From 1ef5ee27f7690104f3e4ef91f6d7788dbd84b797 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 03:03:02 +0000 Subject: [PATCH] SDK regeneration Unable to analyze changes with AI, incrementing PATCH version. --- .fern/metadata.json | 57 - .fernignore | 1 + .npmignore | 10 +- .prettierrc.yml | 2 + CONTRIBUTING.md | 133 - LICENSE | 2 +- README.md | 138 +- biome.json | 74 - changelog.md | 4 + package.json | 20 +- reference.md | 7098 +++++++---------- src/BaseClient.ts | 61 - src/Client.ts | 340 +- src/api/index.ts | 2 +- src/api/resources/applePay/client/Client.ts | 79 +- src/api/resources/applePay/client/index.ts | 1 + .../client/requests/RegisterDomainRequest.ts | 4 +- .../applePay/client/requests/index.ts | 2 +- .../resources/bankAccounts/client/Client.ts | 153 +- .../resources/bankAccounts/client/index.ts | 1 + .../client/requests/GetBankAccountsRequest.ts | 8 +- .../requests/GetByV1IdBankAccountsRequest.ts | 4 +- .../requests/ListBankAccountsRequest.ts | 4 +- .../bankAccounts/client/requests/index.ts | 6 +- src/api/resources/bookings/client/Client.ts | 409 +- src/api/resources/bookings/client/index.ts | 1 + .../requests/BulkRetrieveBookingsRequest.ts | 4 +- ...etrieveTeamMemberBookingProfilesRequest.ts | 4 +- .../client/requests/CancelBookingRequest.ts | 8 +- .../client/requests/CreateBookingRequest.ts | 6 +- .../client/requests/GetBookingsRequest.ts | 8 +- .../client/requests/ListBookingsRequest.ts | 32 +- .../RetrieveLocationBookingProfileRequest.ts | 8 +- .../requests/SearchAvailabilityRequest.ts | 6 +- .../client/requests/UpdateBookingRequest.ts | 10 +- .../bookings/client/requests/index.ts | 18 +- .../client/Client.ts | 219 +- .../client/index.ts | 1 + ...BookingCustomAttributeDefinitionRequest.ts | 6 +- ...DeleteCustomAttributeDefinitionsRequest.ts | 8 +- .../GetCustomAttributeDefinitionsRequest.ts | 4 +- .../ListCustomAttributeDefinitionsRequest.ts | 4 +- ...BookingCustomAttributeDefinitionRequest.ts | 10 +- .../client/requests/index.ts | 10 +- .../customAttributes/client/Client.ts | 252 +- .../customAttributes/client/index.ts | 1 + ...ulkDeleteBookingCustomAttributesRequest.ts | 6 +- ...ulkUpsertBookingCustomAttributesRequest.ts | 6 +- .../requests/DeleteCustomAttributesRequest.ts | 8 +- .../requests/GetCustomAttributesRequest.ts | 8 +- .../requests/ListCustomAttributesRequest.ts | 8 +- .../UpsertBookingCustomAttributeRequest.ts | 10 +- .../customAttributes/client/requests/index.ts | 12 +- src/api/resources/bookings/resources/index.ts | 6 +- .../locationProfiles/client/Client.ts | 87 +- .../locationProfiles/client/index.ts | 1 + .../requests/ListLocationProfilesRequest.ts | 12 +- .../locationProfiles/client/requests/index.ts | 2 +- .../teamMemberProfiles/client/Client.ts | 123 +- .../teamMemberProfiles/client/index.ts | 1 + .../requests/GetTeamMemberProfilesRequest.ts | 8 +- .../requests/ListTeamMemberProfilesRequest.ts | 20 +- .../client/requests/index.ts | 4 +- src/api/resources/cards/client/Client.ts | 187 +- src/api/resources/cards/client/index.ts | 1 + .../client/requests/CreateCardRequest.ts | 6 +- .../client/requests/DisableCardsRequest.ts | 8 +- .../cards/client/requests/GetCardsRequest.ts | 8 +- .../cards/client/requests/ListCardsRequest.ts | 10 +- .../resources/cards/client/requests/index.ts | 8 +- .../resources/cashDrawers/client/Client.ts | 38 +- .../resources/shifts/client/Client.ts | 172 +- .../resources/shifts/client/index.ts | 1 + .../client/requests/GetShiftsRequest.ts | 12 +- .../requests/ListEventsShiftsRequest.ts | 16 +- .../client/requests/ListShiftsRequest.ts | 22 +- .../resources/shifts/client/requests/index.ts | 6 +- src/api/resources/catalog/client/Client.ts | 347 +- src/api/resources/catalog/client/index.ts | 1 + .../BatchDeleteCatalogObjectsRequest.ts | 4 +- .../requests/BatchGetCatalogObjectsRequest.ts | 4 +- .../BatchUpsertCatalogObjectsRequest.ts | 6 +- .../client/requests/ListCatalogRequest.ts | 4 +- .../requests/SearchCatalogItemsRequest.ts | 6 +- .../requests/SearchCatalogObjectsRequest.ts | 6 +- .../UpdateItemModifierListsRequest.ts | 4 +- .../client/requests/UpdateItemTaxesRequest.ts | 4 +- .../catalog/client/requests/index.ts | 16 +- .../catalog/resources/images/client/Client.ts | 119 +- .../catalog/resources/images/client/index.ts | 1 + .../client/requests/CreateImagesRequest.ts | 8 +- .../client/requests/UpdateImagesRequest.ts | 12 +- .../resources/images/client/requests/index.ts | 4 +- src/api/resources/catalog/resources/index.ts | 2 +- .../catalog/resources/object/client/Client.ts | 150 +- .../catalog/resources/object/client/index.ts | 1 + .../client/requests/DeleteObjectRequest.ts | 4 +- .../client/requests/GetObjectRequest.ts | 8 +- .../requests/UpsertCatalogObjectRequest.ts | 6 +- .../resources/object/client/requests/index.ts | 6 +- src/api/resources/channels/client/Client.ts | 325 - src/api/resources/channels/client/index.ts | 1 - .../requests/BulkRetrieveChannelsRequest.ts | 11 - .../client/requests/GetChannelsRequest.ts | 12 - .../client/requests/ListChannelsRequest.ts | 29 - .../channels/client/requests/index.ts | 3 - src/api/resources/channels/index.ts | 1 - src/api/resources/checkout/client/Client.ts | 181 +- src/api/resources/checkout/client/index.ts | 1 + .../RetrieveLocationSettingsRequest.ts | 8 +- .../requests/UpdateLocationSettingsRequest.ts | 10 +- .../requests/UpdateMerchantSettingsRequest.ts | 6 +- .../checkout/client/requests/index.ts | 6 +- .../resources/paymentLinks/client/Client.ts | 213 +- .../resources/paymentLinks/client/index.ts | 1 + .../requests/CreatePaymentLinkRequest.ts | 6 +- .../requests/DeletePaymentLinksRequest.ts | 8 +- .../client/requests/GetPaymentLinksRequest.ts | 8 +- .../requests/ListPaymentLinksRequest.ts | 4 +- .../requests/UpdatePaymentLinkRequest.ts | 10 +- .../paymentLinks/client/requests/index.ts | 10 +- src/api/resources/customers/client/Client.ts | 412 +- src/api/resources/customers/client/index.ts | 1 + .../requests/BulkCreateCustomersRequest.ts | 6 +- .../requests/BulkDeleteCustomersRequest.ts | 4 +- .../requests/BulkRetrieveCustomersRequest.ts | 4 +- .../requests/BulkUpdateCustomersRequest.ts | 6 +- .../client/requests/CreateCustomerRequest.ts | 6 +- .../client/requests/DeleteCustomersRequest.ts | 8 +- .../client/requests/GetCustomersRequest.ts | 8 +- .../client/requests/ListCustomersRequest.ts | 6 +- .../client/requests/SearchCustomersRequest.ts | 6 +- .../client/requests/UpdateCustomerRequest.ts | 10 +- .../customers/client/requests/index.ts | 20 +- .../resources/cards/client/Client.ts | 113 +- .../customers/resources/cards/client/index.ts | 1 + .../requests/CreateCustomerCardRequest.ts | 10 +- .../client/requests/DeleteCardsRequest.ts | 12 +- .../resources/cards/client/requests/index.ts | 4 +- .../client/Client.ts | 249 +- .../client/index.ts | 1 + ...chUpsertCustomerCustomAttributesRequest.ts | 6 +- ...ustomerCustomAttributeDefinitionRequest.ts | 6 +- ...DeleteCustomAttributeDefinitionsRequest.ts | 8 +- .../GetCustomAttributeDefinitionsRequest.ts | 4 +- .../ListCustomAttributeDefinitionsRequest.ts | 4 +- ...ustomerCustomAttributeDefinitionRequest.ts | 10 +- .../client/requests/index.ts | 12 +- .../customAttributes/client/Client.ts | 192 +- .../customAttributes/client/index.ts | 1 + .../requests/DeleteCustomAttributesRequest.ts | 8 +- .../requests/GetCustomAttributesRequest.ts | 8 +- .../requests/ListCustomAttributesRequest.ts | 8 +- .../UpsertCustomerCustomAttributeRequest.ts | 10 +- .../customAttributes/client/requests/index.ts | 8 +- .../resources/groups/client/Client.ts | 277 +- .../resources/groups/client/index.ts | 1 + .../client/requests/AddGroupsRequest.ts | 12 +- .../requests/CreateCustomerGroupRequest.ts | 6 +- .../client/requests/DeleteGroupsRequest.ts | 8 +- .../client/requests/GetGroupsRequest.ts | 8 +- .../client/requests/ListGroupsRequest.ts | 4 +- .../client/requests/RemoveGroupsRequest.ts | 12 +- .../requests/UpdateCustomerGroupRequest.ts | 10 +- .../resources/groups/client/requests/index.ts | 14 +- .../resources/customers/resources/index.ts | 12 +- .../resources/segments/client/Client.ts | 119 +- .../resources/segments/client/index.ts | 1 + .../client/requests/GetSegmentsRequest.ts | 8 +- .../client/requests/ListSegmentsRequest.ts | 4 +- .../segments/client/requests/index.ts | 4 +- src/api/resources/devices/client/Client.ts | 131 +- src/api/resources/devices/client/index.ts | 1 + .../client/requests/GetDevicesRequest.ts | 8 +- .../client/requests/ListDevicesRequest.ts | 14 +- .../devices/client/requests/index.ts | 4 +- .../devices/resources/codes/client/Client.ts | 153 +- .../devices/resources/codes/client/index.ts | 1 + .../requests/CreateDeviceCodeRequest.ts | 6 +- .../codes/client/requests/GetCodesRequest.ts | 8 +- .../codes/client/requests/ListCodesRequest.ts | 6 +- .../resources/codes/client/requests/index.ts | 6 +- src/api/resources/disputes/client/Client.ts | 262 +- src/api/resources/disputes/client/index.ts | 1 + .../client/requests/AcceptDisputesRequest.ts | 8 +- .../CreateDisputeEvidenceTextRequest.ts | 10 +- .../CreateEvidenceFileDisputesRequest.ts | 12 +- .../client/requests/GetDisputesRequest.ts | 8 +- .../client/requests/ListDisputesRequest.ts | 10 +- .../requests/SubmitEvidenceDisputesRequest.ts | 8 +- .../disputes/client/requests/index.ts | 12 +- .../resources/evidence/client/Client.ts | 151 +- .../resources/evidence/client/index.ts | 1 + .../client/requests/DeleteEvidenceRequest.ts | 12 +- .../client/requests/GetEvidenceRequest.ts | 12 +- .../client/requests/ListEvidenceRequest.ts | 8 +- .../evidence/client/requests/index.ts | 6 +- src/api/resources/employees/client/Client.ts | 123 +- src/api/resources/employees/client/index.ts | 1 + .../client/requests/GetEmployeesRequest.ts | 8 +- .../client/requests/ListEmployeesRequest.ts | 22 +- .../employees/client/requests/index.ts | 4 +- src/api/resources/events/client/Client.ts | 174 +- src/api/resources/events/client/index.ts | 1 + .../client/requests/ListEventTypesRequest.ts | 8 +- .../client/requests/SearchEventsRequest.ts | 6 +- .../resources/events/client/requests/index.ts | 4 +- src/api/resources/giftCards/client/Client.ts | 289 +- src/api/resources/giftCards/client/index.ts | 1 + .../client/requests/CreateGiftCardRequest.ts | 6 +- .../requests/GetGiftCardFromGanRequest.ts | 4 +- .../requests/GetGiftCardFromNonceRequest.ts | 4 +- .../client/requests/GetGiftCardsRequest.ts | 8 +- .../requests/LinkCustomerToGiftCardRequest.ts | 8 +- .../client/requests/ListGiftCardsRequest.ts | 8 +- .../UnlinkCustomerFromGiftCardRequest.ts | 8 +- .../giftCards/client/requests/index.ts | 14 +- .../resources/activities/client/Client.ts | 129 +- .../resources/activities/client/index.ts | 1 + .../requests/CreateGiftCardActivityRequest.ts | 6 +- .../client/requests/ListActivitiesRequest.ts | 4 +- .../activities/client/requests/index.ts | 4 +- src/api/resources/index.ts | 78 +- src/api/resources/inventory/client/Client.ts | 475 +- src/api/resources/inventory/client/index.ts | 1 + .../requests/ChangesInventoryRequest.ts | 8 +- ...DeprecatedGetAdjustmentInventoryRequest.ts | 8 +- ...recatedGetPhysicalCountInventoryRequest.ts | 4 +- .../requests/GetAdjustmentInventoryRequest.ts | 8 +- .../client/requests/GetInventoryRequest.ts | 8 +- .../GetPhysicalCountInventoryRequest.ts | 4 +- .../requests/GetTransferInventoryRequest.ts | 8 +- .../inventory/client/requests/index.ts | 14 +- src/api/resources/invoices/client/Client.ts | 381 +- src/api/resources/invoices/client/index.ts | 1 + .../client/requests/CancelInvoiceRequest.ts | 8 +- .../CreateInvoiceAttachmentRequest.ts | 12 +- .../client/requests/CreateInvoiceRequest.ts | 6 +- .../DeleteInvoiceAttachmentRequest.ts | 12 +- .../client/requests/DeleteInvoicesRequest.ts | 8 +- .../client/requests/GetInvoicesRequest.ts | 8 +- .../client/requests/ListInvoicesRequest.ts | 8 +- .../client/requests/PublishInvoiceRequest.ts | 8 +- .../client/requests/SearchInvoicesRequest.ts | 6 +- .../client/requests/UpdateInvoiceRequest.ts | 10 +- .../invoices/client/requests/index.ts | 20 +- src/api/resources/labor/client/Client.ts | 431 +- src/api/resources/labor/client/index.ts | 1 + .../BulkPublishScheduledShiftsRequest.ts | 6 +- .../requests/CreateScheduledShiftRequest.ts | 6 +- .../client/requests/CreateTimecardRequest.ts | 6 +- .../client/requests/DeleteTimecardRequest.ts | 8 +- .../requests/PublishScheduledShiftRequest.ts | 10 +- .../requests/RetrieveScheduledShiftRequest.ts | 8 +- .../requests/RetrieveTimecardRequest.ts | 8 +- .../requests/SearchScheduledShiftsRequest.ts | 6 +- .../client/requests/SearchTimecardsRequest.ts | 6 +- .../requests/UpdateScheduledShiftRequest.ts | 10 +- .../client/requests/UpdateTimecardRequest.ts | 10 +- .../resources/labor/client/requests/index.ts | 22 +- .../resources/breakTypes/client/Client.ts | 215 +- .../resources/breakTypes/client/index.ts | 1 + .../client/requests/CreateBreakTypeRequest.ts | 6 +- .../requests/DeleteBreakTypesRequest.ts | 8 +- .../client/requests/GetBreakTypesRequest.ts | 8 +- .../client/requests/ListBreakTypesRequest.ts | 8 +- .../client/requests/UpdateBreakTypeRequest.ts | 10 +- .../breakTypes/client/requests/index.ts | 10 +- .../resources/employeeWages/client/Client.ts | 121 +- .../resources/employeeWages/client/index.ts | 1 + .../requests/GetEmployeeWagesRequest.ts | 8 +- .../requests/ListEmployeeWagesRequest.ts | 12 +- .../employeeWages/client/requests/index.ts | 4 +- src/api/resources/labor/resources/index.ts | 8 +- .../labor/resources/shifts/client/Client.ts | 205 +- .../labor/resources/shifts/client/index.ts | 1 + .../client/requests/CreateShiftRequest.ts | 6 +- .../client/requests/DeleteShiftsRequest.ts | 8 +- .../client/requests/GetShiftsRequest.ts | 8 +- .../client/requests/SearchShiftsRequest.ts | 6 +- .../client/requests/UpdateShiftRequest.ts | 10 +- .../resources/shifts/client/requests/index.ts | 10 +- .../teamMemberWages/client/Client.ts | 121 +- .../resources/teamMemberWages/client/index.ts | 1 + .../requests/GetTeamMemberWagesRequest.ts | 8 +- .../requests/ListTeamMemberWagesRequest.ts | 8 +- .../teamMemberWages/client/requests/index.ts | 4 +- .../workweekConfigs/client/Client.ts | 119 +- .../resources/workweekConfigs/client/index.ts | 1 + .../requests/ListWorkweekConfigsRequest.ts | 12 +- .../requests/UpdateWorkweekConfigRequest.ts | 10 +- .../workweekConfigs/client/requests/index.ts | 4 +- src/api/resources/locations/client/Client.ts | 231 +- src/api/resources/locations/client/index.ts | 1 + .../client/requests/CreateCheckoutRequest.ts | 10 +- .../client/requests/CreateLocationRequest.ts | 6 +- .../client/requests/GetLocationsRequest.ts | 4 +- .../client/requests/UpdateLocationRequest.ts | 10 +- .../locations/client/requests/index.ts | 8 +- .../client/Client.ts | 221 +- .../client/index.ts | 1 + ...ocationCustomAttributeDefinitionRequest.ts | 6 +- ...DeleteCustomAttributeDefinitionsRequest.ts | 8 +- .../GetCustomAttributeDefinitionsRequest.ts | 4 +- .../ListCustomAttributeDefinitionsRequest.ts | 10 +- ...ocationCustomAttributeDefinitionRequest.ts | 10 +- .../client/requests/index.ts | 10 +- .../customAttributes/client/Client.ts | 254 +- .../customAttributes/client/index.ts | 1 + ...lkDeleteLocationCustomAttributesRequest.ts | 6 +- ...lkUpsertLocationCustomAttributesRequest.ts | 6 +- .../requests/DeleteCustomAttributesRequest.ts | 8 +- .../requests/GetCustomAttributesRequest.ts | 8 +- .../requests/ListCustomAttributesRequest.ts | 14 +- .../UpsertLocationCustomAttributeRequest.ts | 10 +- .../customAttributes/client/requests/index.ts | 12 +- .../resources/locations/resources/index.ts | 4 +- .../resources/transactions/client/Client.ts | 186 +- .../resources/transactions/client/index.ts | 1 + .../requests/CaptureTransactionsRequest.ts | 12 +- .../client/requests/GetTransactionsRequest.ts | 12 +- .../requests/ListTransactionsRequest.ts | 10 +- .../requests/VoidTransactionsRequest.ts | 12 +- .../transactions/client/requests/index.ts | 8 +- src/api/resources/loyalty/client/Client.ts | 103 +- src/api/resources/loyalty/client/index.ts | 1 + .../requests/SearchLoyaltyEventsRequest.ts | 6 +- .../loyalty/client/requests/index.ts | 2 +- .../resources/accounts/client/Client.ts | 205 +- .../resources/accounts/client/index.ts | 1 + .../AccumulateLoyaltyPointsRequest.ts | 10 +- .../requests/AdjustLoyaltyPointsRequest.ts | 10 +- .../requests/CreateLoyaltyAccountRequest.ts | 6 +- .../client/requests/GetAccountsRequest.ts | 8 +- .../requests/SearchLoyaltyAccountsRequest.ts | 6 +- .../accounts/client/requests/index.ts | 10 +- src/api/resources/loyalty/resources/index.ts | 4 +- .../resources/programs/client/Client.ts | 151 +- .../resources/programs/client/index.ts | 1 + .../requests/CalculateLoyaltyPointsRequest.ts | 10 +- .../client/requests/GetProgramsRequest.ts | 8 +- .../programs/client/requests/index.ts | 4 +- .../resources/promotions/client/Client.ts | 187 +- .../resources/promotions/client/index.ts | 1 + .../requests/CancelPromotionsRequest.ts | 8 +- .../requests/CreateLoyaltyPromotionRequest.ts | 6 +- .../client/requests/GetPromotionsRequest.ts | 8 +- .../client/requests/ListPromotionsRequest.ts | 6 +- .../promotions/client/requests/index.ts | 8 +- .../resources/rewards/client/Client.ts | 205 +- .../loyalty/resources/rewards/client/index.ts | 1 + .../requests/CreateLoyaltyRewardRequest.ts | 6 +- .../client/requests/DeleteRewardsRequest.ts | 8 +- .../client/requests/GetRewardsRequest.ts | 8 +- .../requests/RedeemLoyaltyRewardRequest.ts | 8 +- .../requests/SearchLoyaltyRewardsRequest.ts | 6 +- .../rewards/client/requests/index.ts | 10 +- src/api/resources/merchants/client/Client.ts | 133 +- src/api/resources/merchants/client/index.ts | 1 + .../client/requests/GetMerchantsRequest.ts | 4 +- .../client/requests/ListMerchantsRequest.ts | 8 +- .../merchants/client/requests/index.ts | 4 +- .../client/Client.ts | 221 +- .../client/index.ts | 1 + ...erchantCustomAttributeDefinitionRequest.ts | 6 +- ...DeleteCustomAttributeDefinitionsRequest.ts | 8 +- .../GetCustomAttributeDefinitionsRequest.ts | 4 +- .../ListCustomAttributeDefinitionsRequest.ts | 10 +- ...erchantCustomAttributeDefinitionRequest.ts | 10 +- .../client/requests/index.ts | 10 +- .../customAttributes/client/Client.ts | 254 +- .../customAttributes/client/index.ts | 1 + ...lkDeleteMerchantCustomAttributesRequest.ts | 6 +- ...lkUpsertMerchantCustomAttributesRequest.ts | 6 +- .../requests/DeleteCustomAttributesRequest.ts | 8 +- .../requests/GetCustomAttributesRequest.ts | 8 +- .../requests/ListCustomAttributesRequest.ts | 14 +- .../UpsertMerchantCustomAttributeRequest.ts | 10 +- .../customAttributes/client/requests/index.ts | 12 +- .../resources/merchants/resources/index.ts | 2 +- src/api/resources/mobile/client/Client.ts | 79 +- src/api/resources/mobile/client/index.ts | 1 + .../CreateMobileAuthorizationCodeRequest.ts | 4 +- .../resources/mobile/client/requests/index.ts | 2 +- src/api/resources/oAuth/client/Client.ts | 163 +- src/api/resources/oAuth/client/index.ts | 1 + .../client/requests/ObtainTokenRequest.ts | 4 +- .../client/requests/RevokeTokenRequest.ts | 4 +- .../resources/oAuth/client/requests/index.ts | 4 +- src/api/resources/orders/client/Client.ts | 313 +- src/api/resources/orders/client/index.ts | 1 + .../client/requests/BatchGetOrdersRequest.ts | 4 +- .../client/requests/CalculateOrderRequest.ts | 6 +- .../client/requests/CloneOrderRequest.ts | 4 +- .../client/requests/GetOrdersRequest.ts | 8 +- .../orders/client/requests/PayOrderRequest.ts | 8 +- .../client/requests/SearchOrdersRequest.ts | 6 +- .../client/requests/UpdateOrderRequest.ts | 10 +- .../resources/orders/client/requests/index.ts | 14 +- .../client/Client.ts | 218 +- .../client/index.ts | 1 + ...teOrderCustomAttributeDefinitionRequest.ts | 6 +- ...DeleteCustomAttributeDefinitionsRequest.ts | 8 +- .../GetCustomAttributeDefinitionsRequest.ts | 8 +- .../ListCustomAttributeDefinitionsRequest.ts | 10 +- ...teOrderCustomAttributeDefinitionRequest.ts | 10 +- .../client/requests/index.ts | 10 +- .../customAttributes/client/Client.ts | 254 +- .../customAttributes/client/index.ts | 1 + .../BulkDeleteOrderCustomAttributesRequest.ts | 6 +- .../BulkUpsertOrderCustomAttributesRequest.ts | 6 +- .../requests/DeleteCustomAttributesRequest.ts | 8 +- .../requests/GetCustomAttributesRequest.ts | 8 +- .../requests/ListCustomAttributesRequest.ts | 14 +- .../UpsertOrderCustomAttributeRequest.ts | 10 +- .../customAttributes/client/requests/index.ts | 12 +- src/api/resources/orders/resources/index.ts | 2 +- src/api/resources/payments/client/Client.ts | 301 +- src/api/resources/payments/client/index.ts | 1 + .../CancelPaymentByIdempotencyKeyRequest.ts | 4 +- .../client/requests/CancelPaymentsRequest.ts | 8 +- .../client/requests/CompletePaymentRequest.ts | 8 +- .../client/requests/CreatePaymentRequest.ts | 6 +- .../client/requests/GetPaymentsRequest.ts | 8 +- .../client/requests/ListPaymentsRequest.ts | 26 +- .../client/requests/UpdatePaymentRequest.ts | 10 +- .../payments/client/requests/index.ts | 14 +- src/api/resources/payouts/client/Client.ts | 171 +- src/api/resources/payouts/client/index.ts | 1 + .../client/requests/GetPayoutsRequest.ts | 8 +- .../requests/ListEntriesPayoutsRequest.ts | 14 +- .../client/requests/ListPayoutsRequest.ts | 14 +- .../payouts/client/requests/index.ts | 6 +- src/api/resources/refunds/client/Client.ts | 167 +- src/api/resources/refunds/client/index.ts | 1 + .../client/requests/GetRefundsRequest.ts | 8 +- .../client/requests/ListRefundsRequest.ts | 10 +- .../client/requests/RefundPaymentRequest.ts | 6 +- .../refunds/client/requests/index.ts | 6 +- src/api/resources/sites/client/Client.ts | 79 +- src/api/resources/snippets/client/Client.ts | 145 +- src/api/resources/snippets/client/index.ts | 1 + .../client/requests/DeleteSnippetsRequest.ts | 8 +- .../client/requests/GetSnippetsRequest.ts | 8 +- .../client/requests/UpsertSnippetRequest.ts | 10 +- .../snippets/client/requests/index.ts | 6 +- .../resources/subscriptions/client/Client.ts | 438 +- .../resources/subscriptions/client/index.ts | 1 + .../client/requests/BulkSwapPlanRequest.ts | 4 +- .../requests/CancelSubscriptionsRequest.ts | 8 +- .../ChangeBillingAnchorDateRequest.ts | 8 +- .../requests/CreateSubscriptionRequest.ts | 8 +- .../DeleteActionSubscriptionsRequest.ts | 12 +- .../requests/GetSubscriptionsRequest.ts | 8 +- .../ListEventsSubscriptionsRequest.ts | 8 +- .../requests/PauseSubscriptionRequest.ts | 10 +- .../requests/ResumeSubscriptionRequest.ts | 10 +- .../requests/SearchSubscriptionsRequest.ts | 6 +- .../client/requests/SwapPlanRequest.ts | 10 +- .../requests/UpdateSubscriptionRequest.ts | 10 +- .../subscriptions/client/requests/index.ts | 24 +- src/api/resources/team/client/Client.ts | 176 +- src/api/resources/team/client/index.ts | 1 + .../team/client/requests/CreateJobRequest.ts | 6 +- .../team/client/requests/ListJobsRequest.ts | 4 +- .../client/requests/RetrieveJobRequest.ts | 8 +- .../team/client/requests/UpdateJobRequest.ts | 10 +- .../resources/team/client/requests/index.ts | 8 +- .../resources/teamMembers/client/Client.ts | 243 +- src/api/resources/teamMembers/client/index.ts | 1 + .../requests/BatchCreateTeamMembersRequest.ts | 6 +- .../requests/BatchUpdateTeamMembersRequest.ts | 6 +- .../client/requests/GetTeamMembersRequest.ts | 8 +- .../requests/SearchTeamMembersRequest.ts | 6 +- .../requests/UpdateTeamMembersRequest.ts | 10 +- .../teamMembers/client/requests/index.ts | 10 +- .../resources/wageSetting/client/Client.ts | 113 +- .../resources/wageSetting/client/index.ts | 1 + .../client/requests/GetWageSettingRequest.ts | 8 +- .../requests/UpdateWageSettingRequest.ts | 10 +- .../wageSetting/client/requests/index.ts | 4 +- src/api/resources/terminal/client/Client.ts | 169 +- src/api/resources/terminal/client/index.ts | 1 + .../requests/DismissTerminalActionRequest.ts | 8 +- .../DismissTerminalCheckoutRequest.ts | 8 +- .../requests/DismissTerminalRefundRequest.ts | 8 +- .../terminal/client/requests/index.ts | 6 +- .../resources/actions/client/Client.ts | 173 +- .../resources/actions/client/index.ts | 1 + .../client/requests/CancelActionsRequest.ts | 8 +- .../requests/CreateTerminalActionRequest.ts | 6 +- .../client/requests/GetActionsRequest.ts | 8 +- .../requests/SearchTerminalActionsRequest.ts | 6 +- .../actions/client/requests/index.ts | 8 +- .../resources/checkouts/client/Client.ts | 173 +- .../resources/checkouts/client/index.ts | 1 + .../client/requests/CancelCheckoutsRequest.ts | 8 +- .../requests/CreateTerminalCheckoutRequest.ts | 6 +- .../client/requests/GetCheckoutsRequest.ts | 8 +- .../SearchTerminalCheckoutsRequest.ts | 6 +- .../checkouts/client/requests/index.ts | 8 +- src/api/resources/terminal/resources/index.ts | 4 +- .../resources/refunds/client/Client.ts | 173 +- .../resources/refunds/client/index.ts | 1 + .../client/requests/CancelRefundsRequest.ts | 8 +- .../requests/CreateTerminalRefundRequest.ts | 6 +- .../client/requests/GetRefundsRequest.ts | 8 +- .../requests/SearchTerminalRefundsRequest.ts | 6 +- .../refunds/client/requests/index.ts | 8 +- .../resources/transferOrders/client/Client.ts | 908 --- .../resources/transferOrders/client/index.ts | 1 - .../requests/CancelTransferOrderRequest.ts | 21 - .../requests/CreateTransferOrderRequest.ts | 34 - .../requests/DeleteTransferOrdersRequest.ts | 15 - .../requests/GetTransferOrdersRequest.ts | 12 - .../requests/ReceiveTransferOrderRequest.ts | 34 - .../requests/SearchTransferOrdersRequest.ts | 30 - .../requests/StartTransferOrderRequest.ts | 21 - .../requests/UpdateTransferOrderRequest.ts | 39 - .../transferOrders/client/requests/index.ts | 8 - src/api/resources/transferOrders/index.ts | 1 - .../resources/v1Transactions/client/Client.ts | 152 +- .../resources/v1Transactions/client/index.ts | 1 + .../client/requests/V1ListOrdersRequest.ts | 18 +- .../client/requests/V1RetrieveOrderRequest.ts | 12 +- .../client/requests/V1UpdateOrderRequest.ts | 14 +- .../v1Transactions/client/requests/index.ts | 6 +- src/api/resources/vendors/client/Client.ts | 263 +- src/api/resources/vendors/client/index.ts | 1 + .../requests/BatchCreateVendorsRequest.ts | 6 +- .../client/requests/BatchGetVendorsRequest.ts | 4 +- .../requests/BatchUpdateVendorsRequest.ts | 6 +- .../client/requests/CreateVendorRequest.ts | 6 +- .../client/requests/GetVendorsRequest.ts | 8 +- .../client/requests/SearchVendorsRequest.ts | 6 +- .../client/requests/UpdateVendorsRequest.ts | 10 +- .../vendors/client/requests/index.ts | 14 +- src/api/resources/webhooks/client/Client.ts | 46 +- .../resources/eventTypes/client/Client.ts | 82 +- .../resources/eventTypes/client/index.ts | 1 + .../client/requests/ListEventTypesRequest.ts | 8 +- .../eventTypes/client/requests/index.ts | 2 +- src/api/resources/webhooks/resources/index.ts | 2 +- .../resources/subscriptions/client/Client.ts | 281 +- .../resources/subscriptions/client/index.ts | 1 + .../CreateWebhookSubscriptionRequest.ts | 6 +- .../requests/DeleteSubscriptionsRequest.ts | 8 +- .../requests/GetSubscriptionsRequest.ts | 8 +- .../requests/ListSubscriptionsRequest.ts | 6 +- .../TestWebhookSubscriptionRequest.ts | 8 +- .../UpdateWebhookSubscriptionRequest.ts | 10 +- ...eWebhookSubscriptionSignatureKeyRequest.ts | 8 +- .../subscriptions/client/requests/index.ts | 14 +- src/api/types/AcceptDisputeResponse.ts | 6 +- src/api/types/AcceptedPaymentMethods.ts | 4 +- .../types/AccumulateLoyaltyPointsResponse.ts | 6 +- src/api/types/AchDetails.ts | 4 +- src/api/types/ActionCancelReason.ts | 6 +- src/api/types/ActivityType.ts | 64 +- src/api/types/AddGroupToCustomerResponse.ts | 6 +- src/api/types/AdditionalRecipient.ts | 6 +- src/api/types/Address.ts | 6 +- src/api/types/AdjustLoyaltyPointsResponse.ts | 6 +- src/api/types/AfterpayDetails.ts | 4 +- src/api/types/ApplicationDetails.ts | 6 +- ...ApplicationDetailsExternalSquareProduct.ts | 21 +- src/api/types/ApplicationType.ts | 4 +- src/api/types/AppointmentSegment.ts | 4 +- src/api/types/ArchivedState.ts | 6 +- src/api/types/Availability.ts | 6 +- src/api/types/BankAccount.ts | 6 +- src/api/types/BankAccountCreatedEvent.ts | 6 +- src/api/types/BankAccountCreatedEventData.ts | 6 +- .../types/BankAccountCreatedEventObject.ts | 6 +- src/api/types/BankAccountDisabledEvent.ts | 6 +- src/api/types/BankAccountDisabledEventData.ts | 6 +- .../types/BankAccountDisabledEventObject.ts | 6 +- src/api/types/BankAccountPaymentDetails.ts | 6 +- src/api/types/BankAccountStatus.ts | 10 +- src/api/types/BankAccountType.ts | 10 +- src/api/types/BankAccountVerifiedEvent.ts | 6 +- src/api/types/BankAccountVerifiedEventData.ts | 6 +- .../types/BankAccountVerifiedEventObject.ts | 6 +- src/api/types/BatchChangeInventoryRequest.ts | 6 +- src/api/types/BatchChangeInventoryResponse.ts | 6 +- .../types/BatchCreateTeamMembersResponse.ts | 6 +- src/api/types/BatchCreateVendorsResponse.ts | 6 +- .../BatchDeleteCatalogObjectsResponse.ts | 6 +- .../types/BatchGetCatalogObjectsResponse.ts | 6 +- .../types/BatchGetInventoryChangesResponse.ts | 6 +- .../types/BatchGetInventoryCountsRequest.ts | 6 +- .../types/BatchGetInventoryCountsResponse.ts | 6 +- src/api/types/BatchGetOrdersResponse.ts | 6 +- src/api/types/BatchGetVendorsResponse.ts | 6 +- .../BatchRetrieveInventoryChangesRequest.ts | 6 +- .../types/BatchUpdateTeamMembersResponse.ts | 6 +- src/api/types/BatchUpdateVendorsResponse.ts | 6 +- .../BatchUpsertCatalogObjectsResponse.ts | 6 +- ...estCustomerCustomAttributeUpsertRequest.ts | 6 +- ...hUpsertCustomerCustomAttributesResponse.ts | 6 +- ...seCustomerCustomAttributeUpsertResponse.ts | 6 +- src/api/types/Booking.ts | 6 +- src/api/types/BookingBookingSource.ts | 10 +- src/api/types/BookingCreatedEvent.ts | 6 +- src/api/types/BookingCreatedEventData.ts | 6 +- src/api/types/BookingCreatedEventObject.ts | 6 +- src/api/types/BookingCreatorDetails.ts | 6 +- .../types/BookingCreatorDetailsCreatorType.ts | 11 +- ...tomAttributeDefinitionOwnedCreatedEvent.ts | 6 +- ...tomAttributeDefinitionOwnedDeletedEvent.ts | 6 +- ...tomAttributeDefinitionOwnedUpdatedEvent.ts | 6 +- ...mAttributeDefinitionVisibleCreatedEvent.ts | 6 +- ...mAttributeDefinitionVisibleDeletedEvent.ts | 6 +- ...mAttributeDefinitionVisibleUpdatedEvent.ts | 6 +- .../BookingCustomAttributeDeleteRequest.ts | 4 +- .../BookingCustomAttributeDeleteResponse.ts | 6 +- ...BookingCustomAttributeOwnedDeletedEvent.ts | 6 +- ...BookingCustomAttributeOwnedUpdatedEvent.ts | 6 +- .../BookingCustomAttributeUpsertRequest.ts | 6 +- .../BookingCustomAttributeUpsertResponse.ts | 6 +- ...okingCustomAttributeVisibleDeletedEvent.ts | 6 +- ...okingCustomAttributeVisibleUpdatedEvent.ts | 6 +- src/api/types/BookingStatus.ts | 16 +- src/api/types/BookingUpdatedEvent.ts | 6 +- src/api/types/BookingUpdatedEventData.ts | 6 +- src/api/types/BookingUpdatedEventObject.ts | 6 +- src/api/types/Break.ts | 4 +- src/api/types/BreakType.ts | 4 +- src/api/types/BulkCreateCustomerData.ts | 6 +- src/api/types/BulkCreateCustomersResponse.ts | 6 +- ...lkDeleteBookingCustomAttributesResponse.ts | 6 +- src/api/types/BulkDeleteCustomersResponse.ts | 6 +- ...estLocationCustomAttributeDeleteRequest.ts | 4 +- ...kDeleteLocationCustomAttributesResponse.ts | 6 +- ...seLocationCustomAttributeDeleteResponse.ts | 6 +- ...estMerchantCustomAttributeDeleteRequest.ts | 4 +- ...kDeleteMerchantCustomAttributesResponse.ts | 6 +- ...seMerchantCustomAttributeDeleteResponse.ts | 6 +- ...mAttributesRequestDeleteCustomAttribute.ts | 4 +- ...BulkDeleteOrderCustomAttributesResponse.ts | 6 +- .../types/BulkPublishScheduledShiftsData.ts | 4 +- .../BulkPublishScheduledShiftsResponse.ts | 6 +- src/api/types/BulkRetrieveBookingsResponse.ts | 6 +- .../BulkRetrieveChannelsRequestConstants.ts | 3 - src/api/types/BulkRetrieveChannelsResponse.ts | 19 - .../types/BulkRetrieveCustomersResponse.ts | 6 +- ...trieveTeamMemberBookingProfilesResponse.ts | 6 +- src/api/types/BulkSwapPlanResponse.ts | 6 +- src/api/types/BulkUpdateCustomerData.ts | 6 +- src/api/types/BulkUpdateCustomersResponse.ts | 6 +- ...lkUpsertBookingCustomAttributesResponse.ts | 6 +- ...estLocationCustomAttributeUpsertRequest.ts | 6 +- ...kUpsertLocationCustomAttributesResponse.ts | 6 +- ...seLocationCustomAttributeUpsertResponse.ts | 6 +- ...estMerchantCustomAttributeUpsertRequest.ts | 6 +- ...kUpsertMerchantCustomAttributesResponse.ts | 6 +- ...seMerchantCustomAttributeUpsertResponse.ts | 6 +- ...mAttributesRequestUpsertCustomAttribute.ts | 6 +- ...BulkUpsertOrderCustomAttributesResponse.ts | 6 +- src/api/types/BusinessAppointmentSettings.ts | 6 +- ...usinessAppointmentSettingsAlignmentTime.ts | 11 +- ...sAppointmentSettingsBookingLocationType.ts | 11 +- ...ssAppointmentSettingsCancellationPolicy.ts | 11 +- ...tSettingsMaxAppointmentsPerDayLimitType.ts | 11 +- src/api/types/BusinessBookingProfile.ts | 6 +- .../BusinessBookingProfileBookingPolicy.ts | 11 +- ...essBookingProfileCustomerTimezoneChoice.ts | 11 +- src/api/types/BusinessHours.ts | 6 +- src/api/types/BusinessHoursPeriod.ts | 6 +- src/api/types/BuyNowPayLaterDetails.ts | 6 +- .../types/CalculateLoyaltyPointsResponse.ts | 6 +- src/api/types/CalculateOrderResponse.ts | 6 +- src/api/types/CancelBookingResponse.ts | 6 +- src/api/types/CancelInvoiceResponse.ts | 6 +- .../types/CancelLoyaltyPromotionResponse.ts | 6 +- .../CancelPaymentByIdempotencyKeyResponse.ts | 6 +- src/api/types/CancelPaymentResponse.ts | 6 +- src/api/types/CancelSubscriptionResponse.ts | 6 +- src/api/types/CancelTerminalActionResponse.ts | 6 +- .../types/CancelTerminalCheckoutResponse.ts | 6 +- src/api/types/CancelTerminalRefundResponse.ts | 6 +- src/api/types/CancelTransferOrderResponse.ts | 13 - src/api/types/CaptureTransactionResponse.ts | 6 +- src/api/types/Card.ts | 6 +- .../types/CardAutomaticallyUpdatedEvent.ts | 6 +- .../CardAutomaticallyUpdatedEventData.ts | 6 +- .../CardAutomaticallyUpdatedEventObject.ts | 6 +- src/api/types/CardBrand.ts | 24 +- src/api/types/CardCoBrand.ts | 10 +- src/api/types/CardCreatedEvent.ts | 6 +- src/api/types/CardCreatedEventData.ts | 6 +- src/api/types/CardCreatedEventObject.ts | 6 +- src/api/types/CardDisabledEvent.ts | 6 +- src/api/types/CardDisabledEventData.ts | 6 +- src/api/types/CardDisabledEventObject.ts | 6 +- src/api/types/CardForgottenEvent.ts | 6 +- src/api/types/CardForgottenEventCard.ts | 4 +- src/api/types/CardForgottenEventData.ts | 6 +- src/api/types/CardForgottenEventObject.ts | 6 +- src/api/types/CardIssuerAlert.ts | 4 +- src/api/types/CardPaymentDetails.ts | 32 +- src/api/types/CardPaymentTimeline.ts | 4 +- src/api/types/CardPrepaidType.ts | 10 +- src/api/types/CardType.ts | 10 +- src/api/types/CardUpdatedEvent.ts | 6 +- src/api/types/CardUpdatedEventData.ts | 6 +- src/api/types/CardUpdatedEventObject.ts | 6 +- src/api/types/CashAppDetails.ts | 4 +- src/api/types/CashDrawerDevice.ts | 4 +- src/api/types/CashDrawerEventType.ts | 15 +- src/api/types/CashDrawerShift.ts | 6 +- src/api/types/CashDrawerShiftEvent.ts | 6 +- src/api/types/CashDrawerShiftState.ts | 10 +- src/api/types/CashDrawerShiftSummary.ts | 6 +- src/api/types/CashPaymentDetails.ts | 6 +- src/api/types/CatalogAvailabilityPeriod.ts | 6 +- src/api/types/CatalogCategory.ts | 6 +- src/api/types/CatalogCategoryType.ts | 10 +- .../types/CatalogCustomAttributeDefinition.ts | 6 +- ...gCustomAttributeDefinitionAppVisibility.ts | 10 +- ...ogCustomAttributeDefinitionNumberConfig.ts | 4 +- ...ustomAttributeDefinitionSelectionConfig.ts | 6 +- ...SelectionConfigCustomAttributeSelection.ts | 4 +- ...stomAttributeDefinitionSellerVisibility.ts | 9 +- ...ogCustomAttributeDefinitionStringConfig.ts | 4 +- .../CatalogCustomAttributeDefinitionType.ts | 11 +- src/api/types/CatalogCustomAttributeValue.ts | 6 +- src/api/types/CatalogDiscount.ts | 6 +- .../types/CatalogDiscountModifyTaxBasis.ts | 7 +- src/api/types/CatalogDiscountType.ts | 10 +- src/api/types/CatalogEcomSeoData.ts | 4 +- src/api/types/CatalogIdMapping.ts | 4 +- src/api/types/CatalogImage.ts | 4 +- src/api/types/CatalogInfoResponse.ts | 6 +- src/api/types/CatalogInfoResponseLimits.ts | 4 +- src/api/types/CatalogItem.ts | 6 +- .../CatalogItemFoodAndBeverageDetails.ts | 6 +- ...FoodAndBeverageDetailsDietaryPreference.ts | 6 +- ...taryPreferenceStandardDietaryPreference.ts | 18 +- ...AndBeverageDetailsDietaryPreferenceType.ts | 11 +- ...logItemFoodAndBeverageDetailsIngredient.ts | 6 +- ...rageDetailsIngredientStandardIngredient.ts | 25 +- src/api/types/CatalogItemModifierListInfo.ts | 6 +- src/api/types/CatalogItemOption.ts | 6 +- src/api/types/CatalogItemOptionForItem.ts | 4 +- src/api/types/CatalogItemOptionValue.ts | 4 +- .../CatalogItemOptionValueForItemVariation.ts | 4 +- src/api/types/CatalogItemProductType.ts | 19 +- src/api/types/CatalogItemVariation.ts | 6 +- src/api/types/CatalogMeasurementUnit.ts | 6 +- src/api/types/CatalogModifier.ts | 6 +- src/api/types/CatalogModifierList.ts | 6 +- .../types/CatalogModifierListModifierType.ts | 11 +- .../types/CatalogModifierListSelectionType.ts | 11 +- src/api/types/CatalogModifierOverride.ts | 4 +- src/api/types/CatalogObject.ts | 39 +- .../types/CatalogObjectAvailabilityPeriod.ts | 6 +- src/api/types/CatalogObjectBase.ts | 6 +- src/api/types/CatalogObjectBatch.ts | 6 +- src/api/types/CatalogObjectCategory.ts | 6 +- .../CatalogObjectCustomAttributeDefinition.ts | 6 +- src/api/types/CatalogObjectDiscount.ts | 6 +- src/api/types/CatalogObjectImage.ts | 6 +- src/api/types/CatalogObjectItem.ts | 6 +- src/api/types/CatalogObjectItemOption.ts | 6 +- src/api/types/CatalogObjectItemOptionValue.ts | 6 +- src/api/types/CatalogObjectItemVariation.ts | 6 +- src/api/types/CatalogObjectMeasurementUnit.ts | 6 +- src/api/types/CatalogObjectModifier.ts | 6 +- src/api/types/CatalogObjectModifierList.ts | 6 +- src/api/types/CatalogObjectPricingRule.ts | 6 +- src/api/types/CatalogObjectProductSet.ts | 6 +- .../CatalogObjectQuickAmountsSettings.ts | 6 +- src/api/types/CatalogObjectReference.ts | 4 +- .../types/CatalogObjectSubscriptionPlan.ts | 6 +- .../CatalogObjectSubscriptionPlanVariation.ts | 6 +- src/api/types/CatalogObjectTax.ts | 6 +- src/api/types/CatalogObjectTimePeriod.ts | 6 +- src/api/types/CatalogObjectType.ts | 25 +- src/api/types/CatalogPricingRule.ts | 6 +- src/api/types/CatalogPricingType.ts | 10 +- src/api/types/CatalogProductSet.ts | 4 +- src/api/types/CatalogQuery.ts | 6 +- src/api/types/CatalogQueryExact.ts | 4 +- ...gQueryItemVariationsForItemOptionValues.ts | 4 +- .../types/CatalogQueryItemsForItemOptions.ts | 4 +- .../types/CatalogQueryItemsForModifierList.ts | 4 +- src/api/types/CatalogQueryItemsForTax.ts | 4 +- src/api/types/CatalogQueryPrefix.ts | 4 +- src/api/types/CatalogQueryRange.ts | 4 +- src/api/types/CatalogQuerySet.ts | 4 +- src/api/types/CatalogQuerySortedAttribute.ts | 6 +- src/api/types/CatalogQueryText.ts | 4 +- src/api/types/CatalogQuickAmount.ts | 6 +- src/api/types/CatalogQuickAmountType.ts | 10 +- src/api/types/CatalogQuickAmountsSettings.ts | 6 +- .../CatalogQuickAmountsSettingsOption.ts | 11 +- src/api/types/CatalogStockConversion.ts | 4 +- src/api/types/CatalogSubscriptionPlan.ts | 6 +- .../types/CatalogSubscriptionPlanVariation.ts | 6 +- src/api/types/CatalogTax.ts | 6 +- src/api/types/CatalogTimePeriod.ts | 4 +- src/api/types/CatalogV1Id.ts | 4 +- src/api/types/CatalogVersionUpdatedEvent.ts | 6 +- ...atalogVersionUpdatedEventCatalogVersion.ts | 4 +- .../types/CatalogVersionUpdatedEventData.ts | 6 +- .../types/CatalogVersionUpdatedEventObject.ts | 6 +- src/api/types/CategoryPathToRootNode.ts | 4 +- .../types/ChangeBillingAnchorDateResponse.ts | 6 +- src/api/types/ChangeTiming.ts | 10 +- src/api/types/Channel.ts | 31 - src/api/types/ChannelStatus.ts | 7 - .../types/ChargeRequestAdditionalRecipient.ts | 6 +- src/api/types/Checkout.ts | 6 +- src/api/types/CheckoutLocationSettings.ts | 6 +- .../types/CheckoutLocationSettingsBranding.ts | 6 +- ...koutLocationSettingsBrandingButtonShape.ts | 7 +- ...ckoutLocationSettingsBrandingHeaderType.ts | 7 +- .../types/CheckoutLocationSettingsCoupons.ts | 4 +- .../types/CheckoutLocationSettingsPolicy.ts | 4 +- .../types/CheckoutLocationSettingsTipping.ts | 6 +- src/api/types/CheckoutMerchantSettings.ts | 6 +- .../CheckoutMerchantSettingsPaymentMethods.ts | 6 +- ...tSettingsPaymentMethodsAfterpayClearpay.ts | 6 +- ...MethodsAfterpayClearpayEligibilityRange.ts | 6 +- ...hantSettingsPaymentMethodsPaymentMethod.ts | 4 +- src/api/types/CheckoutOptions.ts | 6 +- src/api/types/CheckoutOptionsPaymentType.ts | 14 +- src/api/types/ClearpayDetails.ts | 4 +- src/api/types/CloneOrderResponse.ts | 6 +- src/api/types/CollectedData.ts | 4 +- src/api/types/CompletePaymentResponse.ts | 6 +- src/api/types/Component.ts | 6 +- src/api/types/ComponentComponentType.ts | 10 +- src/api/types/ConfirmationDecision.ts | 4 +- src/api/types/ConfirmationOptions.ts | 6 +- src/api/types/Coordinates.ts | 4 +- src/api/types/Country.ts | 256 +- ...ookingCustomAttributeDefinitionResponse.ts | 6 +- src/api/types/CreateBookingResponse.ts | 6 +- src/api/types/CreateBreakTypeResponse.ts | 6 +- src/api/types/CreateCardResponse.ts | 6 +- src/api/types/CreateCatalogImageRequest.ts | 6 +- src/api/types/CreateCatalogImageResponse.ts | 6 +- src/api/types/CreateCheckoutResponse.ts | 6 +- src/api/types/CreateCustomerCardResponse.ts | 6 +- ...stomerCustomAttributeDefinitionResponse.ts | 6 +- src/api/types/CreateCustomerGroupResponse.ts | 6 +- src/api/types/CreateCustomerResponse.ts | 6 +- src/api/types/CreateDeviceCodeResponse.ts | 6 +- .../types/CreateDisputeEvidenceFileRequest.ts | 6 +- .../CreateDisputeEvidenceFileResponse.ts | 6 +- .../CreateDisputeEvidenceTextResponse.ts | 6 +- .../types/CreateGiftCardActivityResponse.ts | 6 +- src/api/types/CreateGiftCardResponse.ts | 6 +- .../CreateInvoiceAttachmentRequestData.ts | 4 +- .../types/CreateInvoiceAttachmentResponse.ts | 6 +- src/api/types/CreateInvoiceResponse.ts | 6 +- src/api/types/CreateJobResponse.ts | 6 +- ...cationCustomAttributeDefinitionResponse.ts | 6 +- src/api/types/CreateLocationResponse.ts | 6 +- src/api/types/CreateLoyaltyAccountResponse.ts | 6 +- .../types/CreateLoyaltyPromotionResponse.ts | 6 +- src/api/types/CreateLoyaltyRewardResponse.ts | 6 +- ...rchantCustomAttributeDefinitionResponse.ts | 6 +- .../CreateMobileAuthorizationCodeResponse.ts | 6 +- ...eOrderCustomAttributeDefinitionResponse.ts | 6 +- src/api/types/CreateOrderRequest.ts | 6 +- src/api/types/CreateOrderResponse.ts | 6 +- src/api/types/CreatePaymentLinkResponse.ts | 6 +- src/api/types/CreatePaymentResponse.ts | 6 +- src/api/types/CreateScheduledShiftResponse.ts | 6 +- src/api/types/CreateShiftResponse.ts | 6 +- src/api/types/CreateSubscriptionResponse.ts | 6 +- src/api/types/CreateTeamMemberRequest.ts | 6 +- src/api/types/CreateTeamMemberResponse.ts | 6 +- src/api/types/CreateTerminalActionResponse.ts | 6 +- .../types/CreateTerminalCheckoutResponse.ts | 6 +- src/api/types/CreateTerminalRefundResponse.ts | 6 +- src/api/types/CreateTimecardResponse.ts | 6 +- src/api/types/CreateTransferOrderData.ts | 34 - src/api/types/CreateTransferOrderLineData.ts | 18 - src/api/types/CreateTransferOrderResponse.ts | 13 - src/api/types/CreateVendorResponse.ts | 6 +- .../CreateWebhookSubscriptionResponse.ts | 6 +- src/api/types/Currency.ts | 189 +- src/api/types/CustomAttribute.ts | 6 +- src/api/types/CustomAttributeDefinition.ts | 6 +- .../CustomAttributeDefinitionEventData.ts | 6 +- ...ustomAttributeDefinitionEventDataObject.ts | 6 +- .../CustomAttributeDefinitionVisibility.ts | 10 +- src/api/types/CustomAttributeEventData.ts | 6 +- .../types/CustomAttributeEventDataObject.ts | 6 +- src/api/types/CustomAttributeFilter.ts | 6 +- src/api/types/CustomField.ts | 4 +- src/api/types/Customer.ts | 6 +- src/api/types/CustomerAddressFilter.ts | 6 +- src/api/types/CustomerCreatedEvent.ts | 6 +- src/api/types/CustomerCreatedEventData.ts | 6 +- .../types/CustomerCreatedEventEventContext.ts | 6 +- .../CustomerCreatedEventEventContextMerge.ts | 4 +- src/api/types/CustomerCreatedEventObject.ts | 6 +- src/api/types/CustomerCreationSource.ts | 29 +- src/api/types/CustomerCreationSourceFilter.ts | 6 +- ...erCustomAttributeDefinitionCreatedEvent.ts | 6 +- ...omAttributeDefinitionCreatedPublicEvent.ts | 6 +- ...erCustomAttributeDefinitionDeletedEvent.ts | 6 +- ...omAttributeDefinitionDeletedPublicEvent.ts | 6 +- ...tomAttributeDefinitionOwnedCreatedEvent.ts | 6 +- ...tomAttributeDefinitionOwnedDeletedEvent.ts | 6 +- ...tomAttributeDefinitionOwnedUpdatedEvent.ts | 6 +- ...erCustomAttributeDefinitionUpdatedEvent.ts | 6 +- ...omAttributeDefinitionUpdatedPublicEvent.ts | 6 +- ...mAttributeDefinitionVisibleCreatedEvent.ts | 6 +- ...mAttributeDefinitionVisibleDeletedEvent.ts | 6 +- ...mAttributeDefinitionVisibleUpdatedEvent.ts | 6 +- .../CustomerCustomAttributeDeletedEvent.ts | 6 +- ...stomerCustomAttributeDeletedPublicEvent.ts | 6 +- .../types/CustomerCustomAttributeFilter.ts | 6 +- .../CustomerCustomAttributeFilterValue.ts | 6 +- .../types/CustomerCustomAttributeFilters.ts | 6 +- ...ustomerCustomAttributeOwnedDeletedEvent.ts | 6 +- ...ustomerCustomAttributeOwnedUpdatedEvent.ts | 6 +- .../CustomerCustomAttributeUpdatedEvent.ts | 6 +- ...stomerCustomAttributeUpdatedPublicEvent.ts | 6 +- ...tomerCustomAttributeVisibleDeletedEvent.ts | 6 +- ...tomerCustomAttributeVisibleUpdatedEvent.ts | 6 +- src/api/types/CustomerDeletedEvent.ts | 6 +- src/api/types/CustomerDeletedEventData.ts | 6 +- .../types/CustomerDeletedEventEventContext.ts | 6 +- .../CustomerDeletedEventEventContextMerge.ts | 4 +- src/api/types/CustomerDeletedEventObject.ts | 6 +- src/api/types/CustomerDetails.ts | 4 +- src/api/types/CustomerFilter.ts | 6 +- src/api/types/CustomerGroup.ts | 4 +- src/api/types/CustomerInclusionExclusion.ts | 6 +- src/api/types/CustomerPreferences.ts | 4 +- src/api/types/CustomerQuery.ts | 6 +- src/api/types/CustomerSegment.ts | 4 +- src/api/types/CustomerSort.ts | 6 +- src/api/types/CustomerSortField.ts | 10 +- src/api/types/CustomerTaxIds.ts | 4 +- src/api/types/CustomerTextFilter.ts | 4 +- src/api/types/CustomerUpdatedEvent.ts | 6 +- src/api/types/CustomerUpdatedEventData.ts | 6 +- src/api/types/CustomerUpdatedEventObject.ts | 6 +- src/api/types/DataCollectionOptions.ts | 6 +- .../types/DataCollectionOptionsInputType.ts | 11 +- src/api/types/DateRange.ts | 4 +- src/api/types/DayOfWeek.ts | 10 +- ...ookingCustomAttributeDefinitionResponse.ts | 6 +- .../DeleteBookingCustomAttributeResponse.ts | 6 +- src/api/types/DeleteBreakTypeResponse.ts | 6 +- src/api/types/DeleteCatalogObjectResponse.ts | 6 +- src/api/types/DeleteCustomerCardResponse.ts | 6 +- ...stomerCustomAttributeDefinitionResponse.ts | 6 +- .../DeleteCustomerCustomAttributeResponse.ts | 6 +- src/api/types/DeleteCustomerGroupResponse.ts | 6 +- src/api/types/DeleteCustomerResponse.ts | 6 +- .../types/DeleteDisputeEvidenceResponse.ts | 6 +- .../types/DeleteInvoiceAttachmentResponse.ts | 6 +- src/api/types/DeleteInvoiceResponse.ts | 6 +- ...cationCustomAttributeDefinitionResponse.ts | 6 +- .../DeleteLocationCustomAttributeResponse.ts | 6 +- src/api/types/DeleteLoyaltyRewardResponse.ts | 6 +- ...rchantCustomAttributeDefinitionResponse.ts | 6 +- .../DeleteMerchantCustomAttributeResponse.ts | 6 +- ...eOrderCustomAttributeDefinitionResponse.ts | 6 +- .../DeleteOrderCustomAttributeResponse.ts | 6 +- src/api/types/DeletePaymentLinkResponse.ts | 6 +- src/api/types/DeleteShiftResponse.ts | 6 +- src/api/types/DeleteSnippetResponse.ts | 6 +- .../types/DeleteSubscriptionActionResponse.ts | 6 +- src/api/types/DeleteTimecardResponse.ts | 6 +- src/api/types/DeleteTransferOrderResponse.ts | 11 - .../DeleteWebhookSubscriptionResponse.ts | 6 +- src/api/types/Destination.ts | 6 +- src/api/types/DestinationDetails.ts | 6 +- .../DestinationDetailsCardRefundDetails.ts | 6 +- .../DestinationDetailsCashRefundDetails.ts | 6 +- ...DestinationDetailsExternalRefundDetails.ts | 4 +- src/api/types/DestinationType.ts | 10 +- src/api/types/Device.ts | 6 +- src/api/types/DeviceAttributes.ts | 6 +- src/api/types/DeviceAttributesDeviceType.ts | 14 +- src/api/types/DeviceCheckoutOptions.ts | 6 +- src/api/types/DeviceCode.ts | 6 +- src/api/types/DeviceCodePairedEvent.ts | 6 +- src/api/types/DeviceCodePairedEventData.ts | 6 +- src/api/types/DeviceCodePairedEventObject.ts | 6 +- src/api/types/DeviceCodeStatus.ts | 10 +- ...eviceComponentDetailsApplicationDetails.ts | 6 +- .../DeviceComponentDetailsBatteryDetails.ts | 6 +- ...DeviceComponentDetailsCardReaderDetails.ts | 4 +- .../DeviceComponentDetailsEthernetDetails.ts | 6 +- .../DeviceComponentDetailsExternalPower.ts | 15 +- .../DeviceComponentDetailsMeasurement.ts | 5 +- .../DeviceComponentDetailsWiFiDetails.ts | 8 +- src/api/types/DeviceCreatedEvent.ts | 6 +- src/api/types/DeviceCreatedEventData.ts | 6 +- src/api/types/DeviceCreatedEventObject.ts | 6 +- src/api/types/DeviceDetails.ts | 4 +- src/api/types/DeviceMetadata.ts | 4 +- src/api/types/DeviceStatus.ts | 7 +- src/api/types/DeviceStatusCategory.ts | 6 +- src/api/types/DigitalWalletDetails.ts | 6 +- src/api/types/DisableCardResponse.ts | 6 +- src/api/types/DisableEventsResponse.ts | 6 +- .../types/DismissTerminalActionResponse.ts | 6 +- .../types/DismissTerminalCheckoutResponse.ts | 6 +- .../types/DismissTerminalRefundResponse.ts | 6 +- src/api/types/Dispute.ts | 6 +- src/api/types/DisputeCreatedEvent.ts | 6 +- src/api/types/DisputeCreatedEventData.ts | 6 +- src/api/types/DisputeCreatedEventObject.ts | 6 +- src/api/types/DisputeEvidence.ts | 6 +- src/api/types/DisputeEvidenceAddedEvent.ts | 6 +- .../types/DisputeEvidenceAddedEventData.ts | 6 +- .../types/DisputeEvidenceAddedEventObject.ts | 6 +- src/api/types/DisputeEvidenceCreatedEvent.ts | 6 +- .../types/DisputeEvidenceCreatedEventData.ts | 6 +- .../DisputeEvidenceCreatedEventObject.ts | 6 +- src/api/types/DisputeEvidenceDeletedEvent.ts | 6 +- .../types/DisputeEvidenceDeletedEventData.ts | 6 +- .../DisputeEvidenceDeletedEventObject.ts | 6 +- src/api/types/DisputeEvidenceFile.ts | 4 +- src/api/types/DisputeEvidenceRemovedEvent.ts | 6 +- .../types/DisputeEvidenceRemovedEventData.ts | 6 +- .../DisputeEvidenceRemovedEventObject.ts | 6 +- src/api/types/DisputeEvidenceType.ts | 25 +- src/api/types/DisputeReason.ts | 15 +- src/api/types/DisputeState.ts | 18 +- src/api/types/DisputeStateChangedEvent.ts | 6 +- src/api/types/DisputeStateChangedEventData.ts | 6 +- .../types/DisputeStateChangedEventObject.ts | 6 +- src/api/types/DisputeStateUpdatedEvent.ts | 6 +- src/api/types/DisputeStateUpdatedEventData.ts | 6 +- .../types/DisputeStateUpdatedEventObject.ts | 6 +- src/api/types/DisputedPayment.ts | 4 +- src/api/types/EcomVisibility.ts | 10 +- src/api/types/Employee.ts | 6 +- src/api/types/EmployeeStatus.ts | 6 +- src/api/types/EmployeeWage.ts | 6 +- src/api/types/EnableEventsResponse.ts | 6 +- src/api/types/ErrorCategory.ts | 14 +- src/api/types/ErrorCode.ts | 159 +- src/api/types/Error_.ts | 6 +- src/api/types/Event.ts | 6 +- src/api/types/EventData.ts | 4 +- src/api/types/EventMetadata.ts | 4 +- src/api/types/EventTypeMetadata.ts | 4 +- src/api/types/ExcludeStrategy.ts | 6 +- src/api/types/ExternalPaymentDetails.ts | 6 +- src/api/types/FilterValue.ts | 4 +- src/api/types/FloatNumberRange.ts | 4 +- src/api/types/Fulfillment.ts | 6 +- src/api/types/FulfillmentDeliveryDetails.ts | 6 +- ...rFulfillmentDeliveryDetailsScheduleType.ts | 11 +- src/api/types/FulfillmentFulfillmentEntry.ts | 4 +- ...lfillmentFulfillmentLineItemApplication.ts | 7 +- src/api/types/FulfillmentPickupDetails.ts | 6 +- ...lmentPickupDetailsCurbsidePickupDetails.ts | 4 +- .../FulfillmentPickupDetailsScheduleType.ts | 11 +- src/api/types/FulfillmentRecipient.ts | 6 +- src/api/types/FulfillmentShipmentDetails.ts | 6 +- src/api/types/FulfillmentState.ts | 10 +- src/api/types/FulfillmentType.ts | 10 +- src/api/types/GetBankAccountByV1IdResponse.ts | 6 +- src/api/types/GetBankAccountResponse.ts | 6 +- src/api/types/GetBookingRequest.ts | 4 +- src/api/types/GetBookingResponse.ts | 6 +- src/api/types/GetBreakTypeResponse.ts | 6 +- .../types/GetBusinessBookingProfileRequest.ts | 4 +- .../GetBusinessBookingProfileResponse.ts | 6 +- src/api/types/GetCardRequest.ts | 4 +- src/api/types/GetCardResponse.ts | 6 +- src/api/types/GetCashDrawerShiftResponse.ts | 6 +- src/api/types/GetCatalogObjectResponse.ts | 6 +- ...stomerCustomAttributeDefinitionResponse.ts | 6 +- .../GetCustomerCustomAttributeResponse.ts | 6 +- src/api/types/GetCustomerGroupRequest.ts | 4 +- src/api/types/GetCustomerGroupResponse.ts | 6 +- src/api/types/GetCustomerRequest.ts | 4 +- src/api/types/GetCustomerResponse.ts | 6 +- src/api/types/GetCustomerSegmentRequest.ts | 4 +- src/api/types/GetCustomerSegmentResponse.ts | 6 +- src/api/types/GetDeviceCodeResponse.ts | 6 +- src/api/types/GetDeviceResponse.ts | 6 +- src/api/types/GetDisputeEvidenceRequest.ts | 4 +- src/api/types/GetDisputeEvidenceResponse.ts | 6 +- src/api/types/GetDisputeRequest.ts | 4 +- src/api/types/GetDisputeResponse.ts | 6 +- src/api/types/GetEmployeeRequest.ts | 4 +- src/api/types/GetEmployeeResponse.ts | 6 +- src/api/types/GetEmployeeWageResponse.ts | 6 +- src/api/types/GetGiftCardFromGanResponse.ts | 6 +- src/api/types/GetGiftCardFromNonceResponse.ts | 6 +- src/api/types/GetGiftCardRequest.ts | 4 +- src/api/types/GetGiftCardResponse.ts | 6 +- .../types/GetInventoryAdjustmentRequest.ts | 4 +- .../types/GetInventoryAdjustmentResponse.ts | 6 +- src/api/types/GetInventoryChangesResponse.ts | 6 +- src/api/types/GetInventoryCountResponse.ts | 6 +- .../types/GetInventoryPhysicalCountRequest.ts | 4 +- .../GetInventoryPhysicalCountResponse.ts | 6 +- src/api/types/GetInventoryTransferRequest.ts | 4 +- src/api/types/GetInventoryTransferResponse.ts | 6 +- src/api/types/GetInvoiceResponse.ts | 6 +- src/api/types/GetLocationRequest.ts | 4 +- src/api/types/GetLocationResponse.ts | 6 +- src/api/types/GetLoyaltyAccountRequest.ts | 4 +- src/api/types/GetLoyaltyAccountResponse.ts | 6 +- src/api/types/GetLoyaltyProgramRequest.ts | 4 +- src/api/types/GetLoyaltyProgramResponse.ts | 6 +- src/api/types/GetLoyaltyPromotionRequest.ts | 4 +- src/api/types/GetLoyaltyPromotionResponse.ts | 6 +- src/api/types/GetLoyaltyRewardRequest.ts | 4 +- src/api/types/GetLoyaltyRewardResponse.ts | 6 +- src/api/types/GetMerchantRequest.ts | 4 +- src/api/types/GetMerchantResponse.ts | 6 +- src/api/types/GetOrderRequest.ts | 4 +- src/api/types/GetOrderResponse.ts | 6 +- src/api/types/GetPaymentLinkRequest.ts | 4 +- src/api/types/GetPaymentLinkResponse.ts | 6 +- src/api/types/GetPaymentRefundResponse.ts | 6 +- src/api/types/GetPaymentResponse.ts | 6 +- src/api/types/GetPayoutResponse.ts | 6 +- src/api/types/GetShiftResponse.ts | 6 +- src/api/types/GetSnippetRequest.ts | 4 +- src/api/types/GetSnippetResponse.ts | 6 +- src/api/types/GetSubscriptionResponse.ts | 6 +- .../GetTeamMemberBookingProfileRequest.ts | 4 +- .../GetTeamMemberBookingProfileResponse.ts | 6 +- src/api/types/GetTeamMemberRequest.ts | 4 +- src/api/types/GetTeamMemberResponse.ts | 6 +- src/api/types/GetTeamMemberWageResponse.ts | 6 +- src/api/types/GetTerminalActionResponse.ts | 6 +- src/api/types/GetTerminalCheckoutResponse.ts | 6 +- src/api/types/GetTerminalRefundResponse.ts | 6 +- src/api/types/GetTransactionRequest.ts | 4 +- src/api/types/GetTransactionResponse.ts | 6 +- src/api/types/GetVendorRequest.ts | 4 +- src/api/types/GetVendorResponse.ts | 6 +- src/api/types/GetWageSettingRequest.ts | 4 +- src/api/types/GetWageSettingResponse.ts | 6 +- .../types/GetWebhookSubscriptionRequest.ts | 4 +- .../types/GetWebhookSubscriptionResponse.ts | 6 +- src/api/types/GiftCard.ts | 6 +- src/api/types/GiftCardActivity.ts | 6 +- src/api/types/GiftCardActivityActivate.ts | 6 +- .../types/GiftCardActivityAdjustDecrement.ts | 6 +- .../GiftCardActivityAdjustDecrementReason.ts | 15 +- .../types/GiftCardActivityAdjustIncrement.ts | 6 +- .../GiftCardActivityAdjustIncrementReason.ts | 11 +- src/api/types/GiftCardActivityBlock.ts | 6 +- src/api/types/GiftCardActivityBlockReason.ts | 4 +- src/api/types/GiftCardActivityClearBalance.ts | 6 +- .../GiftCardActivityClearBalanceReason.ts | 11 +- src/api/types/GiftCardActivityCreatedEvent.ts | 6 +- .../types/GiftCardActivityCreatedEventData.ts | 6 +- .../GiftCardActivityCreatedEventObject.ts | 6 +- src/api/types/GiftCardActivityDeactivate.ts | 6 +- .../types/GiftCardActivityDeactivateReason.ts | 11 +- src/api/types/GiftCardActivityImport.ts | 6 +- .../types/GiftCardActivityImportReversal.ts | 6 +- src/api/types/GiftCardActivityLoad.ts | 6 +- src/api/types/GiftCardActivityRedeem.ts | 6 +- src/api/types/GiftCardActivityRedeemStatus.ts | 7 +- src/api/types/GiftCardActivityRefund.ts | 6 +- .../GiftCardActivityTransferBalanceFrom.ts | 6 +- .../GiftCardActivityTransferBalanceTo.ts | 6 +- src/api/types/GiftCardActivityType.ts | 25 +- src/api/types/GiftCardActivityUnblock.ts | 6 +- .../types/GiftCardActivityUnblockReason.ts | 4 +- .../GiftCardActivityUnlinkedActivityRefund.ts | 6 +- src/api/types/GiftCardActivityUpdatedEvent.ts | 6 +- .../types/GiftCardActivityUpdatedEventData.ts | 6 +- .../GiftCardActivityUpdatedEventObject.ts | 6 +- src/api/types/GiftCardCreatedEvent.ts | 6 +- src/api/types/GiftCardCreatedEventData.ts | 6 +- src/api/types/GiftCardCreatedEventObject.ts | 6 +- src/api/types/GiftCardCustomerLinkedEvent.ts | 6 +- .../types/GiftCardCustomerLinkedEventData.ts | 6 +- .../GiftCardCustomerLinkedEventObject.ts | 6 +- .../types/GiftCardCustomerUnlinkedEvent.ts | 6 +- .../GiftCardCustomerUnlinkedEventData.ts | 6 +- .../GiftCardCustomerUnlinkedEventObject.ts | 6 +- src/api/types/GiftCardGanSource.ts | 6 +- src/api/types/GiftCardStatus.ts | 10 +- src/api/types/GiftCardType.ts | 10 +- src/api/types/GiftCardUpdatedEvent.ts | 6 +- src/api/types/GiftCardUpdatedEventData.ts | 6 +- src/api/types/GiftCardUpdatedEventObject.ts | 6 +- src/api/types/InventoryAdjustment.ts | 6 +- src/api/types/InventoryAdjustmentGroup.ts | 6 +- src/api/types/InventoryAlertType.ts | 10 +- src/api/types/InventoryChange.ts | 6 +- src/api/types/InventoryChangeType.ts | 10 +- src/api/types/InventoryCount.ts | 6 +- src/api/types/InventoryCountUpdatedEvent.ts | 6 +- .../types/InventoryCountUpdatedEventData.ts | 6 +- .../types/InventoryCountUpdatedEventObject.ts | 6 +- src/api/types/InventoryPhysicalCount.ts | 6 +- src/api/types/InventoryState.ts | 26 +- src/api/types/InventoryTransfer.ts | 6 +- src/api/types/Invoice.ts | 6 +- .../types/InvoiceAcceptedPaymentMethods.ts | 4 +- src/api/types/InvoiceAttachment.ts | 4 +- .../types/InvoiceAutomaticPaymentSource.ts | 11 +- src/api/types/InvoiceCanceledEvent.ts | 6 +- src/api/types/InvoiceCanceledEventData.ts | 6 +- src/api/types/InvoiceCanceledEventObject.ts | 6 +- src/api/types/InvoiceCreatedEvent.ts | 6 +- src/api/types/InvoiceCreatedEventData.ts | 6 +- src/api/types/InvoiceCreatedEventObject.ts | 6 +- src/api/types/InvoiceCustomField.ts | 6 +- src/api/types/InvoiceCustomFieldPlacement.ts | 7 +- src/api/types/InvoiceDeletedEvent.ts | 6 +- src/api/types/InvoiceDeletedEventData.ts | 4 +- src/api/types/InvoiceDeliveryMethod.ts | 10 +- src/api/types/InvoiceFilter.ts | 4 +- src/api/types/InvoicePaymentMadeEvent.ts | 6 +- src/api/types/InvoicePaymentMadeEventData.ts | 6 +- .../types/InvoicePaymentMadeEventObject.ts | 6 +- src/api/types/InvoicePaymentReminder.ts | 6 +- src/api/types/InvoicePaymentReminderStatus.ts | 11 +- src/api/types/InvoicePaymentRequest.ts | 6 +- src/api/types/InvoicePublishedEvent.ts | 6 +- src/api/types/InvoicePublishedEventData.ts | 6 +- src/api/types/InvoicePublishedEventObject.ts | 6 +- src/api/types/InvoiceQuery.ts | 6 +- src/api/types/InvoiceRecipient.ts | 6 +- src/api/types/InvoiceRecipientTaxIds.ts | 4 +- src/api/types/InvoiceRefundedEvent.ts | 6 +- src/api/types/InvoiceRefundedEventData.ts | 6 +- src/api/types/InvoiceRefundedEventObject.ts | 6 +- src/api/types/InvoiceRequestMethod.ts | 13 +- src/api/types/InvoiceRequestType.ts | 6 +- .../InvoiceScheduledChargeFailedEvent.ts | 6 +- .../InvoiceScheduledChargeFailedEventData.ts | 6 +- ...InvoiceScheduledChargeFailedEventObject.ts | 6 +- src/api/types/InvoiceSort.ts | 6 +- src/api/types/InvoiceSortField.ts | 4 +- src/api/types/InvoiceStatus.ts | 20 +- src/api/types/InvoiceUpdatedEvent.ts | 6 +- src/api/types/InvoiceUpdatedEventData.ts | 6 +- src/api/types/InvoiceUpdatedEventObject.ts | 6 +- .../types/ItemVariationLocationOverrides.ts | 6 +- src/api/types/Job.ts | 4 +- src/api/types/JobAssignment.ts | 6 +- src/api/types/JobAssignmentPayType.ts | 10 +- src/api/types/JobCreatedEvent.ts | 6 +- src/api/types/JobCreatedEventData.ts | 6 +- src/api/types/JobCreatedEventObject.ts | 6 +- src/api/types/JobUpdatedEvent.ts | 6 +- src/api/types/JobUpdatedEventData.ts | 6 +- src/api/types/JobUpdatedEventObject.ts | 6 +- .../types/LaborScheduledShiftCreatedEvent.ts | 6 +- .../LaborScheduledShiftCreatedEventData.ts | 6 +- .../LaborScheduledShiftCreatedEventObject.ts | 6 +- .../types/LaborScheduledShiftDeletedEvent.ts | 6 +- .../LaborScheduledShiftDeletedEventData.ts | 4 +- .../LaborScheduledShiftPublishedEvent.ts | 6 +- .../LaborScheduledShiftPublishedEventData.ts | 6 +- ...LaborScheduledShiftPublishedEventObject.ts | 6 +- .../types/LaborScheduledShiftUpdatedEvent.ts | 6 +- .../LaborScheduledShiftUpdatedEventData.ts | 6 +- .../LaborScheduledShiftUpdatedEventObject.ts | 6 +- src/api/types/LaborShiftCreatedEvent.ts | 6 +- src/api/types/LaborShiftCreatedEventData.ts | 6 +- src/api/types/LaborShiftCreatedEventObject.ts | 6 +- src/api/types/LaborShiftDeletedEvent.ts | 6 +- src/api/types/LaborShiftDeletedEventData.ts | 4 +- src/api/types/LaborShiftUpdatedEvent.ts | 6 +- src/api/types/LaborShiftUpdatedEventData.ts | 6 +- src/api/types/LaborShiftUpdatedEventObject.ts | 6 +- src/api/types/LaborTimecardCreatedEvent.ts | 6 +- .../types/LaborTimecardCreatedEventData.ts | 6 +- .../types/LaborTimecardCreatedEventObject.ts | 6 +- src/api/types/LaborTimecardDeletedEvent.ts | 6 +- .../types/LaborTimecardDeletedEventData.ts | 4 +- src/api/types/LaborTimecardUpdatedEvent.ts | 6 +- .../types/LaborTimecardUpdatedEventData.ts | 6 +- .../types/LaborTimecardUpdatedEventObject.ts | 6 +- .../types/LinkCustomerToGiftCardResponse.ts | 6 +- src/api/types/ListBankAccountsResponse.ts | 6 +- ...okingCustomAttributeDefinitionsResponse.ts | 6 +- .../ListBookingCustomAttributesResponse.ts | 6 +- src/api/types/ListBookingsResponse.ts | 6 +- src/api/types/ListBreakTypesResponse.ts | 6 +- src/api/types/ListCardsResponse.ts | 6 +- .../ListCashDrawerShiftEventsResponse.ts | 6 +- src/api/types/ListCashDrawerShiftsResponse.ts | 6 +- src/api/types/ListCatalogResponse.ts | 6 +- src/api/types/ListChannelsRequestConstants.ts | 3 - src/api/types/ListChannelsResponse.ts | 12 - ...tomerCustomAttributeDefinitionsResponse.ts | 6 +- .../ListCustomerCustomAttributesResponse.ts | 6 +- src/api/types/ListCustomerGroupsResponse.ts | 6 +- src/api/types/ListCustomerSegmentsResponse.ts | 6 +- src/api/types/ListCustomersResponse.ts | 6 +- src/api/types/ListDeviceCodesResponse.ts | 6 +- src/api/types/ListDevicesResponse.ts | 6 +- src/api/types/ListDisputeEvidenceResponse.ts | 6 +- src/api/types/ListDisputesResponse.ts | 6 +- src/api/types/ListEmployeeWagesResponse.ts | 6 +- src/api/types/ListEmployeesResponse.ts | 6 +- src/api/types/ListEventTypesResponse.ts | 6 +- .../types/ListGiftCardActivitiesResponse.ts | 6 +- src/api/types/ListGiftCardsResponse.ts | 6 +- src/api/types/ListInvoicesResponse.ts | 6 +- src/api/types/ListJobsResponse.ts | 6 +- .../ListLocationBookingProfilesResponse.ts | 6 +- ...ationCustomAttributeDefinitionsResponse.ts | 6 +- .../ListLocationCustomAttributesResponse.ts | 6 +- src/api/types/ListLocationsResponse.ts | 6 +- src/api/types/ListLoyaltyProgramsResponse.ts | 6 +- .../types/ListLoyaltyPromotionsResponse.ts | 6 +- ...chantCustomAttributeDefinitionsResponse.ts | 6 +- .../ListMerchantCustomAttributesResponse.ts | 6 +- src/api/types/ListMerchantsResponse.ts | 6 +- ...OrderCustomAttributeDefinitionsResponse.ts | 6 +- .../ListOrderCustomAttributesResponse.ts | 6 +- src/api/types/ListPaymentLinksResponse.ts | 6 +- .../ListPaymentRefundsRequestSortField.ts | 7 +- src/api/types/ListPaymentRefundsResponse.ts | 6 +- src/api/types/ListPaymentsRequestSortField.ts | 7 +- src/api/types/ListPaymentsResponse.ts | 6 +- src/api/types/ListPayoutEntriesResponse.ts | 6 +- src/api/types/ListPayoutsResponse.ts | 6 +- src/api/types/ListSitesResponse.ts | 6 +- .../types/ListSubscriptionEventsResponse.ts | 6 +- .../ListTeamMemberBookingProfilesResponse.ts | 6 +- src/api/types/ListTeamMemberWagesResponse.ts | 6 +- src/api/types/ListTransactionsResponse.ts | 6 +- .../types/ListWebhookEventTypesResponse.ts | 6 +- .../types/ListWebhookSubscriptionsResponse.ts | 6 +- src/api/types/ListWorkweekConfigsResponse.ts | 6 +- src/api/types/Location.ts | 6 +- src/api/types/LocationBookingProfile.ts | 4 +- src/api/types/LocationCapability.ts | 10 +- src/api/types/LocationCreatedEvent.ts | 6 +- src/api/types/LocationCreatedEventData.ts | 4 +- ...tomAttributeDefinitionOwnedCreatedEvent.ts | 6 +- ...tomAttributeDefinitionOwnedDeletedEvent.ts | 6 +- ...tomAttributeDefinitionOwnedUpdatedEvent.ts | 6 +- ...mAttributeDefinitionVisibleCreatedEvent.ts | 6 +- ...mAttributeDefinitionVisibleDeletedEvent.ts | 6 +- ...mAttributeDefinitionVisibleUpdatedEvent.ts | 6 +- ...ocationCustomAttributeOwnedDeletedEvent.ts | 6 +- ...ocationCustomAttributeOwnedUpdatedEvent.ts | 6 +- ...ationCustomAttributeVisibleDeletedEvent.ts | 6 +- ...ationCustomAttributeVisibleUpdatedEvent.ts | 6 +- src/api/types/LocationSettingsUpdatedEvent.ts | 6 +- .../types/LocationSettingsUpdatedEventData.ts | 6 +- .../LocationSettingsUpdatedEventObject.ts | 6 +- src/api/types/LocationStatus.ts | 10 +- src/api/types/LocationType.ts | 10 +- src/api/types/LocationUpdatedEvent.ts | 6 +- src/api/types/LocationUpdatedEventData.ts | 4 +- src/api/types/LoyaltyAccount.ts | 13 +- src/api/types/LoyaltyAccountCreatedEvent.ts | 6 +- .../types/LoyaltyAccountCreatedEventData.ts | 6 +- .../types/LoyaltyAccountCreatedEventObject.ts | 6 +- src/api/types/LoyaltyAccountDeletedEvent.ts | 6 +- .../types/LoyaltyAccountDeletedEventData.ts | 6 +- .../types/LoyaltyAccountDeletedEventObject.ts | 6 +- .../LoyaltyAccountExpiringPointDeadline.ts | 4 +- src/api/types/LoyaltyAccountMapping.ts | 4 +- src/api/types/LoyaltyAccountMappingType.ts | 4 +- src/api/types/LoyaltyAccountUpdatedEvent.ts | 6 +- .../types/LoyaltyAccountUpdatedEventData.ts | 6 +- .../types/LoyaltyAccountUpdatedEventObject.ts | 6 +- src/api/types/LoyaltyEvent.ts | 6 +- src/api/types/LoyaltyEventAccumulatePoints.ts | 4 +- .../LoyaltyEventAccumulatePromotionPoints.ts | 4 +- src/api/types/LoyaltyEventAdjustPoints.ts | 4 +- src/api/types/LoyaltyEventCreateReward.ts | 4 +- src/api/types/LoyaltyEventCreatedEvent.ts | 6 +- src/api/types/LoyaltyEventCreatedEventData.ts | 6 +- .../types/LoyaltyEventCreatedEventObject.ts | 6 +- src/api/types/LoyaltyEventDateTimeFilter.ts | 6 +- src/api/types/LoyaltyEventDeleteReward.ts | 4 +- src/api/types/LoyaltyEventExpirePoints.ts | 4 +- src/api/types/LoyaltyEventFilter.ts | 6 +- src/api/types/LoyaltyEventLocationFilter.ts | 4 +- .../types/LoyaltyEventLoyaltyAccountFilter.ts | 4 +- src/api/types/LoyaltyEventOrderFilter.ts | 4 +- src/api/types/LoyaltyEventOther.ts | 4 +- src/api/types/LoyaltyEventQuery.ts | 6 +- src/api/types/LoyaltyEventRedeemReward.ts | 4 +- src/api/types/LoyaltyEventSource.ts | 10 +- src/api/types/LoyaltyEventType.ts | 18 +- src/api/types/LoyaltyEventTypeFilter.ts | 6 +- src/api/types/LoyaltyProgram.ts | 6 +- src/api/types/LoyaltyProgramAccrualRule.ts | 6 +- .../LoyaltyProgramAccrualRuleCategoryData.ts | 4 +- ...altyProgramAccrualRuleItemVariationData.ts | 4 +- .../LoyaltyProgramAccrualRuleSpendData.ts | 6 +- .../types/LoyaltyProgramAccrualRuleTaxMode.ts | 7 +- .../types/LoyaltyProgramAccrualRuleType.ts | 11 +- .../LoyaltyProgramAccrualRuleVisitData.ts | 6 +- src/api/types/LoyaltyProgramCreatedEvent.ts | 6 +- .../types/LoyaltyProgramCreatedEventData.ts | 6 +- .../types/LoyaltyProgramCreatedEventObject.ts | 6 +- .../types/LoyaltyProgramExpirationPolicy.ts | 4 +- src/api/types/LoyaltyProgramRewardTier.ts | 6 +- src/api/types/LoyaltyProgramStatus.ts | 10 +- src/api/types/LoyaltyProgramTerminology.ts | 4 +- src/api/types/LoyaltyProgramUpdatedEvent.ts | 6 +- .../types/LoyaltyProgramUpdatedEventData.ts | 6 +- .../types/LoyaltyProgramUpdatedEventObject.ts | 6 +- src/api/types/LoyaltyPromotion.ts | 6 +- .../LoyaltyPromotionAvailableTimeData.ts | 4 +- src/api/types/LoyaltyPromotionCreatedEvent.ts | 6 +- .../types/LoyaltyPromotionCreatedEventData.ts | 6 +- .../LoyaltyPromotionCreatedEventObject.ts | 6 +- src/api/types/LoyaltyPromotionIncentive.ts | 6 +- ...ltyPromotionIncentivePointsAdditionData.ts | 4 +- ...yPromotionIncentivePointsMultiplierData.ts | 4 +- .../types/LoyaltyPromotionIncentiveType.ts | 7 +- src/api/types/LoyaltyPromotionStatus.ts | 10 +- src/api/types/LoyaltyPromotionTriggerLimit.ts | 6 +- .../LoyaltyPromotionTriggerLimitInterval.ts | 7 +- src/api/types/LoyaltyPromotionUpdatedEvent.ts | 6 +- .../types/LoyaltyPromotionUpdatedEventData.ts | 6 +- .../LoyaltyPromotionUpdatedEventObject.ts | 6 +- src/api/types/LoyaltyReward.ts | 6 +- src/api/types/LoyaltyRewardStatus.ts | 10 +- src/api/types/MeasurementUnit.ts | 6 +- src/api/types/MeasurementUnitArea.ts | 18 +- src/api/types/MeasurementUnitCustom.ts | 4 +- src/api/types/MeasurementUnitGeneric.ts | 4 +- src/api/types/MeasurementUnitLength.ts | 18 +- src/api/types/MeasurementUnitTime.ts | 15 +- src/api/types/MeasurementUnitUnitType.ts | 16 +- src/api/types/MeasurementUnitVolume.ts | 21 +- src/api/types/MeasurementUnitWeight.ts | 16 +- src/api/types/Merchant.ts | 6 +- ...tomAttributeDefinitionOwnedCreatedEvent.ts | 6 +- ...tomAttributeDefinitionOwnedDeletedEvent.ts | 6 +- ...tomAttributeDefinitionOwnedUpdatedEvent.ts | 6 +- ...mAttributeDefinitionVisibleCreatedEvent.ts | 6 +- ...mAttributeDefinitionVisibleDeletedEvent.ts | 6 +- ...mAttributeDefinitionVisibleUpdatedEvent.ts | 6 +- ...erchantCustomAttributeOwnedDeletedEvent.ts | 6 +- ...erchantCustomAttributeOwnedUpdatedEvent.ts | 6 +- ...chantCustomAttributeVisibleDeletedEvent.ts | 6 +- ...chantCustomAttributeVisibleUpdatedEvent.ts | 6 +- src/api/types/MerchantSettingsUpdatedEvent.ts | 6 +- .../types/MerchantSettingsUpdatedEventData.ts | 6 +- .../MerchantSettingsUpdatedEventObject.ts | 6 +- src/api/types/MerchantStatus.ts | 6 +- src/api/types/ModifierLocationOverrides.ts | 6 +- src/api/types/Money.ts | 6 +- .../types/OauthAuthorizationRevokedEvent.ts | 6 +- .../OauthAuthorizationRevokedEventData.ts | 6 +- .../OauthAuthorizationRevokedEventObject.ts | 6 +- ...thorizationRevokedEventRevocationObject.ts | 6 +- ...uthAuthorizationRevokedEventRevokerType.ts | 11 +- src/api/types/ObtainTokenResponse.ts | 6 +- src/api/types/OfflinePaymentDetails.ts | 4 +- src/api/types/Order.ts | 6 +- src/api/types/OrderCreated.ts | 6 +- src/api/types/OrderCreatedEvent.ts | 6 +- src/api/types/OrderCreatedEventData.ts | 6 +- src/api/types/OrderCreatedObject.ts | 6 +- ...tomAttributeDefinitionOwnedCreatedEvent.ts | 6 +- ...tomAttributeDefinitionOwnedDeletedEvent.ts | 6 +- ...tomAttributeDefinitionOwnedUpdatedEvent.ts | 6 +- ...mAttributeDefinitionVisibleCreatedEvent.ts | 6 +- ...mAttributeDefinitionVisibleDeletedEvent.ts | 6 +- ...mAttributeDefinitionVisibleUpdatedEvent.ts | 6 +- .../OrderCustomAttributeOwnedDeletedEvent.ts | 6 +- .../OrderCustomAttributeOwnedUpdatedEvent.ts | 6 +- ...OrderCustomAttributeVisibleDeletedEvent.ts | 6 +- ...OrderCustomAttributeVisibleUpdatedEvent.ts | 6 +- src/api/types/OrderEntry.ts | 4 +- ...rFulfillmentDeliveryDetailsScheduleType.ts | 11 +- ...lfillmentFulfillmentLineItemApplication.ts | 7 +- ...derFulfillmentPickupDetailsScheduleType.ts | 11 +- src/api/types/OrderFulfillmentState.ts | 10 +- src/api/types/OrderFulfillmentType.ts | 10 +- src/api/types/OrderFulfillmentUpdated.ts | 6 +- src/api/types/OrderFulfillmentUpdatedEvent.ts | 6 +- .../types/OrderFulfillmentUpdatedEventData.ts | 6 +- .../types/OrderFulfillmentUpdatedObject.ts | 6 +- .../types/OrderFulfillmentUpdatedUpdate.ts | 6 +- src/api/types/OrderLineItem.ts | 6 +- src/api/types/OrderLineItemAppliedDiscount.ts | 6 +- .../OrderLineItemAppliedServiceCharge.ts | 6 +- src/api/types/OrderLineItemAppliedTax.ts | 6 +- src/api/types/OrderLineItemDiscount.ts | 6 +- src/api/types/OrderLineItemDiscountScope.ts | 10 +- src/api/types/OrderLineItemDiscountType.ts | 15 +- src/api/types/OrderLineItemItemType.ts | 10 +- src/api/types/OrderLineItemModifier.ts | 6 +- .../types/OrderLineItemPricingBlocklists.ts | 6 +- ...ineItemPricingBlocklistsBlockedDiscount.ts | 4 +- ...rderLineItemPricingBlocklistsBlockedTax.ts | 4 +- src/api/types/OrderLineItemTax.ts | 6 +- src/api/types/OrderLineItemTaxScope.ts | 10 +- src/api/types/OrderLineItemTaxType.ts | 10 +- src/api/types/OrderMoneyAmounts.ts | 6 +- src/api/types/OrderPricingOptions.ts | 4 +- src/api/types/OrderQuantityUnit.ts | 6 +- src/api/types/OrderReturn.ts | 6 +- src/api/types/OrderReturnDiscount.ts | 6 +- src/api/types/OrderReturnLineItem.ts | 6 +- src/api/types/OrderReturnLineItemModifier.ts | 6 +- src/api/types/OrderReturnServiceCharge.ts | 6 +- src/api/types/OrderReturnTax.ts | 6 +- src/api/types/OrderReturnTip.ts | 6 +- src/api/types/OrderReward.ts | 4 +- src/api/types/OrderRoundingAdjustment.ts | 6 +- src/api/types/OrderServiceCharge.ts | 6 +- .../OrderServiceChargeCalculationPhase.ts | 11 +- src/api/types/OrderServiceChargeScope.ts | 6 +- .../types/OrderServiceChargeTreatmentType.ts | 7 +- src/api/types/OrderServiceChargeType.ts | 6 +- src/api/types/OrderSource.ts | 4 +- src/api/types/OrderState.ts | 10 +- src/api/types/OrderUpdated.ts | 6 +- src/api/types/OrderUpdatedEvent.ts | 6 +- src/api/types/OrderUpdatedEventData.ts | 6 +- src/api/types/OrderUpdatedObject.ts | 6 +- src/api/types/PauseSubscriptionResponse.ts | 6 +- src/api/types/PayOrderResponse.ts | 6 +- src/api/types/Payment.ts | 10 +- ...aymentBalanceActivityAppFeeRefundDetail.ts | 4 +- ...ymentBalanceActivityAppFeeRevenueDetail.ts | 4 +- ...ntBalanceActivityAutomaticSavingsDetail.ts | 4 +- ...eActivityAutomaticSavingsReversedDetail.ts | 4 +- .../PaymentBalanceActivityChargeDetail.ts | 4 +- .../PaymentBalanceActivityDepositFeeDetail.ts | 4 +- ...BalanceActivityDepositFeeReversedDetail.ts | 4 +- .../PaymentBalanceActivityDisputeDetail.ts | 4 +- .../types/PaymentBalanceActivityFeeDetail.ts | 4 +- ...mentBalanceActivityFreeProcessingDetail.ts | 4 +- ...mentBalanceActivityHoldAdjustmentDetail.ts | 4 +- ...PaymentBalanceActivityOpenDisputeDetail.ts | 4 +- ...entBalanceActivityOtherAdjustmentDetail.ts | 4 +- .../PaymentBalanceActivityOtherDetail.ts | 4 +- .../PaymentBalanceActivityRefundDetail.ts | 4 +- ...tBalanceActivityReleaseAdjustmentDetail.ts | 4 +- ...PaymentBalanceActivityReserveHoldDetail.ts | 4 +- ...mentBalanceActivityReserveReleaseDetail.ts | 4 +- ...lanceActivitySquareCapitalPaymentDetail.ts | 4 +- ...ivitySquareCapitalReversedPaymentDetail.ts | 4 +- ...anceActivitySquarePayrollTransferDetail.ts | 4 +- ...vitySquarePayrollTransferReversedDetail.ts | 4 +- .../PaymentBalanceActivityTaxOnFeeDetail.ts | 4 +- ...ymentBalanceActivityThirdPartyFeeDetail.ts | 4 +- ...alanceActivityThirdPartyFeeRefundDetail.ts | 4 +- src/api/types/PaymentCreatedEvent.ts | 6 +- src/api/types/PaymentCreatedEventData.ts | 6 +- src/api/types/PaymentCreatedEventObject.ts | 6 +- src/api/types/PaymentLink.ts | 6 +- src/api/types/PaymentLinkRelatedResources.ts | 6 +- src/api/types/PaymentOptions.ts | 6 +- src/api/types/PaymentOptionsDelayAction.ts | 6 +- src/api/types/PaymentRefund.ts | 6 +- src/api/types/PaymentUpdatedEvent.ts | 6 +- src/api/types/PaymentUpdatedEventData.ts | 6 +- src/api/types/PaymentUpdatedEventObject.ts | 6 +- src/api/types/Payout.ts | 6 +- src/api/types/PayoutEntry.ts | 6 +- src/api/types/PayoutFailedEvent.ts | 6 +- src/api/types/PayoutFailedEventData.ts | 6 +- src/api/types/PayoutFailedEventObject.ts | 6 +- src/api/types/PayoutFee.ts | 6 +- src/api/types/PayoutFeeType.ts | 10 +- src/api/types/PayoutPaidEvent.ts | 6 +- src/api/types/PayoutPaidEventData.ts | 6 +- src/api/types/PayoutPaidEventObject.ts | 6 +- src/api/types/PayoutSentEvent.ts | 6 +- src/api/types/PayoutSentEventData.ts | 6 +- src/api/types/PayoutSentEventObject.ts | 6 +- src/api/types/PayoutStatus.ts | 10 +- src/api/types/PayoutType.ts | 6 +- src/api/types/Phase.ts | 4 +- src/api/types/PhaseInput.ts | 4 +- src/api/types/PrePopulatedData.ts | 6 +- src/api/types/ProcessingFee.ts | 6 +- src/api/types/Product.ts | 20 +- src/api/types/ProductType.ts | 4 +- src/api/types/PublishInvoiceResponse.ts | 6 +- .../types/PublishScheduledShiftResponse.ts | 6 +- src/api/types/QrCodeOptions.ts | 4 +- src/api/types/QuickPay.ts | 6 +- src/api/types/Range.ts | 4 +- src/api/types/ReceiptOptions.ts | 4 +- src/api/types/ReceiveTransferOrderResponse.ts | 13 - src/api/types/RedeemLoyaltyRewardResponse.ts | 6 +- src/api/types/Reference.ts | 13 - src/api/types/ReferenceType.ts | 21 - src/api/types/Refund.ts | 6 +- src/api/types/RefundCreatedEvent.ts | 6 +- src/api/types/RefundCreatedEventData.ts | 6 +- src/api/types/RefundCreatedEventObject.ts | 6 +- src/api/types/RefundPaymentResponse.ts | 6 +- src/api/types/RefundStatus.ts | 10 +- src/api/types/RefundUpdatedEvent.ts | 6 +- src/api/types/RefundUpdatedEventData.ts | 6 +- src/api/types/RefundUpdatedEventObject.ts | 6 +- src/api/types/RegisterDomainResponse.ts | 6 +- src/api/types/RegisterDomainResponseStatus.ts | 11 +- .../types/RemoveGroupFromCustomerResponse.ts | 6 +- src/api/types/ResumeSubscriptionResponse.ts | 6 +- ...ookingCustomAttributeDefinitionResponse.ts | 6 +- .../RetrieveBookingCustomAttributeResponse.ts | 6 +- src/api/types/RetrieveChannelResponse.ts | 10 - src/api/types/RetrieveJobResponse.ts | 6 +- .../RetrieveLocationBookingProfileResponse.ts | 6 +- ...cationCustomAttributeDefinitionResponse.ts | 6 +- ...RetrieveLocationCustomAttributeResponse.ts | 6 +- .../types/RetrieveLocationSettingsResponse.ts | 6 +- ...rchantCustomAttributeDefinitionResponse.ts | 6 +- ...RetrieveMerchantCustomAttributeResponse.ts | 6 +- .../types/RetrieveMerchantSettingsResponse.ts | 6 +- ...eOrderCustomAttributeDefinitionResponse.ts | 6 +- .../RetrieveOrderCustomAttributeResponse.ts | 6 +- .../types/RetrieveScheduledShiftResponse.ts | 6 +- src/api/types/RetrieveTimecardResponse.ts | 6 +- src/api/types/RetrieveTokenStatusResponse.ts | 6 +- .../types/RetrieveTransferOrderResponse.ts | 13 - src/api/types/RevokeTokenResponse.ts | 6 +- src/api/types/RiskEvaluation.ts | 6 +- src/api/types/RiskEvaluationRiskLevel.ts | 6 +- src/api/types/SaveCardOptions.ts | 4 +- src/api/types/ScheduledShift.ts | 6 +- src/api/types/ScheduledShiftDetails.ts | 4 +- src/api/types/ScheduledShiftFilter.ts | 6 +- .../ScheduledShiftFilterAssignmentStatus.ts | 7 +- ...cheduledShiftFilterScheduledShiftStatus.ts | 7 +- .../ScheduledShiftNotificationAudience.ts | 7 +- src/api/types/ScheduledShiftQuery.ts | 6 +- src/api/types/ScheduledShiftSort.ts | 6 +- src/api/types/ScheduledShiftSortField.ts | 6 +- src/api/types/ScheduledShiftWorkday.ts | 6 +- src/api/types/ScheduledShiftWorkdayMatcher.ts | 11 +- src/api/types/SearchAvailabilityFilter.ts | 6 +- src/api/types/SearchAvailabilityQuery.ts | 6 +- src/api/types/SearchAvailabilityResponse.ts | 6 +- .../SearchCatalogItemsRequestStockLevel.ts | 11 +- src/api/types/SearchCatalogItemsResponse.ts | 6 +- src/api/types/SearchCatalogObjectsResponse.ts | 6 +- src/api/types/SearchCustomersResponse.ts | 6 +- src/api/types/SearchEventsFilter.ts | 6 +- src/api/types/SearchEventsQuery.ts | 6 +- src/api/types/SearchEventsResponse.ts | 6 +- src/api/types/SearchEventsSort.ts | 6 +- src/api/types/SearchEventsSortField.ts | 4 +- src/api/types/SearchInvoicesResponse.ts | 6 +- ...yaltyAccountsRequestLoyaltyAccountQuery.ts | 6 +- .../types/SearchLoyaltyAccountsResponse.ts | 6 +- src/api/types/SearchLoyaltyEventsResponse.ts | 6 +- ...LoyaltyRewardsRequestLoyaltyRewardQuery.ts | 6 +- src/api/types/SearchLoyaltyRewardsResponse.ts | 6 +- src/api/types/SearchOrdersCustomerFilter.ts | 4 +- src/api/types/SearchOrdersDateTimeFilter.ts | 6 +- src/api/types/SearchOrdersFilter.ts | 6 +- .../types/SearchOrdersFulfillmentFilter.ts | 6 +- src/api/types/SearchOrdersQuery.ts | 6 +- src/api/types/SearchOrdersResponse.ts | 6 +- src/api/types/SearchOrdersSort.ts | 6 +- src/api/types/SearchOrdersSortField.ts | 10 +- src/api/types/SearchOrdersSourceFilter.ts | 4 +- src/api/types/SearchOrdersStateFilter.ts | 6 +- .../types/SearchScheduledShiftsResponse.ts | 6 +- src/api/types/SearchShiftsResponse.ts | 6 +- src/api/types/SearchSubscriptionsFilter.ts | 4 +- src/api/types/SearchSubscriptionsQuery.ts | 6 +- src/api/types/SearchSubscriptionsResponse.ts | 6 +- src/api/types/SearchTeamMembersFilter.ts | 6 +- src/api/types/SearchTeamMembersQuery.ts | 6 +- src/api/types/SearchTeamMembersResponse.ts | 6 +- .../types/SearchTerminalActionsResponse.ts | 6 +- .../types/SearchTerminalCheckoutsResponse.ts | 6 +- .../types/SearchTerminalRefundsResponse.ts | 6 +- src/api/types/SearchTimecardsResponse.ts | 6 +- src/api/types/SearchTransferOrdersResponse.ts | 15 - src/api/types/SearchVendorsRequestFilter.ts | 6 +- src/api/types/SearchVendorsRequestSort.ts | 6 +- .../types/SearchVendorsRequestSortField.ts | 11 +- src/api/types/SearchVendorsResponse.ts | 6 +- src/api/types/SegmentFilter.ts | 6 +- src/api/types/SelectOption.ts | 4 +- src/api/types/SelectOptions.ts | 6 +- src/api/types/Shift.ts | 6 +- src/api/types/ShiftFilter.ts | 6 +- src/api/types/ShiftFilterStatus.ts | 6 +- src/api/types/ShiftQuery.ts | 6 +- src/api/types/ShiftSort.ts | 6 +- src/api/types/ShiftSortField.ts | 6 +- src/api/types/ShiftStatus.ts | 6 +- src/api/types/ShiftWage.ts | 6 +- src/api/types/ShiftWorkday.ts | 6 +- src/api/types/ShiftWorkdayMatcher.ts | 10 +- src/api/types/ShippingFee.ts | 6 +- src/api/types/SignatureImage.ts | 4 +- src/api/types/SignatureOptions.ts | 6 +- src/api/types/Site.ts | 4 +- src/api/types/Snippet.ts | 4 +- src/api/types/SortOrder.ts | 10 +- src/api/types/SourceApplication.ts | 6 +- src/api/types/SquareAccountDetails.ts | 6 +- src/api/types/StandardUnitDescription.ts | 6 +- src/api/types/StandardUnitDescriptionGroup.ts | 6 +- src/api/types/StartTransferOrderResponse.ts | 13 - src/api/types/SubmitEvidenceResponse.ts | 6 +- src/api/types/Subscription.ts | 8 +- src/api/types/SubscriptionAction.ts | 6 +- src/api/types/SubscriptionActionType.ts | 11 +- src/api/types/SubscriptionCadence.ts | 23 +- src/api/types/SubscriptionCreatedEvent.ts | 6 +- src/api/types/SubscriptionCreatedEventData.ts | 6 +- .../types/SubscriptionCreatedEventObject.ts | 6 +- src/api/types/SubscriptionEvent.ts | 6 +- src/api/types/SubscriptionEventInfo.ts | 6 +- src/api/types/SubscriptionEventInfoCode.ts | 16 +- .../SubscriptionEventSubscriptionEventType.ts | 18 +- src/api/types/SubscriptionPhase.ts | 6 +- src/api/types/SubscriptionPricing.ts | 6 +- src/api/types/SubscriptionPricingType.ts | 10 +- src/api/types/SubscriptionSource.ts | 4 +- src/api/types/SubscriptionStatus.ts | 11 +- src/api/types/SubscriptionTestResult.ts | 4 +- src/api/types/SubscriptionUpdatedEvent.ts | 6 +- src/api/types/SubscriptionUpdatedEventData.ts | 6 +- .../types/SubscriptionUpdatedEventObject.ts | 6 +- src/api/types/SwapPlanResponse.ts | 6 +- src/api/types/TaxCalculationPhase.ts | 10 +- src/api/types/TaxIds.ts | 4 +- src/api/types/TaxInclusionType.ts | 10 +- src/api/types/TeamMember.ts | 6 +- src/api/types/TeamMemberAssignedLocations.ts | 6 +- ...amMemberAssignedLocationsAssignmentType.ts | 11 +- src/api/types/TeamMemberBookingProfile.ts | 4 +- src/api/types/TeamMemberCreatedEvent.ts | 6 +- src/api/types/TeamMemberCreatedEventData.ts | 6 +- src/api/types/TeamMemberCreatedEventObject.ts | 6 +- src/api/types/TeamMemberInvitationStatus.ts | 10 +- src/api/types/TeamMemberStatus.ts | 10 +- src/api/types/TeamMemberUpdatedEvent.ts | 6 +- src/api/types/TeamMemberUpdatedEventData.ts | 6 +- src/api/types/TeamMemberUpdatedEventObject.ts | 6 +- src/api/types/TeamMemberWage.ts | 6 +- .../TeamMemberWageSettingUpdatedEvent.ts | 6 +- .../TeamMemberWageSettingUpdatedEventData.ts | 6 +- ...TeamMemberWageSettingUpdatedEventObject.ts | 6 +- src/api/types/Tender.ts | 6 +- src/api/types/TenderBankAccountDetails.ts | 6 +- .../types/TenderBankAccountDetailsStatus.ts | 11 +- src/api/types/TenderBuyNowPayLaterDetails.ts | 6 +- .../types/TenderBuyNowPayLaterDetailsBrand.ts | 7 +- .../TenderBuyNowPayLaterDetailsStatus.ts | 7 +- src/api/types/TenderCardDetails.ts | 6 +- src/api/types/TenderCardDetailsEntryMethod.ts | 11 +- src/api/types/TenderCardDetailsStatus.ts | 10 +- src/api/types/TenderCashDetails.ts | 6 +- src/api/types/TenderSquareAccountDetails.ts | 6 +- .../types/TenderSquareAccountDetailsStatus.ts | 7 +- src/api/types/TenderType.ts | 20 +- src/api/types/TerminalAction.ts | 6 +- src/api/types/TerminalActionActionType.ts | 18 +- src/api/types/TerminalActionCreatedEvent.ts | 6 +- .../types/TerminalActionCreatedEventData.ts | 6 +- .../types/TerminalActionCreatedEventObject.ts | 6 +- src/api/types/TerminalActionQuery.ts | 6 +- src/api/types/TerminalActionQueryFilter.ts | 6 +- src/api/types/TerminalActionQuerySort.ts | 6 +- src/api/types/TerminalActionUpdatedEvent.ts | 6 +- .../types/TerminalActionUpdatedEventData.ts | 6 +- .../types/TerminalActionUpdatedEventObject.ts | 6 +- src/api/types/TerminalCheckout.ts | 6 +- src/api/types/TerminalCheckoutCreatedEvent.ts | 6 +- .../types/TerminalCheckoutCreatedEventData.ts | 6 +- .../TerminalCheckoutCreatedEventObject.ts | 6 +- src/api/types/TerminalCheckoutQuery.ts | 6 +- src/api/types/TerminalCheckoutQueryFilter.ts | 6 +- src/api/types/TerminalCheckoutQuerySort.ts | 6 +- src/api/types/TerminalCheckoutUpdatedEvent.ts | 6 +- .../types/TerminalCheckoutUpdatedEventData.ts | 6 +- .../TerminalCheckoutUpdatedEventObject.ts | 6 +- src/api/types/TerminalRefund.ts | 6 +- src/api/types/TerminalRefundCreatedEvent.ts | 6 +- .../types/TerminalRefundCreatedEventData.ts | 6 +- .../types/TerminalRefundCreatedEventObject.ts | 6 +- src/api/types/TerminalRefundQuery.ts | 6 +- src/api/types/TerminalRefundQueryFilter.ts | 6 +- src/api/types/TerminalRefundQuerySort.ts | 4 +- src/api/types/TerminalRefundUpdatedEvent.ts | 6 +- .../types/TerminalRefundUpdatedEventData.ts | 6 +- .../types/TerminalRefundUpdatedEventObject.ts | 6 +- .../types/TestWebhookSubscriptionResponse.ts | 6 +- src/api/types/TimeRange.ts | 4 +- src/api/types/Timecard.ts | 6 +- src/api/types/TimecardFilter.ts | 6 +- src/api/types/TimecardFilterStatus.ts | 10 +- src/api/types/TimecardQuery.ts | 6 +- src/api/types/TimecardSort.ts | 6 +- src/api/types/TimecardSortField.ts | 10 +- src/api/types/TimecardStatus.ts | 10 +- src/api/types/TimecardWage.ts | 6 +- src/api/types/TimecardWorkday.ts | 6 +- src/api/types/TimecardWorkdayMatcher.ts | 10 +- src/api/types/TipSettings.ts | 4 +- src/api/types/Transaction.ts | 6 +- src/api/types/TransactionProduct.ts | 18 +- src/api/types/TransactionType.ts | 10 +- src/api/types/TransferOrder.ts | 104 - src/api/types/TransferOrderCreatedEvent.ts | 19 - .../types/TransferOrderCreatedEventData.ts | 12 - .../types/TransferOrderCreatedEventObject.ts | 8 - src/api/types/TransferOrderDeletedEvent.ts | 19 - .../types/TransferOrderDeletedEventData.ts | 10 - src/api/types/TransferOrderFilter.ts | 18 - src/api/types/TransferOrderGoodsReceipt.ts | 40 - .../TransferOrderGoodsReceiptLineItem.ts | 21 - src/api/types/TransferOrderLine.ts | 44 - src/api/types/TransferOrderQuery.ts | 13 - src/api/types/TransferOrderSort.ts | 19 - src/api/types/TransferOrderSortField.ts | 12 - src/api/types/TransferOrderStatus.ts | 15 - src/api/types/TransferOrderUpdatedEvent.ts | 19 - .../types/TransferOrderUpdatedEventData.ts | 12 - .../types/TransferOrderUpdatedEventObject.ts | 8 - .../UnlinkCustomerFromGiftCardResponse.ts | 6 +- ...ookingCustomAttributeDefinitionResponse.ts | 6 +- src/api/types/UpdateBookingResponse.ts | 6 +- src/api/types/UpdateBreakTypeResponse.ts | 6 +- src/api/types/UpdateCatalogImageRequest.ts | 4 +- src/api/types/UpdateCatalogImageResponse.ts | 6 +- ...stomerCustomAttributeDefinitionResponse.ts | 6 +- src/api/types/UpdateCustomerGroupResponse.ts | 6 +- src/api/types/UpdateCustomerResponse.ts | 6 +- src/api/types/UpdateInvoiceResponse.ts | 6 +- .../types/UpdateItemModifierListsResponse.ts | 6 +- src/api/types/UpdateItemTaxesResponse.ts | 6 +- src/api/types/UpdateJobResponse.ts | 6 +- ...cationCustomAttributeDefinitionResponse.ts | 6 +- src/api/types/UpdateLocationResponse.ts | 6 +- .../types/UpdateLocationSettingsResponse.ts | 6 +- ...rchantCustomAttributeDefinitionResponse.ts | 6 +- .../types/UpdateMerchantSettingsResponse.ts | 6 +- ...eOrderCustomAttributeDefinitionResponse.ts | 6 +- src/api/types/UpdateOrderResponse.ts | 6 +- src/api/types/UpdatePaymentLinkResponse.ts | 6 +- src/api/types/UpdatePaymentResponse.ts | 6 +- src/api/types/UpdateScheduledShiftResponse.ts | 6 +- src/api/types/UpdateShiftResponse.ts | 6 +- src/api/types/UpdateSubscriptionResponse.ts | 6 +- src/api/types/UpdateTeamMemberRequest.ts | 6 +- src/api/types/UpdateTeamMemberResponse.ts | 6 +- src/api/types/UpdateTimecardResponse.ts | 6 +- src/api/types/UpdateTransferOrderData.ts | 27 - src/api/types/UpdateTransferOrderLineData.ts | 19 - src/api/types/UpdateTransferOrderResponse.ts | 13 - src/api/types/UpdateVendorRequest.ts | 6 +- src/api/types/UpdateVendorResponse.ts | 6 +- src/api/types/UpdateWageSettingResponse.ts | 6 +- .../UpdateWebhookSubscriptionResponse.ts | 6 +- ...WebhookSubscriptionSignatureKeyResponse.ts | 6 +- src/api/types/UpdateWorkweekConfigResponse.ts | 6 +- .../UpsertBookingCustomAttributeResponse.ts | 6 +- src/api/types/UpsertCatalogObjectResponse.ts | 6 +- .../UpsertCustomerCustomAttributeResponse.ts | 6 +- .../UpsertLocationCustomAttributeResponse.ts | 6 +- .../UpsertMerchantCustomAttributeResponse.ts | 6 +- .../UpsertOrderCustomAttributeResponse.ts | 6 +- src/api/types/UpsertSnippetResponse.ts | 6 +- src/api/types/V1GetPaymentRequest.ts | 4 +- src/api/types/V1GetSettlementRequest.ts | 4 +- src/api/types/V1Money.ts | 6 +- src/api/types/V1Order.ts | 6 +- src/api/types/V1OrderHistoryEntry.ts | 6 +- src/api/types/V1OrderHistoryEntryAction.ts | 13 +- src/api/types/V1OrderState.ts | 6 +- src/api/types/V1Tender.ts | 6 +- src/api/types/V1TenderCardBrand.ts | 19 +- src/api/types/V1TenderEntryMethod.ts | 13 +- src/api/types/V1TenderType.ts | 14 +- src/api/types/V1UpdateOrderRequestAction.ts | 6 +- src/api/types/Vendor.ts | 6 +- src/api/types/VendorContact.ts | 4 +- src/api/types/VendorCreatedEvent.ts | 6 +- src/api/types/VendorCreatedEventData.ts | 6 +- src/api/types/VendorCreatedEventObject.ts | 6 +- .../VendorCreatedEventObjectOperation.ts | 4 +- src/api/types/VendorStatus.ts | 6 +- src/api/types/VendorUpdatedEvent.ts | 6 +- src/api/types/VendorUpdatedEventData.ts | 6 +- src/api/types/VendorUpdatedEventObject.ts | 6 +- .../VendorUpdatedEventObjectOperation.ts | 4 +- src/api/types/VisibilityFilter.ts | 10 +- src/api/types/VoidTransactionResponse.ts | 6 +- src/api/types/WageSetting.ts | 6 +- src/api/types/WebhookSubscription.ts | 4 +- src/api/types/Weekday.ts | 10 +- src/api/types/WorkweekConfig.ts | 6 +- src/api/types/index.ts | 248 +- src/core/auth/AuthProvider.ts | 5 - src/core/auth/AuthRequest.ts | 9 - src/core/auth/BasicAuth.ts | 3 +- src/core/auth/index.ts | 2 - src/core/exports.ts | 3 - src/core/fetcher/APIResponse.ts | 2 +- src/core/fetcher/BinaryResponse.ts | 2 +- src/core/fetcher/EndpointMetadata.ts | 13 - src/core/fetcher/EndpointSupplier.ts | 14 - src/core/fetcher/Fetcher.ts | 254 +- src/core/fetcher/HttpResponsePromise.ts | 2 +- src/core/fetcher/getErrorResponseBody.ts | 3 +- src/core/fetcher/getFetchFn.ts | 2 +- src/core/fetcher/getRequestBody.ts | 6 +- src/core/fetcher/getResponseBody.ts | 6 +- src/core/fetcher/index.ts | 12 +- src/core/fetcher/makeRequest.ts | 8 +- src/core/fetcher/requestWithRetries.ts | 49 +- src/core/fetcher/signals.ts | 12 + .../Node18UniversalStreamWrapper.ts | 12 +- .../stream-wrappers/NodePre18StreamWrapper.ts | 2 +- .../stream-wrappers/UndiciStreamWrapper.ts | 9 +- src/core/file/exports.ts | 1 - src/core/file/file.ts | 217 - src/core/file/index.ts | 2 - src/core/file/types.ts | 81 - src/core/form-data-utils/FormDataWrapper.ts | 210 +- src/core/headers.ts | 28 +- src/core/json.ts | 395 +- src/core/logging/exports.ts | 19 - src/core/logging/index.ts | 1 - src/core/logging/logger.ts | 203 - src/core/pagination/Page.ts | 21 +- src/core/pagination/Pageable.ts | 18 + src/core/pagination/exports.ts | 1 - src/core/pagination/index.ts | 1 + src/core/schemas/Schema.ts | 4 +- src/core/schemas/builders/bigint/bigint.ts | 4 +- src/core/schemas/builders/date/date.ts | 4 +- src/core/schemas/builders/enum/enum.ts | 2 +- src/core/schemas/builders/index.ts | 28 +- src/core/schemas/builders/lazy/index.ts | 2 +- src/core/schemas/builders/lazy/lazy.ts | 4 +- src/core/schemas/builders/lazy/lazyObject.ts | 10 +- src/core/schemas/builders/list/list.ts | 4 +- .../builders/literals/booleanLiteral.ts | 2 +- src/core/schemas/builders/literals/index.ts | 2 +- .../builders/literals/stringLiteral.ts | 2 +- .../object-like/getObjectLikeUtils.ts | 6 +- .../schemas/builders/object-like/types.ts | 10 +- src/core/schemas/builders/object/index.ts | 4 +- src/core/schemas/builders/object/object.ts | 14 +- .../object/objectWithoutOptionalProperties.ts | 7 +- src/core/schemas/builders/object/property.ts | 2 +- src/core/schemas/builders/object/types.ts | 37 +- src/core/schemas/builders/primitives/any.ts | 7 +- .../schemas/builders/primitives/boolean.ts | 4 +- src/core/schemas/builders/primitives/index.ts | 1 - src/core/schemas/builders/primitives/never.ts | 15 - .../schemas/builders/primitives/number.ts | 4 +- .../schemas/builders/primitives/string.ts | 4 +- .../schemas/builders/primitives/unknown.ts | 7 +- src/core/schemas/builders/record/record.ts | 8 +- src/core/schemas/builders/record/types.ts | 4 +- .../builders/schema-utils/JsonError.ts | 2 +- .../builders/schema-utils/ParseError.ts | 2 +- .../builders/schema-utils/getSchemaUtils.ts | 2 +- .../schemas/builders/schema-utils/index.ts | 2 +- .../schema-utils/stringifyValidationErrors.ts | 2 +- src/core/schemas/builders/set/set.ts | 6 +- .../builders/undiscriminated-union/types.ts | 2 +- .../undiscriminatedUnion.ts | 13 +- src/core/schemas/builders/union/index.ts | 2 +- src/core/schemas/builders/union/types.ts | 4 +- src/core/schemas/builders/union/union.ts | 20 +- src/core/schemas/index.ts | 2 +- .../utils/createIdentitySchemaCreator.ts | 4 +- src/core/schemas/utils/maybeSkipValidation.ts | 4 +- src/core/url/encodePathParam.ts | 18 - src/core/url/index.ts | 1 - src/core/url/join.ts | 34 +- src/environments.ts | 4 +- src/errors/SquareTimeoutError.ts | 4 +- src/exports.ts | 1 - src/serialization/index.ts | 2 +- .../client/requests/RegisterDomainRequest.ts | 8 +- .../requests/BulkRetrieveBookingsRequest.ts | 8 +- ...etrieveTeamMemberBookingProfilesRequest.ts | 8 +- .../client/requests/CancelBookingRequest.ts | 12 +- .../client/requests/CreateBookingRequest.ts | 8 +- .../requests/SearchAvailabilityRequest.ts | 8 +- .../client/requests/UpdateBookingRequest.ts | 10 +- .../bookings/client/requests/index.ts | 6 +- ...BookingCustomAttributeDefinitionRequest.ts | 8 +- ...BookingCustomAttributeDefinitionRequest.ts | 10 +- ...ulkDeleteBookingCustomAttributesRequest.ts | 8 +- ...ulkUpsertBookingCustomAttributesRequest.ts | 8 +- .../UpsertBookingCustomAttributeRequest.ts | 10 +- .../client/requests/CreateCardRequest.ts | 8 +- .../BatchDeleteCatalogObjectsRequest.ts | 8 +- .../requests/BatchGetCatalogObjectsRequest.ts | 16 +- .../BatchUpsertCatalogObjectsRequest.ts | 8 +- .../requests/SearchCatalogItemsRequest.ts | 14 +- .../requests/SearchCatalogObjectsRequest.ts | 8 +- .../UpdateItemModifierListsRequest.ts | 12 +- .../client/requests/UpdateItemTaxesRequest.ts | 12 +- .../catalog/client/requests/index.ts | 2 +- .../requests/UpsertCatalogObjectRequest.ts | 8 +- .../resources/channels/client/index.ts | 1 - .../requests/BulkRetrieveChannelsRequest.ts | 18 - .../channels/client/requests/index.ts | 1 - src/serialization/resources/channels/index.ts | 1 - .../requests/UpdateLocationSettingsRequest.ts | 8 +- .../requests/UpdateMerchantSettingsRequest.ts | 8 +- .../requests/CreatePaymentLinkRequest.ts | 12 +- .../requests/UpdatePaymentLinkRequest.ts | 8 +- .../requests/BulkCreateCustomersRequest.ts | 8 +- .../requests/BulkDeleteCustomersRequest.ts | 8 +- .../requests/BulkRetrieveCustomersRequest.ts | 8 +- .../requests/BulkUpdateCustomersRequest.ts | 8 +- .../client/requests/CreateCustomerRequest.ts | 8 +- .../client/requests/SearchCustomersRequest.ts | 8 +- .../client/requests/UpdateCustomerRequest.ts | 26 +- .../customers/client/requests/index.ts | 2 +- .../requests/CreateCustomerCardRequest.ts | 8 +- ...chUpsertCustomerCustomAttributesRequest.ts | 8 +- ...ustomerCustomAttributeDefinitionRequest.ts | 8 +- ...ustomerCustomAttributeDefinitionRequest.ts | 10 +- .../client/requests/index.ts | 2 +- .../UpsertCustomerCustomAttributeRequest.ts | 10 +- .../requests/CreateCustomerGroupRequest.ts | 8 +- .../requests/UpdateCustomerGroupRequest.ts | 8 +- .../resources/customers/resources/index.ts | 8 +- .../requests/CreateDeviceCodeRequest.ts | 8 +- .../CreateDisputeEvidenceTextRequest.ts | 8 +- .../client/requests/SearchEventsRequest.ts | 8 +- .../client/requests/CreateGiftCardRequest.ts | 8 +- .../requests/GetGiftCardFromGanRequest.ts | 8 +- .../requests/GetGiftCardFromNonceRequest.ts | 8 +- .../requests/LinkCustomerToGiftCardRequest.ts | 8 +- .../UnlinkCustomerFromGiftCardRequest.ts | 8 +- .../requests/CreateGiftCardActivityRequest.ts | 8 +- src/serialization/resources/index.ts | 30 +- .../client/requests/CancelInvoiceRequest.ts | 8 +- .../client/requests/CreateInvoiceRequest.ts | 8 +- .../client/requests/PublishInvoiceRequest.ts | 10 +- .../client/requests/SearchInvoicesRequest.ts | 8 +- .../client/requests/UpdateInvoiceRequest.ts | 12 +- .../invoices/client/requests/index.ts | 4 +- .../BulkPublishScheduledShiftsRequest.ts | 8 +- .../requests/CreateScheduledShiftRequest.ts | 8 +- .../client/requests/CreateTimecardRequest.ts | 8 +- .../requests/PublishScheduledShiftRequest.ts | 8 +- .../requests/SearchScheduledShiftsRequest.ts | 8 +- .../client/requests/SearchTimecardsRequest.ts | 8 +- .../requests/UpdateScheduledShiftRequest.ts | 8 +- .../client/requests/UpdateTimecardRequest.ts | 8 +- .../resources/labor/client/requests/index.ts | 8 +- .../client/requests/CreateBreakTypeRequest.ts | 8 +- .../client/requests/UpdateBreakTypeRequest.ts | 8 +- .../client/requests/CreateShiftRequest.ts | 8 +- .../client/requests/SearchShiftsRequest.ts | 8 +- .../client/requests/UpdateShiftRequest.ts | 8 +- .../requests/UpdateWorkweekConfigRequest.ts | 8 +- .../client/requests/CreateCheckoutRequest.ts | 10 +- .../client/requests/CreateLocationRequest.ts | 8 +- .../client/requests/UpdateLocationRequest.ts | 8 +- .../locations/client/requests/index.ts | 2 +- ...ocationCustomAttributeDefinitionRequest.ts | 8 +- ...ocationCustomAttributeDefinitionRequest.ts | 10 +- ...lkDeleteLocationCustomAttributesRequest.ts | 8 +- ...lkUpsertLocationCustomAttributesRequest.ts | 8 +- .../UpsertLocationCustomAttributeRequest.ts | 10 +- .../requests/SearchLoyaltyEventsRequest.ts | 8 +- .../AccumulateLoyaltyPointsRequest.ts | 8 +- .../requests/AdjustLoyaltyPointsRequest.ts | 10 +- .../requests/CreateLoyaltyAccountRequest.ts | 8 +- .../requests/SearchLoyaltyAccountsRequest.ts | 8 +- .../accounts/client/requests/index.ts | 4 +- .../requests/CalculateLoyaltyPointsRequest.ts | 12 +- .../requests/CreateLoyaltyPromotionRequest.ts | 8 +- .../requests/CreateLoyaltyRewardRequest.ts | 8 +- .../requests/RedeemLoyaltyRewardRequest.ts | 8 +- .../requests/SearchLoyaltyRewardsRequest.ts | 8 +- .../rewards/client/requests/index.ts | 2 +- ...erchantCustomAttributeDefinitionRequest.ts | 8 +- ...erchantCustomAttributeDefinitionRequest.ts | 10 +- ...lkDeleteMerchantCustomAttributesRequest.ts | 8 +- ...lkUpsertMerchantCustomAttributesRequest.ts | 8 +- .../UpsertMerchantCustomAttributeRequest.ts | 10 +- .../CreateMobileAuthorizationCodeRequest.ts | 8 +- .../client/requests/ObtainTokenRequest.ts | 24 +- .../client/requests/RevokeTokenRequest.ts | 16 +- .../resources/oAuth/client/requests/index.ts | 2 +- .../client/requests/BatchGetOrdersRequest.ts | 10 +- .../client/requests/CalculateOrderRequest.ts | 10 +- .../client/requests/CloneOrderRequest.ts | 10 +- .../orders/client/requests/PayOrderRequest.ts | 12 +- .../client/requests/SearchOrdersRequest.ts | 8 +- .../client/requests/UpdateOrderRequest.ts | 12 +- .../resources/orders/client/requests/index.ts | 2 +- ...teOrderCustomAttributeDefinitionRequest.ts | 8 +- ...teOrderCustomAttributeDefinitionRequest.ts | 10 +- .../BulkDeleteOrderCustomAttributesRequest.ts | 8 +- .../BulkUpsertOrderCustomAttributesRequest.ts | 8 +- .../UpsertOrderCustomAttributeRequest.ts | 10 +- .../CancelPaymentByIdempotencyKeyRequest.ts | 8 +- .../client/requests/CompletePaymentRequest.ts | 10 +- .../client/requests/CreatePaymentRequest.ts | 12 +- .../client/requests/UpdatePaymentRequest.ts | 8 +- .../payments/client/requests/index.ts | 4 +- .../client/requests/RefundPaymentRequest.ts | 26 +- .../client/requests/UpsertSnippetRequest.ts | 8 +- .../client/requests/BulkSwapPlanRequest.ts | 8 +- .../ChangeBillingAnchorDateRequest.ts | 12 +- .../requests/CreateSubscriptionRequest.ts | 10 +- .../requests/PauseSubscriptionRequest.ts | 16 +- .../requests/ResumeSubscriptionRequest.ts | 10 +- .../requests/SearchSubscriptionsRequest.ts | 8 +- .../client/requests/SwapPlanRequest.ts | 12 +- .../requests/UpdateSubscriptionRequest.ts | 8 +- .../subscriptions/client/requests/index.ts | 6 +- .../team/client/requests/CreateJobRequest.ts | 8 +- .../team/client/requests/UpdateJobRequest.ts | 8 +- .../requests/BatchCreateTeamMembersRequest.ts | 8 +- .../requests/BatchUpdateTeamMembersRequest.ts | 8 +- .../requests/SearchTeamMembersRequest.ts | 8 +- .../requests/UpdateWageSettingRequest.ts | 8 +- .../requests/CreateTerminalActionRequest.ts | 8 +- .../requests/SearchTerminalActionsRequest.ts | 8 +- .../requests/CreateTerminalCheckoutRequest.ts | 8 +- .../SearchTerminalCheckoutsRequest.ts | 8 +- .../requests/CreateTerminalRefundRequest.ts | 8 +- .../requests/SearchTerminalRefundsRequest.ts | 8 +- .../resources/transferOrders/client/index.ts | 1 - .../requests/CancelTransferOrderRequest.ts | 20 - .../requests/CreateTransferOrderRequest.ts | 21 - .../requests/ReceiveTransferOrderRequest.ts | 23 - .../requests/SearchTransferOrdersRequest.ts | 23 - .../requests/StartTransferOrderRequest.ts | 20 - .../requests/UpdateTransferOrderRequest.ts | 23 - .../transferOrders/client/requests/index.ts | 6 - .../resources/transferOrders/index.ts | 1 - .../resources/v1Transactions/client/index.ts | 2 +- .../client/requests/V1UpdateOrderRequest.ts | 16 +- .../v1Transactions/client/v1ListOrders.ts | 8 +- .../requests/BatchCreateVendorsRequest.ts | 8 +- .../client/requests/BatchGetVendorsRequest.ts | 10 +- .../requests/BatchUpdateVendorsRequest.ts | 8 +- .../client/requests/CreateVendorRequest.ts | 8 +- .../client/requests/SearchVendorsRequest.ts | 8 +- .../CreateWebhookSubscriptionRequest.ts | 8 +- .../TestWebhookSubscriptionRequest.ts | 10 +- .../UpdateWebhookSubscriptionRequest.ts | 8 +- ...eWebhookSubscriptionSignatureKeyRequest.ts | 10 +- .../subscriptions/client/requests/index.ts | 2 +- .../types/AcceptDisputeResponse.ts | 10 +- .../types/AcceptedPaymentMethods.ts | 16 +- .../types/AccumulateLoyaltyPointsResponse.ts | 8 +- src/serialization/types/AchDetails.ts | 14 +- src/serialization/types/ActionCancelReason.ts | 8 +- src/serialization/types/ActivityType.ts | 8 +- .../types/AddGroupToCustomerResponse.ts | 8 +- .../types/AdditionalRecipient.ts | 12 +- src/serialization/types/Address.ts | 34 +- .../types/AdjustLoyaltyPointsResponse.ts | 8 +- src/serialization/types/AfterpayDetails.ts | 10 +- src/serialization/types/ApplicationDetails.ts | 10 +- ...ApplicationDetailsExternalSquareProduct.ts | 8 +- src/serialization/types/ApplicationType.ts | 8 +- src/serialization/types/AppointmentSegment.ts | 14 +- src/serialization/types/ArchivedState.ts | 8 +- src/serialization/types/Availability.ts | 12 +- src/serialization/types/BankAccount.ts | 24 +- .../types/BankAccountCreatedEvent.ts | 16 +- .../types/BankAccountCreatedEventData.ts | 10 +- .../types/BankAccountCreatedEventObject.ts | 8 +- .../types/BankAccountDisabledEvent.ts | 16 +- .../types/BankAccountDisabledEventData.ts | 10 +- .../types/BankAccountDisabledEventObject.ts | 8 +- .../types/BankAccountPaymentDetails.ts | 22 +- src/serialization/types/BankAccountStatus.ts | 8 +- src/serialization/types/BankAccountType.ts | 8 +- .../types/BankAccountVerifiedEvent.ts | 16 +- .../types/BankAccountVerifiedEventData.ts | 10 +- .../types/BankAccountVerifiedEventObject.ts | 8 +- .../types/BatchChangeInventoryRequest.ts | 12 +- .../types/BatchChangeInventoryResponse.ts | 10 +- .../types/BatchCreateTeamMembersResponse.ts | 8 +- .../types/BatchCreateVendorsResponse.ts | 10 +- .../BatchDeleteCatalogObjectsResponse.ts | 8 +- .../types/BatchGetCatalogObjectsResponse.ts | 8 +- .../types/BatchGetInventoryChangesResponse.ts | 8 +- .../types/BatchGetInventoryCountsRequest.ts | 20 +- .../types/BatchGetInventoryCountsResponse.ts | 8 +- .../types/BatchGetOrdersResponse.ts | 10 +- .../types/BatchGetVendorsResponse.ts | 8 +- .../BatchRetrieveInventoryChangesRequest.ts | 24 +- .../types/BatchUpdateTeamMembersResponse.ts | 10 +- .../types/BatchUpdateVendorsResponse.ts | 8 +- .../BatchUpsertCatalogObjectsResponse.ts | 10 +- ...estCustomerCustomAttributeUpsertRequest.ts | 10 +- ...hUpsertCustomerCustomAttributesResponse.ts | 8 +- ...seCustomerCustomAttributeUpsertResponse.ts | 8 +- src/serialization/types/Booking.ts | 28 +- .../types/BookingBookingSource.ts | 8 +- .../types/BookingCreatedEvent.ts | 14 +- .../types/BookingCreatedEventData.ts | 10 +- .../types/BookingCreatedEventObject.ts | 8 +- .../types/BookingCreatorDetails.ts | 8 +- .../types/BookingCreatorDetailsCreatorType.ts | 8 +- ...tomAttributeDefinitionOwnedCreatedEvent.ts | 14 +- ...tomAttributeDefinitionOwnedDeletedEvent.ts | 14 +- ...tomAttributeDefinitionOwnedUpdatedEvent.ts | 14 +- ...mAttributeDefinitionVisibleCreatedEvent.ts | 14 +- ...mAttributeDefinitionVisibleDeletedEvent.ts | 14 +- ...mAttributeDefinitionVisibleUpdatedEvent.ts | 14 +- .../BookingCustomAttributeDeleteRequest.ts | 8 +- .../BookingCustomAttributeDeleteResponse.ts | 8 +- ...BookingCustomAttributeOwnedDeletedEvent.ts | 14 +- ...BookingCustomAttributeOwnedUpdatedEvent.ts | 14 +- .../BookingCustomAttributeUpsertRequest.ts | 10 +- .../BookingCustomAttributeUpsertResponse.ts | 8 +- ...okingCustomAttributeVisibleDeletedEvent.ts | 14 +- ...okingCustomAttributeVisibleUpdatedEvent.ts | 14 +- src/serialization/types/BookingStatus.ts | 8 +- .../types/BookingUpdatedEvent.ts | 14 +- .../types/BookingUpdatedEventData.ts | 10 +- .../types/BookingUpdatedEventObject.ts | 8 +- src/serialization/types/Break.ts | 10 +- src/serialization/types/BreakType.ts | 8 +- .../types/BulkCreateCustomerData.ts | 26 +- .../types/BulkCreateCustomersResponse.ts | 8 +- ...lkDeleteBookingCustomAttributesResponse.ts | 8 +- .../types/BulkDeleteCustomersResponse.ts | 8 +- ...estLocationCustomAttributeDeleteRequest.ts | 8 +- ...kDeleteLocationCustomAttributesResponse.ts | 8 +- ...seLocationCustomAttributeDeleteResponse.ts | 8 +- ...estMerchantCustomAttributeDeleteRequest.ts | 8 +- ...kDeleteMerchantCustomAttributesResponse.ts | 8 +- ...seMerchantCustomAttributeDeleteResponse.ts | 8 +- ...mAttributesRequestDeleteCustomAttribute.ts | 8 +- ...BulkDeleteOrderCustomAttributesResponse.ts | 10 +- .../types/BulkPublishScheduledShiftsData.ts | 8 +- .../BulkPublishScheduledShiftsResponse.ts | 10 +- .../types/BulkRetrieveBookingsResponse.ts | 10 +- .../BulkRetrieveChannelsRequestConstants.ts | 14 - .../types/BulkRetrieveChannelsResponse.ts | 22 - .../types/BulkRetrieveCustomersResponse.ts | 10 +- ...trieveTeamMemberBookingProfilesResponse.ts | 10 +- .../types/BulkSwapPlanResponse.ts | 8 +- .../types/BulkUpdateCustomerData.ts | 26 +- .../types/BulkUpdateCustomersResponse.ts | 10 +- ...lkUpsertBookingCustomAttributesResponse.ts | 8 +- ...estLocationCustomAttributeUpsertRequest.ts | 10 +- ...kUpsertLocationCustomAttributesResponse.ts | 8 +- ...seLocationCustomAttributeUpsertResponse.ts | 8 +- ...estMerchantCustomAttributeUpsertRequest.ts | 10 +- ...kUpsertMerchantCustomAttributesResponse.ts | 8 +- ...seMerchantCustomAttributeUpsertResponse.ts | 8 +- ...mAttributesRequestUpsertCustomAttribute.ts | 10 +- ...BulkUpsertOrderCustomAttributesResponse.ts | 8 +- .../types/BusinessAppointmentSettings.ts | 30 +- ...usinessAppointmentSettingsAlignmentTime.ts | 8 +- ...sAppointmentSettingsBookingLocationType.ts | 8 +- ...ssAppointmentSettingsCancellationPolicy.ts | 8 +- ...tSettingsMaxAppointmentsPerDayLimitType.ts | 8 +- .../types/BusinessBookingProfile.ts | 20 +- .../BusinessBookingProfileBookingPolicy.ts | 8 +- ...essBookingProfileCustomerTimezoneChoice.ts | 8 +- src/serialization/types/BusinessHours.ts | 10 +- .../types/BusinessHoursPeriod.ts | 12 +- .../types/BuyNowPayLaterDetails.ts | 10 +- .../types/CalculateLoyaltyPointsResponse.ts | 8 +- .../types/CalculateOrderResponse.ts | 10 +- .../types/CancelBookingResponse.ts | 8 +- .../types/CancelInvoiceResponse.ts | 10 +- .../types/CancelLoyaltyPromotionResponse.ts | 8 +- .../CancelPaymentByIdempotencyKeyResponse.ts | 8 +- .../types/CancelPaymentResponse.ts | 8 +- .../types/CancelSubscriptionResponse.ts | 8 +- .../types/CancelTerminalActionResponse.ts | 8 +- .../types/CancelTerminalCheckoutResponse.ts | 8 +- .../types/CancelTerminalRefundResponse.ts | 8 +- .../types/CancelTransferOrderResponse.ts | 22 - .../types/CaptureTransactionResponse.ts | 8 +- src/serialization/types/Card.ts | 24 +- .../types/CardAutomaticallyUpdatedEvent.ts | 14 +- .../CardAutomaticallyUpdatedEventData.ts | 10 +- .../CardAutomaticallyUpdatedEventObject.ts | 8 +- src/serialization/types/CardBrand.ts | 8 +- src/serialization/types/CardCoBrand.ts | 8 +- src/serialization/types/CardCreatedEvent.ts | 14 +- .../types/CardCreatedEventData.ts | 10 +- .../types/CardCreatedEventObject.ts | 8 +- src/serialization/types/CardDisabledEvent.ts | 14 +- .../types/CardDisabledEventData.ts | 10 +- .../types/CardDisabledEventObject.ts | 8 +- src/serialization/types/CardForgottenEvent.ts | 14 +- .../types/CardForgottenEventCard.ts | 16 +- .../types/CardForgottenEventData.ts | 10 +- .../types/CardForgottenEventObject.ts | 8 +- src/serialization/types/CardIssuerAlert.ts | 8 +- src/serialization/types/CardPaymentDetails.ts | 71 +- .../types/CardPaymentTimeline.ts | 14 +- src/serialization/types/CardPrepaidType.ts | 8 +- src/serialization/types/CardType.ts | 8 +- src/serialization/types/CardUpdatedEvent.ts | 14 +- .../types/CardUpdatedEventData.ts | 10 +- .../types/CardUpdatedEventObject.ts | 8 +- src/serialization/types/CashAppDetails.ts | 12 +- src/serialization/types/CashDrawerDevice.ts | 10 +- .../types/CashDrawerEventType.ts | 8 +- src/serialization/types/CashDrawerShift.ts | 18 +- .../types/CashDrawerShiftEvent.ts | 10 +- .../types/CashDrawerShiftState.ts | 8 +- .../types/CashDrawerShiftSummary.ts | 16 +- src/serialization/types/CashPaymentDetails.ts | 8 +- .../types/CatalogAvailabilityPeriod.ts | 12 +- src/serialization/types/CatalogCategory.ts | 22 +- .../types/CatalogCategoryType.ts | 8 +- .../types/CatalogCustomAttributeDefinition.ts | 22 +- ...gCustomAttributeDefinitionAppVisibility.ts | 8 +- ...ogCustomAttributeDefinitionNumberConfig.ts | 10 +- ...ustomAttributeDefinitionSelectionConfig.ts | 12 +- ...SelectionConfigCustomAttributeSelection.ts | 10 +- ...stomAttributeDefinitionSellerVisibility.ts | 8 +- ...ogCustomAttributeDefinitionStringConfig.ts | 10 +- .../CatalogCustomAttributeDefinitionType.ts | 8 +- .../types/CatalogCustomAttributeValue.ts | 18 +- src/serialization/types/CatalogDiscount.ts | 18 +- .../types/CatalogDiscountModifyTaxBasis.ts | 8 +- .../types/CatalogDiscountType.ts | 8 +- src/serialization/types/CatalogEcomSeoData.ts | 14 +- src/serialization/types/CatalogIdMapping.ts | 12 +- src/serialization/types/CatalogImage.ts | 16 +- .../types/CatalogInfoResponse.ts | 10 +- .../types/CatalogInfoResponseLimits.ts | 30 +- src/serialization/types/CatalogItem.ts | 54 +- .../CatalogItemFoodAndBeverageDetails.ts | 14 +- ...FoodAndBeverageDetailsDietaryPreference.ts | 12 +- ...taryPreferenceStandardDietaryPreference.ts | 8 +- ...AndBeverageDetailsDietaryPreferenceType.ts | 8 +- ...logItemFoodAndBeverageDetailsIngredient.ts | 10 +- ...rageDetailsIngredientStandardIngredient.ts | 8 +- .../types/CatalogItemModifierListInfo.ts | 18 +- src/serialization/types/CatalogItemOption.ts | 18 +- .../types/CatalogItemOptionForItem.ts | 10 +- .../types/CatalogItemOptionValue.ts | 18 +- .../CatalogItemOptionValueForItemVariation.ts | 12 +- .../types/CatalogItemProductType.ts | 8 +- .../types/CatalogItemVariation.ts | 48 +- .../types/CatalogMeasurementUnit.ts | 10 +- src/serialization/types/CatalogModifier.ts | 24 +- .../types/CatalogModifierList.ts | 34 +- .../types/CatalogModifierListModifierType.ts | 8 +- .../types/CatalogModifierListSelectionType.ts | 8 +- .../types/CatalogModifierOverride.ts | 10 +- src/serialization/types/CatalogObject.ts | 24 +- .../types/CatalogObjectAvailabilityPeriod.ts | 8 +- src/serialization/types/CatalogObjectBase.ts | 8 +- src/serialization/types/CatalogObjectBatch.ts | 8 +- .../types/CatalogObjectCategory.ts | 10 +- .../CatalogObjectCustomAttributeDefinition.ts | 8 +- .../types/CatalogObjectDiscount.ts | 8 +- src/serialization/types/CatalogObjectImage.ts | 8 +- src/serialization/types/CatalogObjectItem.ts | 8 +- .../types/CatalogObjectItemOption.ts | 8 +- .../types/CatalogObjectItemOptionValue.ts | 8 +- .../types/CatalogObjectItemVariation.ts | 8 +- .../types/CatalogObjectMeasurementUnit.ts | 8 +- .../types/CatalogObjectModifier.ts | 8 +- .../types/CatalogObjectModifierList.ts | 8 +- .../types/CatalogObjectPricingRule.ts | 10 +- .../types/CatalogObjectProductSet.ts | 10 +- .../CatalogObjectQuickAmountsSettings.ts | 10 +- .../types/CatalogObjectReference.ts | 12 +- .../types/CatalogObjectSubscriptionPlan.ts | 8 +- .../CatalogObjectSubscriptionPlanVariation.ts | 10 +- src/serialization/types/CatalogObjectTax.ts | 10 +- .../types/CatalogObjectTimePeriod.ts | 10 +- src/serialization/types/CatalogObjectType.ts | 8 +- src/serialization/types/CatalogPricingRule.ts | 30 +- src/serialization/types/CatalogPricingType.ts | 8 +- src/serialization/types/CatalogProductSet.ts | 22 +- src/serialization/types/CatalogQuery.ts | 20 +- src/serialization/types/CatalogQueryExact.ts | 8 +- ...gQueryItemVariationsForItemOptionValues.ts | 10 +- .../types/CatalogQueryItemsForItemOptions.ts | 10 +- .../types/CatalogQueryItemsForModifierList.ts | 8 +- .../types/CatalogQueryItemsForTax.ts | 8 +- src/serialization/types/CatalogQueryPrefix.ts | 8 +- src/serialization/types/CatalogQueryRange.ts | 12 +- src/serialization/types/CatalogQuerySet.ts | 8 +- .../types/CatalogQuerySortedAttribute.ts | 10 +- src/serialization/types/CatalogQueryText.ts | 8 +- src/serialization/types/CatalogQuickAmount.ts | 12 +- .../types/CatalogQuickAmountType.ts | 8 +- .../types/CatalogQuickAmountsSettings.ts | 14 +- .../CatalogQuickAmountsSettingsOption.ts | 8 +- .../types/CatalogStockConversion.ts | 8 +- .../types/CatalogSubscriptionPlan.ts | 18 +- .../types/CatalogSubscriptionPlanVariation.ts | 16 +- src/serialization/types/CatalogTax.ts | 18 +- src/serialization/types/CatalogTimePeriod.ts | 10 +- src/serialization/types/CatalogV1Id.ts | 12 +- .../types/CatalogVersionUpdatedEvent.ts | 14 +- ...atalogVersionUpdatedEventCatalogVersion.ts | 8 +- .../types/CatalogVersionUpdatedEventData.ts | 10 +- .../types/CatalogVersionUpdatedEventObject.ts | 8 +- .../types/CategoryPathToRootNode.ts | 12 +- .../types/ChangeBillingAnchorDateResponse.ts | 8 +- src/serialization/types/ChangeTiming.ts | 8 +- src/serialization/types/Channel.ts | 32 - src/serialization/types/ChannelStatus.ts | 12 - .../types/ChargeRequestAdditionalRecipient.ts | 8 +- src/serialization/types/Checkout.ts | 22 +- .../types/CheckoutLocationSettings.ts | 18 +- .../types/CheckoutLocationSettingsBranding.ts | 12 +- ...koutLocationSettingsBrandingButtonShape.ts | 8 +- ...ckoutLocationSettingsBrandingHeaderType.ts | 8 +- .../types/CheckoutLocationSettingsCoupons.ts | 10 +- .../types/CheckoutLocationSettingsPolicy.ts | 14 +- .../types/CheckoutLocationSettingsTipping.ts | 16 +- .../types/CheckoutMerchantSettings.ts | 8 +- .../CheckoutMerchantSettingsPaymentMethods.ts | 10 +- ...tSettingsPaymentMethodsAfterpayClearpay.ts | 8 +- ...MethodsAfterpayClearpayEligibilityRange.ts | 8 +- ...hantSettingsPaymentMethodsPaymentMethod.ts | 10 +- src/serialization/types/CheckoutOptions.ts | 26 +- .../types/CheckoutOptionsPaymentType.ts | 8 +- src/serialization/types/ClearpayDetails.ts | 10 +- src/serialization/types/CloneOrderResponse.ts | 10 +- src/serialization/types/CollectedData.ts | 8 +- .../types/CompletePaymentResponse.ts | 8 +- src/serialization/types/Component.ts | 12 +- .../types/ComponentComponentType.ts | 8 +- .../types/ConfirmationDecision.ts | 8 +- .../types/ConfirmationOptions.ts | 10 +- src/serialization/types/Coordinates.ts | 12 +- src/serialization/types/Country.ts | 8 +- ...ookingCustomAttributeDefinitionResponse.ts | 8 +- .../types/CreateBookingResponse.ts | 8 +- .../types/CreateBreakTypeResponse.ts | 8 +- src/serialization/types/CreateCardResponse.ts | 10 +- .../types/CreateCatalogImageRequest.ts | 8 +- .../types/CreateCatalogImageResponse.ts | 8 +- .../types/CreateCheckoutResponse.ts | 8 +- .../types/CreateCustomerCardResponse.ts | 10 +- ...stomerCustomAttributeDefinitionResponse.ts | 8 +- .../types/CreateCustomerGroupResponse.ts | 10 +- .../types/CreateCustomerResponse.ts | 10 +- .../types/CreateDeviceCodeResponse.ts | 10 +- .../types/CreateDisputeEvidenceFileRequest.ts | 8 +- .../CreateDisputeEvidenceFileResponse.ts | 10 +- .../CreateDisputeEvidenceTextResponse.ts | 10 +- .../types/CreateGiftCardActivityResponse.ts | 8 +- .../types/CreateGiftCardResponse.ts | 8 +- .../CreateInvoiceAttachmentRequestData.ts | 8 +- .../types/CreateInvoiceAttachmentResponse.ts | 10 +- .../types/CreateInvoiceResponse.ts | 10 +- src/serialization/types/CreateJobResponse.ts | 10 +- ...cationCustomAttributeDefinitionResponse.ts | 8 +- .../types/CreateLocationResponse.ts | 8 +- .../types/CreateLoyaltyAccountResponse.ts | 8 +- .../types/CreateLoyaltyPromotionResponse.ts | 8 +- .../types/CreateLoyaltyRewardResponse.ts | 8 +- ...rchantCustomAttributeDefinitionResponse.ts | 8 +- .../CreateMobileAuthorizationCodeResponse.ts | 8 +- ...eOrderCustomAttributeDefinitionResponse.ts | 8 +- src/serialization/types/CreateOrderRequest.ts | 8 +- .../types/CreateOrderResponse.ts | 10 +- .../types/CreatePaymentLinkResponse.ts | 8 +- .../types/CreatePaymentResponse.ts | 8 +- .../types/CreateScheduledShiftResponse.ts | 10 +- .../types/CreateShiftResponse.ts | 10 +- .../types/CreateSubscriptionResponse.ts | 8 +- .../types/CreateTeamMemberRequest.ts | 8 +- .../types/CreateTeamMemberResponse.ts | 10 +- .../types/CreateTerminalActionResponse.ts | 8 +- .../types/CreateTerminalCheckoutResponse.ts | 8 +- .../types/CreateTerminalRefundResponse.ts | 8 +- .../types/CreateTimecardResponse.ts | 10 +- .../types/CreateTransferOrderData.ts | 37 - .../types/CreateTransferOrderLineData.ts | 20 - .../types/CreateTransferOrderResponse.ts | 22 - .../types/CreateVendorResponse.ts | 8 +- .../CreateWebhookSubscriptionResponse.ts | 8 +- src/serialization/types/Currency.ts | 8 +- src/serialization/types/CustomAttribute.ts | 14 +- .../types/CustomAttributeDefinition.ts | 16 +- .../CustomAttributeDefinitionEventData.ts | 10 +- ...ustomAttributeDefinitionEventDataObject.ts | 8 +- .../CustomAttributeDefinitionVisibility.ts | 8 +- .../types/CustomAttributeEventData.ts | 10 +- .../types/CustomAttributeEventDataObject.ts | 8 +- .../types/CustomAttributeFilter.ts | 18 +- src/serialization/types/CustomField.ts | 8 +- src/serialization/types/Customer.ts | 32 +- .../types/CustomerAddressFilter.ts | 10 +- .../types/CustomerCreatedEvent.ts | 14 +- .../types/CustomerCreatedEventData.ts | 10 +- .../types/CustomerCreatedEventEventContext.ts | 8 +- .../CustomerCreatedEventEventContextMerge.ts | 12 +- .../types/CustomerCreatedEventObject.ts | 8 +- .../types/CustomerCreationSource.ts | 8 +- .../types/CustomerCreationSourceFilter.ts | 10 +- ...erCustomAttributeDefinitionCreatedEvent.ts | 14 +- ...omAttributeDefinitionCreatedPublicEvent.ts | 14 +- ...erCustomAttributeDefinitionDeletedEvent.ts | 14 +- ...omAttributeDefinitionDeletedPublicEvent.ts | 14 +- ...tomAttributeDefinitionOwnedCreatedEvent.ts | 14 +- ...tomAttributeDefinitionOwnedDeletedEvent.ts | 14 +- ...tomAttributeDefinitionOwnedUpdatedEvent.ts | 14 +- ...erCustomAttributeDefinitionUpdatedEvent.ts | 14 +- ...omAttributeDefinitionUpdatedPublicEvent.ts | 14 +- ...mAttributeDefinitionVisibleCreatedEvent.ts | 14 +- ...mAttributeDefinitionVisibleDeletedEvent.ts | 14 +- ...mAttributeDefinitionVisibleUpdatedEvent.ts | 14 +- .../CustomerCustomAttributeDeletedEvent.ts | 14 +- ...stomerCustomAttributeDeletedPublicEvent.ts | 14 +- .../types/CustomerCustomAttributeFilter.ts | 8 +- .../CustomerCustomAttributeFilterValue.ts | 14 +- .../types/CustomerCustomAttributeFilters.ts | 10 +- ...ustomerCustomAttributeOwnedDeletedEvent.ts | 14 +- ...ustomerCustomAttributeOwnedUpdatedEvent.ts | 14 +- .../CustomerCustomAttributeUpdatedEvent.ts | 14 +- ...stomerCustomAttributeUpdatedPublicEvent.ts | 14 +- ...tomerCustomAttributeVisibleDeletedEvent.ts | 14 +- ...tomerCustomAttributeVisibleUpdatedEvent.ts | 14 +- .../types/CustomerDeletedEvent.ts | 14 +- .../types/CustomerDeletedEventData.ts | 10 +- .../types/CustomerDeletedEventEventContext.ts | 8 +- .../CustomerDeletedEventEventContextMerge.ts | 12 +- .../types/CustomerDeletedEventObject.ts | 8 +- src/serialization/types/CustomerDetails.ts | 12 +- src/serialization/types/CustomerFilter.ts | 12 +- src/serialization/types/CustomerGroup.ts | 8 +- .../types/CustomerInclusionExclusion.ts | 8 +- .../types/CustomerPreferences.ts | 10 +- src/serialization/types/CustomerQuery.ts | 8 +- src/serialization/types/CustomerSegment.ts | 8 +- src/serialization/types/CustomerSort.ts | 8 +- src/serialization/types/CustomerSortField.ts | 8 +- src/serialization/types/CustomerTaxIds.ts | 10 +- src/serialization/types/CustomerTextFilter.ts | 12 +- .../types/CustomerUpdatedEvent.ts | 14 +- .../types/CustomerUpdatedEventData.ts | 10 +- .../types/CustomerUpdatedEventObject.ts | 8 +- .../types/DataCollectionOptions.ts | 10 +- .../types/DataCollectionOptionsInputType.ts | 8 +- src/serialization/types/DateRange.ts | 12 +- src/serialization/types/DayOfWeek.ts | 8 +- ...ookingCustomAttributeDefinitionResponse.ts | 8 +- .../DeleteBookingCustomAttributeResponse.ts | 8 +- .../types/DeleteBreakTypeResponse.ts | 8 +- .../types/DeleteCatalogObjectResponse.ts | 8 +- .../types/DeleteCustomerCardResponse.ts | 8 +- ...stomerCustomAttributeDefinitionResponse.ts | 8 +- .../DeleteCustomerCustomAttributeResponse.ts | 8 +- .../types/DeleteCustomerGroupResponse.ts | 8 +- .../types/DeleteCustomerResponse.ts | 8 +- .../types/DeleteDisputeEvidenceResponse.ts | 8 +- .../types/DeleteInvoiceAttachmentResponse.ts | 8 +- .../types/DeleteInvoiceResponse.ts | 8 +- ...cationCustomAttributeDefinitionResponse.ts | 8 +- .../DeleteLocationCustomAttributeResponse.ts | 8 +- .../types/DeleteLoyaltyRewardResponse.ts | 8 +- ...rchantCustomAttributeDefinitionResponse.ts | 8 +- .../DeleteMerchantCustomAttributeResponse.ts | 8 +- ...eOrderCustomAttributeDefinitionResponse.ts | 8 +- .../DeleteOrderCustomAttributeResponse.ts | 8 +- .../types/DeletePaymentLinkResponse.ts | 8 +- .../types/DeleteShiftResponse.ts | 8 +- .../types/DeleteSnippetResponse.ts | 8 +- .../types/DeleteSubscriptionActionResponse.ts | 8 +- .../types/DeleteTimecardResponse.ts | 8 +- .../types/DeleteTransferOrderResponse.ts | 19 - .../DeleteWebhookSubscriptionResponse.ts | 8 +- src/serialization/types/Destination.ts | 8 +- src/serialization/types/DestinationDetails.ts | 8 +- .../DestinationDetailsCardRefundDetails.ts | 12 +- .../DestinationDetailsCashRefundDetails.ts | 8 +- ...DestinationDetailsExternalRefundDetails.ts | 10 +- src/serialization/types/DestinationType.ts | 8 +- src/serialization/types/Device.ts | 12 +- src/serialization/types/DeviceAttributes.ts | 16 +- .../types/DeviceAttributesDeviceType.ts | 12 +- .../types/DeviceCheckoutOptions.ts | 14 +- src/serialization/types/DeviceCode.ts | 14 +- .../types/DeviceCodePairedEvent.ts | 16 +- .../types/DeviceCodePairedEventData.ts | 10 +- .../types/DeviceCodePairedEventObject.ts | 8 +- src/serialization/types/DeviceCodeStatus.ts | 8 +- ...eviceComponentDetailsApplicationDetails.ts | 12 +- .../DeviceComponentDetailsBatteryDetails.ts | 10 +- ...DeviceComponentDetailsCardReaderDetails.ts | 8 +- .../DeviceComponentDetailsEthernetDetails.ts | 14 +- .../DeviceComponentDetailsExternalPower.ts | 8 +- .../DeviceComponentDetailsMeasurement.ts | 10 +- .../DeviceComponentDetailsWiFiDetails.ts | 18 +- src/serialization/types/DeviceCreatedEvent.ts | 14 +- .../types/DeviceCreatedEventData.ts | 10 +- .../types/DeviceCreatedEventObject.ts | 8 +- src/serialization/types/DeviceDetails.ts | 14 +- src/serialization/types/DeviceMetadata.ts | 32 +- src/serialization/types/DeviceStatus.ts | 8 +- .../types/DeviceStatusCategory.ts | 8 +- .../types/DigitalWalletDetails.ts | 12 +- .../types/DisableCardResponse.ts | 10 +- .../types/DisableEventsResponse.ts | 8 +- .../types/DismissTerminalActionResponse.ts | 8 +- .../types/DismissTerminalCheckoutResponse.ts | 8 +- .../types/DismissTerminalRefundResponse.ts | 8 +- src/serialization/types/Dispute.ts | 28 +- .../types/DisputeCreatedEvent.ts | 16 +- .../types/DisputeCreatedEventData.ts | 10 +- .../types/DisputeCreatedEventObject.ts | 8 +- src/serialization/types/DisputeEvidence.ts | 16 +- .../types/DisputeEvidenceAddedEvent.ts | 16 +- .../types/DisputeEvidenceAddedEventData.ts | 10 +- .../types/DisputeEvidenceAddedEventObject.ts | 8 +- .../types/DisputeEvidenceCreatedEvent.ts | 16 +- .../types/DisputeEvidenceCreatedEventData.ts | 10 +- .../DisputeEvidenceCreatedEventObject.ts | 8 +- .../types/DisputeEvidenceDeletedEvent.ts | 16 +- .../types/DisputeEvidenceDeletedEventData.ts | 10 +- .../DisputeEvidenceDeletedEventObject.ts | 8 +- .../types/DisputeEvidenceFile.ts | 12 +- .../types/DisputeEvidenceRemovedEvent.ts | 16 +- .../types/DisputeEvidenceRemovedEventData.ts | 10 +- .../DisputeEvidenceRemovedEventObject.ts | 8 +- .../types/DisputeEvidenceType.ts | 8 +- src/serialization/types/DisputeReason.ts | 8 +- src/serialization/types/DisputeState.ts | 8 +- .../types/DisputeStateChangedEvent.ts | 16 +- .../types/DisputeStateChangedEventData.ts | 10 +- .../types/DisputeStateChangedEventObject.ts | 8 +- .../types/DisputeStateUpdatedEvent.ts | 16 +- .../types/DisputeStateUpdatedEventData.ts | 10 +- .../types/DisputeStateUpdatedEventObject.ts | 8 +- src/serialization/types/DisputedPayment.ts | 10 +- src/serialization/types/EcomVisibility.ts | 8 +- src/serialization/types/Employee.ts | 20 +- src/serialization/types/EmployeeStatus.ts | 8 +- src/serialization/types/EmployeeWage.ts | 12 +- .../types/EnableEventsResponse.ts | 8 +- src/serialization/types/ErrorCategory.ts | 8 +- src/serialization/types/ErrorCode.ts | 8 +- src/serialization/types/Error_.ts | 8 +- src/serialization/types/Event.ts | 16 +- src/serialization/types/EventData.ts | 14 +- src/serialization/types/EventMetadata.ts | 12 +- src/serialization/types/EventTypeMetadata.ts | 8 +- src/serialization/types/ExcludeStrategy.ts | 8 +- .../types/ExternalPaymentDetails.ts | 10 +- src/serialization/types/FilterValue.ts | 14 +- src/serialization/types/FloatNumberRange.ts | 12 +- src/serialization/types/Fulfillment.ts | 20 +- .../types/FulfillmentDeliveryDetails.ts | 40 +- ...rFulfillmentDeliveryDetailsScheduleType.ts | 8 +- .../types/FulfillmentFulfillmentEntry.ts | 12 +- ...lfillmentFulfillmentLineItemApplication.ts | 8 +- .../types/FulfillmentPickupDetails.ts | 28 +- ...lmentPickupDetailsCurbsidePickupDetails.ts | 12 +- .../FulfillmentPickupDetailsScheduleType.ts | 8 +- .../types/FulfillmentRecipient.ts | 16 +- .../types/FulfillmentShipmentDetails.ts | 26 +- src/serialization/types/FulfillmentState.ts | 8 +- src/serialization/types/FulfillmentType.ts | 8 +- .../types/GetBankAccountByV1IdResponse.ts | 10 +- .../types/GetBankAccountResponse.ts | 10 +- src/serialization/types/GetBookingRequest.ts | 8 +- src/serialization/types/GetBookingResponse.ts | 8 +- .../types/GetBreakTypeResponse.ts | 8 +- .../types/GetBusinessBookingProfileRequest.ts | 8 +- .../GetBusinessBookingProfileResponse.ts | 8 +- src/serialization/types/GetCardRequest.ts | 8 +- src/serialization/types/GetCardResponse.ts | 10 +- .../types/GetCashDrawerShiftResponse.ts | 8 +- .../types/GetCatalogObjectResponse.ts | 8 +- ...stomerCustomAttributeDefinitionResponse.ts | 8 +- .../GetCustomerCustomAttributeResponse.ts | 8 +- .../types/GetCustomerGroupRequest.ts | 8 +- .../types/GetCustomerGroupResponse.ts | 10 +- src/serialization/types/GetCustomerRequest.ts | 8 +- .../types/GetCustomerResponse.ts | 10 +- .../types/GetCustomerSegmentRequest.ts | 8 +- .../types/GetCustomerSegmentResponse.ts | 10 +- .../types/GetDeviceCodeResponse.ts | 10 +- src/serialization/types/GetDeviceResponse.ts | 10 +- .../types/GetDisputeEvidenceRequest.ts | 8 +- .../types/GetDisputeEvidenceResponse.ts | 10 +- src/serialization/types/GetDisputeRequest.ts | 8 +- src/serialization/types/GetDisputeResponse.ts | 10 +- src/serialization/types/GetEmployeeRequest.ts | 8 +- .../types/GetEmployeeResponse.ts | 8 +- .../types/GetEmployeeWageResponse.ts | 8 +- .../types/GetGiftCardFromGanResponse.ts | 8 +- .../types/GetGiftCardFromNonceResponse.ts | 8 +- src/serialization/types/GetGiftCardRequest.ts | 8 +- .../types/GetGiftCardResponse.ts | 8 +- .../types/GetInventoryAdjustmentRequest.ts | 8 +- .../types/GetInventoryAdjustmentResponse.ts | 8 +- .../types/GetInventoryChangesResponse.ts | 8 +- .../types/GetInventoryCountResponse.ts | 8 +- .../types/GetInventoryPhysicalCountRequest.ts | 8 +- .../GetInventoryPhysicalCountResponse.ts | 8 +- .../types/GetInventoryTransferRequest.ts | 8 +- .../types/GetInventoryTransferResponse.ts | 8 +- src/serialization/types/GetInvoiceResponse.ts | 10 +- src/serialization/types/GetLocationRequest.ts | 8 +- .../types/GetLocationResponse.ts | 8 +- .../types/GetLoyaltyAccountRequest.ts | 8 +- .../types/GetLoyaltyAccountResponse.ts | 8 +- .../types/GetLoyaltyProgramRequest.ts | 8 +- .../types/GetLoyaltyProgramResponse.ts | 8 +- .../types/GetLoyaltyPromotionRequest.ts | 8 +- .../types/GetLoyaltyPromotionResponse.ts | 8 +- .../types/GetLoyaltyRewardRequest.ts | 8 +- .../types/GetLoyaltyRewardResponse.ts | 8 +- src/serialization/types/GetMerchantRequest.ts | 8 +- .../types/GetMerchantResponse.ts | 8 +- src/serialization/types/GetOrderRequest.ts | 8 +- src/serialization/types/GetOrderResponse.ts | 10 +- .../types/GetPaymentLinkRequest.ts | 8 +- .../types/GetPaymentLinkResponse.ts | 8 +- .../types/GetPaymentRefundResponse.ts | 8 +- src/serialization/types/GetPaymentResponse.ts | 8 +- src/serialization/types/GetPayoutResponse.ts | 10 +- src/serialization/types/GetShiftResponse.ts | 10 +- src/serialization/types/GetSnippetRequest.ts | 8 +- src/serialization/types/GetSnippetResponse.ts | 8 +- .../types/GetSubscriptionResponse.ts | 8 +- .../GetTeamMemberBookingProfileRequest.ts | 8 +- .../GetTeamMemberBookingProfileResponse.ts | 10 +- .../types/GetTeamMemberRequest.ts | 8 +- .../types/GetTeamMemberResponse.ts | 10 +- .../types/GetTeamMemberWageResponse.ts | 10 +- .../types/GetTerminalActionResponse.ts | 8 +- .../types/GetTerminalCheckoutResponse.ts | 8 +- .../types/GetTerminalRefundResponse.ts | 8 +- .../types/GetTransactionRequest.ts | 8 +- .../types/GetTransactionResponse.ts | 8 +- src/serialization/types/GetVendorRequest.ts | 8 +- src/serialization/types/GetVendorResponse.ts | 8 +- .../types/GetWageSettingRequest.ts | 8 +- .../types/GetWageSettingResponse.ts | 10 +- .../types/GetWebhookSubscriptionRequest.ts | 8 +- .../types/GetWebhookSubscriptionResponse.ts | 8 +- src/serialization/types/GiftCard.ts | 12 +- src/serialization/types/GiftCardActivity.ts | 34 +- .../types/GiftCardActivityActivate.ts | 16 +- .../types/GiftCardActivityAdjustDecrement.ts | 10 +- .../GiftCardActivityAdjustDecrementReason.ts | 8 +- .../types/GiftCardActivityAdjustIncrement.ts | 10 +- .../GiftCardActivityAdjustIncrementReason.ts | 8 +- .../types/GiftCardActivityBlock.ts | 8 +- .../types/GiftCardActivityBlockReason.ts | 8 +- .../types/GiftCardActivityClearBalance.ts | 8 +- .../GiftCardActivityClearBalanceReason.ts | 8 +- .../types/GiftCardActivityCreatedEvent.ts | 14 +- .../types/GiftCardActivityCreatedEventData.ts | 10 +- .../GiftCardActivityCreatedEventObject.ts | 8 +- .../types/GiftCardActivityDeactivate.ts | 8 +- .../types/GiftCardActivityDeactivateReason.ts | 8 +- .../types/GiftCardActivityImport.ts | 8 +- .../types/GiftCardActivityImportReversal.ts | 8 +- .../types/GiftCardActivityLoad.ts | 16 +- .../types/GiftCardActivityRedeem.ts | 12 +- .../types/GiftCardActivityRedeemStatus.ts | 8 +- .../types/GiftCardActivityRefund.ts | 12 +- .../GiftCardActivityTransferBalanceFrom.ts | 8 +- .../GiftCardActivityTransferBalanceTo.ts | 8 +- .../types/GiftCardActivityType.ts | 8 +- .../types/GiftCardActivityUnblock.ts | 8 +- .../types/GiftCardActivityUnblockReason.ts | 8 +- .../GiftCardActivityUnlinkedActivityRefund.ts | 10 +- .../types/GiftCardActivityUpdatedEvent.ts | 14 +- .../types/GiftCardActivityUpdatedEventData.ts | 10 +- .../GiftCardActivityUpdatedEventObject.ts | 8 +- .../types/GiftCardCreatedEvent.ts | 14 +- .../types/GiftCardCreatedEventData.ts | 10 +- .../types/GiftCardCreatedEventObject.ts | 8 +- .../types/GiftCardCustomerLinkedEvent.ts | 14 +- .../types/GiftCardCustomerLinkedEventData.ts | 10 +- .../GiftCardCustomerLinkedEventObject.ts | 10 +- .../types/GiftCardCustomerUnlinkedEvent.ts | 14 +- .../GiftCardCustomerUnlinkedEventData.ts | 10 +- .../GiftCardCustomerUnlinkedEventObject.ts | 10 +- src/serialization/types/GiftCardGanSource.ts | 8 +- src/serialization/types/GiftCardStatus.ts | 8 +- src/serialization/types/GiftCardType.ts | 8 +- .../types/GiftCardUpdatedEvent.ts | 14 +- .../types/GiftCardUpdatedEventData.ts | 10 +- .../types/GiftCardUpdatedEventObject.ts | 8 +- .../types/InventoryAdjustment.ts | 26 +- .../types/InventoryAdjustmentGroup.ts | 8 +- src/serialization/types/InventoryAlertType.ts | 8 +- src/serialization/types/InventoryChange.ts | 12 +- .../types/InventoryChangeType.ts | 8 +- src/serialization/types/InventoryCount.ts | 16 +- .../types/InventoryCountUpdatedEvent.ts | 14 +- .../types/InventoryCountUpdatedEventData.ts | 10 +- .../types/InventoryCountUpdatedEventObject.ts | 10 +- .../types/InventoryPhysicalCount.ts | 24 +- src/serialization/types/InventoryState.ts | 8 +- src/serialization/types/InventoryTransfer.ts | 26 +- src/serialization/types/Invoice.ts | 42 +- .../types/InvoiceAcceptedPaymentMethods.ts | 18 +- src/serialization/types/InvoiceAttachment.ts | 8 +- .../types/InvoiceAutomaticPaymentSource.ts | 8 +- .../types/InvoiceCanceledEvent.ts | 14 +- .../types/InvoiceCanceledEventData.ts | 10 +- .../types/InvoiceCanceledEventObject.ts | 8 +- .../types/InvoiceCreatedEvent.ts | 14 +- .../types/InvoiceCreatedEventData.ts | 10 +- .../types/InvoiceCreatedEventObject.ts | 8 +- src/serialization/types/InvoiceCustomField.ts | 12 +- .../types/InvoiceCustomFieldPlacement.ts | 8 +- .../types/InvoiceDeletedEvent.ts | 14 +- .../types/InvoiceDeletedEventData.ts | 12 +- .../types/InvoiceDeliveryMethod.ts | 8 +- src/serialization/types/InvoiceFilter.ts | 10 +- .../types/InvoicePaymentMadeEvent.ts | 14 +- .../types/InvoicePaymentMadeEventData.ts | 10 +- .../types/InvoicePaymentMadeEventObject.ts | 8 +- .../types/InvoicePaymentReminder.ts | 12 +- .../types/InvoicePaymentReminderStatus.ts | 8 +- .../types/InvoicePaymentRequest.ts | 24 +- .../types/InvoicePublishedEvent.ts | 14 +- .../types/InvoicePublishedEventData.ts | 10 +- .../types/InvoicePublishedEventObject.ts | 8 +- src/serialization/types/InvoiceQuery.ts | 8 +- src/serialization/types/InvoiceRecipient.ts | 10 +- .../types/InvoiceRecipientTaxIds.ts | 8 +- .../types/InvoiceRefundedEvent.ts | 14 +- .../types/InvoiceRefundedEventData.ts | 10 +- .../types/InvoiceRefundedEventObject.ts | 8 +- .../types/InvoiceRequestMethod.ts | 8 +- src/serialization/types/InvoiceRequestType.ts | 8 +- .../InvoiceScheduledChargeFailedEvent.ts | 14 +- .../InvoiceScheduledChargeFailedEventData.ts | 10 +- ...InvoiceScheduledChargeFailedEventObject.ts | 8 +- src/serialization/types/InvoiceSort.ts | 8 +- src/serialization/types/InvoiceSortField.ts | 8 +- src/serialization/types/InvoiceStatus.ts | 8 +- .../types/InvoiceUpdatedEvent.ts | 14 +- .../types/InvoiceUpdatedEventData.ts | 10 +- .../types/InvoiceUpdatedEventObject.ts | 8 +- .../types/ItemVariationLocationOverrides.ts | 16 +- src/serialization/types/Job.ts | 12 +- src/serialization/types/JobAssignment.ts | 14 +- .../types/JobAssignmentPayType.ts | 8 +- src/serialization/types/JobCreatedEvent.ts | 14 +- .../types/JobCreatedEventData.ts | 10 +- .../types/JobCreatedEventObject.ts | 8 +- src/serialization/types/JobUpdatedEvent.ts | 14 +- .../types/JobUpdatedEventData.ts | 10 +- .../types/JobUpdatedEventObject.ts | 8 +- .../types/LaborScheduledShiftCreatedEvent.ts | 16 +- .../LaborScheduledShiftCreatedEventData.ts | 10 +- .../LaborScheduledShiftCreatedEventObject.ts | 8 +- .../types/LaborScheduledShiftDeletedEvent.ts | 16 +- .../LaborScheduledShiftDeletedEventData.ts | 12 +- .../LaborScheduledShiftPublishedEvent.ts | 16 +- .../LaborScheduledShiftPublishedEventData.ts | 10 +- ...LaborScheduledShiftPublishedEventObject.ts | 8 +- .../types/LaborScheduledShiftUpdatedEvent.ts | 16 +- .../LaborScheduledShiftUpdatedEventData.ts | 10 +- .../LaborScheduledShiftUpdatedEventObject.ts | 8 +- .../types/LaborShiftCreatedEvent.ts | 14 +- .../types/LaborShiftCreatedEventData.ts | 10 +- .../types/LaborShiftCreatedEventObject.ts | 8 +- .../types/LaborShiftDeletedEvent.ts | 14 +- .../types/LaborShiftDeletedEventData.ts | 12 +- .../types/LaborShiftUpdatedEvent.ts | 14 +- .../types/LaborShiftUpdatedEventData.ts | 10 +- .../types/LaborShiftUpdatedEventObject.ts | 8 +- .../types/LaborTimecardCreatedEvent.ts | 14 +- .../types/LaborTimecardCreatedEventData.ts | 10 +- .../types/LaborTimecardCreatedEventObject.ts | 8 +- .../types/LaborTimecardDeletedEvent.ts | 14 +- .../types/LaborTimecardDeletedEventData.ts | 12 +- .../types/LaborTimecardUpdatedEvent.ts | 14 +- .../types/LaborTimecardUpdatedEventData.ts | 10 +- .../types/LaborTimecardUpdatedEventObject.ts | 8 +- .../types/LinkCustomerToGiftCardResponse.ts | 8 +- .../types/ListBankAccountsResponse.ts | 10 +- ...okingCustomAttributeDefinitionsResponse.ts | 8 +- .../ListBookingCustomAttributesResponse.ts | 8 +- .../types/ListBookingsResponse.ts | 8 +- .../types/ListBreakTypesResponse.ts | 8 +- src/serialization/types/ListCardsResponse.ts | 10 +- .../ListCashDrawerShiftEventsResponse.ts | 10 +- .../types/ListCashDrawerShiftsResponse.ts | 10 +- .../types/ListCatalogResponse.ts | 8 +- .../types/ListChannelsRequestConstants.ts | 14 - .../types/ListChannelsResponse.ts | 24 - ...tomerCustomAttributeDefinitionsResponse.ts | 8 +- .../ListCustomerCustomAttributesResponse.ts | 8 +- .../types/ListCustomerGroupsResponse.ts | 10 +- .../types/ListCustomerSegmentsResponse.ts | 10 +- .../types/ListCustomersResponse.ts | 10 +- .../types/ListDeviceCodesResponse.ts | 10 +- .../types/ListDevicesResponse.ts | 10 +- .../types/ListDisputeEvidenceResponse.ts | 8 +- .../types/ListDisputesResponse.ts | 10 +- .../types/ListEmployeeWagesResponse.ts | 8 +- .../types/ListEmployeesResponse.ts | 8 +- .../types/ListEventTypesResponse.ts | 8 +- .../types/ListGiftCardActivitiesResponse.ts | 8 +- .../types/ListGiftCardsResponse.ts | 8 +- .../types/ListInvoicesResponse.ts | 10 +- src/serialization/types/ListJobsResponse.ts | 10 +- .../ListLocationBookingProfilesResponse.ts | 10 +- ...ationCustomAttributeDefinitionsResponse.ts | 8 +- .../ListLocationCustomAttributesResponse.ts | 8 +- .../types/ListLocationsResponse.ts | 8 +- .../types/ListLoyaltyProgramsResponse.ts | 8 +- .../types/ListLoyaltyPromotionsResponse.ts | 8 +- ...chantCustomAttributeDefinitionsResponse.ts | 8 +- .../ListMerchantCustomAttributesResponse.ts | 8 +- .../types/ListMerchantsResponse.ts | 8 +- ...OrderCustomAttributeDefinitionsResponse.ts | 8 +- .../ListOrderCustomAttributesResponse.ts | 8 +- .../types/ListPaymentLinksResponse.ts | 8 +- .../ListPaymentRefundsRequestSortField.ts | 8 +- .../types/ListPaymentRefundsResponse.ts | 8 +- .../types/ListPaymentsRequestSortField.ts | 8 +- .../types/ListPaymentsResponse.ts | 8 +- .../types/ListPayoutEntriesResponse.ts | 10 +- .../types/ListPayoutsResponse.ts | 10 +- src/serialization/types/ListSitesResponse.ts | 8 +- .../types/ListSubscriptionEventsResponse.ts | 8 +- .../ListTeamMemberBookingProfilesResponse.ts | 10 +- .../types/ListTeamMemberWagesResponse.ts | 10 +- .../types/ListTransactionsResponse.ts | 8 +- .../types/ListWebhookEventTypesResponse.ts | 8 +- .../types/ListWebhookSubscriptionsResponse.ts | 8 +- .../types/ListWorkweekConfigsResponse.ts | 10 +- src/serialization/types/Location.ts | 40 +- .../types/LocationBookingProfile.ts | 14 +- src/serialization/types/LocationCapability.ts | 8 +- .../types/LocationCreatedEvent.ts | 16 +- .../types/LocationCreatedEventData.ts | 10 +- ...tomAttributeDefinitionOwnedCreatedEvent.ts | 14 +- ...tomAttributeDefinitionOwnedDeletedEvent.ts | 14 +- ...tomAttributeDefinitionOwnedUpdatedEvent.ts | 14 +- ...mAttributeDefinitionVisibleCreatedEvent.ts | 14 +- ...mAttributeDefinitionVisibleDeletedEvent.ts | 14 +- ...mAttributeDefinitionVisibleUpdatedEvent.ts | 14 +- ...ocationCustomAttributeOwnedDeletedEvent.ts | 14 +- ...ocationCustomAttributeOwnedUpdatedEvent.ts | 14 +- ...ationCustomAttributeVisibleDeletedEvent.ts | 14 +- ...ationCustomAttributeVisibleUpdatedEvent.ts | 14 +- .../types/LocationSettingsUpdatedEvent.ts | 14 +- .../types/LocationSettingsUpdatedEventData.ts | 10 +- .../LocationSettingsUpdatedEventObject.ts | 8 +- src/serialization/types/LocationStatus.ts | 8 +- src/serialization/types/LocationType.ts | 8 +- .../types/LocationUpdatedEvent.ts | 16 +- .../types/LocationUpdatedEventData.ts | 10 +- src/serialization/types/LoyaltyAccount.ts | 16 +- .../types/LoyaltyAccountCreatedEvent.ts | 14 +- .../types/LoyaltyAccountCreatedEventData.ts | 10 +- .../types/LoyaltyAccountCreatedEventObject.ts | 8 +- .../types/LoyaltyAccountDeletedEvent.ts | 14 +- .../types/LoyaltyAccountDeletedEventData.ts | 10 +- .../types/LoyaltyAccountDeletedEventObject.ts | 8 +- .../LoyaltyAccountExpiringPointDeadline.ts | 8 +- .../types/LoyaltyAccountMapping.ts | 10 +- .../types/LoyaltyAccountMappingType.ts | 8 +- .../types/LoyaltyAccountUpdatedEvent.ts | 14 +- .../types/LoyaltyAccountUpdatedEventData.ts | 10 +- .../types/LoyaltyAccountUpdatedEventObject.ts | 8 +- src/serialization/types/LoyaltyEvent.ts | 18 +- .../types/LoyaltyEventAccumulatePoints.ts | 12 +- .../LoyaltyEventAccumulatePromotionPoints.ts | 8 +- .../types/LoyaltyEventAdjustPoints.ts | 10 +- .../types/LoyaltyEventCreateReward.ts | 8 +- .../types/LoyaltyEventCreatedEvent.ts | 14 +- .../types/LoyaltyEventCreatedEventData.ts | 10 +- .../types/LoyaltyEventCreatedEventObject.ts | 8 +- .../types/LoyaltyEventDateTimeFilter.ts | 8 +- .../types/LoyaltyEventDeleteReward.ts | 8 +- .../types/LoyaltyEventExpirePoints.ts | 8 +- src/serialization/types/LoyaltyEventFilter.ts | 12 +- .../types/LoyaltyEventLocationFilter.ts | 8 +- .../types/LoyaltyEventLoyaltyAccountFilter.ts | 8 +- .../types/LoyaltyEventOrderFilter.ts | 8 +- src/serialization/types/LoyaltyEventOther.ts | 8 +- src/serialization/types/LoyaltyEventQuery.ts | 8 +- .../types/LoyaltyEventRedeemReward.ts | 8 +- src/serialization/types/LoyaltyEventSource.ts | 8 +- src/serialization/types/LoyaltyEventType.ts | 8 +- .../types/LoyaltyEventTypeFilter.ts | 8 +- src/serialization/types/LoyaltyProgram.ts | 20 +- .../types/LoyaltyProgramAccrualRule.ts | 16 +- .../LoyaltyProgramAccrualRuleCategoryData.ts | 8 +- ...altyProgramAccrualRuleItemVariationData.ts | 8 +- .../LoyaltyProgramAccrualRuleSpendData.ts | 14 +- .../types/LoyaltyProgramAccrualRuleTaxMode.ts | 8 +- .../types/LoyaltyProgramAccrualRuleType.ts | 8 +- .../LoyaltyProgramAccrualRuleVisitData.ts | 10 +- .../types/LoyaltyProgramCreatedEvent.ts | 14 +- .../types/LoyaltyProgramCreatedEventData.ts | 10 +- .../types/LoyaltyProgramCreatedEventObject.ts | 8 +- .../types/LoyaltyProgramExpirationPolicy.ts | 8 +- .../types/LoyaltyProgramRewardTier.ts | 8 +- .../types/LoyaltyProgramStatus.ts | 8 +- .../types/LoyaltyProgramTerminology.ts | 8 +- .../types/LoyaltyProgramUpdatedEvent.ts | 14 +- .../types/LoyaltyProgramUpdatedEventData.ts | 10 +- .../types/LoyaltyProgramUpdatedEventObject.ts | 8 +- src/serialization/types/LoyaltyPromotion.ts | 16 +- .../LoyaltyPromotionAvailableTimeData.ts | 8 +- .../types/LoyaltyPromotionCreatedEvent.ts | 14 +- .../types/LoyaltyPromotionCreatedEventData.ts | 10 +- .../LoyaltyPromotionCreatedEventObject.ts | 8 +- .../types/LoyaltyPromotionIncentive.ts | 12 +- ...ltyPromotionIncentivePointsAdditionData.ts | 8 +- ...yPromotionIncentivePointsMultiplierData.ts | 12 +- .../types/LoyaltyPromotionIncentiveType.ts | 8 +- .../types/LoyaltyPromotionStatus.ts | 8 +- .../types/LoyaltyPromotionTriggerLimit.ts | 8 +- .../LoyaltyPromotionTriggerLimitInterval.ts | 8 +- .../types/LoyaltyPromotionUpdatedEvent.ts | 14 +- .../types/LoyaltyPromotionUpdatedEventData.ts | 10 +- .../LoyaltyPromotionUpdatedEventObject.ts | 8 +- src/serialization/types/LoyaltyReward.ts | 10 +- .../types/LoyaltyRewardStatus.ts | 8 +- src/serialization/types/MeasurementUnit.ts | 16 +- .../types/MeasurementUnitArea.ts | 8 +- .../types/MeasurementUnitCustom.ts | 8 +- .../types/MeasurementUnitGeneric.ts | 8 +- .../types/MeasurementUnitLength.ts | 8 +- .../types/MeasurementUnitTime.ts | 8 +- .../types/MeasurementUnitUnitType.ts | 8 +- .../types/MeasurementUnitVolume.ts | 8 +- .../types/MeasurementUnitWeight.ts | 8 +- src/serialization/types/Merchant.ts | 14 +- ...tomAttributeDefinitionOwnedCreatedEvent.ts | 14 +- ...tomAttributeDefinitionOwnedDeletedEvent.ts | 14 +- ...tomAttributeDefinitionOwnedUpdatedEvent.ts | 14 +- ...mAttributeDefinitionVisibleCreatedEvent.ts | 14 +- ...mAttributeDefinitionVisibleDeletedEvent.ts | 14 +- ...mAttributeDefinitionVisibleUpdatedEvent.ts | 14 +- ...erchantCustomAttributeOwnedDeletedEvent.ts | 14 +- ...erchantCustomAttributeOwnedUpdatedEvent.ts | 14 +- ...chantCustomAttributeVisibleDeletedEvent.ts | 14 +- ...chantCustomAttributeVisibleUpdatedEvent.ts | 14 +- .../types/MerchantSettingsUpdatedEvent.ts | 14 +- .../types/MerchantSettingsUpdatedEventData.ts | 10 +- .../MerchantSettingsUpdatedEventObject.ts | 8 +- src/serialization/types/MerchantStatus.ts | 8 +- .../types/ModifierLocationOverrides.ts | 10 +- src/serialization/types/Money.ts | 10 +- .../types/OauthAuthorizationRevokedEvent.ts | 14 +- .../OauthAuthorizationRevokedEventData.ts | 10 +- .../OauthAuthorizationRevokedEventObject.ts | 8 +- ...thorizationRevokedEventRevocationObject.ts | 10 +- ...uthAuthorizationRevokedEventRevokerType.ts | 8 +- .../types/ObtainTokenResponse.ts | 8 +- .../types/OfflinePaymentDetails.ts | 8 +- src/serialization/types/Order.ts | 46 +- src/serialization/types/OrderCreated.ts | 12 +- src/serialization/types/OrderCreatedEvent.ts | 14 +- .../types/OrderCreatedEventData.ts | 10 +- src/serialization/types/OrderCreatedObject.ts | 8 +- ...tomAttributeDefinitionOwnedCreatedEvent.ts | 14 +- ...tomAttributeDefinitionOwnedDeletedEvent.ts | 14 +- ...tomAttributeDefinitionOwnedUpdatedEvent.ts | 14 +- ...mAttributeDefinitionVisibleCreatedEvent.ts | 14 +- ...mAttributeDefinitionVisibleDeletedEvent.ts | 14 +- ...mAttributeDefinitionVisibleUpdatedEvent.ts | 14 +- .../OrderCustomAttributeOwnedDeletedEvent.ts | 14 +- .../OrderCustomAttributeOwnedUpdatedEvent.ts | 14 +- ...OrderCustomAttributeVisibleDeletedEvent.ts | 14 +- ...OrderCustomAttributeVisibleUpdatedEvent.ts | 14 +- src/serialization/types/OrderEntry.ts | 12 +- ...rFulfillmentDeliveryDetailsScheduleType.ts | 8 +- ...lfillmentFulfillmentLineItemApplication.ts | 8 +- ...derFulfillmentPickupDetailsScheduleType.ts | 8 +- .../types/OrderFulfillmentState.ts | 8 +- .../types/OrderFulfillmentType.ts | 8 +- .../types/OrderFulfillmentUpdated.ts | 16 +- .../types/OrderFulfillmentUpdatedEvent.ts | 14 +- .../types/OrderFulfillmentUpdatedEventData.ts | 10 +- .../types/OrderFulfillmentUpdatedObject.ts | 8 +- .../types/OrderFulfillmentUpdatedUpdate.ts | 10 +- src/serialization/types/OrderLineItem.ts | 40 +- .../types/OrderLineItemAppliedDiscount.ts | 10 +- .../OrderLineItemAppliedServiceCharge.ts | 10 +- .../types/OrderLineItemAppliedTax.ts | 10 +- .../types/OrderLineItemDiscount.ts | 22 +- .../types/OrderLineItemDiscountScope.ts | 8 +- .../types/OrderLineItemDiscountType.ts | 8 +- .../types/OrderLineItemItemType.ts | 8 +- .../types/OrderLineItemModifier.ts | 20 +- .../types/OrderLineItemPricingBlocklists.ts | 12 +- ...ineItemPricingBlocklistsBlockedDiscount.ts | 14 +- ...rderLineItemPricingBlocklistsBlockedTax.ts | 14 +- src/serialization/types/OrderLineItemTax.ts | 22 +- .../types/OrderLineItemTaxScope.ts | 8 +- .../types/OrderLineItemTaxType.ts | 8 +- src/serialization/types/OrderMoneyAmounts.ts | 8 +- .../types/OrderPricingOptions.ts | 12 +- src/serialization/types/OrderQuantityUnit.ts | 14 +- src/serialization/types/OrderReturn.ts | 22 +- .../types/OrderReturnDiscount.ts | 22 +- .../types/OrderReturnLineItem.ts | 40 +- .../types/OrderReturnLineItemModifier.ts | 20 +- .../types/OrderReturnServiceCharge.ts | 28 +- src/serialization/types/OrderReturnTax.ts | 22 +- src/serialization/types/OrderReturnTip.ts | 14 +- src/serialization/types/OrderReward.ts | 8 +- .../types/OrderRoundingAdjustment.ts | 12 +- src/serialization/types/OrderServiceCharge.ts | 30 +- .../OrderServiceChargeCalculationPhase.ts | 8 +- .../types/OrderServiceChargeScope.ts | 8 +- .../types/OrderServiceChargeTreatmentType.ts | 8 +- .../types/OrderServiceChargeType.ts | 8 +- src/serialization/types/OrderSource.ts | 10 +- src/serialization/types/OrderState.ts | 8 +- src/serialization/types/OrderUpdated.ts | 12 +- src/serialization/types/OrderUpdatedEvent.ts | 14 +- .../types/OrderUpdatedEventData.ts | 10 +- src/serialization/types/OrderUpdatedObject.ts | 8 +- .../types/PauseSubscriptionResponse.ts | 8 +- src/serialization/types/PayOrderResponse.ts | 8 +- src/serialization/types/Payment.ts | 34 +- ...aymentBalanceActivityAppFeeRefundDetail.ts | 14 +- ...ymentBalanceActivityAppFeeRevenueDetail.ts | 12 +- ...ntBalanceActivityAutomaticSavingsDetail.ts | 12 +- ...eActivityAutomaticSavingsReversedDetail.ts | 12 +- .../PaymentBalanceActivityChargeDetail.ts | 10 +- .../PaymentBalanceActivityDepositFeeDetail.ts | 10 +- ...BalanceActivityDepositFeeReversedDetail.ts | 10 +- .../PaymentBalanceActivityDisputeDetail.ts | 12 +- .../types/PaymentBalanceActivityFeeDetail.ts | 10 +- ...mentBalanceActivityFreeProcessingDetail.ts | 10 +- ...mentBalanceActivityHoldAdjustmentDetail.ts | 10 +- ...PaymentBalanceActivityOpenDisputeDetail.ts | 12 +- ...entBalanceActivityOtherAdjustmentDetail.ts | 10 +- .../PaymentBalanceActivityOtherDetail.ts | 10 +- .../PaymentBalanceActivityRefundDetail.ts | 12 +- ...tBalanceActivityReleaseAdjustmentDetail.ts | 10 +- ...PaymentBalanceActivityReserveHoldDetail.ts | 10 +- ...mentBalanceActivityReserveReleaseDetail.ts | 10 +- ...lanceActivitySquareCapitalPaymentDetail.ts | 10 +- ...ivitySquareCapitalReversedPaymentDetail.ts | 10 +- ...anceActivitySquarePayrollTransferDetail.ts | 10 +- ...vitySquarePayrollTransferReversedDetail.ts | 10 +- .../PaymentBalanceActivityTaxOnFeeDetail.ts | 12 +- ...ymentBalanceActivityThirdPartyFeeDetail.ts | 10 +- ...alanceActivityThirdPartyFeeRefundDetail.ts | 12 +- .../types/PaymentCreatedEvent.ts | 14 +- .../types/PaymentCreatedEventData.ts | 10 +- .../types/PaymentCreatedEventObject.ts | 8 +- src/serialization/types/PaymentLink.ts | 12 +- .../types/PaymentLinkRelatedResources.ts | 12 +- src/serialization/types/PaymentOptions.ts | 14 +- .../types/PaymentOptionsDelayAction.ts | 8 +- src/serialization/types/PaymentRefund.ts | 22 +- .../types/PaymentUpdatedEvent.ts | 14 +- .../types/PaymentUpdatedEventData.ts | 10 +- .../types/PaymentUpdatedEventObject.ts | 8 +- src/serialization/types/Payout.ts | 20 +- src/serialization/types/PayoutEntry.ts | 18 +- src/serialization/types/PayoutFailedEvent.ts | 16 +- .../types/PayoutFailedEventData.ts | 10 +- .../types/PayoutFailedEventObject.ts | 8 +- src/serialization/types/PayoutFee.ts | 10 +- src/serialization/types/PayoutFeeType.ts | 8 +- src/serialization/types/PayoutPaidEvent.ts | 16 +- .../types/PayoutPaidEventData.ts | 10 +- .../types/PayoutPaidEventObject.ts | 8 +- src/serialization/types/PayoutSentEvent.ts | 16 +- .../types/PayoutSentEventData.ts | 10 +- .../types/PayoutSentEventObject.ts | 8 +- src/serialization/types/PayoutStatus.ts | 8 +- src/serialization/types/PayoutType.ts | 8 +- src/serialization/types/Phase.ts | 16 +- src/serialization/types/PhaseInput.ts | 10 +- src/serialization/types/PrePopulatedData.ts | 12 +- src/serialization/types/ProcessingFee.ts | 12 +- src/serialization/types/Product.ts | 8 +- src/serialization/types/ProductType.ts | 8 +- .../types/PublishInvoiceResponse.ts | 10 +- .../types/PublishScheduledShiftResponse.ts | 10 +- src/serialization/types/QrCodeOptions.ts | 8 +- src/serialization/types/QuickPay.ts | 8 +- src/serialization/types/Range.ts | 12 +- src/serialization/types/ReceiptOptions.ts | 12 +- .../types/ReceiveTransferOrderResponse.ts | 22 - .../types/RedeemLoyaltyRewardResponse.ts | 8 +- src/serialization/types/Reference.ts | 19 - src/serialization/types/ReferenceType.ts | 43 - src/serialization/types/Refund.ts | 16 +- src/serialization/types/RefundCreatedEvent.ts | 14 +- .../types/RefundCreatedEventData.ts | 10 +- .../types/RefundCreatedEventObject.ts | 8 +- .../types/RefundPaymentResponse.ts | 8 +- src/serialization/types/RefundStatus.ts | 8 +- src/serialization/types/RefundUpdatedEvent.ts | 14 +- .../types/RefundUpdatedEventData.ts | 10 +- .../types/RefundUpdatedEventObject.ts | 8 +- .../types/RegisterDomainResponse.ts | 8 +- .../types/RegisterDomainResponseStatus.ts | 8 +- .../types/RemoveGroupFromCustomerResponse.ts | 8 +- .../types/ResumeSubscriptionResponse.ts | 8 +- ...ookingCustomAttributeDefinitionResponse.ts | 8 +- .../RetrieveBookingCustomAttributeResponse.ts | 8 +- .../types/RetrieveChannelResponse.ts | 22 - .../types/RetrieveJobResponse.ts | 10 +- .../RetrieveLocationBookingProfileResponse.ts | 10 +- ...cationCustomAttributeDefinitionResponse.ts | 8 +- ...RetrieveLocationCustomAttributeResponse.ts | 8 +- .../types/RetrieveLocationSettingsResponse.ts | 10 +- ...rchantCustomAttributeDefinitionResponse.ts | 8 +- ...RetrieveMerchantCustomAttributeResponse.ts | 8 +- .../types/RetrieveMerchantSettingsResponse.ts | 10 +- ...eOrderCustomAttributeDefinitionResponse.ts | 8 +- .../RetrieveOrderCustomAttributeResponse.ts | 8 +- .../types/RetrieveScheduledShiftResponse.ts | 10 +- .../types/RetrieveTimecardResponse.ts | 10 +- .../types/RetrieveTokenStatusResponse.ts | 8 +- .../types/RetrieveTransferOrderResponse.ts | 22 - .../types/RevokeTokenResponse.ts | 8 +- src/serialization/types/RiskEvaluation.ts | 8 +- .../types/RiskEvaluationRiskLevel.ts | 8 +- src/serialization/types/SaveCardOptions.ts | 10 +- src/serialization/types/ScheduledShift.ts | 8 +- .../types/ScheduledShiftDetails.ts | 22 +- .../types/ScheduledShiftFilter.ts | 18 +- .../ScheduledShiftFilterAssignmentStatus.ts | 8 +- ...cheduledShiftFilterScheduledShiftStatus.ts | 8 +- .../ScheduledShiftNotificationAudience.ts | 8 +- .../types/ScheduledShiftQuery.ts | 8 +- src/serialization/types/ScheduledShiftSort.ts | 8 +- .../types/ScheduledShiftSortField.ts | 8 +- .../types/ScheduledShiftWorkday.ts | 10 +- .../types/ScheduledShiftWorkdayMatcher.ts | 8 +- .../types/SearchAvailabilityFilter.ts | 16 +- .../types/SearchAvailabilityQuery.ts | 8 +- .../types/SearchAvailabilityResponse.ts | 8 +- .../SearchCatalogItemsRequestStockLevel.ts | 8 +- .../types/SearchCatalogItemsResponse.ts | 8 +- .../types/SearchCatalogObjectsResponse.ts | 8 +- .../types/SearchCustomersResponse.ts | 10 +- src/serialization/types/SearchEventsFilter.ts | 14 +- src/serialization/types/SearchEventsQuery.ts | 8 +- .../types/SearchEventsResponse.ts | 8 +- src/serialization/types/SearchEventsSort.ts | 8 +- .../types/SearchEventsSortField.ts | 8 +- .../types/SearchInvoicesResponse.ts | 10 +- ...yaltyAccountsRequestLoyaltyAccountQuery.ts | 12 +- .../types/SearchLoyaltyAccountsResponse.ts | 8 +- .../types/SearchLoyaltyEventsResponse.ts | 8 +- ...LoyaltyRewardsRequestLoyaltyRewardQuery.ts | 8 +- .../types/SearchLoyaltyRewardsResponse.ts | 8 +- .../types/SearchOrdersCustomerFilter.ts | 10 +- .../types/SearchOrdersDateTimeFilter.ts | 8 +- src/serialization/types/SearchOrdersFilter.ts | 12 +- .../types/SearchOrdersFulfillmentFilter.ts | 14 +- src/serialization/types/SearchOrdersQuery.ts | 8 +- .../types/SearchOrdersResponse.ts | 12 +- src/serialization/types/SearchOrdersSort.ts | 8 +- .../types/SearchOrdersSortField.ts | 8 +- .../types/SearchOrdersSourceFilter.ts | 10 +- .../types/SearchOrdersStateFilter.ts | 8 +- .../types/SearchScheduledShiftsResponse.ts | 10 +- .../types/SearchShiftsResponse.ts | 10 +- .../types/SearchSubscriptionsFilter.ts | 14 +- .../types/SearchSubscriptionsQuery.ts | 8 +- .../types/SearchSubscriptionsResponse.ts | 8 +- .../types/SearchTeamMembersFilter.ts | 12 +- .../types/SearchTeamMembersQuery.ts | 8 +- .../types/SearchTeamMembersResponse.ts | 10 +- .../types/SearchTerminalActionsResponse.ts | 8 +- .../types/SearchTerminalCheckoutsResponse.ts | 8 +- .../types/SearchTerminalRefundsResponse.ts | 8 +- .../types/SearchTimecardsResponse.ts | 10 +- .../types/SearchTransferOrdersResponse.ts | 24 - .../types/SearchVendorsRequestFilter.ts | 12 +- .../types/SearchVendorsRequestSort.ts | 8 +- .../types/SearchVendorsRequestSortField.ts | 8 +- .../types/SearchVendorsResponse.ts | 8 +- src/serialization/types/SegmentFilter.ts | 8 +- src/serialization/types/SelectOption.ts | 8 +- src/serialization/types/SelectOptions.ts | 8 +- src/serialization/types/Shift.ts | 22 +- src/serialization/types/ShiftFilter.ts | 16 +- src/serialization/types/ShiftFilterStatus.ts | 8 +- src/serialization/types/ShiftQuery.ts | 8 +- src/serialization/types/ShiftSort.ts | 8 +- src/serialization/types/ShiftSortField.ts | 8 +- src/serialization/types/ShiftStatus.ts | 8 +- src/serialization/types/ShiftWage.ts | 12 +- src/serialization/types/ShiftWorkday.ts | 10 +- .../types/ShiftWorkdayMatcher.ts | 8 +- src/serialization/types/ShippingFee.ts | 10 +- src/serialization/types/SignatureImage.ts | 8 +- src/serialization/types/SignatureOptions.ts | 8 +- src/serialization/types/Site.ts | 14 +- src/serialization/types/Snippet.ts | 8 +- src/serialization/types/SortOrder.ts | 8 +- src/serialization/types/SourceApplication.ts | 12 +- .../types/SquareAccountDetails.ts | 12 +- .../types/StandardUnitDescription.ts | 12 +- .../types/StandardUnitDescriptionGroup.ts | 12 +- .../types/StartTransferOrderResponse.ts | 22 - .../types/SubmitEvidenceResponse.ts | 10 +- src/serialization/types/Subscription.ts | 24 +- src/serialization/types/SubscriptionAction.ts | 18 +- .../types/SubscriptionActionType.ts | 12 +- .../types/SubscriptionCadence.ts | 8 +- .../types/SubscriptionCreatedEvent.ts | 14 +- .../types/SubscriptionCreatedEventData.ts | 10 +- .../types/SubscriptionCreatedEventObject.ts | 8 +- src/serialization/types/SubscriptionEvent.ts | 14 +- .../types/SubscriptionEventInfo.ts | 10 +- .../types/SubscriptionEventInfoCode.ts | 8 +- .../SubscriptionEventSubscriptionEventType.ts | 8 +- src/serialization/types/SubscriptionPhase.ts | 16 +- .../types/SubscriptionPricing.ts | 12 +- .../types/SubscriptionPricingType.ts | 8 +- src/serialization/types/SubscriptionSource.ts | 10 +- src/serialization/types/SubscriptionStatus.ts | 12 +- .../types/SubscriptionTestResult.ts | 12 +- .../types/SubscriptionUpdatedEvent.ts | 14 +- .../types/SubscriptionUpdatedEventData.ts | 10 +- .../types/SubscriptionUpdatedEventObject.ts | 8 +- src/serialization/types/SwapPlanResponse.ts | 8 +- .../types/TaxCalculationPhase.ts | 8 +- src/serialization/types/TaxIds.ts | 8 +- src/serialization/types/TaxInclusionType.ts | 8 +- src/serialization/types/TeamMember.ts | 20 +- .../types/TeamMemberAssignedLocations.ts | 10 +- ...amMemberAssignedLocationsAssignmentType.ts | 8 +- .../types/TeamMemberBookingProfile.ts | 10 +- .../types/TeamMemberCreatedEvent.ts | 14 +- .../types/TeamMemberCreatedEventData.ts | 10 +- .../types/TeamMemberCreatedEventObject.ts | 8 +- .../types/TeamMemberInvitationStatus.ts | 8 +- src/serialization/types/TeamMemberStatus.ts | 8 +- .../types/TeamMemberUpdatedEvent.ts | 14 +- .../types/TeamMemberUpdatedEventData.ts | 10 +- .../types/TeamMemberUpdatedEventObject.ts | 8 +- src/serialization/types/TeamMemberWage.ts | 16 +- .../TeamMemberWageSettingUpdatedEvent.ts | 14 +- .../TeamMemberWageSettingUpdatedEventData.ts | 10 +- ...TeamMemberWageSettingUpdatedEventObject.ts | 8 +- src/serialization/types/Tender.ts | 28 +- .../types/TenderBankAccountDetails.ts | 8 +- .../types/TenderBankAccountDetailsStatus.ts | 8 +- .../types/TenderBuyNowPayLaterDetails.ts | 8 +- .../types/TenderBuyNowPayLaterDetailsBrand.ts | 8 +- .../TenderBuyNowPayLaterDetailsStatus.ts | 8 +- src/serialization/types/TenderCardDetails.ts | 10 +- .../types/TenderCardDetailsEntryMethod.ts | 8 +- .../types/TenderCardDetailsStatus.ts | 8 +- src/serialization/types/TenderCashDetails.ts | 8 +- .../types/TenderSquareAccountDetails.ts | 8 +- .../types/TenderSquareAccountDetailsStatus.ts | 8 +- src/serialization/types/TenderType.ts | 8 +- src/serialization/types/TerminalAction.ts | 28 +- .../types/TerminalActionActionType.ts | 8 +- .../types/TerminalActionCreatedEvent.ts | 14 +- .../types/TerminalActionCreatedEventData.ts | 10 +- .../types/TerminalActionCreatedEventObject.ts | 8 +- .../types/TerminalActionQuery.ts | 8 +- .../types/TerminalActionQueryFilter.ts | 14 +- .../types/TerminalActionQuerySort.ts | 8 +- .../types/TerminalActionUpdatedEvent.ts | 14 +- .../types/TerminalActionUpdatedEventData.ts | 10 +- .../types/TerminalActionUpdatedEventObject.ts | 8 +- src/serialization/types/TerminalCheckout.ts | 28 +- .../types/TerminalCheckoutCreatedEvent.ts | 14 +- .../types/TerminalCheckoutCreatedEventData.ts | 10 +- .../TerminalCheckoutCreatedEventObject.ts | 8 +- .../types/TerminalCheckoutQuery.ts | 8 +- .../types/TerminalCheckoutQueryFilter.ts | 12 +- .../types/TerminalCheckoutQuerySort.ts | 8 +- .../types/TerminalCheckoutUpdatedEvent.ts | 14 +- .../types/TerminalCheckoutUpdatedEventData.ts | 10 +- .../TerminalCheckoutUpdatedEventObject.ts | 8 +- src/serialization/types/TerminalRefund.ts | 12 +- .../types/TerminalRefundCreatedEvent.ts | 14 +- .../types/TerminalRefundCreatedEventData.ts | 10 +- .../types/TerminalRefundCreatedEventObject.ts | 8 +- .../types/TerminalRefundQuery.ts | 8 +- .../types/TerminalRefundQueryFilter.ts | 12 +- .../types/TerminalRefundQuerySort.ts | 10 +- .../types/TerminalRefundUpdatedEvent.ts | 14 +- .../types/TerminalRefundUpdatedEventData.ts | 10 +- .../types/TerminalRefundUpdatedEventObject.ts | 8 +- .../types/TestWebhookSubscriptionResponse.ts | 8 +- src/serialization/types/TimeRange.ts | 12 +- src/serialization/types/Timecard.ts | 18 +- src/serialization/types/TimecardFilter.ts | 14 +- .../types/TimecardFilterStatus.ts | 8 +- src/serialization/types/TimecardQuery.ts | 8 +- src/serialization/types/TimecardSort.ts | 10 +- src/serialization/types/TimecardSortField.ts | 8 +- src/serialization/types/TimecardStatus.ts | 8 +- src/serialization/types/TimecardWage.ts | 12 +- src/serialization/types/TimecardWorkday.ts | 10 +- .../types/TimecardWorkdayMatcher.ts | 8 +- src/serialization/types/TipSettings.ts | 18 +- src/serialization/types/Transaction.ts | 24 +- src/serialization/types/TransactionProduct.ts | 8 +- src/serialization/types/TransactionType.ts | 8 +- src/serialization/types/TransferOrder.ts | 54 - .../types/TransferOrderCreatedEvent.ts | 27 - .../types/TransferOrderCreatedEventData.ts | 23 - .../types/TransferOrderCreatedEventObject.ts | 19 - .../types/TransferOrderDeletedEvent.ts | 27 - .../types/TransferOrderDeletedEventData.ts | 22 - .../types/TransferOrderFilter.ts | 29 - .../types/TransferOrderGoodsReceipt.ts | 22 - .../TransferOrderGoodsReceiptLineItem.ts | 24 - src/serialization/types/TransferOrderLine.ts | 30 - src/serialization/types/TransferOrderQuery.ts | 22 - src/serialization/types/TransferOrderSort.ts | 22 - .../types/TransferOrderSortField.ts | 14 - .../types/TransferOrderStatus.ts | 14 - .../types/TransferOrderUpdatedEvent.ts | 27 - .../types/TransferOrderUpdatedEventData.ts | 23 - .../types/TransferOrderUpdatedEventObject.ts | 19 - .../UnlinkCustomerFromGiftCardResponse.ts | 8 +- ...ookingCustomAttributeDefinitionResponse.ts | 8 +- .../types/UpdateBookingResponse.ts | 8 +- .../types/UpdateBreakTypeResponse.ts | 8 +- .../types/UpdateCatalogImageRequest.ts | 8 +- .../types/UpdateCatalogImageResponse.ts | 8 +- ...stomerCustomAttributeDefinitionResponse.ts | 8 +- .../types/UpdateCustomerGroupResponse.ts | 10 +- .../types/UpdateCustomerResponse.ts | 10 +- .../types/UpdateInvoiceResponse.ts | 10 +- .../types/UpdateItemModifierListsResponse.ts | 8 +- .../types/UpdateItemTaxesResponse.ts | 8 +- src/serialization/types/UpdateJobResponse.ts | 10 +- ...cationCustomAttributeDefinitionResponse.ts | 8 +- .../types/UpdateLocationResponse.ts | 8 +- .../types/UpdateLocationSettingsResponse.ts | 10 +- ...rchantCustomAttributeDefinitionResponse.ts | 8 +- .../types/UpdateMerchantSettingsResponse.ts | 10 +- ...eOrderCustomAttributeDefinitionResponse.ts | 8 +- .../types/UpdateOrderResponse.ts | 10 +- .../types/UpdatePaymentLinkResponse.ts | 8 +- .../types/UpdatePaymentResponse.ts | 8 +- .../types/UpdateScheduledShiftResponse.ts | 10 +- .../types/UpdateShiftResponse.ts | 10 +- .../types/UpdateSubscriptionResponse.ts | 8 +- .../types/UpdateTeamMemberRequest.ts | 8 +- .../types/UpdateTeamMemberResponse.ts | 10 +- .../types/UpdateTimecardResponse.ts | 10 +- .../types/UpdateTransferOrderData.ts | 35 - .../types/UpdateTransferOrderLineData.ts | 24 - .../types/UpdateTransferOrderResponse.ts | 22 - .../types/UpdateVendorRequest.ts | 10 +- .../types/UpdateVendorResponse.ts | 8 +- .../types/UpdateWageSettingResponse.ts | 10 +- .../UpdateWebhookSubscriptionResponse.ts | 8 +- ...WebhookSubscriptionSignatureKeyResponse.ts | 8 +- .../types/UpdateWorkweekConfigResponse.ts | 10 +- .../UpsertBookingCustomAttributeResponse.ts | 8 +- .../types/UpsertCatalogObjectResponse.ts | 10 +- .../UpsertCustomerCustomAttributeResponse.ts | 8 +- .../UpsertLocationCustomAttributeResponse.ts | 8 +- .../UpsertMerchantCustomAttributeResponse.ts | 8 +- .../UpsertOrderCustomAttributeResponse.ts | 8 +- .../types/UpsertSnippetResponse.ts | 8 +- .../types/V1GetPaymentRequest.ts | 8 +- .../types/V1GetSettlementRequest.ts | 8 +- src/serialization/types/V1Money.ts | 10 +- src/serialization/types/V1Order.ts | 42 +- .../types/V1OrderHistoryEntry.ts | 8 +- .../types/V1OrderHistoryEntryAction.ts | 8 +- src/serialization/types/V1OrderState.ts | 8 +- src/serialization/types/V1Tender.ts | 28 +- src/serialization/types/V1TenderCardBrand.ts | 8 +- .../types/V1TenderEntryMethod.ts | 8 +- src/serialization/types/V1TenderType.ts | 8 +- .../types/V1UpdateOrderRequestAction.ts | 8 +- src/serialization/types/Vendor.ts | 16 +- src/serialization/types/VendorContact.ts | 16 +- src/serialization/types/VendorCreatedEvent.ts | 16 +- .../types/VendorCreatedEventData.ts | 10 +- .../types/VendorCreatedEventObject.ts | 10 +- .../VendorCreatedEventObjectOperation.ts | 8 +- src/serialization/types/VendorStatus.ts | 8 +- src/serialization/types/VendorUpdatedEvent.ts | 16 +- .../types/VendorUpdatedEventData.ts | 10 +- .../types/VendorUpdatedEventObject.ts | 10 +- .../VendorUpdatedEventObjectOperation.ts | 8 +- src/serialization/types/VisibilityFilter.ts | 8 +- .../types/VoidTransactionResponse.ts | 8 +- src/serialization/types/WageSetting.ts | 14 +- .../types/WebhookSubscription.ts | 18 +- src/serialization/types/Weekday.ts | 8 +- src/serialization/types/WorkweekConfig.ts | 8 +- src/serialization/types/index.ts | 248 +- src/version.ts | 2 +- tests/BrowserTestEnvironment.ts | 17 + tests/bigint.setup.ts | 2 + tests/mock-server/MockServer.ts | 4 +- tests/mock-server/MockServerPool.ts | 10 +- tests/mock-server/mockEndpointBuilder.ts | 48 +- tests/mock-server/withFormUrlEncoded.ts | 80 - tests/mock-server/withHeaders.ts | 2 +- tests/mock-server/withJson.ts | 18 +- tests/setup.ts | 87 - tests/tsconfig.json | 2 +- tests/unit/auth/BasicAuth.test.ts | 92 +- tests/unit/fetcher/Fetcher.test.ts | 11 +- .../unit/fetcher/HttpResponsePromise.test.ts | 2 +- tests/unit/fetcher/createRequestUrl.test.ts | 305 +- tests/unit/fetcher/getFetchFn.test.ts | 4 +- tests/unit/fetcher/getRequestBody.test.ts | 154 +- tests/unit/fetcher/getResponseBody.test.ts | 88 +- tests/unit/fetcher/logging.test.ts | 517 -- tests/unit/fetcher/redacting.test.ts | 1115 --- tests/unit/fetcher/requestWithRetries.test.ts | 86 +- .../Node18UniversalStreamWrapper.test.ts | 2 +- .../NodePre18StreamWrapper.test.ts | 4 +- .../chooseStreamWrapper.test.ts | 2 +- tests/unit/file/file.test.ts | 498 -- .../form-data-utils/formDataWrapper.test.ts | 34 +- tests/unit/logging/logger.test.ts | 454 -- tests/unit/schemas/lazy/lazy.test.ts | 2 +- tests/unit/schemas/primitives/never.test.ts | 54 - .../schema-utils/getSchemaUtils.test.ts | 6 +- tests/unit/schemas/utils/itSchema.ts | 6 +- tests/unit/schemas/utils/itValidate.ts | 2 +- tests/unit/test-file.txt | 1 - tests/unit/url/join.test.ts | 315 +- tests/unit/url/qs.test.ts | 375 +- tests/wire/applePay.test.ts | 10 +- tests/wire/bankAccounts.test.ts | 131 +- tests/wire/bookings.test.ts | 121 +- .../customAttributeDefinitions.test.ts | 106 +- tests/wire/bookings/customAttributes.test.ts | 94 +- tests/wire/bookings/locationProfiles.test.ts | 64 - .../wire/bookings/teamMemberProfiles.test.ts | 82 +- tests/wire/cards.test.ts | 117 +- tests/wire/cashDrawers/shifts.test.ts | 251 +- tests/wire/catalog.test.ts | 187 +- tests/wire/catalog/object.test.ts | 35 +- tests/wire/channels.test.ts | 239 - tests/wire/checkout.test.ts | 16 +- tests/wire/checkout/paymentLinks.test.ts | 108 +- tests/wire/customers.test.ts | 129 +- tests/wire/customers/cards.test.ts | 12 +- .../customAttributeDefinitions.test.ts | 108 +- tests/wire/customers/customAttributes.test.ts | 90 +- tests/wire/customers/groups.test.ts | 86 +- tests/wire/customers/segments.test.ts | 100 +- tests/wire/devices.test.ts | 248 +- tests/wire/devices/codes.test.ts | 108 +- tests/wire/disputes.test.ts | 141 +- tests/wire/disputes/evidence.test.ts | 96 +- tests/wire/employees.test.ts | 78 +- tests/wire/events.test.ts | 16 +- tests/wire/giftCards.test.ts | 111 +- tests/wire/giftCards/activities.test.ts | 232 +- tests/wire/inventory.test.ts | 343 +- tests/wire/invoices.test.ts | 360 +- tests/wire/labor.test.ts | 30 +- tests/wire/labor/breakTypes.test.ts | 99 +- tests/wire/labor/employeeWages.test.ts | 113 +- tests/wire/labor/shifts.test.ts | 18 +- tests/wire/labor/teamMemberWages.test.ts | 129 +- tests/wire/labor/workweekConfigs.test.ts | 68 +- tests/wire/locations.test.ts | 18 +- .../customAttributeDefinitions.test.ts | 107 +- tests/wire/locations/customAttributes.test.ts | 95 +- tests/wire/locations/transactions.test.ts | 16 +- tests/wire/loyalty.test.ts | 10 +- tests/wire/loyalty/accounts.test.ts | 18 +- tests/wire/loyalty/programs.test.ts | 14 +- .../wire/loyalty/programs/promotions.test.ts | 173 +- tests/wire/loyalty/rewards.test.ts | 18 +- tests/wire/merchants.test.ts | 71 +- .../customAttributeDefinitions.test.ts | 107 +- tests/wire/merchants/customAttributes.test.ts | 95 +- tests/wire/mobile.test.ts | 10 +- tests/wire/oAuth.test.ts | 16 +- tests/wire/orders.test.ts | 24 +- .../orders/customAttributeDefinitions.test.ts | 131 +- tests/wire/orders/customAttributes.test.ts | 79 +- tests/wire/payments.test.ts | 220 +- tests/wire/payouts.test.ts | 241 +- tests/wire/refunds.test.ts | 113 +- tests/wire/sites.test.ts | 10 +- tests/wire/snippets.test.ts | 14 +- tests/wire/subscriptions.test.ts | 217 +- tests/wire/team.test.ts | 16 +- tests/wire/teamMembers.test.ts | 20 +- tests/wire/teamMembers/wageSetting.test.ts | 12 +- tests/wire/terminal.test.ts | 14 +- tests/wire/terminal/actions.test.ts | 16 +- tests/wire/terminal/checkouts.test.ts | 16 +- tests/wire/terminal/refunds.test.ts | 16 +- tests/wire/transferOrders.test.ts | 907 --- tests/wire/v1Transactions.test.ts | 14 +- tests/wire/vendors.test.ts | 22 +- tests/wire/webhooks/eventTypes.test.ts | 10 +- tests/wire/webhooks/subscriptions.test.ts | 86 +- tsconfig.json | 2 - yarn.lock | 516 +- 3615 files changed, 30582 insertions(+), 37527 deletions(-) delete mode 100644 .fern/metadata.json create mode 100644 .prettierrc.yml delete mode 100644 CONTRIBUTING.md delete mode 100644 biome.json create mode 100644 changelog.md delete mode 100644 src/BaseClient.ts delete mode 100644 src/api/resources/channels/client/Client.ts delete mode 100644 src/api/resources/channels/client/index.ts delete mode 100644 src/api/resources/channels/client/requests/BulkRetrieveChannelsRequest.ts delete mode 100644 src/api/resources/channels/client/requests/GetChannelsRequest.ts delete mode 100644 src/api/resources/channels/client/requests/ListChannelsRequest.ts delete mode 100644 src/api/resources/channels/client/requests/index.ts delete mode 100644 src/api/resources/channels/index.ts delete mode 100644 src/api/resources/transferOrders/client/Client.ts delete mode 100644 src/api/resources/transferOrders/client/index.ts delete mode 100644 src/api/resources/transferOrders/client/requests/CancelTransferOrderRequest.ts delete mode 100644 src/api/resources/transferOrders/client/requests/CreateTransferOrderRequest.ts delete mode 100644 src/api/resources/transferOrders/client/requests/DeleteTransferOrdersRequest.ts delete mode 100644 src/api/resources/transferOrders/client/requests/GetTransferOrdersRequest.ts delete mode 100644 src/api/resources/transferOrders/client/requests/ReceiveTransferOrderRequest.ts delete mode 100644 src/api/resources/transferOrders/client/requests/SearchTransferOrdersRequest.ts delete mode 100644 src/api/resources/transferOrders/client/requests/StartTransferOrderRequest.ts delete mode 100644 src/api/resources/transferOrders/client/requests/UpdateTransferOrderRequest.ts delete mode 100644 src/api/resources/transferOrders/client/requests/index.ts delete mode 100644 src/api/resources/transferOrders/index.ts delete mode 100644 src/api/types/BulkRetrieveChannelsRequestConstants.ts delete mode 100644 src/api/types/BulkRetrieveChannelsResponse.ts delete mode 100644 src/api/types/CancelTransferOrderResponse.ts delete mode 100644 src/api/types/Channel.ts delete mode 100644 src/api/types/ChannelStatus.ts delete mode 100644 src/api/types/CreateTransferOrderData.ts delete mode 100644 src/api/types/CreateTransferOrderLineData.ts delete mode 100644 src/api/types/CreateTransferOrderResponse.ts delete mode 100644 src/api/types/DeleteTransferOrderResponse.ts delete mode 100644 src/api/types/ListChannelsRequestConstants.ts delete mode 100644 src/api/types/ListChannelsResponse.ts delete mode 100644 src/api/types/ReceiveTransferOrderResponse.ts delete mode 100644 src/api/types/Reference.ts delete mode 100644 src/api/types/ReferenceType.ts delete mode 100644 src/api/types/RetrieveChannelResponse.ts delete mode 100644 src/api/types/RetrieveTransferOrderResponse.ts delete mode 100644 src/api/types/SearchTransferOrdersResponse.ts delete mode 100644 src/api/types/StartTransferOrderResponse.ts delete mode 100644 src/api/types/TransferOrder.ts delete mode 100644 src/api/types/TransferOrderCreatedEvent.ts delete mode 100644 src/api/types/TransferOrderCreatedEventData.ts delete mode 100644 src/api/types/TransferOrderCreatedEventObject.ts delete mode 100644 src/api/types/TransferOrderDeletedEvent.ts delete mode 100644 src/api/types/TransferOrderDeletedEventData.ts delete mode 100644 src/api/types/TransferOrderFilter.ts delete mode 100644 src/api/types/TransferOrderGoodsReceipt.ts delete mode 100644 src/api/types/TransferOrderGoodsReceiptLineItem.ts delete mode 100644 src/api/types/TransferOrderLine.ts delete mode 100644 src/api/types/TransferOrderQuery.ts delete mode 100644 src/api/types/TransferOrderSort.ts delete mode 100644 src/api/types/TransferOrderSortField.ts delete mode 100644 src/api/types/TransferOrderStatus.ts delete mode 100644 src/api/types/TransferOrderUpdatedEvent.ts delete mode 100644 src/api/types/TransferOrderUpdatedEventData.ts delete mode 100644 src/api/types/TransferOrderUpdatedEventObject.ts delete mode 100644 src/api/types/UpdateTransferOrderData.ts delete mode 100644 src/api/types/UpdateTransferOrderLineData.ts delete mode 100644 src/api/types/UpdateTransferOrderResponse.ts delete mode 100644 src/core/auth/AuthProvider.ts delete mode 100644 src/core/auth/AuthRequest.ts delete mode 100644 src/core/exports.ts delete mode 100644 src/core/fetcher/EndpointMetadata.ts delete mode 100644 src/core/fetcher/EndpointSupplier.ts delete mode 100644 src/core/file/exports.ts delete mode 100644 src/core/file/file.ts delete mode 100644 src/core/file/index.ts delete mode 100644 src/core/file/types.ts delete mode 100644 src/core/logging/exports.ts delete mode 100644 src/core/logging/index.ts delete mode 100644 src/core/logging/logger.ts create mode 100644 src/core/pagination/Pageable.ts delete mode 100644 src/core/pagination/exports.ts delete mode 100644 src/core/schemas/builders/primitives/never.ts delete mode 100644 src/core/url/encodePathParam.ts delete mode 100644 src/exports.ts delete mode 100644 src/serialization/resources/channels/client/index.ts delete mode 100644 src/serialization/resources/channels/client/requests/BulkRetrieveChannelsRequest.ts delete mode 100644 src/serialization/resources/channels/client/requests/index.ts delete mode 100644 src/serialization/resources/channels/index.ts delete mode 100644 src/serialization/resources/transferOrders/client/index.ts delete mode 100644 src/serialization/resources/transferOrders/client/requests/CancelTransferOrderRequest.ts delete mode 100644 src/serialization/resources/transferOrders/client/requests/CreateTransferOrderRequest.ts delete mode 100644 src/serialization/resources/transferOrders/client/requests/ReceiveTransferOrderRequest.ts delete mode 100644 src/serialization/resources/transferOrders/client/requests/SearchTransferOrdersRequest.ts delete mode 100644 src/serialization/resources/transferOrders/client/requests/StartTransferOrderRequest.ts delete mode 100644 src/serialization/resources/transferOrders/client/requests/UpdateTransferOrderRequest.ts delete mode 100644 src/serialization/resources/transferOrders/client/requests/index.ts delete mode 100644 src/serialization/resources/transferOrders/index.ts delete mode 100644 src/serialization/types/BulkRetrieveChannelsRequestConstants.ts delete mode 100644 src/serialization/types/BulkRetrieveChannelsResponse.ts delete mode 100644 src/serialization/types/CancelTransferOrderResponse.ts delete mode 100644 src/serialization/types/Channel.ts delete mode 100644 src/serialization/types/ChannelStatus.ts delete mode 100644 src/serialization/types/CreateTransferOrderData.ts delete mode 100644 src/serialization/types/CreateTransferOrderLineData.ts delete mode 100644 src/serialization/types/CreateTransferOrderResponse.ts delete mode 100644 src/serialization/types/DeleteTransferOrderResponse.ts delete mode 100644 src/serialization/types/ListChannelsRequestConstants.ts delete mode 100644 src/serialization/types/ListChannelsResponse.ts delete mode 100644 src/serialization/types/ReceiveTransferOrderResponse.ts delete mode 100644 src/serialization/types/Reference.ts delete mode 100644 src/serialization/types/ReferenceType.ts delete mode 100644 src/serialization/types/RetrieveChannelResponse.ts delete mode 100644 src/serialization/types/RetrieveTransferOrderResponse.ts delete mode 100644 src/serialization/types/SearchTransferOrdersResponse.ts delete mode 100644 src/serialization/types/StartTransferOrderResponse.ts delete mode 100644 src/serialization/types/TransferOrder.ts delete mode 100644 src/serialization/types/TransferOrderCreatedEvent.ts delete mode 100644 src/serialization/types/TransferOrderCreatedEventData.ts delete mode 100644 src/serialization/types/TransferOrderCreatedEventObject.ts delete mode 100644 src/serialization/types/TransferOrderDeletedEvent.ts delete mode 100644 src/serialization/types/TransferOrderDeletedEventData.ts delete mode 100644 src/serialization/types/TransferOrderFilter.ts delete mode 100644 src/serialization/types/TransferOrderGoodsReceipt.ts delete mode 100644 src/serialization/types/TransferOrderGoodsReceiptLineItem.ts delete mode 100644 src/serialization/types/TransferOrderLine.ts delete mode 100644 src/serialization/types/TransferOrderQuery.ts delete mode 100644 src/serialization/types/TransferOrderSort.ts delete mode 100644 src/serialization/types/TransferOrderSortField.ts delete mode 100644 src/serialization/types/TransferOrderStatus.ts delete mode 100644 src/serialization/types/TransferOrderUpdatedEvent.ts delete mode 100644 src/serialization/types/TransferOrderUpdatedEventData.ts delete mode 100644 src/serialization/types/TransferOrderUpdatedEventObject.ts delete mode 100644 src/serialization/types/UpdateTransferOrderData.ts delete mode 100644 src/serialization/types/UpdateTransferOrderLineData.ts delete mode 100644 src/serialization/types/UpdateTransferOrderResponse.ts create mode 100644 tests/BrowserTestEnvironment.ts delete mode 100644 tests/mock-server/withFormUrlEncoded.ts delete mode 100644 tests/setup.ts delete mode 100644 tests/unit/fetcher/logging.test.ts delete mode 100644 tests/unit/fetcher/redacting.test.ts delete mode 100644 tests/unit/file/file.test.ts delete mode 100644 tests/unit/logging/logger.test.ts delete mode 100644 tests/unit/schemas/primitives/never.test.ts delete mode 100644 tests/unit/test-file.txt delete mode 100644 tests/wire/bookings/locationProfiles.test.ts delete mode 100644 tests/wire/channels.test.ts delete mode 100644 tests/wire/transferOrders.test.ts diff --git a/.fern/metadata.json b/.fern/metadata.json deleted file mode 100644 index eb5c29ba1..000000000 --- a/.fern/metadata.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "cliVersion": "2.2.5", - "generatorName": "fernapi/fern-typescript-sdk", - "generatorVersion": "3.33.0", - "generatorConfig": { - "namespaceExport": "Square", - "allowCustomFetcher": true, - "skipResponseValidation": true, - "inlineFileProperties": true, - "inlinePathParameters": true, - "enableInlineTypes": false, - "noSerdeLayer": false, - "useLegacyExports": true, - "streamType": "wrapper", - "fileResponseType": "stream", - "formDataSupport": "Node16", - "fetchSupport": "node-fetch", - "omitUndefined": true, - "useBigInt": true, - "packageManager": "yarn", - "testFramework": "jest", - "packageJson": { - "description": "Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.", - "author": { - "name": "Square Developer Platform", - "url": "https://developer.squareup.com", - "email": "developers@squareup.com" - }, - "bugs": { - "url": "https://developer.squareup.com", - "email": "developers@squareup.com" - }, - "dependencies": { - "square-legacy": "npm:square@^39.1.1" - }, - "exports": { - ".": "./index.js", - "./legacy": { - "types": "./legacy/exports/index.d.ts", - "require": { - "types": "./legacy/exports/index.d.ts", - "default": "./legacy/exports/index.js" - }, - "import": { - "types": "./legacy/exports/index.d.mts", - "default": "./legacy/exports/index.mjs" - } - } - }, - "scripts": { - "test": "jest --selectProjects unit wire", - "test:unit": "jest --selectProjects unit", - "test:integration": "jest --selectProjects integration" - } - } - } -} diff --git a/.fernignore b/.fernignore index db56945d0..b183571eb 100644 --- a/.fernignore +++ b/.fernignore @@ -12,3 +12,4 @@ tests/unit/fetcher/stream-wrappers/webpack.test.ts tests/integration legacy jest.config.mjs +changelog.md diff --git a/.npmignore b/.npmignore index d730bd7d3..6db0876c4 100644 --- a/.npmignore +++ b/.npmignore @@ -4,14 +4,6 @@ tests .gitignore .github .fernignore -.fern .prettierrc.yml -biome.json tsconfig.json -yarn.lock -pnpm-lock.yaml -.mock -dist -scripts -jest.config.* -vitest.config.* \ No newline at end of file +yarn.lock \ No newline at end of file diff --git a/.prettierrc.yml b/.prettierrc.yml new file mode 100644 index 000000000..0c06786bf --- /dev/null +++ b/.prettierrc.yml @@ -0,0 +1,2 @@ +tabWidth: 4 +printWidth: 120 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 4b59dbc97..000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,133 +0,0 @@ -# Contributing - -Thanks for your interest in contributing to this SDK! This document provides guidelines for contributing to the project. - -## Getting Started - -### Prerequisites - -- Node.js 20 or higher -- yarn package manager - -### Installation - -Install the project dependencies: - -```bash -yarn install -``` - -### Building - -Build the project: - -```bash -yarn build -``` - -### Testing - -Run the test suite: - -```bash -yarn test -``` - -Run specific test types: -- `yarn test:unit` - Run unit tests -- `yarn test:wire` - Run wire/integration tests - -### Linting and Formatting - -Check code style: - -```bash -yarn run lint -yarn run format:check -``` - -Fix code style issues: - -```bash -yarn run lint:fix -yarn run format:fix -``` - -Or use the combined check command: - -```bash -yarn run check:fix -``` - -## About Generated Code - -**Important**: Most files in this SDK are automatically generated by [Fern](https://buildwithfern.com) from the API definition. Direct modifications to generated files will be overwritten the next time the SDK is generated. - -### Generated Files - -The following directories contain generated code: -- `src/api/` - API client classes and types -- `src/serialization/` - Serialization/deserialization logic -- Most TypeScript files in `src/` - -### How to Customize - -If you need to customize the SDK, you have two options: - -#### Option 1: Use `.fernignore` - -For custom code that should persist across SDK regenerations: - -1. Create a `.fernignore` file in the project root -2. Add file patterns for files you want to preserve (similar to `.gitignore` syntax) -3. Add your custom code to those files - -Files listed in `.fernignore` will not be overwritten when the SDK is regenerated. - -For more information, see the [Fern documentation on custom code](https://buildwithfern.com/learn/sdks/overview/custom-code). - -#### Option 2: Contribute to the Generator - -If you want to change how code is generated for all users of this SDK: - -1. The TypeScript SDK generator lives in the [Fern repository](https://github.com/fern-api/fern) -2. Generator code is located at `generators/typescript/sdk/` -3. Follow the [Fern contributing guidelines](https://github.com/fern-api/fern/blob/main/CONTRIBUTING.md) -4. Submit a pull request with your changes to the generator - -This approach is best for: -- Bug fixes in generated code -- New features that would benefit all users -- Improvements to code generation patterns - -## Making Changes - -### Workflow - -1. Create a new branch for your changes -2. Make your modifications -3. Run tests to ensure nothing breaks: `yarn test` -4. Run linting and formatting: `yarn run check:fix` -5. Build the project: `yarn build` -6. Commit your changes with a clear commit message -7. Push your branch and create a pull request - -### Commit Messages - -Write clear, descriptive commit messages that explain what changed and why. - -### Code Style - -This project uses automated code formatting and linting. Run `yarn run check:fix` before committing to ensure your code meets the project's style guidelines. - -## Questions or Issues? - -If you have questions or run into issues: - -1. Check the [Fern documentation](https://buildwithfern.com) -2. Search existing [GitHub issues](https://github.com/fern-api/fern/issues) -3. Open a new issue if your question hasn't been addressed - -## License - -By contributing to this project, you agree that your contributions will be licensed under the same license as the project. diff --git a/LICENSE b/LICENSE index f5669d1d5..878ffc142 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2025 Square. +Copyright (c) 2026 Square. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 42ea71816..f54d2d67e 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,27 @@ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fsquare%2Fsquare-nodejs-sdk) [![npm shield](https://img.shields.io/npm/v/square)](https://www.npmjs.com/package/square) -The Square TypeScript library provides convenient access to the Square API from TypeScript. +The Square TypeScript library provides convenient access to the Square APIs from TypeScript. + +## Table of Contents + +- [Installation](#installation) +- [Reference](#reference) +- [Versioning](#versioning) +- [Usage](#usage) +- [Legacy Sdk](#legacy-sdk) +- [Request and Response Types](#request-and-response-types) +- [Exception Handling](#exception-handling) +- [Pagination](#pagination) +- [Webhook Signature Verification](#webhook-signature-verification) +- [Advanced](#advanced) + - [Additional Headers](#additional-headers) + - [Retries](#retries) + - [Timeouts](#timeouts) + - [Aborting Requests](#aborting-requests) + - [Access Raw Response Data](#access-raw-response-data) + - [Runtime Compatibility](#runtime-compatibility) +- [Contributing](#contributing) ## Installation @@ -13,7 +33,7 @@ npm i -s square ## Reference -A full reference for this library is available [here](./reference.md). +A full reference for this library is available [here](https://github.com/square/square-nodejs-sdk/blob/HEAD/./reference.md). ## Versioning @@ -38,11 +58,11 @@ await client.payments.create({ sourceId: "ccof:GaJGNaZa8x4OgDJn4GB", idempotencyKey: "7b0f3ec5-086a-4871-8f13-3c81b3875218", amountMoney: { - amount: BigInt(1000), + amount: BigInt("1000"), currency: "USD", }, appFeeMoney: { - amount: BigInt(10), + amount: BigInt("10"), currency: "USD", }, autocomplete: true, @@ -68,41 +88,41 @@ import { Square, SquareClient } from "square"; import { Client } from "square/legacy"; const client = new SquareClient({ - token: process.env.SQUARE_ACCESS_TOKEN, + token: process.env.SQUARE_ACCESS_TOKEN, }); const legacyClient = new Client({ - bearerAuthCredentials: { - accessToken: process.env.SQUARE_ACCESS_TOKEN!, - }, + bearerAuthCredentials: { + accessToken: process.env.SQUARE_ACCESS_TOKEN!, + }, }); async function getLocation(): Promise { - return ( - await client.locations.get({ - locationId: "YOUR_LOCATION_ID", - }) - ).location!; + return ( + await client.locations.get({ + locationId: "YOUR_LOCATION_ID", + }) + ).location!; } async function createOrder() { - const location = await getLocation(); - await legacyClient.ordersApi.createOrder({ - idempotencyKey: randomUUID(), - order: { - locationId: location.id!, - lineItems: [ - { - name: "New Item", - quantity: "1", - basePriceMoney: { - amount: BigInt(100), - currency: "USD", - }, + const location = await getLocation(); + await legacyClient.ordersApi.createOrder({ + idempotencyKey: randomUUID(), + order: { + locationId: location.id!, + lineItems: [ + { + name: "New Item", + quantity: "1", + basePriceMoney: { + amount: BigInt(100), + currency: "USD", + }, + }, + ], }, - ], - }, - }); + }); } createOrder(); @@ -119,7 +139,7 @@ We recommend migrating to the new SDK using the following steps: 3. Gradually move over to use the new SDK by importing it from the `"square"` import. -## Request And Response Types +## Request and Response Types The SDK exports all request and response types as TypeScript interfaces. Simply import them with the following namespace: @@ -147,6 +167,7 @@ try { console.log(err.statusCode); console.log(err.message); console.log(err.body); + console.log(err.rawResponse); } } ``` @@ -159,13 +180,21 @@ List endpoints are paginated. The SDK provides an iterator so that you can simpl import { SquareClient } from "square"; const client = new SquareClient({ token: "YOUR_TOKEN" }); -const response = await client.bankAccounts.list(); +const response = await client.bankAccounts.list({ + cursor: "cursor", + limit: 1, + locationId: "location_id", +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -const page = await client.bankAccounts.list(); +let page = await client.bankAccounts.list({ + cursor: "cursor", + limit: 1, + locationId: "location_id", +}); while (page.hasNextPage()) { page = page.getNextPage(); } @@ -173,17 +202,17 @@ while (page.hasNextPage()) { ## Webhook Signature Verification -The SDK provides utility methods that allow you to verify webhook signatures and ensure that all +The SDK provides utility methods that allow you to verify webhook signatures and ensure that all webhook events originate from Square. The `Webhooks.verifySignature` method will verify the signature. ```ts import { WebhooksHelper } from "square"; const isValid = WebhooksHelper.verifySignature({ - requestBody, - signatureHeader: request.headers['x-square-hmacsha256-signature'], - signatureKey: "YOUR_SIGNATURE_KEY", - notificationUrl: "https://example.com/webhook", // The URL where event notifications are sent. + requestBody, + signatureHeader: request.headers["x-square-hmacsha256-signature"], + signatureKey: "YOUR_SIGNATURE_KEY", + notificationUrl: "https://example.com/webhook", // The URL where event notifications are sent. }); ``` @@ -201,30 +230,13 @@ const response = await client.payments.create(..., { }); ``` -### Receive extra properties - -Every response includes any extra properties in the JSON response that were not specified in the type. -This can be useful for API features not present in the SDK yet. - -You can receive and interact with the extra properties by accessing each one directly like so: - -```typescript -const response = await client.locations.create(...); - -// Cast the response type into an `any`. -const location = response.location as any; - -// Then access the extra property by its name. -const undocumentedProperty = location.undocumentedProperty; -``` - ### Retries The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long -as the request is deemed retriable and the number of retry attempts has not grown larger than the configured +as the request is deemed retryable and the number of retry attempts has not grown larger than the configured retry limit (default: 2). -A request is deemed retriable when any of the following HTTP status codes is returned: +A request is deemed retryable when any of the following HTTP status codes is returned: - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout) - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests) @@ -260,6 +272,18 @@ const response = await client.payments.create(..., { controller.abort(); // aborts the request ``` +### Access Raw Response Data + +The SDK provides access to raw response data, including headers, through the `.withRawResponse()` method. +The `.withRawResponse()` method returns a promise that results to an object with a `data` and a `rawResponse` property. + +```typescript +const { data, rawResponse } = await client.payments.create(...).withRawResponse(); + +console.log(data); +console.log(rawResponse.headers['X-My-Header']); +``` + ### Runtime Compatibility The SDK defaults to `node-fetch` but will use the global fetch client if present. The SDK works in the following @@ -274,7 +298,7 @@ runtimes: ### Customizing Fetch Client -The SDK provides a way for your to customize the underlying HTTP client / Fetch function. If you're running in an +The SDK provides a way for you to customize the underlying HTTP client / Fetch function. If you're running in an unsupported environment, this provides a way for you to break glass and ensure the SDK works. ```typescript diff --git a/biome.json b/biome.json deleted file mode 100644 index a777468e4..000000000 --- a/biome.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/2.3.1/schema.json", - "root": true, - "vcs": { - "enabled": false - }, - "files": { - "ignoreUnknown": true, - "includes": [ - "**", - "!!dist", - "!!**/dist", - "!!lib", - "!!**/lib", - "!!_tmp_*", - "!!**/_tmp_*", - "!!*.tmp", - "!!**/*.tmp", - "!!.tmp/", - "!!**/.tmp/", - "!!*.log", - "!!**/*.log", - "!!**/.DS_Store", - "!!**/Thumbs.db" - ] - }, - "formatter": { - "enabled": true, - "indentStyle": "space", - "indentWidth": 4, - "lineWidth": 120 - }, - "javascript": { - "formatter": { - "quoteStyle": "double" - } - }, - "assist": { - "enabled": true, - "actions": { - "source": { - "organizeImports": "on" - } - } - }, - "linter": { - "rules": { - "style": { - "useNodejsImportProtocol": "off" - }, - "suspicious": { - "noAssignInExpressions": "warn", - "noUselessEscapeInString": { - "level": "warn", - "fix": "none", - "options": {} - }, - "noThenProperty": "warn", - "useIterableCallbackReturn": "warn", - "noShadowRestrictedNames": "warn", - "noTsIgnore": { - "level": "warn", - "fix": "none", - "options": {} - }, - "noConfusingVoidType": { - "level": "warn", - "fix": "none", - "options": {} - } - } - } - } -} diff --git a/changelog.md b/changelog.md new file mode 100644 index 000000000..aa5a5e176 --- /dev/null +++ b/changelog.md @@ -0,0 +1,4 @@ +## 43.2.2 - 2026-01-16 +* SDK regeneration +* Unable to analyze changes with AI, incrementing PATCH version. + diff --git a/package.json b/package.json index 3e168ab12..c9eb4d10f 100644 --- a/package.json +++ b/package.json @@ -1,27 +1,23 @@ { "name": "square", - "version": "43.2.1", + "version": "43.2.2", "private": false, "repository": "github:square/square-nodejs-sdk", "license": "MIT", "main": "./index.js", "types": "./index.d.ts", "scripts": { - "format": "biome format --write --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", - "format:check": "biome format --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", - "lint": "biome lint --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", - "lint:fix": "biome lint --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", - "check": "biome check --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", - "check:fix": "biome check --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", + "format": "prettier . --write --ignore-unknown", "build": "tsc", "prepack": "cp -rv dist/. .", - "test": "jest --selectProjects unit wire", + "test": "jest --selectProjects unit browser wire", "test:unit": "jest --selectProjects unit", + "test:browser": "jest --selectProjects browser", "test:wire": "jest --selectProjects wire", "test:integration": "jest --selectProjects integration" }, "dependencies": { - "form-data": "^4.0.4", + "form-data": "^4.0.0", "formdata-node": "^6.0.3", "node-fetch": "^2.7.0", "readable-stream": "^4.5.2", @@ -38,10 +34,10 @@ "@types/jest": "^29.5.14", "ts-jest": "^29.3.4", "jest-environment-jsdom": "^29.7.0", - "msw": "2.11.2", + "msw": "^2.8.4", "@types/node": "^18.19.70", - "typescript": "~5.7.2", - "@biomejs/biome": "2.3.1" + "prettier": "^3.4.2", + "typescript": "~5.7.2" }, "browser": { "fs": false, diff --git a/reference.md b/reference.md index 524aee6fc..0b2fd2d93 100644 --- a/reference.md +++ b/reference.md @@ -1,5 +1,7 @@ # Reference + ## Mobile +
client.mobile.authorizationCode({ ...params }) -> Square.CreateMobileAuthorizationCodeResponse
@@ -12,8 +14,8 @@
-__Note:__ This endpoint is used by the deprecated Reader SDK. -Developers should update their integration to use the [Mobile Payments SDK](https://developer.squareup.com/docs/mobile-payments-sdk), which includes its own authorization methods. +**Note:** This endpoint is used by the deprecated Reader SDK. +Developers should update their integration to use the [Mobile Payments SDK](https://developer.squareup.com/docs/mobile-payments-sdk), which includes its own authorization methods. Generates code to authorize a mobile application to connect to a Square card reader. @@ -27,6 +29,7 @@ Authorization: Bearer ACCESS_TOKEN Replace `ACCESS_TOKEN` with a [valid production authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens). +
@@ -42,10 +45,10 @@ Replace `ACCESS_TOKEN` with a ```typescript await client.mobile.authorizationCode({ - locationId: "YOUR_LOCATION_ID" + locationId: "YOUR_LOCATION_ID", }); - ``` +
@@ -59,27 +62,27 @@ await client.mobile.authorizationCode({
-**request:** `Square.CreateMobileAuthorizationCodeRequest` - +**request:** `Square.CreateMobileAuthorizationCodeRequest` +
-**requestOptions:** `MobileClient.RequestOptions` - +**requestOptions:** `Mobile.RequestOptions` +
-
## OAuth +
client.oAuth.revokeToken({ ...params }) -> Square.RevokeTokenResponse
@@ -95,9 +98,9 @@ await client.mobile.authorizationCode({ Revokes an access token generated with the OAuth flow. If an account has more than one OAuth access token for your application, this -endpoint revokes all of them, regardless of which token you specify. +endpoint revokes all of them, regardless of which token you specify. -__Important:__ The `Authorization` header for this endpoint must have the +**Important:** The `Authorization` header for this endpoint must have the following format: ``` @@ -106,6 +109,7 @@ Authorization: Client APPLICATION_SECRET Replace `APPLICATION_SECRET` with the application secret on the **OAuth** page for your application in the Developer Dashboard. +
@@ -122,10 +126,10 @@ page for your application in the Developer Dashboard. ```typescript await client.oAuth.revokeToken({ clientId: "CLIENT_ID", - accessToken: "ACCESS_TOKEN" + accessToken: "ACCESS_TOKEN", }); - ``` + @@ -139,22 +143,21 @@ await client.oAuth.revokeToken({
-**request:** `Square.RevokeTokenRequest` - +**request:** `Square.RevokeTokenRequest` +
-**requestOptions:** `OAuthClient.RequestOptions` - +**requestOptions:** `OAuth.RequestOptions` +
-
@@ -175,23 +178,26 @@ Returns an OAuth access token and refresh token using the `authorization_code` or `refresh_token` grant type. When `grant_type` is `authorization_code`: + - With the [code flow](https://developer.squareup.com/docs/oauth-api/overview#code-flow), -provide `code`, `client_id`, and `client_secret`. + provide `code`, `client_id`, and `client_secret`. - With the [PKCE flow](https://developer.squareup.com/docs/oauth-api/overview#pkce-flow), -provide `code`, `client_id`, and `code_verifier`. + provide `code`, `client_id`, and `code_verifier`. When `grant_type` is `refresh_token`: + - With the code flow, provide `refresh_token`, `client_id`, and `client_secret`. -The response returns the same refresh token provided in the request. + The response returns the same refresh token provided in the request. - With the PKCE flow, provide `refresh_token` and `client_id`. The response returns -a new refresh token. + a new refresh token. You can use the `scopes` parameter to limit the set of permissions authorized by the access token. You can use the `short_lived` parameter to create an access token that expires in 24 hours. -__Important:__ OAuth tokens should be encrypted and stored on a secure server. +**Important:** OAuth tokens should be encrypted and stored on a secure server. Application clients should never interact directly with OAuth tokens. + @@ -210,10 +216,10 @@ await client.oAuth.obtainToken({ clientId: "sq0idp-uaPHILoPzWZk3tlJqlML0g", clientSecret: "sq0csp-30a-4C_tVOnTh14Piza2BfTPBXyLafLPWSzY1qAjeBfM", code: "sq0cgb-l0SBqxs4uwxErTVyYOdemg", - grantType: "authorization_code" + grantType: "authorization_code", }); - ``` + @@ -227,22 +233,21 @@ await client.oAuth.obtainToken({
-**request:** `Square.ObtainTokenRequest` - +**request:** `Square.ObtainTokenRequest` +
-**requestOptions:** `OAuthClient.RequestOptions` - +**requestOptions:** `OAuth.RequestOptions` +
- @@ -263,7 +268,7 @@ Returns information about an [OAuth access token](https://developer.squareup.com Add the access token to the Authorization header of the request. -__Important:__ The `Authorization` header you provide to this endpoint must have the following format: +**Important:** The `Authorization` header you provide to this endpoint must have the following format: ``` Authorization: Bearer ACCESS_TOKEN @@ -273,6 +278,7 @@ where `ACCESS_TOKEN` is a [valid production authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens). If the access token is expired or not a valid access token, the endpoint returns an `UNAUTHORIZED` error. + @@ -288,8 +294,8 @@ If the access token is expired or not a valid access token, the endpoint returns ```typescript await client.oAuth.retrieveTokenStatus(); - ``` + @@ -303,14 +309,13 @@ await client.oAuth.retrieveTokenStatus();
-**requestOptions:** `OAuthClient.RequestOptions` - +**requestOptions:** `OAuth.RequestOptions` +
- @@ -329,8 +334,8 @@ await client.oAuth.retrieveTokenStatus(); ```typescript await client.oAuth.authorize(); - ``` + @@ -344,19 +349,19 @@ await client.oAuth.authorize();
-**requestOptions:** `OAuthClient.RequestOptions` - +**requestOptions:** `OAuth.RequestOptions` +
- ## V1Transactions +
client.v1Transactions.v1ListOrders({ ...params }) -> Square.V1Order[]
@@ -370,6 +375,7 @@ await client.oAuth.authorize();
Provides summary information for a merchant's online store orders. +
@@ -388,10 +394,10 @@ await client.v1Transactions.v1ListOrders({ locationId: "location_id", order: "DESC", limit: 1, - batchToken: "batch_token" + batchToken: "batch_token", }); - ``` + @@ -405,22 +411,21 @@ await client.v1Transactions.v1ListOrders({
-**request:** `Square.V1ListOrdersRequest` - +**request:** `Square.V1ListOrdersRequest` +
-**requestOptions:** `V1TransactionsClient.RequestOptions` - +**requestOptions:** `V1Transactions.RequestOptions` +
-
@@ -438,6 +443,7 @@ await client.v1Transactions.v1ListOrders({
Provides comprehensive information for a single online store order, including the order's history. +
@@ -454,10 +460,10 @@ Provides comprehensive information for a single online store order, including th ```typescript await client.v1Transactions.v1RetrieveOrder({ locationId: "location_id", - orderId: "order_id" + orderId: "order_id", }); - ``` + @@ -471,22 +477,21 @@ await client.v1Transactions.v1RetrieveOrder({
-**request:** `Square.V1RetrieveOrderRequest` - +**request:** `Square.V1RetrieveOrderRequest` +
-**requestOptions:** `V1TransactionsClient.RequestOptions` - +**requestOptions:** `V1Transactions.RequestOptions` +
- @@ -504,6 +509,7 @@ await client.v1Transactions.v1RetrieveOrder({
Updates the details of an online store order. Every update you perform on an order corresponds to one of three actions: +
@@ -521,10 +527,10 @@ Updates the details of an online store order. Every update you perform on an ord await client.v1Transactions.v1UpdateOrder({ locationId: "location_id", orderId: "order_id", - action: "COMPLETE" + action: "COMPLETE", }); - ``` + @@ -538,27 +544,27 @@ await client.v1Transactions.v1UpdateOrder({
-**request:** `Square.V1UpdateOrderRequest` - +**request:** `Square.V1UpdateOrderRequest` +
-**requestOptions:** `V1TransactionsClient.RequestOptions` - +**requestOptions:** `V1Transactions.RequestOptions` +
- ## ApplePay +
client.applePay.registerDomain({ ...params }) -> Square.RegisterDomainResponse
@@ -578,13 +584,14 @@ an Apple Pay enabled domain. This endpoint provides an easy way for platform developers to bulk activate Apple Pay on the Web with Square for merchants using their platform. -Note: You will need to host a valid domain verification file on your domain to support Apple Pay. The +Note: You will need to host a valid domain verification file on your domain to support Apple Pay. The current version of this file is always available at https://app.squareup.com/digital-wallets/apple-pay/apple-developer-merchantid-domain-association, and should be hosted at `.well_known/apple-developer-merchantid-domain-association` on your -domain. This file is subject to change; we strongly recommend checking for updates regularly and avoiding +domain. This file is subject to change; we strongly recommend checking for updates regularly and avoiding long-lived caches that might not keep in sync with the correct file version. To learn more about the Web Payments SDK and how to add Apple Pay, see [Take an Apple Pay Payment](https://developer.squareup.com/docs/web-payments/apple-pay). +
@@ -600,10 +607,10 @@ To learn more about the Web Payments SDK and how to add Apple Pay, see [Take an ```typescript await client.applePay.registerDomain({ - domainName: "example.com" + domainName: "example.com", }); - ``` + @@ -617,28 +624,28 @@ await client.applePay.registerDomain({
-**request:** `Square.RegisterDomainRequest` - +**request:** `Square.RegisterDomainRequest` +
-**requestOptions:** `ApplePayClient.RequestOptions` - +**requestOptions:** `ApplePay.RequestOptions` +
-
## BankAccounts -
client.bankAccounts.list({ ...params }) -> core.Page + +
client.bankAccounts.list({ ...params }) -> core.Page<Square.BankAccount>
@@ -651,6 +658,7 @@ await client.applePay.registerDomain({
Returns a list of [BankAccount](entity:BankAccount) objects linked to a Square account. +
@@ -665,12 +673,12 @@ Returns a list of [BankAccount](entity:BankAccount) objects linked to a Square a
```typescript -const pageableResponse = await client.bankAccounts.list({ +const response = await client.bankAccounts.list({ cursor: "cursor", limit: 1, - locationId: "location_id" + locationId: "location_id", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -678,16 +686,13 @@ for await (const item of pageableResponse) { let page = await client.bankAccounts.list({ cursor: "cursor", limit: 1, - locationId: "location_id" + locationId: "location_id", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -701,22 +706,21 @@ const response = page.response;
-**request:** `Square.ListBankAccountsRequest` - +**request:** `Square.ListBankAccountsRequest` +
-**requestOptions:** `BankAccountsClient.RequestOptions` - +**requestOptions:** `BankAccounts.RequestOptions` +
-
@@ -734,6 +738,7 @@ const response = page.response;
Returns details of a [BankAccount](entity:BankAccount) identified by V1 bank account ID. +
@@ -749,10 +754,10 @@ Returns details of a [BankAccount](entity:BankAccount) identified by V1 bank acc ```typescript await client.bankAccounts.getByV1Id({ - v1BankAccountId: "v1_bank_account_id" + v1BankAccountId: "v1_bank_account_id", }); - ``` + @@ -766,22 +771,21 @@ await client.bankAccounts.getByV1Id({
-**request:** `Square.GetByV1IdBankAccountsRequest` - +**request:** `Square.GetByV1IdBankAccountsRequest` +
-**requestOptions:** `BankAccountsClient.RequestOptions` - +**requestOptions:** `BankAccounts.RequestOptions` +
-
@@ -800,6 +804,7 @@ await client.bankAccounts.getByV1Id({ Returns details of a [BankAccount](entity:BankAccount) linked to a Square account. + @@ -815,10 +820,10 @@ linked to a Square account. ```typescript await client.bankAccounts.get({ - bankAccountId: "bank_account_id" + bankAccountId: "bank_account_id", }); - ``` + @@ -832,28 +837,28 @@ await client.bankAccounts.get({
-**request:** `Square.GetBankAccountsRequest` - +**request:** `Square.GetBankAccountsRequest` +
-**requestOptions:** `BankAccountsClient.RequestOptions` - +**requestOptions:** `BankAccounts.RequestOptions` +
- ## Bookings -
client.bookings.list({ ...params }) -> core.Page + +
client.bookings.list({ ...params }) -> core.Page<Square.Booking>
@@ -869,6 +874,7 @@ Retrieve a collection of bookings. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. +
@@ -883,16 +889,16 @@ To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ`
```typescript -const pageableResponse = await client.bookings.list({ +const response = await client.bookings.list({ limit: 1, cursor: "cursor", customerId: "customer_id", teamMemberId: "team_member_id", locationId: "location_id", startAtMin: "start_at_min", - startAtMax: "start_at_max" + startAtMax: "start_at_max", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -904,16 +910,13 @@ let page = await client.bookings.list({ teamMemberId: "team_member_id", locationId: "location_id", startAtMin: "start_at_min", - startAtMax: "start_at_max" + startAtMax: "start_at_max", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -927,22 +930,21 @@ const response = page.response;
-**request:** `Square.ListBookingsRequest` - +**request:** `Square.ListBookingsRequest` +
-**requestOptions:** `BookingsClient.RequestOptions` - +**requestOptions:** `Bookings.RequestOptions` +
-
@@ -962,6 +964,7 @@ const response = page.response; Creates a booking. The required input must include the following: + - `Booking.location_id` - `Booking.start_at` - `Booking.AppointmentSegment.team_member_id` @@ -971,8 +974,9 @@ The required input must include the following: To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* -or *Appointments Premium*. +For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to _Appointments Plus_ +or _Appointments Premium_. + @@ -988,10 +992,10 @@ or *Appointments Premium*. ```typescript await client.bookings.create({ - booking: {} + booking: {}, }); - ``` + @@ -1005,22 +1009,21 @@ await client.bookings.create({
-**request:** `Square.CreateBookingRequest` - +**request:** `Square.CreateBookingRequest` +
-**requestOptions:** `BookingsClient.RequestOptions` - +**requestOptions:** `Bookings.RequestOptions` +
-
@@ -1041,6 +1044,7 @@ Searches for availabilities for booking. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + @@ -1058,12 +1062,12 @@ To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` await client.bookings.searchAvailability({ query: { filter: { - startAtRange: {} - } - } + startAtRange: {}, + }, + }, }); - ``` + @@ -1077,22 +1081,21 @@ await client.bookings.searchAvailability({
-**request:** `Square.SearchAvailabilityRequest` - +**request:** `Square.SearchAvailabilityRequest` +
-**requestOptions:** `BookingsClient.RequestOptions` - +**requestOptions:** `Bookings.RequestOptions` +
- @@ -1113,6 +1116,7 @@ Bulk-Retrieves a list of bookings by booking IDs. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + @@ -1128,10 +1132,10 @@ To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` ```typescript await client.bookings.bulkRetrieveBookings({ - bookingIds: ["booking_ids"] + bookingIds: ["booking_ids"], }); - ``` + @@ -1145,22 +1149,21 @@ await client.bookings.bulkRetrieveBookings({
-**request:** `Square.BulkRetrieveBookingsRequest` - +**request:** `Square.BulkRetrieveBookingsRequest` +
-**requestOptions:** `BookingsClient.RequestOptions` - +**requestOptions:** `Bookings.RequestOptions` +
- @@ -1178,6 +1181,7 @@ await client.bookings.bulkRetrieveBookings({
Retrieves a seller's booking profile. +
@@ -1193,8 +1197,8 @@ Retrieves a seller's booking profile. ```typescript await client.bookings.getBusinessProfile(); - ``` + @@ -1208,14 +1212,13 @@ await client.bookings.getBusinessProfile();
-**requestOptions:** `BookingsClient.RequestOptions` - +**requestOptions:** `Bookings.RequestOptions` +
- @@ -1233,6 +1236,7 @@ await client.bookings.getBusinessProfile();
Retrieves a seller's location booking profile. +
@@ -1248,10 +1252,10 @@ Retrieves a seller's location booking profile. ```typescript await client.bookings.retrieveLocationBookingProfile({ - locationId: "location_id" + locationId: "location_id", }); - ``` + @@ -1265,22 +1269,21 @@ await client.bookings.retrieveLocationBookingProfile({
-**request:** `Square.RetrieveLocationBookingProfileRequest` - +**request:** `Square.RetrieveLocationBookingProfileRequest` +
-**requestOptions:** `BookingsClient.RequestOptions` - +**requestOptions:** `Bookings.RequestOptions` +
- @@ -1298,6 +1301,7 @@ await client.bookings.retrieveLocationBookingProfile({
Retrieves one or more team members' booking profiles. +
@@ -1313,10 +1317,10 @@ Retrieves one or more team members' booking profiles. ```typescript await client.bookings.bulkRetrieveTeamMemberBookingProfiles({ - teamMemberIds: ["team_member_ids"] + teamMemberIds: ["team_member_ids"], }); - ``` + @@ -1330,22 +1334,21 @@ await client.bookings.bulkRetrieveTeamMemberBookingProfiles({
-**request:** `Square.BulkRetrieveTeamMemberBookingProfilesRequest` - +**request:** `Square.BulkRetrieveTeamMemberBookingProfilesRequest` +
-**requestOptions:** `BookingsClient.RequestOptions` - +**requestOptions:** `Bookings.RequestOptions` +
- @@ -1366,6 +1369,7 @@ Retrieves a booking. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + @@ -1381,10 +1385,10 @@ To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` ```typescript await client.bookings.get({ - bookingId: "booking_id" + bookingId: "booking_id", }); - ``` + @@ -1398,22 +1402,21 @@ await client.bookings.get({
-**request:** `Square.GetBookingsRequest` - +**request:** `Square.GetBookingsRequest` +
-**requestOptions:** `BookingsClient.RequestOptions` - +**requestOptions:** `Bookings.RequestOptions` +
- @@ -1435,8 +1438,9 @@ Updates a booking. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* -or *Appointments Premium*. +For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to _Appointments Plus_ +or _Appointments Premium_. + @@ -1453,10 +1457,10 @@ or *Appointments Premium*. ```typescript await client.bookings.update({ bookingId: "booking_id", - booking: {} + booking: {}, }); - ``` + @@ -1470,22 +1474,21 @@ await client.bookings.update({
-**request:** `Square.UpdateBookingRequest` - +**request:** `Square.UpdateBookingRequest` +
-**requestOptions:** `BookingsClient.RequestOptions` - +**requestOptions:** `Bookings.RequestOptions` +
- @@ -1507,8 +1510,9 @@ Cancels an existing booking. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* -or *Appointments Premium*. +For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to _Appointments Plus_ +or _Appointments Premium_. + @@ -1524,10 +1528,10 @@ or *Appointments Premium*. ```typescript await client.bookings.cancel({ - bookingId: "booking_id" + bookingId: "booking_id", }); - ``` + @@ -1541,28 +1545,28 @@ await client.bookings.cancel({
-**request:** `Square.CancelBookingRequest` - +**request:** `Square.CancelBookingRequest` +
-**requestOptions:** `BookingsClient.RequestOptions` - +**requestOptions:** `Bookings.RequestOptions` +
- ## Cards -
client.cards.list({ ...params }) -> core.Page + +
client.cards.list({ ...params }) -> core.Page<Square.Card>
@@ -1576,6 +1580,7 @@ await client.bookings.cancel({ Retrieves a list of cards owned by the account making the request. A max of 25 cards will be returned. +
@@ -1590,14 +1595,14 @@ A max of 25 cards will be returned.
```typescript -const pageableResponse = await client.cards.list({ +const response = await client.cards.list({ cursor: "cursor", customerId: "customer_id", includeDisabled: true, referenceId: "reference_id", - sortOrder: "DESC" + sortOrder: "DESC", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -1607,16 +1612,13 @@ let page = await client.cards.list({ customerId: "customer_id", includeDisabled: true, referenceId: "reference_id", - sortOrder: "DESC" + sortOrder: "DESC", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -1630,22 +1632,21 @@ const response = page.response;
-**request:** `Square.ListCardsRequest` - +**request:** `Square.ListCardsRequest` +
-**requestOptions:** `CardsClient.RequestOptions` - +**requestOptions:** `Cards.RequestOptions` +
-
@@ -1663,6 +1664,7 @@ const response = page.response;
Adds a card on file to an existing merchant. +
@@ -1688,14 +1690,14 @@ await client.cards.create({ locality: "New York", administrativeDistrictLevel1: "NY", postalCode: "10003", - country: "US" + country: "US", }, customerId: "VDKXEEKPJN48QDG3BGGFAK05P8", - referenceId: "user-id-1" - } + referenceId: "user-id-1", + }, }); - ``` + @@ -1709,22 +1711,21 @@ await client.cards.create({
-**request:** `Square.CreateCardRequest` - +**request:** `Square.CreateCardRequest` +
-**requestOptions:** `CardsClient.RequestOptions` - +**requestOptions:** `Cards.RequestOptions` +
-
@@ -1742,6 +1743,7 @@ await client.cards.create({
Retrieves details for a specific Card. +
@@ -1757,10 +1759,10 @@ Retrieves details for a specific Card. ```typescript await client.cards.get({ - cardId: "card_id" + cardId: "card_id", }); - ``` + @@ -1774,22 +1776,21 @@ await client.cards.get({
-**request:** `Square.GetCardsRequest` - +**request:** `Square.GetCardsRequest` +
-**requestOptions:** `CardsClient.RequestOptions` - +**requestOptions:** `Cards.RequestOptions` +
- @@ -1808,6 +1809,7 @@ await client.cards.get({ Disables the card, preventing any further updates or charges. Disabling an already disabled card is allowed but has no effect. + @@ -1823,10 +1825,10 @@ Disabling an already disabled card is allowed but has no effect. ```typescript await client.cards.disable({ - cardId: "card_id" + cardId: "card_id", }); - ``` + @@ -1840,27 +1842,27 @@ await client.cards.disable({
-**request:** `Square.DisableCardsRequest` - +**request:** `Square.DisableCardsRequest` +
-**requestOptions:** `CardsClient.RequestOptions` - +**requestOptions:** `Cards.RequestOptions` +
- ## Catalog +
client.catalog.batchDelete({ ...params }) -> Square.BatchDeleteCatalogObjectsResponse
@@ -1887,6 +1889,7 @@ actually deleted. To ensure consistency, only one delete request is processed at a time per seller account. While one (batch or non-batch) delete request is being processed, other (batched and non-batched) delete requests are rejected with the `429` error code. +
@@ -1902,10 +1905,10 @@ delete requests are rejected with the `429` error code. ```typescript await client.catalog.batchDelete({ - objectIds: ["W62UWFY35CWMYGVWK6TWJDNI", "AA27W3M2GGTF3H6AVPNB77CK"] + objectIds: ["W62UWFY35CWMYGVWK6TWJDNI", "AA27W3M2GGTF3H6AVPNB77CK"], }); - ``` + @@ -1919,22 +1922,21 @@ await client.catalog.batchDelete({
-**request:** `Square.BatchDeleteCatalogObjectsRequest` - +**request:** `Square.BatchDeleteCatalogObjectsRequest` +
-**requestOptions:** `CatalogClient.RequestOptions` - +**requestOptions:** `Catalog.RequestOptions` +
-
@@ -1957,6 +1959,7 @@ child information including: all of its [CatalogItemVariation](entity:CatalogItemVariation) objects, references to its [CatalogModifierList](entity:CatalogModifierList) objects, and the ids of any [CatalogTax](entity:CatalogTax) objects that apply to it. + @@ -1973,10 +1976,10 @@ any [CatalogTax](entity:CatalogTax) objects that apply to it. ```typescript await client.catalog.batchGet({ objectIds: ["W62UWFY35CWMYGVWK6TWJDNI", "AA27W3M2GGTF3H6AVPNB77CK"], - includeRelatedObjects: true + includeRelatedObjects: true, }); - ``` + @@ -1990,22 +1993,21 @@ await client.catalog.batchGet({
-**request:** `Square.BatchGetCatalogObjectsRequest` - +**request:** `Square.BatchGetCatalogObjectsRequest` +
-**requestOptions:** `CatalogClient.RequestOptions` - +**requestOptions:** `Catalog.RequestOptions` +
- @@ -2035,6 +2037,7 @@ than 10,000. To ensure consistency, only one update request is processed at a time per seller account. While one (batch or non-batch) update request is being processed, other (batched and non-batched) update requests are rejected with the `429` error code. + @@ -2051,24 +2054,31 @@ update requests are rejected with the `429` error code. ```typescript await client.catalog.batchUpsert({ idempotencyKey: "789ff020-f723-43a9-b4b5-43b5dc1fa3dc", - batches: [{ - objects: [{ + batches: [ + { + objects: [ + { type: "ITEM", - id: "id" - }, { + id: "id", + }, + { type: "ITEM", - id: "id" - }, { + id: "id", + }, + { type: "ITEM", - id: "id" - }, { + id: "id", + }, + { type: "TAX", - id: "id" - }] - }] + id: "id", + }, + ], + }, + ], }); - ``` + @@ -2082,22 +2092,21 @@ await client.catalog.batchUpsert({
-**request:** `Square.BatchUpsertCatalogObjectsRequest` - +**request:** `Square.BatchUpsertCatalogObjectsRequest` +
-**requestOptions:** `CatalogClient.RequestOptions` - +**requestOptions:** `Catalog.RequestOptions` +
- @@ -2116,6 +2125,7 @@ await client.catalog.batchUpsert({ Retrieves information about the Square Catalog API, such as batch size limits that can be used by the `BatchUpsertCatalogObjects` endpoint. + @@ -2131,8 +2141,8 @@ limits that can be used by the `BatchUpsertCatalogObjects` endpoint. ```typescript await client.catalog.info(); - ``` + @@ -2146,19 +2156,18 @@ await client.catalog.info();
-**requestOptions:** `CatalogClient.RequestOptions` - +**requestOptions:** `Catalog.RequestOptions` +
- -
client.catalog.list({ ...params }) -> core.Page +
client.catalog.list({ ...params }) -> core.Page<Square.CatalogObject>
@@ -2175,9 +2184,10 @@ Returns a list of all [CatalogObject](entity:CatalogObject)s of the specified ty The `types` parameter is specified as a comma-separated list of the [CatalogObjectType](entity:CatalogObjectType) values, for example, "`ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`, `IMAGE`". -__Important:__ ListCatalog does not return deleted catalog items. To retrieve +**Important:** ListCatalog does not return deleted catalog items. To retrieve deleted catalog items, use [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects) and set the `include_deleted_objects` attribute value to `true`. +
@@ -2192,12 +2202,12 @@ and set the `include_deleted_objects` attribute value to `true`.
```typescript -const pageableResponse = await client.catalog.list({ +const response = await client.catalog.list({ cursor: "cursor", types: "types", - catalogVersion: BigInt("1000000") + catalogVersion: BigInt("1000000"), }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -2205,16 +2215,13 @@ for await (const item of pageableResponse) { let page = await client.catalog.list({ cursor: "cursor", types: "types", - catalogVersion: BigInt("1000000") + catalogVersion: BigInt("1000000"), }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -2228,22 +2235,21 @@ const response = page.response;
-**request:** `Square.ListCatalogRequest` - +**request:** `Square.ListCatalogRequest` +
-**requestOptions:** `CatalogClient.RequestOptions` - +**requestOptions:** `Catalog.RequestOptions` +
-
@@ -2270,10 +2276,10 @@ endpoint in the following aspects: - `SearchCatalogItems` supports the custom attribute query filters to return items or item variations that contain custom attribute values, where `SearchCatalogObjects` does not. - `SearchCatalogItems` does not support the `include_deleted_objects` filter to search for deleted items or item variations, whereas `SearchCatalogObjects` does. - The both endpoints have different call conventions, including the query filter formats. - - - - + + + + #### 🔌 Usage @@ -2289,13 +2295,13 @@ await client.catalog.search({ query: { prefixQuery: { attributeName: "name", - attributePrefix: "tea" - } + attributePrefix: "tea", + }, }, - limit: 100 + limit: 100, }); - ``` + @@ -2309,22 +2315,21 @@ await client.catalog.search({
-**request:** `Square.SearchCatalogObjectsRequest` - +**request:** `Square.SearchCatalogObjectsRequest` +
-**requestOptions:** `CatalogClient.RequestOptions` - +**requestOptions:** `Catalog.RequestOptions` +
-
@@ -2351,10 +2356,10 @@ endpoint in the following aspects: - `SearchCatalogItems` supports the custom attribute query filters to return items or item variations that contain custom attribute values, where `SearchCatalogObjects` does not. - `SearchCatalogItems` does not support the `include_deleted_objects` filter to search for deleted items or item variations, whereas `SearchCatalogObjects` does. - The both endpoints use different call conventions, including the query filter formats. - - - - + + + + #### 🔌 Usage @@ -2373,24 +2378,29 @@ await client.catalog.searchItems({ limit: 100, sortOrder: "ASC", productTypes: ["REGULAR"], - customAttributeFilters: [{ + customAttributeFilters: [ + { customAttributeDefinitionId: "VEGAN_DEFINITION_ID", - boolFilter: true - }, { + boolFilter: true, + }, + { customAttributeDefinitionId: "BRAND_DEFINITION_ID", - stringFilter: "Dark Horse" - }, { + stringFilter: "Dark Horse", + }, + { key: "VINTAGE", numberFilter: { min: "min", - max: "max" - } - }, { - customAttributeDefinitionId: "VARIETAL_DEFINITION_ID" - }] + max: "max", + }, + }, + { + customAttributeDefinitionId: "VARIETAL_DEFINITION_ID", + }, + ], }); - ``` + @@ -2404,22 +2414,21 @@ await client.catalog.searchItems({
-**request:** `Square.SearchCatalogItemsRequest` - +**request:** `Square.SearchCatalogItemsRequest` +
-**requestOptions:** `CatalogClient.RequestOptions` - +**requestOptions:** `Catalog.RequestOptions` +
- @@ -2439,6 +2448,7 @@ await client.catalog.searchItems({ Updates the [CatalogModifierList](entity:CatalogModifierList) objects that apply to the targeted [CatalogItem](entity:CatalogItem) without having to perform an upsert on the entire item. + @@ -2456,10 +2466,10 @@ to perform an upsert on the entire item. await client.catalog.updateItemModifierLists({ itemIds: ["H42BRLUJ5KTZTTMPVSLFAACQ", "2JXOBJIHCWBQ4NZ3RIXQGJA6"], modifierListsToEnable: ["H42BRLUJ5KTZTTMPVSLFAACQ", "2JXOBJIHCWBQ4NZ3RIXQGJA6"], - modifierListsToDisable: ["7WRC16CJZDVLSNDQ35PP6YAD"] + modifierListsToDisable: ["7WRC16CJZDVLSNDQ35PP6YAD"], }); - ``` + @@ -2473,22 +2483,21 @@ await client.catalog.updateItemModifierLists({
-**request:** `Square.UpdateItemModifierListsRequest` - +**request:** `Square.UpdateItemModifierListsRequest` +
-**requestOptions:** `CatalogClient.RequestOptions` - +**requestOptions:** `Catalog.RequestOptions` +
- @@ -2508,6 +2517,7 @@ await client.catalog.updateItemModifierLists({ Updates the [CatalogTax](entity:CatalogTax) objects that apply to the targeted [CatalogItem](entity:CatalogItem) without having to perform an upsert on the entire item. + @@ -2525,10 +2535,10 @@ upsert on the entire item. await client.catalog.updateItemTaxes({ itemIds: ["H42BRLUJ5KTZTTMPVSLFAACQ", "2JXOBJIHCWBQ4NZ3RIXQGJA6"], taxesToEnable: ["4WRCNHCJZDVLSNDQ35PP6YAD"], - taxesToDisable: ["AQCEGCEBBQONINDOHRGZISEX"] + taxesToDisable: ["AQCEGCEBBQONINDOHRGZISEX"], }); - ``` + @@ -2542,246 +2552,28 @@ await client.catalog.updateItemTaxes({
-**request:** `Square.UpdateItemTaxesRequest` - +**request:** `Square.UpdateItemTaxesRequest` +
-**requestOptions:** `CatalogClient.RequestOptions` - +**requestOptions:** `Catalog.RequestOptions` +
- -## Channels -
client.channels.list({ ...params }) -> core.Page -
-
- -#### 📝 Description - -
-
- -
-
- - -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -const pageableResponse = await client.channels.list({ - referenceType: "UNKNOWN_TYPE", - referenceId: "reference_id", - status: "ACTIVE", - cursor: "cursor", - limit: 1 -}); -for await (const item of pageableResponse) { - console.log(item); -} - -// Or you can manually iterate page-by-page -let page = await client.channels.list({ - referenceType: "UNKNOWN_TYPE", - referenceId: "reference_id", - status: "ACTIVE", - cursor: "cursor", - limit: 1 -}); -while (page.hasNextPage()) { - page = page.getNextPage(); -} - -// You can also access the underlying response -const response = page.response; - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `Square.ListChannelsRequest` - -
-
- -
-
- -**requestOptions:** `ChannelsClient.RequestOptions` - -
-
-
-
- - -
-
-
- -
client.channels.bulkRetrieve({ ...params }) -> Square.BulkRetrieveChannelsResponse -
-
- -#### 📝 Description - -
-
- -
-
- - -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.channels.bulkRetrieve({ - channelIds: ["CH_9C03D0B59", "CH_6X139B5MN", "NOT_EXISTING"] -}); - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `Square.BulkRetrieveChannelsRequest` - -
-
- -
-
- -**requestOptions:** `ChannelsClient.RequestOptions` - -
-
-
-
- - -
-
-
- -
client.channels.get({ ...params }) -> Square.RetrieveChannelResponse -
-
- -#### 📝 Description - -
-
- -
-
- - -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.channels.get({ - channelId: "channel_id" -}); - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `Square.GetChannelsRequest` - -
-
- -
-
- -**requestOptions:** `ChannelsClient.RequestOptions` - -
-
-
-
- - -
-
-
- -## Customers -
client.customers.list({ ...params }) -> core.Page +## Customers + +
client.customers.list({ ...params }) -> core.Page<Square.Customer>
@@ -2798,6 +2590,7 @@ Lists customer profiles associated with a Square account. Under normal operating conditions, newly created or updated customer profiles become available for the listing operation in well under 30 seconds. Occasionally, propagation of the new or updated profiles can take closer to one minute or longer, especially during network incidents and outages. +
@@ -2812,14 +2605,14 @@ profiles can take closer to one minute or longer, especially during network inci
```typescript -const pageableResponse = await client.customers.list({ +const response = await client.customers.list({ cursor: "cursor", limit: 1, sortField: "DEFAULT", sortOrder: "DESC", - count: true + count: true, }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -2829,16 +2622,13 @@ let page = await client.customers.list({ limit: 1, sortField: "DEFAULT", sortOrder: "DESC", - count: true + count: true, }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -2852,22 +2642,21 @@ const response = page.response;
-**request:** `Square.ListCustomersRequest` - +**request:** `Square.ListCustomersRequest` +
-**requestOptions:** `CustomersClient.RequestOptions` - +**requestOptions:** `Customers.RequestOptions` +
-
@@ -2894,10 +2683,10 @@ endpoint: - `company_name` - `email_address` - `phone_number` - - - - + + + + #### 🔌 Usage @@ -2918,14 +2707,14 @@ await client.customers.create({ locality: "New York", administrativeDistrictLevel1: "NY", postalCode: "10003", - country: "US" + country: "US", }, phoneNumber: "+1-212-555-4240", referenceId: "YOUR_REFERENCE_ID", - note: "a customer" + note: "a customer", }); - ``` + @@ -2939,22 +2728,21 @@ await client.customers.create({
-**request:** `Square.CreateCustomerRequest` - +**request:** `Square.CreateCustomerRequest` +
-**requestOptions:** `CustomersClient.RequestOptions` - +**requestOptions:** `Customers.RequestOptions` +
-
@@ -2982,10 +2770,10 @@ You must provide at least one of the following values in each create request: - `company_name` - `email_address` - `phone_number` - - - - + + + + #### 🔌 Usage @@ -3008,11 +2796,11 @@ await client.customers.batchCreate({ locality: "New York", administrativeDistrictLevel1: "NY", postalCode: "10003", - country: "US" + country: "US", }, phoneNumber: "+1-212-555-4240", referenceId: "YOUR_REFERENCE_ID", - note: "a customer" + note: "a customer", }, "d1689f23-b25d-4932-b2f0-aed00f5e2029": { givenName: "Marie", @@ -3024,16 +2812,16 @@ await client.customers.batchCreate({ locality: "New York", administrativeDistrictLevel1: "NY", postalCode: "10003", - country: "US" + country: "US", }, phoneNumber: "+1-212-444-4240", referenceId: "YOUR_REFERENCE_ID", - note: "another customer" - } - } + note: "another customer", + }, + }, }); - ``` + @@ -3047,22 +2835,21 @@ await client.customers.batchCreate({
-**request:** `Square.BulkCreateCustomersRequest` - +**request:** `Square.BulkCreateCustomersRequest` +
-**requestOptions:** `CustomersClient.RequestOptions` - +**requestOptions:** `Customers.RequestOptions` +
- @@ -3082,6 +2869,7 @@ await client.customers.batchCreate({ Deletes multiple customer profiles. The endpoint takes a list of customer IDs and returns a map of responses. + @@ -3097,10 +2885,10 @@ The endpoint takes a list of customer IDs and returns a map of responses. ```typescript await client.customers.bulkDeleteCustomers({ - customerIds: ["8DDA5NZVBZFGAX0V3HPF81HHE0", "N18CPRVXR5214XPBBA6BZQWF3C", "2GYD7WNXF7BJZW1PMGNXZ3Y8M8"] + customerIds: ["8DDA5NZVBZFGAX0V3HPF81HHE0", "N18CPRVXR5214XPBBA6BZQWF3C", "2GYD7WNXF7BJZW1PMGNXZ3Y8M8"], }); - ``` + @@ -3114,22 +2902,21 @@ await client.customers.bulkDeleteCustomers({
-**request:** `Square.BulkDeleteCustomersRequest` - +**request:** `Square.BulkDeleteCustomersRequest` +
-**requestOptions:** `CustomersClient.RequestOptions` - +**requestOptions:** `Customers.RequestOptions` +
- @@ -3149,6 +2936,7 @@ await client.customers.bulkDeleteCustomers({ Retrieves multiple customer profiles. This endpoint takes a list of customer IDs and returns a map of responses. + @@ -3164,10 +2952,10 @@ This endpoint takes a list of customer IDs and returns a map of responses. ```typescript await client.customers.bulkRetrieveCustomers({ - customerIds: ["8DDA5NZVBZFGAX0V3HPF81HHE0", "N18CPRVXR5214XPBBA6BZQWF3C", "2GYD7WNXF7BJZW1PMGNXZ3Y8M8"] + customerIds: ["8DDA5NZVBZFGAX0V3HPF81HHE0", "N18CPRVXR5214XPBBA6BZQWF3C", "2GYD7WNXF7BJZW1PMGNXZ3Y8M8"], }); - ``` + @@ -3181,22 +2969,21 @@ await client.customers.bulkRetrieveCustomers({
-**request:** `Square.BulkRetrieveCustomersRequest` - +**request:** `Square.BulkRetrieveCustomersRequest` +
-**requestOptions:** `CustomersClient.RequestOptions` - +**requestOptions:** `Customers.RequestOptions` +
- @@ -3216,6 +3003,7 @@ await client.customers.bulkRetrieveCustomers({ Updates multiple customer profiles. This endpoint takes a map of individual update requests and returns a map of responses. + @@ -3235,17 +3023,17 @@ await client.customers.bulkUpdateCustomers({ "8DDA5NZVBZFGAX0V3HPF81HHE0": { emailAddress: "New.Amelia.Earhart@example.com", note: "updated customer note", - version: BigInt("2") + version: BigInt("2"), }, - "N18CPRVXR5214XPBBA6BZQWF3C": { + N18CPRVXR5214XPBBA6BZQWF3C: { givenName: "Marie", familyName: "Curie", - version: BigInt("0") - } - } + version: BigInt("0"), + }, + }, }); - ``` + @@ -3259,22 +3047,21 @@ await client.customers.bulkUpdateCustomers({
-**request:** `Square.BulkUpdateCustomersRequest` - +**request:** `Square.BulkUpdateCustomersRequest` +
-**requestOptions:** `CustomersClient.RequestOptions` - +**requestOptions:** `Customers.RequestOptions` +
- @@ -3300,6 +3087,7 @@ customer profiles ordered alphabetically based on `given_name` and Under normal operating conditions, newly created or updated customer profiles become available for the search operation in well under 30 seconds. Occasionally, propagation of the new or updated profiles can take closer to one minute or longer, especially during network incidents and outages. + @@ -3320,27 +3108,27 @@ await client.customers.search({ filter: { creationSource: { values: ["THIRD_PARTY"], - rule: "INCLUDE" + rule: "INCLUDE", }, createdAt: { startAt: "2018-01-01T00:00:00-00:00", - endAt: "2018-02-01T00:00:00-00:00" + endAt: "2018-02-01T00:00:00-00:00", }, emailAddress: { - fuzzy: "example.com" + fuzzy: "example.com", }, groupIds: { - all: ["545AXB44B4XXWMVQ4W8SBT3HHF"] - } + all: ["545AXB44B4XXWMVQ4W8SBT3HHF"], + }, }, sort: { field: "CREATED_AT", - order: "ASC" - } - } + order: "ASC", + }, + }, }); - ``` + @@ -3354,22 +3142,21 @@ await client.customers.search({
-**request:** `Square.SearchCustomersRequest` - +**request:** `Square.SearchCustomersRequest` +
-**requestOptions:** `CustomersClient.RequestOptions` - +**requestOptions:** `Customers.RequestOptions` +
- @@ -3387,6 +3174,7 @@ await client.customers.search({
Returns details for a single customer. +
@@ -3402,10 +3190,10 @@ Returns details for a single customer. ```typescript await client.customers.get({ - customerId: "customer_id" + customerId: "customer_id", }); - ``` + @@ -3419,22 +3207,21 @@ await client.customers.get({
-**request:** `Square.GetCustomersRequest` - +**request:** `Square.GetCustomersRequest` +
-**requestOptions:** `CustomersClient.RequestOptions` - +**requestOptions:** `Customers.RequestOptions` +
- @@ -3455,6 +3242,7 @@ Updates a customer profile. This endpoint supports sparse updates, so only new o To add or update a field, specify the new value. To remove a field, specify `null`. To update a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. + @@ -3473,10 +3261,10 @@ await client.customers.update({ customerId: "customer_id", emailAddress: "New.Amelia.Earhart@example.com", note: "updated customer note", - version: BigInt("2") + version: BigInt("2"), }); - ``` + @@ -3490,22 +3278,21 @@ await client.customers.update({
-**request:** `Square.UpdateCustomerRequest` - +**request:** `Square.UpdateCustomerRequest` +
-**requestOptions:** `CustomersClient.RequestOptions` - +**requestOptions:** `Customers.RequestOptions` +
- @@ -3525,6 +3312,7 @@ await client.customers.update({ Deletes a customer profile from a business. To delete a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. + @@ -3541,10 +3329,10 @@ To delete a customer profile that was created by merging existing profiles, you ```typescript await client.customers.delete({ customerId: "customer_id", - version: BigInt("1000000") + version: BigInt("1000000"), }); - ``` + @@ -3558,28 +3346,28 @@ await client.customers.delete({
-**request:** `Square.DeleteCustomersRequest` - +**request:** `Square.DeleteCustomersRequest` +
-**requestOptions:** `CustomersClient.RequestOptions` - +**requestOptions:** `Customers.RequestOptions` +
- ## Devices -
client.devices.list({ ...params }) -> core.Page + +
client.devices.list({ ...params }) -> core.Page<Square.Device>
@@ -3593,6 +3381,7 @@ await client.customers.delete({ List devices associated with the merchant. Currently, only Terminal API devices are supported. +
@@ -3607,13 +3396,13 @@ devices are supported.
```typescript -const pageableResponse = await client.devices.list({ +const response = await client.devices.list({ cursor: "cursor", sortOrder: "DESC", limit: 1, - locationId: "location_id" + locationId: "location_id", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -3622,16 +3411,13 @@ let page = await client.devices.list({ cursor: "cursor", sortOrder: "DESC", limit: 1, - locationId: "location_id" + locationId: "location_id", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -3645,22 +3431,21 @@ const response = page.response;
-**request:** `Square.ListDevicesRequest` - +**request:** `Square.ListDevicesRequest` +
-**requestOptions:** `DevicesClient.RequestOptions` - +**requestOptions:** `Devices.RequestOptions` +
-
@@ -3678,6 +3463,7 @@ const response = page.response;
Retrieves Device with the associated `device_id`. +
@@ -3693,10 +3479,10 @@ Retrieves Device with the associated `device_id`. ```typescript await client.devices.get({ - deviceId: "device_id" + deviceId: "device_id", }); - ``` + @@ -3710,28 +3496,28 @@ await client.devices.get({
-**request:** `Square.GetDevicesRequest` - +**request:** `Square.GetDevicesRequest` +
-**requestOptions:** `DevicesClient.RequestOptions` - +**requestOptions:** `Devices.RequestOptions` +
-
## Disputes -
client.disputes.list({ ...params }) -> core.Page + +
client.disputes.list({ ...params }) -> core.Page<Square.Dispute>
@@ -3744,6 +3530,7 @@ await client.devices.get({
Returns a list of disputes associated with a particular account. +
@@ -3758,12 +3545,12 @@ Returns a list of disputes associated with a particular account.
```typescript -const pageableResponse = await client.disputes.list({ +const response = await client.disputes.list({ cursor: "cursor", states: "INQUIRY_EVIDENCE_REQUIRED", - locationId: "location_id" + locationId: "location_id", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -3771,16 +3558,13 @@ for await (const item of pageableResponse) { let page = await client.disputes.list({ cursor: "cursor", states: "INQUIRY_EVIDENCE_REQUIRED", - locationId: "location_id" + locationId: "location_id", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -3794,22 +3578,21 @@ const response = page.response;
-**request:** `Square.ListDisputesRequest` - +**request:** `Square.ListDisputesRequest` +
-**requestOptions:** `DisputesClient.RequestOptions` - +**requestOptions:** `Disputes.RequestOptions` +
-
@@ -3827,6 +3610,7 @@ const response = page.response;
Returns details about a specific dispute. +
@@ -3842,10 +3626,10 @@ Returns details about a specific dispute. ```typescript await client.disputes.get({ - disputeId: "dispute_id" + disputeId: "dispute_id", }); - ``` + @@ -3859,22 +3643,21 @@ await client.disputes.get({
-**request:** `Square.GetDisputesRequest` - +**request:** `Square.GetDisputesRequest` +
-**requestOptions:** `DisputesClient.RequestOptions` - +**requestOptions:** `Disputes.RequestOptions` +
-
@@ -3896,6 +3679,7 @@ updates the dispute state to ACCEPTED. Square debits the disputed amount from the seller’s Square account. If the Square account does not have sufficient funds, Square debits the associated bank account. + @@ -3911,10 +3695,10 @@ does not have sufficient funds, Square debits the associated bank account. ```typescript await client.disputes.accept({ - disputeId: "dispute_id" + disputeId: "dispute_id", }); - ``` + @@ -3928,22 +3712,21 @@ await client.disputes.accept({
-**request:** `Square.AcceptDisputesRequest` - +**request:** `Square.AcceptDisputesRequest` +
-**requestOptions:** `DisputesClient.RequestOptions` - +**requestOptions:** `Disputes.RequestOptions` +
- @@ -3962,6 +3745,7 @@ await client.disputes.accept({ Uploads a file to use as evidence in a dispute challenge. The endpoint accepts HTTP multipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, and TIFF formats. + @@ -3977,10 +3761,10 @@ multipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, and TIFF formats ```typescript await client.disputes.createEvidenceFile({ - disputeId: "dispute_id" + disputeId: "dispute_id", }); - ``` + @@ -3994,22 +3778,21 @@ await client.disputes.createEvidenceFile({
-**request:** `Square.CreateEvidenceFileDisputesRequest` - +**request:** `Square.CreateEvidenceFileDisputesRequest` +
-**requestOptions:** `DisputesClient.RequestOptions` - +**requestOptions:** `Disputes.RequestOptions` +
- @@ -4027,6 +3810,7 @@ await client.disputes.createEvidenceFile({
Uploads text to use as evidence for a dispute challenge. +
@@ -4045,10 +3829,10 @@ await client.disputes.createEvidenceText({ disputeId: "dispute_id", idempotencyKey: "ed3ee3933d946f1514d505d173c82648", evidenceType: "TRACKING_NUMBER", - evidenceText: "1Z8888888888888888" + evidenceText: "1Z8888888888888888", }); - ``` + @@ -4062,22 +3846,21 @@ await client.disputes.createEvidenceText({
-**request:** `Square.CreateDisputeEvidenceTextRequest` - +**request:** `Square.CreateDisputeEvidenceTextRequest` +
-**requestOptions:** `DisputesClient.RequestOptions` - +**requestOptions:** `Disputes.RequestOptions` +
- @@ -4101,6 +3884,7 @@ using the [CreateDisputeEvidenceFile](api-endpoint:Disputes-CreateDisputeEvidenc [CreateDisputeEvidenceText](api-endpoint:Disputes-CreateDisputeEvidenceText) endpoints and evidence automatically provided by Square, when available. Evidence cannot be removed from a dispute after submission. + @@ -4116,10 +3900,10 @@ a dispute after submission. ```typescript await client.disputes.submitEvidence({ - disputeId: "dispute_id" + disputeId: "dispute_id", }); - ``` + @@ -4133,28 +3917,28 @@ await client.disputes.submitEvidence({
-**request:** `Square.SubmitEvidenceDisputesRequest` - +**request:** `Square.SubmitEvidenceDisputesRequest` +
-**requestOptions:** `DisputesClient.RequestOptions` - +**requestOptions:** `Disputes.RequestOptions` +
- ## Employees -
client.employees.list({ ...params }) -> core.Page + +
client.employees.list({ ...params }) -> core.Page<Square.Employee>
@@ -4166,7 +3950,6 @@ await client.disputes.submitEvidence({
-
@@ -4181,13 +3964,13 @@ await client.disputes.submitEvidence({
```typescript -const pageableResponse = await client.employees.list({ +const response = await client.employees.list({ locationId: "location_id", status: "ACTIVE", limit: 1, - cursor: "cursor" + cursor: "cursor", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -4196,16 +3979,13 @@ let page = await client.employees.list({ locationId: "location_id", status: "ACTIVE", limit: 1, - cursor: "cursor" + cursor: "cursor", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -4219,22 +3999,21 @@ const response = page.response;
-**request:** `Square.ListEmployeesRequest` - +**request:** `Square.ListEmployeesRequest` +
-**requestOptions:** `EmployeesClient.RequestOptions` - +**requestOptions:** `Employees.RequestOptions` +
-
@@ -4251,7 +4030,6 @@ const response = page.response;
-
@@ -4267,10 +4045,10 @@ const response = page.response; ```typescript await client.employees.get({ - id: "id" + id: "id", }); - ``` + @@ -4284,27 +4062,27 @@ await client.employees.get({
-**request:** `Square.GetEmployeesRequest` - +**request:** `Square.GetEmployeesRequest` +
-**requestOptions:** `EmployeesClient.RequestOptions` - +**requestOptions:** `Employees.RequestOptions` +
-
## Events +
client.events.searchEvents({ ...params }) -> Square.SearchEventsResponse
@@ -4318,6 +4096,7 @@ await client.employees.get({
Search for Square API events that occur within a 28-day timeframe. +
@@ -4333,8 +4112,8 @@ Search for Square API events that occur within a 28-day timeframe. ```typescript await client.events.searchEvents(); - ``` + @@ -4348,22 +4127,21 @@ await client.events.searchEvents();
-**request:** `Square.SearchEventsRequest` - +**request:** `Square.SearchEventsRequest` +
-**requestOptions:** `EventsClient.RequestOptions` - +**requestOptions:** `Events.RequestOptions` +
-
@@ -4383,6 +4161,7 @@ await client.events.searchEvents(); Disables events to prevent them from being searchable. All events are disabled by default. You must enable events to make them searchable. Disabling events for a specific time period prevents them from being searchable, even if you re-enable them later. + @@ -4398,8 +4177,8 @@ Disabling events for a specific time period prevents them from being searchable, ```typescript await client.events.disableEvents(); - ``` + @@ -4413,14 +4192,13 @@ await client.events.disableEvents();
-**requestOptions:** `EventsClient.RequestOptions` - +**requestOptions:** `Events.RequestOptions` +
- @@ -4438,6 +4216,7 @@ await client.events.disableEvents();
Enables events to make them searchable. Only events that occur while in the enabled state are searchable. +
@@ -4453,8 +4232,8 @@ Enables events to make them searchable. Only events that occur while in the enab ```typescript await client.events.enableEvents(); - ``` + @@ -4468,14 +4247,13 @@ await client.events.enableEvents();
-**requestOptions:** `EventsClient.RequestOptions` - +**requestOptions:** `Events.RequestOptions` +
- @@ -4493,6 +4271,7 @@ await client.events.enableEvents();
Lists all event types that you can subscribe to as webhooks or query using the Events API. +
@@ -4508,10 +4287,10 @@ Lists all event types that you can subscribe to as webhooks or query using the E ```typescript await client.events.listEventTypes({ - apiVersion: "api_version" + apiVersion: "api_version", }); - ``` + @@ -4525,28 +4304,28 @@ await client.events.listEventTypes({
-**request:** `Square.ListEventTypesRequest` - +**request:** `Square.ListEventTypesRequest` +
-**requestOptions:** `EventsClient.RequestOptions` - +**requestOptions:** `Events.RequestOptions` +
- ## GiftCards -
client.giftCards.list({ ...params }) -> core.Page + +
client.giftCards.list({ ...params }) -> core.Page<Square.GiftCard>
@@ -4558,8 +4337,9 @@ await client.events.listEventTypes({
-Lists all gift cards. You can specify optional filters to retrieve +Lists all gift cards. You can specify optional filters to retrieve a subset of the gift cards. Results are sorted by `created_at` in ascending order. +
@@ -4574,14 +4354,14 @@ a subset of the gift cards. Results are sorted by `created_at` in ascending orde
```typescript -const pageableResponse = await client.giftCards.list({ +const response = await client.giftCards.list({ type: "type", state: "state", limit: 1, cursor: "cursor", - customerId: "customer_id" + customerId: "customer_id", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -4591,16 +4371,13 @@ let page = await client.giftCards.list({ state: "state", limit: 1, cursor: "cursor", - customerId: "customer_id" + customerId: "customer_id", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -4614,22 +4391,21 @@ const response = page.response;
-**request:** `Square.ListGiftCardsRequest` - +**request:** `Square.ListGiftCardsRequest` +
-**requestOptions:** `GiftCardsClient.RequestOptions` - +**requestOptions:** `GiftCards.RequestOptions` +
-
@@ -4651,6 +4427,7 @@ has a `PENDING` state. To activate a gift card so that it can be redeemed for pu [CreateGiftCardActivity](api-endpoint:GiftCardActivities-CreateGiftCardActivity) and create an `ACTIVATE` activity with the initial balance. Alternatively, you can use [RefundPayment](api-endpoint:Refunds-RefundPayment) to refund a payment to the new gift card. + @@ -4669,11 +4446,11 @@ await client.giftCards.create({ idempotencyKey: "NC9Tm69EjbjtConu", locationId: "81FN9BNFZTKS4", giftCard: { - type: "DIGITAL" - } + type: "DIGITAL", + }, }); - ``` + @@ -4687,22 +4464,21 @@ await client.giftCards.create({
-**request:** `Square.CreateGiftCardRequest` - +**request:** `Square.CreateGiftCardRequest` +
-**requestOptions:** `GiftCardsClient.RequestOptions` - +**requestOptions:** `GiftCards.RequestOptions` +
-
@@ -4720,6 +4496,7 @@ await client.giftCards.create({
Retrieves a gift card using the gift card account number (GAN). +
@@ -4735,10 +4512,10 @@ Retrieves a gift card using the gift card account number (GAN). ```typescript await client.giftCards.getFromGan({ - gan: "7783320001001635" + gan: "7783320001001635", }); - ``` + @@ -4752,22 +4529,21 @@ await client.giftCards.getFromGan({
-**request:** `Square.GetGiftCardFromGanRequest` - +**request:** `Square.GetGiftCardFromGanRequest` +
-**requestOptions:** `GiftCardsClient.RequestOptions` - +**requestOptions:** `GiftCards.RequestOptions` +
- @@ -4785,6 +4561,7 @@ await client.giftCards.getFromGan({
Retrieves a gift card using a secure payment token that represents the gift card. +
@@ -4800,10 +4577,10 @@ Retrieves a gift card using a secure payment token that represents the gift card ```typescript await client.giftCards.getFromNonce({ - nonce: "cnon:7783322135245171" + nonce: "cnon:7783322135245171", }); - ``` + @@ -4817,22 +4594,21 @@ await client.giftCards.getFromNonce({
-**request:** `Square.GetGiftCardFromNonceRequest` - +**request:** `Square.GetGiftCardFromNonceRequest` +
-**requestOptions:** `GiftCardsClient.RequestOptions` - +**requestOptions:** `GiftCards.RequestOptions` +
- @@ -4850,6 +4626,7 @@ await client.giftCards.getFromNonce({
Links a customer to a gift card, which is also referred to as adding a card on file. +
@@ -4866,10 +4643,10 @@ Links a customer to a gift card, which is also referred to as adding a card on f ```typescript await client.giftCards.linkCustomer({ giftCardId: "gift_card_id", - customerId: "GKY0FZ3V717AH8Q2D821PNT2ZW" + customerId: "GKY0FZ3V717AH8Q2D821PNT2ZW", }); - ``` + @@ -4883,22 +4660,21 @@ await client.giftCards.linkCustomer({
-**request:** `Square.LinkCustomerToGiftCardRequest` - +**request:** `Square.LinkCustomerToGiftCardRequest` +
-**requestOptions:** `GiftCardsClient.RequestOptions` - +**requestOptions:** `GiftCards.RequestOptions` +
- @@ -4916,6 +4692,7 @@ await client.giftCards.linkCustomer({
Unlinks a customer from a gift card, which is also referred to as removing a card on file. +
@@ -4932,10 +4709,10 @@ Unlinks a customer from a gift card, which is also referred to as removing a car ```typescript await client.giftCards.unlinkCustomer({ giftCardId: "gift_card_id", - customerId: "GKY0FZ3V717AH8Q2D821PNT2ZW" + customerId: "GKY0FZ3V717AH8Q2D821PNT2ZW", }); - ``` + @@ -4949,22 +4726,21 @@ await client.giftCards.unlinkCustomer({
-**request:** `Square.UnlinkCustomerFromGiftCardRequest` - +**request:** `Square.UnlinkCustomerFromGiftCardRequest` +
-**requestOptions:** `GiftCardsClient.RequestOptions` - +**requestOptions:** `GiftCards.RequestOptions` +
- @@ -4982,6 +4758,7 @@ await client.giftCards.unlinkCustomer({
Retrieves a gift card using the gift card ID. +
@@ -4997,10 +4774,10 @@ Retrieves a gift card using the gift card ID. ```typescript await client.giftCards.get({ - id: "id" + id: "id", }); - ``` + @@ -5014,27 +4791,27 @@ await client.giftCards.get({
-**request:** `Square.GetGiftCardsRequest` - +**request:** `Square.GetGiftCardsRequest` +
-**requestOptions:** `GiftCardsClient.RequestOptions` - +**requestOptions:** `GiftCards.RequestOptions` +
- ## Inventory +
client.inventory.deprecatedGetAdjustment({ ...params }) -> Square.GetInventoryAdjustmentResponse
@@ -5049,6 +4826,7 @@ await client.giftCards.get({ Deprecated version of [RetrieveInventoryAdjustment](api-endpoint:Inventory-RetrieveInventoryAdjustment) after the endpoint URL is updated to conform to the standard convention. +
@@ -5064,10 +4842,10 @@ is updated to conform to the standard convention. ```typescript await client.inventory.deprecatedGetAdjustment({ - adjustmentId: "adjustment_id" + adjustmentId: "adjustment_id", }); - ``` + @@ -5081,22 +4859,21 @@ await client.inventory.deprecatedGetAdjustment({
-**request:** `Square.DeprecatedGetAdjustmentInventoryRequest` - +**request:** `Square.DeprecatedGetAdjustmentInventoryRequest` +
-**requestOptions:** `InventoryClient.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
-
@@ -5115,6 +4892,7 @@ await client.inventory.deprecatedGetAdjustment({ Returns the [InventoryAdjustment](entity:InventoryAdjustment) object with the provided `adjustment_id`. + @@ -5130,10 +4908,10 @@ with the provided `adjustment_id`. ```typescript await client.inventory.getAdjustment({ - adjustmentId: "adjustment_id" + adjustmentId: "adjustment_id", }); - ``` + @@ -5147,22 +4925,21 @@ await client.inventory.getAdjustment({
-**request:** `Square.GetAdjustmentInventoryRequest` - +**request:** `Square.GetAdjustmentInventoryRequest` +
-**requestOptions:** `InventoryClient.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
- @@ -5181,6 +4958,7 @@ await client.inventory.getAdjustment({ Deprecated version of [BatchChangeInventory](api-endpoint:Inventory-BatchChangeInventory) after the endpoint URL is updated to conform to the standard convention. + @@ -5197,7 +4975,8 @@ is updated to conform to the standard convention. ```typescript await client.inventory.deprecatedBatchChange({ idempotencyKey: "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", - changes: [{ + changes: [ + { type: "PHYSICAL_COUNT", physicalCount: { referenceId: "1536bfbf-efed-48bf-b17d-a197141b2a92", @@ -5206,13 +4985,14 @@ await client.inventory.deprecatedBatchChange({ locationId: "C6W5YS5QM06F5", quantity: "53", teamMemberId: "LRK57NSQ5X7PUD05", - occurredAt: "2016-11-16T22:25:24.878Z" - } - }], - ignoreUnchangedCounts: true + occurredAt: "2016-11-16T22:25:24.878Z", + }, + }, + ], + ignoreUnchangedCounts: true, }); - ``` + @@ -5226,22 +5006,21 @@ await client.inventory.deprecatedBatchChange({
-**request:** `Square.BatchChangeInventoryRequest` - +**request:** `Square.BatchChangeInventoryRequest` +
-**requestOptions:** `InventoryClient.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
- @@ -5260,6 +5039,7 @@ await client.inventory.deprecatedBatchChange({ Deprecated version of [BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges) after the endpoint URL is updated to conform to the standard convention. + @@ -5280,10 +5060,10 @@ await client.inventory.deprecatedBatchGetChanges({ types: ["PHYSICAL_COUNT"], states: ["IN_STOCK"], updatedAfter: "2016-11-01T00:00:00.000Z", - updatedBefore: "2016-12-01T00:00:00.000Z" + updatedBefore: "2016-12-01T00:00:00.000Z", }); - ``` + @@ -5297,22 +5077,21 @@ await client.inventory.deprecatedBatchGetChanges({
-**request:** `Square.BatchRetrieveInventoryChangesRequest` - +**request:** `Square.BatchRetrieveInventoryChangesRequest` +
-**requestOptions:** `InventoryClient.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
- @@ -5331,6 +5110,7 @@ await client.inventory.deprecatedBatchGetChanges({ Deprecated version of [BatchRetrieveInventoryCounts](api-endpoint:Inventory-BatchRetrieveInventoryCounts) after the endpoint URL is updated to conform to the standard convention. + @@ -5348,10 +5128,10 @@ is updated to conform to the standard convention. await client.inventory.deprecatedBatchGetCounts({ catalogObjectIds: ["W62UWFY35CWMYGVWK6TWJDNI"], locationIds: ["59TNP9SA8VGDA"], - updatedAfter: "2016-11-16T00:00:00.000Z" + updatedAfter: "2016-11-16T00:00:00.000Z", }); - ``` + @@ -5365,22 +5145,21 @@ await client.inventory.deprecatedBatchGetCounts({
-**request:** `Square.BatchGetInventoryCountsRequest` - +**request:** `Square.BatchGetInventoryCountsRequest` +
-**requestOptions:** `InventoryClient.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
- @@ -5402,6 +5181,7 @@ Applies adjustments and counts to the provided item quantities. On success: returns the current calculated counts for all objects referenced in the request. On failure: returns a list of related errors. + @@ -5418,7 +5198,8 @@ On failure: returns a list of related errors. ```typescript await client.inventory.batchCreateChanges({ idempotencyKey: "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", - changes: [{ + changes: [ + { type: "PHYSICAL_COUNT", physicalCount: { referenceId: "1536bfbf-efed-48bf-b17d-a197141b2a92", @@ -5427,13 +5208,14 @@ await client.inventory.batchCreateChanges({ locationId: "C6W5YS5QM06F5", quantity: "53", teamMemberId: "LRK57NSQ5X7PUD05", - occurredAt: "2016-11-16T22:25:24.878Z" - } - }], - ignoreUnchangedCounts: true + occurredAt: "2016-11-16T22:25:24.878Z", + }, + }, + ], + ignoreUnchangedCounts: true, }); - ``` + @@ -5447,27 +5229,26 @@ await client.inventory.batchCreateChanges({
-**request:** `Square.BatchChangeInventoryRequest` - +**request:** `Square.BatchChangeInventoryRequest` +
-**requestOptions:** `InventoryClient.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
- -
client.inventory.batchGetChanges({ ...params }) -> core.Page +
client.inventory.batchGetChanges({ ...params }) -> core.Page<Square.InventoryChange>
@@ -5487,6 +5268,7 @@ Results are paginated and sorted in ascending order according their BatchRetrieveInventoryChanges is a catch-all query endpoint for queries that cannot be handled by other, simpler endpoints. +
@@ -5501,15 +5283,15 @@ that cannot be handled by other, simpler endpoints.
```typescript -const pageableResponse = await client.inventory.batchGetChanges({ +const response = await client.inventory.batchGetChanges({ catalogObjectIds: ["W62UWFY35CWMYGVWK6TWJDNI"], locationIds: ["C6W5YS5QM06F5"], types: ["PHYSICAL_COUNT"], states: ["IN_STOCK"], updatedAfter: "2016-11-01T00:00:00.000Z", - updatedBefore: "2016-12-01T00:00:00.000Z" + updatedBefore: "2016-12-01T00:00:00.000Z", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -5520,16 +5302,13 @@ let page = await client.inventory.batchGetChanges({ types: ["PHYSICAL_COUNT"], states: ["IN_STOCK"], updatedAfter: "2016-11-01T00:00:00.000Z", - updatedBefore: "2016-12-01T00:00:00.000Z" + updatedBefore: "2016-12-01T00:00:00.000Z", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -5543,27 +5322,26 @@ const response = page.response;
-**request:** `Square.BatchRetrieveInventoryChangesRequest` - +**request:** `Square.BatchRetrieveInventoryChangesRequest` +
-**requestOptions:** `InventoryClient.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
-
-
client.inventory.batchGetCounts({ ...params }) -> core.Page +
client.inventory.batchGetCounts({ ...params }) -> core.Page<Square.InventoryCount>
@@ -5586,6 +5364,7 @@ When `updated_after` is specified, only counts that have changed since that time (based on the server timestamp for the most recent change) are returned. This allows clients to perform a "sync" operation, for example in response to receiving a Webhook notification. +
@@ -5600,12 +5379,12 @@ in response to receiving a Webhook notification.
```typescript -const pageableResponse = await client.inventory.batchGetCounts({ +const response = await client.inventory.batchGetCounts({ catalogObjectIds: ["W62UWFY35CWMYGVWK6TWJDNI"], locationIds: ["59TNP9SA8VGDA"], - updatedAfter: "2016-11-16T00:00:00.000Z" + updatedAfter: "2016-11-16T00:00:00.000Z", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -5613,16 +5392,13 @@ for await (const item of pageableResponse) { let page = await client.inventory.batchGetCounts({ catalogObjectIds: ["W62UWFY35CWMYGVWK6TWJDNI"], locationIds: ["59TNP9SA8VGDA"], - updatedAfter: "2016-11-16T00:00:00.000Z" + updatedAfter: "2016-11-16T00:00:00.000Z", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -5636,22 +5412,21 @@ const response = page.response;
-**request:** `Square.BatchGetInventoryCountsRequest` - +**request:** `Square.BatchGetInventoryCountsRequest` +
-**requestOptions:** `InventoryClient.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
-
@@ -5670,6 +5445,7 @@ const response = page.response; Deprecated version of [RetrieveInventoryPhysicalCount](api-endpoint:Inventory-RetrieveInventoryPhysicalCount) after the endpoint URL is updated to conform to the standard convention. + @@ -5685,10 +5461,10 @@ is updated to conform to the standard convention. ```typescript await client.inventory.deprecatedGetPhysicalCount({ - physicalCountId: "physical_count_id" + physicalCountId: "physical_count_id", }); - ``` + @@ -5702,22 +5478,21 @@ await client.inventory.deprecatedGetPhysicalCount({
-**request:** `Square.DeprecatedGetPhysicalCountInventoryRequest` - +**request:** `Square.DeprecatedGetPhysicalCountInventoryRequest` +
-**requestOptions:** `InventoryClient.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
-
@@ -5736,6 +5511,7 @@ await client.inventory.deprecatedGetPhysicalCount({ Returns the [InventoryPhysicalCount](entity:InventoryPhysicalCount) object with the provided `physical_count_id`. + @@ -5751,10 +5527,10 @@ object with the provided `physical_count_id`. ```typescript await client.inventory.getPhysicalCount({ - physicalCountId: "physical_count_id" + physicalCountId: "physical_count_id", }); - ``` + @@ -5768,22 +5544,21 @@ await client.inventory.getPhysicalCount({
-**request:** `Square.GetPhysicalCountInventoryRequest` - +**request:** `Square.GetPhysicalCountInventoryRequest` +
-**requestOptions:** `InventoryClient.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
-
@@ -5802,6 +5577,7 @@ await client.inventory.getPhysicalCount({ Returns the [InventoryTransfer](entity:InventoryTransfer) object with the provided `transfer_id`. + @@ -5817,10 +5593,10 @@ with the provided `transfer_id`. ```typescript await client.inventory.getTransfer({ - transferId: "transfer_id" + transferId: "transfer_id", }); - ``` + @@ -5834,27 +5610,26 @@ await client.inventory.getTransfer({
-**request:** `Square.GetTransferInventoryRequest` - +**request:** `Square.GetTransferInventoryRequest` +
-**requestOptions:** `InventoryClient.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
- -
client.inventory.get({ ...params }) -> core.Page +
client.inventory.get({ ...params }) -> core.Page<Square.InventoryCount>
@@ -5870,6 +5645,7 @@ Retrieves the current calculated stock count for a given [CatalogObject](entity:CatalogObject) at a given set of [Location](entity:Location)s. Responses are paginated and unsorted. For more sophisticated queries, use a batch endpoint. +
@@ -5884,12 +5660,12 @@ For more sophisticated queries, use a batch endpoint.
```typescript -const pageableResponse = await client.inventory.get({ +const response = await client.inventory.get({ catalogObjectId: "catalog_object_id", locationIds: "location_ids", - cursor: "cursor" + cursor: "cursor", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -5897,16 +5673,13 @@ for await (const item of pageableResponse) { let page = await client.inventory.get({ catalogObjectId: "catalog_object_id", locationIds: "location_ids", - cursor: "cursor" + cursor: "cursor", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -5920,27 +5693,26 @@ const response = page.response;
-**request:** `Square.GetInventoryRequest` - +**request:** `Square.GetInventoryRequest` +
-**requestOptions:** `InventoryClient.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
-
-
client.inventory.changes({ ...params }) -> core.Page +
client.inventory.changes({ ...params }) -> core.Page<Square.InventoryChange>
@@ -5965,6 +5737,7 @@ Results are paginated and sorted in descending order according to their There are no limits on how far back the caller can page. This endpoint can be used to display recent changes for a specific item. For more sophisticated queries, use a batch endpoint. +
@@ -5979,12 +5752,12 @@ sophisticated queries, use a batch endpoint.
```typescript -const pageableResponse = await client.inventory.changes({ +const response = await client.inventory.changes({ catalogObjectId: "catalog_object_id", locationIds: "location_ids", - cursor: "cursor" + cursor: "cursor", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -5992,16 +5765,13 @@ for await (const item of pageableResponse) { let page = await client.inventory.changes({ catalogObjectId: "catalog_object_id", locationIds: "location_ids", - cursor: "cursor" + cursor: "cursor", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -6015,28 +5785,28 @@ const response = page.response;
-**request:** `Square.ChangesInventoryRequest` - +**request:** `Square.ChangesInventoryRequest` +
-**requestOptions:** `InventoryClient.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
-
## Invoices -
client.invoices.list({ ...params }) -> core.Page + +
client.invoices.list({ ...params }) -> core.Page<Square.Invoice>
@@ -6048,9 +5818,10 @@ const response = page.response;
-Returns a list of invoices for a given location. The response -is paginated. If truncated, the response includes a `cursor` that you +Returns a list of invoices for a given location. The response +is paginated. If truncated, the response includes a `cursor` that you use in a subsequent request to retrieve the next set of invoices. +
@@ -6065,12 +5836,12 @@ use in a subsequent request to retrieve the next set of invoices.
```typescript -const pageableResponse = await client.invoices.list({ +const response = await client.invoices.list({ locationId: "location_id", cursor: "cursor", - limit: 1 + limit: 1, }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -6078,16 +5849,13 @@ for await (const item of pageableResponse) { let page = await client.invoices.list({ locationId: "location_id", cursor: "cursor", - limit: 1 + limit: 1, }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -6101,22 +5869,21 @@ const response = page.response;
-**request:** `Square.ListInvoicesRequest` - +**request:** `Square.ListInvoicesRequest` +
-**requestOptions:** `InvoicesClient.RequestOptions` - +**requestOptions:** `Invoices.RequestOptions` +
-
@@ -6133,11 +5900,12 @@ const response = page.response;
-Creates a draft [invoice](entity:Invoice) +Creates a draft [invoice](entity:Invoice) for an order created using the Orders API. -A draft invoice remains in your account and no action is taken. +A draft invoice remains in your account and no action is taken. You must publish the invoice before Square can process it (send it to the customer's email address or charge the customer’s card on file). +
@@ -6157,18 +5925,22 @@ await client.invoices.create({ locationId: "ES0RJRZYEC39A", orderId: "CAISENgvlJ6jLWAzERDzjyHVybY", primaryRecipient: { - customerId: "JDKYHBWT1D4F8MFH63DBMEN8Y4" + customerId: "JDKYHBWT1D4F8MFH63DBMEN8Y4", }, - paymentRequests: [{ + paymentRequests: [ + { requestType: "BALANCE", dueDate: "2030-01-24", tippingEnabled: true, automaticPaymentSource: "NONE", - reminders: [{ + reminders: [ + { relativeScheduledDays: -1, - message: "Your invoice is due tomorrow" - }] - }], + message: "Your invoice is due tomorrow", + }, + ], + }, + ], deliveryMethod: "EMAIL", invoiceNumber: "inv-100", title: "Event Planning Services", @@ -6179,24 +5951,27 @@ await client.invoices.create({ squareGiftCard: false, bankAccount: false, buyNowPayLater: false, - cashAppPay: false + cashAppPay: false, }, - customFields: [{ + customFields: [ + { label: "Event Reference Number", value: "Ref. #1234", - placement: "ABOVE_LINE_ITEMS" - }, { + placement: "ABOVE_LINE_ITEMS", + }, + { label: "Terms of Service", value: "The terms of service are...", - placement: "BELOW_LINE_ITEMS" - }], + placement: "BELOW_LINE_ITEMS", + }, + ], saleOrServiceDate: "2030-01-24", - storePaymentMethodEnabled: false + storePaymentMethodEnabled: false, }, - idempotencyKey: "ce3748f9-5fc1-4762-aa12-aae5e843f1f4" + idempotencyKey: "ce3748f9-5fc1-4762-aa12-aae5e843f1f4", }); - ``` + @@ -6210,22 +5985,21 @@ await client.invoices.create({
-**request:** `Square.CreateInvoiceRequest` - +**request:** `Square.CreateInvoiceRequest` +
-**requestOptions:** `InvoicesClient.RequestOptions` - +**requestOptions:** `Invoices.RequestOptions` +
-
@@ -6242,13 +6016,14 @@ await client.invoices.create({
-Searches for invoices from a location specified in -the filter. You can optionally specify customers in the filter for whom to -retrieve invoices. In the current implementation, you can only specify one location and +Searches for invoices from a location specified in +the filter. You can optionally specify customers in the filter for whom to +retrieve invoices. In the current implementation, you can only specify one location and optionally one customer. -The response is paginated. If truncated, the response includes a `cursor` +The response is paginated. If truncated, the response includes a `cursor` that you use in a subsequent request to retrieve the next set of invoices. +
@@ -6267,17 +6042,17 @@ await client.invoices.search({ query: { filter: { locationIds: ["ES0RJRZYEC39A"], - customerIds: ["JDKYHBWT1D4F8MFH63DBMEN8Y4"] + customerIds: ["JDKYHBWT1D4F8MFH63DBMEN8Y4"], }, sort: { field: "INVOICE_SORT_DATE", - order: "DESC" - } + order: "DESC", + }, }, - limit: 100 + limit: 100, }); - ``` + @@ -6291,22 +6066,21 @@ await client.invoices.search({
-**request:** `Square.SearchInvoicesRequest` - +**request:** `Square.SearchInvoicesRequest` +
-**requestOptions:** `InvoicesClient.RequestOptions` - +**requestOptions:** `Invoices.RequestOptions` +
-
@@ -6324,6 +6098,7 @@ await client.invoices.search({
Retrieves an invoice by invoice ID. +
@@ -6339,10 +6114,10 @@ Retrieves an invoice by invoice ID. ```typescript await client.invoices.get({ - invoiceId: "invoice_id" + invoiceId: "invoice_id", }); - ``` + @@ -6356,22 +6131,21 @@ await client.invoices.get({
-**request:** `Square.GetInvoicesRequest` - +**request:** `Square.GetInvoicesRequest` +
-**requestOptions:** `InvoicesClient.RequestOptions` - +**requestOptions:** `Invoices.RequestOptions` +
-
@@ -6392,6 +6166,7 @@ Updates an invoice. This endpoint supports sparse updates, so you only need to specify the fields you want to change along with the required `version` field. Some restrictions apply to updating invoices. For example, you cannot change the `order_id` or `location_id` field. + @@ -6410,15 +6185,17 @@ await client.invoices.update({ invoiceId: "invoice_id", invoice: { version: 1, - paymentRequests: [{ + paymentRequests: [ + { uid: "2da7964f-f3d2-4f43-81e8-5aa220bf3355", - tippingEnabled: false - }] + tippingEnabled: false, + }, + ], }, - idempotencyKey: "4ee82288-0910-499e-ab4c-5d0071dad1be" + idempotencyKey: "4ee82288-0910-499e-ab4c-5d0071dad1be", }); - ``` + @@ -6432,22 +6209,21 @@ await client.invoices.update({
-**request:** `Square.UpdateInvoiceRequest` - +**request:** `Square.UpdateInvoiceRequest` +
-**requestOptions:** `InvoicesClient.RequestOptions` - +**requestOptions:** `Invoices.RequestOptions` +
- @@ -6464,9 +6240,10 @@ await client.invoices.update({
-Deletes the specified invoice. When an invoice is deleted, the -associated order status changes to CANCELED. You can only delete a draft +Deletes the specified invoice. When an invoice is deleted, the +associated order status changes to CANCELED. You can only delete a draft invoice (you cannot delete a published invoice, including one that is scheduled for processing). +
@@ -6483,10 +6260,10 @@ invoice (you cannot delete a published invoice, including one that is scheduled ```typescript await client.invoices.delete({ invoiceId: "invoice_id", - version: 1 + version: 1, }); - ``` + @@ -6500,22 +6277,21 @@ await client.invoices.delete({
-**request:** `Square.DeleteInvoicesRequest` - +**request:** `Square.DeleteInvoicesRequest` +
-**requestOptions:** `InvoicesClient.RequestOptions` - +**requestOptions:** `Invoices.RequestOptions` +
- @@ -6539,7 +6315,8 @@ in a supported format: GIF, JPEG, PNG, TIFF, BMP, or PDF. Invoices can have up to 10 attachments with a total file size of 25 MB. Attachments can be added only to invoices in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state. -__NOTE:__ When testing in the Sandbox environment, the total file size is limited to 1 KB. +**NOTE:** When testing in the Sandbox environment, the total file size is limited to 1 KB. + @@ -6555,10 +6332,10 @@ __NOTE:__ When testing in the Sandbox environment, the total file size is limite ```typescript await client.invoices.createInvoiceAttachment({ - invoiceId: "invoice_id" + invoiceId: "invoice_id", }); - ``` + @@ -6572,22 +6349,21 @@ await client.invoices.createInvoiceAttachment({
-**request:** `Square.CreateInvoiceAttachmentRequest` - +**request:** `Square.CreateInvoiceAttachmentRequest` +
-**requestOptions:** `InvoicesClient.RequestOptions` - +**requestOptions:** `Invoices.RequestOptions` +
- @@ -6606,6 +6382,7 @@ await client.invoices.createInvoiceAttachment({ Removes an attachment from an invoice and permanently deletes the file. Attachments can be removed only from invoices in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state. + @@ -6622,10 +6399,10 @@ from invoices in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state. ```typescript await client.invoices.deleteInvoiceAttachment({ invoiceId: "invoice_id", - attachmentId: "attachment_id" + attachmentId: "attachment_id", }); - ``` + @@ -6639,22 +6416,21 @@ await client.invoices.deleteInvoiceAttachment({
-**request:** `Square.DeleteInvoiceAttachmentRequest` - +**request:** `Square.DeleteInvoiceAttachmentRequest` +
-**requestOptions:** `InvoicesClient.RequestOptions` - +**requestOptions:** `Invoices.RequestOptions` +
- @@ -6671,10 +6447,11 @@ await client.invoices.deleteInvoiceAttachment({
-Cancels an invoice. The seller cannot collect payments for +Cancels an invoice. The seller cannot collect payments for the canceled invoice. You cannot cancel an invoice in the `DRAFT` state or in a terminal state: `PAID`, `REFUNDED`, `CANCELED`, or `FAILED`. +
@@ -6691,10 +6468,10 @@ You cannot cancel an invoice in the `DRAFT` state or in a terminal state: `PAID` ```typescript await client.invoices.cancel({ invoiceId: "invoice_id", - version: 0 + version: 0, }); - ``` + @@ -6708,22 +6485,21 @@ await client.invoices.cancel({
-**request:** `Square.CancelInvoiceRequest` - +**request:** `Square.CancelInvoiceRequest` +
-**requestOptions:** `InvoicesClient.RequestOptions` - +**requestOptions:** `Invoices.RequestOptions` +
- @@ -6740,20 +6516,21 @@ await client.invoices.cancel({
-Publishes the specified draft invoice. +Publishes the specified draft invoice. -After an invoice is published, Square -follows up based on the invoice configuration. For example, Square -sends the invoice to the customer's email address, charges the customer's card on file, or does -nothing. Square also makes the invoice available on a Square-hosted invoice page. +After an invoice is published, Square +follows up based on the invoice configuration. For example, Square +sends the invoice to the customer's email address, charges the customer's card on file, or does +nothing. Square also makes the invoice available on a Square-hosted invoice page. -The invoice `status` also changes from `DRAFT` to a status -based on the invoice configuration. For example, the status changes to `UNPAID` if -Square emails the invoice or `PARTIALLY_PAID` if Square charges a card on file for a portion of the +The invoice `status` also changes from `DRAFT` to a status +based on the invoice configuration. For example, the status changes to `UNPAID` if +Square emails the invoice or `PARTIALLY_PAID` if Square charges a card on file for a portion of the invoice amount. In addition to the required `ORDERS_WRITE` and `INVOICES_WRITE` permissions, `CUSTOMERS_READ` and `PAYMENTS_WRITE` are required when publishing invoices configured for card-on-file payments. +
@@ -6771,10 +6548,10 @@ and `PAYMENTS_WRITE` are required when publishing invoices configured for card-o await client.invoices.publish({ invoiceId: "invoice_id", version: 1, - idempotencyKey: "32da42d0-1997-41b0-826b-f09464fc2c2e" + idempotencyKey: "32da42d0-1997-41b0-826b-f09464fc2c2e", }); - ``` + @@ -6788,27 +6565,27 @@ await client.invoices.publish({
-**request:** `Square.PublishInvoiceRequest` - +**request:** `Square.PublishInvoiceRequest` +
-**requestOptions:** `InvoicesClient.RequestOptions` - +**requestOptions:** `Invoices.RequestOptions` +
- ## Labor +
client.labor.createScheduledShift({ ...params }) -> Square.CreateScheduledShiftResponse
@@ -6825,14 +6602,15 @@ Creates a scheduled shift by providing draft shift details such as job ID, team member assignment, and start and end times. The following `draft_shift_details` fields are required: + - `location_id` - `job_id` - `start_at` - `end_at` -
-
- - + + + + #### 🔌 Usage @@ -6853,12 +6631,12 @@ await client.labor.createScheduledShift({ startAt: "2019-01-25T03:11:00-05:00", endAt: "2019-01-25T13:11:00-05:00", notes: "Dont forget to prep the vegetables", - isDeleted: false - } - } + isDeleted: false, + }, + }, }); - ``` + @@ -6872,22 +6650,21 @@ await client.labor.createScheduledShift({
-**request:** `Square.CreateScheduledShiftRequest` - +**request:** `Square.CreateScheduledShiftRequest` +
-**requestOptions:** `LaborClient.RequestOptions` - +**requestOptions:** `Labor.RequestOptions` +
-
@@ -6910,6 +6687,7 @@ the `draft_shift_details` field as is and copies it to the `published_shift_deta The minimum `start_at` and maximum `end_at` timestamps of all shifts in a `BulkPublishScheduledShifts` request must fall within a two-week period. + @@ -6926,12 +6704,12 @@ The minimum `start_at` and maximum `end_at` timestamps of all shifts in a ```typescript await client.labor.bulkPublishScheduledShifts({ scheduledShifts: { - "key": {} + key: {}, }, - scheduledShiftNotificationAudience: "AFFECTED" + scheduledShiftNotificationAudience: "AFFECTED", }); - ``` + @@ -6945,22 +6723,21 @@ await client.labor.bulkPublishScheduledShifts({
-**request:** `Square.BulkPublishScheduledShiftsRequest` - +**request:** `Square.BulkPublishScheduledShiftsRequest` +
-**requestOptions:** `LaborClient.RequestOptions` - +**requestOptions:** `Labor.RequestOptions` +
- @@ -6979,6 +6756,7 @@ await client.labor.bulkPublishScheduledShifts({ Returns a paginated list of scheduled shifts, with optional filter and sort settings. By default, results are sorted by `start_at` in ascending order. + @@ -6996,18 +6774,18 @@ By default, results are sorted by `start_at` in ascending order. await client.labor.searchScheduledShifts({ query: { filter: { - assignmentStatus: "ASSIGNED" + assignmentStatus: "ASSIGNED", }, sort: { field: "CREATED_AT", - order: "ASC" - } + order: "ASC", + }, }, limit: 2, - cursor: "xoxp-1234-5678-90123" + cursor: "xoxp-1234-5678-90123", }); - ``` + @@ -7021,22 +6799,21 @@ await client.labor.searchScheduledShifts({
-**request:** `Square.SearchScheduledShiftsRequest` - +**request:** `Square.SearchScheduledShiftsRequest` +
-**requestOptions:** `LaborClient.RequestOptions` - +**requestOptions:** `Labor.RequestOptions` +
- @@ -7054,6 +6831,7 @@ await client.labor.searchScheduledShifts({
Retrieves a scheduled shift by ID. +
@@ -7069,10 +6847,10 @@ Retrieves a scheduled shift by ID. ```typescript await client.labor.retrieveScheduledShift({ - id: "id" + id: "id", }); - ``` + @@ -7086,22 +6864,21 @@ await client.labor.retrieveScheduledShift({
-**request:** `Square.RetrieveScheduledShiftRequest` - +**request:** `Square.RetrieveScheduledShiftRequest` +
-**requestOptions:** `LaborClient.RequestOptions` - +**requestOptions:** `Labor.RequestOptions` +
- @@ -7123,15 +6900,16 @@ sparse updates, so only new, changed, or removed fields are required in the requ You must publish the shift to make updates public. You can make the following updates to `draft_shift_details`: + - Change the `location_id`, `job_id`, `start_at`, and `end_at` fields. - Add, change, or clear the `team_member_id` and `notes` fields. To clear these fields, -set the value to null. + set the value to null. - Change the `is_deleted` field. To delete a scheduled shift, set `is_deleted` to true and then publish the shift. - - - - + + + + #### 🔌 Usage @@ -7152,13 +6930,13 @@ await client.labor.updateScheduledShift({ startAt: "2019-03-25T03:11:00-05:00", endAt: "2019-03-25T13:18:00-05:00", notes: "Dont forget to prep the vegetables", - isDeleted: false + isDeleted: false, }, - version: 1 - } + version: 1, + }, }); - ``` + @@ -7172,22 +6950,21 @@ await client.labor.updateScheduledShift({
-**request:** `Square.UpdateScheduledShiftRequest` - +**request:** `Square.UpdateScheduledShiftRequest` +
-**requestOptions:** `LaborClient.RequestOptions` - +**requestOptions:** `Labor.RequestOptions` +
- @@ -7206,6 +6983,7 @@ await client.labor.updateScheduledShift({ Publishes a scheduled shift. When a scheduled shift is published, Square keeps the `draft_shift_details` field as is and copies it to the `published_shift_details` field. + @@ -7224,10 +7002,10 @@ await client.labor.publishScheduledShift({ id: "id", idempotencyKey: "HIDSNG5KS478L", version: 2, - scheduledShiftNotificationAudience: "ALL" + scheduledShiftNotificationAudience: "ALL", }); - ``` + @@ -7241,22 +7019,21 @@ await client.labor.publishScheduledShift({
-**request:** `Square.PublishScheduledShiftRequest` - +**request:** `Square.PublishScheduledShiftRequest` +
-**requestOptions:** `LaborClient.RequestOptions` - +**requestOptions:** `Labor.RequestOptions` +
- @@ -7284,17 +7061,18 @@ endpoint: - `start_at` An attempt to create a new `Timecard` can result in a `BAD_REQUEST` error when: + - The `status` of the new `Timecard` is `OPEN` and the team member has another -timecard with an `OPEN` status. + timecard with an `OPEN` status. - The `start_at` date is in the future. - The `start_at` or `end_at` date overlaps another timecard for the same team member. - The `Break` instances are set in the request and a break `start_at` is before the `Timecard.start_at`, a break `end_at` is after the `Timecard.end_at`, or both. - - - - + + + + #### 🔌 Usage @@ -7315,27 +7093,29 @@ await client.labor.createTimecard({ title: "Barista", hourlyRate: { amount: BigInt("1100"), - currency: "USD" + currency: "USD", }, - tipEligible: true + tipEligible: true, }, - breaks: [{ + breaks: [ + { startAt: "2019-01-25T06:11:00-05:00", endAt: "2019-01-25T06:16:00-05:00", breakTypeId: "REGS1EQR1TPZ5", name: "Tea Break", expectedDuration: "PT5M", - isPaid: true - }], + isPaid: true, + }, + ], teamMemberId: "ormj0jJJZ5OZIzxrZYJI", declaredCashTipMoney: { amount: BigInt("500"), - currency: "USD" - } - } + currency: "USD", + }, + }, }); - ``` + @@ -7349,22 +7129,21 @@ await client.labor.createTimecard({
-**request:** `Square.CreateTimecardRequest` - +**request:** `Square.CreateTimecardRequest` +
-**requestOptions:** `LaborClient.RequestOptions` - +**requestOptions:** `Labor.RequestOptions` +
- @@ -7383,6 +7162,7 @@ await client.labor.createTimecard({ Returns a paginated list of `Timecard` records for a business. The list to be returned can be filtered by: + - Location IDs - Team member IDs - Timecard status (`OPEN` or `CLOSED`) @@ -7391,14 +7171,15 @@ The list to be returned can be filtered by: - Workday details The list can be sorted by: + - `START_AT` - `END_AT` - `CREATED_AT` - `UPDATED_AT` - - - - + + + + #### 🔌 Usage @@ -7415,17 +7196,17 @@ await client.labor.searchTimecards({ workday: { dateRange: { startDate: "2019-01-20", - endDate: "2019-02-03" + endDate: "2019-02-03", }, matchTimecardsBy: "START_AT", - defaultTimezone: "America/Los_Angeles" - } - } + defaultTimezone: "America/Los_Angeles", + }, + }, }, - limit: 100 + limit: 100, }); - ``` + @@ -7439,22 +7220,21 @@ await client.labor.searchTimecards({
-**request:** `Square.SearchTimecardsRequest` - +**request:** `Square.SearchTimecardsRequest` +
-**requestOptions:** `LaborClient.RequestOptions` - +**requestOptions:** `Labor.RequestOptions` +
- @@ -7472,6 +7252,7 @@ await client.labor.searchTimecards({
Returns a single `Timecard` specified by `id`. +
@@ -7487,10 +7268,10 @@ Returns a single `Timecard` specified by `id`. ```typescript await client.labor.retrieveTimecard({ - id: "id" + id: "id", }); - ``` + @@ -7504,22 +7285,21 @@ await client.labor.retrieveTimecard({
-**request:** `Square.RetrieveTimecardRequest` - +**request:** `Square.RetrieveTimecardRequest` +
-**requestOptions:** `LaborClient.RequestOptions` - +**requestOptions:** `Labor.RequestOptions` +
- @@ -7543,6 +7323,7 @@ the `end_at` property set to a valid RFC-3339 datetime string. When closing a `Timecard`, all `Break` instances in the `Timecard` must be complete with `end_at` set on each `Break`. + @@ -7567,30 +7348,32 @@ await client.labor.updateTimecard({ title: "Bartender", hourlyRate: { amount: BigInt("1500"), - currency: "USD" + currency: "USD", }, - tipEligible: true + tipEligible: true, }, - breaks: [{ + breaks: [ + { id: "X7GAQYVVRRG6P", startAt: "2019-01-25T06:11:00-05:00", endAt: "2019-01-25T06:16:00-05:00", breakTypeId: "REGS1EQR1TPZ5", name: "Tea Break", expectedDuration: "PT5M", - isPaid: true - }], + isPaid: true, + }, + ], status: "CLOSED", version: 1, teamMemberId: "ormj0jJJZ5OZIzxrZYJI", declaredCashTipMoney: { amount: BigInt("500"), - currency: "USD" - } - } + currency: "USD", + }, + }, }); - ``` + @@ -7604,22 +7387,21 @@ await client.labor.updateTimecard({
-**request:** `Square.UpdateTimecardRequest` - +**request:** `Square.UpdateTimecardRequest` +
-**requestOptions:** `LaborClient.RequestOptions` - +**requestOptions:** `Labor.RequestOptions` +
- @@ -7637,6 +7419,7 @@ await client.labor.updateTimecard({
Deletes a `Timecard`. +
@@ -7652,10 +7435,10 @@ Deletes a `Timecard`. ```typescript await client.labor.deleteTimecard({ - id: "id" + id: "id", }); - ``` + @@ -7669,27 +7452,27 @@ await client.labor.deleteTimecard({
-**request:** `Square.DeleteTimecardRequest` - +**request:** `Square.DeleteTimecardRequest` +
-**requestOptions:** `LaborClient.RequestOptions` - +**requestOptions:** `Labor.RequestOptions` +
- ## Locations +
client.locations.list() -> Square.ListLocationsResponse
@@ -7704,6 +7487,7 @@ await client.labor.deleteTimecard({ Provides details about all of the seller's [locations](https://developer.squareup.com/docs/locations-api), including those with an inactive status. Locations are listed alphabetically by `name`. +
@@ -7719,8 +7503,8 @@ including those with an inactive status. Locations are listed alphabetically by ```typescript await client.locations.list(); - ``` + @@ -7734,14 +7518,13 @@ await client.locations.list();
-**requestOptions:** `LocationsClient.RequestOptions` - +**requestOptions:** `Locations.RequestOptions` +
-
@@ -7765,6 +7548,7 @@ that integrate with Square from sales activity elsewhere in a seller's account. Locations created programmatically with the Locations API last forever and are visible to the seller for their own management. Therefore, ensure that each location has a sensible and unique name. + @@ -7786,13 +7570,13 @@ await client.locations.create({ addressLine1: "1234 Peachtree St. NE", locality: "Atlanta", administrativeDistrictLevel1: "GA", - postalCode: "30309" + postalCode: "30309", }, - description: "Midtown Atlanta store" - } + description: "Midtown Atlanta store", + }, }); - ``` + @@ -7806,22 +7590,21 @@ await client.locations.create({
-**request:** `Square.CreateLocationRequest` - +**request:** `Square.CreateLocationRequest` +
-**requestOptions:** `LocationsClient.RequestOptions` - +**requestOptions:** `Locations.RequestOptions` +
- @@ -7840,6 +7623,7 @@ await client.locations.create({ Retrieves details of a single location. Specify "main" as the location ID to retrieve details of the [main location](https://developer.squareup.com/docs/locations-api#about-the-main-location). + @@ -7855,10 +7639,10 @@ as the location ID to retrieve details of the [main location](https://developer. ```typescript await client.locations.get({ - locationId: "location_id" + locationId: "location_id", }); - ``` + @@ -7872,22 +7656,21 @@ await client.locations.get({
-**request:** `Square.GetLocationsRequest` - +**request:** `Square.GetLocationsRequest` +
-**requestOptions:** `LocationsClient.RequestOptions` - +**requestOptions:** `Locations.RequestOptions` +
- @@ -7905,6 +7688,7 @@ await client.locations.get({
Updates a [location](https://developer.squareup.com/docs/locations-api). +
@@ -7923,25 +7707,29 @@ await client.locations.update({ locationId: "location_id", location: { businessHours: { - periods: [{ + periods: [ + { dayOfWeek: "FRI", startLocalTime: "07:00", - endLocalTime: "18:00" - }, { + endLocalTime: "18:00", + }, + { dayOfWeek: "SAT", startLocalTime: "07:00", - endLocalTime: "18:00" - }, { + endLocalTime: "18:00", + }, + { dayOfWeek: "SUN", startLocalTime: "09:00", - endLocalTime: "15:00" - }] + endLocalTime: "15:00", + }, + ], }, - description: "Midtown Atlanta store - Open weekends" - } + description: "Midtown Atlanta store - Open weekends", + }, }); - ``` + @@ -7955,22 +7743,21 @@ await client.locations.update({
-**request:** `Square.UpdateLocationRequest` - +**request:** `Square.UpdateLocationRequest` +
-**requestOptions:** `LocationsClient.RequestOptions` - +**requestOptions:** `Locations.RequestOptions` +
- @@ -7989,11 +7776,11 @@ await client.locations.update({ Links a `checkoutId` to a `checkout_page_url` that customers are directed to in order to provide their payment information using a -payment processing workflow hosted on connect.squareup.com. +payment processing workflow hosted on connect.squareup.com. - -NOTE: The Checkout API has been updated with new features. +NOTE: The Checkout API has been updated with new features. For more information, see [Checkout API highlights](https://developer.squareup.com/docs/checkout-api#checkout-api-highlights). + @@ -8016,51 +7803,63 @@ await client.locations.checkouts({ locationId: "location_id", referenceId: "reference_id", customerId: "customer_id", - lineItems: [{ + lineItems: [ + { name: "Printed T Shirt", quantity: "2", - appliedTaxes: [{ - taxUid: "38ze1696-z1e3-5628-af6d-f1e04d947fg3" - }], - appliedDiscounts: [{ - discountUid: "56ae1696-z1e3-9328-af6d-f1e04d947gd4" - }], + appliedTaxes: [ + { + taxUid: "38ze1696-z1e3-5628-af6d-f1e04d947fg3", + }, + ], + appliedDiscounts: [ + { + discountUid: "56ae1696-z1e3-9328-af6d-f1e04d947gd4", + }, + ], basePriceMoney: { amount: BigInt("1500"), - currency: "USD" - } - }, { + currency: "USD", + }, + }, + { name: "Slim Jeans", quantity: "1", basePriceMoney: { amount: BigInt("2500"), - currency: "USD" - } - }, { + currency: "USD", + }, + }, + { name: "Woven Sweater", quantity: "3", basePriceMoney: { amount: BigInt("3500"), - currency: "USD" - } - }], - taxes: [{ + currency: "USD", + }, + }, + ], + taxes: [ + { uid: "38ze1696-z1e3-5628-af6d-f1e04d947fg3", type: "INCLUSIVE", percentage: "7.75", - scope: "LINE_ITEM" - }], - discounts: [{ + scope: "LINE_ITEM", + }, + ], + discounts: [ + { uid: "56ae1696-z1e3-9328-af6d-f1e04d947gd4", type: "FIXED_AMOUNT", amountMoney: { amount: BigInt("100"), - currency: "USD" + currency: "USD", }, - scope: "LINE_ITEM" - }] + scope: "LINE_ITEM", + }, + ], }, - idempotencyKey: "12ae1696-z1e3-4328-af6d-f1e04d947gd4" + idempotencyKey: "12ae1696-z1e3-4328-af6d-f1e04d947gd4", }, askForShippingAddress: true, merchantSupportEmail: "merchant+support@website.com", @@ -8073,20 +7872,22 @@ await client.locations.checkouts({ postalCode: "94103", country: "US", firstName: "Jane", - lastName: "Doe" + lastName: "Doe", }, redirectUrl: "https://merchant.website.com/order-confirm", - additionalRecipients: [{ + additionalRecipients: [ + { locationId: "057P5VYJ4A5X1", description: "Application fees", amountMoney: { amount: BigInt("60"), - currency: "USD" - } - }] + currency: "USD", + }, + }, + ], }); - ``` + @@ -8100,27 +7901,27 @@ await client.locations.checkouts({
-**request:** `Square.CreateCheckoutRequest` - +**request:** `Square.CreateCheckoutRequest` +
-**requestOptions:** `LocationsClient.RequestOptions` - +**requestOptions:** `Locations.RequestOptions` +
- ## Loyalty +
client.loyalty.searchEvents({ ...params }) -> Square.SearchLoyaltyEventsResponse
@@ -8141,6 +7942,7 @@ buyer's loyalty account. Each change in the point balance recorded in the ledger. Using this endpoint, you can search the ledger for events. Search results are sorted by `created_at` in descending order. +
@@ -8159,14 +7961,14 @@ await client.loyalty.searchEvents({ query: { filter: { orderFilter: { - orderId: "PyATxhYLfsMqpVkcKJITPydgEYfZY" - } - } + orderId: "PyATxhYLfsMqpVkcKJITPydgEYfZY", + }, + }, }, - limit: 30 + limit: 30, }); - ``` + @@ -8180,28 +7982,28 @@ await client.loyalty.searchEvents({
-**request:** `Square.SearchLoyaltyEventsRequest` - +**request:** `Square.SearchLoyaltyEventsRequest` +
-**requestOptions:** `LoyaltyClient.RequestOptions` - +**requestOptions:** `Loyalty.RequestOptions` +
-
## Merchants -
client.merchants.list({ ...params }) -> core.Page + +
client.merchants.list({ ...params }) -> core.Page<Square.Merchant>
@@ -8223,6 +8025,7 @@ information for the merchant that granted your application access. If you know the merchant ID, you can also use the [RetrieveMerchant](api-endpoint:Merchants-RetrieveMerchant) endpoint to retrieve the merchant information. +
@@ -8237,25 +8040,22 @@ endpoint to retrieve the merchant information.
```typescript -const pageableResponse = await client.merchants.list({ - cursor: 1 +const response = await client.merchants.list({ + cursor: 1, }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.merchants.list({ - cursor: 1 + cursor: 1, }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -8269,22 +8069,21 @@ const response = page.response;
-**request:** `Square.ListMerchantsRequest` - +**request:** `Square.ListMerchantsRequest` +
-**requestOptions:** `MerchantsClient.RequestOptions` - +**requestOptions:** `Merchants.RequestOptions` +
-
@@ -8302,6 +8101,7 @@ const response = page.response;
Retrieves the `Merchant` object for the given `merchant_id`. +
@@ -8317,10 +8117,10 @@ Retrieves the `Merchant` object for the given `merchant_id`. ```typescript await client.merchants.get({ - merchantId: "merchant_id" + merchantId: "merchant_id", }); - ``` + @@ -8334,27 +8134,27 @@ await client.merchants.get({
-**request:** `Square.GetMerchantsRequest` - +**request:** `Square.GetMerchantsRequest` +
-**requestOptions:** `MerchantsClient.RequestOptions` - +**requestOptions:** `Merchants.RequestOptions` +
-
## Checkout +
client.checkout.retrieveLocationSettings({ ...params }) -> Square.RetrieveLocationSettingsResponse
@@ -8368,6 +8168,7 @@ await client.merchants.get({
Retrieves the location-level settings for a Square-hosted checkout page. +
@@ -8383,10 +8184,10 @@ Retrieves the location-level settings for a Square-hosted checkout page. ```typescript await client.checkout.retrieveLocationSettings({ - locationId: "location_id" + locationId: "location_id", }); - ``` + @@ -8400,22 +8201,21 @@ await client.checkout.retrieveLocationSettings({
-**request:** `Square.RetrieveLocationSettingsRequest` - +**request:** `Square.RetrieveLocationSettingsRequest` +
-**requestOptions:** `CheckoutClient.RequestOptions` - +**requestOptions:** `Checkout.RequestOptions` +
-
@@ -8433,6 +8233,7 @@ await client.checkout.retrieveLocationSettings({
Updates the location-level settings for a Square-hosted checkout page. +
@@ -8449,10 +8250,10 @@ Updates the location-level settings for a Square-hosted checkout page. ```typescript await client.checkout.updateLocationSettings({ locationId: "location_id", - locationSettings: {} + locationSettings: {}, }); - ``` + @@ -8466,22 +8267,21 @@ await client.checkout.updateLocationSettings({
-**request:** `Square.UpdateLocationSettingsRequest` - +**request:** `Square.UpdateLocationSettingsRequest` +
-**requestOptions:** `CheckoutClient.RequestOptions` - +**requestOptions:** `Checkout.RequestOptions` +
- @@ -8499,6 +8299,7 @@ await client.checkout.updateLocationSettings({
Retrieves the merchant-level settings for a Square-hosted checkout page. +
@@ -8514,8 +8315,8 @@ Retrieves the merchant-level settings for a Square-hosted checkout page. ```typescript await client.checkout.retrieveMerchantSettings(); - ``` + @@ -8529,14 +8330,13 @@ await client.checkout.retrieveMerchantSettings();
-**requestOptions:** `CheckoutClient.RequestOptions` - +**requestOptions:** `Checkout.RequestOptions` +
- @@ -8554,6 +8354,7 @@ await client.checkout.retrieveMerchantSettings();
Updates the merchant-level settings for a Square-hosted checkout page. +
@@ -8569,10 +8370,10 @@ Updates the merchant-level settings for a Square-hosted checkout page. ```typescript await client.checkout.updateMerchantSettings({ - merchantSettings: {} + merchantSettings: {}, }); - ``` + @@ -8586,27 +8387,27 @@ await client.checkout.updateMerchantSettings({
-**request:** `Square.UpdateMerchantSettingsRequest` - +**request:** `Square.UpdateMerchantSettingsRequest` +
-**requestOptions:** `CheckoutClient.RequestOptions` - +**requestOptions:** `Checkout.RequestOptions` +
- ## Orders +
client.orders.create({ ...params }) -> Square.CreateOrderResponse
@@ -8626,6 +8427,7 @@ To pay for a created order, see [Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders). You can modify open orders using the [UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint. +
@@ -8644,52 +8446,65 @@ await client.orders.create({ order: { locationId: "057P5VYJ4A5X1", referenceId: "my-order-001", - lineItems: [{ + lineItems: [ + { name: "New York Strip Steak", quantity: "1", basePriceMoney: { amount: BigInt("1599"), - currency: "USD" - } - }, { + currency: "USD", + }, + }, + { quantity: "2", catalogObjectId: "BEMYCSMIJL46OCDV4KYIKXIB", - modifiers: [{ - catalogObjectId: "CHQX7Y4KY6N5KINJKZCFURPZ" - }], - appliedDiscounts: [{ - discountUid: "one-dollar-off" - }] - }], - taxes: [{ + modifiers: [ + { + catalogObjectId: "CHQX7Y4KY6N5KINJKZCFURPZ", + }, + ], + appliedDiscounts: [ + { + discountUid: "one-dollar-off", + }, + ], + }, + ], + taxes: [ + { uid: "state-sales-tax", name: "State Sales Tax", percentage: "9", - scope: "ORDER" - }], - discounts: [{ + scope: "ORDER", + }, + ], + discounts: [ + { uid: "labor-day-sale", name: "Labor Day Sale", percentage: "5", - scope: "ORDER" - }, { + scope: "ORDER", + }, + { uid: "membership-discount", catalogObjectId: "DB7L55ZH2BGWI4H23ULIWOQ7", - scope: "ORDER" - }, { + scope: "ORDER", + }, + { uid: "one-dollar-off", name: "Sale - $1.00 off", amountMoney: { amount: BigInt("100"), - currency: "USD" + currency: "USD", }, - scope: "LINE_ITEM" - }] + scope: "LINE_ITEM", + }, + ], }, - idempotencyKey: "8193148c-9586-11e6-99f9-28cfe92138cf" + idempotencyKey: "8193148c-9586-11e6-99f9-28cfe92138cf", }); - ``` + @@ -8703,22 +8518,21 @@ await client.orders.create({
-**request:** `Square.CreateOrderRequest` - +**request:** `Square.CreateOrderRequest` +
-**requestOptions:** `OrdersClient.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
-
@@ -8738,6 +8552,7 @@ await client.orders.create({ Retrieves a set of [orders](entity:Order) by their IDs. If a given order ID does not exist, the ID is ignored instead of generating an error. + @@ -8754,10 +8569,10 @@ If a given order ID does not exist, the ID is ignored instead of generating an e ```typescript await client.orders.batchGet({ locationId: "057P5VYJ4A5X1", - orderIds: ["CAISEM82RcpmcFBM0TfOyiHV3es", "CAISENgvlJ6jLWAzERDzjyHVybY"] + orderIds: ["CAISEM82RcpmcFBM0TfOyiHV3es", "CAISENgvlJ6jLWAzERDzjyHVybY"], }); - ``` + @@ -8771,22 +8586,21 @@ await client.orders.batchGet({
-**request:** `Square.BatchGetOrdersRequest` - +**request:** `Square.BatchGetOrdersRequest` +
-**requestOptions:** `OrdersClient.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
- @@ -8804,6 +8618,7 @@ await client.orders.batchGet({
Enables applications to preview order pricing without creating an order. +
@@ -8821,30 +8636,35 @@ Enables applications to preview order pricing without creating an order. await client.orders.calculate({ order: { locationId: "D7AVYMEAPJ3A3", - lineItems: [{ + lineItems: [ + { name: "Item 1", quantity: "1", basePriceMoney: { amount: BigInt("500"), - currency: "USD" - } - }, { + currency: "USD", + }, + }, + { name: "Item 2", quantity: "2", basePriceMoney: { amount: BigInt("300"), - currency: "USD" - } - }], - discounts: [{ + currency: "USD", + }, + }, + ], + discounts: [ + { name: "50% Off", percentage: "50", - scope: "ORDER" - }] - } + scope: "ORDER", + }, + ], + }, }); - ``` + @@ -8858,22 +8678,21 @@ await client.orders.calculate({
-**request:** `Square.CalculateOrderRequest` - +**request:** `Square.CalculateOrderRequest` +
-**requestOptions:** `OrdersClient.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
- @@ -8892,6 +8711,7 @@ await client.orders.calculate({ Creates a new order, in the `DRAFT` state, by duplicating an existing order. The newly created order has only the core fields (such as line items, taxes, and discounts) copied from the original order. + @@ -8909,10 +8729,10 @@ only the core fields (such as line items, taxes, and discounts) copied from the await client.orders.clone({ orderId: "ZAISEM52YcpmcWAzERDOyiWS123", version: 3, - idempotencyKey: "UNIQUE_STRING" + idempotencyKey: "UNIQUE_STRING", }); - ``` + @@ -8926,22 +8746,21 @@ await client.orders.clone({
-**request:** `Square.CloneOrderRequest` - +**request:** `Square.CloneOrderRequest` +
-**requestOptions:** `OrdersClient.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
- @@ -8966,15 +8785,16 @@ ecosystem (such as Point of Sale, Invoices, and Connect APIs). [SearchOrdersQuery](entity:SearchOrdersQuery) object that controls how to sort or filter the results. Your `SearchOrdersQuery` can: - Set filter criteria. - Set the sort order. - Determine whether to return results as complete `Order` objects or as +Set filter criteria. +Set the sort order. +Determine whether to return results as complete `Order` objects or as [OrderEntry](entity:OrderEntry) objects. Note that details for orders processed with Square Point of Sale while in offline mode might not be transmitted to Square for up to 72 hours. Offline orders have a `created_at` value that reflects the time the order was created, not the time it was subsequently transmitted to Square. + @@ -8994,25 +8814,25 @@ await client.orders.search({ query: { filter: { stateFilter: { - states: ["COMPLETED"] + states: ["COMPLETED"], }, dateTimeFilter: { closedAt: { startAt: "2018-03-03T20:00:00+00:00", - endAt: "2019-03-04T21:54:45+00:00" - } - } + endAt: "2019-03-04T21:54:45+00:00", + }, + }, }, sort: { sortField: "CLOSED_AT", - sortOrder: "DESC" - } + sortOrder: "DESC", + }, }, limit: 3, - returnEntries: true + returnEntries: true, }); - ``` + @@ -9026,22 +8846,21 @@ await client.orders.search({
-**request:** `Square.SearchOrdersRequest` - +**request:** `Square.SearchOrdersRequest` +
-**requestOptions:** `OrdersClient.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
- @@ -9059,6 +8878,7 @@ await client.orders.search({
Retrieves an [Order](entity:Order) by ID. +
@@ -9074,10 +8894,10 @@ Retrieves an [Order](entity:Order) by ID. ```typescript await client.orders.get({ - orderId: "order_id" + orderId: "order_id", }); - ``` + @@ -9091,22 +8911,21 @@ await client.orders.get({
-**request:** `Square.GetOrdersRequest` - +**request:** `Square.GetOrdersRequest` +
-**requestOptions:** `OrdersClient.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
- @@ -9131,13 +8950,14 @@ An `UpdateOrder` request requires the following: - The `order_id` in the endpoint path, identifying the order to update. - The latest `version` of the order to update. - The [sparse order](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#sparse-order-objects) -containing only the fields to update and the version to which the update is -being applied. + containing only the fields to update and the version to which the update is + being applied. - If deleting fields, the [dot notation paths](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#identifying-fields-to-delete) -identifying the fields to clear. + identifying the fields to clear. To pay for an order, see [Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders). + @@ -9156,22 +8976,24 @@ await client.orders.update({ orderId: "order_id", order: { locationId: "location_id", - lineItems: [{ + lineItems: [ + { uid: "cookie_uid", name: "COOKIE", quantity: "2", basePriceMoney: { amount: BigInt("200"), - currency: "USD" - } - }], - version: 1 + currency: "USD", + }, + }, + ], + version: 1, }, fieldsToClear: ["discounts"], - idempotencyKey: "UNIQUE_STRING" + idempotencyKey: "UNIQUE_STRING", }); - ``` + @@ -9185,22 +9007,21 @@ await client.orders.update({
-**request:** `Square.UpdateOrderRequest` - +**request:** `Square.UpdateOrderRequest` +
-**requestOptions:** `OrdersClient.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
- @@ -9227,14 +9048,14 @@ array of `payment_ids` in the request. To be used with `PayOrder`, a payment must: - Reference the order by specifying the `order_id` when [creating the payment](api-endpoint:Payments-CreatePayment). -Any approved payments that reference the same `order_id` not specified in the -`payment_ids` is canceled. + Any approved payments that reference the same `order_id` not specified in the + `payment_ids` is canceled. - Be approved with [delayed capture](https://developer.squareup.com/docs/payments-api/take-payments/card-payments/delayed-capture). Using a delayed capture payment with `PayOrder` completes the approved payment. - - - - + + + + #### 🔌 Usage @@ -9248,10 +9069,10 @@ Using a delayed capture payment with `PayOrder` completes the approved payment. await client.orders.pay({ orderId: "order_id", idempotencyKey: "c043a359-7ad9-4136-82a9-c3f1d66dcbff", - paymentIds: ["EnZdNAlWCmfh6Mt5FMNST1o7taB", "0LRiVlbXVwe8ozu4KbZxd12mvaB"] + paymentIds: ["EnZdNAlWCmfh6Mt5FMNST1o7taB", "0LRiVlbXVwe8ozu4KbZxd12mvaB"], }); - ``` + @@ -9265,28 +9086,28 @@ await client.orders.pay({
-**request:** `Square.PayOrderRequest` - +**request:** `Square.PayOrderRequest` +
-**requestOptions:** `OrdersClient.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
- ## Payments -
client.payments.list({ ...params }) -> core.Page + +
client.payments.list({ ...params }) -> core.Page<Square.Payment>
@@ -9304,6 +9125,7 @@ Results are eventually consistent, and new payments or changes to payments might seconds to appear. The maximum results per page is 100. +
@@ -9318,7 +9140,7 @@ The maximum results per page is 100.
```typescript -const pageableResponse = await client.payments.list({ +const response = await client.payments.list({ beginTime: "begin_time", endTime: "end_time", sortOrder: "sort_order", @@ -9333,9 +9155,9 @@ const pageableResponse = await client.payments.list({ offlineEndTime: "offline_end_time", updatedAtBeginTime: "updated_at_begin_time", updatedAtEndTime: "updated_at_end_time", - sortField: "CREATED_AT" + sortField: "CREATED_AT", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -9355,16 +9177,13 @@ let page = await client.payments.list({ offlineEndTime: "offline_end_time", updatedAtBeginTime: "updated_at_begin_time", updatedAtEndTime: "updated_at_end_time", - sortField: "CREATED_AT" + sortField: "CREATED_AT", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -9378,22 +9197,21 @@ const response = page.response;
-**request:** `Square.ListPaymentsRequest` - +**request:** `Square.ListPaymentsRequest` +
-**requestOptions:** `PaymentsClient.RequestOptions` - +**requestOptions:** `Payments.RequestOptions` +
-
@@ -9410,14 +9228,15 @@ const response = page.response;
-Creates a payment using the provided source. You can use this endpoint -to charge a card (credit/debit card or -Square gift card) or record a payment that the seller received outside of Square -(cash payment from a buyer or a payment that an external entity +Creates a payment using the provided source. You can use this endpoint +to charge a card (credit/debit card or +Square gift card) or record a payment that the seller received outside of Square +(cash payment from a buyer or a payment that an external entity processed on behalf of the seller). -The endpoint creates a +The endpoint creates a `Payment` object and returns it in the response. +
@@ -9437,20 +9256,20 @@ await client.payments.create({ idempotencyKey: "7b0f3ec5-086a-4871-8f13-3c81b3875218", amountMoney: { amount: BigInt("1000"), - currency: "USD" + currency: "USD", }, appFeeMoney: { amount: BigInt("10"), - currency: "USD" + currency: "USD", }, autocomplete: true, customerId: "W92WH6P11H4Z77CTET0RNTGFW8", locationId: "L88917AVBK2S5", referenceId: "123456", - note: "Brief description" + note: "Brief description", }); - ``` + @@ -9464,22 +9283,21 @@ await client.payments.create({
-**request:** `Square.CreatePaymentRequest` - +**request:** `Square.CreatePaymentRequest` +
-**requestOptions:** `PaymentsClient.RequestOptions` - +**requestOptions:** `Payments.RequestOptions` +
-
@@ -9507,6 +9325,7 @@ canceling the payment, you can submit your `CreatePayment` request again. Note that if no payment with the specified idempotency key is found, no action is taken and the endpoint returns successfully. + @@ -9522,10 +9341,10 @@ returns successfully. ```typescript await client.payments.cancelByIdempotencyKey({ - idempotencyKey: "a7e36d40-d24b-11e8-b568-0800200c9a66" + idempotencyKey: "a7e36d40-d24b-11e8-b568-0800200c9a66", }); - ``` + @@ -9539,22 +9358,21 @@ await client.payments.cancelByIdempotencyKey({
-**request:** `Square.CancelPaymentByIdempotencyKeyRequest` - +**request:** `Square.CancelPaymentByIdempotencyKeyRequest` +
-**requestOptions:** `PaymentsClient.RequestOptions` - +**requestOptions:** `Payments.RequestOptions` +
- @@ -9572,6 +9390,7 @@ await client.payments.cancelByIdempotencyKey({
Retrieves details for a specific payment. +
@@ -9587,10 +9406,10 @@ Retrieves details for a specific payment. ```typescript await client.payments.get({ - paymentId: "payment_id" + paymentId: "payment_id", }); - ``` + @@ -9604,22 +9423,21 @@ await client.payments.get({
-**request:** `Square.GetPaymentsRequest` - +**request:** `Square.GetPaymentsRequest` +
-**requestOptions:** `PaymentsClient.RequestOptions` - +**requestOptions:** `Payments.RequestOptions` +
- @@ -9638,6 +9456,7 @@ await client.payments.get({ Updates a payment with the APPROVED status. You can update the `amount_money` and `tip_money` using this endpoint. + @@ -9657,18 +9476,18 @@ await client.payments.update({ payment: { amountMoney: { amount: BigInt("1000"), - currency: "USD" + currency: "USD", }, tipMoney: { amount: BigInt("100"), - currency: "USD" + currency: "USD", }, - versionToken: "ODhwVQ35xwlzRuoZEwKXucfu7583sPTzK48c5zoGd0g6o" + versionToken: "ODhwVQ35xwlzRuoZEwKXucfu7583sPTzK48c5zoGd0g6o", }, - idempotencyKey: "956f8b13-e4ec-45d6-85e8-d1d95ef0c5de" + idempotencyKey: "956f8b13-e4ec-45d6-85e8-d1d95ef0c5de", }); - ``` + @@ -9682,22 +9501,21 @@ await client.payments.update({
-**request:** `Square.UpdatePaymentRequest` - +**request:** `Square.UpdatePaymentRequest` +
-**requestOptions:** `PaymentsClient.RequestOptions` - +**requestOptions:** `Payments.RequestOptions` +
- @@ -9714,8 +9532,9 @@ await client.payments.update({
-Cancels (voids) a payment. You can use this endpoint to cancel a payment with +Cancels (voids) a payment. You can use this endpoint to cancel a payment with the APPROVED `status`. +
@@ -9731,10 +9550,10 @@ the APPROVED `status`. ```typescript await client.payments.cancel({ - paymentId: "payment_id" + paymentId: "payment_id", }); - ``` + @@ -9748,22 +9567,21 @@ await client.payments.cancel({
-**request:** `Square.CancelPaymentsRequest` - +**request:** `Square.CancelPaymentsRequest` +
-**requestOptions:** `PaymentsClient.RequestOptions` - +**requestOptions:** `Payments.RequestOptions` +
- @@ -9784,6 +9602,7 @@ Completes (captures) a payment. By default, payments are set to complete immediately after they are created. You can use this endpoint to complete a payment with the APPROVED `status`. + @@ -9799,10 +9618,10 @@ You can use this endpoint to complete a payment with the APPROVED `status`. ```typescript await client.payments.complete({ - paymentId: "payment_id" + paymentId: "payment_id", }); - ``` + @@ -9816,28 +9635,28 @@ await client.payments.complete({
-**request:** `Square.CompletePaymentRequest` - +**request:** `Square.CompletePaymentRequest` +
-**requestOptions:** `PaymentsClient.RequestOptions` - +**requestOptions:** `Payments.RequestOptions` +
- ## Payouts -
client.payouts.list({ ...params }) -> core.Page + +
client.payouts.list({ ...params }) -> core.Page<Square.Payout>
@@ -9852,6 +9671,7 @@ await client.payments.complete({ Retrieves a list of all payouts for the default location. You can filter payouts by location ID, status, time range, and order them in ascending or descending order. To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. +
@@ -9866,16 +9686,16 @@ To call this endpoint, set `PAYOUTS_READ` for the OAuth scope.
```typescript -const pageableResponse = await client.payouts.list({ +const response = await client.payouts.list({ locationId: "location_id", status: "SENT", beginTime: "begin_time", endTime: "end_time", sortOrder: "DESC", cursor: "cursor", - limit: 1 + limit: 1, }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -9887,16 +9707,13 @@ let page = await client.payouts.list({ endTime: "end_time", sortOrder: "DESC", cursor: "cursor", - limit: 1 + limit: 1, }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -9910,22 +9727,21 @@ const response = page.response;
-**request:** `Square.ListPayoutsRequest` - +**request:** `Square.ListPayoutsRequest` +
-**requestOptions:** `PayoutsClient.RequestOptions` - +**requestOptions:** `Payouts.RequestOptions` +
-
@@ -9944,6 +9760,7 @@ const response = page.response; Retrieves details of a specific payout identified by a payout ID. To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. + @@ -9959,10 +9776,10 @@ To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. ```typescript await client.payouts.get({ - payoutId: "payout_id" + payoutId: "payout_id", }); - ``` + @@ -9976,27 +9793,26 @@ await client.payouts.get({
-**request:** `Square.GetPayoutsRequest` - +**request:** `Square.GetPayoutsRequest` +
-**requestOptions:** `PayoutsClient.RequestOptions` - +**requestOptions:** `Payouts.RequestOptions` +
-
-
client.payouts.listEntries({ ...params }) -> core.Page +
client.payouts.listEntries({ ...params }) -> core.Page<Square.PayoutEntry>
@@ -10010,6 +9826,7 @@ await client.payouts.get({ Retrieves a list of all payout entries for a specific payout. To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. +
@@ -10024,13 +9841,13 @@ To call this endpoint, set `PAYOUTS_READ` for the OAuth scope.
```typescript -const pageableResponse = await client.payouts.listEntries({ +const response = await client.payouts.listEntries({ payoutId: "payout_id", sortOrder: "DESC", cursor: "cursor", - limit: 1 + limit: 1, }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -10039,16 +9856,13 @@ let page = await client.payouts.listEntries({ payoutId: "payout_id", sortOrder: "DESC", cursor: "cursor", - limit: 1 + limit: 1, }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -10062,28 +9876,28 @@ const response = page.response;
-**request:** `Square.ListEntriesPayoutsRequest` - +**request:** `Square.ListEntriesPayoutsRequest` +
-**requestOptions:** `PayoutsClient.RequestOptions` - +**requestOptions:** `Payouts.RequestOptions` +
-
## Refunds -
client.refunds.list({ ...params }) -> core.Page + +
client.refunds.list({ ...params }) -> core.Page<Square.PaymentRefund>
@@ -10101,6 +9915,7 @@ Results are eventually consistent, and new refunds or changes to refunds might t seconds to appear. The maximum results per page is 100. +
@@ -10115,7 +9930,7 @@ The maximum results per page is 100.
```typescript -const pageableResponse = await client.refunds.list({ +const response = await client.refunds.list({ beginTime: "begin_time", endTime: "end_time", sortOrder: "sort_order", @@ -10126,9 +9941,9 @@ const pageableResponse = await client.refunds.list({ limit: 1, updatedAtBeginTime: "updated_at_begin_time", updatedAtEndTime: "updated_at_end_time", - sortField: "CREATED_AT" + sortField: "CREATED_AT", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -10144,16 +9959,13 @@ let page = await client.refunds.list({ limit: 1, updatedAtBeginTime: "updated_at_begin_time", updatedAtEndTime: "updated_at_end_time", - sortField: "CREATED_AT" + sortField: "CREATED_AT", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -10167,22 +9979,21 @@ const response = page.response;
-**request:** `Square.ListRefundsRequest` - +**request:** `Square.ListRefundsRequest` +
-**requestOptions:** `RefundsClient.RequestOptions` - +**requestOptions:** `Refunds.RequestOptions` +
-
@@ -10200,9 +10011,10 @@ const response = page.response;
Refunds a payment. You can refund the entire payment amount or a -portion of it. You can use this endpoint to refund a card payment or record a +portion of it. You can use this endpoint to refund a card payment or record a refund of a cash or external payment. For more information, see [Refund Payment](https://developer.squareup.com/docs/payments-api/refund-payments). +
@@ -10221,17 +10033,17 @@ await client.refunds.refundPayment({ idempotencyKey: "9b7f2dcf-49da-4411-b23e-a2d6af21333a", amountMoney: { amount: BigInt("1000"), - currency: "USD" + currency: "USD", }, appFeeMoney: { amount: BigInt("10"), - currency: "USD" + currency: "USD", }, paymentId: "R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY", - reason: "Example" + reason: "Example", }); - ``` + @@ -10245,22 +10057,21 @@ await client.refunds.refundPayment({
-**request:** `Square.RefundPaymentRequest` - +**request:** `Square.RefundPaymentRequest` +
-**requestOptions:** `RefundsClient.RequestOptions` - +**requestOptions:** `Refunds.RequestOptions` +
-
@@ -10278,6 +10089,7 @@ await client.refunds.refundPayment({
Retrieves a specific refund using the `refund_id`. +
@@ -10293,10 +10105,10 @@ Retrieves a specific refund using the `refund_id`. ```typescript await client.refunds.get({ - refundId: "refund_id" + refundId: "refund_id", }); - ``` + @@ -10310,27 +10122,27 @@ await client.refunds.get({
-**request:** `Square.GetRefundsRequest` - +**request:** `Square.GetRefundsRequest` +
-**requestOptions:** `RefundsClient.RequestOptions` - +**requestOptions:** `Refunds.RequestOptions` +
-
## Sites +
client.sites.list() -> Square.ListSitesResponse
@@ -10345,8 +10157,8 @@ await client.refunds.get({ Lists the Square Online sites that belong to a seller. Sites are listed in descending order by the `created_at` date. +**Note:** Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). -__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis).
@@ -10362,8 +10174,8 @@ __Note:__ Square Online APIs are publicly available as part of an early access p ```typescript await client.sites.list(); - ``` + @@ -10377,19 +10189,19 @@ await client.sites.list();
-**requestOptions:** `SitesClient.RequestOptions` - +**requestOptions:** `Sites.RequestOptions` +
-
## Snippets +
client.snippets.get({ ...params }) -> Square.GetSnippetResponse
@@ -10406,8 +10218,8 @@ Retrieves your snippet from a Square Online site. A site can contain snippets fr You can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of the sites that belong to a seller. +**Note:** Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). -__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis).
@@ -10423,10 +10235,10 @@ __Note:__ Square Online APIs are publicly available as part of an early access p ```typescript await client.snippets.get({ - siteId: "site_id" + siteId: "site_id", }); - ``` + @@ -10440,22 +10252,21 @@ await client.snippets.get({
-**request:** `Square.GetSnippetsRequest` - +**request:** `Square.GetSnippetsRequest` +
-**requestOptions:** `SnippetsClient.RequestOptions` - +**requestOptions:** `Snippets.RequestOptions` +
-
@@ -10472,13 +10283,13 @@ await client.snippets.get({
-Adds a snippet to a Square Online site or updates the existing snippet on the site. -The snippet code is appended to the end of the `head` element on every page of the site, except checkout pages. A snippet application can add one snippet to a given site. +Adds a snippet to a Square Online site or updates the existing snippet on the site. +The snippet code is appended to the end of the `head` element on every page of the site, except checkout pages. A snippet application can add one snippet to a given site. You can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of the sites that belong to a seller. +**Note:** Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). -__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis).
@@ -10496,11 +10307,11 @@ __Note:__ Square Online APIs are publicly available as part of an early access p await client.snippets.upsert({ siteId: "site_id", snippet: { - content: "" - } + content: "", + }, }); - ``` + @@ -10514,22 +10325,21 @@ await client.snippets.upsert({
-**request:** `Square.UpsertSnippetRequest` - +**request:** `Square.UpsertSnippetRequest` +
-**requestOptions:** `SnippetsClient.RequestOptions` - +**requestOptions:** `Snippets.RequestOptions` +
- @@ -10550,8 +10360,8 @@ Removes your snippet from a Square Online site. You can call [ListSites](api-endpoint:Sites-ListSites) to get the IDs of the sites that belong to a seller. +**Note:** Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). -__Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). @@ -10567,10 +10377,10 @@ __Note:__ Square Online APIs are publicly available as part of an early access p ```typescript await client.snippets.delete({ - siteId: "site_id" + siteId: "site_id", }); - ``` + @@ -10584,27 +10394,27 @@ await client.snippets.delete({
-**request:** `Square.DeleteSnippetsRequest` - +**request:** `Square.DeleteSnippetsRequest` +
-**requestOptions:** `SnippetsClient.RequestOptions` - +**requestOptions:** `Snippets.RequestOptions` +
- ## Subscriptions +
client.subscriptions.create({ ...params }) -> Square.CreateSubscriptionResponse
@@ -10625,6 +10435,7 @@ address. The subscription starts immediately, unless the request includes the optional `start_date`. Each individual subscription is associated with a particular location. For more information, see [Create a subscription](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#create-a-subscription). +
@@ -10648,15 +10459,17 @@ await client.subscriptions.create({ cardId: "ccof:qy5x8hHGYsgLrp4Q4GB", timezone: "America/Los_Angeles", source: { - name: "My Application" + name: "My Application", }, - phases: [{ + phases: [ + { ordinal: BigInt("0"), - orderTemplateId: "U2NaowWxzXwpsZU697x7ZHOAnCNZY" - }] + orderTemplateId: "U2NaowWxzXwpsZU697x7ZHOAnCNZY", + }, + ], }); - ``` + @@ -10670,22 +10483,21 @@ await client.subscriptions.create({
-**request:** `Square.CreateSubscriptionRequest` - +**request:** `Square.CreateSubscriptionRequest` +
-**requestOptions:** `SubscriptionsClient.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
-
@@ -10704,6 +10516,7 @@ await client.subscriptions.create({ Schedules a plan variation change for all active subscriptions under a given plan variation. For more information, see [Swap Subscription Plan Variations](https://developer.squareup.com/docs/subscriptions-api/swap-plan-variations). + @@ -10721,10 +10534,10 @@ variation. For more information, see [Swap Subscription Plan Variations](https:/ await client.subscriptions.bulkSwapPlan({ newPlanVariationId: "FQ7CDXXWSLUJRPM3GFJSJGZ7", oldPlanVariationId: "6JHXF3B2CW3YKHDV4XEM674H", - locationId: "S8GWD5R9QB376" + locationId: "S8GWD5R9QB376", }); - ``` + @@ -10738,22 +10551,21 @@ await client.subscriptions.bulkSwapPlan({
-**request:** `Square.BulkSwapPlanRequest` - +**request:** `Square.BulkSwapPlanRequest` +
-**requestOptions:** `SubscriptionsClient.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
- @@ -10784,6 +10596,7 @@ associated with the specified locations are returned. If the request specifies customer IDs, the endpoint orders results first by location, within location by customer ID, and within customer by subscription creation date. + @@ -10803,12 +10616,12 @@ await client.subscriptions.search({ filter: { customerIds: ["CHFGVKYY8RSV93M5KCYTG4PN0G"], locationIds: ["S8GWD5R9QB376"], - sourceNames: ["My App"] - } - } + sourceNames: ["My App"], + }, + }, }); - ``` + @@ -10822,22 +10635,21 @@ await client.subscriptions.search({
-**request:** `Square.SearchSubscriptionsRequest` - +**request:** `Square.SearchSubscriptionsRequest` +
-**requestOptions:** `SubscriptionsClient.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
- @@ -10855,6 +10667,7 @@ await client.subscriptions.search({
Retrieves a specific subscription. +
@@ -10871,10 +10684,10 @@ Retrieves a specific subscription. ```typescript await client.subscriptions.get({ subscriptionId: "subscription_id", - include: "include" + include: "include", }); - ``` + @@ -10888,22 +10701,21 @@ await client.subscriptions.get({
-**request:** `Square.GetSubscriptionsRequest` - +**request:** `Square.GetSubscriptionsRequest` +
-**requestOptions:** `SubscriptionsClient.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
- @@ -10922,6 +10734,7 @@ await client.subscriptions.get({ Updates a subscription by modifying or clearing `subscription` field values. To clear a field, set its value to `null`. + @@ -10939,11 +10752,11 @@ To clear a field, set its value to `null`. await client.subscriptions.update({ subscriptionId: "subscription_id", subscription: { - cardId: "{NEW CARD ID}" - } + cardId: "{NEW CARD ID}", + }, }); - ``` + @@ -10957,22 +10770,21 @@ await client.subscriptions.update({
-**request:** `Square.UpdateSubscriptionRequest` - +**request:** `Square.UpdateSubscriptionRequest` +
-**requestOptions:** `SubscriptionsClient.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
- @@ -10990,6 +10802,7 @@ await client.subscriptions.update({
Deletes a scheduled action for a subscription. +
@@ -11006,10 +10819,10 @@ Deletes a scheduled action for a subscription. ```typescript await client.subscriptions.deleteAction({ subscriptionId: "subscription_id", - actionId: "action_id" + actionId: "action_id", }); - ``` + @@ -11023,22 +10836,21 @@ await client.subscriptions.deleteAction({
-**request:** `Square.DeleteActionSubscriptionsRequest` - +**request:** `Square.DeleteActionSubscriptionsRequest` +
-**requestOptions:** `SubscriptionsClient.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
- @@ -11057,6 +10869,7 @@ await client.subscriptions.deleteAction({ Changes the [billing anchor date](https://developer.squareup.com/docs/subscriptions-api/subscription-billing#billing-dates) for a subscription. + @@ -11073,10 +10886,10 @@ for a subscription. ```typescript await client.subscriptions.changeBillingAnchorDate({ subscriptionId: "subscription_id", - monthlyBillingAnchorDate: 1 + monthlyBillingAnchorDate: 1, }); - ``` + @@ -11090,22 +10903,21 @@ await client.subscriptions.changeBillingAnchorDate({
-**request:** `Square.ChangeBillingAnchorDateRequest` - +**request:** `Square.ChangeBillingAnchorDateRequest` +
-**requestOptions:** `SubscriptionsClient.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
- @@ -11122,9 +10934,10 @@ await client.subscriptions.changeBillingAnchorDate({
-Schedules a `CANCEL` action to cancel an active subscription. This -sets the `canceled_date` field to the end of the active billing period. After this date, +Schedules a `CANCEL` action to cancel an active subscription. This +sets the `canceled_date` field to the end of the active billing period. After this date, the subscription status changes from ACTIVE to CANCELED. +
@@ -11140,10 +10953,10 @@ the subscription status changes from ACTIVE to CANCELED. ```typescript await client.subscriptions.cancel({ - subscriptionId: "subscription_id" + subscriptionId: "subscription_id", }); - ``` + @@ -11157,27 +10970,26 @@ await client.subscriptions.cancel({
-**request:** `Square.CancelSubscriptionsRequest` - +**request:** `Square.CancelSubscriptionsRequest` +
-**requestOptions:** `SubscriptionsClient.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
- -
client.subscriptions.listEvents({ ...params }) -> core.Page +
client.subscriptions.listEvents({ ...params }) -> core.Page<Square.SubscriptionEvent>
@@ -11190,6 +11002,7 @@ await client.subscriptions.cancel({
Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a specific subscription. +
@@ -11204,12 +11017,12 @@ Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions
```typescript -const pageableResponse = await client.subscriptions.listEvents({ +const response = await client.subscriptions.listEvents({ subscriptionId: "subscription_id", cursor: "cursor", - limit: 1 + limit: 1, }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -11217,16 +11030,13 @@ for await (const item of pageableResponse) { let page = await client.subscriptions.listEvents({ subscriptionId: "subscription_id", cursor: "cursor", - limit: 1 + limit: 1, }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -11240,22 +11050,21 @@ const response = page.response;
-**request:** `Square.ListEventsSubscriptionsRequest` - +**request:** `Square.ListEventsSubscriptionsRequest` +
-**requestOptions:** `SubscriptionsClient.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
-
@@ -11273,6 +11082,7 @@ const response = page.response;
Schedules a `PAUSE` action to pause an active subscription. +
@@ -11288,10 +11098,10 @@ Schedules a `PAUSE` action to pause an active subscription. ```typescript await client.subscriptions.pause({ - subscriptionId: "subscription_id" + subscriptionId: "subscription_id", }); - ``` + @@ -11305,22 +11115,21 @@ await client.subscriptions.pause({
-**request:** `Square.PauseSubscriptionRequest` - +**request:** `Square.PauseSubscriptionRequest` +
-**requestOptions:** `SubscriptionsClient.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
-
@@ -11338,6 +11147,7 @@ await client.subscriptions.pause({
Schedules a `RESUME` action to resume a paused or a deactivated subscription. +
@@ -11353,10 +11163,10 @@ Schedules a `RESUME` action to resume a paused or a deactivated subscription. ```typescript await client.subscriptions.resume({ - subscriptionId: "subscription_id" + subscriptionId: "subscription_id", }); - ``` + @@ -11370,22 +11180,21 @@ await client.subscriptions.resume({
-**request:** `Square.ResumeSubscriptionRequest` - +**request:** `Square.ResumeSubscriptionRequest` +
-**requestOptions:** `SubscriptionsClient.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
- @@ -11402,8 +11211,9 @@ await client.subscriptions.resume({
-Schedules a `SWAP_PLAN` action to swap a subscription plan variation in an existing subscription. +Schedules a `SWAP_PLAN` action to swap a subscription plan variation in an existing subscription. For more information, see [Swap Subscription Plan Variations](https://developer.squareup.com/docs/subscriptions-api/swap-plan-variations). +
@@ -11421,13 +11231,15 @@ For more information, see [Swap Subscription Plan Variations](https://developer. await client.subscriptions.swapPlan({ subscriptionId: "subscription_id", newPlanVariationId: "FQ7CDXXWSLUJRPM3GFJSJGZ7", - phases: [{ + phases: [ + { ordinal: BigInt("0"), - orderTemplateId: "uhhnjH9osVv3shUADwaC0b3hNxQZY" - }] + orderTemplateId: "uhhnjH9osVv3shUADwaC0b3hNxQZY", + }, + ], }); - ``` + @@ -11441,27 +11253,27 @@ await client.subscriptions.swapPlan({
-**request:** `Square.SwapPlanRequest` - +**request:** `Square.SwapPlanRequest` +
-**requestOptions:** `SubscriptionsClient.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
- ## TeamMembers +
client.teamMembers.create({ ...params }) -> Square.CreateTeamMemberResponse
@@ -11476,10 +11288,12 @@ await client.subscriptions.swapPlan({ Creates a single `TeamMember` object. The `TeamMember` object is returned on successful creates. You must provide the following values in your request to this endpoint: + - `given_name` - `family_name` Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#createteammember). +
@@ -11505,31 +11319,34 @@ await client.teamMembers.create({ phoneNumber: "+14159283333", assignedLocations: { assignmentType: "EXPLICIT_LOCATIONS", - locationIds: ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"] + locationIds: ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"], }, wageSetting: { - jobAssignments: [{ + jobAssignments: [ + { payType: "SALARY", annualRate: { amount: BigInt("3000000"), - currency: "USD" + currency: "USD", }, weeklyHours: 40, - jobId: "FjS8x95cqHiMenw4f1NAUH4P" - }, { + jobId: "FjS8x95cqHiMenw4f1NAUH4P", + }, + { payType: "HOURLY", hourlyRate: { amount: BigInt("2000"), - currency: "USD" + currency: "USD", }, - jobId: "VDNpRv8da51NU8qZFC5zDWpF" - }], - isOvertimeExempt: true - } - } + jobId: "VDNpRv8da51NU8qZFC5zDWpF", + }, + ], + isOvertimeExempt: true, + }, + }, }); - ``` + @@ -11543,22 +11360,21 @@ await client.teamMembers.create({
-**request:** `Square.CreateTeamMemberRequest` - +**request:** `Square.CreateTeamMemberRequest` +
-**requestOptions:** `TeamMembersClient.RequestOptions` - +**requestOptions:** `TeamMembers.RequestOptions` +
-
@@ -11581,6 +11397,7 @@ the request cannot be successfully processed, the request is not marked as faile contains explicit error information for the failed create. Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#bulk-create-team-members). + @@ -11606,9 +11423,9 @@ await client.teamMembers.batchCreate({ phoneNumber: "+14159283333", assignedLocations: { assignmentType: "EXPLICIT_LOCATIONS", - locationIds: ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"] - } - } + locationIds: ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"], + }, + }, }, "idempotency-key-2": { teamMember: { @@ -11618,14 +11435,14 @@ await client.teamMembers.batchCreate({ emailAddress: "jane_smith@gmail.com", phoneNumber: "+14159223334", assignedLocations: { - assignmentType: "ALL_CURRENT_AND_FUTURE_LOCATIONS" - } - } - } - } + assignmentType: "ALL_CURRENT_AND_FUTURE_LOCATIONS", + }, + }, + }, + }, }); - ``` + @@ -11639,22 +11456,21 @@ await client.teamMembers.batchCreate({
-**request:** `Square.BatchCreateTeamMembersRequest` - +**request:** `Square.BatchCreateTeamMembersRequest` +
-**requestOptions:** `TeamMembersClient.RequestOptions` - +**requestOptions:** `TeamMembers.RequestOptions` +
- @@ -11676,6 +11492,7 @@ This process is non-transactional and processes as much of the request as possib the request cannot be successfully processed, the request is not marked as failed, but the body of the response contains explicit error information for the failed update. Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#bulk-update-team-members). + @@ -11702,9 +11519,9 @@ await client.teamMembers.batchUpdate({ emailAddress: "jane_smith@gmail.com", phoneNumber: "+14159223334", assignedLocations: { - assignmentType: "ALL_CURRENT_AND_FUTURE_LOCATIONS" - } - } + assignmentType: "ALL_CURRENT_AND_FUTURE_LOCATIONS", + }, + }, }, "fpgteZNMaf0qOK-a4t6P": { teamMember: { @@ -11717,14 +11534,14 @@ await client.teamMembers.batchUpdate({ phoneNumber: "+14159283333", assignedLocations: { assignmentType: "EXPLICIT_LOCATIONS", - locationIds: ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"] - } - } - } - } + locationIds: ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"], + }, + }, + }, + }, }); - ``` + @@ -11738,22 +11555,21 @@ await client.teamMembers.batchUpdate({
-**request:** `Square.BatchUpdateTeamMembersRequest` - +**request:** `Square.BatchUpdateTeamMembersRequest` +
-**requestOptions:** `TeamMembersClient.RequestOptions` - +**requestOptions:** `TeamMembers.RequestOptions` +
- @@ -11770,9 +11586,10 @@ await client.teamMembers.batchUpdate({
-Returns a paginated list of `TeamMember` objects for a business. +Returns a paginated list of `TeamMember` objects for a business. The list can be filtered by location IDs, `ACTIVE` or `INACTIVE` status, or whether the team member is the Square account owner. +
@@ -11791,13 +11608,13 @@ await client.teamMembers.search({ query: { filter: { locationIds: ["0G5P3VGACMMQZ"], - status: "ACTIVE" - } + status: "ACTIVE", + }, }, - limit: 10 + limit: 10, }); - ``` + @@ -11811,22 +11628,21 @@ await client.teamMembers.search({
-**request:** `Square.SearchTeamMembersRequest` - +**request:** `Square.SearchTeamMembersRequest` +
-**requestOptions:** `TeamMembersClient.RequestOptions` - +**requestOptions:** `TeamMembers.RequestOptions` +
- @@ -11845,6 +11661,7 @@ await client.teamMembers.search({ Retrieves a `TeamMember` object for the given `TeamMember.id`. Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#retrieve-a-team-member). + @@ -11860,10 +11677,10 @@ Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/t ```typescript await client.teamMembers.get({ - teamMemberId: "team_member_id" + teamMemberId: "team_member_id", }); - ``` + @@ -11877,22 +11694,21 @@ await client.teamMembers.get({
-**request:** `Square.GetTeamMembersRequest` - +**request:** `Square.GetTeamMembersRequest` +
-**requestOptions:** `TeamMembersClient.RequestOptions` - +**requestOptions:** `TeamMembers.RequestOptions` +
- @@ -11911,6 +11727,7 @@ await client.teamMembers.get({ Updates a single `TeamMember` object. The `TeamMember` object is returned on successful updates. Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#update-a-team-member). + @@ -11937,32 +11754,35 @@ await client.teamMembers.update({ phoneNumber: "+14159283333", assignedLocations: { assignmentType: "EXPLICIT_LOCATIONS", - locationIds: ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"] + locationIds: ["YSGH2WBKG94QZ", "GA2Y9HSJ8KRYT"], }, wageSetting: { - jobAssignments: [{ + jobAssignments: [ + { payType: "SALARY", annualRate: { amount: BigInt("3000000"), - currency: "USD" + currency: "USD", }, weeklyHours: 40, - jobId: "FjS8x95cqHiMenw4f1NAUH4P" - }, { + jobId: "FjS8x95cqHiMenw4f1NAUH4P", + }, + { payType: "HOURLY", hourlyRate: { amount: BigInt("1200"), - currency: "USD" + currency: "USD", }, - jobId: "VDNpRv8da51NU8qZFC5zDWpF" - }], - isOvertimeExempt: true - } - } - } + jobId: "VDNpRv8da51NU8qZFC5zDWpF", + }, + ], + isOvertimeExempt: true, + }, + }, + }, }); - ``` + @@ -11976,27 +11796,27 @@ await client.teamMembers.update({
-**request:** `Square.UpdateTeamMembersRequest` - +**request:** `Square.UpdateTeamMembersRequest` +
-**requestOptions:** `TeamMembersClient.RequestOptions` - +**requestOptions:** `TeamMembers.RequestOptions` +
- ## Team +
client.team.listJobs({ ...params }) -> Square.ListJobsResponse
@@ -12010,141 +11830,7 @@ await client.teamMembers.update({
Lists jobs in a seller account. Results are sorted by title in ascending order. -
-
- - - -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.team.listJobs({ - cursor: "cursor" -}); - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `Square.ListJobsRequest` - -
-
- -
-
- -**requestOptions:** `TeamClient.RequestOptions` - -
-
-
-
- - - - -
- -
client.team.createJob({ ...params }) -> Square.CreateJobResponse -
-
- -#### 📝 Description - -
-
- -
-
- -Creates a job in a seller account. A job defines a title and tip eligibility. Note that -compensation is defined in a [job assignment](entity:JobAssignment) in a team member's wage setting. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.team.createJob({ - job: { - title: "Cashier", - isTipEligible: true - }, - idempotencyKey: "idempotency-key-0" -}); - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `Square.CreateJobRequest` - -
-
- -
-
- -**requestOptions:** `TeamClient.RequestOptions` - -
-
-
-
- - -
-
-
- -
client.team.retrieveJob({ ...params }) -> Square.RetrieveJobResponse -
-
-#### 📝 Description - -
-
- -
-
- -Retrieves a specified job.
@@ -12156,492 +11842,14 @@ Retrieves a specified job.
-
- -```typescript -await client.team.retrieveJob({ - jobId: "job_id" -}); - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `Square.RetrieveJobRequest` - -
-
- -
-
- -**requestOptions:** `TeamClient.RequestOptions` - -
-
-
-
- - -
-
-
- -
client.team.updateJob({ ...params }) -> Square.UpdateJobResponse -
-
- -#### 📝 Description - -
-
- -
-
- -Updates the title or tip eligibility of a job. Changes to the title propagate to all -`JobAssignment`, `Shift`, and `TeamMemberWage` objects that reference the job ID. Changes to -tip eligibility propagate to all `TeamMemberWage` objects that reference the job ID. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.team.updateJob({ - jobId: "job_id", - job: { - title: "Cashier 1", - isTipEligible: true - } -}); - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `Square.UpdateJobRequest` - -
-
- -
-
- -**requestOptions:** `TeamClient.RequestOptions` - -
-
-
-
- - -
-
-
- -## Terminal -
client.terminal.dismissTerminalAction({ ...params }) -> Square.DismissTerminalActionResponse -
-
- -#### 📝 Description - -
-
- -
-
- -Dismisses a Terminal action request if the status and type of the request permits it. - -See [Link and Dismiss Actions](https://developer.squareup.com/docs/terminal-api/advanced-features/custom-workflows/link-and-dismiss-actions) for more details. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.terminal.dismissTerminalAction({ - actionId: "action_id" -}); - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `Square.DismissTerminalActionRequest` - -
-
- -
-
- -**requestOptions:** `TerminalClient.RequestOptions` - -
-
-
-
- - -
-
-
- -
client.terminal.dismissTerminalCheckout({ ...params }) -> Square.DismissTerminalCheckoutResponse -
-
- -#### 📝 Description - -
-
- -
-
- -Dismisses a Terminal checkout request if the status and type of the request permits it. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.terminal.dismissTerminalCheckout({ - checkoutId: "checkout_id" -}); - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `Square.DismissTerminalCheckoutRequest` - -
-
- -
-
- -**requestOptions:** `TerminalClient.RequestOptions` - -
-
-
-
- - -
-
-
- -
client.terminal.dismissTerminalRefund({ ...params }) -> Square.DismissTerminalRefundResponse -
-
- -#### 📝 Description - -
-
- -
-
- -Dismisses a Terminal refund request if the status and type of the request permits it. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.terminal.dismissTerminalRefund({ - terminalRefundId: "terminal_refund_id" -}); - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `Square.DismissTerminalRefundRequest` - -
-
- -
-
- -**requestOptions:** `TerminalClient.RequestOptions` - -
-
-
-
- - -
-
-
- -## TransferOrders -
client.transferOrders.create({ ...params }) -> Square.CreateTransferOrderResponse -
-
- -#### 📝 Description - -
-
- -
-
- -Creates a new transfer order in [DRAFT](entity:TransferOrderStatus) status. A transfer order represents the intent -to move [CatalogItemVariation](entity:CatalogItemVariation)s from one [Location](entity:Location) to another. -The source and destination locations must be different and must belong to your Square account. - -In [DRAFT](entity:TransferOrderStatus) status, you can: -- Add or remove items -- Modify quantities -- Update shipping information -- Delete the entire order via [DeleteTransferOrder](api-endpoint:TransferOrders-DeleteTransferOrder) - -The request requires source_location_id and destination_location_id. -Inventory levels are not affected until the order is started via -[StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder). - -Common integration points: -- Sync with warehouse management systems -- Automate regular stock transfers -- Initialize transfers from inventory optimization systems - -Creates a [transfer_order.created](webhook:transfer_order.created) webhook event. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.transferOrders.create({ - idempotencyKey: "65cc0586-3e82-384s-b524-3885cffd52", - transferOrder: { - sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_123", - destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_456", - expectedAt: "2025-11-09T05:00:00Z", - notes: "Example transfer order for inventory redistribution between locations", - trackingNumber: "TRACK123456789", - createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", - lineItems: [{ - itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", - quantityOrdered: "5" - }, { - itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_002", - quantityOrdered: "3" - }] - } -}); - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `Square.CreateTransferOrderRequest` - -
-
- -
-
- -**requestOptions:** `TransferOrdersClient.RequestOptions` - -
-
-
-
- - -
-
-
- -
client.transferOrders.search({ ...params }) -> core.Page -
-
- -#### 📝 Description - -
-
- -
-
- -Searches for transfer orders using filters. Returns a paginated list of matching -[TransferOrder](entity:TransferOrder)s sorted by creation date. - -Common search scenarios: -- Find orders for a source [Location](entity:Location) -- Find orders for a destination [Location](entity:Location) -- Find orders in a particular [TransferOrderStatus](entity:TransferOrderStatus) -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -const pageableResponse = await client.transferOrders.search({ - query: { - filter: { - sourceLocationIds: ["EXAMPLE_SOURCE_LOCATION_ID_123"], - destinationLocationIds: ["EXAMPLE_DEST_LOCATION_ID_456"], - statuses: ["STARTED", "PARTIALLY_RECEIVED"] - }, - sort: { - field: "UPDATED_AT", - order: "DESC" - } - }, - cursor: "eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTg2NjQ4NzN9", - limit: 10 -}); -for await (const item of pageableResponse) { - console.log(item); -} - -// Or you can manually iterate page-by-page -let page = await client.transferOrders.search({ - query: { - filter: { - sourceLocationIds: ["EXAMPLE_SOURCE_LOCATION_ID_123"], - destinationLocationIds: ["EXAMPLE_DEST_LOCATION_ID_456"], - statuses: ["STARTED", "PARTIALLY_RECEIVED"] - }, - sort: { - field: "UPDATED_AT", - order: "DESC" - } - }, - cursor: "eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTg2NjQ4NzN9", - limit: 10 -}); -while (page.hasNextPage()) { - page = page.getNextPage(); -} - -// You can also access the underlying response -const response = page.response; +
+```typescript +await client.team.listJobs({ + cursor: "cursor", +}); ``` +
@@ -12655,27 +11863,26 @@ const response = page.response;
-**request:** `Square.SearchTransferOrdersRequest` - +**request:** `Square.ListJobsRequest` +
-**requestOptions:** `TransferOrdersClient.RequestOptions` - +**requestOptions:** `Team.RequestOptions` +
-
-
client.transferOrders.get({ ...params }) -> Square.RetrieveTransferOrderResponse +
client.team.createJob({ ...params }) -> Square.CreateJobResponse
@@ -12687,13 +11894,9 @@ const response = page.response;
-Retrieves a specific [TransferOrder](entity:TransferOrder) by ID. Returns the complete -order details including: +Creates a job in a seller account. A job defines a title and tip eligibility. Note that +compensation is defined in a [job assignment](entity:JobAssignment) in a team member's wage setting. -- Basic information (status, dates, notes) -- Line items with ordered and received quantities -- Source and destination [Location](entity:Location)s -- Tracking information (if available)
@@ -12708,11 +11911,15 @@ order details including:
```typescript -await client.transferOrders.get({ - transferOrderId: "transfer_order_id" +await client.team.createJob({ + job: { + title: "Cashier", + isTipEligible: true, + }, + idempotencyKey: "idempotency-key-0", }); - ``` +
@@ -12726,27 +11933,26 @@ await client.transferOrders.get({
-**request:** `Square.GetTransferOrdersRequest` - +**request:** `Square.CreateJobRequest` +
-**requestOptions:** `TransferOrdersClient.RequestOptions` - +**requestOptions:** `Team.RequestOptions` +
-
-
client.transferOrders.update({ ...params }) -> Square.UpdateTransferOrderResponse +
client.team.retrieveJob({ ...params }) -> Square.RetrieveJobResponse
@@ -12758,10 +11964,8 @@ await client.transferOrders.get({
-Updates an existing transfer order. This endpoint supports sparse updates, -allowing you to modify specific fields without affecting others. +Retrieves a specified job. -Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event.
@@ -12776,30 +11980,11 @@ Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event
```typescript -await client.transferOrders.update({ - transferOrderId: "transfer_order_id", - idempotencyKey: "f47ac10b-58cc-4372-a567-0e02b2c3d479", - transferOrder: { - sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_789", - destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_101", - expectedAt: "2025-11-10T08:00:00Z", - notes: "Updated: Priority transfer due to low stock at destination", - trackingNumber: "TRACK987654321", - lineItems: [{ - uid: "1", - quantityOrdered: "7" - }, { - itemVariationId: "EXAMPLE_NEW_ITEM_VARIATION_ID_003", - quantityOrdered: "2" - }, { - uid: "2", - remove: true - }] - }, - version: BigInt("1753109537351") +await client.team.retrieveJob({ + jobId: "job_id", }); - ``` +
@@ -12813,27 +11998,26 @@ await client.transferOrders.update({
-**request:** `Square.UpdateTransferOrderRequest` - +**request:** `Square.RetrieveJobRequest` +
-**requestOptions:** `TransferOrdersClient.RequestOptions` - +**requestOptions:** `Team.RequestOptions` +
-
-
client.transferOrders.delete({ ...params }) -> Square.DeleteTransferOrderResponse +
client.team.updateJob({ ...params }) -> Square.UpdateJobResponse
@@ -12845,11 +12029,10 @@ await client.transferOrders.update({
-Deletes a transfer order in [DRAFT](entity:TransferOrderStatus) status. -Only draft orders can be deleted. Once an order is started via -[StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder), it can no longer be deleted. +Updates the title or tip eligibility of a job. Changes to the title propagate to all +`JobAssignment`, `Shift`, and `TeamMemberWage` objects that reference the job ID. Changes to +tip eligibility propagate to all `TeamMemberWage` objects that reference the job ID. -Creates a [transfer_order.deleted](webhook:transfer_order.deleted) webhook event.
@@ -12864,12 +12047,15 @@ Creates a [transfer_order.deleted](webhook:transfer_order.deleted) webhook event
```typescript -await client.transferOrders.delete({ - transferOrderId: "transfer_order_id", - version: BigInt("1000000") +await client.team.updateJob({ + jobId: "job_id", + job: { + title: "Cashier 1", + isTipEligible: true, + }, }); - ``` +
@@ -12883,27 +12069,28 @@ await client.transferOrders.delete({
-**request:** `Square.DeleteTransferOrdersRequest` - +**request:** `Square.UpdateJobRequest` +
-**requestOptions:** `TransferOrdersClient.RequestOptions` - +**requestOptions:** `Team.RequestOptions` +
-
-
client.transferOrders.cancel({ ...params }) -> Square.CancelTransferOrderResponse +## Terminal + +
client.terminal.dismissTerminalAction({ ...params }) -> Square.DismissTerminalActionResponse
@@ -12915,16 +12102,10 @@ await client.transferOrders.delete({
-Cancels a transfer order in [STARTED](entity:TransferOrderStatus) or -[PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. Any unreceived quantities will no -longer be receivable and will be immediately returned to the source [Location](entity:Location)'s inventory. +Dismisses a Terminal action request if the status and type of the request permits it. -Common reasons for cancellation: -- Items no longer needed at destination -- Source location needs the inventory -- Order created in error +See [Link and Dismiss Actions](https://developer.squareup.com/docs/terminal-api/advanced-features/custom-workflows/link-and-dismiss-actions) for more details. -Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event.
@@ -12939,13 +12120,11 @@ Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event
```typescript -await client.transferOrders.cancel({ - transferOrderId: "transfer_order_id", - idempotencyKey: "65cc0586-3e82-4d08-b524-3885cffd52", - version: BigInt("1753117449752") +await client.terminal.dismissTerminalAction({ + actionId: "action_id", }); - ``` +
@@ -12959,27 +12138,26 @@ await client.transferOrders.cancel({
-**request:** `Square.CancelTransferOrderRequest` - +**request:** `Square.DismissTerminalActionRequest` +
-**requestOptions:** `TransferOrdersClient.RequestOptions` - +**requestOptions:** `Terminal.RequestOptions` +
-
-
client.transferOrders.receive({ ...params }) -> Square.ReceiveTransferOrderResponse +
client.terminal.dismissTerminalCheckout({ ...params }) -> Square.DismissTerminalCheckoutResponse
@@ -12991,22 +12169,8 @@ await client.transferOrders.cancel({
-Records receipt of [CatalogItemVariation](entity:CatalogItemVariation)s for a transfer order. -This endpoint supports partial receiving - you can receive items in multiple batches. - -For each line item, you can specify: -- Quantity received in good condition (added to destination inventory with [InventoryState](entity:InventoryState) of IN_STOCK) -- Quantity damaged during transit/handling (added to destination inventory with [InventoryState](entity:InventoryState) of WASTE) -- Quantity canceled (returned to source location's inventory) - -The order must be in [STARTED](entity:TransferOrderStatus) or [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. -Received quantities are added to the destination [Location](entity:Location)'s inventory according to their condition. -Canceled quantities are immediately returned to the source [Location](entity:Location)'s inventory. - -When all items are either received, damaged, or canceled, the order moves to -[COMPLETED](entity:TransferOrderStatus) status. +Dismisses a Terminal checkout request if the status and type of the request permits it. -Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event.
@@ -13021,25 +12185,11 @@ Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event
```typescript -await client.transferOrders.receive({ - transferOrderId: "transfer_order_id", - idempotencyKey: "EXAMPLE_IDEMPOTENCY_KEY_101", - receipt: { - lineItems: [{ - transferOrderLineUid: "transfer_order_line_uid", - quantityReceived: "3", - quantityDamaged: "1", - quantityCanceled: "1" - }, { - transferOrderLineUid: "transfer_order_line_uid", - quantityReceived: "2", - quantityCanceled: "1" - }] - }, - version: BigInt("1753118664873") +await client.terminal.dismissTerminalCheckout({ + checkoutId: "checkout_id", }); - ``` +
@@ -13053,27 +12203,26 @@ await client.transferOrders.receive({
-**request:** `Square.ReceiveTransferOrderRequest` - +**request:** `Square.DismissTerminalCheckoutRequest` +
-**requestOptions:** `TransferOrdersClient.RequestOptions` - +**requestOptions:** `Terminal.RequestOptions` +
-
-
client.transferOrders.start({ ...params }) -> Square.StartTransferOrderResponse +
client.terminal.dismissTerminalRefund({ ...params }) -> Square.DismissTerminalRefundResponse
@@ -13085,14 +12234,8 @@ await client.transferOrders.receive({
-Changes a [DRAFT](entity:TransferOrderStatus) transfer order to [STARTED](entity:TransferOrderStatus) status. -This decrements inventory at the source [Location](entity:Location) and marks it as in-transit. - -The order must be in [DRAFT](entity:TransferOrderStatus) status and have all required fields populated. -Once started, the order can no longer be deleted, but it can be canceled via -[CancelTransferOrder](api-endpoint:TransferOrders-CancelTransferOrder). +Dismisses a Terminal refund request if the status and type of the request permits it. -Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event.
@@ -13107,13 +12250,11 @@ Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event
```typescript -await client.transferOrders.start({ - transferOrderId: "transfer_order_id", - idempotencyKey: "EXAMPLE_IDEMPOTENCY_KEY_789", - version: BigInt("1753109537351") +await client.terminal.dismissTerminalRefund({ + terminalRefundId: "terminal_refund_id", }); - ``` +
@@ -13127,27 +12268,27 @@ await client.transferOrders.start({
-**request:** `Square.StartTransferOrderRequest` - +**request:** `Square.DismissTerminalRefundRequest` +
-**requestOptions:** `TransferOrdersClient.RequestOptions` - +**requestOptions:** `Terminal.RequestOptions` +
-
## Vendors +
client.vendors.batchCreate({ ...params }) -> Square.BatchCreateVendorsResponse
@@ -13161,6 +12302,7 @@ await client.transferOrders.start({
Creates one or more [Vendor](entity:Vendor) objects to represent suppliers to a seller. +
@@ -13185,21 +12327,23 @@ await client.vendors.batchCreate({ locality: "New York", administrativeDistrictLevel1: "NY", postalCode: "10003", - country: "US" + country: "US", }, - contacts: [{ + contacts: [ + { name: "Joe Burrow", emailAddress: "joe@joesfreshseafood.com", phoneNumber: "1-212-555-4250", - ordinal: 1 - }], + ordinal: 1, + }, + ], accountNumber: "4025391", - note: "a vendor" - } - } + note: "a vendor", + }, + }, }); - ``` + @@ -13213,22 +12357,21 @@ await client.vendors.batchCreate({
-**request:** `Square.BatchCreateVendorsRequest` - +**request:** `Square.BatchCreateVendorsRequest` +
-**requestOptions:** `VendorsClient.RequestOptions` - +**requestOptions:** `Vendors.RequestOptions` +
-
@@ -13246,6 +12389,7 @@ await client.vendors.batchCreate({
Retrieves one or more vendors of specified [Vendor](entity:Vendor) IDs. +
@@ -13261,10 +12405,10 @@ Retrieves one or more vendors of specified [Vendor](entity:Vendor) IDs. ```typescript await client.vendors.batchGet({ - vendorIds: ["INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4"] + vendorIds: ["INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4"], }); - ``` + @@ -13278,22 +12422,21 @@ await client.vendors.batchGet({
-**request:** `Square.BatchGetVendorsRequest` - +**request:** `Square.BatchGetVendorsRequest` +
-**requestOptions:** `VendorsClient.RequestOptions` - +**requestOptions:** `Vendors.RequestOptions` +
-
@@ -13311,6 +12454,7 @@ await client.vendors.batchGet({
Updates one or more of existing [Vendor](entity:Vendor) objects as suppliers to a seller. +
@@ -13327,16 +12471,16 @@ Updates one or more of existing [Vendor](entity:Vendor) objects as suppliers to ```typescript await client.vendors.batchUpdate({ vendors: { - "FMCYHBWT1TPL8MFH52PBMEN92A": { - vendor: {} + FMCYHBWT1TPL8MFH52PBMEN92A: { + vendor: {}, + }, + INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4: { + vendor: {}, }, - "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4": { - vendor: {} - } - } + }, }); - ``` + @@ -13350,22 +12494,21 @@ await client.vendors.batchUpdate({
-**request:** `Square.BatchUpdateVendorsRequest` - +**request:** `Square.BatchUpdateVendorsRequest` +
-**requestOptions:** `VendorsClient.RequestOptions` - +**requestOptions:** `Vendors.RequestOptions` +
-
@@ -13383,6 +12526,7 @@ await client.vendors.batchUpdate({
Creates a single [Vendor](entity:Vendor) object to represent a supplier to a seller. +
@@ -13407,20 +12551,22 @@ await client.vendors.create({ locality: "New York", administrativeDistrictLevel1: "NY", postalCode: "10003", - country: "US" + country: "US", }, - contacts: [{ + contacts: [ + { name: "Joe Burrow", emailAddress: "joe@joesfreshseafood.com", phoneNumber: "1-212-555-4250", - ordinal: 1 - }], + ordinal: 1, + }, + ], accountNumber: "4025391", - note: "a vendor" - } + note: "a vendor", + }, }); - ``` + @@ -13434,22 +12580,21 @@ await client.vendors.create({
-**request:** `Square.CreateVendorRequest` - +**request:** `Square.CreateVendorRequest` +
-**requestOptions:** `VendorsClient.RequestOptions` - +**requestOptions:** `Vendors.RequestOptions` +
-
@@ -13467,6 +12612,7 @@ await client.vendors.create({
Searches for vendors using a filter against supported [Vendor](entity:Vendor) properties and a supported sorter. +
@@ -13482,8 +12628,8 @@ Searches for vendors using a filter against supported [Vendor](entity:Vendor) pr ```typescript await client.vendors.search(); - ``` + @@ -13497,22 +12643,21 @@ await client.vendors.search();
-**request:** `Square.SearchVendorsRequest` - +**request:** `Square.SearchVendorsRequest` +
-**requestOptions:** `VendorsClient.RequestOptions` - +**requestOptions:** `Vendors.RequestOptions` +
-
@@ -13530,6 +12675,7 @@ await client.vendors.search();
Retrieves the vendor of a specified [Vendor](entity:Vendor) ID. +
@@ -13545,10 +12691,10 @@ Retrieves the vendor of a specified [Vendor](entity:Vendor) ID. ```typescript await client.vendors.get({ - vendorId: "vendor_id" + vendorId: "vendor_id", }); - ``` + @@ -13562,22 +12708,21 @@ await client.vendors.get({
-**request:** `Square.GetVendorsRequest` - +**request:** `Square.GetVendorsRequest` +
-**requestOptions:** `VendorsClient.RequestOptions` - +**requestOptions:** `Vendors.RequestOptions` +
-
@@ -13595,6 +12740,7 @@ await client.vendors.get({
Updates an existing [Vendor](entity:Vendor) object as a supplier to a seller. +
@@ -13617,12 +12763,12 @@ await client.vendors.update({ id: "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4", name: "Jack's Chicken Shack", version: 1, - status: "ACTIVE" - } - } + status: "ACTIVE", + }, + }, }); - ``` + @@ -13636,28 +12782,28 @@ await client.vendors.update({
-**request:** `Square.UpdateVendorsRequest` - +**request:** `Square.UpdateVendorsRequest` +
-**requestOptions:** `VendorsClient.RequestOptions` - +**requestOptions:** `Vendors.RequestOptions` +
-
## Bookings CustomAttributeDefinitions -
client.bookings.customAttributeDefinitions.list({ ...params }) -> core.Page + +
client.bookings.customAttributeDefinitions.list({ ...params }) -> core.Page<Square.CustomAttributeDefinition>
@@ -13673,6 +12819,7 @@ Get all bookings custom attribute definitions. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. +
@@ -13687,27 +12834,24 @@ To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ`
```typescript -const pageableResponse = await client.bookings.customAttributeDefinitions.list({ +const response = await client.bookings.customAttributeDefinitions.list({ limit: 1, - cursor: "cursor" + cursor: "cursor", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.bookings.customAttributeDefinitions.list({ limit: 1, - cursor: "cursor" + cursor: "cursor", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -13721,22 +12865,21 @@ const response = page.response;
-**request:** `Square.bookings.ListCustomAttributeDefinitionsRequest` - +**request:** `Square.bookings.ListCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
-
@@ -13758,8 +12901,9 @@ Creates a bookings custom attribute definition. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* -or *Appointments Premium*. +For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to _Appointments Plus_ +or _Appointments Premium_. + @@ -13775,10 +12919,10 @@ or *Appointments Premium*. ```typescript await client.bookings.customAttributeDefinitions.create({ - customAttributeDefinition: {} + customAttributeDefinition: {}, }); - ``` + @@ -13792,22 +12936,21 @@ await client.bookings.customAttributeDefinitions.create({
-**request:** `Square.bookings.CreateBookingCustomAttributeDefinitionRequest` - +**request:** `Square.bookings.CreateBookingCustomAttributeDefinitionRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
-
@@ -13828,6 +12971,7 @@ Retrieves a bookings custom attribute definition. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + @@ -13844,10 +12988,10 @@ To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` ```typescript await client.bookings.customAttributeDefinitions.get({ key: "key", - version: 1 + version: 1, }); - ``` + @@ -13861,22 +13005,21 @@ await client.bookings.customAttributeDefinitions.get({
-**request:** `Square.bookings.GetCustomAttributeDefinitionsRequest` - +**request:** `Square.bookings.GetCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
- @@ -13898,8 +13041,9 @@ Updates a bookings custom attribute definition. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* -or *Appointments Premium*. +For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to _Appointments Plus_ +or _Appointments Premium_. + @@ -13916,10 +13060,10 @@ or *Appointments Premium*. ```typescript await client.bookings.customAttributeDefinitions.update({ key: "key", - customAttributeDefinition: {} + customAttributeDefinition: {}, }); - ``` + @@ -13933,22 +13077,21 @@ await client.bookings.customAttributeDefinitions.update({
-**request:** `Square.bookings.UpdateBookingCustomAttributeDefinitionRequest` - +**request:** `Square.bookings.UpdateBookingCustomAttributeDefinitionRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
- @@ -13970,8 +13113,9 @@ Deletes a bookings custom attribute definition. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* -or *Appointments Premium*. +For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to _Appointments Plus_ +or _Appointments Premium_. + @@ -13987,10 +13131,10 @@ or *Appointments Premium*. ```typescript await client.bookings.customAttributeDefinitions.delete({ - key: "key" + key: "key", }); - ``` + @@ -14004,27 +13148,27 @@ await client.bookings.customAttributeDefinitions.delete({
-**request:** `Square.bookings.DeleteCustomAttributeDefinitionsRequest` - +**request:** `Square.bookings.DeleteCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
- ## Bookings CustomAttributes +
client.bookings.customAttributes.batchDelete({ ...params }) -> Square.BulkDeleteBookingCustomAttributesResponse
@@ -14042,8 +13186,9 @@ Bulk deletes bookings custom attributes. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* -or *Appointments Premium*. +For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to _Appointments Plus_ +or _Appointments Premium_. +
@@ -14060,14 +13205,14 @@ or *Appointments Premium*. ```typescript await client.bookings.customAttributes.batchDelete({ values: { - "key": { + key: { bookingId: "booking_id", - key: "key" - } - } + key: "key", + }, + }, }); - ``` + @@ -14081,22 +13226,21 @@ await client.bookings.customAttributes.batchDelete({
-**request:** `Square.bookings.BulkDeleteBookingCustomAttributesRequest` - +**request:** `Square.bookings.BulkDeleteBookingCustomAttributesRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
-
@@ -14118,8 +13262,9 @@ Bulk upserts bookings custom attributes. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* -or *Appointments Premium*. +For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to _Appointments Plus_ +or _Appointments Premium_. + @@ -14136,14 +13281,14 @@ or *Appointments Premium*. ```typescript await client.bookings.customAttributes.batchUpsert({ values: { - "key": { + key: { bookingId: "booking_id", - customAttribute: {} - } - } + customAttribute: {}, + }, + }, }); - ``` + @@ -14157,27 +13302,26 @@ await client.bookings.customAttributes.batchUpsert({
-**request:** `Square.bookings.BulkUpsertBookingCustomAttributesRequest` - +**request:** `Square.bookings.BulkUpsertBookingCustomAttributesRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
- -
client.bookings.customAttributes.list({ ...params }) -> core.Page +
client.bookings.customAttributes.list({ ...params }) -> core.Page<Square.CustomAttribute>
@@ -14193,6 +13337,7 @@ Lists a booking's custom attributes. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. +
@@ -14207,13 +13352,13 @@ To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ`
```typescript -const pageableResponse = await client.bookings.customAttributes.list({ +const response = await client.bookings.customAttributes.list({ bookingId: "booking_id", limit: 1, cursor: "cursor", - withDefinitions: true + withDefinitions: true, }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -14222,16 +13367,13 @@ let page = await client.bookings.customAttributes.list({ bookingId: "booking_id", limit: 1, cursor: "cursor", - withDefinitions: true + withDefinitions: true, }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -14245,22 +13387,21 @@ const response = page.response;
-**request:** `Square.bookings.ListCustomAttributesRequest` - +**request:** `Square.bookings.ListCustomAttributesRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
-
@@ -14281,6 +13422,7 @@ Retrieves a bookings custom attribute. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_READ` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. + @@ -14299,10 +13441,10 @@ await client.bookings.customAttributes.get({ bookingId: "booking_id", key: "key", withDefinition: true, - version: 1 + version: 1, }); - ``` + @@ -14316,22 +13458,21 @@ await client.bookings.customAttributes.get({
-**request:** `Square.bookings.GetCustomAttributesRequest` - +**request:** `Square.bookings.GetCustomAttributesRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
-
@@ -14353,8 +13494,9 @@ Upserts a bookings custom attribute. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* -or *Appointments Premium*. +For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to _Appointments Plus_ +or _Appointments Premium_. + @@ -14372,10 +13514,10 @@ or *Appointments Premium*. await client.bookings.customAttributes.upsert({ bookingId: "booking_id", key: "key", - customAttribute: {} + customAttribute: {}, }); - ``` + @@ -14389,22 +13531,21 @@ await client.bookings.customAttributes.upsert({
-**request:** `Square.bookings.UpsertBookingCustomAttributeRequest` - +**request:** `Square.bookings.UpsertBookingCustomAttributeRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
- @@ -14426,8 +13567,9 @@ Deletes a bookings custom attribute. To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope. To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope. -For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus* -or *Appointments Premium*. +For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to _Appointments Plus_ +or _Appointments Premium_. + @@ -14444,10 +13586,10 @@ or *Appointments Premium*. ```typescript await client.bookings.customAttributes.delete({ bookingId: "booking_id", - key: "key" + key: "key", }); - ``` + @@ -14461,28 +13603,28 @@ await client.bookings.customAttributes.delete({
-**request:** `Square.bookings.DeleteCustomAttributesRequest` - +**request:** `Square.bookings.DeleteCustomAttributesRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
- ## Bookings LocationProfiles -
client.bookings.locationProfiles.list({ ...params }) -> core.Page + +
client.bookings.locationProfiles.list({ ...params }) -> core.Page<Square.LocationBookingProfile>
@@ -14495,6 +13637,7 @@ await client.bookings.customAttributes.delete({
Lists location booking profiles of a seller. +
@@ -14509,27 +13652,24 @@ Lists location booking profiles of a seller.
```typescript -const pageableResponse = await client.bookings.locationProfiles.list({ +const response = await client.bookings.locationProfiles.list({ limit: 1, - cursor: "cursor" + cursor: "cursor", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.bookings.locationProfiles.list({ limit: 1, - cursor: "cursor" + cursor: "cursor", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -14543,28 +13683,28 @@ const response = page.response;
-**request:** `Square.bookings.ListLocationProfilesRequest` - +**request:** `Square.bookings.ListLocationProfilesRequest` +
-**requestOptions:** `LocationProfilesClient.RequestOptions` - +**requestOptions:** `LocationProfiles.RequestOptions` +
-
## Bookings TeamMemberProfiles -
client.bookings.teamMemberProfiles.list({ ...params }) -> core.Page + +
client.bookings.teamMemberProfiles.list({ ...params }) -> core.Page<Square.TeamMemberBookingProfile>
@@ -14577,6 +13717,7 @@ const response = page.response;
Lists booking profiles for team members. +
@@ -14591,13 +13732,13 @@ Lists booking profiles for team members.
```typescript -const pageableResponse = await client.bookings.teamMemberProfiles.list({ +const response = await client.bookings.teamMemberProfiles.list({ bookableOnly: true, limit: 1, cursor: "cursor", - locationId: "location_id" + locationId: "location_id", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -14606,16 +13747,13 @@ let page = await client.bookings.teamMemberProfiles.list({ bookableOnly: true, limit: 1, cursor: "cursor", - locationId: "location_id" + locationId: "location_id", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -14629,22 +13767,21 @@ const response = page.response;
-**request:** `Square.bookings.ListTeamMemberProfilesRequest` - +**request:** `Square.bookings.ListTeamMemberProfilesRequest` +
-**requestOptions:** `TeamMemberProfilesClient.RequestOptions` - +**requestOptions:** `TeamMemberProfiles.RequestOptions` +
-
@@ -14662,6 +13799,7 @@ const response = page.response;
Retrieves a team member's booking profile. +
@@ -14677,10 +13815,10 @@ Retrieves a team member's booking profile. ```typescript await client.bookings.teamMemberProfiles.get({ - teamMemberId: "team_member_id" + teamMemberId: "team_member_id", }); - ``` + @@ -14694,28 +13832,28 @@ await client.bookings.teamMemberProfiles.get({
-**request:** `Square.bookings.GetTeamMemberProfilesRequest` - +**request:** `Square.bookings.GetTeamMemberProfilesRequest` +
-**requestOptions:** `TeamMemberProfilesClient.RequestOptions` - +**requestOptions:** `TeamMemberProfiles.RequestOptions` +
-
## CashDrawers Shifts -
client.cashDrawers.shifts.list({ ...params }) -> core.Page + +
client.cashDrawers.shifts.list({ ...params }) -> core.Page<Square.CashDrawerShiftSummary>
@@ -14729,6 +13867,7 @@ await client.bookings.teamMemberProfiles.get({ Provides the details for all of the cash drawer shifts for a location in a date range. +
@@ -14743,15 +13882,15 @@ in a date range.
```typescript -const pageableResponse = await client.cashDrawers.shifts.list({ +const response = await client.cashDrawers.shifts.list({ locationId: "location_id", sortOrder: "DESC", beginTime: "begin_time", endTime: "end_time", limit: 1, - cursor: "cursor" + cursor: "cursor", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -14762,16 +13901,13 @@ let page = await client.cashDrawers.shifts.list({ beginTime: "begin_time", endTime: "end_time", limit: 1, - cursor: "cursor" + cursor: "cursor", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -14785,22 +13921,21 @@ const response = page.response;
-**request:** `Square.cashDrawers.ListShiftsRequest` - +**request:** `Square.cashDrawers.ListShiftsRequest` +
-**requestOptions:** `ShiftsClient.RequestOptions` - +**requestOptions:** `Shifts.RequestOptions` +
-
@@ -14819,6 +13954,7 @@ const response = page.response; Provides the summary details for a single cash drawer shift. See [ListCashDrawerShiftEvents](api-endpoint:CashDrawers-ListCashDrawerShiftEvents) for a list of cash drawer shift events. + @@ -14835,10 +13971,10 @@ Provides the summary details for a single cash drawer shift. See ```typescript await client.cashDrawers.shifts.get({ shiftId: "shift_id", - locationId: "location_id" + locationId: "location_id", }); - ``` + @@ -14852,27 +13988,26 @@ await client.cashDrawers.shifts.get({
-**request:** `Square.cashDrawers.GetShiftsRequest` - +**request:** `Square.cashDrawers.GetShiftsRequest` +
-**requestOptions:** `ShiftsClient.RequestOptions` - +**requestOptions:** `Shifts.RequestOptions` +
-
-
client.cashDrawers.shifts.listEvents({ ...params }) -> core.Page +
client.cashDrawers.shifts.listEvents({ ...params }) -> core.Page<Square.CashDrawerShiftEvent>
@@ -14885,6 +14020,7 @@ await client.cashDrawers.shifts.get({
Provides a paginated list of events for a single cash drawer shift. +
@@ -14899,13 +14035,13 @@ Provides a paginated list of events for a single cash drawer shift.
```typescript -const pageableResponse = await client.cashDrawers.shifts.listEvents({ +const response = await client.cashDrawers.shifts.listEvents({ shiftId: "shift_id", locationId: "location_id", limit: 1, - cursor: "cursor" + cursor: "cursor", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -14914,16 +14050,13 @@ let page = await client.cashDrawers.shifts.listEvents({ shiftId: "shift_id", locationId: "location_id", limit: 1, - cursor: "cursor" + cursor: "cursor", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -14937,27 +14070,27 @@ const response = page.response;
-**request:** `Square.cashDrawers.ListEventsShiftsRequest` - +**request:** `Square.cashDrawers.ListEventsShiftsRequest` +
-**requestOptions:** `ShiftsClient.RequestOptions` - +**requestOptions:** `Shifts.RequestOptions` +
-
## Catalog Images +
client.catalog.images.create({ ...params }) -> Square.CreateCatalogImageResponse
@@ -14976,6 +14109,7 @@ is not specified. This `CreateCatalogImage` endpoint accepts HTTP multipart/form-data requests with a JSON part and an image file part in JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB. +
@@ -14991,8 +14125,8 @@ JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB. ```typescript await client.catalog.images.create({}); - ``` + @@ -15006,22 +14140,21 @@ await client.catalog.images.create({});
-**request:** `Square.catalog.CreateImagesRequest` - +**request:** `Square.catalog.CreateImagesRequest` +
-**requestOptions:** `ImagesClient.RequestOptions` - +**requestOptions:** `Images.RequestOptions` +
-
@@ -15042,6 +14175,7 @@ Uploads a new image file to replace the existing one in the specified [CatalogIm This `UpdateCatalogImage` endpoint accepts HTTP multipart/form-data requests with a JSON part and an image file part in JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB. + @@ -15057,10 +14191,10 @@ JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB. ```typescript await client.catalog.images.update({ - imageId: "image_id" + imageId: "image_id", }); - ``` + @@ -15074,27 +14208,27 @@ await client.catalog.images.update({
-**request:** `Square.catalog.UpdateImagesRequest` - +**request:** `Square.catalog.UpdateImagesRequest` +
-**requestOptions:** `ImagesClient.RequestOptions` - +**requestOptions:** `Images.RequestOptions` +
-
## Catalog Object +
client.catalog.object.upsert({ ...params }) -> Square.UpsertCatalogObjectResponse
@@ -15112,6 +14246,7 @@ Creates a new or updates the specified [CatalogObject](entity:CatalogObject). To ensure consistency, only one update request is processed at a time per seller account. While one (batch or non-batch) update request is being processed, other (batched and non-batched) update requests are rejected with the `429` error code. +
@@ -15130,11 +14265,11 @@ await client.catalog.object.upsert({ idempotencyKey: "af3d1afc-7212-4300-b463-0bfc5314a5ae", object: { type: "ITEM", - id: "id" - } + id: "id", + }, }); - ``` + @@ -15148,22 +14283,21 @@ await client.catalog.object.upsert({
-**request:** `Square.catalog.UpsertCatalogObjectRequest` - +**request:** `Square.catalog.UpsertCatalogObjectRequest` +
-**requestOptions:** `ObjectClient.RequestOptions` - +**requestOptions:** `Object_.RequestOptions` +
-
@@ -15187,6 +14321,7 @@ information including: [CatalogItemVariation](entity:CatalogItemVariation) children, references to its [CatalogModifierList](entity:CatalogModifierList) objects, and the ids of any [CatalogTax](entity:CatalogTax) objects that apply to it. + @@ -15205,10 +14340,10 @@ await client.catalog.object.get({ objectId: "object_id", includeRelatedObjects: true, catalogVersion: BigInt("1000000"), - includeCategoryPathToRoot: true + includeCategoryPathToRoot: true, }); - ``` + @@ -15222,22 +14357,21 @@ await client.catalog.object.get({
-**request:** `Square.catalog.GetObjectRequest` - +**request:** `Square.catalog.GetObjectRequest` +
-**requestOptions:** `ObjectClient.RequestOptions` - +**requestOptions:** `Object_.RequestOptions` +
-
@@ -15264,6 +14398,7 @@ will also delete all of its To ensure consistency, only one delete request is processed at a time per seller account. While one (batch or non-batch) delete request is being processed, other (batched and non-batched) delete requests are rejected with the `429` error code. + @@ -15279,10 +14414,10 @@ delete requests are rejected with the `429` error code. ```typescript await client.catalog.object.delete({ - objectId: "object_id" + objectId: "object_id", }); - ``` + @@ -15296,28 +14431,28 @@ await client.catalog.object.delete({
-**request:** `Square.catalog.DeleteObjectRequest` - +**request:** `Square.catalog.DeleteObjectRequest` +
-**requestOptions:** `ObjectClient.RequestOptions` - +**requestOptions:** `Object_.RequestOptions` +
- ## Checkout PaymentLinks -
client.checkout.paymentLinks.list({ ...params }) -> core.Page + +
client.checkout.paymentLinks.list({ ...params }) -> core.Page<Square.PaymentLink>
@@ -15330,6 +14465,7 @@ await client.catalog.object.delete({
Lists all payment links. +
@@ -15344,27 +14480,24 @@ Lists all payment links.
```typescript -const pageableResponse = await client.checkout.paymentLinks.list({ +const response = await client.checkout.paymentLinks.list({ cursor: "cursor", - limit: 1 + limit: 1, }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.checkout.paymentLinks.list({ cursor: "cursor", - limit: 1 + limit: 1, }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -15378,22 +14511,21 @@ const response = page.response;
-**request:** `Square.checkout.ListPaymentLinksRequest` - +**request:** `Square.checkout.ListPaymentLinksRequest` +
-**requestOptions:** `PaymentLinksClient.RequestOptions` - +**requestOptions:** `PaymentLinks.RequestOptions` +
-
@@ -15411,6 +14543,7 @@ const response = page.response;
Creates a Square-hosted checkout page. Applications can share the resulting payment link with their buyer to pay for goods and services. +
@@ -15431,13 +14564,13 @@ await client.checkout.paymentLinks.create({ name: "Auto Detailing", priceMoney: { amount: BigInt("10000"), - currency: "USD" + currency: "USD", }, - locationId: "A9Y43N9ABXZBP" - } + locationId: "A9Y43N9ABXZBP", + }, }); - ``` + @@ -15451,22 +14584,21 @@ await client.checkout.paymentLinks.create({
-**request:** `Square.checkout.CreatePaymentLinkRequest` - +**request:** `Square.checkout.CreatePaymentLinkRequest` +
-**requestOptions:** `PaymentLinksClient.RequestOptions` - +**requestOptions:** `PaymentLinks.RequestOptions` +
-
@@ -15484,6 +14616,7 @@ await client.checkout.paymentLinks.create({
Retrieves a payment link. +
@@ -15499,10 +14632,10 @@ Retrieves a payment link. ```typescript await client.checkout.paymentLinks.get({ - id: "id" + id: "id", }); - ``` + @@ -15516,22 +14649,21 @@ await client.checkout.paymentLinks.get({
-**request:** `Square.checkout.GetPaymentLinksRequest` - +**request:** `Square.checkout.GetPaymentLinksRequest` +
-**requestOptions:** `PaymentLinksClient.RequestOptions` - +**requestOptions:** `PaymentLinks.RequestOptions` +
- @@ -15549,8 +14681,9 @@ await client.checkout.paymentLinks.get({
Updates a payment link. You can update the `payment_link` fields such as -`description`, `checkout_options`, and `pre_populated_data`. +`description`, `checkout_options`, and `pre_populated_data`. You cannot update other fields such as the `order_id`, `version`, `URL`, or `timestamp` field. +
@@ -15570,12 +14703,12 @@ await client.checkout.paymentLinks.update({ paymentLink: { version: 1, checkoutOptions: { - askForShippingAddress: true - } - } + askForShippingAddress: true, + }, + }, }); - ``` + @@ -15589,22 +14722,21 @@ await client.checkout.paymentLinks.update({
-**request:** `Square.checkout.UpdatePaymentLinkRequest` - +**request:** `Square.checkout.UpdatePaymentLinkRequest` +
-**requestOptions:** `PaymentLinksClient.RequestOptions` - +**requestOptions:** `PaymentLinks.RequestOptions` +
- @@ -15622,6 +14754,7 @@ await client.checkout.paymentLinks.update({
Deletes a payment link. +
@@ -15637,10 +14770,10 @@ Deletes a payment link. ```typescript await client.checkout.paymentLinks.delete({ - id: "id" + id: "id", }); - ``` + @@ -15654,28 +14787,28 @@ await client.checkout.paymentLinks.delete({
-**request:** `Square.checkout.DeletePaymentLinksRequest` - +**request:** `Square.checkout.DeletePaymentLinksRequest` +
-**requestOptions:** `PaymentLinksClient.RequestOptions` - +**requestOptions:** `PaymentLinks.RequestOptions` +
- ## Customers CustomAttributeDefinitions -
client.customers.customAttributeDefinitions.list({ ...params }) -> core.Page + +
client.customers.customAttributeDefinitions.list({ ...params }) -> core.Page<Square.CustomAttributeDefinition>
@@ -15693,6 +14826,7 @@ When all response pages are retrieved, the results include all custom attribute that are visible to the requesting application, including those that are created by other applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. +
@@ -15707,27 +14841,24 @@ seller-defined custom attributes (also known as custom fields) are always set to
```typescript -const pageableResponse = await client.customers.customAttributeDefinitions.list({ +const response = await client.customers.customAttributeDefinitions.list({ limit: 1, - cursor: "cursor" + cursor: "cursor", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.customers.customAttributeDefinitions.list({ limit: 1, - cursor: "cursor" + cursor: "cursor", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -15741,22 +14872,21 @@ const response = page.response;
-**request:** `Square.customers.ListCustomAttributeDefinitionsRequest` - +**request:** `Square.customers.ListCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
-
@@ -15784,6 +14914,7 @@ to set the custom attribute for customer profiles in the seller's Customer Direc Sellers can view all custom attributes in exported customer data, including those set to `VISIBILITY_HIDDEN`. + @@ -15802,15 +14933,15 @@ await client.customers.customAttributeDefinitions.create({ customAttributeDefinition: { key: "favoritemovie", schema: { - "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String", }, name: "Favorite Movie", description: "The favorite movie of the customer.", - visibility: "VISIBILITY_HIDDEN" - } + visibility: "VISIBILITY_HIDDEN", + }, }); - ``` + @@ -15824,22 +14955,21 @@ await client.customers.customAttributeDefinitions.create({
-**request:** `Square.customers.CreateCustomerCustomAttributeDefinitionRequest` - +**request:** `Square.customers.CreateCustomerCustomAttributeDefinitionRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
-
@@ -15861,6 +14991,7 @@ Retrieves a customer-related [custom attribute definition](entity:CustomAttribut To retrieve a custom attribute definition created by another application, the `visibility` setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + @@ -15877,10 +15008,10 @@ setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note t ```typescript await client.customers.customAttributeDefinitions.get({ key: "key", - version: 1 + version: 1, }); - ``` + @@ -15894,22 +15025,21 @@ await client.customers.customAttributeDefinitions.get({
-**request:** `Square.customers.GetCustomAttributeDefinitionsRequest` - +**request:** `Square.customers.GetCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
- @@ -15933,6 +15063,7 @@ Use this endpoint to update the following fields: `name`, `description`, `visibi Only the definition owner can update a custom attribute definition. Note that sellers can view all custom attributes in exported customer data, including those set to `VISIBILITY_HIDDEN`. + @@ -15951,11 +15082,11 @@ await client.customers.customAttributeDefinitions.update({ key: "key", customAttributeDefinition: { description: "Update the description as desired.", - visibility: "VISIBILITY_READ_ONLY" - } + visibility: "VISIBILITY_READ_ONLY", + }, }); - ``` + @@ -15969,22 +15100,21 @@ await client.customers.customAttributeDefinitions.update({
-**request:** `Square.customers.UpdateCustomerCustomAttributeDefinitionRequest` - +**request:** `Square.customers.UpdateCustomerCustomAttributeDefinitionRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
- @@ -16007,6 +15137,7 @@ Deleting a custom attribute definition also deletes the corresponding custom att all customer profiles in the seller's Customer Directory. Only the definition owner can delete a custom attribute definition. + @@ -16022,10 +15153,10 @@ Only the definition owner can delete a custom attribute definition. ```typescript await client.customers.customAttributeDefinitions.delete({ - key: "key" + key: "key", }); - ``` + @@ -16039,22 +15170,21 @@ await client.customers.customAttributeDefinitions.delete({
-**request:** `Square.customers.DeleteCustomAttributeDefinitionsRequest` - +**request:** `Square.customers.DeleteCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
- @@ -16085,6 +15215,7 @@ of the corresponding request. To create or update a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + @@ -16101,45 +15232,45 @@ must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attribut ```typescript await client.customers.customAttributeDefinitions.batchUpsert({ values: { - "id1": { + id1: { customerId: "N3NCVYY3WS27HF0HKANA3R9FP8", customAttribute: { key: "favoritemovie", - value: "Dune" - } + value: "Dune", + }, }, - "id2": { + id2: { customerId: "SY8EMWRNDN3TQDP2H4KS1QWMMM", customAttribute: { key: "ownsmovie", - value: false - } + value: false, + }, }, - "id3": { + id3: { customerId: "SY8EMWRNDN3TQDP2H4KS1QWMMM", customAttribute: { key: "favoritemovie", - value: "Star Wars" - } + value: "Star Wars", + }, }, - "id4": { + id4: { customerId: "N3NCVYY3WS27HF0HKANA3R9FP8", customAttribute: { key: "square:a0f1505a-2aa1-490d-91a8-8d31ff181808", - value: "10.5" - } + value: "10.5", + }, }, - "id5": { + id5: { customerId: "70548QG1HN43B05G0KCZ4MMC1G", customAttribute: { key: "sq0ids-0evKIskIGaY45fCyNL66aw:backupemail", - value: "fake-email@squareup.com" - } - } - } + value: "fake-email@squareup.com", + }, + }, + }, }); - ``` + @@ -16153,28 +15284,28 @@ await client.customers.customAttributeDefinitions.batchUpsert({
-**request:** `Square.customers.BatchUpsertCustomerCustomAttributesRequest` - +**request:** `Square.customers.BatchUpsertCustomerCustomAttributesRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
- ## Customers Groups -
client.customers.groups.list({ ...params }) -> core.Page + +
client.customers.groups.list({ ...params }) -> core.Page<Square.CustomerGroup>
@@ -16187,6 +15318,7 @@ await client.customers.customAttributeDefinitions.batchUpsert({
Retrieves the list of customer groups of a business. +
@@ -16201,27 +15333,24 @@ Retrieves the list of customer groups of a business.
```typescript -const pageableResponse = await client.customers.groups.list({ +const response = await client.customers.groups.list({ cursor: "cursor", - limit: 1 + limit: 1, }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.customers.groups.list({ cursor: "cursor", - limit: 1 + limit: 1, }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -16235,22 +15364,21 @@ const response = page.response;
-**request:** `Square.customers.ListGroupsRequest` - +**request:** `Square.customers.ListGroupsRequest` +
-**requestOptions:** `GroupsClient.RequestOptions` - +**requestOptions:** `Groups.RequestOptions` +
-
@@ -16270,6 +15398,7 @@ const response = page.response; Creates a new customer group for a business. The request must include the `name` value of the group. + @@ -16286,11 +15415,11 @@ The request must include the `name` value of the group. ```typescript await client.customers.groups.create({ group: { - name: "Loyal Customers" - } + name: "Loyal Customers", + }, }); - ``` + @@ -16304,22 +15433,21 @@ await client.customers.groups.create({
-**request:** `Square.customers.CreateCustomerGroupRequest` - +**request:** `Square.customers.CreateCustomerGroupRequest` +
-**requestOptions:** `GroupsClient.RequestOptions` - +**requestOptions:** `Groups.RequestOptions` +
-
@@ -16337,6 +15465,7 @@ await client.customers.groups.create({
Retrieves a specific customer group as identified by the `group_id` value. +
@@ -16352,10 +15481,10 @@ Retrieves a specific customer group as identified by the `group_id` value. ```typescript await client.customers.groups.get({ - groupId: "group_id" + groupId: "group_id", }); - ``` + @@ -16369,22 +15498,21 @@ await client.customers.groups.get({
-**request:** `Square.customers.GetGroupsRequest` - +**request:** `Square.customers.GetGroupsRequest` +
-**requestOptions:** `GroupsClient.RequestOptions` - +**requestOptions:** `Groups.RequestOptions` +
- @@ -16402,6 +15530,7 @@ await client.customers.groups.get({
Updates a customer group as identified by the `group_id` value. +
@@ -16419,11 +15548,11 @@ Updates a customer group as identified by the `group_id` value. await client.customers.groups.update({ groupId: "group_id", group: { - name: "Loyal Customers" - } + name: "Loyal Customers", + }, }); - ``` + @@ -16437,22 +15566,21 @@ await client.customers.groups.update({
-**request:** `Square.customers.UpdateCustomerGroupRequest` - +**request:** `Square.customers.UpdateCustomerGroupRequest` +
-**requestOptions:** `GroupsClient.RequestOptions` - +**requestOptions:** `Groups.RequestOptions` +
- @@ -16470,6 +15598,7 @@ await client.customers.groups.update({
Deletes a customer group as identified by the `group_id` value. +
@@ -16485,10 +15614,10 @@ Deletes a customer group as identified by the `group_id` value. ```typescript await client.customers.groups.delete({ - groupId: "group_id" + groupId: "group_id", }); - ``` + @@ -16502,22 +15631,21 @@ await client.customers.groups.delete({
-**request:** `Square.customers.DeleteGroupsRequest` - +**request:** `Square.customers.DeleteGroupsRequest` +
-**requestOptions:** `GroupsClient.RequestOptions` - +**requestOptions:** `Groups.RequestOptions` +
- @@ -16538,6 +15666,7 @@ Adds a group membership to a customer. The customer is identified by the `customer_id` value and the customer group is identified by the `group_id` value. + @@ -16554,10 +15683,10 @@ and the customer group is identified by the `group_id` value. ```typescript await client.customers.groups.add({ customerId: "customer_id", - groupId: "group_id" + groupId: "group_id", }); - ``` + @@ -16571,22 +15700,21 @@ await client.customers.groups.add({
-**request:** `Square.customers.AddGroupsRequest` - +**request:** `Square.customers.AddGroupsRequest` +
-**requestOptions:** `GroupsClient.RequestOptions` - +**requestOptions:** `Groups.RequestOptions` +
- @@ -16607,6 +15735,7 @@ Removes a group membership from a customer. The customer is identified by the `customer_id` value and the customer group is identified by the `group_id` value. + @@ -16623,10 +15752,10 @@ and the customer group is identified by the `group_id` value. ```typescript await client.customers.groups.remove({ customerId: "customer_id", - groupId: "group_id" + groupId: "group_id", }); - ``` + @@ -16640,28 +15769,28 @@ await client.customers.groups.remove({
-**request:** `Square.customers.RemoveGroupsRequest` - +**request:** `Square.customers.RemoveGroupsRequest` +
-**requestOptions:** `GroupsClient.RequestOptions` - +**requestOptions:** `Groups.RequestOptions` +
- ## Customers Segments -
client.customers.segments.list({ ...params }) -> core.Page + +
client.customers.segments.list({ ...params }) -> core.Page<Square.CustomerSegment>
@@ -16674,6 +15803,7 @@ await client.customers.groups.remove({
Retrieves the list of customer segments of a business. +
@@ -16688,27 +15818,24 @@ Retrieves the list of customer segments of a business.
```typescript -const pageableResponse = await client.customers.segments.list({ +const response = await client.customers.segments.list({ cursor: "cursor", - limit: 1 + limit: 1, }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.customers.segments.list({ cursor: "cursor", - limit: 1 + limit: 1, }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -16722,22 +15849,21 @@ const response = page.response;
-**request:** `Square.customers.ListSegmentsRequest` - +**request:** `Square.customers.ListSegmentsRequest` +
-**requestOptions:** `SegmentsClient.RequestOptions` - +**requestOptions:** `Segments.RequestOptions` +
-
@@ -16755,6 +15881,7 @@ const response = page.response;
Retrieves a specific customer segment as identified by the `segment_id` value. +
@@ -16770,10 +15897,10 @@ Retrieves a specific customer segment as identified by the `segment_id` value. ```typescript await client.customers.segments.get({ - segmentId: "segment_id" + segmentId: "segment_id", }); - ``` + @@ -16787,27 +15914,27 @@ await client.customers.segments.get({
-**request:** `Square.customers.GetSegmentsRequest` - +**request:** `Square.customers.GetSegmentsRequest` +
-**requestOptions:** `SegmentsClient.RequestOptions` - +**requestOptions:** `Segments.RequestOptions` +
-
## Customers Cards +
client.customers.cards.create({ ...params }) -> Square.CreateCustomerCardResponse
@@ -16825,6 +15952,7 @@ Adds a card on file to an existing customer. As with charges, calls to `CreateCustomerCard` are idempotent. Multiple calls with the same card nonce return the same card record that was created with the provided nonce during the _first_ call. +
@@ -16848,12 +15976,12 @@ await client.customers.cards.create({ locality: "New York", administrativeDistrictLevel1: "NY", postalCode: "10003", - country: "US" + country: "US", }, - cardholderName: "Amelia Earhart" + cardholderName: "Amelia Earhart", }); - ``` + @@ -16867,22 +15995,21 @@ await client.customers.cards.create({
-**request:** `Square.customers.CreateCustomerCardRequest` - +**request:** `Square.customers.CreateCustomerCardRequest` +
-**requestOptions:** `CardsClient.RequestOptions` - +**requestOptions:** `Cards.RequestOptions` +
-
@@ -16900,6 +16027,7 @@ await client.customers.cards.create({
Removes a card on file from a customer. +
@@ -16916,10 +16044,10 @@ Removes a card on file from a customer. ```typescript await client.customers.cards.delete({ customerId: "customer_id", - cardId: "card_id" + cardId: "card_id", }); - ``` + @@ -16933,28 +16061,28 @@ await client.customers.cards.delete({
-**request:** `Square.customers.DeleteCardsRequest` - +**request:** `Square.customers.DeleteCardsRequest` +
-**requestOptions:** `CardsClient.RequestOptions` - +**requestOptions:** `Cards.RequestOptions` +
- ## Customers CustomAttributes -
client.customers.customAttributes.list({ ...params }) -> core.Page + +
client.customers.customAttributes.list({ ...params }) -> core.Page<Square.CustomAttribute>
@@ -16974,6 +16102,7 @@ in the same call. When all response pages are retrieved, the results include all custom attributes that are visible to the requesting application, including those that are owned by other applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. +
@@ -16988,13 +16117,13 @@ and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.
```typescript -const pageableResponse = await client.customers.customAttributes.list({ +const response = await client.customers.customAttributes.list({ customerId: "customer_id", limit: 1, cursor: "cursor", - withDefinitions: true + withDefinitions: true, }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -17003,16 +16132,13 @@ let page = await client.customers.customAttributes.list({ customerId: "customer_id", limit: 1, cursor: "cursor", - withDefinitions: true + withDefinitions: true, }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -17026,22 +16152,21 @@ const response = page.response;
-**request:** `Square.customers.ListCustomAttributesRequest` - +**request:** `Square.customers.ListCustomAttributesRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
-
@@ -17066,6 +16191,7 @@ in the same call. To retrieve a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + @@ -17084,10 +16210,10 @@ await client.customers.customAttributes.get({ customerId: "customer_id", key: "key", withDefinition: true, - version: 1 + version: 1, }); - ``` + @@ -17101,22 +16227,21 @@ await client.customers.customAttributes.get({
-**request:** `Square.customers.GetCustomAttributesRequest` - +**request:** `Square.customers.GetCustomAttributesRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
-
@@ -17142,6 +16267,7 @@ is created using the [CreateCustomerCustomAttributeDefinition](api-endpoint:Cust To create or update a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + @@ -17160,11 +16286,11 @@ await client.customers.customAttributes.upsert({ customerId: "customer_id", key: "key", customAttribute: { - value: "Dune" - } + value: "Dune", + }, }); - ``` + @@ -17178,22 +16304,21 @@ await client.customers.customAttributes.upsert({
-**request:** `Square.customers.UpsertCustomerCustomAttributeRequest` - +**request:** `Square.customers.UpsertCustomerCustomAttributeRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
- @@ -17215,6 +16340,7 @@ Deletes a [custom attribute](entity:CustomAttribute) associated with a customer To delete a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + @@ -17231,10 +16357,10 @@ To delete a custom attribute owned by another application, the `visibility` sett ```typescript await client.customers.customAttributes.delete({ customerId: "customer_id", - key: "key" + key: "key", }); - ``` + @@ -17248,28 +16374,28 @@ await client.customers.customAttributes.delete({
-**request:** `Square.customers.DeleteCustomAttributesRequest` - +**request:** `Square.customers.DeleteCustomAttributesRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
- ## Devices Codes -
client.devices.codes.list({ ...params }) -> core.Page + +
client.devices.codes.list({ ...params }) -> core.Page<Square.DeviceCode>
@@ -17282,6 +16408,7 @@ await client.customers.customAttributes.delete({
Lists all DeviceCodes associated with the merchant. +
@@ -17296,13 +16423,13 @@ Lists all DeviceCodes associated with the merchant.
```typescript -const pageableResponse = await client.devices.codes.list({ +const response = await client.devices.codes.list({ cursor: "cursor", locationId: "location_id", productType: "TERMINAL_API", - status: "UNKNOWN" + status: "UNKNOWN", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -17311,16 +16438,13 @@ let page = await client.devices.codes.list({ cursor: "cursor", locationId: "location_id", productType: "TERMINAL_API", - status: "UNKNOWN" + status: "UNKNOWN", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -17334,22 +16458,21 @@ const response = page.response;
-**request:** `Square.devices.ListCodesRequest` - +**request:** `Square.devices.ListCodesRequest` +
-**requestOptions:** `CodesClient.RequestOptions` - +**requestOptions:** `Codes.RequestOptions` +
-
@@ -17368,6 +16491,7 @@ const response = page.response; Creates a DeviceCode that can be used to login to a Square Terminal device to enter the connected terminal mode. + @@ -17387,11 +16511,11 @@ await client.devices.codes.create({ deviceCode: { name: "Counter 1", productType: "TERMINAL_API", - locationId: "B5E4484SHHNYH" - } + locationId: "B5E4484SHHNYH", + }, }); - ``` + @@ -17405,22 +16529,21 @@ await client.devices.codes.create({
-**request:** `Square.devices.CreateDeviceCodeRequest` - +**request:** `Square.devices.CreateDeviceCodeRequest` +
-**requestOptions:** `CodesClient.RequestOptions` - +**requestOptions:** `Codes.RequestOptions` +
-
@@ -17438,6 +16561,7 @@ await client.devices.codes.create({
Retrieves DeviceCode with the associated ID. +
@@ -17453,10 +16577,10 @@ Retrieves DeviceCode with the associated ID. ```typescript await client.devices.codes.get({ - id: "id" + id: "id", }); - ``` + @@ -17470,28 +16594,28 @@ await client.devices.codes.get({
-**request:** `Square.devices.GetCodesRequest` - +**request:** `Square.devices.GetCodesRequest` +
-**requestOptions:** `CodesClient.RequestOptions` - +**requestOptions:** `Codes.RequestOptions` +
- ## Disputes Evidence -
client.disputes.evidence.list({ ...params }) -> core.Page + +
client.disputes.evidence.list({ ...params }) -> core.Page<Square.DisputeEvidence>
@@ -17504,6 +16628,7 @@ await client.devices.codes.get({
Returns a list of evidence associated with a dispute. +
@@ -17518,27 +16643,24 @@ Returns a list of evidence associated with a dispute.
```typescript -const pageableResponse = await client.disputes.evidence.list({ +const response = await client.disputes.evidence.list({ disputeId: "dispute_id", - cursor: "cursor" + cursor: "cursor", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.disputes.evidence.list({ disputeId: "dispute_id", - cursor: "cursor" + cursor: "cursor", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -17552,22 +16674,21 @@ const response = page.response;
-**request:** `Square.disputes.ListEvidenceRequest` - +**request:** `Square.disputes.ListEvidenceRequest` +
-**requestOptions:** `EvidenceClient.RequestOptions` - +**requestOptions:** `Evidence.RequestOptions` +
-
@@ -17587,6 +16708,7 @@ const response = page.response; Returns the metadata for the evidence specified in the request URL path. You must maintain a copy of any evidence uploaded if you want to reference it later. Evidence cannot be downloaded after you upload it. + @@ -17603,10 +16725,10 @@ You must maintain a copy of any evidence uploaded if you want to reference it la ```typescript await client.disputes.evidence.get({ disputeId: "dispute_id", - evidenceId: "evidence_id" + evidenceId: "evidence_id", }); - ``` + @@ -17620,22 +16742,21 @@ await client.disputes.evidence.get({
-**request:** `Square.disputes.GetEvidenceRequest` - +**request:** `Square.disputes.GetEvidenceRequest` +
-**requestOptions:** `EvidenceClient.RequestOptions` - +**requestOptions:** `Evidence.RequestOptions` +
-
@@ -17654,6 +16775,7 @@ await client.disputes.evidence.get({ Removes specified evidence from a dispute. Square does not send the bank any evidence that is removed. + @@ -17670,10 +16792,10 @@ Square does not send the bank any evidence that is removed. ```typescript await client.disputes.evidence.delete({ disputeId: "dispute_id", - evidenceId: "evidence_id" + evidenceId: "evidence_id", }); - ``` + @@ -17687,28 +16809,28 @@ await client.disputes.evidence.delete({
-**request:** `Square.disputes.DeleteEvidenceRequest` - +**request:** `Square.disputes.DeleteEvidenceRequest` +
-**requestOptions:** `EvidenceClient.RequestOptions` - +**requestOptions:** `Evidence.RequestOptions` +
- ## GiftCards Activities -
client.giftCards.activities.list({ ...params }) -> core.Page + +
client.giftCards.activities.list({ ...params }) -> core.Page<Square.GiftCardActivity>
@@ -17724,6 +16846,7 @@ Lists gift card activities. By default, you get gift card activities for all gift cards in the seller's account. You can optionally specify query parameters to filter the list. For example, you can get a list of gift card activities for a gift card, for all gift cards in a specific region, or for activities within a time window. +
@@ -17738,7 +16861,7 @@ for all gift cards in a specific region, or for activities within a time window.
```typescript -const pageableResponse = await client.giftCards.activities.list({ +const response = await client.giftCards.activities.list({ giftCardId: "gift_card_id", type: "type", locationId: "location_id", @@ -17746,9 +16869,9 @@ const pageableResponse = await client.giftCards.activities.list({ endTime: "end_time", limit: 1, cursor: "cursor", - sortOrder: "sort_order" + sortOrder: "sort_order", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -17761,16 +16884,13 @@ let page = await client.giftCards.activities.list({ endTime: "end_time", limit: 1, cursor: "cursor", - sortOrder: "sort_order" + sortOrder: "sort_order", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -17784,22 +16904,21 @@ const response = page.response;
-**request:** `Square.giftCards.ListActivitiesRequest` - +**request:** `Square.giftCards.ListActivitiesRequest` +
-**requestOptions:** `ActivitiesClient.RequestOptions` - +**requestOptions:** `Activities.RequestOptions` +
-
@@ -17818,6 +16937,7 @@ const response = page.response; Creates a gift card activity to manage the balance or state of a [gift card](entity:GiftCard). For example, create an `ACTIVATE` activity to activate a gift card with an initial balance before first use. + @@ -17840,12 +16960,12 @@ await client.giftCards.activities.create({ giftCardId: "gftc:6d55a72470d940c6ba09c0ab8ad08d20", activateActivityDetails: { orderId: "jJNGHm4gLI6XkFbwtiSLqK72KkAZY", - lineItemUid: "eIWl7X0nMuO9Ewbh0ChIx" - } - } + lineItemUid: "eIWl7X0nMuO9Ewbh0ChIx", + }, + }, }); - ``` + @@ -17859,28 +16979,28 @@ await client.giftCards.activities.create({
-**request:** `Square.giftCards.CreateGiftCardActivityRequest` - +**request:** `Square.giftCards.CreateGiftCardActivityRequest` +
-**requestOptions:** `ActivitiesClient.RequestOptions` - +**requestOptions:** `Activities.RequestOptions` +
-
## Labor BreakTypes -
client.labor.breakTypes.list({ ...params }) -> core.Page + +
client.labor.breakTypes.list({ ...params }) -> core.Page<Square.BreakType>
@@ -17893,6 +17013,7 @@ await client.giftCards.activities.create({
Returns a paginated list of `BreakType` instances for a business. +
@@ -17907,12 +17028,12 @@ Returns a paginated list of `BreakType` instances for a business.
```typescript -const pageableResponse = await client.labor.breakTypes.list({ +const response = await client.labor.breakTypes.list({ locationId: "location_id", limit: 1, - cursor: "cursor" + cursor: "cursor", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -17920,16 +17041,13 @@ for await (const item of pageableResponse) { let page = await client.labor.breakTypes.list({ locationId: "location_id", limit: 1, - cursor: "cursor" + cursor: "cursor", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -17943,22 +17061,21 @@ const response = page.response;
-**request:** `Square.labor.ListBreakTypesRequest` - +**request:** `Square.labor.ListBreakTypesRequest` +
-**requestOptions:** `BreakTypesClient.RequestOptions` - +**requestOptions:** `BreakTypes.RequestOptions` +
-
@@ -17989,6 +17106,7 @@ endpoint: You can only have three `BreakType` instances per location. If you attempt to add a fourth `BreakType` for a location, an `INVALID_REQUEST_ERROR` "Exceeded limit of 3 breaks per location." is returned. + @@ -18009,11 +17127,11 @@ await client.labor.breakTypes.create({ locationId: "CGJN03P1D08GF", breakName: "Lunch Break", expectedDuration: "PT30M", - isPaid: true - } + isPaid: true, + }, }); - ``` + @@ -18027,22 +17145,21 @@ await client.labor.breakTypes.create({
-**request:** `Square.labor.CreateBreakTypeRequest` - +**request:** `Square.labor.CreateBreakTypeRequest` +
-**requestOptions:** `BreakTypesClient.RequestOptions` - +**requestOptions:** `BreakTypes.RequestOptions` +
-
@@ -18060,6 +17177,7 @@ await client.labor.breakTypes.create({
Returns a single `BreakType` specified by `id`. +
@@ -18075,10 +17193,10 @@ Returns a single `BreakType` specified by `id`. ```typescript await client.labor.breakTypes.get({ - id: "id" + id: "id", }); - ``` + @@ -18092,22 +17210,21 @@ await client.labor.breakTypes.get({
-**request:** `Square.labor.GetBreakTypesRequest` - +**request:** `Square.labor.GetBreakTypesRequest` +
-**requestOptions:** `BreakTypesClient.RequestOptions` - +**requestOptions:** `BreakTypes.RequestOptions` +
- @@ -18125,6 +17242,7 @@ await client.labor.breakTypes.get({
Updates an existing `BreakType`. +
@@ -18146,11 +17264,11 @@ await client.labor.breakTypes.update({ breakName: "Lunch", expectedDuration: "PT50M", isPaid: true, - version: 1 - } + version: 1, + }, }); - ``` + @@ -18164,22 +17282,21 @@ await client.labor.breakTypes.update({
-**request:** `Square.labor.UpdateBreakTypeRequest` - +**request:** `Square.labor.UpdateBreakTypeRequest` +
-**requestOptions:** `BreakTypesClient.RequestOptions` - +**requestOptions:** `BreakTypes.RequestOptions` +
- @@ -18199,6 +17316,7 @@ await client.labor.breakTypes.update({ Deletes an existing `BreakType`. A `BreakType` can be deleted even if it is referenced from a `Shift`. + @@ -18214,10 +17332,10 @@ A `BreakType` can be deleted even if it is referenced from a `Shift`. ```typescript await client.labor.breakTypes.delete({ - id: "id" + id: "id", }); - ``` + @@ -18231,28 +17349,28 @@ await client.labor.breakTypes.delete({
-**request:** `Square.labor.DeleteBreakTypesRequest` - +**request:** `Square.labor.DeleteBreakTypesRequest` +
-**requestOptions:** `BreakTypesClient.RequestOptions` - +**requestOptions:** `BreakTypes.RequestOptions` +
- ## Labor EmployeeWages -
client.labor.employeeWages.list({ ...params }) -> core.Page + +
client.labor.employeeWages.list({ ...params }) -> core.Page<Square.EmployeeWage>
@@ -18265,6 +17383,7 @@ await client.labor.breakTypes.delete({
Returns a paginated list of `EmployeeWage` instances for a business. +
@@ -18279,12 +17398,12 @@ Returns a paginated list of `EmployeeWage` instances for a business.
```typescript -const pageableResponse = await client.labor.employeeWages.list({ +const response = await client.labor.employeeWages.list({ employeeId: "employee_id", limit: 1, - cursor: "cursor" + cursor: "cursor", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -18292,16 +17411,13 @@ for await (const item of pageableResponse) { let page = await client.labor.employeeWages.list({ employeeId: "employee_id", limit: 1, - cursor: "cursor" + cursor: "cursor", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -18315,22 +17431,21 @@ const response = page.response;
-**request:** `Square.labor.ListEmployeeWagesRequest` - +**request:** `Square.labor.ListEmployeeWagesRequest` +
-**requestOptions:** `EmployeeWagesClient.RequestOptions` - +**requestOptions:** `EmployeeWages.RequestOptions` +
-
@@ -18348,6 +17463,7 @@ const response = page.response;
Returns a single `EmployeeWage` specified by `id`. +
@@ -18363,10 +17479,10 @@ Returns a single `EmployeeWage` specified by `id`. ```typescript await client.labor.employeeWages.get({ - id: "id" + id: "id", }); - ``` + @@ -18380,27 +17496,27 @@ await client.labor.employeeWages.get({
-**request:** `Square.labor.GetEmployeeWagesRequest` - +**request:** `Square.labor.GetEmployeeWagesRequest` +
-**requestOptions:** `EmployeeWagesClient.RequestOptions` - +**requestOptions:** `EmployeeWages.RequestOptions` +
-
## Labor Shifts +
client.labor.shifts.create({ ...params }) -> Square.CreateShiftResponse
@@ -18424,17 +17540,18 @@ endpoint: - `start_at` An attempt to create a new `Shift` can result in a `BAD_REQUEST` error when: + - The `status` of the new `Shift` is `OPEN` and the team member has another -shift with an `OPEN` status. + shift with an `OPEN` status. - The `start_at` date is in the future. - The `start_at` or `end_at` date overlaps another shift for the same team member. - The `Break` instances are set in the request and a break `start_at` is before the `Shift.start_at`, a break `end_at` is after the `Shift.end_at`, or both. -
-
- - + + + + #### 🔌 Usage @@ -18455,27 +17572,29 @@ await client.labor.shifts.create({ title: "Barista", hourlyRate: { amount: BigInt("1100"), - currency: "USD" + currency: "USD", }, - tipEligible: true + tipEligible: true, }, - breaks: [{ + breaks: [ + { startAt: "2019-01-25T06:11:00-05:00", endAt: "2019-01-25T06:16:00-05:00", breakTypeId: "REGS1EQR1TPZ5", name: "Tea Break", expectedDuration: "PT5M", - isPaid: true - }], + isPaid: true, + }, + ], teamMemberId: "ormj0jJJZ5OZIzxrZYJI", declaredCashTipMoney: { amount: BigInt("500"), - currency: "USD" - } - } + currency: "USD", + }, + }, }); - ``` + @@ -18489,22 +17608,21 @@ await client.labor.shifts.create({
-**request:** `Square.labor.CreateShiftRequest` - +**request:** `Square.labor.CreateShiftRequest` +
-**requestOptions:** `ShiftsClient.RequestOptions` - +**requestOptions:** `Shifts.RequestOptions` +
-
@@ -18523,6 +17641,7 @@ await client.labor.shifts.create({ Returns a paginated list of `Shift` records for a business. The list to be returned can be filtered by: + - Location IDs - Team member IDs - Shift status (`OPEN` or `CLOSED`) @@ -18531,14 +17650,15 @@ The list to be returned can be filtered by: - Workday details The list can be sorted by: + - `START_AT` - `END_AT` - `CREATED_AT` - `UPDATED_AT` - - - - + + + + #### 🔌 Usage @@ -18555,17 +17675,17 @@ await client.labor.shifts.search({ workday: { dateRange: { startDate: "2019-01-20", - endDate: "2019-02-03" + endDate: "2019-02-03", }, matchShiftsBy: "START_AT", - defaultTimezone: "America/Los_Angeles" - } - } + defaultTimezone: "America/Los_Angeles", + }, + }, }, - limit: 100 + limit: 100, }); - ``` + @@ -18579,22 +17699,21 @@ await client.labor.shifts.search({
-**request:** `Square.labor.SearchShiftsRequest` - +**request:** `Square.labor.SearchShiftsRequest` +
-**requestOptions:** `ShiftsClient.RequestOptions` - +**requestOptions:** `Shifts.RequestOptions` +
- @@ -18612,6 +17731,7 @@ await client.labor.shifts.search({
Returns a single `Shift` specified by `id`. +
@@ -18627,10 +17747,10 @@ Returns a single `Shift` specified by `id`. ```typescript await client.labor.shifts.get({ - id: "id" + id: "id", }); - ``` + @@ -18644,22 +17764,21 @@ await client.labor.shifts.get({
-**request:** `Square.labor.GetShiftsRequest` - +**request:** `Square.labor.GetShiftsRequest` +
-**requestOptions:** `ShiftsClient.RequestOptions` - +**requestOptions:** `Shifts.RequestOptions` +
- @@ -18683,6 +17802,7 @@ the `end_at` property set to a valid RFC-3339 datetime string. When closing a `Shift`, all `Break` instances in the `Shift` must be complete with `end_at` set on each `Break`. + @@ -18707,29 +17827,31 @@ await client.labor.shifts.update({ title: "Bartender", hourlyRate: { amount: BigInt("1500"), - currency: "USD" + currency: "USD", }, - tipEligible: true + tipEligible: true, }, - breaks: [{ + breaks: [ + { id: "X7GAQYVVRRG6P", startAt: "2019-01-25T06:11:00-05:00", endAt: "2019-01-25T06:16:00-05:00", breakTypeId: "REGS1EQR1TPZ5", name: "Tea Break", expectedDuration: "PT5M", - isPaid: true - }], + isPaid: true, + }, + ], version: 1, teamMemberId: "ormj0jJJZ5OZIzxrZYJI", declaredCashTipMoney: { amount: BigInt("500"), - currency: "USD" - } - } + currency: "USD", + }, + }, }); - ``` + @@ -18743,22 +17865,21 @@ await client.labor.shifts.update({
-**request:** `Square.labor.UpdateShiftRequest` - +**request:** `Square.labor.UpdateShiftRequest` +
-**requestOptions:** `ShiftsClient.RequestOptions` - +**requestOptions:** `Shifts.RequestOptions` +
- @@ -18776,6 +17897,7 @@ await client.labor.shifts.update({
Deletes a `Shift`. +
@@ -18791,10 +17913,10 @@ Deletes a `Shift`. ```typescript await client.labor.shifts.delete({ - id: "id" + id: "id", }); - ``` + @@ -18808,28 +17930,28 @@ await client.labor.shifts.delete({
-**request:** `Square.labor.DeleteShiftsRequest` - +**request:** `Square.labor.DeleteShiftsRequest` +
-**requestOptions:** `ShiftsClient.RequestOptions` - +**requestOptions:** `Shifts.RequestOptions` +
- ## Labor TeamMemberWages -
client.labor.teamMemberWages.list({ ...params }) -> core.Page + +
client.labor.teamMemberWages.list({ ...params }) -> core.Page<Square.TeamMemberWage>
@@ -18842,6 +17964,7 @@ await client.labor.shifts.delete({
Returns a paginated list of `TeamMemberWage` instances for a business. +
@@ -18856,12 +17979,12 @@ Returns a paginated list of `TeamMemberWage` instances for a business.
```typescript -const pageableResponse = await client.labor.teamMemberWages.list({ +const response = await client.labor.teamMemberWages.list({ teamMemberId: "team_member_id", limit: 1, - cursor: "cursor" + cursor: "cursor", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -18869,16 +17992,13 @@ for await (const item of pageableResponse) { let page = await client.labor.teamMemberWages.list({ teamMemberId: "team_member_id", limit: 1, - cursor: "cursor" + cursor: "cursor", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -18892,22 +18012,21 @@ const response = page.response;
-**request:** `Square.labor.ListTeamMemberWagesRequest` - +**request:** `Square.labor.ListTeamMemberWagesRequest` +
-**requestOptions:** `TeamMemberWagesClient.RequestOptions` - +**requestOptions:** `TeamMemberWages.RequestOptions` +
-
@@ -18925,6 +18044,7 @@ const response = page.response;
Returns a single `TeamMemberWage` specified by `id`. +
@@ -18940,10 +18060,10 @@ Returns a single `TeamMemberWage` specified by `id`. ```typescript await client.labor.teamMemberWages.get({ - id: "id" + id: "id", }); - ``` + @@ -18957,28 +18077,28 @@ await client.labor.teamMemberWages.get({
-**request:** `Square.labor.GetTeamMemberWagesRequest` - +**request:** `Square.labor.GetTeamMemberWagesRequest` +
-**requestOptions:** `TeamMemberWagesClient.RequestOptions` - +**requestOptions:** `TeamMemberWages.RequestOptions` +
-
## Labor WorkweekConfigs -
client.labor.workweekConfigs.list({ ...params }) -> core.Page + +
client.labor.workweekConfigs.list({ ...params }) -> core.Page<Square.WorkweekConfig>
@@ -18991,6 +18111,7 @@ await client.labor.teamMemberWages.get({
Returns a list of `WorkweekConfig` instances for a business. +
@@ -19005,27 +18126,24 @@ Returns a list of `WorkweekConfig` instances for a business.
```typescript -const pageableResponse = await client.labor.workweekConfigs.list({ +const response = await client.labor.workweekConfigs.list({ limit: 1, - cursor: "cursor" + cursor: "cursor", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page let page = await client.labor.workweekConfigs.list({ limit: 1, - cursor: "cursor" + cursor: "cursor", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -19039,22 +18157,21 @@ const response = page.response;
-**request:** `Square.labor.ListWorkweekConfigsRequest` - +**request:** `Square.labor.ListWorkweekConfigsRequest` +
-**requestOptions:** `WorkweekConfigsClient.RequestOptions` - +**requestOptions:** `WorkweekConfigs.RequestOptions` +
-
@@ -19072,6 +18189,7 @@ const response = page.response;
Updates a `WorkweekConfig`. +
@@ -19091,11 +18209,11 @@ await client.labor.workweekConfigs.get({ workweekConfig: { startOfWeek: "MON", startOfDayLocalTime: "10:00", - version: 10 - } + version: 10, + }, }); - ``` + @@ -19109,28 +18227,28 @@ await client.labor.workweekConfigs.get({
-**request:** `Square.labor.UpdateWorkweekConfigRequest` - +**request:** `Square.labor.UpdateWorkweekConfigRequest` +
-**requestOptions:** `WorkweekConfigsClient.RequestOptions` - +**requestOptions:** `WorkweekConfigs.RequestOptions` +
-
## Locations CustomAttributeDefinitions -
client.locations.customAttributeDefinitions.list({ ...params }) -> core.Page + +
client.locations.customAttributeDefinitions.list({ ...params }) -> core.Page<Square.CustomAttributeDefinition>
@@ -19146,6 +18264,7 @@ Lists the location-related [custom attribute definitions](entity:CustomAttribute When all response pages are retrieved, the results include all custom attribute definitions that are visible to the requesting application, including those that are created by other applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. +
@@ -19160,12 +18279,12 @@ applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`
```typescript -const pageableResponse = await client.locations.customAttributeDefinitions.list({ +const response = await client.locations.customAttributeDefinitions.list({ visibilityFilter: "ALL", limit: 1, - cursor: "cursor" + cursor: "cursor", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -19173,16 +18292,13 @@ for await (const item of pageableResponse) { let page = await client.locations.customAttributeDefinitions.list({ visibilityFilter: "ALL", limit: 1, - cursor: "cursor" + cursor: "cursor", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -19196,22 +18312,21 @@ const response = page.response;
-**request:** `Square.locations.ListCustomAttributeDefinitionsRequest` - +**request:** `Square.locations.ListCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
-
@@ -19235,6 +18350,7 @@ for a custom attribute. After the definition is created, you can call [UpsertLocationCustomAttribute](api-endpoint:LocationCustomAttributes-UpsertLocationCustomAttribute) or [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) to set the custom attribute for locations. + @@ -19253,15 +18369,15 @@ await client.locations.customAttributeDefinitions.create({ customAttributeDefinition: { key: "bestseller", schema: { - "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String", }, name: "Bestseller", description: "Bestselling item at location", - visibility: "VISIBILITY_READ_WRITE_VALUES" - } + visibility: "VISIBILITY_READ_WRITE_VALUES", + }, }); - ``` + @@ -19275,22 +18391,21 @@ await client.locations.customAttributeDefinitions.create({
-**request:** `Square.locations.CreateLocationCustomAttributeDefinitionRequest` - +**request:** `Square.locations.CreateLocationCustomAttributeDefinitionRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
-
@@ -19310,6 +18425,7 @@ await client.locations.customAttributeDefinitions.create({ Retrieves a location-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. To retrieve a custom attribute definition created by another application, the `visibility` setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + @@ -19326,10 +18442,10 @@ setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. ```typescript await client.locations.customAttributeDefinitions.get({ key: "key", - version: 1 + version: 1, }); - ``` + @@ -19343,22 +18459,21 @@ await client.locations.customAttributeDefinitions.get({
-**request:** `Square.locations.GetCustomAttributeDefinitionsRequest` - +**request:** `Square.locations.GetCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
- @@ -19379,6 +18494,7 @@ Updates a location-related [custom attribute definition](entity:CustomAttributeD Use this endpoint to update the following fields: `name`, `description`, `visibility`, or the `schema` for a `Selection` data type. Only the definition owner can update a custom attribute definition. + @@ -19397,11 +18513,11 @@ await client.locations.customAttributeDefinitions.update({ key: "key", customAttributeDefinition: { description: "Update the description as desired.", - visibility: "VISIBILITY_READ_ONLY" - } + visibility: "VISIBILITY_READ_ONLY", + }, }); - ``` + @@ -19415,22 +18531,21 @@ await client.locations.customAttributeDefinitions.update({
-**request:** `Square.locations.UpdateLocationCustomAttributeDefinitionRequest` - +**request:** `Square.locations.UpdateLocationCustomAttributeDefinitionRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
- @@ -19451,6 +18566,7 @@ Deletes a location-related [custom attribute definition](entity:CustomAttributeD Deleting a custom attribute definition also deletes the corresponding custom attribute from all locations. Only the definition owner can delete a custom attribute definition. + @@ -19466,10 +18582,10 @@ Only the definition owner can delete a custom attribute definition. ```typescript await client.locations.customAttributeDefinitions.delete({ - key: "key" + key: "key", }); - ``` + @@ -19483,27 +18599,27 @@ await client.locations.customAttributeDefinitions.delete({
-**request:** `Square.locations.DeleteCustomAttributeDefinitionsRequest` - +**request:** `Square.locations.DeleteCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
- ## Locations CustomAttributes +
client.locations.customAttributes.batchDelete({ ...params }) -> Square.BulkDeleteLocationCustomAttributesResponse
@@ -19519,6 +18635,7 @@ await client.locations.customAttributeDefinitions.delete({ Deletes [custom attributes](entity:CustomAttribute) for locations as a bulk operation. To delete a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. +
@@ -19535,19 +18652,19 @@ To delete a custom attribute owned by another application, the `visibility` sett ```typescript await client.locations.customAttributes.batchDelete({ values: { - "id1": { - key: "bestseller" + id1: { + key: "bestseller", }, - "id2": { - key: "bestseller" + id2: { + key: "bestseller", }, - "id3": { - key: "phone-number" - } - } + id3: { + key: "phone-number", + }, + }, }); - ``` + @@ -19561,22 +18678,21 @@ await client.locations.customAttributes.batchDelete({
-**request:** `Square.locations.BulkDeleteLocationCustomAttributesRequest` - +**request:** `Square.locations.BulkDeleteLocationCustomAttributesRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
-
@@ -19603,6 +18719,7 @@ and provides a location ID and custom attribute. Each upsert response is returne of the corresponding request. To create or update a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. + @@ -19619,31 +18736,31 @@ must be `VISIBILITY_READ_WRITE_VALUES`. ```typescript await client.locations.customAttributes.batchUpsert({ values: { - "id1": { + id1: { locationId: "L0TBCBTB7P8RQ", customAttribute: { key: "bestseller", - value: "hot cocoa" - } + value: "hot cocoa", + }, }, - "id2": { + id2: { locationId: "L9XMD04V3STJX", customAttribute: { key: "bestseller", - value: "berry smoothie" - } + value: "berry smoothie", + }, }, - "id3": { + id3: { locationId: "L0TBCBTB7P8RQ", customAttribute: { key: "phone-number", - value: "+12223334444" - } - } - } + value: "+12223334444", + }, + }, + }, }); - ``` + @@ -19657,27 +18774,26 @@ await client.locations.customAttributes.batchUpsert({
-**request:** `Square.locations.BulkUpsertLocationCustomAttributesRequest` - +**request:** `Square.locations.BulkUpsertLocationCustomAttributesRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
- -
client.locations.customAttributes.list({ ...params }) -> core.Page +
client.locations.customAttributes.list({ ...params }) -> core.Page<Square.CustomAttribute>
@@ -19695,6 +18811,7 @@ in the same call. When all response pages are retrieved, the results include all custom attributes that are visible to the requesting application, including those that are owned by other applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. +
@@ -19709,14 +18826,14 @@ and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.
```typescript -const pageableResponse = await client.locations.customAttributes.list({ +const response = await client.locations.customAttributes.list({ locationId: "location_id", visibilityFilter: "ALL", limit: 1, cursor: "cursor", - withDefinitions: true + withDefinitions: true, }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -19726,16 +18843,13 @@ let page = await client.locations.customAttributes.list({ visibilityFilter: "ALL", limit: 1, cursor: "cursor", - withDefinitions: true + withDefinitions: true, }); while (page.hasNextPage()) { page = page.getNextPage(); -} - -// You can also access the underlying response -const response = page.response; - +} ``` +
@@ -19749,22 +18863,21 @@ const response = page.response;
-**request:** `Square.locations.ListCustomAttributesRequest` - +**request:** `Square.locations.ListCustomAttributesRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
-
@@ -19786,6 +18899,7 @@ You can use the `with_definition` query parameter to also retrieve the custom at in the same call. To retrieve a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + @@ -19804,10 +18918,10 @@ await client.locations.customAttributes.get({ locationId: "location_id", key: "key", withDefinition: true, - version: 1 + version: 1, }); - ``` + @@ -19821,22 +18935,21 @@ await client.locations.customAttributes.get({
-**request:** `Square.locations.GetCustomAttributesRequest` - +**request:** `Square.locations.GetCustomAttributesRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
-
@@ -19859,6 +18972,7 @@ A custom attribute is based on a custom attribute definition in a Square seller is created using the [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) endpoint. To create or update a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. + @@ -19877,11 +18991,11 @@ await client.locations.customAttributes.upsert({ locationId: "location_id", key: "key", customAttribute: { - value: "hot cocoa" - } + value: "hot cocoa", + }, }); - ``` + @@ -19895,22 +19009,21 @@ await client.locations.customAttributes.upsert({
-**request:** `Square.locations.UpsertLocationCustomAttributeRequest` - +**request:** `Square.locations.UpsertLocationCustomAttributeRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
- @@ -19930,6 +19043,7 @@ await client.locations.customAttributes.upsert({ Deletes a [custom attribute](entity:CustomAttribute) associated with a location. To delete a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. + @@ -19946,10 +19060,10 @@ To delete a custom attribute owned by another application, the `visibility` sett ```typescript await client.locations.customAttributes.delete({ locationId: "location_id", - key: "key" + key: "key", }); - ``` + @@ -19963,27 +19077,27 @@ await client.locations.customAttributes.delete({
-**request:** `Square.locations.DeleteCustomAttributesRequest` - +**request:** `Square.locations.DeleteCustomAttributesRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
- ## Locations Transactions +
client.locations.transactions.list({ ...params }) -> Square.ListTransactionsResponse
@@ -20002,6 +19116,7 @@ Transactions include payment information from sales and exchanges and refund information from returns and exchanges. Max results per [page](https://developer.squareup.com/docs/working-with-apis/pagination): 50 +
@@ -20021,10 +19136,10 @@ await client.locations.transactions.list({ beginTime: "begin_time", endTime: "end_time", sortOrder: "DESC", - cursor: "cursor" + cursor: "cursor", }); - ``` + @@ -20038,22 +19153,21 @@ await client.locations.transactions.list({
-**request:** `Square.locations.ListTransactionsRequest` - +**request:** `Square.locations.ListTransactionsRequest` +
-**requestOptions:** `TransactionsClient.RequestOptions` - +**requestOptions:** `Transactions.RequestOptions` +
-
@@ -20071,6 +19185,7 @@ await client.locations.transactions.list({
Retrieves details for a single transaction. +
@@ -20087,10 +19202,10 @@ Retrieves details for a single transaction. ```typescript await client.locations.transactions.get({ locationId: "location_id", - transactionId: "transaction_id" + transactionId: "transaction_id", }); - ``` + @@ -20104,22 +19219,21 @@ await client.locations.transactions.get({
-**request:** `Square.locations.GetTransactionsRequest` - +**request:** `Square.locations.GetTransactionsRequest` +
-**requestOptions:** `TransactionsClient.RequestOptions` - +**requestOptions:** `Transactions.RequestOptions` +
- @@ -20139,9 +19253,9 @@ await client.locations.transactions.get({ Captures a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) endpoint with a `delay_capture` value of `true`. - See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) for more information. + @@ -20158,10 +19272,10 @@ for more information. ```typescript await client.locations.transactions.capture({ locationId: "location_id", - transactionId: "transaction_id" + transactionId: "transaction_id", }); - ``` + @@ -20175,22 +19289,21 @@ await client.locations.transactions.capture({
-**request:** `Square.locations.CaptureTransactionsRequest` - +**request:** `Square.locations.CaptureTransactionsRequest` +
-**requestOptions:** `TransactionsClient.RequestOptions` - +**requestOptions:** `Transactions.RequestOptions` +
- @@ -20210,9 +19323,9 @@ await client.locations.transactions.capture({ Cancels a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) endpoint with a `delay_capture` value of `true`. - See [Delayed capture transactions](https://developer.squareup.com/docs/payments/transactions/overview#delayed-capture) for more information. + @@ -20229,10 +19342,10 @@ for more information. ```typescript await client.locations.transactions.void({ locationId: "location_id", - transactionId: "transaction_id" + transactionId: "transaction_id", }); - ``` + @@ -20246,27 +19359,27 @@ await client.locations.transactions.void({
-**request:** `Square.locations.VoidTransactionsRequest` - +**request:** `Square.locations.VoidTransactionsRequest` +
-**requestOptions:** `TransactionsClient.RequestOptions` - +**requestOptions:** `Transactions.RequestOptions` +
- ## Loyalty Accounts +
client.loyalty.accounts.create({ ...params }) -> Square.CreateLoyaltyAccountResponse
@@ -20280,6 +19393,7 @@ await client.locations.transactions.void({
Creates a loyalty account. To create a loyalty account, you must provide the `program_id` and a `mapping` with the `phone_number` of the buyer. +
@@ -20298,13 +19412,13 @@ await client.loyalty.accounts.create({ loyaltyAccount: { programId: "d619f755-2d17-41f3-990d-c04ecedd64dd", mapping: { - phoneNumber: "+14155551234" - } + phoneNumber: "+14155551234", + }, }, - idempotencyKey: "ec78c477-b1c3-4899-a209-a4e71337c996" + idempotencyKey: "ec78c477-b1c3-4899-a209-a4e71337c996", }); - ``` + @@ -20318,22 +19432,21 @@ await client.loyalty.accounts.create({
-**request:** `Square.loyalty.CreateLoyaltyAccountRequest` - +**request:** `Square.loyalty.CreateLoyaltyAccountRequest` +
-**requestOptions:** `AccountsClient.RequestOptions` - +**requestOptions:** `Accounts.RequestOptions` +
-
@@ -20355,6 +19468,7 @@ Searches for loyalty accounts in a loyalty program. You can search for a loyalty account using the phone number or customer ID associated with the account. To return all loyalty accounts, specify an empty `query` object or omit it entirely. Search results are sorted by `created_at` in ascending order. + @@ -20371,14 +19485,16 @@ Search results are sorted by `created_at` in ascending order. ```typescript await client.loyalty.accounts.search({ query: { - mappings: [{ - phoneNumber: "+14155551234" - }] + mappings: [ + { + phoneNumber: "+14155551234", + }, + ], }, - limit: 10 + limit: 10, }); - ``` + @@ -20392,22 +19508,21 @@ await client.loyalty.accounts.search({
-**request:** `Square.loyalty.SearchLoyaltyAccountsRequest` - +**request:** `Square.loyalty.SearchLoyaltyAccountsRequest` +
-**requestOptions:** `AccountsClient.RequestOptions` - +**requestOptions:** `Accounts.RequestOptions` +
- @@ -20425,6 +19540,7 @@ await client.loyalty.accounts.search({
Retrieves a loyalty account. +
@@ -20440,10 +19556,10 @@ Retrieves a loyalty account. ```typescript await client.loyalty.accounts.get({ - accountId: "account_id" + accountId: "account_id", }); - ``` + @@ -20457,22 +19573,21 @@ await client.loyalty.accounts.get({
-**request:** `Square.loyalty.GetAccountsRequest` - +**request:** `Square.loyalty.GetAccountsRequest` +
-**requestOptions:** `AccountsClient.RequestOptions` - +**requestOptions:** `Accounts.RequestOptions` +
- @@ -20492,21 +19607,21 @@ await client.loyalty.accounts.get({ Adds points earned from a purchase to a [loyalty account](entity:LoyaltyAccount). - If you are using the Orders API to manage orders, provide the `order_id`. Square reads the order -to compute the points earned from both the base loyalty program and an associated -[loyalty promotion](entity:LoyaltyPromotion). For purchases that qualify for multiple accrual -rules, Square computes points based on the accrual rule that grants the most points. -For purchases that qualify for multiple promotions, Square computes points based on the most -recently created promotion. A purchase must first qualify for program points to be eligible for promotion points. + to compute the points earned from both the base loyalty program and an associated + [loyalty promotion](entity:LoyaltyPromotion). For purchases that qualify for multiple accrual + rules, Square computes points based on the accrual rule that grants the most points. + For purchases that qualify for multiple promotions, Square computes points based on the most + recently created promotion. A purchase must first qualify for program points to be eligible for promotion points. - If you are not using the Orders API to manage orders, provide `points` with the number of points to add. You must first perform a client-side computation of the points earned from the loyalty program and loyalty promotion. For spend-based and visit-based programs, you can call [CalculateLoyaltyPoints](api-endpoint:Loyalty-CalculateLoyaltyPoints) to compute the points earned from the base loyalty program. For information about computing points earned from a loyalty promotion, see [Calculating promotion points](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#calculate-promotion-points). - - - - + + + + #### 🔌 Usage @@ -20520,13 +19635,13 @@ to compute the points earned from the base loyalty program. For information abou await client.loyalty.accounts.accumulatePoints({ accountId: "account_id", accumulatePoints: { - orderId: "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY" + orderId: "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY", }, idempotencyKey: "58b90739-c3e8-4b11-85f7-e636d48d72cb", - locationId: "P034NEENMD09F" + locationId: "P034NEENMD09F", }); - ``` + @@ -20540,22 +19655,21 @@ await client.loyalty.accounts.accumulatePoints({
-**request:** `Square.loyalty.AccumulateLoyaltyPointsRequest` - +**request:** `Square.loyalty.AccumulateLoyaltyPointsRequest` +
-**requestOptions:** `AccountsClient.RequestOptions` - +**requestOptions:** `Accounts.RequestOptions` +
- @@ -20577,6 +19691,7 @@ Adds points to or subtracts points from a buyer's account. Use this endpoint only when you need to manually adjust points. Otherwise, in your application flow, you call [AccumulateLoyaltyPoints](api-endpoint:Loyalty-AccumulateLoyaltyPoints) to add points when a buyer pays for the purchase. + @@ -20596,11 +19711,11 @@ await client.loyalty.accounts.adjust({ idempotencyKey: "bc29a517-3dc9-450e-aa76-fae39ee849d1", adjustPoints: { points: 10, - reason: "Complimentary points" - } + reason: "Complimentary points", + }, }); - ``` + @@ -20614,27 +19729,27 @@ await client.loyalty.accounts.adjust({
-**request:** `Square.loyalty.AdjustLoyaltyPointsRequest` - +**request:** `Square.loyalty.AdjustLoyaltyPointsRequest` +
-**requestOptions:** `AccountsClient.RequestOptions` - +**requestOptions:** `Accounts.RequestOptions` +
- ## Loyalty Programs +
client.loyalty.programs.list() -> Square.ListLoyaltyProgramsResponse
@@ -20650,8 +19765,8 @@ await client.loyalty.accounts.adjust({ Returns a list of loyalty programs in the seller's account. Loyalty programs define how buyers can earn points and redeem points for rewards. Square sellers can have only one loyalty program, which is created and managed from the Seller Dashboard. For more information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview). - Replaced with [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) when used with the keyword `main`. +
@@ -20667,8 +19782,8 @@ Replaced with [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgr ```typescript await client.loyalty.programs.list(); - ``` + @@ -20682,14 +19797,13 @@ await client.loyalty.programs.list();
-**requestOptions:** `ProgramsClient.RequestOptions` - +**requestOptions:** `Programs.RequestOptions` +
-
@@ -20709,6 +19823,7 @@ await client.loyalty.programs.list(); Retrieves the loyalty program in a seller's account, specified by the program ID or the keyword `main`. Loyalty programs define how buyers can earn points and redeem points for rewards. Square sellers can have only one loyalty program, which is created and managed from the Seller Dashboard. For more information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview). + @@ -20724,10 +19839,10 @@ Loyalty programs define how buyers can earn points and redeem points for rewards ```typescript await client.loyalty.programs.get({ - programId: "program_id" + programId: "program_id", }); - ``` + @@ -20741,22 +19856,21 @@ await client.loyalty.programs.get({
-**request:** `Square.loyalty.GetProgramsRequest` - +**request:** `Square.loyalty.GetProgramsRequest` +
-**requestOptions:** `ProgramsClient.RequestOptions` - +**requestOptions:** `Programs.RequestOptions` +
- @@ -20777,8 +19891,8 @@ Calculates the number of points a buyer can earn from a purchase. Applications m to display the points to the buyer. - If you are using the Orders API to manage orders, provide the `order_id` and (optional) `loyalty_account_id`. -Square reads the order to compute the points earned from the base loyalty program and an associated -[loyalty promotion](entity:LoyaltyPromotion). + Square reads the order to compute the points earned from the base loyalty program and an associated + [loyalty promotion](entity:LoyaltyPromotion). - If you are not using the Orders API to manage orders, provide `transaction_amount_money` with the purchase amount. Square uses this amount to calculate the points earned from the base loyalty program, @@ -20788,10 +19902,10 @@ If the purchase qualifies for program points, call [ListLoyaltyPromotions](api-endpoint:Loyalty-ListLoyaltyPromotions) and perform a client-side computation to calculate whether the purchase also qualifies for promotion points. For more information, see [Calculating promotion points](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#calculate-promotion-points). - - - - + + + + #### 🔌 Usage @@ -20805,10 +19919,10 @@ to calculate whether the purchase also qualifies for promotion points. For more await client.loyalty.programs.calculate({ programId: "program_id", orderId: "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY", - loyaltyAccountId: "79b807d2-d786-46a9-933b-918028d7a8c5" + loyaltyAccountId: "79b807d2-d786-46a9-933b-918028d7a8c5", }); - ``` + @@ -20822,27 +19936,27 @@ await client.loyalty.programs.calculate({
-**request:** `Square.loyalty.CalculateLoyaltyPointsRequest` - +**request:** `Square.loyalty.CalculateLoyaltyPointsRequest` +
-**requestOptions:** `ProgramsClient.RequestOptions` - +**requestOptions:** `Programs.RequestOptions` +
- ## Loyalty Rewards +
client.loyalty.rewards.create({ ...params }) -> Square.CreateLoyaltyRewardResponse
@@ -20858,11 +19972,12 @@ await client.loyalty.programs.calculate({ Creates a loyalty reward. In the process, the endpoint does following: - Uses the `reward_tier_id` in the request to determine the number of points -to lock for this reward. + to lock for this reward. - If the request includes `order_id`, it adds the reward and related discount to the order. After a reward is created, the points are locked and not available for the buyer to redeem another reward. +
@@ -20881,12 +19996,12 @@ await client.loyalty.rewards.create({ reward: { loyaltyAccountId: "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", rewardTierId: "e1b39225-9da5-43d1-a5db-782cdd8ad94f", - orderId: "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY" + orderId: "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY", }, - idempotencyKey: "18c2e5ea-a620-4b1f-ad60-7b167285e451" + idempotencyKey: "18c2e5ea-a620-4b1f-ad60-7b167285e451", }); - ``` + @@ -20900,22 +20015,21 @@ await client.loyalty.rewards.create({
-**request:** `Square.loyalty.CreateLoyaltyRewardRequest` - +**request:** `Square.loyalty.CreateLoyaltyRewardRequest` +
-**requestOptions:** `RewardsClient.RequestOptions` - +**requestOptions:** `Rewards.RequestOptions` +
-
@@ -20933,12 +20047,13 @@ await client.loyalty.rewards.create({
Searches for loyalty rewards. This endpoint accepts a request with no query filters and returns results for all loyalty accounts. -If you include a `query` object, `loyalty_account_id` is required and `status` is optional. +If you include a `query` object, `loyalty_account_id` is required and `status` is optional. If you know a reward ID, use the [RetrieveLoyaltyReward](api-endpoint:Loyalty-RetrieveLoyaltyReward) endpoint. Search results are sorted by `updated_at` in descending order. +
@@ -20955,12 +20070,12 @@ Search results are sorted by `updated_at` in descending order. ```typescript await client.loyalty.rewards.search({ query: { - loyaltyAccountId: "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd" + loyaltyAccountId: "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", }, - limit: 10 + limit: 10, }); - ``` + @@ -20974,22 +20089,21 @@ await client.loyalty.rewards.search({
-**request:** `Square.loyalty.SearchLoyaltyRewardsRequest` - +**request:** `Square.loyalty.SearchLoyaltyRewardsRequest` +
-**requestOptions:** `RewardsClient.RequestOptions` - +**requestOptions:** `Rewards.RequestOptions` +
- @@ -21007,6 +20121,7 @@ await client.loyalty.rewards.search({
Retrieves a loyalty reward. +
@@ -21022,10 +20137,10 @@ Retrieves a loyalty reward. ```typescript await client.loyalty.rewards.get({ - rewardId: "reward_id" + rewardId: "reward_id", }); - ``` + @@ -21039,22 +20154,21 @@ await client.loyalty.rewards.get({
-**request:** `Square.loyalty.GetRewardsRequest` - +**request:** `Square.loyalty.GetRewardsRequest` +
-**requestOptions:** `RewardsClient.RequestOptions` - +**requestOptions:** `Rewards.RequestOptions` +
- @@ -21075,11 +20189,12 @@ Deletes a loyalty reward by doing the following: - Returns the loyalty points back to the loyalty account. - If an order ID was specified when the reward was created -(see [CreateLoyaltyReward](api-endpoint:Loyalty-CreateLoyaltyReward)), -it updates the order by removing the reward and related -discounts. + (see [CreateLoyaltyReward](api-endpoint:Loyalty-CreateLoyaltyReward)), + it updates the order by removing the reward and related + discounts. You cannot delete a reward that has reached the terminal state (REDEEMED). + @@ -21095,10 +20210,10 @@ You cannot delete a reward that has reached the terminal state (REDEEMED). ```typescript await client.loyalty.rewards.delete({ - rewardId: "reward_id" + rewardId: "reward_id", }); - ``` + @@ -21112,22 +20227,21 @@ await client.loyalty.rewards.delete({
-**request:** `Square.loyalty.DeleteRewardsRequest` - +**request:** `Square.loyalty.DeleteRewardsRequest` +
-**requestOptions:** `RewardsClient.RequestOptions` - +**requestOptions:** `Rewards.RequestOptions` +
- @@ -21155,6 +20269,7 @@ purchase. After the reward reaches the terminal state, it cannot be deleted. In other words, points used for the reward cannot be returned to the account. + @@ -21172,10 +20287,10 @@ to the account. await client.loyalty.rewards.redeem({ rewardId: "reward_id", idempotencyKey: "98adc7f7-6963-473b-b29c-f3c9cdd7d994", - locationId: "P034NEENMD09F" + locationId: "P034NEENMD09F", }); - ``` + @@ -21189,28 +20304,28 @@ await client.loyalty.rewards.redeem({
-**request:** `Square.loyalty.RedeemLoyaltyRewardRequest` - +**request:** `Square.loyalty.RedeemLoyaltyRewardRequest` +
-**requestOptions:** `RewardsClient.RequestOptions` - +**requestOptions:** `Rewards.RequestOptions` +
- ## Loyalty Programs Promotions -
client.loyalty.programs.promotions.list({ ...params }) -> core.Page + +
client.loyalty.programs.promotions.list({ ...params }) -> core.Page<Square.LoyaltyPromotion>
@@ -21224,6 +20339,7 @@ await client.loyalty.rewards.redeem({ Lists the loyalty promotions associated with a [loyalty program](entity:LoyaltyProgram). Results are sorted by the `created_at` date in descending order (newest to oldest). +
@@ -21238,13 +20354,13 @@ Results are sorted by the `created_at` date in descending order (newest to oldes
```typescript -const pageableResponse = await client.loyalty.programs.promotions.list({ +const response = await client.loyalty.programs.promotions.list({ programId: "program_id", status: "ACTIVE", cursor: "cursor", - limit: 1 + limit: 1, }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -21253,16 +20369,13 @@ let page = await client.loyalty.programs.promotions.list({ programId: "program_id", status: "ACTIVE", cursor: "cursor", - limit: 1 + limit: 1, }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -21276,22 +20389,21 @@ const response = page.response;
-**request:** `Square.loyalty.programs.ListPromotionsRequest` - +**request:** `Square.loyalty.programs.ListPromotionsRequest` +
-**requestOptions:** `PromotionsClient.RequestOptions` - +**requestOptions:** `Promotions.RequestOptions` +
-
@@ -21314,6 +20426,7 @@ enables buyers to earn points in addition to those earned from the base loyalty This endpoint sets the loyalty promotion to the `ACTIVE` or `SCHEDULED` status, depending on the `available_time` setting. A loyalty program can have a maximum of 10 loyalty promotions with an `ACTIVE` or `SCHEDULED` status. + @@ -21335,26 +20448,28 @@ await client.loyalty.programs.promotions.create({ incentive: { type: "POINTS_MULTIPLIER", pointsMultiplierData: { - multiplier: "3.0" - } + multiplier: "3.0", + }, }, availableTime: { - timePeriods: ["BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT"] + timePeriods: [ + "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT", + ], }, triggerLimit: { times: 1, - interval: "DAY" + interval: "DAY", }, minimumSpendAmountMoney: { amount: BigInt("2000"), - currency: "USD" + currency: "USD", }, - qualifyingCategoryIds: ["XTQPYLR3IIU9C44VRCB3XD12"] + qualifyingCategoryIds: ["XTQPYLR3IIU9C44VRCB3XD12"], }, - idempotencyKey: "ec78c477-b1c3-4899-a209-a4e71337c996" + idempotencyKey: "ec78c477-b1c3-4899-a209-a4e71337c996", }); - ``` + @@ -21368,22 +20483,21 @@ await client.loyalty.programs.promotions.create({
-**request:** `Square.loyalty.programs.CreateLoyaltyPromotionRequest` - +**request:** `Square.loyalty.programs.CreateLoyaltyPromotionRequest` +
-**requestOptions:** `PromotionsClient.RequestOptions` - +**requestOptions:** `Promotions.RequestOptions` +
-
@@ -21401,6 +20515,7 @@ await client.loyalty.programs.promotions.create({
Retrieves a loyalty promotion. +
@@ -21417,10 +20532,10 @@ Retrieves a loyalty promotion. ```typescript await client.loyalty.programs.promotions.get({ programId: "program_id", - promotionId: "promotion_id" + promotionId: "promotion_id", }); - ``` + @@ -21434,22 +20549,21 @@ await client.loyalty.programs.promotions.get({
-**request:** `Square.loyalty.programs.GetPromotionsRequest` - +**request:** `Square.loyalty.programs.GetPromotionsRequest` +
-**requestOptions:** `PromotionsClient.RequestOptions` - +**requestOptions:** `Promotions.RequestOptions` +
- @@ -21472,6 +20586,7 @@ Because updating a promotion is not supported, you can also use this endpoint to you create a new one. This endpoint sets the loyalty promotion to the `CANCELED` state + @@ -21488,10 +20603,10 @@ This endpoint sets the loyalty promotion to the `CANCELED` state ```typescript await client.loyalty.programs.promotions.cancel({ programId: "program_id", - promotionId: "promotion_id" + promotionId: "promotion_id", }); - ``` + @@ -21505,28 +20620,28 @@ await client.loyalty.programs.promotions.cancel({
-**request:** `Square.loyalty.programs.CancelPromotionsRequest` - +**request:** `Square.loyalty.programs.CancelPromotionsRequest` +
-**requestOptions:** `PromotionsClient.RequestOptions` - +**requestOptions:** `Promotions.RequestOptions` +
- ## Merchants CustomAttributeDefinitions -
client.merchants.customAttributeDefinitions.list({ ...params }) -> core.Page + +
client.merchants.customAttributeDefinitions.list({ ...params }) -> core.Page<Square.CustomAttributeDefinition>
@@ -21542,6 +20657,7 @@ Lists the merchant-related [custom attribute definitions](entity:CustomAttribute When all response pages are retrieved, the results include all custom attribute definitions that are visible to the requesting application, including those that are created by other applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. +
@@ -21556,12 +20672,12 @@ applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`
```typescript -const pageableResponse = await client.merchants.customAttributeDefinitions.list({ +const response = await client.merchants.customAttributeDefinitions.list({ visibilityFilter: "ALL", limit: 1, - cursor: "cursor" + cursor: "cursor", }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -21569,16 +20685,13 @@ for await (const item of pageableResponse) { let page = await client.merchants.customAttributeDefinitions.list({ visibilityFilter: "ALL", limit: 1, - cursor: "cursor" + cursor: "cursor", }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -21592,22 +20705,21 @@ const response = page.response;
-**request:** `Square.merchants.ListCustomAttributeDefinitionsRequest` - +**request:** `Square.merchants.ListCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
-
@@ -21631,6 +20743,7 @@ for a custom attribute. After the definition is created, you can call [UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute) or [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) to set the custom attribute for a merchant. + @@ -21649,15 +20762,15 @@ await client.merchants.customAttributeDefinitions.create({ customAttributeDefinition: { key: "alternative_seller_name", schema: { - "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String" + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String", }, name: "Alternative Merchant Name", description: "This is the other name this merchant goes by.", - visibility: "VISIBILITY_READ_ONLY" - } + visibility: "VISIBILITY_READ_ONLY", + }, }); - ``` + @@ -21671,22 +20784,21 @@ await client.merchants.customAttributeDefinitions.create({
-**request:** `Square.merchants.CreateMerchantCustomAttributeDefinitionRequest` - +**request:** `Square.merchants.CreateMerchantCustomAttributeDefinitionRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
-
@@ -21706,6 +20818,7 @@ await client.merchants.customAttributeDefinitions.create({ Retrieves a merchant-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. To retrieve a custom attribute definition created by another application, the `visibility` setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + @@ -21722,10 +20835,10 @@ setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. ```typescript await client.merchants.customAttributeDefinitions.get({ key: "key", - version: 1 + version: 1, }); - ``` + @@ -21739,22 +20852,21 @@ await client.merchants.customAttributeDefinitions.get({
-**request:** `Square.merchants.GetCustomAttributeDefinitionsRequest` - +**request:** `Square.merchants.GetCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
- @@ -21775,6 +20887,7 @@ Updates a merchant-related [custom attribute definition](entity:CustomAttributeD Use this endpoint to update the following fields: `name`, `description`, `visibility`, or the `schema` for a `Selection` data type. Only the definition owner can update a custom attribute definition. + @@ -21793,11 +20906,11 @@ await client.merchants.customAttributeDefinitions.update({ key: "key", customAttributeDefinition: { description: "Update the description as desired.", - visibility: "VISIBILITY_READ_ONLY" - } + visibility: "VISIBILITY_READ_ONLY", + }, }); - ``` + @@ -21811,22 +20924,21 @@ await client.merchants.customAttributeDefinitions.update({
-**request:** `Square.merchants.UpdateMerchantCustomAttributeDefinitionRequest` - +**request:** `Square.merchants.UpdateMerchantCustomAttributeDefinitionRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
- @@ -21847,6 +20959,7 @@ Deletes a merchant-related [custom attribute definition](entity:CustomAttributeD Deleting a custom attribute definition also deletes the corresponding custom attribute from the merchant. Only the definition owner can delete a custom attribute definition. + @@ -21862,10 +20975,10 @@ Only the definition owner can delete a custom attribute definition. ```typescript await client.merchants.customAttributeDefinitions.delete({ - key: "key" + key: "key", }); - ``` + @@ -21879,27 +20992,27 @@ await client.merchants.customAttributeDefinitions.delete({
-**request:** `Square.merchants.DeleteCustomAttributeDefinitionsRequest` - +**request:** `Square.merchants.DeleteCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
- ## Merchants CustomAttributes +
client.merchants.customAttributes.batchDelete({ ...params }) -> Square.BulkDeleteMerchantCustomAttributesResponse
@@ -21915,6 +21028,7 @@ await client.merchants.customAttributeDefinitions.delete({ Deletes [custom attributes](entity:CustomAttribute) for a merchant as a bulk operation. To delete a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. +
@@ -21931,16 +21045,16 @@ To delete a custom attribute owned by another application, the `visibility` sett ```typescript await client.merchants.customAttributes.batchDelete({ values: { - "id1": { - key: "alternative_seller_name" + id1: { + key: "alternative_seller_name", }, - "id2": { - key: "has_seen_tutorial" - } - } + id2: { + key: "has_seen_tutorial", + }, + }, }); - ``` + @@ -21954,22 +21068,21 @@ await client.merchants.customAttributes.batchDelete({
-**request:** `Square.merchants.BulkDeleteMerchantCustomAttributesRequest` - +**request:** `Square.merchants.BulkDeleteMerchantCustomAttributesRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
-
@@ -21996,6 +21109,7 @@ and provides a merchant ID and custom attribute. Each upsert response is returne of the corresponding request. To create or update a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. + @@ -22012,24 +21126,24 @@ must be `VISIBILITY_READ_WRITE_VALUES`. ```typescript await client.merchants.customAttributes.batchUpsert({ values: { - "id1": { + id1: { merchantId: "DM7VKY8Q63GNP", customAttribute: { key: "alternative_seller_name", - value: "Ultimate Sneaker Store" - } + value: "Ultimate Sneaker Store", + }, }, - "id2": { + id2: { merchantId: "DM7VKY8Q63GNP", customAttribute: { key: "has_seen_tutorial", - value: true - } - } - } + value: true, + }, + }, + }, }); - ``` + @@ -22043,27 +21157,26 @@ await client.merchants.customAttributes.batchUpsert({
-**request:** `Square.merchants.BulkUpsertMerchantCustomAttributesRequest` - +**request:** `Square.merchants.BulkUpsertMerchantCustomAttributesRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
- -
client.merchants.customAttributes.list({ ...params }) -> core.Page +
client.merchants.customAttributes.list({ ...params }) -> core.Page<Square.CustomAttribute>
@@ -22081,6 +21194,7 @@ in the same call. When all response pages are retrieved, the results include all custom attributes that are visible to the requesting application, including those that are owned by other applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. +
@@ -22095,14 +21209,14 @@ and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.
```typescript -const pageableResponse = await client.merchants.customAttributes.list({ +const response = await client.merchants.customAttributes.list({ merchantId: "merchant_id", visibilityFilter: "ALL", limit: 1, cursor: "cursor", - withDefinitions: true + withDefinitions: true, }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -22112,16 +21226,13 @@ let page = await client.merchants.customAttributes.list({ visibilityFilter: "ALL", limit: 1, cursor: "cursor", - withDefinitions: true + withDefinitions: true, }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -22135,22 +21246,21 @@ const response = page.response;
-**request:** `Square.merchants.ListCustomAttributesRequest` - +**request:** `Square.merchants.ListCustomAttributesRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
-
@@ -22172,6 +21282,7 @@ You can use the `with_definition` query parameter to also retrieve the custom at in the same call. To retrieve a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. + @@ -22190,10 +21301,10 @@ await client.merchants.customAttributes.get({ merchantId: "merchant_id", key: "key", withDefinition: true, - version: 1 + version: 1, }); - ``` + @@ -22207,22 +21318,21 @@ await client.merchants.customAttributes.get({
-**request:** `Square.merchants.GetCustomAttributesRequest` - +**request:** `Square.merchants.GetCustomAttributesRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
-
@@ -22245,6 +21355,7 @@ A custom attribute is based on a custom attribute definition in a Square seller is created using the [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) endpoint. To create or update a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. + @@ -22263,11 +21374,11 @@ await client.merchants.customAttributes.upsert({ merchantId: "merchant_id", key: "key", customAttribute: { - value: "Ultimate Sneaker Store" - } + value: "Ultimate Sneaker Store", + }, }); - ``` + @@ -22281,22 +21392,21 @@ await client.merchants.customAttributes.upsert({
-**request:** `Square.merchants.UpsertMerchantCustomAttributeRequest` - +**request:** `Square.merchants.UpsertMerchantCustomAttributeRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
- @@ -22316,6 +21426,7 @@ await client.merchants.customAttributes.upsert({ Deletes a [custom attribute](entity:CustomAttribute) associated with a merchant. To delete a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. + @@ -22332,10 +21443,10 @@ To delete a custom attribute owned by another application, the `visibility` sett ```typescript await client.merchants.customAttributes.delete({ merchantId: "merchant_id", - key: "key" + key: "key", }); - ``` + @@ -22349,28 +21460,28 @@ await client.merchants.customAttributes.delete({
-**request:** `Square.merchants.DeleteCustomAttributesRequest` - +**request:** `Square.merchants.DeleteCustomAttributesRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
- ## Orders CustomAttributeDefinitions -
client.orders.customAttributeDefinitions.list({ ...params }) -> core.Page + +
client.orders.customAttributeDefinitions.list({ ...params }) -> core.Page<Square.CustomAttributeDefinition>
@@ -22388,6 +21499,7 @@ When all response pages are retrieved, the results include all custom attribute that are visible to the requesting application, including those that are created by other applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. +
@@ -22402,12 +21514,12 @@ seller-defined custom attributes (also known as custom fields) are always set to
```typescript -const pageableResponse = await client.orders.customAttributeDefinitions.list({ +const response = await client.orders.customAttributeDefinitions.list({ visibilityFilter: "ALL", cursor: "cursor", - limit: 1 + limit: 1, }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -22415,16 +21527,13 @@ for await (const item of pageableResponse) { let page = await client.orders.customAttributeDefinitions.list({ visibilityFilter: "ALL", cursor: "cursor", - limit: 1 + limit: 1, }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -22438,22 +21547,21 @@ const response = page.response;
-**request:** `Square.orders.ListCustomAttributeDefinitionsRequest` - +**request:** `Square.orders.ListCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
-
@@ -22470,11 +21578,12 @@ const response = page.response;
-Creates an order-related custom attribute definition. Use this endpoint to +Creates an order-related custom attribute definition. Use this endpoint to define a custom attribute that can be associated with orders. After creating a custom attribute definition, you can set the custom attribute for orders in the Square seller account. +
@@ -22493,16 +21602,16 @@ await client.orders.customAttributeDefinitions.create({ customAttributeDefinition: { key: "cover-count", schema: { - "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number" + $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number", }, name: "Cover count", description: "The number of people seated at a table", - visibility: "VISIBILITY_READ_WRITE_VALUES" + visibility: "VISIBILITY_READ_WRITE_VALUES", }, - idempotencyKey: "IDEMPOTENCY_KEY" + idempotencyKey: "IDEMPOTENCY_KEY", }); - ``` + @@ -22516,22 +21625,21 @@ await client.orders.customAttributeDefinitions.create({
-**request:** `Square.orders.CreateOrderCustomAttributeDefinitionRequest` - +**request:** `Square.orders.CreateOrderCustomAttributeDefinitionRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
-
@@ -22553,6 +21661,7 @@ Retrieves an order-related [custom attribute definition](entity:CustomAttributeD To retrieve a custom attribute definition created by another application, the `visibility` setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + @@ -22569,10 +21678,10 @@ setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note t ```typescript await client.orders.customAttributeDefinitions.get({ key: "key", - version: 1 + version: 1, }); - ``` + @@ -22586,22 +21695,21 @@ await client.orders.customAttributeDefinitions.get({
-**request:** `Square.orders.GetCustomAttributeDefinitionsRequest` - +**request:** `Square.orders.GetCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
- @@ -22621,6 +21729,7 @@ await client.orders.customAttributeDefinitions.get({ Updates an order-related custom attribute definition for a Square seller account. Only the definition owner can update a custom attribute definition. Note that sellers can view all custom attributes in exported customer data, including those set to `VISIBILITY_HIDDEN`. + @@ -22640,12 +21749,12 @@ await client.orders.customAttributeDefinitions.update({ customAttributeDefinition: { key: "cover-count", visibility: "VISIBILITY_READ_ONLY", - version: 1 + version: 1, }, - idempotencyKey: "IDEMPOTENCY_KEY" + idempotencyKey: "IDEMPOTENCY_KEY", }); - ``` + @@ -22659,22 +21768,21 @@ await client.orders.customAttributeDefinitions.update({
-**request:** `Square.orders.UpdateOrderCustomAttributeDefinitionRequest` - +**request:** `Square.orders.UpdateOrderCustomAttributeDefinitionRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
- @@ -22694,6 +21802,7 @@ await client.orders.customAttributeDefinitions.update({ Deletes an order-related [custom attribute definition](entity:CustomAttributeDefinition) from a Square seller account. Only the definition owner can delete a custom attribute definition. + @@ -22709,10 +21818,10 @@ Only the definition owner can delete a custom attribute definition. ```typescript await client.orders.customAttributeDefinitions.delete({ - key: "key" + key: "key", }); - ``` + @@ -22726,27 +21835,27 @@ await client.orders.customAttributeDefinitions.delete({
-**request:** `Square.orders.DeleteCustomAttributeDefinitionsRequest` - +**request:** `Square.orders.DeleteCustomAttributeDefinitionsRequest` +
-**requestOptions:** `CustomAttributeDefinitionsClient.RequestOptions` - +**requestOptions:** `CustomAttributeDefinitions.RequestOptions` +
- ## Orders CustomAttributes +
client.orders.customAttributes.batchDelete({ ...params }) -> Square.BulkDeleteOrderCustomAttributesResponse
@@ -22762,7 +21871,7 @@ await client.orders.customAttributeDefinitions.delete({ Deletes order [custom attributes](entity:CustomAttribute) as a bulk operation. Use this endpoint to delete one or more custom attributes from one or more orders. -A custom attribute is based on a custom attribute definition in a Square seller account. (To create a +A custom attribute is based on a custom attribute definition in a Square seller account. (To create a custom attribute definition, use the [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) endpoint.) This `BulkDeleteOrderCustomAttributes` endpoint accepts a map of 1 to 25 individual delete @@ -22773,6 +21882,7 @@ of the corresponding request. To delete a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. +
@@ -22791,16 +21901,16 @@ await client.orders.customAttributes.batchDelete({ values: { "cover-count": { key: "cover-count", - orderId: "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" + orderId: "7BbXGEIWNldxAzrtGf9GPVZTwZ4F", }, "table-number": { key: "table-number", - orderId: "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" - } - } + orderId: "7BbXGEIWNldxAzrtGf9GPVZTwZ4F", + }, + }, }); - ``` + @@ -22814,22 +21924,21 @@ await client.orders.customAttributes.batchDelete({
-**request:** `Square.orders.BulkDeleteOrderCustomAttributesRequest` - +**request:** `Square.orders.BulkDeleteOrderCustomAttributesRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
-
@@ -22849,7 +21958,7 @@ await client.orders.customAttributes.batchDelete({ Creates or updates order [custom attributes](entity:CustomAttribute) as a bulk operation. Use this endpoint to delete one or more custom attributes from one or more orders. -A custom attribute is based on a custom attribute definition in a Square seller account. (To create a +A custom attribute is based on a custom attribute definition in a Square seller account. (To create a custom attribute definition, use the [CreateOrderCustomAttributeDefinition](api-endpoint:OrderCustomAttributes-CreateOrderCustomAttributeDefinition) endpoint.) This `BulkUpsertOrderCustomAttributes` endpoint accepts a map of 1 to 25 individual upsert @@ -22860,6 +21969,7 @@ of the corresponding request. To create or update a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + @@ -22880,22 +21990,22 @@ await client.orders.customAttributes.batchUpsert({ customAttribute: { key: "cover-count", value: "6", - version: 2 + version: 2, }, - orderId: "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" + orderId: "7BbXGEIWNldxAzrtGf9GPVZTwZ4F", }, "table-number": { customAttribute: { key: "table-number", value: "11", - version: 4 + version: 4, }, - orderId: "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" - } - } + orderId: "7BbXGEIWNldxAzrtGf9GPVZTwZ4F", + }, + }, }); - ``` + @@ -22909,27 +22019,26 @@ await client.orders.customAttributes.batchUpsert({
-**request:** `Square.orders.BulkUpsertOrderCustomAttributesRequest` - +**request:** `Square.orders.BulkUpsertOrderCustomAttributesRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
- -
client.orders.customAttributes.list({ ...params }) -> core.Page +
client.orders.customAttributes.list({ ...params }) -> core.Page<Square.CustomAttribute>
@@ -22949,6 +22058,7 @@ in the same call. When all response pages are retrieved, the results include all custom attributes that are visible to the requesting application, including those that are owned by other applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. +
@@ -22963,14 +22073,14 @@ and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.
```typescript -const pageableResponse = await client.orders.customAttributes.list({ +const response = await client.orders.customAttributes.list({ orderId: "order_id", visibilityFilter: "ALL", cursor: "cursor", limit: 1, - withDefinitions: true + withDefinitions: true, }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -22980,16 +22090,13 @@ let page = await client.orders.customAttributes.list({ visibilityFilter: "ALL", cursor: "cursor", limit: 1, - withDefinitions: true + withDefinitions: true, }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -23003,22 +22110,21 @@ const response = page.response;
-**request:** `Square.orders.ListCustomAttributesRequest` - +**request:** `Square.orders.ListCustomAttributesRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
-
@@ -23043,6 +22149,7 @@ in the same call. To retrieve a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + @@ -23061,10 +22168,10 @@ await client.orders.customAttributes.get({ orderId: "order_id", customAttributeKey: "custom_attribute_key", version: 1, - withDefinition: true + withDefinition: true, }); - ``` + @@ -23078,22 +22185,21 @@ await client.orders.customAttributes.get({
-**request:** `Square.orders.GetCustomAttributesRequest` - +**request:** `Square.orders.GetCustomAttributesRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
-
@@ -23119,6 +22225,7 @@ custom attribute definition, use the [CreateOrderCustomAttributeDefinition](api- To create or update a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + @@ -23139,11 +22246,11 @@ await client.orders.customAttributes.upsert({ customAttribute: { key: "table-number", value: "42", - version: 1 - } + version: 1, + }, }); - ``` + @@ -23157,22 +22264,21 @@ await client.orders.customAttributes.upsert({
-**request:** `Square.orders.UpsertOrderCustomAttributeRequest` - +**request:** `Square.orders.UpsertOrderCustomAttributeRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
- @@ -23194,6 +22300,7 @@ Deletes a [custom attribute](entity:CustomAttribute) associated with a customer To delete a custom attribute owned by another application, the `visibility` setting must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. + @@ -23210,10 +22317,10 @@ To delete a custom attribute owned by another application, the `visibility` sett ```typescript await client.orders.customAttributes.delete({ orderId: "order_id", - customAttributeKey: "custom_attribute_key" + customAttributeKey: "custom_attribute_key", }); - ``` + @@ -23227,27 +22334,27 @@ await client.orders.customAttributes.delete({
-**request:** `Square.orders.DeleteCustomAttributesRequest` - +**request:** `Square.orders.DeleteCustomAttributesRequest` +
-**requestOptions:** `CustomAttributesClient.RequestOptions` - +**requestOptions:** `CustomAttributes.RequestOptions` +
- ## TeamMembers WageSetting +
client.teamMembers.wageSetting.get({ ...params }) -> Square.GetWageSettingResponse
@@ -23266,6 +22373,7 @@ by `TeamMember.id`. For more information, see Square recommends using [RetrieveTeamMember](api-endpoint:Team-RetrieveTeamMember) or [SearchTeamMembers](api-endpoint:Team-SearchTeamMembers) to get this information directly from the `TeamMember.wage_setting` field. +
@@ -23281,10 +22389,10 @@ to get this information directly from the `TeamMember.wage_setting` field. ```typescript await client.teamMembers.wageSetting.get({ - teamMemberId: "team_member_id" + teamMemberId: "team_member_id", }); - ``` + @@ -23298,22 +22406,21 @@ await client.teamMembers.wageSetting.get({
-**request:** `Square.teamMembers.GetWageSettingRequest` - +**request:** `Square.teamMembers.GetWageSettingRequest` +
-**requestOptions:** `WageSettingClient.RequestOptions` - +**requestOptions:** `WageSetting.RequestOptions` +
-
@@ -23338,6 +22445,7 @@ The `WageSetting` is returned on a successful update. For more information, see Square recommends using [CreateTeamMember](api-endpoint:Team-CreateTeamMember) or [UpdateTeamMember](api-endpoint:Team-UpdateTeamMember) to manage the `TeamMember.wage_setting` field directly. + @@ -23355,27 +22463,30 @@ to manage the `TeamMember.wage_setting` field directly. await client.teamMembers.wageSetting.update({ teamMemberId: "team_member_id", wageSetting: { - jobAssignments: [{ + jobAssignments: [ + { jobTitle: "Manager", payType: "SALARY", annualRate: { amount: BigInt("3000000"), - currency: "USD" + currency: "USD", }, - weeklyHours: 40 - }, { + weeklyHours: 40, + }, + { jobTitle: "Cashier", payType: "HOURLY", hourlyRate: { amount: BigInt("2000"), - currency: "USD" - } - }], - isOvertimeExempt: true - } + currency: "USD", + }, + }, + ], + isOvertimeExempt: true, + }, }); - ``` + @@ -23389,27 +22500,27 @@ await client.teamMembers.wageSetting.update({
-**request:** `Square.teamMembers.UpdateWageSettingRequest` - +**request:** `Square.teamMembers.UpdateWageSettingRequest` +
-**requestOptions:** `WageSettingClient.RequestOptions` - +**requestOptions:** `WageSetting.RequestOptions` +
- ## Terminal Actions +
client.terminal.actions.create({ ...params }) -> Square.CreateTerminalActionResponse
@@ -23423,6 +22534,7 @@ await client.teamMembers.wageSetting.update({
Creates a Terminal action request and sends it to the specified device. +
@@ -23445,12 +22557,12 @@ await client.terminal.actions.create({ type: "SAVE_CARD", saveCardOptions: { customerId: "{{CUSTOMER_ID}}", - referenceId: "user-id-1" - } - } + referenceId: "user-id-1", + }, + }, }); - ``` + @@ -23464,22 +22576,21 @@ await client.terminal.actions.create({
-**request:** `Square.terminal.CreateTerminalActionRequest` - +**request:** `Square.terminal.CreateTerminalActionRequest` +
-**requestOptions:** `ActionsClient.RequestOptions` - +**requestOptions:** `Actions.RequestOptions` +
-
@@ -23497,6 +22608,7 @@ await client.terminal.actions.create({
Retrieves a filtered list of Terminal action requests created by the account making the request. Terminal action requests are available for 30 days. +
@@ -23515,17 +22627,17 @@ await client.terminal.actions.search({ query: { filter: { createdAt: { - startAt: "2022-04-01T00:00:00.000Z" - } + startAt: "2022-04-01T00:00:00.000Z", + }, }, sort: { - sortOrder: "DESC" - } + sortOrder: "DESC", + }, }, - limit: 2 + limit: 2, }); - ``` + @@ -23539,22 +22651,21 @@ await client.terminal.actions.search({
-**request:** `Square.terminal.SearchTerminalActionsRequest` - +**request:** `Square.terminal.SearchTerminalActionsRequest` +
-**requestOptions:** `ActionsClient.RequestOptions` - +**requestOptions:** `Actions.RequestOptions` +
- @@ -23572,6 +22683,7 @@ await client.terminal.actions.search({
Retrieves a Terminal action request by `action_id`. Terminal action requests are available for 30 days. +
@@ -23587,10 +22699,10 @@ Retrieves a Terminal action request by `action_id`. Terminal action requests are ```typescript await client.terminal.actions.get({ - actionId: "action_id" + actionId: "action_id", }); - ``` + @@ -23604,22 +22716,21 @@ await client.terminal.actions.get({
-**request:** `Square.terminal.GetActionsRequest` - +**request:** `Square.terminal.GetActionsRequest` +
-**requestOptions:** `ActionsClient.RequestOptions` - +**requestOptions:** `Actions.RequestOptions` +
- @@ -23637,6 +22748,7 @@ await client.terminal.actions.get({
Cancels a Terminal action request if the status of the request permits it. +
@@ -23652,10 +22764,10 @@ Cancels a Terminal action request if the status of the request permits it. ```typescript await client.terminal.actions.cancel({ - actionId: "action_id" + actionId: "action_id", }); - ``` + @@ -23669,27 +22781,27 @@ await client.terminal.actions.cancel({
-**request:** `Square.terminal.CancelActionsRequest` - +**request:** `Square.terminal.CancelActionsRequest` +
-**requestOptions:** `ActionsClient.RequestOptions` - +**requestOptions:** `Actions.RequestOptions` +
- ## Terminal Checkouts +
client.terminal.checkouts.create({ ...params }) -> Square.CreateTerminalCheckoutResponse
@@ -23704,6 +22816,7 @@ await client.terminal.actions.cancel({ Creates a Terminal checkout request and sends it to the specified device to take a payment for the requested amount. +
@@ -23723,17 +22836,17 @@ await client.terminal.checkouts.create({ checkout: { amountMoney: { amount: BigInt("2610"), - currency: "USD" + currency: "USD", }, referenceId: "id11572", note: "A brief note", deviceOptions: { - deviceId: "dbb5d83a-7838-11ea-bc55-0242ac130003" - } - } + deviceId: "dbb5d83a-7838-11ea-bc55-0242ac130003", + }, + }, }); - ``` + @@ -23747,22 +22860,21 @@ await client.terminal.checkouts.create({
-**request:** `Square.terminal.CreateTerminalCheckoutRequest` - +**request:** `Square.terminal.CreateTerminalCheckoutRequest` +
-**requestOptions:** `CheckoutsClient.RequestOptions` - +**requestOptions:** `Checkouts.RequestOptions` +
-
@@ -23780,6 +22892,7 @@ await client.terminal.checkouts.create({
Returns a filtered list of Terminal checkout requests created by the application making the request. Only Terminal checkout requests created for the merchant scoped to the OAuth token are returned. Terminal checkout requests are available for 30 days. +
@@ -23797,13 +22910,13 @@ Returns a filtered list of Terminal checkout requests created by the application await client.terminal.checkouts.search({ query: { filter: { - status: "COMPLETED" - } + status: "COMPLETED", + }, }, - limit: 2 + limit: 2, }); - ``` + @@ -23817,22 +22930,21 @@ await client.terminal.checkouts.search({
-**request:** `Square.terminal.SearchTerminalCheckoutsRequest` - +**request:** `Square.terminal.SearchTerminalCheckoutsRequest` +
-**requestOptions:** `CheckoutsClient.RequestOptions` - +**requestOptions:** `Checkouts.RequestOptions` +
- @@ -23850,6 +22962,7 @@ await client.terminal.checkouts.search({
Retrieves a Terminal checkout request by `checkout_id`. Terminal checkout requests are available for 30 days. +
@@ -23865,10 +22978,10 @@ Retrieves a Terminal checkout request by `checkout_id`. Terminal checkout reques ```typescript await client.terminal.checkouts.get({ - checkoutId: "checkout_id" + checkoutId: "checkout_id", }); - ``` + @@ -23882,22 +22995,21 @@ await client.terminal.checkouts.get({
-**request:** `Square.terminal.GetCheckoutsRequest` - +**request:** `Square.terminal.GetCheckoutsRequest` +
-**requestOptions:** `CheckoutsClient.RequestOptions` - +**requestOptions:** `Checkouts.RequestOptions` +
- @@ -23915,6 +23027,7 @@ await client.terminal.checkouts.get({
Cancels a Terminal checkout request if the status of the request permits it. +
@@ -23930,10 +23043,10 @@ Cancels a Terminal checkout request if the status of the request permits it. ```typescript await client.terminal.checkouts.cancel({ - checkoutId: "checkout_id" + checkoutId: "checkout_id", }); - ``` + @@ -23947,27 +23060,27 @@ await client.terminal.checkouts.cancel({
-**request:** `Square.terminal.CancelCheckoutsRequest` - +**request:** `Square.terminal.CancelCheckoutsRequest` +
-**requestOptions:** `CheckoutsClient.RequestOptions` - +**requestOptions:** `Checkouts.RequestOptions` +
- ## Terminal Refunds +
client.terminal.refunds.create({ ...params }) -> Square.CreateTerminalRefundResponse
@@ -23981,6 +23094,7 @@ await client.terminal.checkouts.cancel({
Creates a request to refund an Interac payment completed on a Square Terminal. Refunds for Interac payments on a Square Terminal are supported only for Interac debit cards in Canada. Other refunds for Terminal payments should use the Refunds API. For more information, see [Refunds API](api:Refunds). +
@@ -24001,14 +23115,14 @@ await client.terminal.refunds.create({ paymentId: "5O5OvgkcNUhl7JBuINflcjKqUzXZY", amountMoney: { amount: BigInt("111"), - currency: "CAD" + currency: "CAD", }, reason: "Returning items", - deviceId: "f72dfb8e-4d65-4e56-aade-ec3fb8d33291" - } + deviceId: "f72dfb8e-4d65-4e56-aade-ec3fb8d33291", + }, }); - ``` + @@ -24022,22 +23136,21 @@ await client.terminal.refunds.create({
-**request:** `Square.terminal.CreateTerminalRefundRequest` - +**request:** `Square.terminal.CreateTerminalRefundRequest` +
-**requestOptions:** `RefundsClient.RequestOptions` - +**requestOptions:** `Refunds.RequestOptions` +
-
@@ -24055,6 +23168,7 @@ await client.terminal.refunds.create({
Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request. Terminal refund requests are available for 30 days. +
@@ -24072,13 +23186,13 @@ Retrieves a filtered list of Interac Terminal refund requests created by the sel await client.terminal.refunds.search({ query: { filter: { - status: "COMPLETED" - } + status: "COMPLETED", + }, }, - limit: 1 + limit: 1, }); - ``` + @@ -24092,22 +23206,21 @@ await client.terminal.refunds.search({
-**request:** `Square.terminal.SearchTerminalRefundsRequest` - +**request:** `Square.terminal.SearchTerminalRefundsRequest` +
-**requestOptions:** `RefundsClient.RequestOptions` - +**requestOptions:** `Refunds.RequestOptions` +
- @@ -24125,6 +23238,7 @@ await client.terminal.refunds.search({
Retrieves an Interac Terminal refund object by ID. Terminal refund objects are available for 30 days. +
@@ -24140,10 +23254,10 @@ Retrieves an Interac Terminal refund object by ID. Terminal refund objects are a ```typescript await client.terminal.refunds.get({ - terminalRefundId: "terminal_refund_id" + terminalRefundId: "terminal_refund_id", }); - ``` + @@ -24157,22 +23271,21 @@ await client.terminal.refunds.get({
-**request:** `Square.terminal.GetRefundsRequest` - +**request:** `Square.terminal.GetRefundsRequest` +
-**requestOptions:** `RefundsClient.RequestOptions` - +**requestOptions:** `Refunds.RequestOptions` +
- @@ -24190,6 +23303,7 @@ await client.terminal.refunds.get({
Cancels an Interac Terminal refund request by refund request ID if the status of the request permits it. +
@@ -24205,10 +23319,10 @@ Cancels an Interac Terminal refund request by refund request ID if the status of ```typescript await client.terminal.refunds.cancel({ - terminalRefundId: "terminal_refund_id" + terminalRefundId: "terminal_refund_id", }); - ``` + @@ -24222,27 +23336,27 @@ await client.terminal.refunds.cancel({
-**request:** `Square.terminal.CancelRefundsRequest` - +**request:** `Square.terminal.CancelRefundsRequest` +
-**requestOptions:** `RefundsClient.RequestOptions` - +**requestOptions:** `Refunds.RequestOptions` +
- ## Webhooks EventTypes +
client.webhooks.eventTypes.list({ ...params }) -> Square.ListWebhookEventTypesResponse
@@ -24256,6 +23370,7 @@ await client.terminal.refunds.cancel({
Lists all webhook event types that can be subscribed to. +
@@ -24271,10 +23386,10 @@ Lists all webhook event types that can be subscribed to. ```typescript await client.webhooks.eventTypes.list({ - apiVersion: "api_version" + apiVersion: "api_version", }); - ``` + @@ -24288,28 +23403,28 @@ await client.webhooks.eventTypes.list({
-**request:** `Square.webhooks.ListEventTypesRequest` - +**request:** `Square.webhooks.ListEventTypesRequest` +
-**requestOptions:** `EventTypesClient.RequestOptions` - +**requestOptions:** `EventTypes.RequestOptions` +
-
## Webhooks Subscriptions -
client.webhooks.subscriptions.list({ ...params }) -> core.Page + +
client.webhooks.subscriptions.list({ ...params }) -> core.Page<Square.WebhookSubscription>
@@ -24322,6 +23437,7 @@ await client.webhooks.eventTypes.list({
Lists all webhook subscriptions owned by your application. +
@@ -24336,13 +23452,13 @@ Lists all webhook subscriptions owned by your application.
```typescript -const pageableResponse = await client.webhooks.subscriptions.list({ +const response = await client.webhooks.subscriptions.list({ cursor: "cursor", includeDisabled: true, sortOrder: "DESC", - limit: 1 + limit: 1, }); -for await (const item of pageableResponse) { +for await (const item of response) { console.log(item); } @@ -24351,16 +23467,13 @@ let page = await client.webhooks.subscriptions.list({ cursor: "cursor", includeDisabled: true, sortOrder: "DESC", - limit: 1 + limit: 1, }); while (page.hasNextPage()) { page = page.getNextPage(); } - -// You can also access the underlying response -const response = page.response; - ``` +
@@ -24374,22 +23487,21 @@ const response = page.response;
-**request:** `Square.webhooks.ListSubscriptionsRequest` - +**request:** `Square.webhooks.ListSubscriptionsRequest` +
-**requestOptions:** `SubscriptionsClient.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
-
@@ -24407,6 +23519,7 @@ const response = page.response;
Creates a webhook subscription. +
@@ -24427,11 +23540,11 @@ await client.webhooks.subscriptions.create({ name: "Example Webhook Subscription", eventTypes: ["payment.created", "payment.updated"], notificationUrl: "https://example-webhook-url.com", - apiVersion: "2021-12-15" - } + apiVersion: "2021-12-15", + }, }); - ``` + @@ -24445,22 +23558,21 @@ await client.webhooks.subscriptions.create({
-**request:** `Square.webhooks.CreateWebhookSubscriptionRequest` - +**request:** `Square.webhooks.CreateWebhookSubscriptionRequest` +
-**requestOptions:** `SubscriptionsClient.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
-
@@ -24478,6 +23590,7 @@ await client.webhooks.subscriptions.create({
Retrieves a webhook subscription identified by its ID. +
@@ -24493,10 +23606,10 @@ Retrieves a webhook subscription identified by its ID. ```typescript await client.webhooks.subscriptions.get({ - subscriptionId: "subscription_id" + subscriptionId: "subscription_id", }); - ``` + @@ -24510,22 +23623,21 @@ await client.webhooks.subscriptions.get({
-**request:** `Square.webhooks.GetSubscriptionsRequest` - +**request:** `Square.webhooks.GetSubscriptionsRequest` +
-**requestOptions:** `SubscriptionsClient.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
- @@ -24543,6 +23655,7 @@ await client.webhooks.subscriptions.get({
Updates a webhook subscription. +
@@ -24561,11 +23674,11 @@ await client.webhooks.subscriptions.update({ subscriptionId: "subscription_id", subscription: { name: "Updated Example Webhook Subscription", - enabled: false - } + enabled: false, + }, }); - ``` + @@ -24579,22 +23692,21 @@ await client.webhooks.subscriptions.update({
-**request:** `Square.webhooks.UpdateWebhookSubscriptionRequest` - +**request:** `Square.webhooks.UpdateWebhookSubscriptionRequest` +
-**requestOptions:** `SubscriptionsClient.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
- @@ -24612,6 +23724,7 @@ await client.webhooks.subscriptions.update({
Deletes a webhook subscription. +
@@ -24627,10 +23740,10 @@ Deletes a webhook subscription. ```typescript await client.webhooks.subscriptions.delete({ - subscriptionId: "subscription_id" + subscriptionId: "subscription_id", }); - ``` + @@ -24644,22 +23757,21 @@ await client.webhooks.subscriptions.delete({
-**request:** `Square.webhooks.DeleteSubscriptionsRequest` - +**request:** `Square.webhooks.DeleteSubscriptionsRequest` +
-**requestOptions:** `SubscriptionsClient.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
- @@ -24677,6 +23789,7 @@ await client.webhooks.subscriptions.delete({
Updates a webhook subscription by replacing the existing signature key with a new one. +
@@ -24693,10 +23806,10 @@ Updates a webhook subscription by replacing the existing signature key with a ne ```typescript await client.webhooks.subscriptions.updateSignatureKey({ subscriptionId: "subscription_id", - idempotencyKey: "ed80ae6b-0654-473b-bbab-a39aee89a60d" + idempotencyKey: "ed80ae6b-0654-473b-bbab-a39aee89a60d", }); - ``` + @@ -24710,22 +23823,21 @@ await client.webhooks.subscriptions.updateSignatureKey({
-**request:** `Square.webhooks.UpdateWebhookSubscriptionSignatureKeyRequest` - +**request:** `Square.webhooks.UpdateWebhookSubscriptionSignatureKeyRequest` +
-**requestOptions:** `SubscriptionsClient.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
- @@ -24743,6 +23855,7 @@ await client.webhooks.subscriptions.updateSignatureKey({
Tests a webhook subscription by sending a test event to the notification URL. +
@@ -24759,10 +23872,10 @@ Tests a webhook subscription by sending a test event to the notification URL. ```typescript await client.webhooks.subscriptions.test({ subscriptionId: "subscription_id", - eventType: "payment.created" + eventType: "payment.created", }); - ``` + @@ -24776,22 +23889,21 @@ await client.webhooks.subscriptions.test({
-**request:** `Square.webhooks.TestWebhookSubscriptionRequest` - +**request:** `Square.webhooks.TestWebhookSubscriptionRequest` +
-**requestOptions:** `SubscriptionsClient.RequestOptions` - +**requestOptions:** `Subscriptions.RequestOptions` +
- diff --git a/src/BaseClient.ts b/src/BaseClient.ts deleted file mode 100644 index 796b29c04..000000000 --- a/src/BaseClient.ts +++ /dev/null @@ -1,61 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import * as core from "./core"; -import { mergeHeaders } from "./core/headers"; -import type * as environments from "./environments"; - -export interface BaseClientOptions { - environment?: core.Supplier; - /** Specify a custom URL to connect the client to. */ - baseUrl?: core.Supplier; - token?: core.Supplier; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional headers to include in requests. */ - headers?: Record | null | undefined>; - /** The default maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The default number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** Provide a custom fetch implementation. Useful for platforms that don't have a built-in fetch or need a custom implementation. */ - fetch?: typeof fetch; - fetcher?: core.FetchFunction; - /** Configure logging for the client. */ - logging?: core.logging.LogConfig | core.logging.Logger; -} - -export interface BaseRequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Override the Square-Version header */ - version?: "2025-10-16"; - /** Additional query string parameters to include in the request. */ - queryParams?: Record; - /** Additional headers to include in the request. */ - headers?: Record | null | undefined>; -} - -export function normalizeClientOptions(options: T): T { - const headers = mergeHeaders( - { - "X-Fern-Language": "JavaScript", - "X-Fern-SDK-Name": "square", - "X-Fern-SDK-Version": "43.2.1", - "User-Agent": "square/43.2.1", - "X-Fern-Runtime": core.RUNTIME.type, - "X-Fern-Runtime-Version": core.RUNTIME.version, - "Square-Version": options?.version ?? "2025-10-16", - }, - options?.headers, - ); - - return { - ...options, - logging: core.logging.createLogger(options?.logging), - headers, - } as T; -} diff --git a/src/Client.ts b/src/Client.ts index f81557c60..157061399 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -1,234 +1,260 @@ -// This file was auto-generated by Fern from our API Definition. - -import { ApplePayClient } from "./api/resources/applePay/client/Client"; -import { BankAccountsClient } from "./api/resources/bankAccounts/client/Client"; -import { BookingsClient } from "./api/resources/bookings/client/Client"; -import { CardsClient } from "./api/resources/cards/client/Client"; -import { CashDrawersClient } from "./api/resources/cashDrawers/client/Client"; -import { CatalogClient } from "./api/resources/catalog/client/Client"; -import { ChannelsClient } from "./api/resources/channels/client/Client"; -import { CheckoutClient } from "./api/resources/checkout/client/Client"; -import { CustomersClient } from "./api/resources/customers/client/Client"; -import { DevicesClient } from "./api/resources/devices/client/Client"; -import { DisputesClient } from "./api/resources/disputes/client/Client"; -import { EmployeesClient } from "./api/resources/employees/client/Client"; -import { EventsClient } from "./api/resources/events/client/Client"; -import { GiftCardsClient } from "./api/resources/giftCards/client/Client"; -import { InventoryClient } from "./api/resources/inventory/client/Client"; -import { InvoicesClient } from "./api/resources/invoices/client/Client"; -import { LaborClient } from "./api/resources/labor/client/Client"; -import { LocationsClient } from "./api/resources/locations/client/Client"; -import { LoyaltyClient } from "./api/resources/loyalty/client/Client"; -import { MerchantsClient } from "./api/resources/merchants/client/Client"; -import { MobileClient } from "./api/resources/mobile/client/Client"; -import { OAuthClient } from "./api/resources/oAuth/client/Client"; -import { OrdersClient } from "./api/resources/orders/client/Client"; -import { PaymentsClient } from "./api/resources/payments/client/Client"; -import { PayoutsClient } from "./api/resources/payouts/client/Client"; -import { RefundsClient } from "./api/resources/refunds/client/Client"; -import { SitesClient } from "./api/resources/sites/client/Client"; -import { SnippetsClient } from "./api/resources/snippets/client/Client"; -import { SubscriptionsClient } from "./api/resources/subscriptions/client/Client"; -import { TeamClient } from "./api/resources/team/client/Client"; -import { TeamMembersClient } from "./api/resources/teamMembers/client/Client"; -import { TerminalClient } from "./api/resources/terminal/client/Client"; -import { TransferOrdersClient } from "./api/resources/transferOrders/client/Client"; -import { V1TransactionsClient } from "./api/resources/v1Transactions/client/Client"; -import { VendorsClient } from "./api/resources/vendors/client/Client"; -import { WebhooksClient } from "./api/resources/webhooks/client/Client"; -import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient"; -import { normalizeClientOptions } from "./BaseClient"; +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as environments from "./environments"; +import * as core from "./core"; +import { mergeHeaders } from "./core/headers"; +import { Mobile } from "./api/resources/mobile/client/Client"; +import { OAuth } from "./api/resources/oAuth/client/Client"; +import { V1Transactions } from "./api/resources/v1Transactions/client/Client"; +import { ApplePay } from "./api/resources/applePay/client/Client"; +import { BankAccounts } from "./api/resources/bankAccounts/client/Client"; +import { Bookings } from "./api/resources/bookings/client/Client"; +import { Cards } from "./api/resources/cards/client/Client"; +import { Catalog } from "./api/resources/catalog/client/Client"; +import { Customers } from "./api/resources/customers/client/Client"; +import { Devices } from "./api/resources/devices/client/Client"; +import { Disputes } from "./api/resources/disputes/client/Client"; +import { Employees } from "./api/resources/employees/client/Client"; +import { Events } from "./api/resources/events/client/Client"; +import { GiftCards } from "./api/resources/giftCards/client/Client"; +import { Inventory } from "./api/resources/inventory/client/Client"; +import { Invoices } from "./api/resources/invoices/client/Client"; +import { Labor } from "./api/resources/labor/client/Client"; +import { Locations } from "./api/resources/locations/client/Client"; +import { Loyalty } from "./api/resources/loyalty/client/Client"; +import { Merchants } from "./api/resources/merchants/client/Client"; +import { Checkout } from "./api/resources/checkout/client/Client"; +import { Orders } from "./api/resources/orders/client/Client"; +import { Payments } from "./api/resources/payments/client/Client"; +import { Payouts } from "./api/resources/payouts/client/Client"; +import { Refunds } from "./api/resources/refunds/client/Client"; +import { Sites } from "./api/resources/sites/client/Client"; +import { Snippets } from "./api/resources/snippets/client/Client"; +import { Subscriptions } from "./api/resources/subscriptions/client/Client"; +import { TeamMembers } from "./api/resources/teamMembers/client/Client"; +import { Team } from "./api/resources/team/client/Client"; +import { Terminal } from "./api/resources/terminal/client/Client"; +import { Vendors } from "./api/resources/vendors/client/Client"; +import { CashDrawers } from "./api/resources/cashDrawers/client/Client"; +import { Webhooks } from "./api/resources/webhooks/client/Client"; export declare namespace SquareClient { - export interface Options extends BaseClientOptions {} - - export interface RequestOptions extends BaseRequestOptions {} + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } + + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } export class SquareClient { protected readonly _options: SquareClient.Options; - protected _mobile: MobileClient | undefined; - protected _oAuth: OAuthClient | undefined; - protected _v1Transactions: V1TransactionsClient | undefined; - protected _applePay: ApplePayClient | undefined; - protected _bankAccounts: BankAccountsClient | undefined; - protected _bookings: BookingsClient | undefined; - protected _cards: CardsClient | undefined; - protected _catalog: CatalogClient | undefined; - protected _channels: ChannelsClient | undefined; - protected _customers: CustomersClient | undefined; - protected _devices: DevicesClient | undefined; - protected _disputes: DisputesClient | undefined; - protected _employees: EmployeesClient | undefined; - protected _events: EventsClient | undefined; - protected _giftCards: GiftCardsClient | undefined; - protected _inventory: InventoryClient | undefined; - protected _invoices: InvoicesClient | undefined; - protected _labor: LaborClient | undefined; - protected _locations: LocationsClient | undefined; - protected _loyalty: LoyaltyClient | undefined; - protected _merchants: MerchantsClient | undefined; - protected _checkout: CheckoutClient | undefined; - protected _orders: OrdersClient | undefined; - protected _payments: PaymentsClient | undefined; - protected _payouts: PayoutsClient | undefined; - protected _refunds: RefundsClient | undefined; - protected _sites: SitesClient | undefined; - protected _snippets: SnippetsClient | undefined; - protected _subscriptions: SubscriptionsClient | undefined; - protected _teamMembers: TeamMembersClient | undefined; - protected _team: TeamClient | undefined; - protected _terminal: TerminalClient | undefined; - protected _transferOrders: TransferOrdersClient | undefined; - protected _vendors: VendorsClient | undefined; - protected _cashDrawers: CashDrawersClient | undefined; - protected _webhooks: WebhooksClient | undefined; - - constructor(options: SquareClient.Options = {}) { - this._options = normalizeClientOptions(options); - } - - public get mobile(): MobileClient { - return (this._mobile ??= new MobileClient(this._options)); - } + protected _mobile: Mobile | undefined; + protected _oAuth: OAuth | undefined; + protected _v1Transactions: V1Transactions | undefined; + protected _applePay: ApplePay | undefined; + protected _bankAccounts: BankAccounts | undefined; + protected _bookings: Bookings | undefined; + protected _cards: Cards | undefined; + protected _catalog: Catalog | undefined; + protected _customers: Customers | undefined; + protected _devices: Devices | undefined; + protected _disputes: Disputes | undefined; + protected _employees: Employees | undefined; + protected _events: Events | undefined; + protected _giftCards: GiftCards | undefined; + protected _inventory: Inventory | undefined; + protected _invoices: Invoices | undefined; + protected _labor: Labor | undefined; + protected _locations: Locations | undefined; + protected _loyalty: Loyalty | undefined; + protected _merchants: Merchants | undefined; + protected _checkout: Checkout | undefined; + protected _orders: Orders | undefined; + protected _payments: Payments | undefined; + protected _payouts: Payouts | undefined; + protected _refunds: Refunds | undefined; + protected _sites: Sites | undefined; + protected _snippets: Snippets | undefined; + protected _subscriptions: Subscriptions | undefined; + protected _teamMembers: TeamMembers | undefined; + protected _team: Team | undefined; + protected _terminal: Terminal | undefined; + protected _vendors: Vendors | undefined; + protected _cashDrawers: CashDrawers | undefined; + protected _webhooks: Webhooks | undefined; - public get oAuth(): OAuthClient { - return (this._oAuth ??= new OAuthClient(this._options)); + constructor(_options: SquareClient.Options = {}) { + this._options = { + ..._options, + headers: mergeHeaders( + { + "Square-Version": _options?.version ?? "2025-07-16", + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "square", + "X-Fern-SDK-Version": "43.2.2", + "User-Agent": "square/43.2.2", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + _options?.headers, + ), + }; } - public get v1Transactions(): V1TransactionsClient { - return (this._v1Transactions ??= new V1TransactionsClient(this._options)); + public get mobile(): Mobile { + return (this._mobile ??= new Mobile(this._options)); } - public get applePay(): ApplePayClient { - return (this._applePay ??= new ApplePayClient(this._options)); + public get oAuth(): OAuth { + return (this._oAuth ??= new OAuth(this._options)); } - public get bankAccounts(): BankAccountsClient { - return (this._bankAccounts ??= new BankAccountsClient(this._options)); + public get v1Transactions(): V1Transactions { + return (this._v1Transactions ??= new V1Transactions(this._options)); } - public get bookings(): BookingsClient { - return (this._bookings ??= new BookingsClient(this._options)); + public get applePay(): ApplePay { + return (this._applePay ??= new ApplePay(this._options)); } - public get cards(): CardsClient { - return (this._cards ??= new CardsClient(this._options)); + public get bankAccounts(): BankAccounts { + return (this._bankAccounts ??= new BankAccounts(this._options)); } - public get catalog(): CatalogClient { - return (this._catalog ??= new CatalogClient(this._options)); + public get bookings(): Bookings { + return (this._bookings ??= new Bookings(this._options)); } - public get channels(): ChannelsClient { - return (this._channels ??= new ChannelsClient(this._options)); + public get cards(): Cards { + return (this._cards ??= new Cards(this._options)); } - public get customers(): CustomersClient { - return (this._customers ??= new CustomersClient(this._options)); + public get catalog(): Catalog { + return (this._catalog ??= new Catalog(this._options)); } - public get devices(): DevicesClient { - return (this._devices ??= new DevicesClient(this._options)); + public get customers(): Customers { + return (this._customers ??= new Customers(this._options)); } - public get disputes(): DisputesClient { - return (this._disputes ??= new DisputesClient(this._options)); + public get devices(): Devices { + return (this._devices ??= new Devices(this._options)); } - public get employees(): EmployeesClient { - return (this._employees ??= new EmployeesClient(this._options)); + public get disputes(): Disputes { + return (this._disputes ??= new Disputes(this._options)); } - public get events(): EventsClient { - return (this._events ??= new EventsClient(this._options)); + public get employees(): Employees { + return (this._employees ??= new Employees(this._options)); } - public get giftCards(): GiftCardsClient { - return (this._giftCards ??= new GiftCardsClient(this._options)); + public get events(): Events { + return (this._events ??= new Events(this._options)); } - public get inventory(): InventoryClient { - return (this._inventory ??= new InventoryClient(this._options)); + public get giftCards(): GiftCards { + return (this._giftCards ??= new GiftCards(this._options)); } - public get invoices(): InvoicesClient { - return (this._invoices ??= new InvoicesClient(this._options)); + public get inventory(): Inventory { + return (this._inventory ??= new Inventory(this._options)); } - public get labor(): LaborClient { - return (this._labor ??= new LaborClient(this._options)); + public get invoices(): Invoices { + return (this._invoices ??= new Invoices(this._options)); } - public get locations(): LocationsClient { - return (this._locations ??= new LocationsClient(this._options)); + public get labor(): Labor { + return (this._labor ??= new Labor(this._options)); } - public get loyalty(): LoyaltyClient { - return (this._loyalty ??= new LoyaltyClient(this._options)); + public get locations(): Locations { + return (this._locations ??= new Locations(this._options)); } - public get merchants(): MerchantsClient { - return (this._merchants ??= new MerchantsClient(this._options)); + public get loyalty(): Loyalty { + return (this._loyalty ??= new Loyalty(this._options)); } - public get checkout(): CheckoutClient { - return (this._checkout ??= new CheckoutClient(this._options)); + public get merchants(): Merchants { + return (this._merchants ??= new Merchants(this._options)); } - public get orders(): OrdersClient { - return (this._orders ??= new OrdersClient(this._options)); + public get checkout(): Checkout { + return (this._checkout ??= new Checkout(this._options)); } - public get payments(): PaymentsClient { - return (this._payments ??= new PaymentsClient(this._options)); + public get orders(): Orders { + return (this._orders ??= new Orders(this._options)); } - public get payouts(): PayoutsClient { - return (this._payouts ??= new PayoutsClient(this._options)); + public get payments(): Payments { + return (this._payments ??= new Payments(this._options)); } - public get refunds(): RefundsClient { - return (this._refunds ??= new RefundsClient(this._options)); + public get payouts(): Payouts { + return (this._payouts ??= new Payouts(this._options)); } - public get sites(): SitesClient { - return (this._sites ??= new SitesClient(this._options)); + public get refunds(): Refunds { + return (this._refunds ??= new Refunds(this._options)); } - public get snippets(): SnippetsClient { - return (this._snippets ??= new SnippetsClient(this._options)); + public get sites(): Sites { + return (this._sites ??= new Sites(this._options)); } - public get subscriptions(): SubscriptionsClient { - return (this._subscriptions ??= new SubscriptionsClient(this._options)); + public get snippets(): Snippets { + return (this._snippets ??= new Snippets(this._options)); } - public get teamMembers(): TeamMembersClient { - return (this._teamMembers ??= new TeamMembersClient(this._options)); + public get subscriptions(): Subscriptions { + return (this._subscriptions ??= new Subscriptions(this._options)); } - public get team(): TeamClient { - return (this._team ??= new TeamClient(this._options)); + public get teamMembers(): TeamMembers { + return (this._teamMembers ??= new TeamMembers(this._options)); } - public get terminal(): TerminalClient { - return (this._terminal ??= new TerminalClient(this._options)); + public get team(): Team { + return (this._team ??= new Team(this._options)); } - public get transferOrders(): TransferOrdersClient { - return (this._transferOrders ??= new TransferOrdersClient(this._options)); + public get terminal(): Terminal { + return (this._terminal ??= new Terminal(this._options)); } - public get vendors(): VendorsClient { - return (this._vendors ??= new VendorsClient(this._options)); + public get vendors(): Vendors { + return (this._vendors ??= new Vendors(this._options)); } - public get cashDrawers(): CashDrawersClient { - return (this._cashDrawers ??= new CashDrawersClient(this._options)); + public get cashDrawers(): CashDrawers { + return (this._cashDrawers ??= new CashDrawers(this._options)); } - public get webhooks(): WebhooksClient { - return (this._webhooks ??= new WebhooksClient(this._options)); + public get webhooks(): Webhooks { + return (this._webhooks ??= new Webhooks(this._options)); } } diff --git a/src/api/index.ts b/src/api/index.ts index 3e15e2907..3ce0a3e38 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,2 +1,2 @@ -export * from "./resources"; export * from "./types"; +export * from "./resources"; diff --git a/src/api/resources/applePay/client/Client.ts b/src/api/resources/applePay/client/Client.ts index 5579b3dad..604bc6655 100644 --- a/src/api/resources/applePay/client/Client.ts +++ b/src/api/resources/applePay/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; +import * as errors from "../../../../errors/index"; -export declare namespace ApplePayClient { - export interface Options extends BaseClientOptions {} +export declare namespace ApplePay { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class ApplePayClient { - protected readonly _options: ApplePayClient.Options; +export class ApplePay { + protected readonly _options: ApplePay.Options; - constructor(options: ApplePayClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: ApplePay.Options = {}) { + this._options = _options; } /** @@ -39,7 +60,7 @@ export class ApplePayClient { * To learn more about the Web Payments SDK and how to add Apple Pay, see [Take an Apple Pay Payment](https://developer.squareup.com/docs/web-payments/apple-pay). * * @param {Square.RegisterDomainRequest} request - * @param {ApplePayClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {ApplePay.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.applePay.registerDomain({ @@ -48,23 +69,15 @@ export class ApplePayClient { */ public registerDomain( request: Square.RegisterDomainRequest, - requestOptions?: ApplePayClient.RequestOptions, + requestOptions?: ApplePay.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__registerDomain(request, requestOptions)); } private async __registerDomain( request: Square.RegisterDomainRequest, - requestOptions?: ApplePayClient.RequestOptions, + requestOptions?: ApplePay.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -73,19 +86,23 @@ export class ApplePayClient { "v2/apple-pay/domains", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.RegisterDomainRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -126,7 +143,7 @@ export class ApplePayClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/applePay/client/index.ts b/src/api/resources/applePay/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/applePay/client/index.ts +++ b/src/api/resources/applePay/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/applePay/client/requests/RegisterDomainRequest.ts b/src/api/resources/applePay/client/requests/RegisterDomainRequest.ts index 53e20f46e..d2aa825f6 100644 --- a/src/api/resources/applePay/client/requests/RegisterDomainRequest.ts +++ b/src/api/resources/applePay/client/requests/RegisterDomainRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/applePay/client/requests/index.ts b/src/api/resources/applePay/client/requests/index.ts index 626d59ba4..11c98648b 100644 --- a/src/api/resources/applePay/client/requests/index.ts +++ b/src/api/resources/applePay/client/requests/index.ts @@ -1 +1 @@ -export type { RegisterDomainRequest } from "./RegisterDomainRequest"; +export { type RegisterDomainRequest } from "./RegisterDomainRequest"; diff --git a/src/api/resources/bankAccounts/client/Client.ts b/src/api/resources/bankAccounts/client/Client.ts index bacd34365..abf9b76d6 100644 --- a/src/api/resources/bankAccounts/client/Client.ts +++ b/src/api/resources/bankAccounts/client/Client.ts @@ -1,32 +1,53 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; +import * as errors from "../../../../errors/index"; -export declare namespace BankAccountsClient { - export interface Options extends BaseClientOptions {} +export declare namespace BankAccounts { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class BankAccountsClient { - protected readonly _options: BankAccountsClient.Options; +export class BankAccounts { + protected readonly _options: BankAccounts.Options; - constructor(options: BankAccountsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: BankAccounts.Options = {}) { + this._options = _options; } /** * Returns a list of [BankAccount](entity:BankAccount) objects linked to a Square account. * * @param {Square.ListBankAccountsRequest} request - * @param {BankAccountsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {BankAccounts.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bankAccounts.list({ @@ -37,8 +58,8 @@ export class BankAccountsClient { */ public async list( request: Square.ListBankAccountsRequest = {}, - requestOptions?: BankAccountsClient.RequestOptions, - ): Promise> { + requestOptions?: BankAccounts.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.ListBankAccountsRequest, @@ -46,22 +67,14 @@ export class BankAccountsClient { const { cursor, limit, locationId } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (locationId !== undefined) { - _queryParams.location_id = locationId; + _queryParams["location_id"] = locationId; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -70,13 +83,19 @@ export class BankAccountsClient { "v2/bank-accounts", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -115,7 +134,7 @@ export class BankAccountsClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -131,7 +150,7 @@ export class BankAccountsClient { * Returns details of a [BankAccount](entity:BankAccount) identified by V1 bank account ID. * * @param {Square.GetByV1IdBankAccountsRequest} request - * @param {BankAccountsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {BankAccounts.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bankAccounts.getByV1Id({ @@ -140,39 +159,35 @@ export class BankAccountsClient { */ public getByV1Id( request: Square.GetByV1IdBankAccountsRequest, - requestOptions?: BankAccountsClient.RequestOptions, + requestOptions?: BankAccounts.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getByV1Id(request, requestOptions)); } private async __getByV1Id( request: Square.GetByV1IdBankAccountsRequest, - requestOptions?: BankAccountsClient.RequestOptions, + requestOptions?: BankAccounts.RequestOptions, ): Promise> { const { v1BankAccountId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/bank-accounts/by-v1-id/${core.url.encodePathParam(v1BankAccountId)}`, + `v2/bank-accounts/by-v1-id/${encodeURIComponent(v1BankAccountId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -219,7 +234,7 @@ export class BankAccountsClient { * linked to a Square account. * * @param {Square.GetBankAccountsRequest} request - * @param {BankAccountsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {BankAccounts.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bankAccounts.get({ @@ -228,39 +243,35 @@ export class BankAccountsClient { */ public get( request: Square.GetBankAccountsRequest, - requestOptions?: BankAccountsClient.RequestOptions, + requestOptions?: BankAccounts.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.GetBankAccountsRequest, - requestOptions?: BankAccountsClient.RequestOptions, + requestOptions?: BankAccounts.RequestOptions, ): Promise> { const { bankAccountId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/bank-accounts/${core.url.encodePathParam(bankAccountId)}`, + `v2/bank-accounts/${encodeURIComponent(bankAccountId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -303,7 +314,7 @@ export class BankAccountsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/bankAccounts/client/index.ts b/src/api/resources/bankAccounts/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/bankAccounts/client/index.ts +++ b/src/api/resources/bankAccounts/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/bankAccounts/client/requests/GetBankAccountsRequest.ts b/src/api/resources/bankAccounts/client/requests/GetBankAccountsRequest.ts index fd0ed195e..2e0fe1f5c 100644 --- a/src/api/resources/bankAccounts/client/requests/GetBankAccountsRequest.ts +++ b/src/api/resources/bankAccounts/client/requests/GetBankAccountsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetBankAccountsRequest { - /** Square-issued ID of the desired `BankAccount`. */ + /** + * Square-issued ID of the desired `BankAccount`. + */ bankAccountId: string; } diff --git a/src/api/resources/bankAccounts/client/requests/GetByV1IdBankAccountsRequest.ts b/src/api/resources/bankAccounts/client/requests/GetByV1IdBankAccountsRequest.ts index 7eb6fa97c..f567ca2bf 100644 --- a/src/api/resources/bankAccounts/client/requests/GetByV1IdBankAccountsRequest.ts +++ b/src/api/resources/bankAccounts/client/requests/GetByV1IdBankAccountsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/bankAccounts/client/requests/ListBankAccountsRequest.ts b/src/api/resources/bankAccounts/client/requests/ListBankAccountsRequest.ts index 37f1757c6..e7aa36957 100644 --- a/src/api/resources/bankAccounts/client/requests/ListBankAccountsRequest.ts +++ b/src/api/resources/bankAccounts/client/requests/ListBankAccountsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/bankAccounts/client/requests/index.ts b/src/api/resources/bankAccounts/client/requests/index.ts index f20aad70e..15a87c836 100644 --- a/src/api/resources/bankAccounts/client/requests/index.ts +++ b/src/api/resources/bankAccounts/client/requests/index.ts @@ -1,3 +1,3 @@ -export type { GetBankAccountsRequest } from "./GetBankAccountsRequest"; -export type { GetByV1IdBankAccountsRequest } from "./GetByV1IdBankAccountsRequest"; -export type { ListBankAccountsRequest } from "./ListBankAccountsRequest"; +export { type ListBankAccountsRequest } from "./ListBankAccountsRequest"; +export { type GetByV1IdBankAccountsRequest } from "./GetByV1IdBankAccountsRequest"; +export { type GetBankAccountsRequest } from "./GetBankAccountsRequest"; diff --git a/src/api/resources/bookings/client/Client.ts b/src/api/resources/bookings/client/Client.ts index 423a86aba..5c0587c79 100644 --- a/src/api/resources/bookings/client/Client.ts +++ b/src/api/resources/bookings/client/Client.ts @@ -1,49 +1,70 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; -import { CustomAttributeDefinitionsClient } from "../resources/customAttributeDefinitions/client/Client"; -import { CustomAttributesClient } from "../resources/customAttributes/client/Client"; -import { LocationProfilesClient } from "../resources/locationProfiles/client/Client"; -import { TeamMemberProfilesClient } from "../resources/teamMemberProfiles/client/Client"; - -export declare namespace BookingsClient { - export interface Options extends BaseClientOptions {} +import * as errors from "../../../../errors/index"; +import { CustomAttributeDefinitions } from "../resources/customAttributeDefinitions/client/Client"; +import { CustomAttributes } from "../resources/customAttributes/client/Client"; +import { LocationProfiles } from "../resources/locationProfiles/client/Client"; +import { TeamMemberProfiles } from "../resources/teamMemberProfiles/client/Client"; + +export declare namespace Bookings { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class BookingsClient { - protected readonly _options: BookingsClient.Options; - protected _customAttributeDefinitions: CustomAttributeDefinitionsClient | undefined; - protected _customAttributes: CustomAttributesClient | undefined; - protected _locationProfiles: LocationProfilesClient | undefined; - protected _teamMemberProfiles: TeamMemberProfilesClient | undefined; +export class Bookings { + protected readonly _options: Bookings.Options; + protected _customAttributeDefinitions: CustomAttributeDefinitions | undefined; + protected _customAttributes: CustomAttributes | undefined; + protected _locationProfiles: LocationProfiles | undefined; + protected _teamMemberProfiles: TeamMemberProfiles | undefined; - constructor(options: BookingsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Bookings.Options = {}) { + this._options = _options; } - public get customAttributeDefinitions(): CustomAttributeDefinitionsClient { - return (this._customAttributeDefinitions ??= new CustomAttributeDefinitionsClient(this._options)); + public get customAttributeDefinitions(): CustomAttributeDefinitions { + return (this._customAttributeDefinitions ??= new CustomAttributeDefinitions(this._options)); } - public get customAttributes(): CustomAttributesClient { - return (this._customAttributes ??= new CustomAttributesClient(this._options)); + public get customAttributes(): CustomAttributes { + return (this._customAttributes ??= new CustomAttributes(this._options)); } - public get locationProfiles(): LocationProfilesClient { - return (this._locationProfiles ??= new LocationProfilesClient(this._options)); + public get locationProfiles(): LocationProfiles { + return (this._locationProfiles ??= new LocationProfiles(this._options)); } - public get teamMemberProfiles(): TeamMemberProfilesClient { - return (this._teamMemberProfiles ??= new TeamMemberProfilesClient(this._options)); + public get teamMemberProfiles(): TeamMemberProfiles { + return (this._teamMemberProfiles ??= new TeamMemberProfiles(this._options)); } /** @@ -53,7 +74,7 @@ export class BookingsClient { * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. * * @param {Square.ListBookingsRequest} request - * @param {BookingsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Bookings.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.list({ @@ -68,41 +89,33 @@ export class BookingsClient { */ public async list( request: Square.ListBookingsRequest = {}, - requestOptions?: BookingsClient.RequestOptions, - ): Promise> { + requestOptions?: Bookings.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async (request: Square.ListBookingsRequest): Promise> => { const { limit, cursor, customerId, teamMemberId, locationId, startAtMin, startAtMax } = request; const _queryParams: Record = {}; if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (customerId !== undefined) { - _queryParams.customer_id = customerId; + _queryParams["customer_id"] = customerId; } if (teamMemberId !== undefined) { - _queryParams.team_member_id = teamMemberId; + _queryParams["team_member_id"] = teamMemberId; } if (locationId !== undefined) { - _queryParams.location_id = locationId; + _queryParams["location_id"] = locationId; } if (startAtMin !== undefined) { - _queryParams.start_at_min = startAtMin; + _queryParams["start_at_min"] = startAtMin; } if (startAtMax !== undefined) { - _queryParams.start_at_max = startAtMax; + _queryParams["start_at_max"] = startAtMax; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -111,13 +124,19 @@ export class BookingsClient { "v2/bookings", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -156,7 +175,7 @@ export class BookingsClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -185,7 +204,7 @@ export class BookingsClient { * or *Appointments Premium*. * * @param {Square.CreateBookingRequest} request - * @param {BookingsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Bookings.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.create({ @@ -194,23 +213,15 @@ export class BookingsClient { */ public create( request: Square.CreateBookingRequest, - requestOptions?: BookingsClient.RequestOptions, + requestOptions?: Bookings.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.CreateBookingRequest, - requestOptions?: BookingsClient.RequestOptions, + requestOptions?: Bookings.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -219,19 +230,23 @@ export class BookingsClient { "v2/bookings", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateBookingRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -278,7 +293,7 @@ export class BookingsClient { * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. * * @param {Square.SearchAvailabilityRequest} request - * @param {BookingsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Bookings.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.searchAvailability({ @@ -291,23 +306,15 @@ export class BookingsClient { */ public searchAvailability( request: Square.SearchAvailabilityRequest, - requestOptions?: BookingsClient.RequestOptions, + requestOptions?: Bookings.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__searchAvailability(request, requestOptions)); } private async __searchAvailability( request: Square.SearchAvailabilityRequest, - requestOptions?: BookingsClient.RequestOptions, + requestOptions?: Bookings.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -316,19 +323,23 @@ export class BookingsClient { "v2/bookings/availability/search", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchAvailabilityRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -377,7 +388,7 @@ export class BookingsClient { * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. * * @param {Square.BulkRetrieveBookingsRequest} request - * @param {BookingsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Bookings.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.bulkRetrieveBookings({ @@ -386,23 +397,15 @@ export class BookingsClient { */ public bulkRetrieveBookings( request: Square.BulkRetrieveBookingsRequest, - requestOptions?: BookingsClient.RequestOptions, + requestOptions?: Bookings.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__bulkRetrieveBookings(request, requestOptions)); } private async __bulkRetrieveBookings( request: Square.BulkRetrieveBookingsRequest, - requestOptions?: BookingsClient.RequestOptions, + requestOptions?: Bookings.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -411,19 +414,23 @@ export class BookingsClient { "v2/bookings/bulk-retrieve", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BulkRetrieveBookingsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -466,28 +473,20 @@ export class BookingsClient { /** * Retrieves a seller's booking profile. * - * @param {BookingsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Bookings.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.getBusinessProfile() */ public getBusinessProfile( - requestOptions?: BookingsClient.RequestOptions, + requestOptions?: Bookings.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getBusinessProfile(requestOptions)); } private async __getBusinessProfile( - requestOptions?: BookingsClient.RequestOptions, + requestOptions?: Bookings.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -496,13 +495,17 @@ export class BookingsClient { "v2/bookings/business-booking-profile", ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -548,7 +551,7 @@ export class BookingsClient { * Retrieves a seller's location booking profile. * * @param {Square.RetrieveLocationBookingProfileRequest} request - * @param {BookingsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Bookings.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.retrieveLocationBookingProfile({ @@ -557,39 +560,35 @@ export class BookingsClient { */ public retrieveLocationBookingProfile( request: Square.RetrieveLocationBookingProfileRequest, - requestOptions?: BookingsClient.RequestOptions, + requestOptions?: Bookings.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__retrieveLocationBookingProfile(request, requestOptions)); } private async __retrieveLocationBookingProfile( request: Square.RetrieveLocationBookingProfileRequest, - requestOptions?: BookingsClient.RequestOptions, + requestOptions?: Bookings.RequestOptions, ): Promise> { const { locationId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/bookings/location-booking-profiles/${core.url.encodePathParam(locationId)}`, + `v2/bookings/location-booking-profiles/${encodeURIComponent(locationId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -635,7 +634,7 @@ export class BookingsClient { * Retrieves one or more team members' booking profiles. * * @param {Square.BulkRetrieveTeamMemberBookingProfilesRequest} request - * @param {BookingsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Bookings.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.bulkRetrieveTeamMemberBookingProfiles({ @@ -644,7 +643,7 @@ export class BookingsClient { */ public bulkRetrieveTeamMemberBookingProfiles( request: Square.BulkRetrieveTeamMemberBookingProfilesRequest, - requestOptions?: BookingsClient.RequestOptions, + requestOptions?: Bookings.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise( this.__bulkRetrieveTeamMemberBookingProfiles(request, requestOptions), @@ -653,16 +652,8 @@ export class BookingsClient { private async __bulkRetrieveTeamMemberBookingProfiles( request: Square.BulkRetrieveTeamMemberBookingProfilesRequest, - requestOptions?: BookingsClient.RequestOptions, + requestOptions?: Bookings.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -671,19 +662,23 @@ export class BookingsClient { "v2/bookings/team-member-booking-profiles/bulk-retrieve", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BulkRetrieveTeamMemberBookingProfilesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -732,7 +727,7 @@ export class BookingsClient { * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. * * @param {Square.GetBookingsRequest} request - * @param {BookingsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Bookings.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.get({ @@ -741,39 +736,35 @@ export class BookingsClient { */ public get( request: Square.GetBookingsRequest, - requestOptions?: BookingsClient.RequestOptions, + requestOptions?: Bookings.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.GetBookingsRequest, - requestOptions?: BookingsClient.RequestOptions, + requestOptions?: Bookings.RequestOptions, ): Promise> { const { bookingId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/bookings/${core.url.encodePathParam(bookingId)}`, + `v2/bookings/${encodeURIComponent(bookingId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -823,7 +814,7 @@ export class BookingsClient { * or *Appointments Premium*. * * @param {Square.UpdateBookingRequest} request - * @param {BookingsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Bookings.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.update({ @@ -833,45 +824,41 @@ export class BookingsClient { */ public update( request: Square.UpdateBookingRequest, - requestOptions?: BookingsClient.RequestOptions, + requestOptions?: Bookings.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); } private async __update( request: Square.UpdateBookingRequest, - requestOptions?: BookingsClient.RequestOptions, + requestOptions?: Bookings.RequestOptions, ): Promise> { const { bookingId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/bookings/${core.url.encodePathParam(bookingId)}`, + `v2/bookings/${encodeURIComponent(bookingId)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateBookingRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -921,7 +908,7 @@ export class BookingsClient { * or *Appointments Premium*. * * @param {Square.CancelBookingRequest} request - * @param {BookingsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Bookings.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.cancel({ @@ -930,45 +917,41 @@ export class BookingsClient { */ public cancel( request: Square.CancelBookingRequest, - requestOptions?: BookingsClient.RequestOptions, + requestOptions?: Bookings.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__cancel(request, requestOptions)); } private async __cancel( request: Square.CancelBookingRequest, - requestOptions?: BookingsClient.RequestOptions, + requestOptions?: Bookings.RequestOptions, ): Promise> { const { bookingId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/bookings/${core.url.encodePathParam(bookingId)}/cancel`, + `v2/bookings/${encodeURIComponent(bookingId)}/cancel`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CancelBookingRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -1011,7 +994,7 @@ export class BookingsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/bookings/client/index.ts b/src/api/resources/bookings/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/bookings/client/index.ts +++ b/src/api/resources/bookings/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/bookings/client/requests/BulkRetrieveBookingsRequest.ts b/src/api/resources/bookings/client/requests/BulkRetrieveBookingsRequest.ts index e08ce18f1..fb06a42b6 100644 --- a/src/api/resources/bookings/client/requests/BulkRetrieveBookingsRequest.ts +++ b/src/api/resources/bookings/client/requests/BulkRetrieveBookingsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/bookings/client/requests/BulkRetrieveTeamMemberBookingProfilesRequest.ts b/src/api/resources/bookings/client/requests/BulkRetrieveTeamMemberBookingProfilesRequest.ts index 60da96685..f0d8d22fe 100644 --- a/src/api/resources/bookings/client/requests/BulkRetrieveTeamMemberBookingProfilesRequest.ts +++ b/src/api/resources/bookings/client/requests/BulkRetrieveTeamMemberBookingProfilesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/bookings/client/requests/CancelBookingRequest.ts b/src/api/resources/bookings/client/requests/CancelBookingRequest.ts index 35e1aa1e1..df9e2f50c 100644 --- a/src/api/resources/bookings/client/requests/CancelBookingRequest.ts +++ b/src/api/resources/bookings/client/requests/CancelBookingRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,7 +9,9 @@ * } */ export interface CancelBookingRequest { - /** The ID of the [Booking](entity:Booking) object representing the to-be-cancelled booking. */ + /** + * The ID of the [Booking](entity:Booking) object representing the to-be-cancelled booking. + */ bookingId: string; /** A unique key to make this request an idempotent operation. */ idempotencyKey?: string | null; diff --git a/src/api/resources/bookings/client/requests/CreateBookingRequest.ts b/src/api/resources/bookings/client/requests/CreateBookingRequest.ts index 78e01e34f..f02b87e0c 100644 --- a/src/api/resources/bookings/client/requests/CreateBookingRequest.ts +++ b/src/api/resources/bookings/client/requests/CreateBookingRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/bookings/client/requests/GetBookingsRequest.ts b/src/api/resources/bookings/client/requests/GetBookingsRequest.ts index 39a9b25da..f30022de8 100644 --- a/src/api/resources/bookings/client/requests/GetBookingsRequest.ts +++ b/src/api/resources/bookings/client/requests/GetBookingsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetBookingsRequest { - /** The ID of the [Booking](entity:Booking) object representing the to-be-retrieved booking. */ + /** + * The ID of the [Booking](entity:Booking) object representing the to-be-retrieved booking. + */ bookingId: string; } diff --git a/src/api/resources/bookings/client/requests/ListBookingsRequest.ts b/src/api/resources/bookings/client/requests/ListBookingsRequest.ts index ffd74d7f2..f8d24958d 100644 --- a/src/api/resources/bookings/client/requests/ListBookingsRequest.ts +++ b/src/api/resources/bookings/client/requests/ListBookingsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -13,18 +15,32 @@ * } */ export interface ListBookingsRequest { - /** The maximum number of results per page to return in a paged response. */ + /** + * The maximum number of results per page to return in a paged response. + */ limit?: number | null; - /** The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. */ + /** + * The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. + */ cursor?: string | null; - /** The [customer](entity:Customer) for whom to retrieve bookings. If this is not set, bookings for all customers are retrieved. */ + /** + * The [customer](entity:Customer) for whom to retrieve bookings. If this is not set, bookings for all customers are retrieved. + */ customerId?: string | null; - /** The team member for whom to retrieve bookings. If this is not set, bookings of all members are retrieved. */ + /** + * The team member for whom to retrieve bookings. If this is not set, bookings of all members are retrieved. + */ teamMemberId?: string | null; - /** The location for which to retrieve bookings. If this is not set, all locations' bookings are retrieved. */ + /** + * The location for which to retrieve bookings. If this is not set, all locations' bookings are retrieved. + */ locationId?: string | null; - /** The RFC 3339 timestamp specifying the earliest of the start time. If this is not set, the current time is used. */ + /** + * The RFC 3339 timestamp specifying the earliest of the start time. If this is not set, the current time is used. + */ startAtMin?: string | null; - /** The RFC 3339 timestamp specifying the latest of the start time. If this is not set, the time of 31 days after `start_at_min` is used. */ + /** + * The RFC 3339 timestamp specifying the latest of the start time. If this is not set, the time of 31 days after `start_at_min` is used. + */ startAtMax?: string | null; } diff --git a/src/api/resources/bookings/client/requests/RetrieveLocationBookingProfileRequest.ts b/src/api/resources/bookings/client/requests/RetrieveLocationBookingProfileRequest.ts index fffd057eb..c53c91d78 100644 --- a/src/api/resources/bookings/client/requests/RetrieveLocationBookingProfileRequest.ts +++ b/src/api/resources/bookings/client/requests/RetrieveLocationBookingProfileRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface RetrieveLocationBookingProfileRequest { - /** The ID of the location to retrieve the booking profile. */ + /** + * The ID of the location to retrieve the booking profile. + */ locationId: string; } diff --git a/src/api/resources/bookings/client/requests/SearchAvailabilityRequest.ts b/src/api/resources/bookings/client/requests/SearchAvailabilityRequest.ts index 15d46cd19..50bc2efd8 100644 --- a/src/api/resources/bookings/client/requests/SearchAvailabilityRequest.ts +++ b/src/api/resources/bookings/client/requests/SearchAvailabilityRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/bookings/client/requests/UpdateBookingRequest.ts b/src/api/resources/bookings/client/requests/UpdateBookingRequest.ts index 709aa34bb..3ed17fbab 100644 --- a/src/api/resources/bookings/client/requests/UpdateBookingRequest.ts +++ b/src/api/resources/bookings/client/requests/UpdateBookingRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -10,7 +12,9 @@ import type * as Square from "../../../../index"; * } */ export interface UpdateBookingRequest { - /** The ID of the [Booking](entity:Booking) object representing the to-be-updated booking. */ + /** + * The ID of the [Booking](entity:Booking) object representing the to-be-updated booking. + */ bookingId: string; /** A unique key to make this request an idempotent operation. */ idempotencyKey?: string | null; diff --git a/src/api/resources/bookings/client/requests/index.ts b/src/api/resources/bookings/client/requests/index.ts index 74bd1af69..3c416a42f 100644 --- a/src/api/resources/bookings/client/requests/index.ts +++ b/src/api/resources/bookings/client/requests/index.ts @@ -1,9 +1,9 @@ -export type { BulkRetrieveBookingsRequest } from "./BulkRetrieveBookingsRequest"; -export type { BulkRetrieveTeamMemberBookingProfilesRequest } from "./BulkRetrieveTeamMemberBookingProfilesRequest"; -export type { CancelBookingRequest } from "./CancelBookingRequest"; -export type { CreateBookingRequest } from "./CreateBookingRequest"; -export type { GetBookingsRequest } from "./GetBookingsRequest"; -export type { ListBookingsRequest } from "./ListBookingsRequest"; -export type { RetrieveLocationBookingProfileRequest } from "./RetrieveLocationBookingProfileRequest"; -export type { SearchAvailabilityRequest } from "./SearchAvailabilityRequest"; -export type { UpdateBookingRequest } from "./UpdateBookingRequest"; +export { type ListBookingsRequest } from "./ListBookingsRequest"; +export { type CreateBookingRequest } from "./CreateBookingRequest"; +export { type SearchAvailabilityRequest } from "./SearchAvailabilityRequest"; +export { type BulkRetrieveBookingsRequest } from "./BulkRetrieveBookingsRequest"; +export { type RetrieveLocationBookingProfileRequest } from "./RetrieveLocationBookingProfileRequest"; +export { type BulkRetrieveTeamMemberBookingProfilesRequest } from "./BulkRetrieveTeamMemberBookingProfilesRequest"; +export { type GetBookingsRequest } from "./GetBookingsRequest"; +export { type UpdateBookingRequest } from "./UpdateBookingRequest"; +export { type CancelBookingRequest } from "./CancelBookingRequest"; diff --git a/src/api/resources/bookings/resources/customAttributeDefinitions/client/Client.ts b/src/api/resources/bookings/resources/customAttributeDefinitions/client/Client.ts index 33df4821f..92d7c283d 100644 --- a/src/api/resources/bookings/resources/customAttributeDefinitions/client/Client.ts +++ b/src/api/resources/bookings/resources/customAttributeDefinitions/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace CustomAttributeDefinitionsClient { - export interface Options extends BaseClientOptions {} +export declare namespace CustomAttributeDefinitions { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class CustomAttributeDefinitionsClient { - protected readonly _options: CustomAttributeDefinitionsClient.Options; +export class CustomAttributeDefinitions { + protected readonly _options: CustomAttributeDefinitions.Options; - constructor(options: CustomAttributeDefinitionsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: CustomAttributeDefinitions.Options = {}) { + this._options = _options; } /** @@ -29,7 +50,7 @@ export class CustomAttributeDefinitionsClient { * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. * * @param {Square.bookings.ListCustomAttributeDefinitionsRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.customAttributeDefinitions.list({ @@ -39,8 +60,8 @@ export class CustomAttributeDefinitionsClient { */ public async list( request: Square.bookings.ListCustomAttributeDefinitionsRequest = {}, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, - ): Promise> { + requestOptions?: CustomAttributeDefinitions.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.bookings.ListCustomAttributeDefinitionsRequest, @@ -48,19 +69,11 @@ export class CustomAttributeDefinitionsClient { const { limit, cursor } = request; const _queryParams: Record = {}; if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -69,13 +82,19 @@ export class CustomAttributeDefinitionsClient { "v2/bookings/custom-attribute-definitions", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -116,7 +135,10 @@ export class CustomAttributeDefinitionsClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable< + Square.ListBookingCustomAttributeDefinitionsResponse, + Square.CustomAttributeDefinition + >({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -138,7 +160,7 @@ export class CustomAttributeDefinitionsClient { * or *Appointments Premium*. * * @param {Square.bookings.CreateBookingCustomAttributeDefinitionRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.customAttributeDefinitions.create({ @@ -147,23 +169,15 @@ export class CustomAttributeDefinitionsClient { */ public create( request: Square.bookings.CreateBookingCustomAttributeDefinitionRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.bookings.CreateBookingCustomAttributeDefinitionRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -172,19 +186,23 @@ export class CustomAttributeDefinitionsClient { "v2/bookings/custom-attribute-definitions", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.bookings.CreateBookingCustomAttributeDefinitionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -233,7 +251,7 @@ export class CustomAttributeDefinitionsClient { * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. * * @param {Square.bookings.GetCustomAttributeDefinitionsRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.customAttributeDefinitions.get({ @@ -243,44 +261,41 @@ export class CustomAttributeDefinitionsClient { */ public get( request: Square.bookings.GetCustomAttributeDefinitionsRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.bookings.GetCustomAttributeDefinitionsRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key, version } = request; const _queryParams: Record = {}; if (version !== undefined) { - _queryParams.version = version?.toString() ?? null; + _queryParams["version"] = version?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/bookings/custom-attribute-definitions/${core.url.encodePathParam(key)}`, + `v2/bookings/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -332,7 +347,7 @@ export class CustomAttributeDefinitionsClient { * or *Appointments Premium*. * * @param {Square.bookings.UpdateBookingCustomAttributeDefinitionRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.customAttributeDefinitions.update({ @@ -342,45 +357,41 @@ export class CustomAttributeDefinitionsClient { */ public update( request: Square.bookings.UpdateBookingCustomAttributeDefinitionRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); } private async __update( request: Square.bookings.UpdateBookingCustomAttributeDefinitionRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/bookings/custom-attribute-definitions/${core.url.encodePathParam(key)}`, + `v2/bookings/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.bookings.UpdateBookingCustomAttributeDefinitionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -432,7 +443,7 @@ export class CustomAttributeDefinitionsClient { * or *Appointments Premium*. * * @param {Square.bookings.DeleteCustomAttributeDefinitionsRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.customAttributeDefinitions.delete({ @@ -441,39 +452,35 @@ export class CustomAttributeDefinitionsClient { */ public delete( request: Square.bookings.DeleteCustomAttributeDefinitionsRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); } private async __delete( request: Square.bookings.DeleteCustomAttributeDefinitionsRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/bookings/custom-attribute-definitions/${core.url.encodePathParam(key)}`, + `v2/bookings/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -516,7 +523,7 @@ export class CustomAttributeDefinitionsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/bookings/resources/customAttributeDefinitions/client/index.ts b/src/api/resources/bookings/resources/customAttributeDefinitions/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/bookings/resources/customAttributeDefinitions/client/index.ts +++ b/src/api/resources/bookings/resources/customAttributeDefinitions/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/CreateBookingCustomAttributeDefinitionRequest.ts b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/CreateBookingCustomAttributeDefinitionRequest.ts index 7ff733005..9ca4428e5 100644 --- a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/CreateBookingCustomAttributeDefinitionRequest.ts +++ b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/CreateBookingCustomAttributeDefinitionRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts index a9c9d9ec5..6a1b34cf1 100644 --- a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface DeleteCustomAttributeDefinitionsRequest { - /** The key of the custom attribute definition to delete. */ + /** + * The key of the custom attribute definition to delete. + */ key: string; } diff --git a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts index 3de83fd32..e4c05d712 100644 --- a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts index b059525c5..ded39f5a0 100644 --- a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/UpdateBookingCustomAttributeDefinitionRequest.ts b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/UpdateBookingCustomAttributeDefinitionRequest.ts index 8de5fe948..ec3f3cb5a 100644 --- a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/UpdateBookingCustomAttributeDefinitionRequest.ts +++ b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/UpdateBookingCustomAttributeDefinitionRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -10,7 +12,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface UpdateBookingCustomAttributeDefinitionRequest { - /** The key of the custom attribute definition to update. */ + /** + * The key of the custom attribute definition to update. + */ key: string; /** * The custom attribute definition that contains the fields to update. Only the following fields can be updated: diff --git a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/index.ts b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/index.ts index c8988a76b..0dd526820 100644 --- a/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/index.ts +++ b/src/api/resources/bookings/resources/customAttributeDefinitions/client/requests/index.ts @@ -1,5 +1,5 @@ -export type { CreateBookingCustomAttributeDefinitionRequest } from "./CreateBookingCustomAttributeDefinitionRequest"; -export type { DeleteCustomAttributeDefinitionsRequest } from "./DeleteCustomAttributeDefinitionsRequest"; -export type { GetCustomAttributeDefinitionsRequest } from "./GetCustomAttributeDefinitionsRequest"; -export type { ListCustomAttributeDefinitionsRequest } from "./ListCustomAttributeDefinitionsRequest"; -export type { UpdateBookingCustomAttributeDefinitionRequest } from "./UpdateBookingCustomAttributeDefinitionRequest"; +export { type ListCustomAttributeDefinitionsRequest } from "./ListCustomAttributeDefinitionsRequest"; +export { type CreateBookingCustomAttributeDefinitionRequest } from "./CreateBookingCustomAttributeDefinitionRequest"; +export { type GetCustomAttributeDefinitionsRequest } from "./GetCustomAttributeDefinitionsRequest"; +export { type UpdateBookingCustomAttributeDefinitionRequest } from "./UpdateBookingCustomAttributeDefinitionRequest"; +export { type DeleteCustomAttributeDefinitionsRequest } from "./DeleteCustomAttributeDefinitionsRequest"; diff --git a/src/api/resources/bookings/resources/customAttributes/client/Client.ts b/src/api/resources/bookings/resources/customAttributes/client/Client.ts index c5dcaa4fb..a6be53acb 100644 --- a/src/api/resources/bookings/resources/customAttributes/client/Client.ts +++ b/src/api/resources/bookings/resources/customAttributes/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace CustomAttributesClient { - export interface Options extends BaseClientOptions {} +export declare namespace CustomAttributes { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class CustomAttributesClient { - protected readonly _options: CustomAttributesClient.Options; +export class CustomAttributes { + protected readonly _options: CustomAttributes.Options; - constructor(options: CustomAttributesClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: CustomAttributes.Options = {}) { + this._options = _options; } /** @@ -32,7 +53,7 @@ export class CustomAttributesClient { * or *Appointments Premium*. * * @param {Square.bookings.BulkDeleteBookingCustomAttributesRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.customAttributes.batchDelete({ @@ -46,23 +67,15 @@ export class CustomAttributesClient { */ public batchDelete( request: Square.bookings.BulkDeleteBookingCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__batchDelete(request, requestOptions)); } private async __batchDelete( request: Square.bookings.BulkDeleteBookingCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -71,19 +84,23 @@ export class CustomAttributesClient { "v2/bookings/custom-attributes/bulk-delete", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.bookings.BulkDeleteBookingCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -135,7 +152,7 @@ export class CustomAttributesClient { * or *Appointments Premium*. * * @param {Square.bookings.BulkUpsertBookingCustomAttributesRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.customAttributes.batchUpsert({ @@ -149,23 +166,15 @@ export class CustomAttributesClient { */ public batchUpsert( request: Square.bookings.BulkUpsertBookingCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__batchUpsert(request, requestOptions)); } private async __batchUpsert( request: Square.bookings.BulkUpsertBookingCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -174,19 +183,23 @@ export class CustomAttributesClient { "v2/bookings/custom-attributes/bulk-upsert", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.bookings.BulkUpsertBookingCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -235,7 +248,7 @@ export class CustomAttributesClient { * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. * * @param {Square.bookings.ListCustomAttributesRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.customAttributes.list({ @@ -247,8 +260,8 @@ export class CustomAttributesClient { */ public async list( request: Square.bookings.ListCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, - ): Promise> { + requestOptions?: CustomAttributes.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.bookings.ListCustomAttributesRequest, @@ -256,37 +269,35 @@ export class CustomAttributesClient { const { bookingId, limit, cursor, withDefinitions } = request; const _queryParams: Record = {}; if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (withDefinitions !== undefined) { - _queryParams.with_definitions = withDefinitions?.toString() ?? null; + _queryParams["with_definitions"] = withDefinitions?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/bookings/${core.url.encodePathParam(bookingId)}/custom-attributes`, + `v2/bookings/${encodeURIComponent(bookingId)}/custom-attributes`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -327,7 +338,7 @@ export class CustomAttributesClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -346,7 +357,7 @@ export class CustomAttributesClient { * To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope. * * @param {Square.bookings.GetCustomAttributesRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.customAttributes.get({ @@ -358,48 +369,45 @@ export class CustomAttributesClient { */ public get( request: Square.bookings.GetCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.bookings.GetCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { bookingId, key, withDefinition, version } = request; const _queryParams: Record = {}; if (withDefinition !== undefined) { - _queryParams.with_definition = withDefinition?.toString() ?? null; + _queryParams["with_definition"] = withDefinition?.toString() ?? null; } if (version !== undefined) { - _queryParams.version = version?.toString() ?? null; + _queryParams["version"] = version?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/bookings/${core.url.encodePathParam(bookingId)}/custom-attributes/${core.url.encodePathParam(key)}`, + `v2/bookings/${encodeURIComponent(bookingId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -451,7 +459,7 @@ export class CustomAttributesClient { * or *Appointments Premium*. * * @param {Square.bookings.UpsertBookingCustomAttributeRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.customAttributes.upsert({ @@ -462,45 +470,41 @@ export class CustomAttributesClient { */ public upsert( request: Square.bookings.UpsertBookingCustomAttributeRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__upsert(request, requestOptions)); } private async __upsert( request: Square.bookings.UpsertBookingCustomAttributeRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { bookingId, key, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/bookings/${core.url.encodePathParam(bookingId)}/custom-attributes/${core.url.encodePathParam(key)}`, + `v2/bookings/${encodeURIComponent(bookingId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.bookings.UpsertBookingCustomAttributeRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -552,7 +556,7 @@ export class CustomAttributesClient { * or *Appointments Premium*. * * @param {Square.bookings.DeleteCustomAttributesRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.customAttributes.delete({ @@ -562,39 +566,35 @@ export class CustomAttributesClient { */ public delete( request: Square.bookings.DeleteCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); } private async __delete( request: Square.bookings.DeleteCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { bookingId, key } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/bookings/${core.url.encodePathParam(bookingId)}/custom-attributes/${core.url.encodePathParam(key)}`, + `v2/bookings/${encodeURIComponent(bookingId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -637,7 +637,7 @@ export class CustomAttributesClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/bookings/resources/customAttributes/client/index.ts b/src/api/resources/bookings/resources/customAttributes/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/bookings/resources/customAttributes/client/index.ts +++ b/src/api/resources/bookings/resources/customAttributes/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/bookings/resources/customAttributes/client/requests/BulkDeleteBookingCustomAttributesRequest.ts b/src/api/resources/bookings/resources/customAttributes/client/requests/BulkDeleteBookingCustomAttributesRequest.ts index 3afec6d52..dd626b7a9 100644 --- a/src/api/resources/bookings/resources/customAttributes/client/requests/BulkDeleteBookingCustomAttributesRequest.ts +++ b/src/api/resources/bookings/resources/customAttributes/client/requests/BulkDeleteBookingCustomAttributesRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/bookings/resources/customAttributes/client/requests/BulkUpsertBookingCustomAttributesRequest.ts b/src/api/resources/bookings/resources/customAttributes/client/requests/BulkUpsertBookingCustomAttributesRequest.ts index f444c119e..fca36bbb3 100644 --- a/src/api/resources/bookings/resources/customAttributes/client/requests/BulkUpsertBookingCustomAttributesRequest.ts +++ b/src/api/resources/bookings/resources/customAttributes/client/requests/BulkUpsertBookingCustomAttributesRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/bookings/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts b/src/api/resources/bookings/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts index d7deb9550..1e6be8d91 100644 --- a/src/api/resources/bookings/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts +++ b/src/api/resources/bookings/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,7 +10,9 @@ * } */ export interface DeleteCustomAttributesRequest { - /** The ID of the target [booking](entity:Booking). */ + /** + * The ID of the target [booking](entity:Booking). + */ bookingId: string; /** * The key of the custom attribute to delete. This key must match the `key` of a custom diff --git a/src/api/resources/bookings/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts b/src/api/resources/bookings/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts index ee94bb88f..2dc919041 100644 --- a/src/api/resources/bookings/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts +++ b/src/api/resources/bookings/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -10,7 +12,9 @@ * } */ export interface GetCustomAttributesRequest { - /** The ID of the target [booking](entity:Booking). */ + /** + * The ID of the target [booking](entity:Booking). + */ bookingId: string; /** * The key of the custom attribute to retrieve. This key must match the `key` of a custom diff --git a/src/api/resources/bookings/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts b/src/api/resources/bookings/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts index 7d3da5f77..bab55c3f7 100644 --- a/src/api/resources/bookings/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts +++ b/src/api/resources/bookings/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -10,7 +12,9 @@ * } */ export interface ListCustomAttributesRequest { - /** The ID of the target [booking](entity:Booking). */ + /** + * The ID of the target [booking](entity:Booking). + */ bookingId: string; /** * The maximum number of results to return in a single paged response. This limit is advisory. diff --git a/src/api/resources/bookings/resources/customAttributes/client/requests/UpsertBookingCustomAttributeRequest.ts b/src/api/resources/bookings/resources/customAttributes/client/requests/UpsertBookingCustomAttributeRequest.ts index ad652461e..b65cfb25c 100644 --- a/src/api/resources/bookings/resources/customAttributes/client/requests/UpsertBookingCustomAttributeRequest.ts +++ b/src/api/resources/bookings/resources/customAttributes/client/requests/UpsertBookingCustomAttributeRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -11,7 +13,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface UpsertBookingCustomAttributeRequest { - /** The ID of the target [booking](entity:Booking). */ + /** + * The ID of the target [booking](entity:Booking). + */ bookingId: string; /** * The key of the custom attribute to create or update. This key must match the `key` of a diff --git a/src/api/resources/bookings/resources/customAttributes/client/requests/index.ts b/src/api/resources/bookings/resources/customAttributes/client/requests/index.ts index 7080551b5..3e49e8cbc 100644 --- a/src/api/resources/bookings/resources/customAttributes/client/requests/index.ts +++ b/src/api/resources/bookings/resources/customAttributes/client/requests/index.ts @@ -1,6 +1,6 @@ -export type { BulkDeleteBookingCustomAttributesRequest } from "./BulkDeleteBookingCustomAttributesRequest"; -export type { BulkUpsertBookingCustomAttributesRequest } from "./BulkUpsertBookingCustomAttributesRequest"; -export type { DeleteCustomAttributesRequest } from "./DeleteCustomAttributesRequest"; -export type { GetCustomAttributesRequest } from "./GetCustomAttributesRequest"; -export type { ListCustomAttributesRequest } from "./ListCustomAttributesRequest"; -export type { UpsertBookingCustomAttributeRequest } from "./UpsertBookingCustomAttributeRequest"; +export { type BulkDeleteBookingCustomAttributesRequest } from "./BulkDeleteBookingCustomAttributesRequest"; +export { type BulkUpsertBookingCustomAttributesRequest } from "./BulkUpsertBookingCustomAttributesRequest"; +export { type ListCustomAttributesRequest } from "./ListCustomAttributesRequest"; +export { type GetCustomAttributesRequest } from "./GetCustomAttributesRequest"; +export { type UpsertBookingCustomAttributeRequest } from "./UpsertBookingCustomAttributeRequest"; +export { type DeleteCustomAttributesRequest } from "./DeleteCustomAttributesRequest"; diff --git a/src/api/resources/bookings/resources/index.ts b/src/api/resources/bookings/resources/index.ts index a409142bf..f4f82dee8 100644 --- a/src/api/resources/bookings/resources/index.ts +++ b/src/api/resources/bookings/resources/index.ts @@ -1,8 +1,8 @@ export * as customAttributeDefinitions from "./customAttributeDefinitions"; -export * from "./customAttributeDefinitions/client/requests"; export * as customAttributes from "./customAttributes"; -export * from "./customAttributes/client/requests"; export * as locationProfiles from "./locationProfiles"; -export * from "./locationProfiles/client/requests"; export * as teamMemberProfiles from "./teamMemberProfiles"; +export * from "./customAttributeDefinitions/client/requests"; +export * from "./customAttributes/client/requests"; +export * from "./locationProfiles/client/requests"; export * from "./teamMemberProfiles/client/requests"; diff --git a/src/api/resources/bookings/resources/locationProfiles/client/Client.ts b/src/api/resources/bookings/resources/locationProfiles/client/Client.ts index 1ab1fa5ff..44df96123 100644 --- a/src/api/resources/bookings/resources/locationProfiles/client/Client.ts +++ b/src/api/resources/bookings/resources/locationProfiles/client/Client.ts @@ -1,32 +1,53 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace LocationProfilesClient { - export interface Options extends BaseClientOptions {} +export declare namespace LocationProfiles { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class LocationProfilesClient { - protected readonly _options: LocationProfilesClient.Options; +export class LocationProfiles { + protected readonly _options: LocationProfiles.Options; - constructor(options: LocationProfilesClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: LocationProfiles.Options = {}) { + this._options = _options; } /** * Lists location booking profiles of a seller. * * @param {Square.bookings.ListLocationProfilesRequest} request - * @param {LocationProfilesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {LocationProfiles.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.locationProfiles.list({ @@ -36,8 +57,8 @@ export class LocationProfilesClient { */ public async list( request: Square.bookings.ListLocationProfilesRequest = {}, - requestOptions?: LocationProfilesClient.RequestOptions, - ): Promise> { + requestOptions?: LocationProfiles.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.bookings.ListLocationProfilesRequest, @@ -45,19 +66,11 @@ export class LocationProfilesClient { const { limit, cursor } = request; const _queryParams: Record = {}; if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -66,13 +79,19 @@ export class LocationProfilesClient { "v2/bookings/location-booking-profiles", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -113,7 +132,7 @@ export class LocationProfilesClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -126,7 +145,7 @@ export class LocationProfilesClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/bookings/resources/locationProfiles/client/index.ts b/src/api/resources/bookings/resources/locationProfiles/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/bookings/resources/locationProfiles/client/index.ts +++ b/src/api/resources/bookings/resources/locationProfiles/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/bookings/resources/locationProfiles/client/requests/ListLocationProfilesRequest.ts b/src/api/resources/bookings/resources/locationProfiles/client/requests/ListLocationProfilesRequest.ts index 78b960681..03d1b8bfc 100644 --- a/src/api/resources/bookings/resources/locationProfiles/client/requests/ListLocationProfilesRequest.ts +++ b/src/api/resources/bookings/resources/locationProfiles/client/requests/ListLocationProfilesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,8 +10,12 @@ * } */ export interface ListLocationProfilesRequest { - /** The maximum number of results to return in a paged response. */ + /** + * The maximum number of results to return in a paged response. + */ limit?: number | null; - /** The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. */ + /** + * The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. + */ cursor?: string | null; } diff --git a/src/api/resources/bookings/resources/locationProfiles/client/requests/index.ts b/src/api/resources/bookings/resources/locationProfiles/client/requests/index.ts index 07a32c892..f3f432a40 100644 --- a/src/api/resources/bookings/resources/locationProfiles/client/requests/index.ts +++ b/src/api/resources/bookings/resources/locationProfiles/client/requests/index.ts @@ -1 +1 @@ -export type { ListLocationProfilesRequest } from "./ListLocationProfilesRequest"; +export { type ListLocationProfilesRequest } from "./ListLocationProfilesRequest"; diff --git a/src/api/resources/bookings/resources/teamMemberProfiles/client/Client.ts b/src/api/resources/bookings/resources/teamMemberProfiles/client/Client.ts index d73681869..33e63af52 100644 --- a/src/api/resources/bookings/resources/teamMemberProfiles/client/Client.ts +++ b/src/api/resources/bookings/resources/teamMemberProfiles/client/Client.ts @@ -1,32 +1,53 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace TeamMemberProfilesClient { - export interface Options extends BaseClientOptions {} +export declare namespace TeamMemberProfiles { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class TeamMemberProfilesClient { - protected readonly _options: TeamMemberProfilesClient.Options; +export class TeamMemberProfiles { + protected readonly _options: TeamMemberProfiles.Options; - constructor(options: TeamMemberProfilesClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: TeamMemberProfiles.Options = {}) { + this._options = _options; } /** * Lists booking profiles for team members. * * @param {Square.bookings.ListTeamMemberProfilesRequest} request - * @param {TeamMemberProfilesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {TeamMemberProfiles.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.teamMemberProfiles.list({ @@ -38,8 +59,8 @@ export class TeamMemberProfilesClient { */ public async list( request: Square.bookings.ListTeamMemberProfilesRequest = {}, - requestOptions?: TeamMemberProfilesClient.RequestOptions, - ): Promise> { + requestOptions?: TeamMemberProfiles.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.bookings.ListTeamMemberProfilesRequest, @@ -47,25 +68,17 @@ export class TeamMemberProfilesClient { const { bookableOnly, limit, cursor, locationId } = request; const _queryParams: Record = {}; if (bookableOnly !== undefined) { - _queryParams.bookable_only = bookableOnly?.toString() ?? null; + _queryParams["bookable_only"] = bookableOnly?.toString() ?? null; } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (locationId !== undefined) { - _queryParams.location_id = locationId; + _queryParams["location_id"] = locationId; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -74,13 +87,19 @@ export class TeamMemberProfilesClient { "v2/bookings/team-member-booking-profiles", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -121,7 +140,7 @@ export class TeamMemberProfilesClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -137,7 +156,7 @@ export class TeamMemberProfilesClient { * Retrieves a team member's booking profile. * * @param {Square.bookings.GetTeamMemberProfilesRequest} request - * @param {TeamMemberProfilesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {TeamMemberProfiles.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.bookings.teamMemberProfiles.get({ @@ -146,39 +165,35 @@ export class TeamMemberProfilesClient { */ public get( request: Square.bookings.GetTeamMemberProfilesRequest, - requestOptions?: TeamMemberProfilesClient.RequestOptions, + requestOptions?: TeamMemberProfiles.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.bookings.GetTeamMemberProfilesRequest, - requestOptions?: TeamMemberProfilesClient.RequestOptions, + requestOptions?: TeamMemberProfiles.RequestOptions, ): Promise> { const { teamMemberId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/bookings/team-member-booking-profiles/${core.url.encodePathParam(teamMemberId)}`, + `v2/bookings/team-member-booking-profiles/${encodeURIComponent(teamMemberId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -221,7 +236,7 @@ export class TeamMemberProfilesClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/bookings/resources/teamMemberProfiles/client/index.ts b/src/api/resources/bookings/resources/teamMemberProfiles/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/bookings/resources/teamMemberProfiles/client/index.ts +++ b/src/api/resources/bookings/resources/teamMemberProfiles/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/GetTeamMemberProfilesRequest.ts b/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/GetTeamMemberProfilesRequest.ts index 421b3fef4..8c0e22128 100644 --- a/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/GetTeamMemberProfilesRequest.ts +++ b/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/GetTeamMemberProfilesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetTeamMemberProfilesRequest { - /** The ID of the team member to retrieve. */ + /** + * The ID of the team member to retrieve. + */ teamMemberId: string; } diff --git a/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/ListTeamMemberProfilesRequest.ts b/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/ListTeamMemberProfilesRequest.ts index bcc3be659..bb7d124ab 100644 --- a/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/ListTeamMemberProfilesRequest.ts +++ b/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/ListTeamMemberProfilesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -10,12 +12,20 @@ * } */ export interface ListTeamMemberProfilesRequest { - /** Indicates whether to include only bookable team members in the returned result (`true`) or not (`false`). */ + /** + * Indicates whether to include only bookable team members in the returned result (`true`) or not (`false`). + */ bookableOnly?: boolean | null; - /** The maximum number of results to return in a paged response. */ + /** + * The maximum number of results to return in a paged response. + */ limit?: number | null; - /** The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. */ + /** + * The pagination cursor from the preceding response to return the next page of the results. Do not set this when retrieving the first page of the results. + */ cursor?: string | null; - /** Indicates whether to include only team members enabled at the given location in the returned result. */ + /** + * Indicates whether to include only team members enabled at the given location in the returned result. + */ locationId?: string | null; } diff --git a/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/index.ts b/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/index.ts index 83f7a2633..4a2788242 100644 --- a/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/index.ts +++ b/src/api/resources/bookings/resources/teamMemberProfiles/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { GetTeamMemberProfilesRequest } from "./GetTeamMemberProfilesRequest"; -export type { ListTeamMemberProfilesRequest } from "./ListTeamMemberProfilesRequest"; +export { type ListTeamMemberProfilesRequest } from "./ListTeamMemberProfilesRequest"; +export { type GetTeamMemberProfilesRequest } from "./GetTeamMemberProfilesRequest"; diff --git a/src/api/resources/cards/client/Client.ts b/src/api/resources/cards/client/Client.ts index 34127e617..03ef43f25 100644 --- a/src/api/resources/cards/client/Client.ts +++ b/src/api/resources/cards/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; +import * as serializers from "../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; -export declare namespace CardsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Cards { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class CardsClient { - protected readonly _options: CardsClient.Options; +export class Cards { + protected readonly _options: Cards.Options; - constructor(options: CardsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Cards.Options = {}) { + this._options = _options; } /** @@ -27,7 +48,7 @@ export class CardsClient { * A max of 25 cards will be returned. * * @param {Square.ListCardsRequest} request - * @param {CardsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Cards.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.cards.list({ @@ -40,38 +61,30 @@ export class CardsClient { */ public async list( request: Square.ListCardsRequest = {}, - requestOptions?: CardsClient.RequestOptions, - ): Promise> { + requestOptions?: Cards.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async (request: Square.ListCardsRequest): Promise> => { const { cursor, customerId, includeDisabled, referenceId, sortOrder } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (customerId !== undefined) { - _queryParams.customer_id = customerId; + _queryParams["customer_id"] = customerId; } if (includeDisabled !== undefined) { - _queryParams.include_disabled = includeDisabled?.toString() ?? null; + _queryParams["include_disabled"] = includeDisabled?.toString() ?? null; } if (referenceId !== undefined) { - _queryParams.reference_id = referenceId; + _queryParams["reference_id"] = referenceId; } if (sortOrder !== undefined) { - _queryParams.sort_order = serializers.SortOrder.jsonOrThrow(sortOrder, { + _queryParams["sort_order"] = serializers.SortOrder.jsonOrThrow(sortOrder, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -80,13 +93,19 @@ export class CardsClient { "v2/cards", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -125,7 +144,7 @@ export class CardsClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -141,7 +160,7 @@ export class CardsClient { * Adds a card on file to an existing merchant. * * @param {Square.CreateCardRequest} request - * @param {CardsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Cards.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.cards.create({ @@ -164,23 +183,15 @@ export class CardsClient { */ public create( request: Square.CreateCardRequest, - requestOptions?: CardsClient.RequestOptions, + requestOptions?: Cards.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.CreateCardRequest, - requestOptions?: CardsClient.RequestOptions, + requestOptions?: Cards.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -189,19 +200,23 @@ export class CardsClient { "v2/cards", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateCardRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -245,7 +260,7 @@ export class CardsClient { * Retrieves details for a specific Card. * * @param {Square.GetCardsRequest} request - * @param {CardsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Cards.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.cards.get({ @@ -254,39 +269,35 @@ export class CardsClient { */ public get( request: Square.GetCardsRequest, - requestOptions?: CardsClient.RequestOptions, + requestOptions?: Cards.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.GetCardsRequest, - requestOptions?: CardsClient.RequestOptions, + requestOptions?: Cards.RequestOptions, ): Promise> { const { cardId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/cards/${core.url.encodePathParam(cardId)}`, + `v2/cards/${encodeURIComponent(cardId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -331,7 +342,7 @@ export class CardsClient { * Disabling an already disabled card is allowed but has no effect. * * @param {Square.DisableCardsRequest} request - * @param {CardsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Cards.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.cards.disable({ @@ -340,39 +351,35 @@ export class CardsClient { */ public disable( request: Square.DisableCardsRequest, - requestOptions?: CardsClient.RequestOptions, + requestOptions?: Cards.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__disable(request, requestOptions)); } private async __disable( request: Square.DisableCardsRequest, - requestOptions?: CardsClient.RequestOptions, + requestOptions?: Cards.RequestOptions, ): Promise> { const { cardId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/cards/${core.url.encodePathParam(cardId)}/disable`, + `v2/cards/${encodeURIComponent(cardId)}/disable`, ), method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -413,7 +420,7 @@ export class CardsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/cards/client/index.ts b/src/api/resources/cards/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/cards/client/index.ts +++ b/src/api/resources/cards/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/cards/client/requests/CreateCardRequest.ts b/src/api/resources/cards/client/requests/CreateCardRequest.ts index f4b61e20b..54ac6b9bf 100644 --- a/src/api/resources/cards/client/requests/CreateCardRequest.ts +++ b/src/api/resources/cards/client/requests/CreateCardRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/cards/client/requests/DisableCardsRequest.ts b/src/api/resources/cards/client/requests/DisableCardsRequest.ts index 795af52c2..7a96d92d9 100644 --- a/src/api/resources/cards/client/requests/DisableCardsRequest.ts +++ b/src/api/resources/cards/client/requests/DisableCardsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface DisableCardsRequest { - /** Unique ID for the desired Card. */ + /** + * Unique ID for the desired Card. + */ cardId: string; } diff --git a/src/api/resources/cards/client/requests/GetCardsRequest.ts b/src/api/resources/cards/client/requests/GetCardsRequest.ts index 3e93aa5ea..c5d067993 100644 --- a/src/api/resources/cards/client/requests/GetCardsRequest.ts +++ b/src/api/resources/cards/client/requests/GetCardsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetCardsRequest { - /** Unique ID for the desired Card. */ + /** + * Unique ID for the desired Card. + */ cardId: string; } diff --git a/src/api/resources/cards/client/requests/ListCardsRequest.ts b/src/api/resources/cards/client/requests/ListCardsRequest.ts index 420f88299..ae1540aa5 100644 --- a/src/api/resources/cards/client/requests/ListCardsRequest.ts +++ b/src/api/resources/cards/client/requests/ListCardsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -30,7 +32,9 @@ export interface ListCardsRequest { * By default, all enabled cards owned by the merchant are returned. */ includeDisabled?: boolean | null; - /** Limit results to cards associated with the reference_id supplied. */ + /** + * Limit results to cards associated with the reference_id supplied. + */ referenceId?: string | null; /** * Sorts the returned list by when the card was created with the specified order. diff --git a/src/api/resources/cards/client/requests/index.ts b/src/api/resources/cards/client/requests/index.ts index 3c2f33758..5fb9592cd 100644 --- a/src/api/resources/cards/client/requests/index.ts +++ b/src/api/resources/cards/client/requests/index.ts @@ -1,4 +1,4 @@ -export type { CreateCardRequest } from "./CreateCardRequest"; -export type { DisableCardsRequest } from "./DisableCardsRequest"; -export type { GetCardsRequest } from "./GetCardsRequest"; -export type { ListCardsRequest } from "./ListCardsRequest"; +export { type ListCardsRequest } from "./ListCardsRequest"; +export { type CreateCardRequest } from "./CreateCardRequest"; +export { type GetCardsRequest } from "./GetCardsRequest"; +export { type DisableCardsRequest } from "./DisableCardsRequest"; diff --git a/src/api/resources/cashDrawers/client/Client.ts b/src/api/resources/cashDrawers/client/Client.ts index 0c62334dd..16f60e97e 100644 --- a/src/api/resources/cashDrawers/client/Client.ts +++ b/src/api/resources/cashDrawers/client/Client.ts @@ -1,22 +1,34 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; -import { ShiftsClient } from "../resources/shifts/client/Client"; +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import { Shifts } from "../resources/shifts/client/Client"; -export declare namespace CashDrawersClient { - export interface Options extends BaseClientOptions {} +export declare namespace CashDrawers { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } } -export class CashDrawersClient { - protected readonly _options: CashDrawersClient.Options; - protected _shifts: ShiftsClient | undefined; +export class CashDrawers { + protected readonly _options: CashDrawers.Options; + protected _shifts: Shifts | undefined; - constructor(options: CashDrawersClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: CashDrawers.Options = {}) { + this._options = _options; } - public get shifts(): ShiftsClient { - return (this._shifts ??= new ShiftsClient(this._options)); + public get shifts(): Shifts { + return (this._shifts ??= new Shifts(this._options)); } } diff --git a/src/api/resources/cashDrawers/resources/shifts/client/Client.ts b/src/api/resources/cashDrawers/resources/shifts/client/Client.ts index 17a834cae..350477ae3 100644 --- a/src/api/resources/cashDrawers/resources/shifts/client/Client.ts +++ b/src/api/resources/cashDrawers/resources/shifts/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; +import * as serializers from "../../../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; -import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; -export declare namespace ShiftsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Shifts { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class ShiftsClient { - protected readonly _options: ShiftsClient.Options; +export class Shifts { + protected readonly _options: Shifts.Options; - constructor(options: ShiftsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Shifts.Options = {}) { + this._options = _options; } /** @@ -27,7 +48,7 @@ export class ShiftsClient { * in a date range. * * @param {Square.cashDrawers.ListShiftsRequest} request - * @param {ShiftsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Shifts.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.cashDrawers.shifts.list({ @@ -41,41 +62,33 @@ export class ShiftsClient { */ public async list( request: Square.cashDrawers.ListShiftsRequest, - requestOptions?: ShiftsClient.RequestOptions, - ): Promise> { + requestOptions?: Shifts.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.cashDrawers.ListShiftsRequest, ): Promise> => { const { locationId, sortOrder, beginTime, endTime, limit, cursor } = request; const _queryParams: Record = {}; - _queryParams.location_id = locationId; + _queryParams["location_id"] = locationId; if (sortOrder !== undefined) { - _queryParams.sort_order = serializers.SortOrder.jsonOrThrow(sortOrder, { + _queryParams["sort_order"] = serializers.SortOrder.jsonOrThrow(sortOrder, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (beginTime !== undefined) { - _queryParams.begin_time = beginTime; + _queryParams["begin_time"] = beginTime; } if (endTime !== undefined) { - _queryParams.end_time = endTime; + _queryParams["end_time"] = endTime; } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -84,13 +97,19 @@ export class ShiftsClient { "v2/cash-drawers/shifts", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -131,7 +150,7 @@ export class ShiftsClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -148,7 +167,7 @@ export class ShiftsClient { * [ListCashDrawerShiftEvents](api-endpoint:CashDrawers-ListCashDrawerShiftEvents) for a list of cash drawer shift events. * * @param {Square.cashDrawers.GetShiftsRequest} request - * @param {ShiftsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Shifts.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.cashDrawers.shifts.get({ @@ -158,41 +177,38 @@ export class ShiftsClient { */ public get( request: Square.cashDrawers.GetShiftsRequest, - requestOptions?: ShiftsClient.RequestOptions, + requestOptions?: Shifts.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.cashDrawers.GetShiftsRequest, - requestOptions?: ShiftsClient.RequestOptions, + requestOptions?: Shifts.RequestOptions, ): Promise> { const { shiftId, locationId } = request; const _queryParams: Record = {}; - _queryParams.location_id = locationId; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); + _queryParams["location_id"] = locationId; const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/cash-drawers/shifts/${core.url.encodePathParam(shiftId)}`, + `v2/cash-drawers/shifts/${encodeURIComponent(shiftId)}`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -238,7 +254,7 @@ export class ShiftsClient { * Provides a paginated list of events for a single cash drawer shift. * * @param {Square.cashDrawers.ListEventsShiftsRequest} request - * @param {ShiftsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Shifts.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.cashDrawers.shifts.listEvents({ @@ -250,44 +266,42 @@ export class ShiftsClient { */ public async listEvents( request: Square.cashDrawers.ListEventsShiftsRequest, - requestOptions?: ShiftsClient.RequestOptions, - ): Promise> { + requestOptions?: Shifts.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.cashDrawers.ListEventsShiftsRequest, ): Promise> => { const { shiftId, locationId, limit, cursor } = request; const _queryParams: Record = {}; - _queryParams.location_id = locationId; + _queryParams["location_id"] = locationId; if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/cash-drawers/shifts/${core.url.encodePathParam(shiftId)}/events`, + `v2/cash-drawers/shifts/${encodeURIComponent(shiftId)}/events`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -328,7 +342,7 @@ export class ShiftsClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -341,7 +355,7 @@ export class ShiftsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/cashDrawers/resources/shifts/client/index.ts b/src/api/resources/cashDrawers/resources/shifts/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/cashDrawers/resources/shifts/client/index.ts +++ b/src/api/resources/cashDrawers/resources/shifts/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/cashDrawers/resources/shifts/client/requests/GetShiftsRequest.ts b/src/api/resources/cashDrawers/resources/shifts/client/requests/GetShiftsRequest.ts index 4c3f1e321..3f84d4aac 100644 --- a/src/api/resources/cashDrawers/resources/shifts/client/requests/GetShiftsRequest.ts +++ b/src/api/resources/cashDrawers/resources/shifts/client/requests/GetShiftsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,8 +10,12 @@ * } */ export interface GetShiftsRequest { - /** The shift ID. */ + /** + * The shift ID. + */ shiftId: string; - /** The ID of the location to retrieve cash drawer shifts from. */ + /** + * The ID of the location to retrieve cash drawer shifts from. + */ locationId: string; } diff --git a/src/api/resources/cashDrawers/resources/shifts/client/requests/ListEventsShiftsRequest.ts b/src/api/resources/cashDrawers/resources/shifts/client/requests/ListEventsShiftsRequest.ts index 0bd695b2d..69d274f2b 100644 --- a/src/api/resources/cashDrawers/resources/shifts/client/requests/ListEventsShiftsRequest.ts +++ b/src/api/resources/cashDrawers/resources/shifts/client/requests/ListEventsShiftsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -10,15 +12,21 @@ * } */ export interface ListEventsShiftsRequest { - /** The shift ID. */ + /** + * The shift ID. + */ shiftId: string; - /** The ID of the location to list cash drawer shifts for. */ + /** + * The ID of the location to list cash drawer shifts for. + */ locationId: string; /** * Number of resources to be returned in a page of results (200 by * default, 1000 max). */ limit?: number | null; - /** Opaque cursor for fetching the next page of results. */ + /** + * Opaque cursor for fetching the next page of results. + */ cursor?: string | null; } diff --git a/src/api/resources/cashDrawers/resources/shifts/client/requests/ListShiftsRequest.ts b/src/api/resources/cashDrawers/resources/shifts/client/requests/ListShiftsRequest.ts index 996b2695f..711f5a9cf 100644 --- a/src/api/resources/cashDrawers/resources/shifts/client/requests/ListShiftsRequest.ts +++ b/src/api/resources/cashDrawers/resources/shifts/client/requests/ListShiftsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -14,22 +16,30 @@ import type * as Square from "../../../../../../index"; * } */ export interface ListShiftsRequest { - /** The ID of the location to query for a list of cash drawer shifts. */ + /** + * The ID of the location to query for a list of cash drawer shifts. + */ locationId: string; /** * The order in which cash drawer shifts are listed in the response, * based on their opened_at field. Default value: ASC */ sortOrder?: Square.SortOrder | null; - /** The inclusive start time of the query on opened_at, in ISO 8601 format. */ + /** + * The inclusive start time of the query on opened_at, in ISO 8601 format. + */ beginTime?: string | null; - /** The exclusive end date of the query on opened_at, in ISO 8601 format. */ + /** + * The exclusive end date of the query on opened_at, in ISO 8601 format. + */ endTime?: string | null; /** * Number of cash drawer shift events in a page of results (200 by * default, 1000 max). */ limit?: number | null; - /** Opaque cursor for fetching the next page of results. */ + /** + * Opaque cursor for fetching the next page of results. + */ cursor?: string | null; } diff --git a/src/api/resources/cashDrawers/resources/shifts/client/requests/index.ts b/src/api/resources/cashDrawers/resources/shifts/client/requests/index.ts index 467468a6e..c69b4133d 100644 --- a/src/api/resources/cashDrawers/resources/shifts/client/requests/index.ts +++ b/src/api/resources/cashDrawers/resources/shifts/client/requests/index.ts @@ -1,3 +1,3 @@ -export type { GetShiftsRequest } from "./GetShiftsRequest"; -export type { ListEventsShiftsRequest } from "./ListEventsShiftsRequest"; -export type { ListShiftsRequest } from "./ListShiftsRequest"; +export { type ListShiftsRequest } from "./ListShiftsRequest"; +export { type GetShiftsRequest } from "./GetShiftsRequest"; +export { type ListEventsShiftsRequest } from "./ListEventsShiftsRequest"; diff --git a/src/api/resources/catalog/client/Client.ts b/src/api/resources/catalog/client/Client.ts index 8c5e8f886..e3890cf19 100644 --- a/src/api/resources/catalog/client/Client.ts +++ b/src/api/resources/catalog/client/Client.ts @@ -1,37 +1,58 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; -import { ImagesClient } from "../resources/images/client/Client"; -import { ObjectClient } from "../resources/object/client/Client"; - -export declare namespace CatalogClient { - export interface Options extends BaseClientOptions {} +import * as errors from "../../../../errors/index"; +import { Images } from "../resources/images/client/Client"; +import { Object_ } from "../resources/object/client/Client"; + +export declare namespace Catalog { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class CatalogClient { - protected readonly _options: CatalogClient.Options; - protected _images: ImagesClient | undefined; - protected _object: ObjectClient | undefined; +export class Catalog { + protected readonly _options: Catalog.Options; + protected _images: Images | undefined; + protected _object: Object_ | undefined; - constructor(options: CatalogClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Catalog.Options = {}) { + this._options = _options; } - public get images(): ImagesClient { - return (this._images ??= new ImagesClient(this._options)); + public get images(): Images { + return (this._images ??= new Images(this._options)); } - public get object(): ObjectClient { - return (this._object ??= new ObjectClient(this._options)); + public get object(): Object_ { + return (this._object ??= new Object_(this._options)); } /** @@ -51,7 +72,7 @@ export class CatalogClient { * delete requests are rejected with the `429` error code. * * @param {Square.BatchDeleteCatalogObjectsRequest} request - * @param {CatalogClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Catalog.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.catalog.batchDelete({ @@ -60,23 +81,15 @@ export class CatalogClient { */ public batchDelete( request: Square.BatchDeleteCatalogObjectsRequest, - requestOptions?: CatalogClient.RequestOptions, + requestOptions?: Catalog.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__batchDelete(request, requestOptions)); } private async __batchDelete( request: Square.BatchDeleteCatalogObjectsRequest, - requestOptions?: CatalogClient.RequestOptions, + requestOptions?: Catalog.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -85,19 +98,23 @@ export class CatalogClient { "v2/catalog/batch-delete", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchDeleteCatalogObjectsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -146,7 +163,7 @@ export class CatalogClient { * any [CatalogTax](entity:CatalogTax) objects that apply to it. * * @param {Square.BatchGetCatalogObjectsRequest} request - * @param {CatalogClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Catalog.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.catalog.batchGet({ @@ -156,23 +173,15 @@ export class CatalogClient { */ public batchGet( request: Square.BatchGetCatalogObjectsRequest, - requestOptions?: CatalogClient.RequestOptions, + requestOptions?: Catalog.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__batchGet(request, requestOptions)); } private async __batchGet( request: Square.BatchGetCatalogObjectsRequest, - requestOptions?: CatalogClient.RequestOptions, + requestOptions?: Catalog.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -181,19 +190,23 @@ export class CatalogClient { "v2/catalog/batch-retrieve", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchGetCatalogObjectsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -249,7 +262,7 @@ export class CatalogClient { * update requests are rejected with the `429` error code. * * @param {Square.BatchUpsertCatalogObjectsRequest} request - * @param {CatalogClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Catalog.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.catalog.batchUpsert({ @@ -273,23 +286,15 @@ export class CatalogClient { */ public batchUpsert( request: Square.BatchUpsertCatalogObjectsRequest, - requestOptions?: CatalogClient.RequestOptions, + requestOptions?: Catalog.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__batchUpsert(request, requestOptions)); } private async __batchUpsert( request: Square.BatchUpsertCatalogObjectsRequest, - requestOptions?: CatalogClient.RequestOptions, + requestOptions?: Catalog.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -298,19 +303,23 @@ export class CatalogClient { "v2/catalog/batch-upsert", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchUpsertCatalogObjectsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -354,26 +363,18 @@ export class CatalogClient { * Retrieves information about the Square Catalog API, such as batch size * limits that can be used by the `BatchUpsertCatalogObjects` endpoint. * - * @param {CatalogClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Catalog.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.catalog.info() */ - public info(requestOptions?: CatalogClient.RequestOptions): core.HttpResponsePromise { + public info(requestOptions?: Catalog.RequestOptions): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__info(requestOptions)); } private async __info( - requestOptions?: CatalogClient.RequestOptions, + requestOptions?: Catalog.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -382,13 +383,17 @@ export class CatalogClient { "v2/catalog/info", ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -439,7 +444,7 @@ export class CatalogClient { * and set the `include_deleted_objects` attribute value to `true`. * * @param {Square.ListCatalogRequest} request - * @param {CatalogClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Catalog.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.catalog.list({ @@ -450,29 +455,21 @@ export class CatalogClient { */ public async list( request: Square.ListCatalogRequest = {}, - requestOptions?: CatalogClient.RequestOptions, - ): Promise> { + requestOptions?: Catalog.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async (request: Square.ListCatalogRequest): Promise> => { const { cursor, types, catalogVersion } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (types !== undefined) { - _queryParams.types = types; + _queryParams["types"] = types; } if (catalogVersion !== undefined) { - _queryParams.catalog_version = catalogVersion?.toString() ?? null; + _queryParams["catalog_version"] = catalogVersion?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -481,13 +478,19 @@ export class CatalogClient { "v2/catalog/list", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -526,7 +529,7 @@ export class CatalogClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -551,7 +554,7 @@ export class CatalogClient { * - The both endpoints have different call conventions, including the query filter formats. * * @param {Square.SearchCatalogObjectsRequest} request - * @param {CatalogClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Catalog.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.catalog.search({ @@ -567,23 +570,15 @@ export class CatalogClient { */ public search( request: Square.SearchCatalogObjectsRequest = {}, - requestOptions?: CatalogClient.RequestOptions, + requestOptions?: Catalog.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__search(request, requestOptions)); } private async __search( request: Square.SearchCatalogObjectsRequest = {}, - requestOptions?: CatalogClient.RequestOptions, + requestOptions?: Catalog.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -592,19 +587,23 @@ export class CatalogClient { "v2/catalog/search", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchCatalogObjectsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -657,7 +656,7 @@ export class CatalogClient { * - The both endpoints use different call conventions, including the query filter formats. * * @param {Square.SearchCatalogItemsRequest} request - * @param {CatalogClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Catalog.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.catalog.searchItems({ @@ -687,23 +686,15 @@ export class CatalogClient { */ public searchItems( request: Square.SearchCatalogItemsRequest = {}, - requestOptions?: CatalogClient.RequestOptions, + requestOptions?: Catalog.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__searchItems(request, requestOptions)); } private async __searchItems( request: Square.SearchCatalogItemsRequest = {}, - requestOptions?: CatalogClient.RequestOptions, + requestOptions?: Catalog.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -712,19 +703,23 @@ export class CatalogClient { "v2/catalog/search-catalog-items", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchCatalogItemsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -772,7 +767,7 @@ export class CatalogClient { * to perform an upsert on the entire item. * * @param {Square.UpdateItemModifierListsRequest} request - * @param {CatalogClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Catalog.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.catalog.updateItemModifierLists({ @@ -783,23 +778,15 @@ export class CatalogClient { */ public updateItemModifierLists( request: Square.UpdateItemModifierListsRequest, - requestOptions?: CatalogClient.RequestOptions, + requestOptions?: Catalog.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__updateItemModifierLists(request, requestOptions)); } private async __updateItemModifierLists( request: Square.UpdateItemModifierListsRequest, - requestOptions?: CatalogClient.RequestOptions, + requestOptions?: Catalog.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -808,19 +795,23 @@ export class CatalogClient { "v2/catalog/update-item-modifier-lists", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateItemModifierListsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -868,7 +859,7 @@ export class CatalogClient { * upsert on the entire item. * * @param {Square.UpdateItemTaxesRequest} request - * @param {CatalogClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Catalog.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.catalog.updateItemTaxes({ @@ -879,23 +870,15 @@ export class CatalogClient { */ public updateItemTaxes( request: Square.UpdateItemTaxesRequest, - requestOptions?: CatalogClient.RequestOptions, + requestOptions?: Catalog.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__updateItemTaxes(request, requestOptions)); } private async __updateItemTaxes( request: Square.UpdateItemTaxesRequest, - requestOptions?: CatalogClient.RequestOptions, + requestOptions?: Catalog.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -904,19 +887,23 @@ export class CatalogClient { "v2/catalog/update-item-taxes", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateItemTaxesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -959,7 +946,7 @@ export class CatalogClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/catalog/client/index.ts b/src/api/resources/catalog/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/catalog/client/index.ts +++ b/src/api/resources/catalog/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/catalog/client/requests/BatchDeleteCatalogObjectsRequest.ts b/src/api/resources/catalog/client/requests/BatchDeleteCatalogObjectsRequest.ts index e86f61042..5928375f6 100644 --- a/src/api/resources/catalog/client/requests/BatchDeleteCatalogObjectsRequest.ts +++ b/src/api/resources/catalog/client/requests/BatchDeleteCatalogObjectsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/catalog/client/requests/BatchGetCatalogObjectsRequest.ts b/src/api/resources/catalog/client/requests/BatchGetCatalogObjectsRequest.ts index 64bb23e96..be6a46943 100644 --- a/src/api/resources/catalog/client/requests/BatchGetCatalogObjectsRequest.ts +++ b/src/api/resources/catalog/client/requests/BatchGetCatalogObjectsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/catalog/client/requests/BatchUpsertCatalogObjectsRequest.ts b/src/api/resources/catalog/client/requests/BatchUpsertCatalogObjectsRequest.ts index 2e6f983e3..07bb27415 100644 --- a/src/api/resources/catalog/client/requests/BatchUpsertCatalogObjectsRequest.ts +++ b/src/api/resources/catalog/client/requests/BatchUpsertCatalogObjectsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/catalog/client/requests/ListCatalogRequest.ts b/src/api/resources/catalog/client/requests/ListCatalogRequest.ts index 789229961..def3b3f15 100644 --- a/src/api/resources/catalog/client/requests/ListCatalogRequest.ts +++ b/src/api/resources/catalog/client/requests/ListCatalogRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/catalog/client/requests/SearchCatalogItemsRequest.ts b/src/api/resources/catalog/client/requests/SearchCatalogItemsRequest.ts index 66571563f..040e6a65f 100644 --- a/src/api/resources/catalog/client/requests/SearchCatalogItemsRequest.ts +++ b/src/api/resources/catalog/client/requests/SearchCatalogItemsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/catalog/client/requests/SearchCatalogObjectsRequest.ts b/src/api/resources/catalog/client/requests/SearchCatalogObjectsRequest.ts index 5b0cd9e39..93c4054a5 100644 --- a/src/api/resources/catalog/client/requests/SearchCatalogObjectsRequest.ts +++ b/src/api/resources/catalog/client/requests/SearchCatalogObjectsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/catalog/client/requests/UpdateItemModifierListsRequest.ts b/src/api/resources/catalog/client/requests/UpdateItemModifierListsRequest.ts index 77303ad19..993504615 100644 --- a/src/api/resources/catalog/client/requests/UpdateItemModifierListsRequest.ts +++ b/src/api/resources/catalog/client/requests/UpdateItemModifierListsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/catalog/client/requests/UpdateItemTaxesRequest.ts b/src/api/resources/catalog/client/requests/UpdateItemTaxesRequest.ts index 348d677bc..45b6420c6 100644 --- a/src/api/resources/catalog/client/requests/UpdateItemTaxesRequest.ts +++ b/src/api/resources/catalog/client/requests/UpdateItemTaxesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/catalog/client/requests/index.ts b/src/api/resources/catalog/client/requests/index.ts index 550909f08..14d4621a0 100644 --- a/src/api/resources/catalog/client/requests/index.ts +++ b/src/api/resources/catalog/client/requests/index.ts @@ -1,8 +1,8 @@ -export type { BatchDeleteCatalogObjectsRequest } from "./BatchDeleteCatalogObjectsRequest"; -export type { BatchGetCatalogObjectsRequest } from "./BatchGetCatalogObjectsRequest"; -export type { BatchUpsertCatalogObjectsRequest } from "./BatchUpsertCatalogObjectsRequest"; -export type { ListCatalogRequest } from "./ListCatalogRequest"; -export type { SearchCatalogItemsRequest } from "./SearchCatalogItemsRequest"; -export type { SearchCatalogObjectsRequest } from "./SearchCatalogObjectsRequest"; -export type { UpdateItemModifierListsRequest } from "./UpdateItemModifierListsRequest"; -export type { UpdateItemTaxesRequest } from "./UpdateItemTaxesRequest"; +export { type BatchDeleteCatalogObjectsRequest } from "./BatchDeleteCatalogObjectsRequest"; +export { type BatchGetCatalogObjectsRequest } from "./BatchGetCatalogObjectsRequest"; +export { type BatchUpsertCatalogObjectsRequest } from "./BatchUpsertCatalogObjectsRequest"; +export { type ListCatalogRequest } from "./ListCatalogRequest"; +export { type SearchCatalogObjectsRequest } from "./SearchCatalogObjectsRequest"; +export { type SearchCatalogItemsRequest } from "./SearchCatalogItemsRequest"; +export { type UpdateItemModifierListsRequest } from "./UpdateItemModifierListsRequest"; +export { type UpdateItemTaxesRequest } from "./UpdateItemTaxesRequest"; diff --git a/src/api/resources/catalog/resources/images/client/Client.ts b/src/api/resources/catalog/resources/images/client/Client.ts index 191aedf19..ffbfcbf66 100644 --- a/src/api/resources/catalog/resources/images/client/Client.ts +++ b/src/api/resources/catalog/resources/images/client/Client.ts @@ -1,26 +1,47 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; +import * as Square from "../../../../../index"; +import * as serializers from "../../../../../../serialization/index"; import { toJson } from "../../../../../../core/json"; -import * as environments from "../../../../../../environments"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; import * as errors from "../../../../../../errors/index"; -import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; -export declare namespace ImagesClient { - export interface Options extends BaseClientOptions {} +export declare namespace Images { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class ImagesClient { - protected readonly _options: ImagesClient.Options; +export class Images { + protected readonly _options: Images.Options; - constructor(options: ImagesClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Images.Options = {}) { + this._options = _options; } /** @@ -32,22 +53,21 @@ export class ImagesClient { * JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB. * * @param {Square.catalog.CreateImagesRequest} request - * @param {ImagesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Images.RequestOptions} requestOptions - Request-specific configuration. * * @example - * import { createReadStream } from "fs"; * await client.catalog.images.create({}) */ public create( request: Square.catalog.CreateImagesRequest, - requestOptions?: ImagesClient.RequestOptions, + requestOptions?: Images.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.catalog.CreateImagesRequest, - requestOptions?: ImagesClient.RequestOptions, + requestOptions?: Images.RequestOptions, ): Promise> { const _request = await core.newFormData(); if (request.request != null) { @@ -67,15 +87,6 @@ export class ImagesClient { } const _maybeEncodedRequest = await _request.getRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - ..._maybeEncodedRequest.headers, - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -84,16 +95,21 @@ export class ImagesClient { "v2/catalog/images", ), method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + ..._maybeEncodedRequest.headers, + }), + requestOptions?.headers, + ), requestType: "file", duplex: _maybeEncodedRequest.duplex, body: _maybeEncodedRequest.body, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -140,24 +156,23 @@ export class ImagesClient { * JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB. * * @param {Square.catalog.UpdateImagesRequest} request - * @param {ImagesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Images.RequestOptions} requestOptions - Request-specific configuration. * * @example - * import { createReadStream } from "fs"; * await client.catalog.images.update({ * imageId: "image_id" * }) */ public update( request: Square.catalog.UpdateImagesRequest, - requestOptions?: ImagesClient.RequestOptions, + requestOptions?: Images.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); } private async __update( request: Square.catalog.UpdateImagesRequest, - requestOptions?: ImagesClient.RequestOptions, + requestOptions?: Images.RequestOptions, ): Promise> { const _request = await core.newFormData(); if (request.request != null) { @@ -177,33 +192,29 @@ export class ImagesClient { } const _maybeEncodedRequest = await _request.getRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - ..._maybeEncodedRequest.headers, - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/catalog/images/${core.url.encodePathParam(request.imageId)}`, + `v2/catalog/images/${encodeURIComponent(request.imageId)}`, ), method: "PUT", - headers: _headers, - queryParameters: requestOptions?.queryParams, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + ..._maybeEncodedRequest.headers, + }), + requestOptions?.headers, + ), requestType: "file", duplex: _maybeEncodedRequest.duplex, body: _maybeEncodedRequest.body, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -244,7 +255,7 @@ export class ImagesClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/catalog/resources/images/client/index.ts b/src/api/resources/catalog/resources/images/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/catalog/resources/images/client/index.ts +++ b/src/api/resources/catalog/resources/images/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/catalog/resources/images/client/requests/CreateImagesRequest.ts b/src/api/resources/catalog/resources/images/client/requests/CreateImagesRequest.ts index 959ebc4d2..50d490319 100644 --- a/src/api/resources/catalog/resources/images/client/requests/CreateImagesRequest.ts +++ b/src/api/resources/catalog/resources/images/client/requests/CreateImagesRequest.ts @@ -1,7 +1,9 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as fs from "fs"; -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; +import * as fs from "fs"; /** * @example diff --git a/src/api/resources/catalog/resources/images/client/requests/UpdateImagesRequest.ts b/src/api/resources/catalog/resources/images/client/requests/UpdateImagesRequest.ts index ce4aba4af..ad56e6e59 100644 --- a/src/api/resources/catalog/resources/images/client/requests/UpdateImagesRequest.ts +++ b/src/api/resources/catalog/resources/images/client/requests/UpdateImagesRequest.ts @@ -1,7 +1,9 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as fs from "fs"; -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; +import * as fs from "fs"; /** * @example @@ -10,7 +12,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface UpdateImagesRequest { - /** The ID of the `CatalogImage` object to update the encapsulated image file. */ + /** + * The ID of the `CatalogImage` object to update the encapsulated image file. + */ imageId: string; request?: Square.UpdateCatalogImageRequest; imageFile?: File | fs.ReadStream | Blob | undefined; diff --git a/src/api/resources/catalog/resources/images/client/requests/index.ts b/src/api/resources/catalog/resources/images/client/requests/index.ts index ec7e38ae9..ebbd407bb 100644 --- a/src/api/resources/catalog/resources/images/client/requests/index.ts +++ b/src/api/resources/catalog/resources/images/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { CreateImagesRequest } from "./CreateImagesRequest"; -export type { UpdateImagesRequest } from "./UpdateImagesRequest"; +export { type CreateImagesRequest } from "./CreateImagesRequest"; +export { type UpdateImagesRequest } from "./UpdateImagesRequest"; diff --git a/src/api/resources/catalog/resources/index.ts b/src/api/resources/catalog/resources/index.ts index 842612441..cbcd61155 100644 --- a/src/api/resources/catalog/resources/index.ts +++ b/src/api/resources/catalog/resources/index.ts @@ -1,4 +1,4 @@ export * as images from "./images"; -export * from "./images/client/requests"; export * as object from "./object"; +export * from "./images/client/requests"; export * from "./object/client/requests"; diff --git a/src/api/resources/catalog/resources/object/client/Client.ts b/src/api/resources/catalog/resources/object/client/Client.ts index 653ef2342..b4c5dbf3a 100644 --- a/src/api/resources/catalog/resources/object/client/Client.ts +++ b/src/api/resources/catalog/resources/object/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace ObjectClient { - export interface Options extends BaseClientOptions {} +export declare namespace Object_ { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class ObjectClient { - protected readonly _options: ObjectClient.Options; +export class Object_ { + protected readonly _options: Object_.Options; - constructor(options: ObjectClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Object_.Options = {}) { + this._options = _options; } /** @@ -30,7 +51,7 @@ export class ObjectClient { * update requests are rejected with the `429` error code. * * @param {Square.catalog.UpsertCatalogObjectRequest} request - * @param {ObjectClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Object_.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.catalog.object.upsert({ @@ -43,23 +64,15 @@ export class ObjectClient { */ public upsert( request: Square.catalog.UpsertCatalogObjectRequest, - requestOptions?: ObjectClient.RequestOptions, + requestOptions?: Object_.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__upsert(request, requestOptions)); } private async __upsert( request: Square.catalog.UpsertCatalogObjectRequest, - requestOptions?: ObjectClient.RequestOptions, + requestOptions?: Object_.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -68,19 +81,23 @@ export class ObjectClient { "v2/catalog/object", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.catalog.UpsertCatalogObjectRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -130,7 +147,7 @@ export class ObjectClient { * any [CatalogTax](entity:CatalogTax) objects that apply to it. * * @param {Square.catalog.GetObjectRequest} request - * @param {ObjectClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Object_.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.catalog.object.get({ @@ -142,52 +159,49 @@ export class ObjectClient { */ public get( request: Square.catalog.GetObjectRequest, - requestOptions?: ObjectClient.RequestOptions, + requestOptions?: Object_.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.catalog.GetObjectRequest, - requestOptions?: ObjectClient.RequestOptions, + requestOptions?: Object_.RequestOptions, ): Promise> { const { objectId, includeRelatedObjects, catalogVersion, includeCategoryPathToRoot } = request; const _queryParams: Record = {}; if (includeRelatedObjects !== undefined) { - _queryParams.include_related_objects = includeRelatedObjects?.toString() ?? null; + _queryParams["include_related_objects"] = includeRelatedObjects?.toString() ?? null; } if (catalogVersion !== undefined) { - _queryParams.catalog_version = catalogVersion?.toString() ?? null; + _queryParams["catalog_version"] = catalogVersion?.toString() ?? null; } if (includeCategoryPathToRoot !== undefined) { - _queryParams.include_category_path_to_root = includeCategoryPathToRoot?.toString() ?? null; + _queryParams["include_category_path_to_root"] = includeCategoryPathToRoot?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/catalog/object/${core.url.encodePathParam(objectId)}`, + `v2/catalog/object/${encodeURIComponent(objectId)}`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -242,7 +256,7 @@ export class ObjectClient { * delete requests are rejected with the `429` error code. * * @param {Square.catalog.DeleteObjectRequest} request - * @param {ObjectClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Object_.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.catalog.object.delete({ @@ -251,39 +265,35 @@ export class ObjectClient { */ public delete( request: Square.catalog.DeleteObjectRequest, - requestOptions?: ObjectClient.RequestOptions, + requestOptions?: Object_.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); } private async __delete( request: Square.catalog.DeleteObjectRequest, - requestOptions?: ObjectClient.RequestOptions, + requestOptions?: Object_.RequestOptions, ): Promise> { const { objectId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/catalog/object/${core.url.encodePathParam(objectId)}`, + `v2/catalog/object/${encodeURIComponent(objectId)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -326,7 +336,7 @@ export class ObjectClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/catalog/resources/object/client/index.ts b/src/api/resources/catalog/resources/object/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/catalog/resources/object/client/index.ts +++ b/src/api/resources/catalog/resources/object/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/catalog/resources/object/client/requests/DeleteObjectRequest.ts b/src/api/resources/catalog/resources/object/client/requests/DeleteObjectRequest.ts index f34c339f7..5553a8a35 100644 --- a/src/api/resources/catalog/resources/object/client/requests/DeleteObjectRequest.ts +++ b/src/api/resources/catalog/resources/object/client/requests/DeleteObjectRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/catalog/resources/object/client/requests/GetObjectRequest.ts b/src/api/resources/catalog/resources/object/client/requests/GetObjectRequest.ts index 5d3887af9..a39970258 100644 --- a/src/api/resources/catalog/resources/object/client/requests/GetObjectRequest.ts +++ b/src/api/resources/catalog/resources/object/client/requests/GetObjectRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -10,7 +12,9 @@ * } */ export interface GetObjectRequest { - /** The object ID of any type of catalog objects to be retrieved. */ + /** + * The object ID of any type of catalog objects to be retrieved. + */ objectId: string; /** * If `true`, the response will include additional objects that are related to the diff --git a/src/api/resources/catalog/resources/object/client/requests/UpsertCatalogObjectRequest.ts b/src/api/resources/catalog/resources/object/client/requests/UpsertCatalogObjectRequest.ts index bec15210f..071efb170 100644 --- a/src/api/resources/catalog/resources/object/client/requests/UpsertCatalogObjectRequest.ts +++ b/src/api/resources/catalog/resources/object/client/requests/UpsertCatalogObjectRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/catalog/resources/object/client/requests/index.ts b/src/api/resources/catalog/resources/object/client/requests/index.ts index 11c1281ff..a974f1464 100644 --- a/src/api/resources/catalog/resources/object/client/requests/index.ts +++ b/src/api/resources/catalog/resources/object/client/requests/index.ts @@ -1,3 +1,3 @@ -export type { DeleteObjectRequest } from "./DeleteObjectRequest"; -export type { GetObjectRequest } from "./GetObjectRequest"; -export type { UpsertCatalogObjectRequest } from "./UpsertCatalogObjectRequest"; +export { type UpsertCatalogObjectRequest } from "./UpsertCatalogObjectRequest"; +export { type GetObjectRequest } from "./GetObjectRequest"; +export { type DeleteObjectRequest } from "./DeleteObjectRequest"; diff --git a/src/api/resources/channels/client/Client.ts b/src/api/resources/channels/client/Client.ts deleted file mode 100644 index 0975335ce..000000000 --- a/src/api/resources/channels/client/Client.ts +++ /dev/null @@ -1,325 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; -import * as core from "../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; - -export declare namespace ChannelsClient { - export interface Options extends BaseClientOptions {} - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class ChannelsClient { - protected readonly _options: ChannelsClient.Options; - - constructor(options: ChannelsClient.Options = {}) { - this._options = normalizeClientOptions(options); - } - - /** - * - * - * @param {Square.ListChannelsRequest} request - * @param {ChannelsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.channels.list({ - * referenceType: "UNKNOWN_TYPE", - * referenceId: "reference_id", - * status: "ACTIVE", - * cursor: "cursor", - * limit: 1 - * }) - */ - public async list( - request: Square.ListChannelsRequest = {}, - requestOptions?: ChannelsClient.RequestOptions, - ): Promise> { - const list = core.HttpResponsePromise.interceptFunction( - async (request: Square.ListChannelsRequest): Promise> => { - const { referenceType, referenceId, status, cursor, limit } = request; - const _queryParams: Record = {}; - if (referenceType !== undefined) { - _queryParams.reference_type = serializers.ReferenceType.jsonOrThrow(referenceType, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }); - } - if (referenceId !== undefined) { - _queryParams.reference_id = referenceId; - } - if (status !== undefined) { - _queryParams.status = serializers.ChannelStatus.jsonOrThrow(status, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }); - } - if (cursor !== undefined) { - _queryParams.cursor = cursor; - } - if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; - } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.SquareEnvironment.Production, - "v2/channels", - ), - method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.ListChannelsResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - if (_response.error.reason === "status-code") { - throw new errors.SquareError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - switch (_response.error.reason) { - case "non-json": - throw new errors.SquareError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse, - }); - case "timeout": - throw new errors.SquareTimeoutError("Timeout exceeded when calling GET /v2/channels."); - case "unknown": - throw new errors.SquareError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse, - }); - } - }, - ); - const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ - response: dataWithRawResponse.data, - rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: (response) => - response?.cursor != null && !(typeof response?.cursor === "string" && response?.cursor === ""), - getItems: (response) => response?.channels ?? [], - loadPage: (response) => { - return list(core.setObjectProperty(request, "cursor", response?.cursor)); - }, - }); - } - - /** - * - * - * @param {Square.BulkRetrieveChannelsRequest} request - * @param {ChannelsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.channels.bulkRetrieve({ - * channelIds: ["CH_9C03D0B59", "CH_6X139B5MN", "NOT_EXISTING"] - * }) - */ - public bulkRetrieve( - request: Square.BulkRetrieveChannelsRequest, - requestOptions?: ChannelsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__bulkRetrieve(request, requestOptions)); - } - - private async __bulkRetrieve( - request: Square.BulkRetrieveChannelsRequest, - requestOptions?: ChannelsClient.RequestOptions, - ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.SquareEnvironment.Production, - "v2/channels/bulk-retrieve", - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.BulkRetrieveChannelsRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.BulkRetrieveChannelsResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - throw new errors.SquareError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.SquareError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse, - }); - case "timeout": - throw new errors.SquareTimeoutError("Timeout exceeded when calling POST /v2/channels/bulk-retrieve."); - case "unknown": - throw new errors.SquareError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse, - }); - } - } - - /** - * - * - * @param {Square.GetChannelsRequest} request - * @param {ChannelsClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.channels.get({ - * channelId: "channel_id" - * }) - */ - public get( - request: Square.GetChannelsRequest, - requestOptions?: ChannelsClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); - } - - private async __get( - request: Square.GetChannelsRequest, - requestOptions?: ChannelsClient.RequestOptions, - ): Promise> { - const { channelId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.SquareEnvironment.Production, - `v2/channels/${core.url.encodePathParam(channelId)}`, - ), - method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.RetrieveChannelResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - throw new errors.SquareError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.SquareError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse, - }); - case "timeout": - throw new errors.SquareTimeoutError("Timeout exceeded when calling GET /v2/channels/{channel_id}."); - case "unknown": - throw new errors.SquareError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse, - }); - } - } - - protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; - if (bearer != null) { - return `Bearer ${bearer}`; - } - - return undefined; - } -} diff --git a/src/api/resources/channels/client/index.ts b/src/api/resources/channels/client/index.ts deleted file mode 100644 index 415726b7f..000000000 --- a/src/api/resources/channels/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests"; diff --git a/src/api/resources/channels/client/requests/BulkRetrieveChannelsRequest.ts b/src/api/resources/channels/client/requests/BulkRetrieveChannelsRequest.ts deleted file mode 100644 index 72ec81ea6..000000000 --- a/src/api/resources/channels/client/requests/BulkRetrieveChannelsRequest.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * channelIds: ["CH_9C03D0B59", "CH_6X139B5MN", "NOT_EXISTING"] - * } - */ -export interface BulkRetrieveChannelsRequest { - channelIds: string[]; -} diff --git a/src/api/resources/channels/client/requests/GetChannelsRequest.ts b/src/api/resources/channels/client/requests/GetChannelsRequest.ts deleted file mode 100644 index 89ae4b7f7..000000000 --- a/src/api/resources/channels/client/requests/GetChannelsRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * channelId: "channel_id" - * } - */ -export interface GetChannelsRequest { - /** A channel id */ - channelId: string; -} diff --git a/src/api/resources/channels/client/requests/ListChannelsRequest.ts b/src/api/resources/channels/client/requests/ListChannelsRequest.ts deleted file mode 100644 index c27ecb486..000000000 --- a/src/api/resources/channels/client/requests/ListChannelsRequest.ts +++ /dev/null @@ -1,29 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../../../index"; - -/** - * @example - * { - * referenceType: "UNKNOWN_TYPE", - * referenceId: "reference_id", - * status: "ACTIVE", - * cursor: "cursor", - * limit: 1 - * } - */ -export interface ListChannelsRequest { - /** Type of reference associated to channel */ - referenceType?: Square.ReferenceType | null; - /** id of reference associated to channel */ - referenceId?: string | null; - /** Status of channel */ - status?: Square.ChannelStatus | null; - /** Cursor to fetch the next result */ - cursor?: string | null; - /** - * Maximum number of results to return. - * When not provided the returned results will be cap at 100 channels. - */ - limit?: number | null; -} diff --git a/src/api/resources/channels/client/requests/index.ts b/src/api/resources/channels/client/requests/index.ts deleted file mode 100644 index 5e5f4c64a..000000000 --- a/src/api/resources/channels/client/requests/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type { BulkRetrieveChannelsRequest } from "./BulkRetrieveChannelsRequest"; -export type { GetChannelsRequest } from "./GetChannelsRequest"; -export type { ListChannelsRequest } from "./ListChannelsRequest"; diff --git a/src/api/resources/channels/index.ts b/src/api/resources/channels/index.ts deleted file mode 100644 index 5ec76921e..000000000 --- a/src/api/resources/channels/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client"; diff --git a/src/api/resources/checkout/client/Client.ts b/src/api/resources/checkout/client/Client.ts index 5825d213e..b616387fe 100644 --- a/src/api/resources/checkout/client/Client.ts +++ b/src/api/resources/checkout/client/Client.ts @@ -1,38 +1,59 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; -import { PaymentLinksClient } from "../resources/paymentLinks/client/Client"; +import * as errors from "../../../../errors/index"; +import { PaymentLinks } from "../resources/paymentLinks/client/Client"; -export declare namespace CheckoutClient { - export interface Options extends BaseClientOptions {} +export declare namespace Checkout { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class CheckoutClient { - protected readonly _options: CheckoutClient.Options; - protected _paymentLinks: PaymentLinksClient | undefined; +export class Checkout { + protected readonly _options: Checkout.Options; + protected _paymentLinks: PaymentLinks | undefined; - constructor(options: CheckoutClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Checkout.Options = {}) { + this._options = _options; } - public get paymentLinks(): PaymentLinksClient { - return (this._paymentLinks ??= new PaymentLinksClient(this._options)); + public get paymentLinks(): PaymentLinks { + return (this._paymentLinks ??= new PaymentLinks(this._options)); } /** * Retrieves the location-level settings for a Square-hosted checkout page. * * @param {Square.RetrieveLocationSettingsRequest} request - * @param {CheckoutClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Checkout.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.checkout.retrieveLocationSettings({ @@ -41,39 +62,35 @@ export class CheckoutClient { */ public retrieveLocationSettings( request: Square.RetrieveLocationSettingsRequest, - requestOptions?: CheckoutClient.RequestOptions, + requestOptions?: Checkout.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__retrieveLocationSettings(request, requestOptions)); } private async __retrieveLocationSettings( request: Square.RetrieveLocationSettingsRequest, - requestOptions?: CheckoutClient.RequestOptions, + requestOptions?: Checkout.RequestOptions, ): Promise> { const { locationId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/online-checkout/location-settings/${core.url.encodePathParam(locationId)}`, + `v2/online-checkout/location-settings/${encodeURIComponent(locationId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -119,7 +136,7 @@ export class CheckoutClient { * Updates the location-level settings for a Square-hosted checkout page. * * @param {Square.UpdateLocationSettingsRequest} request - * @param {CheckoutClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Checkout.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.checkout.updateLocationSettings({ @@ -129,45 +146,41 @@ export class CheckoutClient { */ public updateLocationSettings( request: Square.UpdateLocationSettingsRequest, - requestOptions?: CheckoutClient.RequestOptions, + requestOptions?: Checkout.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__updateLocationSettings(request, requestOptions)); } private async __updateLocationSettings( request: Square.UpdateLocationSettingsRequest, - requestOptions?: CheckoutClient.RequestOptions, + requestOptions?: Checkout.RequestOptions, ): Promise> { const { locationId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/online-checkout/location-settings/${core.url.encodePathParam(locationId)}`, + `v2/online-checkout/location-settings/${encodeURIComponent(locationId)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateLocationSettingsRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -212,28 +225,20 @@ export class CheckoutClient { /** * Retrieves the merchant-level settings for a Square-hosted checkout page. * - * @param {CheckoutClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Checkout.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.checkout.retrieveMerchantSettings() */ public retrieveMerchantSettings( - requestOptions?: CheckoutClient.RequestOptions, + requestOptions?: Checkout.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__retrieveMerchantSettings(requestOptions)); } private async __retrieveMerchantSettings( - requestOptions?: CheckoutClient.RequestOptions, + requestOptions?: Checkout.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -242,13 +247,17 @@ export class CheckoutClient { "v2/online-checkout/merchant-settings", ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -294,7 +303,7 @@ export class CheckoutClient { * Updates the merchant-level settings for a Square-hosted checkout page. * * @param {Square.UpdateMerchantSettingsRequest} request - * @param {CheckoutClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Checkout.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.checkout.updateMerchantSettings({ @@ -303,23 +312,15 @@ export class CheckoutClient { */ public updateMerchantSettings( request: Square.UpdateMerchantSettingsRequest, - requestOptions?: CheckoutClient.RequestOptions, + requestOptions?: Checkout.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__updateMerchantSettings(request, requestOptions)); } private async __updateMerchantSettings( request: Square.UpdateMerchantSettingsRequest, - requestOptions?: CheckoutClient.RequestOptions, + requestOptions?: Checkout.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -328,19 +329,23 @@ export class CheckoutClient { "v2/online-checkout/merchant-settings", ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateMerchantSettingsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -383,7 +388,7 @@ export class CheckoutClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/checkout/client/index.ts b/src/api/resources/checkout/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/checkout/client/index.ts +++ b/src/api/resources/checkout/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/checkout/client/requests/RetrieveLocationSettingsRequest.ts b/src/api/resources/checkout/client/requests/RetrieveLocationSettingsRequest.ts index 01f3b4124..71ce84a90 100644 --- a/src/api/resources/checkout/client/requests/RetrieveLocationSettingsRequest.ts +++ b/src/api/resources/checkout/client/requests/RetrieveLocationSettingsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface RetrieveLocationSettingsRequest { - /** The ID of the location for which to retrieve settings. */ + /** + * The ID of the location for which to retrieve settings. + */ locationId: string; } diff --git a/src/api/resources/checkout/client/requests/UpdateLocationSettingsRequest.ts b/src/api/resources/checkout/client/requests/UpdateLocationSettingsRequest.ts index 762c6ea9b..e94cf5f0c 100644 --- a/src/api/resources/checkout/client/requests/UpdateLocationSettingsRequest.ts +++ b/src/api/resources/checkout/client/requests/UpdateLocationSettingsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -10,7 +12,9 @@ import type * as Square from "../../../../index"; * } */ export interface UpdateLocationSettingsRequest { - /** The ID of the location for which to retrieve settings. */ + /** + * The ID of the location for which to retrieve settings. + */ locationId: string; /** Describe your updates using the `location_settings` object. Make sure it contains only the fields that have changed. */ locationSettings: Square.CheckoutLocationSettings; diff --git a/src/api/resources/checkout/client/requests/UpdateMerchantSettingsRequest.ts b/src/api/resources/checkout/client/requests/UpdateMerchantSettingsRequest.ts index 6430f9b80..d46b43bda 100644 --- a/src/api/resources/checkout/client/requests/UpdateMerchantSettingsRequest.ts +++ b/src/api/resources/checkout/client/requests/UpdateMerchantSettingsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/checkout/client/requests/index.ts b/src/api/resources/checkout/client/requests/index.ts index 760953527..ff86d69a5 100644 --- a/src/api/resources/checkout/client/requests/index.ts +++ b/src/api/resources/checkout/client/requests/index.ts @@ -1,3 +1,3 @@ -export type { RetrieveLocationSettingsRequest } from "./RetrieveLocationSettingsRequest"; -export type { UpdateLocationSettingsRequest } from "./UpdateLocationSettingsRequest"; -export type { UpdateMerchantSettingsRequest } from "./UpdateMerchantSettingsRequest"; +export { type RetrieveLocationSettingsRequest } from "./RetrieveLocationSettingsRequest"; +export { type UpdateLocationSettingsRequest } from "./UpdateLocationSettingsRequest"; +export { type UpdateMerchantSettingsRequest } from "./UpdateMerchantSettingsRequest"; diff --git a/src/api/resources/checkout/resources/paymentLinks/client/Client.ts b/src/api/resources/checkout/resources/paymentLinks/client/Client.ts index 7b1ab8db1..950f76ee3 100644 --- a/src/api/resources/checkout/resources/paymentLinks/client/Client.ts +++ b/src/api/resources/checkout/resources/paymentLinks/client/Client.ts @@ -1,32 +1,53 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace PaymentLinksClient { - export interface Options extends BaseClientOptions {} +export declare namespace PaymentLinks { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class PaymentLinksClient { - protected readonly _options: PaymentLinksClient.Options; +export class PaymentLinks { + protected readonly _options: PaymentLinks.Options; - constructor(options: PaymentLinksClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: PaymentLinks.Options = {}) { + this._options = _options; } /** * Lists all payment links. * * @param {Square.checkout.ListPaymentLinksRequest} request - * @param {PaymentLinksClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {PaymentLinks.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.checkout.paymentLinks.list({ @@ -36,8 +57,8 @@ export class PaymentLinksClient { */ public async list( request: Square.checkout.ListPaymentLinksRequest = {}, - requestOptions?: PaymentLinksClient.RequestOptions, - ): Promise> { + requestOptions?: PaymentLinks.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.checkout.ListPaymentLinksRequest, @@ -45,19 +66,11 @@ export class PaymentLinksClient { const { cursor, limit } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -66,13 +79,19 @@ export class PaymentLinksClient { "v2/online-checkout/payment-links", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -113,7 +132,7 @@ export class PaymentLinksClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -129,7 +148,7 @@ export class PaymentLinksClient { * Creates a Square-hosted checkout page. Applications can share the resulting payment link with their buyer to pay for goods and services. * * @param {Square.checkout.CreatePaymentLinkRequest} request - * @param {PaymentLinksClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {PaymentLinks.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.checkout.paymentLinks.create({ @@ -146,23 +165,15 @@ export class PaymentLinksClient { */ public create( request: Square.checkout.CreatePaymentLinkRequest = {}, - requestOptions?: PaymentLinksClient.RequestOptions, + requestOptions?: PaymentLinks.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.checkout.CreatePaymentLinkRequest = {}, - requestOptions?: PaymentLinksClient.RequestOptions, + requestOptions?: PaymentLinks.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -171,19 +182,23 @@ export class PaymentLinksClient { "v2/online-checkout/payment-links", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.checkout.CreatePaymentLinkRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -229,7 +244,7 @@ export class PaymentLinksClient { * Retrieves a payment link. * * @param {Square.checkout.GetPaymentLinksRequest} request - * @param {PaymentLinksClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {PaymentLinks.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.checkout.paymentLinks.get({ @@ -238,39 +253,35 @@ export class PaymentLinksClient { */ public get( request: Square.checkout.GetPaymentLinksRequest, - requestOptions?: PaymentLinksClient.RequestOptions, + requestOptions?: PaymentLinks.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.checkout.GetPaymentLinksRequest, - requestOptions?: PaymentLinksClient.RequestOptions, + requestOptions?: PaymentLinks.RequestOptions, ): Promise> { const { id } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/online-checkout/payment-links/${core.url.encodePathParam(id)}`, + `v2/online-checkout/payment-links/${encodeURIComponent(id)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -318,7 +329,7 @@ export class PaymentLinksClient { * You cannot update other fields such as the `order_id`, `version`, `URL`, or `timestamp` field. * * @param {Square.checkout.UpdatePaymentLinkRequest} request - * @param {PaymentLinksClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {PaymentLinks.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.checkout.paymentLinks.update({ @@ -333,45 +344,41 @@ export class PaymentLinksClient { */ public update( request: Square.checkout.UpdatePaymentLinkRequest, - requestOptions?: PaymentLinksClient.RequestOptions, + requestOptions?: PaymentLinks.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); } private async __update( request: Square.checkout.UpdatePaymentLinkRequest, - requestOptions?: PaymentLinksClient.RequestOptions, + requestOptions?: PaymentLinks.RequestOptions, ): Promise> { const { id, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/online-checkout/payment-links/${core.url.encodePathParam(id)}`, + `v2/online-checkout/payment-links/${encodeURIComponent(id)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.checkout.UpdatePaymentLinkRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -417,7 +424,7 @@ export class PaymentLinksClient { * Deletes a payment link. * * @param {Square.checkout.DeletePaymentLinksRequest} request - * @param {PaymentLinksClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {PaymentLinks.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.checkout.paymentLinks.delete({ @@ -426,39 +433,35 @@ export class PaymentLinksClient { */ public delete( request: Square.checkout.DeletePaymentLinksRequest, - requestOptions?: PaymentLinksClient.RequestOptions, + requestOptions?: PaymentLinks.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); } private async __delete( request: Square.checkout.DeletePaymentLinksRequest, - requestOptions?: PaymentLinksClient.RequestOptions, + requestOptions?: PaymentLinks.RequestOptions, ): Promise> { const { id } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/online-checkout/payment-links/${core.url.encodePathParam(id)}`, + `v2/online-checkout/payment-links/${encodeURIComponent(id)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -501,7 +504,7 @@ export class PaymentLinksClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/checkout/resources/paymentLinks/client/index.ts b/src/api/resources/checkout/resources/paymentLinks/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/checkout/resources/paymentLinks/client/index.ts +++ b/src/api/resources/checkout/resources/paymentLinks/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/checkout/resources/paymentLinks/client/requests/CreatePaymentLinkRequest.ts b/src/api/resources/checkout/resources/paymentLinks/client/requests/CreatePaymentLinkRequest.ts index 49046088f..3aff25717 100644 --- a/src/api/resources/checkout/resources/paymentLinks/client/requests/CreatePaymentLinkRequest.ts +++ b/src/api/resources/checkout/resources/paymentLinks/client/requests/CreatePaymentLinkRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/checkout/resources/paymentLinks/client/requests/DeletePaymentLinksRequest.ts b/src/api/resources/checkout/resources/paymentLinks/client/requests/DeletePaymentLinksRequest.ts index 46598a462..97f225007 100644 --- a/src/api/resources/checkout/resources/paymentLinks/client/requests/DeletePaymentLinksRequest.ts +++ b/src/api/resources/checkout/resources/paymentLinks/client/requests/DeletePaymentLinksRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface DeletePaymentLinksRequest { - /** The ID of the payment link to delete. */ + /** + * The ID of the payment link to delete. + */ id: string; } diff --git a/src/api/resources/checkout/resources/paymentLinks/client/requests/GetPaymentLinksRequest.ts b/src/api/resources/checkout/resources/paymentLinks/client/requests/GetPaymentLinksRequest.ts index 9e606f67d..d25d871be 100644 --- a/src/api/resources/checkout/resources/paymentLinks/client/requests/GetPaymentLinksRequest.ts +++ b/src/api/resources/checkout/resources/paymentLinks/client/requests/GetPaymentLinksRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetPaymentLinksRequest { - /** The ID of link to retrieve. */ + /** + * The ID of link to retrieve. + */ id: string; } diff --git a/src/api/resources/checkout/resources/paymentLinks/client/requests/ListPaymentLinksRequest.ts b/src/api/resources/checkout/resources/paymentLinks/client/requests/ListPaymentLinksRequest.ts index 325710fc8..ebcb3acd2 100644 --- a/src/api/resources/checkout/resources/paymentLinks/client/requests/ListPaymentLinksRequest.ts +++ b/src/api/resources/checkout/resources/paymentLinks/client/requests/ListPaymentLinksRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/checkout/resources/paymentLinks/client/requests/UpdatePaymentLinkRequest.ts b/src/api/resources/checkout/resources/paymentLinks/client/requests/UpdatePaymentLinkRequest.ts index 1d106ba96..52118ba6c 100644 --- a/src/api/resources/checkout/resources/paymentLinks/client/requests/UpdatePaymentLinkRequest.ts +++ b/src/api/resources/checkout/resources/paymentLinks/client/requests/UpdatePaymentLinkRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -15,7 +17,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface UpdatePaymentLinkRequest { - /** The ID of the payment link to update. */ + /** + * The ID of the payment link to update. + */ id: string; /** * The `payment_link` object describing the updates to apply. diff --git a/src/api/resources/checkout/resources/paymentLinks/client/requests/index.ts b/src/api/resources/checkout/resources/paymentLinks/client/requests/index.ts index 07f94c75f..f201fa065 100644 --- a/src/api/resources/checkout/resources/paymentLinks/client/requests/index.ts +++ b/src/api/resources/checkout/resources/paymentLinks/client/requests/index.ts @@ -1,5 +1,5 @@ -export type { CreatePaymentLinkRequest } from "./CreatePaymentLinkRequest"; -export type { DeletePaymentLinksRequest } from "./DeletePaymentLinksRequest"; -export type { GetPaymentLinksRequest } from "./GetPaymentLinksRequest"; -export type { ListPaymentLinksRequest } from "./ListPaymentLinksRequest"; -export type { UpdatePaymentLinkRequest } from "./UpdatePaymentLinkRequest"; +export { type ListPaymentLinksRequest } from "./ListPaymentLinksRequest"; +export { type CreatePaymentLinkRequest } from "./CreatePaymentLinkRequest"; +export { type GetPaymentLinksRequest } from "./GetPaymentLinksRequest"; +export { type UpdatePaymentLinkRequest } from "./UpdatePaymentLinkRequest"; +export { type DeletePaymentLinksRequest } from "./DeletePaymentLinksRequest"; diff --git a/src/api/resources/customers/client/Client.ts b/src/api/resources/customers/client/Client.ts index 748a6c5b0..e669e92c9 100644 --- a/src/api/resources/customers/client/Client.ts +++ b/src/api/resources/customers/client/Client.ts @@ -1,55 +1,76 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; +import * as serializers from "../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; -import { CardsClient } from "../resources/cards/client/Client"; -import { CustomAttributeDefinitionsClient } from "../resources/customAttributeDefinitions/client/Client"; -import { CustomAttributesClient } from "../resources/customAttributes/client/Client"; -import { GroupsClient } from "../resources/groups/client/Client"; -import { SegmentsClient } from "../resources/segments/client/Client"; +import { CustomAttributeDefinitions } from "../resources/customAttributeDefinitions/client/Client"; +import { Groups } from "../resources/groups/client/Client"; +import { Segments } from "../resources/segments/client/Client"; +import { Cards } from "../resources/cards/client/Client"; +import { CustomAttributes } from "../resources/customAttributes/client/Client"; -export declare namespace CustomersClient { - export interface Options extends BaseClientOptions {} +export declare namespace Customers { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class CustomersClient { - protected readonly _options: CustomersClient.Options; - protected _customAttributeDefinitions: CustomAttributeDefinitionsClient | undefined; - protected _groups: GroupsClient | undefined; - protected _segments: SegmentsClient | undefined; - protected _cards: CardsClient | undefined; - protected _customAttributes: CustomAttributesClient | undefined; +export class Customers { + protected readonly _options: Customers.Options; + protected _customAttributeDefinitions: CustomAttributeDefinitions | undefined; + protected _groups: Groups | undefined; + protected _segments: Segments | undefined; + protected _cards: Cards | undefined; + protected _customAttributes: CustomAttributes | undefined; - constructor(options: CustomersClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Customers.Options = {}) { + this._options = _options; } - public get customAttributeDefinitions(): CustomAttributeDefinitionsClient { - return (this._customAttributeDefinitions ??= new CustomAttributeDefinitionsClient(this._options)); + public get customAttributeDefinitions(): CustomAttributeDefinitions { + return (this._customAttributeDefinitions ??= new CustomAttributeDefinitions(this._options)); } - public get groups(): GroupsClient { - return (this._groups ??= new GroupsClient(this._options)); + public get groups(): Groups { + return (this._groups ??= new Groups(this._options)); } - public get segments(): SegmentsClient { - return (this._segments ??= new SegmentsClient(this._options)); + public get segments(): Segments { + return (this._segments ??= new Segments(this._options)); } - public get cards(): CardsClient { - return (this._cards ??= new CardsClient(this._options)); + public get cards(): Cards { + return (this._cards ??= new Cards(this._options)); } - public get customAttributes(): CustomAttributesClient { - return (this._customAttributes ??= new CustomAttributesClient(this._options)); + public get customAttributes(): CustomAttributes { + return (this._customAttributes ??= new CustomAttributes(this._options)); } /** @@ -60,7 +81,7 @@ export class CustomersClient { * profiles can take closer to one minute or longer, especially during network incidents and outages. * * @param {Square.ListCustomersRequest} request - * @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Customers.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.list({ @@ -73,8 +94,8 @@ export class CustomersClient { */ public async list( request: Square.ListCustomersRequest = {}, - requestOptions?: CustomersClient.RequestOptions, - ): Promise> { + requestOptions?: Customers.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.ListCustomersRequest, @@ -82,34 +103,26 @@ export class CustomersClient { const { cursor, limit, sortField, sortOrder, count } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (sortField !== undefined) { - _queryParams.sort_field = serializers.CustomerSortField.jsonOrThrow(sortField, { + _queryParams["sort_field"] = serializers.CustomerSortField.jsonOrThrow(sortField, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (sortOrder !== undefined) { - _queryParams.sort_order = serializers.SortOrder.jsonOrThrow(sortOrder, { + _queryParams["sort_order"] = serializers.SortOrder.jsonOrThrow(sortOrder, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (count !== undefined) { - _queryParams.count = count?.toString() ?? null; + _queryParams["count"] = count?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -118,13 +131,19 @@ export class CustomersClient { "v2/customers", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -163,7 +182,7 @@ export class CustomersClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -188,7 +207,7 @@ export class CustomersClient { * - `phone_number` * * @param {Square.CreateCustomerRequest} request - * @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Customers.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.create({ @@ -210,23 +229,15 @@ export class CustomersClient { */ public create( request: Square.CreateCustomerRequest = {}, - requestOptions?: CustomersClient.RequestOptions, + requestOptions?: Customers.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.CreateCustomerRequest = {}, - requestOptions?: CustomersClient.RequestOptions, + requestOptions?: Customers.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -235,19 +246,23 @@ export class CustomersClient { "v2/customers", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateCustomerRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -301,7 +316,7 @@ export class CustomersClient { * - `phone_number` * * @param {Square.BulkCreateCustomersRequest} request - * @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Customers.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.batchCreate({ @@ -343,23 +358,15 @@ export class CustomersClient { */ public batchCreate( request: Square.BulkCreateCustomersRequest, - requestOptions?: CustomersClient.RequestOptions, + requestOptions?: Customers.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__batchCreate(request, requestOptions)); } private async __batchCreate( request: Square.BulkCreateCustomersRequest, - requestOptions?: CustomersClient.RequestOptions, + requestOptions?: Customers.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -368,19 +375,23 @@ export class CustomersClient { "v2/customers/bulk-create", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BulkCreateCustomersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -426,7 +437,7 @@ export class CustomersClient { * The endpoint takes a list of customer IDs and returns a map of responses. * * @param {Square.BulkDeleteCustomersRequest} request - * @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Customers.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.bulkDeleteCustomers({ @@ -435,23 +446,15 @@ export class CustomersClient { */ public bulkDeleteCustomers( request: Square.BulkDeleteCustomersRequest, - requestOptions?: CustomersClient.RequestOptions, + requestOptions?: Customers.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__bulkDeleteCustomers(request, requestOptions)); } private async __bulkDeleteCustomers( request: Square.BulkDeleteCustomersRequest, - requestOptions?: CustomersClient.RequestOptions, + requestOptions?: Customers.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -460,19 +463,23 @@ export class CustomersClient { "v2/customers/bulk-delete", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BulkDeleteCustomersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -518,7 +525,7 @@ export class CustomersClient { * This endpoint takes a list of customer IDs and returns a map of responses. * * @param {Square.BulkRetrieveCustomersRequest} request - * @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Customers.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.bulkRetrieveCustomers({ @@ -527,23 +534,15 @@ export class CustomersClient { */ public bulkRetrieveCustomers( request: Square.BulkRetrieveCustomersRequest, - requestOptions?: CustomersClient.RequestOptions, + requestOptions?: Customers.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__bulkRetrieveCustomers(request, requestOptions)); } private async __bulkRetrieveCustomers( request: Square.BulkRetrieveCustomersRequest, - requestOptions?: CustomersClient.RequestOptions, + requestOptions?: Customers.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -552,19 +551,23 @@ export class CustomersClient { "v2/customers/bulk-retrieve", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BulkRetrieveCustomersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -610,7 +613,7 @@ export class CustomersClient { * This endpoint takes a map of individual update requests and returns a map of responses. * * @param {Square.BulkUpdateCustomersRequest} request - * @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Customers.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.bulkUpdateCustomers({ @@ -630,23 +633,15 @@ export class CustomersClient { */ public bulkUpdateCustomers( request: Square.BulkUpdateCustomersRequest, - requestOptions?: CustomersClient.RequestOptions, + requestOptions?: Customers.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__bulkUpdateCustomers(request, requestOptions)); } private async __bulkUpdateCustomers( request: Square.BulkUpdateCustomersRequest, - requestOptions?: CustomersClient.RequestOptions, + requestOptions?: Customers.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -655,19 +650,23 @@ export class CustomersClient { "v2/customers/bulk-update", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BulkUpdateCustomersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -719,7 +718,7 @@ export class CustomersClient { * profiles can take closer to one minute or longer, especially during network incidents and outages. * * @param {Square.SearchCustomersRequest} request - * @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Customers.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.search({ @@ -750,23 +749,15 @@ export class CustomersClient { */ public search( request: Square.SearchCustomersRequest = {}, - requestOptions?: CustomersClient.RequestOptions, + requestOptions?: Customers.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__search(request, requestOptions)); } private async __search( request: Square.SearchCustomersRequest = {}, - requestOptions?: CustomersClient.RequestOptions, + requestOptions?: Customers.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -775,19 +766,23 @@ export class CustomersClient { "v2/customers/search", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchCustomersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -831,7 +826,7 @@ export class CustomersClient { * Returns details for a single customer. * * @param {Square.GetCustomersRequest} request - * @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Customers.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.get({ @@ -840,39 +835,35 @@ export class CustomersClient { */ public get( request: Square.GetCustomersRequest, - requestOptions?: CustomersClient.RequestOptions, + requestOptions?: Customers.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.GetCustomersRequest, - requestOptions?: CustomersClient.RequestOptions, + requestOptions?: Customers.RequestOptions, ): Promise> { const { customerId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/customers/${core.url.encodePathParam(customerId)}`, + `v2/customers/${encodeURIComponent(customerId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -919,7 +910,7 @@ export class CustomersClient { * To update a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. * * @param {Square.UpdateCustomerRequest} request - * @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Customers.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.update({ @@ -931,45 +922,41 @@ export class CustomersClient { */ public update( request: Square.UpdateCustomerRequest, - requestOptions?: CustomersClient.RequestOptions, + requestOptions?: Customers.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); } private async __update( request: Square.UpdateCustomerRequest, - requestOptions?: CustomersClient.RequestOptions, + requestOptions?: Customers.RequestOptions, ): Promise> { const { customerId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/customers/${core.url.encodePathParam(customerId)}`, + `v2/customers/${encodeURIComponent(customerId)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateCustomerRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -1015,7 +1002,7 @@ export class CustomersClient { * To delete a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. * * @param {Square.DeleteCustomersRequest} request - * @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Customers.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.delete({ @@ -1025,44 +1012,41 @@ export class CustomersClient { */ public delete( request: Square.DeleteCustomersRequest, - requestOptions?: CustomersClient.RequestOptions, + requestOptions?: Customers.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); } private async __delete( request: Square.DeleteCustomersRequest, - requestOptions?: CustomersClient.RequestOptions, + requestOptions?: Customers.RequestOptions, ): Promise> { const { customerId, version } = request; const _queryParams: Record = {}; if (version !== undefined) { - _queryParams.version = version?.toString() ?? null; + _queryParams["version"] = version?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/customers/${core.url.encodePathParam(customerId)}`, + `v2/customers/${encodeURIComponent(customerId)}`, ), method: "DELETE", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -1105,7 +1089,7 @@ export class CustomersClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/customers/client/index.ts b/src/api/resources/customers/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/customers/client/index.ts +++ b/src/api/resources/customers/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/customers/client/requests/BulkCreateCustomersRequest.ts b/src/api/resources/customers/client/requests/BulkCreateCustomersRequest.ts index 844c36522..95a024d18 100644 --- a/src/api/resources/customers/client/requests/BulkCreateCustomersRequest.ts +++ b/src/api/resources/customers/client/requests/BulkCreateCustomersRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/customers/client/requests/BulkDeleteCustomersRequest.ts b/src/api/resources/customers/client/requests/BulkDeleteCustomersRequest.ts index db897b451..125111848 100644 --- a/src/api/resources/customers/client/requests/BulkDeleteCustomersRequest.ts +++ b/src/api/resources/customers/client/requests/BulkDeleteCustomersRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/customers/client/requests/BulkRetrieveCustomersRequest.ts b/src/api/resources/customers/client/requests/BulkRetrieveCustomersRequest.ts index 9ca779f0f..99a7568c7 100644 --- a/src/api/resources/customers/client/requests/BulkRetrieveCustomersRequest.ts +++ b/src/api/resources/customers/client/requests/BulkRetrieveCustomersRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/customers/client/requests/BulkUpdateCustomersRequest.ts b/src/api/resources/customers/client/requests/BulkUpdateCustomersRequest.ts index 76409fde8..2af49f166 100644 --- a/src/api/resources/customers/client/requests/BulkUpdateCustomersRequest.ts +++ b/src/api/resources/customers/client/requests/BulkUpdateCustomersRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/customers/client/requests/CreateCustomerRequest.ts b/src/api/resources/customers/client/requests/CreateCustomerRequest.ts index 0326055ed..3aeb62979 100644 --- a/src/api/resources/customers/client/requests/CreateCustomerRequest.ts +++ b/src/api/resources/customers/client/requests/CreateCustomerRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/customers/client/requests/DeleteCustomersRequest.ts b/src/api/resources/customers/client/requests/DeleteCustomersRequest.ts index c32e263c4..7e0dc540a 100644 --- a/src/api/resources/customers/client/requests/DeleteCustomersRequest.ts +++ b/src/api/resources/customers/client/requests/DeleteCustomersRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,7 +10,9 @@ * } */ export interface DeleteCustomersRequest { - /** The ID of the customer to delete. */ + /** + * The ID of the customer to delete. + */ customerId: string; /** * The current version of the customer profile. diff --git a/src/api/resources/customers/client/requests/GetCustomersRequest.ts b/src/api/resources/customers/client/requests/GetCustomersRequest.ts index 6ceee6583..5e5f54091 100644 --- a/src/api/resources/customers/client/requests/GetCustomersRequest.ts +++ b/src/api/resources/customers/client/requests/GetCustomersRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetCustomersRequest { - /** The ID of the customer to retrieve. */ + /** + * The ID of the customer to retrieve. + */ customerId: string; } diff --git a/src/api/resources/customers/client/requests/ListCustomersRequest.ts b/src/api/resources/customers/client/requests/ListCustomersRequest.ts index 35aa50e56..c10f2c512 100644 --- a/src/api/resources/customers/client/requests/ListCustomersRequest.ts +++ b/src/api/resources/customers/client/requests/ListCustomersRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/customers/client/requests/SearchCustomersRequest.ts b/src/api/resources/customers/client/requests/SearchCustomersRequest.ts index fcb3917d7..898381ffd 100644 --- a/src/api/resources/customers/client/requests/SearchCustomersRequest.ts +++ b/src/api/resources/customers/client/requests/SearchCustomersRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/customers/client/requests/UpdateCustomerRequest.ts b/src/api/resources/customers/client/requests/UpdateCustomerRequest.ts index fc9a8eba8..8aae7b1ec 100644 --- a/src/api/resources/customers/client/requests/UpdateCustomerRequest.ts +++ b/src/api/resources/customers/client/requests/UpdateCustomerRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -12,7 +14,9 @@ import type * as Square from "../../../../index"; * } */ export interface UpdateCustomerRequest { - /** The ID of the customer to update. */ + /** + * The ID of the customer to update. + */ customerId: string; /** * The given name (that is, the first name) associated with the customer profile. diff --git a/src/api/resources/customers/client/requests/index.ts b/src/api/resources/customers/client/requests/index.ts index a43a19c18..01de7b583 100644 --- a/src/api/resources/customers/client/requests/index.ts +++ b/src/api/resources/customers/client/requests/index.ts @@ -1,10 +1,10 @@ -export type { BulkCreateCustomersRequest } from "./BulkCreateCustomersRequest"; -export type { BulkDeleteCustomersRequest } from "./BulkDeleteCustomersRequest"; -export type { BulkRetrieveCustomersRequest } from "./BulkRetrieveCustomersRequest"; -export type { BulkUpdateCustomersRequest } from "./BulkUpdateCustomersRequest"; -export type { CreateCustomerRequest } from "./CreateCustomerRequest"; -export type { DeleteCustomersRequest } from "./DeleteCustomersRequest"; -export type { GetCustomersRequest } from "./GetCustomersRequest"; -export type { ListCustomersRequest } from "./ListCustomersRequest"; -export type { SearchCustomersRequest } from "./SearchCustomersRequest"; -export type { UpdateCustomerRequest } from "./UpdateCustomerRequest"; +export { type ListCustomersRequest } from "./ListCustomersRequest"; +export { type CreateCustomerRequest } from "./CreateCustomerRequest"; +export { type BulkCreateCustomersRequest } from "./BulkCreateCustomersRequest"; +export { type BulkDeleteCustomersRequest } from "./BulkDeleteCustomersRequest"; +export { type BulkRetrieveCustomersRequest } from "./BulkRetrieveCustomersRequest"; +export { type BulkUpdateCustomersRequest } from "./BulkUpdateCustomersRequest"; +export { type SearchCustomersRequest } from "./SearchCustomersRequest"; +export { type GetCustomersRequest } from "./GetCustomersRequest"; +export { type UpdateCustomerRequest } from "./UpdateCustomerRequest"; +export { type DeleteCustomersRequest } from "./DeleteCustomersRequest"; diff --git a/src/api/resources/customers/resources/cards/client/Client.ts b/src/api/resources/customers/resources/cards/client/Client.ts index 4e4e36436..f73bd187a 100644 --- a/src/api/resources/customers/resources/cards/client/Client.ts +++ b/src/api/resources/customers/resources/cards/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace CardsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Cards { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class CardsClient { - protected readonly _options: CardsClient.Options; +export class Cards { + protected readonly _options: Cards.Options; - constructor(options: CardsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Cards.Options = {}) { + this._options = _options; } /** @@ -30,7 +51,7 @@ export class CardsClient { * with the provided nonce during the _first_ call. * * @param {Square.customers.CreateCustomerCardRequest} request - * @param {CardsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Cards.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.cards.create({ @@ -49,45 +70,41 @@ export class CardsClient { */ public create( request: Square.customers.CreateCustomerCardRequest, - requestOptions?: CardsClient.RequestOptions, + requestOptions?: Cards.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.customers.CreateCustomerCardRequest, - requestOptions?: CardsClient.RequestOptions, + requestOptions?: Cards.RequestOptions, ): Promise> { const { customerId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/customers/${core.url.encodePathParam(customerId)}/cards`, + `v2/customers/${encodeURIComponent(customerId)}/cards`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.customers.CreateCustomerCardRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -133,7 +150,7 @@ export class CardsClient { * Removes a card on file from a customer. * * @param {Square.customers.DeleteCardsRequest} request - * @param {CardsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Cards.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.cards.delete({ @@ -143,39 +160,35 @@ export class CardsClient { */ public delete( request: Square.customers.DeleteCardsRequest, - requestOptions?: CardsClient.RequestOptions, + requestOptions?: Cards.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); } private async __delete( request: Square.customers.DeleteCardsRequest, - requestOptions?: CardsClient.RequestOptions, + requestOptions?: Cards.RequestOptions, ): Promise> { const { customerId, cardId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/customers/${core.url.encodePathParam(customerId)}/cards/${core.url.encodePathParam(cardId)}`, + `v2/customers/${encodeURIComponent(customerId)}/cards/${encodeURIComponent(cardId)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -218,7 +231,7 @@ export class CardsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/customers/resources/cards/client/index.ts b/src/api/resources/customers/resources/cards/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/customers/resources/cards/client/index.ts +++ b/src/api/resources/customers/resources/cards/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/customers/resources/cards/client/requests/CreateCustomerCardRequest.ts b/src/api/resources/customers/resources/cards/client/requests/CreateCustomerCardRequest.ts index e394cc7ff..05226b95c 100644 --- a/src/api/resources/customers/resources/cards/client/requests/CreateCustomerCardRequest.ts +++ b/src/api/resources/customers/resources/cards/client/requests/CreateCustomerCardRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -19,7 +21,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface CreateCustomerCardRequest { - /** The Square ID of the customer profile the card is linked to. */ + /** + * The Square ID of the customer profile the card is linked to. + */ customerId: string; /** * A card nonce representing the credit card to link to the customer. diff --git a/src/api/resources/customers/resources/cards/client/requests/DeleteCardsRequest.ts b/src/api/resources/customers/resources/cards/client/requests/DeleteCardsRequest.ts index 6abffd498..b21e54b56 100644 --- a/src/api/resources/customers/resources/cards/client/requests/DeleteCardsRequest.ts +++ b/src/api/resources/customers/resources/cards/client/requests/DeleteCardsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,8 +10,12 @@ * } */ export interface DeleteCardsRequest { - /** The ID of the customer that the card on file belongs to. */ + /** + * The ID of the customer that the card on file belongs to. + */ customerId: string; - /** The ID of the card on file to delete. */ + /** + * The ID of the card on file to delete. + */ cardId: string; } diff --git a/src/api/resources/customers/resources/cards/client/requests/index.ts b/src/api/resources/customers/resources/cards/client/requests/index.ts index b30438186..f9b2da688 100644 --- a/src/api/resources/customers/resources/cards/client/requests/index.ts +++ b/src/api/resources/customers/resources/cards/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { CreateCustomerCardRequest } from "./CreateCustomerCardRequest"; -export type { DeleteCardsRequest } from "./DeleteCardsRequest"; +export { type CreateCustomerCardRequest } from "./CreateCustomerCardRequest"; +export { type DeleteCardsRequest } from "./DeleteCardsRequest"; diff --git a/src/api/resources/customers/resources/customAttributeDefinitions/client/Client.ts b/src/api/resources/customers/resources/customAttributeDefinitions/client/Client.ts index ab2242066..b355fe41a 100644 --- a/src/api/resources/customers/resources/customAttributeDefinitions/client/Client.ts +++ b/src/api/resources/customers/resources/customAttributeDefinitions/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace CustomAttributeDefinitionsClient { - export interface Options extends BaseClientOptions {} +export declare namespace CustomAttributeDefinitions { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class CustomAttributeDefinitionsClient { - protected readonly _options: CustomAttributeDefinitionsClient.Options; +export class CustomAttributeDefinitions { + protected readonly _options: CustomAttributeDefinitions.Options; - constructor(options: CustomAttributeDefinitionsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: CustomAttributeDefinitions.Options = {}) { + this._options = _options; } /** @@ -31,7 +52,7 @@ export class CustomAttributeDefinitionsClient { * seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.customers.ListCustomAttributeDefinitionsRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.customAttributeDefinitions.list({ @@ -41,8 +62,8 @@ export class CustomAttributeDefinitionsClient { */ public async list( request: Square.customers.ListCustomAttributeDefinitionsRequest = {}, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, - ): Promise> { + requestOptions?: CustomAttributeDefinitions.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.customers.ListCustomAttributeDefinitionsRequest, @@ -50,19 +71,11 @@ export class CustomAttributeDefinitionsClient { const { limit, cursor } = request; const _queryParams: Record = {}; if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -71,13 +84,19 @@ export class CustomAttributeDefinitionsClient { "v2/customers/custom-attribute-definitions", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -118,7 +137,10 @@ export class CustomAttributeDefinitionsClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable< + Square.ListCustomerCustomAttributeDefinitionsResponse, + Square.CustomAttributeDefinition + >({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -144,7 +166,7 @@ export class CustomAttributeDefinitionsClient { * `VISIBILITY_HIDDEN`. * * @param {Square.customers.CreateCustomerCustomAttributeDefinitionRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.customAttributeDefinitions.create({ @@ -161,23 +183,15 @@ export class CustomAttributeDefinitionsClient { */ public create( request: Square.customers.CreateCustomerCustomAttributeDefinitionRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.customers.CreateCustomerCustomAttributeDefinitionRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -186,19 +200,23 @@ export class CustomAttributeDefinitionsClient { "v2/customers/custom-attribute-definitions", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.customers.CreateCustomerCustomAttributeDefinitionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -248,7 +266,7 @@ export class CustomAttributeDefinitionsClient { * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.customers.GetCustomAttributeDefinitionsRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.customAttributeDefinitions.get({ @@ -258,44 +276,41 @@ export class CustomAttributeDefinitionsClient { */ public get( request: Square.customers.GetCustomAttributeDefinitionsRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.customers.GetCustomAttributeDefinitionsRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key, version } = request; const _queryParams: Record = {}; if (version !== undefined) { - _queryParams.version = version?.toString() ?? null; + _queryParams["version"] = version?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/customers/custom-attribute-definitions/${core.url.encodePathParam(key)}`, + `v2/customers/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -347,7 +362,7 @@ export class CustomAttributeDefinitionsClient { * all custom attributes in exported customer data, including those set to `VISIBILITY_HIDDEN`. * * @param {Square.customers.UpdateCustomerCustomAttributeDefinitionRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.customAttributeDefinitions.update({ @@ -360,45 +375,41 @@ export class CustomAttributeDefinitionsClient { */ public update( request: Square.customers.UpdateCustomerCustomAttributeDefinitionRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); } private async __update( request: Square.customers.UpdateCustomerCustomAttributeDefinitionRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/customers/custom-attribute-definitions/${core.url.encodePathParam(key)}`, + `v2/customers/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.customers.UpdateCustomerCustomAttributeDefinitionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -449,7 +460,7 @@ export class CustomAttributeDefinitionsClient { * Only the definition owner can delete a custom attribute definition. * * @param {Square.customers.DeleteCustomAttributeDefinitionsRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.customAttributeDefinitions.delete({ @@ -458,39 +469,35 @@ export class CustomAttributeDefinitionsClient { */ public delete( request: Square.customers.DeleteCustomAttributeDefinitionsRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); } private async __delete( request: Square.customers.DeleteCustomAttributeDefinitionsRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/customers/custom-attribute-definitions/${core.url.encodePathParam(key)}`, + `v2/customers/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -549,7 +556,7 @@ export class CustomAttributeDefinitionsClient { * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.customers.BatchUpsertCustomerCustomAttributesRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.customAttributeDefinitions.batchUpsert({ @@ -594,23 +601,15 @@ export class CustomAttributeDefinitionsClient { */ public batchUpsert( request: Square.customers.BatchUpsertCustomerCustomAttributesRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__batchUpsert(request, requestOptions)); } private async __batchUpsert( request: Square.customers.BatchUpsertCustomerCustomAttributesRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -619,19 +618,23 @@ export class CustomAttributeDefinitionsClient { "v2/customers/custom-attributes/bulk-upsert", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.customers.BatchUpsertCustomerCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -674,7 +677,7 @@ export class CustomAttributeDefinitionsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/customers/resources/customAttributeDefinitions/client/index.ts b/src/api/resources/customers/resources/customAttributeDefinitions/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/customers/resources/customAttributeDefinitions/client/index.ts +++ b/src/api/resources/customers/resources/customAttributeDefinitions/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/BatchUpsertCustomerCustomAttributesRequest.ts b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/BatchUpsertCustomerCustomAttributesRequest.ts index df09804dd..a4550a3fe 100644 --- a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/BatchUpsertCustomerCustomAttributesRequest.ts +++ b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/BatchUpsertCustomerCustomAttributesRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/CreateCustomerCustomAttributeDefinitionRequest.ts b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/CreateCustomerCustomAttributeDefinitionRequest.ts index ecdb0b4aa..33e0d7815 100644 --- a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/CreateCustomerCustomAttributeDefinitionRequest.ts +++ b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/CreateCustomerCustomAttributeDefinitionRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts index a9c9d9ec5..6a1b34cf1 100644 --- a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface DeleteCustomAttributeDefinitionsRequest { - /** The key of the custom attribute definition to delete. */ + /** + * The key of the custom attribute definition to delete. + */ key: string; } diff --git a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts index 3de83fd32..e4c05d712 100644 --- a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts index b059525c5..ded39f5a0 100644 --- a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/UpdateCustomerCustomAttributeDefinitionRequest.ts b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/UpdateCustomerCustomAttributeDefinitionRequest.ts index a279ad36a..1a6d65104 100644 --- a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/UpdateCustomerCustomAttributeDefinitionRequest.ts +++ b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/UpdateCustomerCustomAttributeDefinitionRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -13,7 +15,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface UpdateCustomerCustomAttributeDefinitionRequest { - /** The key of the custom attribute definition to update. */ + /** + * The key of the custom attribute definition to update. + */ key: string; /** * The custom attribute definition that contains the fields to update. This endpoint diff --git a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/index.ts b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/index.ts index f83a54385..5ad73b714 100644 --- a/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/index.ts +++ b/src/api/resources/customers/resources/customAttributeDefinitions/client/requests/index.ts @@ -1,6 +1,6 @@ -export type { BatchUpsertCustomerCustomAttributesRequest } from "./BatchUpsertCustomerCustomAttributesRequest"; -export type { CreateCustomerCustomAttributeDefinitionRequest } from "./CreateCustomerCustomAttributeDefinitionRequest"; -export type { DeleteCustomAttributeDefinitionsRequest } from "./DeleteCustomAttributeDefinitionsRequest"; -export type { GetCustomAttributeDefinitionsRequest } from "./GetCustomAttributeDefinitionsRequest"; -export type { ListCustomAttributeDefinitionsRequest } from "./ListCustomAttributeDefinitionsRequest"; -export type { UpdateCustomerCustomAttributeDefinitionRequest } from "./UpdateCustomerCustomAttributeDefinitionRequest"; +export { type ListCustomAttributeDefinitionsRequest } from "./ListCustomAttributeDefinitionsRequest"; +export { type CreateCustomerCustomAttributeDefinitionRequest } from "./CreateCustomerCustomAttributeDefinitionRequest"; +export { type GetCustomAttributeDefinitionsRequest } from "./GetCustomAttributeDefinitionsRequest"; +export { type UpdateCustomerCustomAttributeDefinitionRequest } from "./UpdateCustomerCustomAttributeDefinitionRequest"; +export { type DeleteCustomAttributeDefinitionsRequest } from "./DeleteCustomAttributeDefinitionsRequest"; +export { type BatchUpsertCustomerCustomAttributesRequest } from "./BatchUpsertCustomerCustomAttributesRequest"; diff --git a/src/api/resources/customers/resources/customAttributes/client/Client.ts b/src/api/resources/customers/resources/customAttributes/client/Client.ts index b7f710c5a..4146e7f19 100644 --- a/src/api/resources/customers/resources/customAttributes/client/Client.ts +++ b/src/api/resources/customers/resources/customAttributes/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace CustomAttributesClient { - export interface Options extends BaseClientOptions {} +export declare namespace CustomAttributes { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class CustomAttributesClient { - protected readonly _options: CustomAttributesClient.Options; +export class CustomAttributes { + protected readonly _options: CustomAttributes.Options; - constructor(options: CustomAttributesClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: CustomAttributes.Options = {}) { + this._options = _options; } /** @@ -33,7 +54,7 @@ export class CustomAttributesClient { * and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.customers.ListCustomAttributesRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.customAttributes.list({ @@ -45,8 +66,8 @@ export class CustomAttributesClient { */ public async list( request: Square.customers.ListCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, - ): Promise> { + requestOptions?: CustomAttributes.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.customers.ListCustomAttributesRequest, @@ -54,37 +75,35 @@ export class CustomAttributesClient { const { customerId, limit, cursor, withDefinitions } = request; const _queryParams: Record = {}; if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (withDefinitions !== undefined) { - _queryParams.with_definitions = withDefinitions?.toString() ?? null; + _queryParams["with_definitions"] = withDefinitions?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/customers/${core.url.encodePathParam(customerId)}/custom-attributes`, + `v2/customers/${encodeURIComponent(customerId)}/custom-attributes`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -125,7 +144,7 @@ export class CustomAttributesClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -148,7 +167,7 @@ export class CustomAttributesClient { * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.customers.GetCustomAttributesRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.customAttributes.get({ @@ -160,48 +179,45 @@ export class CustomAttributesClient { */ public get( request: Square.customers.GetCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.customers.GetCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { customerId, key, withDefinition, version } = request; const _queryParams: Record = {}; if (withDefinition !== undefined) { - _queryParams.with_definition = withDefinition?.toString() ?? null; + _queryParams["with_definition"] = withDefinition?.toString() ?? null; } if (version !== undefined) { - _queryParams.version = version?.toString() ?? null; + _queryParams["version"] = version?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/customers/${core.url.encodePathParam(customerId)}/custom-attributes/${core.url.encodePathParam(key)}`, + `v2/customers/${encodeURIComponent(customerId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -255,7 +271,7 @@ export class CustomAttributesClient { * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.customers.UpsertCustomerCustomAttributeRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.customAttributes.upsert({ @@ -268,45 +284,41 @@ export class CustomAttributesClient { */ public upsert( request: Square.customers.UpsertCustomerCustomAttributeRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__upsert(request, requestOptions)); } private async __upsert( request: Square.customers.UpsertCustomerCustomAttributeRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { customerId, key, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/customers/${core.url.encodePathParam(customerId)}/custom-attributes/${core.url.encodePathParam(key)}`, + `v2/customers/${encodeURIComponent(customerId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.customers.UpsertCustomerCustomAttributeRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -356,7 +368,7 @@ export class CustomAttributesClient { * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.customers.DeleteCustomAttributesRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.customAttributes.delete({ @@ -366,39 +378,35 @@ export class CustomAttributesClient { */ public delete( request: Square.customers.DeleteCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); } private async __delete( request: Square.customers.DeleteCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { customerId, key } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/customers/${core.url.encodePathParam(customerId)}/custom-attributes/${core.url.encodePathParam(key)}`, + `v2/customers/${encodeURIComponent(customerId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -441,7 +449,7 @@ export class CustomAttributesClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/customers/resources/customAttributes/client/index.ts b/src/api/resources/customers/resources/customAttributes/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/customers/resources/customAttributes/client/index.ts +++ b/src/api/resources/customers/resources/customAttributes/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/customers/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts b/src/api/resources/customers/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts index 45be858bf..fd96e16a6 100644 --- a/src/api/resources/customers/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts +++ b/src/api/resources/customers/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,7 +10,9 @@ * } */ export interface DeleteCustomAttributesRequest { - /** The ID of the target [customer profile](entity:Customer). */ + /** + * The ID of the target [customer profile](entity:Customer). + */ customerId: string; /** * The key of the custom attribute to delete. This key must match the `key` of a custom diff --git a/src/api/resources/customers/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts b/src/api/resources/customers/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts index d92b68b07..dec991b8a 100644 --- a/src/api/resources/customers/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts +++ b/src/api/resources/customers/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -10,7 +12,9 @@ * } */ export interface GetCustomAttributesRequest { - /** The ID of the target [customer profile](entity:Customer). */ + /** + * The ID of the target [customer profile](entity:Customer). + */ customerId: string; /** * The key of the custom attribute to retrieve. This key must match the `key` of a custom diff --git a/src/api/resources/customers/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts b/src/api/resources/customers/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts index 7811b43bf..61d16f54a 100644 --- a/src/api/resources/customers/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts +++ b/src/api/resources/customers/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -10,7 +12,9 @@ * } */ export interface ListCustomAttributesRequest { - /** The ID of the target [customer profile](entity:Customer). */ + /** + * The ID of the target [customer profile](entity:Customer). + */ customerId: string; /** * The maximum number of results to return in a single paged response. This limit is advisory. diff --git a/src/api/resources/customers/resources/customAttributes/client/requests/UpsertCustomerCustomAttributeRequest.ts b/src/api/resources/customers/resources/customAttributes/client/requests/UpsertCustomerCustomAttributeRequest.ts index baa5c49f5..c9728624d 100644 --- a/src/api/resources/customers/resources/customAttributes/client/requests/UpsertCustomerCustomAttributeRequest.ts +++ b/src/api/resources/customers/resources/customAttributes/client/requests/UpsertCustomerCustomAttributeRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -13,7 +15,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface UpsertCustomerCustomAttributeRequest { - /** The ID of the target [customer profile](entity:Customer). */ + /** + * The ID of the target [customer profile](entity:Customer). + */ customerId: string; /** * The key of the custom attribute to create or update. This key must match the `key` of a diff --git a/src/api/resources/customers/resources/customAttributes/client/requests/index.ts b/src/api/resources/customers/resources/customAttributes/client/requests/index.ts index 48ae5a3cb..db9a23463 100644 --- a/src/api/resources/customers/resources/customAttributes/client/requests/index.ts +++ b/src/api/resources/customers/resources/customAttributes/client/requests/index.ts @@ -1,4 +1,4 @@ -export type { DeleteCustomAttributesRequest } from "./DeleteCustomAttributesRequest"; -export type { GetCustomAttributesRequest } from "./GetCustomAttributesRequest"; -export type { ListCustomAttributesRequest } from "./ListCustomAttributesRequest"; -export type { UpsertCustomerCustomAttributeRequest } from "./UpsertCustomerCustomAttributeRequest"; +export { type ListCustomAttributesRequest } from "./ListCustomAttributesRequest"; +export { type GetCustomAttributesRequest } from "./GetCustomAttributesRequest"; +export { type UpsertCustomerCustomAttributeRequest } from "./UpsertCustomerCustomAttributeRequest"; +export { type DeleteCustomAttributesRequest } from "./DeleteCustomAttributesRequest"; diff --git a/src/api/resources/customers/resources/groups/client/Client.ts b/src/api/resources/customers/resources/groups/client/Client.ts index 778f7d564..2d65a4533 100644 --- a/src/api/resources/customers/resources/groups/client/Client.ts +++ b/src/api/resources/customers/resources/groups/client/Client.ts @@ -1,32 +1,53 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace GroupsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Groups { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class GroupsClient { - protected readonly _options: GroupsClient.Options; +export class Groups { + protected readonly _options: Groups.Options; - constructor(options: GroupsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Groups.Options = {}) { + this._options = _options; } /** * Retrieves the list of customer groups of a business. * * @param {Square.customers.ListGroupsRequest} request - * @param {GroupsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Groups.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.groups.list({ @@ -36,8 +57,8 @@ export class GroupsClient { */ public async list( request: Square.customers.ListGroupsRequest = {}, - requestOptions?: GroupsClient.RequestOptions, - ): Promise> { + requestOptions?: Groups.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.customers.ListGroupsRequest, @@ -45,19 +66,11 @@ export class GroupsClient { const { cursor, limit } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -66,13 +79,19 @@ export class GroupsClient { "v2/customers/groups", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -111,7 +130,7 @@ export class GroupsClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -129,7 +148,7 @@ export class GroupsClient { * The request must include the `name` value of the group. * * @param {Square.customers.CreateCustomerGroupRequest} request - * @param {GroupsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Groups.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.groups.create({ @@ -140,23 +159,15 @@ export class GroupsClient { */ public create( request: Square.customers.CreateCustomerGroupRequest, - requestOptions?: GroupsClient.RequestOptions, + requestOptions?: Groups.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.customers.CreateCustomerGroupRequest, - requestOptions?: GroupsClient.RequestOptions, + requestOptions?: Groups.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -165,19 +176,23 @@ export class GroupsClient { "v2/customers/groups", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.customers.CreateCustomerGroupRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -221,7 +236,7 @@ export class GroupsClient { * Retrieves a specific customer group as identified by the `group_id` value. * * @param {Square.customers.GetGroupsRequest} request - * @param {GroupsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Groups.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.groups.get({ @@ -230,39 +245,35 @@ export class GroupsClient { */ public get( request: Square.customers.GetGroupsRequest, - requestOptions?: GroupsClient.RequestOptions, + requestOptions?: Groups.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.customers.GetGroupsRequest, - requestOptions?: GroupsClient.RequestOptions, + requestOptions?: Groups.RequestOptions, ): Promise> { const { groupId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/customers/groups/${core.url.encodePathParam(groupId)}`, + `v2/customers/groups/${encodeURIComponent(groupId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -308,7 +319,7 @@ export class GroupsClient { * Updates a customer group as identified by the `group_id` value. * * @param {Square.customers.UpdateCustomerGroupRequest} request - * @param {GroupsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Groups.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.groups.update({ @@ -320,45 +331,41 @@ export class GroupsClient { */ public update( request: Square.customers.UpdateCustomerGroupRequest, - requestOptions?: GroupsClient.RequestOptions, + requestOptions?: Groups.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); } private async __update( request: Square.customers.UpdateCustomerGroupRequest, - requestOptions?: GroupsClient.RequestOptions, + requestOptions?: Groups.RequestOptions, ): Promise> { const { groupId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/customers/groups/${core.url.encodePathParam(groupId)}`, + `v2/customers/groups/${encodeURIComponent(groupId)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.customers.UpdateCustomerGroupRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -404,7 +411,7 @@ export class GroupsClient { * Deletes a customer group as identified by the `group_id` value. * * @param {Square.customers.DeleteGroupsRequest} request - * @param {GroupsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Groups.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.groups.delete({ @@ -413,39 +420,35 @@ export class GroupsClient { */ public delete( request: Square.customers.DeleteGroupsRequest, - requestOptions?: GroupsClient.RequestOptions, + requestOptions?: Groups.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); } private async __delete( request: Square.customers.DeleteGroupsRequest, - requestOptions?: GroupsClient.RequestOptions, + requestOptions?: Groups.RequestOptions, ): Promise> { const { groupId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/customers/groups/${core.url.encodePathParam(groupId)}`, + `v2/customers/groups/${encodeURIComponent(groupId)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -494,7 +497,7 @@ export class GroupsClient { * and the customer group is identified by the `group_id` value. * * @param {Square.customers.AddGroupsRequest} request - * @param {GroupsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Groups.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.groups.add({ @@ -504,39 +507,35 @@ export class GroupsClient { */ public add( request: Square.customers.AddGroupsRequest, - requestOptions?: GroupsClient.RequestOptions, + requestOptions?: Groups.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__add(request, requestOptions)); } private async __add( request: Square.customers.AddGroupsRequest, - requestOptions?: GroupsClient.RequestOptions, + requestOptions?: Groups.RequestOptions, ): Promise> { const { customerId, groupId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/customers/${core.url.encodePathParam(customerId)}/groups/${core.url.encodePathParam(groupId)}`, + `v2/customers/${encodeURIComponent(customerId)}/groups/${encodeURIComponent(groupId)}`, ), method: "PUT", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -585,7 +584,7 @@ export class GroupsClient { * and the customer group is identified by the `group_id` value. * * @param {Square.customers.RemoveGroupsRequest} request - * @param {GroupsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Groups.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.groups.remove({ @@ -595,39 +594,35 @@ export class GroupsClient { */ public remove( request: Square.customers.RemoveGroupsRequest, - requestOptions?: GroupsClient.RequestOptions, + requestOptions?: Groups.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__remove(request, requestOptions)); } private async __remove( request: Square.customers.RemoveGroupsRequest, - requestOptions?: GroupsClient.RequestOptions, + requestOptions?: Groups.RequestOptions, ): Promise> { const { customerId, groupId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/customers/${core.url.encodePathParam(customerId)}/groups/${core.url.encodePathParam(groupId)}`, + `v2/customers/${encodeURIComponent(customerId)}/groups/${encodeURIComponent(groupId)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -670,7 +665,7 @@ export class GroupsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/customers/resources/groups/client/index.ts b/src/api/resources/customers/resources/groups/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/customers/resources/groups/client/index.ts +++ b/src/api/resources/customers/resources/groups/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/customers/resources/groups/client/requests/AddGroupsRequest.ts b/src/api/resources/customers/resources/groups/client/requests/AddGroupsRequest.ts index fbcec87d4..df2f570ea 100644 --- a/src/api/resources/customers/resources/groups/client/requests/AddGroupsRequest.ts +++ b/src/api/resources/customers/resources/groups/client/requests/AddGroupsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,8 +10,12 @@ * } */ export interface AddGroupsRequest { - /** The ID of the customer to add to a group. */ + /** + * The ID of the customer to add to a group. + */ customerId: string; - /** The ID of the customer group to add the customer to. */ + /** + * The ID of the customer group to add the customer to. + */ groupId: string; } diff --git a/src/api/resources/customers/resources/groups/client/requests/CreateCustomerGroupRequest.ts b/src/api/resources/customers/resources/groups/client/requests/CreateCustomerGroupRequest.ts index 9a4521c2f..4bbad8d1a 100644 --- a/src/api/resources/customers/resources/groups/client/requests/CreateCustomerGroupRequest.ts +++ b/src/api/resources/customers/resources/groups/client/requests/CreateCustomerGroupRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/customers/resources/groups/client/requests/DeleteGroupsRequest.ts b/src/api/resources/customers/resources/groups/client/requests/DeleteGroupsRequest.ts index 65ede93bb..42f86baa1 100644 --- a/src/api/resources/customers/resources/groups/client/requests/DeleteGroupsRequest.ts +++ b/src/api/resources/customers/resources/groups/client/requests/DeleteGroupsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface DeleteGroupsRequest { - /** The ID of the customer group to delete. */ + /** + * The ID of the customer group to delete. + */ groupId: string; } diff --git a/src/api/resources/customers/resources/groups/client/requests/GetGroupsRequest.ts b/src/api/resources/customers/resources/groups/client/requests/GetGroupsRequest.ts index dc11c0b6b..2ee379d62 100644 --- a/src/api/resources/customers/resources/groups/client/requests/GetGroupsRequest.ts +++ b/src/api/resources/customers/resources/groups/client/requests/GetGroupsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetGroupsRequest { - /** The ID of the customer group to retrieve. */ + /** + * The ID of the customer group to retrieve. + */ groupId: string; } diff --git a/src/api/resources/customers/resources/groups/client/requests/ListGroupsRequest.ts b/src/api/resources/customers/resources/groups/client/requests/ListGroupsRequest.ts index 41097252d..8f5ce9765 100644 --- a/src/api/resources/customers/resources/groups/client/requests/ListGroupsRequest.ts +++ b/src/api/resources/customers/resources/groups/client/requests/ListGroupsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/customers/resources/groups/client/requests/RemoveGroupsRequest.ts b/src/api/resources/customers/resources/groups/client/requests/RemoveGroupsRequest.ts index 8ddc34ab1..5404edfa6 100644 --- a/src/api/resources/customers/resources/groups/client/requests/RemoveGroupsRequest.ts +++ b/src/api/resources/customers/resources/groups/client/requests/RemoveGroupsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,8 +10,12 @@ * } */ export interface RemoveGroupsRequest { - /** The ID of the customer to remove from the group. */ + /** + * The ID of the customer to remove from the group. + */ customerId: string; - /** The ID of the customer group to remove the customer from. */ + /** + * The ID of the customer group to remove the customer from. + */ groupId: string; } diff --git a/src/api/resources/customers/resources/groups/client/requests/UpdateCustomerGroupRequest.ts b/src/api/resources/customers/resources/groups/client/requests/UpdateCustomerGroupRequest.ts index e735b6a4a..d1655a132 100644 --- a/src/api/resources/customers/resources/groups/client/requests/UpdateCustomerGroupRequest.ts +++ b/src/api/resources/customers/resources/groups/client/requests/UpdateCustomerGroupRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -12,7 +14,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface UpdateCustomerGroupRequest { - /** The ID of the customer group to update. */ + /** + * The ID of the customer group to update. + */ groupId: string; /** The `CustomerGroup` object including all the updates you want to make. */ group: Square.CustomerGroup; diff --git a/src/api/resources/customers/resources/groups/client/requests/index.ts b/src/api/resources/customers/resources/groups/client/requests/index.ts index 2cc28237c..8b20adcd7 100644 --- a/src/api/resources/customers/resources/groups/client/requests/index.ts +++ b/src/api/resources/customers/resources/groups/client/requests/index.ts @@ -1,7 +1,7 @@ -export type { AddGroupsRequest } from "./AddGroupsRequest"; -export type { CreateCustomerGroupRequest } from "./CreateCustomerGroupRequest"; -export type { DeleteGroupsRequest } from "./DeleteGroupsRequest"; -export type { GetGroupsRequest } from "./GetGroupsRequest"; -export type { ListGroupsRequest } from "./ListGroupsRequest"; -export type { RemoveGroupsRequest } from "./RemoveGroupsRequest"; -export type { UpdateCustomerGroupRequest } from "./UpdateCustomerGroupRequest"; +export { type ListGroupsRequest } from "./ListGroupsRequest"; +export { type CreateCustomerGroupRequest } from "./CreateCustomerGroupRequest"; +export { type GetGroupsRequest } from "./GetGroupsRequest"; +export { type UpdateCustomerGroupRequest } from "./UpdateCustomerGroupRequest"; +export { type DeleteGroupsRequest } from "./DeleteGroupsRequest"; +export { type AddGroupsRequest } from "./AddGroupsRequest"; +export { type RemoveGroupsRequest } from "./RemoveGroupsRequest"; diff --git a/src/api/resources/customers/resources/index.ts b/src/api/resources/customers/resources/index.ts index 432928b2b..7cd096b80 100644 --- a/src/api/resources/customers/resources/index.ts +++ b/src/api/resources/customers/resources/index.ts @@ -1,10 +1,10 @@ -export * as cards from "./cards"; -export * from "./cards/client/requests"; export * as customAttributeDefinitions from "./customAttributeDefinitions"; -export * from "./customAttributeDefinitions/client/requests"; -export * as customAttributes from "./customAttributes"; -export * from "./customAttributes/client/requests"; export * as groups from "./groups"; -export * from "./groups/client/requests"; export * as segments from "./segments"; +export * as cards from "./cards"; +export * as customAttributes from "./customAttributes"; +export * from "./customAttributeDefinitions/client/requests"; +export * from "./groups/client/requests"; export * from "./segments/client/requests"; +export * from "./cards/client/requests"; +export * from "./customAttributes/client/requests"; diff --git a/src/api/resources/customers/resources/segments/client/Client.ts b/src/api/resources/customers/resources/segments/client/Client.ts index adf6195eb..5f70ed1a9 100644 --- a/src/api/resources/customers/resources/segments/client/Client.ts +++ b/src/api/resources/customers/resources/segments/client/Client.ts @@ -1,32 +1,53 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace SegmentsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Segments { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class SegmentsClient { - protected readonly _options: SegmentsClient.Options; +export class Segments { + protected readonly _options: Segments.Options; - constructor(options: SegmentsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Segments.Options = {}) { + this._options = _options; } /** * Retrieves the list of customer segments of a business. * * @param {Square.customers.ListSegmentsRequest} request - * @param {SegmentsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Segments.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.segments.list({ @@ -36,8 +57,8 @@ export class SegmentsClient { */ public async list( request: Square.customers.ListSegmentsRequest = {}, - requestOptions?: SegmentsClient.RequestOptions, - ): Promise> { + requestOptions?: Segments.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.customers.ListSegmentsRequest, @@ -45,19 +66,11 @@ export class SegmentsClient { const { cursor, limit } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -66,13 +79,19 @@ export class SegmentsClient { "v2/customers/segments", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -113,7 +132,7 @@ export class SegmentsClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -129,7 +148,7 @@ export class SegmentsClient { * Retrieves a specific customer segment as identified by the `segment_id` value. * * @param {Square.customers.GetSegmentsRequest} request - * @param {SegmentsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Segments.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.customers.segments.get({ @@ -138,39 +157,35 @@ export class SegmentsClient { */ public get( request: Square.customers.GetSegmentsRequest, - requestOptions?: SegmentsClient.RequestOptions, + requestOptions?: Segments.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.customers.GetSegmentsRequest, - requestOptions?: SegmentsClient.RequestOptions, + requestOptions?: Segments.RequestOptions, ): Promise> { const { segmentId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/customers/segments/${core.url.encodePathParam(segmentId)}`, + `v2/customers/segments/${encodeURIComponent(segmentId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -213,7 +228,7 @@ export class SegmentsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/customers/resources/segments/client/index.ts b/src/api/resources/customers/resources/segments/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/customers/resources/segments/client/index.ts +++ b/src/api/resources/customers/resources/segments/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/customers/resources/segments/client/requests/GetSegmentsRequest.ts b/src/api/resources/customers/resources/segments/client/requests/GetSegmentsRequest.ts index 4a3b61d81..e8c325079 100644 --- a/src/api/resources/customers/resources/segments/client/requests/GetSegmentsRequest.ts +++ b/src/api/resources/customers/resources/segments/client/requests/GetSegmentsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetSegmentsRequest { - /** The Square-issued ID of the customer segment. */ + /** + * The Square-issued ID of the customer segment. + */ segmentId: string; } diff --git a/src/api/resources/customers/resources/segments/client/requests/ListSegmentsRequest.ts b/src/api/resources/customers/resources/segments/client/requests/ListSegmentsRequest.ts index 9f1c9e014..4ee529a9f 100644 --- a/src/api/resources/customers/resources/segments/client/requests/ListSegmentsRequest.ts +++ b/src/api/resources/customers/resources/segments/client/requests/ListSegmentsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/customers/resources/segments/client/requests/index.ts b/src/api/resources/customers/resources/segments/client/requests/index.ts index 49fa315c0..f5fa9bba2 100644 --- a/src/api/resources/customers/resources/segments/client/requests/index.ts +++ b/src/api/resources/customers/resources/segments/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { GetSegmentsRequest } from "./GetSegmentsRequest"; -export type { ListSegmentsRequest } from "./ListSegmentsRequest"; +export { type ListSegmentsRequest } from "./ListSegmentsRequest"; +export { type GetSegmentsRequest } from "./GetSegmentsRequest"; diff --git a/src/api/resources/devices/client/Client.ts b/src/api/resources/devices/client/Client.ts index 561d50912..f1cfeb5ea 100644 --- a/src/api/resources/devices/client/Client.ts +++ b/src/api/resources/devices/client/Client.ts @@ -1,31 +1,52 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; +import * as serializers from "../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; -import { CodesClient } from "../resources/codes/client/Client"; +import { Codes } from "../resources/codes/client/Client"; -export declare namespace DevicesClient { - export interface Options extends BaseClientOptions {} +export declare namespace Devices { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class DevicesClient { - protected readonly _options: DevicesClient.Options; - protected _codes: CodesClient | undefined; +export class Devices { + protected readonly _options: Devices.Options; + protected _codes: Codes | undefined; - constructor(options: DevicesClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Devices.Options = {}) { + this._options = _options; } - public get codes(): CodesClient { - return (this._codes ??= new CodesClient(this._options)); + public get codes(): Codes { + return (this._codes ??= new Codes(this._options)); } /** @@ -33,7 +54,7 @@ export class DevicesClient { * devices are supported. * * @param {Square.ListDevicesRequest} request - * @param {DevicesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Devices.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.devices.list({ @@ -45,35 +66,27 @@ export class DevicesClient { */ public async list( request: Square.ListDevicesRequest = {}, - requestOptions?: DevicesClient.RequestOptions, - ): Promise> { + requestOptions?: Devices.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async (request: Square.ListDevicesRequest): Promise> => { const { cursor, sortOrder, limit, locationId } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (sortOrder !== undefined) { - _queryParams.sort_order = serializers.SortOrder.jsonOrThrow(sortOrder, { + _queryParams["sort_order"] = serializers.SortOrder.jsonOrThrow(sortOrder, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (locationId !== undefined) { - _queryParams.location_id = locationId; + _queryParams["location_id"] = locationId; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -82,13 +95,19 @@ export class DevicesClient { "v2/devices", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -127,7 +146,7 @@ export class DevicesClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -143,7 +162,7 @@ export class DevicesClient { * Retrieves Device with the associated `device_id`. * * @param {Square.GetDevicesRequest} request - * @param {DevicesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Devices.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.devices.get({ @@ -152,39 +171,35 @@ export class DevicesClient { */ public get( request: Square.GetDevicesRequest, - requestOptions?: DevicesClient.RequestOptions, + requestOptions?: Devices.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.GetDevicesRequest, - requestOptions?: DevicesClient.RequestOptions, + requestOptions?: Devices.RequestOptions, ): Promise> { const { deviceId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/devices/${core.url.encodePathParam(deviceId)}`, + `v2/devices/${encodeURIComponent(deviceId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -225,7 +240,7 @@ export class DevicesClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/devices/client/index.ts b/src/api/resources/devices/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/devices/client/index.ts +++ b/src/api/resources/devices/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/devices/client/requests/GetDevicesRequest.ts b/src/api/resources/devices/client/requests/GetDevicesRequest.ts index 7a4188633..cce78e0b7 100644 --- a/src/api/resources/devices/client/requests/GetDevicesRequest.ts +++ b/src/api/resources/devices/client/requests/GetDevicesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetDevicesRequest { - /** The unique ID for the desired `Device`. */ + /** + * The unique ID for the desired `Device`. + */ deviceId: string; } diff --git a/src/api/resources/devices/client/requests/ListDevicesRequest.ts b/src/api/resources/devices/client/requests/ListDevicesRequest.ts index 05091c3a4..299bd9ec4 100644 --- a/src/api/resources/devices/client/requests/ListDevicesRequest.ts +++ b/src/api/resources/devices/client/requests/ListDevicesRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -24,8 +26,12 @@ export interface ListDevicesRequest { * - `DESC` - Newest to oldest (default). */ sortOrder?: Square.SortOrder | null; - /** The number of results to return in a single page. */ + /** + * The number of results to return in a single page. + */ limit?: number | null; - /** If present, only returns devices at the target location. */ + /** + * If present, only returns devices at the target location. + */ locationId?: string | null; } diff --git a/src/api/resources/devices/client/requests/index.ts b/src/api/resources/devices/client/requests/index.ts index 21537e6a1..cb037fcfd 100644 --- a/src/api/resources/devices/client/requests/index.ts +++ b/src/api/resources/devices/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { GetDevicesRequest } from "./GetDevicesRequest"; -export type { ListDevicesRequest } from "./ListDevicesRequest"; +export { type ListDevicesRequest } from "./ListDevicesRequest"; +export { type GetDevicesRequest } from "./GetDevicesRequest"; diff --git a/src/api/resources/devices/resources/codes/client/Client.ts b/src/api/resources/devices/resources/codes/client/Client.ts index 49c724f12..f78182d05 100644 --- a/src/api/resources/devices/resources/codes/client/Client.ts +++ b/src/api/resources/devices/resources/codes/client/Client.ts @@ -1,32 +1,53 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; +import * as serializers from "../../../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; -import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; -export declare namespace CodesClient { - export interface Options extends BaseClientOptions {} +export declare namespace Codes { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class CodesClient { - protected readonly _options: CodesClient.Options; +export class Codes { + protected readonly _options: Codes.Options; - constructor(options: CodesClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Codes.Options = {}) { + this._options = _options; } /** * Lists all DeviceCodes associated with the merchant. * * @param {Square.devices.ListCodesRequest} request - * @param {CodesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Codes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.devices.codes.list({ @@ -38,8 +59,8 @@ export class CodesClient { */ public async list( request: Square.devices.ListCodesRequest = {}, - requestOptions?: CodesClient.RequestOptions, - ): Promise> { + requestOptions?: Codes.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.devices.ListCodesRequest, @@ -47,31 +68,23 @@ export class CodesClient { const { cursor, locationId, productType, status } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (locationId !== undefined) { - _queryParams.location_id = locationId; + _queryParams["location_id"] = locationId; } if (productType !== undefined) { - _queryParams.product_type = serializers.ProductType.jsonOrThrow(productType, { + _queryParams["product_type"] = serializers.ProductType.jsonOrThrow(productType, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (status !== undefined) { - _queryParams.status = serializers.DeviceCodeStatus.jsonOrThrow(status, { + _queryParams["status"] = serializers.DeviceCodeStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -80,13 +93,19 @@ export class CodesClient { "v2/devices/codes", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -125,7 +144,7 @@ export class CodesClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -142,7 +161,7 @@ export class CodesClient { * terminal mode. * * @param {Square.devices.CreateDeviceCodeRequest} request - * @param {CodesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Codes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.devices.codes.create({ @@ -156,23 +175,15 @@ export class CodesClient { */ public create( request: Square.devices.CreateDeviceCodeRequest, - requestOptions?: CodesClient.RequestOptions, + requestOptions?: Codes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.devices.CreateDeviceCodeRequest, - requestOptions?: CodesClient.RequestOptions, + requestOptions?: Codes.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -181,19 +192,23 @@ export class CodesClient { "v2/devices/codes", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.devices.CreateDeviceCodeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -237,7 +252,7 @@ export class CodesClient { * Retrieves DeviceCode with the associated ID. * * @param {Square.devices.GetCodesRequest} request - * @param {CodesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Codes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.devices.codes.get({ @@ -246,39 +261,35 @@ export class CodesClient { */ public get( request: Square.devices.GetCodesRequest, - requestOptions?: CodesClient.RequestOptions, + requestOptions?: Codes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.devices.GetCodesRequest, - requestOptions?: CodesClient.RequestOptions, + requestOptions?: Codes.RequestOptions, ): Promise> { const { id } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/devices/codes/${core.url.encodePathParam(id)}`, + `v2/devices/codes/${encodeURIComponent(id)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -319,7 +330,7 @@ export class CodesClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/devices/resources/codes/client/index.ts b/src/api/resources/devices/resources/codes/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/devices/resources/codes/client/index.ts +++ b/src/api/resources/devices/resources/codes/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/devices/resources/codes/client/requests/CreateDeviceCodeRequest.ts b/src/api/resources/devices/resources/codes/client/requests/CreateDeviceCodeRequest.ts index e420b2480..2e6a6d4fe 100644 --- a/src/api/resources/devices/resources/codes/client/requests/CreateDeviceCodeRequest.ts +++ b/src/api/resources/devices/resources/codes/client/requests/CreateDeviceCodeRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/devices/resources/codes/client/requests/GetCodesRequest.ts b/src/api/resources/devices/resources/codes/client/requests/GetCodesRequest.ts index 815afde79..9ccf97ae6 100644 --- a/src/api/resources/devices/resources/codes/client/requests/GetCodesRequest.ts +++ b/src/api/resources/devices/resources/codes/client/requests/GetCodesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetCodesRequest { - /** The unique identifier for the device code. */ + /** + * The unique identifier for the device code. + */ id: string; } diff --git a/src/api/resources/devices/resources/codes/client/requests/ListCodesRequest.ts b/src/api/resources/devices/resources/codes/client/requests/ListCodesRequest.ts index c6c51891b..c7e5d8399 100644 --- a/src/api/resources/devices/resources/codes/client/requests/ListCodesRequest.ts +++ b/src/api/resources/devices/resources/codes/client/requests/ListCodesRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/devices/resources/codes/client/requests/index.ts b/src/api/resources/devices/resources/codes/client/requests/index.ts index 6df00210e..884d772bf 100644 --- a/src/api/resources/devices/resources/codes/client/requests/index.ts +++ b/src/api/resources/devices/resources/codes/client/requests/index.ts @@ -1,3 +1,3 @@ -export type { CreateDeviceCodeRequest } from "./CreateDeviceCodeRequest"; -export type { GetCodesRequest } from "./GetCodesRequest"; -export type { ListCodesRequest } from "./ListCodesRequest"; +export { type ListCodesRequest } from "./ListCodesRequest"; +export { type CreateDeviceCodeRequest } from "./CreateDeviceCodeRequest"; +export { type GetCodesRequest } from "./GetCodesRequest"; diff --git a/src/api/resources/disputes/client/Client.ts b/src/api/resources/disputes/client/Client.ts index c0872974c..4e88eb3c2 100644 --- a/src/api/resources/disputes/client/Client.ts +++ b/src/api/resources/disputes/client/Client.ts @@ -1,39 +1,60 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; +import * as serializers from "../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import { toJson } from "../../../../core/json"; -import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; -import { EvidenceClient } from "../resources/evidence/client/Client"; +import { toJson } from "../../../../core/json"; +import { Evidence } from "../resources/evidence/client/Client"; -export declare namespace DisputesClient { - export interface Options extends BaseClientOptions {} +export declare namespace Disputes { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class DisputesClient { - protected readonly _options: DisputesClient.Options; - protected _evidence: EvidenceClient | undefined; +export class Disputes { + protected readonly _options: Disputes.Options; + protected _evidence: Evidence | undefined; - constructor(options: DisputesClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Disputes.Options = {}) { + this._options = _options; } - public get evidence(): EvidenceClient { - return (this._evidence ??= new EvidenceClient(this._options)); + public get evidence(): Evidence { + return (this._evidence ??= new Evidence(this._options)); } /** * Returns a list of disputes associated with a particular account. * * @param {Square.ListDisputesRequest} request - * @param {DisputesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Disputes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.disputes.list({ @@ -44,32 +65,24 @@ export class DisputesClient { */ public async list( request: Square.ListDisputesRequest = {}, - requestOptions?: DisputesClient.RequestOptions, - ): Promise> { + requestOptions?: Disputes.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async (request: Square.ListDisputesRequest): Promise> => { const { cursor, states, locationId } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (states !== undefined) { - _queryParams.states = serializers.DisputeState.jsonOrThrow(states, { + _queryParams["states"] = serializers.DisputeState.jsonOrThrow(states, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (locationId !== undefined) { - _queryParams.location_id = locationId; + _queryParams["location_id"] = locationId; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -78,13 +91,19 @@ export class DisputesClient { "v2/disputes", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -123,7 +142,7 @@ export class DisputesClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -139,7 +158,7 @@ export class DisputesClient { * Returns details about a specific dispute. * * @param {Square.GetDisputesRequest} request - * @param {DisputesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Disputes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.disputes.get({ @@ -148,39 +167,35 @@ export class DisputesClient { */ public get( request: Square.GetDisputesRequest, - requestOptions?: DisputesClient.RequestOptions, + requestOptions?: Disputes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.GetDisputesRequest, - requestOptions?: DisputesClient.RequestOptions, + requestOptions?: Disputes.RequestOptions, ): Promise> { const { disputeId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/disputes/${core.url.encodePathParam(disputeId)}`, + `v2/disputes/${encodeURIComponent(disputeId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -228,7 +243,7 @@ export class DisputesClient { * does not have sufficient funds, Square debits the associated bank account. * * @param {Square.AcceptDisputesRequest} request - * @param {DisputesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Disputes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.disputes.accept({ @@ -237,39 +252,35 @@ export class DisputesClient { */ public accept( request: Square.AcceptDisputesRequest, - requestOptions?: DisputesClient.RequestOptions, + requestOptions?: Disputes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__accept(request, requestOptions)); } private async __accept( request: Square.AcceptDisputesRequest, - requestOptions?: DisputesClient.RequestOptions, + requestOptions?: Disputes.RequestOptions, ): Promise> { const { disputeId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/disputes/${core.url.encodePathParam(disputeId)}/accept`, + `v2/disputes/${encodeURIComponent(disputeId)}/accept`, ), method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -316,24 +327,23 @@ export class DisputesClient { * multipart/form-data file uploads in HEIC, HEIF, JPEG, PDF, PNG, and TIFF formats. * * @param {Square.CreateEvidenceFileDisputesRequest} request - * @param {DisputesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Disputes.RequestOptions} requestOptions - Request-specific configuration. * * @example - * import { createReadStream } from "fs"; * await client.disputes.createEvidenceFile({ * disputeId: "dispute_id" * }) */ public createEvidenceFile( request: Square.CreateEvidenceFileDisputesRequest, - requestOptions?: DisputesClient.RequestOptions, + requestOptions?: Disputes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createEvidenceFile(request, requestOptions)); } private async __createEvidenceFile( request: Square.CreateEvidenceFileDisputesRequest, - requestOptions?: DisputesClient.RequestOptions, + requestOptions?: Disputes.RequestOptions, ): Promise> { const _request = await core.newFormData(); if (request.request != null) { @@ -353,33 +363,29 @@ export class DisputesClient { } const _maybeEncodedRequest = await _request.getRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - ..._maybeEncodedRequest.headers, - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/disputes/${core.url.encodePathParam(request.disputeId)}/evidence-files`, + `v2/disputes/${encodeURIComponent(request.disputeId)}/evidence-files`, ), method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + ..._maybeEncodedRequest.headers, + }), + requestOptions?.headers, + ), requestType: "file", duplex: _maybeEncodedRequest.duplex, body: _maybeEncodedRequest.body, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -425,7 +431,7 @@ export class DisputesClient { * Uploads text to use as evidence for a dispute challenge. * * @param {Square.CreateDisputeEvidenceTextRequest} request - * @param {DisputesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Disputes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.disputes.createEvidenceText({ @@ -437,45 +443,41 @@ export class DisputesClient { */ public createEvidenceText( request: Square.CreateDisputeEvidenceTextRequest, - requestOptions?: DisputesClient.RequestOptions, + requestOptions?: Disputes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createEvidenceText(request, requestOptions)); } private async __createEvidenceText( request: Square.CreateDisputeEvidenceTextRequest, - requestOptions?: DisputesClient.RequestOptions, + requestOptions?: Disputes.RequestOptions, ): Promise> { const { disputeId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/disputes/${core.url.encodePathParam(disputeId)}/evidence-text`, + `v2/disputes/${encodeURIComponent(disputeId)}/evidence-text`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateDisputeEvidenceTextRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -527,7 +529,7 @@ export class DisputesClient { * a dispute after submission. * * @param {Square.SubmitEvidenceDisputesRequest} request - * @param {DisputesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Disputes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.disputes.submitEvidence({ @@ -536,39 +538,35 @@ export class DisputesClient { */ public submitEvidence( request: Square.SubmitEvidenceDisputesRequest, - requestOptions?: DisputesClient.RequestOptions, + requestOptions?: Disputes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__submitEvidence(request, requestOptions)); } private async __submitEvidence( request: Square.SubmitEvidenceDisputesRequest, - requestOptions?: DisputesClient.RequestOptions, + requestOptions?: Disputes.RequestOptions, ): Promise> { const { disputeId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/disputes/${core.url.encodePathParam(disputeId)}/submit-evidence`, + `v2/disputes/${encodeURIComponent(disputeId)}/submit-evidence`, ), method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -611,7 +609,7 @@ export class DisputesClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/disputes/client/index.ts b/src/api/resources/disputes/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/disputes/client/index.ts +++ b/src/api/resources/disputes/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/disputes/client/requests/AcceptDisputesRequest.ts b/src/api/resources/disputes/client/requests/AcceptDisputesRequest.ts index 42e043c84..e7b39024c 100644 --- a/src/api/resources/disputes/client/requests/AcceptDisputesRequest.ts +++ b/src/api/resources/disputes/client/requests/AcceptDisputesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface AcceptDisputesRequest { - /** The ID of the dispute you want to accept. */ + /** + * The ID of the dispute you want to accept. + */ disputeId: string; } diff --git a/src/api/resources/disputes/client/requests/CreateDisputeEvidenceTextRequest.ts b/src/api/resources/disputes/client/requests/CreateDisputeEvidenceTextRequest.ts index f9e15a387..dd6bf19e1 100644 --- a/src/api/resources/disputes/client/requests/CreateDisputeEvidenceTextRequest.ts +++ b/src/api/resources/disputes/client/requests/CreateDisputeEvidenceTextRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -12,7 +14,9 @@ import type * as Square from "../../../../index"; * } */ export interface CreateDisputeEvidenceTextRequest { - /** The ID of the dispute for which you want to upload evidence. */ + /** + * The ID of the dispute for which you want to upload evidence. + */ disputeId: string; /** A unique key identifying the request. For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency). */ idempotencyKey: string; diff --git a/src/api/resources/disputes/client/requests/CreateEvidenceFileDisputesRequest.ts b/src/api/resources/disputes/client/requests/CreateEvidenceFileDisputesRequest.ts index 4b4ba3df1..bd5c4e399 100644 --- a/src/api/resources/disputes/client/requests/CreateEvidenceFileDisputesRequest.ts +++ b/src/api/resources/disputes/client/requests/CreateEvidenceFileDisputesRequest.ts @@ -1,7 +1,9 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as fs from "fs"; -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; +import * as fs from "fs"; /** * @example @@ -10,7 +12,9 @@ import type * as Square from "../../../../index"; * } */ export interface CreateEvidenceFileDisputesRequest { - /** The ID of the dispute for which you want to upload evidence. */ + /** + * The ID of the dispute for which you want to upload evidence. + */ disputeId: string; request?: Square.CreateDisputeEvidenceFileRequest; imageFile?: File | fs.ReadStream | Blob | undefined; diff --git a/src/api/resources/disputes/client/requests/GetDisputesRequest.ts b/src/api/resources/disputes/client/requests/GetDisputesRequest.ts index d23c028fc..8ce67be68 100644 --- a/src/api/resources/disputes/client/requests/GetDisputesRequest.ts +++ b/src/api/resources/disputes/client/requests/GetDisputesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetDisputesRequest { - /** The ID of the dispute you want more details about. */ + /** + * The ID of the dispute you want more details about. + */ disputeId: string; } diff --git a/src/api/resources/disputes/client/requests/ListDisputesRequest.ts b/src/api/resources/disputes/client/requests/ListDisputesRequest.ts index 978ff3bfc..228295073 100644 --- a/src/api/resources/disputes/client/requests/ListDisputesRequest.ts +++ b/src/api/resources/disputes/client/requests/ListDisputesRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -17,7 +19,9 @@ export interface ListDisputesRequest { * For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). */ cursor?: string | null; - /** The dispute states used to filter the result. If not specified, the endpoint returns all disputes. */ + /** + * The dispute states used to filter the result. If not specified, the endpoint returns all disputes. + */ states?: Square.DisputeState | null; /** * The ID of the location for which to return a list of disputes. diff --git a/src/api/resources/disputes/client/requests/SubmitEvidenceDisputesRequest.ts b/src/api/resources/disputes/client/requests/SubmitEvidenceDisputesRequest.ts index eff36ce6a..260395581 100644 --- a/src/api/resources/disputes/client/requests/SubmitEvidenceDisputesRequest.ts +++ b/src/api/resources/disputes/client/requests/SubmitEvidenceDisputesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface SubmitEvidenceDisputesRequest { - /** The ID of the dispute for which you want to submit evidence. */ + /** + * The ID of the dispute for which you want to submit evidence. + */ disputeId: string; } diff --git a/src/api/resources/disputes/client/requests/index.ts b/src/api/resources/disputes/client/requests/index.ts index fcf52770b..9be21844e 100644 --- a/src/api/resources/disputes/client/requests/index.ts +++ b/src/api/resources/disputes/client/requests/index.ts @@ -1,6 +1,6 @@ -export type { AcceptDisputesRequest } from "./AcceptDisputesRequest"; -export type { CreateDisputeEvidenceTextRequest } from "./CreateDisputeEvidenceTextRequest"; -export type { CreateEvidenceFileDisputesRequest } from "./CreateEvidenceFileDisputesRequest"; -export type { GetDisputesRequest } from "./GetDisputesRequest"; -export type { ListDisputesRequest } from "./ListDisputesRequest"; -export type { SubmitEvidenceDisputesRequest } from "./SubmitEvidenceDisputesRequest"; +export { type ListDisputesRequest } from "./ListDisputesRequest"; +export { type GetDisputesRequest } from "./GetDisputesRequest"; +export { type AcceptDisputesRequest } from "./AcceptDisputesRequest"; +export { type CreateEvidenceFileDisputesRequest } from "./CreateEvidenceFileDisputesRequest"; +export { type CreateDisputeEvidenceTextRequest } from "./CreateDisputeEvidenceTextRequest"; +export { type SubmitEvidenceDisputesRequest } from "./SubmitEvidenceDisputesRequest"; diff --git a/src/api/resources/disputes/resources/evidence/client/Client.ts b/src/api/resources/disputes/resources/evidence/client/Client.ts index 8f51f0132..751eaae18 100644 --- a/src/api/resources/disputes/resources/evidence/client/Client.ts +++ b/src/api/resources/disputes/resources/evidence/client/Client.ts @@ -1,32 +1,53 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace EvidenceClient { - export interface Options extends BaseClientOptions {} +export declare namespace Evidence { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class EvidenceClient { - protected readonly _options: EvidenceClient.Options; +export class Evidence { + protected readonly _options: Evidence.Options; - constructor(options: EvidenceClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Evidence.Options = {}) { + this._options = _options; } /** * Returns a list of evidence associated with a dispute. * * @param {Square.disputes.ListEvidenceRequest} request - * @param {EvidenceClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Evidence.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.disputes.evidence.list({ @@ -36,8 +57,8 @@ export class EvidenceClient { */ public async list( request: Square.disputes.ListEvidenceRequest, - requestOptions?: EvidenceClient.RequestOptions, - ): Promise> { + requestOptions?: Evidence.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.disputes.ListEvidenceRequest, @@ -45,31 +66,29 @@ export class EvidenceClient { const { disputeId, cursor } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/disputes/${core.url.encodePathParam(disputeId)}/evidence`, + `v2/disputes/${encodeURIComponent(disputeId)}/evidence`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -110,7 +129,7 @@ export class EvidenceClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -128,7 +147,7 @@ export class EvidenceClient { * You must maintain a copy of any evidence uploaded if you want to reference it later. Evidence cannot be downloaded after you upload it. * * @param {Square.disputes.GetEvidenceRequest} request - * @param {EvidenceClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Evidence.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.disputes.evidence.get({ @@ -138,39 +157,35 @@ export class EvidenceClient { */ public get( request: Square.disputes.GetEvidenceRequest, - requestOptions?: EvidenceClient.RequestOptions, + requestOptions?: Evidence.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.disputes.GetEvidenceRequest, - requestOptions?: EvidenceClient.RequestOptions, + requestOptions?: Evidence.RequestOptions, ): Promise> { const { disputeId, evidenceId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/disputes/${core.url.encodePathParam(disputeId)}/evidence/${core.url.encodePathParam(evidenceId)}`, + `v2/disputes/${encodeURIComponent(disputeId)}/evidence/${encodeURIComponent(evidenceId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -217,7 +232,7 @@ export class EvidenceClient { * Square does not send the bank any evidence that is removed. * * @param {Square.disputes.DeleteEvidenceRequest} request - * @param {EvidenceClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Evidence.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.disputes.evidence.delete({ @@ -227,39 +242,35 @@ export class EvidenceClient { */ public delete( request: Square.disputes.DeleteEvidenceRequest, - requestOptions?: EvidenceClient.RequestOptions, + requestOptions?: Evidence.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); } private async __delete( request: Square.disputes.DeleteEvidenceRequest, - requestOptions?: EvidenceClient.RequestOptions, + requestOptions?: Evidence.RequestOptions, ): Promise> { const { disputeId, evidenceId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/disputes/${core.url.encodePathParam(disputeId)}/evidence/${core.url.encodePathParam(evidenceId)}`, + `v2/disputes/${encodeURIComponent(disputeId)}/evidence/${encodeURIComponent(evidenceId)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -302,7 +313,7 @@ export class EvidenceClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/disputes/resources/evidence/client/index.ts b/src/api/resources/disputes/resources/evidence/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/disputes/resources/evidence/client/index.ts +++ b/src/api/resources/disputes/resources/evidence/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/disputes/resources/evidence/client/requests/DeleteEvidenceRequest.ts b/src/api/resources/disputes/resources/evidence/client/requests/DeleteEvidenceRequest.ts index 2b2b0652b..0695d4de6 100644 --- a/src/api/resources/disputes/resources/evidence/client/requests/DeleteEvidenceRequest.ts +++ b/src/api/resources/disputes/resources/evidence/client/requests/DeleteEvidenceRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,8 +10,12 @@ * } */ export interface DeleteEvidenceRequest { - /** The ID of the dispute from which you want to remove evidence. */ + /** + * The ID of the dispute from which you want to remove evidence. + */ disputeId: string; - /** The ID of the evidence you want to remove. */ + /** + * The ID of the evidence you want to remove. + */ evidenceId: string; } diff --git a/src/api/resources/disputes/resources/evidence/client/requests/GetEvidenceRequest.ts b/src/api/resources/disputes/resources/evidence/client/requests/GetEvidenceRequest.ts index e9f0eb1b3..9272744c7 100644 --- a/src/api/resources/disputes/resources/evidence/client/requests/GetEvidenceRequest.ts +++ b/src/api/resources/disputes/resources/evidence/client/requests/GetEvidenceRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,8 +10,12 @@ * } */ export interface GetEvidenceRequest { - /** The ID of the dispute from which you want to retrieve evidence metadata. */ + /** + * The ID of the dispute from which you want to retrieve evidence metadata. + */ disputeId: string; - /** The ID of the evidence to retrieve. */ + /** + * The ID of the evidence to retrieve. + */ evidenceId: string; } diff --git a/src/api/resources/disputes/resources/evidence/client/requests/ListEvidenceRequest.ts b/src/api/resources/disputes/resources/evidence/client/requests/ListEvidenceRequest.ts index 80d042153..b7dcdf22a 100644 --- a/src/api/resources/disputes/resources/evidence/client/requests/ListEvidenceRequest.ts +++ b/src/api/resources/disputes/resources/evidence/client/requests/ListEvidenceRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,7 +10,9 @@ * } */ export interface ListEvidenceRequest { - /** The ID of the dispute. */ + /** + * The ID of the dispute. + */ disputeId: string; /** * A pagination cursor returned by a previous call to this endpoint. diff --git a/src/api/resources/disputes/resources/evidence/client/requests/index.ts b/src/api/resources/disputes/resources/evidence/client/requests/index.ts index 75bfa4fe2..854770a17 100644 --- a/src/api/resources/disputes/resources/evidence/client/requests/index.ts +++ b/src/api/resources/disputes/resources/evidence/client/requests/index.ts @@ -1,3 +1,3 @@ -export type { DeleteEvidenceRequest } from "./DeleteEvidenceRequest"; -export type { GetEvidenceRequest } from "./GetEvidenceRequest"; -export type { ListEvidenceRequest } from "./ListEvidenceRequest"; +export { type ListEvidenceRequest } from "./ListEvidenceRequest"; +export { type GetEvidenceRequest } from "./GetEvidenceRequest"; +export { type DeleteEvidenceRequest } from "./DeleteEvidenceRequest"; diff --git a/src/api/resources/employees/client/Client.ts b/src/api/resources/employees/client/Client.ts index e913ba5f2..cd5b86f3d 100644 --- a/src/api/resources/employees/client/Client.ts +++ b/src/api/resources/employees/client/Client.ts @@ -1,32 +1,53 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; +import * as serializers from "../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; -export declare namespace EmployeesClient { - export interface Options extends BaseClientOptions {} +export declare namespace Employees { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class EmployeesClient { - protected readonly _options: EmployeesClient.Options; +export class Employees { + protected readonly _options: Employees.Options; - constructor(options: EmployeesClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Employees.Options = {}) { + this._options = _options; } /** * * * @param {Square.ListEmployeesRequest} request - * @param {EmployeesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Employees.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.employees.list({ @@ -38,8 +59,8 @@ export class EmployeesClient { */ public async list( request: Square.ListEmployeesRequest = {}, - requestOptions?: EmployeesClient.RequestOptions, - ): Promise> { + requestOptions?: Employees.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.ListEmployeesRequest, @@ -47,28 +68,20 @@ export class EmployeesClient { const { locationId, status, limit, cursor } = request; const _queryParams: Record = {}; if (locationId !== undefined) { - _queryParams.location_id = locationId; + _queryParams["location_id"] = locationId; } if (status !== undefined) { - _queryParams.status = serializers.EmployeeStatus.jsonOrThrow(status, { + _queryParams["status"] = serializers.EmployeeStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -77,13 +90,19 @@ export class EmployeesClient { "v2/employees", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -122,7 +141,7 @@ export class EmployeesClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -138,7 +157,7 @@ export class EmployeesClient { * * * @param {Square.GetEmployeesRequest} request - * @param {EmployeesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Employees.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.employees.get({ @@ -147,39 +166,35 @@ export class EmployeesClient { */ public get( request: Square.GetEmployeesRequest, - requestOptions?: EmployeesClient.RequestOptions, + requestOptions?: Employees.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.GetEmployeesRequest, - requestOptions?: EmployeesClient.RequestOptions, + requestOptions?: Employees.RequestOptions, ): Promise> { const { id } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/employees/${core.url.encodePathParam(id)}`, + `v2/employees/${encodeURIComponent(id)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -220,7 +235,7 @@ export class EmployeesClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/employees/client/index.ts b/src/api/resources/employees/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/employees/client/index.ts +++ b/src/api/resources/employees/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/employees/client/requests/GetEmployeesRequest.ts b/src/api/resources/employees/client/requests/GetEmployeesRequest.ts index ba24c5056..3d3796dad 100644 --- a/src/api/resources/employees/client/requests/GetEmployeesRequest.ts +++ b/src/api/resources/employees/client/requests/GetEmployeesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetEmployeesRequest { - /** UUID for the employee that was requested. */ + /** + * UUID for the employee that was requested. + */ id: string; } diff --git a/src/api/resources/employees/client/requests/ListEmployeesRequest.ts b/src/api/resources/employees/client/requests/ListEmployeesRequest.ts index 56f0f5881..1a727fa8e 100644 --- a/src/api/resources/employees/client/requests/ListEmployeesRequest.ts +++ b/src/api/resources/employees/client/requests/ListEmployeesRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -12,12 +14,20 @@ import type * as Square from "../../../../index"; * } */ export interface ListEmployeesRequest { - /** */ + /** + * + */ locationId?: string | null; - /** Specifies the EmployeeStatus to filter the employee by. */ + /** + * Specifies the EmployeeStatus to filter the employee by. + */ status?: Square.EmployeeStatus | null; - /** The number of employees to be returned on each page. */ + /** + * The number of employees to be returned on each page. + */ limit?: number | null; - /** The token required to retrieve the specified page of results. */ + /** + * The token required to retrieve the specified page of results. + */ cursor?: string | null; } diff --git a/src/api/resources/employees/client/requests/index.ts b/src/api/resources/employees/client/requests/index.ts index 725670c0f..9557dae81 100644 --- a/src/api/resources/employees/client/requests/index.ts +++ b/src/api/resources/employees/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { GetEmployeesRequest } from "./GetEmployeesRequest"; -export type { ListEmployeesRequest } from "./ListEmployeesRequest"; +export { type ListEmployeesRequest } from "./ListEmployeesRequest"; +export { type GetEmployeesRequest } from "./GetEmployeesRequest"; diff --git a/src/api/resources/events/client/Client.ts b/src/api/resources/events/client/Client.ts index c1ee6ea62..14c8c1d0b 100644 --- a/src/api/resources/events/client/Client.ts +++ b/src/api/resources/events/client/Client.ts @@ -1,55 +1,68 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; +import * as errors from "../../../../errors/index"; -export declare namespace EventsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Events { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class EventsClient { - protected readonly _options: EventsClient.Options; +export class Events { + protected readonly _options: Events.Options; - constructor(options: EventsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Events.Options = {}) { + this._options = _options; } /** * Search for Square API events that occur within a 28-day timeframe. * * @param {Square.SearchEventsRequest} request - * @param {EventsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Events.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.events.searchEvents() */ public searchEvents( request: Square.SearchEventsRequest = {}, - requestOptions?: EventsClient.RequestOptions, + requestOptions?: Events.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__searchEvents(request, requestOptions)); } private async __searchEvents( request: Square.SearchEventsRequest = {}, - requestOptions?: EventsClient.RequestOptions, + requestOptions?: Events.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -58,19 +71,23 @@ export class EventsClient { "v2/events", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchEventsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -115,28 +132,20 @@ export class EventsClient { * All events are disabled by default. You must enable events to make them searchable. * Disabling events for a specific time period prevents them from being searchable, even if you re-enable them later. * - * @param {EventsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Events.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.events.disableEvents() */ public disableEvents( - requestOptions?: EventsClient.RequestOptions, + requestOptions?: Events.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__disableEvents(requestOptions)); } private async __disableEvents( - requestOptions?: EventsClient.RequestOptions, + requestOptions?: Events.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -145,13 +154,17 @@ export class EventsClient { "v2/events/disable", ), method: "PUT", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -194,28 +207,18 @@ export class EventsClient { /** * Enables events to make them searchable. Only events that occur while in the enabled state are searchable. * - * @param {EventsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Events.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.events.enableEvents() */ - public enableEvents( - requestOptions?: EventsClient.RequestOptions, - ): core.HttpResponsePromise { + public enableEvents(requestOptions?: Events.RequestOptions): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__enableEvents(requestOptions)); } private async __enableEvents( - requestOptions?: EventsClient.RequestOptions, + requestOptions?: Events.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -224,13 +227,17 @@ export class EventsClient { "v2/events/enable", ), method: "PUT", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -274,7 +281,7 @@ export class EventsClient { * Lists all event types that you can subscribe to as webhooks or query using the Events API. * * @param {Square.ListEventTypesRequest} request - * @param {EventsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Events.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.events.listEventTypes({ @@ -283,29 +290,21 @@ export class EventsClient { */ public listEventTypes( request: Square.ListEventTypesRequest = {}, - requestOptions?: EventsClient.RequestOptions, + requestOptions?: Events.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__listEventTypes(request, requestOptions)); } private async __listEventTypes( request: Square.ListEventTypesRequest = {}, - requestOptions?: EventsClient.RequestOptions, + requestOptions?: Events.RequestOptions, ): Promise> { const { apiVersion } = request; const _queryParams: Record = {}; if (apiVersion !== undefined) { - _queryParams.api_version = apiVersion; + _queryParams["api_version"] = apiVersion; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -314,13 +313,18 @@ export class EventsClient { "v2/events/types", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -361,7 +365,7 @@ export class EventsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/events/client/index.ts b/src/api/resources/events/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/events/client/index.ts +++ b/src/api/resources/events/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/events/client/requests/ListEventTypesRequest.ts b/src/api/resources/events/client/requests/ListEventTypesRequest.ts index 4b8cfb8d4..dacf1b022 100644 --- a/src/api/resources/events/client/requests/ListEventTypesRequest.ts +++ b/src/api/resources/events/client/requests/ListEventTypesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface ListEventTypesRequest { - /** The API version for which to list event types. Setting this field overrides the default version used by the application. */ + /** + * The API version for which to list event types. Setting this field overrides the default version used by the application. + */ apiVersion?: string | null; } diff --git a/src/api/resources/events/client/requests/SearchEventsRequest.ts b/src/api/resources/events/client/requests/SearchEventsRequest.ts index 8c2c65a7b..e63d21d15 100644 --- a/src/api/resources/events/client/requests/SearchEventsRequest.ts +++ b/src/api/resources/events/client/requests/SearchEventsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/events/client/requests/index.ts b/src/api/resources/events/client/requests/index.ts index 07d2f52ca..d6a20d449 100644 --- a/src/api/resources/events/client/requests/index.ts +++ b/src/api/resources/events/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { ListEventTypesRequest } from "./ListEventTypesRequest"; -export type { SearchEventsRequest } from "./SearchEventsRequest"; +export { type SearchEventsRequest } from "./SearchEventsRequest"; +export { type ListEventTypesRequest } from "./ListEventTypesRequest"; diff --git a/src/api/resources/giftCards/client/Client.ts b/src/api/resources/giftCards/client/Client.ts index b1a85117c..067068e67 100644 --- a/src/api/resources/giftCards/client/Client.ts +++ b/src/api/resources/giftCards/client/Client.ts @@ -1,31 +1,52 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; -import { ActivitiesClient } from "../resources/activities/client/Client"; - -export declare namespace GiftCardsClient { - export interface Options extends BaseClientOptions {} +import * as errors from "../../../../errors/index"; +import { Activities } from "../resources/activities/client/Client"; + +export declare namespace GiftCards { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class GiftCardsClient { - protected readonly _options: GiftCardsClient.Options; - protected _activities: ActivitiesClient | undefined; +export class GiftCards { + protected readonly _options: GiftCards.Options; + protected _activities: Activities | undefined; - constructor(options: GiftCardsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: GiftCards.Options = {}) { + this._options = _options; } - public get activities(): ActivitiesClient { - return (this._activities ??= new ActivitiesClient(this._options)); + public get activities(): Activities { + return (this._activities ??= new Activities(this._options)); } /** @@ -33,7 +54,7 @@ export class GiftCardsClient { * a subset of the gift cards. Results are sorted by `created_at` in ascending order. * * @param {Square.ListGiftCardsRequest} request - * @param {GiftCardsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {GiftCards.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.giftCards.list({ @@ -46,8 +67,8 @@ export class GiftCardsClient { */ public async list( request: Square.ListGiftCardsRequest = {}, - requestOptions?: GiftCardsClient.RequestOptions, - ): Promise> { + requestOptions?: GiftCards.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.ListGiftCardsRequest, @@ -55,28 +76,20 @@ export class GiftCardsClient { const { type: type_, state, limit, cursor, customerId } = request; const _queryParams: Record = {}; if (type_ !== undefined) { - _queryParams.type = type_; + _queryParams["type"] = type_; } if (state !== undefined) { - _queryParams.state = state; + _queryParams["state"] = state; } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (customerId !== undefined) { - _queryParams.customer_id = customerId; + _queryParams["customer_id"] = customerId; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -85,13 +98,19 @@ export class GiftCardsClient { "v2/gift-cards", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -130,7 +149,7 @@ export class GiftCardsClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -150,7 +169,7 @@ export class GiftCardsClient { * to refund a payment to the new gift card. * * @param {Square.CreateGiftCardRequest} request - * @param {GiftCardsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {GiftCards.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.giftCards.create({ @@ -163,23 +182,15 @@ export class GiftCardsClient { */ public create( request: Square.CreateGiftCardRequest, - requestOptions?: GiftCardsClient.RequestOptions, + requestOptions?: GiftCards.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.CreateGiftCardRequest, - requestOptions?: GiftCardsClient.RequestOptions, + requestOptions?: GiftCards.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -188,19 +199,23 @@ export class GiftCardsClient { "v2/gift-cards", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateGiftCardRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -244,7 +259,7 @@ export class GiftCardsClient { * Retrieves a gift card using the gift card account number (GAN). * * @param {Square.GetGiftCardFromGanRequest} request - * @param {GiftCardsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {GiftCards.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.giftCards.getFromGan({ @@ -253,23 +268,15 @@ export class GiftCardsClient { */ public getFromGan( request: Square.GetGiftCardFromGanRequest, - requestOptions?: GiftCardsClient.RequestOptions, + requestOptions?: GiftCards.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getFromGan(request, requestOptions)); } private async __getFromGan( request: Square.GetGiftCardFromGanRequest, - requestOptions?: GiftCardsClient.RequestOptions, + requestOptions?: GiftCards.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -278,19 +285,23 @@ export class GiftCardsClient { "v2/gift-cards/from-gan", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.GetGiftCardFromGanRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -334,7 +345,7 @@ export class GiftCardsClient { * Retrieves a gift card using a secure payment token that represents the gift card. * * @param {Square.GetGiftCardFromNonceRequest} request - * @param {GiftCardsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {GiftCards.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.giftCards.getFromNonce({ @@ -343,23 +354,15 @@ export class GiftCardsClient { */ public getFromNonce( request: Square.GetGiftCardFromNonceRequest, - requestOptions?: GiftCardsClient.RequestOptions, + requestOptions?: GiftCards.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getFromNonce(request, requestOptions)); } private async __getFromNonce( request: Square.GetGiftCardFromNonceRequest, - requestOptions?: GiftCardsClient.RequestOptions, + requestOptions?: GiftCards.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -368,19 +371,23 @@ export class GiftCardsClient { "v2/gift-cards/from-nonce", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.GetGiftCardFromNonceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -424,7 +431,7 @@ export class GiftCardsClient { * Links a customer to a gift card, which is also referred to as adding a card on file. * * @param {Square.LinkCustomerToGiftCardRequest} request - * @param {GiftCardsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {GiftCards.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.giftCards.linkCustomer({ @@ -434,45 +441,41 @@ export class GiftCardsClient { */ public linkCustomer( request: Square.LinkCustomerToGiftCardRequest, - requestOptions?: GiftCardsClient.RequestOptions, + requestOptions?: GiftCards.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__linkCustomer(request, requestOptions)); } private async __linkCustomer( request: Square.LinkCustomerToGiftCardRequest, - requestOptions?: GiftCardsClient.RequestOptions, + requestOptions?: GiftCards.RequestOptions, ): Promise> { const { giftCardId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/gift-cards/${core.url.encodePathParam(giftCardId)}/link-customer`, + `v2/gift-cards/${encodeURIComponent(giftCardId)}/link-customer`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.LinkCustomerToGiftCardRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -518,7 +521,7 @@ export class GiftCardsClient { * Unlinks a customer from a gift card, which is also referred to as removing a card on file. * * @param {Square.UnlinkCustomerFromGiftCardRequest} request - * @param {GiftCardsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {GiftCards.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.giftCards.unlinkCustomer({ @@ -528,45 +531,41 @@ export class GiftCardsClient { */ public unlinkCustomer( request: Square.UnlinkCustomerFromGiftCardRequest, - requestOptions?: GiftCardsClient.RequestOptions, + requestOptions?: GiftCards.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__unlinkCustomer(request, requestOptions)); } private async __unlinkCustomer( request: Square.UnlinkCustomerFromGiftCardRequest, - requestOptions?: GiftCardsClient.RequestOptions, + requestOptions?: GiftCards.RequestOptions, ): Promise> { const { giftCardId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/gift-cards/${core.url.encodePathParam(giftCardId)}/unlink-customer`, + `v2/gift-cards/${encodeURIComponent(giftCardId)}/unlink-customer`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UnlinkCustomerFromGiftCardRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -612,7 +611,7 @@ export class GiftCardsClient { * Retrieves a gift card using the gift card ID. * * @param {Square.GetGiftCardsRequest} request - * @param {GiftCardsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {GiftCards.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.giftCards.get({ @@ -621,39 +620,35 @@ export class GiftCardsClient { */ public get( request: Square.GetGiftCardsRequest, - requestOptions?: GiftCardsClient.RequestOptions, + requestOptions?: GiftCards.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.GetGiftCardsRequest, - requestOptions?: GiftCardsClient.RequestOptions, + requestOptions?: GiftCards.RequestOptions, ): Promise> { const { id } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/gift-cards/${core.url.encodePathParam(id)}`, + `v2/gift-cards/${encodeURIComponent(id)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -694,7 +689,7 @@ export class GiftCardsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/giftCards/client/index.ts b/src/api/resources/giftCards/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/giftCards/client/index.ts +++ b/src/api/resources/giftCards/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/giftCards/client/requests/CreateGiftCardRequest.ts b/src/api/resources/giftCards/client/requests/CreateGiftCardRequest.ts index 1d142cc82..a31b388cc 100644 --- a/src/api/resources/giftCards/client/requests/CreateGiftCardRequest.ts +++ b/src/api/resources/giftCards/client/requests/CreateGiftCardRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/giftCards/client/requests/GetGiftCardFromGanRequest.ts b/src/api/resources/giftCards/client/requests/GetGiftCardFromGanRequest.ts index 3cde30fa2..2685a3d48 100644 --- a/src/api/resources/giftCards/client/requests/GetGiftCardFromGanRequest.ts +++ b/src/api/resources/giftCards/client/requests/GetGiftCardFromGanRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/giftCards/client/requests/GetGiftCardFromNonceRequest.ts b/src/api/resources/giftCards/client/requests/GetGiftCardFromNonceRequest.ts index 7a146fb08..ee98164d0 100644 --- a/src/api/resources/giftCards/client/requests/GetGiftCardFromNonceRequest.ts +++ b/src/api/resources/giftCards/client/requests/GetGiftCardFromNonceRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/giftCards/client/requests/GetGiftCardsRequest.ts b/src/api/resources/giftCards/client/requests/GetGiftCardsRequest.ts index 86ea77a28..7d36ea9f8 100644 --- a/src/api/resources/giftCards/client/requests/GetGiftCardsRequest.ts +++ b/src/api/resources/giftCards/client/requests/GetGiftCardsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetGiftCardsRequest { - /** The ID of the gift card to retrieve. */ + /** + * The ID of the gift card to retrieve. + */ id: string; } diff --git a/src/api/resources/giftCards/client/requests/LinkCustomerToGiftCardRequest.ts b/src/api/resources/giftCards/client/requests/LinkCustomerToGiftCardRequest.ts index 84157fd07..65406b42f 100644 --- a/src/api/resources/giftCards/client/requests/LinkCustomerToGiftCardRequest.ts +++ b/src/api/resources/giftCards/client/requests/LinkCustomerToGiftCardRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,7 +10,9 @@ * } */ export interface LinkCustomerToGiftCardRequest { - /** The ID of the gift card to be linked. */ + /** + * The ID of the gift card to be linked. + */ giftCardId: string; /** The ID of the customer to link to the gift card. */ customerId: string; diff --git a/src/api/resources/giftCards/client/requests/ListGiftCardsRequest.ts b/src/api/resources/giftCards/client/requests/ListGiftCardsRequest.ts index 8e5ff2b93..6d23cec0d 100644 --- a/src/api/resources/giftCards/client/requests/ListGiftCardsRequest.ts +++ b/src/api/resources/giftCards/client/requests/ListGiftCardsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -34,6 +36,8 @@ export interface ListGiftCardsRequest { * For more information, see [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination). */ cursor?: string | null; - /** If a customer ID is provided, the endpoint returns only the gift cards linked to the specified customer. */ + /** + * If a customer ID is provided, the endpoint returns only the gift cards linked to the specified customer. + */ customerId?: string | null; } diff --git a/src/api/resources/giftCards/client/requests/UnlinkCustomerFromGiftCardRequest.ts b/src/api/resources/giftCards/client/requests/UnlinkCustomerFromGiftCardRequest.ts index 9e1940ffe..b4c49c798 100644 --- a/src/api/resources/giftCards/client/requests/UnlinkCustomerFromGiftCardRequest.ts +++ b/src/api/resources/giftCards/client/requests/UnlinkCustomerFromGiftCardRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,7 +10,9 @@ * } */ export interface UnlinkCustomerFromGiftCardRequest { - /** The ID of the gift card to be unlinked. */ + /** + * The ID of the gift card to be unlinked. + */ giftCardId: string; /** The ID of the customer to unlink from the gift card. */ customerId: string; diff --git a/src/api/resources/giftCards/client/requests/index.ts b/src/api/resources/giftCards/client/requests/index.ts index 800994359..0b6147fc9 100644 --- a/src/api/resources/giftCards/client/requests/index.ts +++ b/src/api/resources/giftCards/client/requests/index.ts @@ -1,7 +1,7 @@ -export type { CreateGiftCardRequest } from "./CreateGiftCardRequest"; -export type { GetGiftCardFromGanRequest } from "./GetGiftCardFromGanRequest"; -export type { GetGiftCardFromNonceRequest } from "./GetGiftCardFromNonceRequest"; -export type { GetGiftCardsRequest } from "./GetGiftCardsRequest"; -export type { LinkCustomerToGiftCardRequest } from "./LinkCustomerToGiftCardRequest"; -export type { ListGiftCardsRequest } from "./ListGiftCardsRequest"; -export type { UnlinkCustomerFromGiftCardRequest } from "./UnlinkCustomerFromGiftCardRequest"; +export { type ListGiftCardsRequest } from "./ListGiftCardsRequest"; +export { type CreateGiftCardRequest } from "./CreateGiftCardRequest"; +export { type GetGiftCardFromGanRequest } from "./GetGiftCardFromGanRequest"; +export { type GetGiftCardFromNonceRequest } from "./GetGiftCardFromNonceRequest"; +export { type LinkCustomerToGiftCardRequest } from "./LinkCustomerToGiftCardRequest"; +export { type UnlinkCustomerFromGiftCardRequest } from "./UnlinkCustomerFromGiftCardRequest"; +export { type GetGiftCardsRequest } from "./GetGiftCardsRequest"; diff --git a/src/api/resources/giftCards/resources/activities/client/Client.ts b/src/api/resources/giftCards/resources/activities/client/Client.ts index 26d1f4f83..368fb948d 100644 --- a/src/api/resources/giftCards/resources/activities/client/Client.ts +++ b/src/api/resources/giftCards/resources/activities/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace ActivitiesClient { - export interface Options extends BaseClientOptions {} +export declare namespace Activities { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class ActivitiesClient { - protected readonly _options: ActivitiesClient.Options; +export class Activities { + protected readonly _options: Activities.Options; - constructor(options: ActivitiesClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Activities.Options = {}) { + this._options = _options; } /** @@ -29,7 +50,7 @@ export class ActivitiesClient { * for all gift cards in a specific region, or for activities within a time window. * * @param {Square.giftCards.ListActivitiesRequest} request - * @param {ActivitiesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Activities.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.giftCards.activities.list({ @@ -45,8 +66,8 @@ export class ActivitiesClient { */ public async list( request: Square.giftCards.ListActivitiesRequest = {}, - requestOptions?: ActivitiesClient.RequestOptions, - ): Promise> { + requestOptions?: Activities.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.giftCards.ListActivitiesRequest, @@ -54,37 +75,29 @@ export class ActivitiesClient { const { giftCardId, type: type_, locationId, beginTime, endTime, limit, cursor, sortOrder } = request; const _queryParams: Record = {}; if (giftCardId !== undefined) { - _queryParams.gift_card_id = giftCardId; + _queryParams["gift_card_id"] = giftCardId; } if (type_ !== undefined) { - _queryParams.type = type_; + _queryParams["type"] = type_; } if (locationId !== undefined) { - _queryParams.location_id = locationId; + _queryParams["location_id"] = locationId; } if (beginTime !== undefined) { - _queryParams.begin_time = beginTime; + _queryParams["begin_time"] = beginTime; } if (endTime !== undefined) { - _queryParams.end_time = endTime; + _queryParams["end_time"] = endTime; } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (sortOrder !== undefined) { - _queryParams.sort_order = sortOrder; + _queryParams["sort_order"] = sortOrder; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -93,13 +106,19 @@ export class ActivitiesClient { "v2/gift-cards/activities", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -140,7 +159,7 @@ export class ActivitiesClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -157,7 +176,7 @@ export class ActivitiesClient { * For example, create an `ACTIVATE` activity to activate a gift card with an initial balance before first use. * * @param {Square.giftCards.CreateGiftCardActivityRequest} request - * @param {ActivitiesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Activities.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.giftCards.activities.create({ @@ -175,23 +194,15 @@ export class ActivitiesClient { */ public create( request: Square.giftCards.CreateGiftCardActivityRequest, - requestOptions?: ActivitiesClient.RequestOptions, + requestOptions?: Activities.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.giftCards.CreateGiftCardActivityRequest, - requestOptions?: ActivitiesClient.RequestOptions, + requestOptions?: Activities.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -200,19 +211,23 @@ export class ActivitiesClient { "v2/gift-cards/activities", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.giftCards.CreateGiftCardActivityRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -253,7 +268,7 @@ export class ActivitiesClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/giftCards/resources/activities/client/index.ts b/src/api/resources/giftCards/resources/activities/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/giftCards/resources/activities/client/index.ts +++ b/src/api/resources/giftCards/resources/activities/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/giftCards/resources/activities/client/requests/CreateGiftCardActivityRequest.ts b/src/api/resources/giftCards/resources/activities/client/requests/CreateGiftCardActivityRequest.ts index 403a8cec6..dba2fc080 100644 --- a/src/api/resources/giftCards/resources/activities/client/requests/CreateGiftCardActivityRequest.ts +++ b/src/api/resources/giftCards/resources/activities/client/requests/CreateGiftCardActivityRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/giftCards/resources/activities/client/requests/ListActivitiesRequest.ts b/src/api/resources/giftCards/resources/activities/client/requests/ListActivitiesRequest.ts index e1b411e5c..88a40604c 100644 --- a/src/api/resources/giftCards/resources/activities/client/requests/ListActivitiesRequest.ts +++ b/src/api/resources/giftCards/resources/activities/client/requests/ListActivitiesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/giftCards/resources/activities/client/requests/index.ts b/src/api/resources/giftCards/resources/activities/client/requests/index.ts index ce856ef9d..9c2bd6210 100644 --- a/src/api/resources/giftCards/resources/activities/client/requests/index.ts +++ b/src/api/resources/giftCards/resources/activities/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { CreateGiftCardActivityRequest } from "./CreateGiftCardActivityRequest"; -export type { ListActivitiesRequest } from "./ListActivitiesRequest"; +export { type ListActivitiesRequest } from "./ListActivitiesRequest"; +export { type CreateGiftCardActivityRequest } from "./CreateGiftCardActivityRequest"; diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index 92b50160e..23678d5af 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -1,69 +1,65 @@ +export * as mobile from "./mobile"; +export * as oAuth from "./oAuth"; +export * as v1Transactions from "./v1Transactions"; export * as applePay from "./applePay"; -export * from "./applePay/client/requests"; export * as bankAccounts from "./bankAccounts"; -export * from "./bankAccounts/client/requests"; export * as bookings from "./bookings"; -export * from "./bookings/client/requests"; export * as cards from "./cards"; -export * from "./cards/client/requests"; -export * as cashDrawers from "./cashDrawers"; export * as catalog from "./catalog"; -export * from "./catalog/client/requests"; -export * as channels from "./channels"; -export * from "./channels/client/requests"; -export * as checkout from "./checkout"; -export * from "./checkout/client/requests"; export * as customers from "./customers"; -export * from "./customers/client/requests"; export * as devices from "./devices"; -export * from "./devices/client/requests"; export * as disputes from "./disputes"; -export * from "./disputes/client/requests"; export * as employees from "./employees"; -export * from "./employees/client/requests"; export * as events from "./events"; -export * from "./events/client/requests"; export * as giftCards from "./giftCards"; -export * from "./giftCards/client/requests"; export * as inventory from "./inventory"; -export * from "./inventory/client/requests"; export * as invoices from "./invoices"; -export * from "./invoices/client/requests"; export * as labor from "./labor"; -export * from "./labor/client/requests"; export * as locations from "./locations"; -export * from "./locations/client/requests"; export * as loyalty from "./loyalty"; -export * from "./loyalty/client/requests"; export * as merchants from "./merchants"; -export * from "./merchants/client/requests"; -export * as mobile from "./mobile"; -export * from "./mobile/client/requests"; -export * as oAuth from "./oAuth"; -export * from "./oAuth/client/requests"; +export * as checkout from "./checkout"; export * as orders from "./orders"; -export * from "./orders/client/requests"; export * as payments from "./payments"; -export * from "./payments/client/requests"; export * as payouts from "./payouts"; -export * from "./payouts/client/requests"; export * as refunds from "./refunds"; -export * from "./refunds/client/requests"; export * as sites from "./sites"; export * as snippets from "./snippets"; -export * from "./snippets/client/requests"; export * as subscriptions from "./subscriptions"; -export * from "./subscriptions/client/requests"; -export * as team from "./team"; -export * from "./team/client/requests"; export * as teamMembers from "./teamMembers"; -export * from "./teamMembers/client/requests"; +export * as team from "./team"; export * as terminal from "./terminal"; -export * from "./terminal/client/requests"; -export * as transferOrders from "./transferOrders"; -export * from "./transferOrders/client/requests"; -export * as v1Transactions from "./v1Transactions"; -export * from "./v1Transactions/client/requests"; export * as vendors from "./vendors"; -export * from "./vendors/client/requests"; +export * as cashDrawers from "./cashDrawers"; export * as webhooks from "./webhooks"; +export * from "./mobile/client/requests"; +export * from "./oAuth/client/requests"; +export * from "./v1Transactions/client/requests"; +export * from "./applePay/client/requests"; +export * from "./bankAccounts/client/requests"; +export * from "./bookings/client/requests"; +export * from "./cards/client/requests"; +export * from "./catalog/client/requests"; +export * from "./customers/client/requests"; +export * from "./devices/client/requests"; +export * from "./disputes/client/requests"; +export * from "./employees/client/requests"; +export * from "./events/client/requests"; +export * from "./giftCards/client/requests"; +export * from "./inventory/client/requests"; +export * from "./invoices/client/requests"; +export * from "./labor/client/requests"; +export * from "./locations/client/requests"; +export * from "./loyalty/client/requests"; +export * from "./merchants/client/requests"; +export * from "./checkout/client/requests"; +export * from "./orders/client/requests"; +export * from "./payments/client/requests"; +export * from "./payouts/client/requests"; +export * from "./refunds/client/requests"; +export * from "./snippets/client/requests"; +export * from "./subscriptions/client/requests"; +export * from "./teamMembers/client/requests"; +export * from "./team/client/requests"; +export * from "./terminal/client/requests"; +export * from "./vendors/client/requests"; diff --git a/src/api/resources/inventory/client/Client.ts b/src/api/resources/inventory/client/Client.ts index b9bb81d50..da8bd6089 100644 --- a/src/api/resources/inventory/client/Client.ts +++ b/src/api/resources/inventory/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; +import * as errors from "../../../../errors/index"; -export declare namespace InventoryClient { - export interface Options extends BaseClientOptions {} +export declare namespace Inventory { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class InventoryClient { - protected readonly _options: InventoryClient.Options; +export class Inventory { + protected readonly _options: Inventory.Options; - constructor(options: InventoryClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Inventory.Options = {}) { + this._options = _options; } /** @@ -27,7 +48,7 @@ export class InventoryClient { * is updated to conform to the standard convention. * * @param {Square.DeprecatedGetAdjustmentInventoryRequest} request - * @param {InventoryClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Inventory.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.inventory.deprecatedGetAdjustment({ @@ -36,39 +57,35 @@ export class InventoryClient { */ public deprecatedGetAdjustment( request: Square.DeprecatedGetAdjustmentInventoryRequest, - requestOptions?: InventoryClient.RequestOptions, + requestOptions?: Inventory.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__deprecatedGetAdjustment(request, requestOptions)); } private async __deprecatedGetAdjustment( request: Square.DeprecatedGetAdjustmentInventoryRequest, - requestOptions?: InventoryClient.RequestOptions, + requestOptions?: Inventory.RequestOptions, ): Promise> { const { adjustmentId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/inventory/adjustment/${core.url.encodePathParam(adjustmentId)}`, + `v2/inventory/adjustment/${encodeURIComponent(adjustmentId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -115,7 +132,7 @@ export class InventoryClient { * with the provided `adjustment_id`. * * @param {Square.GetAdjustmentInventoryRequest} request - * @param {InventoryClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Inventory.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.inventory.getAdjustment({ @@ -124,39 +141,35 @@ export class InventoryClient { */ public getAdjustment( request: Square.GetAdjustmentInventoryRequest, - requestOptions?: InventoryClient.RequestOptions, + requestOptions?: Inventory.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getAdjustment(request, requestOptions)); } private async __getAdjustment( request: Square.GetAdjustmentInventoryRequest, - requestOptions?: InventoryClient.RequestOptions, + requestOptions?: Inventory.RequestOptions, ): Promise> { const { adjustmentId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/inventory/adjustments/${core.url.encodePathParam(adjustmentId)}`, + `v2/inventory/adjustments/${encodeURIComponent(adjustmentId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -203,7 +216,7 @@ export class InventoryClient { * is updated to conform to the standard convention. * * @param {Square.BatchChangeInventoryRequest} request - * @param {InventoryClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Inventory.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.inventory.deprecatedBatchChange({ @@ -225,23 +238,15 @@ export class InventoryClient { */ public deprecatedBatchChange( request: Square.BatchChangeInventoryRequest, - requestOptions?: InventoryClient.RequestOptions, + requestOptions?: Inventory.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__deprecatedBatchChange(request, requestOptions)); } private async __deprecatedBatchChange( request: Square.BatchChangeInventoryRequest, - requestOptions?: InventoryClient.RequestOptions, + requestOptions?: Inventory.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -250,19 +255,23 @@ export class InventoryClient { "v2/inventory/batch-change", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchChangeInventoryRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -307,7 +316,7 @@ export class InventoryClient { * is updated to conform to the standard convention. * * @param {Square.BatchRetrieveInventoryChangesRequest} request - * @param {InventoryClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Inventory.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.inventory.deprecatedBatchGetChanges({ @@ -321,23 +330,15 @@ export class InventoryClient { */ public deprecatedBatchGetChanges( request: Square.BatchRetrieveInventoryChangesRequest, - requestOptions?: InventoryClient.RequestOptions, + requestOptions?: Inventory.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__deprecatedBatchGetChanges(request, requestOptions)); } private async __deprecatedBatchGetChanges( request: Square.BatchRetrieveInventoryChangesRequest, - requestOptions?: InventoryClient.RequestOptions, + requestOptions?: Inventory.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -346,19 +347,23 @@ export class InventoryClient { "v2/inventory/batch-retrieve-changes", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchRetrieveInventoryChangesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -405,7 +410,7 @@ export class InventoryClient { * is updated to conform to the standard convention. * * @param {Square.BatchGetInventoryCountsRequest} request - * @param {InventoryClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Inventory.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.inventory.deprecatedBatchGetCounts({ @@ -416,23 +421,15 @@ export class InventoryClient { */ public deprecatedBatchGetCounts( request: Square.BatchGetInventoryCountsRequest, - requestOptions?: InventoryClient.RequestOptions, + requestOptions?: Inventory.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__deprecatedBatchGetCounts(request, requestOptions)); } private async __deprecatedBatchGetCounts( request: Square.BatchGetInventoryCountsRequest, - requestOptions?: InventoryClient.RequestOptions, + requestOptions?: Inventory.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -441,19 +438,23 @@ export class InventoryClient { "v2/inventory/batch-retrieve-counts", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchGetInventoryCountsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -503,7 +504,7 @@ export class InventoryClient { * On failure: returns a list of related errors. * * @param {Square.BatchChangeInventoryRequest} request - * @param {InventoryClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Inventory.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.inventory.batchCreateChanges({ @@ -525,23 +526,15 @@ export class InventoryClient { */ public batchCreateChanges( request: Square.BatchChangeInventoryRequest, - requestOptions?: InventoryClient.RequestOptions, + requestOptions?: Inventory.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__batchCreateChanges(request, requestOptions)); } private async __batchCreateChanges( request: Square.BatchChangeInventoryRequest, - requestOptions?: InventoryClient.RequestOptions, + requestOptions?: Inventory.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -550,19 +543,23 @@ export class InventoryClient { "v2/inventory/changes/batch-create", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchChangeInventoryRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -615,7 +612,7 @@ export class InventoryClient { * that cannot be handled by other, simpler endpoints. * * @param {Square.BatchRetrieveInventoryChangesRequest} request - * @param {InventoryClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Inventory.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.inventory.batchGetChanges({ @@ -629,20 +626,12 @@ export class InventoryClient { */ public async batchGetChanges( request: Square.BatchRetrieveInventoryChangesRequest, - requestOptions?: InventoryClient.RequestOptions, - ): Promise> { + requestOptions?: Inventory.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.BatchRetrieveInventoryChangesRequest, ): Promise> => { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -651,19 +640,24 @@ export class InventoryClient { "v2/inventory/changes/batch-retrieve", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchRetrieveInventoryChangesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -704,7 +698,7 @@ export class InventoryClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -730,7 +724,7 @@ export class InventoryClient { * in response to receiving a Webhook notification. * * @param {Square.BatchGetInventoryCountsRequest} request - * @param {InventoryClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Inventory.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.inventory.batchGetCounts({ @@ -741,20 +735,12 @@ export class InventoryClient { */ public async batchGetCounts( request: Square.BatchGetInventoryCountsRequest, - requestOptions?: InventoryClient.RequestOptions, - ): Promise> { + requestOptions?: Inventory.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.BatchGetInventoryCountsRequest, ): Promise> => { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -763,19 +749,24 @@ export class InventoryClient { "v2/inventory/counts/batch-retrieve", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchGetInventoryCountsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -816,7 +807,7 @@ export class InventoryClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -833,7 +824,7 @@ export class InventoryClient { * is updated to conform to the standard convention. * * @param {Square.DeprecatedGetPhysicalCountInventoryRequest} request - * @param {InventoryClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Inventory.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.inventory.deprecatedGetPhysicalCount({ @@ -842,39 +833,35 @@ export class InventoryClient { */ public deprecatedGetPhysicalCount( request: Square.DeprecatedGetPhysicalCountInventoryRequest, - requestOptions?: InventoryClient.RequestOptions, + requestOptions?: Inventory.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__deprecatedGetPhysicalCount(request, requestOptions)); } private async __deprecatedGetPhysicalCount( request: Square.DeprecatedGetPhysicalCountInventoryRequest, - requestOptions?: InventoryClient.RequestOptions, + requestOptions?: Inventory.RequestOptions, ): Promise> { const { physicalCountId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/inventory/physical-count/${core.url.encodePathParam(physicalCountId)}`, + `v2/inventory/physical-count/${encodeURIComponent(physicalCountId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -921,7 +908,7 @@ export class InventoryClient { * object with the provided `physical_count_id`. * * @param {Square.GetPhysicalCountInventoryRequest} request - * @param {InventoryClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Inventory.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.inventory.getPhysicalCount({ @@ -930,39 +917,35 @@ export class InventoryClient { */ public getPhysicalCount( request: Square.GetPhysicalCountInventoryRequest, - requestOptions?: InventoryClient.RequestOptions, + requestOptions?: Inventory.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getPhysicalCount(request, requestOptions)); } private async __getPhysicalCount( request: Square.GetPhysicalCountInventoryRequest, - requestOptions?: InventoryClient.RequestOptions, + requestOptions?: Inventory.RequestOptions, ): Promise> { const { physicalCountId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/inventory/physical-counts/${core.url.encodePathParam(physicalCountId)}`, + `v2/inventory/physical-counts/${encodeURIComponent(physicalCountId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -1009,7 +992,7 @@ export class InventoryClient { * with the provided `transfer_id`. * * @param {Square.GetTransferInventoryRequest} request - * @param {InventoryClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Inventory.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.inventory.getTransfer({ @@ -1018,39 +1001,35 @@ export class InventoryClient { */ public getTransfer( request: Square.GetTransferInventoryRequest, - requestOptions?: InventoryClient.RequestOptions, + requestOptions?: Inventory.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__getTransfer(request, requestOptions)); } private async __getTransfer( request: Square.GetTransferInventoryRequest, - requestOptions?: InventoryClient.RequestOptions, + requestOptions?: Inventory.RequestOptions, ): Promise> { const { transferId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/inventory/transfers/${core.url.encodePathParam(transferId)}`, + `v2/inventory/transfers/${encodeURIComponent(transferId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -1099,7 +1078,7 @@ export class InventoryClient { * For more sophisticated queries, use a batch endpoint. * * @param {Square.GetInventoryRequest} request - * @param {InventoryClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Inventory.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.inventory.get({ @@ -1110,8 +1089,8 @@ export class InventoryClient { */ public async get( request: Square.GetInventoryRequest, - requestOptions?: InventoryClient.RequestOptions, - ): Promise> { + requestOptions?: Inventory.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.GetInventoryRequest, @@ -1119,34 +1098,32 @@ export class InventoryClient { const { catalogObjectId, locationIds, cursor } = request; const _queryParams: Record = {}; if (locationIds !== undefined) { - _queryParams.location_ids = locationIds; + _queryParams["location_ids"] = locationIds; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/inventory/${core.url.encodePathParam(catalogObjectId)}`, + `v2/inventory/${encodeURIComponent(catalogObjectId)}`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -1187,7 +1164,7 @@ export class InventoryClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -1215,7 +1192,7 @@ export class InventoryClient { * sophisticated queries, use a batch endpoint. * * @param {Square.ChangesInventoryRequest} request - * @param {InventoryClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Inventory.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.inventory.changes({ @@ -1226,8 +1203,8 @@ export class InventoryClient { */ public async changes( request: Square.ChangesInventoryRequest, - requestOptions?: InventoryClient.RequestOptions, - ): Promise> { + requestOptions?: Inventory.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.ChangesInventoryRequest, @@ -1235,34 +1212,32 @@ export class InventoryClient { const { catalogObjectId, locationIds, cursor } = request; const _queryParams: Record = {}; if (locationIds !== undefined) { - _queryParams.location_ids = locationIds; + _queryParams["location_ids"] = locationIds; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/inventory/${core.url.encodePathParam(catalogObjectId)}/changes`, + `v2/inventory/${encodeURIComponent(catalogObjectId)}/changes`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -1303,7 +1278,7 @@ export class InventoryClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -1316,7 +1291,7 @@ export class InventoryClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/inventory/client/index.ts b/src/api/resources/inventory/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/inventory/client/index.ts +++ b/src/api/resources/inventory/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/inventory/client/requests/ChangesInventoryRequest.ts b/src/api/resources/inventory/client/requests/ChangesInventoryRequest.ts index 14891ac79..4be1ccbc5 100644 --- a/src/api/resources/inventory/client/requests/ChangesInventoryRequest.ts +++ b/src/api/resources/inventory/client/requests/ChangesInventoryRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -9,7 +11,9 @@ * } */ export interface ChangesInventoryRequest { - /** ID of the [CatalogObject](entity:CatalogObject) to retrieve. */ + /** + * ID of the [CatalogObject](entity:CatalogObject) to retrieve. + */ catalogObjectId: string; /** * The [Location](entity:Location) IDs to look up as a comma-separated diff --git a/src/api/resources/inventory/client/requests/DeprecatedGetAdjustmentInventoryRequest.ts b/src/api/resources/inventory/client/requests/DeprecatedGetAdjustmentInventoryRequest.ts index 64cfe0b60..c9473a53c 100644 --- a/src/api/resources/inventory/client/requests/DeprecatedGetAdjustmentInventoryRequest.ts +++ b/src/api/resources/inventory/client/requests/DeprecatedGetAdjustmentInventoryRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface DeprecatedGetAdjustmentInventoryRequest { - /** ID of the [InventoryAdjustment](entity:InventoryAdjustment) to retrieve. */ + /** + * ID of the [InventoryAdjustment](entity:InventoryAdjustment) to retrieve. + */ adjustmentId: string; } diff --git a/src/api/resources/inventory/client/requests/DeprecatedGetPhysicalCountInventoryRequest.ts b/src/api/resources/inventory/client/requests/DeprecatedGetPhysicalCountInventoryRequest.ts index 5674c5b69..d9de48c2a 100644 --- a/src/api/resources/inventory/client/requests/DeprecatedGetPhysicalCountInventoryRequest.ts +++ b/src/api/resources/inventory/client/requests/DeprecatedGetPhysicalCountInventoryRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/inventory/client/requests/GetAdjustmentInventoryRequest.ts b/src/api/resources/inventory/client/requests/GetAdjustmentInventoryRequest.ts index 3aa3090e2..c65aa9ca8 100644 --- a/src/api/resources/inventory/client/requests/GetAdjustmentInventoryRequest.ts +++ b/src/api/resources/inventory/client/requests/GetAdjustmentInventoryRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetAdjustmentInventoryRequest { - /** ID of the [InventoryAdjustment](entity:InventoryAdjustment) to retrieve. */ + /** + * ID of the [InventoryAdjustment](entity:InventoryAdjustment) to retrieve. + */ adjustmentId: string; } diff --git a/src/api/resources/inventory/client/requests/GetInventoryRequest.ts b/src/api/resources/inventory/client/requests/GetInventoryRequest.ts index a16313278..c4cb90342 100644 --- a/src/api/resources/inventory/client/requests/GetInventoryRequest.ts +++ b/src/api/resources/inventory/client/requests/GetInventoryRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -9,7 +11,9 @@ * } */ export interface GetInventoryRequest { - /** ID of the [CatalogObject](entity:CatalogObject) to retrieve. */ + /** + * ID of the [CatalogObject](entity:CatalogObject) to retrieve. + */ catalogObjectId: string; /** * The [Location](entity:Location) IDs to look up as a comma-separated diff --git a/src/api/resources/inventory/client/requests/GetPhysicalCountInventoryRequest.ts b/src/api/resources/inventory/client/requests/GetPhysicalCountInventoryRequest.ts index 1c1d7cd68..cfc96a4c6 100644 --- a/src/api/resources/inventory/client/requests/GetPhysicalCountInventoryRequest.ts +++ b/src/api/resources/inventory/client/requests/GetPhysicalCountInventoryRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/inventory/client/requests/GetTransferInventoryRequest.ts b/src/api/resources/inventory/client/requests/GetTransferInventoryRequest.ts index 50fc548e1..c09664a30 100644 --- a/src/api/resources/inventory/client/requests/GetTransferInventoryRequest.ts +++ b/src/api/resources/inventory/client/requests/GetTransferInventoryRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetTransferInventoryRequest { - /** ID of the [InventoryTransfer](entity:InventoryTransfer) to retrieve. */ + /** + * ID of the [InventoryTransfer](entity:InventoryTransfer) to retrieve. + */ transferId: string; } diff --git a/src/api/resources/inventory/client/requests/index.ts b/src/api/resources/inventory/client/requests/index.ts index 30b02fc9c..b1ea5cc1f 100644 --- a/src/api/resources/inventory/client/requests/index.ts +++ b/src/api/resources/inventory/client/requests/index.ts @@ -1,7 +1,7 @@ -export type { ChangesInventoryRequest } from "./ChangesInventoryRequest"; -export type { DeprecatedGetAdjustmentInventoryRequest } from "./DeprecatedGetAdjustmentInventoryRequest"; -export type { DeprecatedGetPhysicalCountInventoryRequest } from "./DeprecatedGetPhysicalCountInventoryRequest"; -export type { GetAdjustmentInventoryRequest } from "./GetAdjustmentInventoryRequest"; -export type { GetInventoryRequest } from "./GetInventoryRequest"; -export type { GetPhysicalCountInventoryRequest } from "./GetPhysicalCountInventoryRequest"; -export type { GetTransferInventoryRequest } from "./GetTransferInventoryRequest"; +export { type DeprecatedGetAdjustmentInventoryRequest } from "./DeprecatedGetAdjustmentInventoryRequest"; +export { type GetAdjustmentInventoryRequest } from "./GetAdjustmentInventoryRequest"; +export { type DeprecatedGetPhysicalCountInventoryRequest } from "./DeprecatedGetPhysicalCountInventoryRequest"; +export { type GetPhysicalCountInventoryRequest } from "./GetPhysicalCountInventoryRequest"; +export { type GetTransferInventoryRequest } from "./GetTransferInventoryRequest"; +export { type GetInventoryRequest } from "./GetInventoryRequest"; +export { type ChangesInventoryRequest } from "./ChangesInventoryRequest"; diff --git a/src/api/resources/invoices/client/Client.ts b/src/api/resources/invoices/client/Client.ts index ae1562f96..b14a6d32c 100644 --- a/src/api/resources/invoices/client/Client.ts +++ b/src/api/resources/invoices/client/Client.ts @@ -1,26 +1,47 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import { toJson } from "../../../../core/json"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; +import * as errors from "../../../../errors/index"; +import { toJson } from "../../../../core/json"; -export declare namespace InvoicesClient { - export interface Options extends BaseClientOptions {} +export declare namespace Invoices { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class InvoicesClient { - protected readonly _options: InvoicesClient.Options; +export class Invoices { + protected readonly _options: Invoices.Options; - constructor(options: InvoicesClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Invoices.Options = {}) { + this._options = _options; } /** @@ -29,7 +50,7 @@ export class InvoicesClient { * use in a subsequent request to retrieve the next set of invoices. * * @param {Square.ListInvoicesRequest} request - * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.invoices.list({ @@ -40,27 +61,19 @@ export class InvoicesClient { */ public async list( request: Square.ListInvoicesRequest, - requestOptions?: InvoicesClient.RequestOptions, - ): Promise> { + requestOptions?: Invoices.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async (request: Square.ListInvoicesRequest): Promise> => { const { locationId, cursor, limit } = request; const _queryParams: Record = {}; - _queryParams.location_id = locationId; + _queryParams["location_id"] = locationId; if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -69,13 +82,19 @@ export class InvoicesClient { "v2/invoices", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -114,7 +133,7 @@ export class InvoicesClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -134,7 +153,7 @@ export class InvoicesClient { * You must publish the invoice before Square can process it (send it to the customer's email address or charge the customer’s card on file). * * @param {Square.CreateInvoiceRequest} request - * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.invoices.create({ @@ -183,23 +202,15 @@ export class InvoicesClient { */ public create( request: Square.CreateInvoiceRequest, - requestOptions?: InvoicesClient.RequestOptions, + requestOptions?: Invoices.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.CreateInvoiceRequest, - requestOptions?: InvoicesClient.RequestOptions, + requestOptions?: Invoices.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -208,19 +219,23 @@ export class InvoicesClient { "v2/invoices", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateInvoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -270,7 +285,7 @@ export class InvoicesClient { * that you use in a subsequent request to retrieve the next set of invoices. * * @param {Square.SearchInvoicesRequest} request - * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.invoices.search({ @@ -289,23 +304,15 @@ export class InvoicesClient { */ public search( request: Square.SearchInvoicesRequest, - requestOptions?: InvoicesClient.RequestOptions, + requestOptions?: Invoices.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__search(request, requestOptions)); } private async __search( request: Square.SearchInvoicesRequest, - requestOptions?: InvoicesClient.RequestOptions, + requestOptions?: Invoices.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -314,19 +321,23 @@ export class InvoicesClient { "v2/invoices/search", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchInvoicesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -370,7 +381,7 @@ export class InvoicesClient { * Retrieves an invoice by invoice ID. * * @param {Square.GetInvoicesRequest} request - * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.invoices.get({ @@ -379,39 +390,35 @@ export class InvoicesClient { */ public get( request: Square.GetInvoicesRequest, - requestOptions?: InvoicesClient.RequestOptions, + requestOptions?: Invoices.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.GetInvoicesRequest, - requestOptions?: InvoicesClient.RequestOptions, + requestOptions?: Invoices.RequestOptions, ): Promise> { const { invoiceId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/invoices/${core.url.encodePathParam(invoiceId)}`, + `v2/invoices/${encodeURIComponent(invoiceId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -458,7 +465,7 @@ export class InvoicesClient { * `order_id` or `location_id` field. * * @param {Square.UpdateInvoiceRequest} request - * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.invoices.update({ @@ -475,45 +482,41 @@ export class InvoicesClient { */ public update( request: Square.UpdateInvoiceRequest, - requestOptions?: InvoicesClient.RequestOptions, + requestOptions?: Invoices.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); } private async __update( request: Square.UpdateInvoiceRequest, - requestOptions?: InvoicesClient.RequestOptions, + requestOptions?: Invoices.RequestOptions, ): Promise> { const { invoiceId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/invoices/${core.url.encodePathParam(invoiceId)}`, + `v2/invoices/${encodeURIComponent(invoiceId)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateInvoiceRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -559,7 +562,7 @@ export class InvoicesClient { * invoice (you cannot delete a published invoice, including one that is scheduled for processing). * * @param {Square.DeleteInvoicesRequest} request - * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.invoices.delete({ @@ -569,44 +572,41 @@ export class InvoicesClient { */ public delete( request: Square.DeleteInvoicesRequest, - requestOptions?: InvoicesClient.RequestOptions, + requestOptions?: Invoices.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); } private async __delete( request: Square.DeleteInvoicesRequest, - requestOptions?: InvoicesClient.RequestOptions, + requestOptions?: Invoices.RequestOptions, ): Promise> { const { invoiceId, version } = request; const _queryParams: Record = {}; if (version !== undefined) { - _queryParams.version = version?.toString() ?? null; + _queryParams["version"] = version?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/invoices/${core.url.encodePathParam(invoiceId)}`, + `v2/invoices/${encodeURIComponent(invoiceId)}`, ), method: "DELETE", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -657,24 +657,23 @@ export class InvoicesClient { * __NOTE:__ When testing in the Sandbox environment, the total file size is limited to 1 KB. * * @param {Square.CreateInvoiceAttachmentRequest} request - * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration. * * @example - * import { createReadStream } from "fs"; * await client.invoices.createInvoiceAttachment({ * invoiceId: "invoice_id" * }) */ public createInvoiceAttachment( request: Square.CreateInvoiceAttachmentRequest, - requestOptions?: InvoicesClient.RequestOptions, + requestOptions?: Invoices.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createInvoiceAttachment(request, requestOptions)); } private async __createInvoiceAttachment( request: Square.CreateInvoiceAttachmentRequest, - requestOptions?: InvoicesClient.RequestOptions, + requestOptions?: Invoices.RequestOptions, ): Promise> { const _request = await core.newFormData(); if (request.request != null) { @@ -694,33 +693,29 @@ export class InvoicesClient { } const _maybeEncodedRequest = await _request.getRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - ..._maybeEncodedRequest.headers, - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/invoices/${core.url.encodePathParam(request.invoiceId)}/attachments`, + `v2/invoices/${encodeURIComponent(request.invoiceId)}/attachments`, ), method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + ..._maybeEncodedRequest.headers, + }), + requestOptions?.headers, + ), requestType: "file", duplex: _maybeEncodedRequest.duplex, body: _maybeEncodedRequest.body, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -767,7 +762,7 @@ export class InvoicesClient { * from invoices in the `DRAFT`, `SCHEDULED`, `UNPAID`, or `PARTIALLY_PAID` state. * * @param {Square.DeleteInvoiceAttachmentRequest} request - * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.invoices.deleteInvoiceAttachment({ @@ -777,39 +772,35 @@ export class InvoicesClient { */ public deleteInvoiceAttachment( request: Square.DeleteInvoiceAttachmentRequest, - requestOptions?: InvoicesClient.RequestOptions, + requestOptions?: Invoices.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__deleteInvoiceAttachment(request, requestOptions)); } private async __deleteInvoiceAttachment( request: Square.DeleteInvoiceAttachmentRequest, - requestOptions?: InvoicesClient.RequestOptions, + requestOptions?: Invoices.RequestOptions, ): Promise> { const { invoiceId, attachmentId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/invoices/${core.url.encodePathParam(invoiceId)}/attachments/${core.url.encodePathParam(attachmentId)}`, + `v2/invoices/${encodeURIComponent(invoiceId)}/attachments/${encodeURIComponent(attachmentId)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -858,7 +849,7 @@ export class InvoicesClient { * You cannot cancel an invoice in the `DRAFT` state or in a terminal state: `PAID`, `REFUNDED`, `CANCELED`, or `FAILED`. * * @param {Square.CancelInvoiceRequest} request - * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.invoices.cancel({ @@ -868,45 +859,41 @@ export class InvoicesClient { */ public cancel( request: Square.CancelInvoiceRequest, - requestOptions?: InvoicesClient.RequestOptions, + requestOptions?: Invoices.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__cancel(request, requestOptions)); } private async __cancel( request: Square.CancelInvoiceRequest, - requestOptions?: InvoicesClient.RequestOptions, + requestOptions?: Invoices.RequestOptions, ): Promise> { const { invoiceId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/invoices/${core.url.encodePathParam(invoiceId)}/cancel`, + `v2/invoices/${encodeURIComponent(invoiceId)}/cancel`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CancelInvoiceRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -965,7 +952,7 @@ export class InvoicesClient { * and `PAYMENTS_WRITE` are required when publishing invoices configured for card-on-file payments. * * @param {Square.PublishInvoiceRequest} request - * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Invoices.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.invoices.publish({ @@ -976,45 +963,41 @@ export class InvoicesClient { */ public publish( request: Square.PublishInvoiceRequest, - requestOptions?: InvoicesClient.RequestOptions, + requestOptions?: Invoices.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__publish(request, requestOptions)); } private async __publish( request: Square.PublishInvoiceRequest, - requestOptions?: InvoicesClient.RequestOptions, + requestOptions?: Invoices.RequestOptions, ): Promise> { const { invoiceId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/invoices/${core.url.encodePathParam(invoiceId)}/publish`, + `v2/invoices/${encodeURIComponent(invoiceId)}/publish`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.PublishInvoiceRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -1057,7 +1040,7 @@ export class InvoicesClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/invoices/client/index.ts b/src/api/resources/invoices/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/invoices/client/index.ts +++ b/src/api/resources/invoices/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/invoices/client/requests/CancelInvoiceRequest.ts b/src/api/resources/invoices/client/requests/CancelInvoiceRequest.ts index 79b61b825..57766ffa7 100644 --- a/src/api/resources/invoices/client/requests/CancelInvoiceRequest.ts +++ b/src/api/resources/invoices/client/requests/CancelInvoiceRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,7 +10,9 @@ * } */ export interface CancelInvoiceRequest { - /** The ID of the [invoice](entity:Invoice) to cancel. */ + /** + * The ID of the [invoice](entity:Invoice) to cancel. + */ invoiceId: string; /** * The version of the [invoice](entity:Invoice) to cancel. diff --git a/src/api/resources/invoices/client/requests/CreateInvoiceAttachmentRequest.ts b/src/api/resources/invoices/client/requests/CreateInvoiceAttachmentRequest.ts index a0d66240e..da5fcfc6f 100644 --- a/src/api/resources/invoices/client/requests/CreateInvoiceAttachmentRequest.ts +++ b/src/api/resources/invoices/client/requests/CreateInvoiceAttachmentRequest.ts @@ -1,7 +1,9 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as fs from "fs"; -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; +import * as fs from "fs"; /** * @example @@ -10,7 +12,9 @@ import type * as Square from "../../../../index"; * } */ export interface CreateInvoiceAttachmentRequest { - /** The ID of the [invoice](entity:Invoice) to attach the file to. */ + /** + * The ID of the [invoice](entity:Invoice) to attach the file to. + */ invoiceId: string; request?: Square.CreateInvoiceAttachmentRequestData; imageFile?: File | fs.ReadStream | Blob | undefined; diff --git a/src/api/resources/invoices/client/requests/CreateInvoiceRequest.ts b/src/api/resources/invoices/client/requests/CreateInvoiceRequest.ts index 48da4aa74..32296308a 100644 --- a/src/api/resources/invoices/client/requests/CreateInvoiceRequest.ts +++ b/src/api/resources/invoices/client/requests/CreateInvoiceRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/invoices/client/requests/DeleteInvoiceAttachmentRequest.ts b/src/api/resources/invoices/client/requests/DeleteInvoiceAttachmentRequest.ts index f1852641c..56926b013 100644 --- a/src/api/resources/invoices/client/requests/DeleteInvoiceAttachmentRequest.ts +++ b/src/api/resources/invoices/client/requests/DeleteInvoiceAttachmentRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,8 +10,12 @@ * } */ export interface DeleteInvoiceAttachmentRequest { - /** The ID of the [invoice](entity:Invoice) to delete the attachment from. */ + /** + * The ID of the [invoice](entity:Invoice) to delete the attachment from. + */ invoiceId: string; - /** The ID of the [attachment](entity:InvoiceAttachment) to delete. */ + /** + * The ID of the [attachment](entity:InvoiceAttachment) to delete. + */ attachmentId: string; } diff --git a/src/api/resources/invoices/client/requests/DeleteInvoicesRequest.ts b/src/api/resources/invoices/client/requests/DeleteInvoicesRequest.ts index 6f36aafcf..97e237452 100644 --- a/src/api/resources/invoices/client/requests/DeleteInvoicesRequest.ts +++ b/src/api/resources/invoices/client/requests/DeleteInvoicesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,7 +10,9 @@ * } */ export interface DeleteInvoicesRequest { - /** The ID of the invoice to delete. */ + /** + * The ID of the invoice to delete. + */ invoiceId: string; /** * The version of the [invoice](entity:Invoice) to delete. diff --git a/src/api/resources/invoices/client/requests/GetInvoicesRequest.ts b/src/api/resources/invoices/client/requests/GetInvoicesRequest.ts index 5342763ee..8f288b53f 100644 --- a/src/api/resources/invoices/client/requests/GetInvoicesRequest.ts +++ b/src/api/resources/invoices/client/requests/GetInvoicesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetInvoicesRequest { - /** The ID of the invoice to retrieve. */ + /** + * The ID of the invoice to retrieve. + */ invoiceId: string; } diff --git a/src/api/resources/invoices/client/requests/ListInvoicesRequest.ts b/src/api/resources/invoices/client/requests/ListInvoicesRequest.ts index f07c3a973..501cde386 100644 --- a/src/api/resources/invoices/client/requests/ListInvoicesRequest.ts +++ b/src/api/resources/invoices/client/requests/ListInvoicesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -9,7 +11,9 @@ * } */ export interface ListInvoicesRequest { - /** The ID of the location for which to list invoices. */ + /** + * The ID of the location for which to list invoices. + */ locationId: string; /** * A pagination cursor returned by a previous call to this endpoint. diff --git a/src/api/resources/invoices/client/requests/PublishInvoiceRequest.ts b/src/api/resources/invoices/client/requests/PublishInvoiceRequest.ts index 9c5866162..d6c52757a 100644 --- a/src/api/resources/invoices/client/requests/PublishInvoiceRequest.ts +++ b/src/api/resources/invoices/client/requests/PublishInvoiceRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -9,7 +11,9 @@ * } */ export interface PublishInvoiceRequest { - /** The ID of the invoice to publish. */ + /** + * The ID of the invoice to publish. + */ invoiceId: string; /** * The version of the [invoice](entity:Invoice) to publish. diff --git a/src/api/resources/invoices/client/requests/SearchInvoicesRequest.ts b/src/api/resources/invoices/client/requests/SearchInvoicesRequest.ts index 34bf2062e..a33ce5a75 100644 --- a/src/api/resources/invoices/client/requests/SearchInvoicesRequest.ts +++ b/src/api/resources/invoices/client/requests/SearchInvoicesRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/invoices/client/requests/UpdateInvoiceRequest.ts b/src/api/resources/invoices/client/requests/UpdateInvoiceRequest.ts index 928fd6d32..a84529af0 100644 --- a/src/api/resources/invoices/client/requests/UpdateInvoiceRequest.ts +++ b/src/api/resources/invoices/client/requests/UpdateInvoiceRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -17,7 +19,9 @@ import type * as Square from "../../../../index"; * } */ export interface UpdateInvoiceRequest { - /** The ID of the invoice to update. */ + /** + * The ID of the invoice to update. + */ invoiceId: string; /** * The invoice fields to add, change, or clear. Fields can be cleared using diff --git a/src/api/resources/invoices/client/requests/index.ts b/src/api/resources/invoices/client/requests/index.ts index 71c00300b..d6b0b4452 100644 --- a/src/api/resources/invoices/client/requests/index.ts +++ b/src/api/resources/invoices/client/requests/index.ts @@ -1,10 +1,10 @@ -export type { CancelInvoiceRequest } from "./CancelInvoiceRequest"; -export type { CreateInvoiceAttachmentRequest } from "./CreateInvoiceAttachmentRequest"; -export type { CreateInvoiceRequest } from "./CreateInvoiceRequest"; -export type { DeleteInvoiceAttachmentRequest } from "./DeleteInvoiceAttachmentRequest"; -export type { DeleteInvoicesRequest } from "./DeleteInvoicesRequest"; -export type { GetInvoicesRequest } from "./GetInvoicesRequest"; -export type { ListInvoicesRequest } from "./ListInvoicesRequest"; -export type { PublishInvoiceRequest } from "./PublishInvoiceRequest"; -export type { SearchInvoicesRequest } from "./SearchInvoicesRequest"; -export type { UpdateInvoiceRequest } from "./UpdateInvoiceRequest"; +export { type ListInvoicesRequest } from "./ListInvoicesRequest"; +export { type CreateInvoiceRequest } from "./CreateInvoiceRequest"; +export { type SearchInvoicesRequest } from "./SearchInvoicesRequest"; +export { type GetInvoicesRequest } from "./GetInvoicesRequest"; +export { type UpdateInvoiceRequest } from "./UpdateInvoiceRequest"; +export { type DeleteInvoicesRequest } from "./DeleteInvoicesRequest"; +export { type CreateInvoiceAttachmentRequest } from "./CreateInvoiceAttachmentRequest"; +export { type DeleteInvoiceAttachmentRequest } from "./DeleteInvoiceAttachmentRequest"; +export { type CancelInvoiceRequest } from "./CancelInvoiceRequest"; +export { type PublishInvoiceRequest } from "./PublishInvoiceRequest"; diff --git a/src/api/resources/labor/client/Client.ts b/src/api/resources/labor/client/Client.ts index d10e8a1c8..5e2289f41 100644 --- a/src/api/resources/labor/client/Client.ts +++ b/src/api/resources/labor/client/Client.ts @@ -1,55 +1,76 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; -import { BreakTypesClient } from "../resources/breakTypes/client/Client"; -import { EmployeeWagesClient } from "../resources/employeeWages/client/Client"; -import { ShiftsClient } from "../resources/shifts/client/Client"; -import { TeamMemberWagesClient } from "../resources/teamMemberWages/client/Client"; -import { WorkweekConfigsClient } from "../resources/workweekConfigs/client/Client"; +import * as errors from "../../../../errors/index"; +import { BreakTypes } from "../resources/breakTypes/client/Client"; +import { EmployeeWages } from "../resources/employeeWages/client/Client"; +import { Shifts } from "../resources/shifts/client/Client"; +import { TeamMemberWages } from "../resources/teamMemberWages/client/Client"; +import { WorkweekConfigs } from "../resources/workweekConfigs/client/Client"; -export declare namespace LaborClient { - export interface Options extends BaseClientOptions {} +export declare namespace Labor { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class LaborClient { - protected readonly _options: LaborClient.Options; - protected _breakTypes: BreakTypesClient | undefined; - protected _employeeWages: EmployeeWagesClient | undefined; - protected _shifts: ShiftsClient | undefined; - protected _teamMemberWages: TeamMemberWagesClient | undefined; - protected _workweekConfigs: WorkweekConfigsClient | undefined; +export class Labor { + protected readonly _options: Labor.Options; + protected _breakTypes: BreakTypes | undefined; + protected _employeeWages: EmployeeWages | undefined; + protected _shifts: Shifts | undefined; + protected _teamMemberWages: TeamMemberWages | undefined; + protected _workweekConfigs: WorkweekConfigs | undefined; - constructor(options: LaborClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Labor.Options = {}) { + this._options = _options; } - public get breakTypes(): BreakTypesClient { - return (this._breakTypes ??= new BreakTypesClient(this._options)); + public get breakTypes(): BreakTypes { + return (this._breakTypes ??= new BreakTypes(this._options)); } - public get employeeWages(): EmployeeWagesClient { - return (this._employeeWages ??= new EmployeeWagesClient(this._options)); + public get employeeWages(): EmployeeWages { + return (this._employeeWages ??= new EmployeeWages(this._options)); } - public get shifts(): ShiftsClient { - return (this._shifts ??= new ShiftsClient(this._options)); + public get shifts(): Shifts { + return (this._shifts ??= new Shifts(this._options)); } - public get teamMemberWages(): TeamMemberWagesClient { - return (this._teamMemberWages ??= new TeamMemberWagesClient(this._options)); + public get teamMemberWages(): TeamMemberWages { + return (this._teamMemberWages ??= new TeamMemberWages(this._options)); } - public get workweekConfigs(): WorkweekConfigsClient { - return (this._workweekConfigs ??= new WorkweekConfigsClient(this._options)); + public get workweekConfigs(): WorkweekConfigs { + return (this._workweekConfigs ??= new WorkweekConfigs(this._options)); } /** @@ -63,7 +84,7 @@ export class LaborClient { * - `end_at` * * @param {Square.CreateScheduledShiftRequest} request - * @param {LaborClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Labor.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.createScheduledShift({ @@ -83,23 +104,15 @@ export class LaborClient { */ public createScheduledShift( request: Square.CreateScheduledShiftRequest, - requestOptions?: LaborClient.RequestOptions, + requestOptions?: Labor.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createScheduledShift(request, requestOptions)); } private async __createScheduledShift( request: Square.CreateScheduledShiftRequest, - requestOptions?: LaborClient.RequestOptions, + requestOptions?: Labor.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -108,19 +121,23 @@ export class LaborClient { "v2/labor/scheduled-shifts", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateScheduledShiftRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -169,7 +186,7 @@ export class LaborClient { * `BulkPublishScheduledShifts` request must fall within a two-week period. * * @param {Square.BulkPublishScheduledShiftsRequest} request - * @param {LaborClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Labor.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.bulkPublishScheduledShifts({ @@ -181,23 +198,15 @@ export class LaborClient { */ public bulkPublishScheduledShifts( request: Square.BulkPublishScheduledShiftsRequest, - requestOptions?: LaborClient.RequestOptions, + requestOptions?: Labor.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__bulkPublishScheduledShifts(request, requestOptions)); } private async __bulkPublishScheduledShifts( request: Square.BulkPublishScheduledShiftsRequest, - requestOptions?: LaborClient.RequestOptions, + requestOptions?: Labor.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -206,19 +215,23 @@ export class LaborClient { "v2/labor/scheduled-shifts/bulk-publish", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BulkPublishScheduledShiftsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -265,7 +278,7 @@ export class LaborClient { * By default, results are sorted by `start_at` in ascending order. * * @param {Square.SearchScheduledShiftsRequest} request - * @param {LaborClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Labor.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.searchScheduledShifts({ @@ -284,23 +297,15 @@ export class LaborClient { */ public searchScheduledShifts( request: Square.SearchScheduledShiftsRequest = {}, - requestOptions?: LaborClient.RequestOptions, + requestOptions?: Labor.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__searchScheduledShifts(request, requestOptions)); } private async __searchScheduledShifts( request: Square.SearchScheduledShiftsRequest = {}, - requestOptions?: LaborClient.RequestOptions, + requestOptions?: Labor.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -309,19 +314,23 @@ export class LaborClient { "v2/labor/scheduled-shifts/search", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchScheduledShiftsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -367,7 +376,7 @@ export class LaborClient { * Retrieves a scheduled shift by ID. * * @param {Square.RetrieveScheduledShiftRequest} request - * @param {LaborClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Labor.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.retrieveScheduledShift({ @@ -376,39 +385,35 @@ export class LaborClient { */ public retrieveScheduledShift( request: Square.RetrieveScheduledShiftRequest, - requestOptions?: LaborClient.RequestOptions, + requestOptions?: Labor.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__retrieveScheduledShift(request, requestOptions)); } private async __retrieveScheduledShift( request: Square.RetrieveScheduledShiftRequest, - requestOptions?: LaborClient.RequestOptions, + requestOptions?: Labor.RequestOptions, ): Promise> { const { id } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/labor/scheduled-shifts/${core.url.encodePathParam(id)}`, + `v2/labor/scheduled-shifts/${encodeURIComponent(id)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -463,7 +468,7 @@ export class LaborClient { * and then publish the shift. * * @param {Square.UpdateScheduledShiftRequest} request - * @param {LaborClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Labor.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.updateScheduledShift({ @@ -484,45 +489,41 @@ export class LaborClient { */ public updateScheduledShift( request: Square.UpdateScheduledShiftRequest, - requestOptions?: LaborClient.RequestOptions, + requestOptions?: Labor.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__updateScheduledShift(request, requestOptions)); } private async __updateScheduledShift( request: Square.UpdateScheduledShiftRequest, - requestOptions?: LaborClient.RequestOptions, + requestOptions?: Labor.RequestOptions, ): Promise> { const { id, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/labor/scheduled-shifts/${core.url.encodePathParam(id)}`, + `v2/labor/scheduled-shifts/${encodeURIComponent(id)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateScheduledShiftRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -569,7 +570,7 @@ export class LaborClient { * `draft_shift_details` field as is and copies it to the `published_shift_details` field. * * @param {Square.PublishScheduledShiftRequest} request - * @param {LaborClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Labor.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.publishScheduledShift({ @@ -581,45 +582,41 @@ export class LaborClient { */ public publishScheduledShift( request: Square.PublishScheduledShiftRequest, - requestOptions?: LaborClient.RequestOptions, + requestOptions?: Labor.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__publishScheduledShift(request, requestOptions)); } private async __publishScheduledShift( request: Square.PublishScheduledShiftRequest, - requestOptions?: LaborClient.RequestOptions, + requestOptions?: Labor.RequestOptions, ): Promise> { const { id, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/labor/scheduled-shifts/${core.url.encodePathParam(id)}/publish`, + `v2/labor/scheduled-shifts/${encodeURIComponent(id)}/publish`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.PublishScheduledShiftRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -682,7 +679,7 @@ export class LaborClient { * the `Timecard.end_at`, or both. * * @param {Square.CreateTimecardRequest} request - * @param {LaborClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Labor.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.createTimecard({ @@ -717,23 +714,15 @@ export class LaborClient { */ public createTimecard( request: Square.CreateTimecardRequest, - requestOptions?: LaborClient.RequestOptions, + requestOptions?: Labor.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createTimecard(request, requestOptions)); } private async __createTimecard( request: Square.CreateTimecardRequest, - requestOptions?: LaborClient.RequestOptions, + requestOptions?: Labor.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -742,19 +731,23 @@ export class LaborClient { "v2/labor/timecards", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateTimecardRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -811,7 +804,7 @@ export class LaborClient { * - `UPDATED_AT` * * @param {Square.SearchTimecardsRequest} request - * @param {LaborClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Labor.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.searchTimecards({ @@ -832,23 +825,15 @@ export class LaborClient { */ public searchTimecards( request: Square.SearchTimecardsRequest = {}, - requestOptions?: LaborClient.RequestOptions, + requestOptions?: Labor.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__searchTimecards(request, requestOptions)); } private async __searchTimecards( request: Square.SearchTimecardsRequest = {}, - requestOptions?: LaborClient.RequestOptions, + requestOptions?: Labor.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -857,19 +842,23 @@ export class LaborClient { "v2/labor/timecards/search", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchTimecardsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -913,7 +902,7 @@ export class LaborClient { * Returns a single `Timecard` specified by `id`. * * @param {Square.RetrieveTimecardRequest} request - * @param {LaborClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Labor.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.retrieveTimecard({ @@ -922,39 +911,35 @@ export class LaborClient { */ public retrieveTimecard( request: Square.RetrieveTimecardRequest, - requestOptions?: LaborClient.RequestOptions, + requestOptions?: Labor.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__retrieveTimecard(request, requestOptions)); } private async __retrieveTimecard( request: Square.RetrieveTimecardRequest, - requestOptions?: LaborClient.RequestOptions, + requestOptions?: Labor.RequestOptions, ): Promise> { const { id } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/labor/timecards/${core.url.encodePathParam(id)}`, + `v2/labor/timecards/${encodeURIComponent(id)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -1004,7 +989,7 @@ export class LaborClient { * set on each `Break`. * * @param {Square.UpdateTimecardRequest} request - * @param {LaborClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Labor.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.updateTimecard({ @@ -1042,45 +1027,41 @@ export class LaborClient { */ public updateTimecard( request: Square.UpdateTimecardRequest, - requestOptions?: LaborClient.RequestOptions, + requestOptions?: Labor.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__updateTimecard(request, requestOptions)); } private async __updateTimecard( request: Square.UpdateTimecardRequest, - requestOptions?: LaborClient.RequestOptions, + requestOptions?: Labor.RequestOptions, ): Promise> { const { id, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/labor/timecards/${core.url.encodePathParam(id)}`, + `v2/labor/timecards/${encodeURIComponent(id)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateTimecardRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -1124,7 +1105,7 @@ export class LaborClient { * Deletes a `Timecard`. * * @param {Square.DeleteTimecardRequest} request - * @param {LaborClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Labor.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.deleteTimecard({ @@ -1133,39 +1114,35 @@ export class LaborClient { */ public deleteTimecard( request: Square.DeleteTimecardRequest, - requestOptions?: LaborClient.RequestOptions, + requestOptions?: Labor.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__deleteTimecard(request, requestOptions)); } private async __deleteTimecard( request: Square.DeleteTimecardRequest, - requestOptions?: LaborClient.RequestOptions, + requestOptions?: Labor.RequestOptions, ): Promise> { const { id } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/labor/timecards/${core.url.encodePathParam(id)}`, + `v2/labor/timecards/${encodeURIComponent(id)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -1206,7 +1183,7 @@ export class LaborClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/labor/client/index.ts b/src/api/resources/labor/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/labor/client/index.ts +++ b/src/api/resources/labor/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/labor/client/requests/BulkPublishScheduledShiftsRequest.ts b/src/api/resources/labor/client/requests/BulkPublishScheduledShiftsRequest.ts index 14e0a2f04..a2082ab1d 100644 --- a/src/api/resources/labor/client/requests/BulkPublishScheduledShiftsRequest.ts +++ b/src/api/resources/labor/client/requests/BulkPublishScheduledShiftsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/labor/client/requests/CreateScheduledShiftRequest.ts b/src/api/resources/labor/client/requests/CreateScheduledShiftRequest.ts index d13dc516f..b17585939 100644 --- a/src/api/resources/labor/client/requests/CreateScheduledShiftRequest.ts +++ b/src/api/resources/labor/client/requests/CreateScheduledShiftRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/labor/client/requests/CreateTimecardRequest.ts b/src/api/resources/labor/client/requests/CreateTimecardRequest.ts index e1538b5a9..1e70da741 100644 --- a/src/api/resources/labor/client/requests/CreateTimecardRequest.ts +++ b/src/api/resources/labor/client/requests/CreateTimecardRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/labor/client/requests/DeleteTimecardRequest.ts b/src/api/resources/labor/client/requests/DeleteTimecardRequest.ts index cd097d193..cb6ec0223 100644 --- a/src/api/resources/labor/client/requests/DeleteTimecardRequest.ts +++ b/src/api/resources/labor/client/requests/DeleteTimecardRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface DeleteTimecardRequest { - /** The UUID for the `Timecard` being deleted. */ + /** + * The UUID for the `Timecard` being deleted. + */ id: string; } diff --git a/src/api/resources/labor/client/requests/PublishScheduledShiftRequest.ts b/src/api/resources/labor/client/requests/PublishScheduledShiftRequest.ts index be5aedc65..4d3be81fb 100644 --- a/src/api/resources/labor/client/requests/PublishScheduledShiftRequest.ts +++ b/src/api/resources/labor/client/requests/PublishScheduledShiftRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -12,7 +14,9 @@ import type * as Square from "../../../../index"; * } */ export interface PublishScheduledShiftRequest { - /** The ID of the scheduled shift to publish. */ + /** + * The ID of the scheduled shift to publish. + */ id: string; /** * A unique identifier for the `PublishScheduledShift` request, used to ensure the diff --git a/src/api/resources/labor/client/requests/RetrieveScheduledShiftRequest.ts b/src/api/resources/labor/client/requests/RetrieveScheduledShiftRequest.ts index 992dae070..d12a8f15b 100644 --- a/src/api/resources/labor/client/requests/RetrieveScheduledShiftRequest.ts +++ b/src/api/resources/labor/client/requests/RetrieveScheduledShiftRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface RetrieveScheduledShiftRequest { - /** The ID of the scheduled shift to retrieve. */ + /** + * The ID of the scheduled shift to retrieve. + */ id: string; } diff --git a/src/api/resources/labor/client/requests/RetrieveTimecardRequest.ts b/src/api/resources/labor/client/requests/RetrieveTimecardRequest.ts index b44f5e28c..99e58768d 100644 --- a/src/api/resources/labor/client/requests/RetrieveTimecardRequest.ts +++ b/src/api/resources/labor/client/requests/RetrieveTimecardRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface RetrieveTimecardRequest { - /** The UUID for the `Timecard` being retrieved. */ + /** + * The UUID for the `Timecard` being retrieved. + */ id: string; } diff --git a/src/api/resources/labor/client/requests/SearchScheduledShiftsRequest.ts b/src/api/resources/labor/client/requests/SearchScheduledShiftsRequest.ts index 5a8ab3c0b..ff557cd35 100644 --- a/src/api/resources/labor/client/requests/SearchScheduledShiftsRequest.ts +++ b/src/api/resources/labor/client/requests/SearchScheduledShiftsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/labor/client/requests/SearchTimecardsRequest.ts b/src/api/resources/labor/client/requests/SearchTimecardsRequest.ts index 5830fd2c1..7cb06c2dc 100644 --- a/src/api/resources/labor/client/requests/SearchTimecardsRequest.ts +++ b/src/api/resources/labor/client/requests/SearchTimecardsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/labor/client/requests/UpdateScheduledShiftRequest.ts b/src/api/resources/labor/client/requests/UpdateScheduledShiftRequest.ts index 22ba81fae..748947023 100644 --- a/src/api/resources/labor/client/requests/UpdateScheduledShiftRequest.ts +++ b/src/api/resources/labor/client/requests/UpdateScheduledShiftRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -21,7 +23,9 @@ import type * as Square from "../../../../index"; * } */ export interface UpdateScheduledShiftRequest { - /** The ID of the scheduled shift to update. */ + /** + * The ID of the scheduled shift to update. + */ id: string; /** * The scheduled shift with any updates in the `draft_shift_details` field. diff --git a/src/api/resources/labor/client/requests/UpdateTimecardRequest.ts b/src/api/resources/labor/client/requests/UpdateTimecardRequest.ts index a9babe1f7..c9ffafaae 100644 --- a/src/api/resources/labor/client/requests/UpdateTimecardRequest.ts +++ b/src/api/resources/labor/client/requests/UpdateTimecardRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -38,7 +40,9 @@ import type * as Square from "../../../../index"; * } */ export interface UpdateTimecardRequest { - /** The ID of the object being updated. */ + /** + * The ID of the object being updated. + */ id: string; /** The updated `Timecard` object. */ timecard: Square.Timecard; diff --git a/src/api/resources/labor/client/requests/index.ts b/src/api/resources/labor/client/requests/index.ts index 87988c2d7..8b8e6d675 100644 --- a/src/api/resources/labor/client/requests/index.ts +++ b/src/api/resources/labor/client/requests/index.ts @@ -1,11 +1,11 @@ -export type { BulkPublishScheduledShiftsRequest } from "./BulkPublishScheduledShiftsRequest"; -export type { CreateScheduledShiftRequest } from "./CreateScheduledShiftRequest"; -export type { CreateTimecardRequest } from "./CreateTimecardRequest"; -export type { DeleteTimecardRequest } from "./DeleteTimecardRequest"; -export type { PublishScheduledShiftRequest } from "./PublishScheduledShiftRequest"; -export type { RetrieveScheduledShiftRequest } from "./RetrieveScheduledShiftRequest"; -export type { RetrieveTimecardRequest } from "./RetrieveTimecardRequest"; -export type { SearchScheduledShiftsRequest } from "./SearchScheduledShiftsRequest"; -export type { SearchTimecardsRequest } from "./SearchTimecardsRequest"; -export type { UpdateScheduledShiftRequest } from "./UpdateScheduledShiftRequest"; -export type { UpdateTimecardRequest } from "./UpdateTimecardRequest"; +export { type CreateScheduledShiftRequest } from "./CreateScheduledShiftRequest"; +export { type BulkPublishScheduledShiftsRequest } from "./BulkPublishScheduledShiftsRequest"; +export { type SearchScheduledShiftsRequest } from "./SearchScheduledShiftsRequest"; +export { type RetrieveScheduledShiftRequest } from "./RetrieveScheduledShiftRequest"; +export { type UpdateScheduledShiftRequest } from "./UpdateScheduledShiftRequest"; +export { type PublishScheduledShiftRequest } from "./PublishScheduledShiftRequest"; +export { type CreateTimecardRequest } from "./CreateTimecardRequest"; +export { type SearchTimecardsRequest } from "./SearchTimecardsRequest"; +export { type RetrieveTimecardRequest } from "./RetrieveTimecardRequest"; +export { type UpdateTimecardRequest } from "./UpdateTimecardRequest"; +export { type DeleteTimecardRequest } from "./DeleteTimecardRequest"; diff --git a/src/api/resources/labor/resources/breakTypes/client/Client.ts b/src/api/resources/labor/resources/breakTypes/client/Client.ts index 8e068679f..a0c81e6f1 100644 --- a/src/api/resources/labor/resources/breakTypes/client/Client.ts +++ b/src/api/resources/labor/resources/breakTypes/client/Client.ts @@ -1,32 +1,53 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace BreakTypesClient { - export interface Options extends BaseClientOptions {} +export declare namespace BreakTypes { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class BreakTypesClient { - protected readonly _options: BreakTypesClient.Options; +export class BreakTypes { + protected readonly _options: BreakTypes.Options; - constructor(options: BreakTypesClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: BreakTypes.Options = {}) { + this._options = _options; } /** * Returns a paginated list of `BreakType` instances for a business. * * @param {Square.labor.ListBreakTypesRequest} request - * @param {BreakTypesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {BreakTypes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.breakTypes.list({ @@ -37,8 +58,8 @@ export class BreakTypesClient { */ public async list( request: Square.labor.ListBreakTypesRequest = {}, - requestOptions?: BreakTypesClient.RequestOptions, - ): Promise> { + requestOptions?: BreakTypes.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.labor.ListBreakTypesRequest, @@ -46,22 +67,14 @@ export class BreakTypesClient { const { locationId, limit, cursor } = request; const _queryParams: Record = {}; if (locationId !== undefined) { - _queryParams.location_id = locationId; + _queryParams["location_id"] = locationId; } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -70,13 +83,19 @@ export class BreakTypesClient { "v2/labor/break-types", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -115,7 +134,7 @@ export class BreakTypesClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -144,7 +163,7 @@ export class BreakTypesClient { * is returned. * * @param {Square.labor.CreateBreakTypeRequest} request - * @param {BreakTypesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {BreakTypes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.breakTypes.create({ @@ -159,23 +178,15 @@ export class BreakTypesClient { */ public create( request: Square.labor.CreateBreakTypeRequest, - requestOptions?: BreakTypesClient.RequestOptions, + requestOptions?: BreakTypes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.labor.CreateBreakTypeRequest, - requestOptions?: BreakTypesClient.RequestOptions, + requestOptions?: BreakTypes.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -184,19 +195,23 @@ export class BreakTypesClient { "v2/labor/break-types", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.labor.CreateBreakTypeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -240,7 +255,7 @@ export class BreakTypesClient { * Returns a single `BreakType` specified by `id`. * * @param {Square.labor.GetBreakTypesRequest} request - * @param {BreakTypesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {BreakTypes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.breakTypes.get({ @@ -249,39 +264,35 @@ export class BreakTypesClient { */ public get( request: Square.labor.GetBreakTypesRequest, - requestOptions?: BreakTypesClient.RequestOptions, + requestOptions?: BreakTypes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.labor.GetBreakTypesRequest, - requestOptions?: BreakTypesClient.RequestOptions, + requestOptions?: BreakTypes.RequestOptions, ): Promise> { const { id } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/labor/break-types/${core.url.encodePathParam(id)}`, + `v2/labor/break-types/${encodeURIComponent(id)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -325,7 +336,7 @@ export class BreakTypesClient { * Updates an existing `BreakType`. * * @param {Square.labor.UpdateBreakTypeRequest} request - * @param {BreakTypesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {BreakTypes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.breakTypes.update({ @@ -341,45 +352,41 @@ export class BreakTypesClient { */ public update( request: Square.labor.UpdateBreakTypeRequest, - requestOptions?: BreakTypesClient.RequestOptions, + requestOptions?: BreakTypes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); } private async __update( request: Square.labor.UpdateBreakTypeRequest, - requestOptions?: BreakTypesClient.RequestOptions, + requestOptions?: BreakTypes.RequestOptions, ): Promise> { const { id, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/labor/break-types/${core.url.encodePathParam(id)}`, + `v2/labor/break-types/${encodeURIComponent(id)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.labor.UpdateBreakTypeRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -425,7 +432,7 @@ export class BreakTypesClient { * A `BreakType` can be deleted even if it is referenced from a `Shift`. * * @param {Square.labor.DeleteBreakTypesRequest} request - * @param {BreakTypesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {BreakTypes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.breakTypes.delete({ @@ -434,39 +441,35 @@ export class BreakTypesClient { */ public delete( request: Square.labor.DeleteBreakTypesRequest, - requestOptions?: BreakTypesClient.RequestOptions, + requestOptions?: BreakTypes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); } private async __delete( request: Square.labor.DeleteBreakTypesRequest, - requestOptions?: BreakTypesClient.RequestOptions, + requestOptions?: BreakTypes.RequestOptions, ): Promise> { const { id } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/labor/break-types/${core.url.encodePathParam(id)}`, + `v2/labor/break-types/${encodeURIComponent(id)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -507,7 +510,7 @@ export class BreakTypesClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/labor/resources/breakTypes/client/index.ts b/src/api/resources/labor/resources/breakTypes/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/labor/resources/breakTypes/client/index.ts +++ b/src/api/resources/labor/resources/breakTypes/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/labor/resources/breakTypes/client/requests/CreateBreakTypeRequest.ts b/src/api/resources/labor/resources/breakTypes/client/requests/CreateBreakTypeRequest.ts index 35f5f0e55..f79298188 100644 --- a/src/api/resources/labor/resources/breakTypes/client/requests/CreateBreakTypeRequest.ts +++ b/src/api/resources/labor/resources/breakTypes/client/requests/CreateBreakTypeRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/labor/resources/breakTypes/client/requests/DeleteBreakTypesRequest.ts b/src/api/resources/labor/resources/breakTypes/client/requests/DeleteBreakTypesRequest.ts index 516adf92b..43a446e81 100644 --- a/src/api/resources/labor/resources/breakTypes/client/requests/DeleteBreakTypesRequest.ts +++ b/src/api/resources/labor/resources/breakTypes/client/requests/DeleteBreakTypesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface DeleteBreakTypesRequest { - /** The UUID for the `BreakType` being deleted. */ + /** + * The UUID for the `BreakType` being deleted. + */ id: string; } diff --git a/src/api/resources/labor/resources/breakTypes/client/requests/GetBreakTypesRequest.ts b/src/api/resources/labor/resources/breakTypes/client/requests/GetBreakTypesRequest.ts index 7686e88db..b3151b750 100644 --- a/src/api/resources/labor/resources/breakTypes/client/requests/GetBreakTypesRequest.ts +++ b/src/api/resources/labor/resources/breakTypes/client/requests/GetBreakTypesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetBreakTypesRequest { - /** The UUID for the `BreakType` being retrieved. */ + /** + * The UUID for the `BreakType` being retrieved. + */ id: string; } diff --git a/src/api/resources/labor/resources/breakTypes/client/requests/ListBreakTypesRequest.ts b/src/api/resources/labor/resources/breakTypes/client/requests/ListBreakTypesRequest.ts index e0514c25f..f8d653dfc 100644 --- a/src/api/resources/labor/resources/breakTypes/client/requests/ListBreakTypesRequest.ts +++ b/src/api/resources/labor/resources/breakTypes/client/requests/ListBreakTypesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -19,6 +21,8 @@ export interface ListBreakTypesRequest { * and 200. The default is 200. */ limit?: number | null; - /** A pointer to the next page of `BreakType` results to fetch. */ + /** + * A pointer to the next page of `BreakType` results to fetch. + */ cursor?: string | null; } diff --git a/src/api/resources/labor/resources/breakTypes/client/requests/UpdateBreakTypeRequest.ts b/src/api/resources/labor/resources/breakTypes/client/requests/UpdateBreakTypeRequest.ts index ec23fb7e9..57ed0b0f5 100644 --- a/src/api/resources/labor/resources/breakTypes/client/requests/UpdateBreakTypeRequest.ts +++ b/src/api/resources/labor/resources/breakTypes/client/requests/UpdateBreakTypeRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -16,7 +18,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface UpdateBreakTypeRequest { - /** The UUID for the `BreakType` being updated. */ + /** + * The UUID for the `BreakType` being updated. + */ id: string; /** The updated `BreakType`. */ breakType: Square.BreakType; diff --git a/src/api/resources/labor/resources/breakTypes/client/requests/index.ts b/src/api/resources/labor/resources/breakTypes/client/requests/index.ts index 859da800c..12addd0f2 100644 --- a/src/api/resources/labor/resources/breakTypes/client/requests/index.ts +++ b/src/api/resources/labor/resources/breakTypes/client/requests/index.ts @@ -1,5 +1,5 @@ -export type { CreateBreakTypeRequest } from "./CreateBreakTypeRequest"; -export type { DeleteBreakTypesRequest } from "./DeleteBreakTypesRequest"; -export type { GetBreakTypesRequest } from "./GetBreakTypesRequest"; -export type { ListBreakTypesRequest } from "./ListBreakTypesRequest"; -export type { UpdateBreakTypeRequest } from "./UpdateBreakTypeRequest"; +export { type ListBreakTypesRequest } from "./ListBreakTypesRequest"; +export { type CreateBreakTypeRequest } from "./CreateBreakTypeRequest"; +export { type GetBreakTypesRequest } from "./GetBreakTypesRequest"; +export { type UpdateBreakTypeRequest } from "./UpdateBreakTypeRequest"; +export { type DeleteBreakTypesRequest } from "./DeleteBreakTypesRequest"; diff --git a/src/api/resources/labor/resources/employeeWages/client/Client.ts b/src/api/resources/labor/resources/employeeWages/client/Client.ts index 7c91bc303..e689aa0f4 100644 --- a/src/api/resources/labor/resources/employeeWages/client/Client.ts +++ b/src/api/resources/labor/resources/employeeWages/client/Client.ts @@ -1,32 +1,53 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace EmployeeWagesClient { - export interface Options extends BaseClientOptions {} +export declare namespace EmployeeWages { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class EmployeeWagesClient { - protected readonly _options: EmployeeWagesClient.Options; +export class EmployeeWages { + protected readonly _options: EmployeeWages.Options; - constructor(options: EmployeeWagesClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: EmployeeWages.Options = {}) { + this._options = _options; } /** * Returns a paginated list of `EmployeeWage` instances for a business. * * @param {Square.labor.ListEmployeeWagesRequest} request - * @param {EmployeeWagesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {EmployeeWages.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.employeeWages.list({ @@ -37,8 +58,8 @@ export class EmployeeWagesClient { */ public async list( request: Square.labor.ListEmployeeWagesRequest = {}, - requestOptions?: EmployeeWagesClient.RequestOptions, - ): Promise> { + requestOptions?: EmployeeWages.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.labor.ListEmployeeWagesRequest, @@ -46,22 +67,14 @@ export class EmployeeWagesClient { const { employeeId, limit, cursor } = request; const _queryParams: Record = {}; if (employeeId !== undefined) { - _queryParams.employee_id = employeeId; + _queryParams["employee_id"] = employeeId; } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -70,13 +83,19 @@ export class EmployeeWagesClient { "v2/labor/employee-wages", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -117,7 +136,7 @@ export class EmployeeWagesClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -133,7 +152,7 @@ export class EmployeeWagesClient { * Returns a single `EmployeeWage` specified by `id`. * * @param {Square.labor.GetEmployeeWagesRequest} request - * @param {EmployeeWagesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {EmployeeWages.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.employeeWages.get({ @@ -142,39 +161,35 @@ export class EmployeeWagesClient { */ public get( request: Square.labor.GetEmployeeWagesRequest, - requestOptions?: EmployeeWagesClient.RequestOptions, + requestOptions?: EmployeeWages.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.labor.GetEmployeeWagesRequest, - requestOptions?: EmployeeWagesClient.RequestOptions, + requestOptions?: EmployeeWages.RequestOptions, ): Promise> { const { id } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/labor/employee-wages/${core.url.encodePathParam(id)}`, + `v2/labor/employee-wages/${encodeURIComponent(id)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -215,7 +230,7 @@ export class EmployeeWagesClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/labor/resources/employeeWages/client/index.ts b/src/api/resources/labor/resources/employeeWages/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/labor/resources/employeeWages/client/index.ts +++ b/src/api/resources/labor/resources/employeeWages/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/labor/resources/employeeWages/client/requests/GetEmployeeWagesRequest.ts b/src/api/resources/labor/resources/employeeWages/client/requests/GetEmployeeWagesRequest.ts index 7f1595af5..9e73a6b6a 100644 --- a/src/api/resources/labor/resources/employeeWages/client/requests/GetEmployeeWagesRequest.ts +++ b/src/api/resources/labor/resources/employeeWages/client/requests/GetEmployeeWagesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetEmployeeWagesRequest { - /** The UUID for the `EmployeeWage` being retrieved. */ + /** + * The UUID for the `EmployeeWage` being retrieved. + */ id: string; } diff --git a/src/api/resources/labor/resources/employeeWages/client/requests/ListEmployeeWagesRequest.ts b/src/api/resources/labor/resources/employeeWages/client/requests/ListEmployeeWagesRequest.ts index ac1eb9e4a..24a7da1d0 100644 --- a/src/api/resources/labor/resources/employeeWages/client/requests/ListEmployeeWagesRequest.ts +++ b/src/api/resources/labor/resources/employeeWages/client/requests/ListEmployeeWagesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -9,13 +11,17 @@ * } */ export interface ListEmployeeWagesRequest { - /** Filter the returned wages to only those that are associated with the specified employee. */ + /** + * Filter the returned wages to only those that are associated with the specified employee. + */ employeeId?: string | null; /** * The maximum number of `EmployeeWage` results to return per page. The number can range between * 1 and 200. The default is 200. */ limit?: number | null; - /** A pointer to the next page of `EmployeeWage` results to fetch. */ + /** + * A pointer to the next page of `EmployeeWage` results to fetch. + */ cursor?: string | null; } diff --git a/src/api/resources/labor/resources/employeeWages/client/requests/index.ts b/src/api/resources/labor/resources/employeeWages/client/requests/index.ts index acf0ca130..eb9a9e67e 100644 --- a/src/api/resources/labor/resources/employeeWages/client/requests/index.ts +++ b/src/api/resources/labor/resources/employeeWages/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { GetEmployeeWagesRequest } from "./GetEmployeeWagesRequest"; -export type { ListEmployeeWagesRequest } from "./ListEmployeeWagesRequest"; +export { type ListEmployeeWagesRequest } from "./ListEmployeeWagesRequest"; +export { type GetEmployeeWagesRequest } from "./GetEmployeeWagesRequest"; diff --git a/src/api/resources/labor/resources/index.ts b/src/api/resources/labor/resources/index.ts index 986244b5c..e0b60d0eb 100644 --- a/src/api/resources/labor/resources/index.ts +++ b/src/api/resources/labor/resources/index.ts @@ -1,10 +1,10 @@ export * as breakTypes from "./breakTypes"; -export * from "./breakTypes/client/requests"; export * as employeeWages from "./employeeWages"; -export * from "./employeeWages/client/requests"; export * as shifts from "./shifts"; -export * from "./shifts/client/requests"; export * as teamMemberWages from "./teamMemberWages"; -export * from "./teamMemberWages/client/requests"; export * as workweekConfigs from "./workweekConfigs"; +export * from "./breakTypes/client/requests"; +export * from "./employeeWages/client/requests"; +export * from "./shifts/client/requests"; +export * from "./teamMemberWages/client/requests"; export * from "./workweekConfigs/client/requests"; diff --git a/src/api/resources/labor/resources/shifts/client/Client.ts b/src/api/resources/labor/resources/shifts/client/Client.ts index 4a82b4c74..fe3690188 100644 --- a/src/api/resources/labor/resources/shifts/client/Client.ts +++ b/src/api/resources/labor/resources/shifts/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace ShiftsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Shifts { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class ShiftsClient { - protected readonly _options: ShiftsClient.Options; +export class Shifts { + protected readonly _options: Shifts.Options; - constructor(options: ShiftsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Shifts.Options = {}) { + this._options = _options; } /** @@ -43,7 +64,7 @@ export class ShiftsClient { * the `Shift.end_at`, or both. * * @param {Square.labor.CreateShiftRequest} request - * @param {ShiftsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Shifts.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.shifts.create({ @@ -78,23 +99,15 @@ export class ShiftsClient { */ public create( request: Square.labor.CreateShiftRequest, - requestOptions?: ShiftsClient.RequestOptions, + requestOptions?: Shifts.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.labor.CreateShiftRequest, - requestOptions?: ShiftsClient.RequestOptions, + requestOptions?: Shifts.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -103,19 +116,23 @@ export class ShiftsClient { "v2/labor/shifts", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.labor.CreateShiftRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -172,7 +189,7 @@ export class ShiftsClient { * - `UPDATED_AT` * * @param {Square.labor.SearchShiftsRequest} request - * @param {ShiftsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Shifts.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.shifts.search({ @@ -193,23 +210,15 @@ export class ShiftsClient { */ public search( request: Square.labor.SearchShiftsRequest = {}, - requestOptions?: ShiftsClient.RequestOptions, + requestOptions?: Shifts.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__search(request, requestOptions)); } private async __search( request: Square.labor.SearchShiftsRequest = {}, - requestOptions?: ShiftsClient.RequestOptions, + requestOptions?: Shifts.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -218,19 +227,23 @@ export class ShiftsClient { "v2/labor/shifts/search", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.labor.SearchShiftsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -274,7 +287,7 @@ export class ShiftsClient { * Returns a single `Shift` specified by `id`. * * @param {Square.labor.GetShiftsRequest} request - * @param {ShiftsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Shifts.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.shifts.get({ @@ -283,39 +296,35 @@ export class ShiftsClient { */ public get( request: Square.labor.GetShiftsRequest, - requestOptions?: ShiftsClient.RequestOptions, + requestOptions?: Shifts.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.labor.GetShiftsRequest, - requestOptions?: ShiftsClient.RequestOptions, + requestOptions?: Shifts.RequestOptions, ): Promise> { const { id } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/labor/shifts/${core.url.encodePathParam(id)}`, + `v2/labor/shifts/${encodeURIComponent(id)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -365,7 +374,7 @@ export class ShiftsClient { * set on each `Break`. * * @param {Square.labor.UpdateShiftRequest} request - * @param {ShiftsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Shifts.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.shifts.update({ @@ -402,45 +411,41 @@ export class ShiftsClient { */ public update( request: Square.labor.UpdateShiftRequest, - requestOptions?: ShiftsClient.RequestOptions, + requestOptions?: Shifts.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); } private async __update( request: Square.labor.UpdateShiftRequest, - requestOptions?: ShiftsClient.RequestOptions, + requestOptions?: Shifts.RequestOptions, ): Promise> { const { id, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/labor/shifts/${core.url.encodePathParam(id)}`, + `v2/labor/shifts/${encodeURIComponent(id)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.labor.UpdateShiftRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -484,7 +489,7 @@ export class ShiftsClient { * Deletes a `Shift`. * * @param {Square.labor.DeleteShiftsRequest} request - * @param {ShiftsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Shifts.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.shifts.delete({ @@ -493,39 +498,35 @@ export class ShiftsClient { */ public delete( request: Square.labor.DeleteShiftsRequest, - requestOptions?: ShiftsClient.RequestOptions, + requestOptions?: Shifts.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); } private async __delete( request: Square.labor.DeleteShiftsRequest, - requestOptions?: ShiftsClient.RequestOptions, + requestOptions?: Shifts.RequestOptions, ): Promise> { const { id } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/labor/shifts/${core.url.encodePathParam(id)}`, + `v2/labor/shifts/${encodeURIComponent(id)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -566,7 +567,7 @@ export class ShiftsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/labor/resources/shifts/client/index.ts b/src/api/resources/labor/resources/shifts/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/labor/resources/shifts/client/index.ts +++ b/src/api/resources/labor/resources/shifts/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/labor/resources/shifts/client/requests/CreateShiftRequest.ts b/src/api/resources/labor/resources/shifts/client/requests/CreateShiftRequest.ts index 26d309ccf..6c258c04a 100644 --- a/src/api/resources/labor/resources/shifts/client/requests/CreateShiftRequest.ts +++ b/src/api/resources/labor/resources/shifts/client/requests/CreateShiftRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/labor/resources/shifts/client/requests/DeleteShiftsRequest.ts b/src/api/resources/labor/resources/shifts/client/requests/DeleteShiftsRequest.ts index c4f2cf615..9a05ba1f5 100644 --- a/src/api/resources/labor/resources/shifts/client/requests/DeleteShiftsRequest.ts +++ b/src/api/resources/labor/resources/shifts/client/requests/DeleteShiftsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface DeleteShiftsRequest { - /** The UUID for the `Shift` being deleted. */ + /** + * The UUID for the `Shift` being deleted. + */ id: string; } diff --git a/src/api/resources/labor/resources/shifts/client/requests/GetShiftsRequest.ts b/src/api/resources/labor/resources/shifts/client/requests/GetShiftsRequest.ts index cc8521615..eca608527 100644 --- a/src/api/resources/labor/resources/shifts/client/requests/GetShiftsRequest.ts +++ b/src/api/resources/labor/resources/shifts/client/requests/GetShiftsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetShiftsRequest { - /** The UUID for the `Shift` being retrieved. */ + /** + * The UUID for the `Shift` being retrieved. + */ id: string; } diff --git a/src/api/resources/labor/resources/shifts/client/requests/SearchShiftsRequest.ts b/src/api/resources/labor/resources/shifts/client/requests/SearchShiftsRequest.ts index e9142fba8..17caa5167 100644 --- a/src/api/resources/labor/resources/shifts/client/requests/SearchShiftsRequest.ts +++ b/src/api/resources/labor/resources/shifts/client/requests/SearchShiftsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/labor/resources/shifts/client/requests/UpdateShiftRequest.ts b/src/api/resources/labor/resources/shifts/client/requests/UpdateShiftRequest.ts index 85ffac0dd..e14a46844 100644 --- a/src/api/resources/labor/resources/shifts/client/requests/UpdateShiftRequest.ts +++ b/src/api/resources/labor/resources/shifts/client/requests/UpdateShiftRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -37,7 +39,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface UpdateShiftRequest { - /** The ID of the object being updated. */ + /** + * The ID of the object being updated. + */ id: string; /** The updated `Shift` object. */ shift: Square.Shift; diff --git a/src/api/resources/labor/resources/shifts/client/requests/index.ts b/src/api/resources/labor/resources/shifts/client/requests/index.ts index 69d9129c3..49df3318e 100644 --- a/src/api/resources/labor/resources/shifts/client/requests/index.ts +++ b/src/api/resources/labor/resources/shifts/client/requests/index.ts @@ -1,5 +1,5 @@ -export type { CreateShiftRequest } from "./CreateShiftRequest"; -export type { DeleteShiftsRequest } from "./DeleteShiftsRequest"; -export type { GetShiftsRequest } from "./GetShiftsRequest"; -export type { SearchShiftsRequest } from "./SearchShiftsRequest"; -export type { UpdateShiftRequest } from "./UpdateShiftRequest"; +export { type CreateShiftRequest } from "./CreateShiftRequest"; +export { type SearchShiftsRequest } from "./SearchShiftsRequest"; +export { type GetShiftsRequest } from "./GetShiftsRequest"; +export { type UpdateShiftRequest } from "./UpdateShiftRequest"; +export { type DeleteShiftsRequest } from "./DeleteShiftsRequest"; diff --git a/src/api/resources/labor/resources/teamMemberWages/client/Client.ts b/src/api/resources/labor/resources/teamMemberWages/client/Client.ts index 872737f7b..8aa95155b 100644 --- a/src/api/resources/labor/resources/teamMemberWages/client/Client.ts +++ b/src/api/resources/labor/resources/teamMemberWages/client/Client.ts @@ -1,32 +1,53 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace TeamMemberWagesClient { - export interface Options extends BaseClientOptions {} +export declare namespace TeamMemberWages { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class TeamMemberWagesClient { - protected readonly _options: TeamMemberWagesClient.Options; +export class TeamMemberWages { + protected readonly _options: TeamMemberWages.Options; - constructor(options: TeamMemberWagesClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: TeamMemberWages.Options = {}) { + this._options = _options; } /** * Returns a paginated list of `TeamMemberWage` instances for a business. * * @param {Square.labor.ListTeamMemberWagesRequest} request - * @param {TeamMemberWagesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {TeamMemberWages.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.teamMemberWages.list({ @@ -37,8 +58,8 @@ export class TeamMemberWagesClient { */ public async list( request: Square.labor.ListTeamMemberWagesRequest = {}, - requestOptions?: TeamMemberWagesClient.RequestOptions, - ): Promise> { + requestOptions?: TeamMemberWages.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.labor.ListTeamMemberWagesRequest, @@ -46,22 +67,14 @@ export class TeamMemberWagesClient { const { teamMemberId, limit, cursor } = request; const _queryParams: Record = {}; if (teamMemberId !== undefined) { - _queryParams.team_member_id = teamMemberId; + _queryParams["team_member_id"] = teamMemberId; } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -70,13 +83,19 @@ export class TeamMemberWagesClient { "v2/labor/team-member-wages", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -117,7 +136,7 @@ export class TeamMemberWagesClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -133,7 +152,7 @@ export class TeamMemberWagesClient { * Returns a single `TeamMemberWage` specified by `id`. * * @param {Square.labor.GetTeamMemberWagesRequest} request - * @param {TeamMemberWagesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {TeamMemberWages.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.teamMemberWages.get({ @@ -142,39 +161,35 @@ export class TeamMemberWagesClient { */ public get( request: Square.labor.GetTeamMemberWagesRequest, - requestOptions?: TeamMemberWagesClient.RequestOptions, + requestOptions?: TeamMemberWages.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.labor.GetTeamMemberWagesRequest, - requestOptions?: TeamMemberWagesClient.RequestOptions, + requestOptions?: TeamMemberWages.RequestOptions, ): Promise> { const { id } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/labor/team-member-wages/${core.url.encodePathParam(id)}`, + `v2/labor/team-member-wages/${encodeURIComponent(id)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -217,7 +232,7 @@ export class TeamMemberWagesClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/labor/resources/teamMemberWages/client/index.ts b/src/api/resources/labor/resources/teamMemberWages/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/labor/resources/teamMemberWages/client/index.ts +++ b/src/api/resources/labor/resources/teamMemberWages/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/labor/resources/teamMemberWages/client/requests/GetTeamMemberWagesRequest.ts b/src/api/resources/labor/resources/teamMemberWages/client/requests/GetTeamMemberWagesRequest.ts index 43618c7fe..6e5e5f0ce 100644 --- a/src/api/resources/labor/resources/teamMemberWages/client/requests/GetTeamMemberWagesRequest.ts +++ b/src/api/resources/labor/resources/teamMemberWages/client/requests/GetTeamMemberWagesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetTeamMemberWagesRequest { - /** The UUID for the `TeamMemberWage` being retrieved. */ + /** + * The UUID for the `TeamMemberWage` being retrieved. + */ id: string; } diff --git a/src/api/resources/labor/resources/teamMemberWages/client/requests/ListTeamMemberWagesRequest.ts b/src/api/resources/labor/resources/teamMemberWages/client/requests/ListTeamMemberWagesRequest.ts index d9c6201ff..4bdcfeb7a 100644 --- a/src/api/resources/labor/resources/teamMemberWages/client/requests/ListTeamMemberWagesRequest.ts +++ b/src/api/resources/labor/resources/teamMemberWages/client/requests/ListTeamMemberWagesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -19,6 +21,8 @@ export interface ListTeamMemberWagesRequest { * 1 and 200. The default is 200. */ limit?: number | null; - /** A pointer to the next page of `EmployeeWage` results to fetch. */ + /** + * A pointer to the next page of `EmployeeWage` results to fetch. + */ cursor?: string | null; } diff --git a/src/api/resources/labor/resources/teamMemberWages/client/requests/index.ts b/src/api/resources/labor/resources/teamMemberWages/client/requests/index.ts index 99d3ac556..97313ff47 100644 --- a/src/api/resources/labor/resources/teamMemberWages/client/requests/index.ts +++ b/src/api/resources/labor/resources/teamMemberWages/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { GetTeamMemberWagesRequest } from "./GetTeamMemberWagesRequest"; -export type { ListTeamMemberWagesRequest } from "./ListTeamMemberWagesRequest"; +export { type ListTeamMemberWagesRequest } from "./ListTeamMemberWagesRequest"; +export { type GetTeamMemberWagesRequest } from "./GetTeamMemberWagesRequest"; diff --git a/src/api/resources/labor/resources/workweekConfigs/client/Client.ts b/src/api/resources/labor/resources/workweekConfigs/client/Client.ts index 896eb1cf9..7ed4249d9 100644 --- a/src/api/resources/labor/resources/workweekConfigs/client/Client.ts +++ b/src/api/resources/labor/resources/workweekConfigs/client/Client.ts @@ -1,32 +1,53 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace WorkweekConfigsClient { - export interface Options extends BaseClientOptions {} +export declare namespace WorkweekConfigs { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class WorkweekConfigsClient { - protected readonly _options: WorkweekConfigsClient.Options; +export class WorkweekConfigs { + protected readonly _options: WorkweekConfigs.Options; - constructor(options: WorkweekConfigsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: WorkweekConfigs.Options = {}) { + this._options = _options; } /** * Returns a list of `WorkweekConfig` instances for a business. * * @param {Square.labor.ListWorkweekConfigsRequest} request - * @param {WorkweekConfigsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {WorkweekConfigs.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.workweekConfigs.list({ @@ -36,8 +57,8 @@ export class WorkweekConfigsClient { */ public async list( request: Square.labor.ListWorkweekConfigsRequest = {}, - requestOptions?: WorkweekConfigsClient.RequestOptions, - ): Promise> { + requestOptions?: WorkweekConfigs.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.labor.ListWorkweekConfigsRequest, @@ -45,19 +66,11 @@ export class WorkweekConfigsClient { const { limit, cursor } = request; const _queryParams: Record = {}; if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -66,13 +79,19 @@ export class WorkweekConfigsClient { "v2/labor/workweek-configs", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -113,7 +132,7 @@ export class WorkweekConfigsClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -129,7 +148,7 @@ export class WorkweekConfigsClient { * Updates a `WorkweekConfig`. * * @param {Square.labor.UpdateWorkweekConfigRequest} request - * @param {WorkweekConfigsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {WorkweekConfigs.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.labor.workweekConfigs.get({ @@ -143,45 +162,41 @@ export class WorkweekConfigsClient { */ public get( request: Square.labor.UpdateWorkweekConfigRequest, - requestOptions?: WorkweekConfigsClient.RequestOptions, + requestOptions?: WorkweekConfigs.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.labor.UpdateWorkweekConfigRequest, - requestOptions?: WorkweekConfigsClient.RequestOptions, + requestOptions?: WorkweekConfigs.RequestOptions, ): Promise> { const { id, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/labor/workweek-configs/${core.url.encodePathParam(id)}`, + `v2/labor/workweek-configs/${encodeURIComponent(id)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.labor.UpdateWorkweekConfigRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -224,7 +239,7 @@ export class WorkweekConfigsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/labor/resources/workweekConfigs/client/index.ts b/src/api/resources/labor/resources/workweekConfigs/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/labor/resources/workweekConfigs/client/index.ts +++ b/src/api/resources/labor/resources/workweekConfigs/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/labor/resources/workweekConfigs/client/requests/ListWorkweekConfigsRequest.ts b/src/api/resources/labor/resources/workweekConfigs/client/requests/ListWorkweekConfigsRequest.ts index fbd301c1d..2f8a70af2 100644 --- a/src/api/resources/labor/resources/workweekConfigs/client/requests/ListWorkweekConfigsRequest.ts +++ b/src/api/resources/labor/resources/workweekConfigs/client/requests/ListWorkweekConfigsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,8 +10,12 @@ * } */ export interface ListWorkweekConfigsRequest { - /** The maximum number of `WorkweekConfigs` results to return per page. */ + /** + * The maximum number of `WorkweekConfigs` results to return per page. + */ limit?: number | null; - /** A pointer to the next page of `WorkweekConfig` results to fetch. */ + /** + * A pointer to the next page of `WorkweekConfig` results to fetch. + */ cursor?: string | null; } diff --git a/src/api/resources/labor/resources/workweekConfigs/client/requests/UpdateWorkweekConfigRequest.ts b/src/api/resources/labor/resources/workweekConfigs/client/requests/UpdateWorkweekConfigRequest.ts index ef4ef8609..b9a85bb7c 100644 --- a/src/api/resources/labor/resources/workweekConfigs/client/requests/UpdateWorkweekConfigRequest.ts +++ b/src/api/resources/labor/resources/workweekConfigs/client/requests/UpdateWorkweekConfigRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -14,7 +16,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface UpdateWorkweekConfigRequest { - /** The UUID for the `WorkweekConfig` object being updated. */ + /** + * The UUID for the `WorkweekConfig` object being updated. + */ id: string; /** The updated `WorkweekConfig` object. */ workweekConfig: Square.WorkweekConfig; diff --git a/src/api/resources/labor/resources/workweekConfigs/client/requests/index.ts b/src/api/resources/labor/resources/workweekConfigs/client/requests/index.ts index 384958493..04fe60b23 100644 --- a/src/api/resources/labor/resources/workweekConfigs/client/requests/index.ts +++ b/src/api/resources/labor/resources/workweekConfigs/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { ListWorkweekConfigsRequest } from "./ListWorkweekConfigsRequest"; -export type { UpdateWorkweekConfigRequest } from "./UpdateWorkweekConfigRequest"; +export { type ListWorkweekConfigsRequest } from "./ListWorkweekConfigsRequest"; +export { type UpdateWorkweekConfigRequest } from "./UpdateWorkweekConfigRequest"; diff --git a/src/api/resources/locations/client/Client.ts b/src/api/resources/locations/client/Client.ts index aef3dcf22..9b8241521 100644 --- a/src/api/resources/locations/client/Client.ts +++ b/src/api/resources/locations/client/Client.ts @@ -1,71 +1,82 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; -import { CustomAttributeDefinitionsClient } from "../resources/customAttributeDefinitions/client/Client"; -import { CustomAttributesClient } from "../resources/customAttributes/client/Client"; -import { TransactionsClient } from "../resources/transactions/client/Client"; +import * as errors from "../../../../errors/index"; +import { CustomAttributeDefinitions } from "../resources/customAttributeDefinitions/client/Client"; +import { CustomAttributes } from "../resources/customAttributes/client/Client"; +import { Transactions } from "../resources/transactions/client/Client"; -export declare namespace LocationsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Locations { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class LocationsClient { - protected readonly _options: LocationsClient.Options; - protected _customAttributeDefinitions: CustomAttributeDefinitionsClient | undefined; - protected _customAttributes: CustomAttributesClient | undefined; - protected _transactions: TransactionsClient | undefined; +export class Locations { + protected readonly _options: Locations.Options; + protected _customAttributeDefinitions: CustomAttributeDefinitions | undefined; + protected _customAttributes: CustomAttributes | undefined; + protected _transactions: Transactions | undefined; - constructor(options: LocationsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Locations.Options = {}) { + this._options = _options; } - public get customAttributeDefinitions(): CustomAttributeDefinitionsClient { - return (this._customAttributeDefinitions ??= new CustomAttributeDefinitionsClient(this._options)); + public get customAttributeDefinitions(): CustomAttributeDefinitions { + return (this._customAttributeDefinitions ??= new CustomAttributeDefinitions(this._options)); } - public get customAttributes(): CustomAttributesClient { - return (this._customAttributes ??= new CustomAttributesClient(this._options)); + public get customAttributes(): CustomAttributes { + return (this._customAttributes ??= new CustomAttributes(this._options)); } - public get transactions(): TransactionsClient { - return (this._transactions ??= new TransactionsClient(this._options)); + public get transactions(): Transactions { + return (this._transactions ??= new Transactions(this._options)); } /** * Provides details about all of the seller's [locations](https://developer.squareup.com/docs/locations-api), * including those with an inactive status. Locations are listed alphabetically by `name`. * - * @param {LocationsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Locations.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.locations.list() */ - public list( - requestOptions?: LocationsClient.RequestOptions, - ): core.HttpResponsePromise { + public list(requestOptions?: Locations.RequestOptions): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__list(requestOptions)); } private async __list( - requestOptions?: LocationsClient.RequestOptions, + requestOptions?: Locations.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -74,13 +85,17 @@ export class LocationsClient { "v2/locations", ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -130,7 +145,7 @@ export class LocationsClient { * each location has a sensible and unique name. * * @param {Square.CreateLocationRequest} request - * @param {LocationsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Locations.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.locations.create({ @@ -148,23 +163,15 @@ export class LocationsClient { */ public create( request: Square.CreateLocationRequest = {}, - requestOptions?: LocationsClient.RequestOptions, + requestOptions?: Locations.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.CreateLocationRequest = {}, - requestOptions?: LocationsClient.RequestOptions, + requestOptions?: Locations.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -173,19 +180,23 @@ export class LocationsClient { "v2/locations", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateLocationRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -230,7 +241,7 @@ export class LocationsClient { * as the location ID to retrieve details of the [main location](https://developer.squareup.com/docs/locations-api#about-the-main-location). * * @param {Square.GetLocationsRequest} request - * @param {LocationsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Locations.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.locations.get({ @@ -239,39 +250,35 @@ export class LocationsClient { */ public get( request: Square.GetLocationsRequest, - requestOptions?: LocationsClient.RequestOptions, + requestOptions?: Locations.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.GetLocationsRequest, - requestOptions?: LocationsClient.RequestOptions, + requestOptions?: Locations.RequestOptions, ): Promise> { const { locationId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/locations/${core.url.encodePathParam(locationId)}`, + `v2/locations/${encodeURIComponent(locationId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -315,7 +322,7 @@ export class LocationsClient { * Updates a [location](https://developer.squareup.com/docs/locations-api). * * @param {Square.UpdateLocationRequest} request - * @param {LocationsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Locations.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.locations.update({ @@ -342,45 +349,41 @@ export class LocationsClient { */ public update( request: Square.UpdateLocationRequest, - requestOptions?: LocationsClient.RequestOptions, + requestOptions?: Locations.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); } private async __update( request: Square.UpdateLocationRequest, - requestOptions?: LocationsClient.RequestOptions, + requestOptions?: Locations.RequestOptions, ): Promise> { const { locationId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/locations/${core.url.encodePathParam(locationId)}`, + `v2/locations/${encodeURIComponent(locationId)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateLocationRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -430,7 +433,7 @@ export class LocationsClient { * For more information, see [Checkout API highlights](https://developer.squareup.com/docs/checkout-api#checkout-api-highlights). * * @param {Square.CreateCheckoutRequest} request - * @param {LocationsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Locations.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.locations.checkouts({ @@ -513,45 +516,41 @@ export class LocationsClient { */ public checkouts( request: Square.CreateCheckoutRequest, - requestOptions?: LocationsClient.RequestOptions, + requestOptions?: Locations.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__checkouts(request, requestOptions)); } private async __checkouts( request: Square.CreateCheckoutRequest, - requestOptions?: LocationsClient.RequestOptions, + requestOptions?: Locations.RequestOptions, ): Promise> { const { locationId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/locations/${core.url.encodePathParam(locationId)}/checkouts`, + `v2/locations/${encodeURIComponent(locationId)}/checkouts`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateCheckoutRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -594,7 +593,7 @@ export class LocationsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/locations/client/index.ts b/src/api/resources/locations/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/locations/client/index.ts +++ b/src/api/resources/locations/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/locations/client/requests/CreateCheckoutRequest.ts b/src/api/resources/locations/client/requests/CreateCheckoutRequest.ts index eec4693bf..b7371e9d4 100644 --- a/src/api/resources/locations/client/requests/CreateCheckoutRequest.ts +++ b/src/api/resources/locations/client/requests/CreateCheckoutRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -83,7 +85,9 @@ import type * as Square from "../../../../index"; * } */ export interface CreateCheckoutRequest { - /** The ID of the business location to associate the checkout with. */ + /** + * The ID of the business location to associate the checkout with. + */ locationId: string; /** * A unique string that identifies this checkout among others you have created. It can be diff --git a/src/api/resources/locations/client/requests/CreateLocationRequest.ts b/src/api/resources/locations/client/requests/CreateLocationRequest.ts index 2b153ae44..d51a6483b 100644 --- a/src/api/resources/locations/client/requests/CreateLocationRequest.ts +++ b/src/api/resources/locations/client/requests/CreateLocationRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/locations/client/requests/GetLocationsRequest.ts b/src/api/resources/locations/client/requests/GetLocationsRequest.ts index 20dd966df..06f3a0e38 100644 --- a/src/api/resources/locations/client/requests/GetLocationsRequest.ts +++ b/src/api/resources/locations/client/requests/GetLocationsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/locations/client/requests/UpdateLocationRequest.ts b/src/api/resources/locations/client/requests/UpdateLocationRequest.ts index 409853cc8..328c18b39 100644 --- a/src/api/resources/locations/client/requests/UpdateLocationRequest.ts +++ b/src/api/resources/locations/client/requests/UpdateLocationRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -27,7 +29,9 @@ import type * as Square from "../../../../index"; * } */ export interface UpdateLocationRequest { - /** The ID of the location to update. */ + /** + * The ID of the location to update. + */ locationId: string; /** The `Location` object with only the fields to update. */ location?: Square.Location; diff --git a/src/api/resources/locations/client/requests/index.ts b/src/api/resources/locations/client/requests/index.ts index a262c7106..4b7f7c91c 100644 --- a/src/api/resources/locations/client/requests/index.ts +++ b/src/api/resources/locations/client/requests/index.ts @@ -1,4 +1,4 @@ -export type { CreateCheckoutRequest } from "./CreateCheckoutRequest"; -export type { CreateLocationRequest } from "./CreateLocationRequest"; -export type { GetLocationsRequest } from "./GetLocationsRequest"; -export type { UpdateLocationRequest } from "./UpdateLocationRequest"; +export { type CreateLocationRequest } from "./CreateLocationRequest"; +export { type GetLocationsRequest } from "./GetLocationsRequest"; +export { type UpdateLocationRequest } from "./UpdateLocationRequest"; +export { type CreateCheckoutRequest } from "./CreateCheckoutRequest"; diff --git a/src/api/resources/locations/resources/customAttributeDefinitions/client/Client.ts b/src/api/resources/locations/resources/customAttributeDefinitions/client/Client.ts index 46bc33be1..980aed257 100644 --- a/src/api/resources/locations/resources/customAttributeDefinitions/client/Client.ts +++ b/src/api/resources/locations/resources/customAttributeDefinitions/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; +import * as serializers from "../../../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; -import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; -export declare namespace CustomAttributeDefinitionsClient { - export interface Options extends BaseClientOptions {} +export declare namespace CustomAttributeDefinitions { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class CustomAttributeDefinitionsClient { - protected readonly _options: CustomAttributeDefinitionsClient.Options; +export class CustomAttributeDefinitions { + protected readonly _options: CustomAttributeDefinitions.Options; - constructor(options: CustomAttributeDefinitionsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: CustomAttributeDefinitions.Options = {}) { + this._options = _options; } /** @@ -29,7 +50,7 @@ export class CustomAttributeDefinitionsClient { * applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.locations.ListCustomAttributeDefinitionsRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.locations.customAttributeDefinitions.list({ @@ -40,8 +61,8 @@ export class CustomAttributeDefinitionsClient { */ public async list( request: Square.locations.ListCustomAttributeDefinitionsRequest = {}, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, - ): Promise> { + requestOptions?: CustomAttributeDefinitions.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.locations.ListCustomAttributeDefinitionsRequest, @@ -49,25 +70,17 @@ export class CustomAttributeDefinitionsClient { const { visibilityFilter, limit, cursor } = request; const _queryParams: Record = {}; if (visibilityFilter !== undefined) { - _queryParams.visibility_filter = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { + _queryParams["visibility_filter"] = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -76,13 +89,19 @@ export class CustomAttributeDefinitionsClient { "v2/locations/custom-attribute-definitions", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -123,7 +142,10 @@ export class CustomAttributeDefinitionsClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable< + Square.ListLocationCustomAttributeDefinitionsResponse, + Square.CustomAttributeDefinition + >({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -145,7 +167,7 @@ export class CustomAttributeDefinitionsClient { * to set the custom attribute for locations. * * @param {Square.locations.CreateLocationCustomAttributeDefinitionRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.locations.customAttributeDefinitions.create({ @@ -162,23 +184,15 @@ export class CustomAttributeDefinitionsClient { */ public create( request: Square.locations.CreateLocationCustomAttributeDefinitionRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.locations.CreateLocationCustomAttributeDefinitionRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -187,19 +201,23 @@ export class CustomAttributeDefinitionsClient { "v2/locations/custom-attribute-definitions", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.locations.CreateLocationCustomAttributeDefinitionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -247,7 +265,7 @@ export class CustomAttributeDefinitionsClient { * setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.locations.GetCustomAttributeDefinitionsRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.locations.customAttributeDefinitions.get({ @@ -257,44 +275,41 @@ export class CustomAttributeDefinitionsClient { */ public get( request: Square.locations.GetCustomAttributeDefinitionsRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.locations.GetCustomAttributeDefinitionsRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key, version } = request; const _queryParams: Record = {}; if (version !== undefined) { - _queryParams.version = version?.toString() ?? null; + _queryParams["version"] = version?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/locations/custom-attribute-definitions/${core.url.encodePathParam(key)}`, + `v2/locations/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -343,7 +358,7 @@ export class CustomAttributeDefinitionsClient { * Only the definition owner can update a custom attribute definition. * * @param {Square.locations.UpdateLocationCustomAttributeDefinitionRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.locations.customAttributeDefinitions.update({ @@ -356,45 +371,41 @@ export class CustomAttributeDefinitionsClient { */ public update( request: Square.locations.UpdateLocationCustomAttributeDefinitionRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); } private async __update( request: Square.locations.UpdateLocationCustomAttributeDefinitionRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/locations/custom-attribute-definitions/${core.url.encodePathParam(key)}`, + `v2/locations/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.locations.UpdateLocationCustomAttributeDefinitionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -443,7 +454,7 @@ export class CustomAttributeDefinitionsClient { * Only the definition owner can delete a custom attribute definition. * * @param {Square.locations.DeleteCustomAttributeDefinitionsRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.locations.customAttributeDefinitions.delete({ @@ -452,39 +463,35 @@ export class CustomAttributeDefinitionsClient { */ public delete( request: Square.locations.DeleteCustomAttributeDefinitionsRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); } private async __delete( request: Square.locations.DeleteCustomAttributeDefinitionsRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/locations/custom-attribute-definitions/${core.url.encodePathParam(key)}`, + `v2/locations/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -527,7 +534,7 @@ export class CustomAttributeDefinitionsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/locations/resources/customAttributeDefinitions/client/index.ts b/src/api/resources/locations/resources/customAttributeDefinitions/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/locations/resources/customAttributeDefinitions/client/index.ts +++ b/src/api/resources/locations/resources/customAttributeDefinitions/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/CreateLocationCustomAttributeDefinitionRequest.ts b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/CreateLocationCustomAttributeDefinitionRequest.ts index b041fa196..8c308f4b0 100644 --- a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/CreateLocationCustomAttributeDefinitionRequest.ts +++ b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/CreateLocationCustomAttributeDefinitionRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts index a9c9d9ec5..6a1b34cf1 100644 --- a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface DeleteCustomAttributeDefinitionsRequest { - /** The key of the custom attribute definition to delete. */ + /** + * The key of the custom attribute definition to delete. + */ key: string; } diff --git a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts index 3de83fd32..e4c05d712 100644 --- a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts index 94eb07f3c..4818482a3 100644 --- a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -11,7 +13,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface ListCustomAttributeDefinitionsRequest { - /** Filters the `CustomAttributeDefinition` results by their `visibility` values. */ + /** + * Filters the `CustomAttributeDefinition` results by their `visibility` values. + */ visibilityFilter?: Square.VisibilityFilter | null; /** * The maximum number of results to return in a single paged response. This limit is advisory. diff --git a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/UpdateLocationCustomAttributeDefinitionRequest.ts b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/UpdateLocationCustomAttributeDefinitionRequest.ts index 5f84b4424..b1178a8df 100644 --- a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/UpdateLocationCustomAttributeDefinitionRequest.ts +++ b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/UpdateLocationCustomAttributeDefinitionRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -13,7 +15,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface UpdateLocationCustomAttributeDefinitionRequest { - /** The key of the custom attribute definition to update. */ + /** + * The key of the custom attribute definition to update. + */ key: string; /** * The custom attribute definition that contains the fields to update. This endpoint diff --git a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/index.ts b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/index.ts index eca4ca7ca..04a383e3e 100644 --- a/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/index.ts +++ b/src/api/resources/locations/resources/customAttributeDefinitions/client/requests/index.ts @@ -1,5 +1,5 @@ -export type { CreateLocationCustomAttributeDefinitionRequest } from "./CreateLocationCustomAttributeDefinitionRequest"; -export type { DeleteCustomAttributeDefinitionsRequest } from "./DeleteCustomAttributeDefinitionsRequest"; -export type { GetCustomAttributeDefinitionsRequest } from "./GetCustomAttributeDefinitionsRequest"; -export type { ListCustomAttributeDefinitionsRequest } from "./ListCustomAttributeDefinitionsRequest"; -export type { UpdateLocationCustomAttributeDefinitionRequest } from "./UpdateLocationCustomAttributeDefinitionRequest"; +export { type ListCustomAttributeDefinitionsRequest } from "./ListCustomAttributeDefinitionsRequest"; +export { type CreateLocationCustomAttributeDefinitionRequest } from "./CreateLocationCustomAttributeDefinitionRequest"; +export { type GetCustomAttributeDefinitionsRequest } from "./GetCustomAttributeDefinitionsRequest"; +export { type UpdateLocationCustomAttributeDefinitionRequest } from "./UpdateLocationCustomAttributeDefinitionRequest"; +export { type DeleteCustomAttributeDefinitionsRequest } from "./DeleteCustomAttributeDefinitionsRequest"; diff --git a/src/api/resources/locations/resources/customAttributes/client/Client.ts b/src/api/resources/locations/resources/customAttributes/client/Client.ts index 65a3191e6..b1bbe0967 100644 --- a/src/api/resources/locations/resources/customAttributes/client/Client.ts +++ b/src/api/resources/locations/resources/customAttributes/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace CustomAttributesClient { - export interface Options extends BaseClientOptions {} +export declare namespace CustomAttributes { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class CustomAttributesClient { - protected readonly _options: CustomAttributesClient.Options; +export class CustomAttributes { + protected readonly _options: CustomAttributes.Options; - constructor(options: CustomAttributesClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: CustomAttributes.Options = {}) { + this._options = _options; } /** @@ -28,7 +49,7 @@ export class CustomAttributesClient { * `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.locations.BulkDeleteLocationCustomAttributesRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.locations.customAttributes.batchDelete({ @@ -47,23 +68,15 @@ export class CustomAttributesClient { */ public batchDelete( request: Square.locations.BulkDeleteLocationCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__batchDelete(request, requestOptions)); } private async __batchDelete( request: Square.locations.BulkDeleteLocationCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -72,19 +85,23 @@ export class CustomAttributesClient { "v2/locations/custom-attributes/bulk-delete", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.locations.BulkDeleteLocationCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -139,7 +156,7 @@ export class CustomAttributesClient { * must be `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.locations.BulkUpsertLocationCustomAttributesRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.locations.customAttributes.batchUpsert({ @@ -170,23 +187,15 @@ export class CustomAttributesClient { */ public batchUpsert( request: Square.locations.BulkUpsertLocationCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__batchUpsert(request, requestOptions)); } private async __batchUpsert( request: Square.locations.BulkUpsertLocationCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -195,19 +204,23 @@ export class CustomAttributesClient { "v2/locations/custom-attributes/bulk-upsert", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.locations.BulkUpsertLocationCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -258,7 +271,7 @@ export class CustomAttributesClient { * and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.locations.ListCustomAttributesRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.locations.customAttributes.list({ @@ -271,8 +284,8 @@ export class CustomAttributesClient { */ public async list( request: Square.locations.ListCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, - ): Promise> { + requestOptions?: CustomAttributes.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.locations.ListCustomAttributesRequest, @@ -280,43 +293,41 @@ export class CustomAttributesClient { const { locationId, visibilityFilter, limit, cursor, withDefinitions } = request; const _queryParams: Record = {}; if (visibilityFilter !== undefined) { - _queryParams.visibility_filter = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { + _queryParams["visibility_filter"] = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (withDefinitions !== undefined) { - _queryParams.with_definitions = withDefinitions?.toString() ?? null; + _queryParams["with_definitions"] = withDefinitions?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/locations/${core.url.encodePathParam(locationId)}/custom-attributes`, + `v2/locations/${encodeURIComponent(locationId)}/custom-attributes`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -357,7 +368,7 @@ export class CustomAttributesClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -377,7 +388,7 @@ export class CustomAttributesClient { * `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.locations.GetCustomAttributesRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.locations.customAttributes.get({ @@ -389,48 +400,45 @@ export class CustomAttributesClient { */ public get( request: Square.locations.GetCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.locations.GetCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { locationId, key, withDefinition, version } = request; const _queryParams: Record = {}; if (withDefinition !== undefined) { - _queryParams.with_definition = withDefinition?.toString() ?? null; + _queryParams["with_definition"] = withDefinition?.toString() ?? null; } if (version !== undefined) { - _queryParams.version = version?.toString() ?? null; + _queryParams["version"] = version?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/locations/${core.url.encodePathParam(locationId)}/custom-attributes/${core.url.encodePathParam(key)}`, + `v2/locations/${encodeURIComponent(locationId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -481,7 +489,7 @@ export class CustomAttributesClient { * must be `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.locations.UpsertLocationCustomAttributeRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.locations.customAttributes.upsert({ @@ -494,45 +502,41 @@ export class CustomAttributesClient { */ public upsert( request: Square.locations.UpsertLocationCustomAttributeRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__upsert(request, requestOptions)); } private async __upsert( request: Square.locations.UpsertLocationCustomAttributeRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { locationId, key, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/locations/${core.url.encodePathParam(locationId)}/custom-attributes/${core.url.encodePathParam(key)}`, + `v2/locations/${encodeURIComponent(locationId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.locations.UpsertLocationCustomAttributeRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -580,7 +584,7 @@ export class CustomAttributesClient { * `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.locations.DeleteCustomAttributesRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.locations.customAttributes.delete({ @@ -590,39 +594,35 @@ export class CustomAttributesClient { */ public delete( request: Square.locations.DeleteCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); } private async __delete( request: Square.locations.DeleteCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { locationId, key } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/locations/${core.url.encodePathParam(locationId)}/custom-attributes/${core.url.encodePathParam(key)}`, + `v2/locations/${encodeURIComponent(locationId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -665,7 +665,7 @@ export class CustomAttributesClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/locations/resources/customAttributes/client/index.ts b/src/api/resources/locations/resources/customAttributes/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/locations/resources/customAttributes/client/index.ts +++ b/src/api/resources/locations/resources/customAttributes/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/locations/resources/customAttributes/client/requests/BulkDeleteLocationCustomAttributesRequest.ts b/src/api/resources/locations/resources/customAttributes/client/requests/BulkDeleteLocationCustomAttributesRequest.ts index 9fc9280eb..b7bca236d 100644 --- a/src/api/resources/locations/resources/customAttributes/client/requests/BulkDeleteLocationCustomAttributesRequest.ts +++ b/src/api/resources/locations/resources/customAttributes/client/requests/BulkDeleteLocationCustomAttributesRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/locations/resources/customAttributes/client/requests/BulkUpsertLocationCustomAttributesRequest.ts b/src/api/resources/locations/resources/customAttributes/client/requests/BulkUpsertLocationCustomAttributesRequest.ts index 9167da5e4..c45d120fb 100644 --- a/src/api/resources/locations/resources/customAttributes/client/requests/BulkUpsertLocationCustomAttributesRequest.ts +++ b/src/api/resources/locations/resources/customAttributes/client/requests/BulkUpsertLocationCustomAttributesRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/locations/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts b/src/api/resources/locations/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts index 02f487a4a..466967e90 100644 --- a/src/api/resources/locations/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts +++ b/src/api/resources/locations/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,7 +10,9 @@ * } */ export interface DeleteCustomAttributesRequest { - /** The ID of the target [location](entity:Location). */ + /** + * The ID of the target [location](entity:Location). + */ locationId: string; /** * The key of the custom attribute to delete. This key must match the `key` of a custom diff --git a/src/api/resources/locations/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts b/src/api/resources/locations/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts index a1ea2b5c4..7ca5414a6 100644 --- a/src/api/resources/locations/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts +++ b/src/api/resources/locations/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -10,7 +12,9 @@ * } */ export interface GetCustomAttributesRequest { - /** The ID of the target [location](entity:Location). */ + /** + * The ID of the target [location](entity:Location). + */ locationId: string; /** * The key of the custom attribute to retrieve. This key must match the `key` of a custom diff --git a/src/api/resources/locations/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts b/src/api/resources/locations/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts index 589ef7707..a7f35f860 100644 --- a/src/api/resources/locations/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts +++ b/src/api/resources/locations/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -13,9 +15,13 @@ import type * as Square from "../../../../../../index"; * } */ export interface ListCustomAttributesRequest { - /** The ID of the target [location](entity:Location). */ + /** + * The ID of the target [location](entity:Location). + */ locationId: string; - /** Filters the `CustomAttributeDefinition` results by their `visibility` values. */ + /** + * Filters the `CustomAttributeDefinition` results by their `visibility` values. + */ visibilityFilter?: Square.VisibilityFilter | null; /** * The maximum number of results to return in a single paged response. This limit is advisory. diff --git a/src/api/resources/locations/resources/customAttributes/client/requests/UpsertLocationCustomAttributeRequest.ts b/src/api/resources/locations/resources/customAttributes/client/requests/UpsertLocationCustomAttributeRequest.ts index 03bca5dd6..fd3393039 100644 --- a/src/api/resources/locations/resources/customAttributes/client/requests/UpsertLocationCustomAttributeRequest.ts +++ b/src/api/resources/locations/resources/customAttributes/client/requests/UpsertLocationCustomAttributeRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -13,7 +15,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface UpsertLocationCustomAttributeRequest { - /** The ID of the target [location](entity:Location). */ + /** + * The ID of the target [location](entity:Location). + */ locationId: string; /** * The key of the custom attribute to create or update. This key must match the `key` of a diff --git a/src/api/resources/locations/resources/customAttributes/client/requests/index.ts b/src/api/resources/locations/resources/customAttributes/client/requests/index.ts index fdc993cf1..5fa631d1f 100644 --- a/src/api/resources/locations/resources/customAttributes/client/requests/index.ts +++ b/src/api/resources/locations/resources/customAttributes/client/requests/index.ts @@ -1,6 +1,6 @@ -export type { BulkDeleteLocationCustomAttributesRequest } from "./BulkDeleteLocationCustomAttributesRequest"; -export type { BulkUpsertLocationCustomAttributesRequest } from "./BulkUpsertLocationCustomAttributesRequest"; -export type { DeleteCustomAttributesRequest } from "./DeleteCustomAttributesRequest"; -export type { GetCustomAttributesRequest } from "./GetCustomAttributesRequest"; -export type { ListCustomAttributesRequest } from "./ListCustomAttributesRequest"; -export type { UpsertLocationCustomAttributeRequest } from "./UpsertLocationCustomAttributeRequest"; +export { type BulkDeleteLocationCustomAttributesRequest } from "./BulkDeleteLocationCustomAttributesRequest"; +export { type BulkUpsertLocationCustomAttributesRequest } from "./BulkUpsertLocationCustomAttributesRequest"; +export { type ListCustomAttributesRequest } from "./ListCustomAttributesRequest"; +export { type GetCustomAttributesRequest } from "./GetCustomAttributesRequest"; +export { type UpsertLocationCustomAttributeRequest } from "./UpsertLocationCustomAttributeRequest"; +export { type DeleteCustomAttributesRequest } from "./DeleteCustomAttributesRequest"; diff --git a/src/api/resources/locations/resources/index.ts b/src/api/resources/locations/resources/index.ts index dc016dabd..6322f4066 100644 --- a/src/api/resources/locations/resources/index.ts +++ b/src/api/resources/locations/resources/index.ts @@ -1,6 +1,6 @@ export * as customAttributeDefinitions from "./customAttributeDefinitions"; -export * from "./customAttributeDefinitions/client/requests"; export * as customAttributes from "./customAttributes"; -export * from "./customAttributes/client/requests"; export * as transactions from "./transactions"; +export * from "./customAttributeDefinitions/client/requests"; +export * from "./customAttributes/client/requests"; export * from "./transactions/client/requests"; diff --git a/src/api/resources/locations/resources/transactions/client/Client.ts b/src/api/resources/locations/resources/transactions/client/Client.ts index 8c44874ac..d8a192771 100644 --- a/src/api/resources/locations/resources/transactions/client/Client.ts +++ b/src/api/resources/locations/resources/transactions/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; +import * as serializers from "../../../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; -import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; -export declare namespace TransactionsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Transactions { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class TransactionsClient { - protected readonly _options: TransactionsClient.Options; +export class Transactions { + protected readonly _options: Transactions.Options; - constructor(options: TransactionsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Transactions.Options = {}) { + this._options = _options; } /** @@ -31,7 +52,7 @@ export class TransactionsClient { * Max results per [page](https://developer.squareup.com/docs/working-with-apis/pagination): 50 * * @param {Square.locations.ListTransactionsRequest} request - * @param {TransactionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Transactions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.locations.transactions.list({ @@ -44,59 +65,56 @@ export class TransactionsClient { */ public list( request: Square.locations.ListTransactionsRequest, - requestOptions?: TransactionsClient.RequestOptions, + requestOptions?: Transactions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); } private async __list( request: Square.locations.ListTransactionsRequest, - requestOptions?: TransactionsClient.RequestOptions, + requestOptions?: Transactions.RequestOptions, ): Promise> { const { locationId, beginTime, endTime, sortOrder, cursor } = request; const _queryParams: Record = {}; if (beginTime !== undefined) { - _queryParams.begin_time = beginTime; + _queryParams["begin_time"] = beginTime; } if (endTime !== undefined) { - _queryParams.end_time = endTime; + _queryParams["end_time"] = endTime; } if (sortOrder !== undefined) { - _queryParams.sort_order = serializers.SortOrder.jsonOrThrow(sortOrder, { + _queryParams["sort_order"] = serializers.SortOrder.jsonOrThrow(sortOrder, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/locations/${core.url.encodePathParam(locationId)}/transactions`, + `v2/locations/${encodeURIComponent(locationId)}/transactions`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -142,7 +160,7 @@ export class TransactionsClient { * Retrieves details for a single transaction. * * @param {Square.locations.GetTransactionsRequest} request - * @param {TransactionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Transactions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.locations.transactions.get({ @@ -152,39 +170,35 @@ export class TransactionsClient { */ public get( request: Square.locations.GetTransactionsRequest, - requestOptions?: TransactionsClient.RequestOptions, + requestOptions?: Transactions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.locations.GetTransactionsRequest, - requestOptions?: TransactionsClient.RequestOptions, + requestOptions?: Transactions.RequestOptions, ): Promise> { const { locationId, transactionId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/locations/${core.url.encodePathParam(locationId)}/transactions/${core.url.encodePathParam(transactionId)}`, + `v2/locations/${encodeURIComponent(locationId)}/transactions/${encodeURIComponent(transactionId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -235,7 +249,7 @@ export class TransactionsClient { * for more information. * * @param {Square.locations.CaptureTransactionsRequest} request - * @param {TransactionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Transactions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.locations.transactions.capture({ @@ -245,39 +259,35 @@ export class TransactionsClient { */ public capture( request: Square.locations.CaptureTransactionsRequest, - requestOptions?: TransactionsClient.RequestOptions, + requestOptions?: Transactions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__capture(request, requestOptions)); } private async __capture( request: Square.locations.CaptureTransactionsRequest, - requestOptions?: TransactionsClient.RequestOptions, + requestOptions?: Transactions.RequestOptions, ): Promise> { const { locationId, transactionId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/locations/${core.url.encodePathParam(locationId)}/transactions/${core.url.encodePathParam(transactionId)}/capture`, + `v2/locations/${encodeURIComponent(locationId)}/transactions/${encodeURIComponent(transactionId)}/capture`, ), method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -328,7 +338,7 @@ export class TransactionsClient { * for more information. * * @param {Square.locations.VoidTransactionsRequest} request - * @param {TransactionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Transactions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.locations.transactions.void({ @@ -338,39 +348,35 @@ export class TransactionsClient { */ public void( request: Square.locations.VoidTransactionsRequest, - requestOptions?: TransactionsClient.RequestOptions, + requestOptions?: Transactions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__void(request, requestOptions)); } private async __void( request: Square.locations.VoidTransactionsRequest, - requestOptions?: TransactionsClient.RequestOptions, + requestOptions?: Transactions.RequestOptions, ): Promise> { const { locationId, transactionId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/locations/${core.url.encodePathParam(locationId)}/transactions/${core.url.encodePathParam(transactionId)}/void`, + `v2/locations/${encodeURIComponent(locationId)}/transactions/${encodeURIComponent(transactionId)}/void`, ), method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -413,7 +419,7 @@ export class TransactionsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/locations/resources/transactions/client/index.ts b/src/api/resources/locations/resources/transactions/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/locations/resources/transactions/client/index.ts +++ b/src/api/resources/locations/resources/transactions/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/locations/resources/transactions/client/requests/CaptureTransactionsRequest.ts b/src/api/resources/locations/resources/transactions/client/requests/CaptureTransactionsRequest.ts index 1ca6b5728..cf21b4087 100644 --- a/src/api/resources/locations/resources/transactions/client/requests/CaptureTransactionsRequest.ts +++ b/src/api/resources/locations/resources/transactions/client/requests/CaptureTransactionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,8 +10,12 @@ * } */ export interface CaptureTransactionsRequest { - /** */ + /** + * + */ locationId: string; - /** */ + /** + * + */ transactionId: string; } diff --git a/src/api/resources/locations/resources/transactions/client/requests/GetTransactionsRequest.ts b/src/api/resources/locations/resources/transactions/client/requests/GetTransactionsRequest.ts index b231673f7..fb2c20d13 100644 --- a/src/api/resources/locations/resources/transactions/client/requests/GetTransactionsRequest.ts +++ b/src/api/resources/locations/resources/transactions/client/requests/GetTransactionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,8 +10,12 @@ * } */ export interface GetTransactionsRequest { - /** The ID of the transaction's associated location. */ + /** + * The ID of the transaction's associated location. + */ locationId: string; - /** The ID of the transaction to retrieve. */ + /** + * The ID of the transaction to retrieve. + */ transactionId: string; } diff --git a/src/api/resources/locations/resources/transactions/client/requests/ListTransactionsRequest.ts b/src/api/resources/locations/resources/transactions/client/requests/ListTransactionsRequest.ts index 1f5e88b31..9a850cf0b 100644 --- a/src/api/resources/locations/resources/transactions/client/requests/ListTransactionsRequest.ts +++ b/src/api/resources/locations/resources/transactions/client/requests/ListTransactionsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -13,7 +15,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface ListTransactionsRequest { - /** The ID of the location to list transactions for. */ + /** + * The ID of the location to list transactions for. + */ locationId: string; /** * The beginning of the requested reporting period, in RFC 3339 format. diff --git a/src/api/resources/locations/resources/transactions/client/requests/VoidTransactionsRequest.ts b/src/api/resources/locations/resources/transactions/client/requests/VoidTransactionsRequest.ts index 1e192d64f..6c73f8655 100644 --- a/src/api/resources/locations/resources/transactions/client/requests/VoidTransactionsRequest.ts +++ b/src/api/resources/locations/resources/transactions/client/requests/VoidTransactionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,8 +10,12 @@ * } */ export interface VoidTransactionsRequest { - /** */ + /** + * + */ locationId: string; - /** */ + /** + * + */ transactionId: string; } diff --git a/src/api/resources/locations/resources/transactions/client/requests/index.ts b/src/api/resources/locations/resources/transactions/client/requests/index.ts index c2e4f05af..71ae1bc2c 100644 --- a/src/api/resources/locations/resources/transactions/client/requests/index.ts +++ b/src/api/resources/locations/resources/transactions/client/requests/index.ts @@ -1,4 +1,4 @@ -export type { CaptureTransactionsRequest } from "./CaptureTransactionsRequest"; -export type { GetTransactionsRequest } from "./GetTransactionsRequest"; -export type { ListTransactionsRequest } from "./ListTransactionsRequest"; -export type { VoidTransactionsRequest } from "./VoidTransactionsRequest"; +export { type ListTransactionsRequest } from "./ListTransactionsRequest"; +export { type GetTransactionsRequest } from "./GetTransactionsRequest"; +export { type CaptureTransactionsRequest } from "./CaptureTransactionsRequest"; +export { type VoidTransactionsRequest } from "./VoidTransactionsRequest"; diff --git a/src/api/resources/loyalty/client/Client.ts b/src/api/resources/loyalty/client/Client.ts index 3c1136eb3..ec281fcf1 100644 --- a/src/api/resources/loyalty/client/Client.ts +++ b/src/api/resources/loyalty/client/Client.ts @@ -1,43 +1,64 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; -import { AccountsClient } from "../resources/accounts/client/Client"; -import { ProgramsClient } from "../resources/programs/client/Client"; -import { RewardsClient } from "../resources/rewards/client/Client"; +import * as errors from "../../../../errors/index"; +import { Accounts } from "../resources/accounts/client/Client"; +import { Programs } from "../resources/programs/client/Client"; +import { Rewards } from "../resources/rewards/client/Client"; -export declare namespace LoyaltyClient { - export interface Options extends BaseClientOptions {} +export declare namespace Loyalty { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class LoyaltyClient { - protected readonly _options: LoyaltyClient.Options; - protected _accounts: AccountsClient | undefined; - protected _programs: ProgramsClient | undefined; - protected _rewards: RewardsClient | undefined; +export class Loyalty { + protected readonly _options: Loyalty.Options; + protected _accounts: Accounts | undefined; + protected _programs: Programs | undefined; + protected _rewards: Rewards | undefined; - constructor(options: LoyaltyClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Loyalty.Options = {}) { + this._options = _options; } - public get accounts(): AccountsClient { - return (this._accounts ??= new AccountsClient(this._options)); + public get accounts(): Accounts { + return (this._accounts ??= new Accounts(this._options)); } - public get programs(): ProgramsClient { - return (this._programs ??= new ProgramsClient(this._options)); + public get programs(): Programs { + return (this._programs ??= new Programs(this._options)); } - public get rewards(): RewardsClient { - return (this._rewards ??= new RewardsClient(this._options)); + public get rewards(): Rewards { + return (this._rewards ??= new Rewards(this._options)); } /** @@ -51,7 +72,7 @@ export class LoyaltyClient { * Search results are sorted by `created_at` in descending order. * * @param {Square.SearchLoyaltyEventsRequest} request - * @param {LoyaltyClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Loyalty.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.loyalty.searchEvents({ @@ -67,23 +88,15 @@ export class LoyaltyClient { */ public searchEvents( request: Square.SearchLoyaltyEventsRequest = {}, - requestOptions?: LoyaltyClient.RequestOptions, + requestOptions?: Loyalty.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__searchEvents(request, requestOptions)); } private async __searchEvents( request: Square.SearchLoyaltyEventsRequest = {}, - requestOptions?: LoyaltyClient.RequestOptions, + requestOptions?: Loyalty.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -92,19 +105,23 @@ export class LoyaltyClient { "v2/loyalty/events/search", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchLoyaltyEventsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -145,7 +162,7 @@ export class LoyaltyClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/loyalty/client/index.ts b/src/api/resources/loyalty/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/loyalty/client/index.ts +++ b/src/api/resources/loyalty/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/loyalty/client/requests/SearchLoyaltyEventsRequest.ts b/src/api/resources/loyalty/client/requests/SearchLoyaltyEventsRequest.ts index 63a3e0ead..2b1bc0f10 100644 --- a/src/api/resources/loyalty/client/requests/SearchLoyaltyEventsRequest.ts +++ b/src/api/resources/loyalty/client/requests/SearchLoyaltyEventsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/loyalty/client/requests/index.ts b/src/api/resources/loyalty/client/requests/index.ts index 7f957a88e..119b5f36e 100644 --- a/src/api/resources/loyalty/client/requests/index.ts +++ b/src/api/resources/loyalty/client/requests/index.ts @@ -1 +1 @@ -export type { SearchLoyaltyEventsRequest } from "./SearchLoyaltyEventsRequest"; +export { type SearchLoyaltyEventsRequest } from "./SearchLoyaltyEventsRequest"; diff --git a/src/api/resources/loyalty/resources/accounts/client/Client.ts b/src/api/resources/loyalty/resources/accounts/client/Client.ts index 372059c4b..51e6164be 100644 --- a/src/api/resources/loyalty/resources/accounts/client/Client.ts +++ b/src/api/resources/loyalty/resources/accounts/client/Client.ts @@ -1,32 +1,53 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace AccountsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Accounts { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class AccountsClient { - protected readonly _options: AccountsClient.Options; +export class Accounts { + protected readonly _options: Accounts.Options; - constructor(options: AccountsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Accounts.Options = {}) { + this._options = _options; } /** * Creates a loyalty account. To create a loyalty account, you must provide the `program_id` and a `mapping` with the `phone_number` of the buyer. * * @param {Square.loyalty.CreateLoyaltyAccountRequest} request - * @param {AccountsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Accounts.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.loyalty.accounts.create({ @@ -41,23 +62,15 @@ export class AccountsClient { */ public create( request: Square.loyalty.CreateLoyaltyAccountRequest, - requestOptions?: AccountsClient.RequestOptions, + requestOptions?: Accounts.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.loyalty.CreateLoyaltyAccountRequest, - requestOptions?: AccountsClient.RequestOptions, + requestOptions?: Accounts.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -66,19 +79,23 @@ export class AccountsClient { "v2/loyalty/accounts", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.loyalty.CreateLoyaltyAccountRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -126,7 +143,7 @@ export class AccountsClient { * Search results are sorted by `created_at` in ascending order. * * @param {Square.loyalty.SearchLoyaltyAccountsRequest} request - * @param {AccountsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Accounts.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.loyalty.accounts.search({ @@ -140,23 +157,15 @@ export class AccountsClient { */ public search( request: Square.loyalty.SearchLoyaltyAccountsRequest = {}, - requestOptions?: AccountsClient.RequestOptions, + requestOptions?: Accounts.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__search(request, requestOptions)); } private async __search( request: Square.loyalty.SearchLoyaltyAccountsRequest = {}, - requestOptions?: AccountsClient.RequestOptions, + requestOptions?: Accounts.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -165,19 +174,23 @@ export class AccountsClient { "v2/loyalty/accounts/search", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.loyalty.SearchLoyaltyAccountsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -221,7 +234,7 @@ export class AccountsClient { * Retrieves a loyalty account. * * @param {Square.loyalty.GetAccountsRequest} request - * @param {AccountsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Accounts.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.loyalty.accounts.get({ @@ -230,39 +243,35 @@ export class AccountsClient { */ public get( request: Square.loyalty.GetAccountsRequest, - requestOptions?: AccountsClient.RequestOptions, + requestOptions?: Accounts.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.loyalty.GetAccountsRequest, - requestOptions?: AccountsClient.RequestOptions, + requestOptions?: Accounts.RequestOptions, ): Promise> { const { accountId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/loyalty/accounts/${core.url.encodePathParam(accountId)}`, + `v2/loyalty/accounts/${encodeURIComponent(accountId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -321,7 +330,7 @@ export class AccountsClient { * [Calculating promotion points](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#calculate-promotion-points). * * @param {Square.loyalty.AccumulateLoyaltyPointsRequest} request - * @param {AccountsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Accounts.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.loyalty.accounts.accumulatePoints({ @@ -335,45 +344,41 @@ export class AccountsClient { */ public accumulatePoints( request: Square.loyalty.AccumulateLoyaltyPointsRequest, - requestOptions?: AccountsClient.RequestOptions, + requestOptions?: Accounts.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__accumulatePoints(request, requestOptions)); } private async __accumulatePoints( request: Square.loyalty.AccumulateLoyaltyPointsRequest, - requestOptions?: AccountsClient.RequestOptions, + requestOptions?: Accounts.RequestOptions, ): Promise> { const { accountId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/loyalty/accounts/${core.url.encodePathParam(accountId)}/accumulate`, + `v2/loyalty/accounts/${encodeURIComponent(accountId)}/accumulate`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.loyalty.AccumulateLoyaltyPointsRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -423,7 +428,7 @@ export class AccountsClient { * to add points when a buyer pays for the purchase. * * @param {Square.loyalty.AdjustLoyaltyPointsRequest} request - * @param {AccountsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Accounts.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.loyalty.accounts.adjust({ @@ -437,45 +442,41 @@ export class AccountsClient { */ public adjust( request: Square.loyalty.AdjustLoyaltyPointsRequest, - requestOptions?: AccountsClient.RequestOptions, + requestOptions?: Accounts.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__adjust(request, requestOptions)); } private async __adjust( request: Square.loyalty.AdjustLoyaltyPointsRequest, - requestOptions?: AccountsClient.RequestOptions, + requestOptions?: Accounts.RequestOptions, ): Promise> { const { accountId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/loyalty/accounts/${core.url.encodePathParam(accountId)}/adjust`, + `v2/loyalty/accounts/${encodeURIComponent(accountId)}/adjust`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.loyalty.AdjustLoyaltyPointsRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -518,7 +519,7 @@ export class AccountsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/loyalty/resources/accounts/client/index.ts b/src/api/resources/loyalty/resources/accounts/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/loyalty/resources/accounts/client/index.ts +++ b/src/api/resources/loyalty/resources/accounts/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/loyalty/resources/accounts/client/requests/AccumulateLoyaltyPointsRequest.ts b/src/api/resources/loyalty/resources/accounts/client/requests/AccumulateLoyaltyPointsRequest.ts index b89c2408b..88c4285f2 100644 --- a/src/api/resources/loyalty/resources/accounts/client/requests/AccumulateLoyaltyPointsRequest.ts +++ b/src/api/resources/loyalty/resources/accounts/client/requests/AccumulateLoyaltyPointsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -14,7 +16,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface AccumulateLoyaltyPointsRequest { - /** The ID of the target [loyalty account](entity:LoyaltyAccount). */ + /** + * The ID of the target [loyalty account](entity:LoyaltyAccount). + */ accountId: string; /** * The points to add to the account. diff --git a/src/api/resources/loyalty/resources/accounts/client/requests/AdjustLoyaltyPointsRequest.ts b/src/api/resources/loyalty/resources/accounts/client/requests/AdjustLoyaltyPointsRequest.ts index 42b70d986..6243e046b 100644 --- a/src/api/resources/loyalty/resources/accounts/client/requests/AdjustLoyaltyPointsRequest.ts +++ b/src/api/resources/loyalty/resources/accounts/client/requests/AdjustLoyaltyPointsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -14,7 +16,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface AdjustLoyaltyPointsRequest { - /** The ID of the target [loyalty account](entity:LoyaltyAccount). */ + /** + * The ID of the target [loyalty account](entity:LoyaltyAccount). + */ accountId: string; /** * A unique string that identifies this `AdjustLoyaltyPoints` request. diff --git a/src/api/resources/loyalty/resources/accounts/client/requests/CreateLoyaltyAccountRequest.ts b/src/api/resources/loyalty/resources/accounts/client/requests/CreateLoyaltyAccountRequest.ts index ca19890f9..b9301ffc1 100644 --- a/src/api/resources/loyalty/resources/accounts/client/requests/CreateLoyaltyAccountRequest.ts +++ b/src/api/resources/loyalty/resources/accounts/client/requests/CreateLoyaltyAccountRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/loyalty/resources/accounts/client/requests/GetAccountsRequest.ts b/src/api/resources/loyalty/resources/accounts/client/requests/GetAccountsRequest.ts index da5330105..1037dbb90 100644 --- a/src/api/resources/loyalty/resources/accounts/client/requests/GetAccountsRequest.ts +++ b/src/api/resources/loyalty/resources/accounts/client/requests/GetAccountsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetAccountsRequest { - /** The ID of the [loyalty account](entity:LoyaltyAccount) to retrieve. */ + /** + * The ID of the [loyalty account](entity:LoyaltyAccount) to retrieve. + */ accountId: string; } diff --git a/src/api/resources/loyalty/resources/accounts/client/requests/SearchLoyaltyAccountsRequest.ts b/src/api/resources/loyalty/resources/accounts/client/requests/SearchLoyaltyAccountsRequest.ts index 18f5178f2..b5b095842 100644 --- a/src/api/resources/loyalty/resources/accounts/client/requests/SearchLoyaltyAccountsRequest.ts +++ b/src/api/resources/loyalty/resources/accounts/client/requests/SearchLoyaltyAccountsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/loyalty/resources/accounts/client/requests/index.ts b/src/api/resources/loyalty/resources/accounts/client/requests/index.ts index ad84fb2f2..d6efd2ba6 100644 --- a/src/api/resources/loyalty/resources/accounts/client/requests/index.ts +++ b/src/api/resources/loyalty/resources/accounts/client/requests/index.ts @@ -1,5 +1,5 @@ -export type { AccumulateLoyaltyPointsRequest } from "./AccumulateLoyaltyPointsRequest"; -export type { AdjustLoyaltyPointsRequest } from "./AdjustLoyaltyPointsRequest"; -export type { CreateLoyaltyAccountRequest } from "./CreateLoyaltyAccountRequest"; -export type { GetAccountsRequest } from "./GetAccountsRequest"; -export type { SearchLoyaltyAccountsRequest } from "./SearchLoyaltyAccountsRequest"; +export { type CreateLoyaltyAccountRequest } from "./CreateLoyaltyAccountRequest"; +export { type SearchLoyaltyAccountsRequest } from "./SearchLoyaltyAccountsRequest"; +export { type GetAccountsRequest } from "./GetAccountsRequest"; +export { type AccumulateLoyaltyPointsRequest } from "./AccumulateLoyaltyPointsRequest"; +export { type AdjustLoyaltyPointsRequest } from "./AdjustLoyaltyPointsRequest"; diff --git a/src/api/resources/loyalty/resources/index.ts b/src/api/resources/loyalty/resources/index.ts index 98cded2c5..e335fa8c9 100644 --- a/src/api/resources/loyalty/resources/index.ts +++ b/src/api/resources/loyalty/resources/index.ts @@ -1,6 +1,6 @@ export * as accounts from "./accounts"; -export * from "./accounts/client/requests"; export * as programs from "./programs"; -export * from "./programs/client/requests"; export * as rewards from "./rewards"; +export * from "./accounts/client/requests"; +export * from "./programs/client/requests"; export * from "./rewards/client/requests"; diff --git a/src/api/resources/loyalty/resources/programs/client/Client.ts b/src/api/resources/loyalty/resources/programs/client/Client.ts index ec5248058..93a899bb0 100644 --- a/src/api/resources/loyalty/resources/programs/client/Client.ts +++ b/src/api/resources/loyalty/resources/programs/client/Client.ts @@ -1,31 +1,52 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; -import { PromotionsClient } from "../resources/promotions/client/Client"; +import * as errors from "../../../../../../errors/index"; +import { Promotions } from "../resources/promotions/client/Client"; -export declare namespace ProgramsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Programs { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class ProgramsClient { - protected readonly _options: ProgramsClient.Options; - protected _promotions: PromotionsClient | undefined; +export class Programs { + protected readonly _options: Programs.Options; + protected _promotions: Promotions | undefined; - constructor(options: ProgramsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Programs.Options = {}) { + this._options = _options; } - public get promotions(): PromotionsClient { - return (this._promotions ??= new PromotionsClient(this._options)); + public get promotions(): Promotions { + return (this._promotions ??= new Promotions(this._options)); } /** @@ -35,28 +56,20 @@ export class ProgramsClient { * * Replaced with [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) when used with the keyword `main`. * - * @param {ProgramsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Programs.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.loyalty.programs.list() */ public list( - requestOptions?: ProgramsClient.RequestOptions, + requestOptions?: Programs.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__list(requestOptions)); } private async __list( - requestOptions?: ProgramsClient.RequestOptions, + requestOptions?: Programs.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -65,13 +78,17 @@ export class ProgramsClient { "v2/loyalty/programs", ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -117,7 +134,7 @@ export class ProgramsClient { * Loyalty programs define how buyers can earn points and redeem points for rewards. Square sellers can have only one loyalty program, which is created and managed from the Seller Dashboard. For more information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview). * * @param {Square.loyalty.GetProgramsRequest} request - * @param {ProgramsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Programs.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.loyalty.programs.get({ @@ -126,39 +143,35 @@ export class ProgramsClient { */ public get( request: Square.loyalty.GetProgramsRequest, - requestOptions?: ProgramsClient.RequestOptions, + requestOptions?: Programs.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.loyalty.GetProgramsRequest, - requestOptions?: ProgramsClient.RequestOptions, + requestOptions?: Programs.RequestOptions, ): Promise> { const { programId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/loyalty/programs/${core.url.encodePathParam(programId)}`, + `v2/loyalty/programs/${encodeURIComponent(programId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -218,7 +231,7 @@ export class ProgramsClient { * [Calculating promotion points](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#calculate-promotion-points). * * @param {Square.loyalty.CalculateLoyaltyPointsRequest} request - * @param {ProgramsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Programs.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.loyalty.programs.calculate({ @@ -229,45 +242,41 @@ export class ProgramsClient { */ public calculate( request: Square.loyalty.CalculateLoyaltyPointsRequest, - requestOptions?: ProgramsClient.RequestOptions, + requestOptions?: Programs.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__calculate(request, requestOptions)); } private async __calculate( request: Square.loyalty.CalculateLoyaltyPointsRequest, - requestOptions?: ProgramsClient.RequestOptions, + requestOptions?: Programs.RequestOptions, ): Promise> { const { programId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/loyalty/programs/${core.url.encodePathParam(programId)}/calculate`, + `v2/loyalty/programs/${encodeURIComponent(programId)}/calculate`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.loyalty.CalculateLoyaltyPointsRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -310,7 +319,7 @@ export class ProgramsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/loyalty/resources/programs/client/index.ts b/src/api/resources/loyalty/resources/programs/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/loyalty/resources/programs/client/index.ts +++ b/src/api/resources/loyalty/resources/programs/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/loyalty/resources/programs/client/requests/CalculateLoyaltyPointsRequest.ts b/src/api/resources/loyalty/resources/programs/client/requests/CalculateLoyaltyPointsRequest.ts index 08b80f283..ce71619a8 100644 --- a/src/api/resources/loyalty/resources/programs/client/requests/CalculateLoyaltyPointsRequest.ts +++ b/src/api/resources/loyalty/resources/programs/client/requests/CalculateLoyaltyPointsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -11,7 +13,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface CalculateLoyaltyPointsRequest { - /** The ID of the [loyalty program](entity:LoyaltyProgram), which defines the rules for accruing points. */ + /** + * The ID of the [loyalty program](entity:LoyaltyProgram), which defines the rules for accruing points. + */ programId: string; /** * The [order](entity:Order) ID for which to calculate the points. diff --git a/src/api/resources/loyalty/resources/programs/client/requests/GetProgramsRequest.ts b/src/api/resources/loyalty/resources/programs/client/requests/GetProgramsRequest.ts index a5d13b262..21b4fcc20 100644 --- a/src/api/resources/loyalty/resources/programs/client/requests/GetProgramsRequest.ts +++ b/src/api/resources/loyalty/resources/programs/client/requests/GetProgramsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetProgramsRequest { - /** The ID of the loyalty program or the keyword `main`. Either value can be used to retrieve the single loyalty program that belongs to the seller. */ + /** + * The ID of the loyalty program or the keyword `main`. Either value can be used to retrieve the single loyalty program that belongs to the seller. + */ programId: string; } diff --git a/src/api/resources/loyalty/resources/programs/client/requests/index.ts b/src/api/resources/loyalty/resources/programs/client/requests/index.ts index 5fb0fee97..c6b8d4f6f 100644 --- a/src/api/resources/loyalty/resources/programs/client/requests/index.ts +++ b/src/api/resources/loyalty/resources/programs/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { CalculateLoyaltyPointsRequest } from "./CalculateLoyaltyPointsRequest"; -export type { GetProgramsRequest } from "./GetProgramsRequest"; +export { type GetProgramsRequest } from "./GetProgramsRequest"; +export { type CalculateLoyaltyPointsRequest } from "./CalculateLoyaltyPointsRequest"; diff --git a/src/api/resources/loyalty/resources/programs/resources/promotions/client/Client.ts b/src/api/resources/loyalty/resources/programs/resources/promotions/client/Client.ts index 4b8aa03d4..d1ddd6881 100644 --- a/src/api/resources/loyalty/resources/programs/resources/promotions/client/Client.ts +++ b/src/api/resources/loyalty/resources/programs/resources/promotions/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../../../BaseClient"; +import * as environments from "../../../../../../../../environments"; import * as core from "../../../../../../../../core"; +import * as Square from "../../../../../../../index"; +import * as serializers from "../../../../../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../../../core/headers"; -import * as environments from "../../../../../../../../environments"; import * as errors from "../../../../../../../../errors/index"; -import * as serializers from "../../../../../../../../serialization/index"; -import type * as Square from "../../../../../../../index"; -export declare namespace PromotionsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Promotions { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class PromotionsClient { - protected readonly _options: PromotionsClient.Options; +export class Promotions { + protected readonly _options: Promotions.Options; - constructor(options: PromotionsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Promotions.Options = {}) { + this._options = _options; } /** @@ -27,7 +48,7 @@ export class PromotionsClient { * Results are sorted by the `created_at` date in descending order (newest to oldest). * * @param {Square.loyalty.programs.ListPromotionsRequest} request - * @param {PromotionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Promotions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.loyalty.programs.promotions.list({ @@ -39,8 +60,8 @@ export class PromotionsClient { */ public async list( request: Square.loyalty.programs.ListPromotionsRequest, - requestOptions?: PromotionsClient.RequestOptions, - ): Promise> { + requestOptions?: Promotions.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.loyalty.programs.ListPromotionsRequest, @@ -48,40 +69,38 @@ export class PromotionsClient { const { programId, status, cursor, limit } = request; const _queryParams: Record = {}; if (status !== undefined) { - _queryParams.status = serializers.LoyaltyPromotionStatus.jsonOrThrow(status, { + _queryParams["status"] = serializers.LoyaltyPromotionStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/loyalty/programs/${core.url.encodePathParam(programId)}/promotions`, + `v2/loyalty/programs/${encodeURIComponent(programId)}/promotions`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -122,7 +141,7 @@ export class PromotionsClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -143,7 +162,7 @@ export class PromotionsClient { * `ACTIVE` or `SCHEDULED` status. * * @param {Square.loyalty.programs.CreateLoyaltyPromotionRequest} request - * @param {PromotionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Promotions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.loyalty.programs.promotions.create({ @@ -174,45 +193,41 @@ export class PromotionsClient { */ public create( request: Square.loyalty.programs.CreateLoyaltyPromotionRequest, - requestOptions?: PromotionsClient.RequestOptions, + requestOptions?: Promotions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.loyalty.programs.CreateLoyaltyPromotionRequest, - requestOptions?: PromotionsClient.RequestOptions, + requestOptions?: Promotions.RequestOptions, ): Promise> { const { programId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/loyalty/programs/${core.url.encodePathParam(programId)}/promotions`, + `v2/loyalty/programs/${encodeURIComponent(programId)}/promotions`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.loyalty.programs.CreateLoyaltyPromotionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -258,7 +273,7 @@ export class PromotionsClient { * Retrieves a loyalty promotion. * * @param {Square.loyalty.programs.GetPromotionsRequest} request - * @param {PromotionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Promotions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.loyalty.programs.promotions.get({ @@ -268,39 +283,35 @@ export class PromotionsClient { */ public get( request: Square.loyalty.programs.GetPromotionsRequest, - requestOptions?: PromotionsClient.RequestOptions, + requestOptions?: Promotions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.loyalty.programs.GetPromotionsRequest, - requestOptions?: PromotionsClient.RequestOptions, + requestOptions?: Promotions.RequestOptions, ): Promise> { const { programId, promotionId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/loyalty/programs/${core.url.encodePathParam(programId)}/promotions/${core.url.encodePathParam(promotionId)}`, + `v2/loyalty/programs/${encodeURIComponent(programId)}/promotions/${encodeURIComponent(promotionId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -351,7 +362,7 @@ export class PromotionsClient { * This endpoint sets the loyalty promotion to the `CANCELED` state * * @param {Square.loyalty.programs.CancelPromotionsRequest} request - * @param {PromotionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Promotions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.loyalty.programs.promotions.cancel({ @@ -361,39 +372,35 @@ export class PromotionsClient { */ public cancel( request: Square.loyalty.programs.CancelPromotionsRequest, - requestOptions?: PromotionsClient.RequestOptions, + requestOptions?: Promotions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__cancel(request, requestOptions)); } private async __cancel( request: Square.loyalty.programs.CancelPromotionsRequest, - requestOptions?: PromotionsClient.RequestOptions, + requestOptions?: Promotions.RequestOptions, ): Promise> { const { programId, promotionId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/loyalty/programs/${core.url.encodePathParam(programId)}/promotions/${core.url.encodePathParam(promotionId)}/cancel`, + `v2/loyalty/programs/${encodeURIComponent(programId)}/promotions/${encodeURIComponent(promotionId)}/cancel`, ), method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -436,7 +443,7 @@ export class PromotionsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/loyalty/resources/programs/resources/promotions/client/index.ts b/src/api/resources/loyalty/resources/programs/resources/promotions/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/loyalty/resources/programs/resources/promotions/client/index.ts +++ b/src/api/resources/loyalty/resources/programs/resources/promotions/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/CancelPromotionsRequest.ts b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/CancelPromotionsRequest.ts index 956f0ec81..419b7deb7 100644 --- a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/CancelPromotionsRequest.ts +++ b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/CancelPromotionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,7 +10,9 @@ * } */ export interface CancelPromotionsRequest { - /** The ID of the base [loyalty program](entity:LoyaltyProgram). */ + /** + * The ID of the base [loyalty program](entity:LoyaltyProgram). + */ programId: string; /** * The ID of the [loyalty promotion](entity:LoyaltyPromotion) to cancel. You can cancel a diff --git a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/CreateLoyaltyPromotionRequest.ts b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/CreateLoyaltyPromotionRequest.ts index 2f8efa85b..7e69310f0 100644 --- a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/CreateLoyaltyPromotionRequest.ts +++ b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/CreateLoyaltyPromotionRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../../index"; +import * as Square from "../../../../../../../../index"; /** * @example diff --git a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/GetPromotionsRequest.ts b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/GetPromotionsRequest.ts index 34a64d737..df500e557 100644 --- a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/GetPromotionsRequest.ts +++ b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/GetPromotionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -13,6 +15,8 @@ export interface GetPromotionsRequest { * call [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) using the `main` keyword. */ programId: string; - /** The ID of the [loyalty promotion](entity:LoyaltyPromotion) to retrieve. */ + /** + * The ID of the [loyalty promotion](entity:LoyaltyPromotion) to retrieve. + */ promotionId: string; } diff --git a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/ListPromotionsRequest.ts b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/ListPromotionsRequest.ts index 5bd9b1d60..46d676b3a 100644 --- a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/ListPromotionsRequest.ts +++ b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/ListPromotionsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../../index"; +import * as Square from "../../../../../../../../index"; /** * @example diff --git a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/index.ts b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/index.ts index a9acf1162..123564dd0 100644 --- a/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/index.ts +++ b/src/api/resources/loyalty/resources/programs/resources/promotions/client/requests/index.ts @@ -1,4 +1,4 @@ -export type { CancelPromotionsRequest } from "./CancelPromotionsRequest"; -export type { CreateLoyaltyPromotionRequest } from "./CreateLoyaltyPromotionRequest"; -export type { GetPromotionsRequest } from "./GetPromotionsRequest"; -export type { ListPromotionsRequest } from "./ListPromotionsRequest"; +export { type ListPromotionsRequest } from "./ListPromotionsRequest"; +export { type CreateLoyaltyPromotionRequest } from "./CreateLoyaltyPromotionRequest"; +export { type GetPromotionsRequest } from "./GetPromotionsRequest"; +export { type CancelPromotionsRequest } from "./CancelPromotionsRequest"; diff --git a/src/api/resources/loyalty/resources/rewards/client/Client.ts b/src/api/resources/loyalty/resources/rewards/client/Client.ts index c67ce6f31..377b3f6a1 100644 --- a/src/api/resources/loyalty/resources/rewards/client/Client.ts +++ b/src/api/resources/loyalty/resources/rewards/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace RewardsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Rewards { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class RewardsClient { - protected readonly _options: RewardsClient.Options; +export class Rewards { + protected readonly _options: Rewards.Options; - constructor(options: RewardsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Rewards.Options = {}) { + this._options = _options; } /** @@ -33,7 +54,7 @@ export class RewardsClient { * not available for the buyer to redeem another reward. * * @param {Square.loyalty.CreateLoyaltyRewardRequest} request - * @param {RewardsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Rewards.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.loyalty.rewards.create({ @@ -47,23 +68,15 @@ export class RewardsClient { */ public create( request: Square.loyalty.CreateLoyaltyRewardRequest, - requestOptions?: RewardsClient.RequestOptions, + requestOptions?: Rewards.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.loyalty.CreateLoyaltyRewardRequest, - requestOptions?: RewardsClient.RequestOptions, + requestOptions?: Rewards.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -72,19 +85,23 @@ export class RewardsClient { "v2/loyalty/rewards", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.loyalty.CreateLoyaltyRewardRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -134,7 +151,7 @@ export class RewardsClient { * Search results are sorted by `updated_at` in descending order. * * @param {Square.loyalty.SearchLoyaltyRewardsRequest} request - * @param {RewardsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Rewards.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.loyalty.rewards.search({ @@ -146,23 +163,15 @@ export class RewardsClient { */ public search( request: Square.loyalty.SearchLoyaltyRewardsRequest = {}, - requestOptions?: RewardsClient.RequestOptions, + requestOptions?: Rewards.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__search(request, requestOptions)); } private async __search( request: Square.loyalty.SearchLoyaltyRewardsRequest = {}, - requestOptions?: RewardsClient.RequestOptions, + requestOptions?: Rewards.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -171,19 +180,23 @@ export class RewardsClient { "v2/loyalty/rewards/search", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.loyalty.SearchLoyaltyRewardsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -227,7 +240,7 @@ export class RewardsClient { * Retrieves a loyalty reward. * * @param {Square.loyalty.GetRewardsRequest} request - * @param {RewardsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Rewards.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.loyalty.rewards.get({ @@ -236,39 +249,35 @@ export class RewardsClient { */ public get( request: Square.loyalty.GetRewardsRequest, - requestOptions?: RewardsClient.RequestOptions, + requestOptions?: Rewards.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.loyalty.GetRewardsRequest, - requestOptions?: RewardsClient.RequestOptions, + requestOptions?: Rewards.RequestOptions, ): Promise> { const { rewardId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/loyalty/rewards/${core.url.encodePathParam(rewardId)}`, + `v2/loyalty/rewards/${encodeURIComponent(rewardId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -322,7 +331,7 @@ export class RewardsClient { * You cannot delete a reward that has reached the terminal state (REDEEMED). * * @param {Square.loyalty.DeleteRewardsRequest} request - * @param {RewardsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Rewards.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.loyalty.rewards.delete({ @@ -331,39 +340,35 @@ export class RewardsClient { */ public delete( request: Square.loyalty.DeleteRewardsRequest, - requestOptions?: RewardsClient.RequestOptions, + requestOptions?: Rewards.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); } private async __delete( request: Square.loyalty.DeleteRewardsRequest, - requestOptions?: RewardsClient.RequestOptions, + requestOptions?: Rewards.RequestOptions, ): Promise> { const { rewardId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/loyalty/rewards/${core.url.encodePathParam(rewardId)}`, + `v2/loyalty/rewards/${encodeURIComponent(rewardId)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -419,7 +424,7 @@ export class RewardsClient { * to the account. * * @param {Square.loyalty.RedeemLoyaltyRewardRequest} request - * @param {RewardsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Rewards.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.loyalty.rewards.redeem({ @@ -430,45 +435,41 @@ export class RewardsClient { */ public redeem( request: Square.loyalty.RedeemLoyaltyRewardRequest, - requestOptions?: RewardsClient.RequestOptions, + requestOptions?: Rewards.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__redeem(request, requestOptions)); } private async __redeem( request: Square.loyalty.RedeemLoyaltyRewardRequest, - requestOptions?: RewardsClient.RequestOptions, + requestOptions?: Rewards.RequestOptions, ): Promise> { const { rewardId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/loyalty/rewards/${core.url.encodePathParam(rewardId)}/redeem`, + `v2/loyalty/rewards/${encodeURIComponent(rewardId)}/redeem`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.loyalty.RedeemLoyaltyRewardRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -511,7 +512,7 @@ export class RewardsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/loyalty/resources/rewards/client/index.ts b/src/api/resources/loyalty/resources/rewards/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/loyalty/resources/rewards/client/index.ts +++ b/src/api/resources/loyalty/resources/rewards/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/loyalty/resources/rewards/client/requests/CreateLoyaltyRewardRequest.ts b/src/api/resources/loyalty/resources/rewards/client/requests/CreateLoyaltyRewardRequest.ts index 5ecdf572d..ae271caac 100644 --- a/src/api/resources/loyalty/resources/rewards/client/requests/CreateLoyaltyRewardRequest.ts +++ b/src/api/resources/loyalty/resources/rewards/client/requests/CreateLoyaltyRewardRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/loyalty/resources/rewards/client/requests/DeleteRewardsRequest.ts b/src/api/resources/loyalty/resources/rewards/client/requests/DeleteRewardsRequest.ts index db7d0ce7f..4d0f60bd3 100644 --- a/src/api/resources/loyalty/resources/rewards/client/requests/DeleteRewardsRequest.ts +++ b/src/api/resources/loyalty/resources/rewards/client/requests/DeleteRewardsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface DeleteRewardsRequest { - /** The ID of the [loyalty reward](entity:LoyaltyReward) to delete. */ + /** + * The ID of the [loyalty reward](entity:LoyaltyReward) to delete. + */ rewardId: string; } diff --git a/src/api/resources/loyalty/resources/rewards/client/requests/GetRewardsRequest.ts b/src/api/resources/loyalty/resources/rewards/client/requests/GetRewardsRequest.ts index 1111b67f5..4eaaed693 100644 --- a/src/api/resources/loyalty/resources/rewards/client/requests/GetRewardsRequest.ts +++ b/src/api/resources/loyalty/resources/rewards/client/requests/GetRewardsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetRewardsRequest { - /** The ID of the [loyalty reward](entity:LoyaltyReward) to retrieve. */ + /** + * The ID of the [loyalty reward](entity:LoyaltyReward) to retrieve. + */ rewardId: string; } diff --git a/src/api/resources/loyalty/resources/rewards/client/requests/RedeemLoyaltyRewardRequest.ts b/src/api/resources/loyalty/resources/rewards/client/requests/RedeemLoyaltyRewardRequest.ts index 3e949fbd2..ee713cc43 100644 --- a/src/api/resources/loyalty/resources/rewards/client/requests/RedeemLoyaltyRewardRequest.ts +++ b/src/api/resources/loyalty/resources/rewards/client/requests/RedeemLoyaltyRewardRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -9,7 +11,9 @@ * } */ export interface RedeemLoyaltyRewardRequest { - /** The ID of the [loyalty reward](entity:LoyaltyReward) to redeem. */ + /** + * The ID of the [loyalty reward](entity:LoyaltyReward) to redeem. + */ rewardId: string; /** * A unique string that identifies this `RedeemLoyaltyReward` request. diff --git a/src/api/resources/loyalty/resources/rewards/client/requests/SearchLoyaltyRewardsRequest.ts b/src/api/resources/loyalty/resources/rewards/client/requests/SearchLoyaltyRewardsRequest.ts index 3fcb045d9..17ef09df2 100644 --- a/src/api/resources/loyalty/resources/rewards/client/requests/SearchLoyaltyRewardsRequest.ts +++ b/src/api/resources/loyalty/resources/rewards/client/requests/SearchLoyaltyRewardsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/loyalty/resources/rewards/client/requests/index.ts b/src/api/resources/loyalty/resources/rewards/client/requests/index.ts index 76fc2265b..387da86cf 100644 --- a/src/api/resources/loyalty/resources/rewards/client/requests/index.ts +++ b/src/api/resources/loyalty/resources/rewards/client/requests/index.ts @@ -1,5 +1,5 @@ -export type { CreateLoyaltyRewardRequest } from "./CreateLoyaltyRewardRequest"; -export type { DeleteRewardsRequest } from "./DeleteRewardsRequest"; -export type { GetRewardsRequest } from "./GetRewardsRequest"; -export type { RedeemLoyaltyRewardRequest } from "./RedeemLoyaltyRewardRequest"; -export type { SearchLoyaltyRewardsRequest } from "./SearchLoyaltyRewardsRequest"; +export { type CreateLoyaltyRewardRequest } from "./CreateLoyaltyRewardRequest"; +export { type SearchLoyaltyRewardsRequest } from "./SearchLoyaltyRewardsRequest"; +export { type GetRewardsRequest } from "./GetRewardsRequest"; +export { type DeleteRewardsRequest } from "./DeleteRewardsRequest"; +export { type RedeemLoyaltyRewardRequest } from "./RedeemLoyaltyRewardRequest"; diff --git a/src/api/resources/merchants/client/Client.ts b/src/api/resources/merchants/client/Client.ts index c841f2685..9918bdd43 100644 --- a/src/api/resources/merchants/client/Client.ts +++ b/src/api/resources/merchants/client/Client.ts @@ -1,37 +1,58 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; -import { CustomAttributeDefinitionsClient } from "../resources/customAttributeDefinitions/client/Client"; -import { CustomAttributesClient } from "../resources/customAttributes/client/Client"; +import * as errors from "../../../../errors/index"; +import { CustomAttributeDefinitions } from "../resources/customAttributeDefinitions/client/Client"; +import { CustomAttributes } from "../resources/customAttributes/client/Client"; -export declare namespace MerchantsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Merchants { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class MerchantsClient { - protected readonly _options: MerchantsClient.Options; - protected _customAttributeDefinitions: CustomAttributeDefinitionsClient | undefined; - protected _customAttributes: CustomAttributesClient | undefined; +export class Merchants { + protected readonly _options: Merchants.Options; + protected _customAttributeDefinitions: CustomAttributeDefinitions | undefined; + protected _customAttributes: CustomAttributes | undefined; - constructor(options: MerchantsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Merchants.Options = {}) { + this._options = _options; } - public get customAttributeDefinitions(): CustomAttributeDefinitionsClient { - return (this._customAttributeDefinitions ??= new CustomAttributeDefinitionsClient(this._options)); + public get customAttributeDefinitions(): CustomAttributeDefinitions { + return (this._customAttributeDefinitions ??= new CustomAttributeDefinitions(this._options)); } - public get customAttributes(): CustomAttributesClient { - return (this._customAttributes ??= new CustomAttributesClient(this._options)); + public get customAttributes(): CustomAttributes { + return (this._customAttributes ??= new CustomAttributes(this._options)); } /** @@ -47,7 +68,7 @@ export class MerchantsClient { * endpoint to retrieve the merchant information. * * @param {Square.ListMerchantsRequest} request - * @param {MerchantsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Merchants.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.merchants.list({ @@ -56,8 +77,8 @@ export class MerchantsClient { */ public async list( request: Square.ListMerchantsRequest = {}, - requestOptions?: MerchantsClient.RequestOptions, - ): Promise> { + requestOptions?: Merchants.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.ListMerchantsRequest, @@ -65,16 +86,8 @@ export class MerchantsClient { const { cursor } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams.cursor = cursor?.toString() ?? null; + _queryParams["cursor"] = cursor?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -83,13 +96,19 @@ export class MerchantsClient { "v2/merchants", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -128,7 +147,7 @@ export class MerchantsClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -144,7 +163,7 @@ export class MerchantsClient { * Retrieves the `Merchant` object for the given `merchant_id`. * * @param {Square.GetMerchantsRequest} request - * @param {MerchantsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Merchants.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.merchants.get({ @@ -153,39 +172,35 @@ export class MerchantsClient { */ public get( request: Square.GetMerchantsRequest, - requestOptions?: MerchantsClient.RequestOptions, + requestOptions?: Merchants.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.GetMerchantsRequest, - requestOptions?: MerchantsClient.RequestOptions, + requestOptions?: Merchants.RequestOptions, ): Promise> { const { merchantId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/merchants/${core.url.encodePathParam(merchantId)}`, + `v2/merchants/${encodeURIComponent(merchantId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -226,7 +241,7 @@ export class MerchantsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/merchants/client/index.ts b/src/api/resources/merchants/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/merchants/client/index.ts +++ b/src/api/resources/merchants/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/merchants/client/requests/GetMerchantsRequest.ts b/src/api/resources/merchants/client/requests/GetMerchantsRequest.ts index e9c7bfafa..9c1ccaa5d 100644 --- a/src/api/resources/merchants/client/requests/GetMerchantsRequest.ts +++ b/src/api/resources/merchants/client/requests/GetMerchantsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/merchants/client/requests/ListMerchantsRequest.ts b/src/api/resources/merchants/client/requests/ListMerchantsRequest.ts index 4384cd6a0..a7cbfe78b 100644 --- a/src/api/resources/merchants/client/requests/ListMerchantsRequest.ts +++ b/src/api/resources/merchants/client/requests/ListMerchantsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface ListMerchantsRequest { - /** The cursor generated by the previous response. */ + /** + * The cursor generated by the previous response. + */ cursor?: number | null; } diff --git a/src/api/resources/merchants/client/requests/index.ts b/src/api/resources/merchants/client/requests/index.ts index e6af5de78..0569efc51 100644 --- a/src/api/resources/merchants/client/requests/index.ts +++ b/src/api/resources/merchants/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { GetMerchantsRequest } from "./GetMerchantsRequest"; -export type { ListMerchantsRequest } from "./ListMerchantsRequest"; +export { type ListMerchantsRequest } from "./ListMerchantsRequest"; +export { type GetMerchantsRequest } from "./GetMerchantsRequest"; diff --git a/src/api/resources/merchants/resources/customAttributeDefinitions/client/Client.ts b/src/api/resources/merchants/resources/customAttributeDefinitions/client/Client.ts index d220083af..a95242ab2 100644 --- a/src/api/resources/merchants/resources/customAttributeDefinitions/client/Client.ts +++ b/src/api/resources/merchants/resources/customAttributeDefinitions/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; +import * as serializers from "../../../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; -import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; -export declare namespace CustomAttributeDefinitionsClient { - export interface Options extends BaseClientOptions {} +export declare namespace CustomAttributeDefinitions { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class CustomAttributeDefinitionsClient { - protected readonly _options: CustomAttributeDefinitionsClient.Options; +export class CustomAttributeDefinitions { + protected readonly _options: CustomAttributeDefinitions.Options; - constructor(options: CustomAttributeDefinitionsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: CustomAttributeDefinitions.Options = {}) { + this._options = _options; } /** @@ -29,7 +50,7 @@ export class CustomAttributeDefinitionsClient { * applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.merchants.ListCustomAttributeDefinitionsRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.merchants.customAttributeDefinitions.list({ @@ -40,8 +61,8 @@ export class CustomAttributeDefinitionsClient { */ public async list( request: Square.merchants.ListCustomAttributeDefinitionsRequest = {}, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, - ): Promise> { + requestOptions?: CustomAttributeDefinitions.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.merchants.ListCustomAttributeDefinitionsRequest, @@ -49,25 +70,17 @@ export class CustomAttributeDefinitionsClient { const { visibilityFilter, limit, cursor } = request; const _queryParams: Record = {}; if (visibilityFilter !== undefined) { - _queryParams.visibility_filter = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { + _queryParams["visibility_filter"] = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -76,13 +89,19 @@ export class CustomAttributeDefinitionsClient { "v2/merchants/custom-attribute-definitions", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -123,7 +142,10 @@ export class CustomAttributeDefinitionsClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable< + Square.ListMerchantCustomAttributeDefinitionsResponse, + Square.CustomAttributeDefinition + >({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -145,7 +167,7 @@ export class CustomAttributeDefinitionsClient { * to set the custom attribute for a merchant. * * @param {Square.merchants.CreateMerchantCustomAttributeDefinitionRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.merchants.customAttributeDefinitions.create({ @@ -162,23 +184,15 @@ export class CustomAttributeDefinitionsClient { */ public create( request: Square.merchants.CreateMerchantCustomAttributeDefinitionRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.merchants.CreateMerchantCustomAttributeDefinitionRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -187,19 +201,23 @@ export class CustomAttributeDefinitionsClient { "v2/merchants/custom-attribute-definitions", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.merchants.CreateMerchantCustomAttributeDefinitionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -247,7 +265,7 @@ export class CustomAttributeDefinitionsClient { * setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.merchants.GetCustomAttributeDefinitionsRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.merchants.customAttributeDefinitions.get({ @@ -257,44 +275,41 @@ export class CustomAttributeDefinitionsClient { */ public get( request: Square.merchants.GetCustomAttributeDefinitionsRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.merchants.GetCustomAttributeDefinitionsRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key, version } = request; const _queryParams: Record = {}; if (version !== undefined) { - _queryParams.version = version?.toString() ?? null; + _queryParams["version"] = version?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/merchants/custom-attribute-definitions/${core.url.encodePathParam(key)}`, + `v2/merchants/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -343,7 +358,7 @@ export class CustomAttributeDefinitionsClient { * Only the definition owner can update a custom attribute definition. * * @param {Square.merchants.UpdateMerchantCustomAttributeDefinitionRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.merchants.customAttributeDefinitions.update({ @@ -356,45 +371,41 @@ export class CustomAttributeDefinitionsClient { */ public update( request: Square.merchants.UpdateMerchantCustomAttributeDefinitionRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); } private async __update( request: Square.merchants.UpdateMerchantCustomAttributeDefinitionRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/merchants/custom-attribute-definitions/${core.url.encodePathParam(key)}`, + `v2/merchants/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.merchants.UpdateMerchantCustomAttributeDefinitionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -443,7 +454,7 @@ export class CustomAttributeDefinitionsClient { * Only the definition owner can delete a custom attribute definition. * * @param {Square.merchants.DeleteCustomAttributeDefinitionsRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.merchants.customAttributeDefinitions.delete({ @@ -452,39 +463,35 @@ export class CustomAttributeDefinitionsClient { */ public delete( request: Square.merchants.DeleteCustomAttributeDefinitionsRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); } private async __delete( request: Square.merchants.DeleteCustomAttributeDefinitionsRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/merchants/custom-attribute-definitions/${core.url.encodePathParam(key)}`, + `v2/merchants/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -527,7 +534,7 @@ export class CustomAttributeDefinitionsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/merchants/resources/customAttributeDefinitions/client/index.ts b/src/api/resources/merchants/resources/customAttributeDefinitions/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/merchants/resources/customAttributeDefinitions/client/index.ts +++ b/src/api/resources/merchants/resources/customAttributeDefinitions/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/CreateMerchantCustomAttributeDefinitionRequest.ts b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/CreateMerchantCustomAttributeDefinitionRequest.ts index 59e348b65..572fe7378 100644 --- a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/CreateMerchantCustomAttributeDefinitionRequest.ts +++ b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/CreateMerchantCustomAttributeDefinitionRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts index a9c9d9ec5..6a1b34cf1 100644 --- a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface DeleteCustomAttributeDefinitionsRequest { - /** The key of the custom attribute definition to delete. */ + /** + * The key of the custom attribute definition to delete. + */ key: string; } diff --git a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts index 3de83fd32..e4c05d712 100644 --- a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts index 94eb07f3c..4818482a3 100644 --- a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -11,7 +13,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface ListCustomAttributeDefinitionsRequest { - /** Filters the `CustomAttributeDefinition` results by their `visibility` values. */ + /** + * Filters the `CustomAttributeDefinition` results by their `visibility` values. + */ visibilityFilter?: Square.VisibilityFilter | null; /** * The maximum number of results to return in a single paged response. This limit is advisory. diff --git a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/UpdateMerchantCustomAttributeDefinitionRequest.ts b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/UpdateMerchantCustomAttributeDefinitionRequest.ts index fa6bc87f8..16bfd1215 100644 --- a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/UpdateMerchantCustomAttributeDefinitionRequest.ts +++ b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/UpdateMerchantCustomAttributeDefinitionRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -13,7 +15,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface UpdateMerchantCustomAttributeDefinitionRequest { - /** The key of the custom attribute definition to update. */ + /** + * The key of the custom attribute definition to update. + */ key: string; /** * The custom attribute definition that contains the fields to update. This endpoint diff --git a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/index.ts b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/index.ts index 2eb218115..eb8078803 100644 --- a/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/index.ts +++ b/src/api/resources/merchants/resources/customAttributeDefinitions/client/requests/index.ts @@ -1,5 +1,5 @@ -export type { CreateMerchantCustomAttributeDefinitionRequest } from "./CreateMerchantCustomAttributeDefinitionRequest"; -export type { DeleteCustomAttributeDefinitionsRequest } from "./DeleteCustomAttributeDefinitionsRequest"; -export type { GetCustomAttributeDefinitionsRequest } from "./GetCustomAttributeDefinitionsRequest"; -export type { ListCustomAttributeDefinitionsRequest } from "./ListCustomAttributeDefinitionsRequest"; -export type { UpdateMerchantCustomAttributeDefinitionRequest } from "./UpdateMerchantCustomAttributeDefinitionRequest"; +export { type ListCustomAttributeDefinitionsRequest } from "./ListCustomAttributeDefinitionsRequest"; +export { type CreateMerchantCustomAttributeDefinitionRequest } from "./CreateMerchantCustomAttributeDefinitionRequest"; +export { type GetCustomAttributeDefinitionsRequest } from "./GetCustomAttributeDefinitionsRequest"; +export { type UpdateMerchantCustomAttributeDefinitionRequest } from "./UpdateMerchantCustomAttributeDefinitionRequest"; +export { type DeleteCustomAttributeDefinitionsRequest } from "./DeleteCustomAttributeDefinitionsRequest"; diff --git a/src/api/resources/merchants/resources/customAttributes/client/Client.ts b/src/api/resources/merchants/resources/customAttributes/client/Client.ts index 4284a3da1..43a23a854 100644 --- a/src/api/resources/merchants/resources/customAttributes/client/Client.ts +++ b/src/api/resources/merchants/resources/customAttributes/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace CustomAttributesClient { - export interface Options extends BaseClientOptions {} +export declare namespace CustomAttributes { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class CustomAttributesClient { - protected readonly _options: CustomAttributesClient.Options; +export class CustomAttributes { + protected readonly _options: CustomAttributes.Options; - constructor(options: CustomAttributesClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: CustomAttributes.Options = {}) { + this._options = _options; } /** @@ -28,7 +49,7 @@ export class CustomAttributesClient { * `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.merchants.BulkDeleteMerchantCustomAttributesRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.merchants.customAttributes.batchDelete({ @@ -44,23 +65,15 @@ export class CustomAttributesClient { */ public batchDelete( request: Square.merchants.BulkDeleteMerchantCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__batchDelete(request, requestOptions)); } private async __batchDelete( request: Square.merchants.BulkDeleteMerchantCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -69,19 +82,23 @@ export class CustomAttributesClient { "v2/merchants/custom-attributes/bulk-delete", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.merchants.BulkDeleteMerchantCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -136,7 +153,7 @@ export class CustomAttributesClient { * must be `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.merchants.BulkUpsertMerchantCustomAttributesRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.merchants.customAttributes.batchUpsert({ @@ -160,23 +177,15 @@ export class CustomAttributesClient { */ public batchUpsert( request: Square.merchants.BulkUpsertMerchantCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__batchUpsert(request, requestOptions)); } private async __batchUpsert( request: Square.merchants.BulkUpsertMerchantCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -185,19 +194,23 @@ export class CustomAttributesClient { "v2/merchants/custom-attributes/bulk-upsert", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.merchants.BulkUpsertMerchantCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -248,7 +261,7 @@ export class CustomAttributesClient { * and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.merchants.ListCustomAttributesRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.merchants.customAttributes.list({ @@ -261,8 +274,8 @@ export class CustomAttributesClient { */ public async list( request: Square.merchants.ListCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, - ): Promise> { + requestOptions?: CustomAttributes.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.merchants.ListCustomAttributesRequest, @@ -270,43 +283,41 @@ export class CustomAttributesClient { const { merchantId, visibilityFilter, limit, cursor, withDefinitions } = request; const _queryParams: Record = {}; if (visibilityFilter !== undefined) { - _queryParams.visibility_filter = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { + _queryParams["visibility_filter"] = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (withDefinitions !== undefined) { - _queryParams.with_definitions = withDefinitions?.toString() ?? null; + _queryParams["with_definitions"] = withDefinitions?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/merchants/${core.url.encodePathParam(merchantId)}/custom-attributes`, + `v2/merchants/${encodeURIComponent(merchantId)}/custom-attributes`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -347,7 +358,7 @@ export class CustomAttributesClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -367,7 +378,7 @@ export class CustomAttributesClient { * `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.merchants.GetCustomAttributesRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.merchants.customAttributes.get({ @@ -379,48 +390,45 @@ export class CustomAttributesClient { */ public get( request: Square.merchants.GetCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.merchants.GetCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { merchantId, key, withDefinition, version } = request; const _queryParams: Record = {}; if (withDefinition !== undefined) { - _queryParams.with_definition = withDefinition?.toString() ?? null; + _queryParams["with_definition"] = withDefinition?.toString() ?? null; } if (version !== undefined) { - _queryParams.version = version?.toString() ?? null; + _queryParams["version"] = version?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/merchants/${core.url.encodePathParam(merchantId)}/custom-attributes/${core.url.encodePathParam(key)}`, + `v2/merchants/${encodeURIComponent(merchantId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -471,7 +479,7 @@ export class CustomAttributesClient { * must be `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.merchants.UpsertMerchantCustomAttributeRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.merchants.customAttributes.upsert({ @@ -484,45 +492,41 @@ export class CustomAttributesClient { */ public upsert( request: Square.merchants.UpsertMerchantCustomAttributeRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__upsert(request, requestOptions)); } private async __upsert( request: Square.merchants.UpsertMerchantCustomAttributeRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { merchantId, key, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/merchants/${core.url.encodePathParam(merchantId)}/custom-attributes/${core.url.encodePathParam(key)}`, + `v2/merchants/${encodeURIComponent(merchantId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.merchants.UpsertMerchantCustomAttributeRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -570,7 +574,7 @@ export class CustomAttributesClient { * `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.merchants.DeleteCustomAttributesRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.merchants.customAttributes.delete({ @@ -580,39 +584,35 @@ export class CustomAttributesClient { */ public delete( request: Square.merchants.DeleteCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); } private async __delete( request: Square.merchants.DeleteCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { merchantId, key } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/merchants/${core.url.encodePathParam(merchantId)}/custom-attributes/${core.url.encodePathParam(key)}`, + `v2/merchants/${encodeURIComponent(merchantId)}/custom-attributes/${encodeURIComponent(key)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -655,7 +655,7 @@ export class CustomAttributesClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/merchants/resources/customAttributes/client/index.ts b/src/api/resources/merchants/resources/customAttributes/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/merchants/resources/customAttributes/client/index.ts +++ b/src/api/resources/merchants/resources/customAttributes/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/merchants/resources/customAttributes/client/requests/BulkDeleteMerchantCustomAttributesRequest.ts b/src/api/resources/merchants/resources/customAttributes/client/requests/BulkDeleteMerchantCustomAttributesRequest.ts index 891f56741..08cb2ddaf 100644 --- a/src/api/resources/merchants/resources/customAttributes/client/requests/BulkDeleteMerchantCustomAttributesRequest.ts +++ b/src/api/resources/merchants/resources/customAttributes/client/requests/BulkDeleteMerchantCustomAttributesRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/merchants/resources/customAttributes/client/requests/BulkUpsertMerchantCustomAttributesRequest.ts b/src/api/resources/merchants/resources/customAttributes/client/requests/BulkUpsertMerchantCustomAttributesRequest.ts index c9c06a5f6..2c267173d 100644 --- a/src/api/resources/merchants/resources/customAttributes/client/requests/BulkUpsertMerchantCustomAttributesRequest.ts +++ b/src/api/resources/merchants/resources/customAttributes/client/requests/BulkUpsertMerchantCustomAttributesRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/merchants/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts b/src/api/resources/merchants/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts index 2a0418363..ad30e0e56 100644 --- a/src/api/resources/merchants/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts +++ b/src/api/resources/merchants/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,7 +10,9 @@ * } */ export interface DeleteCustomAttributesRequest { - /** The ID of the target [merchant](entity:Merchant). */ + /** + * The ID of the target [merchant](entity:Merchant). + */ merchantId: string; /** * The key of the custom attribute to delete. This key must match the `key` of a custom diff --git a/src/api/resources/merchants/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts b/src/api/resources/merchants/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts index a1349d1ea..ddedc056e 100644 --- a/src/api/resources/merchants/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts +++ b/src/api/resources/merchants/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -10,7 +12,9 @@ * } */ export interface GetCustomAttributesRequest { - /** The ID of the target [merchant](entity:Merchant). */ + /** + * The ID of the target [merchant](entity:Merchant). + */ merchantId: string; /** * The key of the custom attribute to retrieve. This key must match the `key` of a custom diff --git a/src/api/resources/merchants/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts b/src/api/resources/merchants/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts index fe86aa3f0..649e8a162 100644 --- a/src/api/resources/merchants/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts +++ b/src/api/resources/merchants/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -13,9 +15,13 @@ import type * as Square from "../../../../../../index"; * } */ export interface ListCustomAttributesRequest { - /** The ID of the target [merchant](entity:Merchant). */ + /** + * The ID of the target [merchant](entity:Merchant). + */ merchantId: string; - /** Filters the `CustomAttributeDefinition` results by their `visibility` values. */ + /** + * Filters the `CustomAttributeDefinition` results by their `visibility` values. + */ visibilityFilter?: Square.VisibilityFilter | null; /** * The maximum number of results to return in a single paged response. This limit is advisory. diff --git a/src/api/resources/merchants/resources/customAttributes/client/requests/UpsertMerchantCustomAttributeRequest.ts b/src/api/resources/merchants/resources/customAttributes/client/requests/UpsertMerchantCustomAttributeRequest.ts index dedd481d3..b798742bf 100644 --- a/src/api/resources/merchants/resources/customAttributes/client/requests/UpsertMerchantCustomAttributeRequest.ts +++ b/src/api/resources/merchants/resources/customAttributes/client/requests/UpsertMerchantCustomAttributeRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -13,7 +15,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface UpsertMerchantCustomAttributeRequest { - /** The ID of the target [merchant](entity:Merchant). */ + /** + * The ID of the target [merchant](entity:Merchant). + */ merchantId: string; /** * The key of the custom attribute to create or update. This key must match the `key` of a diff --git a/src/api/resources/merchants/resources/customAttributes/client/requests/index.ts b/src/api/resources/merchants/resources/customAttributes/client/requests/index.ts index 6beabaad1..0f91a2b02 100644 --- a/src/api/resources/merchants/resources/customAttributes/client/requests/index.ts +++ b/src/api/resources/merchants/resources/customAttributes/client/requests/index.ts @@ -1,6 +1,6 @@ -export type { BulkDeleteMerchantCustomAttributesRequest } from "./BulkDeleteMerchantCustomAttributesRequest"; -export type { BulkUpsertMerchantCustomAttributesRequest } from "./BulkUpsertMerchantCustomAttributesRequest"; -export type { DeleteCustomAttributesRequest } from "./DeleteCustomAttributesRequest"; -export type { GetCustomAttributesRequest } from "./GetCustomAttributesRequest"; -export type { ListCustomAttributesRequest } from "./ListCustomAttributesRequest"; -export type { UpsertMerchantCustomAttributeRequest } from "./UpsertMerchantCustomAttributeRequest"; +export { type BulkDeleteMerchantCustomAttributesRequest } from "./BulkDeleteMerchantCustomAttributesRequest"; +export { type BulkUpsertMerchantCustomAttributesRequest } from "./BulkUpsertMerchantCustomAttributesRequest"; +export { type ListCustomAttributesRequest } from "./ListCustomAttributesRequest"; +export { type GetCustomAttributesRequest } from "./GetCustomAttributesRequest"; +export { type UpsertMerchantCustomAttributeRequest } from "./UpsertMerchantCustomAttributeRequest"; +export { type DeleteCustomAttributesRequest } from "./DeleteCustomAttributesRequest"; diff --git a/src/api/resources/merchants/resources/index.ts b/src/api/resources/merchants/resources/index.ts index 96153bc82..bfa7c90b7 100644 --- a/src/api/resources/merchants/resources/index.ts +++ b/src/api/resources/merchants/resources/index.ts @@ -1,4 +1,4 @@ export * as customAttributeDefinitions from "./customAttributeDefinitions"; -export * from "./customAttributeDefinitions/client/requests"; export * as customAttributes from "./customAttributes"; +export * from "./customAttributeDefinitions/client/requests"; export * from "./customAttributes/client/requests"; diff --git a/src/api/resources/mobile/client/Client.ts b/src/api/resources/mobile/client/Client.ts index e2c4a0e6c..c14e0e942 100644 --- a/src/api/resources/mobile/client/Client.ts +++ b/src/api/resources/mobile/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; +import * as errors from "../../../../errors/index"; -export declare namespace MobileClient { - export interface Options extends BaseClientOptions {} +export declare namespace Mobile { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class MobileClient { - protected readonly _options: MobileClient.Options; +export class Mobile { + protected readonly _options: Mobile.Options; - constructor(options: MobileClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Mobile.Options = {}) { + this._options = _options; } /** @@ -40,7 +61,7 @@ export class MobileClient { * [valid production authorization credential](https://developer.squareup.com/docs/build-basics/access-tokens). * * @param {Square.CreateMobileAuthorizationCodeRequest} request - * @param {MobileClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Mobile.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.mobile.authorizationCode({ @@ -49,23 +70,15 @@ export class MobileClient { */ public authorizationCode( request: Square.CreateMobileAuthorizationCodeRequest = {}, - requestOptions?: MobileClient.RequestOptions, + requestOptions?: Mobile.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__authorizationCode(request, requestOptions)); } private async __authorizationCode( request: Square.CreateMobileAuthorizationCodeRequest = {}, - requestOptions?: MobileClient.RequestOptions, + requestOptions?: Mobile.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -74,19 +87,23 @@ export class MobileClient { "mobile/authorization-code", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateMobileAuthorizationCodeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -127,7 +144,7 @@ export class MobileClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/mobile/client/index.ts b/src/api/resources/mobile/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/mobile/client/index.ts +++ b/src/api/resources/mobile/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/mobile/client/requests/CreateMobileAuthorizationCodeRequest.ts b/src/api/resources/mobile/client/requests/CreateMobileAuthorizationCodeRequest.ts index df2769fdb..3620d5786 100644 --- a/src/api/resources/mobile/client/requests/CreateMobileAuthorizationCodeRequest.ts +++ b/src/api/resources/mobile/client/requests/CreateMobileAuthorizationCodeRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/mobile/client/requests/index.ts b/src/api/resources/mobile/client/requests/index.ts index 45b5f1dc6..1d310fdf0 100644 --- a/src/api/resources/mobile/client/requests/index.ts +++ b/src/api/resources/mobile/client/requests/index.ts @@ -1 +1 @@ -export type { CreateMobileAuthorizationCodeRequest } from "./CreateMobileAuthorizationCodeRequest"; +export { type CreateMobileAuthorizationCodeRequest } from "./CreateMobileAuthorizationCodeRequest"; diff --git a/src/api/resources/oAuth/client/Client.ts b/src/api/resources/oAuth/client/Client.ts index e5078aa95..8e3a31fc5 100644 --- a/src/api/resources/oAuth/client/Client.ts +++ b/src/api/resources/oAuth/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; +import * as errors from "../../../../errors/index"; -export declare namespace OAuthClient { - export interface Options extends BaseClientOptions {} +export declare namespace OAuth { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class OAuthClient { - protected readonly _options: OAuthClient.Options; +export class OAuth { + protected readonly _options: OAuth.Options; - constructor(options: OAuthClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: OAuth.Options = {}) { + this._options = _options; } /** @@ -39,7 +60,7 @@ export class OAuthClient { * page for your application in the Developer Dashboard. * * @param {Square.RevokeTokenRequest} request - * @param {OAuthClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {OAuth.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.oAuth.revokeToken({ @@ -49,23 +70,15 @@ export class OAuthClient { */ public revokeToken( request: Square.RevokeTokenRequest = {}, - requestOptions?: OAuthClient.RequestOptions, + requestOptions?: OAuth.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__revokeToken(request, requestOptions)); } private async __revokeToken( request: Square.RevokeTokenRequest = {}, - requestOptions?: OAuthClient.RequestOptions, + requestOptions?: OAuth.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -74,19 +87,23 @@ export class OAuthClient { "oauth2/revoke", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.RevokeTokenRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -150,7 +167,7 @@ export class OAuthClient { * Application clients should never interact directly with OAuth tokens. * * @param {Square.ObtainTokenRequest} request - * @param {OAuthClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {OAuth.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.oAuth.obtainToken({ @@ -162,20 +179,15 @@ export class OAuthClient { */ public obtainToken( request: Square.ObtainTokenRequest, - requestOptions?: OAuthClient.RequestOptions, + requestOptions?: OAuth.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__obtainToken(request, requestOptions)); } private async __obtainToken( request: Square.ObtainTokenRequest, - requestOptions?: OAuthClient.RequestOptions, + requestOptions?: OAuth.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ "Square-Version": requestOptions?.version ?? "2025-10-16" }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -184,19 +196,23 @@ export class OAuthClient { "oauth2/token", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.ObtainTokenRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -252,28 +268,20 @@ export class OAuthClient { * * If the access token is expired or not a valid access token, the endpoint returns an `UNAUTHORIZED` error. * - * @param {OAuthClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {OAuth.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.oAuth.retrieveTokenStatus() */ public retrieveTokenStatus( - requestOptions?: OAuthClient.RequestOptions, + requestOptions?: OAuth.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__retrieveTokenStatus(requestOptions)); } private async __retrieveTokenStatus( - requestOptions?: OAuthClient.RequestOptions, + requestOptions?: OAuth.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -282,13 +290,17 @@ export class OAuthClient { "oauth2/token/status", ), method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -329,21 +341,16 @@ export class OAuthClient { } /** - * @param {OAuthClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {OAuth.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.oAuth.authorize() */ - public authorize(requestOptions?: OAuthClient.RequestOptions): core.HttpResponsePromise { + public authorize(requestOptions?: OAuth.RequestOptions): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__authorize(requestOptions)); } - private async __authorize(requestOptions?: OAuthClient.RequestOptions): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ "Square-Version": requestOptions?.version ?? "2025-10-16" }), - requestOptions?.headers, - ); + private async __authorize(requestOptions?: OAuth.RequestOptions): Promise> { const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -352,13 +359,17 @@ export class OAuthClient { "oauth2/authorize", ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { data: undefined, rawResponse: _response.rawResponse }; @@ -390,7 +401,7 @@ export class OAuthClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/oAuth/client/index.ts b/src/api/resources/oAuth/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/oAuth/client/index.ts +++ b/src/api/resources/oAuth/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/oAuth/client/requests/ObtainTokenRequest.ts b/src/api/resources/oAuth/client/requests/ObtainTokenRequest.ts index 3c64b3297..3d744b592 100644 --- a/src/api/resources/oAuth/client/requests/ObtainTokenRequest.ts +++ b/src/api/resources/oAuth/client/requests/ObtainTokenRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/oAuth/client/requests/RevokeTokenRequest.ts b/src/api/resources/oAuth/client/requests/RevokeTokenRequest.ts index 2c5233f71..206891192 100644 --- a/src/api/resources/oAuth/client/requests/RevokeTokenRequest.ts +++ b/src/api/resources/oAuth/client/requests/RevokeTokenRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/oAuth/client/requests/index.ts b/src/api/resources/oAuth/client/requests/index.ts index c1616cd4a..b92160be5 100644 --- a/src/api/resources/oAuth/client/requests/index.ts +++ b/src/api/resources/oAuth/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { ObtainTokenRequest } from "./ObtainTokenRequest"; -export type { RevokeTokenRequest } from "./RevokeTokenRequest"; +export { type RevokeTokenRequest } from "./RevokeTokenRequest"; +export { type ObtainTokenRequest } from "./ObtainTokenRequest"; diff --git a/src/api/resources/orders/client/Client.ts b/src/api/resources/orders/client/Client.ts index f274686c4..233b506aa 100644 --- a/src/api/resources/orders/client/Client.ts +++ b/src/api/resources/orders/client/Client.ts @@ -1,37 +1,58 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; -import { CustomAttributeDefinitionsClient } from "../resources/customAttributeDefinitions/client/Client"; -import { CustomAttributesClient } from "../resources/customAttributes/client/Client"; - -export declare namespace OrdersClient { - export interface Options extends BaseClientOptions {} +import * as errors from "../../../../errors/index"; +import { CustomAttributeDefinitions } from "../resources/customAttributeDefinitions/client/Client"; +import { CustomAttributes } from "../resources/customAttributes/client/Client"; + +export declare namespace Orders { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class OrdersClient { - protected readonly _options: OrdersClient.Options; - protected _customAttributeDefinitions: CustomAttributeDefinitionsClient | undefined; - protected _customAttributes: CustomAttributesClient | undefined; +export class Orders { + protected readonly _options: Orders.Options; + protected _customAttributeDefinitions: CustomAttributeDefinitions | undefined; + protected _customAttributes: CustomAttributes | undefined; - constructor(options: OrdersClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Orders.Options = {}) { + this._options = _options; } - public get customAttributeDefinitions(): CustomAttributeDefinitionsClient { - return (this._customAttributeDefinitions ??= new CustomAttributeDefinitionsClient(this._options)); + public get customAttributeDefinitions(): CustomAttributeDefinitions { + return (this._customAttributeDefinitions ??= new CustomAttributeDefinitions(this._options)); } - public get customAttributes(): CustomAttributesClient { - return (this._customAttributes ??= new CustomAttributesClient(this._options)); + public get customAttributes(): CustomAttributes { + return (this._customAttributes ??= new CustomAttributes(this._options)); } /** @@ -44,7 +65,7 @@ export class OrdersClient { * You can modify open orders using the [UpdateOrder](api-endpoint:Orders-UpdateOrder) endpoint. * * @param {Square.CreateOrderRequest} request - * @param {OrdersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Orders.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.orders.create({ @@ -98,23 +119,15 @@ export class OrdersClient { */ public create( request: Square.CreateOrderRequest, - requestOptions?: OrdersClient.RequestOptions, + requestOptions?: Orders.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.CreateOrderRequest, - requestOptions?: OrdersClient.RequestOptions, + requestOptions?: Orders.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -123,19 +136,23 @@ export class OrdersClient { "v2/orders", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateOrderRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -181,7 +198,7 @@ export class OrdersClient { * If a given order ID does not exist, the ID is ignored instead of generating an error. * * @param {Square.BatchGetOrdersRequest} request - * @param {OrdersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Orders.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.orders.batchGet({ @@ -191,23 +208,15 @@ export class OrdersClient { */ public batchGet( request: Square.BatchGetOrdersRequest, - requestOptions?: OrdersClient.RequestOptions, + requestOptions?: Orders.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__batchGet(request, requestOptions)); } private async __batchGet( request: Square.BatchGetOrdersRequest, - requestOptions?: OrdersClient.RequestOptions, + requestOptions?: Orders.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -216,19 +225,23 @@ export class OrdersClient { "v2/orders/batch-retrieve", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchGetOrdersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -272,7 +285,7 @@ export class OrdersClient { * Enables applications to preview order pricing without creating an order. * * @param {Square.CalculateOrderRequest} request - * @param {OrdersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Orders.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.orders.calculate({ @@ -303,23 +316,15 @@ export class OrdersClient { */ public calculate( request: Square.CalculateOrderRequest, - requestOptions?: OrdersClient.RequestOptions, + requestOptions?: Orders.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__calculate(request, requestOptions)); } private async __calculate( request: Square.CalculateOrderRequest, - requestOptions?: OrdersClient.RequestOptions, + requestOptions?: Orders.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -328,19 +333,23 @@ export class OrdersClient { "v2/orders/calculate", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CalculateOrderRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -385,7 +394,7 @@ export class OrdersClient { * only the core fields (such as line items, taxes, and discounts) copied from the original order. * * @param {Square.CloneOrderRequest} request - * @param {OrdersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Orders.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.orders.clone({ @@ -396,23 +405,15 @@ export class OrdersClient { */ public clone( request: Square.CloneOrderRequest, - requestOptions?: OrdersClient.RequestOptions, + requestOptions?: Orders.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__clone(request, requestOptions)); } private async __clone( request: Square.CloneOrderRequest, - requestOptions?: OrdersClient.RequestOptions, + requestOptions?: Orders.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -421,19 +422,23 @@ export class OrdersClient { "v2/orders/clone", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CloneOrderRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -493,7 +498,7 @@ export class OrdersClient { * not the time it was subsequently transmitted to Square. * * @param {Square.SearchOrdersRequest} request - * @param {OrdersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Orders.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.orders.search({ @@ -521,23 +526,15 @@ export class OrdersClient { */ public search( request: Square.SearchOrdersRequest = {}, - requestOptions?: OrdersClient.RequestOptions, + requestOptions?: Orders.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__search(request, requestOptions)); } private async __search( request: Square.SearchOrdersRequest = {}, - requestOptions?: OrdersClient.RequestOptions, + requestOptions?: Orders.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -546,19 +543,23 @@ export class OrdersClient { "v2/orders/search", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchOrdersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -602,7 +603,7 @@ export class OrdersClient { * Retrieves an [Order](entity:Order) by ID. * * @param {Square.GetOrdersRequest} request - * @param {OrdersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Orders.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.orders.get({ @@ -611,39 +612,35 @@ export class OrdersClient { */ public get( request: Square.GetOrdersRequest, - requestOptions?: OrdersClient.RequestOptions, + requestOptions?: Orders.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.GetOrdersRequest, - requestOptions?: OrdersClient.RequestOptions, + requestOptions?: Orders.RequestOptions, ): Promise> { const { orderId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/orders/${core.url.encodePathParam(orderId)}`, + `v2/orders/${encodeURIComponent(orderId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -701,7 +698,7 @@ export class OrdersClient { * [Pay for Orders](https://developer.squareup.com/docs/orders-api/pay-for-orders). * * @param {Square.UpdateOrderRequest} request - * @param {OrdersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Orders.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.orders.update({ @@ -725,45 +722,41 @@ export class OrdersClient { */ public update( request: Square.UpdateOrderRequest, - requestOptions?: OrdersClient.RequestOptions, + requestOptions?: Orders.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); } private async __update( request: Square.UpdateOrderRequest, - requestOptions?: OrdersClient.RequestOptions, + requestOptions?: Orders.RequestOptions, ): Promise> { const { orderId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/orders/${core.url.encodePathParam(orderId)}`, + `v2/orders/${encodeURIComponent(orderId)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateOrderRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -820,7 +813,7 @@ export class OrdersClient { * Using a delayed capture payment with `PayOrder` completes the approved payment. * * @param {Square.PayOrderRequest} request - * @param {OrdersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Orders.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.orders.pay({ @@ -831,45 +824,41 @@ export class OrdersClient { */ public pay( request: Square.PayOrderRequest, - requestOptions?: OrdersClient.RequestOptions, + requestOptions?: Orders.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__pay(request, requestOptions)); } private async __pay( request: Square.PayOrderRequest, - requestOptions?: OrdersClient.RequestOptions, + requestOptions?: Orders.RequestOptions, ): Promise> { const { orderId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/orders/${core.url.encodePathParam(orderId)}/pay`, + `v2/orders/${encodeURIComponent(orderId)}/pay`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.PayOrderRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -910,7 +899,7 @@ export class OrdersClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/orders/client/index.ts b/src/api/resources/orders/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/orders/client/index.ts +++ b/src/api/resources/orders/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/orders/client/requests/BatchGetOrdersRequest.ts b/src/api/resources/orders/client/requests/BatchGetOrdersRequest.ts index db430befb..96c31a8df 100644 --- a/src/api/resources/orders/client/requests/BatchGetOrdersRequest.ts +++ b/src/api/resources/orders/client/requests/BatchGetOrdersRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/orders/client/requests/CalculateOrderRequest.ts b/src/api/resources/orders/client/requests/CalculateOrderRequest.ts index 72acd888f..419083fa9 100644 --- a/src/api/resources/orders/client/requests/CalculateOrderRequest.ts +++ b/src/api/resources/orders/client/requests/CalculateOrderRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/orders/client/requests/CloneOrderRequest.ts b/src/api/resources/orders/client/requests/CloneOrderRequest.ts index d1676b241..e246451d0 100644 --- a/src/api/resources/orders/client/requests/CloneOrderRequest.ts +++ b/src/api/resources/orders/client/requests/CloneOrderRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/orders/client/requests/GetOrdersRequest.ts b/src/api/resources/orders/client/requests/GetOrdersRequest.ts index cf3a837fc..9d225211b 100644 --- a/src/api/resources/orders/client/requests/GetOrdersRequest.ts +++ b/src/api/resources/orders/client/requests/GetOrdersRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetOrdersRequest { - /** The ID of the order to retrieve. */ + /** + * The ID of the order to retrieve. + */ orderId: string; } diff --git a/src/api/resources/orders/client/requests/PayOrderRequest.ts b/src/api/resources/orders/client/requests/PayOrderRequest.ts index c6be66861..3d74c7950 100644 --- a/src/api/resources/orders/client/requests/PayOrderRequest.ts +++ b/src/api/resources/orders/client/requests/PayOrderRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -9,7 +11,9 @@ * } */ export interface PayOrderRequest { - /** The ID of the order being paid. */ + /** + * The ID of the order being paid. + */ orderId: string; /** * A value you specify that uniquely identifies this request among requests you have sent. If diff --git a/src/api/resources/orders/client/requests/SearchOrdersRequest.ts b/src/api/resources/orders/client/requests/SearchOrdersRequest.ts index b5b42759a..5313f9d5d 100644 --- a/src/api/resources/orders/client/requests/SearchOrdersRequest.ts +++ b/src/api/resources/orders/client/requests/SearchOrdersRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/orders/client/requests/UpdateOrderRequest.ts b/src/api/resources/orders/client/requests/UpdateOrderRequest.ts index 519b32538..effc16634 100644 --- a/src/api/resources/orders/client/requests/UpdateOrderRequest.ts +++ b/src/api/resources/orders/client/requests/UpdateOrderRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -24,7 +26,9 @@ import type * as Square from "../../../../index"; * } */ export interface UpdateOrderRequest { - /** The ID of the order to update. */ + /** + * The ID of the order to update. + */ orderId: string; /** * The [sparse order](https://developer.squareup.com/docs/orders-api/manage-orders/update-orders#sparse-order-objects) diff --git a/src/api/resources/orders/client/requests/index.ts b/src/api/resources/orders/client/requests/index.ts index c9b77cc8d..f9f9976ef 100644 --- a/src/api/resources/orders/client/requests/index.ts +++ b/src/api/resources/orders/client/requests/index.ts @@ -1,7 +1,7 @@ -export type { BatchGetOrdersRequest } from "./BatchGetOrdersRequest"; -export type { CalculateOrderRequest } from "./CalculateOrderRequest"; -export type { CloneOrderRequest } from "./CloneOrderRequest"; -export type { GetOrdersRequest } from "./GetOrdersRequest"; -export type { PayOrderRequest } from "./PayOrderRequest"; -export type { SearchOrdersRequest } from "./SearchOrdersRequest"; -export type { UpdateOrderRequest } from "./UpdateOrderRequest"; +export { type BatchGetOrdersRequest } from "./BatchGetOrdersRequest"; +export { type CalculateOrderRequest } from "./CalculateOrderRequest"; +export { type CloneOrderRequest } from "./CloneOrderRequest"; +export { type SearchOrdersRequest } from "./SearchOrdersRequest"; +export { type GetOrdersRequest } from "./GetOrdersRequest"; +export { type UpdateOrderRequest } from "./UpdateOrderRequest"; +export { type PayOrderRequest } from "./PayOrderRequest"; diff --git a/src/api/resources/orders/resources/customAttributeDefinitions/client/Client.ts b/src/api/resources/orders/resources/customAttributeDefinitions/client/Client.ts index ae99a3bbe..eb5416777 100644 --- a/src/api/resources/orders/resources/customAttributeDefinitions/client/Client.ts +++ b/src/api/resources/orders/resources/customAttributeDefinitions/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; +import * as serializers from "../../../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; -import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; -export declare namespace CustomAttributeDefinitionsClient { - export interface Options extends BaseClientOptions {} +export declare namespace CustomAttributeDefinitions { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class CustomAttributeDefinitionsClient { - protected readonly _options: CustomAttributeDefinitionsClient.Options; +export class CustomAttributeDefinitions { + protected readonly _options: CustomAttributeDefinitions.Options; - constructor(options: CustomAttributeDefinitionsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: CustomAttributeDefinitions.Options = {}) { + this._options = _options; } /** @@ -31,7 +52,7 @@ export class CustomAttributeDefinitionsClient { * seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.orders.ListCustomAttributeDefinitionsRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.orders.customAttributeDefinitions.list({ @@ -42,8 +63,8 @@ export class CustomAttributeDefinitionsClient { */ public async list( request: Square.orders.ListCustomAttributeDefinitionsRequest = {}, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, - ): Promise> { + requestOptions?: CustomAttributeDefinitions.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.orders.ListCustomAttributeDefinitionsRequest, @@ -51,25 +72,17 @@ export class CustomAttributeDefinitionsClient { const { visibilityFilter, cursor, limit } = request; const _queryParams: Record = {}; if (visibilityFilter !== undefined) { - _queryParams.visibility_filter = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { + _queryParams["visibility_filter"] = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -78,13 +91,19 @@ export class CustomAttributeDefinitionsClient { "v2/orders/custom-attribute-definitions", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -125,7 +144,7 @@ export class CustomAttributeDefinitionsClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -145,7 +164,7 @@ export class CustomAttributeDefinitionsClient { * in the Square seller account. * * @param {Square.orders.CreateOrderCustomAttributeDefinitionRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.orders.customAttributeDefinitions.create({ @@ -163,23 +182,15 @@ export class CustomAttributeDefinitionsClient { */ public create( request: Square.orders.CreateOrderCustomAttributeDefinitionRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.orders.CreateOrderCustomAttributeDefinitionRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -188,19 +199,23 @@ export class CustomAttributeDefinitionsClient { "v2/orders/custom-attribute-definitions", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.orders.CreateOrderCustomAttributeDefinitionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -250,7 +265,7 @@ export class CustomAttributeDefinitionsClient { * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.orders.GetCustomAttributeDefinitionsRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.orders.customAttributeDefinitions.get({ @@ -260,44 +275,41 @@ export class CustomAttributeDefinitionsClient { */ public get( request: Square.orders.GetCustomAttributeDefinitionsRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.orders.GetCustomAttributeDefinitionsRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key, version } = request; const _queryParams: Record = {}; if (version !== undefined) { - _queryParams.version = version?.toString() ?? null; + _queryParams["version"] = version?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/orders/custom-attribute-definitions/${core.url.encodePathParam(key)}`, + `v2/orders/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -345,7 +357,7 @@ export class CustomAttributeDefinitionsClient { * Only the definition owner can update a custom attribute definition. Note that sellers can view all custom attributes in exported customer data, including those set to `VISIBILITY_HIDDEN`. * * @param {Square.orders.UpdateOrderCustomAttributeDefinitionRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.orders.customAttributeDefinitions.update({ @@ -360,45 +372,41 @@ export class CustomAttributeDefinitionsClient { */ public update( request: Square.orders.UpdateOrderCustomAttributeDefinitionRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); } private async __update( request: Square.orders.UpdateOrderCustomAttributeDefinitionRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/orders/custom-attribute-definitions/${core.url.encodePathParam(key)}`, + `v2/orders/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.orders.UpdateOrderCustomAttributeDefinitionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -446,7 +454,7 @@ export class CustomAttributeDefinitionsClient { * Only the definition owner can delete a custom attribute definition. * * @param {Square.orders.DeleteCustomAttributeDefinitionsRequest} request - * @param {CustomAttributeDefinitionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributeDefinitions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.orders.customAttributeDefinitions.delete({ @@ -455,39 +463,35 @@ export class CustomAttributeDefinitionsClient { */ public delete( request: Square.orders.DeleteCustomAttributeDefinitionsRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); } private async __delete( request: Square.orders.DeleteCustomAttributeDefinitionsRequest, - requestOptions?: CustomAttributeDefinitionsClient.RequestOptions, + requestOptions?: CustomAttributeDefinitions.RequestOptions, ): Promise> { const { key } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/orders/custom-attribute-definitions/${core.url.encodePathParam(key)}`, + `v2/orders/custom-attribute-definitions/${encodeURIComponent(key)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -530,7 +534,7 @@ export class CustomAttributeDefinitionsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/orders/resources/customAttributeDefinitions/client/index.ts b/src/api/resources/orders/resources/customAttributeDefinitions/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/orders/resources/customAttributeDefinitions/client/index.ts +++ b/src/api/resources/orders/resources/customAttributeDefinitions/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/CreateOrderCustomAttributeDefinitionRequest.ts b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/CreateOrderCustomAttributeDefinitionRequest.ts index 00bbd9ece..296e03219 100644 --- a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/CreateOrderCustomAttributeDefinitionRequest.ts +++ b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/CreateOrderCustomAttributeDefinitionRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts index a9c9d9ec5..6a1b34cf1 100644 --- a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/DeleteCustomAttributeDefinitionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface DeleteCustomAttributeDefinitionsRequest { - /** The key of the custom attribute definition to delete. */ + /** + * The key of the custom attribute definition to delete. + */ key: string; } diff --git a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts index a766f69cb..b72b1159b 100644 --- a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/GetCustomAttributeDefinitionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,7 +10,9 @@ * } */ export interface GetCustomAttributeDefinitionsRequest { - /** The key of the custom attribute definition to retrieve. */ + /** + * The key of the custom attribute definition to retrieve. + */ key: string; /** * To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) diff --git a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts index 0af73ad0e..3f1c4b730 100644 --- a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts +++ b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/ListCustomAttributeDefinitionsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -11,7 +13,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface ListCustomAttributeDefinitionsRequest { - /** Requests that all of the custom attributes be returned, or only those that are read-only or read-write. */ + /** + * Requests that all of the custom attributes be returned, or only those that are read-only or read-write. + */ visibilityFilter?: Square.VisibilityFilter | null; /** * The cursor returned in the paged response from the previous call to this endpoint. diff --git a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/UpdateOrderCustomAttributeDefinitionRequest.ts b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/UpdateOrderCustomAttributeDefinitionRequest.ts index 6394705bb..3eaac2d78 100644 --- a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/UpdateOrderCustomAttributeDefinitionRequest.ts +++ b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/UpdateOrderCustomAttributeDefinitionRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -15,7 +17,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface UpdateOrderCustomAttributeDefinitionRequest { - /** The key of the custom attribute definition to update. */ + /** + * The key of the custom attribute definition to update. + */ key: string; /** * The custom attribute definition that contains the fields to update. This endpoint supports sparse updates, diff --git a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/index.ts b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/index.ts index 8a5b5749a..fbb70badb 100644 --- a/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/index.ts +++ b/src/api/resources/orders/resources/customAttributeDefinitions/client/requests/index.ts @@ -1,5 +1,5 @@ -export type { CreateOrderCustomAttributeDefinitionRequest } from "./CreateOrderCustomAttributeDefinitionRequest"; -export type { DeleteCustomAttributeDefinitionsRequest } from "./DeleteCustomAttributeDefinitionsRequest"; -export type { GetCustomAttributeDefinitionsRequest } from "./GetCustomAttributeDefinitionsRequest"; -export type { ListCustomAttributeDefinitionsRequest } from "./ListCustomAttributeDefinitionsRequest"; -export type { UpdateOrderCustomAttributeDefinitionRequest } from "./UpdateOrderCustomAttributeDefinitionRequest"; +export { type ListCustomAttributeDefinitionsRequest } from "./ListCustomAttributeDefinitionsRequest"; +export { type CreateOrderCustomAttributeDefinitionRequest } from "./CreateOrderCustomAttributeDefinitionRequest"; +export { type GetCustomAttributeDefinitionsRequest } from "./GetCustomAttributeDefinitionsRequest"; +export { type UpdateOrderCustomAttributeDefinitionRequest } from "./UpdateOrderCustomAttributeDefinitionRequest"; +export { type DeleteCustomAttributeDefinitionsRequest } from "./DeleteCustomAttributeDefinitionsRequest"; diff --git a/src/api/resources/orders/resources/customAttributes/client/Client.ts b/src/api/resources/orders/resources/customAttributes/client/Client.ts index 7b66d1088..236df1c06 100644 --- a/src/api/resources/orders/resources/customAttributes/client/Client.ts +++ b/src/api/resources/orders/resources/customAttributes/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace CustomAttributesClient { - export interface Options extends BaseClientOptions {} +export declare namespace CustomAttributes { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class CustomAttributesClient { - protected readonly _options: CustomAttributesClient.Options; +export class CustomAttributes { + protected readonly _options: CustomAttributes.Options; - constructor(options: CustomAttributesClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: CustomAttributes.Options = {}) { + this._options = _options; } /** @@ -39,7 +60,7 @@ export class CustomAttributesClient { * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.orders.BulkDeleteOrderCustomAttributesRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.orders.customAttributes.batchDelete({ @@ -57,23 +78,15 @@ export class CustomAttributesClient { */ public batchDelete( request: Square.orders.BulkDeleteOrderCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__batchDelete(request, requestOptions)); } private async __batchDelete( request: Square.orders.BulkDeleteOrderCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -82,19 +95,23 @@ export class CustomAttributesClient { "v2/orders/custom-attributes/bulk-delete", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.orders.BulkDeleteOrderCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -153,7 +170,7 @@ export class CustomAttributesClient { * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.orders.BulkUpsertOrderCustomAttributesRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.orders.customAttributes.batchUpsert({ @@ -179,23 +196,15 @@ export class CustomAttributesClient { */ public batchUpsert( request: Square.orders.BulkUpsertOrderCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__batchUpsert(request, requestOptions)); } private async __batchUpsert( request: Square.orders.BulkUpsertOrderCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -204,19 +213,23 @@ export class CustomAttributesClient { "v2/orders/custom-attributes/bulk-upsert", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.orders.BulkUpsertOrderCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -269,7 +282,7 @@ export class CustomAttributesClient { * and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.orders.ListCustomAttributesRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.orders.customAttributes.list({ @@ -282,8 +295,8 @@ export class CustomAttributesClient { */ public async list( request: Square.orders.ListCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, - ): Promise> { + requestOptions?: CustomAttributes.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.orders.ListCustomAttributesRequest, @@ -291,43 +304,41 @@ export class CustomAttributesClient { const { orderId, visibilityFilter, cursor, limit, withDefinitions } = request; const _queryParams: Record = {}; if (visibilityFilter !== undefined) { - _queryParams.visibility_filter = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { + _queryParams["visibility_filter"] = serializers.VisibilityFilter.jsonOrThrow(visibilityFilter, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (withDefinitions !== undefined) { - _queryParams.with_definitions = withDefinitions?.toString() ?? null; + _queryParams["with_definitions"] = withDefinitions?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/orders/${core.url.encodePathParam(orderId)}/custom-attributes`, + `v2/orders/${encodeURIComponent(orderId)}/custom-attributes`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -368,7 +379,7 @@ export class CustomAttributesClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -391,7 +402,7 @@ export class CustomAttributesClient { * also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.orders.GetCustomAttributesRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.orders.customAttributes.get({ @@ -403,48 +414,45 @@ export class CustomAttributesClient { */ public get( request: Square.orders.GetCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.orders.GetCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { orderId, customAttributeKey, version, withDefinition } = request; const _queryParams: Record = {}; if (version !== undefined) { - _queryParams.version = version?.toString() ?? null; + _queryParams["version"] = version?.toString() ?? null; } if (withDefinition !== undefined) { - _queryParams.with_definition = withDefinition?.toString() ?? null; + _queryParams["with_definition"] = withDefinition?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/orders/${core.url.encodePathParam(orderId)}/custom-attributes/${core.url.encodePathParam(customAttributeKey)}`, + `v2/orders/${encodeURIComponent(orderId)}/custom-attributes/${encodeURIComponent(customAttributeKey)}`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -498,7 +506,7 @@ export class CustomAttributesClient { * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.orders.UpsertOrderCustomAttributeRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.orders.customAttributes.upsert({ @@ -513,45 +521,41 @@ export class CustomAttributesClient { */ public upsert( request: Square.orders.UpsertOrderCustomAttributeRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__upsert(request, requestOptions)); } private async __upsert( request: Square.orders.UpsertOrderCustomAttributeRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { orderId, customAttributeKey, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/orders/${core.url.encodePathParam(orderId)}/custom-attributes/${core.url.encodePathParam(customAttributeKey)}`, + `v2/orders/${encodeURIComponent(orderId)}/custom-attributes/${encodeURIComponent(customAttributeKey)}`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.orders.UpsertOrderCustomAttributeRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -601,7 +605,7 @@ export class CustomAttributesClient { * (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`. * * @param {Square.orders.DeleteCustomAttributesRequest} request - * @param {CustomAttributesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {CustomAttributes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.orders.customAttributes.delete({ @@ -611,39 +615,35 @@ export class CustomAttributesClient { */ public delete( request: Square.orders.DeleteCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); } private async __delete( request: Square.orders.DeleteCustomAttributesRequest, - requestOptions?: CustomAttributesClient.RequestOptions, + requestOptions?: CustomAttributes.RequestOptions, ): Promise> { const { orderId, customAttributeKey } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/orders/${core.url.encodePathParam(orderId)}/custom-attributes/${core.url.encodePathParam(customAttributeKey)}`, + `v2/orders/${encodeURIComponent(orderId)}/custom-attributes/${encodeURIComponent(customAttributeKey)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -686,7 +686,7 @@ export class CustomAttributesClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/orders/resources/customAttributes/client/index.ts b/src/api/resources/orders/resources/customAttributes/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/orders/resources/customAttributes/client/index.ts +++ b/src/api/resources/orders/resources/customAttributes/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/orders/resources/customAttributes/client/requests/BulkDeleteOrderCustomAttributesRequest.ts b/src/api/resources/orders/resources/customAttributes/client/requests/BulkDeleteOrderCustomAttributesRequest.ts index e240e6b22..c179f4272 100644 --- a/src/api/resources/orders/resources/customAttributes/client/requests/BulkDeleteOrderCustomAttributesRequest.ts +++ b/src/api/resources/orders/resources/customAttributes/client/requests/BulkDeleteOrderCustomAttributesRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/orders/resources/customAttributes/client/requests/BulkUpsertOrderCustomAttributesRequest.ts b/src/api/resources/orders/resources/customAttributes/client/requests/BulkUpsertOrderCustomAttributesRequest.ts index 32f0efb3c..049e4a5fc 100644 --- a/src/api/resources/orders/resources/customAttributes/client/requests/BulkUpsertOrderCustomAttributesRequest.ts +++ b/src/api/resources/orders/resources/customAttributes/client/requests/BulkUpsertOrderCustomAttributesRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/orders/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts b/src/api/resources/orders/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts index 37be1b432..1ad104438 100644 --- a/src/api/resources/orders/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts +++ b/src/api/resources/orders/resources/customAttributes/client/requests/DeleteCustomAttributesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,7 +10,9 @@ * } */ export interface DeleteCustomAttributesRequest { - /** The ID of the target [order](entity:Order). */ + /** + * The ID of the target [order](entity:Order). + */ orderId: string; /** * The key of the custom attribute to delete. This key must match the key of an diff --git a/src/api/resources/orders/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts b/src/api/resources/orders/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts index 3478f0202..4c8dbdb0d 100644 --- a/src/api/resources/orders/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts +++ b/src/api/resources/orders/resources/customAttributes/client/requests/GetCustomAttributesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -10,7 +12,9 @@ * } */ export interface GetCustomAttributesRequest { - /** The ID of the target [order](entity:Order). */ + /** + * The ID of the target [order](entity:Order). + */ orderId: string; /** * The key of the custom attribute to retrieve. This key must match the key of an diff --git a/src/api/resources/orders/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts b/src/api/resources/orders/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts index 887cff2c7..206799d76 100644 --- a/src/api/resources/orders/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts +++ b/src/api/resources/orders/resources/customAttributes/client/requests/ListCustomAttributesRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -13,9 +15,13 @@ import type * as Square from "../../../../../../index"; * } */ export interface ListCustomAttributesRequest { - /** The ID of the target [order](entity:Order). */ + /** + * The ID of the target [order](entity:Order). + */ orderId: string; - /** Requests that all of the custom attributes be returned, or only those that are read-only or read-write. */ + /** + * Requests that all of the custom attributes be returned, or only those that are read-only or read-write. + */ visibilityFilter?: Square.VisibilityFilter | null; /** * The cursor returned in the paged response from the previous call to this endpoint. diff --git a/src/api/resources/orders/resources/customAttributes/client/requests/UpsertOrderCustomAttributeRequest.ts b/src/api/resources/orders/resources/customAttributes/client/requests/UpsertOrderCustomAttributeRequest.ts index 1d293c94c..d8edbbc12 100644 --- a/src/api/resources/orders/resources/customAttributes/client/requests/UpsertOrderCustomAttributeRequest.ts +++ b/src/api/resources/orders/resources/customAttributes/client/requests/UpsertOrderCustomAttributeRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -15,7 +17,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface UpsertOrderCustomAttributeRequest { - /** The ID of the target [order](entity:Order). */ + /** + * The ID of the target [order](entity:Order). + */ orderId: string; /** * The key of the custom attribute to create or update. This key must match the key diff --git a/src/api/resources/orders/resources/customAttributes/client/requests/index.ts b/src/api/resources/orders/resources/customAttributes/client/requests/index.ts index ee8dadc35..63278aa3e 100644 --- a/src/api/resources/orders/resources/customAttributes/client/requests/index.ts +++ b/src/api/resources/orders/resources/customAttributes/client/requests/index.ts @@ -1,6 +1,6 @@ -export type { BulkDeleteOrderCustomAttributesRequest } from "./BulkDeleteOrderCustomAttributesRequest"; -export type { BulkUpsertOrderCustomAttributesRequest } from "./BulkUpsertOrderCustomAttributesRequest"; -export type { DeleteCustomAttributesRequest } from "./DeleteCustomAttributesRequest"; -export type { GetCustomAttributesRequest } from "./GetCustomAttributesRequest"; -export type { ListCustomAttributesRequest } from "./ListCustomAttributesRequest"; -export type { UpsertOrderCustomAttributeRequest } from "./UpsertOrderCustomAttributeRequest"; +export { type BulkDeleteOrderCustomAttributesRequest } from "./BulkDeleteOrderCustomAttributesRequest"; +export { type BulkUpsertOrderCustomAttributesRequest } from "./BulkUpsertOrderCustomAttributesRequest"; +export { type ListCustomAttributesRequest } from "./ListCustomAttributesRequest"; +export { type GetCustomAttributesRequest } from "./GetCustomAttributesRequest"; +export { type UpsertOrderCustomAttributeRequest } from "./UpsertOrderCustomAttributeRequest"; +export { type DeleteCustomAttributesRequest } from "./DeleteCustomAttributesRequest"; diff --git a/src/api/resources/orders/resources/index.ts b/src/api/resources/orders/resources/index.ts index 96153bc82..bfa7c90b7 100644 --- a/src/api/resources/orders/resources/index.ts +++ b/src/api/resources/orders/resources/index.ts @@ -1,4 +1,4 @@ export * as customAttributeDefinitions from "./customAttributeDefinitions"; -export * from "./customAttributeDefinitions/client/requests"; export * as customAttributes from "./customAttributes"; +export * from "./customAttributeDefinitions/client/requests"; export * from "./customAttributes/client/requests"; diff --git a/src/api/resources/payments/client/Client.ts b/src/api/resources/payments/client/Client.ts index 0af30c97f..4a5e99f2a 100644 --- a/src/api/resources/payments/client/Client.ts +++ b/src/api/resources/payments/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; +import * as serializers from "../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; -export declare namespace PaymentsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Payments { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class PaymentsClient { - protected readonly _options: PaymentsClient.Options; +export class Payments { + protected readonly _options: Payments.Options; - constructor(options: PaymentsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Payments.Options = {}) { + this._options = _options; } /** @@ -31,7 +52,7 @@ export class PaymentsClient { * The maximum results per page is 100. * * @param {Square.ListPaymentsRequest} request - * @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Payments.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.payments.list({ @@ -54,8 +75,8 @@ export class PaymentsClient { */ public async list( request: Square.ListPaymentsRequest = {}, - requestOptions?: PaymentsClient.RequestOptions, - ): Promise> { + requestOptions?: Payments.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async (request: Square.ListPaymentsRequest): Promise> => { const { @@ -77,61 +98,53 @@ export class PaymentsClient { } = request; const _queryParams: Record = {}; if (beginTime !== undefined) { - _queryParams.begin_time = beginTime; + _queryParams["begin_time"] = beginTime; } if (endTime !== undefined) { - _queryParams.end_time = endTime; + _queryParams["end_time"] = endTime; } if (sortOrder !== undefined) { - _queryParams.sort_order = sortOrder; + _queryParams["sort_order"] = sortOrder; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (locationId !== undefined) { - _queryParams.location_id = locationId; + _queryParams["location_id"] = locationId; } if (total !== undefined) { - _queryParams.total = total?.toString() ?? null; + _queryParams["total"] = total?.toString() ?? null; } if (last4 !== undefined) { - _queryParams.last_4 = last4; + _queryParams["last_4"] = last4; } if (cardBrand !== undefined) { - _queryParams.card_brand = cardBrand; + _queryParams["card_brand"] = cardBrand; } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (isOfflinePayment !== undefined) { - _queryParams.is_offline_payment = isOfflinePayment?.toString() ?? null; + _queryParams["is_offline_payment"] = isOfflinePayment?.toString() ?? null; } if (offlineBeginTime !== undefined) { - _queryParams.offline_begin_time = offlineBeginTime; + _queryParams["offline_begin_time"] = offlineBeginTime; } if (offlineEndTime !== undefined) { - _queryParams.offline_end_time = offlineEndTime; + _queryParams["offline_end_time"] = offlineEndTime; } if (updatedAtBeginTime !== undefined) { - _queryParams.updated_at_begin_time = updatedAtBeginTime; + _queryParams["updated_at_begin_time"] = updatedAtBeginTime; } if (updatedAtEndTime !== undefined) { - _queryParams.updated_at_end_time = updatedAtEndTime; + _queryParams["updated_at_end_time"] = updatedAtEndTime; } if (sortField !== undefined) { - _queryParams.sort_field = serializers.ListPaymentsRequestSortField.jsonOrThrow(sortField, { + _queryParams["sort_field"] = serializers.ListPaymentsRequestSortField.jsonOrThrow(sortField, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -140,13 +153,19 @@ export class PaymentsClient { "v2/payments", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -185,7 +204,7 @@ export class PaymentsClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -208,7 +227,7 @@ export class PaymentsClient { * `Payment` object and returns it in the response. * * @param {Square.CreatePaymentRequest} request - * @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Payments.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.payments.create({ @@ -231,23 +250,15 @@ export class PaymentsClient { */ public create( request: Square.CreatePaymentRequest, - requestOptions?: PaymentsClient.RequestOptions, + requestOptions?: Payments.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.CreatePaymentRequest, - requestOptions?: PaymentsClient.RequestOptions, + requestOptions?: Payments.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -256,19 +267,23 @@ export class PaymentsClient { "v2/payments", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreatePaymentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -322,7 +337,7 @@ export class PaymentsClient { * returns successfully. * * @param {Square.CancelPaymentByIdempotencyKeyRequest} request - * @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Payments.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.payments.cancelByIdempotencyKey({ @@ -331,23 +346,15 @@ export class PaymentsClient { */ public cancelByIdempotencyKey( request: Square.CancelPaymentByIdempotencyKeyRequest, - requestOptions?: PaymentsClient.RequestOptions, + requestOptions?: Payments.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__cancelByIdempotencyKey(request, requestOptions)); } private async __cancelByIdempotencyKey( request: Square.CancelPaymentByIdempotencyKeyRequest, - requestOptions?: PaymentsClient.RequestOptions, + requestOptions?: Payments.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -356,19 +363,23 @@ export class PaymentsClient { "v2/payments/cancel", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CancelPaymentByIdempotencyKeyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -412,7 +423,7 @@ export class PaymentsClient { * Retrieves details for a specific payment. * * @param {Square.GetPaymentsRequest} request - * @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Payments.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.payments.get({ @@ -421,39 +432,35 @@ export class PaymentsClient { */ public get( request: Square.GetPaymentsRequest, - requestOptions?: PaymentsClient.RequestOptions, + requestOptions?: Payments.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.GetPaymentsRequest, - requestOptions?: PaymentsClient.RequestOptions, + requestOptions?: Payments.RequestOptions, ): Promise> { const { paymentId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/payments/${core.url.encodePathParam(paymentId)}`, + `v2/payments/${encodeURIComponent(paymentId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -498,7 +505,7 @@ export class PaymentsClient { * You can update the `amount_money` and `tip_money` using this endpoint. * * @param {Square.UpdatePaymentRequest} request - * @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Payments.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.payments.update({ @@ -519,45 +526,41 @@ export class PaymentsClient { */ public update( request: Square.UpdatePaymentRequest, - requestOptions?: PaymentsClient.RequestOptions, + requestOptions?: Payments.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); } private async __update( request: Square.UpdatePaymentRequest, - requestOptions?: PaymentsClient.RequestOptions, + requestOptions?: Payments.RequestOptions, ): Promise> { const { paymentId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/payments/${core.url.encodePathParam(paymentId)}`, + `v2/payments/${encodeURIComponent(paymentId)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdatePaymentRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -602,7 +605,7 @@ export class PaymentsClient { * the APPROVED `status`. * * @param {Square.CancelPaymentsRequest} request - * @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Payments.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.payments.cancel({ @@ -611,39 +614,35 @@ export class PaymentsClient { */ public cancel( request: Square.CancelPaymentsRequest, - requestOptions?: PaymentsClient.RequestOptions, + requestOptions?: Payments.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__cancel(request, requestOptions)); } private async __cancel( request: Square.CancelPaymentsRequest, - requestOptions?: PaymentsClient.RequestOptions, + requestOptions?: Payments.RequestOptions, ): Promise> { const { paymentId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/payments/${core.url.encodePathParam(paymentId)}/cancel`, + `v2/payments/${encodeURIComponent(paymentId)}/cancel`, ), method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -692,7 +691,7 @@ export class PaymentsClient { * You can use this endpoint to complete a payment with the APPROVED `status`. * * @param {Square.CompletePaymentRequest} request - * @param {PaymentsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Payments.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.payments.complete({ @@ -701,45 +700,41 @@ export class PaymentsClient { */ public complete( request: Square.CompletePaymentRequest, - requestOptions?: PaymentsClient.RequestOptions, + requestOptions?: Payments.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__complete(request, requestOptions)); } private async __complete( request: Square.CompletePaymentRequest, - requestOptions?: PaymentsClient.RequestOptions, + requestOptions?: Payments.RequestOptions, ): Promise> { const { paymentId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/payments/${core.url.encodePathParam(paymentId)}/complete`, + `v2/payments/${encodeURIComponent(paymentId)}/complete`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CompletePaymentRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -782,7 +777,7 @@ export class PaymentsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/payments/client/index.ts b/src/api/resources/payments/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/payments/client/index.ts +++ b/src/api/resources/payments/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/payments/client/requests/CancelPaymentByIdempotencyKeyRequest.ts b/src/api/resources/payments/client/requests/CancelPaymentByIdempotencyKeyRequest.ts index 476c4d4eb..7929437cc 100644 --- a/src/api/resources/payments/client/requests/CancelPaymentByIdempotencyKeyRequest.ts +++ b/src/api/resources/payments/client/requests/CancelPaymentByIdempotencyKeyRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/payments/client/requests/CancelPaymentsRequest.ts b/src/api/resources/payments/client/requests/CancelPaymentsRequest.ts index 9f9ec3e0e..909ef567d 100644 --- a/src/api/resources/payments/client/requests/CancelPaymentsRequest.ts +++ b/src/api/resources/payments/client/requests/CancelPaymentsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface CancelPaymentsRequest { - /** The ID of the payment to cancel. */ + /** + * The ID of the payment to cancel. + */ paymentId: string; } diff --git a/src/api/resources/payments/client/requests/CompletePaymentRequest.ts b/src/api/resources/payments/client/requests/CompletePaymentRequest.ts index 12fdbc6c9..c75e332e9 100644 --- a/src/api/resources/payments/client/requests/CompletePaymentRequest.ts +++ b/src/api/resources/payments/client/requests/CompletePaymentRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,7 +9,9 @@ * } */ export interface CompletePaymentRequest { - /** The unique ID identifying the payment to be completed. */ + /** + * The unique ID identifying the payment to be completed. + */ paymentId: string; /** * Used for optimistic concurrency. This opaque token identifies the current `Payment` diff --git a/src/api/resources/payments/client/requests/CreatePaymentRequest.ts b/src/api/resources/payments/client/requests/CreatePaymentRequest.ts index 1bb38cec3..b9a1ae46a 100644 --- a/src/api/resources/payments/client/requests/CreatePaymentRequest.ts +++ b/src/api/resources/payments/client/requests/CreatePaymentRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/payments/client/requests/GetPaymentsRequest.ts b/src/api/resources/payments/client/requests/GetPaymentsRequest.ts index a2fecfcf3..a012df8cd 100644 --- a/src/api/resources/payments/client/requests/GetPaymentsRequest.ts +++ b/src/api/resources/payments/client/requests/GetPaymentsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetPaymentsRequest { - /** A unique ID for the desired payment. */ + /** + * A unique ID for the desired payment. + */ paymentId: string; } diff --git a/src/api/resources/payments/client/requests/ListPaymentsRequest.ts b/src/api/resources/payments/client/requests/ListPaymentsRequest.ts index 09ed36f2c..affd3d479 100644 --- a/src/api/resources/payments/client/requests/ListPaymentsRequest.ts +++ b/src/api/resources/payments/client/requests/ListPaymentsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -54,11 +56,17 @@ export interface ListPaymentsRequest { * for the default (main) location associated with the seller. */ locationId?: string | null; - /** The exact amount in the `total_money` for a payment. */ + /** + * The exact amount in the `total_money` for a payment. + */ total?: bigint | null; - /** The last four digits of a payment card. */ + /** + * The last four digits of a payment card. + */ last4?: string | null; - /** The brand of the payment card (for example, VISA). */ + /** + * The brand of the payment card (for example, VISA). + */ cardBrand?: string | null; /** * The maximum number of results to be returned in a single page. @@ -70,7 +78,9 @@ export interface ListPaymentsRequest { * Default: `100` */ limit?: number | null; - /** Whether the payment was taken offline or not. */ + /** + * Whether the payment was taken offline or not. + */ isOfflinePayment?: boolean | null; /** * Indicates the start of the time range for which to retrieve offline payments, in RFC 3339 @@ -100,6 +110,8 @@ export interface ListPaymentsRequest { * range is determined using the `updated_at` field for each Payment. */ updatedAtEndTime?: string | null; - /** The field used to sort results by. The default is `CREATED_AT`. */ + /** + * The field used to sort results by. The default is `CREATED_AT`. + */ sortField?: Square.ListPaymentsRequestSortField | null; } diff --git a/src/api/resources/payments/client/requests/UpdatePaymentRequest.ts b/src/api/resources/payments/client/requests/UpdatePaymentRequest.ts index 649ac9153..d6f7f9ba9 100644 --- a/src/api/resources/payments/client/requests/UpdatePaymentRequest.ts +++ b/src/api/resources/payments/client/requests/UpdatePaymentRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -21,7 +23,9 @@ import type * as Square from "../../../../index"; * } */ export interface UpdatePaymentRequest { - /** The ID of the payment to update. */ + /** + * The ID of the payment to update. + */ paymentId: string; /** The updated `Payment` object. */ payment?: Square.Payment; diff --git a/src/api/resources/payments/client/requests/index.ts b/src/api/resources/payments/client/requests/index.ts index 1a570a47e..3828c6442 100644 --- a/src/api/resources/payments/client/requests/index.ts +++ b/src/api/resources/payments/client/requests/index.ts @@ -1,7 +1,7 @@ -export type { CancelPaymentByIdempotencyKeyRequest } from "./CancelPaymentByIdempotencyKeyRequest"; -export type { CancelPaymentsRequest } from "./CancelPaymentsRequest"; -export type { CompletePaymentRequest } from "./CompletePaymentRequest"; -export type { CreatePaymentRequest } from "./CreatePaymentRequest"; -export type { GetPaymentsRequest } from "./GetPaymentsRequest"; -export type { ListPaymentsRequest } from "./ListPaymentsRequest"; -export type { UpdatePaymentRequest } from "./UpdatePaymentRequest"; +export { type ListPaymentsRequest } from "./ListPaymentsRequest"; +export { type CreatePaymentRequest } from "./CreatePaymentRequest"; +export { type CancelPaymentByIdempotencyKeyRequest } from "./CancelPaymentByIdempotencyKeyRequest"; +export { type GetPaymentsRequest } from "./GetPaymentsRequest"; +export { type UpdatePaymentRequest } from "./UpdatePaymentRequest"; +export { type CancelPaymentsRequest } from "./CancelPaymentsRequest"; +export { type CompletePaymentRequest } from "./CompletePaymentRequest"; diff --git a/src/api/resources/payouts/client/Client.ts b/src/api/resources/payouts/client/Client.ts index b45ec7dd2..a2ed81d96 100644 --- a/src/api/resources/payouts/client/Client.ts +++ b/src/api/resources/payouts/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; +import * as serializers from "../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; -export declare namespace PayoutsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Payouts { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class PayoutsClient { - protected readonly _options: PayoutsClient.Options; +export class Payouts { + protected readonly _options: Payouts.Options; - constructor(options: PayoutsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Payouts.Options = {}) { + this._options = _options; } /** @@ -28,7 +49,7 @@ export class PayoutsClient { * To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. * * @param {Square.ListPayoutsRequest} request - * @param {PayoutsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Payouts.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.payouts.list({ @@ -43,47 +64,39 @@ export class PayoutsClient { */ public async list( request: Square.ListPayoutsRequest = {}, - requestOptions?: PayoutsClient.RequestOptions, - ): Promise> { + requestOptions?: Payouts.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async (request: Square.ListPayoutsRequest): Promise> => { const { locationId, status, beginTime, endTime, sortOrder, cursor, limit } = request; const _queryParams: Record = {}; if (locationId !== undefined) { - _queryParams.location_id = locationId; + _queryParams["location_id"] = locationId; } if (status !== undefined) { - _queryParams.status = serializers.PayoutStatus.jsonOrThrow(status, { + _queryParams["status"] = serializers.PayoutStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (beginTime !== undefined) { - _queryParams.begin_time = beginTime; + _queryParams["begin_time"] = beginTime; } if (endTime !== undefined) { - _queryParams.end_time = endTime; + _queryParams["end_time"] = endTime; } if (sortOrder !== undefined) { - _queryParams.sort_order = serializers.SortOrder.jsonOrThrow(sortOrder, { + _queryParams["sort_order"] = serializers.SortOrder.jsonOrThrow(sortOrder, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -92,13 +105,19 @@ export class PayoutsClient { "v2/payouts", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -137,7 +156,7 @@ export class PayoutsClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -154,7 +173,7 @@ export class PayoutsClient { * To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. * * @param {Square.GetPayoutsRequest} request - * @param {PayoutsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Payouts.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.payouts.get({ @@ -163,39 +182,35 @@ export class PayoutsClient { */ public get( request: Square.GetPayoutsRequest, - requestOptions?: PayoutsClient.RequestOptions, + requestOptions?: Payouts.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.GetPayoutsRequest, - requestOptions?: PayoutsClient.RequestOptions, + requestOptions?: Payouts.RequestOptions, ): Promise> { const { payoutId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/payouts/${core.url.encodePathParam(payoutId)}`, + `v2/payouts/${encodeURIComponent(payoutId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -240,7 +255,7 @@ export class PayoutsClient { * To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. * * @param {Square.ListEntriesPayoutsRequest} request - * @param {PayoutsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Payouts.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.payouts.listEntries({ @@ -252,8 +267,8 @@ export class PayoutsClient { */ public async listEntries( request: Square.ListEntriesPayoutsRequest, - requestOptions?: PayoutsClient.RequestOptions, - ): Promise> { + requestOptions?: Payouts.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.ListEntriesPayoutsRequest, @@ -261,40 +276,38 @@ export class PayoutsClient { const { payoutId, sortOrder, cursor, limit } = request; const _queryParams: Record = {}; if (sortOrder !== undefined) { - _queryParams.sort_order = serializers.SortOrder.jsonOrThrow(sortOrder, { + _queryParams["sort_order"] = serializers.SortOrder.jsonOrThrow(sortOrder, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/payouts/${core.url.encodePathParam(payoutId)}/payout-entries`, + `v2/payouts/${encodeURIComponent(payoutId)}/payout-entries`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -335,7 +348,7 @@ export class PayoutsClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -348,7 +361,7 @@ export class PayoutsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/payouts/client/index.ts b/src/api/resources/payouts/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/payouts/client/index.ts +++ b/src/api/resources/payouts/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/payouts/client/requests/GetPayoutsRequest.ts b/src/api/resources/payouts/client/requests/GetPayoutsRequest.ts index 8e553472b..2a31c8f5b 100644 --- a/src/api/resources/payouts/client/requests/GetPayoutsRequest.ts +++ b/src/api/resources/payouts/client/requests/GetPayoutsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetPayoutsRequest { - /** The ID of the payout to retrieve the information for. */ + /** + * The ID of the payout to retrieve the information for. + */ payoutId: string; } diff --git a/src/api/resources/payouts/client/requests/ListEntriesPayoutsRequest.ts b/src/api/resources/payouts/client/requests/ListEntriesPayoutsRequest.ts index bb67a6f96..6b329f73c 100644 --- a/src/api/resources/payouts/client/requests/ListEntriesPayoutsRequest.ts +++ b/src/api/resources/payouts/client/requests/ListEntriesPayoutsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -12,9 +14,13 @@ import type * as Square from "../../../../index"; * } */ export interface ListEntriesPayoutsRequest { - /** The ID of the payout to retrieve the information for. */ + /** + * The ID of the payout to retrieve the information for. + */ payoutId: string; - /** The order in which payout entries are listed. */ + /** + * The order in which payout entries are listed. + */ sortOrder?: Square.SortOrder | null; /** * A pagination cursor returned by a previous call to this endpoint. diff --git a/src/api/resources/payouts/client/requests/ListPayoutsRequest.ts b/src/api/resources/payouts/client/requests/ListPayoutsRequest.ts index 7cc94db6a..49f693190 100644 --- a/src/api/resources/payouts/client/requests/ListPayoutsRequest.ts +++ b/src/api/resources/payouts/client/requests/ListPayoutsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -20,7 +22,9 @@ export interface ListPayoutsRequest { * By default, payouts are returned for the default (main) location associated with the seller. */ locationId?: string | null; - /** If provided, only payouts with the given status are returned. */ + /** + * If provided, only payouts with the given status are returned. + */ status?: Square.PayoutStatus | null; /** * The timestamp for the beginning of the payout creation time, in RFC 3339 format. @@ -32,7 +36,9 @@ export interface ListPayoutsRequest { * Default: The current time. */ endTime?: string | null; - /** The order in which payouts are listed. */ + /** + * The order in which payouts are listed. + */ sortOrder?: Square.SortOrder | null; /** * A pagination cursor returned by a previous call to this endpoint. diff --git a/src/api/resources/payouts/client/requests/index.ts b/src/api/resources/payouts/client/requests/index.ts index af948303a..73f48e53f 100644 --- a/src/api/resources/payouts/client/requests/index.ts +++ b/src/api/resources/payouts/client/requests/index.ts @@ -1,3 +1,3 @@ -export type { GetPayoutsRequest } from "./GetPayoutsRequest"; -export type { ListEntriesPayoutsRequest } from "./ListEntriesPayoutsRequest"; -export type { ListPayoutsRequest } from "./ListPayoutsRequest"; +export { type ListPayoutsRequest } from "./ListPayoutsRequest"; +export { type GetPayoutsRequest } from "./GetPayoutsRequest"; +export { type ListEntriesPayoutsRequest } from "./ListEntriesPayoutsRequest"; diff --git a/src/api/resources/refunds/client/Client.ts b/src/api/resources/refunds/client/Client.ts index d4fe1040d..a093491b8 100644 --- a/src/api/resources/refunds/client/Client.ts +++ b/src/api/resources/refunds/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; +import * as serializers from "../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; -export declare namespace RefundsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Refunds { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class RefundsClient { - protected readonly _options: RefundsClient.Options; +export class Refunds { + protected readonly _options: Refunds.Options; - constructor(options: RefundsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Refunds.Options = {}) { + this._options = _options; } /** @@ -31,7 +52,7 @@ export class RefundsClient { * The maximum results per page is 100. * * @param {Square.ListRefundsRequest} request - * @param {RefundsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Refunds.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.refunds.list({ @@ -50,8 +71,8 @@ export class RefundsClient { */ public async list( request: Square.ListRefundsRequest = {}, - requestOptions?: RefundsClient.RequestOptions, - ): Promise> { + requestOptions?: Refunds.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.ListRefundsRequest, @@ -71,49 +92,41 @@ export class RefundsClient { } = request; const _queryParams: Record = {}; if (beginTime !== undefined) { - _queryParams.begin_time = beginTime; + _queryParams["begin_time"] = beginTime; } if (endTime !== undefined) { - _queryParams.end_time = endTime; + _queryParams["end_time"] = endTime; } if (sortOrder !== undefined) { - _queryParams.sort_order = sortOrder; + _queryParams["sort_order"] = sortOrder; } if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (locationId !== undefined) { - _queryParams.location_id = locationId; + _queryParams["location_id"] = locationId; } if (status !== undefined) { - _queryParams.status = status; + _queryParams["status"] = status; } if (sourceType !== undefined) { - _queryParams.source_type = sourceType; + _queryParams["source_type"] = sourceType; } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (updatedAtBeginTime !== undefined) { - _queryParams.updated_at_begin_time = updatedAtBeginTime; + _queryParams["updated_at_begin_time"] = updatedAtBeginTime; } if (updatedAtEndTime !== undefined) { - _queryParams.updated_at_end_time = updatedAtEndTime; + _queryParams["updated_at_end_time"] = updatedAtEndTime; } if (sortField !== undefined) { - _queryParams.sort_field = serializers.ListPaymentRefundsRequestSortField.jsonOrThrow(sortField, { + _queryParams["sort_field"] = serializers.ListPaymentRefundsRequestSortField.jsonOrThrow(sortField, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -122,13 +135,19 @@ export class RefundsClient { "v2/refunds", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -167,7 +186,7 @@ export class RefundsClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -186,7 +205,7 @@ export class RefundsClient { * [Refund Payment](https://developer.squareup.com/docs/payments-api/refund-payments). * * @param {Square.RefundPaymentRequest} request - * @param {RefundsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Refunds.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.refunds.refundPayment({ @@ -205,23 +224,15 @@ export class RefundsClient { */ public refundPayment( request: Square.RefundPaymentRequest, - requestOptions?: RefundsClient.RequestOptions, + requestOptions?: Refunds.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__refundPayment(request, requestOptions)); } private async __refundPayment( request: Square.RefundPaymentRequest, - requestOptions?: RefundsClient.RequestOptions, + requestOptions?: Refunds.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -230,19 +241,23 @@ export class RefundsClient { "v2/refunds", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.RefundPaymentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -286,7 +301,7 @@ export class RefundsClient { * Retrieves a specific refund using the `refund_id`. * * @param {Square.GetRefundsRequest} request - * @param {RefundsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Refunds.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.refunds.get({ @@ -295,39 +310,35 @@ export class RefundsClient { */ public get( request: Square.GetRefundsRequest, - requestOptions?: RefundsClient.RequestOptions, + requestOptions?: Refunds.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.GetRefundsRequest, - requestOptions?: RefundsClient.RequestOptions, + requestOptions?: Refunds.RequestOptions, ): Promise> { const { refundId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/refunds/${core.url.encodePathParam(refundId)}`, + `v2/refunds/${encodeURIComponent(refundId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -368,7 +379,7 @@ export class RefundsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/refunds/client/index.ts b/src/api/resources/refunds/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/refunds/client/index.ts +++ b/src/api/resources/refunds/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/refunds/client/requests/GetRefundsRequest.ts b/src/api/resources/refunds/client/requests/GetRefundsRequest.ts index 006a22028..e5935da3f 100644 --- a/src/api/resources/refunds/client/requests/GetRefundsRequest.ts +++ b/src/api/resources/refunds/client/requests/GetRefundsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetRefundsRequest { - /** The unique ID for the desired `PaymentRefund`. */ + /** + * The unique ID for the desired `PaymentRefund`. + */ refundId: string; } diff --git a/src/api/resources/refunds/client/requests/ListRefundsRequest.ts b/src/api/resources/refunds/client/requests/ListRefundsRequest.ts index 437501a4c..e7e2d1d54 100644 --- a/src/api/resources/refunds/client/requests/ListRefundsRequest.ts +++ b/src/api/resources/refunds/client/requests/ListRefundsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -91,6 +93,8 @@ export interface ListRefundsRequest { * Default: The current time. */ updatedAtEndTime?: string | null; - /** The field used to sort results by. The default is `CREATED_AT`. */ + /** + * The field used to sort results by. The default is `CREATED_AT`. + */ sortField?: Square.ListPaymentRefundsRequestSortField | null; } diff --git a/src/api/resources/refunds/client/requests/RefundPaymentRequest.ts b/src/api/resources/refunds/client/requests/RefundPaymentRequest.ts index 887b23384..9d700e817 100644 --- a/src/api/resources/refunds/client/requests/RefundPaymentRequest.ts +++ b/src/api/resources/refunds/client/requests/RefundPaymentRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/refunds/client/requests/index.ts b/src/api/resources/refunds/client/requests/index.ts index 4c0ce2a64..8effc0bce 100644 --- a/src/api/resources/refunds/client/requests/index.ts +++ b/src/api/resources/refunds/client/requests/index.ts @@ -1,3 +1,3 @@ -export type { GetRefundsRequest } from "./GetRefundsRequest"; -export type { ListRefundsRequest } from "./ListRefundsRequest"; -export type { RefundPaymentRequest } from "./RefundPaymentRequest"; +export { type ListRefundsRequest } from "./ListRefundsRequest"; +export { type RefundPaymentRequest } from "./RefundPaymentRequest"; +export { type GetRefundsRequest } from "./GetRefundsRequest"; diff --git a/src/api/resources/sites/client/Client.ts b/src/api/resources/sites/client/Client.ts index f41fa2c00..f31ffdf7d 100644 --- a/src/api/resources/sites/client/Client.ts +++ b/src/api/resources/sites/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; +import * as errors from "../../../../errors/index"; -export declare namespace SitesClient { - export interface Options extends BaseClientOptions {} +export declare namespace Sites { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class SitesClient { - protected readonly _options: SitesClient.Options; +export class Sites { + protected readonly _options: Sites.Options; - constructor(options: SitesClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Sites.Options = {}) { + this._options = _options; } /** @@ -28,26 +49,18 @@ export class SitesClient { * * __Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). * - * @param {SitesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Sites.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.sites.list() */ - public list(requestOptions?: SitesClient.RequestOptions): core.HttpResponsePromise { + public list(requestOptions?: Sites.RequestOptions): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__list(requestOptions)); } private async __list( - requestOptions?: SitesClient.RequestOptions, + requestOptions?: Sites.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -56,13 +69,17 @@ export class SitesClient { "v2/sites", ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -103,7 +120,7 @@ export class SitesClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/snippets/client/Client.ts b/src/api/resources/snippets/client/Client.ts index 393e800b9..307a4bbe8 100644 --- a/src/api/resources/snippets/client/Client.ts +++ b/src/api/resources/snippets/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; +import * as errors from "../../../../errors/index"; -export declare namespace SnippetsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Snippets { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class SnippetsClient { - protected readonly _options: SnippetsClient.Options; +export class Snippets { + protected readonly _options: Snippets.Options; - constructor(options: SnippetsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Snippets.Options = {}) { + this._options = _options; } /** @@ -31,7 +52,7 @@ export class SnippetsClient { * __Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). * * @param {Square.GetSnippetsRequest} request - * @param {SnippetsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Snippets.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.snippets.get({ @@ -40,39 +61,35 @@ export class SnippetsClient { */ public get( request: Square.GetSnippetsRequest, - requestOptions?: SnippetsClient.RequestOptions, + requestOptions?: Snippets.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.GetSnippetsRequest, - requestOptions?: SnippetsClient.RequestOptions, + requestOptions?: Snippets.RequestOptions, ): Promise> { const { siteId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/sites/${core.url.encodePathParam(siteId)}/snippet`, + `v2/sites/${encodeURIComponent(siteId)}/snippet`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -122,7 +139,7 @@ export class SnippetsClient { * __Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). * * @param {Square.UpsertSnippetRequest} request - * @param {SnippetsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Snippets.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.snippets.upsert({ @@ -134,45 +151,41 @@ export class SnippetsClient { */ public upsert( request: Square.UpsertSnippetRequest, - requestOptions?: SnippetsClient.RequestOptions, + requestOptions?: Snippets.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__upsert(request, requestOptions)); } private async __upsert( request: Square.UpsertSnippetRequest, - requestOptions?: SnippetsClient.RequestOptions, + requestOptions?: Snippets.RequestOptions, ): Promise> { const { siteId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/sites/${core.url.encodePathParam(siteId)}/snippet`, + `v2/sites/${encodeURIComponent(siteId)}/snippet`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpsertSnippetRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -221,7 +234,7 @@ export class SnippetsClient { * __Note:__ Square Online APIs are publicly available as part of an early access program. For more information, see [Early access program for Square Online APIs](https://developer.squareup.com/docs/online-api#early-access-program-for-square-online-apis). * * @param {Square.DeleteSnippetsRequest} request - * @param {SnippetsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Snippets.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.snippets.delete({ @@ -230,39 +243,35 @@ export class SnippetsClient { */ public delete( request: Square.DeleteSnippetsRequest, - requestOptions?: SnippetsClient.RequestOptions, + requestOptions?: Snippets.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); } private async __delete( request: Square.DeleteSnippetsRequest, - requestOptions?: SnippetsClient.RequestOptions, + requestOptions?: Snippets.RequestOptions, ): Promise> { const { siteId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/sites/${core.url.encodePathParam(siteId)}/snippet`, + `v2/sites/${encodeURIComponent(siteId)}/snippet`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -305,7 +314,7 @@ export class SnippetsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/snippets/client/index.ts b/src/api/resources/snippets/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/snippets/client/index.ts +++ b/src/api/resources/snippets/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/snippets/client/requests/DeleteSnippetsRequest.ts b/src/api/resources/snippets/client/requests/DeleteSnippetsRequest.ts index 1ebc31b51..35df88023 100644 --- a/src/api/resources/snippets/client/requests/DeleteSnippetsRequest.ts +++ b/src/api/resources/snippets/client/requests/DeleteSnippetsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface DeleteSnippetsRequest { - /** The ID of the site that contains the snippet. */ + /** + * The ID of the site that contains the snippet. + */ siteId: string; } diff --git a/src/api/resources/snippets/client/requests/GetSnippetsRequest.ts b/src/api/resources/snippets/client/requests/GetSnippetsRequest.ts index 15c4b0278..64275821f 100644 --- a/src/api/resources/snippets/client/requests/GetSnippetsRequest.ts +++ b/src/api/resources/snippets/client/requests/GetSnippetsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetSnippetsRequest { - /** The ID of the site that contains the snippet. */ + /** + * The ID of the site that contains the snippet. + */ siteId: string; } diff --git a/src/api/resources/snippets/client/requests/UpsertSnippetRequest.ts b/src/api/resources/snippets/client/requests/UpsertSnippetRequest.ts index f713c91b0..28d2100a3 100644 --- a/src/api/resources/snippets/client/requests/UpsertSnippetRequest.ts +++ b/src/api/resources/snippets/client/requests/UpsertSnippetRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -12,7 +14,9 @@ import type * as Square from "../../../../index"; * } */ export interface UpsertSnippetRequest { - /** The ID of the site where you want to add or update the snippet. */ + /** + * The ID of the site where you want to add or update the snippet. + */ siteId: string; /** The snippet for the site. */ snippet: Square.Snippet; diff --git a/src/api/resources/snippets/client/requests/index.ts b/src/api/resources/snippets/client/requests/index.ts index 90ce3a93b..9dd51c182 100644 --- a/src/api/resources/snippets/client/requests/index.ts +++ b/src/api/resources/snippets/client/requests/index.ts @@ -1,3 +1,3 @@ -export type { DeleteSnippetsRequest } from "./DeleteSnippetsRequest"; -export type { GetSnippetsRequest } from "./GetSnippetsRequest"; -export type { UpsertSnippetRequest } from "./UpsertSnippetRequest"; +export { type GetSnippetsRequest } from "./GetSnippetsRequest"; +export { type UpsertSnippetRequest } from "./UpsertSnippetRequest"; +export { type DeleteSnippetsRequest } from "./DeleteSnippetsRequest"; diff --git a/src/api/resources/subscriptions/client/Client.ts b/src/api/resources/subscriptions/client/Client.ts index 41fea99d4..ec8207d38 100644 --- a/src/api/resources/subscriptions/client/Client.ts +++ b/src/api/resources/subscriptions/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; +import * as errors from "../../../../errors/index"; -export declare namespace SubscriptionsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Subscriptions { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class SubscriptionsClient { - protected readonly _options: SubscriptionsClient.Options; +export class Subscriptions { + protected readonly _options: Subscriptions.Options; - constructor(options: SubscriptionsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Subscriptions.Options = {}) { + this._options = _options; } /** @@ -33,7 +54,7 @@ export class SubscriptionsClient { * For more information, see [Create a subscription](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#create-a-subscription). * * @param {Square.CreateSubscriptionRequest} request - * @param {SubscriptionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.subscriptions.create({ @@ -55,23 +76,15 @@ export class SubscriptionsClient { */ public create( request: Square.CreateSubscriptionRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.CreateSubscriptionRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -80,19 +93,23 @@ export class SubscriptionsClient { "v2/subscriptions", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateSubscriptionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -137,7 +154,7 @@ export class SubscriptionsClient { * variation. For more information, see [Swap Subscription Plan Variations](https://developer.squareup.com/docs/subscriptions-api/swap-plan-variations). * * @param {Square.BulkSwapPlanRequest} request - * @param {SubscriptionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.subscriptions.bulkSwapPlan({ @@ -148,23 +165,15 @@ export class SubscriptionsClient { */ public bulkSwapPlan( request: Square.BulkSwapPlanRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__bulkSwapPlan(request, requestOptions)); } private async __bulkSwapPlan( request: Square.BulkSwapPlanRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -173,19 +182,23 @@ export class SubscriptionsClient { "v2/subscriptions/bulk-swap-plan", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BulkSwapPlanRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -244,7 +257,7 @@ export class SubscriptionsClient { * customer by subscription creation date. * * @param {Square.SearchSubscriptionsRequest} request - * @param {SubscriptionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.subscriptions.search({ @@ -259,23 +272,15 @@ export class SubscriptionsClient { */ public search( request: Square.SearchSubscriptionsRequest = {}, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__search(request, requestOptions)); } private async __search( request: Square.SearchSubscriptionsRequest = {}, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -284,19 +289,23 @@ export class SubscriptionsClient { "v2/subscriptions/search", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchSubscriptionsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -340,7 +349,7 @@ export class SubscriptionsClient { * Retrieves a specific subscription. * * @param {Square.GetSubscriptionsRequest} request - * @param {SubscriptionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.subscriptions.get({ @@ -350,44 +359,41 @@ export class SubscriptionsClient { */ public get( request: Square.GetSubscriptionsRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.GetSubscriptionsRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId, include } = request; const _queryParams: Record = {}; if (include !== undefined) { - _queryParams.include = include; + _queryParams["include"] = include; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/subscriptions/${core.url.encodePathParam(subscriptionId)}`, + `v2/subscriptions/${encodeURIComponent(subscriptionId)}`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -434,7 +440,7 @@ export class SubscriptionsClient { * To clear a field, set its value to `null`. * * @param {Square.UpdateSubscriptionRequest} request - * @param {SubscriptionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.subscriptions.update({ @@ -446,45 +452,41 @@ export class SubscriptionsClient { */ public update( request: Square.UpdateSubscriptionRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); } private async __update( request: Square.UpdateSubscriptionRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/subscriptions/${core.url.encodePathParam(subscriptionId)}`, + `v2/subscriptions/${encodeURIComponent(subscriptionId)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateSubscriptionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -530,7 +532,7 @@ export class SubscriptionsClient { * Deletes a scheduled action for a subscription. * * @param {Square.DeleteActionSubscriptionsRequest} request - * @param {SubscriptionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.subscriptions.deleteAction({ @@ -540,39 +542,35 @@ export class SubscriptionsClient { */ public deleteAction( request: Square.DeleteActionSubscriptionsRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__deleteAction(request, requestOptions)); } private async __deleteAction( request: Square.DeleteActionSubscriptionsRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId, actionId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/subscriptions/${core.url.encodePathParam(subscriptionId)}/actions/${core.url.encodePathParam(actionId)}`, + `v2/subscriptions/${encodeURIComponent(subscriptionId)}/actions/${encodeURIComponent(actionId)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -619,7 +617,7 @@ export class SubscriptionsClient { * for a subscription. * * @param {Square.ChangeBillingAnchorDateRequest} request - * @param {SubscriptionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.subscriptions.changeBillingAnchorDate({ @@ -629,45 +627,41 @@ export class SubscriptionsClient { */ public changeBillingAnchorDate( request: Square.ChangeBillingAnchorDateRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__changeBillingAnchorDate(request, requestOptions)); } private async __changeBillingAnchorDate( request: Square.ChangeBillingAnchorDateRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/subscriptions/${core.url.encodePathParam(subscriptionId)}/billing-anchor`, + `v2/subscriptions/${encodeURIComponent(subscriptionId)}/billing-anchor`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.ChangeBillingAnchorDateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -715,7 +709,7 @@ export class SubscriptionsClient { * the subscription status changes from ACTIVE to CANCELED. * * @param {Square.CancelSubscriptionsRequest} request - * @param {SubscriptionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.subscriptions.cancel({ @@ -724,39 +718,35 @@ export class SubscriptionsClient { */ public cancel( request: Square.CancelSubscriptionsRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__cancel(request, requestOptions)); } private async __cancel( request: Square.CancelSubscriptionsRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/subscriptions/${core.url.encodePathParam(subscriptionId)}/cancel`, + `v2/subscriptions/${encodeURIComponent(subscriptionId)}/cancel`, ), method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -802,7 +792,7 @@ export class SubscriptionsClient { * Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a specific subscription. * * @param {Square.ListEventsSubscriptionsRequest} request - * @param {SubscriptionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.subscriptions.listEvents({ @@ -813,8 +803,8 @@ export class SubscriptionsClient { */ public async listEvents( request: Square.ListEventsSubscriptionsRequest, - requestOptions?: SubscriptionsClient.RequestOptions, - ): Promise> { + requestOptions?: Subscriptions.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.ListEventsSubscriptionsRequest, @@ -822,34 +812,32 @@ export class SubscriptionsClient { const { subscriptionId, cursor, limit } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/subscriptions/${core.url.encodePathParam(subscriptionId)}/events`, + `v2/subscriptions/${encodeURIComponent(subscriptionId)}/events`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -890,7 +878,7 @@ export class SubscriptionsClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -906,7 +894,7 @@ export class SubscriptionsClient { * Schedules a `PAUSE` action to pause an active subscription. * * @param {Square.PauseSubscriptionRequest} request - * @param {SubscriptionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.subscriptions.pause({ @@ -915,45 +903,41 @@ export class SubscriptionsClient { */ public pause( request: Square.PauseSubscriptionRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__pause(request, requestOptions)); } private async __pause( request: Square.PauseSubscriptionRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/subscriptions/${core.url.encodePathParam(subscriptionId)}/pause`, + `v2/subscriptions/${encodeURIComponent(subscriptionId)}/pause`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.PauseSubscriptionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -999,7 +983,7 @@ export class SubscriptionsClient { * Schedules a `RESUME` action to resume a paused or a deactivated subscription. * * @param {Square.ResumeSubscriptionRequest} request - * @param {SubscriptionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.subscriptions.resume({ @@ -1008,45 +992,41 @@ export class SubscriptionsClient { */ public resume( request: Square.ResumeSubscriptionRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__resume(request, requestOptions)); } private async __resume( request: Square.ResumeSubscriptionRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/subscriptions/${core.url.encodePathParam(subscriptionId)}/resume`, + `v2/subscriptions/${encodeURIComponent(subscriptionId)}/resume`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.ResumeSubscriptionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -1093,7 +1073,7 @@ export class SubscriptionsClient { * For more information, see [Swap Subscription Plan Variations](https://developer.squareup.com/docs/subscriptions-api/swap-plan-variations). * * @param {Square.SwapPlanRequest} request - * @param {SubscriptionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.subscriptions.swapPlan({ @@ -1107,45 +1087,41 @@ export class SubscriptionsClient { */ public swapPlan( request: Square.SwapPlanRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__swapPlan(request, requestOptions)); } private async __swapPlan( request: Square.SwapPlanRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/subscriptions/${core.url.encodePathParam(subscriptionId)}/swap-plan`, + `v2/subscriptions/${encodeURIComponent(subscriptionId)}/swap-plan`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SwapPlanRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -1188,7 +1164,7 @@ export class SubscriptionsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/subscriptions/client/index.ts b/src/api/resources/subscriptions/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/subscriptions/client/index.ts +++ b/src/api/resources/subscriptions/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/subscriptions/client/requests/BulkSwapPlanRequest.ts b/src/api/resources/subscriptions/client/requests/BulkSwapPlanRequest.ts index 6a459b086..b282183e2 100644 --- a/src/api/resources/subscriptions/client/requests/BulkSwapPlanRequest.ts +++ b/src/api/resources/subscriptions/client/requests/BulkSwapPlanRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/subscriptions/client/requests/CancelSubscriptionsRequest.ts b/src/api/resources/subscriptions/client/requests/CancelSubscriptionsRequest.ts index 5009ed8d8..5586bc2e5 100644 --- a/src/api/resources/subscriptions/client/requests/CancelSubscriptionsRequest.ts +++ b/src/api/resources/subscriptions/client/requests/CancelSubscriptionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface CancelSubscriptionsRequest { - /** The ID of the subscription to cancel. */ + /** + * The ID of the subscription to cancel. + */ subscriptionId: string; } diff --git a/src/api/resources/subscriptions/client/requests/ChangeBillingAnchorDateRequest.ts b/src/api/resources/subscriptions/client/requests/ChangeBillingAnchorDateRequest.ts index e53f6a603..9c715ee5f 100644 --- a/src/api/resources/subscriptions/client/requests/ChangeBillingAnchorDateRequest.ts +++ b/src/api/resources/subscriptions/client/requests/ChangeBillingAnchorDateRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,7 +10,9 @@ * } */ export interface ChangeBillingAnchorDateRequest { - /** The ID of the subscription to update the billing anchor date. */ + /** + * The ID of the subscription to update the billing anchor date. + */ subscriptionId: string; /** The anchor day for the billing cycle. */ monthlyBillingAnchorDate?: number | null; diff --git a/src/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.ts b/src/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.ts index b15df0699..0c9cffa77 100644 --- a/src/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.ts +++ b/src/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -49,7 +51,7 @@ export interface CreateSubscriptionRequest { * at the canceled date and the subscriber is sent a prorated invoice at the beginning of the canceled cycle. * * When the subscription plan of the newly created subscription has a fixed number of cycles and the `canceled_date` - * occurs before the subscription plan completes, the specified `canceled_date` sets the date when the subscription + * occurs before the subscription plan expires, the specified `canceled_date` sets the date when the subscription * stops through the end of the last cycle. */ canceledDate?: string; diff --git a/src/api/resources/subscriptions/client/requests/DeleteActionSubscriptionsRequest.ts b/src/api/resources/subscriptions/client/requests/DeleteActionSubscriptionsRequest.ts index 1dd5187ba..efbc64238 100644 --- a/src/api/resources/subscriptions/client/requests/DeleteActionSubscriptionsRequest.ts +++ b/src/api/resources/subscriptions/client/requests/DeleteActionSubscriptionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,8 +10,12 @@ * } */ export interface DeleteActionSubscriptionsRequest { - /** The ID of the subscription the targeted action is to act upon. */ + /** + * The ID of the subscription the targeted action is to act upon. + */ subscriptionId: string; - /** The ID of the targeted action to be deleted. */ + /** + * The ID of the targeted action to be deleted. + */ actionId: string; } diff --git a/src/api/resources/subscriptions/client/requests/GetSubscriptionsRequest.ts b/src/api/resources/subscriptions/client/requests/GetSubscriptionsRequest.ts index 5f4cf252f..4604762dd 100644 --- a/src/api/resources/subscriptions/client/requests/GetSubscriptionsRequest.ts +++ b/src/api/resources/subscriptions/client/requests/GetSubscriptionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,7 +10,9 @@ * } */ export interface GetSubscriptionsRequest { - /** The ID of the subscription to retrieve. */ + /** + * The ID of the subscription to retrieve. + */ subscriptionId: string; /** * A query parameter to specify related information to be included in the response. diff --git a/src/api/resources/subscriptions/client/requests/ListEventsSubscriptionsRequest.ts b/src/api/resources/subscriptions/client/requests/ListEventsSubscriptionsRequest.ts index 06804a947..d2597584e 100644 --- a/src/api/resources/subscriptions/client/requests/ListEventsSubscriptionsRequest.ts +++ b/src/api/resources/subscriptions/client/requests/ListEventsSubscriptionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -9,7 +11,9 @@ * } */ export interface ListEventsSubscriptionsRequest { - /** The ID of the subscription to retrieve the events for. */ + /** + * The ID of the subscription to retrieve the events for. + */ subscriptionId: string; /** * When the total number of resulting subscription events exceeds the limit of a paged response, diff --git a/src/api/resources/subscriptions/client/requests/PauseSubscriptionRequest.ts b/src/api/resources/subscriptions/client/requests/PauseSubscriptionRequest.ts index c1ed4a63e..1b7358f4f 100644 --- a/src/api/resources/subscriptions/client/requests/PauseSubscriptionRequest.ts +++ b/src/api/resources/subscriptions/client/requests/PauseSubscriptionRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -9,7 +11,9 @@ import type * as Square from "../../../../index"; * } */ export interface PauseSubscriptionRequest { - /** The ID of the subscription to pause. */ + /** + * The ID of the subscription to pause. + */ subscriptionId: string; /** * The `YYYY-MM-DD`-formatted date when the scheduled `PAUSE` action takes place on the subscription. diff --git a/src/api/resources/subscriptions/client/requests/ResumeSubscriptionRequest.ts b/src/api/resources/subscriptions/client/requests/ResumeSubscriptionRequest.ts index c1d6e22b4..b0c1e5f91 100644 --- a/src/api/resources/subscriptions/client/requests/ResumeSubscriptionRequest.ts +++ b/src/api/resources/subscriptions/client/requests/ResumeSubscriptionRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -9,7 +11,9 @@ import type * as Square from "../../../../index"; * } */ export interface ResumeSubscriptionRequest { - /** The ID of the subscription to resume. */ + /** + * The ID of the subscription to resume. + */ subscriptionId: string; /** The `YYYY-MM-DD`-formatted date when the subscription reactivated. */ resumeEffectiveDate?: string | null; diff --git a/src/api/resources/subscriptions/client/requests/SearchSubscriptionsRequest.ts b/src/api/resources/subscriptions/client/requests/SearchSubscriptionsRequest.ts index 0c96b9674..cf4de613c 100644 --- a/src/api/resources/subscriptions/client/requests/SearchSubscriptionsRequest.ts +++ b/src/api/resources/subscriptions/client/requests/SearchSubscriptionsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/subscriptions/client/requests/SwapPlanRequest.ts b/src/api/resources/subscriptions/client/requests/SwapPlanRequest.ts index ede85dea6..0b09db27f 100644 --- a/src/api/resources/subscriptions/client/requests/SwapPlanRequest.ts +++ b/src/api/resources/subscriptions/client/requests/SwapPlanRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -14,7 +16,9 @@ import type * as Square from "../../../../index"; * } */ export interface SwapPlanRequest { - /** The ID of the subscription to swap the subscription plan for. */ + /** + * The ID of the subscription to swap the subscription plan for. + */ subscriptionId: string; /** * The ID of the new subscription plan variation. diff --git a/src/api/resources/subscriptions/client/requests/UpdateSubscriptionRequest.ts b/src/api/resources/subscriptions/client/requests/UpdateSubscriptionRequest.ts index 62a96480b..2f2e513e5 100644 --- a/src/api/resources/subscriptions/client/requests/UpdateSubscriptionRequest.ts +++ b/src/api/resources/subscriptions/client/requests/UpdateSubscriptionRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -12,7 +14,9 @@ import type * as Square from "../../../../index"; * } */ export interface UpdateSubscriptionRequest { - /** The ID of the subscription to update. */ + /** + * The ID of the subscription to update. + */ subscriptionId: string; /** * The subscription object containing the current version, and fields to update. diff --git a/src/api/resources/subscriptions/client/requests/index.ts b/src/api/resources/subscriptions/client/requests/index.ts index edcd52789..e79da906c 100644 --- a/src/api/resources/subscriptions/client/requests/index.ts +++ b/src/api/resources/subscriptions/client/requests/index.ts @@ -1,12 +1,12 @@ -export type { BulkSwapPlanRequest } from "./BulkSwapPlanRequest"; -export type { CancelSubscriptionsRequest } from "./CancelSubscriptionsRequest"; -export type { ChangeBillingAnchorDateRequest } from "./ChangeBillingAnchorDateRequest"; -export type { CreateSubscriptionRequest } from "./CreateSubscriptionRequest"; -export type { DeleteActionSubscriptionsRequest } from "./DeleteActionSubscriptionsRequest"; -export type { GetSubscriptionsRequest } from "./GetSubscriptionsRequest"; -export type { ListEventsSubscriptionsRequest } from "./ListEventsSubscriptionsRequest"; -export type { PauseSubscriptionRequest } from "./PauseSubscriptionRequest"; -export type { ResumeSubscriptionRequest } from "./ResumeSubscriptionRequest"; -export type { SearchSubscriptionsRequest } from "./SearchSubscriptionsRequest"; -export type { SwapPlanRequest } from "./SwapPlanRequest"; -export type { UpdateSubscriptionRequest } from "./UpdateSubscriptionRequest"; +export { type CreateSubscriptionRequest } from "./CreateSubscriptionRequest"; +export { type BulkSwapPlanRequest } from "./BulkSwapPlanRequest"; +export { type SearchSubscriptionsRequest } from "./SearchSubscriptionsRequest"; +export { type GetSubscriptionsRequest } from "./GetSubscriptionsRequest"; +export { type UpdateSubscriptionRequest } from "./UpdateSubscriptionRequest"; +export { type DeleteActionSubscriptionsRequest } from "./DeleteActionSubscriptionsRequest"; +export { type ChangeBillingAnchorDateRequest } from "./ChangeBillingAnchorDateRequest"; +export { type CancelSubscriptionsRequest } from "./CancelSubscriptionsRequest"; +export { type ListEventsSubscriptionsRequest } from "./ListEventsSubscriptionsRequest"; +export { type PauseSubscriptionRequest } from "./PauseSubscriptionRequest"; +export { type ResumeSubscriptionRequest } from "./ResumeSubscriptionRequest"; +export { type SwapPlanRequest } from "./SwapPlanRequest"; diff --git a/src/api/resources/team/client/Client.ts b/src/api/resources/team/client/Client.ts index 44884116b..e7cb54e54 100644 --- a/src/api/resources/team/client/Client.ts +++ b/src/api/resources/team/client/Client.ts @@ -1,32 +1,53 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; +import * as errors from "../../../../errors/index"; -export declare namespace TeamClient { - export interface Options extends BaseClientOptions {} +export declare namespace Team { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class TeamClient { - protected readonly _options: TeamClient.Options; +export class Team { + protected readonly _options: Team.Options; - constructor(options: TeamClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Team.Options = {}) { + this._options = _options; } /** * Lists jobs in a seller account. Results are sorted by title in ascending order. * * @param {Square.ListJobsRequest} request - * @param {TeamClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Team.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.team.listJobs({ @@ -35,29 +56,21 @@ export class TeamClient { */ public listJobs( request: Square.ListJobsRequest = {}, - requestOptions?: TeamClient.RequestOptions, + requestOptions?: Team.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__listJobs(request, requestOptions)); } private async __listJobs( request: Square.ListJobsRequest = {}, - requestOptions?: TeamClient.RequestOptions, + requestOptions?: Team.RequestOptions, ): Promise> { const { cursor } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -66,13 +79,18 @@ export class TeamClient { "v2/team-members/jobs", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -117,7 +135,7 @@ export class TeamClient { * compensation is defined in a [job assignment](entity:JobAssignment) in a team member's wage setting. * * @param {Square.CreateJobRequest} request - * @param {TeamClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Team.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.team.createJob({ @@ -130,23 +148,15 @@ export class TeamClient { */ public createJob( request: Square.CreateJobRequest, - requestOptions?: TeamClient.RequestOptions, + requestOptions?: Team.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createJob(request, requestOptions)); } private async __createJob( request: Square.CreateJobRequest, - requestOptions?: TeamClient.RequestOptions, + requestOptions?: Team.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -155,19 +165,23 @@ export class TeamClient { "v2/team-members/jobs", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateJobRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -211,7 +225,7 @@ export class TeamClient { * Retrieves a specified job. * * @param {Square.RetrieveJobRequest} request - * @param {TeamClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Team.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.team.retrieveJob({ @@ -220,39 +234,35 @@ export class TeamClient { */ public retrieveJob( request: Square.RetrieveJobRequest, - requestOptions?: TeamClient.RequestOptions, + requestOptions?: Team.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__retrieveJob(request, requestOptions)); } private async __retrieveJob( request: Square.RetrieveJobRequest, - requestOptions?: TeamClient.RequestOptions, + requestOptions?: Team.RequestOptions, ): Promise> { const { jobId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/team-members/jobs/${core.url.encodePathParam(jobId)}`, + `v2/team-members/jobs/${encodeURIComponent(jobId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -300,7 +310,7 @@ export class TeamClient { * tip eligibility propagate to all `TeamMemberWage` objects that reference the job ID. * * @param {Square.UpdateJobRequest} request - * @param {TeamClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Team.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.team.updateJob({ @@ -313,45 +323,41 @@ export class TeamClient { */ public updateJob( request: Square.UpdateJobRequest, - requestOptions?: TeamClient.RequestOptions, + requestOptions?: Team.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__updateJob(request, requestOptions)); } private async __updateJob( request: Square.UpdateJobRequest, - requestOptions?: TeamClient.RequestOptions, + requestOptions?: Team.RequestOptions, ): Promise> { const { jobId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/team-members/jobs/${core.url.encodePathParam(jobId)}`, + `v2/team-members/jobs/${encodeURIComponent(jobId)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateJobRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -394,7 +400,7 @@ export class TeamClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/team/client/index.ts b/src/api/resources/team/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/team/client/index.ts +++ b/src/api/resources/team/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/team/client/requests/CreateJobRequest.ts b/src/api/resources/team/client/requests/CreateJobRequest.ts index 22f281a72..168657c5b 100644 --- a/src/api/resources/team/client/requests/CreateJobRequest.ts +++ b/src/api/resources/team/client/requests/CreateJobRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/team/client/requests/ListJobsRequest.ts b/src/api/resources/team/client/requests/ListJobsRequest.ts index e7f9edc3e..0202a0ebc 100644 --- a/src/api/resources/team/client/requests/ListJobsRequest.ts +++ b/src/api/resources/team/client/requests/ListJobsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/team/client/requests/RetrieveJobRequest.ts b/src/api/resources/team/client/requests/RetrieveJobRequest.ts index 8088ca5f2..a4b709eb1 100644 --- a/src/api/resources/team/client/requests/RetrieveJobRequest.ts +++ b/src/api/resources/team/client/requests/RetrieveJobRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface RetrieveJobRequest { - /** The ID of the job to retrieve. */ + /** + * The ID of the job to retrieve. + */ jobId: string; } diff --git a/src/api/resources/team/client/requests/UpdateJobRequest.ts b/src/api/resources/team/client/requests/UpdateJobRequest.ts index 36a9aa5cf..2889c5bab 100644 --- a/src/api/resources/team/client/requests/UpdateJobRequest.ts +++ b/src/api/resources/team/client/requests/UpdateJobRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -13,7 +15,9 @@ import type * as Square from "../../../../index"; * } */ export interface UpdateJobRequest { - /** The ID of the job to update. */ + /** + * The ID of the job to update. + */ jobId: string; /** * The job with the updated fields, either `title`, `is_tip_eligible`, or both. Only changed fields need diff --git a/src/api/resources/team/client/requests/index.ts b/src/api/resources/team/client/requests/index.ts index 2201831df..1ade5cbcb 100644 --- a/src/api/resources/team/client/requests/index.ts +++ b/src/api/resources/team/client/requests/index.ts @@ -1,4 +1,4 @@ -export type { CreateJobRequest } from "./CreateJobRequest"; -export type { ListJobsRequest } from "./ListJobsRequest"; -export type { RetrieveJobRequest } from "./RetrieveJobRequest"; -export type { UpdateJobRequest } from "./UpdateJobRequest"; +export { type ListJobsRequest } from "./ListJobsRequest"; +export { type CreateJobRequest } from "./CreateJobRequest"; +export { type RetrieveJobRequest } from "./RetrieveJobRequest"; +export { type UpdateJobRequest } from "./UpdateJobRequest"; diff --git a/src/api/resources/teamMembers/client/Client.ts b/src/api/resources/teamMembers/client/Client.ts index f1a7c5af1..ec4a7de87 100644 --- a/src/api/resources/teamMembers/client/Client.ts +++ b/src/api/resources/teamMembers/client/Client.ts @@ -1,31 +1,52 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; -import { WageSettingClient } from "../resources/wageSetting/client/Client"; - -export declare namespace TeamMembersClient { - export interface Options extends BaseClientOptions {} +import * as errors from "../../../../errors/index"; +import { WageSetting } from "../resources/wageSetting/client/Client"; + +export declare namespace TeamMembers { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class TeamMembersClient { - protected readonly _options: TeamMembersClient.Options; - protected _wageSetting: WageSettingClient | undefined; +export class TeamMembers { + protected readonly _options: TeamMembers.Options; + protected _wageSetting: WageSetting | undefined; - constructor(options: TeamMembersClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: TeamMembers.Options = {}) { + this._options = _options; } - public get wageSetting(): WageSettingClient { - return (this._wageSetting ??= new WageSettingClient(this._options)); + public get wageSetting(): WageSetting { + return (this._wageSetting ??= new WageSetting(this._options)); } /** @@ -37,7 +58,7 @@ export class TeamMembersClient { * Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#createteammember). * * @param {Square.CreateTeamMemberRequest} request - * @param {TeamMembersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {TeamMembers.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.teamMembers.create({ @@ -77,23 +98,15 @@ export class TeamMembersClient { */ public create( request: Square.CreateTeamMemberRequest, - requestOptions?: TeamMembersClient.RequestOptions, + requestOptions?: TeamMembers.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.CreateTeamMemberRequest, - requestOptions?: TeamMembersClient.RequestOptions, + requestOptions?: TeamMembers.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -102,19 +115,23 @@ export class TeamMembersClient { "v2/team-members", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateTeamMemberRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -163,7 +180,7 @@ export class TeamMembersClient { * Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#bulk-create-team-members). * * @param {Square.BatchCreateTeamMembersRequest} request - * @param {TeamMembersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {TeamMembers.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.teamMembers.batchCreate({ @@ -198,23 +215,15 @@ export class TeamMembersClient { */ public batchCreate( request: Square.BatchCreateTeamMembersRequest, - requestOptions?: TeamMembersClient.RequestOptions, + requestOptions?: TeamMembers.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__batchCreate(request, requestOptions)); } private async __batchCreate( request: Square.BatchCreateTeamMembersRequest, - requestOptions?: TeamMembersClient.RequestOptions, + requestOptions?: TeamMembers.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -223,19 +232,23 @@ export class TeamMembersClient { "v2/team-members/bulk-create", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchCreateTeamMembersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -283,7 +296,7 @@ export class TeamMembersClient { * Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#bulk-update-team-members). * * @param {Square.BatchUpdateTeamMembersRequest} request - * @param {TeamMembersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {TeamMembers.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.teamMembers.batchUpdate({ @@ -322,23 +335,15 @@ export class TeamMembersClient { */ public batchUpdate( request: Square.BatchUpdateTeamMembersRequest, - requestOptions?: TeamMembersClient.RequestOptions, + requestOptions?: TeamMembers.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__batchUpdate(request, requestOptions)); } private async __batchUpdate( request: Square.BatchUpdateTeamMembersRequest, - requestOptions?: TeamMembersClient.RequestOptions, + requestOptions?: TeamMembers.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -347,19 +352,23 @@ export class TeamMembersClient { "v2/team-members/bulk-update", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchUpdateTeamMembersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -405,7 +414,7 @@ export class TeamMembersClient { * the team member is the Square account owner. * * @param {Square.SearchTeamMembersRequest} request - * @param {TeamMembersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {TeamMembers.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.teamMembers.search({ @@ -420,23 +429,15 @@ export class TeamMembersClient { */ public search( request: Square.SearchTeamMembersRequest = {}, - requestOptions?: TeamMembersClient.RequestOptions, + requestOptions?: TeamMembers.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__search(request, requestOptions)); } private async __search( request: Square.SearchTeamMembersRequest = {}, - requestOptions?: TeamMembersClient.RequestOptions, + requestOptions?: TeamMembers.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -445,19 +446,23 @@ export class TeamMembersClient { "v2/team-members/search", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchTeamMembersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -502,7 +507,7 @@ export class TeamMembersClient { * Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#retrieve-a-team-member). * * @param {Square.GetTeamMembersRequest} request - * @param {TeamMembersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {TeamMembers.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.teamMembers.get({ @@ -511,39 +516,35 @@ export class TeamMembersClient { */ public get( request: Square.GetTeamMembersRequest, - requestOptions?: TeamMembersClient.RequestOptions, + requestOptions?: TeamMembers.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.GetTeamMembersRequest, - requestOptions?: TeamMembersClient.RequestOptions, + requestOptions?: TeamMembers.RequestOptions, ): Promise> { const { teamMemberId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/team-members/${core.url.encodePathParam(teamMemberId)}`, + `v2/team-members/${encodeURIComponent(teamMemberId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -590,7 +591,7 @@ export class TeamMembersClient { * Learn about [Troubleshooting the Team API](https://developer.squareup.com/docs/team/troubleshooting#update-a-team-member). * * @param {Square.UpdateTeamMembersRequest} request - * @param {TeamMembersClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {TeamMembers.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.teamMembers.update({ @@ -632,45 +633,41 @@ export class TeamMembersClient { */ public update( request: Square.UpdateTeamMembersRequest, - requestOptions?: TeamMembersClient.RequestOptions, + requestOptions?: TeamMembers.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); } private async __update( request: Square.UpdateTeamMembersRequest, - requestOptions?: TeamMembersClient.RequestOptions, + requestOptions?: TeamMembers.RequestOptions, ): Promise> { const { teamMemberId, body: _body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/team-members/${core.url.encodePathParam(teamMemberId)}`, + `v2/team-members/${encodeURIComponent(teamMemberId)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateTeamMemberRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -713,7 +710,7 @@ export class TeamMembersClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/teamMembers/client/index.ts b/src/api/resources/teamMembers/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/teamMembers/client/index.ts +++ b/src/api/resources/teamMembers/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/teamMembers/client/requests/BatchCreateTeamMembersRequest.ts b/src/api/resources/teamMembers/client/requests/BatchCreateTeamMembersRequest.ts index 1a9433502..b14d89bb5 100644 --- a/src/api/resources/teamMembers/client/requests/BatchCreateTeamMembersRequest.ts +++ b/src/api/resources/teamMembers/client/requests/BatchCreateTeamMembersRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/teamMembers/client/requests/BatchUpdateTeamMembersRequest.ts b/src/api/resources/teamMembers/client/requests/BatchUpdateTeamMembersRequest.ts index 1821c3040..a29378d92 100644 --- a/src/api/resources/teamMembers/client/requests/BatchUpdateTeamMembersRequest.ts +++ b/src/api/resources/teamMembers/client/requests/BatchUpdateTeamMembersRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/teamMembers/client/requests/GetTeamMembersRequest.ts b/src/api/resources/teamMembers/client/requests/GetTeamMembersRequest.ts index e3c930549..a8b345f61 100644 --- a/src/api/resources/teamMembers/client/requests/GetTeamMembersRequest.ts +++ b/src/api/resources/teamMembers/client/requests/GetTeamMembersRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetTeamMembersRequest { - /** The ID of the team member to retrieve. */ + /** + * The ID of the team member to retrieve. + */ teamMemberId: string; } diff --git a/src/api/resources/teamMembers/client/requests/SearchTeamMembersRequest.ts b/src/api/resources/teamMembers/client/requests/SearchTeamMembersRequest.ts index c79733dc7..2e097261d 100644 --- a/src/api/resources/teamMembers/client/requests/SearchTeamMembersRequest.ts +++ b/src/api/resources/teamMembers/client/requests/SearchTeamMembersRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/teamMembers/client/requests/UpdateTeamMembersRequest.ts b/src/api/resources/teamMembers/client/requests/UpdateTeamMembersRequest.ts index b85d339f5..7c8339675 100644 --- a/src/api/resources/teamMembers/client/requests/UpdateTeamMembersRequest.ts +++ b/src/api/resources/teamMembers/client/requests/UpdateTeamMembersRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -42,7 +44,9 @@ import type * as Square from "../../../../index"; * } */ export interface UpdateTeamMembersRequest { - /** The ID of the team member to update. */ + /** + * The ID of the team member to update. + */ teamMemberId: string; body: Square.UpdateTeamMemberRequest; } diff --git a/src/api/resources/teamMembers/client/requests/index.ts b/src/api/resources/teamMembers/client/requests/index.ts index 499dfd8c1..64e675afc 100644 --- a/src/api/resources/teamMembers/client/requests/index.ts +++ b/src/api/resources/teamMembers/client/requests/index.ts @@ -1,5 +1,5 @@ -export type { BatchCreateTeamMembersRequest } from "./BatchCreateTeamMembersRequest"; -export type { BatchUpdateTeamMembersRequest } from "./BatchUpdateTeamMembersRequest"; -export type { GetTeamMembersRequest } from "./GetTeamMembersRequest"; -export type { SearchTeamMembersRequest } from "./SearchTeamMembersRequest"; -export type { UpdateTeamMembersRequest } from "./UpdateTeamMembersRequest"; +export { type BatchCreateTeamMembersRequest } from "./BatchCreateTeamMembersRequest"; +export { type BatchUpdateTeamMembersRequest } from "./BatchUpdateTeamMembersRequest"; +export { type SearchTeamMembersRequest } from "./SearchTeamMembersRequest"; +export { type GetTeamMembersRequest } from "./GetTeamMembersRequest"; +export { type UpdateTeamMembersRequest } from "./UpdateTeamMembersRequest"; diff --git a/src/api/resources/teamMembers/resources/wageSetting/client/Client.ts b/src/api/resources/teamMembers/resources/wageSetting/client/Client.ts index 56f3ebe62..8ccbbd410 100644 --- a/src/api/resources/teamMembers/resources/wageSetting/client/Client.ts +++ b/src/api/resources/teamMembers/resources/wageSetting/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace WageSettingClient { - export interface Options extends BaseClientOptions {} +export declare namespace WageSetting { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class WageSettingClient { - protected readonly _options: WageSettingClient.Options; +export class WageSetting { + protected readonly _options: WageSetting.Options; - constructor(options: WageSettingClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: WageSetting.Options = {}) { + this._options = _options; } /** @@ -31,7 +52,7 @@ export class WageSettingClient { * to get this information directly from the `TeamMember.wage_setting` field. * * @param {Square.teamMembers.GetWageSettingRequest} request - * @param {WageSettingClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {WageSetting.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.teamMembers.wageSetting.get({ @@ -40,39 +61,35 @@ export class WageSettingClient { */ public get( request: Square.teamMembers.GetWageSettingRequest, - requestOptions?: WageSettingClient.RequestOptions, + requestOptions?: WageSetting.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.teamMembers.GetWageSettingRequest, - requestOptions?: WageSettingClient.RequestOptions, + requestOptions?: WageSetting.RequestOptions, ): Promise> { const { teamMemberId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/team-members/${core.url.encodePathParam(teamMemberId)}/wage-setting`, + `v2/team-members/${encodeURIComponent(teamMemberId)}/wage-setting`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -125,7 +142,7 @@ export class WageSettingClient { * to manage the `TeamMember.wage_setting` field directly. * * @param {Square.teamMembers.UpdateWageSettingRequest} request - * @param {WageSettingClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {WageSetting.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.teamMembers.wageSetting.update({ @@ -153,45 +170,41 @@ export class WageSettingClient { */ public update( request: Square.teamMembers.UpdateWageSettingRequest, - requestOptions?: WageSettingClient.RequestOptions, + requestOptions?: WageSetting.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); } private async __update( request: Square.teamMembers.UpdateWageSettingRequest, - requestOptions?: WageSettingClient.RequestOptions, + requestOptions?: WageSetting.RequestOptions, ): Promise> { const { teamMemberId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/team-members/${core.url.encodePathParam(teamMemberId)}/wage-setting`, + `v2/team-members/${encodeURIComponent(teamMemberId)}/wage-setting`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.teamMembers.UpdateWageSettingRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -234,7 +247,7 @@ export class WageSettingClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/teamMembers/resources/wageSetting/client/index.ts b/src/api/resources/teamMembers/resources/wageSetting/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/teamMembers/resources/wageSetting/client/index.ts +++ b/src/api/resources/teamMembers/resources/wageSetting/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/teamMembers/resources/wageSetting/client/requests/GetWageSettingRequest.ts b/src/api/resources/teamMembers/resources/wageSetting/client/requests/GetWageSettingRequest.ts index b67341f8f..81df49508 100644 --- a/src/api/resources/teamMembers/resources/wageSetting/client/requests/GetWageSettingRequest.ts +++ b/src/api/resources/teamMembers/resources/wageSetting/client/requests/GetWageSettingRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetWageSettingRequest { - /** The ID of the team member for which to retrieve the wage setting. */ + /** + * The ID of the team member for which to retrieve the wage setting. + */ teamMemberId: string; } diff --git a/src/api/resources/teamMembers/resources/wageSetting/client/requests/UpdateWageSettingRequest.ts b/src/api/resources/teamMembers/resources/wageSetting/client/requests/UpdateWageSettingRequest.ts index a8c1df38f..b352121a3 100644 --- a/src/api/resources/teamMembers/resources/wageSetting/client/requests/UpdateWageSettingRequest.ts +++ b/src/api/resources/teamMembers/resources/wageSetting/client/requests/UpdateWageSettingRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -28,7 +30,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface UpdateWageSettingRequest { - /** The ID of the team member for which to update the `WageSetting` object. */ + /** + * The ID of the team member for which to update the `WageSetting` object. + */ teamMemberId: string; /** * The complete `WageSetting` object. For all job assignments, specify one of the following: diff --git a/src/api/resources/teamMembers/resources/wageSetting/client/requests/index.ts b/src/api/resources/teamMembers/resources/wageSetting/client/requests/index.ts index fa5ad7a7d..68850acfa 100644 --- a/src/api/resources/teamMembers/resources/wageSetting/client/requests/index.ts +++ b/src/api/resources/teamMembers/resources/wageSetting/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { GetWageSettingRequest } from "./GetWageSettingRequest"; -export type { UpdateWageSettingRequest } from "./UpdateWageSettingRequest"; +export { type GetWageSettingRequest } from "./GetWageSettingRequest"; +export { type UpdateWageSettingRequest } from "./UpdateWageSettingRequest"; diff --git a/src/api/resources/terminal/client/Client.ts b/src/api/resources/terminal/client/Client.ts index 8b0d70f68..83250f89e 100644 --- a/src/api/resources/terminal/client/Client.ts +++ b/src/api/resources/terminal/client/Client.ts @@ -1,43 +1,64 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; -import { ActionsClient } from "../resources/actions/client/Client"; -import { CheckoutsClient } from "../resources/checkouts/client/Client"; -import { RefundsClient } from "../resources/refunds/client/Client"; +import * as errors from "../../../../errors/index"; +import { Actions } from "../resources/actions/client/Client"; +import { Checkouts } from "../resources/checkouts/client/Client"; +import { Refunds } from "../resources/refunds/client/Client"; -export declare namespace TerminalClient { - export interface Options extends BaseClientOptions {} +export declare namespace Terminal { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class TerminalClient { - protected readonly _options: TerminalClient.Options; - protected _actions: ActionsClient | undefined; - protected _checkouts: CheckoutsClient | undefined; - protected _refunds: RefundsClient | undefined; +export class Terminal { + protected readonly _options: Terminal.Options; + protected _actions: Actions | undefined; + protected _checkouts: Checkouts | undefined; + protected _refunds: Refunds | undefined; - constructor(options: TerminalClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Terminal.Options = {}) { + this._options = _options; } - public get actions(): ActionsClient { - return (this._actions ??= new ActionsClient(this._options)); + public get actions(): Actions { + return (this._actions ??= new Actions(this._options)); } - public get checkouts(): CheckoutsClient { - return (this._checkouts ??= new CheckoutsClient(this._options)); + public get checkouts(): Checkouts { + return (this._checkouts ??= new Checkouts(this._options)); } - public get refunds(): RefundsClient { - return (this._refunds ??= new RefundsClient(this._options)); + public get refunds(): Refunds { + return (this._refunds ??= new Refunds(this._options)); } /** @@ -46,7 +67,7 @@ export class TerminalClient { * See [Link and Dismiss Actions](https://developer.squareup.com/docs/terminal-api/advanced-features/custom-workflows/link-and-dismiss-actions) for more details. * * @param {Square.DismissTerminalActionRequest} request - * @param {TerminalClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Terminal.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.terminal.dismissTerminalAction({ @@ -55,39 +76,35 @@ export class TerminalClient { */ public dismissTerminalAction( request: Square.DismissTerminalActionRequest, - requestOptions?: TerminalClient.RequestOptions, + requestOptions?: Terminal.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__dismissTerminalAction(request, requestOptions)); } private async __dismissTerminalAction( request: Square.DismissTerminalActionRequest, - requestOptions?: TerminalClient.RequestOptions, + requestOptions?: Terminal.RequestOptions, ): Promise> { const { actionId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/terminals/actions/${core.url.encodePathParam(actionId)}/dismiss`, + `v2/terminals/actions/${encodeURIComponent(actionId)}/dismiss`, ), method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -133,7 +150,7 @@ export class TerminalClient { * Dismisses a Terminal checkout request if the status and type of the request permits it. * * @param {Square.DismissTerminalCheckoutRequest} request - * @param {TerminalClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Terminal.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.terminal.dismissTerminalCheckout({ @@ -142,39 +159,35 @@ export class TerminalClient { */ public dismissTerminalCheckout( request: Square.DismissTerminalCheckoutRequest, - requestOptions?: TerminalClient.RequestOptions, + requestOptions?: Terminal.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__dismissTerminalCheckout(request, requestOptions)); } private async __dismissTerminalCheckout( request: Square.DismissTerminalCheckoutRequest, - requestOptions?: TerminalClient.RequestOptions, + requestOptions?: Terminal.RequestOptions, ): Promise> { const { checkoutId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/terminals/checkouts/${core.url.encodePathParam(checkoutId)}/dismiss`, + `v2/terminals/checkouts/${encodeURIComponent(checkoutId)}/dismiss`, ), method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -220,7 +233,7 @@ export class TerminalClient { * Dismisses a Terminal refund request if the status and type of the request permits it. * * @param {Square.DismissTerminalRefundRequest} request - * @param {TerminalClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Terminal.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.terminal.dismissTerminalRefund({ @@ -229,39 +242,35 @@ export class TerminalClient { */ public dismissTerminalRefund( request: Square.DismissTerminalRefundRequest, - requestOptions?: TerminalClient.RequestOptions, + requestOptions?: Terminal.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__dismissTerminalRefund(request, requestOptions)); } private async __dismissTerminalRefund( request: Square.DismissTerminalRefundRequest, - requestOptions?: TerminalClient.RequestOptions, + requestOptions?: Terminal.RequestOptions, ): Promise> { const { terminalRefundId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/terminals/refunds/${core.url.encodePathParam(terminalRefundId)}/dismiss`, + `v2/terminals/refunds/${encodeURIComponent(terminalRefundId)}/dismiss`, ), method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -304,7 +313,7 @@ export class TerminalClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/terminal/client/index.ts b/src/api/resources/terminal/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/terminal/client/index.ts +++ b/src/api/resources/terminal/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/terminal/client/requests/DismissTerminalActionRequest.ts b/src/api/resources/terminal/client/requests/DismissTerminalActionRequest.ts index 34d00e7e1..950b3ab0c 100644 --- a/src/api/resources/terminal/client/requests/DismissTerminalActionRequest.ts +++ b/src/api/resources/terminal/client/requests/DismissTerminalActionRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface DismissTerminalActionRequest { - /** Unique ID for the `TerminalAction` associated with the action to be dismissed. */ + /** + * Unique ID for the `TerminalAction` associated with the action to be dismissed. + */ actionId: string; } diff --git a/src/api/resources/terminal/client/requests/DismissTerminalCheckoutRequest.ts b/src/api/resources/terminal/client/requests/DismissTerminalCheckoutRequest.ts index 3dc136868..3ff7298a2 100644 --- a/src/api/resources/terminal/client/requests/DismissTerminalCheckoutRequest.ts +++ b/src/api/resources/terminal/client/requests/DismissTerminalCheckoutRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface DismissTerminalCheckoutRequest { - /** Unique ID for the `TerminalCheckout` associated with the checkout to be dismissed. */ + /** + * Unique ID for the `TerminalCheckout` associated with the checkout to be dismissed. + */ checkoutId: string; } diff --git a/src/api/resources/terminal/client/requests/DismissTerminalRefundRequest.ts b/src/api/resources/terminal/client/requests/DismissTerminalRefundRequest.ts index 7b0448f78..699bf5b40 100644 --- a/src/api/resources/terminal/client/requests/DismissTerminalRefundRequest.ts +++ b/src/api/resources/terminal/client/requests/DismissTerminalRefundRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface DismissTerminalRefundRequest { - /** Unique ID for the `TerminalRefund` associated with the refund to be dismissed. */ + /** + * Unique ID for the `TerminalRefund` associated with the refund to be dismissed. + */ terminalRefundId: string; } diff --git a/src/api/resources/terminal/client/requests/index.ts b/src/api/resources/terminal/client/requests/index.ts index 8cf2ece59..f3e44661a 100644 --- a/src/api/resources/terminal/client/requests/index.ts +++ b/src/api/resources/terminal/client/requests/index.ts @@ -1,3 +1,3 @@ -export type { DismissTerminalActionRequest } from "./DismissTerminalActionRequest"; -export type { DismissTerminalCheckoutRequest } from "./DismissTerminalCheckoutRequest"; -export type { DismissTerminalRefundRequest } from "./DismissTerminalRefundRequest"; +export { type DismissTerminalActionRequest } from "./DismissTerminalActionRequest"; +export { type DismissTerminalCheckoutRequest } from "./DismissTerminalCheckoutRequest"; +export { type DismissTerminalRefundRequest } from "./DismissTerminalRefundRequest"; diff --git a/src/api/resources/terminal/resources/actions/client/Client.ts b/src/api/resources/terminal/resources/actions/client/Client.ts index 58fd69a33..f0b223613 100644 --- a/src/api/resources/terminal/resources/actions/client/Client.ts +++ b/src/api/resources/terminal/resources/actions/client/Client.ts @@ -1,32 +1,53 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace ActionsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Actions { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class ActionsClient { - protected readonly _options: ActionsClient.Options; +export class Actions { + protected readonly _options: Actions.Options; - constructor(options: ActionsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Actions.Options = {}) { + this._options = _options; } /** * Creates a Terminal action request and sends it to the specified device. * * @param {Square.terminal.CreateTerminalActionRequest} request - * @param {ActionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Actions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.terminal.actions.create({ @@ -44,23 +65,15 @@ export class ActionsClient { */ public create( request: Square.terminal.CreateTerminalActionRequest, - requestOptions?: ActionsClient.RequestOptions, + requestOptions?: Actions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.terminal.CreateTerminalActionRequest, - requestOptions?: ActionsClient.RequestOptions, + requestOptions?: Actions.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -69,19 +82,23 @@ export class ActionsClient { "v2/terminals/actions", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.terminal.CreateTerminalActionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -125,7 +142,7 @@ export class ActionsClient { * Retrieves a filtered list of Terminal action requests created by the account making the request. Terminal action requests are available for 30 days. * * @param {Square.terminal.SearchTerminalActionsRequest} request - * @param {ActionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Actions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.terminal.actions.search({ @@ -144,23 +161,15 @@ export class ActionsClient { */ public search( request: Square.terminal.SearchTerminalActionsRequest = {}, - requestOptions?: ActionsClient.RequestOptions, + requestOptions?: Actions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__search(request, requestOptions)); } private async __search( request: Square.terminal.SearchTerminalActionsRequest = {}, - requestOptions?: ActionsClient.RequestOptions, + requestOptions?: Actions.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -169,19 +178,23 @@ export class ActionsClient { "v2/terminals/actions/search", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.terminal.SearchTerminalActionsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -225,7 +238,7 @@ export class ActionsClient { * Retrieves a Terminal action request by `action_id`. Terminal action requests are available for 30 days. * * @param {Square.terminal.GetActionsRequest} request - * @param {ActionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Actions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.terminal.actions.get({ @@ -234,39 +247,35 @@ export class ActionsClient { */ public get( request: Square.terminal.GetActionsRequest, - requestOptions?: ActionsClient.RequestOptions, + requestOptions?: Actions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.terminal.GetActionsRequest, - requestOptions?: ActionsClient.RequestOptions, + requestOptions?: Actions.RequestOptions, ): Promise> { const { actionId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/terminals/actions/${core.url.encodePathParam(actionId)}`, + `v2/terminals/actions/${encodeURIComponent(actionId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -312,7 +321,7 @@ export class ActionsClient { * Cancels a Terminal action request if the status of the request permits it. * * @param {Square.terminal.CancelActionsRequest} request - * @param {ActionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Actions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.terminal.actions.cancel({ @@ -321,39 +330,35 @@ export class ActionsClient { */ public cancel( request: Square.terminal.CancelActionsRequest, - requestOptions?: ActionsClient.RequestOptions, + requestOptions?: Actions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__cancel(request, requestOptions)); } private async __cancel( request: Square.terminal.CancelActionsRequest, - requestOptions?: ActionsClient.RequestOptions, + requestOptions?: Actions.RequestOptions, ): Promise> { const { actionId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/terminals/actions/${core.url.encodePathParam(actionId)}/cancel`, + `v2/terminals/actions/${encodeURIComponent(actionId)}/cancel`, ), method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -396,7 +401,7 @@ export class ActionsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/terminal/resources/actions/client/index.ts b/src/api/resources/terminal/resources/actions/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/terminal/resources/actions/client/index.ts +++ b/src/api/resources/terminal/resources/actions/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/terminal/resources/actions/client/requests/CancelActionsRequest.ts b/src/api/resources/terminal/resources/actions/client/requests/CancelActionsRequest.ts index 466d543a5..e37d98233 100644 --- a/src/api/resources/terminal/resources/actions/client/requests/CancelActionsRequest.ts +++ b/src/api/resources/terminal/resources/actions/client/requests/CancelActionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface CancelActionsRequest { - /** Unique ID for the desired `TerminalAction`. */ + /** + * Unique ID for the desired `TerminalAction`. + */ actionId: string; } diff --git a/src/api/resources/terminal/resources/actions/client/requests/CreateTerminalActionRequest.ts b/src/api/resources/terminal/resources/actions/client/requests/CreateTerminalActionRequest.ts index 5017c0735..95d1c87d1 100644 --- a/src/api/resources/terminal/resources/actions/client/requests/CreateTerminalActionRequest.ts +++ b/src/api/resources/terminal/resources/actions/client/requests/CreateTerminalActionRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/terminal/resources/actions/client/requests/GetActionsRequest.ts b/src/api/resources/terminal/resources/actions/client/requests/GetActionsRequest.ts index 57101abdf..68e93ee26 100644 --- a/src/api/resources/terminal/resources/actions/client/requests/GetActionsRequest.ts +++ b/src/api/resources/terminal/resources/actions/client/requests/GetActionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetActionsRequest { - /** Unique ID for the desired `TerminalAction`. */ + /** + * Unique ID for the desired `TerminalAction`. + */ actionId: string; } diff --git a/src/api/resources/terminal/resources/actions/client/requests/SearchTerminalActionsRequest.ts b/src/api/resources/terminal/resources/actions/client/requests/SearchTerminalActionsRequest.ts index 1539787b4..7b4697a8e 100644 --- a/src/api/resources/terminal/resources/actions/client/requests/SearchTerminalActionsRequest.ts +++ b/src/api/resources/terminal/resources/actions/client/requests/SearchTerminalActionsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/terminal/resources/actions/client/requests/index.ts b/src/api/resources/terminal/resources/actions/client/requests/index.ts index b57544067..1f4d52c70 100644 --- a/src/api/resources/terminal/resources/actions/client/requests/index.ts +++ b/src/api/resources/terminal/resources/actions/client/requests/index.ts @@ -1,4 +1,4 @@ -export type { CancelActionsRequest } from "./CancelActionsRequest"; -export type { CreateTerminalActionRequest } from "./CreateTerminalActionRequest"; -export type { GetActionsRequest } from "./GetActionsRequest"; -export type { SearchTerminalActionsRequest } from "./SearchTerminalActionsRequest"; +export { type CreateTerminalActionRequest } from "./CreateTerminalActionRequest"; +export { type SearchTerminalActionsRequest } from "./SearchTerminalActionsRequest"; +export { type GetActionsRequest } from "./GetActionsRequest"; +export { type CancelActionsRequest } from "./CancelActionsRequest"; diff --git a/src/api/resources/terminal/resources/checkouts/client/Client.ts b/src/api/resources/terminal/resources/checkouts/client/Client.ts index db5d41260..26a594743 100644 --- a/src/api/resources/terminal/resources/checkouts/client/Client.ts +++ b/src/api/resources/terminal/resources/checkouts/client/Client.ts @@ -1,25 +1,46 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace CheckoutsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Checkouts { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class CheckoutsClient { - protected readonly _options: CheckoutsClient.Options; +export class Checkouts { + protected readonly _options: Checkouts.Options; - constructor(options: CheckoutsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Checkouts.Options = {}) { + this._options = _options; } /** @@ -27,7 +48,7 @@ export class CheckoutsClient { * for the requested amount. * * @param {Square.terminal.CreateTerminalCheckoutRequest} request - * @param {CheckoutsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Checkouts.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.terminal.checkouts.create({ @@ -47,23 +68,15 @@ export class CheckoutsClient { */ public create( request: Square.terminal.CreateTerminalCheckoutRequest, - requestOptions?: CheckoutsClient.RequestOptions, + requestOptions?: Checkouts.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.terminal.CreateTerminalCheckoutRequest, - requestOptions?: CheckoutsClient.RequestOptions, + requestOptions?: Checkouts.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -72,19 +85,23 @@ export class CheckoutsClient { "v2/terminals/checkouts", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.terminal.CreateTerminalCheckoutRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -128,7 +145,7 @@ export class CheckoutsClient { * Returns a filtered list of Terminal checkout requests created by the application making the request. Only Terminal checkout requests created for the merchant scoped to the OAuth token are returned. Terminal checkout requests are available for 30 days. * * @param {Square.terminal.SearchTerminalCheckoutsRequest} request - * @param {CheckoutsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Checkouts.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.terminal.checkouts.search({ @@ -142,23 +159,15 @@ export class CheckoutsClient { */ public search( request: Square.terminal.SearchTerminalCheckoutsRequest = {}, - requestOptions?: CheckoutsClient.RequestOptions, + requestOptions?: Checkouts.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__search(request, requestOptions)); } private async __search( request: Square.terminal.SearchTerminalCheckoutsRequest = {}, - requestOptions?: CheckoutsClient.RequestOptions, + requestOptions?: Checkouts.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -167,19 +176,23 @@ export class CheckoutsClient { "v2/terminals/checkouts/search", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.terminal.SearchTerminalCheckoutsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -225,7 +238,7 @@ export class CheckoutsClient { * Retrieves a Terminal checkout request by `checkout_id`. Terminal checkout requests are available for 30 days. * * @param {Square.terminal.GetCheckoutsRequest} request - * @param {CheckoutsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Checkouts.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.terminal.checkouts.get({ @@ -234,39 +247,35 @@ export class CheckoutsClient { */ public get( request: Square.terminal.GetCheckoutsRequest, - requestOptions?: CheckoutsClient.RequestOptions, + requestOptions?: Checkouts.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.terminal.GetCheckoutsRequest, - requestOptions?: CheckoutsClient.RequestOptions, + requestOptions?: Checkouts.RequestOptions, ): Promise> { const { checkoutId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/terminals/checkouts/${core.url.encodePathParam(checkoutId)}`, + `v2/terminals/checkouts/${encodeURIComponent(checkoutId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -312,7 +321,7 @@ export class CheckoutsClient { * Cancels a Terminal checkout request if the status of the request permits it. * * @param {Square.terminal.CancelCheckoutsRequest} request - * @param {CheckoutsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Checkouts.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.terminal.checkouts.cancel({ @@ -321,39 +330,35 @@ export class CheckoutsClient { */ public cancel( request: Square.terminal.CancelCheckoutsRequest, - requestOptions?: CheckoutsClient.RequestOptions, + requestOptions?: Checkouts.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__cancel(request, requestOptions)); } private async __cancel( request: Square.terminal.CancelCheckoutsRequest, - requestOptions?: CheckoutsClient.RequestOptions, + requestOptions?: Checkouts.RequestOptions, ): Promise> { const { checkoutId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/terminals/checkouts/${core.url.encodePathParam(checkoutId)}/cancel`, + `v2/terminals/checkouts/${encodeURIComponent(checkoutId)}/cancel`, ), method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -396,7 +401,7 @@ export class CheckoutsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/terminal/resources/checkouts/client/index.ts b/src/api/resources/terminal/resources/checkouts/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/terminal/resources/checkouts/client/index.ts +++ b/src/api/resources/terminal/resources/checkouts/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/terminal/resources/checkouts/client/requests/CancelCheckoutsRequest.ts b/src/api/resources/terminal/resources/checkouts/client/requests/CancelCheckoutsRequest.ts index 453a6e61a..a346b1067 100644 --- a/src/api/resources/terminal/resources/checkouts/client/requests/CancelCheckoutsRequest.ts +++ b/src/api/resources/terminal/resources/checkouts/client/requests/CancelCheckoutsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface CancelCheckoutsRequest { - /** The unique ID for the desired `TerminalCheckout`. */ + /** + * The unique ID for the desired `TerminalCheckout`. + */ checkoutId: string; } diff --git a/src/api/resources/terminal/resources/checkouts/client/requests/CreateTerminalCheckoutRequest.ts b/src/api/resources/terminal/resources/checkouts/client/requests/CreateTerminalCheckoutRequest.ts index 12f74d5af..a07279878 100644 --- a/src/api/resources/terminal/resources/checkouts/client/requests/CreateTerminalCheckoutRequest.ts +++ b/src/api/resources/terminal/resources/checkouts/client/requests/CreateTerminalCheckoutRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/terminal/resources/checkouts/client/requests/GetCheckoutsRequest.ts b/src/api/resources/terminal/resources/checkouts/client/requests/GetCheckoutsRequest.ts index 7e683baec..83f26ef56 100644 --- a/src/api/resources/terminal/resources/checkouts/client/requests/GetCheckoutsRequest.ts +++ b/src/api/resources/terminal/resources/checkouts/client/requests/GetCheckoutsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetCheckoutsRequest { - /** The unique ID for the desired `TerminalCheckout`. */ + /** + * The unique ID for the desired `TerminalCheckout`. + */ checkoutId: string; } diff --git a/src/api/resources/terminal/resources/checkouts/client/requests/SearchTerminalCheckoutsRequest.ts b/src/api/resources/terminal/resources/checkouts/client/requests/SearchTerminalCheckoutsRequest.ts index 3593cdd9b..06ef4a3d5 100644 --- a/src/api/resources/terminal/resources/checkouts/client/requests/SearchTerminalCheckoutsRequest.ts +++ b/src/api/resources/terminal/resources/checkouts/client/requests/SearchTerminalCheckoutsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/terminal/resources/checkouts/client/requests/index.ts b/src/api/resources/terminal/resources/checkouts/client/requests/index.ts index 9447f39ad..5ef9dcb34 100644 --- a/src/api/resources/terminal/resources/checkouts/client/requests/index.ts +++ b/src/api/resources/terminal/resources/checkouts/client/requests/index.ts @@ -1,4 +1,4 @@ -export type { CancelCheckoutsRequest } from "./CancelCheckoutsRequest"; -export type { CreateTerminalCheckoutRequest } from "./CreateTerminalCheckoutRequest"; -export type { GetCheckoutsRequest } from "./GetCheckoutsRequest"; -export type { SearchTerminalCheckoutsRequest } from "./SearchTerminalCheckoutsRequest"; +export { type CreateTerminalCheckoutRequest } from "./CreateTerminalCheckoutRequest"; +export { type SearchTerminalCheckoutsRequest } from "./SearchTerminalCheckoutsRequest"; +export { type GetCheckoutsRequest } from "./GetCheckoutsRequest"; +export { type CancelCheckoutsRequest } from "./CancelCheckoutsRequest"; diff --git a/src/api/resources/terminal/resources/index.ts b/src/api/resources/terminal/resources/index.ts index 0a902a361..9c6d9980c 100644 --- a/src/api/resources/terminal/resources/index.ts +++ b/src/api/resources/terminal/resources/index.ts @@ -1,6 +1,6 @@ export * as actions from "./actions"; -export * from "./actions/client/requests"; export * as checkouts from "./checkouts"; -export * from "./checkouts/client/requests"; export * as refunds from "./refunds"; +export * from "./actions/client/requests"; +export * from "./checkouts/client/requests"; export * from "./refunds/client/requests"; diff --git a/src/api/resources/terminal/resources/refunds/client/Client.ts b/src/api/resources/terminal/resources/refunds/client/Client.ts index 509e7c40c..ee04835f6 100644 --- a/src/api/resources/terminal/resources/refunds/client/Client.ts +++ b/src/api/resources/terminal/resources/refunds/client/Client.ts @@ -1,32 +1,53 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace RefundsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Refunds { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class RefundsClient { - protected readonly _options: RefundsClient.Options; +export class Refunds { + protected readonly _options: Refunds.Options; - constructor(options: RefundsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Refunds.Options = {}) { + this._options = _options; } /** * Creates a request to refund an Interac payment completed on a Square Terminal. Refunds for Interac payments on a Square Terminal are supported only for Interac debit cards in Canada. Other refunds for Terminal payments should use the Refunds API. For more information, see [Refunds API](api:Refunds). * * @param {Square.terminal.CreateTerminalRefundRequest} request - * @param {RefundsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Refunds.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.terminal.refunds.create({ @@ -44,23 +65,15 @@ export class RefundsClient { */ public create( request: Square.terminal.CreateTerminalRefundRequest, - requestOptions?: RefundsClient.RequestOptions, + requestOptions?: Refunds.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.terminal.CreateTerminalRefundRequest, - requestOptions?: RefundsClient.RequestOptions, + requestOptions?: Refunds.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -69,19 +82,23 @@ export class RefundsClient { "v2/terminals/refunds", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.terminal.CreateTerminalRefundRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -125,7 +142,7 @@ export class RefundsClient { * Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request. Terminal refund requests are available for 30 days. * * @param {Square.terminal.SearchTerminalRefundsRequest} request - * @param {RefundsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Refunds.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.terminal.refunds.search({ @@ -139,23 +156,15 @@ export class RefundsClient { */ public search( request: Square.terminal.SearchTerminalRefundsRequest = {}, - requestOptions?: RefundsClient.RequestOptions, + requestOptions?: Refunds.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__search(request, requestOptions)); } private async __search( request: Square.terminal.SearchTerminalRefundsRequest = {}, - requestOptions?: RefundsClient.RequestOptions, + requestOptions?: Refunds.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -164,19 +173,23 @@ export class RefundsClient { "v2/terminals/refunds/search", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.terminal.SearchTerminalRefundsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -220,7 +233,7 @@ export class RefundsClient { * Retrieves an Interac Terminal refund object by ID. Terminal refund objects are available for 30 days. * * @param {Square.terminal.GetRefundsRequest} request - * @param {RefundsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Refunds.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.terminal.refunds.get({ @@ -229,39 +242,35 @@ export class RefundsClient { */ public get( request: Square.terminal.GetRefundsRequest, - requestOptions?: RefundsClient.RequestOptions, + requestOptions?: Refunds.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.terminal.GetRefundsRequest, - requestOptions?: RefundsClient.RequestOptions, + requestOptions?: Refunds.RequestOptions, ): Promise> { const { terminalRefundId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/terminals/refunds/${core.url.encodePathParam(terminalRefundId)}`, + `v2/terminals/refunds/${encodeURIComponent(terminalRefundId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -307,7 +316,7 @@ export class RefundsClient { * Cancels an Interac Terminal refund request by refund request ID if the status of the request permits it. * * @param {Square.terminal.CancelRefundsRequest} request - * @param {RefundsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Refunds.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.terminal.refunds.cancel({ @@ -316,39 +325,35 @@ export class RefundsClient { */ public cancel( request: Square.terminal.CancelRefundsRequest, - requestOptions?: RefundsClient.RequestOptions, + requestOptions?: Refunds.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__cancel(request, requestOptions)); } private async __cancel( request: Square.terminal.CancelRefundsRequest, - requestOptions?: RefundsClient.RequestOptions, + requestOptions?: Refunds.RequestOptions, ): Promise> { const { terminalRefundId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/terminals/refunds/${core.url.encodePathParam(terminalRefundId)}/cancel`, + `v2/terminals/refunds/${encodeURIComponent(terminalRefundId)}/cancel`, ), method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -391,7 +396,7 @@ export class RefundsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/terminal/resources/refunds/client/index.ts b/src/api/resources/terminal/resources/refunds/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/terminal/resources/refunds/client/index.ts +++ b/src/api/resources/terminal/resources/refunds/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/terminal/resources/refunds/client/requests/CancelRefundsRequest.ts b/src/api/resources/terminal/resources/refunds/client/requests/CancelRefundsRequest.ts index 89b889f9f..250a548ff 100644 --- a/src/api/resources/terminal/resources/refunds/client/requests/CancelRefundsRequest.ts +++ b/src/api/resources/terminal/resources/refunds/client/requests/CancelRefundsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface CancelRefundsRequest { - /** The unique ID for the desired `TerminalRefund`. */ + /** + * The unique ID for the desired `TerminalRefund`. + */ terminalRefundId: string; } diff --git a/src/api/resources/terminal/resources/refunds/client/requests/CreateTerminalRefundRequest.ts b/src/api/resources/terminal/resources/refunds/client/requests/CreateTerminalRefundRequest.ts index 88c42331b..c6389887c 100644 --- a/src/api/resources/terminal/resources/refunds/client/requests/CreateTerminalRefundRequest.ts +++ b/src/api/resources/terminal/resources/refunds/client/requests/CreateTerminalRefundRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/terminal/resources/refunds/client/requests/GetRefundsRequest.ts b/src/api/resources/terminal/resources/refunds/client/requests/GetRefundsRequest.ts index 065a6dbc7..784c1cd2e 100644 --- a/src/api/resources/terminal/resources/refunds/client/requests/GetRefundsRequest.ts +++ b/src/api/resources/terminal/resources/refunds/client/requests/GetRefundsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetRefundsRequest { - /** The unique ID for the desired `TerminalRefund`. */ + /** + * The unique ID for the desired `TerminalRefund`. + */ terminalRefundId: string; } diff --git a/src/api/resources/terminal/resources/refunds/client/requests/SearchTerminalRefundsRequest.ts b/src/api/resources/terminal/resources/refunds/client/requests/SearchTerminalRefundsRequest.ts index c8e6ced61..22f190f62 100644 --- a/src/api/resources/terminal/resources/refunds/client/requests/SearchTerminalRefundsRequest.ts +++ b/src/api/resources/terminal/resources/refunds/client/requests/SearchTerminalRefundsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/terminal/resources/refunds/client/requests/index.ts b/src/api/resources/terminal/resources/refunds/client/requests/index.ts index ee75aecdc..d076a5792 100644 --- a/src/api/resources/terminal/resources/refunds/client/requests/index.ts +++ b/src/api/resources/terminal/resources/refunds/client/requests/index.ts @@ -1,4 +1,4 @@ -export type { CancelRefundsRequest } from "./CancelRefundsRequest"; -export type { CreateTerminalRefundRequest } from "./CreateTerminalRefundRequest"; -export type { GetRefundsRequest } from "./GetRefundsRequest"; -export type { SearchTerminalRefundsRequest } from "./SearchTerminalRefundsRequest"; +export { type CreateTerminalRefundRequest } from "./CreateTerminalRefundRequest"; +export { type SearchTerminalRefundsRequest } from "./SearchTerminalRefundsRequest"; +export { type GetRefundsRequest } from "./GetRefundsRequest"; +export { type CancelRefundsRequest } from "./CancelRefundsRequest"; diff --git a/src/api/resources/transferOrders/client/Client.ts b/src/api/resources/transferOrders/client/Client.ts deleted file mode 100644 index 2d10116b8..000000000 --- a/src/api/resources/transferOrders/client/Client.ts +++ /dev/null @@ -1,908 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; -import * as core from "../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; - -export declare namespace TransferOrdersClient { - export interface Options extends BaseClientOptions {} - - export interface RequestOptions extends BaseRequestOptions {} -} - -export class TransferOrdersClient { - protected readonly _options: TransferOrdersClient.Options; - - constructor(options: TransferOrdersClient.Options = {}) { - this._options = normalizeClientOptions(options); - } - - /** - * Creates a new transfer order in [DRAFT](entity:TransferOrderStatus) status. A transfer order represents the intent - * to move [CatalogItemVariation](entity:CatalogItemVariation)s from one [Location](entity:Location) to another. - * The source and destination locations must be different and must belong to your Square account. - * - * In [DRAFT](entity:TransferOrderStatus) status, you can: - * - Add or remove items - * - Modify quantities - * - Update shipping information - * - Delete the entire order via [DeleteTransferOrder](api-endpoint:TransferOrders-DeleteTransferOrder) - * - * The request requires source_location_id and destination_location_id. - * Inventory levels are not affected until the order is started via - * [StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder). - * - * Common integration points: - * - Sync with warehouse management systems - * - Automate regular stock transfers - * - Initialize transfers from inventory optimization systems - * - * Creates a [transfer_order.created](webhook:transfer_order.created) webhook event. - * - * @param {Square.CreateTransferOrderRequest} request - * @param {TransferOrdersClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.transferOrders.create({ - * idempotencyKey: "65cc0586-3e82-384s-b524-3885cffd52", - * transferOrder: { - * sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_123", - * destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_456", - * expectedAt: "2025-11-09T05:00:00Z", - * notes: "Example transfer order for inventory redistribution between locations", - * trackingNumber: "TRACK123456789", - * createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", - * lineItems: [{ - * itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", - * quantityOrdered: "5" - * }, { - * itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_002", - * quantityOrdered: "3" - * }] - * } - * }) - */ - public create( - request: Square.CreateTransferOrderRequest, - requestOptions?: TransferOrdersClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); - } - - private async __create( - request: Square.CreateTransferOrderRequest, - requestOptions?: TransferOrdersClient.RequestOptions, - ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.SquareEnvironment.Production, - "v2/transfer-orders", - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.CreateTransferOrderRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.CreateTransferOrderResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - throw new errors.SquareError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.SquareError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse, - }); - case "timeout": - throw new errors.SquareTimeoutError("Timeout exceeded when calling POST /v2/transfer-orders."); - case "unknown": - throw new errors.SquareError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse, - }); - } - } - - /** - * Searches for transfer orders using filters. Returns a paginated list of matching - * [TransferOrder](entity:TransferOrder)s sorted by creation date. - * - * Common search scenarios: - * - Find orders for a source [Location](entity:Location) - * - Find orders for a destination [Location](entity:Location) - * - Find orders in a particular [TransferOrderStatus](entity:TransferOrderStatus) - * - * @param {Square.SearchTransferOrdersRequest} request - * @param {TransferOrdersClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.transferOrders.search({ - * query: { - * filter: { - * sourceLocationIds: ["EXAMPLE_SOURCE_LOCATION_ID_123"], - * destinationLocationIds: ["EXAMPLE_DEST_LOCATION_ID_456"], - * statuses: ["STARTED", "PARTIALLY_RECEIVED"] - * }, - * sort: { - * field: "UPDATED_AT", - * order: "DESC" - * } - * }, - * cursor: "eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTg2NjQ4NzN9", - * limit: 10 - * }) - */ - public async search( - request: Square.SearchTransferOrdersRequest = {}, - requestOptions?: TransferOrdersClient.RequestOptions, - ): Promise> { - const list = core.HttpResponsePromise.interceptFunction( - async ( - request: Square.SearchTransferOrdersRequest, - ): Promise> => { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.SquareEnvironment.Production, - "v2/transfer-orders/search", - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.SearchTransferOrdersRequest.jsonOrThrow(request, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.SearchTransferOrdersResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - if (_response.error.reason === "status-code") { - throw new errors.SquareError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - switch (_response.error.reason) { - case "non-json": - throw new errors.SquareError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse, - }); - case "timeout": - throw new errors.SquareTimeoutError( - "Timeout exceeded when calling POST /v2/transfer-orders/search.", - ); - case "unknown": - throw new errors.SquareError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse, - }); - } - }, - ); - const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ - response: dataWithRawResponse.data, - rawResponse: dataWithRawResponse.rawResponse, - hasNextPage: (response) => - response?.cursor != null && !(typeof response?.cursor === "string" && response?.cursor === ""), - getItems: (response) => response?.transferOrders ?? [], - loadPage: (response) => { - return list(core.setObjectProperty(request, "cursor", response?.cursor)); - }, - }); - } - - /** - * Retrieves a specific [TransferOrder](entity:TransferOrder) by ID. Returns the complete - * order details including: - * - * - Basic information (status, dates, notes) - * - Line items with ordered and received quantities - * - Source and destination [Location](entity:Location)s - * - Tracking information (if available) - * - * @param {Square.GetTransferOrdersRequest} request - * @param {TransferOrdersClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.transferOrders.get({ - * transferOrderId: "transfer_order_id" - * }) - */ - public get( - request: Square.GetTransferOrdersRequest, - requestOptions?: TransferOrdersClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); - } - - private async __get( - request: Square.GetTransferOrdersRequest, - requestOptions?: TransferOrdersClient.RequestOptions, - ): Promise> { - const { transferOrderId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.SquareEnvironment.Production, - `v2/transfer-orders/${core.url.encodePathParam(transferOrderId)}`, - ), - method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.RetrieveTransferOrderResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - throw new errors.SquareError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.SquareError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse, - }); - case "timeout": - throw new errors.SquareTimeoutError( - "Timeout exceeded when calling GET /v2/transfer-orders/{transfer_order_id}.", - ); - case "unknown": - throw new errors.SquareError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse, - }); - } - } - - /** - * Updates an existing transfer order. This endpoint supports sparse updates, - * allowing you to modify specific fields without affecting others. - * - * Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. - * - * @param {Square.UpdateTransferOrderRequest} request - * @param {TransferOrdersClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.transferOrders.update({ - * transferOrderId: "transfer_order_id", - * idempotencyKey: "f47ac10b-58cc-4372-a567-0e02b2c3d479", - * transferOrder: { - * sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_789", - * destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_101", - * expectedAt: "2025-11-10T08:00:00Z", - * notes: "Updated: Priority transfer due to low stock at destination", - * trackingNumber: "TRACK987654321", - * lineItems: [{ - * uid: "1", - * quantityOrdered: "7" - * }, { - * itemVariationId: "EXAMPLE_NEW_ITEM_VARIATION_ID_003", - * quantityOrdered: "2" - * }, { - * uid: "2", - * remove: true - * }] - * }, - * version: BigInt("1753109537351") - * }) - */ - public update( - request: Square.UpdateTransferOrderRequest, - requestOptions?: TransferOrdersClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); - } - - private async __update( - request: Square.UpdateTransferOrderRequest, - requestOptions?: TransferOrdersClient.RequestOptions, - ): Promise> { - const { transferOrderId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.SquareEnvironment.Production, - `v2/transfer-orders/${core.url.encodePathParam(transferOrderId)}`, - ), - method: "PUT", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.UpdateTransferOrderRequest.jsonOrThrow(_body, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.UpdateTransferOrderResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - throw new errors.SquareError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.SquareError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse, - }); - case "timeout": - throw new errors.SquareTimeoutError( - "Timeout exceeded when calling PUT /v2/transfer-orders/{transfer_order_id}.", - ); - case "unknown": - throw new errors.SquareError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse, - }); - } - } - - /** - * Deletes a transfer order in [DRAFT](entity:TransferOrderStatus) status. - * Only draft orders can be deleted. Once an order is started via - * [StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder), it can no longer be deleted. - * - * Creates a [transfer_order.deleted](webhook:transfer_order.deleted) webhook event. - * - * @param {Square.DeleteTransferOrdersRequest} request - * @param {TransferOrdersClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.transferOrders.delete({ - * transferOrderId: "transfer_order_id", - * version: BigInt("1000000") - * }) - */ - public delete( - request: Square.DeleteTransferOrdersRequest, - requestOptions?: TransferOrdersClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); - } - - private async __delete( - request: Square.DeleteTransferOrdersRequest, - requestOptions?: TransferOrdersClient.RequestOptions, - ): Promise> { - const { transferOrderId, version } = request; - const _queryParams: Record = {}; - if (version !== undefined) { - _queryParams.version = version?.toString() ?? null; - } - - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.SquareEnvironment.Production, - `v2/transfer-orders/${core.url.encodePathParam(transferOrderId)}`, - ), - method: "DELETE", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.DeleteTransferOrderResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - throw new errors.SquareError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.SquareError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse, - }); - case "timeout": - throw new errors.SquareTimeoutError( - "Timeout exceeded when calling DELETE /v2/transfer-orders/{transfer_order_id}.", - ); - case "unknown": - throw new errors.SquareError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse, - }); - } - } - - /** - * Cancels a transfer order in [STARTED](entity:TransferOrderStatus) or - * [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. Any unreceived quantities will no - * longer be receivable and will be immediately returned to the source [Location](entity:Location)'s inventory. - * - * Common reasons for cancellation: - * - Items no longer needed at destination - * - Source location needs the inventory - * - Order created in error - * - * Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. - * - * @param {Square.CancelTransferOrderRequest} request - * @param {TransferOrdersClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.transferOrders.cancel({ - * transferOrderId: "transfer_order_id", - * idempotencyKey: "65cc0586-3e82-4d08-b524-3885cffd52", - * version: BigInt("1753117449752") - * }) - */ - public cancel( - request: Square.CancelTransferOrderRequest, - requestOptions?: TransferOrdersClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__cancel(request, requestOptions)); - } - - private async __cancel( - request: Square.CancelTransferOrderRequest, - requestOptions?: TransferOrdersClient.RequestOptions, - ): Promise> { - const { transferOrderId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.SquareEnvironment.Production, - `v2/transfer-orders/${core.url.encodePathParam(transferOrderId)}/cancel`, - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.CancelTransferOrderRequest.jsonOrThrow(_body, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.CancelTransferOrderResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - throw new errors.SquareError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.SquareError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse, - }); - case "timeout": - throw new errors.SquareTimeoutError( - "Timeout exceeded when calling POST /v2/transfer-orders/{transfer_order_id}/cancel.", - ); - case "unknown": - throw new errors.SquareError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse, - }); - } - } - - /** - * Records receipt of [CatalogItemVariation](entity:CatalogItemVariation)s for a transfer order. - * This endpoint supports partial receiving - you can receive items in multiple batches. - * - * For each line item, you can specify: - * - Quantity received in good condition (added to destination inventory with [InventoryState](entity:InventoryState) of IN_STOCK) - * - Quantity damaged during transit/handling (added to destination inventory with [InventoryState](entity:InventoryState) of WASTE) - * - Quantity canceled (returned to source location's inventory) - * - * The order must be in [STARTED](entity:TransferOrderStatus) or [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. - * Received quantities are added to the destination [Location](entity:Location)'s inventory according to their condition. - * Canceled quantities are immediately returned to the source [Location](entity:Location)'s inventory. - * - * When all items are either received, damaged, or canceled, the order moves to - * [COMPLETED](entity:TransferOrderStatus) status. - * - * Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. - * - * @param {Square.ReceiveTransferOrderRequest} request - * @param {TransferOrdersClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.transferOrders.receive({ - * transferOrderId: "transfer_order_id", - * idempotencyKey: "EXAMPLE_IDEMPOTENCY_KEY_101", - * receipt: { - * lineItems: [{ - * transferOrderLineUid: "transfer_order_line_uid", - * quantityReceived: "3", - * quantityDamaged: "1", - * quantityCanceled: "1" - * }, { - * transferOrderLineUid: "transfer_order_line_uid", - * quantityReceived: "2", - * quantityCanceled: "1" - * }] - * }, - * version: BigInt("1753118664873") - * }) - */ - public receive( - request: Square.ReceiveTransferOrderRequest, - requestOptions?: TransferOrdersClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__receive(request, requestOptions)); - } - - private async __receive( - request: Square.ReceiveTransferOrderRequest, - requestOptions?: TransferOrdersClient.RequestOptions, - ): Promise> { - const { transferOrderId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.SquareEnvironment.Production, - `v2/transfer-orders/${core.url.encodePathParam(transferOrderId)}/receive`, - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.ReceiveTransferOrderRequest.jsonOrThrow(_body, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.ReceiveTransferOrderResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - throw new errors.SquareError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.SquareError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse, - }); - case "timeout": - throw new errors.SquareTimeoutError( - "Timeout exceeded when calling POST /v2/transfer-orders/{transfer_order_id}/receive.", - ); - case "unknown": - throw new errors.SquareError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse, - }); - } - } - - /** - * Changes a [DRAFT](entity:TransferOrderStatus) transfer order to [STARTED](entity:TransferOrderStatus) status. - * This decrements inventory at the source [Location](entity:Location) and marks it as in-transit. - * - * The order must be in [DRAFT](entity:TransferOrderStatus) status and have all required fields populated. - * Once started, the order can no longer be deleted, but it can be canceled via - * [CancelTransferOrder](api-endpoint:TransferOrders-CancelTransferOrder). - * - * Creates a [transfer_order.updated](webhook:transfer_order.updated) webhook event. - * - * @param {Square.StartTransferOrderRequest} request - * @param {TransferOrdersClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.transferOrders.start({ - * transferOrderId: "transfer_order_id", - * idempotencyKey: "EXAMPLE_IDEMPOTENCY_KEY_789", - * version: BigInt("1753109537351") - * }) - */ - public start( - request: Square.StartTransferOrderRequest, - requestOptions?: TransferOrdersClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__start(request, requestOptions)); - } - - private async __start( - request: Square.StartTransferOrderRequest, - requestOptions?: TransferOrdersClient.RequestOptions, - ): Promise> { - const { transferOrderId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.SquareEnvironment.Production, - `v2/transfer-orders/${core.url.encodePathParam(transferOrderId)}/start`, - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.StartTransferOrderRequest.jsonOrThrow(_body, { - unrecognizedObjectKeys: "strip", - omitUndefined: true, - }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.StartTransferOrderResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - throw new errors.SquareError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.SquareError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - rawResponse: _response.rawResponse, - }); - case "timeout": - throw new errors.SquareTimeoutError( - "Timeout exceeded when calling POST /v2/transfer-orders/{transfer_order_id}/start.", - ); - case "unknown": - throw new errors.SquareError({ - message: _response.error.errorMessage, - rawResponse: _response.rawResponse, - }); - } - } - - protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; - if (bearer != null) { - return `Bearer ${bearer}`; - } - - return undefined; - } -} diff --git a/src/api/resources/transferOrders/client/index.ts b/src/api/resources/transferOrders/client/index.ts deleted file mode 100644 index 415726b7f..000000000 --- a/src/api/resources/transferOrders/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests"; diff --git a/src/api/resources/transferOrders/client/requests/CancelTransferOrderRequest.ts b/src/api/resources/transferOrders/client/requests/CancelTransferOrderRequest.ts deleted file mode 100644 index f5228a95e..000000000 --- a/src/api/resources/transferOrders/client/requests/CancelTransferOrderRequest.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * transferOrderId: "transfer_order_id", - * idempotencyKey: "65cc0586-3e82-4d08-b524-3885cffd52", - * version: BigInt("1753117449752") - * } - */ -export interface CancelTransferOrderRequest { - /** The ID of the transfer order to cancel. Must be in STARTED or PARTIALLY_RECEIVED status. */ - transferOrderId: string; - /** - * A unique string that identifies this UpdateTransferOrder request. Keys can be - * any valid string but must be unique for every UpdateTransferOrder request. - */ - idempotencyKey: string; - /** Version for optimistic concurrency */ - version?: bigint; -} diff --git a/src/api/resources/transferOrders/client/requests/CreateTransferOrderRequest.ts b/src/api/resources/transferOrders/client/requests/CreateTransferOrderRequest.ts deleted file mode 100644 index ca5c039b8..000000000 --- a/src/api/resources/transferOrders/client/requests/CreateTransferOrderRequest.ts +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../../../index"; - -/** - * @example - * { - * idempotencyKey: "65cc0586-3e82-384s-b524-3885cffd52", - * transferOrder: { - * sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_123", - * destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_456", - * expectedAt: "2025-11-09T05:00:00Z", - * notes: "Example transfer order for inventory redistribution between locations", - * trackingNumber: "TRACK123456789", - * createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", - * lineItems: [{ - * itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", - * quantityOrdered: "5" - * }, { - * itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_002", - * quantityOrdered: "3" - * }] - * } - * } - */ -export interface CreateTransferOrderRequest { - /** - * A unique string that identifies this CreateTransferOrder request. Keys can be - * any valid string but must be unique for every CreateTransferOrder request. - */ - idempotencyKey: string; - /** The transfer order to create */ - transferOrder: Square.CreateTransferOrderData; -} diff --git a/src/api/resources/transferOrders/client/requests/DeleteTransferOrdersRequest.ts b/src/api/resources/transferOrders/client/requests/DeleteTransferOrdersRequest.ts deleted file mode 100644 index 8f429adb2..000000000 --- a/src/api/resources/transferOrders/client/requests/DeleteTransferOrdersRequest.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * transferOrderId: "transfer_order_id", - * version: BigInt("1000000") - * } - */ -export interface DeleteTransferOrdersRequest { - /** The ID of the transfer order to delete */ - transferOrderId: string; - /** Version for optimistic concurrency */ - version?: bigint | null; -} diff --git a/src/api/resources/transferOrders/client/requests/GetTransferOrdersRequest.ts b/src/api/resources/transferOrders/client/requests/GetTransferOrdersRequest.ts deleted file mode 100644 index 3959a05f7..000000000 --- a/src/api/resources/transferOrders/client/requests/GetTransferOrdersRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * transferOrderId: "transfer_order_id" - * } - */ -export interface GetTransferOrdersRequest { - /** The ID of the transfer order to retrieve */ - transferOrderId: string; -} diff --git a/src/api/resources/transferOrders/client/requests/ReceiveTransferOrderRequest.ts b/src/api/resources/transferOrders/client/requests/ReceiveTransferOrderRequest.ts deleted file mode 100644 index 8b3bb7497..000000000 --- a/src/api/resources/transferOrders/client/requests/ReceiveTransferOrderRequest.ts +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../../../index"; - -/** - * @example - * { - * transferOrderId: "transfer_order_id", - * idempotencyKey: "EXAMPLE_IDEMPOTENCY_KEY_101", - * receipt: { - * lineItems: [{ - * transferOrderLineUid: "transfer_order_line_uid", - * quantityReceived: "3", - * quantityDamaged: "1", - * quantityCanceled: "1" - * }, { - * transferOrderLineUid: "transfer_order_line_uid", - * quantityReceived: "2", - * quantityCanceled: "1" - * }] - * }, - * version: BigInt("1753118664873") - * } - */ -export interface ReceiveTransferOrderRequest { - /** The ID of the transfer order to receive items for */ - transferOrderId: string; - /** A unique key to make this request idempotent */ - idempotencyKey: string; - /** The receipt details */ - receipt: Square.TransferOrderGoodsReceipt; - /** Version for optimistic concurrency */ - version?: bigint; -} diff --git a/src/api/resources/transferOrders/client/requests/SearchTransferOrdersRequest.ts b/src/api/resources/transferOrders/client/requests/SearchTransferOrdersRequest.ts deleted file mode 100644 index 86f9a89ef..000000000 --- a/src/api/resources/transferOrders/client/requests/SearchTransferOrdersRequest.ts +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../../../index"; - -/** - * @example - * { - * query: { - * filter: { - * sourceLocationIds: ["EXAMPLE_SOURCE_LOCATION_ID_123"], - * destinationLocationIds: ["EXAMPLE_DEST_LOCATION_ID_456"], - * statuses: ["STARTED", "PARTIALLY_RECEIVED"] - * }, - * sort: { - * field: "UPDATED_AT", - * order: "DESC" - * } - * }, - * cursor: "eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTg2NjQ4NzN9", - * limit: 10 - * } - */ -export interface SearchTransferOrdersRequest { - /** The search query */ - query?: Square.TransferOrderQuery; - /** Pagination cursor from a previous search response */ - cursor?: string; - /** Maximum number of results to return (1-100) */ - limit?: number; -} diff --git a/src/api/resources/transferOrders/client/requests/StartTransferOrderRequest.ts b/src/api/resources/transferOrders/client/requests/StartTransferOrderRequest.ts deleted file mode 100644 index a3f56bece..000000000 --- a/src/api/resources/transferOrders/client/requests/StartTransferOrderRequest.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * transferOrderId: "transfer_order_id", - * idempotencyKey: "EXAMPLE_IDEMPOTENCY_KEY_789", - * version: BigInt("1753109537351") - * } - */ -export interface StartTransferOrderRequest { - /** The ID of the transfer order to start. Must be in DRAFT status. */ - transferOrderId: string; - /** - * A unique string that identifies this UpdateTransferOrder request. Keys can be - * any valid string but must be unique for every UpdateTransferOrder request. - */ - idempotencyKey: string; - /** Version for optimistic concurrency */ - version?: bigint; -} diff --git a/src/api/resources/transferOrders/client/requests/UpdateTransferOrderRequest.ts b/src/api/resources/transferOrders/client/requests/UpdateTransferOrderRequest.ts deleted file mode 100644 index ec881fe67..000000000 --- a/src/api/resources/transferOrders/client/requests/UpdateTransferOrderRequest.ts +++ /dev/null @@ -1,39 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../../../index"; - -/** - * @example - * { - * transferOrderId: "transfer_order_id", - * idempotencyKey: "f47ac10b-58cc-4372-a567-0e02b2c3d479", - * transferOrder: { - * sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_789", - * destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_101", - * expectedAt: "2025-11-10T08:00:00Z", - * notes: "Updated: Priority transfer due to low stock at destination", - * trackingNumber: "TRACK987654321", - * lineItems: [{ - * uid: "1", - * quantityOrdered: "7" - * }, { - * itemVariationId: "EXAMPLE_NEW_ITEM_VARIATION_ID_003", - * quantityOrdered: "2" - * }, { - * uid: "2", - * remove: true - * }] - * }, - * version: BigInt("1753109537351") - * } - */ -export interface UpdateTransferOrderRequest { - /** The ID of the transfer order to update */ - transferOrderId: string; - /** A unique string that identifies this UpdateTransferOrder request. Keys must contain only alphanumeric characters, dashes and underscores */ - idempotencyKey: string; - /** The transfer order updates to apply */ - transferOrder: Square.UpdateTransferOrderData; - /** Version for optimistic concurrency */ - version?: bigint; -} diff --git a/src/api/resources/transferOrders/client/requests/index.ts b/src/api/resources/transferOrders/client/requests/index.ts deleted file mode 100644 index c0324f7bc..000000000 --- a/src/api/resources/transferOrders/client/requests/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -export type { CancelTransferOrderRequest } from "./CancelTransferOrderRequest"; -export type { CreateTransferOrderRequest } from "./CreateTransferOrderRequest"; -export type { DeleteTransferOrdersRequest } from "./DeleteTransferOrdersRequest"; -export type { GetTransferOrdersRequest } from "./GetTransferOrdersRequest"; -export type { ReceiveTransferOrderRequest } from "./ReceiveTransferOrderRequest"; -export type { SearchTransferOrdersRequest } from "./SearchTransferOrdersRequest"; -export type { StartTransferOrderRequest } from "./StartTransferOrderRequest"; -export type { UpdateTransferOrderRequest } from "./UpdateTransferOrderRequest"; diff --git a/src/api/resources/transferOrders/index.ts b/src/api/resources/transferOrders/index.ts deleted file mode 100644 index 5ec76921e..000000000 --- a/src/api/resources/transferOrders/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client"; diff --git a/src/api/resources/v1Transactions/client/Client.ts b/src/api/resources/v1Transactions/client/Client.ts index d5513f1b8..5f3a79665 100644 --- a/src/api/resources/v1Transactions/client/Client.ts +++ b/src/api/resources/v1Transactions/client/Client.ts @@ -1,32 +1,53 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; +import * as serializers from "../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; -export declare namespace V1TransactionsClient { - export interface Options extends BaseClientOptions {} +export declare namespace V1Transactions { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class V1TransactionsClient { - protected readonly _options: V1TransactionsClient.Options; +export class V1Transactions { + protected readonly _options: V1Transactions.Options; - constructor(options: V1TransactionsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: V1Transactions.Options = {}) { + this._options = _options; } /** * Provides summary information for a merchant's online store orders. * * @param {Square.V1ListOrdersRequest} request - * @param {V1TransactionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {V1Transactions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.v1Transactions.v1ListOrders({ @@ -38,55 +59,52 @@ export class V1TransactionsClient { */ public v1ListOrders( request: Square.V1ListOrdersRequest, - requestOptions?: V1TransactionsClient.RequestOptions, + requestOptions?: V1Transactions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__v1ListOrders(request, requestOptions)); } private async __v1ListOrders( request: Square.V1ListOrdersRequest, - requestOptions?: V1TransactionsClient.RequestOptions, + requestOptions?: V1Transactions.RequestOptions, ): Promise> { const { locationId, order, limit, batchToken } = request; const _queryParams: Record = {}; if (order !== undefined) { - _queryParams.order = serializers.SortOrder.jsonOrThrow(order, { + _queryParams["order"] = serializers.SortOrder.jsonOrThrow(order, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } if (batchToken !== undefined) { - _queryParams.batch_token = batchToken; + _queryParams["batch_token"] = batchToken; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v1/${core.url.encodePathParam(locationId)}/orders`, + `v1/${encodeURIComponent(locationId)}/orders`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -130,7 +148,7 @@ export class V1TransactionsClient { * Provides comprehensive information for a single online store order, including the order's history. * * @param {Square.V1RetrieveOrderRequest} request - * @param {V1TransactionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {V1Transactions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.v1Transactions.v1RetrieveOrder({ @@ -140,39 +158,35 @@ export class V1TransactionsClient { */ public v1RetrieveOrder( request: Square.V1RetrieveOrderRequest, - requestOptions?: V1TransactionsClient.RequestOptions, + requestOptions?: V1Transactions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__v1RetrieveOrder(request, requestOptions)); } private async __v1RetrieveOrder( request: Square.V1RetrieveOrderRequest, - requestOptions?: V1TransactionsClient.RequestOptions, + requestOptions?: V1Transactions.RequestOptions, ): Promise> { const { locationId, orderId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v1/${core.url.encodePathParam(locationId)}/orders/${core.url.encodePathParam(orderId)}`, + `v1/${encodeURIComponent(locationId)}/orders/${encodeURIComponent(orderId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -218,7 +232,7 @@ export class V1TransactionsClient { * Updates the details of an online store order. Every update you perform on an order corresponds to one of three actions: * * @param {Square.V1UpdateOrderRequest} request - * @param {V1TransactionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {V1Transactions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.v1Transactions.v1UpdateOrder({ @@ -229,45 +243,41 @@ export class V1TransactionsClient { */ public v1UpdateOrder( request: Square.V1UpdateOrderRequest, - requestOptions?: V1TransactionsClient.RequestOptions, + requestOptions?: V1Transactions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__v1UpdateOrder(request, requestOptions)); } private async __v1UpdateOrder( request: Square.V1UpdateOrderRequest, - requestOptions?: V1TransactionsClient.RequestOptions, + requestOptions?: V1Transactions.RequestOptions, ): Promise> { const { locationId, orderId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v1/${core.url.encodePathParam(locationId)}/orders/${core.url.encodePathParam(orderId)}`, + `v1/${encodeURIComponent(locationId)}/orders/${encodeURIComponent(orderId)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.V1UpdateOrderRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -310,7 +320,7 @@ export class V1TransactionsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/v1Transactions/client/index.ts b/src/api/resources/v1Transactions/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/v1Transactions/client/index.ts +++ b/src/api/resources/v1Transactions/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/v1Transactions/client/requests/V1ListOrdersRequest.ts b/src/api/resources/v1Transactions/client/requests/V1ListOrdersRequest.ts index 7913709bc..b485a1a5f 100644 --- a/src/api/resources/v1Transactions/client/requests/V1ListOrdersRequest.ts +++ b/src/api/resources/v1Transactions/client/requests/V1ListOrdersRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -12,11 +14,17 @@ import type * as Square from "../../../../index"; * } */ export interface V1ListOrdersRequest { - /** The ID of the location to list online store orders for. */ + /** + * The ID of the location to list online store orders for. + */ locationId: string; - /** The order in which payments are listed in the response. */ + /** + * The order in which payments are listed in the response. + */ order?: Square.SortOrder | null; - /** The maximum number of payments to return in a single response. This value cannot exceed 200. */ + /** + * The maximum number of payments to return in a single response. This value cannot exceed 200. + */ limit?: number | null; /** * A pagination cursor to retrieve the next set of results for your diff --git a/src/api/resources/v1Transactions/client/requests/V1RetrieveOrderRequest.ts b/src/api/resources/v1Transactions/client/requests/V1RetrieveOrderRequest.ts index 749f2cc00..cdc38ad36 100644 --- a/src/api/resources/v1Transactions/client/requests/V1RetrieveOrderRequest.ts +++ b/src/api/resources/v1Transactions/client/requests/V1RetrieveOrderRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,8 +10,12 @@ * } */ export interface V1RetrieveOrderRequest { - /** The ID of the order's associated location. */ + /** + * The ID of the order's associated location. + */ locationId: string; - /** The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint */ + /** + * The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint + */ orderId: string; } diff --git a/src/api/resources/v1Transactions/client/requests/V1UpdateOrderRequest.ts b/src/api/resources/v1Transactions/client/requests/V1UpdateOrderRequest.ts index 47073e210..29b41dae6 100644 --- a/src/api/resources/v1Transactions/client/requests/V1UpdateOrderRequest.ts +++ b/src/api/resources/v1Transactions/client/requests/V1UpdateOrderRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -11,9 +13,13 @@ import type * as Square from "../../../../index"; * } */ export interface V1UpdateOrderRequest { - /** The ID of the order's associated location. */ + /** + * The ID of the order's associated location. + */ locationId: string; - /** The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint */ + /** + * The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint + */ orderId: string; /** * The action to perform on the order (COMPLETE, CANCEL, or REFUND). diff --git a/src/api/resources/v1Transactions/client/requests/index.ts b/src/api/resources/v1Transactions/client/requests/index.ts index 27b522a40..0d77a3125 100644 --- a/src/api/resources/v1Transactions/client/requests/index.ts +++ b/src/api/resources/v1Transactions/client/requests/index.ts @@ -1,3 +1,3 @@ -export type { V1ListOrdersRequest } from "./V1ListOrdersRequest"; -export type { V1RetrieveOrderRequest } from "./V1RetrieveOrderRequest"; -export type { V1UpdateOrderRequest } from "./V1UpdateOrderRequest"; +export { type V1ListOrdersRequest } from "./V1ListOrdersRequest"; +export { type V1RetrieveOrderRequest } from "./V1RetrieveOrderRequest"; +export { type V1UpdateOrderRequest } from "./V1UpdateOrderRequest"; diff --git a/src/api/resources/vendors/client/Client.ts b/src/api/resources/vendors/client/Client.ts index bf62ea1d1..1d3e4516c 100644 --- a/src/api/resources/vendors/client/Client.ts +++ b/src/api/resources/vendors/client/Client.ts @@ -1,32 +1,53 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; import * as core from "../../../../core"; +import * as Square from "../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; -import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; import * as serializers from "../../../../serialization/index"; -import type * as Square from "../../../index"; +import * as errors from "../../../../errors/index"; -export declare namespace VendorsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Vendors { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class VendorsClient { - protected readonly _options: VendorsClient.Options; +export class Vendors { + protected readonly _options: Vendors.Options; - constructor(options: VendorsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Vendors.Options = {}) { + this._options = _options; } /** * Creates one or more [Vendor](entity:Vendor) objects to represent suppliers to a seller. * * @param {Square.BatchCreateVendorsRequest} request - * @param {VendorsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Vendors.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.vendors.batchCreate({ @@ -55,23 +76,15 @@ export class VendorsClient { */ public batchCreate( request: Square.BatchCreateVendorsRequest, - requestOptions?: VendorsClient.RequestOptions, + requestOptions?: Vendors.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__batchCreate(request, requestOptions)); } private async __batchCreate( request: Square.BatchCreateVendorsRequest, - requestOptions?: VendorsClient.RequestOptions, + requestOptions?: Vendors.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -80,19 +93,23 @@ export class VendorsClient { "v2/vendors/bulk-create", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchCreateVendorsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -136,7 +153,7 @@ export class VendorsClient { * Retrieves one or more vendors of specified [Vendor](entity:Vendor) IDs. * * @param {Square.BatchGetVendorsRequest} request - * @param {VendorsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Vendors.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.vendors.batchGet({ @@ -145,23 +162,15 @@ export class VendorsClient { */ public batchGet( request: Square.BatchGetVendorsRequest = {}, - requestOptions?: VendorsClient.RequestOptions, + requestOptions?: Vendors.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__batchGet(request, requestOptions)); } private async __batchGet( request: Square.BatchGetVendorsRequest = {}, - requestOptions?: VendorsClient.RequestOptions, + requestOptions?: Vendors.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -170,19 +179,23 @@ export class VendorsClient { "v2/vendors/bulk-retrieve", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchGetVendorsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -226,7 +239,7 @@ export class VendorsClient { * Updates one or more of existing [Vendor](entity:Vendor) objects as suppliers to a seller. * * @param {Square.BatchUpdateVendorsRequest} request - * @param {VendorsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Vendors.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.vendors.batchUpdate({ @@ -242,23 +255,15 @@ export class VendorsClient { */ public batchUpdate( request: Square.BatchUpdateVendorsRequest, - requestOptions?: VendorsClient.RequestOptions, + requestOptions?: Vendors.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__batchUpdate(request, requestOptions)); } private async __batchUpdate( request: Square.BatchUpdateVendorsRequest, - requestOptions?: VendorsClient.RequestOptions, + requestOptions?: Vendors.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -267,19 +272,23 @@ export class VendorsClient { "v2/vendors/bulk-update", ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.BatchUpdateVendorsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -323,7 +332,7 @@ export class VendorsClient { * Creates a single [Vendor](entity:Vendor) object to represent a supplier to a seller. * * @param {Square.CreateVendorRequest} request - * @param {VendorsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Vendors.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.vendors.create({ @@ -351,23 +360,15 @@ export class VendorsClient { */ public create( request: Square.CreateVendorRequest, - requestOptions?: VendorsClient.RequestOptions, + requestOptions?: Vendors.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.CreateVendorRequest, - requestOptions?: VendorsClient.RequestOptions, + requestOptions?: Vendors.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -376,19 +377,23 @@ export class VendorsClient { "v2/vendors/create", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CreateVendorRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -432,30 +437,22 @@ export class VendorsClient { * Searches for vendors using a filter against supported [Vendor](entity:Vendor) properties and a supported sorter. * * @param {Square.SearchVendorsRequest} request - * @param {VendorsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Vendors.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.vendors.search() */ public search( request: Square.SearchVendorsRequest = {}, - requestOptions?: VendorsClient.RequestOptions, + requestOptions?: Vendors.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__search(request, requestOptions)); } private async __search( request: Square.SearchVendorsRequest = {}, - requestOptions?: VendorsClient.RequestOptions, + requestOptions?: Vendors.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -464,19 +461,23 @@ export class VendorsClient { "v2/vendors/search", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SearchVendorsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -520,7 +521,7 @@ export class VendorsClient { * Retrieves the vendor of a specified [Vendor](entity:Vendor) ID. * * @param {Square.GetVendorsRequest} request - * @param {VendorsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Vendors.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.vendors.get({ @@ -529,39 +530,35 @@ export class VendorsClient { */ public get( request: Square.GetVendorsRequest, - requestOptions?: VendorsClient.RequestOptions, + requestOptions?: Vendors.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.GetVendorsRequest, - requestOptions?: VendorsClient.RequestOptions, + requestOptions?: Vendors.RequestOptions, ): Promise> { const { vendorId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/vendors/${core.url.encodePathParam(vendorId)}`, + `v2/vendors/${encodeURIComponent(vendorId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -605,7 +602,7 @@ export class VendorsClient { * Updates an existing [Vendor](entity:Vendor) object as a supplier to a seller. * * @param {Square.UpdateVendorsRequest} request - * @param {VendorsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Vendors.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.vendors.update({ @@ -623,45 +620,41 @@ export class VendorsClient { */ public update( request: Square.UpdateVendorsRequest, - requestOptions?: VendorsClient.RequestOptions, + requestOptions?: Vendors.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); } private async __update( request: Square.UpdateVendorsRequest, - requestOptions?: VendorsClient.RequestOptions, + requestOptions?: Vendors.RequestOptions, ): Promise> { const { vendorId, body: _body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/vendors/${core.url.encodePathParam(vendorId)}`, + `v2/vendors/${encodeURIComponent(vendorId)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UpdateVendorRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -702,7 +695,7 @@ export class VendorsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/vendors/client/index.ts b/src/api/resources/vendors/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/vendors/client/index.ts +++ b/src/api/resources/vendors/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/vendors/client/requests/BatchCreateVendorsRequest.ts b/src/api/resources/vendors/client/requests/BatchCreateVendorsRequest.ts index 192cf92c5..7137f0e8e 100644 --- a/src/api/resources/vendors/client/requests/BatchCreateVendorsRequest.ts +++ b/src/api/resources/vendors/client/requests/BatchCreateVendorsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/vendors/client/requests/BatchGetVendorsRequest.ts b/src/api/resources/vendors/client/requests/BatchGetVendorsRequest.ts index 0da531abc..26dda1865 100644 --- a/src/api/resources/vendors/client/requests/BatchGetVendorsRequest.ts +++ b/src/api/resources/vendors/client/requests/BatchGetVendorsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/vendors/client/requests/BatchUpdateVendorsRequest.ts b/src/api/resources/vendors/client/requests/BatchUpdateVendorsRequest.ts index dc77bd25a..9af78e9eb 100644 --- a/src/api/resources/vendors/client/requests/BatchUpdateVendorsRequest.ts +++ b/src/api/resources/vendors/client/requests/BatchUpdateVendorsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/vendors/client/requests/CreateVendorRequest.ts b/src/api/resources/vendors/client/requests/CreateVendorRequest.ts index 36c70f49a..5af83d983 100644 --- a/src/api/resources/vendors/client/requests/CreateVendorRequest.ts +++ b/src/api/resources/vendors/client/requests/CreateVendorRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/vendors/client/requests/GetVendorsRequest.ts b/src/api/resources/vendors/client/requests/GetVendorsRequest.ts index d36c6a790..ac8bc8927 100644 --- a/src/api/resources/vendors/client/requests/GetVendorsRequest.ts +++ b/src/api/resources/vendors/client/requests/GetVendorsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetVendorsRequest { - /** ID of the [Vendor](entity:Vendor) to retrieve. */ + /** + * ID of the [Vendor](entity:Vendor) to retrieve. + */ vendorId: string; } diff --git a/src/api/resources/vendors/client/requests/SearchVendorsRequest.ts b/src/api/resources/vendors/client/requests/SearchVendorsRequest.ts index 430634fe2..67d1ddc63 100644 --- a/src/api/resources/vendors/client/requests/SearchVendorsRequest.ts +++ b/src/api/resources/vendors/client/requests/SearchVendorsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example diff --git a/src/api/resources/vendors/client/requests/UpdateVendorsRequest.ts b/src/api/resources/vendors/client/requests/UpdateVendorsRequest.ts index b1b4eeb32..912e5811f 100644 --- a/src/api/resources/vendors/client/requests/UpdateVendorsRequest.ts +++ b/src/api/resources/vendors/client/requests/UpdateVendorsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../index"; +import * as Square from "../../../../index"; /** * @example @@ -18,7 +20,9 @@ import type * as Square from "../../../../index"; * } */ export interface UpdateVendorsRequest { - /** ID of the [Vendor](entity:Vendor) to retrieve. */ + /** + * ID of the [Vendor](entity:Vendor) to retrieve. + */ vendorId: string; body: Square.UpdateVendorRequest; } diff --git a/src/api/resources/vendors/client/requests/index.ts b/src/api/resources/vendors/client/requests/index.ts index 6b7ddb67a..68fdae923 100644 --- a/src/api/resources/vendors/client/requests/index.ts +++ b/src/api/resources/vendors/client/requests/index.ts @@ -1,7 +1,7 @@ -export type { BatchCreateVendorsRequest } from "./BatchCreateVendorsRequest"; -export type { BatchGetVendorsRequest } from "./BatchGetVendorsRequest"; -export type { BatchUpdateVendorsRequest } from "./BatchUpdateVendorsRequest"; -export type { CreateVendorRequest } from "./CreateVendorRequest"; -export type { GetVendorsRequest } from "./GetVendorsRequest"; -export type { SearchVendorsRequest } from "./SearchVendorsRequest"; -export type { UpdateVendorsRequest } from "./UpdateVendorsRequest"; +export { type BatchCreateVendorsRequest } from "./BatchCreateVendorsRequest"; +export { type BatchGetVendorsRequest } from "./BatchGetVendorsRequest"; +export { type BatchUpdateVendorsRequest } from "./BatchUpdateVendorsRequest"; +export { type CreateVendorRequest } from "./CreateVendorRequest"; +export { type SearchVendorsRequest } from "./SearchVendorsRequest"; +export { type GetVendorsRequest } from "./GetVendorsRequest"; +export { type UpdateVendorsRequest } from "./UpdateVendorsRequest"; diff --git a/src/api/resources/webhooks/client/Client.ts b/src/api/resources/webhooks/client/Client.ts index 06c9693a0..d9fb560cd 100644 --- a/src/api/resources/webhooks/client/Client.ts +++ b/src/api/resources/webhooks/client/Client.ts @@ -1,28 +1,40 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions } from "../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../BaseClient"; -import { EventTypesClient } from "../resources/eventTypes/client/Client"; -import { SubscriptionsClient } from "../resources/subscriptions/client/Client"; +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; +import { EventTypes } from "../resources/eventTypes/client/Client"; +import { Subscriptions } from "../resources/subscriptions/client/Client"; -export declare namespace WebhooksClient { - export interface Options extends BaseClientOptions {} +export declare namespace Webhooks { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } } -export class WebhooksClient { - protected readonly _options: WebhooksClient.Options; - protected _eventTypes: EventTypesClient | undefined; - protected _subscriptions: SubscriptionsClient | undefined; +export class Webhooks { + protected readonly _options: Webhooks.Options; + protected _eventTypes: EventTypes | undefined; + protected _subscriptions: Subscriptions | undefined; - constructor(options: WebhooksClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Webhooks.Options = {}) { + this._options = _options; } - public get eventTypes(): EventTypesClient { - return (this._eventTypes ??= new EventTypesClient(this._options)); + public get eventTypes(): EventTypes { + return (this._eventTypes ??= new EventTypes(this._options)); } - public get subscriptions(): SubscriptionsClient { - return (this._subscriptions ??= new SubscriptionsClient(this._options)); + public get subscriptions(): Subscriptions { + return (this._subscriptions ??= new Subscriptions(this._options)); } } diff --git a/src/api/resources/webhooks/resources/eventTypes/client/Client.ts b/src/api/resources/webhooks/resources/eventTypes/client/Client.ts index 4605f4a68..90ed0c0d4 100644 --- a/src/api/resources/webhooks/resources/eventTypes/client/Client.ts +++ b/src/api/resources/webhooks/resources/eventTypes/client/Client.ts @@ -1,32 +1,53 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; +import * as errors from "../../../../../../errors/index"; -export declare namespace EventTypesClient { - export interface Options extends BaseClientOptions {} +export declare namespace EventTypes { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class EventTypesClient { - protected readonly _options: EventTypesClient.Options; +export class EventTypes { + protected readonly _options: EventTypes.Options; - constructor(options: EventTypesClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: EventTypes.Options = {}) { + this._options = _options; } /** * Lists all webhook event types that can be subscribed to. * * @param {Square.webhooks.ListEventTypesRequest} request - * @param {EventTypesClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {EventTypes.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.webhooks.eventTypes.list({ @@ -35,29 +56,21 @@ export class EventTypesClient { */ public list( request: Square.webhooks.ListEventTypesRequest = {}, - requestOptions?: EventTypesClient.RequestOptions, + requestOptions?: EventTypes.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); } private async __list( request: Square.webhooks.ListEventTypesRequest = {}, - requestOptions?: EventTypesClient.RequestOptions, + requestOptions?: EventTypes.RequestOptions, ): Promise> { const { apiVersion } = request; const _queryParams: Record = {}; if (apiVersion !== undefined) { - _queryParams.api_version = apiVersion; + _queryParams["api_version"] = apiVersion; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -66,13 +79,18 @@ export class EventTypesClient { "v2/webhooks/event-types", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -113,7 +131,7 @@ export class EventTypesClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/webhooks/resources/eventTypes/client/index.ts b/src/api/resources/webhooks/resources/eventTypes/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/webhooks/resources/eventTypes/client/index.ts +++ b/src/api/resources/webhooks/resources/eventTypes/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/webhooks/resources/eventTypes/client/requests/ListEventTypesRequest.ts b/src/api/resources/webhooks/resources/eventTypes/client/requests/ListEventTypesRequest.ts index 4b8cfb8d4..dacf1b022 100644 --- a/src/api/resources/webhooks/resources/eventTypes/client/requests/ListEventTypesRequest.ts +++ b/src/api/resources/webhooks/resources/eventTypes/client/requests/ListEventTypesRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface ListEventTypesRequest { - /** The API version for which to list event types. Setting this field overrides the default version used by the application. */ + /** + * The API version for which to list event types. Setting this field overrides the default version used by the application. + */ apiVersion?: string | null; } diff --git a/src/api/resources/webhooks/resources/eventTypes/client/requests/index.ts b/src/api/resources/webhooks/resources/eventTypes/client/requests/index.ts index 6482bea3a..2e7e10bf3 100644 --- a/src/api/resources/webhooks/resources/eventTypes/client/requests/index.ts +++ b/src/api/resources/webhooks/resources/eventTypes/client/requests/index.ts @@ -1 +1 @@ -export type { ListEventTypesRequest } from "./ListEventTypesRequest"; +export { type ListEventTypesRequest } from "./ListEventTypesRequest"; diff --git a/src/api/resources/webhooks/resources/index.ts b/src/api/resources/webhooks/resources/index.ts index d38891001..f0cf7982d 100644 --- a/src/api/resources/webhooks/resources/index.ts +++ b/src/api/resources/webhooks/resources/index.ts @@ -1,4 +1,4 @@ export * as eventTypes from "./eventTypes"; -export * from "./eventTypes/client/requests"; export * as subscriptions from "./subscriptions"; +export * from "./eventTypes/client/requests"; export * from "./subscriptions/client/requests"; diff --git a/src/api/resources/webhooks/resources/subscriptions/client/Client.ts b/src/api/resources/webhooks/resources/subscriptions/client/Client.ts index 622abbddb..bf4415611 100644 --- a/src/api/resources/webhooks/resources/subscriptions/client/Client.ts +++ b/src/api/resources/webhooks/resources/subscriptions/client/Client.ts @@ -1,32 +1,53 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import { normalizeClientOptions } from "../../../../../../BaseClient"; +import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; +import * as Square from "../../../../../index"; +import * as serializers from "../../../../../../serialization/index"; import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; -import * as environments from "../../../../../../environments"; import * as errors from "../../../../../../errors/index"; -import * as serializers from "../../../../../../serialization/index"; -import type * as Square from "../../../../../index"; -export declare namespace SubscriptionsClient { - export interface Options extends BaseClientOptions {} +export declare namespace Subscriptions { + export interface Options { + environment?: core.Supplier; + /** Specify a custom URL to connect the client to. */ + baseUrl?: core.Supplier; + token?: core.Supplier; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in requests. */ + headers?: Record | undefined>; + fetcher?: core.FetchFunction; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the Square-Version header */ + version?: "2025-07-16"; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } -export class SubscriptionsClient { - protected readonly _options: SubscriptionsClient.Options; +export class Subscriptions { + protected readonly _options: Subscriptions.Options; - constructor(options: SubscriptionsClient.Options = {}) { - this._options = normalizeClientOptions(options); + constructor(_options: Subscriptions.Options = {}) { + this._options = _options; } /** * Lists all webhook subscriptions owned by your application. * * @param {Square.webhooks.ListSubscriptionsRequest} request - * @param {SubscriptionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.webhooks.subscriptions.list({ @@ -38,8 +59,8 @@ export class SubscriptionsClient { */ public async list( request: Square.webhooks.ListSubscriptionsRequest = {}, - requestOptions?: SubscriptionsClient.RequestOptions, - ): Promise> { + requestOptions?: Subscriptions.RequestOptions, + ): Promise> { const list = core.HttpResponsePromise.interceptFunction( async ( request: Square.webhooks.ListSubscriptionsRequest, @@ -47,28 +68,20 @@ export class SubscriptionsClient { const { cursor, includeDisabled, sortOrder, limit } = request; const _queryParams: Record = {}; if (cursor !== undefined) { - _queryParams.cursor = cursor; + _queryParams["cursor"] = cursor; } if (includeDisabled !== undefined) { - _queryParams.include_disabled = includeDisabled?.toString() ?? null; + _queryParams["include_disabled"] = includeDisabled?.toString() ?? null; } if (sortOrder !== undefined) { - _queryParams.sort_order = serializers.SortOrder.jsonOrThrow(sortOrder, { + _queryParams["sort_order"] = serializers.SortOrder.jsonOrThrow(sortOrder, { unrecognizedObjectKeys: "strip", omitUndefined: true, }); } if (limit !== undefined) { - _queryParams.limit = limit?.toString() ?? null; + _queryParams["limit"] = limit?.toString() ?? null; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -77,13 +90,19 @@ export class SubscriptionsClient { "v2/webhooks/subscriptions", ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: + requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -124,7 +143,7 @@ export class SubscriptionsClient { }, ); const dataWithRawResponse = await list(request).withRawResponse(); - return new core.Page({ + return new core.Pageable({ response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => @@ -140,7 +159,7 @@ export class SubscriptionsClient { * Creates a webhook subscription. * * @param {Square.webhooks.CreateWebhookSubscriptionRequest} request - * @param {SubscriptionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.webhooks.subscriptions.create({ @@ -155,23 +174,15 @@ export class SubscriptionsClient { */ public create( request: Square.webhooks.CreateWebhookSubscriptionRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions)); } private async __create( request: Square.webhooks.CreateWebhookSubscriptionRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? @@ -180,19 +191,23 @@ export class SubscriptionsClient { "v2/webhooks/subscriptions", ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.webhooks.CreateWebhookSubscriptionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -236,7 +251,7 @@ export class SubscriptionsClient { * Retrieves a webhook subscription identified by its ID. * * @param {Square.webhooks.GetSubscriptionsRequest} request - * @param {SubscriptionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.webhooks.subscriptions.get({ @@ -245,39 +260,35 @@ export class SubscriptionsClient { */ public get( request: Square.webhooks.GetSubscriptionsRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__get(request, requestOptions)); } private async __get( request: Square.webhooks.GetSubscriptionsRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/webhooks/subscriptions/${core.url.encodePathParam(subscriptionId)}`, + `v2/webhooks/subscriptions/${encodeURIComponent(subscriptionId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -323,7 +334,7 @@ export class SubscriptionsClient { * Updates a webhook subscription. * * @param {Square.webhooks.UpdateWebhookSubscriptionRequest} request - * @param {SubscriptionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.webhooks.subscriptions.update({ @@ -336,45 +347,41 @@ export class SubscriptionsClient { */ public update( request: Square.webhooks.UpdateWebhookSubscriptionRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__update(request, requestOptions)); } private async __update( request: Square.webhooks.UpdateWebhookSubscriptionRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/webhooks/subscriptions/${core.url.encodePathParam(subscriptionId)}`, + `v2/webhooks/subscriptions/${encodeURIComponent(subscriptionId)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.webhooks.UpdateWebhookSubscriptionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -420,7 +427,7 @@ export class SubscriptionsClient { * Deletes a webhook subscription. * * @param {Square.webhooks.DeleteSubscriptionsRequest} request - * @param {SubscriptionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.webhooks.subscriptions.delete({ @@ -429,39 +436,35 @@ export class SubscriptionsClient { */ public delete( request: Square.webhooks.DeleteSubscriptionsRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__delete(request, requestOptions)); } private async __delete( request: Square.webhooks.DeleteSubscriptionsRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/webhooks/subscriptions/${core.url.encodePathParam(subscriptionId)}`, + `v2/webhooks/subscriptions/${encodeURIComponent(subscriptionId)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -507,7 +510,7 @@ export class SubscriptionsClient { * Updates a webhook subscription by replacing the existing signature key with a new one. * * @param {Square.webhooks.UpdateWebhookSubscriptionSignatureKeyRequest} request - * @param {SubscriptionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.webhooks.subscriptions.updateSignatureKey({ @@ -517,45 +520,41 @@ export class SubscriptionsClient { */ public updateSignatureKey( request: Square.webhooks.UpdateWebhookSubscriptionSignatureKeyRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__updateSignatureKey(request, requestOptions)); } private async __updateSignatureKey( request: Square.webhooks.UpdateWebhookSubscriptionSignatureKeyRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/webhooks/subscriptions/${core.url.encodePathParam(subscriptionId)}/signature-key`, + `v2/webhooks/subscriptions/${encodeURIComponent(subscriptionId)}/signature-key`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.webhooks.UpdateWebhookSubscriptionSignatureKeyRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -601,7 +600,7 @@ export class SubscriptionsClient { * Tests a webhook subscription by sending a test event to the notification URL. * * @param {Square.webhooks.TestWebhookSubscriptionRequest} request - * @param {SubscriptionsClient.RequestOptions} requestOptions - Request-specific configuration. + * @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration. * * @example * await client.webhooks.subscriptions.test({ @@ -611,45 +610,41 @@ export class SubscriptionsClient { */ public test( request: Square.webhooks.TestWebhookSubscriptionRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__test(request, requestOptions)); } private async __test( request: Square.webhooks.TestWebhookSubscriptionRequest, - requestOptions?: SubscriptionsClient.RequestOptions, + requestOptions?: Subscriptions.RequestOptions, ): Promise> { const { subscriptionId, ..._body } = request; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ - Authorization: await this._getAuthorizationHeader(), - "Square-Version": requestOptions?.version ?? "2025-10-16", - }), - requestOptions?.headers, - ); const _response = await (this._options.fetcher ?? core.fetcher)({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? environments.SquareEnvironment.Production, - `v2/webhooks/subscriptions/${core.url.encodePathParam(subscriptionId)}/test`, + `v2/webhooks/subscriptions/${encodeURIComponent(subscriptionId)}/test`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ + Authorization: await this._getAuthorizationHeader(), + "Square-Version": requestOptions?.version ?? "2025-07-16", + }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.webhooks.TestWebhookSubscriptionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", omitUndefined: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, }); if (_response.ok) { return { @@ -692,7 +687,7 @@ export class SubscriptionsClient { } protected async _getAuthorizationHeader(): Promise { - const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env.SQUARE_TOKEN; + const bearer = (await core.Supplier.get(this._options.token)) ?? process?.env["SQUARE_TOKEN"]; if (bearer != null) { return `Bearer ${bearer}`; } diff --git a/src/api/resources/webhooks/resources/subscriptions/client/index.ts b/src/api/resources/webhooks/resources/subscriptions/client/index.ts index 415726b7f..f33205a0f 100644 --- a/src/api/resources/webhooks/resources/subscriptions/client/index.ts +++ b/src/api/resources/webhooks/resources/subscriptions/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/webhooks/resources/subscriptions/client/requests/CreateWebhookSubscriptionRequest.ts b/src/api/resources/webhooks/resources/subscriptions/client/requests/CreateWebhookSubscriptionRequest.ts index 6203a96bd..8b5233858 100644 --- a/src/api/resources/webhooks/resources/subscriptions/client/requests/CreateWebhookSubscriptionRequest.ts +++ b/src/api/resources/webhooks/resources/subscriptions/client/requests/CreateWebhookSubscriptionRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/webhooks/resources/subscriptions/client/requests/DeleteSubscriptionsRequest.ts b/src/api/resources/webhooks/resources/subscriptions/client/requests/DeleteSubscriptionsRequest.ts index de2b7e18d..e348ad484 100644 --- a/src/api/resources/webhooks/resources/subscriptions/client/requests/DeleteSubscriptionsRequest.ts +++ b/src/api/resources/webhooks/resources/subscriptions/client/requests/DeleteSubscriptionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface DeleteSubscriptionsRequest { - /** [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to delete. */ + /** + * [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to delete. + */ subscriptionId: string; } diff --git a/src/api/resources/webhooks/resources/subscriptions/client/requests/GetSubscriptionsRequest.ts b/src/api/resources/webhooks/resources/subscriptions/client/requests/GetSubscriptionsRequest.ts index febafeb9d..fde07880e 100644 --- a/src/api/resources/webhooks/resources/subscriptions/client/requests/GetSubscriptionsRequest.ts +++ b/src/api/resources/webhooks/resources/subscriptions/client/requests/GetSubscriptionsRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface GetSubscriptionsRequest { - /** [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to retrieve. */ + /** + * [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to retrieve. + */ subscriptionId: string; } diff --git a/src/api/resources/webhooks/resources/subscriptions/client/requests/ListSubscriptionsRequest.ts b/src/api/resources/webhooks/resources/subscriptions/client/requests/ListSubscriptionsRequest.ts index 9f83667fd..3507e8a2b 100644 --- a/src/api/resources/webhooks/resources/subscriptions/client/requests/ListSubscriptionsRequest.ts +++ b/src/api/resources/webhooks/resources/subscriptions/client/requests/ListSubscriptionsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example diff --git a/src/api/resources/webhooks/resources/subscriptions/client/requests/TestWebhookSubscriptionRequest.ts b/src/api/resources/webhooks/resources/subscriptions/client/requests/TestWebhookSubscriptionRequest.ts index 1c4c4ba8c..2d08b14bb 100644 --- a/src/api/resources/webhooks/resources/subscriptions/client/requests/TestWebhookSubscriptionRequest.ts +++ b/src/api/resources/webhooks/resources/subscriptions/client/requests/TestWebhookSubscriptionRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,7 +10,9 @@ * } */ export interface TestWebhookSubscriptionRequest { - /** [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to test. */ + /** + * [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to test. + */ subscriptionId: string; /** * The event type that will be used to test the [Subscription](entity:WebhookSubscription). The event type must be diff --git a/src/api/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionRequest.ts b/src/api/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionRequest.ts index 8359ec87c..379f9f4e9 100644 --- a/src/api/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionRequest.ts +++ b/src/api/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../index"; +import * as Square from "../../../../../../index"; /** * @example @@ -13,7 +15,9 @@ import type * as Square from "../../../../../../index"; * } */ export interface UpdateWebhookSubscriptionRequest { - /** [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to update. */ + /** + * [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to update. + */ subscriptionId: string; /** The [Subscription](entity:WebhookSubscription) to update. */ subscription?: Square.WebhookSubscription; diff --git a/src/api/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionSignatureKeyRequest.ts b/src/api/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionSignatureKeyRequest.ts index 0d0d7e45b..3a61969f4 100644 --- a/src/api/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionSignatureKeyRequest.ts +++ b/src/api/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionSignatureKeyRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -8,7 +10,9 @@ * } */ export interface UpdateWebhookSubscriptionSignatureKeyRequest { - /** [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to update. */ + /** + * [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to update. + */ subscriptionId: string; /** A unique string that identifies the [UpdateWebhookSubscriptionSignatureKey](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscriptionSignatureKey) request. */ idempotencyKey?: string | null; diff --git a/src/api/resources/webhooks/resources/subscriptions/client/requests/index.ts b/src/api/resources/webhooks/resources/subscriptions/client/requests/index.ts index 554524f6a..f32c424a4 100644 --- a/src/api/resources/webhooks/resources/subscriptions/client/requests/index.ts +++ b/src/api/resources/webhooks/resources/subscriptions/client/requests/index.ts @@ -1,7 +1,7 @@ -export type { CreateWebhookSubscriptionRequest } from "./CreateWebhookSubscriptionRequest"; -export type { DeleteSubscriptionsRequest } from "./DeleteSubscriptionsRequest"; -export type { GetSubscriptionsRequest } from "./GetSubscriptionsRequest"; -export type { ListSubscriptionsRequest } from "./ListSubscriptionsRequest"; -export type { TestWebhookSubscriptionRequest } from "./TestWebhookSubscriptionRequest"; -export type { UpdateWebhookSubscriptionRequest } from "./UpdateWebhookSubscriptionRequest"; -export type { UpdateWebhookSubscriptionSignatureKeyRequest } from "./UpdateWebhookSubscriptionSignatureKeyRequest"; +export { type ListSubscriptionsRequest } from "./ListSubscriptionsRequest"; +export { type CreateWebhookSubscriptionRequest } from "./CreateWebhookSubscriptionRequest"; +export { type GetSubscriptionsRequest } from "./GetSubscriptionsRequest"; +export { type UpdateWebhookSubscriptionRequest } from "./UpdateWebhookSubscriptionRequest"; +export { type DeleteSubscriptionsRequest } from "./DeleteSubscriptionsRequest"; +export { type UpdateWebhookSubscriptionSignatureKeyRequest } from "./UpdateWebhookSubscriptionSignatureKeyRequest"; +export { type TestWebhookSubscriptionRequest } from "./TestWebhookSubscriptionRequest"; diff --git a/src/api/types/AcceptDisputeResponse.ts b/src/api/types/AcceptDisputeResponse.ts index eb64ae625..5cf8036d7 100644 --- a/src/api/types/AcceptDisputeResponse.ts +++ b/src/api/types/AcceptDisputeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields in an `AcceptDispute` response. diff --git a/src/api/types/AcceptedPaymentMethods.ts b/src/api/types/AcceptedPaymentMethods.ts index 78c1929c0..0c05ee8f3 100644 --- a/src/api/types/AcceptedPaymentMethods.ts +++ b/src/api/types/AcceptedPaymentMethods.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface AcceptedPaymentMethods { /** Whether Apple Pay is accepted at checkout. */ diff --git a/src/api/types/AccumulateLoyaltyPointsResponse.ts b/src/api/types/AccumulateLoyaltyPointsResponse.ts index 3595e437b..524ee73d3 100644 --- a/src/api/types/AccumulateLoyaltyPointsResponse.ts +++ b/src/api/types/AccumulateLoyaltyPointsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an [AccumulateLoyaltyPoints](api-endpoint:Loyalty-AccumulateLoyaltyPoints) response. diff --git a/src/api/types/AchDetails.ts b/src/api/types/AchDetails.ts index 3eb96fe39..cdf932f07 100644 --- a/src/api/types/AchDetails.ts +++ b/src/api/types/AchDetails.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * ACH-specific details about `BANK_ACCOUNT` type payments with the `transfer_type` of `ACH`. diff --git a/src/api/types/ActionCancelReason.ts b/src/api/types/ActionCancelReason.ts index 6fa5816b5..1d1653a63 100644 --- a/src/api/types/ActionCancelReason.ts +++ b/src/api/types/ActionCancelReason.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type ActionCancelReason = "BUYER_CANCELED" | "SELLER_CANCELED" | "TIMED_OUT"; export const ActionCancelReason = { BuyerCanceled: "BUYER_CANCELED", SellerCanceled: "SELLER_CANCELED", TimedOut: "TIMED_OUT", } as const; -export type ActionCancelReason = (typeof ActionCancelReason)[keyof typeof ActionCancelReason]; diff --git a/src/api/types/ActivityType.ts b/src/api/types/ActivityType.ts index 86d86082b..e31d2abb1 100644 --- a/src/api/types/ActivityType.ts +++ b/src/api/types/ActivityType.ts @@ -1,5 +1,66 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type ActivityType = + | "ADJUSTMENT" + | "APP_FEE_REFUND" + | "APP_FEE_REVENUE" + | "AUTOMATIC_SAVINGS" + | "AUTOMATIC_SAVINGS_REVERSED" + | "CHARGE" + | "DEPOSIT_FEE" + | "DEPOSIT_FEE_REVERSED" + | "DISPUTE" + | "ESCHEATMENT" + | "FEE" + | "FREE_PROCESSING" + | "HOLD_ADJUSTMENT" + | "INITIAL_BALANCE_CHANGE" + | "MONEY_TRANSFER" + | "MONEY_TRANSFER_REVERSAL" + | "OPEN_DISPUTE" + | "OTHER" + | "OTHER_ADJUSTMENT" + | "PAID_SERVICE_FEE" + | "PAID_SERVICE_FEE_REFUND" + | "REDEMPTION_CODE" + | "REFUND" + | "RELEASE_ADJUSTMENT" + | "RESERVE_HOLD" + | "RESERVE_RELEASE" + | "RETURNED_PAYOUT" + | "SQUARE_CAPITAL_PAYMENT" + | "SQUARE_CAPITAL_REVERSED_PAYMENT" + | "SUBSCRIPTION_FEE" + | "SUBSCRIPTION_FEE_PAID_REFUND" + | "SUBSCRIPTION_FEE_REFUND" + | "TAX_ON_FEE" + | "THIRD_PARTY_FEE" + | "THIRD_PARTY_FEE_REFUND" + | "PAYOUT" + | "AUTOMATIC_BITCOIN_CONVERSIONS" + | "AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED" + | "CREDIT_CARD_REPAYMENT" + | "CREDIT_CARD_REPAYMENT_REVERSED" + | "LOCAL_OFFERS_CASHBACK" + | "LOCAL_OFFERS_FEE" + | "PERCENTAGE_PROCESSING_ENROLLMENT" + | "PERCENTAGE_PROCESSING_DEACTIVATION" + | "PERCENTAGE_PROCESSING_REPAYMENT" + | "PERCENTAGE_PROCESSING_REPAYMENT_REVERSED" + | "PROCESSING_FEE" + | "PROCESSING_FEE_REFUND" + | "UNDO_PROCESSING_FEE_REFUND" + | "GIFT_CARD_LOAD_FEE" + | "GIFT_CARD_LOAD_FEE_REFUND" + | "UNDO_GIFT_CARD_LOAD_FEE_REFUND" + | "BALANCE_FOLDERS_TRANSFER" + | "BALANCE_FOLDERS_TRANSFER_REVERSED" + | "GIFT_CARD_POOL_TRANSFER" + | "GIFT_CARD_POOL_TRANSFER_REVERSED" + | "SQUARE_PAYROLL_TRANSFER" + | "SQUARE_PAYROLL_TRANSFER_REVERSED"; export const ActivityType = { Adjustment: "ADJUSTMENT", AppFeeRefund: "APP_FEE_REFUND", @@ -60,4 +121,3 @@ export const ActivityType = { SquarePayrollTransfer: "SQUARE_PAYROLL_TRANSFER", SquarePayrollTransferReversed: "SQUARE_PAYROLL_TRANSFER_REVERSED", } as const; -export type ActivityType = (typeof ActivityType)[keyof typeof ActivityType]; diff --git a/src/api/types/AddGroupToCustomerResponse.ts b/src/api/types/AddGroupToCustomerResponse.ts index 67e1426a7..064a809ed 100644 --- a/src/api/types/AddGroupToCustomerResponse.ts +++ b/src/api/types/AddGroupToCustomerResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/AdditionalRecipient.ts b/src/api/types/AdditionalRecipient.ts index 76d0d10d7..35b50da40 100644 --- a/src/api/types/AdditionalRecipient.ts +++ b/src/api/types/AdditionalRecipient.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an additional recipient (other than the merchant) receiving a portion of this tender. diff --git a/src/api/types/Address.ts b/src/api/types/Address.ts index 2de755680..31ed6e0dd 100644 --- a/src/api/types/Address.ts +++ b/src/api/types/Address.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a postal address in a country. diff --git a/src/api/types/AdjustLoyaltyPointsResponse.ts b/src/api/types/AdjustLoyaltyPointsResponse.ts index c252e6464..90365ec62 100644 --- a/src/api/types/AdjustLoyaltyPointsResponse.ts +++ b/src/api/types/AdjustLoyaltyPointsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an [AdjustLoyaltyPoints](api-endpoint:Loyalty-AdjustLoyaltyPoints) request. diff --git a/src/api/types/AfterpayDetails.ts b/src/api/types/AfterpayDetails.ts index 02fb6edac..48fbcac19 100644 --- a/src/api/types/AfterpayDetails.ts +++ b/src/api/types/AfterpayDetails.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Additional details about Afterpay payments. diff --git a/src/api/types/ApplicationDetails.ts b/src/api/types/ApplicationDetails.ts index 972d668aa..af1fb2d46 100644 --- a/src/api/types/ApplicationDetails.ts +++ b/src/api/types/ApplicationDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Details about the application that took the payment. diff --git a/src/api/types/ApplicationDetailsExternalSquareProduct.ts b/src/api/types/ApplicationDetailsExternalSquareProduct.ts index 243f9ded7..f4a156f50 100644 --- a/src/api/types/ApplicationDetailsExternalSquareProduct.ts +++ b/src/api/types/ApplicationDetailsExternalSquareProduct.ts @@ -1,6 +1,21 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** A list of products to return to external callers. */ +/** + * A list of products to return to external callers. + */ +export type ApplicationDetailsExternalSquareProduct = + | "APPOINTMENTS" + | "ECOMMERCE_API" + | "INVOICES" + | "ONLINE_STORE" + | "OTHER" + | "RESTAURANTS" + | "RETAIL" + | "SQUARE_POS" + | "TERMINAL_API" + | "VIRTUAL_TERMINAL"; export const ApplicationDetailsExternalSquareProduct = { Appointments: "APPOINTMENTS", EcommerceApi: "ECOMMERCE_API", @@ -13,5 +28,3 @@ export const ApplicationDetailsExternalSquareProduct = { TerminalApi: "TERMINAL_API", VirtualTerminal: "VIRTUAL_TERMINAL", } as const; -export type ApplicationDetailsExternalSquareProduct = - (typeof ApplicationDetailsExternalSquareProduct)[keyof typeof ApplicationDetailsExternalSquareProduct]; diff --git a/src/api/types/ApplicationType.ts b/src/api/types/ApplicationType.ts index cb5649c86..60d86551d 100644 --- a/src/api/types/ApplicationType.ts +++ b/src/api/types/ApplicationType.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type ApplicationType = "TERMINAL_API"; diff --git a/src/api/types/AppointmentSegment.ts b/src/api/types/AppointmentSegment.ts index 2c20ed327..fd5e7e479 100644 --- a/src/api/types/AppointmentSegment.ts +++ b/src/api/types/AppointmentSegment.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Defines an appointment segment of a booking. diff --git a/src/api/types/ArchivedState.ts b/src/api/types/ArchivedState.ts index 94fa49d2d..9bdf9cc21 100644 --- a/src/api/types/ArchivedState.ts +++ b/src/api/types/ArchivedState.ts @@ -1,13 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Defines the values for the `archived_state` query expression * used in [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) * to return the archived, not archived or either type of catalog items. */ +export type ArchivedState = "ARCHIVED_STATE_NOT_ARCHIVED" | "ARCHIVED_STATE_ARCHIVED" | "ARCHIVED_STATE_ALL"; export const ArchivedState = { ArchivedStateNotArchived: "ARCHIVED_STATE_NOT_ARCHIVED", ArchivedStateArchived: "ARCHIVED_STATE_ARCHIVED", ArchivedStateAll: "ARCHIVED_STATE_ALL", } as const; -export type ArchivedState = (typeof ArchivedState)[keyof typeof ArchivedState]; diff --git a/src/api/types/Availability.ts b/src/api/types/Availability.ts index 45cf1e5b6..3dfd740d8 100644 --- a/src/api/types/Availability.ts +++ b/src/api/types/Availability.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines an appointment slot that encapsulates the appointment segments, location and starting time available for booking. diff --git a/src/api/types/BankAccount.ts b/src/api/types/BankAccount.ts index 83f68f4f8..46946a700 100644 --- a/src/api/types/BankAccount.ts +++ b/src/api/types/BankAccount.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a bank account. For more information about diff --git a/src/api/types/BankAccountCreatedEvent.ts b/src/api/types/BankAccountCreatedEvent.ts index d9297cb92..71b39e5cf 100644 --- a/src/api/types/BankAccountCreatedEvent.ts +++ b/src/api/types/BankAccountCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when you link an external bank account to a Square diff --git a/src/api/types/BankAccountCreatedEventData.ts b/src/api/types/BankAccountCreatedEventData.ts index 929735042..f3fedf2ea 100644 --- a/src/api/types/BankAccountCreatedEventData.ts +++ b/src/api/types/BankAccountCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface BankAccountCreatedEventData { /** Name of the affected object’s type, `"bank_account"`. */ diff --git a/src/api/types/BankAccountCreatedEventObject.ts b/src/api/types/BankAccountCreatedEventObject.ts index e3c8c8634..34545b8dc 100644 --- a/src/api/types/BankAccountCreatedEventObject.ts +++ b/src/api/types/BankAccountCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface BankAccountCreatedEventObject { /** The created bank account. */ diff --git a/src/api/types/BankAccountDisabledEvent.ts b/src/api/types/BankAccountDisabledEvent.ts index 44eda7202..9e54b24de 100644 --- a/src/api/types/BankAccountDisabledEvent.ts +++ b/src/api/types/BankAccountDisabledEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when Square sets the status of a diff --git a/src/api/types/BankAccountDisabledEventData.ts b/src/api/types/BankAccountDisabledEventData.ts index 57383f87c..842bb3dac 100644 --- a/src/api/types/BankAccountDisabledEventData.ts +++ b/src/api/types/BankAccountDisabledEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface BankAccountDisabledEventData { /** Name of the affected object’s type, `"bank_account"`. */ diff --git a/src/api/types/BankAccountDisabledEventObject.ts b/src/api/types/BankAccountDisabledEventObject.ts index 76b44ecfc..8ef0589dc 100644 --- a/src/api/types/BankAccountDisabledEventObject.ts +++ b/src/api/types/BankAccountDisabledEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface BankAccountDisabledEventObject { /** The disabled bank account. */ diff --git a/src/api/types/BankAccountPaymentDetails.ts b/src/api/types/BankAccountPaymentDetails.ts index 1a0b2b4a9..67c412152 100644 --- a/src/api/types/BankAccountPaymentDetails.ts +++ b/src/api/types/BankAccountPaymentDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Additional details about BANK_ACCOUNT type payments. diff --git a/src/api/types/BankAccountStatus.ts b/src/api/types/BankAccountStatus.ts index 3ac10423b..8ffa2f5ec 100644 --- a/src/api/types/BankAccountStatus.ts +++ b/src/api/types/BankAccountStatus.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates the current verification status of a `BankAccount` object. */ +/** + * Indicates the current verification status of a `BankAccount` object. + */ +export type BankAccountStatus = "VERIFICATION_IN_PROGRESS" | "VERIFIED" | "DISABLED"; export const BankAccountStatus = { VerificationInProgress: "VERIFICATION_IN_PROGRESS", Verified: "VERIFIED", Disabled: "DISABLED", } as const; -export type BankAccountStatus = (typeof BankAccountStatus)[keyof typeof BankAccountStatus]; diff --git a/src/api/types/BankAccountType.ts b/src/api/types/BankAccountType.ts index 87bc55720..fe1a46083 100644 --- a/src/api/types/BankAccountType.ts +++ b/src/api/types/BankAccountType.ts @@ -1,6 +1,11 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates the financial purpose of the bank account. */ +/** + * Indicates the financial purpose of the bank account. + */ +export type BankAccountType = "CHECKING" | "SAVINGS" | "INVESTMENT" | "OTHER" | "BUSINESS_CHECKING"; export const BankAccountType = { Checking: "CHECKING", Savings: "SAVINGS", @@ -8,4 +13,3 @@ export const BankAccountType = { Other: "OTHER", BusinessChecking: "BUSINESS_CHECKING", } as const; -export type BankAccountType = (typeof BankAccountType)[keyof typeof BankAccountType]; diff --git a/src/api/types/BankAccountVerifiedEvent.ts b/src/api/types/BankAccountVerifiedEvent.ts index 6a2ce32ef..ffbf6a3a2 100644 --- a/src/api/types/BankAccountVerifiedEvent.ts +++ b/src/api/types/BankAccountVerifiedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when Square sets the status of a diff --git a/src/api/types/BankAccountVerifiedEventData.ts b/src/api/types/BankAccountVerifiedEventData.ts index a757dd502..7976fc30a 100644 --- a/src/api/types/BankAccountVerifiedEventData.ts +++ b/src/api/types/BankAccountVerifiedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface BankAccountVerifiedEventData { /** Name of the affected object’s type, `"bank_account"`. */ diff --git a/src/api/types/BankAccountVerifiedEventObject.ts b/src/api/types/BankAccountVerifiedEventObject.ts index d6c3d143f..26af16448 100644 --- a/src/api/types/BankAccountVerifiedEventObject.ts +++ b/src/api/types/BankAccountVerifiedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface BankAccountVerifiedEventObject { /** The verified bank account. */ diff --git a/src/api/types/BatchChangeInventoryRequest.ts b/src/api/types/BatchChangeInventoryRequest.ts index 4ae161bb6..1399ddc0d 100644 --- a/src/api/types/BatchChangeInventoryRequest.ts +++ b/src/api/types/BatchChangeInventoryRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface BatchChangeInventoryRequest { /** diff --git a/src/api/types/BatchChangeInventoryResponse.ts b/src/api/types/BatchChangeInventoryResponse.ts index 001ff66a2..cbda27c7c 100644 --- a/src/api/types/BatchChangeInventoryResponse.ts +++ b/src/api/types/BatchChangeInventoryResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface BatchChangeInventoryResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/BatchCreateTeamMembersResponse.ts b/src/api/types/BatchCreateTeamMembersResponse.ts index 18768cabe..cdcb977b4 100644 --- a/src/api/types/BatchCreateTeamMembersResponse.ts +++ b/src/api/types/BatchCreateTeamMembersResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response from a bulk create request containing the created `TeamMember` objects or error messages. diff --git a/src/api/types/BatchCreateVendorsResponse.ts b/src/api/types/BatchCreateVendorsResponse.ts index 2edb1a6d4..80ac755e2 100644 --- a/src/api/types/BatchCreateVendorsResponse.ts +++ b/src/api/types/BatchCreateVendorsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an output from a call to [BulkCreateVendors](api-endpoint:Vendors-BulkCreateVendors). diff --git a/src/api/types/BatchDeleteCatalogObjectsResponse.ts b/src/api/types/BatchDeleteCatalogObjectsResponse.ts index fe86e5712..18104eca4 100644 --- a/src/api/types/BatchDeleteCatalogObjectsResponse.ts +++ b/src/api/types/BatchDeleteCatalogObjectsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface BatchDeleteCatalogObjectsResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/BatchGetCatalogObjectsResponse.ts b/src/api/types/BatchGetCatalogObjectsResponse.ts index bbbfffd85..55ec80255 100644 --- a/src/api/types/BatchGetCatalogObjectsResponse.ts +++ b/src/api/types/BatchGetCatalogObjectsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface BatchGetCatalogObjectsResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/BatchGetInventoryChangesResponse.ts b/src/api/types/BatchGetInventoryChangesResponse.ts index 2dec1c7e9..9921d17fe 100644 --- a/src/api/types/BatchGetInventoryChangesResponse.ts +++ b/src/api/types/BatchGetInventoryChangesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface BatchGetInventoryChangesResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/BatchGetInventoryCountsRequest.ts b/src/api/types/BatchGetInventoryCountsRequest.ts index a08eae5f2..2a606e459 100644 --- a/src/api/types/BatchGetInventoryCountsRequest.ts +++ b/src/api/types/BatchGetInventoryCountsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface BatchGetInventoryCountsRequest { /** diff --git a/src/api/types/BatchGetInventoryCountsResponse.ts b/src/api/types/BatchGetInventoryCountsResponse.ts index 858db849e..3f436778a 100644 --- a/src/api/types/BatchGetInventoryCountsResponse.ts +++ b/src/api/types/BatchGetInventoryCountsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface BatchGetInventoryCountsResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/BatchGetOrdersResponse.ts b/src/api/types/BatchGetOrdersResponse.ts index 0c3cadbfd..82b088f50 100644 --- a/src/api/types/BatchGetOrdersResponse.ts +++ b/src/api/types/BatchGetOrdersResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/BatchGetVendorsResponse.ts b/src/api/types/BatchGetVendorsResponse.ts index 201c29362..3c3cb05d1 100644 --- a/src/api/types/BatchGetVendorsResponse.ts +++ b/src/api/types/BatchGetVendorsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an output from a call to [BulkRetrieveVendors](api-endpoint:Vendors-BulkRetrieveVendors). diff --git a/src/api/types/BatchRetrieveInventoryChangesRequest.ts b/src/api/types/BatchRetrieveInventoryChangesRequest.ts index 96652103a..66c6c1cb7 100644 --- a/src/api/types/BatchRetrieveInventoryChangesRequest.ts +++ b/src/api/types/BatchRetrieveInventoryChangesRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface BatchRetrieveInventoryChangesRequest { /** diff --git a/src/api/types/BatchUpdateTeamMembersResponse.ts b/src/api/types/BatchUpdateTeamMembersResponse.ts index 334b62398..c3b6d9cb7 100644 --- a/src/api/types/BatchUpdateTeamMembersResponse.ts +++ b/src/api/types/BatchUpdateTeamMembersResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response from a bulk update request containing the updated `TeamMember` objects or error messages. diff --git a/src/api/types/BatchUpdateVendorsResponse.ts b/src/api/types/BatchUpdateVendorsResponse.ts index 1343c93db..e9e88cd75 100644 --- a/src/api/types/BatchUpdateVendorsResponse.ts +++ b/src/api/types/BatchUpdateVendorsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an output from a call to [BulkUpdateVendors](api-endpoint:Vendors-BulkUpdateVendors). diff --git a/src/api/types/BatchUpsertCatalogObjectsResponse.ts b/src/api/types/BatchUpsertCatalogObjectsResponse.ts index fb2e7178d..96bb78280 100644 --- a/src/api/types/BatchUpsertCatalogObjectsResponse.ts +++ b/src/api/types/BatchUpsertCatalogObjectsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface BatchUpsertCatalogObjectsResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.ts b/src/api/types/BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.ts index fd760a2f4..ee0132735 100644 --- a/src/api/types/BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.ts +++ b/src/api/types/BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an individual upsert request in a [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) diff --git a/src/api/types/BatchUpsertCustomerCustomAttributesResponse.ts b/src/api/types/BatchUpsertCustomerCustomAttributesResponse.ts index d1f73265d..800dbb96e 100644 --- a/src/api/types/BatchUpsertCustomerCustomAttributesResponse.ts +++ b/src/api/types/BatchUpsertCustomerCustomAttributesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) response, diff --git a/src/api/types/BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse.ts b/src/api/types/BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse.ts index 2909f5a15..3436be474 100644 --- a/src/api/types/BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse.ts +++ b/src/api/types/BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response for an individual upsert request in a [BulkUpsertCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-BulkUpsertCustomerCustomAttributes) operation. diff --git a/src/api/types/Booking.ts b/src/api/types/Booking.ts index 93e203374..c861453d3 100644 --- a/src/api/types/Booking.ts +++ b/src/api/types/Booking.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a booking as a time-bound service contract for a seller's staff member to provide a specified service diff --git a/src/api/types/BookingBookingSource.ts b/src/api/types/BookingBookingSource.ts index 76bbf801b..6b7febd37 100644 --- a/src/api/types/BookingBookingSource.ts +++ b/src/api/types/BookingBookingSource.ts @@ -1,10 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Supported sources a booking was created from. */ +/** + * Supported sources a booking was created from. + */ +export type BookingBookingSource = "FIRST_PARTY_MERCHANT" | "FIRST_PARTY_BUYER" | "THIRD_PARTY_BUYER" | "API"; export const BookingBookingSource = { FirstPartyMerchant: "FIRST_PARTY_MERCHANT", FirstPartyBuyer: "FIRST_PARTY_BUYER", ThirdPartyBuyer: "THIRD_PARTY_BUYER", Api: "API", } as const; -export type BookingBookingSource = (typeof BookingBookingSource)[keyof typeof BookingBookingSource]; diff --git a/src/api/types/BookingCreatedEvent.ts b/src/api/types/BookingCreatedEvent.ts index f1ac0aba7..646208cca 100644 --- a/src/api/types/BookingCreatedEvent.ts +++ b/src/api/types/BookingCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a booking is created. diff --git a/src/api/types/BookingCreatedEventData.ts b/src/api/types/BookingCreatedEventData.ts index 7dd7ac19f..ec3d1584d 100644 --- a/src/api/types/BookingCreatedEventData.ts +++ b/src/api/types/BookingCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface BookingCreatedEventData { /** The type of the event data object. The value is `"booking"`. */ diff --git a/src/api/types/BookingCreatedEventObject.ts b/src/api/types/BookingCreatedEventObject.ts index c75f0f2ab..1d59263ab 100644 --- a/src/api/types/BookingCreatedEventObject.ts +++ b/src/api/types/BookingCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface BookingCreatedEventObject { /** The created booking. */ diff --git a/src/api/types/BookingCreatorDetails.ts b/src/api/types/BookingCreatorDetails.ts index f7347d0f0..95337d4ca 100644 --- a/src/api/types/BookingCreatorDetails.ts +++ b/src/api/types/BookingCreatorDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Information about a booking creator. diff --git a/src/api/types/BookingCreatorDetailsCreatorType.ts b/src/api/types/BookingCreatorDetailsCreatorType.ts index 27b982ced..75b0061c9 100644 --- a/src/api/types/BookingCreatorDetailsCreatorType.ts +++ b/src/api/types/BookingCreatorDetailsCreatorType.ts @@ -1,9 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Supported types of a booking creator. */ +/** + * Supported types of a booking creator. + */ +export type BookingCreatorDetailsCreatorType = "TEAM_MEMBER" | "CUSTOMER"; export const BookingCreatorDetailsCreatorType = { TeamMember: "TEAM_MEMBER", Customer: "CUSTOMER", } as const; -export type BookingCreatorDetailsCreatorType = - (typeof BookingCreatorDetailsCreatorType)[keyof typeof BookingCreatorDetailsCreatorType]; diff --git a/src/api/types/BookingCustomAttributeDefinitionOwnedCreatedEvent.ts b/src/api/types/BookingCustomAttributeDefinitionOwnedCreatedEvent.ts index a817b5bc4..d0fa96275 100644 --- a/src/api/types/BookingCustomAttributeDefinitionOwnedCreatedEvent.ts +++ b/src/api/types/BookingCustomAttributeDefinitionOwnedCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/BookingCustomAttributeDefinitionOwnedDeletedEvent.ts b/src/api/types/BookingCustomAttributeDefinitionOwnedDeletedEvent.ts index 0424c8365..6088ec85c 100644 --- a/src/api/types/BookingCustomAttributeDefinitionOwnedDeletedEvent.ts +++ b/src/api/types/BookingCustomAttributeDefinitionOwnedDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/BookingCustomAttributeDefinitionOwnedUpdatedEvent.ts b/src/api/types/BookingCustomAttributeDefinitionOwnedUpdatedEvent.ts index 9d94afd43..426ba305f 100644 --- a/src/api/types/BookingCustomAttributeDefinitionOwnedUpdatedEvent.ts +++ b/src/api/types/BookingCustomAttributeDefinitionOwnedUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/BookingCustomAttributeDefinitionVisibleCreatedEvent.ts b/src/api/types/BookingCustomAttributeDefinitionVisibleCreatedEvent.ts index 5d365ef61..42a436488 100644 --- a/src/api/types/BookingCustomAttributeDefinitionVisibleCreatedEvent.ts +++ b/src/api/types/BookingCustomAttributeDefinitionVisibleCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/BookingCustomAttributeDefinitionVisibleDeletedEvent.ts b/src/api/types/BookingCustomAttributeDefinitionVisibleDeletedEvent.ts index 547073da7..9f4cb79d4 100644 --- a/src/api/types/BookingCustomAttributeDefinitionVisibleDeletedEvent.ts +++ b/src/api/types/BookingCustomAttributeDefinitionVisibleDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/BookingCustomAttributeDefinitionVisibleUpdatedEvent.ts b/src/api/types/BookingCustomAttributeDefinitionVisibleUpdatedEvent.ts index 77d89ea52..01afeca30 100644 --- a/src/api/types/BookingCustomAttributeDefinitionVisibleUpdatedEvent.ts +++ b/src/api/types/BookingCustomAttributeDefinitionVisibleUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a booking [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/BookingCustomAttributeDeleteRequest.ts b/src/api/types/BookingCustomAttributeDeleteRequest.ts index 75854ca9d..216588d1b 100644 --- a/src/api/types/BookingCustomAttributeDeleteRequest.ts +++ b/src/api/types/BookingCustomAttributeDeleteRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents an individual delete request in a [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) diff --git a/src/api/types/BookingCustomAttributeDeleteResponse.ts b/src/api/types/BookingCustomAttributeDeleteResponse.ts index 07b83ea6a..fd2712f24 100644 --- a/src/api/types/BookingCustomAttributeDeleteResponse.ts +++ b/src/api/types/BookingCustomAttributeDeleteResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response for an individual upsert request in a [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) operation. diff --git a/src/api/types/BookingCustomAttributeOwnedDeletedEvent.ts b/src/api/types/BookingCustomAttributeOwnedDeletedEvent.ts index 2d9272336..00ea41bcb 100644 --- a/src/api/types/BookingCustomAttributeOwnedDeletedEvent.ts +++ b/src/api/types/BookingCustomAttributeOwnedDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a booking [custom attribute](entity:CustomAttribute) diff --git a/src/api/types/BookingCustomAttributeOwnedUpdatedEvent.ts b/src/api/types/BookingCustomAttributeOwnedUpdatedEvent.ts index fa6fa63cd..60c9a8944 100644 --- a/src/api/types/BookingCustomAttributeOwnedUpdatedEvent.ts +++ b/src/api/types/BookingCustomAttributeOwnedUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a booking [custom attribute](entity:CustomAttribute) diff --git a/src/api/types/BookingCustomAttributeUpsertRequest.ts b/src/api/types/BookingCustomAttributeUpsertRequest.ts index b9cd7c7a2..1635a8103 100644 --- a/src/api/types/BookingCustomAttributeUpsertRequest.ts +++ b/src/api/types/BookingCustomAttributeUpsertRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an individual upsert request in a [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) diff --git a/src/api/types/BookingCustomAttributeUpsertResponse.ts b/src/api/types/BookingCustomAttributeUpsertResponse.ts index af513649d..bcd008f99 100644 --- a/src/api/types/BookingCustomAttributeUpsertResponse.ts +++ b/src/api/types/BookingCustomAttributeUpsertResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response for an individual upsert request in a [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) operation. diff --git a/src/api/types/BookingCustomAttributeVisibleDeletedEvent.ts b/src/api/types/BookingCustomAttributeVisibleDeletedEvent.ts index 80c5bf99c..b3c26f81a 100644 --- a/src/api/types/BookingCustomAttributeVisibleDeletedEvent.ts +++ b/src/api/types/BookingCustomAttributeVisibleDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a booking [custom attribute](entity:CustomAttribute) with diff --git a/src/api/types/BookingCustomAttributeVisibleUpdatedEvent.ts b/src/api/types/BookingCustomAttributeVisibleUpdatedEvent.ts index dc7f35e9a..8451ca112 100644 --- a/src/api/types/BookingCustomAttributeVisibleUpdatedEvent.ts +++ b/src/api/types/BookingCustomAttributeVisibleUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a booking [custom attribute](entity:CustomAttribute) diff --git a/src/api/types/BookingStatus.ts b/src/api/types/BookingStatus.ts index f22649f0b..fd41bf0d3 100644 --- a/src/api/types/BookingStatus.ts +++ b/src/api/types/BookingStatus.ts @@ -1,6 +1,17 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Supported booking statuses. */ +/** + * Supported booking statuses. + */ +export type BookingStatus = + | "PENDING" + | "CANCELLED_BY_CUSTOMER" + | "CANCELLED_BY_SELLER" + | "DECLINED" + | "ACCEPTED" + | "NO_SHOW"; export const BookingStatus = { Pending: "PENDING", CancelledByCustomer: "CANCELLED_BY_CUSTOMER", @@ -9,4 +20,3 @@ export const BookingStatus = { Accepted: "ACCEPTED", NoShow: "NO_SHOW", } as const; -export type BookingStatus = (typeof BookingStatus)[keyof typeof BookingStatus]; diff --git a/src/api/types/BookingUpdatedEvent.ts b/src/api/types/BookingUpdatedEvent.ts index a6ec35237..5304a624b 100644 --- a/src/api/types/BookingUpdatedEvent.ts +++ b/src/api/types/BookingUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a booking is updated or cancelled. diff --git a/src/api/types/BookingUpdatedEventData.ts b/src/api/types/BookingUpdatedEventData.ts index aa6784e42..9bf4fd8f5 100644 --- a/src/api/types/BookingUpdatedEventData.ts +++ b/src/api/types/BookingUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface BookingUpdatedEventData { /** The type of the event data object. The value is `"booking"`. */ diff --git a/src/api/types/BookingUpdatedEventObject.ts b/src/api/types/BookingUpdatedEventObject.ts index f16d768f3..98f157bb1 100644 --- a/src/api/types/BookingUpdatedEventObject.ts +++ b/src/api/types/BookingUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface BookingUpdatedEventObject { /** The updated booking. */ diff --git a/src/api/types/Break.ts b/src/api/types/Break.ts index 49936bd7b..431faeb27 100644 --- a/src/api/types/Break.ts +++ b/src/api/types/Break.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * A record of a team member's break on a [timecard](entity:Timecard). diff --git a/src/api/types/BreakType.ts b/src/api/types/BreakType.ts index 182f0fb00..d27453549 100644 --- a/src/api/types/BreakType.ts +++ b/src/api/types/BreakType.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * A template for a type of [break](entity:Break) that can be added to a diff --git a/src/api/types/BulkCreateCustomerData.ts b/src/api/types/BulkCreateCustomerData.ts index 22d6cb4af..855023880 100644 --- a/src/api/types/BulkCreateCustomerData.ts +++ b/src/api/types/BulkCreateCustomerData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the customer data provided in individual create requests for a diff --git a/src/api/types/BulkCreateCustomersResponse.ts b/src/api/types/BulkCreateCustomersResponse.ts index ff2e028b1..e9c805cb1 100644 --- a/src/api/types/BulkCreateCustomersResponse.ts +++ b/src/api/types/BulkCreateCustomersResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields included in the response body from the diff --git a/src/api/types/BulkDeleteBookingCustomAttributesResponse.ts b/src/api/types/BulkDeleteBookingCustomAttributesResponse.ts index e88909ec4..74b016507 100644 --- a/src/api/types/BulkDeleteBookingCustomAttributesResponse.ts +++ b/src/api/types/BulkDeleteBookingCustomAttributesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [BulkDeleteBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkDeleteBookingCustomAttributes) response, diff --git a/src/api/types/BulkDeleteCustomersResponse.ts b/src/api/types/BulkDeleteCustomersResponse.ts index 22623e8f6..85c1433f0 100644 --- a/src/api/types/BulkDeleteCustomersResponse.ts +++ b/src/api/types/BulkDeleteCustomersResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields included in the response body from the diff --git a/src/api/types/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.ts b/src/api/types/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.ts index ac28fae05..371975d53 100644 --- a/src/api/types/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.ts +++ b/src/api/types/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents an individual delete request in a [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes) diff --git a/src/api/types/BulkDeleteLocationCustomAttributesResponse.ts b/src/api/types/BulkDeleteLocationCustomAttributesResponse.ts index c4812dfb1..468fdcc14 100644 --- a/src/api/types/BulkDeleteLocationCustomAttributesResponse.ts +++ b/src/api/types/BulkDeleteLocationCustomAttributesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes) response, diff --git a/src/api/types/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse.ts b/src/api/types/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse.ts index 46ef4b221..66e4519b1 100644 --- a/src/api/types/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse.ts +++ b/src/api/types/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an individual delete response in a [BulkDeleteLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkDeleteLocationCustomAttributes) diff --git a/src/api/types/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.ts b/src/api/types/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.ts index 9ae182ecc..1a31ee29f 100644 --- a/src/api/types/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.ts +++ b/src/api/types/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents an individual delete request in a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) diff --git a/src/api/types/BulkDeleteMerchantCustomAttributesResponse.ts b/src/api/types/BulkDeleteMerchantCustomAttributesResponse.ts index 36bf98fc8..226851e80 100644 --- a/src/api/types/BulkDeleteMerchantCustomAttributesResponse.ts +++ b/src/api/types/BulkDeleteMerchantCustomAttributesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) response, diff --git a/src/api/types/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse.ts b/src/api/types/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse.ts index fa0085f4a..e2d3355fe 100644 --- a/src/api/types/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse.ts +++ b/src/api/types/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an individual delete response in a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) diff --git a/src/api/types/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.ts b/src/api/types/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.ts index 389f9baeb..ac779af87 100644 --- a/src/api/types/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.ts +++ b/src/api/types/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents one delete within the bulk operation. diff --git a/src/api/types/BulkDeleteOrderCustomAttributesResponse.ts b/src/api/types/BulkDeleteOrderCustomAttributesResponse.ts index bb3d0d82c..c163ac122 100644 --- a/src/api/types/BulkDeleteOrderCustomAttributesResponse.ts +++ b/src/api/types/BulkDeleteOrderCustomAttributesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response from deleting one or more order custom attributes. diff --git a/src/api/types/BulkPublishScheduledShiftsData.ts b/src/api/types/BulkPublishScheduledShiftsData.ts index 7a7f934a6..8c69e366f 100644 --- a/src/api/types/BulkPublishScheduledShiftsData.ts +++ b/src/api/types/BulkPublishScheduledShiftsData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents options for an individual publish request in a diff --git a/src/api/types/BulkPublishScheduledShiftsResponse.ts b/src/api/types/BulkPublishScheduledShiftsResponse.ts index 6dc99cb3b..9bd347fb8 100644 --- a/src/api/types/BulkPublishScheduledShiftsResponse.ts +++ b/src/api/types/BulkPublishScheduledShiftsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [BulkPublishScheduledShifts](api-endpoint:Labor-BulkPublishScheduledShifts) response. diff --git a/src/api/types/BulkRetrieveBookingsResponse.ts b/src/api/types/BulkRetrieveBookingsResponse.ts index c26f7ce78..5f852656a 100644 --- a/src/api/types/BulkRetrieveBookingsResponse.ts +++ b/src/api/types/BulkRetrieveBookingsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Response payload for bulk retrieval of bookings. diff --git a/src/api/types/BulkRetrieveChannelsRequestConstants.ts b/src/api/types/BulkRetrieveChannelsRequestConstants.ts deleted file mode 100644 index 283f45d04..000000000 --- a/src/api/types/BulkRetrieveChannelsRequestConstants.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export type BulkRetrieveChannelsRequestConstants = "MAX_BATCH_SIZE"; diff --git a/src/api/types/BulkRetrieveChannelsResponse.ts b/src/api/types/BulkRetrieveChannelsResponse.ts deleted file mode 100644 index 23b53292e..000000000 --- a/src/api/types/BulkRetrieveChannelsResponse.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -/** - * Defines the fields that are included in the request body for the - * [BulkRetrieveChannels](api-endpoint:Channels-BulkRetrieveChannels) endpoint. - */ -export interface BulkRetrieveChannelsResponse { - /** Information about errors encountered during the request. */ - errors?: Square.Error_[]; - /** - * A map of channel IDs to channel responses which tell whether - * retrieval for a specific channel is success or not. - * Channel response of a success retrieval would contain channel info - * whereas channel response of a failed retrieval would have error info. - */ - responses?: Record; -} diff --git a/src/api/types/BulkRetrieveCustomersResponse.ts b/src/api/types/BulkRetrieveCustomersResponse.ts index e280f8240..3fb4abeca 100644 --- a/src/api/types/BulkRetrieveCustomersResponse.ts +++ b/src/api/types/BulkRetrieveCustomersResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields included in the response body from the diff --git a/src/api/types/BulkRetrieveTeamMemberBookingProfilesResponse.ts b/src/api/types/BulkRetrieveTeamMemberBookingProfilesResponse.ts index 9618591fe..0b7f776e2 100644 --- a/src/api/types/BulkRetrieveTeamMemberBookingProfilesResponse.ts +++ b/src/api/types/BulkRetrieveTeamMemberBookingProfilesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Response payload for the [BulkRetrieveTeamMemberBookingProfiles](api-endpoint:Bookings-BulkRetrieveTeamMemberBookingProfiles) endpoint. diff --git a/src/api/types/BulkSwapPlanResponse.ts b/src/api/types/BulkSwapPlanResponse.ts index d3c9b8077..6dcd1f10c 100644 --- a/src/api/types/BulkSwapPlanResponse.ts +++ b/src/api/types/BulkSwapPlanResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines output parameters in a response of the diff --git a/src/api/types/BulkUpdateCustomerData.ts b/src/api/types/BulkUpdateCustomerData.ts index c2ef2bde7..64c458abb 100644 --- a/src/api/types/BulkUpdateCustomerData.ts +++ b/src/api/types/BulkUpdateCustomerData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the customer data provided in individual update requests for a diff --git a/src/api/types/BulkUpdateCustomersResponse.ts b/src/api/types/BulkUpdateCustomersResponse.ts index 7f4f9f8ec..484c88cd0 100644 --- a/src/api/types/BulkUpdateCustomersResponse.ts +++ b/src/api/types/BulkUpdateCustomersResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields included in the response body from the diff --git a/src/api/types/BulkUpsertBookingCustomAttributesResponse.ts b/src/api/types/BulkUpsertBookingCustomAttributesResponse.ts index d956047bb..9a7bd6c32 100644 --- a/src/api/types/BulkUpsertBookingCustomAttributesResponse.ts +++ b/src/api/types/BulkUpsertBookingCustomAttributesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [BulkUpsertBookingCustomAttributes](api-endpoint:BookingCustomAttributes-BulkUpsertBookingCustomAttributes) response, diff --git a/src/api/types/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.ts b/src/api/types/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.ts index 0fd16f129..a41ba1c28 100644 --- a/src/api/types/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.ts +++ b/src/api/types/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an individual upsert request in a [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) diff --git a/src/api/types/BulkUpsertLocationCustomAttributesResponse.ts b/src/api/types/BulkUpsertLocationCustomAttributesResponse.ts index cc83c28a6..f32c5792c 100644 --- a/src/api/types/BulkUpsertLocationCustomAttributesResponse.ts +++ b/src/api/types/BulkUpsertLocationCustomAttributesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) response, diff --git a/src/api/types/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse.ts b/src/api/types/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse.ts index 79f6af543..29be7dcb1 100644 --- a/src/api/types/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse.ts +++ b/src/api/types/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response for an individual upsert request in a [BulkUpsertLocationCustomAttributes](api-endpoint:LocationCustomAttributes-BulkUpsertLocationCustomAttributes) operation. diff --git a/src/api/types/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.ts b/src/api/types/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.ts index a95835c72..83382ffe7 100644 --- a/src/api/types/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.ts +++ b/src/api/types/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an individual upsert request in a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) diff --git a/src/api/types/BulkUpsertMerchantCustomAttributesResponse.ts b/src/api/types/BulkUpsertMerchantCustomAttributesResponse.ts index 29ce9697e..6e6845881 100644 --- a/src/api/types/BulkUpsertMerchantCustomAttributesResponse.ts +++ b/src/api/types/BulkUpsertMerchantCustomAttributesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) response, diff --git a/src/api/types/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse.ts b/src/api/types/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse.ts index 9aaa58f1c..50e9680b5 100644 --- a/src/api/types/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse.ts +++ b/src/api/types/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response for an individual upsert request in a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) operation. diff --git a/src/api/types/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.ts b/src/api/types/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.ts index 3344cac38..acf829020 100644 --- a/src/api/types/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.ts +++ b/src/api/types/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents one upsert within the bulk operation. diff --git a/src/api/types/BulkUpsertOrderCustomAttributesResponse.ts b/src/api/types/BulkUpsertOrderCustomAttributesResponse.ts index 103f57d38..2cccbde11 100644 --- a/src/api/types/BulkUpsertOrderCustomAttributesResponse.ts +++ b/src/api/types/BulkUpsertOrderCustomAttributesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response from a bulk upsert of order custom attributes. diff --git a/src/api/types/BusinessAppointmentSettings.ts b/src/api/types/BusinessAppointmentSettings.ts index 3dc33fcb6..f95139f7a 100644 --- a/src/api/types/BusinessAppointmentSettings.ts +++ b/src/api/types/BusinessAppointmentSettings.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The service appointment settings, including where and how the service is provided. diff --git a/src/api/types/BusinessAppointmentSettingsAlignmentTime.ts b/src/api/types/BusinessAppointmentSettingsAlignmentTime.ts index 5f9530346..9d9e410be 100644 --- a/src/api/types/BusinessAppointmentSettingsAlignmentTime.ts +++ b/src/api/types/BusinessAppointmentSettingsAlignmentTime.ts @@ -1,11 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Time units of a service duration for bookings. */ +/** + * Time units of a service duration for bookings. + */ +export type BusinessAppointmentSettingsAlignmentTime = "SERVICE_DURATION" | "QUARTER_HOURLY" | "HALF_HOURLY" | "HOURLY"; export const BusinessAppointmentSettingsAlignmentTime = { ServiceDuration: "SERVICE_DURATION", QuarterHourly: "QUARTER_HOURLY", HalfHourly: "HALF_HOURLY", Hourly: "HOURLY", } as const; -export type BusinessAppointmentSettingsAlignmentTime = - (typeof BusinessAppointmentSettingsAlignmentTime)[keyof typeof BusinessAppointmentSettingsAlignmentTime]; diff --git a/src/api/types/BusinessAppointmentSettingsBookingLocationType.ts b/src/api/types/BusinessAppointmentSettingsBookingLocationType.ts index 13750b8f1..101e1b5d7 100644 --- a/src/api/types/BusinessAppointmentSettingsBookingLocationType.ts +++ b/src/api/types/BusinessAppointmentSettingsBookingLocationType.ts @@ -1,10 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Supported types of location where service is provided. */ +/** + * Supported types of location where service is provided. + */ +export type BusinessAppointmentSettingsBookingLocationType = "BUSINESS_LOCATION" | "CUSTOMER_LOCATION" | "PHONE"; export const BusinessAppointmentSettingsBookingLocationType = { BusinessLocation: "BUSINESS_LOCATION", CustomerLocation: "CUSTOMER_LOCATION", Phone: "PHONE", } as const; -export type BusinessAppointmentSettingsBookingLocationType = - (typeof BusinessAppointmentSettingsBookingLocationType)[keyof typeof BusinessAppointmentSettingsBookingLocationType]; diff --git a/src/api/types/BusinessAppointmentSettingsCancellationPolicy.ts b/src/api/types/BusinessAppointmentSettingsCancellationPolicy.ts index ab73f33a8..d72b69834 100644 --- a/src/api/types/BusinessAppointmentSettingsCancellationPolicy.ts +++ b/src/api/types/BusinessAppointmentSettingsCancellationPolicy.ts @@ -1,9 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The category of the seller’s cancellation policy. */ +/** + * The category of the seller’s cancellation policy. + */ +export type BusinessAppointmentSettingsCancellationPolicy = "CANCELLATION_TREATED_AS_NO_SHOW" | "CUSTOM_POLICY"; export const BusinessAppointmentSettingsCancellationPolicy = { CancellationTreatedAsNoShow: "CANCELLATION_TREATED_AS_NO_SHOW", CustomPolicy: "CUSTOM_POLICY", } as const; -export type BusinessAppointmentSettingsCancellationPolicy = - (typeof BusinessAppointmentSettingsCancellationPolicy)[keyof typeof BusinessAppointmentSettingsCancellationPolicy]; diff --git a/src/api/types/BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType.ts b/src/api/types/BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType.ts index 1dae0c040..2a915990d 100644 --- a/src/api/types/BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType.ts +++ b/src/api/types/BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType.ts @@ -1,9 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Types of daily appointment limits. */ +/** + * Types of daily appointment limits. + */ +export type BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType = "PER_TEAM_MEMBER" | "PER_LOCATION"; export const BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType = { PerTeamMember: "PER_TEAM_MEMBER", PerLocation: "PER_LOCATION", } as const; -export type BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType = - (typeof BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType)[keyof typeof BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType]; diff --git a/src/api/types/BusinessBookingProfile.ts b/src/api/types/BusinessBookingProfile.ts index 72142c452..f3ab7bd24 100644 --- a/src/api/types/BusinessBookingProfile.ts +++ b/src/api/types/BusinessBookingProfile.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A seller's business booking profile, including booking policy, appointment settings, etc. diff --git a/src/api/types/BusinessBookingProfileBookingPolicy.ts b/src/api/types/BusinessBookingProfileBookingPolicy.ts index f94b98492..7159dc46e 100644 --- a/src/api/types/BusinessBookingProfileBookingPolicy.ts +++ b/src/api/types/BusinessBookingProfileBookingPolicy.ts @@ -1,9 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Policies for accepting bookings. */ +/** + * Policies for accepting bookings. + */ +export type BusinessBookingProfileBookingPolicy = "ACCEPT_ALL" | "REQUIRES_ACCEPTANCE"; export const BusinessBookingProfileBookingPolicy = { AcceptAll: "ACCEPT_ALL", RequiresAcceptance: "REQUIRES_ACCEPTANCE", } as const; -export type BusinessBookingProfileBookingPolicy = - (typeof BusinessBookingProfileBookingPolicy)[keyof typeof BusinessBookingProfileBookingPolicy]; diff --git a/src/api/types/BusinessBookingProfileCustomerTimezoneChoice.ts b/src/api/types/BusinessBookingProfileCustomerTimezoneChoice.ts index 97e7f11bd..15500acd4 100644 --- a/src/api/types/BusinessBookingProfileCustomerTimezoneChoice.ts +++ b/src/api/types/BusinessBookingProfileCustomerTimezoneChoice.ts @@ -1,9 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Choices of customer-facing time zone used for bookings. */ +/** + * Choices of customer-facing time zone used for bookings. + */ +export type BusinessBookingProfileCustomerTimezoneChoice = "BUSINESS_LOCATION_TIMEZONE" | "CUSTOMER_CHOICE"; export const BusinessBookingProfileCustomerTimezoneChoice = { BusinessLocationTimezone: "BUSINESS_LOCATION_TIMEZONE", CustomerChoice: "CUSTOMER_CHOICE", } as const; -export type BusinessBookingProfileCustomerTimezoneChoice = - (typeof BusinessBookingProfileCustomerTimezoneChoice)[keyof typeof BusinessBookingProfileCustomerTimezoneChoice]; diff --git a/src/api/types/BusinessHours.ts b/src/api/types/BusinessHours.ts index c6543f8cf..5f2d1a5a5 100644 --- a/src/api/types/BusinessHours.ts +++ b/src/api/types/BusinessHours.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The hours of operation for a location. diff --git a/src/api/types/BusinessHoursPeriod.ts b/src/api/types/BusinessHoursPeriod.ts index 85bc83a5e..3391a95d4 100644 --- a/src/api/types/BusinessHoursPeriod.ts +++ b/src/api/types/BusinessHoursPeriod.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a period of time during which a business location is open. diff --git a/src/api/types/BuyNowPayLaterDetails.ts b/src/api/types/BuyNowPayLaterDetails.ts index 3784c04e1..74b151f09 100644 --- a/src/api/types/BuyNowPayLaterDetails.ts +++ b/src/api/types/BuyNowPayLaterDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Additional details about a Buy Now Pay Later payment type. diff --git a/src/api/types/CalculateLoyaltyPointsResponse.ts b/src/api/types/CalculateLoyaltyPointsResponse.ts index dd869a7fd..e970b5d91 100644 --- a/src/api/types/CalculateLoyaltyPointsResponse.ts +++ b/src/api/types/CalculateLoyaltyPointsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [CalculateLoyaltyPoints](api-endpoint:Loyalty-CalculateLoyaltyPoints) response. diff --git a/src/api/types/CalculateOrderResponse.ts b/src/api/types/CalculateOrderResponse.ts index 3013d7440..055766021 100644 --- a/src/api/types/CalculateOrderResponse.ts +++ b/src/api/types/CalculateOrderResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CalculateOrderResponse { /** The calculated version of the order provided in the request. */ diff --git a/src/api/types/CancelBookingResponse.ts b/src/api/types/CancelBookingResponse.ts index 6d40a236d..ccfb89b2c 100644 --- a/src/api/types/CancelBookingResponse.ts +++ b/src/api/types/CancelBookingResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CancelBookingResponse { /** The booking that was cancelled. */ diff --git a/src/api/types/CancelInvoiceResponse.ts b/src/api/types/CancelInvoiceResponse.ts index 69037df20..47bc03cca 100644 --- a/src/api/types/CancelInvoiceResponse.ts +++ b/src/api/types/CancelInvoiceResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response returned by the `CancelInvoice` request. diff --git a/src/api/types/CancelLoyaltyPromotionResponse.ts b/src/api/types/CancelLoyaltyPromotionResponse.ts index 40d03a58e..720b5817c 100644 --- a/src/api/types/CancelLoyaltyPromotionResponse.ts +++ b/src/api/types/CancelLoyaltyPromotionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [CancelLoyaltyPromotion](api-endpoint:Loyalty-CancelLoyaltyPromotion) response. diff --git a/src/api/types/CancelPaymentByIdempotencyKeyResponse.ts b/src/api/types/CancelPaymentByIdempotencyKeyResponse.ts index 746f03334..8df4ee330 100644 --- a/src/api/types/CancelPaymentByIdempotencyKeyResponse.ts +++ b/src/api/types/CancelPaymentByIdempotencyKeyResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the response returned by diff --git a/src/api/types/CancelPaymentResponse.ts b/src/api/types/CancelPaymentResponse.ts index 5164f1cd6..de09f1426 100644 --- a/src/api/types/CancelPaymentResponse.ts +++ b/src/api/types/CancelPaymentResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the response returned by [CancelPayment](api-endpoint:Payments-CancelPayment). diff --git a/src/api/types/CancelSubscriptionResponse.ts b/src/api/types/CancelSubscriptionResponse.ts index a90b84ff4..96950aacf 100644 --- a/src/api/types/CancelSubscriptionResponse.ts +++ b/src/api/types/CancelSubscriptionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines output parameters in a response from the diff --git a/src/api/types/CancelTerminalActionResponse.ts b/src/api/types/CancelTerminalActionResponse.ts index 864a599dd..1bae43a82 100644 --- a/src/api/types/CancelTerminalActionResponse.ts +++ b/src/api/types/CancelTerminalActionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CancelTerminalActionResponse { /** Information on errors encountered during the request. */ diff --git a/src/api/types/CancelTerminalCheckoutResponse.ts b/src/api/types/CancelTerminalCheckoutResponse.ts index 23c018788..280f22b90 100644 --- a/src/api/types/CancelTerminalCheckoutResponse.ts +++ b/src/api/types/CancelTerminalCheckoutResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CancelTerminalCheckoutResponse { /** Information about errors encountered during the request. */ diff --git a/src/api/types/CancelTerminalRefundResponse.ts b/src/api/types/CancelTerminalRefundResponse.ts index 2ef135538..5929fc431 100644 --- a/src/api/types/CancelTerminalRefundResponse.ts +++ b/src/api/types/CancelTerminalRefundResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CancelTerminalRefundResponse { /** Information about errors encountered during the request. */ diff --git a/src/api/types/CancelTransferOrderResponse.ts b/src/api/types/CancelTransferOrderResponse.ts deleted file mode 100644 index 8fd20936d..000000000 --- a/src/api/types/CancelTransferOrderResponse.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -/** - * Response for canceling a transfer order - */ -export interface CancelTransferOrderResponse { - /** The updated transfer order with status changed to CANCELED */ - transferOrder?: Square.TransferOrder; - /** Any errors that occurred during the request */ - errors?: Square.Error_[]; -} diff --git a/src/api/types/CaptureTransactionResponse.ts b/src/api/types/CaptureTransactionResponse.ts index 77b44f500..32224c29a 100644 --- a/src/api/types/CaptureTransactionResponse.ts +++ b/src/api/types/CaptureTransactionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/Card.ts b/src/api/types/Card.ts index e4f40600a..4be90d322 100644 --- a/src/api/types/Card.ts +++ b/src/api/types/Card.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents the payment details of a card to be used for payments. These diff --git a/src/api/types/CardAutomaticallyUpdatedEvent.ts b/src/api/types/CardAutomaticallyUpdatedEvent.ts index f5f90ef84..552768192 100644 --- a/src/api/types/CardAutomaticallyUpdatedEvent.ts +++ b/src/api/types/CardAutomaticallyUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when Square automatically updates the expiration date or diff --git a/src/api/types/CardAutomaticallyUpdatedEventData.ts b/src/api/types/CardAutomaticallyUpdatedEventData.ts index 3352089cb..73ff03d7a 100644 --- a/src/api/types/CardAutomaticallyUpdatedEventData.ts +++ b/src/api/types/CardAutomaticallyUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CardAutomaticallyUpdatedEventData { /** The type of the event data object. The value is `"card"`. */ diff --git a/src/api/types/CardAutomaticallyUpdatedEventObject.ts b/src/api/types/CardAutomaticallyUpdatedEventObject.ts index d7f76277a..7c5569acd 100644 --- a/src/api/types/CardAutomaticallyUpdatedEventObject.ts +++ b/src/api/types/CardAutomaticallyUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CardAutomaticallyUpdatedEventObject { /** The automatically updated card. */ diff --git a/src/api/types/CardBrand.ts b/src/api/types/CardBrand.ts index fd646bcf6..b30410ad7 100644 --- a/src/api/types/CardBrand.ts +++ b/src/api/types/CardBrand.ts @@ -1,6 +1,25 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates a card's brand, such as `VISA` or `MASTERCARD`. */ +/** + * Indicates a card's brand, such as `VISA` or `MASTERCARD`. + */ +export type CardBrand = + | "OTHER_BRAND" + | "VISA" + | "MASTERCARD" + | "AMERICAN_EXPRESS" + | "DISCOVER" + | "DISCOVER_DINERS" + | "JCB" + | "CHINA_UNIONPAY" + | "SQUARE_GIFT_CARD" + | "SQUARE_CAPITAL_CARD" + | "INTERAC" + | "EFTPOS" + | "FELICA" + | "EBT"; export const CardBrand = { OtherBrand: "OTHER_BRAND", Visa: "VISA", @@ -17,4 +36,3 @@ export const CardBrand = { Felica: "FELICA", Ebt: "EBT", } as const; -export type CardBrand = (typeof CardBrand)[keyof typeof CardBrand]; diff --git a/src/api/types/CardCoBrand.ts b/src/api/types/CardCoBrand.ts index 381a6f6cf..4a196be9a 100644 --- a/src/api/types/CardCoBrand.ts +++ b/src/api/types/CardCoBrand.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates the brand for a co-branded card. */ +/** + * Indicates the brand for a co-branded card. + */ +export type CardCoBrand = "UNKNOWN" | "AFTERPAY" | "CLEARPAY"; export const CardCoBrand = { Unknown: "UNKNOWN", Afterpay: "AFTERPAY", Clearpay: "CLEARPAY", } as const; -export type CardCoBrand = (typeof CardCoBrand)[keyof typeof CardCoBrand]; diff --git a/src/api/types/CardCreatedEvent.ts b/src/api/types/CardCreatedEvent.ts index b0fbf30a3..810bc27f7 100644 --- a/src/api/types/CardCreatedEvent.ts +++ b/src/api/types/CardCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [card](entity:Card) is created or imported. diff --git a/src/api/types/CardCreatedEventData.ts b/src/api/types/CardCreatedEventData.ts index 4b71f9227..054e9e4bb 100644 --- a/src/api/types/CardCreatedEventData.ts +++ b/src/api/types/CardCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CardCreatedEventData { /** The type of the event data object. The value is `"card"`. */ diff --git a/src/api/types/CardCreatedEventObject.ts b/src/api/types/CardCreatedEventObject.ts index d84090958..2dafa7445 100644 --- a/src/api/types/CardCreatedEventObject.ts +++ b/src/api/types/CardCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CardCreatedEventObject { /** The created card. */ diff --git a/src/api/types/CardDisabledEvent.ts b/src/api/types/CardDisabledEvent.ts index 7a86e3918..2ecede520 100644 --- a/src/api/types/CardDisabledEvent.ts +++ b/src/api/types/CardDisabledEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [card](entity:Card) is disabled. diff --git a/src/api/types/CardDisabledEventData.ts b/src/api/types/CardDisabledEventData.ts index 50451f256..24cbc2d0b 100644 --- a/src/api/types/CardDisabledEventData.ts +++ b/src/api/types/CardDisabledEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CardDisabledEventData { /** The type of the event data object. The value is `"card"`. */ diff --git a/src/api/types/CardDisabledEventObject.ts b/src/api/types/CardDisabledEventObject.ts index 353e1ca2d..f5f765ed1 100644 --- a/src/api/types/CardDisabledEventObject.ts +++ b/src/api/types/CardDisabledEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CardDisabledEventObject { /** The disabled card. */ diff --git a/src/api/types/CardForgottenEvent.ts b/src/api/types/CardForgottenEvent.ts index e31e3ea5b..fff5cdcc0 100644 --- a/src/api/types/CardForgottenEvent.ts +++ b/src/api/types/CardForgottenEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [card](entity:Card) is GDPR forgotten or vaulted. diff --git a/src/api/types/CardForgottenEventCard.ts b/src/api/types/CardForgottenEventCard.ts index 19b1cc4f2..af07de106 100644 --- a/src/api/types/CardForgottenEventCard.ts +++ b/src/api/types/CardForgottenEventCard.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CardForgottenEventCard { /** Unique ID for this card. Generated by Square. */ diff --git a/src/api/types/CardForgottenEventData.ts b/src/api/types/CardForgottenEventData.ts index 5e286606e..b6dcb0633 100644 --- a/src/api/types/CardForgottenEventData.ts +++ b/src/api/types/CardForgottenEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CardForgottenEventData { /** The type of the event data object. The value is `"card"`. */ diff --git a/src/api/types/CardForgottenEventObject.ts b/src/api/types/CardForgottenEventObject.ts index f9833c652..0c49c64d6 100644 --- a/src/api/types/CardForgottenEventObject.ts +++ b/src/api/types/CardForgottenEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CardForgottenEventObject { /** The forgotten card. */ diff --git a/src/api/types/CardIssuerAlert.ts b/src/api/types/CardIssuerAlert.ts index ec1af6fe4..44ce7004e 100644 --- a/src/api/types/CardIssuerAlert.ts +++ b/src/api/types/CardIssuerAlert.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Indicates the type of issuer alert for a [card on file](entity:Card). diff --git a/src/api/types/CardPaymentDetails.ts b/src/api/types/CardPaymentDetails.ts index 8e3fe5843..f0bdb9504 100644 --- a/src/api/types/CardPaymentDetails.ts +++ b/src/api/types/CardPaymentDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Reflects the current status of a card payment. Contains only non-confidential information. @@ -10,52 +12,52 @@ export interface CardPaymentDetails { * The card payment's current state. The state can be AUTHORIZED, CAPTURED, VOIDED, or * FAILED. */ - status?: string; + status?: string | null; /** The credit card's non-confidential details. */ card?: Square.Card; /** * The method used to enter the card's details for the payment. The method can be * `KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`. */ - entryMethod?: string; + entryMethod?: string | null; /** * The status code returned from the Card Verification Value (CVV) check. The code can be * `CVV_ACCEPTED`, `CVV_REJECTED`, or `CVV_NOT_CHECKED`. */ - cvvStatus?: string; + cvvStatus?: string | null; /** * The status code returned from the Address Verification System (AVS) check. The code can be * `AVS_ACCEPTED`, `AVS_REJECTED`, or `AVS_NOT_CHECKED`. */ - avsStatus?: string; + avsStatus?: string | null; /** * The status code returned by the card issuer that describes the payment's * authorization status. */ - authResultCode?: string; + authResultCode?: string | null; /** For EMV payments, the application ID identifies the EMV application used for the payment. */ - applicationIdentifier?: string; + applicationIdentifier?: string | null; /** For EMV payments, the human-readable name of the EMV application used for the payment. */ - applicationName?: string; + applicationName?: string | null; /** For EMV payments, the cryptogram generated for the payment. */ - applicationCryptogram?: string; + applicationCryptogram?: string | null; /** * For EMV payments, the method used to verify the cardholder's identity. The method can be * `PIN`, `SIGNATURE`, `PIN_AND_SIGNATURE`, `ON_DEVICE`, or `NONE`. */ - verificationMethod?: string; + verificationMethod?: string | null; /** * For EMV payments, the results of the cardholder verification. The result can be * `SUCCESS`, `FAILURE`, or `UNKNOWN`. */ - verificationResults?: string; + verificationResults?: string | null; /** * The statement description sent to the card networks. * * Note: The actual statement description varies and is likely to be truncated and appended with * additional information on a per issuer basis. */ - statementDescription?: string; + statementDescription?: string | null; /** * __Deprecated__: Use `Payment.device_details` instead. * @@ -68,7 +70,7 @@ export interface CardPaymentDetails { * Whether the card must be physically present for the payment to * be refunded. If set to `true`, the card must be present. */ - refundRequiresCardPresence?: boolean; + refundRequiresCardPresence?: boolean | null; /** Information about errors encountered during the request. */ - errors?: Square.Error_[]; + errors?: Square.Error_[] | null; } diff --git a/src/api/types/CardPaymentTimeline.ts b/src/api/types/CardPaymentTimeline.ts index 284fe8a87..ceb53d0e4 100644 --- a/src/api/types/CardPaymentTimeline.ts +++ b/src/api/types/CardPaymentTimeline.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The timeline for card payments. diff --git a/src/api/types/CardPrepaidType.ts b/src/api/types/CardPrepaidType.ts index 23bf96d4b..c20fff509 100644 --- a/src/api/types/CardPrepaidType.ts +++ b/src/api/types/CardPrepaidType.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates a card's prepaid type, such as `NOT_PREPAID` or `PREPAID`. */ +/** + * Indicates a card's prepaid type, such as `NOT_PREPAID` or `PREPAID`. + */ +export type CardPrepaidType = "UNKNOWN_PREPAID_TYPE" | "NOT_PREPAID" | "PREPAID"; export const CardPrepaidType = { UnknownPrepaidType: "UNKNOWN_PREPAID_TYPE", NotPrepaid: "NOT_PREPAID", Prepaid: "PREPAID", } as const; -export type CardPrepaidType = (typeof CardPrepaidType)[keyof typeof CardPrepaidType]; diff --git a/src/api/types/CardType.ts b/src/api/types/CardType.ts index fc2b8e602..b150f1ed1 100644 --- a/src/api/types/CardType.ts +++ b/src/api/types/CardType.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates a card's type, such as `CREDIT` or `DEBIT`. */ +/** + * Indicates a card's type, such as `CREDIT` or `DEBIT`. + */ +export type CardType = "UNKNOWN_CARD_TYPE" | "CREDIT" | "DEBIT"; export const CardType = { UnknownCardType: "UNKNOWN_CARD_TYPE", Credit: "CREDIT", Debit: "DEBIT", } as const; -export type CardType = (typeof CardType)[keyof typeof CardType]; diff --git a/src/api/types/CardUpdatedEvent.ts b/src/api/types/CardUpdatedEvent.ts index 2ba22deb5..2ac6ab047 100644 --- a/src/api/types/CardUpdatedEvent.ts +++ b/src/api/types/CardUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [card](entity:Card) is updated by the seller in the Square Dashboard. diff --git a/src/api/types/CardUpdatedEventData.ts b/src/api/types/CardUpdatedEventData.ts index 3c928fc5a..1185c80fe 100644 --- a/src/api/types/CardUpdatedEventData.ts +++ b/src/api/types/CardUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CardUpdatedEventData { /** The type of the event data object. The value is `"card"`. */ diff --git a/src/api/types/CardUpdatedEventObject.ts b/src/api/types/CardUpdatedEventObject.ts index 1528fd898..8bf011a65 100644 --- a/src/api/types/CardUpdatedEventObject.ts +++ b/src/api/types/CardUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CardUpdatedEventObject { /** The updated card. */ diff --git a/src/api/types/CashAppDetails.ts b/src/api/types/CashAppDetails.ts index 882377531..b1b2528b8 100644 --- a/src/api/types/CashAppDetails.ts +++ b/src/api/types/CashAppDetails.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Additional details about `WALLET` type payments with the `brand` of `CASH_APP`. diff --git a/src/api/types/CashDrawerDevice.ts b/src/api/types/CashDrawerDevice.ts index 2d32f2ea9..d3015226d 100644 --- a/src/api/types/CashDrawerDevice.ts +++ b/src/api/types/CashDrawerDevice.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CashDrawerDevice { /** The device Square-issued ID */ diff --git a/src/api/types/CashDrawerEventType.ts b/src/api/types/CashDrawerEventType.ts index c2df9fb2e..21e07d00d 100644 --- a/src/api/types/CashDrawerEventType.ts +++ b/src/api/types/CashDrawerEventType.ts @@ -1,10 +1,22 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The types of events on a CashDrawerShift. * Each event type represents an employee action on the actual cash drawer * represented by a CashDrawerShift. */ +export type CashDrawerEventType = + | "NO_SALE" + | "CASH_TENDER_PAYMENT" + | "OTHER_TENDER_PAYMENT" + | "CASH_TENDER_CANCELLED_PAYMENT" + | "OTHER_TENDER_CANCELLED_PAYMENT" + | "CASH_TENDER_REFUND" + | "OTHER_TENDER_REFUND" + | "PAID_IN" + | "PAID_OUT"; export const CashDrawerEventType = { NoSale: "NO_SALE", CashTenderPayment: "CASH_TENDER_PAYMENT", @@ -16,4 +28,3 @@ export const CashDrawerEventType = { PaidIn: "PAID_IN", PaidOut: "PAID_OUT", } as const; -export type CashDrawerEventType = (typeof CashDrawerEventType)[keyof typeof CashDrawerEventType]; diff --git a/src/api/types/CashDrawerShift.ts b/src/api/types/CashDrawerShift.ts index 3817ae931..5d8254395 100644 --- a/src/api/types/CashDrawerShift.ts +++ b/src/api/types/CashDrawerShift.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * This model gives the details of a cash drawer shift. diff --git a/src/api/types/CashDrawerShiftEvent.ts b/src/api/types/CashDrawerShiftEvent.ts index 4a21ae4f3..ed6a3bf76 100644 --- a/src/api/types/CashDrawerShiftEvent.ts +++ b/src/api/types/CashDrawerShiftEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CashDrawerShiftEvent { /** The unique ID of the event. */ diff --git a/src/api/types/CashDrawerShiftState.ts b/src/api/types/CashDrawerShiftState.ts index e8c2f0eb8..9c3ac76de 100644 --- a/src/api/types/CashDrawerShiftState.ts +++ b/src/api/types/CashDrawerShiftState.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The current state of a cash drawer shift. */ +/** + * The current state of a cash drawer shift. + */ +export type CashDrawerShiftState = "OPEN" | "ENDED" | "CLOSED"; export const CashDrawerShiftState = { Open: "OPEN", Ended: "ENDED", Closed: "CLOSED", } as const; -export type CashDrawerShiftState = (typeof CashDrawerShiftState)[keyof typeof CashDrawerShiftState]; diff --git a/src/api/types/CashDrawerShiftSummary.ts b/src/api/types/CashDrawerShiftSummary.ts index 3b12574b2..b4053996b 100644 --- a/src/api/types/CashDrawerShiftSummary.ts +++ b/src/api/types/CashDrawerShiftSummary.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The summary of a closed cash drawer shift. diff --git a/src/api/types/CashPaymentDetails.ts b/src/api/types/CashPaymentDetails.ts index a3abe074f..baa0bfe5a 100644 --- a/src/api/types/CashPaymentDetails.ts +++ b/src/api/types/CashPaymentDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Stores details about a cash payment. Contains only non-confidential information. For more information, see diff --git a/src/api/types/CatalogAvailabilityPeriod.ts b/src/api/types/CatalogAvailabilityPeriod.ts index 82cfa7901..5400f1e59 100644 --- a/src/api/types/CatalogAvailabilityPeriod.ts +++ b/src/api/types/CatalogAvailabilityPeriod.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a time period of availability. diff --git a/src/api/types/CatalogCategory.ts b/src/api/types/CatalogCategory.ts index f4b8eeb00..0abeda8e8 100644 --- a/src/api/types/CatalogCategory.ts +++ b/src/api/types/CatalogCategory.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A category to which a `CatalogItem` instance belongs. diff --git a/src/api/types/CatalogCategoryType.ts b/src/api/types/CatalogCategoryType.ts index 3dd13f25a..0e86bdb13 100644 --- a/src/api/types/CatalogCategoryType.ts +++ b/src/api/types/CatalogCategoryType.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates the type of a category. */ +/** + * Indicates the type of a category. + */ +export type CatalogCategoryType = "REGULAR_CATEGORY" | "MENU_CATEGORY" | "KITCHEN_CATEGORY"; export const CatalogCategoryType = { RegularCategory: "REGULAR_CATEGORY", MenuCategory: "MENU_CATEGORY", KitchenCategory: "KITCHEN_CATEGORY", } as const; -export type CatalogCategoryType = (typeof CatalogCategoryType)[keyof typeof CatalogCategoryType]; diff --git a/src/api/types/CatalogCustomAttributeDefinition.ts b/src/api/types/CatalogCustomAttributeDefinition.ts index d9dc92e5c..550c1c5ae 100644 --- a/src/api/types/CatalogCustomAttributeDefinition.ts +++ b/src/api/types/CatalogCustomAttributeDefinition.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Contains information defining a custom attribute. Custom attributes are diff --git a/src/api/types/CatalogCustomAttributeDefinitionAppVisibility.ts b/src/api/types/CatalogCustomAttributeDefinitionAppVisibility.ts index aaaf1eeca..2ca2aaa09 100644 --- a/src/api/types/CatalogCustomAttributeDefinitionAppVisibility.ts +++ b/src/api/types/CatalogCustomAttributeDefinitionAppVisibility.ts @@ -1,13 +1,17 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Defines the visibility of a custom attribute to applications other than their * creating application. */ +export type CatalogCustomAttributeDefinitionAppVisibility = + | "APP_VISIBILITY_HIDDEN" + | "APP_VISIBILITY_READ_ONLY" + | "APP_VISIBILITY_READ_WRITE_VALUES"; export const CatalogCustomAttributeDefinitionAppVisibility = { AppVisibilityHidden: "APP_VISIBILITY_HIDDEN", AppVisibilityReadOnly: "APP_VISIBILITY_READ_ONLY", AppVisibilityReadWriteValues: "APP_VISIBILITY_READ_WRITE_VALUES", } as const; -export type CatalogCustomAttributeDefinitionAppVisibility = - (typeof CatalogCustomAttributeDefinitionAppVisibility)[keyof typeof CatalogCustomAttributeDefinitionAppVisibility]; diff --git a/src/api/types/CatalogCustomAttributeDefinitionNumberConfig.ts b/src/api/types/CatalogCustomAttributeDefinitionNumberConfig.ts index 759729a01..417d50970 100644 --- a/src/api/types/CatalogCustomAttributeDefinitionNumberConfig.ts +++ b/src/api/types/CatalogCustomAttributeDefinitionNumberConfig.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CatalogCustomAttributeDefinitionNumberConfig { /** diff --git a/src/api/types/CatalogCustomAttributeDefinitionSelectionConfig.ts b/src/api/types/CatalogCustomAttributeDefinitionSelectionConfig.ts index 78afa0ffb..46e7f6cba 100644 --- a/src/api/types/CatalogCustomAttributeDefinitionSelectionConfig.ts +++ b/src/api/types/CatalogCustomAttributeDefinitionSelectionConfig.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Configuration associated with `SELECTION`-type custom attribute definitions. diff --git a/src/api/types/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.ts b/src/api/types/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.ts index ff23314c0..84f3d1188 100644 --- a/src/api/types/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.ts +++ b/src/api/types/CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * A named selection for this `SELECTION`-type custom attribute definition. diff --git a/src/api/types/CatalogCustomAttributeDefinitionSellerVisibility.ts b/src/api/types/CatalogCustomAttributeDefinitionSellerVisibility.ts index 39a5b2cc3..dc4afe69b 100644 --- a/src/api/types/CatalogCustomAttributeDefinitionSellerVisibility.ts +++ b/src/api/types/CatalogCustomAttributeDefinitionSellerVisibility.ts @@ -1,13 +1,16 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Defines the visibility of a custom attribute to sellers in Square * client applications, Square APIs or in Square UIs (including Square Point * of Sale applications and Square Dashboard). */ +export type CatalogCustomAttributeDefinitionSellerVisibility = + | "SELLER_VISIBILITY_HIDDEN" + | "SELLER_VISIBILITY_READ_WRITE_VALUES"; export const CatalogCustomAttributeDefinitionSellerVisibility = { SellerVisibilityHidden: "SELLER_VISIBILITY_HIDDEN", SellerVisibilityReadWriteValues: "SELLER_VISIBILITY_READ_WRITE_VALUES", } as const; -export type CatalogCustomAttributeDefinitionSellerVisibility = - (typeof CatalogCustomAttributeDefinitionSellerVisibility)[keyof typeof CatalogCustomAttributeDefinitionSellerVisibility]; diff --git a/src/api/types/CatalogCustomAttributeDefinitionStringConfig.ts b/src/api/types/CatalogCustomAttributeDefinitionStringConfig.ts index a185a2785..ece421219 100644 --- a/src/api/types/CatalogCustomAttributeDefinitionStringConfig.ts +++ b/src/api/types/CatalogCustomAttributeDefinitionStringConfig.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Configuration associated with Custom Attribute Definitions of type `STRING`. diff --git a/src/api/types/CatalogCustomAttributeDefinitionType.ts b/src/api/types/CatalogCustomAttributeDefinitionType.ts index 3ce9a2c14..c456271cb 100644 --- a/src/api/types/CatalogCustomAttributeDefinitionType.ts +++ b/src/api/types/CatalogCustomAttributeDefinitionType.ts @@ -1,11 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Defines the possible types for a custom attribute. */ +/** + * Defines the possible types for a custom attribute. + */ +export type CatalogCustomAttributeDefinitionType = "STRING" | "BOOLEAN" | "NUMBER" | "SELECTION"; export const CatalogCustomAttributeDefinitionType = { String: "STRING", Boolean: "BOOLEAN", Number: "NUMBER", Selection: "SELECTION", } as const; -export type CatalogCustomAttributeDefinitionType = - (typeof CatalogCustomAttributeDefinitionType)[keyof typeof CatalogCustomAttributeDefinitionType]; diff --git a/src/api/types/CatalogCustomAttributeValue.ts b/src/api/types/CatalogCustomAttributeValue.ts index 50d532e7e..17709bb8a 100644 --- a/src/api/types/CatalogCustomAttributeValue.ts +++ b/src/api/types/CatalogCustomAttributeValue.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * An instance of a custom attribute. Custom attributes can be defined and diff --git a/src/api/types/CatalogDiscount.ts b/src/api/types/CatalogDiscount.ts index 8cc60e8bc..d152f7f98 100644 --- a/src/api/types/CatalogDiscount.ts +++ b/src/api/types/CatalogDiscount.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A discount applicable to items. diff --git a/src/api/types/CatalogDiscountModifyTaxBasis.ts b/src/api/types/CatalogDiscountModifyTaxBasis.ts index 72257b39e..eb9a292e7 100644 --- a/src/api/types/CatalogDiscountModifyTaxBasis.ts +++ b/src/api/types/CatalogDiscountModifyTaxBasis.ts @@ -1,8 +1,9 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type CatalogDiscountModifyTaxBasis = "MODIFY_TAX_BASIS" | "DO_NOT_MODIFY_TAX_BASIS"; export const CatalogDiscountModifyTaxBasis = { ModifyTaxBasis: "MODIFY_TAX_BASIS", DoNotModifyTaxBasis: "DO_NOT_MODIFY_TAX_BASIS", } as const; -export type CatalogDiscountModifyTaxBasis = - (typeof CatalogDiscountModifyTaxBasis)[keyof typeof CatalogDiscountModifyTaxBasis]; diff --git a/src/api/types/CatalogDiscountType.ts b/src/api/types/CatalogDiscountType.ts index f77c3d726..cb163566d 100644 --- a/src/api/types/CatalogDiscountType.ts +++ b/src/api/types/CatalogDiscountType.ts @@ -1,10 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** How to apply a CatalogDiscount to a CatalogItem. */ +/** + * How to apply a CatalogDiscount to a CatalogItem. + */ +export type CatalogDiscountType = "FIXED_PERCENTAGE" | "FIXED_AMOUNT" | "VARIABLE_PERCENTAGE" | "VARIABLE_AMOUNT"; export const CatalogDiscountType = { FixedPercentage: "FIXED_PERCENTAGE", FixedAmount: "FIXED_AMOUNT", VariablePercentage: "VARIABLE_PERCENTAGE", VariableAmount: "VARIABLE_AMOUNT", } as const; -export type CatalogDiscountType = (typeof CatalogDiscountType)[keyof typeof CatalogDiscountType]; diff --git a/src/api/types/CatalogEcomSeoData.ts b/src/api/types/CatalogEcomSeoData.ts index c307ec4dc..a5191e257 100644 --- a/src/api/types/CatalogEcomSeoData.ts +++ b/src/api/types/CatalogEcomSeoData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * SEO data for for a seller's Square Online store. diff --git a/src/api/types/CatalogIdMapping.ts b/src/api/types/CatalogIdMapping.ts index 731701157..6a64c6733 100644 --- a/src/api/types/CatalogIdMapping.ts +++ b/src/api/types/CatalogIdMapping.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * A mapping between a temporary client-supplied ID and a permanent server-generated ID. diff --git a/src/api/types/CatalogImage.ts b/src/api/types/CatalogImage.ts index 7a548767c..702f7a63f 100644 --- a/src/api/types/CatalogImage.ts +++ b/src/api/types/CatalogImage.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * An image file to use in Square catalogs. It can be associated with diff --git a/src/api/types/CatalogInfoResponse.ts b/src/api/types/CatalogInfoResponse.ts index 4639e0fce..74498a909 100644 --- a/src/api/types/CatalogInfoResponse.ts +++ b/src/api/types/CatalogInfoResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CatalogInfoResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/CatalogInfoResponseLimits.ts b/src/api/types/CatalogInfoResponseLimits.ts index 554d548ab..882ba531e 100644 --- a/src/api/types/CatalogInfoResponseLimits.ts +++ b/src/api/types/CatalogInfoResponseLimits.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CatalogInfoResponseLimits { /** diff --git a/src/api/types/CatalogItem.ts b/src/api/types/CatalogItem.ts index e3fcba9a5..3a60ac7e0 100644 --- a/src/api/types/CatalogItem.ts +++ b/src/api/types/CatalogItem.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A [CatalogObject](entity:CatalogObject) instance of the `ITEM` type, also referred to as an item, in the catalog. diff --git a/src/api/types/CatalogItemFoodAndBeverageDetails.ts b/src/api/types/CatalogItemFoodAndBeverageDetails.ts index fd66a54b6..eace1998d 100644 --- a/src/api/types/CatalogItemFoodAndBeverageDetails.ts +++ b/src/api/types/CatalogItemFoodAndBeverageDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The food and beverage-specific details of a `FOOD_AND_BEV` item. diff --git a/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreference.ts b/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreference.ts index b796ead06..9b5123a8b 100644 --- a/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreference.ts +++ b/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreference.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Dietary preferences that can be assigned to an `FOOD_AND_BEV` item and its ingredients. diff --git a/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference.ts b/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference.ts index 7abc56223..434c7588d 100644 --- a/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference.ts +++ b/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference.ts @@ -1,6 +1,18 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Standard dietary preferences for food and beverage items that are recommended on item creation. */ +/** + * Standard dietary preferences for food and beverage items that are recommended on item creation. + */ +export type CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference = + | "DAIRY_FREE" + | "GLUTEN_FREE" + | "HALAL" + | "KOSHER" + | "NUT_FREE" + | "VEGAN" + | "VEGETARIAN"; export const CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference = { DairyFree: "DAIRY_FREE", GlutenFree: "GLUTEN_FREE", @@ -10,5 +22,3 @@ export const CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPr Vegan: "VEGAN", Vegetarian: "VEGETARIAN", } as const; -export type CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference = - (typeof CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference)[keyof typeof CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference]; diff --git a/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreferenceType.ts b/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreferenceType.ts index ef1b5c56a..31bb4e4f5 100644 --- a/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreferenceType.ts +++ b/src/api/types/CatalogItemFoodAndBeverageDetailsDietaryPreferenceType.ts @@ -1,9 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The type of dietary preference for the `FOOD_AND_BEV` type of items and integredients. */ +/** + * The type of dietary preference for the `FOOD_AND_BEV` type of items and integredients. + */ +export type CatalogItemFoodAndBeverageDetailsDietaryPreferenceType = "STANDARD" | "CUSTOM"; export const CatalogItemFoodAndBeverageDetailsDietaryPreferenceType = { Standard: "STANDARD", Custom: "CUSTOM", } as const; -export type CatalogItemFoodAndBeverageDetailsDietaryPreferenceType = - (typeof CatalogItemFoodAndBeverageDetailsDietaryPreferenceType)[keyof typeof CatalogItemFoodAndBeverageDetailsDietaryPreferenceType]; diff --git a/src/api/types/CatalogItemFoodAndBeverageDetailsIngredient.ts b/src/api/types/CatalogItemFoodAndBeverageDetailsIngredient.ts index 3887b1610..95e34bd26 100644 --- a/src/api/types/CatalogItemFoodAndBeverageDetailsIngredient.ts +++ b/src/api/types/CatalogItemFoodAndBeverageDetailsIngredient.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Describes the ingredient used in a `FOOD_AND_BEV` item. diff --git a/src/api/types/CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient.ts b/src/api/types/CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient.ts index b861dd04c..cef5da03e 100644 --- a/src/api/types/CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient.ts +++ b/src/api/types/CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient.ts @@ -1,6 +1,25 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Standard ingredients for food and beverage items that are recommended on item creation. */ +/** + * Standard ingredients for food and beverage items that are recommended on item creation. + */ +export type CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = + | "CELERY" + | "CRUSTACEANS" + | "EGGS" + | "FISH" + | "GLUTEN" + | "LUPIN" + | "MILK" + | "MOLLUSCS" + | "MUSTARD" + | "PEANUTS" + | "SESAME" + | "SOY" + | "SULPHITES" + | "TREE_NUTS"; export const CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = { Celery: "CELERY", Crustaceans: "CRUSTACEANS", @@ -17,5 +36,3 @@ export const CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = { Sulphites: "SULPHITES", TreeNuts: "TREE_NUTS", } as const; -export type CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = - (typeof CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient)[keyof typeof CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient]; diff --git a/src/api/types/CatalogItemModifierListInfo.ts b/src/api/types/CatalogItemModifierListInfo.ts index fc23c1005..de2ce69c0 100644 --- a/src/api/types/CatalogItemModifierListInfo.ts +++ b/src/api/types/CatalogItemModifierListInfo.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Controls how a modifier list is applied to a specific item. This object allows for item-specific customization of modifier list behavior diff --git a/src/api/types/CatalogItemOption.ts b/src/api/types/CatalogItemOption.ts index 892e9b54c..fa15b7904 100644 --- a/src/api/types/CatalogItemOption.ts +++ b/src/api/types/CatalogItemOption.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A group of variations for a `CatalogItem`. diff --git a/src/api/types/CatalogItemOptionForItem.ts b/src/api/types/CatalogItemOptionForItem.ts index 2909b8c7c..1dc6995d2 100644 --- a/src/api/types/CatalogItemOptionForItem.ts +++ b/src/api/types/CatalogItemOptionForItem.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * An option that can be assigned to an item. diff --git a/src/api/types/CatalogItemOptionValue.ts b/src/api/types/CatalogItemOptionValue.ts index a5045a8c1..3be28f3f6 100644 --- a/src/api/types/CatalogItemOptionValue.ts +++ b/src/api/types/CatalogItemOptionValue.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * An enumerated value that can link a diff --git a/src/api/types/CatalogItemOptionValueForItemVariation.ts b/src/api/types/CatalogItemOptionValueForItemVariation.ts index 8d4ac5ddb..5a23de8aa 100644 --- a/src/api/types/CatalogItemOptionValueForItemVariation.ts +++ b/src/api/types/CatalogItemOptionValueForItemVariation.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * A `CatalogItemOptionValue` links an item variation to an item option as diff --git a/src/api/types/CatalogItemProductType.ts b/src/api/types/CatalogItemProductType.ts index 4c916b763..3fc91902c 100644 --- a/src/api/types/CatalogItemProductType.ts +++ b/src/api/types/CatalogItemProductType.ts @@ -1,6 +1,20 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The type of a CatalogItem. Connect V2 only allows the creation of `REGULAR` or `APPOINTMENTS_SERVICE` items. */ +/** + * The type of a CatalogItem. Connect V2 only allows the creation of `REGULAR` or `APPOINTMENTS_SERVICE` items. + */ +export type CatalogItemProductType = + | "REGULAR" + | "GIFT_CARD" + | "APPOINTMENTS_SERVICE" + | "FOOD_AND_BEV" + | "EVENT" + | "DIGITAL" + | "DONATION" + | "LEGACY_SQUARE_ONLINE_SERVICE" + | "LEGACY_SQUARE_ONLINE_MEMBERSHIP"; export const CatalogItemProductType = { Regular: "REGULAR", GiftCard: "GIFT_CARD", @@ -12,4 +26,3 @@ export const CatalogItemProductType = { LegacySquareOnlineService: "LEGACY_SQUARE_ONLINE_SERVICE", LegacySquareOnlineMembership: "LEGACY_SQUARE_ONLINE_MEMBERSHIP", } as const; -export type CatalogItemProductType = (typeof CatalogItemProductType)[keyof typeof CatalogItemProductType]; diff --git a/src/api/types/CatalogItemVariation.ts b/src/api/types/CatalogItemVariation.ts index 73678d9ea..59b92d315 100644 --- a/src/api/types/CatalogItemVariation.ts +++ b/src/api/types/CatalogItemVariation.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * An item variation, representing a product for sale, in the Catalog object model. Each [item](entity:CatalogItem) must have at least one diff --git a/src/api/types/CatalogMeasurementUnit.ts b/src/api/types/CatalogMeasurementUnit.ts index 9eeca096e..9e37e5874 100644 --- a/src/api/types/CatalogMeasurementUnit.ts +++ b/src/api/types/CatalogMeasurementUnit.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents the unit used to measure a `CatalogItemVariation` and diff --git a/src/api/types/CatalogModifier.ts b/src/api/types/CatalogModifier.ts index ae423df0f..240e396db 100644 --- a/src/api/types/CatalogModifier.ts +++ b/src/api/types/CatalogModifier.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A modifier that can be applied to items at the time of sale. For example, a cheese modifier for a burger, or a flavor modifier for a serving of ice cream. diff --git a/src/api/types/CatalogModifierList.ts b/src/api/types/CatalogModifierList.ts index 4c8696672..8c58b90e9 100644 --- a/src/api/types/CatalogModifierList.ts +++ b/src/api/types/CatalogModifierList.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A container for a list of modifiers, or a text-based modifier. diff --git a/src/api/types/CatalogModifierListModifierType.ts b/src/api/types/CatalogModifierListModifierType.ts index ceb042745..3275ff7f8 100644 --- a/src/api/types/CatalogModifierListModifierType.ts +++ b/src/api/types/CatalogModifierListModifierType.ts @@ -1,9 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Defines the type of `CatalogModifierList`. */ +/** + * Defines the type of `CatalogModifierList`. + */ +export type CatalogModifierListModifierType = "LIST" | "TEXT"; export const CatalogModifierListModifierType = { List: "LIST", Text: "TEXT", } as const; -export type CatalogModifierListModifierType = - (typeof CatalogModifierListModifierType)[keyof typeof CatalogModifierListModifierType]; diff --git a/src/api/types/CatalogModifierListSelectionType.ts b/src/api/types/CatalogModifierListSelectionType.ts index 24057a3eb..ff4aea126 100644 --- a/src/api/types/CatalogModifierListSelectionType.ts +++ b/src/api/types/CatalogModifierListSelectionType.ts @@ -1,9 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates whether a CatalogModifierList supports multiple selections. */ +/** + * Indicates whether a CatalogModifierList supports multiple selections. + */ +export type CatalogModifierListSelectionType = "SINGLE" | "MULTIPLE"; export const CatalogModifierListSelectionType = { Single: "SINGLE", Multiple: "MULTIPLE", } as const; -export type CatalogModifierListSelectionType = - (typeof CatalogModifierListSelectionType)[keyof typeof CatalogModifierListSelectionType]; diff --git a/src/api/types/CatalogModifierOverride.ts b/src/api/types/CatalogModifierOverride.ts index 7ce823aa2..ceefe9122 100644 --- a/src/api/types/CatalogModifierOverride.ts +++ b/src/api/types/CatalogModifierOverride.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Options to control how to override the default behavior of the specified modifier. diff --git a/src/api/types/CatalogObject.ts b/src/api/types/CatalogObject.ts index fce388276..0a9bb9766 100644 --- a/src/api/types/CatalogObject.ts +++ b/src/api/types/CatalogObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The wrapper object for the catalog entries of a given object type. @@ -111,37 +113,4 @@ export namespace CatalogObject { export interface AvailabilityPeriod extends Square.CatalogObjectAvailabilityPeriod { type: "AVAILABILITY_PERIOD"; } - - /** - * The wrapper object for the catalog entries of a given object type. - * - * Depending on the `type` attribute value, a `CatalogObject` instance assumes a type-specific data to yield the corresponding type of catalog object. - * - * For example, if `type=ITEM`, the `CatalogObject` instance must have the ITEM-specific data set on the `item_data` attribute. The resulting `CatalogObject` instance is also a `CatalogItem` instance. - * - * In general, if `type=`, the `CatalogObject` instance must have the ``-specific data set on the `_data` attribute. The resulting `CatalogObject` instance is also a `Catalog` instance. - * - * For a more detailed discussion of the Catalog data model, please see the - * [Design a Catalog](https://developer.squareup.com/docs/catalog-api/design-a-catalog) guide. - */ - export type Request = - | Square.CatalogObject.Item - | Square.CatalogObject.Image - | Square.CatalogObject.Category - | Square.CatalogObject.ItemVariation - | Square.CatalogObject.Tax - | Square.CatalogObject.Discount - | Square.CatalogObject.ModifierList - | Square.CatalogObject.Modifier - | Square.CatalogObject.PricingRule - | Square.CatalogObject.ProductSet - | Square.CatalogObject.TimePeriod - | Square.CatalogObject.MeasurementUnit - | Square.CatalogObject.SubscriptionPlanVariation - | Square.CatalogObject.ItemOption - | Square.CatalogObject.ItemOptionVal - | Square.CatalogObject.CustomAttributeDefinition - | Square.CatalogObject.QuickAmountsSettings - | Square.CatalogObject.SubscriptionPlan - | Square.CatalogObject.AvailabilityPeriod; } diff --git a/src/api/types/CatalogObjectAvailabilityPeriod.ts b/src/api/types/CatalogObjectAvailabilityPeriod.ts index ecc08c3f7..84fade229 100644 --- a/src/api/types/CatalogObjectAvailabilityPeriod.ts +++ b/src/api/types/CatalogObjectAvailabilityPeriod.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CatalogObjectAvailabilityPeriod extends Square.CatalogObjectBase { /** Structured data for a `CatalogAvailabilityPeriod`, set for CatalogObjects of type `AVAILABILITY_PERIOD`. */ diff --git a/src/api/types/CatalogObjectBase.ts b/src/api/types/CatalogObjectBase.ts index 1917d8621..27fea738d 100644 --- a/src/api/types/CatalogObjectBase.ts +++ b/src/api/types/CatalogObjectBase.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CatalogObjectBase { /** diff --git a/src/api/types/CatalogObjectBatch.ts b/src/api/types/CatalogObjectBatch.ts index c16d991b8..e64670b38 100644 --- a/src/api/types/CatalogObjectBatch.ts +++ b/src/api/types/CatalogObjectBatch.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A batch of catalog objects. diff --git a/src/api/types/CatalogObjectCategory.ts b/src/api/types/CatalogObjectCategory.ts index 63eb6dc02..aacb9a154 100644 --- a/src/api/types/CatalogObjectCategory.ts +++ b/src/api/types/CatalogObjectCategory.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A category that can be assigned to an item or a parent category that can be assigned diff --git a/src/api/types/CatalogObjectCustomAttributeDefinition.ts b/src/api/types/CatalogObjectCustomAttributeDefinition.ts index f6f02a7e7..90777ecf4 100644 --- a/src/api/types/CatalogObjectCustomAttributeDefinition.ts +++ b/src/api/types/CatalogObjectCustomAttributeDefinition.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CatalogObjectCustomAttributeDefinition extends Square.CatalogObjectBase { /** Structured data for a `CatalogCustomAttributeDefinition`, set for CatalogObjects of type `CUSTOM_ATTRIBUTE_DEFINITION`. */ diff --git a/src/api/types/CatalogObjectDiscount.ts b/src/api/types/CatalogObjectDiscount.ts index f9b7e1911..cd8623cbb 100644 --- a/src/api/types/CatalogObjectDiscount.ts +++ b/src/api/types/CatalogObjectDiscount.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CatalogObjectDiscount extends Square.CatalogObjectBase { /** Structured data for a `CatalogDiscount`, set for CatalogObjects of type `DISCOUNT`. */ diff --git a/src/api/types/CatalogObjectImage.ts b/src/api/types/CatalogObjectImage.ts index 47811d3bd..85ee6f5d7 100644 --- a/src/api/types/CatalogObjectImage.ts +++ b/src/api/types/CatalogObjectImage.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CatalogObjectImage extends Square.CatalogObjectBase { /** Structured data for a `CatalogImage`, set for CatalogObjects of type `IMAGE`. */ diff --git a/src/api/types/CatalogObjectItem.ts b/src/api/types/CatalogObjectItem.ts index 845c9c414..041ad742e 100644 --- a/src/api/types/CatalogObjectItem.ts +++ b/src/api/types/CatalogObjectItem.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CatalogObjectItem extends Square.CatalogObjectBase { /** Structured data for a `CatalogItem`, set for CatalogObjects of type `ITEM`. */ diff --git a/src/api/types/CatalogObjectItemOption.ts b/src/api/types/CatalogObjectItemOption.ts index e237c8e75..aa14a0a27 100644 --- a/src/api/types/CatalogObjectItemOption.ts +++ b/src/api/types/CatalogObjectItemOption.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CatalogObjectItemOption extends Square.CatalogObjectBase { /** Structured data for a `CatalogItemOption`, set for CatalogObjects of type `ITEM_OPTION`. */ diff --git a/src/api/types/CatalogObjectItemOptionValue.ts b/src/api/types/CatalogObjectItemOptionValue.ts index 61906a0fe..e2538bd44 100644 --- a/src/api/types/CatalogObjectItemOptionValue.ts +++ b/src/api/types/CatalogObjectItemOptionValue.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CatalogObjectItemOptionValue extends Square.CatalogObjectBase { /** Structured data for a `CatalogItemOptionValue`, set for CatalogObjects of type `ITEM_OPTION_VAL`. */ diff --git a/src/api/types/CatalogObjectItemVariation.ts b/src/api/types/CatalogObjectItemVariation.ts index 7145f4c70..e3db4f88e 100644 --- a/src/api/types/CatalogObjectItemVariation.ts +++ b/src/api/types/CatalogObjectItemVariation.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CatalogObjectItemVariation extends Square.CatalogObjectBase { /** Structured data for a `CatalogItemVariation`, set for CatalogObjects of type `ITEM_VARIATION`. */ diff --git a/src/api/types/CatalogObjectMeasurementUnit.ts b/src/api/types/CatalogObjectMeasurementUnit.ts index 2e788f2f8..617db0199 100644 --- a/src/api/types/CatalogObjectMeasurementUnit.ts +++ b/src/api/types/CatalogObjectMeasurementUnit.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CatalogObjectMeasurementUnit extends Square.CatalogObjectBase { /** Structured data for a `CatalogMeasurementUnit`, set for CatalogObjects of type `MEASUREMENT_UNIT`. */ diff --git a/src/api/types/CatalogObjectModifier.ts b/src/api/types/CatalogObjectModifier.ts index 499a579a1..4035903a2 100644 --- a/src/api/types/CatalogObjectModifier.ts +++ b/src/api/types/CatalogObjectModifier.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CatalogObjectModifier extends Square.CatalogObjectBase { /** Structured data for a `CatalogModifier`, set for CatalogObjects of type `MODIFIER`. */ diff --git a/src/api/types/CatalogObjectModifierList.ts b/src/api/types/CatalogObjectModifierList.ts index 9751988e7..ba19d39a3 100644 --- a/src/api/types/CatalogObjectModifierList.ts +++ b/src/api/types/CatalogObjectModifierList.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CatalogObjectModifierList extends Square.CatalogObjectBase { /** Structured data for a `CatalogModifierList`, set for CatalogObjects of type `MODIFIER_LIST`. */ diff --git a/src/api/types/CatalogObjectPricingRule.ts b/src/api/types/CatalogObjectPricingRule.ts index a5b4f31e5..7ebc2203b 100644 --- a/src/api/types/CatalogObjectPricingRule.ts +++ b/src/api/types/CatalogObjectPricingRule.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CatalogObjectPricingRule extends Square.CatalogObjectBase { /** diff --git a/src/api/types/CatalogObjectProductSet.ts b/src/api/types/CatalogObjectProductSet.ts index 97651155a..8a8ac48d0 100644 --- a/src/api/types/CatalogObjectProductSet.ts +++ b/src/api/types/CatalogObjectProductSet.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CatalogObjectProductSet extends Square.CatalogObjectBase { /** Structured data for a `CatalogProductSet`, set for CatalogObjects of type `PRODUCT_SET`. */ diff --git a/src/api/types/CatalogObjectQuickAmountsSettings.ts b/src/api/types/CatalogObjectQuickAmountsSettings.ts index 9bac196ec..96dfaae14 100644 --- a/src/api/types/CatalogObjectQuickAmountsSettings.ts +++ b/src/api/types/CatalogObjectQuickAmountsSettings.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CatalogObjectQuickAmountsSettings extends Square.CatalogObjectBase { /** Structured data for a `CatalogQuickAmountsSettings`, set for CatalogObjects of type `QUICK_AMOUNTS_SETTINGS`. */ diff --git a/src/api/types/CatalogObjectReference.ts b/src/api/types/CatalogObjectReference.ts index a9f6d72d6..bae12f831 100644 --- a/src/api/types/CatalogObjectReference.ts +++ b/src/api/types/CatalogObjectReference.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * A reference to a Catalog object at a specific version. In general this is diff --git a/src/api/types/CatalogObjectSubscriptionPlan.ts b/src/api/types/CatalogObjectSubscriptionPlan.ts index 96ec7bbde..cc8f91f21 100644 --- a/src/api/types/CatalogObjectSubscriptionPlan.ts +++ b/src/api/types/CatalogObjectSubscriptionPlan.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CatalogObjectSubscriptionPlan extends Square.CatalogObjectBase { /** Structured data for a `CatalogSubscriptionPlan`, set for CatalogObjects of type `SUBSCRIPTION_PLAN`. */ diff --git a/src/api/types/CatalogObjectSubscriptionPlanVariation.ts b/src/api/types/CatalogObjectSubscriptionPlanVariation.ts index 1c80142c2..e7ad55b81 100644 --- a/src/api/types/CatalogObjectSubscriptionPlanVariation.ts +++ b/src/api/types/CatalogObjectSubscriptionPlanVariation.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CatalogObjectSubscriptionPlanVariation extends Square.CatalogObjectBase { /** Structured data for a `CatalogSubscriptionPlanVariation`, set for CatalogObjects of type `SUBSCRIPTION_PLAN_VARIATION`. */ diff --git a/src/api/types/CatalogObjectTax.ts b/src/api/types/CatalogObjectTax.ts index 75a9dc637..9bd1f77c9 100644 --- a/src/api/types/CatalogObjectTax.ts +++ b/src/api/types/CatalogObjectTax.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CatalogObjectTax extends Square.CatalogObjectBase { /** Structured data for a `CatalogTax`, set for CatalogObjects of type `TAX`. */ diff --git a/src/api/types/CatalogObjectTimePeriod.ts b/src/api/types/CatalogObjectTimePeriod.ts index d72b04a64..7e550db1a 100644 --- a/src/api/types/CatalogObjectTimePeriod.ts +++ b/src/api/types/CatalogObjectTimePeriod.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CatalogObjectTimePeriod extends Square.CatalogObjectBase { /** Structured data for a `CatalogTimePeriod`, set for CatalogObjects of type `TIME_PERIOD`. */ diff --git a/src/api/types/CatalogObjectType.ts b/src/api/types/CatalogObjectType.ts index ec88763cd..65f04fa5d 100644 --- a/src/api/types/CatalogObjectType.ts +++ b/src/api/types/CatalogObjectType.ts @@ -1,9 +1,31 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Possible types of CatalogObjects returned from the catalog, each * containing type-specific properties in the `*_data` field corresponding to the specified object type. */ +export type CatalogObjectType = + | "ITEM" + | "IMAGE" + | "CATEGORY" + | "ITEM_VARIATION" + | "TAX" + | "DISCOUNT" + | "MODIFIER_LIST" + | "MODIFIER" + | "PRICING_RULE" + | "PRODUCT_SET" + | "TIME_PERIOD" + | "MEASUREMENT_UNIT" + | "SUBSCRIPTION_PLAN_VARIATION" + | "ITEM_OPTION" + | "ITEM_OPTION_VAL" + | "CUSTOM_ATTRIBUTE_DEFINITION" + | "QUICK_AMOUNTS_SETTINGS" + | "SUBSCRIPTION_PLAN" + | "AVAILABILITY_PERIOD"; export const CatalogObjectType = { Item: "ITEM", Image: "IMAGE", @@ -25,4 +47,3 @@ export const CatalogObjectType = { SubscriptionPlan: "SUBSCRIPTION_PLAN", AvailabilityPeriod: "AVAILABILITY_PERIOD", } as const; -export type CatalogObjectType = (typeof CatalogObjectType)[keyof typeof CatalogObjectType]; diff --git a/src/api/types/CatalogPricingRule.ts b/src/api/types/CatalogPricingRule.ts index 8a68bc019..7097f093e 100644 --- a/src/api/types/CatalogPricingRule.ts +++ b/src/api/types/CatalogPricingRule.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines how discounts are automatically applied to a set of items that match the pricing rule diff --git a/src/api/types/CatalogPricingType.ts b/src/api/types/CatalogPricingType.ts index 755adb487..e1fb68180 100644 --- a/src/api/types/CatalogPricingType.ts +++ b/src/api/types/CatalogPricingType.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates whether the price of a CatalogItemVariation should be entered manually at the time of sale. */ +/** + * Indicates whether the price of a CatalogItemVariation should be entered manually at the time of sale. + */ +export type CatalogPricingType = "FIXED_PRICING" | "VARIABLE_PRICING"; export const CatalogPricingType = { FixedPricing: "FIXED_PRICING", VariablePricing: "VARIABLE_PRICING", } as const; -export type CatalogPricingType = (typeof CatalogPricingType)[keyof typeof CatalogPricingType]; diff --git a/src/api/types/CatalogProductSet.ts b/src/api/types/CatalogProductSet.ts index ec01f4b80..af45500a6 100644 --- a/src/api/types/CatalogProductSet.ts +++ b/src/api/types/CatalogProductSet.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents a collection of catalog objects for the purpose of applying a diff --git a/src/api/types/CatalogQuery.ts b/src/api/types/CatalogQuery.ts index 5c1acbe6a..e4e09f74f 100644 --- a/src/api/types/CatalogQuery.ts +++ b/src/api/types/CatalogQuery.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A query composed of one or more different types of filters to narrow the scope of targeted objects when calling the `SearchCatalogObjects` endpoint. diff --git a/src/api/types/CatalogQueryExact.ts b/src/api/types/CatalogQueryExact.ts index bf84376ae..762749a7d 100644 --- a/src/api/types/CatalogQueryExact.ts +++ b/src/api/types/CatalogQueryExact.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The query filter to return the search result by exact match of the specified attribute name and value. diff --git a/src/api/types/CatalogQueryItemVariationsForItemOptionValues.ts b/src/api/types/CatalogQueryItemVariationsForItemOptionValues.ts index efe699b7c..9f3a4f122 100644 --- a/src/api/types/CatalogQueryItemVariationsForItemOptionValues.ts +++ b/src/api/types/CatalogQueryItemVariationsForItemOptionValues.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The query filter to return the item variations containing the specified item option value IDs. diff --git a/src/api/types/CatalogQueryItemsForItemOptions.ts b/src/api/types/CatalogQueryItemsForItemOptions.ts index 409e2ea45..39e525afb 100644 --- a/src/api/types/CatalogQueryItemsForItemOptions.ts +++ b/src/api/types/CatalogQueryItemsForItemOptions.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The query filter to return the items containing the specified item option IDs. diff --git a/src/api/types/CatalogQueryItemsForModifierList.ts b/src/api/types/CatalogQueryItemsForModifierList.ts index 6de216e7a..b1b539be4 100644 --- a/src/api/types/CatalogQueryItemsForModifierList.ts +++ b/src/api/types/CatalogQueryItemsForModifierList.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The query filter to return the items containing the specified modifier list IDs. diff --git a/src/api/types/CatalogQueryItemsForTax.ts b/src/api/types/CatalogQueryItemsForTax.ts index 41f63e4c0..74186305a 100644 --- a/src/api/types/CatalogQueryItemsForTax.ts +++ b/src/api/types/CatalogQueryItemsForTax.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The query filter to return the items containing the specified tax IDs. diff --git a/src/api/types/CatalogQueryPrefix.ts b/src/api/types/CatalogQueryPrefix.ts index 3a06c45d3..a834d4c3d 100644 --- a/src/api/types/CatalogQueryPrefix.ts +++ b/src/api/types/CatalogQueryPrefix.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The query filter to return the search result whose named attribute values are prefixed by the specified attribute value. diff --git a/src/api/types/CatalogQueryRange.ts b/src/api/types/CatalogQueryRange.ts index 9ab1b87df..c1a96a683 100644 --- a/src/api/types/CatalogQueryRange.ts +++ b/src/api/types/CatalogQueryRange.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The query filter to return the search result whose named attribute values fall between the specified range. diff --git a/src/api/types/CatalogQuerySet.ts b/src/api/types/CatalogQuerySet.ts index b888fc430..316819065 100644 --- a/src/api/types/CatalogQuerySet.ts +++ b/src/api/types/CatalogQuerySet.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The query filter to return the search result(s) by exact match of the specified `attribute_name` and any of diff --git a/src/api/types/CatalogQuerySortedAttribute.ts b/src/api/types/CatalogQuerySortedAttribute.ts index 5793ab788..44807e89f 100644 --- a/src/api/types/CatalogQuerySortedAttribute.ts +++ b/src/api/types/CatalogQuerySortedAttribute.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The query expression to specify the key to sort search results. diff --git a/src/api/types/CatalogQueryText.ts b/src/api/types/CatalogQueryText.ts index 8cf667247..166de4c8a 100644 --- a/src/api/types/CatalogQueryText.ts +++ b/src/api/types/CatalogQueryText.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The query filter to return the search result whose searchable attribute values contain all of the specified keywords or tokens, independent of the token order or case. diff --git a/src/api/types/CatalogQuickAmount.ts b/src/api/types/CatalogQuickAmount.ts index f97e4f0cf..8771b7c83 100644 --- a/src/api/types/CatalogQuickAmount.ts +++ b/src/api/types/CatalogQuickAmount.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a Quick Amount in the Catalog. diff --git a/src/api/types/CatalogQuickAmountType.ts b/src/api/types/CatalogQuickAmountType.ts index 19c96d881..5cc618fa9 100644 --- a/src/api/types/CatalogQuickAmountType.ts +++ b/src/api/types/CatalogQuickAmountType.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Determines the type of a specific Quick Amount. */ +/** + * Determines the type of a specific Quick Amount. + */ +export type CatalogQuickAmountType = "QUICK_AMOUNT_TYPE_MANUAL" | "QUICK_AMOUNT_TYPE_AUTO"; export const CatalogQuickAmountType = { QuickAmountTypeManual: "QUICK_AMOUNT_TYPE_MANUAL", QuickAmountTypeAuto: "QUICK_AMOUNT_TYPE_AUTO", } as const; -export type CatalogQuickAmountType = (typeof CatalogQuickAmountType)[keyof typeof CatalogQuickAmountType]; diff --git a/src/api/types/CatalogQuickAmountsSettings.ts b/src/api/types/CatalogQuickAmountsSettings.ts index 89d19f3c1..f10fa63d9 100644 --- a/src/api/types/CatalogQuickAmountsSettings.ts +++ b/src/api/types/CatalogQuickAmountsSettings.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A parent Catalog Object model represents a set of Quick Amounts and the settings control the amounts. diff --git a/src/api/types/CatalogQuickAmountsSettingsOption.ts b/src/api/types/CatalogQuickAmountsSettingsOption.ts index 180ccf5ac..e25228ade 100644 --- a/src/api/types/CatalogQuickAmountsSettingsOption.ts +++ b/src/api/types/CatalogQuickAmountsSettingsOption.ts @@ -1,10 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Determines a seller's option on Quick Amounts feature. */ +/** + * Determines a seller's option on Quick Amounts feature. + */ +export type CatalogQuickAmountsSettingsOption = "DISABLED" | "MANUAL" | "AUTO"; export const CatalogQuickAmountsSettingsOption = { Disabled: "DISABLED", Manual: "MANUAL", Auto: "AUTO", } as const; -export type CatalogQuickAmountsSettingsOption = - (typeof CatalogQuickAmountsSettingsOption)[keyof typeof CatalogQuickAmountsSettingsOption]; diff --git a/src/api/types/CatalogStockConversion.ts b/src/api/types/CatalogStockConversion.ts index 47960031b..2293c944f 100644 --- a/src/api/types/CatalogStockConversion.ts +++ b/src/api/types/CatalogStockConversion.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents the rule of conversion between a stockable [CatalogItemVariation](entity:CatalogItemVariation) diff --git a/src/api/types/CatalogSubscriptionPlan.ts b/src/api/types/CatalogSubscriptionPlan.ts index 3c3e9c96d..a649ce62e 100644 --- a/src/api/types/CatalogSubscriptionPlan.ts +++ b/src/api/types/CatalogSubscriptionPlan.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Describes a subscription plan. A subscription plan represents what you want to sell in a subscription model, and includes references to each of the associated subscription plan variations. diff --git a/src/api/types/CatalogSubscriptionPlanVariation.ts b/src/api/types/CatalogSubscriptionPlanVariation.ts index 876d36213..a3b24149d 100644 --- a/src/api/types/CatalogSubscriptionPlanVariation.ts +++ b/src/api/types/CatalogSubscriptionPlanVariation.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Describes a subscription plan variation. A subscription plan variation represents how the subscription for a product or service is sold. diff --git a/src/api/types/CatalogTax.ts b/src/api/types/CatalogTax.ts index bc4d6597d..7333f2886 100644 --- a/src/api/types/CatalogTax.ts +++ b/src/api/types/CatalogTax.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A tax applicable to an item. diff --git a/src/api/types/CatalogTimePeriod.ts b/src/api/types/CatalogTimePeriod.ts index 251e32851..f93d98fa6 100644 --- a/src/api/types/CatalogTimePeriod.ts +++ b/src/api/types/CatalogTimePeriod.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents a time period - either a single period or a repeating period. diff --git a/src/api/types/CatalogV1Id.ts b/src/api/types/CatalogV1Id.ts index 67fbe167f..7e8e9b68c 100644 --- a/src/api/types/CatalogV1Id.ts +++ b/src/api/types/CatalogV1Id.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * A Square API V1 identifier of an item, including the object ID and its associated location ID. diff --git a/src/api/types/CatalogVersionUpdatedEvent.ts b/src/api/types/CatalogVersionUpdatedEvent.ts index 50f5f0e8c..d7cf3d759 100644 --- a/src/api/types/CatalogVersionUpdatedEvent.ts +++ b/src/api/types/CatalogVersionUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when the catalog is updated. diff --git a/src/api/types/CatalogVersionUpdatedEventCatalogVersion.ts b/src/api/types/CatalogVersionUpdatedEventCatalogVersion.ts index bf4f00118..917e5cf61 100644 --- a/src/api/types/CatalogVersionUpdatedEventCatalogVersion.ts +++ b/src/api/types/CatalogVersionUpdatedEventCatalogVersion.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CatalogVersionUpdatedEventCatalogVersion { /** Last modification timestamp in RFC 3339 format. */ diff --git a/src/api/types/CatalogVersionUpdatedEventData.ts b/src/api/types/CatalogVersionUpdatedEventData.ts index dfe06045a..c554fd6ee 100644 --- a/src/api/types/CatalogVersionUpdatedEventData.ts +++ b/src/api/types/CatalogVersionUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CatalogVersionUpdatedEventData { /** Name of the affected object’s type. */ diff --git a/src/api/types/CatalogVersionUpdatedEventObject.ts b/src/api/types/CatalogVersionUpdatedEventObject.ts index 602192638..d2ee6eaa8 100644 --- a/src/api/types/CatalogVersionUpdatedEventObject.ts +++ b/src/api/types/CatalogVersionUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CatalogVersionUpdatedEventObject { /** The version of the object. */ diff --git a/src/api/types/CategoryPathToRootNode.ts b/src/api/types/CategoryPathToRootNode.ts index caa724b92..3b8994258 100644 --- a/src/api/types/CategoryPathToRootNode.ts +++ b/src/api/types/CategoryPathToRootNode.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * A node in the path from a retrieved category to its root node. diff --git a/src/api/types/ChangeBillingAnchorDateResponse.ts b/src/api/types/ChangeBillingAnchorDateResponse.ts index af5b4eaa0..f05bb0771 100644 --- a/src/api/types/ChangeBillingAnchorDateResponse.ts +++ b/src/api/types/ChangeBillingAnchorDateResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines output parameters in a request to the diff --git a/src/api/types/ChangeTiming.ts b/src/api/types/ChangeTiming.ts index 9622388aa..856c8c36f 100644 --- a/src/api/types/ChangeTiming.ts +++ b/src/api/types/ChangeTiming.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Supported timings when a pending change, as an action, takes place to a subscription. */ +/** + * Supported timings when a pending change, as an action, takes place to a subscription. + */ +export type ChangeTiming = "IMMEDIATE" | "END_OF_BILLING_CYCLE"; export const ChangeTiming = { Immediate: "IMMEDIATE", EndOfBillingCycle: "END_OF_BILLING_CYCLE", } as const; -export type ChangeTiming = (typeof ChangeTiming)[keyof typeof ChangeTiming]; diff --git a/src/api/types/Channel.ts b/src/api/types/Channel.ts deleted file mode 100644 index 64dc9d913..000000000 --- a/src/api/types/Channel.ts +++ /dev/null @@ -1,31 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -export interface Channel { - /** The channel's unique ID. */ - id?: string; - /** The unique ID of the merchant this channel belongs to. */ - merchantId?: string; - /** The name of the channel. */ - name?: string | null; - /** The version number which is incremented each time an update is made to the channel. */ - version?: number; - /** Represents an entity the channel is associated with. */ - reference?: Square.Reference; - /** - * Status of the channel. - * See [Status](#type-status) for possible values - */ - status?: Square.ChannelStatus; - /** - * The timestamp for when the channel was created, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * For more information, see [Working with Dates](https://developer.squareup.com/docs/build-basics/working-with-dates). - */ - createdAt?: string; - /** - * The timestamp for when the channel was last updated, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). - * For more information, see [Working with Dates](https://developer.squareup.com/docs/build-basics/working-with-dates). - */ - updatedAt?: string; -} diff --git a/src/api/types/ChannelStatus.ts b/src/api/types/ChannelStatus.ts deleted file mode 100644 index 262474671..000000000 --- a/src/api/types/ChannelStatus.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const ChannelStatus = { - Active: "ACTIVE", - Inactive: "INACTIVE", -} as const; -export type ChannelStatus = (typeof ChannelStatus)[keyof typeof ChannelStatus]; diff --git a/src/api/types/ChargeRequestAdditionalRecipient.ts b/src/api/types/ChargeRequestAdditionalRecipient.ts index b73f813c4..86f123eca 100644 --- a/src/api/types/ChargeRequestAdditionalRecipient.ts +++ b/src/api/types/ChargeRequestAdditionalRecipient.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an additional recipient (other than the merchant) entitled to a portion of the tender. diff --git a/src/api/types/Checkout.ts b/src/api/types/Checkout.ts index 9f9cf94d6..377cb8125 100644 --- a/src/api/types/Checkout.ts +++ b/src/api/types/Checkout.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Square Checkout lets merchants accept online payments for supported diff --git a/src/api/types/CheckoutLocationSettings.ts b/src/api/types/CheckoutLocationSettings.ts index 44c086a5a..5f4ddd1a5 100644 --- a/src/api/types/CheckoutLocationSettings.ts +++ b/src/api/types/CheckoutLocationSettings.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CheckoutLocationSettings { /** The ID of the location that these settings apply to. */ diff --git a/src/api/types/CheckoutLocationSettingsBranding.ts b/src/api/types/CheckoutLocationSettingsBranding.ts index d0baa5ba9..1c87ae6c4 100644 --- a/src/api/types/CheckoutLocationSettingsBranding.ts +++ b/src/api/types/CheckoutLocationSettingsBranding.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CheckoutLocationSettingsBranding { /** diff --git a/src/api/types/CheckoutLocationSettingsBrandingButtonShape.ts b/src/api/types/CheckoutLocationSettingsBrandingButtonShape.ts index e57320add..524ef6661 100644 --- a/src/api/types/CheckoutLocationSettingsBrandingButtonShape.ts +++ b/src/api/types/CheckoutLocationSettingsBrandingButtonShape.ts @@ -1,9 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type CheckoutLocationSettingsBrandingButtonShape = "SQUARED" | "ROUNDED" | "PILL"; export const CheckoutLocationSettingsBrandingButtonShape = { Squared: "SQUARED", Rounded: "ROUNDED", Pill: "PILL", } as const; -export type CheckoutLocationSettingsBrandingButtonShape = - (typeof CheckoutLocationSettingsBrandingButtonShape)[keyof typeof CheckoutLocationSettingsBrandingButtonShape]; diff --git a/src/api/types/CheckoutLocationSettingsBrandingHeaderType.ts b/src/api/types/CheckoutLocationSettingsBrandingHeaderType.ts index b727723c6..cea18d8b9 100644 --- a/src/api/types/CheckoutLocationSettingsBrandingHeaderType.ts +++ b/src/api/types/CheckoutLocationSettingsBrandingHeaderType.ts @@ -1,9 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type CheckoutLocationSettingsBrandingHeaderType = "BUSINESS_NAME" | "FRAMED_LOGO" | "FULL_WIDTH_LOGO"; export const CheckoutLocationSettingsBrandingHeaderType = { BusinessName: "BUSINESS_NAME", FramedLogo: "FRAMED_LOGO", FullWidthLogo: "FULL_WIDTH_LOGO", } as const; -export type CheckoutLocationSettingsBrandingHeaderType = - (typeof CheckoutLocationSettingsBrandingHeaderType)[keyof typeof CheckoutLocationSettingsBrandingHeaderType]; diff --git a/src/api/types/CheckoutLocationSettingsCoupons.ts b/src/api/types/CheckoutLocationSettingsCoupons.ts index b1b2f5337..5feeca992 100644 --- a/src/api/types/CheckoutLocationSettingsCoupons.ts +++ b/src/api/types/CheckoutLocationSettingsCoupons.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CheckoutLocationSettingsCoupons { /** Indicates whether coupons are enabled for this location. */ diff --git a/src/api/types/CheckoutLocationSettingsPolicy.ts b/src/api/types/CheckoutLocationSettingsPolicy.ts index 4d9d90f78..3ada5c55e 100644 --- a/src/api/types/CheckoutLocationSettingsPolicy.ts +++ b/src/api/types/CheckoutLocationSettingsPolicy.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CheckoutLocationSettingsPolicy { /** A unique ID to identify the policy when making changes. You must set the UID for policy updates, but it’s optional when setting new policies. */ diff --git a/src/api/types/CheckoutLocationSettingsTipping.ts b/src/api/types/CheckoutLocationSettingsTipping.ts index abaf94f48..5f7bb7342 100644 --- a/src/api/types/CheckoutLocationSettingsTipping.ts +++ b/src/api/types/CheckoutLocationSettingsTipping.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CheckoutLocationSettingsTipping { /** Set three custom percentage amounts that buyers can select at checkout. If Smart Tip is enabled, this only applies to transactions totaling $10 or more. */ diff --git a/src/api/types/CheckoutMerchantSettings.ts b/src/api/types/CheckoutMerchantSettings.ts index 81265c5ba..1f28f467a 100644 --- a/src/api/types/CheckoutMerchantSettings.ts +++ b/src/api/types/CheckoutMerchantSettings.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CheckoutMerchantSettings { /** The set of payment methods accepted for the merchant's account. */ diff --git a/src/api/types/CheckoutMerchantSettingsPaymentMethods.ts b/src/api/types/CheckoutMerchantSettingsPaymentMethods.ts index c8b4cf614..586a93755 100644 --- a/src/api/types/CheckoutMerchantSettingsPaymentMethods.ts +++ b/src/api/types/CheckoutMerchantSettingsPaymentMethods.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CheckoutMerchantSettingsPaymentMethods { applePay?: Square.CheckoutMerchantSettingsPaymentMethodsPaymentMethod; diff --git a/src/api/types/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay.ts b/src/api/types/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay.ts index 0f932eb3d..f485e9053 100644 --- a/src/api/types/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay.ts +++ b/src/api/types/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The settings allowed for AfterpayClearpay. diff --git a/src/api/types/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange.ts b/src/api/types/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange.ts index ac9d774cc..d43e503b5 100644 --- a/src/api/types/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange.ts +++ b/src/api/types/CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A range of purchase price that qualifies. diff --git a/src/api/types/CheckoutMerchantSettingsPaymentMethodsPaymentMethod.ts b/src/api/types/CheckoutMerchantSettingsPaymentMethodsPaymentMethod.ts index d5462ec77..9d3522728 100644 --- a/src/api/types/CheckoutMerchantSettingsPaymentMethodsPaymentMethod.ts +++ b/src/api/types/CheckoutMerchantSettingsPaymentMethodsPaymentMethod.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The settings allowed for a payment method. diff --git a/src/api/types/CheckoutOptions.ts b/src/api/types/CheckoutOptions.ts index e2cb36162..0a598f295 100644 --- a/src/api/types/CheckoutOptions.ts +++ b/src/api/types/CheckoutOptions.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CheckoutOptions { /** Indicates whether the payment allows tipping. */ diff --git a/src/api/types/CheckoutOptionsPaymentType.ts b/src/api/types/CheckoutOptionsPaymentType.ts index 560b2bde9..aa1e08cdd 100644 --- a/src/api/types/CheckoutOptionsPaymentType.ts +++ b/src/api/types/CheckoutOptionsPaymentType.ts @@ -1,5 +1,16 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type CheckoutOptionsPaymentType = + | "CARD_PRESENT" + | "MANUAL_CARD_ENTRY" + | "FELICA_ID" + | "FELICA_QUICPAY" + | "FELICA_TRANSPORTATION_GROUP" + | "FELICA_ALL" + | "PAYPAY" + | "QR_CODE"; export const CheckoutOptionsPaymentType = { CardPresent: "CARD_PRESENT", ManualCardEntry: "MANUAL_CARD_ENTRY", @@ -10,4 +21,3 @@ export const CheckoutOptionsPaymentType = { Paypay: "PAYPAY", QrCode: "QR_CODE", } as const; -export type CheckoutOptionsPaymentType = (typeof CheckoutOptionsPaymentType)[keyof typeof CheckoutOptionsPaymentType]; diff --git a/src/api/types/ClearpayDetails.ts b/src/api/types/ClearpayDetails.ts index 5574152be..f704dcb5a 100644 --- a/src/api/types/ClearpayDetails.ts +++ b/src/api/types/ClearpayDetails.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Additional details about Clearpay payments. diff --git a/src/api/types/CloneOrderResponse.ts b/src/api/types/CloneOrderResponse.ts index 9b615836f..94e715021 100644 --- a/src/api/types/CloneOrderResponse.ts +++ b/src/api/types/CloneOrderResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/CollectedData.ts b/src/api/types/CollectedData.ts index 9ba29a272..0c1544f0a 100644 --- a/src/api/types/CollectedData.ts +++ b/src/api/types/CollectedData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CollectedData { /** The buyer's input text. */ diff --git a/src/api/types/CompletePaymentResponse.ts b/src/api/types/CompletePaymentResponse.ts index 665faa6c6..0421416db 100644 --- a/src/api/types/CompletePaymentResponse.ts +++ b/src/api/types/CompletePaymentResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the response returned by[CompletePayment](api-endpoint:Payments-CompletePayment). diff --git a/src/api/types/Component.ts b/src/api/types/Component.ts index 73a24bccc..d6c9ed530 100644 --- a/src/api/types/Component.ts +++ b/src/api/types/Component.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The wrapper object for the component entries of a given component type. diff --git a/src/api/types/ComponentComponentType.ts b/src/api/types/ComponentComponentType.ts index cee828568..07a975ad1 100644 --- a/src/api/types/ComponentComponentType.ts +++ b/src/api/types/ComponentComponentType.ts @@ -1,6 +1,11 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** An enum for ComponentType. */ +/** + * An enum for ComponentType. + */ +export type ComponentComponentType = "APPLICATION" | "CARD_READER" | "BATTERY" | "WIFI" | "ETHERNET" | "PRINTER"; export const ComponentComponentType = { Application: "APPLICATION", CardReader: "CARD_READER", @@ -9,4 +14,3 @@ export const ComponentComponentType = { Ethernet: "ETHERNET", Printer: "PRINTER", } as const; -export type ComponentComponentType = (typeof ComponentComponentType)[keyof typeof ComponentComponentType]; diff --git a/src/api/types/ConfirmationDecision.ts b/src/api/types/ConfirmationDecision.ts index 683f0ff3c..5fe860a59 100644 --- a/src/api/types/ConfirmationDecision.ts +++ b/src/api/types/ConfirmationDecision.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface ConfirmationDecision { /** The buyer's decision to the displayed terms. */ diff --git a/src/api/types/ConfirmationOptions.ts b/src/api/types/ConfirmationOptions.ts index b50f79fa9..8a5614f98 100644 --- a/src/api/types/ConfirmationOptions.ts +++ b/src/api/types/ConfirmationOptions.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface ConfirmationOptions { /** The title text to display in the confirmation screen flow on the Terminal. */ diff --git a/src/api/types/Coordinates.ts b/src/api/types/Coordinates.ts index 2e44d4839..ecb15a59a 100644 --- a/src/api/types/Coordinates.ts +++ b/src/api/types/Coordinates.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Latitude and longitude coordinates. diff --git a/src/api/types/Country.ts b/src/api/types/Country.ts index c12fc3fab..119c2d9e9 100644 --- a/src/api/types/Country.ts +++ b/src/api/types/Country.ts @@ -1,9 +1,262 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Indicates the country associated with another entity, such as a business. * Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). */ +export type Country = + | "ZZ" + | "AD" + | "AE" + | "AF" + | "AG" + | "AI" + | "AL" + | "AM" + | "AO" + | "AQ" + | "AR" + | "AS" + | "AT" + | "AU" + | "AW" + | "AX" + | "AZ" + | "BA" + | "BB" + | "BD" + | "BE" + | "BF" + | "BG" + | "BH" + | "BI" + | "BJ" + | "BL" + | "BM" + | "BN" + | "BO" + | "BQ" + | "BR" + | "BS" + | "BT" + | "BV" + | "BW" + | "BY" + | "BZ" + | "CA" + | "CC" + | "CD" + | "CF" + | "CG" + | "CH" + | "CI" + | "CK" + | "CL" + | "CM" + | "CN" + | "CO" + | "CR" + | "CU" + | "CV" + | "CW" + | "CX" + | "CY" + | "CZ" + | "DE" + | "DJ" + | "DK" + | "DM" + | "DO" + | "DZ" + | "EC" + | "EE" + | "EG" + | "EH" + | "ER" + | "ES" + | "ET" + | "FI" + | "FJ" + | "FK" + | "FM" + | "FO" + | "FR" + | "GA" + | "GB" + | "GD" + | "GE" + | "GF" + | "GG" + | "GH" + | "GI" + | "GL" + | "GM" + | "GN" + | "GP" + | "GQ" + | "GR" + | "GS" + | "GT" + | "GU" + | "GW" + | "GY" + | "HK" + | "HM" + | "HN" + | "HR" + | "HT" + | "HU" + | "ID" + | "IE" + | "IL" + | "IM" + | "IN" + | "IO" + | "IQ" + | "IR" + | "IS" + | "IT" + | "JE" + | "JM" + | "JO" + | "JP" + | "KE" + | "KG" + | "KH" + | "KI" + | "KM" + | "KN" + | "KP" + | "KR" + | "KW" + | "KY" + | "KZ" + | "LA" + | "LB" + | "LC" + | "LI" + | "LK" + | "LR" + | "LS" + | "LT" + | "LU" + | "LV" + | "LY" + | "MA" + | "MC" + | "MD" + | "ME" + | "MF" + | "MG" + | "MH" + | "MK" + | "ML" + | "MM" + | "MN" + | "MO" + | "MP" + | "MQ" + | "MR" + | "MS" + | "MT" + | "MU" + | "MV" + | "MW" + | "MX" + | "MY" + | "MZ" + | "NA" + | "NC" + | "NE" + | "NF" + | "NG" + | "NI" + | "NL" + | "NO" + | "NP" + | "NR" + | "NU" + | "NZ" + | "OM" + | "PA" + | "PE" + | "PF" + | "PG" + | "PH" + | "PK" + | "PL" + | "PM" + | "PN" + | "PR" + | "PS" + | "PT" + | "PW" + | "PY" + | "QA" + | "RE" + | "RO" + | "RS" + | "RU" + | "RW" + | "SA" + | "SB" + | "SC" + | "SD" + | "SE" + | "SG" + | "SH" + | "SI" + | "SJ" + | "SK" + | "SL" + | "SM" + | "SN" + | "SO" + | "SR" + | "SS" + | "ST" + | "SV" + | "SX" + | "SY" + | "SZ" + | "TC" + | "TD" + | "TF" + | "TG" + | "TH" + | "TJ" + | "TK" + | "TL" + | "TM" + | "TN" + | "TO" + | "TR" + | "TT" + | "TV" + | "TW" + | "TZ" + | "UA" + | "UG" + | "UM" + | "US" + | "UY" + | "UZ" + | "VA" + | "VC" + | "VE" + | "VG" + | "VI" + | "VN" + | "VU" + | "WF" + | "WS" + | "YE" + | "YT" + | "ZA" + | "ZM" + | "ZW"; export const Country = { Zz: "ZZ", Ad: "AD", @@ -256,4 +509,3 @@ export const Country = { Zm: "ZM", Zw: "ZW", } as const; -export type Country = (typeof Country)[keyof typeof Country]; diff --git a/src/api/types/CreateBookingCustomAttributeDefinitionResponse.ts b/src/api/types/CreateBookingCustomAttributeDefinitionResponse.ts index a985d96a9..9ddf6dc41 100644 --- a/src/api/types/CreateBookingCustomAttributeDefinitionResponse.ts +++ b/src/api/types/CreateBookingCustomAttributeDefinitionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [CreateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-CreateBookingCustomAttributeDefinition) response. diff --git a/src/api/types/CreateBookingResponse.ts b/src/api/types/CreateBookingResponse.ts index 9c4d40097..6926c089a 100644 --- a/src/api/types/CreateBookingResponse.ts +++ b/src/api/types/CreateBookingResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CreateBookingResponse { /** The booking that was created. */ diff --git a/src/api/types/CreateBreakTypeResponse.ts b/src/api/types/CreateBreakTypeResponse.ts index 0df0f2167..f63265cca 100644 --- a/src/api/types/CreateBreakTypeResponse.ts +++ b/src/api/types/CreateBreakTypeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response to the request to create a `BreakType`. The response contains diff --git a/src/api/types/CreateCardResponse.ts b/src/api/types/CreateCardResponse.ts index eee423d19..dd2f132be 100644 --- a/src/api/types/CreateCardResponse.ts +++ b/src/api/types/CreateCardResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/CreateCatalogImageRequest.ts b/src/api/types/CreateCatalogImageRequest.ts index 33909cdee..42a34f4db 100644 --- a/src/api/types/CreateCatalogImageRequest.ts +++ b/src/api/types/CreateCatalogImageRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CreateCatalogImageRequest { /** diff --git a/src/api/types/CreateCatalogImageResponse.ts b/src/api/types/CreateCatalogImageResponse.ts index 726a67d0f..b8bdff543 100644 --- a/src/api/types/CreateCatalogImageResponse.ts +++ b/src/api/types/CreateCatalogImageResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CreateCatalogImageResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/CreateCheckoutResponse.ts b/src/api/types/CreateCheckoutResponse.ts index 97f64882f..d2fd0c058 100644 --- a/src/api/types/CreateCheckoutResponse.ts +++ b/src/api/types/CreateCheckoutResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/CreateCustomerCardResponse.ts b/src/api/types/CreateCustomerCardResponse.ts index 236bdbd78..a44fac41c 100644 --- a/src/api/types/CreateCustomerCardResponse.ts +++ b/src/api/types/CreateCustomerCardResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/CreateCustomerCustomAttributeDefinitionResponse.ts b/src/api/types/CreateCustomerCustomAttributeDefinitionResponse.ts index 1a47bec83..ee62749c2 100644 --- a/src/api/types/CreateCustomerCustomAttributeDefinitionResponse.ts +++ b/src/api/types/CreateCustomerCustomAttributeDefinitionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [CreateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-CreateCustomerCustomAttributeDefinition) response. diff --git a/src/api/types/CreateCustomerGroupResponse.ts b/src/api/types/CreateCustomerGroupResponse.ts index bf42cd86d..4b2a3c26e 100644 --- a/src/api/types/CreateCustomerGroupResponse.ts +++ b/src/api/types/CreateCustomerGroupResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/CreateCustomerResponse.ts b/src/api/types/CreateCustomerResponse.ts index 6a18b9f95..c4df8272e 100644 --- a/src/api/types/CreateCustomerResponse.ts +++ b/src/api/types/CreateCustomerResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/CreateDeviceCodeResponse.ts b/src/api/types/CreateDeviceCodeResponse.ts index 1689b38c6..81fc1db4d 100644 --- a/src/api/types/CreateDeviceCodeResponse.ts +++ b/src/api/types/CreateDeviceCodeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CreateDeviceCodeResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/CreateDisputeEvidenceFileRequest.ts b/src/api/types/CreateDisputeEvidenceFileRequest.ts index b862e411f..b618a355f 100644 --- a/src/api/types/CreateDisputeEvidenceFileRequest.ts +++ b/src/api/types/CreateDisputeEvidenceFileRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the parameters for a `CreateDisputeEvidenceFile` request. diff --git a/src/api/types/CreateDisputeEvidenceFileResponse.ts b/src/api/types/CreateDisputeEvidenceFileResponse.ts index 99c660d46..8eaae103c 100644 --- a/src/api/types/CreateDisputeEvidenceFileResponse.ts +++ b/src/api/types/CreateDisputeEvidenceFileResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields in a `CreateDisputeEvidenceFile` response. diff --git a/src/api/types/CreateDisputeEvidenceTextResponse.ts b/src/api/types/CreateDisputeEvidenceTextResponse.ts index 4e5d32e18..2f5ec1d8a 100644 --- a/src/api/types/CreateDisputeEvidenceTextResponse.ts +++ b/src/api/types/CreateDisputeEvidenceTextResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields in a `CreateDisputeEvidenceText` response. diff --git a/src/api/types/CreateGiftCardActivityResponse.ts b/src/api/types/CreateGiftCardActivityResponse.ts index 79ad0ad28..9815bd3a5 100644 --- a/src/api/types/CreateGiftCardActivityResponse.ts +++ b/src/api/types/CreateGiftCardActivityResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response that contains a `GiftCardActivity` that was created. diff --git a/src/api/types/CreateGiftCardResponse.ts b/src/api/types/CreateGiftCardResponse.ts index c7050e3ba..a5705662b 100644 --- a/src/api/types/CreateGiftCardResponse.ts +++ b/src/api/types/CreateGiftCardResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response that contains a `GiftCard`. The response might contain a set of `Error` objects if the request diff --git a/src/api/types/CreateInvoiceAttachmentRequestData.ts b/src/api/types/CreateInvoiceAttachmentRequestData.ts index 1403d5adb..731d8f7f0 100644 --- a/src/api/types/CreateInvoiceAttachmentRequestData.ts +++ b/src/api/types/CreateInvoiceAttachmentRequestData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents a [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) request. diff --git a/src/api/types/CreateInvoiceAttachmentResponse.ts b/src/api/types/CreateInvoiceAttachmentResponse.ts index 92820652f..b14cfba0f 100644 --- a/src/api/types/CreateInvoiceAttachmentResponse.ts +++ b/src/api/types/CreateInvoiceAttachmentResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [CreateInvoiceAttachment](api-endpoint:Invoices-CreateInvoiceAttachment) response. diff --git a/src/api/types/CreateInvoiceResponse.ts b/src/api/types/CreateInvoiceResponse.ts index 956ef88e9..e7f5e3396 100644 --- a/src/api/types/CreateInvoiceResponse.ts +++ b/src/api/types/CreateInvoiceResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response returned by the `CreateInvoice` request. diff --git a/src/api/types/CreateJobResponse.ts b/src/api/types/CreateJobResponse.ts index 9e43d0df1..78e3ce0ff 100644 --- a/src/api/types/CreateJobResponse.ts +++ b/src/api/types/CreateJobResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [CreateJob](api-endpoint:Team-CreateJob) response. Either `job` or `errors` diff --git a/src/api/types/CreateLocationCustomAttributeDefinitionResponse.ts b/src/api/types/CreateLocationCustomAttributeDefinitionResponse.ts index 8f6d2d7da..dc836c484 100644 --- a/src/api/types/CreateLocationCustomAttributeDefinitionResponse.ts +++ b/src/api/types/CreateLocationCustomAttributeDefinitionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [CreateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-CreateLocationCustomAttributeDefinition) response. diff --git a/src/api/types/CreateLocationResponse.ts b/src/api/types/CreateLocationResponse.ts index 46d25de9f..e625beaaf 100644 --- a/src/api/types/CreateLocationResponse.ts +++ b/src/api/types/CreateLocationResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response object returned by the [CreateLocation](api-endpoint:Locations-CreateLocation) endpoint. diff --git a/src/api/types/CreateLoyaltyAccountResponse.ts b/src/api/types/CreateLoyaltyAccountResponse.ts index e3f23cd3b..8deca79e7 100644 --- a/src/api/types/CreateLoyaltyAccountResponse.ts +++ b/src/api/types/CreateLoyaltyAccountResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response that includes loyalty account created. diff --git a/src/api/types/CreateLoyaltyPromotionResponse.ts b/src/api/types/CreateLoyaltyPromotionResponse.ts index da482680c..e9fddfd36 100644 --- a/src/api/types/CreateLoyaltyPromotionResponse.ts +++ b/src/api/types/CreateLoyaltyPromotionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [CreateLoyaltyPromotion](api-endpoint:Loyalty-CreateLoyaltyPromotion) response. diff --git a/src/api/types/CreateLoyaltyRewardResponse.ts b/src/api/types/CreateLoyaltyRewardResponse.ts index c03f5a2a4..d7895312f 100644 --- a/src/api/types/CreateLoyaltyRewardResponse.ts +++ b/src/api/types/CreateLoyaltyRewardResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response that includes the loyalty reward created. diff --git a/src/api/types/CreateMerchantCustomAttributeDefinitionResponse.ts b/src/api/types/CreateMerchantCustomAttributeDefinitionResponse.ts index 5a907b3fc..48eaa375b 100644 --- a/src/api/types/CreateMerchantCustomAttributeDefinitionResponse.ts +++ b/src/api/types/CreateMerchantCustomAttributeDefinitionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) response. diff --git a/src/api/types/CreateMobileAuthorizationCodeResponse.ts b/src/api/types/CreateMobileAuthorizationCodeResponse.ts index 5c0ba9ad4..51b82b007 100644 --- a/src/api/types/CreateMobileAuthorizationCodeResponse.ts +++ b/src/api/types/CreateMobileAuthorizationCodeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/CreateOrderCustomAttributeDefinitionResponse.ts b/src/api/types/CreateOrderCustomAttributeDefinitionResponse.ts index 88206cc4b..2cb47336e 100644 --- a/src/api/types/CreateOrderCustomAttributeDefinitionResponse.ts +++ b/src/api/types/CreateOrderCustomAttributeDefinitionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response from creating an order custom attribute definition. diff --git a/src/api/types/CreateOrderRequest.ts b/src/api/types/CreateOrderRequest.ts index 8d2c51144..7d0bcab65 100644 --- a/src/api/types/CreateOrderRequest.ts +++ b/src/api/types/CreateOrderRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CreateOrderRequest { /** diff --git a/src/api/types/CreateOrderResponse.ts b/src/api/types/CreateOrderResponse.ts index 44c10c7e2..3f049e6fb 100644 --- a/src/api/types/CreateOrderResponse.ts +++ b/src/api/types/CreateOrderResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/CreatePaymentLinkResponse.ts b/src/api/types/CreatePaymentLinkResponse.ts index ac0dad221..e77451368 100644 --- a/src/api/types/CreatePaymentLinkResponse.ts +++ b/src/api/types/CreatePaymentLinkResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CreatePaymentLinkResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/CreatePaymentResponse.ts b/src/api/types/CreatePaymentResponse.ts index a6bcb9994..c8d39c720 100644 --- a/src/api/types/CreatePaymentResponse.ts +++ b/src/api/types/CreatePaymentResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the response returned by [CreatePayment](api-endpoint:Payments-CreatePayment). diff --git a/src/api/types/CreateScheduledShiftResponse.ts b/src/api/types/CreateScheduledShiftResponse.ts index 2e0289767..2e16a71b9 100644 --- a/src/api/types/CreateScheduledShiftResponse.ts +++ b/src/api/types/CreateScheduledShiftResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [CreateScheduledShift](api-endpoint:Labor-CreateScheduledShift) response. diff --git a/src/api/types/CreateShiftResponse.ts b/src/api/types/CreateShiftResponse.ts index c4211df26..1b9200fe0 100644 --- a/src/api/types/CreateShiftResponse.ts +++ b/src/api/types/CreateShiftResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response to a request to create a `Shift`. The response contains diff --git a/src/api/types/CreateSubscriptionResponse.ts b/src/api/types/CreateSubscriptionResponse.ts index 4e5527b0f..4e562b14b 100644 --- a/src/api/types/CreateSubscriptionResponse.ts +++ b/src/api/types/CreateSubscriptionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines output parameters in a response from the diff --git a/src/api/types/CreateTeamMemberRequest.ts b/src/api/types/CreateTeamMemberRequest.ts index 5331d1aac..163ad0994 100644 --- a/src/api/types/CreateTeamMemberRequest.ts +++ b/src/api/types/CreateTeamMemberRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a create request for a `TeamMember` object. diff --git a/src/api/types/CreateTeamMemberResponse.ts b/src/api/types/CreateTeamMemberResponse.ts index 61c15cf15..28ef6df03 100644 --- a/src/api/types/CreateTeamMemberResponse.ts +++ b/src/api/types/CreateTeamMemberResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response from a create request containing the created `TeamMember` object or error messages. diff --git a/src/api/types/CreateTerminalActionResponse.ts b/src/api/types/CreateTerminalActionResponse.ts index 69b9fa028..cc9d6233e 100644 --- a/src/api/types/CreateTerminalActionResponse.ts +++ b/src/api/types/CreateTerminalActionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CreateTerminalActionResponse { /** Information on errors encountered during the request. */ diff --git a/src/api/types/CreateTerminalCheckoutResponse.ts b/src/api/types/CreateTerminalCheckoutResponse.ts index a8907c22c..212fbe7c7 100644 --- a/src/api/types/CreateTerminalCheckoutResponse.ts +++ b/src/api/types/CreateTerminalCheckoutResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CreateTerminalCheckoutResponse { /** Information about errors encountered during the request. */ diff --git a/src/api/types/CreateTerminalRefundResponse.ts b/src/api/types/CreateTerminalRefundResponse.ts index cc08ad2bb..7ef0c70d1 100644 --- a/src/api/types/CreateTerminalRefundResponse.ts +++ b/src/api/types/CreateTerminalRefundResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CreateTerminalRefundResponse { /** Information about errors encountered during the request. */ diff --git a/src/api/types/CreateTimecardResponse.ts b/src/api/types/CreateTimecardResponse.ts index 275772d11..26ea8b8f8 100644 --- a/src/api/types/CreateTimecardResponse.ts +++ b/src/api/types/CreateTimecardResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response to a request to create a `Timecard`. The response contains diff --git a/src/api/types/CreateTransferOrderData.ts b/src/api/types/CreateTransferOrderData.ts deleted file mode 100644 index 1399d622a..000000000 --- a/src/api/types/CreateTransferOrderData.ts +++ /dev/null @@ -1,34 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -/** - * Data for creating a new transfer order to move [CatalogItemVariation](entity:CatalogItemVariation)s - * between [Location](entity:Location)s. Used with the [CreateTransferOrder](api-endpoint:TransferOrders-CreateTransferOrder) - * endpoint. - */ -export interface CreateTransferOrderData { - /** - * The source [Location](entity:Location) that will send the items. Must be an active location - * in your Square account with sufficient inventory of the requested items. - */ - sourceLocationId: string; - /** - * The destination [Location](entity:Location) that will receive the items. Must be an active location - * in your Square account - */ - destinationLocationId: string; - /** Expected transfer date in RFC 3339 format (e.g. "2023-10-01T12:00:00Z"). */ - expectedAt?: string | null; - /** Optional notes about the transfer */ - notes?: string | null; - /** Optional shipment tracking number */ - trackingNumber?: string | null; - /** - * ID of the [TeamMember](entity:TeamMember) creating this transfer order. Used for tracking - * and auditing purposes. - */ - createdByTeamMemberId?: string | null; - /** List of [CatalogItemVariation](entity:CatalogItemVariation)s to transfer, including quantities */ - lineItems?: Square.CreateTransferOrderLineData[] | null; -} diff --git a/src/api/types/CreateTransferOrderLineData.ts b/src/api/types/CreateTransferOrderLineData.ts deleted file mode 100644 index 1b0e9a05c..000000000 --- a/src/api/types/CreateTransferOrderLineData.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Data for creating a new transfer order line item. Each line item specifies a - * [CatalogItemVariation](entity:CatalogItemVariation) and quantity to transfer. - */ -export interface CreateTransferOrderLineData { - /** - * ID of the [CatalogItemVariation](entity:CatalogItemVariation) to transfer. Must reference a valid - * item variation in the [Catalog](api:Catalog). The item variation must be: - * - Active and available for sale - * - Enabled for inventory tracking - * - Available at the source location - */ - itemVariationId: string; - /** Total quantity ordered */ - quantityOrdered: string; -} diff --git a/src/api/types/CreateTransferOrderResponse.ts b/src/api/types/CreateTransferOrderResponse.ts deleted file mode 100644 index 7d5317469..000000000 --- a/src/api/types/CreateTransferOrderResponse.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -/** - * Response for creating a transfer order. - */ -export interface CreateTransferOrderResponse { - /** The created transfer order */ - transferOrder?: Square.TransferOrder; - /** Any errors that occurred during the request */ - errors?: Square.Error_[]; -} diff --git a/src/api/types/CreateVendorResponse.ts b/src/api/types/CreateVendorResponse.ts index e18c6625e..fc742ce16 100644 --- a/src/api/types/CreateVendorResponse.ts +++ b/src/api/types/CreateVendorResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an output from a call to [CreateVendor](api-endpoint:Vendors-CreateVendor). diff --git a/src/api/types/CreateWebhookSubscriptionResponse.ts b/src/api/types/CreateWebhookSubscriptionResponse.ts index b05f74010..26321d45b 100644 --- a/src/api/types/CreateWebhookSubscriptionResponse.ts +++ b/src/api/types/CreateWebhookSubscriptionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/Currency.ts b/src/api/types/Currency.ts index 12c0b81cd..68275d515 100644 --- a/src/api/types/Currency.ts +++ b/src/api/types/Currency.ts @@ -1,9 +1,195 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Indicates the associated currency for an amount of money. Values correspond * to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). */ +export type Currency = + | "UNKNOWN_CURRENCY" + | "AED" + | "AFN" + | "ALL" + | "AMD" + | "ANG" + | "AOA" + | "ARS" + | "AUD" + | "AWG" + | "AZN" + | "BAM" + | "BBD" + | "BDT" + | "BGN" + | "BHD" + | "BIF" + | "BMD" + | "BND" + | "BOB" + | "BOV" + | "BRL" + | "BSD" + | "BTN" + | "BWP" + | "BYR" + | "BZD" + | "CAD" + | "CDF" + | "CHE" + | "CHF" + | "CHW" + | "CLF" + | "CLP" + | "CNY" + | "COP" + | "COU" + | "CRC" + | "CUC" + | "CUP" + | "CVE" + | "CZK" + | "DJF" + | "DKK" + | "DOP" + | "DZD" + | "EGP" + | "ERN" + | "ETB" + | "EUR" + | "FJD" + | "FKP" + | "GBP" + | "GEL" + | "GHS" + | "GIP" + | "GMD" + | "GNF" + | "GTQ" + | "GYD" + | "HKD" + | "HNL" + | "HRK" + | "HTG" + | "HUF" + | "IDR" + | "ILS" + | "INR" + | "IQD" + | "IRR" + | "ISK" + | "JMD" + | "JOD" + | "JPY" + | "KES" + | "KGS" + | "KHR" + | "KMF" + | "KPW" + | "KRW" + | "KWD" + | "KYD" + | "KZT" + | "LAK" + | "LBP" + | "LKR" + | "LRD" + | "LSL" + | "LTL" + | "LVL" + | "LYD" + | "MAD" + | "MDL" + | "MGA" + | "MKD" + | "MMK" + | "MNT" + | "MOP" + | "MRO" + | "MUR" + | "MVR" + | "MWK" + | "MXN" + | "MXV" + | "MYR" + | "MZN" + | "NAD" + | "NGN" + | "NIO" + | "NOK" + | "NPR" + | "NZD" + | "OMR" + | "PAB" + | "PEN" + | "PGK" + | "PHP" + | "PKR" + | "PLN" + | "PYG" + | "QAR" + | "RON" + | "RSD" + | "RUB" + | "RWF" + | "SAR" + | "SBD" + | "SCR" + | "SDG" + | "SEK" + | "SGD" + | "SHP" + | "SLL" + | "SLE" + | "SOS" + | "SRD" + | "SSP" + | "STD" + | "SVC" + | "SYP" + | "SZL" + | "THB" + | "TJS" + | "TMT" + | "TND" + | "TOP" + | "TRY" + | "TTD" + | "TWD" + | "TZS" + | "UAH" + | "UGX" + | "USD" + | "USN" + | "USS" + | "UYI" + | "UYU" + | "UZS" + | "VEF" + | "VND" + | "VUV" + | "WST" + | "XAF" + | "XAG" + | "XAU" + | "XBA" + | "XBB" + | "XBC" + | "XBD" + | "XCD" + | "XDR" + | "XOF" + | "XPD" + | "XPF" + | "XPT" + | "XTS" + | "XXX" + | "YER" + | "ZAR" + | "ZMK" + | "ZMW" + | "BTC" + | "XUS"; export const Currency = { UnknownCurrency: "UNKNOWN_CURRENCY", Aed: "AED", @@ -189,4 +375,3 @@ export const Currency = { Btc: "BTC", Xus: "XUS", } as const; -export type Currency = (typeof Currency)[keyof typeof Currency]; diff --git a/src/api/types/CustomAttribute.ts b/src/api/types/CustomAttribute.ts index 3758c8361..ee921ef55 100644 --- a/src/api/types/CustomAttribute.ts +++ b/src/api/types/CustomAttribute.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A custom attribute value. Each custom attribute value has a corresponding diff --git a/src/api/types/CustomAttributeDefinition.ts b/src/api/types/CustomAttributeDefinition.ts index df912d3ed..f5c5c5e37 100644 --- a/src/api/types/CustomAttributeDefinition.ts +++ b/src/api/types/CustomAttributeDefinition.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a definition for custom attribute values. A custom attribute definition diff --git a/src/api/types/CustomAttributeDefinitionEventData.ts b/src/api/types/CustomAttributeDefinitionEventData.ts index b91b20423..d128a0008 100644 --- a/src/api/types/CustomAttributeDefinitionEventData.ts +++ b/src/api/types/CustomAttributeDefinitionEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an object in the CustomAttributeDefinition event notification diff --git a/src/api/types/CustomAttributeDefinitionEventDataObject.ts b/src/api/types/CustomAttributeDefinitionEventDataObject.ts index 3bab3fa9e..597e74c37 100644 --- a/src/api/types/CustomAttributeDefinitionEventDataObject.ts +++ b/src/api/types/CustomAttributeDefinitionEventDataObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CustomAttributeDefinitionEventDataObject { /** The custom attribute definition. */ diff --git a/src/api/types/CustomAttributeDefinitionVisibility.ts b/src/api/types/CustomAttributeDefinitionVisibility.ts index 4ab17f834..65923bc78 100644 --- a/src/api/types/CustomAttributeDefinitionVisibility.ts +++ b/src/api/types/CustomAttributeDefinitionVisibility.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The level of permission that a seller or other applications requires to @@ -6,10 +8,12 @@ * The `Visibility` field controls who can read and write the custom attribute values * and custom attribute definition. */ +export type CustomAttributeDefinitionVisibility = + | "VISIBILITY_HIDDEN" + | "VISIBILITY_READ_ONLY" + | "VISIBILITY_READ_WRITE_VALUES"; export const CustomAttributeDefinitionVisibility = { VisibilityHidden: "VISIBILITY_HIDDEN", VisibilityReadOnly: "VISIBILITY_READ_ONLY", VisibilityReadWriteValues: "VISIBILITY_READ_WRITE_VALUES", } as const; -export type CustomAttributeDefinitionVisibility = - (typeof CustomAttributeDefinitionVisibility)[keyof typeof CustomAttributeDefinitionVisibility]; diff --git a/src/api/types/CustomAttributeEventData.ts b/src/api/types/CustomAttributeEventData.ts index 5958cb007..ff4eba0ac 100644 --- a/src/api/types/CustomAttributeEventData.ts +++ b/src/api/types/CustomAttributeEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CustomAttributeEventData { /** The type of the event data object. The value is `"custom_attribute"`. */ diff --git a/src/api/types/CustomAttributeEventDataObject.ts b/src/api/types/CustomAttributeEventDataObject.ts index f4410e25b..fe08aa765 100644 --- a/src/api/types/CustomAttributeEventDataObject.ts +++ b/src/api/types/CustomAttributeEventDataObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface CustomAttributeEventDataObject { /** The custom attribute. */ diff --git a/src/api/types/CustomAttributeFilter.ts b/src/api/types/CustomAttributeFilter.ts index d0692365c..691eb9f87 100644 --- a/src/api/types/CustomAttributeFilter.ts +++ b/src/api/types/CustomAttributeFilter.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Supported custom attribute query expressions for calling the diff --git a/src/api/types/CustomField.ts b/src/api/types/CustomField.ts index 3bbeca038..3ad7203a4 100644 --- a/src/api/types/CustomField.ts +++ b/src/api/types/CustomField.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Describes a custom form field to add to the checkout page to collect more information from buyers during checkout. diff --git a/src/api/types/Customer.ts b/src/api/types/Customer.ts index 24194b213..9bf3d84b5 100644 --- a/src/api/types/Customer.ts +++ b/src/api/types/Customer.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a Square customer profile in the Customer Directory of a Square seller. diff --git a/src/api/types/CustomerAddressFilter.ts b/src/api/types/CustomerAddressFilter.ts index 0383d4460..174856341 100644 --- a/src/api/types/CustomerAddressFilter.ts +++ b/src/api/types/CustomerAddressFilter.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The customer address filter. This filter is used in a [CustomerCustomAttributeFilterValue](entity:CustomerCustomAttributeFilterValue) filter when diff --git a/src/api/types/CustomerCreatedEvent.ts b/src/api/types/CustomerCreatedEvent.ts index d4ccd0dd4..d990529e3 100644 --- a/src/api/types/CustomerCreatedEvent.ts +++ b/src/api/types/CustomerCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [customer](entity:Customer) is created. Subscribe to this event to track customer profiles affected by a merge operation. diff --git a/src/api/types/CustomerCreatedEventData.ts b/src/api/types/CustomerCreatedEventData.ts index e60f5465f..b5462a273 100644 --- a/src/api/types/CustomerCreatedEventData.ts +++ b/src/api/types/CustomerCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The data associated with the event. diff --git a/src/api/types/CustomerCreatedEventEventContext.ts b/src/api/types/CustomerCreatedEventEventContext.ts index 807545acf..cffb661e6 100644 --- a/src/api/types/CustomerCreatedEventEventContext.ts +++ b/src/api/types/CustomerCreatedEventEventContext.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Information about the change that triggered the event. diff --git a/src/api/types/CustomerCreatedEventEventContextMerge.ts b/src/api/types/CustomerCreatedEventEventContextMerge.ts index 9fcc1c5d4..2fc291518 100644 --- a/src/api/types/CustomerCreatedEventEventContextMerge.ts +++ b/src/api/types/CustomerCreatedEventEventContextMerge.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Information about a merge operation, which creates a new customer using aggregated properties from two or more existing customers. diff --git a/src/api/types/CustomerCreatedEventObject.ts b/src/api/types/CustomerCreatedEventObject.ts index 2d6fd6800..123408329 100644 --- a/src/api/types/CustomerCreatedEventObject.ts +++ b/src/api/types/CustomerCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * An object that contains the customer associated with the event. diff --git a/src/api/types/CustomerCreationSource.ts b/src/api/types/CustomerCreationSource.ts index c5b3a64e1..041067922 100644 --- a/src/api/types/CustomerCreationSource.ts +++ b/src/api/types/CustomerCreationSource.ts @@ -1,6 +1,30 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates the method used to create the customer profile. */ +/** + * Indicates the method used to create the customer profile. + */ +export type CustomerCreationSource = + | "OTHER" + | "APPOINTMENTS" + | "COUPON" + | "DELETION_RECOVERY" + | "DIRECTORY" + | "EGIFTING" + | "EMAIL_COLLECTION" + | "FEEDBACK" + | "IMPORT" + | "INVOICES" + | "LOYALTY" + | "MARKETING" + | "MERGE" + | "ONLINE_STORE" + | "INSTANT_PROFILE" + | "TERMINAL" + | "THIRD_PARTY" + | "THIRD_PARTY_IMPORT" + | "UNMERGE_RECOVERY"; export const CustomerCreationSource = { Other: "OTHER", Appointments: "APPOINTMENTS", @@ -22,4 +46,3 @@ export const CustomerCreationSource = { ThirdPartyImport: "THIRD_PARTY_IMPORT", UnmergeRecovery: "UNMERGE_RECOVERY", } as const; -export type CustomerCreationSource = (typeof CustomerCreationSource)[keyof typeof CustomerCreationSource]; diff --git a/src/api/types/CustomerCreationSourceFilter.ts b/src/api/types/CustomerCreationSourceFilter.ts index 855cb8ed5..01d0be76c 100644 --- a/src/api/types/CustomerCreationSourceFilter.ts +++ b/src/api/types/CustomerCreationSourceFilter.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The creation source filter. diff --git a/src/api/types/CustomerCustomAttributeDefinitionCreatedEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionCreatedEvent.ts index 0e6cd03fe..b7d19dab5 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionCreatedEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDefinitionCreatedPublicEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionCreatedPublicEvent.ts index 5332d8b88..e1226f9d7 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionCreatedPublicEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionCreatedPublicEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDefinitionDeletedEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionDeletedEvent.ts index e81cd9f46..58b5c9d58 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionDeletedEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDefinitionDeletedPublicEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionDeletedPublicEvent.ts index 51eee6722..3b1c5fc47 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionDeletedPublicEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionDeletedPublicEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDefinitionOwnedCreatedEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionOwnedCreatedEvent.ts index a947c3b83..4bdd8bdfa 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionOwnedCreatedEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionOwnedCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDefinitionOwnedDeletedEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionOwnedDeletedEvent.ts index 720c8e1ec..485f48e57 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionOwnedDeletedEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionOwnedDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDefinitionOwnedUpdatedEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionOwnedUpdatedEvent.ts index f2ee6355c..72cf63c0c 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionOwnedUpdatedEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionOwnedUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDefinitionUpdatedEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionUpdatedEvent.ts index 67a3df298..d5fd169b3 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionUpdatedEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDefinitionUpdatedPublicEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionUpdatedPublicEvent.ts index 6f6d9fb18..b457074b0 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionUpdatedPublicEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionUpdatedPublicEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDefinitionVisibleCreatedEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionVisibleCreatedEvent.ts index f31e793f5..a5c4e8a57 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionVisibleCreatedEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionVisibleCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDefinitionVisibleDeletedEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionVisibleDeletedEvent.ts index 57607c648..9f69e1548 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionVisibleDeletedEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionVisibleDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDefinitionVisibleUpdatedEvent.ts b/src/api/types/CustomerCustomAttributeDefinitionVisibleUpdatedEvent.ts index be6ed293d..0f6ca331c 100644 --- a/src/api/types/CustomerCustomAttributeDefinitionVisibleUpdatedEvent.ts +++ b/src/api/types/CustomerCustomAttributeDefinitionVisibleUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a customer [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/CustomerCustomAttributeDeletedEvent.ts b/src/api/types/CustomerCustomAttributeDeletedEvent.ts index 9366947ce..67472d51f 100644 --- a/src/api/types/CustomerCustomAttributeDeletedEvent.ts +++ b/src/api/types/CustomerCustomAttributeDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a customer [custom attribute](entity:CustomAttribute) owned by the diff --git a/src/api/types/CustomerCustomAttributeDeletedPublicEvent.ts b/src/api/types/CustomerCustomAttributeDeletedPublicEvent.ts index 835ebf129..905861835 100644 --- a/src/api/types/CustomerCustomAttributeDeletedPublicEvent.ts +++ b/src/api/types/CustomerCustomAttributeDeletedPublicEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a customer [custom attribute](entity:CustomAttribute) that is visible diff --git a/src/api/types/CustomerCustomAttributeFilter.ts b/src/api/types/CustomerCustomAttributeFilter.ts index ad4f76a74..0d2b2ddc7 100644 --- a/src/api/types/CustomerCustomAttributeFilter.ts +++ b/src/api/types/CustomerCustomAttributeFilter.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The custom attribute filter. Use this filter in a set of [custom attribute filters](entity:CustomerCustomAttributeFilters) to search diff --git a/src/api/types/CustomerCustomAttributeFilterValue.ts b/src/api/types/CustomerCustomAttributeFilterValue.ts index 46838b891..25df2dfb4 100644 --- a/src/api/types/CustomerCustomAttributeFilterValue.ts +++ b/src/api/types/CustomerCustomAttributeFilterValue.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A type-specific filter used in a [custom attribute filter](entity:CustomerCustomAttributeFilter) to search based on the value diff --git a/src/api/types/CustomerCustomAttributeFilters.ts b/src/api/types/CustomerCustomAttributeFilters.ts index 7c149bf56..bc9ac3f27 100644 --- a/src/api/types/CustomerCustomAttributeFilters.ts +++ b/src/api/types/CustomerCustomAttributeFilters.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The custom attribute filters in a set of [customer filters](entity:CustomerFilter) used in a search query. Use this filter diff --git a/src/api/types/CustomerCustomAttributeOwnedDeletedEvent.ts b/src/api/types/CustomerCustomAttributeOwnedDeletedEvent.ts index dac644434..e2d18f053 100644 --- a/src/api/types/CustomerCustomAttributeOwnedDeletedEvent.ts +++ b/src/api/types/CustomerCustomAttributeOwnedDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a customer [custom attribute](entity:CustomAttribute) owned by the diff --git a/src/api/types/CustomerCustomAttributeOwnedUpdatedEvent.ts b/src/api/types/CustomerCustomAttributeOwnedUpdatedEvent.ts index 83aa5f382..307c5c9d7 100644 --- a/src/api/types/CustomerCustomAttributeOwnedUpdatedEvent.ts +++ b/src/api/types/CustomerCustomAttributeOwnedUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a customer [custom attribute](entity:CustomAttribute) owned by the diff --git a/src/api/types/CustomerCustomAttributeUpdatedEvent.ts b/src/api/types/CustomerCustomAttributeUpdatedEvent.ts index 6e0b5accb..d426f098f 100644 --- a/src/api/types/CustomerCustomAttributeUpdatedEvent.ts +++ b/src/api/types/CustomerCustomAttributeUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a customer [custom attribute](entity:CustomAttribute) owned by the diff --git a/src/api/types/CustomerCustomAttributeUpdatedPublicEvent.ts b/src/api/types/CustomerCustomAttributeUpdatedPublicEvent.ts index 634f11256..c4f4819e3 100644 --- a/src/api/types/CustomerCustomAttributeUpdatedPublicEvent.ts +++ b/src/api/types/CustomerCustomAttributeUpdatedPublicEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a customer [custom attribute](entity:CustomAttribute) that is visible diff --git a/src/api/types/CustomerCustomAttributeVisibleDeletedEvent.ts b/src/api/types/CustomerCustomAttributeVisibleDeletedEvent.ts index 649be1d03..1a12c2c3d 100644 --- a/src/api/types/CustomerCustomAttributeVisibleDeletedEvent.ts +++ b/src/api/types/CustomerCustomAttributeVisibleDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a customer [custom attribute](entity:CustomAttribute) that is visible to the diff --git a/src/api/types/CustomerCustomAttributeVisibleUpdatedEvent.ts b/src/api/types/CustomerCustomAttributeVisibleUpdatedEvent.ts index 90f78e294..151a94dac 100644 --- a/src/api/types/CustomerCustomAttributeVisibleUpdatedEvent.ts +++ b/src/api/types/CustomerCustomAttributeVisibleUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a customer [custom attribute](entity:CustomAttribute) that is visible to the diff --git a/src/api/types/CustomerDeletedEvent.ts b/src/api/types/CustomerDeletedEvent.ts index 6c3d3ee13..6b4f4a606 100644 --- a/src/api/types/CustomerDeletedEvent.ts +++ b/src/api/types/CustomerDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [customer](entity:Customer) is deleted. For more information, see [Use Customer Webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks). diff --git a/src/api/types/CustomerDeletedEventData.ts b/src/api/types/CustomerDeletedEventData.ts index 4971c78c2..6f163c33e 100644 --- a/src/api/types/CustomerDeletedEventData.ts +++ b/src/api/types/CustomerDeletedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The data associated with the event. diff --git a/src/api/types/CustomerDeletedEventEventContext.ts b/src/api/types/CustomerDeletedEventEventContext.ts index d33a26745..e9dc77218 100644 --- a/src/api/types/CustomerDeletedEventEventContext.ts +++ b/src/api/types/CustomerDeletedEventEventContext.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Information about the change that triggered the event. diff --git a/src/api/types/CustomerDeletedEventEventContextMerge.ts b/src/api/types/CustomerDeletedEventEventContextMerge.ts index 4a87832c6..edab8c7f9 100644 --- a/src/api/types/CustomerDeletedEventEventContextMerge.ts +++ b/src/api/types/CustomerDeletedEventEventContextMerge.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Information about a merge operation, which creates a new customer using aggregated properties from two or more existing customers. diff --git a/src/api/types/CustomerDeletedEventObject.ts b/src/api/types/CustomerDeletedEventObject.ts index 7f9d949ad..1e347011a 100644 --- a/src/api/types/CustomerDeletedEventObject.ts +++ b/src/api/types/CustomerDeletedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * An object that contains the customer associated with the event. diff --git a/src/api/types/CustomerDetails.ts b/src/api/types/CustomerDetails.ts index 00e65d7b5..6ffb58fd6 100644 --- a/src/api/types/CustomerDetails.ts +++ b/src/api/types/CustomerDetails.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Details about the customer making the payment. diff --git a/src/api/types/CustomerFilter.ts b/src/api/types/CustomerFilter.ts index b87018036..c7546e024 100644 --- a/src/api/types/CustomerFilter.ts +++ b/src/api/types/CustomerFilter.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents the filtering criteria in a [search query](entity:CustomerQuery) that defines how to filter diff --git a/src/api/types/CustomerGroup.ts b/src/api/types/CustomerGroup.ts index 53287b5a1..d7d65b7fa 100644 --- a/src/api/types/CustomerGroup.ts +++ b/src/api/types/CustomerGroup.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents a group of customer profiles. diff --git a/src/api/types/CustomerInclusionExclusion.ts b/src/api/types/CustomerInclusionExclusion.ts index 1a857d74b..1d8be541f 100644 --- a/src/api/types/CustomerInclusionExclusion.ts +++ b/src/api/types/CustomerInclusionExclusion.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Indicates whether customers should be included in, or excluded from, * the result set when they match the filtering criteria. */ +export type CustomerInclusionExclusion = "INCLUDE" | "EXCLUDE"; export const CustomerInclusionExclusion = { Include: "INCLUDE", Exclude: "EXCLUDE", } as const; -export type CustomerInclusionExclusion = (typeof CustomerInclusionExclusion)[keyof typeof CustomerInclusionExclusion]; diff --git a/src/api/types/CustomerPreferences.ts b/src/api/types/CustomerPreferences.ts index 5f88624a4..2d50d372d 100644 --- a/src/api/types/CustomerPreferences.ts +++ b/src/api/types/CustomerPreferences.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents communication preferences for the customer profile. diff --git a/src/api/types/CustomerQuery.ts b/src/api/types/CustomerQuery.ts index f6171d90b..0cfacb26e 100644 --- a/src/api/types/CustomerQuery.ts +++ b/src/api/types/CustomerQuery.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents filtering and sorting criteria for a [SearchCustomers](api-endpoint:Customers-SearchCustomers) request. diff --git a/src/api/types/CustomerSegment.ts b/src/api/types/CustomerSegment.ts index e8ce7f811..6137a846b 100644 --- a/src/api/types/CustomerSegment.ts +++ b/src/api/types/CustomerSegment.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents a group of customer profiles that match one or more predefined filter criteria. diff --git a/src/api/types/CustomerSort.ts b/src/api/types/CustomerSort.ts index a84ee2109..31fe8860b 100644 --- a/src/api/types/CustomerSort.ts +++ b/src/api/types/CustomerSort.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents the sorting criteria in a [search query](entity:CustomerQuery) that defines how to sort diff --git a/src/api/types/CustomerSortField.ts b/src/api/types/CustomerSortField.ts index 05a44dab8..453994a28 100644 --- a/src/api/types/CustomerSortField.ts +++ b/src/api/types/CustomerSortField.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Specifies customer attributes as the sort key to customer profiles returned from a search. */ +/** + * Specifies customer attributes as the sort key to customer profiles returned from a search. + */ +export type CustomerSortField = "DEFAULT" | "CREATED_AT"; export const CustomerSortField = { Default: "DEFAULT", CreatedAt: "CREATED_AT", } as const; -export type CustomerSortField = (typeof CustomerSortField)[keyof typeof CustomerSortField]; diff --git a/src/api/types/CustomerTaxIds.ts b/src/api/types/CustomerTaxIds.ts index 842819d3e..93daf9e65 100644 --- a/src/api/types/CustomerTaxIds.ts +++ b/src/api/types/CustomerTaxIds.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents the tax ID associated with a [customer profile](entity:Customer). The corresponding `tax_ids` field is available only for customers of sellers in EU countries or the United Kingdom. diff --git a/src/api/types/CustomerTextFilter.ts b/src/api/types/CustomerTextFilter.ts index 33392d3f7..598e03ca9 100644 --- a/src/api/types/CustomerTextFilter.ts +++ b/src/api/types/CustomerTextFilter.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * A filter to select customers based on exact or fuzzy matching of diff --git a/src/api/types/CustomerUpdatedEvent.ts b/src/api/types/CustomerUpdatedEvent.ts index efdb90015..9bbb4aa96 100644 --- a/src/api/types/CustomerUpdatedEvent.ts +++ b/src/api/types/CustomerUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [customer](entity:Customer) is updated. For more information, see [Use Customer Webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks). diff --git a/src/api/types/CustomerUpdatedEventData.ts b/src/api/types/CustomerUpdatedEventData.ts index 23da57a4c..143415a30 100644 --- a/src/api/types/CustomerUpdatedEventData.ts +++ b/src/api/types/CustomerUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The data associated with the event. diff --git a/src/api/types/CustomerUpdatedEventObject.ts b/src/api/types/CustomerUpdatedEventObject.ts index 06441be95..666d5fa91 100644 --- a/src/api/types/CustomerUpdatedEventObject.ts +++ b/src/api/types/CustomerUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * An object that contains the customer associated with the event. diff --git a/src/api/types/DataCollectionOptions.ts b/src/api/types/DataCollectionOptions.ts index e9c925cce..c9fb89b7a 100644 --- a/src/api/types/DataCollectionOptions.ts +++ b/src/api/types/DataCollectionOptions.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DataCollectionOptions { /** The title text to display in the data collection flow on the Terminal. */ diff --git a/src/api/types/DataCollectionOptionsInputType.ts b/src/api/types/DataCollectionOptionsInputType.ts index 02ffc049f..2e8b0cec0 100644 --- a/src/api/types/DataCollectionOptionsInputType.ts +++ b/src/api/types/DataCollectionOptionsInputType.ts @@ -1,9 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Describes the input type of the data. */ +/** + * Describes the input type of the data. + */ +export type DataCollectionOptionsInputType = "EMAIL" | "PHONE_NUMBER"; export const DataCollectionOptionsInputType = { Email: "EMAIL", PhoneNumber: "PHONE_NUMBER", } as const; -export type DataCollectionOptionsInputType = - (typeof DataCollectionOptionsInputType)[keyof typeof DataCollectionOptionsInputType]; diff --git a/src/api/types/DateRange.ts b/src/api/types/DateRange.ts index 3833df326..d5b5c2a3f 100644 --- a/src/api/types/DateRange.ts +++ b/src/api/types/DateRange.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * A range defined by two dates. Used for filtering a query for Connect v2 diff --git a/src/api/types/DayOfWeek.ts b/src/api/types/DayOfWeek.ts index ba252a2ae..d2f9beb46 100644 --- a/src/api/types/DayOfWeek.ts +++ b/src/api/types/DayOfWeek.ts @@ -1,6 +1,11 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates the specific day of the week. */ +/** + * Indicates the specific day of the week. + */ +export type DayOfWeek = "SUN" | "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT"; export const DayOfWeek = { Sun: "SUN", Mon: "MON", @@ -10,4 +15,3 @@ export const DayOfWeek = { Fri: "FRI", Sat: "SAT", } as const; -export type DayOfWeek = (typeof DayOfWeek)[keyof typeof DayOfWeek]; diff --git a/src/api/types/DeleteBookingCustomAttributeDefinitionResponse.ts b/src/api/types/DeleteBookingCustomAttributeDefinitionResponse.ts index 992a6caa1..a2aefe00c 100644 --- a/src/api/types/DeleteBookingCustomAttributeDefinitionResponse.ts +++ b/src/api/types/DeleteBookingCustomAttributeDefinitionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [DeleteBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-DeleteBookingCustomAttributeDefinition) response diff --git a/src/api/types/DeleteBookingCustomAttributeResponse.ts b/src/api/types/DeleteBookingCustomAttributeResponse.ts index 57494b413..57ab7546b 100644 --- a/src/api/types/DeleteBookingCustomAttributeResponse.ts +++ b/src/api/types/DeleteBookingCustomAttributeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [DeleteBookingCustomAttribute](api-endpoint:BookingCustomAttributes-DeleteBookingCustomAttribute) response. diff --git a/src/api/types/DeleteBreakTypeResponse.ts b/src/api/types/DeleteBreakTypeResponse.ts index 50aaa5084..c85ce0eb0 100644 --- a/src/api/types/DeleteBreakTypeResponse.ts +++ b/src/api/types/DeleteBreakTypeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response to a request to delete a `BreakType`. The response might contain a set diff --git a/src/api/types/DeleteCatalogObjectResponse.ts b/src/api/types/DeleteCatalogObjectResponse.ts index 65c8020c6..734606657 100644 --- a/src/api/types/DeleteCatalogObjectResponse.ts +++ b/src/api/types/DeleteCatalogObjectResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DeleteCatalogObjectResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/DeleteCustomerCardResponse.ts b/src/api/types/DeleteCustomerCardResponse.ts index a509918ff..a5fcc3f81 100644 --- a/src/api/types/DeleteCustomerCardResponse.ts +++ b/src/api/types/DeleteCustomerCardResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/DeleteCustomerCustomAttributeDefinitionResponse.ts b/src/api/types/DeleteCustomerCustomAttributeDefinitionResponse.ts index 12fb6d5a8..66a5ca47b 100644 --- a/src/api/types/DeleteCustomerCustomAttributeDefinitionResponse.ts +++ b/src/api/types/DeleteCustomerCustomAttributeDefinitionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response from a delete request containing error messages if there are any. diff --git a/src/api/types/DeleteCustomerCustomAttributeResponse.ts b/src/api/types/DeleteCustomerCustomAttributeResponse.ts index 0da612549..c4bdba587 100644 --- a/src/api/types/DeleteCustomerCustomAttributeResponse.ts +++ b/src/api/types/DeleteCustomerCustomAttributeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [DeleteCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-DeleteCustomerCustomAttribute) response. diff --git a/src/api/types/DeleteCustomerGroupResponse.ts b/src/api/types/DeleteCustomerGroupResponse.ts index 4f0054a43..2a78946f7 100644 --- a/src/api/types/DeleteCustomerGroupResponse.ts +++ b/src/api/types/DeleteCustomerGroupResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/DeleteCustomerResponse.ts b/src/api/types/DeleteCustomerResponse.ts index ba834abf9..225fa47cf 100644 --- a/src/api/types/DeleteCustomerResponse.ts +++ b/src/api/types/DeleteCustomerResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/DeleteDisputeEvidenceResponse.ts b/src/api/types/DeleteDisputeEvidenceResponse.ts index 8d92cfc57..a13499b2b 100644 --- a/src/api/types/DeleteDisputeEvidenceResponse.ts +++ b/src/api/types/DeleteDisputeEvidenceResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields in a `DeleteDisputeEvidence` response. diff --git a/src/api/types/DeleteInvoiceAttachmentResponse.ts b/src/api/types/DeleteInvoiceAttachmentResponse.ts index a84141f04..adc386aaa 100644 --- a/src/api/types/DeleteInvoiceAttachmentResponse.ts +++ b/src/api/types/DeleteInvoiceAttachmentResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [DeleteInvoiceAttachment](api-endpoint:Invoices-DeleteInvoiceAttachment) response. diff --git a/src/api/types/DeleteInvoiceResponse.ts b/src/api/types/DeleteInvoiceResponse.ts index 038a1e13b..f4a336074 100644 --- a/src/api/types/DeleteInvoiceResponse.ts +++ b/src/api/types/DeleteInvoiceResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Describes a `DeleteInvoice` response. diff --git a/src/api/types/DeleteLocationCustomAttributeDefinitionResponse.ts b/src/api/types/DeleteLocationCustomAttributeDefinitionResponse.ts index 0c36b6add..35143f1d1 100644 --- a/src/api/types/DeleteLocationCustomAttributeDefinitionResponse.ts +++ b/src/api/types/DeleteLocationCustomAttributeDefinitionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response from a delete request containing error messages if there are any. diff --git a/src/api/types/DeleteLocationCustomAttributeResponse.ts b/src/api/types/DeleteLocationCustomAttributeResponse.ts index 671800c4a..e5f09f379 100644 --- a/src/api/types/DeleteLocationCustomAttributeResponse.ts +++ b/src/api/types/DeleteLocationCustomAttributeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [DeleteLocationCustomAttribute](api-endpoint:LocationCustomAttributes-DeleteLocationCustomAttribute) response. diff --git a/src/api/types/DeleteLoyaltyRewardResponse.ts b/src/api/types/DeleteLoyaltyRewardResponse.ts index ddcea62dd..f53e6ca05 100644 --- a/src/api/types/DeleteLoyaltyRewardResponse.ts +++ b/src/api/types/DeleteLoyaltyRewardResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response returned by the API call. diff --git a/src/api/types/DeleteMerchantCustomAttributeDefinitionResponse.ts b/src/api/types/DeleteMerchantCustomAttributeDefinitionResponse.ts index a0a94eee8..76deacfa0 100644 --- a/src/api/types/DeleteMerchantCustomAttributeDefinitionResponse.ts +++ b/src/api/types/DeleteMerchantCustomAttributeDefinitionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response from a delete request containing error messages if there are any. diff --git a/src/api/types/DeleteMerchantCustomAttributeResponse.ts b/src/api/types/DeleteMerchantCustomAttributeResponse.ts index 0a844d8f2..d878ba548 100644 --- a/src/api/types/DeleteMerchantCustomAttributeResponse.ts +++ b/src/api/types/DeleteMerchantCustomAttributeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [DeleteMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-DeleteMerchantCustomAttribute) response. diff --git a/src/api/types/DeleteOrderCustomAttributeDefinitionResponse.ts b/src/api/types/DeleteOrderCustomAttributeDefinitionResponse.ts index c13ff7c6a..7f1d85972 100644 --- a/src/api/types/DeleteOrderCustomAttributeDefinitionResponse.ts +++ b/src/api/types/DeleteOrderCustomAttributeDefinitionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response from deleting an order custom attribute definition. diff --git a/src/api/types/DeleteOrderCustomAttributeResponse.ts b/src/api/types/DeleteOrderCustomAttributeResponse.ts index 28ba985fb..2f1d498b6 100644 --- a/src/api/types/DeleteOrderCustomAttributeResponse.ts +++ b/src/api/types/DeleteOrderCustomAttributeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response from deleting an order custom attribute. diff --git a/src/api/types/DeletePaymentLinkResponse.ts b/src/api/types/DeletePaymentLinkResponse.ts index 59d46a8b3..6aef5e3e4 100644 --- a/src/api/types/DeletePaymentLinkResponse.ts +++ b/src/api/types/DeletePaymentLinkResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DeletePaymentLinkResponse { errors?: Square.Error_[]; diff --git a/src/api/types/DeleteShiftResponse.ts b/src/api/types/DeleteShiftResponse.ts index 806e58fca..8c7b76899 100644 --- a/src/api/types/DeleteShiftResponse.ts +++ b/src/api/types/DeleteShiftResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response to a request to delete a `Shift`. The response might contain a set of diff --git a/src/api/types/DeleteSnippetResponse.ts b/src/api/types/DeleteSnippetResponse.ts index e80b6b261..2a768b803 100644 --- a/src/api/types/DeleteSnippetResponse.ts +++ b/src/api/types/DeleteSnippetResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a `DeleteSnippet` response. diff --git a/src/api/types/DeleteSubscriptionActionResponse.ts b/src/api/types/DeleteSubscriptionActionResponse.ts index cfe759bf1..5adb33949 100644 --- a/src/api/types/DeleteSubscriptionActionResponse.ts +++ b/src/api/types/DeleteSubscriptionActionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines output parameters in a response of the [DeleteSubscriptionAction](api-endpoint:Subscriptions-DeleteSubscriptionAction) diff --git a/src/api/types/DeleteTimecardResponse.ts b/src/api/types/DeleteTimecardResponse.ts index 3dbbac027..6f2ff565b 100644 --- a/src/api/types/DeleteTimecardResponse.ts +++ b/src/api/types/DeleteTimecardResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response to a request to delete a `Timecard`. The response might contain a set of diff --git a/src/api/types/DeleteTransferOrderResponse.ts b/src/api/types/DeleteTransferOrderResponse.ts deleted file mode 100644 index 8a3323659..000000000 --- a/src/api/types/DeleteTransferOrderResponse.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -/** - * Response for deleting a transfer order - */ -export interface DeleteTransferOrderResponse { - /** Any errors that occurred during the request */ - errors?: Square.Error_[]; -} diff --git a/src/api/types/DeleteWebhookSubscriptionResponse.ts b/src/api/types/DeleteWebhookSubscriptionResponse.ts index 14d80ffaf..5fd49d18f 100644 --- a/src/api/types/DeleteWebhookSubscriptionResponse.ts +++ b/src/api/types/DeleteWebhookSubscriptionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/Destination.ts b/src/api/types/Destination.ts index 3495cc679..c677acd36 100644 --- a/src/api/types/Destination.ts +++ b/src/api/types/Destination.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Information about the destination against which the payout was made. diff --git a/src/api/types/DestinationDetails.ts b/src/api/types/DestinationDetails.ts index c9201f083..5cdc3ccc7 100644 --- a/src/api/types/DestinationDetails.ts +++ b/src/api/types/DestinationDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Details about a refund's destination. diff --git a/src/api/types/DestinationDetailsCardRefundDetails.ts b/src/api/types/DestinationDetailsCardRefundDetails.ts index 70d402139..dbeddd7e1 100644 --- a/src/api/types/DestinationDetailsCardRefundDetails.ts +++ b/src/api/types/DestinationDetailsCardRefundDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DestinationDetailsCardRefundDetails { /** The card's non-confidential details. */ diff --git a/src/api/types/DestinationDetailsCashRefundDetails.ts b/src/api/types/DestinationDetailsCashRefundDetails.ts index 12b1aa1b5..c88e91e58 100644 --- a/src/api/types/DestinationDetailsCashRefundDetails.ts +++ b/src/api/types/DestinationDetailsCashRefundDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Stores details about a cash refund. Contains only non-confidential information. diff --git a/src/api/types/DestinationDetailsExternalRefundDetails.ts b/src/api/types/DestinationDetailsExternalRefundDetails.ts index ea8a8fce5..1ebbbb2a8 100644 --- a/src/api/types/DestinationDetailsExternalRefundDetails.ts +++ b/src/api/types/DestinationDetailsExternalRefundDetails.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Stores details about an external refund. Contains only non-confidential information. diff --git a/src/api/types/DestinationType.ts b/src/api/types/DestinationType.ts index 53d37f9b3..6864671ab 100644 --- a/src/api/types/DestinationType.ts +++ b/src/api/types/DestinationType.ts @@ -1,10 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** List of possible destinations against which a payout can be made. */ +/** + * List of possible destinations against which a payout can be made. + */ +export type DestinationType = "BANK_ACCOUNT" | "CARD" | "SQUARE_BALANCE" | "SQUARE_STORED_BALANCE"; export const DestinationType = { BankAccount: "BANK_ACCOUNT", Card: "CARD", SquareBalance: "SQUARE_BALANCE", SquareStoredBalance: "SQUARE_STORED_BALANCE", } as const; -export type DestinationType = (typeof DestinationType)[keyof typeof DestinationType]; diff --git a/src/api/types/Device.ts b/src/api/types/Device.ts index 5247a94f3..45d8ea2e0 100644 --- a/src/api/types/Device.ts +++ b/src/api/types/Device.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface Device { /** diff --git a/src/api/types/DeviceAttributes.ts b/src/api/types/DeviceAttributes.ts index 36fd6255a..8c76e3e37 100644 --- a/src/api/types/DeviceAttributes.ts +++ b/src/api/types/DeviceAttributes.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DeviceAttributes { /** diff --git a/src/api/types/DeviceAttributesDeviceType.ts b/src/api/types/DeviceAttributesDeviceType.ts index db7bbe91d..809a96fcb 100644 --- a/src/api/types/DeviceAttributesDeviceType.ts +++ b/src/api/types/DeviceAttributesDeviceType.ts @@ -1,8 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** An enum identifier of the device type. */ -export const DeviceAttributesDeviceType = { - Terminal: "TERMINAL", - Handheld: "HANDHELD", -} as const; -export type DeviceAttributesDeviceType = (typeof DeviceAttributesDeviceType)[keyof typeof DeviceAttributesDeviceType]; +/** + * An enum identifier of the device type. + */ +export type DeviceAttributesDeviceType = "TERMINAL"; diff --git a/src/api/types/DeviceCheckoutOptions.ts b/src/api/types/DeviceCheckoutOptions.ts index b8c03f2b3..98d96f543 100644 --- a/src/api/types/DeviceCheckoutOptions.ts +++ b/src/api/types/DeviceCheckoutOptions.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DeviceCheckoutOptions { /** diff --git a/src/api/types/DeviceCode.ts b/src/api/types/DeviceCode.ts index 6e5120d4d..e762c9166 100644 --- a/src/api/types/DeviceCode.ts +++ b/src/api/types/DeviceCode.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DeviceCode { /** The unique id for this device code. */ diff --git a/src/api/types/DeviceCodePairedEvent.ts b/src/api/types/DeviceCodePairedEvent.ts index 261969718..df8d3398d 100644 --- a/src/api/types/DeviceCodePairedEvent.ts +++ b/src/api/types/DeviceCodePairedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a Square Terminal has been paired with a diff --git a/src/api/types/DeviceCodePairedEventData.ts b/src/api/types/DeviceCodePairedEventData.ts index e9efa7568..a310beca5 100644 --- a/src/api/types/DeviceCodePairedEventData.ts +++ b/src/api/types/DeviceCodePairedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DeviceCodePairedEventData { /** Name of the paired object’s type, `"device_code"`. */ diff --git a/src/api/types/DeviceCodePairedEventObject.ts b/src/api/types/DeviceCodePairedEventObject.ts index 0f913377c..e634cc245 100644 --- a/src/api/types/DeviceCodePairedEventObject.ts +++ b/src/api/types/DeviceCodePairedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DeviceCodePairedEventObject { /** The created terminal checkout */ diff --git a/src/api/types/DeviceCodeStatus.ts b/src/api/types/DeviceCodeStatus.ts index 407b8b512..f1c62347d 100644 --- a/src/api/types/DeviceCodeStatus.ts +++ b/src/api/types/DeviceCodeStatus.ts @@ -1,10 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** DeviceCode.Status enum. */ +/** + * DeviceCode.Status enum. + */ +export type DeviceCodeStatus = "UNKNOWN" | "UNPAIRED" | "PAIRED" | "EXPIRED"; export const DeviceCodeStatus = { Unknown: "UNKNOWN", Unpaired: "UNPAIRED", Paired: "PAIRED", Expired: "EXPIRED", } as const; -export type DeviceCodeStatus = (typeof DeviceCodeStatus)[keyof typeof DeviceCodeStatus]; diff --git a/src/api/types/DeviceComponentDetailsApplicationDetails.ts b/src/api/types/DeviceComponentDetailsApplicationDetails.ts index 9d1b309dd..f514f19aa 100644 --- a/src/api/types/DeviceComponentDetailsApplicationDetails.ts +++ b/src/api/types/DeviceComponentDetailsApplicationDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DeviceComponentDetailsApplicationDetails { /** diff --git a/src/api/types/DeviceComponentDetailsBatteryDetails.ts b/src/api/types/DeviceComponentDetailsBatteryDetails.ts index 2ea89df08..3484279ff 100644 --- a/src/api/types/DeviceComponentDetailsBatteryDetails.ts +++ b/src/api/types/DeviceComponentDetailsBatteryDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DeviceComponentDetailsBatteryDetails { /** The battery charge percentage as displayed on the device. */ diff --git a/src/api/types/DeviceComponentDetailsCardReaderDetails.ts b/src/api/types/DeviceComponentDetailsCardReaderDetails.ts index 30acdae10..73be61ee8 100644 --- a/src/api/types/DeviceComponentDetailsCardReaderDetails.ts +++ b/src/api/types/DeviceComponentDetailsCardReaderDetails.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface DeviceComponentDetailsCardReaderDetails { /** The version of the card reader. */ diff --git a/src/api/types/DeviceComponentDetailsEthernetDetails.ts b/src/api/types/DeviceComponentDetailsEthernetDetails.ts index 8522cc5d7..80069b55e 100644 --- a/src/api/types/DeviceComponentDetailsEthernetDetails.ts +++ b/src/api/types/DeviceComponentDetailsEthernetDetails.ts @@ -1,10 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface DeviceComponentDetailsEthernetDetails { /** A boolean to represent whether the Ethernet interface is currently active. */ active?: boolean | null; /** The string representation of the device’s IPv4 address. */ ipAddressV4?: string | null; - /** The mac address of the device in this network. */ - macAddress?: string | null; } diff --git a/src/api/types/DeviceComponentDetailsExternalPower.ts b/src/api/types/DeviceComponentDetailsExternalPower.ts index 1d49951e2..360a472b6 100644 --- a/src/api/types/DeviceComponentDetailsExternalPower.ts +++ b/src/api/types/DeviceComponentDetailsExternalPower.ts @@ -1,11 +1,18 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** An enum for ExternalPower. */ +/** + * An enum for ExternalPower. + */ +export type DeviceComponentDetailsExternalPower = + | "AVAILABLE_CHARGING" + | "AVAILABLE_NOT_IN_USE" + | "UNAVAILABLE" + | "AVAILABLE_INSUFFICIENT"; export const DeviceComponentDetailsExternalPower = { AvailableCharging: "AVAILABLE_CHARGING", AvailableNotInUse: "AVAILABLE_NOT_IN_USE", Unavailable: "UNAVAILABLE", AvailableInsufficient: "AVAILABLE_INSUFFICIENT", } as const; -export type DeviceComponentDetailsExternalPower = - (typeof DeviceComponentDetailsExternalPower)[keyof typeof DeviceComponentDetailsExternalPower]; diff --git a/src/api/types/DeviceComponentDetailsMeasurement.ts b/src/api/types/DeviceComponentDetailsMeasurement.ts index cb59b792a..d2121e43f 100644 --- a/src/api/types/DeviceComponentDetailsMeasurement.ts +++ b/src/api/types/DeviceComponentDetailsMeasurement.ts @@ -1,9 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * A value qualified by unit of measure. */ export interface DeviceComponentDetailsMeasurement { - /** Value of measure. */ value?: number | null; } diff --git a/src/api/types/DeviceComponentDetailsWiFiDetails.ts b/src/api/types/DeviceComponentDetailsWiFiDetails.ts index faef70f73..a4305877f 100644 --- a/src/api/types/DeviceComponentDetailsWiFiDetails.ts +++ b/src/api/types/DeviceComponentDetailsWiFiDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DeviceComponentDetailsWiFiDetails { /** A boolean to represent whether the WiFI interface is currently active. */ @@ -16,6 +18,4 @@ export interface DeviceComponentDetailsWiFiDetails { secureConnection?: string | null; /** A representation of signal strength of the WIFI network connection. */ signalStrength?: Square.DeviceComponentDetailsMeasurement; - /** The mac address of the device in this network. */ - macAddress?: string | null; } diff --git a/src/api/types/DeviceCreatedEvent.ts b/src/api/types/DeviceCreatedEvent.ts index 5d36b9e86..c84998fe9 100644 --- a/src/api/types/DeviceCreatedEvent.ts +++ b/src/api/types/DeviceCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a Device is created. diff --git a/src/api/types/DeviceCreatedEventData.ts b/src/api/types/DeviceCreatedEventData.ts index f09071a7a..e28b29517 100644 --- a/src/api/types/DeviceCreatedEventData.ts +++ b/src/api/types/DeviceCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DeviceCreatedEventData { /** The type of the event data object. The value is `"device"`. */ diff --git a/src/api/types/DeviceCreatedEventObject.ts b/src/api/types/DeviceCreatedEventObject.ts index 63ca5e136..849560516 100644 --- a/src/api/types/DeviceCreatedEventObject.ts +++ b/src/api/types/DeviceCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DeviceCreatedEventObject { /** The created device. */ diff --git a/src/api/types/DeviceDetails.ts b/src/api/types/DeviceDetails.ts index 0eb7722c5..a2b401bd9 100644 --- a/src/api/types/DeviceDetails.ts +++ b/src/api/types/DeviceDetails.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Details about the device that took the payment. diff --git a/src/api/types/DeviceMetadata.ts b/src/api/types/DeviceMetadata.ts index 06071d729..407c6ecc6 100644 --- a/src/api/types/DeviceMetadata.ts +++ b/src/api/types/DeviceMetadata.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface DeviceMetadata { /** The Terminal’s remaining battery percentage, between 1-100. */ diff --git a/src/api/types/DeviceStatus.ts b/src/api/types/DeviceStatus.ts index 310c81ad3..25843c08c 100644 --- a/src/api/types/DeviceStatus.ts +++ b/src/api/types/DeviceStatus.ts @@ -1,10 +1,11 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DeviceStatus { /** - * Category of the device status. * See [Category](#type-category) for possible values */ category?: Square.DeviceStatusCategory; diff --git a/src/api/types/DeviceStatusCategory.ts b/src/api/types/DeviceStatusCategory.ts index 55f72cea0..cb580c647 100644 --- a/src/api/types/DeviceStatusCategory.ts +++ b/src/api/types/DeviceStatusCategory.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type DeviceStatusCategory = "AVAILABLE" | "NEEDS_ATTENTION" | "OFFLINE"; export const DeviceStatusCategory = { Available: "AVAILABLE", NeedsAttention: "NEEDS_ATTENTION", Offline: "OFFLINE", } as const; -export type DeviceStatusCategory = (typeof DeviceStatusCategory)[keyof typeof DeviceStatusCategory]; diff --git a/src/api/types/DigitalWalletDetails.ts b/src/api/types/DigitalWalletDetails.ts index 0f517c33e..d64610a55 100644 --- a/src/api/types/DigitalWalletDetails.ts +++ b/src/api/types/DigitalWalletDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Additional details about `WALLET` type payments. Contains only non-confidential information. diff --git a/src/api/types/DisableCardResponse.ts b/src/api/types/DisableCardResponse.ts index 92ae51d46..9b9a103db 100644 --- a/src/api/types/DisableCardResponse.ts +++ b/src/api/types/DisableCardResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/DisableEventsResponse.ts b/src/api/types/DisableEventsResponse.ts index 28a8dcb53..070f3298f 100644 --- a/src/api/types/DisableEventsResponse.ts +++ b/src/api/types/DisableEventsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/DismissTerminalActionResponse.ts b/src/api/types/DismissTerminalActionResponse.ts index 374d79226..2eb4d847e 100644 --- a/src/api/types/DismissTerminalActionResponse.ts +++ b/src/api/types/DismissTerminalActionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DismissTerminalActionResponse { /** Information on errors encountered during the request. */ diff --git a/src/api/types/DismissTerminalCheckoutResponse.ts b/src/api/types/DismissTerminalCheckoutResponse.ts index f33ef6b93..1cf11b8b8 100644 --- a/src/api/types/DismissTerminalCheckoutResponse.ts +++ b/src/api/types/DismissTerminalCheckoutResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DismissTerminalCheckoutResponse { /** Information on errors encountered during the request. */ diff --git a/src/api/types/DismissTerminalRefundResponse.ts b/src/api/types/DismissTerminalRefundResponse.ts index aefd26b6d..e79e0f94b 100644 --- a/src/api/types/DismissTerminalRefundResponse.ts +++ b/src/api/types/DismissTerminalRefundResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DismissTerminalRefundResponse { /** Information on errors encountered during the request. */ diff --git a/src/api/types/Dispute.ts b/src/api/types/Dispute.ts index fc3dbc951..ad6f9f8f9 100644 --- a/src/api/types/Dispute.ts +++ b/src/api/types/Dispute.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [dispute](https://developer.squareup.com/docs/disputes-api/overview) a cardholder initiated with their bank. diff --git a/src/api/types/DisputeCreatedEvent.ts b/src/api/types/DisputeCreatedEvent.ts index b979dc294..b9e946c8f 100644 --- a/src/api/types/DisputeCreatedEvent.ts +++ b/src/api/types/DisputeCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [Dispute](entity:Dispute) is created. diff --git a/src/api/types/DisputeCreatedEventData.ts b/src/api/types/DisputeCreatedEventData.ts index 71a3da78e..e6f6bf112 100644 --- a/src/api/types/DisputeCreatedEventData.ts +++ b/src/api/types/DisputeCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DisputeCreatedEventData { /** Name of the affected dispute's type. */ diff --git a/src/api/types/DisputeCreatedEventObject.ts b/src/api/types/DisputeCreatedEventObject.ts index e026522eb..1c12a8303 100644 --- a/src/api/types/DisputeCreatedEventObject.ts +++ b/src/api/types/DisputeCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DisputeCreatedEventObject { /** The dispute object. */ diff --git a/src/api/types/DisputeEvidence.ts b/src/api/types/DisputeEvidence.ts index d3111ab90..958a24acb 100644 --- a/src/api/types/DisputeEvidence.ts +++ b/src/api/types/DisputeEvidence.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DisputeEvidence { /** The Square-generated ID of the evidence. */ diff --git a/src/api/types/DisputeEvidenceAddedEvent.ts b/src/api/types/DisputeEvidenceAddedEvent.ts index e451dc333..895c5c6b4 100644 --- a/src/api/types/DisputeEvidenceAddedEvent.ts +++ b/src/api/types/DisputeEvidenceAddedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when evidence is added to a [Dispute](entity:Dispute) diff --git a/src/api/types/DisputeEvidenceAddedEventData.ts b/src/api/types/DisputeEvidenceAddedEventData.ts index 25535d6fd..5f6b1fe5d 100644 --- a/src/api/types/DisputeEvidenceAddedEventData.ts +++ b/src/api/types/DisputeEvidenceAddedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DisputeEvidenceAddedEventData { /** Name of the affected dispute's type. */ diff --git a/src/api/types/DisputeEvidenceAddedEventObject.ts b/src/api/types/DisputeEvidenceAddedEventObject.ts index 91774e1e6..08116c916 100644 --- a/src/api/types/DisputeEvidenceAddedEventObject.ts +++ b/src/api/types/DisputeEvidenceAddedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DisputeEvidenceAddedEventObject { /** The dispute object. */ diff --git a/src/api/types/DisputeEvidenceCreatedEvent.ts b/src/api/types/DisputeEvidenceCreatedEvent.ts index 8cc5ff473..7f08581f3 100644 --- a/src/api/types/DisputeEvidenceCreatedEvent.ts +++ b/src/api/types/DisputeEvidenceCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when evidence is added to a [Dispute](entity:Dispute) diff --git a/src/api/types/DisputeEvidenceCreatedEventData.ts b/src/api/types/DisputeEvidenceCreatedEventData.ts index 57cbc46b0..bad96233d 100644 --- a/src/api/types/DisputeEvidenceCreatedEventData.ts +++ b/src/api/types/DisputeEvidenceCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DisputeEvidenceCreatedEventData { /** Name of the affected dispute's type. */ diff --git a/src/api/types/DisputeEvidenceCreatedEventObject.ts b/src/api/types/DisputeEvidenceCreatedEventObject.ts index a43571d99..0255378b7 100644 --- a/src/api/types/DisputeEvidenceCreatedEventObject.ts +++ b/src/api/types/DisputeEvidenceCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DisputeEvidenceCreatedEventObject { /** The dispute object. */ diff --git a/src/api/types/DisputeEvidenceDeletedEvent.ts b/src/api/types/DisputeEvidenceDeletedEvent.ts index 4939b3d58..3c178b634 100644 --- a/src/api/types/DisputeEvidenceDeletedEvent.ts +++ b/src/api/types/DisputeEvidenceDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when evidence is removed from a [Dispute](entity:Dispute) diff --git a/src/api/types/DisputeEvidenceDeletedEventData.ts b/src/api/types/DisputeEvidenceDeletedEventData.ts index 4889d6d85..d81b1aabf 100644 --- a/src/api/types/DisputeEvidenceDeletedEventData.ts +++ b/src/api/types/DisputeEvidenceDeletedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DisputeEvidenceDeletedEventData { /** Name of the affected dispute's type. */ diff --git a/src/api/types/DisputeEvidenceDeletedEventObject.ts b/src/api/types/DisputeEvidenceDeletedEventObject.ts index e570bdae5..c6c07882e 100644 --- a/src/api/types/DisputeEvidenceDeletedEventObject.ts +++ b/src/api/types/DisputeEvidenceDeletedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DisputeEvidenceDeletedEventObject { /** The dispute object. */ diff --git a/src/api/types/DisputeEvidenceFile.ts b/src/api/types/DisputeEvidenceFile.ts index b9cff7d30..44c30dd16 100644 --- a/src/api/types/DisputeEvidenceFile.ts +++ b/src/api/types/DisputeEvidenceFile.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * A file to be uploaded as dispute evidence. diff --git a/src/api/types/DisputeEvidenceRemovedEvent.ts b/src/api/types/DisputeEvidenceRemovedEvent.ts index 373f94373..d4e31851b 100644 --- a/src/api/types/DisputeEvidenceRemovedEvent.ts +++ b/src/api/types/DisputeEvidenceRemovedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when evidence is removed from a [Dispute](entity:Dispute) diff --git a/src/api/types/DisputeEvidenceRemovedEventData.ts b/src/api/types/DisputeEvidenceRemovedEventData.ts index a4f88c0ac..fdbad3646 100644 --- a/src/api/types/DisputeEvidenceRemovedEventData.ts +++ b/src/api/types/DisputeEvidenceRemovedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DisputeEvidenceRemovedEventData { /** Name of the affected dispute's type. */ diff --git a/src/api/types/DisputeEvidenceRemovedEventObject.ts b/src/api/types/DisputeEvidenceRemovedEventObject.ts index 981fa5ad2..4ad892935 100644 --- a/src/api/types/DisputeEvidenceRemovedEventObject.ts +++ b/src/api/types/DisputeEvidenceRemovedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DisputeEvidenceRemovedEventObject { /** The dispute object. */ diff --git a/src/api/types/DisputeEvidenceType.ts b/src/api/types/DisputeEvidenceType.ts index 4d49da566..a1952d50e 100644 --- a/src/api/types/DisputeEvidenceType.ts +++ b/src/api/types/DisputeEvidenceType.ts @@ -1,6 +1,26 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The type of the dispute evidence. */ +/** + * The type of the dispute evidence. + */ +export type DisputeEvidenceType = + | "GENERIC_EVIDENCE" + | "ONLINE_OR_APP_ACCESS_LOG" + | "AUTHORIZATION_DOCUMENTATION" + | "CANCELLATION_OR_REFUND_DOCUMENTATION" + | "CARDHOLDER_COMMUNICATION" + | "CARDHOLDER_INFORMATION" + | "PURCHASE_ACKNOWLEDGEMENT" + | "DUPLICATE_CHARGE_DOCUMENTATION" + | "PRODUCT_OR_SERVICE_DESCRIPTION" + | "RECEIPT" + | "SERVICE_RECEIVED_DOCUMENTATION" + | "PROOF_OF_DELIVERY_DOCUMENTATION" + | "RELATED_TRANSACTION_DOCUMENTATION" + | "REBUTTAL_EXPLANATION" + | "TRACKING_NUMBER"; export const DisputeEvidenceType = { GenericEvidence: "GENERIC_EVIDENCE", OnlineOrAppAccessLog: "ONLINE_OR_APP_ACCESS_LOG", @@ -18,4 +38,3 @@ export const DisputeEvidenceType = { RebuttalExplanation: "REBUTTAL_EXPLANATION", TrackingNumber: "TRACKING_NUMBER", } as const; -export type DisputeEvidenceType = (typeof DisputeEvidenceType)[keyof typeof DisputeEvidenceType]; diff --git a/src/api/types/DisputeReason.ts b/src/api/types/DisputeReason.ts index 9393feca5..a2f57806c 100644 --- a/src/api/types/DisputeReason.ts +++ b/src/api/types/DisputeReason.ts @@ -1,9 +1,21 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The list of possible reasons why a cardholder might initiate a * dispute with their bank. */ +export type DisputeReason = + | "AMOUNT_DIFFERS" + | "CANCELLED" + | "DUPLICATE" + | "NO_KNOWLEDGE" + | "NOT_AS_DESCRIBED" + | "NOT_RECEIVED" + | "PAID_BY_OTHER_MEANS" + | "CUSTOMER_REQUESTS_CREDIT" + | "EMV_LIABILITY_SHIFT"; export const DisputeReason = { AmountDiffers: "AMOUNT_DIFFERS", Cancelled: "CANCELLED", @@ -15,4 +27,3 @@ export const DisputeReason = { CustomerRequestsCredit: "CUSTOMER_REQUESTS_CREDIT", EmvLiabilityShift: "EMV_LIABILITY_SHIFT", } as const; -export type DisputeReason = (typeof DisputeReason)[keyof typeof DisputeReason]; diff --git a/src/api/types/DisputeState.ts b/src/api/types/DisputeState.ts index 70ca34de3..bb425f605 100644 --- a/src/api/types/DisputeState.ts +++ b/src/api/types/DisputeState.ts @@ -1,6 +1,19 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The list of possible dispute states. */ +/** + * The list of possible dispute states. + */ +export type DisputeState = + | "INQUIRY_EVIDENCE_REQUIRED" + | "INQUIRY_PROCESSING" + | "INQUIRY_CLOSED" + | "EVIDENCE_REQUIRED" + | "PROCESSING" + | "WON" + | "LOST" + | "ACCEPTED"; export const DisputeState = { InquiryEvidenceRequired: "INQUIRY_EVIDENCE_REQUIRED", InquiryProcessing: "INQUIRY_PROCESSING", @@ -11,4 +24,3 @@ export const DisputeState = { Lost: "LOST", Accepted: "ACCEPTED", } as const; -export type DisputeState = (typeof DisputeState)[keyof typeof DisputeState]; diff --git a/src/api/types/DisputeStateChangedEvent.ts b/src/api/types/DisputeStateChangedEvent.ts index 93b43a918..ed1a0b03b 100644 --- a/src/api/types/DisputeStateChangedEvent.ts +++ b/src/api/types/DisputeStateChangedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when the state of a [Dispute](entity:Dispute) changes. diff --git a/src/api/types/DisputeStateChangedEventData.ts b/src/api/types/DisputeStateChangedEventData.ts index 71eb22546..dde8e9f45 100644 --- a/src/api/types/DisputeStateChangedEventData.ts +++ b/src/api/types/DisputeStateChangedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DisputeStateChangedEventData { /** Name of the affected dispute's type. */ diff --git a/src/api/types/DisputeStateChangedEventObject.ts b/src/api/types/DisputeStateChangedEventObject.ts index 33f75e098..9166ecb26 100644 --- a/src/api/types/DisputeStateChangedEventObject.ts +++ b/src/api/types/DisputeStateChangedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DisputeStateChangedEventObject { /** The dispute object. */ diff --git a/src/api/types/DisputeStateUpdatedEvent.ts b/src/api/types/DisputeStateUpdatedEvent.ts index 65604b864..2182af2cf 100644 --- a/src/api/types/DisputeStateUpdatedEvent.ts +++ b/src/api/types/DisputeStateUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when the state of a [Dispute](entity:Dispute) changes. diff --git a/src/api/types/DisputeStateUpdatedEventData.ts b/src/api/types/DisputeStateUpdatedEventData.ts index 88c1451bb..981082463 100644 --- a/src/api/types/DisputeStateUpdatedEventData.ts +++ b/src/api/types/DisputeStateUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DisputeStateUpdatedEventData { /** Name of the affected dispute's type. */ diff --git a/src/api/types/DisputeStateUpdatedEventObject.ts b/src/api/types/DisputeStateUpdatedEventObject.ts index 43eb52fc1..12aa43443 100644 --- a/src/api/types/DisputeStateUpdatedEventObject.ts +++ b/src/api/types/DisputeStateUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface DisputeStateUpdatedEventObject { /** The dispute object. */ diff --git a/src/api/types/DisputedPayment.ts b/src/api/types/DisputedPayment.ts index 5a3f4f8a6..3a0c7158e 100644 --- a/src/api/types/DisputedPayment.ts +++ b/src/api/types/DisputedPayment.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The payment the cardholder disputed. diff --git a/src/api/types/EcomVisibility.ts b/src/api/types/EcomVisibility.ts index 492d903e7..aeeec9a94 100644 --- a/src/api/types/EcomVisibility.ts +++ b/src/api/types/EcomVisibility.ts @@ -1,10 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Determines item visibility in Ecom (Online Store) and Online Checkout. */ +/** + * Determines item visibility in Ecom (Online Store) and Online Checkout. + */ +export type EcomVisibility = "UNINDEXED" | "UNAVAILABLE" | "HIDDEN" | "VISIBLE"; export const EcomVisibility = { Unindexed: "UNINDEXED", Unavailable: "UNAVAILABLE", Hidden: "HIDDEN", Visible: "VISIBLE", } as const; -export type EcomVisibility = (typeof EcomVisibility)[keyof typeof EcomVisibility]; diff --git a/src/api/types/Employee.ts b/src/api/types/Employee.ts index 999c26b7b..e8ae75817 100644 --- a/src/api/types/Employee.ts +++ b/src/api/types/Employee.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * An employee object that is used by the external API. diff --git a/src/api/types/EmployeeStatus.ts b/src/api/types/EmployeeStatus.ts index 706db862d..3a9d7592f 100644 --- a/src/api/types/EmployeeStatus.ts +++ b/src/api/types/EmployeeStatus.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The status of the Employee being retrieved. * * DEPRECATED at version 2020-08-26. Replaced by [TeamMemberStatus](entity:TeamMemberStatus). */ +export type EmployeeStatus = "ACTIVE" | "INACTIVE"; export const EmployeeStatus = { Active: "ACTIVE", Inactive: "INACTIVE", } as const; -export type EmployeeStatus = (typeof EmployeeStatus)[keyof typeof EmployeeStatus]; diff --git a/src/api/types/EmployeeWage.ts b/src/api/types/EmployeeWage.ts index b8dd659d0..ef2a5948e 100644 --- a/src/api/types/EmployeeWage.ts +++ b/src/api/types/EmployeeWage.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The hourly wage rate that an employee earns on a `Shift` for doing the job specified by the `title` property of this object. Deprecated at version 2020-08-26. Use [TeamMemberWage](entity:TeamMemberWage). diff --git a/src/api/types/EnableEventsResponse.ts b/src/api/types/EnableEventsResponse.ts index 62308d441..28a57e147 100644 --- a/src/api/types/EnableEventsResponse.ts +++ b/src/api/types/EnableEventsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/ErrorCategory.ts b/src/api/types/ErrorCategory.ts index f859b9573..90766ec56 100644 --- a/src/api/types/ErrorCategory.ts +++ b/src/api/types/ErrorCategory.ts @@ -1,9 +1,20 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Indicates which high-level category of error has occurred during a * request to the Connect API. */ +export type ErrorCategory = + | "API_ERROR" + | "AUTHENTICATION_ERROR" + | "INVALID_REQUEST_ERROR" + | "RATE_LIMIT_ERROR" + | "PAYMENT_METHOD_ERROR" + | "REFUND_ERROR" + | "MERCHANT_SUBSCRIPTION_ERROR" + | "EXTERNAL_VENDOR_ERROR"; export const ErrorCategory = { ApiError: "API_ERROR", AuthenticationError: "AUTHENTICATION_ERROR", @@ -14,4 +25,3 @@ export const ErrorCategory = { MerchantSubscriptionError: "MERCHANT_SUBSCRIPTION_ERROR", ExternalVendorError: "EXTERNAL_VENDOR_ERROR", } as const; -export type ErrorCategory = (typeof ErrorCategory)[keyof typeof ErrorCategory]; diff --git a/src/api/types/ErrorCode.ts b/src/api/types/ErrorCode.ts index b0064d470..6f14b0c24 100644 --- a/src/api/types/ErrorCode.ts +++ b/src/api/types/ErrorCode.ts @@ -1,9 +1,165 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Indicates the specific error that occurred during a request to a * Square API. */ +export type ErrorCode = + | "INTERNAL_SERVER_ERROR" + | "UNAUTHORIZED" + | "ACCESS_TOKEN_EXPIRED" + | "ACCESS_TOKEN_REVOKED" + | "CLIENT_DISABLED" + | "FORBIDDEN" + | "INSUFFICIENT_SCOPES" + | "APPLICATION_DISABLED" + | "V1_APPLICATION" + | "V1_ACCESS_TOKEN" + | "CARD_PROCESSING_NOT_ENABLED" + | "MERCHANT_SUBSCRIPTION_NOT_FOUND" + | "BAD_REQUEST" + | "MISSING_REQUIRED_PARAMETER" + | "INCORRECT_TYPE" + | "INVALID_TIME" + | "INVALID_TIME_RANGE" + | "INVALID_VALUE" + | "INVALID_CURSOR" + | "UNKNOWN_QUERY_PARAMETER" + | "CONFLICTING_PARAMETERS" + | "EXPECTED_JSON_BODY" + | "INVALID_SORT_ORDER" + | "VALUE_REGEX_MISMATCH" + | "VALUE_TOO_SHORT" + | "VALUE_TOO_LONG" + | "VALUE_TOO_LOW" + | "VALUE_TOO_HIGH" + | "VALUE_EMPTY" + | "ARRAY_LENGTH_TOO_LONG" + | "ARRAY_LENGTH_TOO_SHORT" + | "ARRAY_EMPTY" + | "EXPECTED_BOOLEAN" + | "EXPECTED_INTEGER" + | "EXPECTED_FLOAT" + | "EXPECTED_STRING" + | "EXPECTED_OBJECT" + | "EXPECTED_ARRAY" + | "EXPECTED_MAP" + | "EXPECTED_BASE64_ENCODED_BYTE_ARRAY" + | "INVALID_ARRAY_VALUE" + | "INVALID_ENUM_VALUE" + | "INVALID_CONTENT_TYPE" + | "INVALID_FORM_VALUE" + | "CUSTOMER_NOT_FOUND" + | "ONE_INSTRUMENT_EXPECTED" + | "NO_FIELDS_SET" + | "TOO_MANY_MAP_ENTRIES" + | "MAP_KEY_LENGTH_TOO_SHORT" + | "MAP_KEY_LENGTH_TOO_LONG" + | "CUSTOMER_MISSING_NAME" + | "CUSTOMER_MISSING_EMAIL" + | "INVALID_PAUSE_LENGTH" + | "INVALID_DATE" + | "UNSUPPORTED_COUNTRY" + | "UNSUPPORTED_CURRENCY" + | "APPLE_TTP_PIN_TOKEN" + | "CARD_EXPIRED" + | "INVALID_EXPIRATION" + | "INVALID_EXPIRATION_YEAR" + | "INVALID_EXPIRATION_DATE" + | "UNSUPPORTED_CARD_BRAND" + | "UNSUPPORTED_ENTRY_METHOD" + | "INVALID_ENCRYPTED_CARD" + | "INVALID_CARD" + | "PAYMENT_AMOUNT_MISMATCH" + | "GENERIC_DECLINE" + | "CVV_FAILURE" + | "ADDRESS_VERIFICATION_FAILURE" + | "INVALID_ACCOUNT" + | "CURRENCY_MISMATCH" + | "INSUFFICIENT_FUNDS" + | "INSUFFICIENT_PERMISSIONS" + | "CARDHOLDER_INSUFFICIENT_PERMISSIONS" + | "INVALID_LOCATION" + | "TRANSACTION_LIMIT" + | "VOICE_FAILURE" + | "PAN_FAILURE" + | "EXPIRATION_FAILURE" + | "CARD_NOT_SUPPORTED" + | "READER_DECLINED" + | "INVALID_PIN" + | "MISSING_PIN" + | "MISSING_ACCOUNT_TYPE" + | "INVALID_POSTAL_CODE" + | "INVALID_FEES" + | "MANUALLY_ENTERED_PAYMENT_NOT_SUPPORTED" + | "PAYMENT_LIMIT_EXCEEDED" + | "GIFT_CARD_AVAILABLE_AMOUNT" + | "ACCOUNT_UNUSABLE" + | "BUYER_REFUSED_PAYMENT" + | "DELAYED_TRANSACTION_EXPIRED" + | "DELAYED_TRANSACTION_CANCELED" + | "DELAYED_TRANSACTION_CAPTURED" + | "DELAYED_TRANSACTION_FAILED" + | "CARD_TOKEN_EXPIRED" + | "CARD_TOKEN_USED" + | "AMOUNT_TOO_HIGH" + | "UNSUPPORTED_INSTRUMENT_TYPE" + | "REFUND_AMOUNT_INVALID" + | "REFUND_ALREADY_PENDING" + | "PAYMENT_NOT_REFUNDABLE" + | "PAYMENT_NOT_REFUNDABLE_DUE_TO_DISPUTE" + | "REFUND_ERROR_PAYMENT_NEEDS_COMPLETION" + | "REFUND_DECLINED" + | "INSUFFICIENT_PERMISSIONS_FOR_REFUND" + | "INVALID_CARD_DATA" + | "SOURCE_USED" + | "SOURCE_EXPIRED" + | "UNSUPPORTED_LOYALTY_REWARD_TIER" + | "LOCATION_MISMATCH" + | "ORDER_UNPAID_NOT_RETURNABLE" + | "IDEMPOTENCY_KEY_REUSED" + | "UNEXPECTED_VALUE" + | "SANDBOX_NOT_SUPPORTED" + | "INVALID_EMAIL_ADDRESS" + | "INVALID_PHONE_NUMBER" + | "CHECKOUT_EXPIRED" + | "BAD_CERTIFICATE" + | "INVALID_SQUARE_VERSION_FORMAT" + | "API_VERSION_INCOMPATIBLE" + | "CARD_PRESENCE_REQUIRED" + | "UNSUPPORTED_SOURCE_TYPE" + | "CARD_MISMATCH" + | "PLAID_ERROR" + | "PLAID_ERROR_ITEM_LOGIN_REQUIRED" + | "PLAID_ERROR_RATE_LIMIT" + | "CARD_DECLINED" + | "VERIFY_CVV_FAILURE" + | "VERIFY_AVS_FAILURE" + | "CARD_DECLINED_CALL_ISSUER" + | "CARD_DECLINED_VERIFICATION_REQUIRED" + | "BAD_EXPIRATION" + | "CHIP_INSERTION_REQUIRED" + | "ALLOWABLE_PIN_TRIES_EXCEEDED" + | "RESERVATION_DECLINED" + | "UNKNOWN_BODY_PARAMETER" + | "NOT_FOUND" + | "APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND" + | "METHOD_NOT_ALLOWED" + | "NOT_ACCEPTABLE" + | "REQUEST_TIMEOUT" + | "CONFLICT" + | "GONE" + | "REQUEST_ENTITY_TOO_LARGE" + | "UNSUPPORTED_MEDIA_TYPE" + | "UNPROCESSABLE_ENTITY" + | "RATE_LIMITED" + | "NOT_IMPLEMENTED" + | "BAD_GATEWAY" + | "SERVICE_UNAVAILABLE" + | "TEMPORARY_ERROR" + | "GATEWAY_TIMEOUT"; export const ErrorCode = { InternalServerError: "INTERNAL_SERVER_ERROR", Unauthorized: "UNAUTHORIZED", @@ -159,4 +315,3 @@ export const ErrorCode = { TemporaryError: "TEMPORARY_ERROR", GatewayTimeout: "GATEWAY_TIMEOUT", } as const; -export type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode]; diff --git a/src/api/types/Error_.ts b/src/api/types/Error_.ts index c982a6701..6efac0309 100644 --- a/src/api/types/Error_.ts +++ b/src/api/types/Error_.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an error encountered during a request to the Connect API. diff --git a/src/api/types/Event.ts b/src/api/types/Event.ts index e28255b07..b3c8135ed 100644 --- a/src/api/types/Event.ts +++ b/src/api/types/Event.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface Event { /** The ID of the target merchant associated with the event. */ diff --git a/src/api/types/EventData.ts b/src/api/types/EventData.ts index 29d98abea..54d750b75 100644 --- a/src/api/types/EventData.ts +++ b/src/api/types/EventData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface EventData { /** The name of the affected object’s type. */ diff --git a/src/api/types/EventMetadata.ts b/src/api/types/EventMetadata.ts index 14df56655..afda8f14d 100644 --- a/src/api/types/EventMetadata.ts +++ b/src/api/types/EventMetadata.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Contains metadata about a particular [Event](entity:Event). diff --git a/src/api/types/EventTypeMetadata.ts b/src/api/types/EventTypeMetadata.ts index 0fa04d63c..ab26d5ea5 100644 --- a/src/api/types/EventTypeMetadata.ts +++ b/src/api/types/EventTypeMetadata.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Contains the metadata of a webhook event type. diff --git a/src/api/types/ExcludeStrategy.ts b/src/api/types/ExcludeStrategy.ts index a8bfa7bb1..6305eb6fa 100644 --- a/src/api/types/ExcludeStrategy.ts +++ b/src/api/types/ExcludeStrategy.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Indicates which products matched by a CatalogPricingRule * will be excluded if the pricing rule uses an exclude set. */ +export type ExcludeStrategy = "LEAST_EXPENSIVE" | "MOST_EXPENSIVE"; export const ExcludeStrategy = { LeastExpensive: "LEAST_EXPENSIVE", MostExpensive: "MOST_EXPENSIVE", } as const; -export type ExcludeStrategy = (typeof ExcludeStrategy)[keyof typeof ExcludeStrategy]; diff --git a/src/api/types/ExternalPaymentDetails.ts b/src/api/types/ExternalPaymentDetails.ts index 76fabb0c4..013cd8786 100644 --- a/src/api/types/ExternalPaymentDetails.ts +++ b/src/api/types/ExternalPaymentDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Stores details about an external payment. Contains only non-confidential information. diff --git a/src/api/types/FilterValue.ts b/src/api/types/FilterValue.ts index 8129af549..2e3e17584 100644 --- a/src/api/types/FilterValue.ts +++ b/src/api/types/FilterValue.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * A filter to select resources based on an exact field value. For any given diff --git a/src/api/types/FloatNumberRange.ts b/src/api/types/FloatNumberRange.ts index 676df55da..8505a494b 100644 --- a/src/api/types/FloatNumberRange.ts +++ b/src/api/types/FloatNumberRange.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Specifies a decimal number range. diff --git a/src/api/types/Fulfillment.ts b/src/api/types/Fulfillment.ts index ba69a5c04..41dfa331b 100644 --- a/src/api/types/Fulfillment.ts +++ b/src/api/types/Fulfillment.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Contains details about how to fulfill this order. diff --git a/src/api/types/FulfillmentDeliveryDetails.ts b/src/api/types/FulfillmentDeliveryDetails.ts index fa73fce19..42b3e3ae3 100644 --- a/src/api/types/FulfillmentDeliveryDetails.ts +++ b/src/api/types/FulfillmentDeliveryDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Describes delivery details of an order fulfillment. diff --git a/src/api/types/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.ts b/src/api/types/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.ts index d9baf4440..e27edc29d 100644 --- a/src/api/types/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.ts +++ b/src/api/types/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.ts @@ -1,9 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The schedule type of the delivery fulfillment. */ +/** + * The schedule type of the delivery fulfillment. + */ +export type FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType = "SCHEDULED" | "ASAP"; export const FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType = { Scheduled: "SCHEDULED", Asap: "ASAP", } as const; -export type FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType = - (typeof FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType)[keyof typeof FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType]; diff --git a/src/api/types/FulfillmentFulfillmentEntry.ts b/src/api/types/FulfillmentFulfillmentEntry.ts index e7d955961..eee1b6960 100644 --- a/src/api/types/FulfillmentFulfillmentEntry.ts +++ b/src/api/types/FulfillmentFulfillmentEntry.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Links an order line item to a fulfillment. Each entry must reference diff --git a/src/api/types/FulfillmentFulfillmentLineItemApplication.ts b/src/api/types/FulfillmentFulfillmentLineItemApplication.ts index 3781549f2..4669179a4 100644 --- a/src/api/types/FulfillmentFulfillmentLineItemApplication.ts +++ b/src/api/types/FulfillmentFulfillmentLineItemApplication.ts @@ -1,12 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The `line_item_application` describes what order line items this fulfillment applies * to. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries. */ +export type FulfillmentFulfillmentLineItemApplication = "ALL" | "ENTRY_LIST"; export const FulfillmentFulfillmentLineItemApplication = { All: "ALL", EntryList: "ENTRY_LIST", } as const; -export type FulfillmentFulfillmentLineItemApplication = - (typeof FulfillmentFulfillmentLineItemApplication)[keyof typeof FulfillmentFulfillmentLineItemApplication]; diff --git a/src/api/types/FulfillmentPickupDetails.ts b/src/api/types/FulfillmentPickupDetails.ts index fbdc0c029..2860652d2 100644 --- a/src/api/types/FulfillmentPickupDetails.ts +++ b/src/api/types/FulfillmentPickupDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Contains details necessary to fulfill a pickup order. diff --git a/src/api/types/FulfillmentPickupDetailsCurbsidePickupDetails.ts b/src/api/types/FulfillmentPickupDetailsCurbsidePickupDetails.ts index c1b4bc455..68fade02b 100644 --- a/src/api/types/FulfillmentPickupDetailsCurbsidePickupDetails.ts +++ b/src/api/types/FulfillmentPickupDetailsCurbsidePickupDetails.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Specific details for curbside pickup. diff --git a/src/api/types/FulfillmentPickupDetailsScheduleType.ts b/src/api/types/FulfillmentPickupDetailsScheduleType.ts index 95c7b5f18..fab10fcda 100644 --- a/src/api/types/FulfillmentPickupDetailsScheduleType.ts +++ b/src/api/types/FulfillmentPickupDetailsScheduleType.ts @@ -1,9 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The schedule type of the pickup fulfillment. */ +/** + * The schedule type of the pickup fulfillment. + */ +export type FulfillmentPickupDetailsScheduleType = "SCHEDULED" | "ASAP"; export const FulfillmentPickupDetailsScheduleType = { Scheduled: "SCHEDULED", Asap: "ASAP", } as const; -export type FulfillmentPickupDetailsScheduleType = - (typeof FulfillmentPickupDetailsScheduleType)[keyof typeof FulfillmentPickupDetailsScheduleType]; diff --git a/src/api/types/FulfillmentRecipient.ts b/src/api/types/FulfillmentRecipient.ts index b5d6e89fb..96e30c413 100644 --- a/src/api/types/FulfillmentRecipient.ts +++ b/src/api/types/FulfillmentRecipient.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Information about the fulfillment recipient. diff --git a/src/api/types/FulfillmentShipmentDetails.ts b/src/api/types/FulfillmentShipmentDetails.ts index e29d014c7..48c6176a6 100644 --- a/src/api/types/FulfillmentShipmentDetails.ts +++ b/src/api/types/FulfillmentShipmentDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Contains the details necessary to fulfill a shipment order. diff --git a/src/api/types/FulfillmentState.ts b/src/api/types/FulfillmentState.ts index 7e4354b1a..49236c3cc 100644 --- a/src/api/types/FulfillmentState.ts +++ b/src/api/types/FulfillmentState.ts @@ -1,6 +1,11 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The current state of this fulfillment. */ +/** + * The current state of this fulfillment. + */ +export type FulfillmentState = "PROPOSED" | "RESERVED" | "PREPARED" | "COMPLETED" | "CANCELED" | "FAILED"; export const FulfillmentState = { Proposed: "PROPOSED", Reserved: "RESERVED", @@ -9,4 +14,3 @@ export const FulfillmentState = { Canceled: "CANCELED", Failed: "FAILED", } as const; -export type FulfillmentState = (typeof FulfillmentState)[keyof typeof FulfillmentState]; diff --git a/src/api/types/FulfillmentType.ts b/src/api/types/FulfillmentType.ts index f9105158f..59bf58a4e 100644 --- a/src/api/types/FulfillmentType.ts +++ b/src/api/types/FulfillmentType.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The type of fulfillment. */ +/** + * The type of fulfillment. + */ +export type FulfillmentType = "PICKUP" | "SHIPMENT" | "DELIVERY"; export const FulfillmentType = { Pickup: "PICKUP", Shipment: "SHIPMENT", Delivery: "DELIVERY", } as const; -export type FulfillmentType = (typeof FulfillmentType)[keyof typeof FulfillmentType]; diff --git a/src/api/types/GetBankAccountByV1IdResponse.ts b/src/api/types/GetBankAccountByV1IdResponse.ts index 12490270c..eb32b38e2 100644 --- a/src/api/types/GetBankAccountByV1IdResponse.ts +++ b/src/api/types/GetBankAccountByV1IdResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Response object returned by GetBankAccountByV1Id. diff --git a/src/api/types/GetBankAccountResponse.ts b/src/api/types/GetBankAccountResponse.ts index 10a5a9994..4da1157b5 100644 --- a/src/api/types/GetBankAccountResponse.ts +++ b/src/api/types/GetBankAccountResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Response object returned by `GetBankAccount`. diff --git a/src/api/types/GetBookingRequest.ts b/src/api/types/GetBookingRequest.ts index ba2057594..3d13e82c9 100644 --- a/src/api/types/GetBookingRequest.ts +++ b/src/api/types/GetBookingRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetBookingRequest = unknown; diff --git a/src/api/types/GetBookingResponse.ts b/src/api/types/GetBookingResponse.ts index e819d4f9f..802155711 100644 --- a/src/api/types/GetBookingResponse.ts +++ b/src/api/types/GetBookingResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface GetBookingResponse { /** The booking that was requested. */ diff --git a/src/api/types/GetBreakTypeResponse.ts b/src/api/types/GetBreakTypeResponse.ts index 5e6d8d0f9..c19ef2831 100644 --- a/src/api/types/GetBreakTypeResponse.ts +++ b/src/api/types/GetBreakTypeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response to a request to get a `BreakType`. The response contains diff --git a/src/api/types/GetBusinessBookingProfileRequest.ts b/src/api/types/GetBusinessBookingProfileRequest.ts index 4f4d13f1f..aefa167f4 100644 --- a/src/api/types/GetBusinessBookingProfileRequest.ts +++ b/src/api/types/GetBusinessBookingProfileRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetBusinessBookingProfileRequest = unknown; diff --git a/src/api/types/GetBusinessBookingProfileResponse.ts b/src/api/types/GetBusinessBookingProfileResponse.ts index fb2851c56..4d00700b7 100644 --- a/src/api/types/GetBusinessBookingProfileResponse.ts +++ b/src/api/types/GetBusinessBookingProfileResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface GetBusinessBookingProfileResponse { /** The seller's booking profile. */ diff --git a/src/api/types/GetCardRequest.ts b/src/api/types/GetCardRequest.ts index bdb411fed..a24eec96f 100644 --- a/src/api/types/GetCardRequest.ts +++ b/src/api/types/GetCardRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetCardRequest = unknown; diff --git a/src/api/types/GetCardResponse.ts b/src/api/types/GetCardResponse.ts index b114e9c3a..977887b0f 100644 --- a/src/api/types/GetCardResponse.ts +++ b/src/api/types/GetCardResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/GetCashDrawerShiftResponse.ts b/src/api/types/GetCashDrawerShiftResponse.ts index 59d347e02..c0dcd2bad 100644 --- a/src/api/types/GetCashDrawerShiftResponse.ts +++ b/src/api/types/GetCashDrawerShiftResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface GetCashDrawerShiftResponse { /** The cash drawer shift queried for. */ diff --git a/src/api/types/GetCatalogObjectResponse.ts b/src/api/types/GetCatalogObjectResponse.ts index 0162a372b..0c9fd7b6d 100644 --- a/src/api/types/GetCatalogObjectResponse.ts +++ b/src/api/types/GetCatalogObjectResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface GetCatalogObjectResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/GetCustomerCustomAttributeDefinitionResponse.ts b/src/api/types/GetCustomerCustomAttributeDefinitionResponse.ts index 467be3574..d0e5c7991 100644 --- a/src/api/types/GetCustomerCustomAttributeDefinitionResponse.ts +++ b/src/api/types/GetCustomerCustomAttributeDefinitionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [RetrieveCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-RetrieveCustomerCustomAttributeDefinition) response. diff --git a/src/api/types/GetCustomerCustomAttributeResponse.ts b/src/api/types/GetCustomerCustomAttributeResponse.ts index 5583834c3..1cddb6f62 100644 --- a/src/api/types/GetCustomerCustomAttributeResponse.ts +++ b/src/api/types/GetCustomerCustomAttributeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [RetrieveCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-RetrieveCustomerCustomAttribute) response. diff --git a/src/api/types/GetCustomerGroupRequest.ts b/src/api/types/GetCustomerGroupRequest.ts index 1556f73f8..7511737ba 100644 --- a/src/api/types/GetCustomerGroupRequest.ts +++ b/src/api/types/GetCustomerGroupRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetCustomerGroupRequest = unknown; diff --git a/src/api/types/GetCustomerGroupResponse.ts b/src/api/types/GetCustomerGroupResponse.ts index b9b439507..34e43193a 100644 --- a/src/api/types/GetCustomerGroupResponse.ts +++ b/src/api/types/GetCustomerGroupResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/GetCustomerRequest.ts b/src/api/types/GetCustomerRequest.ts index 2b6fe27a4..aa6515c1b 100644 --- a/src/api/types/GetCustomerRequest.ts +++ b/src/api/types/GetCustomerRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetCustomerRequest = unknown; diff --git a/src/api/types/GetCustomerResponse.ts b/src/api/types/GetCustomerResponse.ts index 78196d4ff..6729a7527 100644 --- a/src/api/types/GetCustomerResponse.ts +++ b/src/api/types/GetCustomerResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/GetCustomerSegmentRequest.ts b/src/api/types/GetCustomerSegmentRequest.ts index 0675a45ab..548e71c69 100644 --- a/src/api/types/GetCustomerSegmentRequest.ts +++ b/src/api/types/GetCustomerSegmentRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetCustomerSegmentRequest = unknown; diff --git a/src/api/types/GetCustomerSegmentResponse.ts b/src/api/types/GetCustomerSegmentResponse.ts index 2435ee587..03f3c5b30 100644 --- a/src/api/types/GetCustomerSegmentResponse.ts +++ b/src/api/types/GetCustomerSegmentResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body for requests to the `RetrieveCustomerSegment` endpoint. diff --git a/src/api/types/GetDeviceCodeResponse.ts b/src/api/types/GetDeviceCodeResponse.ts index 28c8b6b33..cc4425f39 100644 --- a/src/api/types/GetDeviceCodeResponse.ts +++ b/src/api/types/GetDeviceCodeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface GetDeviceCodeResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/GetDeviceResponse.ts b/src/api/types/GetDeviceResponse.ts index ad2b61319..307d74483 100644 --- a/src/api/types/GetDeviceResponse.ts +++ b/src/api/types/GetDeviceResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface GetDeviceResponse { /** Information about errors encountered during the request. */ diff --git a/src/api/types/GetDisputeEvidenceRequest.ts b/src/api/types/GetDisputeEvidenceRequest.ts index e4353c9ea..7bab2adc2 100644 --- a/src/api/types/GetDisputeEvidenceRequest.ts +++ b/src/api/types/GetDisputeEvidenceRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetDisputeEvidenceRequest = unknown; diff --git a/src/api/types/GetDisputeEvidenceResponse.ts b/src/api/types/GetDisputeEvidenceResponse.ts index f05d01d6e..48a52ff8c 100644 --- a/src/api/types/GetDisputeEvidenceResponse.ts +++ b/src/api/types/GetDisputeEvidenceResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields in a `RetrieveDisputeEvidence` response. diff --git a/src/api/types/GetDisputeRequest.ts b/src/api/types/GetDisputeRequest.ts index 40116ee10..d41f72517 100644 --- a/src/api/types/GetDisputeRequest.ts +++ b/src/api/types/GetDisputeRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetDisputeRequest = unknown; diff --git a/src/api/types/GetDisputeResponse.ts b/src/api/types/GetDisputeResponse.ts index 9025bb7a1..a6d615a91 100644 --- a/src/api/types/GetDisputeResponse.ts +++ b/src/api/types/GetDisputeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines fields in a `RetrieveDispute` response. diff --git a/src/api/types/GetEmployeeRequest.ts b/src/api/types/GetEmployeeRequest.ts index e7cfe37a2..a85cb2cfc 100644 --- a/src/api/types/GetEmployeeRequest.ts +++ b/src/api/types/GetEmployeeRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetEmployeeRequest = unknown; diff --git a/src/api/types/GetEmployeeResponse.ts b/src/api/types/GetEmployeeResponse.ts index 25c03e685..266fa41e1 100644 --- a/src/api/types/GetEmployeeResponse.ts +++ b/src/api/types/GetEmployeeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface GetEmployeeResponse { employee?: Square.Employee; diff --git a/src/api/types/GetEmployeeWageResponse.ts b/src/api/types/GetEmployeeWageResponse.ts index 63eda6ed0..fe7c71f55 100644 --- a/src/api/types/GetEmployeeWageResponse.ts +++ b/src/api/types/GetEmployeeWageResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response to a request to get an `EmployeeWage`. The response contains diff --git a/src/api/types/GetGiftCardFromGanResponse.ts b/src/api/types/GetGiftCardFromGanResponse.ts index c02b88461..ecb5ff639 100644 --- a/src/api/types/GetGiftCardFromGanResponse.ts +++ b/src/api/types/GetGiftCardFromGanResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response that contains a `GiftCard`. This response might contain a set of `Error` objects diff --git a/src/api/types/GetGiftCardFromNonceResponse.ts b/src/api/types/GetGiftCardFromNonceResponse.ts index e4cb42f71..dca2bcbfe 100644 --- a/src/api/types/GetGiftCardFromNonceResponse.ts +++ b/src/api/types/GetGiftCardFromNonceResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response that contains a `GiftCard` object. If the request resulted in errors, diff --git a/src/api/types/GetGiftCardRequest.ts b/src/api/types/GetGiftCardRequest.ts index 84c96bd76..d4632f78c 100644 --- a/src/api/types/GetGiftCardRequest.ts +++ b/src/api/types/GetGiftCardRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetGiftCardRequest = unknown; diff --git a/src/api/types/GetGiftCardResponse.ts b/src/api/types/GetGiftCardResponse.ts index 8840cb6ee..2548f71c0 100644 --- a/src/api/types/GetGiftCardResponse.ts +++ b/src/api/types/GetGiftCardResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response that contains a `GiftCard`. The response might contain a set of `Error` objects diff --git a/src/api/types/GetInventoryAdjustmentRequest.ts b/src/api/types/GetInventoryAdjustmentRequest.ts index 94f38f33e..2b69c2f4d 100644 --- a/src/api/types/GetInventoryAdjustmentRequest.ts +++ b/src/api/types/GetInventoryAdjustmentRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetInventoryAdjustmentRequest = unknown; diff --git a/src/api/types/GetInventoryAdjustmentResponse.ts b/src/api/types/GetInventoryAdjustmentResponse.ts index 6ee38b654..549648d11 100644 --- a/src/api/types/GetInventoryAdjustmentResponse.ts +++ b/src/api/types/GetInventoryAdjustmentResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface GetInventoryAdjustmentResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/GetInventoryChangesResponse.ts b/src/api/types/GetInventoryChangesResponse.ts index ec09d6dd1..91187103f 100644 --- a/src/api/types/GetInventoryChangesResponse.ts +++ b/src/api/types/GetInventoryChangesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface GetInventoryChangesResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/GetInventoryCountResponse.ts b/src/api/types/GetInventoryCountResponse.ts index 229685573..cdedcffdf 100644 --- a/src/api/types/GetInventoryCountResponse.ts +++ b/src/api/types/GetInventoryCountResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface GetInventoryCountResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/GetInventoryPhysicalCountRequest.ts b/src/api/types/GetInventoryPhysicalCountRequest.ts index 9ac1aace4..4e423b2a8 100644 --- a/src/api/types/GetInventoryPhysicalCountRequest.ts +++ b/src/api/types/GetInventoryPhysicalCountRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetInventoryPhysicalCountRequest = unknown; diff --git a/src/api/types/GetInventoryPhysicalCountResponse.ts b/src/api/types/GetInventoryPhysicalCountResponse.ts index 969e82f37..32b1b4305 100644 --- a/src/api/types/GetInventoryPhysicalCountResponse.ts +++ b/src/api/types/GetInventoryPhysicalCountResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface GetInventoryPhysicalCountResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/GetInventoryTransferRequest.ts b/src/api/types/GetInventoryTransferRequest.ts index e8c3a8906..91ff3d2c4 100644 --- a/src/api/types/GetInventoryTransferRequest.ts +++ b/src/api/types/GetInventoryTransferRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetInventoryTransferRequest = unknown; diff --git a/src/api/types/GetInventoryTransferResponse.ts b/src/api/types/GetInventoryTransferResponse.ts index 72d3c3bab..e25b1fc68 100644 --- a/src/api/types/GetInventoryTransferResponse.ts +++ b/src/api/types/GetInventoryTransferResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface GetInventoryTransferResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/GetInvoiceResponse.ts b/src/api/types/GetInvoiceResponse.ts index 45246db3c..620869be5 100644 --- a/src/api/types/GetInvoiceResponse.ts +++ b/src/api/types/GetInvoiceResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Describes a `GetInvoice` response. diff --git a/src/api/types/GetLocationRequest.ts b/src/api/types/GetLocationRequest.ts index 2381e4df1..ba6883ff1 100644 --- a/src/api/types/GetLocationRequest.ts +++ b/src/api/types/GetLocationRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetLocationRequest = unknown; diff --git a/src/api/types/GetLocationResponse.ts b/src/api/types/GetLocationResponse.ts index cf8994a3a..fc0af595d 100644 --- a/src/api/types/GetLocationResponse.ts +++ b/src/api/types/GetLocationResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that the [RetrieveLocation](api-endpoint:Locations-RetrieveLocation) diff --git a/src/api/types/GetLoyaltyAccountRequest.ts b/src/api/types/GetLoyaltyAccountRequest.ts index 485fe087e..4c4b168fe 100644 --- a/src/api/types/GetLoyaltyAccountRequest.ts +++ b/src/api/types/GetLoyaltyAccountRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetLoyaltyAccountRequest = unknown; diff --git a/src/api/types/GetLoyaltyAccountResponse.ts b/src/api/types/GetLoyaltyAccountResponse.ts index d11fb5286..566275fc9 100644 --- a/src/api/types/GetLoyaltyAccountResponse.ts +++ b/src/api/types/GetLoyaltyAccountResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response that includes the loyalty account. diff --git a/src/api/types/GetLoyaltyProgramRequest.ts b/src/api/types/GetLoyaltyProgramRequest.ts index d9a142b05..dd7259869 100644 --- a/src/api/types/GetLoyaltyProgramRequest.ts +++ b/src/api/types/GetLoyaltyProgramRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetLoyaltyProgramRequest = unknown; diff --git a/src/api/types/GetLoyaltyProgramResponse.ts b/src/api/types/GetLoyaltyProgramResponse.ts index ceff46141..e01dee587 100644 --- a/src/api/types/GetLoyaltyProgramResponse.ts +++ b/src/api/types/GetLoyaltyProgramResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response that contains the loyalty program. diff --git a/src/api/types/GetLoyaltyPromotionRequest.ts b/src/api/types/GetLoyaltyPromotionRequest.ts index ffc5d2aaa..4817ea7a7 100644 --- a/src/api/types/GetLoyaltyPromotionRequest.ts +++ b/src/api/types/GetLoyaltyPromotionRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetLoyaltyPromotionRequest = unknown; diff --git a/src/api/types/GetLoyaltyPromotionResponse.ts b/src/api/types/GetLoyaltyPromotionResponse.ts index 649001259..689d5a772 100644 --- a/src/api/types/GetLoyaltyPromotionResponse.ts +++ b/src/api/types/GetLoyaltyPromotionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [RetrieveLoyaltyPromotionPromotions](api-endpoint:Loyalty-RetrieveLoyaltyPromotion) response. diff --git a/src/api/types/GetLoyaltyRewardRequest.ts b/src/api/types/GetLoyaltyRewardRequest.ts index c46972187..6cae255b6 100644 --- a/src/api/types/GetLoyaltyRewardRequest.ts +++ b/src/api/types/GetLoyaltyRewardRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetLoyaltyRewardRequest = unknown; diff --git a/src/api/types/GetLoyaltyRewardResponse.ts b/src/api/types/GetLoyaltyRewardResponse.ts index c0a4fe62f..c285d582e 100644 --- a/src/api/types/GetLoyaltyRewardResponse.ts +++ b/src/api/types/GetLoyaltyRewardResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response that includes the loyalty reward. diff --git a/src/api/types/GetMerchantRequest.ts b/src/api/types/GetMerchantRequest.ts index 785f383b3..21042b11b 100644 --- a/src/api/types/GetMerchantRequest.ts +++ b/src/api/types/GetMerchantRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetMerchantRequest = unknown; diff --git a/src/api/types/GetMerchantResponse.ts b/src/api/types/GetMerchantResponse.ts index c94cefe81..603d2c794 100644 --- a/src/api/types/GetMerchantResponse.ts +++ b/src/api/types/GetMerchantResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response object returned by the [RetrieveMerchant](api-endpoint:Merchants-RetrieveMerchant) endpoint. diff --git a/src/api/types/GetOrderRequest.ts b/src/api/types/GetOrderRequest.ts index 9a9ec2cb3..afbc2cb24 100644 --- a/src/api/types/GetOrderRequest.ts +++ b/src/api/types/GetOrderRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetOrderRequest = unknown; diff --git a/src/api/types/GetOrderResponse.ts b/src/api/types/GetOrderResponse.ts index 376b115ad..17b50598b 100644 --- a/src/api/types/GetOrderResponse.ts +++ b/src/api/types/GetOrderResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface GetOrderResponse { /** The requested order. */ diff --git a/src/api/types/GetPaymentLinkRequest.ts b/src/api/types/GetPaymentLinkRequest.ts index 0d47ded9c..6997b357e 100644 --- a/src/api/types/GetPaymentLinkRequest.ts +++ b/src/api/types/GetPaymentLinkRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetPaymentLinkRequest = unknown; diff --git a/src/api/types/GetPaymentLinkResponse.ts b/src/api/types/GetPaymentLinkResponse.ts index 02de7ba20..e7fa33c13 100644 --- a/src/api/types/GetPaymentLinkResponse.ts +++ b/src/api/types/GetPaymentLinkResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface GetPaymentLinkResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/GetPaymentRefundResponse.ts b/src/api/types/GetPaymentRefundResponse.ts index 21a600c62..2fcdadd81 100644 --- a/src/api/types/GetPaymentRefundResponse.ts +++ b/src/api/types/GetPaymentRefundResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the response returned by [GetRefund](api-endpoint:Refunds-GetPaymentRefund). diff --git a/src/api/types/GetPaymentResponse.ts b/src/api/types/GetPaymentResponse.ts index 8bd49c91a..75908b112 100644 --- a/src/api/types/GetPaymentResponse.ts +++ b/src/api/types/GetPaymentResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the response returned by [GetPayment](api-endpoint:Payments-GetPayment). diff --git a/src/api/types/GetPayoutResponse.ts b/src/api/types/GetPayoutResponse.ts index 0e8c2b4ec..7c70935d8 100644 --- a/src/api/types/GetPayoutResponse.ts +++ b/src/api/types/GetPayoutResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface GetPayoutResponse { /** The requested payout. */ diff --git a/src/api/types/GetShiftResponse.ts b/src/api/types/GetShiftResponse.ts index 343da4826..926693b5c 100644 --- a/src/api/types/GetShiftResponse.ts +++ b/src/api/types/GetShiftResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response to a request to get a `Shift`. The response contains diff --git a/src/api/types/GetSnippetRequest.ts b/src/api/types/GetSnippetRequest.ts index a1334d1fc..ae27a6a6e 100644 --- a/src/api/types/GetSnippetRequest.ts +++ b/src/api/types/GetSnippetRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetSnippetRequest = unknown; diff --git a/src/api/types/GetSnippetResponse.ts b/src/api/types/GetSnippetResponse.ts index 2453f853e..e37027c89 100644 --- a/src/api/types/GetSnippetResponse.ts +++ b/src/api/types/GetSnippetResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a `RetrieveSnippet` response. The response can include either `snippet` or `errors`. diff --git a/src/api/types/GetSubscriptionResponse.ts b/src/api/types/GetSubscriptionResponse.ts index 8854cd0d9..77341f9a7 100644 --- a/src/api/types/GetSubscriptionResponse.ts +++ b/src/api/types/GetSubscriptionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines output parameters in a response from the diff --git a/src/api/types/GetTeamMemberBookingProfileRequest.ts b/src/api/types/GetTeamMemberBookingProfileRequest.ts index 6adc7274b..63c0e3f3e 100644 --- a/src/api/types/GetTeamMemberBookingProfileRequest.ts +++ b/src/api/types/GetTeamMemberBookingProfileRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetTeamMemberBookingProfileRequest = unknown; diff --git a/src/api/types/GetTeamMemberBookingProfileResponse.ts b/src/api/types/GetTeamMemberBookingProfileResponse.ts index 70889bca1..df4c923ae 100644 --- a/src/api/types/GetTeamMemberBookingProfileResponse.ts +++ b/src/api/types/GetTeamMemberBookingProfileResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface GetTeamMemberBookingProfileResponse { /** The returned team member booking profile. */ diff --git a/src/api/types/GetTeamMemberRequest.ts b/src/api/types/GetTeamMemberRequest.ts index 248b7ca84..c19ab9437 100644 --- a/src/api/types/GetTeamMemberRequest.ts +++ b/src/api/types/GetTeamMemberRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetTeamMemberRequest = unknown; diff --git a/src/api/types/GetTeamMemberResponse.ts b/src/api/types/GetTeamMemberResponse.ts index 693752e16..e269e7dfa 100644 --- a/src/api/types/GetTeamMemberResponse.ts +++ b/src/api/types/GetTeamMemberResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response from a retrieve request containing a `TeamMember` object or error messages. diff --git a/src/api/types/GetTeamMemberWageResponse.ts b/src/api/types/GetTeamMemberWageResponse.ts index 6be168259..2b8a9770a 100644 --- a/src/api/types/GetTeamMemberWageResponse.ts +++ b/src/api/types/GetTeamMemberWageResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response to a request to get a `TeamMemberWage`. The response contains diff --git a/src/api/types/GetTerminalActionResponse.ts b/src/api/types/GetTerminalActionResponse.ts index 047d8da1b..ac4225cbc 100644 --- a/src/api/types/GetTerminalActionResponse.ts +++ b/src/api/types/GetTerminalActionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface GetTerminalActionResponse { /** Information on errors encountered during the request. */ diff --git a/src/api/types/GetTerminalCheckoutResponse.ts b/src/api/types/GetTerminalCheckoutResponse.ts index f667bffae..23f4d7e68 100644 --- a/src/api/types/GetTerminalCheckoutResponse.ts +++ b/src/api/types/GetTerminalCheckoutResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface GetTerminalCheckoutResponse { /** Information about errors encountered during the request. */ diff --git a/src/api/types/GetTerminalRefundResponse.ts b/src/api/types/GetTerminalRefundResponse.ts index 887249c8c..973ca5864 100644 --- a/src/api/types/GetTerminalRefundResponse.ts +++ b/src/api/types/GetTerminalRefundResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface GetTerminalRefundResponse { /** Information about errors encountered during the request. */ diff --git a/src/api/types/GetTransactionRequest.ts b/src/api/types/GetTransactionRequest.ts index 8d8421008..2e5fc36c7 100644 --- a/src/api/types/GetTransactionRequest.ts +++ b/src/api/types/GetTransactionRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetTransactionRequest = unknown; diff --git a/src/api/types/GetTransactionResponse.ts b/src/api/types/GetTransactionResponse.ts index 924073a3d..aff31de00 100644 --- a/src/api/types/GetTransactionResponse.ts +++ b/src/api/types/GetTransactionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/GetVendorRequest.ts b/src/api/types/GetVendorRequest.ts index 3fb35714d..96956cd9b 100644 --- a/src/api/types/GetVendorRequest.ts +++ b/src/api/types/GetVendorRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetVendorRequest = unknown; diff --git a/src/api/types/GetVendorResponse.ts b/src/api/types/GetVendorResponse.ts index 5b0562dbd..34662553d 100644 --- a/src/api/types/GetVendorResponse.ts +++ b/src/api/types/GetVendorResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an output from a call to [RetrieveVendor](api-endpoint:Vendors-RetrieveVendor). diff --git a/src/api/types/GetWageSettingRequest.ts b/src/api/types/GetWageSettingRequest.ts index 59aa878cb..befc636af 100644 --- a/src/api/types/GetWageSettingRequest.ts +++ b/src/api/types/GetWageSettingRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetWageSettingRequest = unknown; diff --git a/src/api/types/GetWageSettingResponse.ts b/src/api/types/GetWageSettingResponse.ts index 2e78b89fe..d34904d40 100644 --- a/src/api/types/GetWageSettingResponse.ts +++ b/src/api/types/GetWageSettingResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response from a retrieve request containing the specified `WageSetting` object or error messages. diff --git a/src/api/types/GetWebhookSubscriptionRequest.ts b/src/api/types/GetWebhookSubscriptionRequest.ts index e5851e94c..94e94c97b 100644 --- a/src/api/types/GetWebhookSubscriptionRequest.ts +++ b/src/api/types/GetWebhookSubscriptionRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type GetWebhookSubscriptionRequest = unknown; diff --git a/src/api/types/GetWebhookSubscriptionResponse.ts b/src/api/types/GetWebhookSubscriptionResponse.ts index f17f26534..55d50ead7 100644 --- a/src/api/types/GetWebhookSubscriptionResponse.ts +++ b/src/api/types/GetWebhookSubscriptionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/GiftCard.ts b/src/api/types/GiftCard.ts index 1f145f84b..ed24ffacb 100644 --- a/src/api/types/GiftCard.ts +++ b/src/api/types/GiftCard.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a Square gift card. diff --git a/src/api/types/GiftCardActivity.ts b/src/api/types/GiftCardActivity.ts index 7689db29a..a19037829 100644 --- a/src/api/types/GiftCardActivity.ts +++ b/src/api/types/GiftCardActivity.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an action performed on a [gift card](entity:GiftCard) that affects its state or balance. diff --git a/src/api/types/GiftCardActivityActivate.ts b/src/api/types/GiftCardActivityActivate.ts index 01c82b49a..c8f56828f 100644 --- a/src/api/types/GiftCardActivityActivate.ts +++ b/src/api/types/GiftCardActivityActivate.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents details about an `ACTIVATE` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityAdjustDecrement.ts b/src/api/types/GiftCardActivityAdjustDecrement.ts index 1e89d946a..80d24f854 100644 --- a/src/api/types/GiftCardActivityAdjustDecrement.ts +++ b/src/api/types/GiftCardActivityAdjustDecrement.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents details about an `ADJUST_DECREMENT` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityAdjustDecrementReason.ts b/src/api/types/GiftCardActivityAdjustDecrementReason.ts index ac8b925f9..3d14288d9 100644 --- a/src/api/types/GiftCardActivityAdjustDecrementReason.ts +++ b/src/api/types/GiftCardActivityAdjustDecrementReason.ts @@ -1,11 +1,18 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates the reason for deducting money from a [gift card](entity:GiftCard). */ +/** + * Indicates the reason for deducting money from a [gift card](entity:GiftCard). + */ +export type GiftCardActivityAdjustDecrementReason = + | "SUSPICIOUS_ACTIVITY" + | "BALANCE_ACCIDENTALLY_INCREASED" + | "SUPPORT_ISSUE" + | "PURCHASE_WAS_REFUNDED"; export const GiftCardActivityAdjustDecrementReason = { SuspiciousActivity: "SUSPICIOUS_ACTIVITY", BalanceAccidentallyIncreased: "BALANCE_ACCIDENTALLY_INCREASED", SupportIssue: "SUPPORT_ISSUE", PurchaseWasRefunded: "PURCHASE_WAS_REFUNDED", } as const; -export type GiftCardActivityAdjustDecrementReason = - (typeof GiftCardActivityAdjustDecrementReason)[keyof typeof GiftCardActivityAdjustDecrementReason]; diff --git a/src/api/types/GiftCardActivityAdjustIncrement.ts b/src/api/types/GiftCardActivityAdjustIncrement.ts index bf60c32b6..7e333c906 100644 --- a/src/api/types/GiftCardActivityAdjustIncrement.ts +++ b/src/api/types/GiftCardActivityAdjustIncrement.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents details about an `ADJUST_INCREMENT` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityAdjustIncrementReason.ts b/src/api/types/GiftCardActivityAdjustIncrementReason.ts index f24df5652..b863b9066 100644 --- a/src/api/types/GiftCardActivityAdjustIncrementReason.ts +++ b/src/api/types/GiftCardActivityAdjustIncrementReason.ts @@ -1,10 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates the reason for adding money to a [gift card](entity:GiftCard). */ +/** + * Indicates the reason for adding money to a [gift card](entity:GiftCard). + */ +export type GiftCardActivityAdjustIncrementReason = "COMPLIMENTARY" | "SUPPORT_ISSUE" | "TRANSACTION_VOIDED"; export const GiftCardActivityAdjustIncrementReason = { Complimentary: "COMPLIMENTARY", SupportIssue: "SUPPORT_ISSUE", TransactionVoided: "TRANSACTION_VOIDED", } as const; -export type GiftCardActivityAdjustIncrementReason = - (typeof GiftCardActivityAdjustIncrementReason)[keyof typeof GiftCardActivityAdjustIncrementReason]; diff --git a/src/api/types/GiftCardActivityBlock.ts b/src/api/types/GiftCardActivityBlock.ts index fe8d3604b..7369f2101 100644 --- a/src/api/types/GiftCardActivityBlock.ts +++ b/src/api/types/GiftCardActivityBlock.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents details about a `BLOCK` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityBlockReason.ts b/src/api/types/GiftCardActivityBlockReason.ts index 555970fa6..74695af78 100644 --- a/src/api/types/GiftCardActivityBlockReason.ts +++ b/src/api/types/GiftCardActivityBlockReason.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Indicates the reason for blocking a [gift card](entity:GiftCard). diff --git a/src/api/types/GiftCardActivityClearBalance.ts b/src/api/types/GiftCardActivityClearBalance.ts index 92c6c76c5..3ead099c7 100644 --- a/src/api/types/GiftCardActivityClearBalance.ts +++ b/src/api/types/GiftCardActivityClearBalance.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents details about a `CLEAR_BALANCE` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityClearBalanceReason.ts b/src/api/types/GiftCardActivityClearBalanceReason.ts index feea47409..c780f08f8 100644 --- a/src/api/types/GiftCardActivityClearBalanceReason.ts +++ b/src/api/types/GiftCardActivityClearBalanceReason.ts @@ -1,10 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates the reason for clearing the balance of a [gift card](entity:GiftCard). */ +/** + * Indicates the reason for clearing the balance of a [gift card](entity:GiftCard). + */ +export type GiftCardActivityClearBalanceReason = "SUSPICIOUS_ACTIVITY" | "REUSE_GIFTCARD" | "UNKNOWN_REASON"; export const GiftCardActivityClearBalanceReason = { SuspiciousActivity: "SUSPICIOUS_ACTIVITY", ReuseGiftcard: "REUSE_GIFTCARD", UnknownReason: "UNKNOWN_REASON", } as const; -export type GiftCardActivityClearBalanceReason = - (typeof GiftCardActivityClearBalanceReason)[keyof typeof GiftCardActivityClearBalanceReason]; diff --git a/src/api/types/GiftCardActivityCreatedEvent.ts b/src/api/types/GiftCardActivityCreatedEvent.ts index 73d6c7831..0bb4409dc 100644 --- a/src/api/types/GiftCardActivityCreatedEvent.ts +++ b/src/api/types/GiftCardActivityCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [gift card activity](entity:GiftCardActivity) is created. diff --git a/src/api/types/GiftCardActivityCreatedEventData.ts b/src/api/types/GiftCardActivityCreatedEventData.ts index 2c04b531a..7b92234e8 100644 --- a/src/api/types/GiftCardActivityCreatedEventData.ts +++ b/src/api/types/GiftCardActivityCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents the data associated with a `gift_card.activity.created` event. diff --git a/src/api/types/GiftCardActivityCreatedEventObject.ts b/src/api/types/GiftCardActivityCreatedEventObject.ts index f1f3aa1fe..fe1ca38ff 100644 --- a/src/api/types/GiftCardActivityCreatedEventObject.ts +++ b/src/api/types/GiftCardActivityCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * An object that contains the gift card activity associated with a diff --git a/src/api/types/GiftCardActivityDeactivate.ts b/src/api/types/GiftCardActivityDeactivate.ts index 5b98a00c6..3129c1c2f 100644 --- a/src/api/types/GiftCardActivityDeactivate.ts +++ b/src/api/types/GiftCardActivityDeactivate.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents details about a `DEACTIVATE` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityDeactivateReason.ts b/src/api/types/GiftCardActivityDeactivateReason.ts index eb6590000..efe431f40 100644 --- a/src/api/types/GiftCardActivityDeactivateReason.ts +++ b/src/api/types/GiftCardActivityDeactivateReason.ts @@ -1,10 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates the reason for deactivating a [gift card](entity:GiftCard). */ +/** + * Indicates the reason for deactivating a [gift card](entity:GiftCard). + */ +export type GiftCardActivityDeactivateReason = "SUSPICIOUS_ACTIVITY" | "UNKNOWN_REASON" | "CHARGEBACK_DEACTIVATE"; export const GiftCardActivityDeactivateReason = { SuspiciousActivity: "SUSPICIOUS_ACTIVITY", UnknownReason: "UNKNOWN_REASON", ChargebackDeactivate: "CHARGEBACK_DEACTIVATE", } as const; -export type GiftCardActivityDeactivateReason = - (typeof GiftCardActivityDeactivateReason)[keyof typeof GiftCardActivityDeactivateReason]; diff --git a/src/api/types/GiftCardActivityImport.ts b/src/api/types/GiftCardActivityImport.ts index 0f103205e..c0d4189de 100644 --- a/src/api/types/GiftCardActivityImport.ts +++ b/src/api/types/GiftCardActivityImport.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents details about an `IMPORT` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityImportReversal.ts b/src/api/types/GiftCardActivityImportReversal.ts index 95876f96e..33e18276e 100644 --- a/src/api/types/GiftCardActivityImportReversal.ts +++ b/src/api/types/GiftCardActivityImportReversal.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents details about an `IMPORT_REVERSAL` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityLoad.ts b/src/api/types/GiftCardActivityLoad.ts index 077c404f1..f5ec18e1a 100644 --- a/src/api/types/GiftCardActivityLoad.ts +++ b/src/api/types/GiftCardActivityLoad.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents details about a `LOAD` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityRedeem.ts b/src/api/types/GiftCardActivityRedeem.ts index d5360056b..536cafdd3 100644 --- a/src/api/types/GiftCardActivityRedeem.ts +++ b/src/api/types/GiftCardActivityRedeem.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents details about a `REDEEM` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityRedeemStatus.ts b/src/api/types/GiftCardActivityRedeemStatus.ts index 3531fbafd..a8f616921 100644 --- a/src/api/types/GiftCardActivityRedeemStatus.ts +++ b/src/api/types/GiftCardActivityRedeemStatus.ts @@ -1,14 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Indicates the status of a [gift card](entity:GiftCard) redemption. This status is relevant only for * redemptions made from Square products (such as Square Point of Sale) because Square products use a * two-state process. Gift cards redeemed using the Gift Card Activities API always have a `COMPLETED` status. */ +export type GiftCardActivityRedeemStatus = "PENDING" | "COMPLETED" | "CANCELED"; export const GiftCardActivityRedeemStatus = { Pending: "PENDING", Completed: "COMPLETED", Canceled: "CANCELED", } as const; -export type GiftCardActivityRedeemStatus = - (typeof GiftCardActivityRedeemStatus)[keyof typeof GiftCardActivityRedeemStatus]; diff --git a/src/api/types/GiftCardActivityRefund.ts b/src/api/types/GiftCardActivityRefund.ts index 5738d1e2f..854c4eae2 100644 --- a/src/api/types/GiftCardActivityRefund.ts +++ b/src/api/types/GiftCardActivityRefund.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents details about a `REFUND` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityTransferBalanceFrom.ts b/src/api/types/GiftCardActivityTransferBalanceFrom.ts index d121ddf46..41f6839de 100644 --- a/src/api/types/GiftCardActivityTransferBalanceFrom.ts +++ b/src/api/types/GiftCardActivityTransferBalanceFrom.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents details about a `TRANSFER_BALANCE_FROM` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityTransferBalanceTo.ts b/src/api/types/GiftCardActivityTransferBalanceTo.ts index 2d3b393ef..d68325bf3 100644 --- a/src/api/types/GiftCardActivityTransferBalanceTo.ts +++ b/src/api/types/GiftCardActivityTransferBalanceTo.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents details about a `TRANSFER_BALANCE_TO` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityType.ts b/src/api/types/GiftCardActivityType.ts index d7d2e8067..bc776443d 100644 --- a/src/api/types/GiftCardActivityType.ts +++ b/src/api/types/GiftCardActivityType.ts @@ -1,6 +1,26 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates the type of [gift card activity](entity:GiftCardActivity). */ +/** + * Indicates the type of [gift card activity](entity:GiftCardActivity). + */ +export type GiftCardActivityType = + | "ACTIVATE" + | "LOAD" + | "REDEEM" + | "CLEAR_BALANCE" + | "DEACTIVATE" + | "ADJUST_INCREMENT" + | "ADJUST_DECREMENT" + | "REFUND" + | "UNLINKED_ACTIVITY_REFUND" + | "IMPORT" + | "BLOCK" + | "UNBLOCK" + | "IMPORT_REVERSAL" + | "TRANSFER_BALANCE_FROM" + | "TRANSFER_BALANCE_TO"; export const GiftCardActivityType = { Activate: "ACTIVATE", Load: "LOAD", @@ -18,4 +38,3 @@ export const GiftCardActivityType = { TransferBalanceFrom: "TRANSFER_BALANCE_FROM", TransferBalanceTo: "TRANSFER_BALANCE_TO", } as const; -export type GiftCardActivityType = (typeof GiftCardActivityType)[keyof typeof GiftCardActivityType]; diff --git a/src/api/types/GiftCardActivityUnblock.ts b/src/api/types/GiftCardActivityUnblock.ts index e5b698427..b6cb30f11 100644 --- a/src/api/types/GiftCardActivityUnblock.ts +++ b/src/api/types/GiftCardActivityUnblock.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents details about an `UNBLOCK` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityUnblockReason.ts b/src/api/types/GiftCardActivityUnblockReason.ts index f6beae057..9f67b21e8 100644 --- a/src/api/types/GiftCardActivityUnblockReason.ts +++ b/src/api/types/GiftCardActivityUnblockReason.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Indicates the reason for unblocking a [gift card](entity:GiftCard). diff --git a/src/api/types/GiftCardActivityUnlinkedActivityRefund.ts b/src/api/types/GiftCardActivityUnlinkedActivityRefund.ts index b35eb8d7f..01f3229b4 100644 --- a/src/api/types/GiftCardActivityUnlinkedActivityRefund.ts +++ b/src/api/types/GiftCardActivityUnlinkedActivityRefund.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents details about an `UNLINKED_ACTIVITY_REFUND` [gift card activity type](entity:GiftCardActivityType). diff --git a/src/api/types/GiftCardActivityUpdatedEvent.ts b/src/api/types/GiftCardActivityUpdatedEvent.ts index dbd7538e0..f693bdab8 100644 --- a/src/api/types/GiftCardActivityUpdatedEvent.ts +++ b/src/api/types/GiftCardActivityUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [gift card activity](entity:GiftCardActivity) is updated. diff --git a/src/api/types/GiftCardActivityUpdatedEventData.ts b/src/api/types/GiftCardActivityUpdatedEventData.ts index 334f66ee6..473d79192 100644 --- a/src/api/types/GiftCardActivityUpdatedEventData.ts +++ b/src/api/types/GiftCardActivityUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The data associated with a `gift_card.activity.updated` event. diff --git a/src/api/types/GiftCardActivityUpdatedEventObject.ts b/src/api/types/GiftCardActivityUpdatedEventObject.ts index 01d1fee2f..b0f319574 100644 --- a/src/api/types/GiftCardActivityUpdatedEventObject.ts +++ b/src/api/types/GiftCardActivityUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * An object that contains the gift card activity associated with a diff --git a/src/api/types/GiftCardCreatedEvent.ts b/src/api/types/GiftCardCreatedEvent.ts index 4e975adb9..806cf9e84 100644 --- a/src/api/types/GiftCardCreatedEvent.ts +++ b/src/api/types/GiftCardCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [gift card](entity:GiftCard) is created. diff --git a/src/api/types/GiftCardCreatedEventData.ts b/src/api/types/GiftCardCreatedEventData.ts index d652cf993..5377785bb 100644 --- a/src/api/types/GiftCardCreatedEventData.ts +++ b/src/api/types/GiftCardCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The data associated with a `gift_card.created` event. diff --git a/src/api/types/GiftCardCreatedEventObject.ts b/src/api/types/GiftCardCreatedEventObject.ts index 0e759d505..3b3f72a26 100644 --- a/src/api/types/GiftCardCreatedEventObject.ts +++ b/src/api/types/GiftCardCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * An object that contains the gift card associated with a `gift_card.created` event. diff --git a/src/api/types/GiftCardCustomerLinkedEvent.ts b/src/api/types/GiftCardCustomerLinkedEvent.ts index 3cf45f52b..81d22c4f2 100644 --- a/src/api/types/GiftCardCustomerLinkedEvent.ts +++ b/src/api/types/GiftCardCustomerLinkedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [customer](entity:Customer) is linked to a [gift card](entity:GiftCard). diff --git a/src/api/types/GiftCardCustomerLinkedEventData.ts b/src/api/types/GiftCardCustomerLinkedEventData.ts index f1fb64c79..386681909 100644 --- a/src/api/types/GiftCardCustomerLinkedEventData.ts +++ b/src/api/types/GiftCardCustomerLinkedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The data associated with a `gift_card.customer_linked` event. diff --git a/src/api/types/GiftCardCustomerLinkedEventObject.ts b/src/api/types/GiftCardCustomerLinkedEventObject.ts index 9e832bffa..2f0d47889 100644 --- a/src/api/types/GiftCardCustomerLinkedEventObject.ts +++ b/src/api/types/GiftCardCustomerLinkedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * An object that contains the gift card and customer ID associated with a diff --git a/src/api/types/GiftCardCustomerUnlinkedEvent.ts b/src/api/types/GiftCardCustomerUnlinkedEvent.ts index fddd6e2e8..f2e4e6806 100644 --- a/src/api/types/GiftCardCustomerUnlinkedEvent.ts +++ b/src/api/types/GiftCardCustomerUnlinkedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [customer](entity:Customer) is unlinked from a [gift card](entity:GiftCard). diff --git a/src/api/types/GiftCardCustomerUnlinkedEventData.ts b/src/api/types/GiftCardCustomerUnlinkedEventData.ts index 473f04283..46aba1266 100644 --- a/src/api/types/GiftCardCustomerUnlinkedEventData.ts +++ b/src/api/types/GiftCardCustomerUnlinkedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The data associated with a `gift_card.customer_unlinked` event. diff --git a/src/api/types/GiftCardCustomerUnlinkedEventObject.ts b/src/api/types/GiftCardCustomerUnlinkedEventObject.ts index f95ed2d24..ede810855 100644 --- a/src/api/types/GiftCardCustomerUnlinkedEventObject.ts +++ b/src/api/types/GiftCardCustomerUnlinkedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * An object that contains the gift card and the customer ID associated with a diff --git a/src/api/types/GiftCardGanSource.ts b/src/api/types/GiftCardGanSource.ts index a37853a5e..4f0f75504 100644 --- a/src/api/types/GiftCardGanSource.ts +++ b/src/api/types/GiftCardGanSource.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Indicates the source that generated the gift card * account number (GAN). */ +export type GiftCardGanSource = "SQUARE" | "OTHER"; export const GiftCardGanSource = { Square: "SQUARE", Other: "OTHER", } as const; -export type GiftCardGanSource = (typeof GiftCardGanSource)[keyof typeof GiftCardGanSource]; diff --git a/src/api/types/GiftCardStatus.ts b/src/api/types/GiftCardStatus.ts index fdc0d28d8..10395ce3d 100644 --- a/src/api/types/GiftCardStatus.ts +++ b/src/api/types/GiftCardStatus.ts @@ -1,10 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates the gift card state. */ +/** + * Indicates the gift card state. + */ +export type GiftCardStatus = "ACTIVE" | "DEACTIVATED" | "BLOCKED" | "PENDING"; export const GiftCardStatus = { Active: "ACTIVE", Deactivated: "DEACTIVATED", Blocked: "BLOCKED", Pending: "PENDING", } as const; -export type GiftCardStatus = (typeof GiftCardStatus)[keyof typeof GiftCardStatus]; diff --git a/src/api/types/GiftCardType.ts b/src/api/types/GiftCardType.ts index 5e937b67b..22c2337f3 100644 --- a/src/api/types/GiftCardType.ts +++ b/src/api/types/GiftCardType.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates the gift card type. */ +/** + * Indicates the gift card type. + */ +export type GiftCardType = "PHYSICAL" | "DIGITAL"; export const GiftCardType = { Physical: "PHYSICAL", Digital: "DIGITAL", } as const; -export type GiftCardType = (typeof GiftCardType)[keyof typeof GiftCardType]; diff --git a/src/api/types/GiftCardUpdatedEvent.ts b/src/api/types/GiftCardUpdatedEvent.ts index 960a1e6ec..466c2fb45 100644 --- a/src/api/types/GiftCardUpdatedEvent.ts +++ b/src/api/types/GiftCardUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [gift card](entity:GiftCard) is updated. This includes diff --git a/src/api/types/GiftCardUpdatedEventData.ts b/src/api/types/GiftCardUpdatedEventData.ts index 80702d4a9..96c5db2f1 100644 --- a/src/api/types/GiftCardUpdatedEventData.ts +++ b/src/api/types/GiftCardUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The data associated with a `gift_card.updated` event. diff --git a/src/api/types/GiftCardUpdatedEventObject.ts b/src/api/types/GiftCardUpdatedEventObject.ts index f3b0074bc..2b9aa6532 100644 --- a/src/api/types/GiftCardUpdatedEventObject.ts +++ b/src/api/types/GiftCardUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * An object that contains the gift card associated with a `gift_card.updated` event. diff --git a/src/api/types/InventoryAdjustment.ts b/src/api/types/InventoryAdjustment.ts index bc0ba3ab3..b4914ae0b 100644 --- a/src/api/types/InventoryAdjustment.ts +++ b/src/api/types/InventoryAdjustment.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a change in state or quantity of product inventory at a diff --git a/src/api/types/InventoryAdjustmentGroup.ts b/src/api/types/InventoryAdjustmentGroup.ts index 78ef87bd3..5d5325815 100644 --- a/src/api/types/InventoryAdjustmentGroup.ts +++ b/src/api/types/InventoryAdjustmentGroup.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface InventoryAdjustmentGroup { /** diff --git a/src/api/types/InventoryAlertType.ts b/src/api/types/InventoryAlertType.ts index 4cc807bb7..d4157ce67 100644 --- a/src/api/types/InventoryAlertType.ts +++ b/src/api/types/InventoryAlertType.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates whether Square should alert the merchant when the inventory quantity of a CatalogItemVariation is low. */ +/** + * Indicates whether Square should alert the merchant when the inventory quantity of a CatalogItemVariation is low. + */ +export type InventoryAlertType = "NONE" | "LOW_QUANTITY"; export const InventoryAlertType = { None: "NONE", LowQuantity: "LOW_QUANTITY", } as const; -export type InventoryAlertType = (typeof InventoryAlertType)[keyof typeof InventoryAlertType]; diff --git a/src/api/types/InventoryChange.ts b/src/api/types/InventoryChange.ts index 25da4cac7..155b8d6ad 100644 --- a/src/api/types/InventoryChange.ts +++ b/src/api/types/InventoryChange.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a single physical count, inventory, adjustment, or transfer diff --git a/src/api/types/InventoryChangeType.ts b/src/api/types/InventoryChangeType.ts index dbb8054b7..c77ce19e8 100644 --- a/src/api/types/InventoryChangeType.ts +++ b/src/api/types/InventoryChangeType.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates how the inventory change was applied to a tracked product quantity. */ +/** + * Indicates how the inventory change was applied to a tracked product quantity. + */ +export type InventoryChangeType = "PHYSICAL_COUNT" | "ADJUSTMENT" | "TRANSFER"; export const InventoryChangeType = { PhysicalCount: "PHYSICAL_COUNT", Adjustment: "ADJUSTMENT", Transfer: "TRANSFER", } as const; -export type InventoryChangeType = (typeof InventoryChangeType)[keyof typeof InventoryChangeType]; diff --git a/src/api/types/InventoryCount.ts b/src/api/types/InventoryCount.ts index 9ac14ae96..d5bcbd693 100644 --- a/src/api/types/InventoryCount.ts +++ b/src/api/types/InventoryCount.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents Square-estimated quantity of items in a particular state at a diff --git a/src/api/types/InventoryCountUpdatedEvent.ts b/src/api/types/InventoryCountUpdatedEvent.ts index af73de8e2..6ac19435a 100644 --- a/src/api/types/InventoryCountUpdatedEvent.ts +++ b/src/api/types/InventoryCountUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when the quantity is updated for a diff --git a/src/api/types/InventoryCountUpdatedEventData.ts b/src/api/types/InventoryCountUpdatedEventData.ts index 003dabfef..b88761e37 100644 --- a/src/api/types/InventoryCountUpdatedEventData.ts +++ b/src/api/types/InventoryCountUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface InventoryCountUpdatedEventData { /** Name of the affected object’s type. For this event, the value is `inventory_counts`. */ diff --git a/src/api/types/InventoryCountUpdatedEventObject.ts b/src/api/types/InventoryCountUpdatedEventObject.ts index 2f013920b..fb145136a 100644 --- a/src/api/types/InventoryCountUpdatedEventObject.ts +++ b/src/api/types/InventoryCountUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface InventoryCountUpdatedEventObject { /** The inventory counts. */ diff --git a/src/api/types/InventoryPhysicalCount.ts b/src/api/types/InventoryPhysicalCount.ts index 8272ff746..c20ca06af 100644 --- a/src/api/types/InventoryPhysicalCount.ts +++ b/src/api/types/InventoryPhysicalCount.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents the quantity of an item variation that is physically present diff --git a/src/api/types/InventoryState.ts b/src/api/types/InventoryState.ts index 30c402767..34af6a483 100644 --- a/src/api/types/InventoryState.ts +++ b/src/api/types/InventoryState.ts @@ -1,6 +1,27 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates the state of a tracked item quantity in the lifecycle of goods. */ +/** + * Indicates the state of a tracked item quantity in the lifecycle of goods. + */ +export type InventoryState = + | "CUSTOM" + | "IN_STOCK" + | "SOLD" + | "RETURNED_BY_CUSTOMER" + | "RESERVED_FOR_SALE" + | "SOLD_ONLINE" + | "ORDERED_FROM_VENDOR" + | "RECEIVED_FROM_VENDOR" + | "IN_TRANSIT_TO" + | "NONE" + | "WASTE" + | "UNLINKED_RETURN" + | "COMPOSED" + | "DECOMPOSED" + | "SUPPORTED_BY_NEWER_VERSION" + | "IN_TRANSIT"; export const InventoryState = { Custom: "CUSTOM", InStock: "IN_STOCK", @@ -19,4 +40,3 @@ export const InventoryState = { SupportedByNewerVersion: "SUPPORTED_BY_NEWER_VERSION", InTransit: "IN_TRANSIT", } as const; -export type InventoryState = (typeof InventoryState)[keyof typeof InventoryState]; diff --git a/src/api/types/InventoryTransfer.ts b/src/api/types/InventoryTransfer.ts index 395becc87..180a85c25 100644 --- a/src/api/types/InventoryTransfer.ts +++ b/src/api/types/InventoryTransfer.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents the transfer of a quantity of product inventory at a diff --git a/src/api/types/Invoice.ts b/src/api/types/Invoice.ts index 2aa39c0b4..c0395c393 100644 --- a/src/api/types/Invoice.ts +++ b/src/api/types/Invoice.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Stores information about an invoice. You use the Invoices API to create and manage diff --git a/src/api/types/InvoiceAcceptedPaymentMethods.ts b/src/api/types/InvoiceAcceptedPaymentMethods.ts index a2f90d16a..3423517b3 100644 --- a/src/api/types/InvoiceAcceptedPaymentMethods.ts +++ b/src/api/types/InvoiceAcceptedPaymentMethods.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The payment methods that customers can use to pay an [invoice](entity:Invoice) on the Square-hosted invoice payment page. diff --git a/src/api/types/InvoiceAttachment.ts b/src/api/types/InvoiceAttachment.ts index 7bf8ddaea..025574248 100644 --- a/src/api/types/InvoiceAttachment.ts +++ b/src/api/types/InvoiceAttachment.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents a file attached to an [invoice](entity:Invoice). diff --git a/src/api/types/InvoiceAutomaticPaymentSource.ts b/src/api/types/InvoiceAutomaticPaymentSource.ts index 8d3421c33..19068be2d 100644 --- a/src/api/types/InvoiceAutomaticPaymentSource.ts +++ b/src/api/types/InvoiceAutomaticPaymentSource.ts @@ -1,10 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates the automatic payment method for an [invoice payment request](entity:InvoicePaymentRequest). */ +/** + * Indicates the automatic payment method for an [invoice payment request](entity:InvoicePaymentRequest). + */ +export type InvoiceAutomaticPaymentSource = "NONE" | "CARD_ON_FILE" | "BANK_ON_FILE"; export const InvoiceAutomaticPaymentSource = { None: "NONE", CardOnFile: "CARD_ON_FILE", BankOnFile: "BANK_ON_FILE", } as const; -export type InvoiceAutomaticPaymentSource = - (typeof InvoiceAutomaticPaymentSource)[keyof typeof InvoiceAutomaticPaymentSource]; diff --git a/src/api/types/InvoiceCanceledEvent.ts b/src/api/types/InvoiceCanceledEvent.ts index 55e82eb08..06f8098a4 100644 --- a/src/api/types/InvoiceCanceledEvent.ts +++ b/src/api/types/InvoiceCanceledEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when an [Invoice](entity:Invoice) is canceled. diff --git a/src/api/types/InvoiceCanceledEventData.ts b/src/api/types/InvoiceCanceledEventData.ts index 8948cb55e..7fc4fffed 100644 --- a/src/api/types/InvoiceCanceledEventData.ts +++ b/src/api/types/InvoiceCanceledEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface InvoiceCanceledEventData { /** Name of the affected object’s type, `"invoice"`. */ diff --git a/src/api/types/InvoiceCanceledEventObject.ts b/src/api/types/InvoiceCanceledEventObject.ts index 33442b952..887f3ac67 100644 --- a/src/api/types/InvoiceCanceledEventObject.ts +++ b/src/api/types/InvoiceCanceledEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface InvoiceCanceledEventObject { /** The related invoice. */ diff --git a/src/api/types/InvoiceCreatedEvent.ts b/src/api/types/InvoiceCreatedEvent.ts index 53abe59cc..f2e6515aa 100644 --- a/src/api/types/InvoiceCreatedEvent.ts +++ b/src/api/types/InvoiceCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when an [Invoice](entity:Invoice) is created. diff --git a/src/api/types/InvoiceCreatedEventData.ts b/src/api/types/InvoiceCreatedEventData.ts index 728c94bdc..21a388170 100644 --- a/src/api/types/InvoiceCreatedEventData.ts +++ b/src/api/types/InvoiceCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface InvoiceCreatedEventData { /** Name of the affected object’s type, `"invoice"`. */ diff --git a/src/api/types/InvoiceCreatedEventObject.ts b/src/api/types/InvoiceCreatedEventObject.ts index 520bd3623..48de67333 100644 --- a/src/api/types/InvoiceCreatedEventObject.ts +++ b/src/api/types/InvoiceCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface InvoiceCreatedEventObject { /** The related invoice. */ diff --git a/src/api/types/InvoiceCustomField.ts b/src/api/types/InvoiceCustomField.ts index df4a717db..4dee741b2 100644 --- a/src/api/types/InvoiceCustomField.ts +++ b/src/api/types/InvoiceCustomField.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * An additional seller-defined and customer-facing field to include on the invoice. For more information, diff --git a/src/api/types/InvoiceCustomFieldPlacement.ts b/src/api/types/InvoiceCustomFieldPlacement.ts index 60457cef5..efafb510b 100644 --- a/src/api/types/InvoiceCustomFieldPlacement.ts +++ b/src/api/types/InvoiceCustomFieldPlacement.ts @@ -1,12 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Indicates where to render a custom field on the Square-hosted invoice page and in emailed or PDF * copies of the invoice. */ +export type InvoiceCustomFieldPlacement = "ABOVE_LINE_ITEMS" | "BELOW_LINE_ITEMS"; export const InvoiceCustomFieldPlacement = { AboveLineItems: "ABOVE_LINE_ITEMS", BelowLineItems: "BELOW_LINE_ITEMS", } as const; -export type InvoiceCustomFieldPlacement = - (typeof InvoiceCustomFieldPlacement)[keyof typeof InvoiceCustomFieldPlacement]; diff --git a/src/api/types/InvoiceDeletedEvent.ts b/src/api/types/InvoiceDeletedEvent.ts index 6804f7f14..388a6abb5 100644 --- a/src/api/types/InvoiceDeletedEvent.ts +++ b/src/api/types/InvoiceDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a draft [Invoice](entity:Invoice) is deleted. diff --git a/src/api/types/InvoiceDeletedEventData.ts b/src/api/types/InvoiceDeletedEventData.ts index 34c41270a..bd53f5ecd 100644 --- a/src/api/types/InvoiceDeletedEventData.ts +++ b/src/api/types/InvoiceDeletedEventData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface InvoiceDeletedEventData { /** Name of the affected object’s type, `"invoice"`. */ diff --git a/src/api/types/InvoiceDeliveryMethod.ts b/src/api/types/InvoiceDeliveryMethod.ts index 4bbd1cfa3..d4cc5e7da 100644 --- a/src/api/types/InvoiceDeliveryMethod.ts +++ b/src/api/types/InvoiceDeliveryMethod.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates how Square delivers the [invoice](entity:Invoice) to the customer. */ +/** + * Indicates how Square delivers the [invoice](entity:Invoice) to the customer. + */ +export type InvoiceDeliveryMethod = "EMAIL" | "SHARE_MANUALLY" | "SMS"; export const InvoiceDeliveryMethod = { Email: "EMAIL", ShareManually: "SHARE_MANUALLY", Sms: "SMS", } as const; -export type InvoiceDeliveryMethod = (typeof InvoiceDeliveryMethod)[keyof typeof InvoiceDeliveryMethod]; diff --git a/src/api/types/InvoiceFilter.ts b/src/api/types/InvoiceFilter.ts index e1e74e38f..32d264df3 100644 --- a/src/api/types/InvoiceFilter.ts +++ b/src/api/types/InvoiceFilter.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Describes query filters to apply. diff --git a/src/api/types/InvoicePaymentMadeEvent.ts b/src/api/types/InvoicePaymentMadeEvent.ts index bad16b74e..9f782fddd 100644 --- a/src/api/types/InvoicePaymentMadeEvent.ts +++ b/src/api/types/InvoicePaymentMadeEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a payment that is associated with an [invoice](entity:Invoice) is completed. diff --git a/src/api/types/InvoicePaymentMadeEventData.ts b/src/api/types/InvoicePaymentMadeEventData.ts index cd6034a61..ec74fbf5d 100644 --- a/src/api/types/InvoicePaymentMadeEventData.ts +++ b/src/api/types/InvoicePaymentMadeEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface InvoicePaymentMadeEventData { /** Name of the affected object’s type, `"invoice"`. */ diff --git a/src/api/types/InvoicePaymentMadeEventObject.ts b/src/api/types/InvoicePaymentMadeEventObject.ts index 146a1193c..71dff4017 100644 --- a/src/api/types/InvoicePaymentMadeEventObject.ts +++ b/src/api/types/InvoicePaymentMadeEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface InvoicePaymentMadeEventObject { /** The related invoice. */ diff --git a/src/api/types/InvoicePaymentReminder.ts b/src/api/types/InvoicePaymentReminder.ts index 648250f84..4d52f0894 100644 --- a/src/api/types/InvoicePaymentReminder.ts +++ b/src/api/types/InvoicePaymentReminder.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Describes a payment request reminder (automatic notification) that Square sends diff --git a/src/api/types/InvoicePaymentReminderStatus.ts b/src/api/types/InvoicePaymentReminderStatus.ts index 42bfc2b73..96f891348 100644 --- a/src/api/types/InvoicePaymentReminderStatus.ts +++ b/src/api/types/InvoicePaymentReminderStatus.ts @@ -1,10 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The status of a payment request reminder. */ +/** + * The status of a payment request reminder. + */ +export type InvoicePaymentReminderStatus = "PENDING" | "NOT_APPLICABLE" | "SENT"; export const InvoicePaymentReminderStatus = { Pending: "PENDING", NotApplicable: "NOT_APPLICABLE", Sent: "SENT", } as const; -export type InvoicePaymentReminderStatus = - (typeof InvoicePaymentReminderStatus)[keyof typeof InvoicePaymentReminderStatus]; diff --git a/src/api/types/InvoicePaymentRequest.ts b/src/api/types/InvoicePaymentRequest.ts index ba30b04cd..b238a38b4 100644 --- a/src/api/types/InvoicePaymentRequest.ts +++ b/src/api/types/InvoicePaymentRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a payment request for an [invoice](entity:Invoice). Invoices can specify a maximum diff --git a/src/api/types/InvoicePublishedEvent.ts b/src/api/types/InvoicePublishedEvent.ts index 0d999b81a..53b1c9ab2 100644 --- a/src/api/types/InvoicePublishedEvent.ts +++ b/src/api/types/InvoicePublishedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when an [Invoice](entity:Invoice) transitions from a draft to a non-draft status. diff --git a/src/api/types/InvoicePublishedEventData.ts b/src/api/types/InvoicePublishedEventData.ts index e74b4ba73..0087be06c 100644 --- a/src/api/types/InvoicePublishedEventData.ts +++ b/src/api/types/InvoicePublishedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface InvoicePublishedEventData { /** Name of the affected object’s type, `"invoice"`. */ diff --git a/src/api/types/InvoicePublishedEventObject.ts b/src/api/types/InvoicePublishedEventObject.ts index 53750c7b1..3b6d290cb 100644 --- a/src/api/types/InvoicePublishedEventObject.ts +++ b/src/api/types/InvoicePublishedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface InvoicePublishedEventObject { /** The related invoice. */ diff --git a/src/api/types/InvoiceQuery.ts b/src/api/types/InvoiceQuery.ts index d8893764b..4ed3833b7 100644 --- a/src/api/types/InvoiceQuery.ts +++ b/src/api/types/InvoiceQuery.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Describes query criteria for searching invoices. diff --git a/src/api/types/InvoiceRecipient.ts b/src/api/types/InvoiceRecipient.ts index 0b45b087e..37cf7b4d2 100644 --- a/src/api/types/InvoiceRecipient.ts +++ b/src/api/types/InvoiceRecipient.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a snapshot of customer data. This object stores customer data that is displayed on the invoice diff --git a/src/api/types/InvoiceRecipientTaxIds.ts b/src/api/types/InvoiceRecipientTaxIds.ts index a89c103c5..bb695aae0 100644 --- a/src/api/types/InvoiceRecipientTaxIds.ts +++ b/src/api/types/InvoiceRecipientTaxIds.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents the tax IDs for an invoice recipient. The country of the seller account determines diff --git a/src/api/types/InvoiceRefundedEvent.ts b/src/api/types/InvoiceRefundedEvent.ts index 66cea20b2..323f4d1e6 100644 --- a/src/api/types/InvoiceRefundedEvent.ts +++ b/src/api/types/InvoiceRefundedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a refund is applied toward a payment of an [invoice](entity:Invoice). diff --git a/src/api/types/InvoiceRefundedEventData.ts b/src/api/types/InvoiceRefundedEventData.ts index dee623e7b..a8dcf2de6 100644 --- a/src/api/types/InvoiceRefundedEventData.ts +++ b/src/api/types/InvoiceRefundedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface InvoiceRefundedEventData { /** Name of the affected object’s type, `"invoice"`. */ diff --git a/src/api/types/InvoiceRefundedEventObject.ts b/src/api/types/InvoiceRefundedEventObject.ts index 84d173696..9975bfd57 100644 --- a/src/api/types/InvoiceRefundedEventObject.ts +++ b/src/api/types/InvoiceRefundedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface InvoiceRefundedEventObject { /** The related invoice. */ diff --git a/src/api/types/InvoiceRequestMethod.ts b/src/api/types/InvoiceRequestMethod.ts index 768478b78..2c6c5698f 100644 --- a/src/api/types/InvoiceRequestMethod.ts +++ b/src/api/types/InvoiceRequestMethod.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Specifies the action for Square to take for processing the invoice. For example, @@ -6,6 +8,14 @@ * version 2021-01-21. The corresponding `request_method` field is replaced by the * `Invoice.delivery_method` and `InvoicePaymentRequest.automatic_payment_source` fields. */ +export type InvoiceRequestMethod = + | "EMAIL" + | "CHARGE_CARD_ON_FILE" + | "SHARE_MANUALLY" + | "CHARGE_BANK_ON_FILE" + | "SMS" + | "SMS_CHARGE_CARD_ON_FILE" + | "SMS_CHARGE_BANK_ON_FILE"; export const InvoiceRequestMethod = { Email: "EMAIL", ChargeCardOnFile: "CHARGE_CARD_ON_FILE", @@ -15,4 +25,3 @@ export const InvoiceRequestMethod = { SmsChargeCardOnFile: "SMS_CHARGE_CARD_ON_FILE", SmsChargeBankOnFile: "SMS_CHARGE_BANK_ON_FILE", } as const; -export type InvoiceRequestMethod = (typeof InvoiceRequestMethod)[keyof typeof InvoiceRequestMethod]; diff --git a/src/api/types/InvoiceRequestType.ts b/src/api/types/InvoiceRequestType.ts index a358eec86..7b8d8188c 100644 --- a/src/api/types/InvoiceRequestType.ts +++ b/src/api/types/InvoiceRequestType.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Indicates the type of the payment request. For more information, see * [Configuring payment requests](https://developer.squareup.com/docs/invoices-api/create-publish-invoices#payment-requests). */ +export type InvoiceRequestType = "BALANCE" | "DEPOSIT" | "INSTALLMENT"; export const InvoiceRequestType = { Balance: "BALANCE", Deposit: "DEPOSIT", Installment: "INSTALLMENT", } as const; -export type InvoiceRequestType = (typeof InvoiceRequestType)[keyof typeof InvoiceRequestType]; diff --git a/src/api/types/InvoiceScheduledChargeFailedEvent.ts b/src/api/types/InvoiceScheduledChargeFailedEvent.ts index 6eb419105..a8ea74ed4 100644 --- a/src/api/types/InvoiceScheduledChargeFailedEvent.ts +++ b/src/api/types/InvoiceScheduledChargeFailedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when an automatic scheduled payment for an [Invoice](entity:Invoice) has failed. diff --git a/src/api/types/InvoiceScheduledChargeFailedEventData.ts b/src/api/types/InvoiceScheduledChargeFailedEventData.ts index 3e74429ef..ba7b88e9d 100644 --- a/src/api/types/InvoiceScheduledChargeFailedEventData.ts +++ b/src/api/types/InvoiceScheduledChargeFailedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface InvoiceScheduledChargeFailedEventData { /** Name of the affected object’s type, `"invoice"`. */ diff --git a/src/api/types/InvoiceScheduledChargeFailedEventObject.ts b/src/api/types/InvoiceScheduledChargeFailedEventObject.ts index 18e089ea1..53871b634 100644 --- a/src/api/types/InvoiceScheduledChargeFailedEventObject.ts +++ b/src/api/types/InvoiceScheduledChargeFailedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface InvoiceScheduledChargeFailedEventObject { /** The related invoice. */ diff --git a/src/api/types/InvoiceSort.ts b/src/api/types/InvoiceSort.ts index 03e1c89cd..4ddefc79d 100644 --- a/src/api/types/InvoiceSort.ts +++ b/src/api/types/InvoiceSort.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Identifies the sort field and sort order. diff --git a/src/api/types/InvoiceSortField.ts b/src/api/types/InvoiceSortField.ts index b1c08350f..0f1781d15 100644 --- a/src/api/types/InvoiceSortField.ts +++ b/src/api/types/InvoiceSortField.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The field to use for sorting. diff --git a/src/api/types/InvoiceStatus.ts b/src/api/types/InvoiceStatus.ts index d2c296b2e..32c521001 100644 --- a/src/api/types/InvoiceStatus.ts +++ b/src/api/types/InvoiceStatus.ts @@ -1,6 +1,21 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates the status of an [invoice](entity:Invoice). */ +/** + * Indicates the status of an [invoice](entity:Invoice). + */ +export type InvoiceStatus = + | "DRAFT" + | "UNPAID" + | "SCHEDULED" + | "PARTIALLY_PAID" + | "PAID" + | "PARTIALLY_REFUNDED" + | "REFUNDED" + | "CANCELED" + | "FAILED" + | "PAYMENT_PENDING"; export const InvoiceStatus = { Draft: "DRAFT", Unpaid: "UNPAID", @@ -13,4 +28,3 @@ export const InvoiceStatus = { Failed: "FAILED", PaymentPending: "PAYMENT_PENDING", } as const; -export type InvoiceStatus = (typeof InvoiceStatus)[keyof typeof InvoiceStatus]; diff --git a/src/api/types/InvoiceUpdatedEvent.ts b/src/api/types/InvoiceUpdatedEvent.ts index f9d835390..26e446131 100644 --- a/src/api/types/InvoiceUpdatedEvent.ts +++ b/src/api/types/InvoiceUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when an [Invoice](entity:Invoice) is updated. diff --git a/src/api/types/InvoiceUpdatedEventData.ts b/src/api/types/InvoiceUpdatedEventData.ts index 6a74ba2ea..666c6f156 100644 --- a/src/api/types/InvoiceUpdatedEventData.ts +++ b/src/api/types/InvoiceUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface InvoiceUpdatedEventData { /** Name of the affected object’s type, `"invoice"`. */ diff --git a/src/api/types/InvoiceUpdatedEventObject.ts b/src/api/types/InvoiceUpdatedEventObject.ts index cbbb46493..743f7b063 100644 --- a/src/api/types/InvoiceUpdatedEventObject.ts +++ b/src/api/types/InvoiceUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface InvoiceUpdatedEventObject { /** The related invoice. */ diff --git a/src/api/types/ItemVariationLocationOverrides.ts b/src/api/types/ItemVariationLocationOverrides.ts index 0475c43c7..fb9055148 100644 --- a/src/api/types/ItemVariationLocationOverrides.ts +++ b/src/api/types/ItemVariationLocationOverrides.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Price and inventory alerting overrides for a `CatalogItemVariation` at a specific `Location`. diff --git a/src/api/types/Job.ts b/src/api/types/Job.ts index d86cabb2d..feae74ed7 100644 --- a/src/api/types/Job.ts +++ b/src/api/types/Job.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents a job that can be assigned to [team members](entity:TeamMember). This object defines the diff --git a/src/api/types/JobAssignment.ts b/src/api/types/JobAssignment.ts index d4d37859f..676dacd7b 100644 --- a/src/api/types/JobAssignment.ts +++ b/src/api/types/JobAssignment.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a job assigned to a [team member](entity:TeamMember), including the compensation the team diff --git a/src/api/types/JobAssignmentPayType.ts b/src/api/types/JobAssignmentPayType.ts index 0db74fe12..5dde03d42 100644 --- a/src/api/types/JobAssignmentPayType.ts +++ b/src/api/types/JobAssignmentPayType.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Enumerates the possible pay types that a job can be assigned. */ +/** + * Enumerates the possible pay types that a job can be assigned. + */ +export type JobAssignmentPayType = "NONE" | "HOURLY" | "SALARY"; export const JobAssignmentPayType = { None: "NONE", Hourly: "HOURLY", Salary: "SALARY", } as const; -export type JobAssignmentPayType = (typeof JobAssignmentPayType)[keyof typeof JobAssignmentPayType]; diff --git a/src/api/types/JobCreatedEvent.ts b/src/api/types/JobCreatedEvent.ts index c942c2c7f..886336561 100644 --- a/src/api/types/JobCreatedEvent.ts +++ b/src/api/types/JobCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a Job is created. diff --git a/src/api/types/JobCreatedEventData.ts b/src/api/types/JobCreatedEventData.ts index 051b019a7..75849b538 100644 --- a/src/api/types/JobCreatedEventData.ts +++ b/src/api/types/JobCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface JobCreatedEventData { /** Name of the affected object’s type, `"job"`. */ diff --git a/src/api/types/JobCreatedEventObject.ts b/src/api/types/JobCreatedEventObject.ts index 6fefe46c2..b1ff685a5 100644 --- a/src/api/types/JobCreatedEventObject.ts +++ b/src/api/types/JobCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface JobCreatedEventObject { /** The created job. */ diff --git a/src/api/types/JobUpdatedEvent.ts b/src/api/types/JobUpdatedEvent.ts index fb86b89de..4fb5b31f5 100644 --- a/src/api/types/JobUpdatedEvent.ts +++ b/src/api/types/JobUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a Job is updated. diff --git a/src/api/types/JobUpdatedEventData.ts b/src/api/types/JobUpdatedEventData.ts index 667a6f1bc..ad8f20cc1 100644 --- a/src/api/types/JobUpdatedEventData.ts +++ b/src/api/types/JobUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface JobUpdatedEventData { /** Name of the affected object’s type, `"job"`. */ diff --git a/src/api/types/JobUpdatedEventObject.ts b/src/api/types/JobUpdatedEventObject.ts index e45de8f93..69142b916 100644 --- a/src/api/types/JobUpdatedEventObject.ts +++ b/src/api/types/JobUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface JobUpdatedEventObject { /** The updated job. */ diff --git a/src/api/types/LaborScheduledShiftCreatedEvent.ts b/src/api/types/LaborScheduledShiftCreatedEvent.ts index 298cbf438..f77eedcbb 100644 --- a/src/api/types/LaborScheduledShiftCreatedEvent.ts +++ b/src/api/types/LaborScheduledShiftCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [ScheduledShift](entity:ScheduledShift) is created. diff --git a/src/api/types/LaborScheduledShiftCreatedEventData.ts b/src/api/types/LaborScheduledShiftCreatedEventData.ts index 0904da14d..f710a9ce6 100644 --- a/src/api/types/LaborScheduledShiftCreatedEventData.ts +++ b/src/api/types/LaborScheduledShiftCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface LaborScheduledShiftCreatedEventData { /** The type of object affected by the event. For this event, the value is `scheduled_shift`. */ diff --git a/src/api/types/LaborScheduledShiftCreatedEventObject.ts b/src/api/types/LaborScheduledShiftCreatedEventObject.ts index fb2495f2c..b78cc2241 100644 --- a/src/api/types/LaborScheduledShiftCreatedEventObject.ts +++ b/src/api/types/LaborScheduledShiftCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface LaborScheduledShiftCreatedEventObject { /** The new `ScheduledShift`. */ diff --git a/src/api/types/LaborScheduledShiftDeletedEvent.ts b/src/api/types/LaborScheduledShiftDeletedEvent.ts index c3f821ebd..20af8987c 100644 --- a/src/api/types/LaborScheduledShiftDeletedEvent.ts +++ b/src/api/types/LaborScheduledShiftDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [ScheduledShift](entity:ScheduledShift) is deleted. diff --git a/src/api/types/LaborScheduledShiftDeletedEventData.ts b/src/api/types/LaborScheduledShiftDeletedEventData.ts index 098337422..d948a68a0 100644 --- a/src/api/types/LaborScheduledShiftDeletedEventData.ts +++ b/src/api/types/LaborScheduledShiftDeletedEventData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface LaborScheduledShiftDeletedEventData { /** The type of object affected by the event. For this event, the value is `scheduled_shift`. */ diff --git a/src/api/types/LaborScheduledShiftPublishedEvent.ts b/src/api/types/LaborScheduledShiftPublishedEvent.ts index 7ad721b5f..2b03c27ea 100644 --- a/src/api/types/LaborScheduledShiftPublishedEvent.ts +++ b/src/api/types/LaborScheduledShiftPublishedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [ScheduledShift](entity:ScheduledShift) is published. diff --git a/src/api/types/LaborScheduledShiftPublishedEventData.ts b/src/api/types/LaborScheduledShiftPublishedEventData.ts index c6b60a831..a837ce599 100644 --- a/src/api/types/LaborScheduledShiftPublishedEventData.ts +++ b/src/api/types/LaborScheduledShiftPublishedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface LaborScheduledShiftPublishedEventData { /** The type of object affected by the event. For this event, the value is `scheduled_shift`. */ diff --git a/src/api/types/LaborScheduledShiftPublishedEventObject.ts b/src/api/types/LaborScheduledShiftPublishedEventObject.ts index 922971cad..56f68ace8 100644 --- a/src/api/types/LaborScheduledShiftPublishedEventObject.ts +++ b/src/api/types/LaborScheduledShiftPublishedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface LaborScheduledShiftPublishedEventObject { /** The published `ScheduledShift`. */ diff --git a/src/api/types/LaborScheduledShiftUpdatedEvent.ts b/src/api/types/LaborScheduledShiftUpdatedEvent.ts index 5546a6df9..ff1177120 100644 --- a/src/api/types/LaborScheduledShiftUpdatedEvent.ts +++ b/src/api/types/LaborScheduledShiftUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [ScheduledShift](entity:ScheduledShift) is updated. diff --git a/src/api/types/LaborScheduledShiftUpdatedEventData.ts b/src/api/types/LaborScheduledShiftUpdatedEventData.ts index 8ee2d46a7..10a6bfebd 100644 --- a/src/api/types/LaborScheduledShiftUpdatedEventData.ts +++ b/src/api/types/LaborScheduledShiftUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface LaborScheduledShiftUpdatedEventData { /** The type of object affected by the event. For this event, the value is `scheduled_shift`. */ diff --git a/src/api/types/LaborScheduledShiftUpdatedEventObject.ts b/src/api/types/LaborScheduledShiftUpdatedEventObject.ts index 33e267783..726c1cb02 100644 --- a/src/api/types/LaborScheduledShiftUpdatedEventObject.ts +++ b/src/api/types/LaborScheduledShiftUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface LaborScheduledShiftUpdatedEventObject { /** The updated `ScheduledShift`. */ diff --git a/src/api/types/LaborShiftCreatedEvent.ts b/src/api/types/LaborShiftCreatedEvent.ts index 3a98aa3b9..50f481c25 100644 --- a/src/api/types/LaborShiftCreatedEvent.ts +++ b/src/api/types/LaborShiftCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a worker starts a [Shift](entity:Shift). diff --git a/src/api/types/LaborShiftCreatedEventData.ts b/src/api/types/LaborShiftCreatedEventData.ts index d10b7f899..59b9bfbcf 100644 --- a/src/api/types/LaborShiftCreatedEventData.ts +++ b/src/api/types/LaborShiftCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface LaborShiftCreatedEventData { /** The type of object affected by the event. For this event, the value is `shift`. */ diff --git a/src/api/types/LaborShiftCreatedEventObject.ts b/src/api/types/LaborShiftCreatedEventObject.ts index c6b13d9ca..b5d179491 100644 --- a/src/api/types/LaborShiftCreatedEventObject.ts +++ b/src/api/types/LaborShiftCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface LaborShiftCreatedEventObject { /** The new `Shift`. */ diff --git a/src/api/types/LaborShiftDeletedEvent.ts b/src/api/types/LaborShiftDeletedEvent.ts index 13a3597fc..3f89ce20f 100644 --- a/src/api/types/LaborShiftDeletedEvent.ts +++ b/src/api/types/LaborShiftDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [Shift](entity:Shift) is deleted. diff --git a/src/api/types/LaborShiftDeletedEventData.ts b/src/api/types/LaborShiftDeletedEventData.ts index cf194d285..ead517c78 100644 --- a/src/api/types/LaborShiftDeletedEventData.ts +++ b/src/api/types/LaborShiftDeletedEventData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface LaborShiftDeletedEventData { /** The type of object affected by the event. For this event, the value is `shift`. */ diff --git a/src/api/types/LaborShiftUpdatedEvent.ts b/src/api/types/LaborShiftUpdatedEvent.ts index ac3ea62c0..b5d16a143 100644 --- a/src/api/types/LaborShiftUpdatedEvent.ts +++ b/src/api/types/LaborShiftUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [Shift](entity:Shift) is updated. diff --git a/src/api/types/LaborShiftUpdatedEventData.ts b/src/api/types/LaborShiftUpdatedEventData.ts index e7eb04d5e..fe716c7d6 100644 --- a/src/api/types/LaborShiftUpdatedEventData.ts +++ b/src/api/types/LaborShiftUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface LaborShiftUpdatedEventData { /** The type of object affected by the event. For this event, the value is `shift`. */ diff --git a/src/api/types/LaborShiftUpdatedEventObject.ts b/src/api/types/LaborShiftUpdatedEventObject.ts index ff0f804ba..aca0d470e 100644 --- a/src/api/types/LaborShiftUpdatedEventObject.ts +++ b/src/api/types/LaborShiftUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface LaborShiftUpdatedEventObject { /** The updated `Shift`. */ diff --git a/src/api/types/LaborTimecardCreatedEvent.ts b/src/api/types/LaborTimecardCreatedEvent.ts index 78a586d8d..5b4512fe8 100644 --- a/src/api/types/LaborTimecardCreatedEvent.ts +++ b/src/api/types/LaborTimecardCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a worker starts a [Timecard](entity:Timecard). diff --git a/src/api/types/LaborTimecardCreatedEventData.ts b/src/api/types/LaborTimecardCreatedEventData.ts index f66a50029..71fd122e8 100644 --- a/src/api/types/LaborTimecardCreatedEventData.ts +++ b/src/api/types/LaborTimecardCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface LaborTimecardCreatedEventData { /** The type of object affected by the event. For this event, the value is `timecard`. */ diff --git a/src/api/types/LaborTimecardCreatedEventObject.ts b/src/api/types/LaborTimecardCreatedEventObject.ts index 30e2b2942..703303338 100644 --- a/src/api/types/LaborTimecardCreatedEventObject.ts +++ b/src/api/types/LaborTimecardCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface LaborTimecardCreatedEventObject { /** The new `Timecard`. */ diff --git a/src/api/types/LaborTimecardDeletedEvent.ts b/src/api/types/LaborTimecardDeletedEvent.ts index d80874b1b..7f914a3c2 100644 --- a/src/api/types/LaborTimecardDeletedEvent.ts +++ b/src/api/types/LaborTimecardDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [Timecard](entity:Timecard) is deleted. diff --git a/src/api/types/LaborTimecardDeletedEventData.ts b/src/api/types/LaborTimecardDeletedEventData.ts index f13be6757..5ad7bf3da 100644 --- a/src/api/types/LaborTimecardDeletedEventData.ts +++ b/src/api/types/LaborTimecardDeletedEventData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface LaborTimecardDeletedEventData { /** The type of object affected by the event. For this event, the value is `timecard`. */ diff --git a/src/api/types/LaborTimecardUpdatedEvent.ts b/src/api/types/LaborTimecardUpdatedEvent.ts index 0ab6ef2e0..cae70aa2e 100644 --- a/src/api/types/LaborTimecardUpdatedEvent.ts +++ b/src/api/types/LaborTimecardUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [Timecard](entity:Timecard) is updated. diff --git a/src/api/types/LaborTimecardUpdatedEventData.ts b/src/api/types/LaborTimecardUpdatedEventData.ts index 1c3d4026a..a4a26e515 100644 --- a/src/api/types/LaborTimecardUpdatedEventData.ts +++ b/src/api/types/LaborTimecardUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface LaborTimecardUpdatedEventData { /** The type of object affected by the event. For this event, the value is `timecard`. */ diff --git a/src/api/types/LaborTimecardUpdatedEventObject.ts b/src/api/types/LaborTimecardUpdatedEventObject.ts index 3a0275288..72c23a258 100644 --- a/src/api/types/LaborTimecardUpdatedEventObject.ts +++ b/src/api/types/LaborTimecardUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface LaborTimecardUpdatedEventObject { /** The updated `Timecard`. */ diff --git a/src/api/types/LinkCustomerToGiftCardResponse.ts b/src/api/types/LinkCustomerToGiftCardResponse.ts index c5e9c0f9a..e0bafe979 100644 --- a/src/api/types/LinkCustomerToGiftCardResponse.ts +++ b/src/api/types/LinkCustomerToGiftCardResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response that contains the linked `GiftCard` object. If the request resulted in errors, diff --git a/src/api/types/ListBankAccountsResponse.ts b/src/api/types/ListBankAccountsResponse.ts index a46626b74..2ab464731 100644 --- a/src/api/types/ListBankAccountsResponse.ts +++ b/src/api/types/ListBankAccountsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Response object returned by ListBankAccounts. diff --git a/src/api/types/ListBookingCustomAttributeDefinitionsResponse.ts b/src/api/types/ListBookingCustomAttributeDefinitionsResponse.ts index d5aa5584b..a2513f5fb 100644 --- a/src/api/types/ListBookingCustomAttributeDefinitionsResponse.ts +++ b/src/api/types/ListBookingCustomAttributeDefinitionsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [ListBookingCustomAttributeDefinitions](api-endpoint:BookingCustomAttributes-ListBookingCustomAttributeDefinitions) response. diff --git a/src/api/types/ListBookingCustomAttributesResponse.ts b/src/api/types/ListBookingCustomAttributesResponse.ts index cc725f033..ce84c0459 100644 --- a/src/api/types/ListBookingCustomAttributesResponse.ts +++ b/src/api/types/ListBookingCustomAttributesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [ListBookingCustomAttributes](api-endpoint:BookingCustomAttributes-ListBookingCustomAttributes) response. diff --git a/src/api/types/ListBookingsResponse.ts b/src/api/types/ListBookingsResponse.ts index 2daaddc35..e6ec3d16d 100644 --- a/src/api/types/ListBookingsResponse.ts +++ b/src/api/types/ListBookingsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface ListBookingsResponse { /** The list of targeted bookings. */ diff --git a/src/api/types/ListBreakTypesResponse.ts b/src/api/types/ListBreakTypesResponse.ts index 5311a175a..130fe20ea 100644 --- a/src/api/types/ListBreakTypesResponse.ts +++ b/src/api/types/ListBreakTypesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response to a request for a set of `BreakType` objects. The response contains diff --git a/src/api/types/ListCardsResponse.ts b/src/api/types/ListCardsResponse.ts index 5a576d97f..1d62d8cec 100644 --- a/src/api/types/ListCardsResponse.ts +++ b/src/api/types/ListCardsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/ListCashDrawerShiftEventsResponse.ts b/src/api/types/ListCashDrawerShiftEventsResponse.ts index 933f6ed86..3383ab7a6 100644 --- a/src/api/types/ListCashDrawerShiftEventsResponse.ts +++ b/src/api/types/ListCashDrawerShiftEventsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface ListCashDrawerShiftEventsResponse { /** diff --git a/src/api/types/ListCashDrawerShiftsResponse.ts b/src/api/types/ListCashDrawerShiftsResponse.ts index 73a98dec5..3e0d2e263 100644 --- a/src/api/types/ListCashDrawerShiftsResponse.ts +++ b/src/api/types/ListCashDrawerShiftsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface ListCashDrawerShiftsResponse { /** diff --git a/src/api/types/ListCatalogResponse.ts b/src/api/types/ListCatalogResponse.ts index 9f10755d0..b1b84b52d 100644 --- a/src/api/types/ListCatalogResponse.ts +++ b/src/api/types/ListCatalogResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface ListCatalogResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/ListChannelsRequestConstants.ts b/src/api/types/ListChannelsRequestConstants.ts deleted file mode 100644 index f0b7ca7c6..000000000 --- a/src/api/types/ListChannelsRequestConstants.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export type ListChannelsRequestConstants = "MAX_PAGE_SIZE"; diff --git a/src/api/types/ListChannelsResponse.ts b/src/api/types/ListChannelsResponse.ts deleted file mode 100644 index c4acb4a7c..000000000 --- a/src/api/types/ListChannelsResponse.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -export interface ListChannelsResponse { - /** Information about errors encountered during the request. */ - errors?: Square.Error_[]; - /** List of requested Channel. */ - channels?: Square.Channel[]; - /** The token required to retrieve the next page of results. */ - cursor?: string; -} diff --git a/src/api/types/ListCustomerCustomAttributeDefinitionsResponse.ts b/src/api/types/ListCustomerCustomAttributeDefinitionsResponse.ts index edb30347b..4f19c1fb0 100644 --- a/src/api/types/ListCustomerCustomAttributeDefinitionsResponse.ts +++ b/src/api/types/ListCustomerCustomAttributeDefinitionsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [ListCustomerCustomAttributeDefinitions](api-endpoint:CustomerCustomAttributes-ListCustomerCustomAttributeDefinitions) response. diff --git a/src/api/types/ListCustomerCustomAttributesResponse.ts b/src/api/types/ListCustomerCustomAttributesResponse.ts index fd789213c..5a657217d 100644 --- a/src/api/types/ListCustomerCustomAttributesResponse.ts +++ b/src/api/types/ListCustomerCustomAttributesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [ListCustomerCustomAttributes](api-endpoint:CustomerCustomAttributes-ListCustomerCustomAttributes) response. diff --git a/src/api/types/ListCustomerGroupsResponse.ts b/src/api/types/ListCustomerGroupsResponse.ts index 6375e311e..ac41c182a 100644 --- a/src/api/types/ListCustomerGroupsResponse.ts +++ b/src/api/types/ListCustomerGroupsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/ListCustomerSegmentsResponse.ts b/src/api/types/ListCustomerSegmentsResponse.ts index e254066bb..883cea16d 100644 --- a/src/api/types/ListCustomerSegmentsResponse.ts +++ b/src/api/types/ListCustomerSegmentsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body for requests to the `ListCustomerSegments` endpoint. diff --git a/src/api/types/ListCustomersResponse.ts b/src/api/types/ListCustomersResponse.ts index a119efbd7..bfb19bc90 100644 --- a/src/api/types/ListCustomersResponse.ts +++ b/src/api/types/ListCustomersResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/ListDeviceCodesResponse.ts b/src/api/types/ListDeviceCodesResponse.ts index 52e7b6e1d..5929459ee 100644 --- a/src/api/types/ListDeviceCodesResponse.ts +++ b/src/api/types/ListDeviceCodesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface ListDeviceCodesResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/ListDevicesResponse.ts b/src/api/types/ListDevicesResponse.ts index adbd4a0c4..d4bb92d53 100644 --- a/src/api/types/ListDevicesResponse.ts +++ b/src/api/types/ListDevicesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface ListDevicesResponse { /** Information about errors that occurred during the request. */ diff --git a/src/api/types/ListDisputeEvidenceResponse.ts b/src/api/types/ListDisputeEvidenceResponse.ts index d586fd095..5f54466da 100644 --- a/src/api/types/ListDisputeEvidenceResponse.ts +++ b/src/api/types/ListDisputeEvidenceResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields in a `ListDisputeEvidence` response. diff --git a/src/api/types/ListDisputesResponse.ts b/src/api/types/ListDisputesResponse.ts index c6446c96e..e5375c429 100644 --- a/src/api/types/ListDisputesResponse.ts +++ b/src/api/types/ListDisputesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines fields in a `ListDisputes` response. diff --git a/src/api/types/ListEmployeeWagesResponse.ts b/src/api/types/ListEmployeeWagesResponse.ts index ba4df9331..942884239 100644 --- a/src/api/types/ListEmployeeWagesResponse.ts +++ b/src/api/types/ListEmployeeWagesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response to a request for a set of `EmployeeWage` objects. The response contains diff --git a/src/api/types/ListEmployeesResponse.ts b/src/api/types/ListEmployeesResponse.ts index 99a6375bf..cc7e8a11e 100644 --- a/src/api/types/ListEmployeesResponse.ts +++ b/src/api/types/ListEmployeesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface ListEmployeesResponse { employees?: Square.Employee[]; diff --git a/src/api/types/ListEventTypesResponse.ts b/src/api/types/ListEventTypesResponse.ts index 460d22df9..109d6e21e 100644 --- a/src/api/types/ListEventTypesResponse.ts +++ b/src/api/types/ListEventTypesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/ListGiftCardActivitiesResponse.ts b/src/api/types/ListGiftCardActivitiesResponse.ts index ddbce6701..34fc283b3 100644 --- a/src/api/types/ListGiftCardActivitiesResponse.ts +++ b/src/api/types/ListGiftCardActivitiesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response that contains a list of `GiftCardActivity` objects. If the request resulted in errors, diff --git a/src/api/types/ListGiftCardsResponse.ts b/src/api/types/ListGiftCardsResponse.ts index f8fb1e4be..1b13da7bc 100644 --- a/src/api/types/ListGiftCardsResponse.ts +++ b/src/api/types/ListGiftCardsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response that contains a list of `GiftCard` objects. If the request resulted in errors, diff --git a/src/api/types/ListInvoicesResponse.ts b/src/api/types/ListInvoicesResponse.ts index e99b0fbce..6e45726bf 100644 --- a/src/api/types/ListInvoicesResponse.ts +++ b/src/api/types/ListInvoicesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Describes a `ListInvoice` response. diff --git a/src/api/types/ListJobsResponse.ts b/src/api/types/ListJobsResponse.ts index 6e18e18a1..5322bc98a 100644 --- a/src/api/types/ListJobsResponse.ts +++ b/src/api/types/ListJobsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [ListJobs](api-endpoint:Team-ListJobs) response. Either `jobs` or `errors` diff --git a/src/api/types/ListLocationBookingProfilesResponse.ts b/src/api/types/ListLocationBookingProfilesResponse.ts index 08093667c..b5f346193 100644 --- a/src/api/types/ListLocationBookingProfilesResponse.ts +++ b/src/api/types/ListLocationBookingProfilesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface ListLocationBookingProfilesResponse { /** The list of a seller's location booking profiles. */ diff --git a/src/api/types/ListLocationCustomAttributeDefinitionsResponse.ts b/src/api/types/ListLocationCustomAttributeDefinitionsResponse.ts index 14db478cd..26b6776aa 100644 --- a/src/api/types/ListLocationCustomAttributeDefinitionsResponse.ts +++ b/src/api/types/ListLocationCustomAttributeDefinitionsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [ListLocationCustomAttributeDefinitions](api-endpoint:LocationCustomAttributes-ListLocationCustomAttributeDefinitions) response. diff --git a/src/api/types/ListLocationCustomAttributesResponse.ts b/src/api/types/ListLocationCustomAttributesResponse.ts index 2afb5264c..c5ddf2867 100644 --- a/src/api/types/ListLocationCustomAttributesResponse.ts +++ b/src/api/types/ListLocationCustomAttributesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [ListLocationCustomAttributes](api-endpoint:LocationCustomAttributes-ListLocationCustomAttributes) response. diff --git a/src/api/types/ListLocationsResponse.ts b/src/api/types/ListLocationsResponse.ts index 63fe89c20..b03599ce5 100644 --- a/src/api/types/ListLocationsResponse.ts +++ b/src/api/types/ListLocationsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of a request diff --git a/src/api/types/ListLoyaltyProgramsResponse.ts b/src/api/types/ListLoyaltyProgramsResponse.ts index 79dab4c20..8ff095768 100644 --- a/src/api/types/ListLoyaltyProgramsResponse.ts +++ b/src/api/types/ListLoyaltyProgramsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response that contains all loyalty programs. diff --git a/src/api/types/ListLoyaltyPromotionsResponse.ts b/src/api/types/ListLoyaltyPromotionsResponse.ts index 90640f41a..500c81c9a 100644 --- a/src/api/types/ListLoyaltyPromotionsResponse.ts +++ b/src/api/types/ListLoyaltyPromotionsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [ListLoyaltyPromotions](api-endpoint:Loyalty-ListLoyaltyPromotions) response. diff --git a/src/api/types/ListMerchantCustomAttributeDefinitionsResponse.ts b/src/api/types/ListMerchantCustomAttributeDefinitionsResponse.ts index 2fd165712..bc8d167d1 100644 --- a/src/api/types/ListMerchantCustomAttributeDefinitionsResponse.ts +++ b/src/api/types/ListMerchantCustomAttributeDefinitionsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [ListMerchantCustomAttributeDefinitions](api-endpoint:MerchantCustomAttributes-ListMerchantCustomAttributeDefinitions) response. diff --git a/src/api/types/ListMerchantCustomAttributesResponse.ts b/src/api/types/ListMerchantCustomAttributesResponse.ts index 51c9cc0bc..06bd4e2f1 100644 --- a/src/api/types/ListMerchantCustomAttributesResponse.ts +++ b/src/api/types/ListMerchantCustomAttributesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [ListMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-ListMerchantCustomAttributes) response. diff --git a/src/api/types/ListMerchantsResponse.ts b/src/api/types/ListMerchantsResponse.ts index 6e42130d6..c90dae379 100644 --- a/src/api/types/ListMerchantsResponse.ts +++ b/src/api/types/ListMerchantsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response object returned by the [ListMerchant](api-endpoint:Merchants-ListMerchants) endpoint. diff --git a/src/api/types/ListOrderCustomAttributeDefinitionsResponse.ts b/src/api/types/ListOrderCustomAttributeDefinitionsResponse.ts index bbeaf37c0..8acfd8fcb 100644 --- a/src/api/types/ListOrderCustomAttributeDefinitionsResponse.ts +++ b/src/api/types/ListOrderCustomAttributeDefinitionsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response from listing order custom attribute definitions. diff --git a/src/api/types/ListOrderCustomAttributesResponse.ts b/src/api/types/ListOrderCustomAttributesResponse.ts index 6939f3c0e..73595ad53 100644 --- a/src/api/types/ListOrderCustomAttributesResponse.ts +++ b/src/api/types/ListOrderCustomAttributesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response from listing order custom attributes. diff --git a/src/api/types/ListPaymentLinksResponse.ts b/src/api/types/ListPaymentLinksResponse.ts index a5c9565a8..b380ee63e 100644 --- a/src/api/types/ListPaymentLinksResponse.ts +++ b/src/api/types/ListPaymentLinksResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface ListPaymentLinksResponse { /** Errors that occurred during the request. */ diff --git a/src/api/types/ListPaymentRefundsRequestSortField.ts b/src/api/types/ListPaymentRefundsRequestSortField.ts index 1b0f44d4c..c835a78d5 100644 --- a/src/api/types/ListPaymentRefundsRequestSortField.ts +++ b/src/api/types/ListPaymentRefundsRequestSortField.ts @@ -1,8 +1,9 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type ListPaymentRefundsRequestSortField = "CREATED_AT" | "UPDATED_AT"; export const ListPaymentRefundsRequestSortField = { CreatedAt: "CREATED_AT", UpdatedAt: "UPDATED_AT", } as const; -export type ListPaymentRefundsRequestSortField = - (typeof ListPaymentRefundsRequestSortField)[keyof typeof ListPaymentRefundsRequestSortField]; diff --git a/src/api/types/ListPaymentRefundsResponse.ts b/src/api/types/ListPaymentRefundsResponse.ts index cfbfa9964..a2f5aa8e1 100644 --- a/src/api/types/ListPaymentRefundsResponse.ts +++ b/src/api/types/ListPaymentRefundsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the response returned by [ListPaymentRefunds](api-endpoint:Refunds-ListPaymentRefunds). diff --git a/src/api/types/ListPaymentsRequestSortField.ts b/src/api/types/ListPaymentsRequestSortField.ts index 222202be6..5062db1b6 100644 --- a/src/api/types/ListPaymentsRequestSortField.ts +++ b/src/api/types/ListPaymentsRequestSortField.ts @@ -1,9 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type ListPaymentsRequestSortField = "CREATED_AT" | "OFFLINE_CREATED_AT" | "UPDATED_AT"; export const ListPaymentsRequestSortField = { CreatedAt: "CREATED_AT", OfflineCreatedAt: "OFFLINE_CREATED_AT", UpdatedAt: "UPDATED_AT", } as const; -export type ListPaymentsRequestSortField = - (typeof ListPaymentsRequestSortField)[keyof typeof ListPaymentsRequestSortField]; diff --git a/src/api/types/ListPaymentsResponse.ts b/src/api/types/ListPaymentsResponse.ts index 07474db12..65cb703a0 100644 --- a/src/api/types/ListPaymentsResponse.ts +++ b/src/api/types/ListPaymentsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the response returned by [ListPayments](api-endpoint:Payments-ListPayments). diff --git a/src/api/types/ListPayoutEntriesResponse.ts b/src/api/types/ListPayoutEntriesResponse.ts index 313d5b8d1..fad7d4893 100644 --- a/src/api/types/ListPayoutEntriesResponse.ts +++ b/src/api/types/ListPayoutEntriesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response to retrieve payout records entries. diff --git a/src/api/types/ListPayoutsResponse.ts b/src/api/types/ListPayoutsResponse.ts index 59eda7f77..6a76b4579 100644 --- a/src/api/types/ListPayoutsResponse.ts +++ b/src/api/types/ListPayoutsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response to retrieve payout records entries. diff --git a/src/api/types/ListSitesResponse.ts b/src/api/types/ListSitesResponse.ts index b4d0a1804..5a329a381 100644 --- a/src/api/types/ListSitesResponse.ts +++ b/src/api/types/ListSitesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a `ListSites` response. The response can include either `sites` or `errors`. diff --git a/src/api/types/ListSubscriptionEventsResponse.ts b/src/api/types/ListSubscriptionEventsResponse.ts index e9b3cc49f..2b2f1e37d 100644 --- a/src/api/types/ListSubscriptionEventsResponse.ts +++ b/src/api/types/ListSubscriptionEventsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines output parameters in a response from the diff --git a/src/api/types/ListTeamMemberBookingProfilesResponse.ts b/src/api/types/ListTeamMemberBookingProfilesResponse.ts index 4c7b464f6..01db09ff2 100644 --- a/src/api/types/ListTeamMemberBookingProfilesResponse.ts +++ b/src/api/types/ListTeamMemberBookingProfilesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface ListTeamMemberBookingProfilesResponse { /** diff --git a/src/api/types/ListTeamMemberWagesResponse.ts b/src/api/types/ListTeamMemberWagesResponse.ts index 5a8c51cca..363e6aea4 100644 --- a/src/api/types/ListTeamMemberWagesResponse.ts +++ b/src/api/types/ListTeamMemberWagesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response to a request for a set of `TeamMemberWage` objects. The response contains diff --git a/src/api/types/ListTransactionsResponse.ts b/src/api/types/ListTransactionsResponse.ts index b8918b129..515c68cd5 100644 --- a/src/api/types/ListTransactionsResponse.ts +++ b/src/api/types/ListTransactionsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/ListWebhookEventTypesResponse.ts b/src/api/types/ListWebhookEventTypesResponse.ts index fd0a1e4e2..8f365f9df 100644 --- a/src/api/types/ListWebhookEventTypesResponse.ts +++ b/src/api/types/ListWebhookEventTypesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/ListWebhookSubscriptionsResponse.ts b/src/api/types/ListWebhookSubscriptionsResponse.ts index 7849ae01d..968cd9a68 100644 --- a/src/api/types/ListWebhookSubscriptionsResponse.ts +++ b/src/api/types/ListWebhookSubscriptionsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/ListWorkweekConfigsResponse.ts b/src/api/types/ListWorkweekConfigsResponse.ts index bb6e12cc0..e24e7e639 100644 --- a/src/api/types/ListWorkweekConfigsResponse.ts +++ b/src/api/types/ListWorkweekConfigsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response to a request for a set of `WorkweekConfig` objects. The response contains diff --git a/src/api/types/Location.ts b/src/api/types/Location.ts index cb17835cd..070551111 100644 --- a/src/api/types/Location.ts +++ b/src/api/types/Location.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). diff --git a/src/api/types/LocationBookingProfile.ts b/src/api/types/LocationBookingProfile.ts index 6ba3d8128..c75b777aa 100644 --- a/src/api/types/LocationBookingProfile.ts +++ b/src/api/types/LocationBookingProfile.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The booking profile of a seller's location, including the location's ID and whether the location is enabled for online booking. diff --git a/src/api/types/LocationCapability.ts b/src/api/types/LocationCapability.ts index 10408b9d5..93dc952ea 100644 --- a/src/api/types/LocationCapability.ts +++ b/src/api/types/LocationCapability.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The capabilities a location might have. */ +/** + * The capabilities a location might have. + */ +export type LocationCapability = "CREDIT_CARD_PROCESSING" | "AUTOMATIC_TRANSFERS" | "UNLINKED_REFUNDS"; export const LocationCapability = { CreditCardProcessing: "CREDIT_CARD_PROCESSING", AutomaticTransfers: "AUTOMATIC_TRANSFERS", UnlinkedRefunds: "UNLINKED_REFUNDS", } as const; -export type LocationCapability = (typeof LocationCapability)[keyof typeof LocationCapability]; diff --git a/src/api/types/LocationCreatedEvent.ts b/src/api/types/LocationCreatedEvent.ts index 4372d787f..00654f2b6 100644 --- a/src/api/types/LocationCreatedEvent.ts +++ b/src/api/types/LocationCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [Location](entity:Location) is created. diff --git a/src/api/types/LocationCreatedEventData.ts b/src/api/types/LocationCreatedEventData.ts index 6ad7160d7..a55b34988 100644 --- a/src/api/types/LocationCreatedEventData.ts +++ b/src/api/types/LocationCreatedEventData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface LocationCreatedEventData { /** Name of the affected object’s type, `"location"`. */ diff --git a/src/api/types/LocationCustomAttributeDefinitionOwnedCreatedEvent.ts b/src/api/types/LocationCustomAttributeDefinitionOwnedCreatedEvent.ts index 8f40b6a56..5139600a2 100644 --- a/src/api/types/LocationCustomAttributeDefinitionOwnedCreatedEvent.ts +++ b/src/api/types/LocationCustomAttributeDefinitionOwnedCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a location [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/LocationCustomAttributeDefinitionOwnedDeletedEvent.ts b/src/api/types/LocationCustomAttributeDefinitionOwnedDeletedEvent.ts index e2a545e46..e0e5da3aa 100644 --- a/src/api/types/LocationCustomAttributeDefinitionOwnedDeletedEvent.ts +++ b/src/api/types/LocationCustomAttributeDefinitionOwnedDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a location [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/LocationCustomAttributeDefinitionOwnedUpdatedEvent.ts b/src/api/types/LocationCustomAttributeDefinitionOwnedUpdatedEvent.ts index 2e0a844a4..d187dd3f1 100644 --- a/src/api/types/LocationCustomAttributeDefinitionOwnedUpdatedEvent.ts +++ b/src/api/types/LocationCustomAttributeDefinitionOwnedUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a location [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/LocationCustomAttributeDefinitionVisibleCreatedEvent.ts b/src/api/types/LocationCustomAttributeDefinitionVisibleCreatedEvent.ts index 92b3e4ea6..e1093a350 100644 --- a/src/api/types/LocationCustomAttributeDefinitionVisibleCreatedEvent.ts +++ b/src/api/types/LocationCustomAttributeDefinitionVisibleCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a location [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/LocationCustomAttributeDefinitionVisibleDeletedEvent.ts b/src/api/types/LocationCustomAttributeDefinitionVisibleDeletedEvent.ts index 98fd46647..bf624af8b 100644 --- a/src/api/types/LocationCustomAttributeDefinitionVisibleDeletedEvent.ts +++ b/src/api/types/LocationCustomAttributeDefinitionVisibleDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a location [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/LocationCustomAttributeDefinitionVisibleUpdatedEvent.ts b/src/api/types/LocationCustomAttributeDefinitionVisibleUpdatedEvent.ts index 91c695d6d..dca159f86 100644 --- a/src/api/types/LocationCustomAttributeDefinitionVisibleUpdatedEvent.ts +++ b/src/api/types/LocationCustomAttributeDefinitionVisibleUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a location [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/LocationCustomAttributeOwnedDeletedEvent.ts b/src/api/types/LocationCustomAttributeOwnedDeletedEvent.ts index f560e1d2b..3fc2337b4 100644 --- a/src/api/types/LocationCustomAttributeOwnedDeletedEvent.ts +++ b/src/api/types/LocationCustomAttributeOwnedDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a location [custom attribute](entity:CustomAttribute) diff --git a/src/api/types/LocationCustomAttributeOwnedUpdatedEvent.ts b/src/api/types/LocationCustomAttributeOwnedUpdatedEvent.ts index 09302ad06..7323a84e1 100644 --- a/src/api/types/LocationCustomAttributeOwnedUpdatedEvent.ts +++ b/src/api/types/LocationCustomAttributeOwnedUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a location [custom attribute](entity:CustomAttribute) owned by the diff --git a/src/api/types/LocationCustomAttributeVisibleDeletedEvent.ts b/src/api/types/LocationCustomAttributeVisibleDeletedEvent.ts index 315ff2a91..e9ef28cb5 100644 --- a/src/api/types/LocationCustomAttributeVisibleDeletedEvent.ts +++ b/src/api/types/LocationCustomAttributeVisibleDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a location [custom attribute](entity:CustomAttribute) that is visible to the diff --git a/src/api/types/LocationCustomAttributeVisibleUpdatedEvent.ts b/src/api/types/LocationCustomAttributeVisibleUpdatedEvent.ts index 9d0919594..68db4d117 100644 --- a/src/api/types/LocationCustomAttributeVisibleUpdatedEvent.ts +++ b/src/api/types/LocationCustomAttributeVisibleUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a location [custom attribute](entity:CustomAttribute) that is visible diff --git a/src/api/types/LocationSettingsUpdatedEvent.ts b/src/api/types/LocationSettingsUpdatedEvent.ts index 02bcfda44..d5156843c 100644 --- a/src/api/types/LocationSettingsUpdatedEvent.ts +++ b/src/api/types/LocationSettingsUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when online checkout location settings are updated diff --git a/src/api/types/LocationSettingsUpdatedEventData.ts b/src/api/types/LocationSettingsUpdatedEventData.ts index 6e0d8f2e8..cc5d90a38 100644 --- a/src/api/types/LocationSettingsUpdatedEventData.ts +++ b/src/api/types/LocationSettingsUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface LocationSettingsUpdatedEventData { /** Name of the updated object’s type, `"online_checkout.location_settings"`. */ diff --git a/src/api/types/LocationSettingsUpdatedEventObject.ts b/src/api/types/LocationSettingsUpdatedEventObject.ts index 276010596..ca7ef9d8e 100644 --- a/src/api/types/LocationSettingsUpdatedEventObject.ts +++ b/src/api/types/LocationSettingsUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface LocationSettingsUpdatedEventObject { /** The updated location settings. */ diff --git a/src/api/types/LocationStatus.ts b/src/api/types/LocationStatus.ts index ed166b04a..b9cb3d638 100644 --- a/src/api/types/LocationStatus.ts +++ b/src/api/types/LocationStatus.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** A location's status. */ +/** + * A location's status. + */ +export type LocationStatus = "ACTIVE" | "INACTIVE"; export const LocationStatus = { Active: "ACTIVE", Inactive: "INACTIVE", } as const; -export type LocationStatus = (typeof LocationStatus)[keyof typeof LocationStatus]; diff --git a/src/api/types/LocationType.ts b/src/api/types/LocationType.ts index 9302ef938..f9021c395 100644 --- a/src/api/types/LocationType.ts +++ b/src/api/types/LocationType.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** A location's type. */ +/** + * A location's type. + */ +export type LocationType = "PHYSICAL" | "MOBILE"; export const LocationType = { Physical: "PHYSICAL", Mobile: "MOBILE", } as const; -export type LocationType = (typeof LocationType)[keyof typeof LocationType]; diff --git a/src/api/types/LocationUpdatedEvent.ts b/src/api/types/LocationUpdatedEvent.ts index c4f26505d..ad9581061 100644 --- a/src/api/types/LocationUpdatedEvent.ts +++ b/src/api/types/LocationUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [Location](entity:Location) is updated. diff --git a/src/api/types/LocationUpdatedEventData.ts b/src/api/types/LocationUpdatedEventData.ts index d78118247..f5bd36949 100644 --- a/src/api/types/LocationUpdatedEventData.ts +++ b/src/api/types/LocationUpdatedEventData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface LocationUpdatedEventData { /** Name of the affected object’s type, `"location"`. */ diff --git a/src/api/types/LoyaltyAccount.ts b/src/api/types/LoyaltyAccount.ts index 1a9a9c0cf..0f8dd4738 100644 --- a/src/api/types/LoyaltyAccount.ts +++ b/src/api/types/LoyaltyAccount.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Describes a loyalty account in a [loyalty program](entity:LoyaltyProgram). For more information, see @@ -25,11 +27,10 @@ export interface LoyaltyAccount { * The timestamp when the buyer joined the loyalty program, in RFC 3339 format. This field is used to display the **Enrolled On** or **Member Since** date in first-party Square products. * * If this field is not set in a `CreateLoyaltyAccount` request, Square populates it after the buyer's first action on their account - * (when `AccumulateLoyaltyPoints` or `CreateLoyaltyReward` is called). In first-party flows, Square populates the field when the buyer agrees to the terms of service on Square Point of Sale. + * (when `AccumulateLoyaltyPoints` or `CreateLoyaltyReward` is called). In first-party flows, Square populates the field when the buyer agrees to the terms of service in Square Point of Sale. * - * If this field is set in a `CreateLoyaltyAccount` request, it is meant to be used when there is a loyalty migration from another system and into Square. - * In that case, the timestamp can reflect when the buyer originally enrolled in the previous system. It may represent a current or past date, but cannot be set in the future. - * Note: Setting this field in this scenario does not, by itself, impact the first-party enrollment flow on Square Point of Sale. + * This field is typically specified in a `CreateLoyaltyAccount` request when creating a loyalty account for a buyer who already interacted with their account. + * For example, you would set this field when migrating accounts from an external system. The timestamp in the request can represent a current or previous date and time, but it cannot be set for the future. */ enrolledAt?: string | null; /** The timestamp when the loyalty account was created, in RFC 3339 format. */ diff --git a/src/api/types/LoyaltyAccountCreatedEvent.ts b/src/api/types/LoyaltyAccountCreatedEvent.ts index c9917c934..f903e6b8e 100644 --- a/src/api/types/LoyaltyAccountCreatedEvent.ts +++ b/src/api/types/LoyaltyAccountCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [loyalty account](entity:LoyaltyAccount) is created. diff --git a/src/api/types/LoyaltyAccountCreatedEventData.ts b/src/api/types/LoyaltyAccountCreatedEventData.ts index ba08a0b0b..e2121f78b 100644 --- a/src/api/types/LoyaltyAccountCreatedEventData.ts +++ b/src/api/types/LoyaltyAccountCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The data associated with a `loyalty.account.created` event. diff --git a/src/api/types/LoyaltyAccountCreatedEventObject.ts b/src/api/types/LoyaltyAccountCreatedEventObject.ts index 9b4f3a355..42652de88 100644 --- a/src/api/types/LoyaltyAccountCreatedEventObject.ts +++ b/src/api/types/LoyaltyAccountCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface LoyaltyAccountCreatedEventObject { /** The loyalty account that was created. */ diff --git a/src/api/types/LoyaltyAccountDeletedEvent.ts b/src/api/types/LoyaltyAccountDeletedEvent.ts index 36d8608e1..111ab9f04 100644 --- a/src/api/types/LoyaltyAccountDeletedEvent.ts +++ b/src/api/types/LoyaltyAccountDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [loyalty account](entity:LoyaltyAccount) is deleted. diff --git a/src/api/types/LoyaltyAccountDeletedEventData.ts b/src/api/types/LoyaltyAccountDeletedEventData.ts index 85bf70193..bb91e983f 100644 --- a/src/api/types/LoyaltyAccountDeletedEventData.ts +++ b/src/api/types/LoyaltyAccountDeletedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The data associated with a `loyalty.account.deleted` event. diff --git a/src/api/types/LoyaltyAccountDeletedEventObject.ts b/src/api/types/LoyaltyAccountDeletedEventObject.ts index 3713f98ac..f873af4e0 100644 --- a/src/api/types/LoyaltyAccountDeletedEventObject.ts +++ b/src/api/types/LoyaltyAccountDeletedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface LoyaltyAccountDeletedEventObject { /** The loyalty account that was deleted. */ diff --git a/src/api/types/LoyaltyAccountExpiringPointDeadline.ts b/src/api/types/LoyaltyAccountExpiringPointDeadline.ts index 2204b8422..778b340b3 100644 --- a/src/api/types/LoyaltyAccountExpiringPointDeadline.ts +++ b/src/api/types/LoyaltyAccountExpiringPointDeadline.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents a set of points for a loyalty account that are scheduled to expire on a specific date. diff --git a/src/api/types/LoyaltyAccountMapping.ts b/src/api/types/LoyaltyAccountMapping.ts index 6f26c9807..59d14a0b3 100644 --- a/src/api/types/LoyaltyAccountMapping.ts +++ b/src/api/types/LoyaltyAccountMapping.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents the mapping that associates a loyalty account with a buyer. diff --git a/src/api/types/LoyaltyAccountMappingType.ts b/src/api/types/LoyaltyAccountMappingType.ts index 6de787d37..3824a4777 100644 --- a/src/api/types/LoyaltyAccountMappingType.ts +++ b/src/api/types/LoyaltyAccountMappingType.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The type of mapping. diff --git a/src/api/types/LoyaltyAccountUpdatedEvent.ts b/src/api/types/LoyaltyAccountUpdatedEvent.ts index e44bf3252..e42a752b9 100644 --- a/src/api/types/LoyaltyAccountUpdatedEvent.ts +++ b/src/api/types/LoyaltyAccountUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [loyalty account](entity:LoyaltyAccount) is updated. diff --git a/src/api/types/LoyaltyAccountUpdatedEventData.ts b/src/api/types/LoyaltyAccountUpdatedEventData.ts index cff945cd5..32ef96617 100644 --- a/src/api/types/LoyaltyAccountUpdatedEventData.ts +++ b/src/api/types/LoyaltyAccountUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The data associated with a `loyalty.account.updated` event. diff --git a/src/api/types/LoyaltyAccountUpdatedEventObject.ts b/src/api/types/LoyaltyAccountUpdatedEventObject.ts index ea14f5574..e9d837fc5 100644 --- a/src/api/types/LoyaltyAccountUpdatedEventObject.ts +++ b/src/api/types/LoyaltyAccountUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface LoyaltyAccountUpdatedEventObject { /** The loyalty account that was updated. */ diff --git a/src/api/types/LoyaltyEvent.ts b/src/api/types/LoyaltyEvent.ts index 0d1499926..1f95583c3 100644 --- a/src/api/types/LoyaltyEvent.ts +++ b/src/api/types/LoyaltyEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Provides information about a loyalty event. diff --git a/src/api/types/LoyaltyEventAccumulatePoints.ts b/src/api/types/LoyaltyEventAccumulatePoints.ts index 86ca99628..11a26a152 100644 --- a/src/api/types/LoyaltyEventAccumulatePoints.ts +++ b/src/api/types/LoyaltyEventAccumulatePoints.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Provides metadata when the event `type` is `ACCUMULATE_POINTS`. diff --git a/src/api/types/LoyaltyEventAccumulatePromotionPoints.ts b/src/api/types/LoyaltyEventAccumulatePromotionPoints.ts index 9a27b0aae..9aff14b5d 100644 --- a/src/api/types/LoyaltyEventAccumulatePromotionPoints.ts +++ b/src/api/types/LoyaltyEventAccumulatePromotionPoints.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Provides metadata when the event `type` is `ACCUMULATE_PROMOTION_POINTS`. diff --git a/src/api/types/LoyaltyEventAdjustPoints.ts b/src/api/types/LoyaltyEventAdjustPoints.ts index 72e5d4457..92ea5fca2 100644 --- a/src/api/types/LoyaltyEventAdjustPoints.ts +++ b/src/api/types/LoyaltyEventAdjustPoints.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Provides metadata when the event `type` is `ADJUST_POINTS`. diff --git a/src/api/types/LoyaltyEventCreateReward.ts b/src/api/types/LoyaltyEventCreateReward.ts index f9716d190..9ca80fbb6 100644 --- a/src/api/types/LoyaltyEventCreateReward.ts +++ b/src/api/types/LoyaltyEventCreateReward.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Provides metadata when the event `type` is `CREATE_REWARD`. diff --git a/src/api/types/LoyaltyEventCreatedEvent.ts b/src/api/types/LoyaltyEventCreatedEvent.ts index 3172859d0..686c00240 100644 --- a/src/api/types/LoyaltyEventCreatedEvent.ts +++ b/src/api/types/LoyaltyEventCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [loyalty event](entity:LoyaltyEvent) is created. diff --git a/src/api/types/LoyaltyEventCreatedEventData.ts b/src/api/types/LoyaltyEventCreatedEventData.ts index 282647243..874b67bcd 100644 --- a/src/api/types/LoyaltyEventCreatedEventData.ts +++ b/src/api/types/LoyaltyEventCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The data associated with a `loyalty.event.created` event. diff --git a/src/api/types/LoyaltyEventCreatedEventObject.ts b/src/api/types/LoyaltyEventCreatedEventObject.ts index cce9736ed..0dd22c3f2 100644 --- a/src/api/types/LoyaltyEventCreatedEventObject.ts +++ b/src/api/types/LoyaltyEventCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface LoyaltyEventCreatedEventObject { /** The loyalty event that was created. */ diff --git a/src/api/types/LoyaltyEventDateTimeFilter.ts b/src/api/types/LoyaltyEventDateTimeFilter.ts index 4103a4dfb..55bf54033 100644 --- a/src/api/types/LoyaltyEventDateTimeFilter.ts +++ b/src/api/types/LoyaltyEventDateTimeFilter.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Filter events by date time range. diff --git a/src/api/types/LoyaltyEventDeleteReward.ts b/src/api/types/LoyaltyEventDeleteReward.ts index b38a878de..8c4bf1d44 100644 --- a/src/api/types/LoyaltyEventDeleteReward.ts +++ b/src/api/types/LoyaltyEventDeleteReward.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Provides metadata when the event `type` is `DELETE_REWARD`. diff --git a/src/api/types/LoyaltyEventExpirePoints.ts b/src/api/types/LoyaltyEventExpirePoints.ts index 86ee5f3ff..063d100c5 100644 --- a/src/api/types/LoyaltyEventExpirePoints.ts +++ b/src/api/types/LoyaltyEventExpirePoints.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Provides metadata when the event `type` is `EXPIRE_POINTS`. diff --git a/src/api/types/LoyaltyEventFilter.ts b/src/api/types/LoyaltyEventFilter.ts index 03d927161..2b0b4788f 100644 --- a/src/api/types/LoyaltyEventFilter.ts +++ b/src/api/types/LoyaltyEventFilter.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The filtering criteria. If the request specifies multiple filters, diff --git a/src/api/types/LoyaltyEventLocationFilter.ts b/src/api/types/LoyaltyEventLocationFilter.ts index 3ec942158..0b3d8fe91 100644 --- a/src/api/types/LoyaltyEventLocationFilter.ts +++ b/src/api/types/LoyaltyEventLocationFilter.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Filter events by location. diff --git a/src/api/types/LoyaltyEventLoyaltyAccountFilter.ts b/src/api/types/LoyaltyEventLoyaltyAccountFilter.ts index 0b39762a5..a0e04bf97 100644 --- a/src/api/types/LoyaltyEventLoyaltyAccountFilter.ts +++ b/src/api/types/LoyaltyEventLoyaltyAccountFilter.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Filter events by loyalty account. diff --git a/src/api/types/LoyaltyEventOrderFilter.ts b/src/api/types/LoyaltyEventOrderFilter.ts index 5acc0d8f0..b051f9fdd 100644 --- a/src/api/types/LoyaltyEventOrderFilter.ts +++ b/src/api/types/LoyaltyEventOrderFilter.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Filter events by the order associated with the event. diff --git a/src/api/types/LoyaltyEventOther.ts b/src/api/types/LoyaltyEventOther.ts index be5b78548..3451ccf3a 100644 --- a/src/api/types/LoyaltyEventOther.ts +++ b/src/api/types/LoyaltyEventOther.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Provides metadata when the event `type` is `OTHER`. diff --git a/src/api/types/LoyaltyEventQuery.ts b/src/api/types/LoyaltyEventQuery.ts index 142b09139..12a06292f 100644 --- a/src/api/types/LoyaltyEventQuery.ts +++ b/src/api/types/LoyaltyEventQuery.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a query used to search for loyalty events. diff --git a/src/api/types/LoyaltyEventRedeemReward.ts b/src/api/types/LoyaltyEventRedeemReward.ts index 5ec8f0fd1..555d84f0d 100644 --- a/src/api/types/LoyaltyEventRedeemReward.ts +++ b/src/api/types/LoyaltyEventRedeemReward.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Provides metadata when the event `type` is `REDEEM_REWARD`. diff --git a/src/api/types/LoyaltyEventSource.ts b/src/api/types/LoyaltyEventSource.ts index b60585134..cdd90ab3a 100644 --- a/src/api/types/LoyaltyEventSource.ts +++ b/src/api/types/LoyaltyEventSource.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Defines whether the event was generated by the Square Point of Sale. */ +/** + * Defines whether the event was generated by the Square Point of Sale. + */ +export type LoyaltyEventSource = "SQUARE" | "LOYALTY_API"; export const LoyaltyEventSource = { Square: "SQUARE", LoyaltyApi: "LOYALTY_API", } as const; -export type LoyaltyEventSource = (typeof LoyaltyEventSource)[keyof typeof LoyaltyEventSource]; diff --git a/src/api/types/LoyaltyEventType.ts b/src/api/types/LoyaltyEventType.ts index 3bfbdb044..3c0232c1f 100644 --- a/src/api/types/LoyaltyEventType.ts +++ b/src/api/types/LoyaltyEventType.ts @@ -1,6 +1,19 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The type of the loyalty event. */ +/** + * The type of the loyalty event. + */ +export type LoyaltyEventType = + | "ACCUMULATE_POINTS" + | "CREATE_REWARD" + | "REDEEM_REWARD" + | "DELETE_REWARD" + | "ADJUST_POINTS" + | "EXPIRE_POINTS" + | "OTHER" + | "ACCUMULATE_PROMOTION_POINTS"; export const LoyaltyEventType = { AccumulatePoints: "ACCUMULATE_POINTS", CreateReward: "CREATE_REWARD", @@ -11,4 +24,3 @@ export const LoyaltyEventType = { Other: "OTHER", AccumulatePromotionPoints: "ACCUMULATE_PROMOTION_POINTS", } as const; -export type LoyaltyEventType = (typeof LoyaltyEventType)[keyof typeof LoyaltyEventType]; diff --git a/src/api/types/LoyaltyEventTypeFilter.ts b/src/api/types/LoyaltyEventTypeFilter.ts index 273fbe116..f8308dd64 100644 --- a/src/api/types/LoyaltyEventTypeFilter.ts +++ b/src/api/types/LoyaltyEventTypeFilter.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Filter events by event type. diff --git a/src/api/types/LoyaltyProgram.ts b/src/api/types/LoyaltyProgram.ts index 6a7cae7df..944dfefb2 100644 --- a/src/api/types/LoyaltyProgram.ts +++ b/src/api/types/LoyaltyProgram.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a Square loyalty program. Loyalty programs define how buyers can earn points and redeem points for rewards. diff --git a/src/api/types/LoyaltyProgramAccrualRule.ts b/src/api/types/LoyaltyProgramAccrualRule.ts index 3207e8eb2..233cc9068 100644 --- a/src/api/types/LoyaltyProgramAccrualRule.ts +++ b/src/api/types/LoyaltyProgramAccrualRule.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an accrual rule, which defines how buyers can earn points from the base [loyalty program](entity:LoyaltyProgram). diff --git a/src/api/types/LoyaltyProgramAccrualRuleCategoryData.ts b/src/api/types/LoyaltyProgramAccrualRuleCategoryData.ts index dc71281d3..4fb4d01da 100644 --- a/src/api/types/LoyaltyProgramAccrualRuleCategoryData.ts +++ b/src/api/types/LoyaltyProgramAccrualRuleCategoryData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents additional data for rules with the `CATEGORY` accrual type. diff --git a/src/api/types/LoyaltyProgramAccrualRuleItemVariationData.ts b/src/api/types/LoyaltyProgramAccrualRuleItemVariationData.ts index 8bba49e98..e3bbea3e7 100644 --- a/src/api/types/LoyaltyProgramAccrualRuleItemVariationData.ts +++ b/src/api/types/LoyaltyProgramAccrualRuleItemVariationData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents additional data for rules with the `ITEM_VARIATION` accrual type. diff --git a/src/api/types/LoyaltyProgramAccrualRuleSpendData.ts b/src/api/types/LoyaltyProgramAccrualRuleSpendData.ts index 6c0362f3c..d89798aaa 100644 --- a/src/api/types/LoyaltyProgramAccrualRuleSpendData.ts +++ b/src/api/types/LoyaltyProgramAccrualRuleSpendData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents additional data for rules with the `SPEND` accrual type. diff --git a/src/api/types/LoyaltyProgramAccrualRuleTaxMode.ts b/src/api/types/LoyaltyProgramAccrualRuleTaxMode.ts index 706d8cf91..0d1bb20b0 100644 --- a/src/api/types/LoyaltyProgramAccrualRuleTaxMode.ts +++ b/src/api/types/LoyaltyProgramAccrualRuleTaxMode.ts @@ -1,12 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Indicates how taxes should be treated when calculating the purchase amount used for loyalty points accrual. * This setting applies only to `SPEND` accrual rules or `VISIT` accrual rules that have a minimum spend requirement. */ +export type LoyaltyProgramAccrualRuleTaxMode = "BEFORE_TAX" | "AFTER_TAX"; export const LoyaltyProgramAccrualRuleTaxMode = { BeforeTax: "BEFORE_TAX", AfterTax: "AFTER_TAX", } as const; -export type LoyaltyProgramAccrualRuleTaxMode = - (typeof LoyaltyProgramAccrualRuleTaxMode)[keyof typeof LoyaltyProgramAccrualRuleTaxMode]; diff --git a/src/api/types/LoyaltyProgramAccrualRuleType.ts b/src/api/types/LoyaltyProgramAccrualRuleType.ts index c4f09c43b..b8159b822 100644 --- a/src/api/types/LoyaltyProgramAccrualRuleType.ts +++ b/src/api/types/LoyaltyProgramAccrualRuleType.ts @@ -1,11 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The type of the accrual rule that defines how buyers can earn points. */ +/** + * The type of the accrual rule that defines how buyers can earn points. + */ +export type LoyaltyProgramAccrualRuleType = "VISIT" | "SPEND" | "ITEM_VARIATION" | "CATEGORY"; export const LoyaltyProgramAccrualRuleType = { Visit: "VISIT", Spend: "SPEND", ItemVariation: "ITEM_VARIATION", Category: "CATEGORY", } as const; -export type LoyaltyProgramAccrualRuleType = - (typeof LoyaltyProgramAccrualRuleType)[keyof typeof LoyaltyProgramAccrualRuleType]; diff --git a/src/api/types/LoyaltyProgramAccrualRuleVisitData.ts b/src/api/types/LoyaltyProgramAccrualRuleVisitData.ts index 2d439e6c9..ca0a7548a 100644 --- a/src/api/types/LoyaltyProgramAccrualRuleVisitData.ts +++ b/src/api/types/LoyaltyProgramAccrualRuleVisitData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents additional data for rules with the `VISIT` accrual type. diff --git a/src/api/types/LoyaltyProgramCreatedEvent.ts b/src/api/types/LoyaltyProgramCreatedEvent.ts index 6f676459a..c1acfa5ed 100644 --- a/src/api/types/LoyaltyProgramCreatedEvent.ts +++ b/src/api/types/LoyaltyProgramCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [loyalty program](entity:LoyaltyProgram) is created. diff --git a/src/api/types/LoyaltyProgramCreatedEventData.ts b/src/api/types/LoyaltyProgramCreatedEventData.ts index d50abdb58..3c93f2b74 100644 --- a/src/api/types/LoyaltyProgramCreatedEventData.ts +++ b/src/api/types/LoyaltyProgramCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The data associated with a `loyalty.program.created` event. diff --git a/src/api/types/LoyaltyProgramCreatedEventObject.ts b/src/api/types/LoyaltyProgramCreatedEventObject.ts index 4931030d0..5a047e101 100644 --- a/src/api/types/LoyaltyProgramCreatedEventObject.ts +++ b/src/api/types/LoyaltyProgramCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * An object that contains the loyalty program associated with a `loyalty.program.created` event. diff --git a/src/api/types/LoyaltyProgramExpirationPolicy.ts b/src/api/types/LoyaltyProgramExpirationPolicy.ts index b399301d5..8cae0f861 100644 --- a/src/api/types/LoyaltyProgramExpirationPolicy.ts +++ b/src/api/types/LoyaltyProgramExpirationPolicy.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Describes when the loyalty program expires. diff --git a/src/api/types/LoyaltyProgramRewardTier.ts b/src/api/types/LoyaltyProgramRewardTier.ts index 1e031d808..76b4bebf2 100644 --- a/src/api/types/LoyaltyProgramRewardTier.ts +++ b/src/api/types/LoyaltyProgramRewardTier.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a reward tier in a loyalty program. A reward tier defines how buyers can redeem points for a reward, such as the number of points required and the value and scope of the discount. A loyalty program can offer multiple reward tiers. diff --git a/src/api/types/LoyaltyProgramStatus.ts b/src/api/types/LoyaltyProgramStatus.ts index c00a2f118..99cf1c4de 100644 --- a/src/api/types/LoyaltyProgramStatus.ts +++ b/src/api/types/LoyaltyProgramStatus.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates whether the program is currently active. */ +/** + * Indicates whether the program is currently active. + */ +export type LoyaltyProgramStatus = "INACTIVE" | "ACTIVE"; export const LoyaltyProgramStatus = { Inactive: "INACTIVE", Active: "ACTIVE", } as const; -export type LoyaltyProgramStatus = (typeof LoyaltyProgramStatus)[keyof typeof LoyaltyProgramStatus]; diff --git a/src/api/types/LoyaltyProgramTerminology.ts b/src/api/types/LoyaltyProgramTerminology.ts index d18f19f98..a84f98bd9 100644 --- a/src/api/types/LoyaltyProgramTerminology.ts +++ b/src/api/types/LoyaltyProgramTerminology.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents the naming used for loyalty points. diff --git a/src/api/types/LoyaltyProgramUpdatedEvent.ts b/src/api/types/LoyaltyProgramUpdatedEvent.ts index 9d5a86886..eba64dade 100644 --- a/src/api/types/LoyaltyProgramUpdatedEvent.ts +++ b/src/api/types/LoyaltyProgramUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [loyalty program](entity:LoyaltyProgram) is updated. diff --git a/src/api/types/LoyaltyProgramUpdatedEventData.ts b/src/api/types/LoyaltyProgramUpdatedEventData.ts index 27108cc5f..4e91d3814 100644 --- a/src/api/types/LoyaltyProgramUpdatedEventData.ts +++ b/src/api/types/LoyaltyProgramUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The data associated with a `loyalty.program.updated` event. diff --git a/src/api/types/LoyaltyProgramUpdatedEventObject.ts b/src/api/types/LoyaltyProgramUpdatedEventObject.ts index ef8ff534e..474f5dea7 100644 --- a/src/api/types/LoyaltyProgramUpdatedEventObject.ts +++ b/src/api/types/LoyaltyProgramUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * An object that contains the loyalty program associated with a `loyalty.program.updated` event. diff --git a/src/api/types/LoyaltyPromotion.ts b/src/api/types/LoyaltyPromotion.ts index efa1e7f65..df8c25093 100644 --- a/src/api/types/LoyaltyPromotion.ts +++ b/src/api/types/LoyaltyPromotion.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a promotion for a [loyalty program](entity:LoyaltyProgram). Loyalty promotions enable buyers diff --git a/src/api/types/LoyaltyPromotionAvailableTimeData.ts b/src/api/types/LoyaltyPromotionAvailableTimeData.ts index da7cc60af..ef555493f 100644 --- a/src/api/types/LoyaltyPromotionAvailableTimeData.ts +++ b/src/api/types/LoyaltyPromotionAvailableTimeData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents scheduling information that determines when purchases can qualify to earn points diff --git a/src/api/types/LoyaltyPromotionCreatedEvent.ts b/src/api/types/LoyaltyPromotionCreatedEvent.ts index 56f968d1c..5351bf9a9 100644 --- a/src/api/types/LoyaltyPromotionCreatedEvent.ts +++ b/src/api/types/LoyaltyPromotionCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [loyalty promotion](entity:LoyaltyPromotion) is created. diff --git a/src/api/types/LoyaltyPromotionCreatedEventData.ts b/src/api/types/LoyaltyPromotionCreatedEventData.ts index e0082ebd2..6609ce34e 100644 --- a/src/api/types/LoyaltyPromotionCreatedEventData.ts +++ b/src/api/types/LoyaltyPromotionCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The data associated with a `loyalty.promotion.created` event. diff --git a/src/api/types/LoyaltyPromotionCreatedEventObject.ts b/src/api/types/LoyaltyPromotionCreatedEventObject.ts index 07d0f4e8b..6385e2e20 100644 --- a/src/api/types/LoyaltyPromotionCreatedEventObject.ts +++ b/src/api/types/LoyaltyPromotionCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * An object that contains the loyalty promotion associated with a `loyalty.promotion.created` event. diff --git a/src/api/types/LoyaltyPromotionIncentive.ts b/src/api/types/LoyaltyPromotionIncentive.ts index 49d08388a..96aafdd44 100644 --- a/src/api/types/LoyaltyPromotionIncentive.ts +++ b/src/api/types/LoyaltyPromotionIncentive.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents how points for a [loyalty promotion](entity:LoyaltyPromotion) are calculated, diff --git a/src/api/types/LoyaltyPromotionIncentivePointsAdditionData.ts b/src/api/types/LoyaltyPromotionIncentivePointsAdditionData.ts index 1edd5e188..900a4166a 100644 --- a/src/api/types/LoyaltyPromotionIncentivePointsAdditionData.ts +++ b/src/api/types/LoyaltyPromotionIncentivePointsAdditionData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents the metadata for a `POINTS_ADDITION` type of [loyalty promotion incentive](entity:LoyaltyPromotionIncentive). diff --git a/src/api/types/LoyaltyPromotionIncentivePointsMultiplierData.ts b/src/api/types/LoyaltyPromotionIncentivePointsMultiplierData.ts index eb91c7f6e..1b89d2986 100644 --- a/src/api/types/LoyaltyPromotionIncentivePointsMultiplierData.ts +++ b/src/api/types/LoyaltyPromotionIncentivePointsMultiplierData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents the metadata for a `POINTS_MULTIPLIER` type of [loyalty promotion incentive](entity:LoyaltyPromotionIncentive). diff --git a/src/api/types/LoyaltyPromotionIncentiveType.ts b/src/api/types/LoyaltyPromotionIncentiveType.ts index 33487bf2f..b60e6882e 100644 --- a/src/api/types/LoyaltyPromotionIncentiveType.ts +++ b/src/api/types/LoyaltyPromotionIncentiveType.ts @@ -1,12 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Indicates the type of points incentive for a [loyalty promotion](entity:LoyaltyPromotion), * which is used to determine how buyers can earn points from the promotion. */ +export type LoyaltyPromotionIncentiveType = "POINTS_MULTIPLIER" | "POINTS_ADDITION"; export const LoyaltyPromotionIncentiveType = { PointsMultiplier: "POINTS_MULTIPLIER", PointsAddition: "POINTS_ADDITION", } as const; -export type LoyaltyPromotionIncentiveType = - (typeof LoyaltyPromotionIncentiveType)[keyof typeof LoyaltyPromotionIncentiveType]; diff --git a/src/api/types/LoyaltyPromotionStatus.ts b/src/api/types/LoyaltyPromotionStatus.ts index 6fb58a7cc..fc71b8bd4 100644 --- a/src/api/types/LoyaltyPromotionStatus.ts +++ b/src/api/types/LoyaltyPromotionStatus.ts @@ -1,10 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates the status of a [loyalty promotion](entity:LoyaltyPromotion). */ +/** + * Indicates the status of a [loyalty promotion](entity:LoyaltyPromotion). + */ +export type LoyaltyPromotionStatus = "ACTIVE" | "ENDED" | "CANCELED" | "SCHEDULED"; export const LoyaltyPromotionStatus = { Active: "ACTIVE", Ended: "ENDED", Canceled: "CANCELED", Scheduled: "SCHEDULED", } as const; -export type LoyaltyPromotionStatus = (typeof LoyaltyPromotionStatus)[keyof typeof LoyaltyPromotionStatus]; diff --git a/src/api/types/LoyaltyPromotionTriggerLimit.ts b/src/api/types/LoyaltyPromotionTriggerLimit.ts index 9eb3e9b1f..940ec80f3 100644 --- a/src/api/types/LoyaltyPromotionTriggerLimit.ts +++ b/src/api/types/LoyaltyPromotionTriggerLimit.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents the number of times a buyer can earn points during a [loyalty promotion](entity:LoyaltyPromotion). diff --git a/src/api/types/LoyaltyPromotionTriggerLimitInterval.ts b/src/api/types/LoyaltyPromotionTriggerLimitInterval.ts index 776eeca7e..af488c597 100644 --- a/src/api/types/LoyaltyPromotionTriggerLimitInterval.ts +++ b/src/api/types/LoyaltyPromotionTriggerLimitInterval.ts @@ -1,12 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Indicates the time period that the [trigger limit](entity:LoyaltyPromotionTriggerLimit) applies to, * which is used to determine the number of times a buyer can earn points for a [loyalty promotion](entity:LoyaltyPromotion). */ +export type LoyaltyPromotionTriggerLimitInterval = "ALL_TIME" | "DAY"; export const LoyaltyPromotionTriggerLimitInterval = { AllTime: "ALL_TIME", Day: "DAY", } as const; -export type LoyaltyPromotionTriggerLimitInterval = - (typeof LoyaltyPromotionTriggerLimitInterval)[keyof typeof LoyaltyPromotionTriggerLimitInterval]; diff --git a/src/api/types/LoyaltyPromotionUpdatedEvent.ts b/src/api/types/LoyaltyPromotionUpdatedEvent.ts index 11bfd5c43..344a7bd25 100644 --- a/src/api/types/LoyaltyPromotionUpdatedEvent.ts +++ b/src/api/types/LoyaltyPromotionUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [loyalty promotion](entity:LoyaltyPromotion) is updated. This event is diff --git a/src/api/types/LoyaltyPromotionUpdatedEventData.ts b/src/api/types/LoyaltyPromotionUpdatedEventData.ts index b7fa4644a..130e22019 100644 --- a/src/api/types/LoyaltyPromotionUpdatedEventData.ts +++ b/src/api/types/LoyaltyPromotionUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The data associated with a `loyalty.promotion.updated` event. diff --git a/src/api/types/LoyaltyPromotionUpdatedEventObject.ts b/src/api/types/LoyaltyPromotionUpdatedEventObject.ts index d52afeb0d..1bae561db 100644 --- a/src/api/types/LoyaltyPromotionUpdatedEventObject.ts +++ b/src/api/types/LoyaltyPromotionUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * An object that contains the loyalty promotion associated with a `loyalty.promotion.updated` event. diff --git a/src/api/types/LoyaltyReward.ts b/src/api/types/LoyaltyReward.ts index 5d9d3f3d0..9168d20b2 100644 --- a/src/api/types/LoyaltyReward.ts +++ b/src/api/types/LoyaltyReward.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a contract to redeem loyalty points for a [reward tier](entity:LoyaltyProgramRewardTier) discount. Loyalty rewards can be in an ISSUED, REDEEMED, or DELETED state. diff --git a/src/api/types/LoyaltyRewardStatus.ts b/src/api/types/LoyaltyRewardStatus.ts index 69b60fe3b..2e4593f28 100644 --- a/src/api/types/LoyaltyRewardStatus.ts +++ b/src/api/types/LoyaltyRewardStatus.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The status of the loyalty reward. */ +/** + * The status of the loyalty reward. + */ +export type LoyaltyRewardStatus = "ISSUED" | "REDEEMED" | "DELETED"; export const LoyaltyRewardStatus = { Issued: "ISSUED", Redeemed: "REDEEMED", Deleted: "DELETED", } as const; -export type LoyaltyRewardStatus = (typeof LoyaltyRewardStatus)[keyof typeof LoyaltyRewardStatus]; diff --git a/src/api/types/MeasurementUnit.ts b/src/api/types/MeasurementUnit.ts index 73ed5da3e..24a146726 100644 --- a/src/api/types/MeasurementUnit.ts +++ b/src/api/types/MeasurementUnit.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a unit of measurement to use with a quantity, such as ounces diff --git a/src/api/types/MeasurementUnitArea.ts b/src/api/types/MeasurementUnitArea.ts index 147030d54..b3515d4f6 100644 --- a/src/api/types/MeasurementUnitArea.ts +++ b/src/api/types/MeasurementUnitArea.ts @@ -1,6 +1,19 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Unit of area used to measure a quantity. */ +/** + * Unit of area used to measure a quantity. + */ +export type MeasurementUnitArea = + | "IMPERIAL_ACRE" + | "IMPERIAL_SQUARE_INCH" + | "IMPERIAL_SQUARE_FOOT" + | "IMPERIAL_SQUARE_YARD" + | "IMPERIAL_SQUARE_MILE" + | "METRIC_SQUARE_CENTIMETER" + | "METRIC_SQUARE_METER" + | "METRIC_SQUARE_KILOMETER"; export const MeasurementUnitArea = { ImperialAcre: "IMPERIAL_ACRE", ImperialSquareInch: "IMPERIAL_SQUARE_INCH", @@ -11,4 +24,3 @@ export const MeasurementUnitArea = { MetricSquareMeter: "METRIC_SQUARE_METER", MetricSquareKilometer: "METRIC_SQUARE_KILOMETER", } as const; -export type MeasurementUnitArea = (typeof MeasurementUnitArea)[keyof typeof MeasurementUnitArea]; diff --git a/src/api/types/MeasurementUnitCustom.ts b/src/api/types/MeasurementUnitCustom.ts index 4ef6e6711..1a28c4793 100644 --- a/src/api/types/MeasurementUnitCustom.ts +++ b/src/api/types/MeasurementUnitCustom.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The information needed to define a custom unit, provided by the seller. diff --git a/src/api/types/MeasurementUnitGeneric.ts b/src/api/types/MeasurementUnitGeneric.ts index 41d9a6526..0882b88e3 100644 --- a/src/api/types/MeasurementUnitGeneric.ts +++ b/src/api/types/MeasurementUnitGeneric.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type MeasurementUnitGeneric = "UNIT"; diff --git a/src/api/types/MeasurementUnitLength.ts b/src/api/types/MeasurementUnitLength.ts index 2c0ae42ab..18208ada5 100644 --- a/src/api/types/MeasurementUnitLength.ts +++ b/src/api/types/MeasurementUnitLength.ts @@ -1,6 +1,19 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The unit of length used to measure a quantity. */ +/** + * The unit of length used to measure a quantity. + */ +export type MeasurementUnitLength = + | "IMPERIAL_INCH" + | "IMPERIAL_FOOT" + | "IMPERIAL_YARD" + | "IMPERIAL_MILE" + | "METRIC_MILLIMETER" + | "METRIC_CENTIMETER" + | "METRIC_METER" + | "METRIC_KILOMETER"; export const MeasurementUnitLength = { ImperialInch: "IMPERIAL_INCH", ImperialFoot: "IMPERIAL_FOOT", @@ -11,4 +24,3 @@ export const MeasurementUnitLength = { MetricMeter: "METRIC_METER", MetricKilometer: "METRIC_KILOMETER", } as const; -export type MeasurementUnitLength = (typeof MeasurementUnitLength)[keyof typeof MeasurementUnitLength]; diff --git a/src/api/types/MeasurementUnitTime.ts b/src/api/types/MeasurementUnitTime.ts index b0e938366..4c8187ae1 100644 --- a/src/api/types/MeasurementUnitTime.ts +++ b/src/api/types/MeasurementUnitTime.ts @@ -1,6 +1,16 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Unit of time used to measure a quantity (a duration). */ +/** + * Unit of time used to measure a quantity (a duration). + */ +export type MeasurementUnitTime = + | "GENERIC_MILLISECOND" + | "GENERIC_SECOND" + | "GENERIC_MINUTE" + | "GENERIC_HOUR" + | "GENERIC_DAY"; export const MeasurementUnitTime = { GenericMillisecond: "GENERIC_MILLISECOND", GenericSecond: "GENERIC_SECOND", @@ -8,4 +18,3 @@ export const MeasurementUnitTime = { GenericHour: "GENERIC_HOUR", GenericDay: "GENERIC_DAY", } as const; -export type MeasurementUnitTime = (typeof MeasurementUnitTime)[keyof typeof MeasurementUnitTime]; diff --git a/src/api/types/MeasurementUnitUnitType.ts b/src/api/types/MeasurementUnitUnitType.ts index d5d700913..de29e72ee 100644 --- a/src/api/types/MeasurementUnitUnitType.ts +++ b/src/api/types/MeasurementUnitUnitType.ts @@ -1,6 +1,17 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. */ +/** + * Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. + */ +export type MeasurementUnitUnitType = + | "TYPE_CUSTOM" + | "TYPE_AREA" + | "TYPE_LENGTH" + | "TYPE_VOLUME" + | "TYPE_WEIGHT" + | "TYPE_GENERIC"; export const MeasurementUnitUnitType = { TypeCustom: "TYPE_CUSTOM", TypeArea: "TYPE_AREA", @@ -9,4 +20,3 @@ export const MeasurementUnitUnitType = { TypeWeight: "TYPE_WEIGHT", TypeGeneric: "TYPE_GENERIC", } as const; -export type MeasurementUnitUnitType = (typeof MeasurementUnitUnitType)[keyof typeof MeasurementUnitUnitType]; diff --git a/src/api/types/MeasurementUnitVolume.ts b/src/api/types/MeasurementUnitVolume.ts index 938b067a7..64a0f1c50 100644 --- a/src/api/types/MeasurementUnitVolume.ts +++ b/src/api/types/MeasurementUnitVolume.ts @@ -1,6 +1,22 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The unit of volume used to measure a quantity. */ +/** + * The unit of volume used to measure a quantity. + */ +export type MeasurementUnitVolume = + | "GENERIC_FLUID_OUNCE" + | "GENERIC_SHOT" + | "GENERIC_CUP" + | "GENERIC_PINT" + | "GENERIC_QUART" + | "GENERIC_GALLON" + | "IMPERIAL_CUBIC_INCH" + | "IMPERIAL_CUBIC_FOOT" + | "IMPERIAL_CUBIC_YARD" + | "METRIC_MILLILITER" + | "METRIC_LITER"; export const MeasurementUnitVolume = { GenericFluidOunce: "GENERIC_FLUID_OUNCE", GenericShot: "GENERIC_SHOT", @@ -14,4 +30,3 @@ export const MeasurementUnitVolume = { MetricMilliliter: "METRIC_MILLILITER", MetricLiter: "METRIC_LITER", } as const; -export type MeasurementUnitVolume = (typeof MeasurementUnitVolume)[keyof typeof MeasurementUnitVolume]; diff --git a/src/api/types/MeasurementUnitWeight.ts b/src/api/types/MeasurementUnitWeight.ts index e54cbbdf1..ed30cac93 100644 --- a/src/api/types/MeasurementUnitWeight.ts +++ b/src/api/types/MeasurementUnitWeight.ts @@ -1,6 +1,17 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Unit of weight used to measure a quantity. */ +/** + * Unit of weight used to measure a quantity. + */ +export type MeasurementUnitWeight = + | "IMPERIAL_WEIGHT_OUNCE" + | "IMPERIAL_POUND" + | "IMPERIAL_STONE" + | "METRIC_MILLIGRAM" + | "METRIC_GRAM" + | "METRIC_KILOGRAM"; export const MeasurementUnitWeight = { ImperialWeightOunce: "IMPERIAL_WEIGHT_OUNCE", ImperialPound: "IMPERIAL_POUND", @@ -9,4 +20,3 @@ export const MeasurementUnitWeight = { MetricGram: "METRIC_GRAM", MetricKilogram: "METRIC_KILOGRAM", } as const; -export type MeasurementUnitWeight = (typeof MeasurementUnitWeight)[keyof typeof MeasurementUnitWeight]; diff --git a/src/api/types/Merchant.ts b/src/api/types/Merchant.ts index 9186857cf..d57d5dff7 100644 --- a/src/api/types/Merchant.ts +++ b/src/api/types/Merchant.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a business that sells with Square. diff --git a/src/api/types/MerchantCustomAttributeDefinitionOwnedCreatedEvent.ts b/src/api/types/MerchantCustomAttributeDefinitionOwnedCreatedEvent.ts index c34cd6c54..b0451b41a 100644 --- a/src/api/types/MerchantCustomAttributeDefinitionOwnedCreatedEvent.ts +++ b/src/api/types/MerchantCustomAttributeDefinitionOwnedCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/MerchantCustomAttributeDefinitionOwnedDeletedEvent.ts b/src/api/types/MerchantCustomAttributeDefinitionOwnedDeletedEvent.ts index 288c2c92d..533e9c170 100644 --- a/src/api/types/MerchantCustomAttributeDefinitionOwnedDeletedEvent.ts +++ b/src/api/types/MerchantCustomAttributeDefinitionOwnedDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/MerchantCustomAttributeDefinitionOwnedUpdatedEvent.ts b/src/api/types/MerchantCustomAttributeDefinitionOwnedUpdatedEvent.ts index ca94af6e4..0b18b5657 100644 --- a/src/api/types/MerchantCustomAttributeDefinitionOwnedUpdatedEvent.ts +++ b/src/api/types/MerchantCustomAttributeDefinitionOwnedUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/MerchantCustomAttributeDefinitionVisibleCreatedEvent.ts b/src/api/types/MerchantCustomAttributeDefinitionVisibleCreatedEvent.ts index d156c07ee..37e808296 100644 --- a/src/api/types/MerchantCustomAttributeDefinitionVisibleCreatedEvent.ts +++ b/src/api/types/MerchantCustomAttributeDefinitionVisibleCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/MerchantCustomAttributeDefinitionVisibleDeletedEvent.ts b/src/api/types/MerchantCustomAttributeDefinitionVisibleDeletedEvent.ts index 722aac024..43aba2dd7 100644 --- a/src/api/types/MerchantCustomAttributeDefinitionVisibleDeletedEvent.ts +++ b/src/api/types/MerchantCustomAttributeDefinitionVisibleDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/MerchantCustomAttributeDefinitionVisibleUpdatedEvent.ts b/src/api/types/MerchantCustomAttributeDefinitionVisibleUpdatedEvent.ts index 32f314470..078ff840f 100644 --- a/src/api/types/MerchantCustomAttributeDefinitionVisibleUpdatedEvent.ts +++ b/src/api/types/MerchantCustomAttributeDefinitionVisibleUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a merchant [custom attribute definition](entity:CustomAttributeDefinition) diff --git a/src/api/types/MerchantCustomAttributeOwnedDeletedEvent.ts b/src/api/types/MerchantCustomAttributeOwnedDeletedEvent.ts index eed12edec..3c08c957b 100644 --- a/src/api/types/MerchantCustomAttributeOwnedDeletedEvent.ts +++ b/src/api/types/MerchantCustomAttributeOwnedDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a merchant [custom attribute](entity:CustomAttribute) diff --git a/src/api/types/MerchantCustomAttributeOwnedUpdatedEvent.ts b/src/api/types/MerchantCustomAttributeOwnedUpdatedEvent.ts index 2fcf9dea6..af81e52f6 100644 --- a/src/api/types/MerchantCustomAttributeOwnedUpdatedEvent.ts +++ b/src/api/types/MerchantCustomAttributeOwnedUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a merchant [custom attribute](entity:CustomAttribute) diff --git a/src/api/types/MerchantCustomAttributeVisibleDeletedEvent.ts b/src/api/types/MerchantCustomAttributeVisibleDeletedEvent.ts index 3ac1a7efc..b83c5ad28 100644 --- a/src/api/types/MerchantCustomAttributeVisibleDeletedEvent.ts +++ b/src/api/types/MerchantCustomAttributeVisibleDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a merchant [custom attribute](entity:CustomAttribute) with diff --git a/src/api/types/MerchantCustomAttributeVisibleUpdatedEvent.ts b/src/api/types/MerchantCustomAttributeVisibleUpdatedEvent.ts index 5eb632b13..96b485192 100644 --- a/src/api/types/MerchantCustomAttributeVisibleUpdatedEvent.ts +++ b/src/api/types/MerchantCustomAttributeVisibleUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a merchant [custom attribute](entity:CustomAttribute) with diff --git a/src/api/types/MerchantSettingsUpdatedEvent.ts b/src/api/types/MerchantSettingsUpdatedEvent.ts index 53007ba78..03e615b56 100644 --- a/src/api/types/MerchantSettingsUpdatedEvent.ts +++ b/src/api/types/MerchantSettingsUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when online checkout merchant settings are updated diff --git a/src/api/types/MerchantSettingsUpdatedEventData.ts b/src/api/types/MerchantSettingsUpdatedEventData.ts index deb5b5eb7..e4d739c63 100644 --- a/src/api/types/MerchantSettingsUpdatedEventData.ts +++ b/src/api/types/MerchantSettingsUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface MerchantSettingsUpdatedEventData { /** Name of the updated object’s type, `"online_checkout.merchant_settings"`. */ diff --git a/src/api/types/MerchantSettingsUpdatedEventObject.ts b/src/api/types/MerchantSettingsUpdatedEventObject.ts index bf429d7b3..32b98e67b 100644 --- a/src/api/types/MerchantSettingsUpdatedEventObject.ts +++ b/src/api/types/MerchantSettingsUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface MerchantSettingsUpdatedEventObject { /** The updated merchant settings. */ diff --git a/src/api/types/MerchantStatus.ts b/src/api/types/MerchantStatus.ts index 1a4ba9823..5d20496e2 100644 --- a/src/api/types/MerchantStatus.ts +++ b/src/api/types/MerchantStatus.ts @@ -1,7 +1,9 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type MerchantStatus = "ACTIVE" | "INACTIVE"; export const MerchantStatus = { Active: "ACTIVE", Inactive: "INACTIVE", } as const; -export type MerchantStatus = (typeof MerchantStatus)[keyof typeof MerchantStatus]; diff --git a/src/api/types/ModifierLocationOverrides.ts b/src/api/types/ModifierLocationOverrides.ts index 16f479991..fc4f18ebd 100644 --- a/src/api/types/ModifierLocationOverrides.ts +++ b/src/api/types/ModifierLocationOverrides.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Location-specific overrides for specified properties of a `CatalogModifier` object. diff --git a/src/api/types/Money.ts b/src/api/types/Money.ts index 24000c580..a49a8633f 100644 --- a/src/api/types/Money.ts +++ b/src/api/types/Money.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an amount of money. `Money` fields can be signed or unsigned. diff --git a/src/api/types/OauthAuthorizationRevokedEvent.ts b/src/api/types/OauthAuthorizationRevokedEvent.ts index 3fafe2327..f10413cce 100644 --- a/src/api/types/OauthAuthorizationRevokedEvent.ts +++ b/src/api/types/OauthAuthorizationRevokedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a merchant/application revokes all access tokens and refresh tokens granted to an application. diff --git a/src/api/types/OauthAuthorizationRevokedEventData.ts b/src/api/types/OauthAuthorizationRevokedEventData.ts index ba32ecbfe..3cd2ae5da 100644 --- a/src/api/types/OauthAuthorizationRevokedEventData.ts +++ b/src/api/types/OauthAuthorizationRevokedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface OauthAuthorizationRevokedEventData { /** Name of the affected object’s type, `"revocation"`. */ diff --git a/src/api/types/OauthAuthorizationRevokedEventObject.ts b/src/api/types/OauthAuthorizationRevokedEventObject.ts index fe3bcd281..a95fcc143 100644 --- a/src/api/types/OauthAuthorizationRevokedEventObject.ts +++ b/src/api/types/OauthAuthorizationRevokedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface OauthAuthorizationRevokedEventObject { /** The revocation event. */ diff --git a/src/api/types/OauthAuthorizationRevokedEventRevocationObject.ts b/src/api/types/OauthAuthorizationRevokedEventRevocationObject.ts index 7fbcc5dde..e22a2cfe7 100644 --- a/src/api/types/OauthAuthorizationRevokedEventRevocationObject.ts +++ b/src/api/types/OauthAuthorizationRevokedEventRevocationObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface OauthAuthorizationRevokedEventRevocationObject { /** Timestamp of when the revocation event occurred, in RFC 3339 format. */ diff --git a/src/api/types/OauthAuthorizationRevokedEventRevokerType.ts b/src/api/types/OauthAuthorizationRevokedEventRevokerType.ts index 630abc397..c4fbb2e47 100644 --- a/src/api/types/OauthAuthorizationRevokedEventRevokerType.ts +++ b/src/api/types/OauthAuthorizationRevokedEventRevokerType.ts @@ -1,10 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Defines the possible types for the revoking client. */ +/** + * Defines the possible types for the revoking client. + */ +export type OauthAuthorizationRevokedEventRevokerType = "APPLICATION" | "MERCHANT" | "SQUARE"; export const OauthAuthorizationRevokedEventRevokerType = { Application: "APPLICATION", Merchant: "MERCHANT", Square: "SQUARE", } as const; -export type OauthAuthorizationRevokedEventRevokerType = - (typeof OauthAuthorizationRevokedEventRevokerType)[keyof typeof OauthAuthorizationRevokedEventRevokerType]; diff --git a/src/api/types/ObtainTokenResponse.ts b/src/api/types/ObtainTokenResponse.ts index e6df59048..743942131 100644 --- a/src/api/types/ObtainTokenResponse.ts +++ b/src/api/types/ObtainTokenResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an [ObtainToken](api-endpoint:OAuth-ObtainToken) response. diff --git a/src/api/types/OfflinePaymentDetails.ts b/src/api/types/OfflinePaymentDetails.ts index 2a9557630..d82128b4a 100644 --- a/src/api/types/OfflinePaymentDetails.ts +++ b/src/api/types/OfflinePaymentDetails.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Details specific to offline payments. diff --git a/src/api/types/Order.ts b/src/api/types/Order.ts index 0cf2e9d87..4445dcd7d 100644 --- a/src/api/types/Order.ts +++ b/src/api/types/Order.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Contains all information related to a single order to process with Square, diff --git a/src/api/types/OrderCreated.ts b/src/api/types/OrderCreated.ts index a7970e9b5..fc76f4128 100644 --- a/src/api/types/OrderCreated.ts +++ b/src/api/types/OrderCreated.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface OrderCreated { /** The order's unique ID. */ diff --git a/src/api/types/OrderCreatedEvent.ts b/src/api/types/OrderCreatedEvent.ts index d2f8a9d28..27cbad469 100644 --- a/src/api/types/OrderCreatedEvent.ts +++ b/src/api/types/OrderCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when an [Order](entity:Order) is created. This event is diff --git a/src/api/types/OrderCreatedEventData.ts b/src/api/types/OrderCreatedEventData.ts index 7d441411b..5cc34d44f 100644 --- a/src/api/types/OrderCreatedEventData.ts +++ b/src/api/types/OrderCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface OrderCreatedEventData { /** Name of the affected object’s type, `"order_created"`. */ diff --git a/src/api/types/OrderCreatedObject.ts b/src/api/types/OrderCreatedObject.ts index 511e7c7d3..228dfb0dc 100644 --- a/src/api/types/OrderCreatedObject.ts +++ b/src/api/types/OrderCreatedObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface OrderCreatedObject { /** Information about the created order. */ diff --git a/src/api/types/OrderCustomAttributeDefinitionOwnedCreatedEvent.ts b/src/api/types/OrderCustomAttributeDefinitionOwnedCreatedEvent.ts index 62796198c..5f129058a 100644 --- a/src/api/types/OrderCustomAttributeDefinitionOwnedCreatedEvent.ts +++ b/src/api/types/OrderCustomAttributeDefinitionOwnedCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is created. diff --git a/src/api/types/OrderCustomAttributeDefinitionOwnedDeletedEvent.ts b/src/api/types/OrderCustomAttributeDefinitionOwnedDeletedEvent.ts index 7c727faa8..87c99a7aa 100644 --- a/src/api/types/OrderCustomAttributeDefinitionOwnedDeletedEvent.ts +++ b/src/api/types/OrderCustomAttributeDefinitionOwnedDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is deleted. diff --git a/src/api/types/OrderCustomAttributeDefinitionOwnedUpdatedEvent.ts b/src/api/types/OrderCustomAttributeDefinitionOwnedUpdatedEvent.ts index 57ac895f0..beeb443d6 100644 --- a/src/api/types/OrderCustomAttributeDefinitionOwnedUpdatedEvent.ts +++ b/src/api/types/OrderCustomAttributeDefinitionOwnedUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is updated. diff --git a/src/api/types/OrderCustomAttributeDefinitionVisibleCreatedEvent.ts b/src/api/types/OrderCustomAttributeDefinitionVisibleCreatedEvent.ts index 07e79efec..4dddaa8ef 100644 --- a/src/api/types/OrderCustomAttributeDefinitionVisibleCreatedEvent.ts +++ b/src/api/types/OrderCustomAttributeDefinitionVisibleCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is visible to the subscribing app is created. diff --git a/src/api/types/OrderCustomAttributeDefinitionVisibleDeletedEvent.ts b/src/api/types/OrderCustomAttributeDefinitionVisibleDeletedEvent.ts index 40c49028a..6b6dc2e5b 100644 --- a/src/api/types/OrderCustomAttributeDefinitionVisibleDeletedEvent.ts +++ b/src/api/types/OrderCustomAttributeDefinitionVisibleDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is visible to the subscribing app is deleted. diff --git a/src/api/types/OrderCustomAttributeDefinitionVisibleUpdatedEvent.ts b/src/api/types/OrderCustomAttributeDefinitionVisibleUpdatedEvent.ts index 96435de80..34d7b3031 100644 --- a/src/api/types/OrderCustomAttributeDefinitionVisibleUpdatedEvent.ts +++ b/src/api/types/OrderCustomAttributeDefinitionVisibleUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when an order [custom attribute definition](entity:CustomAttributeDefinition) that is visible to the subscribing app is updated. diff --git a/src/api/types/OrderCustomAttributeOwnedDeletedEvent.ts b/src/api/types/OrderCustomAttributeOwnedDeletedEvent.ts index 3a5051f43..3d31e8a36 100644 --- a/src/api/types/OrderCustomAttributeOwnedDeletedEvent.ts +++ b/src/api/types/OrderCustomAttributeOwnedDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when an order [custom attribute](entity:CustomAttribute) associated with a [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is deleted. diff --git a/src/api/types/OrderCustomAttributeOwnedUpdatedEvent.ts b/src/api/types/OrderCustomAttributeOwnedUpdatedEvent.ts index 943089041..0ec5b4d1a 100644 --- a/src/api/types/OrderCustomAttributeOwnedUpdatedEvent.ts +++ b/src/api/types/OrderCustomAttributeOwnedUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when an order [custom attribute](entity:CustomAttribute) associated with a [custom attribute definition](entity:CustomAttributeDefinition) that is owned by the subscribing app is updated. diff --git a/src/api/types/OrderCustomAttributeVisibleDeletedEvent.ts b/src/api/types/OrderCustomAttributeVisibleDeletedEvent.ts index cc00314b8..00b526c6f 100644 --- a/src/api/types/OrderCustomAttributeVisibleDeletedEvent.ts +++ b/src/api/types/OrderCustomAttributeVisibleDeletedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when an order [custom attribute](entity:CustomAttribute) that is visible to the subscribing app is deleted. diff --git a/src/api/types/OrderCustomAttributeVisibleUpdatedEvent.ts b/src/api/types/OrderCustomAttributeVisibleUpdatedEvent.ts index e066af656..55d63c538 100644 --- a/src/api/types/OrderCustomAttributeVisibleUpdatedEvent.ts +++ b/src/api/types/OrderCustomAttributeVisibleUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when an order [custom attribute](entity:CustomAttribute) that is visible to the subscribing app is updated. diff --git a/src/api/types/OrderEntry.ts b/src/api/types/OrderEntry.ts index 3bb18bfa9..1d662c616 100644 --- a/src/api/types/OrderEntry.ts +++ b/src/api/types/OrderEntry.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * A lightweight description of an [order](entity:Order) that is returned when diff --git a/src/api/types/OrderFulfillmentDeliveryDetailsScheduleType.ts b/src/api/types/OrderFulfillmentDeliveryDetailsScheduleType.ts index 3adac1a27..54fbf5ddc 100644 --- a/src/api/types/OrderFulfillmentDeliveryDetailsScheduleType.ts +++ b/src/api/types/OrderFulfillmentDeliveryDetailsScheduleType.ts @@ -1,9 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The schedule type of the delivery fulfillment. */ +/** + * The schedule type of the delivery fulfillment. + */ +export type OrderFulfillmentDeliveryDetailsScheduleType = "SCHEDULED" | "ASAP"; export const OrderFulfillmentDeliveryDetailsScheduleType = { Scheduled: "SCHEDULED", Asap: "ASAP", } as const; -export type OrderFulfillmentDeliveryDetailsScheduleType = - (typeof OrderFulfillmentDeliveryDetailsScheduleType)[keyof typeof OrderFulfillmentDeliveryDetailsScheduleType]; diff --git a/src/api/types/OrderFulfillmentFulfillmentLineItemApplication.ts b/src/api/types/OrderFulfillmentFulfillmentLineItemApplication.ts index ee73e91d9..b88f9010b 100644 --- a/src/api/types/OrderFulfillmentFulfillmentLineItemApplication.ts +++ b/src/api/types/OrderFulfillmentFulfillmentLineItemApplication.ts @@ -1,12 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The `line_item_application` describes what order line items this fulfillment applies * to. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries. */ +export type OrderFulfillmentFulfillmentLineItemApplication = "ALL" | "ENTRY_LIST"; export const OrderFulfillmentFulfillmentLineItemApplication = { All: "ALL", EntryList: "ENTRY_LIST", } as const; -export type OrderFulfillmentFulfillmentLineItemApplication = - (typeof OrderFulfillmentFulfillmentLineItemApplication)[keyof typeof OrderFulfillmentFulfillmentLineItemApplication]; diff --git a/src/api/types/OrderFulfillmentPickupDetailsScheduleType.ts b/src/api/types/OrderFulfillmentPickupDetailsScheduleType.ts index 4fb680952..4a4452749 100644 --- a/src/api/types/OrderFulfillmentPickupDetailsScheduleType.ts +++ b/src/api/types/OrderFulfillmentPickupDetailsScheduleType.ts @@ -1,9 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The schedule type of the pickup fulfillment. */ +/** + * The schedule type of the pickup fulfillment. + */ +export type OrderFulfillmentPickupDetailsScheduleType = "SCHEDULED" | "ASAP"; export const OrderFulfillmentPickupDetailsScheduleType = { Scheduled: "SCHEDULED", Asap: "ASAP", } as const; -export type OrderFulfillmentPickupDetailsScheduleType = - (typeof OrderFulfillmentPickupDetailsScheduleType)[keyof typeof OrderFulfillmentPickupDetailsScheduleType]; diff --git a/src/api/types/OrderFulfillmentState.ts b/src/api/types/OrderFulfillmentState.ts index 51b9e1c2b..ad143297d 100644 --- a/src/api/types/OrderFulfillmentState.ts +++ b/src/api/types/OrderFulfillmentState.ts @@ -1,6 +1,11 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The current state of this fulfillment. */ +/** + * The current state of this fulfillment. + */ +export type OrderFulfillmentState = "PROPOSED" | "RESERVED" | "PREPARED" | "COMPLETED" | "CANCELED" | "FAILED"; export const OrderFulfillmentState = { Proposed: "PROPOSED", Reserved: "RESERVED", @@ -9,4 +14,3 @@ export const OrderFulfillmentState = { Canceled: "CANCELED", Failed: "FAILED", } as const; -export type OrderFulfillmentState = (typeof OrderFulfillmentState)[keyof typeof OrderFulfillmentState]; diff --git a/src/api/types/OrderFulfillmentType.ts b/src/api/types/OrderFulfillmentType.ts index 98f9d65fa..ef8e220f5 100644 --- a/src/api/types/OrderFulfillmentType.ts +++ b/src/api/types/OrderFulfillmentType.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The type of fulfillment. */ +/** + * The type of fulfillment. + */ +export type OrderFulfillmentType = "PICKUP" | "SHIPMENT" | "DELIVERY"; export const OrderFulfillmentType = { Pickup: "PICKUP", Shipment: "SHIPMENT", Delivery: "DELIVERY", } as const; -export type OrderFulfillmentType = (typeof OrderFulfillmentType)[keyof typeof OrderFulfillmentType]; diff --git a/src/api/types/OrderFulfillmentUpdated.ts b/src/api/types/OrderFulfillmentUpdated.ts index 181704853..088c57d49 100644 --- a/src/api/types/OrderFulfillmentUpdated.ts +++ b/src/api/types/OrderFulfillmentUpdated.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface OrderFulfillmentUpdated { /** The order's unique ID. */ diff --git a/src/api/types/OrderFulfillmentUpdatedEvent.ts b/src/api/types/OrderFulfillmentUpdatedEvent.ts index f6ca77896..c396022e6 100644 --- a/src/api/types/OrderFulfillmentUpdatedEvent.ts +++ b/src/api/types/OrderFulfillmentUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when an [OrderFulfillment](entity:OrderFulfillment) diff --git a/src/api/types/OrderFulfillmentUpdatedEventData.ts b/src/api/types/OrderFulfillmentUpdatedEventData.ts index db6e4eebf..ea8cfcf5e 100644 --- a/src/api/types/OrderFulfillmentUpdatedEventData.ts +++ b/src/api/types/OrderFulfillmentUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface OrderFulfillmentUpdatedEventData { /** Name of the affected object’s type, `"order_fulfillment_updated"`. */ diff --git a/src/api/types/OrderFulfillmentUpdatedObject.ts b/src/api/types/OrderFulfillmentUpdatedObject.ts index b903f4be1..5c587e29f 100644 --- a/src/api/types/OrderFulfillmentUpdatedObject.ts +++ b/src/api/types/OrderFulfillmentUpdatedObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface OrderFulfillmentUpdatedObject { /** Information about the updated order fulfillment. */ diff --git a/src/api/types/OrderFulfillmentUpdatedUpdate.ts b/src/api/types/OrderFulfillmentUpdatedUpdate.ts index 09f752bd6..266b6d6e4 100644 --- a/src/api/types/OrderFulfillmentUpdatedUpdate.ts +++ b/src/api/types/OrderFulfillmentUpdatedUpdate.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Information about fulfillment updates. diff --git a/src/api/types/OrderLineItem.ts b/src/api/types/OrderLineItem.ts index 8d8d3f4c9..bba33a54e 100644 --- a/src/api/types/OrderLineItem.ts +++ b/src/api/types/OrderLineItem.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a line item in an order. Each line item describes a different diff --git a/src/api/types/OrderLineItemAppliedDiscount.ts b/src/api/types/OrderLineItemAppliedDiscount.ts index c66321fc5..fca878465 100644 --- a/src/api/types/OrderLineItemAppliedDiscount.ts +++ b/src/api/types/OrderLineItemAppliedDiscount.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an applied portion of a discount to a line item in an order. diff --git a/src/api/types/OrderLineItemAppliedServiceCharge.ts b/src/api/types/OrderLineItemAppliedServiceCharge.ts index 3a13d69d2..a33c341e0 100644 --- a/src/api/types/OrderLineItemAppliedServiceCharge.ts +++ b/src/api/types/OrderLineItemAppliedServiceCharge.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface OrderLineItemAppliedServiceCharge { /** A unique ID that identifies the applied service charge only within this order. */ diff --git a/src/api/types/OrderLineItemAppliedTax.ts b/src/api/types/OrderLineItemAppliedTax.ts index 7155dfcc0..f858e9670 100644 --- a/src/api/types/OrderLineItemAppliedTax.ts +++ b/src/api/types/OrderLineItemAppliedTax.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an applied portion of a tax to a line item in an order. diff --git a/src/api/types/OrderLineItemDiscount.ts b/src/api/types/OrderLineItemDiscount.ts index 4ccd30a5a..25778f56b 100644 --- a/src/api/types/OrderLineItemDiscount.ts +++ b/src/api/types/OrderLineItemDiscount.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a discount that applies to one or more line items in an diff --git a/src/api/types/OrderLineItemDiscountScope.ts b/src/api/types/OrderLineItemDiscountScope.ts index afcbc5b04..404306970 100644 --- a/src/api/types/OrderLineItemDiscountScope.ts +++ b/src/api/types/OrderLineItemDiscountScope.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates whether this is a line-item or order-level discount. */ +/** + * Indicates whether this is a line-item or order-level discount. + */ +export type OrderLineItemDiscountScope = "OTHER_DISCOUNT_SCOPE" | "LINE_ITEM" | "ORDER"; export const OrderLineItemDiscountScope = { OtherDiscountScope: "OTHER_DISCOUNT_SCOPE", LineItem: "LINE_ITEM", Order: "ORDER", } as const; -export type OrderLineItemDiscountScope = (typeof OrderLineItemDiscountScope)[keyof typeof OrderLineItemDiscountScope]; diff --git a/src/api/types/OrderLineItemDiscountType.ts b/src/api/types/OrderLineItemDiscountType.ts index dd8a9b3df..09a7154db 100644 --- a/src/api/types/OrderLineItemDiscountType.ts +++ b/src/api/types/OrderLineItemDiscountType.ts @@ -1,6 +1,16 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates how the discount is applied to the associated line item or order. */ +/** + * Indicates how the discount is applied to the associated line item or order. + */ +export type OrderLineItemDiscountType = + | "UNKNOWN_DISCOUNT" + | "FIXED_PERCENTAGE" + | "FIXED_AMOUNT" + | "VARIABLE_PERCENTAGE" + | "VARIABLE_AMOUNT"; export const OrderLineItemDiscountType = { UnknownDiscount: "UNKNOWN_DISCOUNT", FixedPercentage: "FIXED_PERCENTAGE", @@ -8,4 +18,3 @@ export const OrderLineItemDiscountType = { VariablePercentage: "VARIABLE_PERCENTAGE", VariableAmount: "VARIABLE_AMOUNT", } as const; -export type OrderLineItemDiscountType = (typeof OrderLineItemDiscountType)[keyof typeof OrderLineItemDiscountType]; diff --git a/src/api/types/OrderLineItemItemType.ts b/src/api/types/OrderLineItemItemType.ts index f88e60b28..f41ab1f62 100644 --- a/src/api/types/OrderLineItemItemType.ts +++ b/src/api/types/OrderLineItemItemType.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Represents the line item type. */ +/** + * Represents the line item type. + */ +export type OrderLineItemItemType = "ITEM" | "CUSTOM_AMOUNT" | "GIFT_CARD"; export const OrderLineItemItemType = { Item: "ITEM", CustomAmount: "CUSTOM_AMOUNT", GiftCard: "GIFT_CARD", } as const; -export type OrderLineItemItemType = (typeof OrderLineItemItemType)[keyof typeof OrderLineItemItemType]; diff --git a/src/api/types/OrderLineItemModifier.ts b/src/api/types/OrderLineItemModifier.ts index 651192f32..c1c4344b6 100644 --- a/src/api/types/OrderLineItemModifier.ts +++ b/src/api/types/OrderLineItemModifier.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A [CatalogModifier](entity:CatalogModifier). diff --git a/src/api/types/OrderLineItemPricingBlocklists.ts b/src/api/types/OrderLineItemPricingBlocklists.ts index 327e37b1a..68ac4f5f9 100644 --- a/src/api/types/OrderLineItemPricingBlocklists.ts +++ b/src/api/types/OrderLineItemPricingBlocklists.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Describes pricing adjustments that are blocked from automatic diff --git a/src/api/types/OrderLineItemPricingBlocklistsBlockedDiscount.ts b/src/api/types/OrderLineItemPricingBlocklistsBlockedDiscount.ts index 183293b8c..6a89a96d9 100644 --- a/src/api/types/OrderLineItemPricingBlocklistsBlockedDiscount.ts +++ b/src/api/types/OrderLineItemPricingBlocklistsBlockedDiscount.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * A discount to block from applying to a line item. The discount must be diff --git a/src/api/types/OrderLineItemPricingBlocklistsBlockedTax.ts b/src/api/types/OrderLineItemPricingBlocklistsBlockedTax.ts index c51dcd6c7..d6fe3da17 100644 --- a/src/api/types/OrderLineItemPricingBlocklistsBlockedTax.ts +++ b/src/api/types/OrderLineItemPricingBlocklistsBlockedTax.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * A tax to block from applying to a line item. The tax must be diff --git a/src/api/types/OrderLineItemTax.ts b/src/api/types/OrderLineItemTax.ts index 46f8582a5..350cca4f6 100644 --- a/src/api/types/OrderLineItemTax.ts +++ b/src/api/types/OrderLineItemTax.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a tax that applies to one or more line item in the order. diff --git a/src/api/types/OrderLineItemTaxScope.ts b/src/api/types/OrderLineItemTaxScope.ts index a6a36051f..64efb16ba 100644 --- a/src/api/types/OrderLineItemTaxScope.ts +++ b/src/api/types/OrderLineItemTaxScope.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates whether this is a line-item or order-level tax. */ +/** + * Indicates whether this is a line-item or order-level tax. + */ +export type OrderLineItemTaxScope = "OTHER_TAX_SCOPE" | "LINE_ITEM" | "ORDER"; export const OrderLineItemTaxScope = { OtherTaxScope: "OTHER_TAX_SCOPE", LineItem: "LINE_ITEM", Order: "ORDER", } as const; -export type OrderLineItemTaxScope = (typeof OrderLineItemTaxScope)[keyof typeof OrderLineItemTaxScope]; diff --git a/src/api/types/OrderLineItemTaxType.ts b/src/api/types/OrderLineItemTaxType.ts index 4e8ed8120..12143f5b0 100644 --- a/src/api/types/OrderLineItemTaxType.ts +++ b/src/api/types/OrderLineItemTaxType.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates how the tax is applied to the associated line item or order. */ +/** + * Indicates how the tax is applied to the associated line item or order. + */ +export type OrderLineItemTaxType = "UNKNOWN_TAX" | "ADDITIVE" | "INCLUSIVE"; export const OrderLineItemTaxType = { UnknownTax: "UNKNOWN_TAX", Additive: "ADDITIVE", Inclusive: "INCLUSIVE", } as const; -export type OrderLineItemTaxType = (typeof OrderLineItemTaxType)[keyof typeof OrderLineItemTaxType]; diff --git a/src/api/types/OrderMoneyAmounts.ts b/src/api/types/OrderMoneyAmounts.ts index 392c29114..39a9d1a5c 100644 --- a/src/api/types/OrderMoneyAmounts.ts +++ b/src/api/types/OrderMoneyAmounts.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A collection of various money amounts. diff --git a/src/api/types/OrderPricingOptions.ts b/src/api/types/OrderPricingOptions.ts index c2ef0930a..b93c380b2 100644 --- a/src/api/types/OrderPricingOptions.ts +++ b/src/api/types/OrderPricingOptions.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Pricing options for an order. The options affect how the order's price is calculated. diff --git a/src/api/types/OrderQuantityUnit.ts b/src/api/types/OrderQuantityUnit.ts index c66952738..a8a12af82 100644 --- a/src/api/types/OrderQuantityUnit.ts +++ b/src/api/types/OrderQuantityUnit.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Contains the measurement unit for a quantity and a precision that diff --git a/src/api/types/OrderReturn.ts b/src/api/types/OrderReturn.ts index ec48967bd..81654aaa2 100644 --- a/src/api/types/OrderReturn.ts +++ b/src/api/types/OrderReturn.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The set of line items, service charges, taxes, discounts, tips, and other items being returned in an order. diff --git a/src/api/types/OrderReturnDiscount.ts b/src/api/types/OrderReturnDiscount.ts index f5b6e2327..7df41273b 100644 --- a/src/api/types/OrderReturnDiscount.ts +++ b/src/api/types/OrderReturnDiscount.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a discount being returned that applies to one or more return line items in an diff --git a/src/api/types/OrderReturnLineItem.ts b/src/api/types/OrderReturnLineItem.ts index 19972e2e1..94f42b8e1 100644 --- a/src/api/types/OrderReturnLineItem.ts +++ b/src/api/types/OrderReturnLineItem.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The line item being returned in an order. diff --git a/src/api/types/OrderReturnLineItemModifier.ts b/src/api/types/OrderReturnLineItemModifier.ts index af6222bd7..91f5a1fe0 100644 --- a/src/api/types/OrderReturnLineItemModifier.ts +++ b/src/api/types/OrderReturnLineItemModifier.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A line item modifier being returned. diff --git a/src/api/types/OrderReturnServiceCharge.ts b/src/api/types/OrderReturnServiceCharge.ts index 0dbd5c652..6e55c018a 100644 --- a/src/api/types/OrderReturnServiceCharge.ts +++ b/src/api/types/OrderReturnServiceCharge.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents the service charge applied to the original order. diff --git a/src/api/types/OrderReturnTax.ts b/src/api/types/OrderReturnTax.ts index bc998bfc2..62c7ba5f0 100644 --- a/src/api/types/OrderReturnTax.ts +++ b/src/api/types/OrderReturnTax.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a tax being returned that applies to one or more return line items in an order. diff --git a/src/api/types/OrderReturnTip.ts b/src/api/types/OrderReturnTip.ts index 494dae732..3031cee77 100644 --- a/src/api/types/OrderReturnTip.ts +++ b/src/api/types/OrderReturnTip.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A tip being returned. diff --git a/src/api/types/OrderReward.ts b/src/api/types/OrderReward.ts index ea237d510..2ee82beb8 100644 --- a/src/api/types/OrderReward.ts +++ b/src/api/types/OrderReward.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents a reward that can be applied to an order if the necessary diff --git a/src/api/types/OrderRoundingAdjustment.ts b/src/api/types/OrderRoundingAdjustment.ts index 1755d82d2..b14027bf6 100644 --- a/src/api/types/OrderRoundingAdjustment.ts +++ b/src/api/types/OrderRoundingAdjustment.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A rounding adjustment of the money being returned. Commonly used to apply cash rounding diff --git a/src/api/types/OrderServiceCharge.ts b/src/api/types/OrderServiceCharge.ts index a1bde321a..bbf802c55 100644 --- a/src/api/types/OrderServiceCharge.ts +++ b/src/api/types/OrderServiceCharge.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a service charge applied to an order. diff --git a/src/api/types/OrderServiceChargeCalculationPhase.ts b/src/api/types/OrderServiceChargeCalculationPhase.ts index 691b929c0..d267e2ede 100644 --- a/src/api/types/OrderServiceChargeCalculationPhase.ts +++ b/src/api/types/OrderServiceChargeCalculationPhase.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents a phase in the process of calculating order totals. @@ -6,11 +8,14 @@ * * [Read more about how order totals are calculated.](https://developer.squareup.com/docs/orders-api/how-it-works#how-totals-are-calculated) */ +export type OrderServiceChargeCalculationPhase = + | "SUBTOTAL_PHASE" + | "TOTAL_PHASE" + | "APPORTIONED_PERCENTAGE_PHASE" + | "APPORTIONED_AMOUNT_PHASE"; export const OrderServiceChargeCalculationPhase = { SubtotalPhase: "SUBTOTAL_PHASE", TotalPhase: "TOTAL_PHASE", ApportionedPercentagePhase: "APPORTIONED_PERCENTAGE_PHASE", ApportionedAmountPhase: "APPORTIONED_AMOUNT_PHASE", } as const; -export type OrderServiceChargeCalculationPhase = - (typeof OrderServiceChargeCalculationPhase)[keyof typeof OrderServiceChargeCalculationPhase]; diff --git a/src/api/types/OrderServiceChargeScope.ts b/src/api/types/OrderServiceChargeScope.ts index 25f159675..fdd81f87f 100644 --- a/src/api/types/OrderServiceChargeScope.ts +++ b/src/api/types/OrderServiceChargeScope.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Indicates whether this is a line-item or order-level apportioned * service charge. */ +export type OrderServiceChargeScope = "OTHER_SERVICE_CHARGE_SCOPE" | "LINE_ITEM" | "ORDER"; export const OrderServiceChargeScope = { OtherServiceChargeScope: "OTHER_SERVICE_CHARGE_SCOPE", LineItem: "LINE_ITEM", Order: "ORDER", } as const; -export type OrderServiceChargeScope = (typeof OrderServiceChargeScope)[keyof typeof OrderServiceChargeScope]; diff --git a/src/api/types/OrderServiceChargeTreatmentType.ts b/src/api/types/OrderServiceChargeTreatmentType.ts index 9b03a9e2a..212f2d39a 100644 --- a/src/api/types/OrderServiceChargeTreatmentType.ts +++ b/src/api/types/OrderServiceChargeTreatmentType.ts @@ -1,12 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Indicates whether the service charge will be treated as a value-holding line item or * apportioned toward a line item. */ +export type OrderServiceChargeTreatmentType = "LINE_ITEM_TREATMENT" | "APPORTIONED_TREATMENT"; export const OrderServiceChargeTreatmentType = { LineItemTreatment: "LINE_ITEM_TREATMENT", ApportionedTreatment: "APPORTIONED_TREATMENT", } as const; -export type OrderServiceChargeTreatmentType = - (typeof OrderServiceChargeTreatmentType)[keyof typeof OrderServiceChargeTreatmentType]; diff --git a/src/api/types/OrderServiceChargeType.ts b/src/api/types/OrderServiceChargeType.ts index 79cc106e5..960b13973 100644 --- a/src/api/types/OrderServiceChargeType.ts +++ b/src/api/types/OrderServiceChargeType.ts @@ -1,7 +1,9 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type OrderServiceChargeType = "AUTO_GRATUITY" | "CUSTOM"; export const OrderServiceChargeType = { AutoGratuity: "AUTO_GRATUITY", Custom: "CUSTOM", } as const; -export type OrderServiceChargeType = (typeof OrderServiceChargeType)[keyof typeof OrderServiceChargeType]; diff --git a/src/api/types/OrderSource.ts b/src/api/types/OrderSource.ts index 291732685..c02c1400e 100644 --- a/src/api/types/OrderSource.ts +++ b/src/api/types/OrderSource.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents the origination details of an order. diff --git a/src/api/types/OrderState.ts b/src/api/types/OrderState.ts index 46d15ac38..545810af4 100644 --- a/src/api/types/OrderState.ts +++ b/src/api/types/OrderState.ts @@ -1,10 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The state of the order. */ +/** + * The state of the order. + */ +export type OrderState = "OPEN" | "COMPLETED" | "CANCELED" | "DRAFT"; export const OrderState = { Open: "OPEN", Completed: "COMPLETED", Canceled: "CANCELED", Draft: "DRAFT", } as const; -export type OrderState = (typeof OrderState)[keyof typeof OrderState]; diff --git a/src/api/types/OrderUpdated.ts b/src/api/types/OrderUpdated.ts index 31d7d1d0f..e9d9371d4 100644 --- a/src/api/types/OrderUpdated.ts +++ b/src/api/types/OrderUpdated.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface OrderUpdated { /** The order's unique ID. */ diff --git a/src/api/types/OrderUpdatedEvent.ts b/src/api/types/OrderUpdatedEvent.ts index 27be5a81f..99045bcbb 100644 --- a/src/api/types/OrderUpdatedEvent.ts +++ b/src/api/types/OrderUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when an [Order](entity:Order) is updated. This diff --git a/src/api/types/OrderUpdatedEventData.ts b/src/api/types/OrderUpdatedEventData.ts index 6f23ba764..a077e59f3 100644 --- a/src/api/types/OrderUpdatedEventData.ts +++ b/src/api/types/OrderUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface OrderUpdatedEventData { /** Name of the affected object’s type, `"order_updated"`. */ diff --git a/src/api/types/OrderUpdatedObject.ts b/src/api/types/OrderUpdatedObject.ts index edd29a9f2..476a7ad60 100644 --- a/src/api/types/OrderUpdatedObject.ts +++ b/src/api/types/OrderUpdatedObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface OrderUpdatedObject { /** Information about the updated order. */ diff --git a/src/api/types/PauseSubscriptionResponse.ts b/src/api/types/PauseSubscriptionResponse.ts index b3f43b1c3..0a0c66a4d 100644 --- a/src/api/types/PauseSubscriptionResponse.ts +++ b/src/api/types/PauseSubscriptionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines output parameters in a response from the diff --git a/src/api/types/PayOrderResponse.ts b/src/api/types/PayOrderResponse.ts index 7d01111fb..a1618a8f1 100644 --- a/src/api/types/PayOrderResponse.ts +++ b/src/api/types/PayOrderResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of a request to the diff --git a/src/api/types/Payment.ts b/src/api/types/Payment.ts index 2ffb66b93..e374c606c 100644 --- a/src/api/types/Payment.ts +++ b/src/api/types/Payment.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a payment processed by the Square API. @@ -21,9 +23,7 @@ export interface Payment { */ amountMoney?: Square.Money; /** - * The amount designated as a tip for the seller's staff. - * - * Tips for external vendors such as a 3rd party delivery courier must be recorded using Order.service_charges. + * The amount designated as a tip. * * This amount is specified in the smallest denomination of the applicable currency (for example, * US dollar amounts are specified in cents). For more information, see diff --git a/src/api/types/PaymentBalanceActivityAppFeeRefundDetail.ts b/src/api/types/PaymentBalanceActivityAppFeeRefundDetail.ts index fe7e8c709..8ae3e35b9 100644 --- a/src/api/types/PaymentBalanceActivityAppFeeRefundDetail.ts +++ b/src/api/types/PaymentBalanceActivityAppFeeRefundDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivityAppFeeRefundDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityAppFeeRevenueDetail.ts b/src/api/types/PaymentBalanceActivityAppFeeRevenueDetail.ts index dbfc182fa..3365241f6 100644 --- a/src/api/types/PaymentBalanceActivityAppFeeRevenueDetail.ts +++ b/src/api/types/PaymentBalanceActivityAppFeeRevenueDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivityAppFeeRevenueDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityAutomaticSavingsDetail.ts b/src/api/types/PaymentBalanceActivityAutomaticSavingsDetail.ts index 73f56e403..d74597394 100644 --- a/src/api/types/PaymentBalanceActivityAutomaticSavingsDetail.ts +++ b/src/api/types/PaymentBalanceActivityAutomaticSavingsDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivityAutomaticSavingsDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityAutomaticSavingsReversedDetail.ts b/src/api/types/PaymentBalanceActivityAutomaticSavingsReversedDetail.ts index 357fe484a..2d37f5c08 100644 --- a/src/api/types/PaymentBalanceActivityAutomaticSavingsReversedDetail.ts +++ b/src/api/types/PaymentBalanceActivityAutomaticSavingsReversedDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivityAutomaticSavingsReversedDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityChargeDetail.ts b/src/api/types/PaymentBalanceActivityChargeDetail.ts index 51b2d4336..9c0ebb78b 100644 --- a/src/api/types/PaymentBalanceActivityChargeDetail.ts +++ b/src/api/types/PaymentBalanceActivityChargeDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivityChargeDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityDepositFeeDetail.ts b/src/api/types/PaymentBalanceActivityDepositFeeDetail.ts index 521cd17dd..1c2b38a39 100644 --- a/src/api/types/PaymentBalanceActivityDepositFeeDetail.ts +++ b/src/api/types/PaymentBalanceActivityDepositFeeDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivityDepositFeeDetail { /** The ID of the payout that triggered this deposit fee activity. */ diff --git a/src/api/types/PaymentBalanceActivityDepositFeeReversedDetail.ts b/src/api/types/PaymentBalanceActivityDepositFeeReversedDetail.ts index 2c53bf092..0c14b36ce 100644 --- a/src/api/types/PaymentBalanceActivityDepositFeeReversedDetail.ts +++ b/src/api/types/PaymentBalanceActivityDepositFeeReversedDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivityDepositFeeReversedDetail { /** The ID of the payout that triggered this deposit fee activity. */ diff --git a/src/api/types/PaymentBalanceActivityDisputeDetail.ts b/src/api/types/PaymentBalanceActivityDisputeDetail.ts index 6a608a2df..d8650ce27 100644 --- a/src/api/types/PaymentBalanceActivityDisputeDetail.ts +++ b/src/api/types/PaymentBalanceActivityDisputeDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivityDisputeDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityFeeDetail.ts b/src/api/types/PaymentBalanceActivityFeeDetail.ts index 08a7997dc..0a718c269 100644 --- a/src/api/types/PaymentBalanceActivityFeeDetail.ts +++ b/src/api/types/PaymentBalanceActivityFeeDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivityFeeDetail { /** diff --git a/src/api/types/PaymentBalanceActivityFreeProcessingDetail.ts b/src/api/types/PaymentBalanceActivityFreeProcessingDetail.ts index 369a63e9d..80871927f 100644 --- a/src/api/types/PaymentBalanceActivityFreeProcessingDetail.ts +++ b/src/api/types/PaymentBalanceActivityFreeProcessingDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivityFreeProcessingDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityHoldAdjustmentDetail.ts b/src/api/types/PaymentBalanceActivityHoldAdjustmentDetail.ts index ee00c3599..cabfda713 100644 --- a/src/api/types/PaymentBalanceActivityHoldAdjustmentDetail.ts +++ b/src/api/types/PaymentBalanceActivityHoldAdjustmentDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivityHoldAdjustmentDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityOpenDisputeDetail.ts b/src/api/types/PaymentBalanceActivityOpenDisputeDetail.ts index 5d9a121c7..5a6a4e388 100644 --- a/src/api/types/PaymentBalanceActivityOpenDisputeDetail.ts +++ b/src/api/types/PaymentBalanceActivityOpenDisputeDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivityOpenDisputeDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityOtherAdjustmentDetail.ts b/src/api/types/PaymentBalanceActivityOtherAdjustmentDetail.ts index f31c8837d..9a23c3c21 100644 --- a/src/api/types/PaymentBalanceActivityOtherAdjustmentDetail.ts +++ b/src/api/types/PaymentBalanceActivityOtherAdjustmentDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivityOtherAdjustmentDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityOtherDetail.ts b/src/api/types/PaymentBalanceActivityOtherDetail.ts index 7b0fb2df0..ca0c2015e 100644 --- a/src/api/types/PaymentBalanceActivityOtherDetail.ts +++ b/src/api/types/PaymentBalanceActivityOtherDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivityOtherDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityRefundDetail.ts b/src/api/types/PaymentBalanceActivityRefundDetail.ts index b764b3124..edf5fbeac 100644 --- a/src/api/types/PaymentBalanceActivityRefundDetail.ts +++ b/src/api/types/PaymentBalanceActivityRefundDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivityRefundDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityReleaseAdjustmentDetail.ts b/src/api/types/PaymentBalanceActivityReleaseAdjustmentDetail.ts index 3a89dff18..1264c364b 100644 --- a/src/api/types/PaymentBalanceActivityReleaseAdjustmentDetail.ts +++ b/src/api/types/PaymentBalanceActivityReleaseAdjustmentDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivityReleaseAdjustmentDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityReserveHoldDetail.ts b/src/api/types/PaymentBalanceActivityReserveHoldDetail.ts index 42beb6fe9..8aa150e24 100644 --- a/src/api/types/PaymentBalanceActivityReserveHoldDetail.ts +++ b/src/api/types/PaymentBalanceActivityReserveHoldDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivityReserveHoldDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityReserveReleaseDetail.ts b/src/api/types/PaymentBalanceActivityReserveReleaseDetail.ts index 84920cfc2..11999dd2d 100644 --- a/src/api/types/PaymentBalanceActivityReserveReleaseDetail.ts +++ b/src/api/types/PaymentBalanceActivityReserveReleaseDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivityReserveReleaseDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivitySquareCapitalPaymentDetail.ts b/src/api/types/PaymentBalanceActivitySquareCapitalPaymentDetail.ts index cd03eac04..faea6cc0a 100644 --- a/src/api/types/PaymentBalanceActivitySquareCapitalPaymentDetail.ts +++ b/src/api/types/PaymentBalanceActivitySquareCapitalPaymentDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivitySquareCapitalPaymentDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivitySquareCapitalReversedPaymentDetail.ts b/src/api/types/PaymentBalanceActivitySquareCapitalReversedPaymentDetail.ts index a5233e729..b906d7614 100644 --- a/src/api/types/PaymentBalanceActivitySquareCapitalReversedPaymentDetail.ts +++ b/src/api/types/PaymentBalanceActivitySquareCapitalReversedPaymentDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivitySquareCapitalReversedPaymentDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivitySquarePayrollTransferDetail.ts b/src/api/types/PaymentBalanceActivitySquarePayrollTransferDetail.ts index 2ac11ccf9..16740b83c 100644 --- a/src/api/types/PaymentBalanceActivitySquarePayrollTransferDetail.ts +++ b/src/api/types/PaymentBalanceActivitySquarePayrollTransferDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivitySquarePayrollTransferDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivitySquarePayrollTransferReversedDetail.ts b/src/api/types/PaymentBalanceActivitySquarePayrollTransferReversedDetail.ts index b9f711f00..9746b2c10 100644 --- a/src/api/types/PaymentBalanceActivitySquarePayrollTransferReversedDetail.ts +++ b/src/api/types/PaymentBalanceActivitySquarePayrollTransferReversedDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivitySquarePayrollTransferReversedDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityTaxOnFeeDetail.ts b/src/api/types/PaymentBalanceActivityTaxOnFeeDetail.ts index 50c870230..b85595f25 100644 --- a/src/api/types/PaymentBalanceActivityTaxOnFeeDetail.ts +++ b/src/api/types/PaymentBalanceActivityTaxOnFeeDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivityTaxOnFeeDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityThirdPartyFeeDetail.ts b/src/api/types/PaymentBalanceActivityThirdPartyFeeDetail.ts index 2b32a9c30..9f3e4172a 100644 --- a/src/api/types/PaymentBalanceActivityThirdPartyFeeDetail.ts +++ b/src/api/types/PaymentBalanceActivityThirdPartyFeeDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivityThirdPartyFeeDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentBalanceActivityThirdPartyFeeRefundDetail.ts b/src/api/types/PaymentBalanceActivityThirdPartyFeeRefundDetail.ts index dbd7b0d1e..e84a88472 100644 --- a/src/api/types/PaymentBalanceActivityThirdPartyFeeRefundDetail.ts +++ b/src/api/types/PaymentBalanceActivityThirdPartyFeeRefundDetail.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaymentBalanceActivityThirdPartyFeeRefundDetail { /** The ID of the payment associated with this activity. */ diff --git a/src/api/types/PaymentCreatedEvent.ts b/src/api/types/PaymentCreatedEvent.ts index e5e144255..3e865157b 100644 --- a/src/api/types/PaymentCreatedEvent.ts +++ b/src/api/types/PaymentCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [Payment](entity:Payment) is created. diff --git a/src/api/types/PaymentCreatedEventData.ts b/src/api/types/PaymentCreatedEventData.ts index f773b246c..39936a8d2 100644 --- a/src/api/types/PaymentCreatedEventData.ts +++ b/src/api/types/PaymentCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface PaymentCreatedEventData { /** Name of the affected object’s type, `"payment"`. */ diff --git a/src/api/types/PaymentCreatedEventObject.ts b/src/api/types/PaymentCreatedEventObject.ts index ce5650c34..6fe3ce9c8 100644 --- a/src/api/types/PaymentCreatedEventObject.ts +++ b/src/api/types/PaymentCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface PaymentCreatedEventObject { /** The created payment. */ diff --git a/src/api/types/PaymentLink.ts b/src/api/types/PaymentLink.ts index 25d12ad28..65ddee385 100644 --- a/src/api/types/PaymentLink.ts +++ b/src/api/types/PaymentLink.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface PaymentLink { /** The Square-assigned ID of the payment link. */ diff --git a/src/api/types/PaymentLinkRelatedResources.ts b/src/api/types/PaymentLinkRelatedResources.ts index 2530fe7b7..1161d468d 100644 --- a/src/api/types/PaymentLinkRelatedResources.ts +++ b/src/api/types/PaymentLinkRelatedResources.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface PaymentLinkRelatedResources { /** The order associated with the payment link. */ diff --git a/src/api/types/PaymentOptions.ts b/src/api/types/PaymentOptions.ts index 60bcf1f03..b1ad4dbad 100644 --- a/src/api/types/PaymentOptions.ts +++ b/src/api/types/PaymentOptions.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface PaymentOptions { /** diff --git a/src/api/types/PaymentOptionsDelayAction.ts b/src/api/types/PaymentOptionsDelayAction.ts index 0deb6463e..4b485f015 100644 --- a/src/api/types/PaymentOptionsDelayAction.ts +++ b/src/api/types/PaymentOptionsDelayAction.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Describes the action to be applied to a delayed capture payment when the delay_duration * has elapsed. */ +export type PaymentOptionsDelayAction = "CANCEL" | "COMPLETE"; export const PaymentOptionsDelayAction = { Cancel: "CANCEL", Complete: "COMPLETE", } as const; -export type PaymentOptionsDelayAction = (typeof PaymentOptionsDelayAction)[keyof typeof PaymentOptionsDelayAction]; diff --git a/src/api/types/PaymentRefund.ts b/src/api/types/PaymentRefund.ts index a71e28dd2..7118cb959 100644 --- a/src/api/types/PaymentRefund.ts +++ b/src/api/types/PaymentRefund.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a refund of a payment made using Square. Contains information about diff --git a/src/api/types/PaymentUpdatedEvent.ts b/src/api/types/PaymentUpdatedEvent.ts index 6a16d4e1d..60a30a58c 100644 --- a/src/api/types/PaymentUpdatedEvent.ts +++ b/src/api/types/PaymentUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [Payment](entity:Payment) is updated. diff --git a/src/api/types/PaymentUpdatedEventData.ts b/src/api/types/PaymentUpdatedEventData.ts index 05d2da047..69310b4da 100644 --- a/src/api/types/PaymentUpdatedEventData.ts +++ b/src/api/types/PaymentUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface PaymentUpdatedEventData { /** Name of the affected object’s type, `"payment"`. */ diff --git a/src/api/types/PaymentUpdatedEventObject.ts b/src/api/types/PaymentUpdatedEventObject.ts index 0db9f5b4f..4c3d2fc5b 100644 --- a/src/api/types/PaymentUpdatedEventObject.ts +++ b/src/api/types/PaymentUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface PaymentUpdatedEventObject { /** The updated payment. */ diff --git a/src/api/types/Payout.ts b/src/api/types/Payout.ts index 29ade4744..bd8aa5bfe 100644 --- a/src/api/types/Payout.ts +++ b/src/api/types/Payout.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * An accounting of the amount owed the seller and record of the actual transfer to their diff --git a/src/api/types/PayoutEntry.ts b/src/api/types/PayoutEntry.ts index c5d426186..50311ca45 100644 --- a/src/api/types/PayoutEntry.ts +++ b/src/api/types/PayoutEntry.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * One or more PayoutEntries that make up a Payout. Each one has a date, amount, and type of activity. diff --git a/src/api/types/PayoutFailedEvent.ts b/src/api/types/PayoutFailedEvent.ts index 00b383ca4..02b523dec 100644 --- a/src/api/types/PayoutFailedEvent.ts +++ b/src/api/types/PayoutFailedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [Payout](entity:Payout) has failed. diff --git a/src/api/types/PayoutFailedEventData.ts b/src/api/types/PayoutFailedEventData.ts index 515ce8cee..c81cca237 100644 --- a/src/api/types/PayoutFailedEventData.ts +++ b/src/api/types/PayoutFailedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface PayoutFailedEventData { /** The name of the affected object's type, `payout`. */ diff --git a/src/api/types/PayoutFailedEventObject.ts b/src/api/types/PayoutFailedEventObject.ts index aa2a68d4a..92a5df18a 100644 --- a/src/api/types/PayoutFailedEventObject.ts +++ b/src/api/types/PayoutFailedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface PayoutFailedEventObject { /** The payout that failed. */ diff --git a/src/api/types/PayoutFee.ts b/src/api/types/PayoutFee.ts index d0c0988dd..0535fc9c8 100644 --- a/src/api/types/PayoutFee.ts +++ b/src/api/types/PayoutFee.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a payout fee that can incur as part of a payout. diff --git a/src/api/types/PayoutFeeType.ts b/src/api/types/PayoutFeeType.ts index 695fae7b1..ff40804b9 100644 --- a/src/api/types/PayoutFeeType.ts +++ b/src/api/types/PayoutFeeType.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Represents the type of payout fee that can incur as part of a payout. */ +/** + * Represents the type of payout fee that can incur as part of a payout. + */ +export type PayoutFeeType = "TRANSFER_FEE" | "TAX_ON_TRANSFER_FEE"; export const PayoutFeeType = { TransferFee: "TRANSFER_FEE", TaxOnTransferFee: "TAX_ON_TRANSFER_FEE", } as const; -export type PayoutFeeType = (typeof PayoutFeeType)[keyof typeof PayoutFeeType]; diff --git a/src/api/types/PayoutPaidEvent.ts b/src/api/types/PayoutPaidEvent.ts index 45791f04c..b781c6cdf 100644 --- a/src/api/types/PayoutPaidEvent.ts +++ b/src/api/types/PayoutPaidEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [Payout](entity:Payout) is complete. diff --git a/src/api/types/PayoutPaidEventData.ts b/src/api/types/PayoutPaidEventData.ts index d59a52f14..f91bfda41 100644 --- a/src/api/types/PayoutPaidEventData.ts +++ b/src/api/types/PayoutPaidEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface PayoutPaidEventData { /** Name of the affected object’s type, `"payout"`. */ diff --git a/src/api/types/PayoutPaidEventObject.ts b/src/api/types/PayoutPaidEventObject.ts index bd57ba64d..295d4d3a8 100644 --- a/src/api/types/PayoutPaidEventObject.ts +++ b/src/api/types/PayoutPaidEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface PayoutPaidEventObject { /** The payout that has completed. */ diff --git a/src/api/types/PayoutSentEvent.ts b/src/api/types/PayoutSentEvent.ts index a38d1e0c4..8a6bd6f40 100644 --- a/src/api/types/PayoutSentEvent.ts +++ b/src/api/types/PayoutSentEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [Payout](entity:Payout) is sent. diff --git a/src/api/types/PayoutSentEventData.ts b/src/api/types/PayoutSentEventData.ts index a4ad4c807..5882f125e 100644 --- a/src/api/types/PayoutSentEventData.ts +++ b/src/api/types/PayoutSentEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface PayoutSentEventData { /** Name of the affected object’s type, `"payout"`. */ diff --git a/src/api/types/PayoutSentEventObject.ts b/src/api/types/PayoutSentEventObject.ts index 5baa39e20..d776568b3 100644 --- a/src/api/types/PayoutSentEventObject.ts +++ b/src/api/types/PayoutSentEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface PayoutSentEventObject { /** The payout that was sent. */ diff --git a/src/api/types/PayoutStatus.ts b/src/api/types/PayoutStatus.ts index aefff4e4c..47fc558fb 100644 --- a/src/api/types/PayoutStatus.ts +++ b/src/api/types/PayoutStatus.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Payout status types */ +/** + * Payout status types + */ +export type PayoutStatus = "SENT" | "FAILED" | "PAID"; export const PayoutStatus = { Sent: "SENT", Failed: "FAILED", Paid: "PAID", } as const; -export type PayoutStatus = (typeof PayoutStatus)[keyof typeof PayoutStatus]; diff --git a/src/api/types/PayoutType.ts b/src/api/types/PayoutType.ts index 1bd72308f..d1a6a078f 100644 --- a/src/api/types/PayoutType.ts +++ b/src/api/types/PayoutType.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The type of payout: “BATCH” or “SIMPLE”. @@ -6,8 +8,8 @@ * SIMPLE payouts do not have any payout entries associated with them * and will show up as one of the payout entries in a future BATCH payout. */ +export type PayoutType = "BATCH" | "SIMPLE"; export const PayoutType = { Batch: "BATCH", Simple: "SIMPLE", } as const; -export type PayoutType = (typeof PayoutType)[keyof typeof PayoutType]; diff --git a/src/api/types/Phase.ts b/src/api/types/Phase.ts index 410a283d8..f3e728a97 100644 --- a/src/api/types/Phase.ts +++ b/src/api/types/Phase.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents a phase, which can override subscription phases as defined by plan_id diff --git a/src/api/types/PhaseInput.ts b/src/api/types/PhaseInput.ts index 6d6b73095..6337c2d0c 100644 --- a/src/api/types/PhaseInput.ts +++ b/src/api/types/PhaseInput.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents the arguments used to construct a new phase. diff --git a/src/api/types/PrePopulatedData.ts b/src/api/types/PrePopulatedData.ts index 6bc23a826..c44aa1414 100644 --- a/src/api/types/PrePopulatedData.ts +++ b/src/api/types/PrePopulatedData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Describes buyer data to prepopulate in the payment form. diff --git a/src/api/types/ProcessingFee.ts b/src/api/types/ProcessingFee.ts index 0ba26f94c..cc656115c 100644 --- a/src/api/types/ProcessingFee.ts +++ b/src/api/types/ProcessingFee.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents the Square processing fee. diff --git a/src/api/types/Product.ts b/src/api/types/Product.ts index e2b30dfad..4255aff87 100644 --- a/src/api/types/Product.ts +++ b/src/api/types/Product.ts @@ -1,6 +1,21 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates the Square product used to generate a change. */ +/** + * Indicates the Square product used to generate a change. + */ +export type Product = + | "SQUARE_POS" + | "EXTERNAL_API" + | "BILLING" + | "APPOINTMENTS" + | "INVOICES" + | "ONLINE_STORE" + | "PAYROLL" + | "DASHBOARD" + | "ITEM_LIBRARY_IMPORT" + | "OTHER"; export const Product = { SquarePos: "SQUARE_POS", ExternalApi: "EXTERNAL_API", @@ -13,4 +28,3 @@ export const Product = { ItemLibraryImport: "ITEM_LIBRARY_IMPORT", Other: "OTHER", } as const; -export type Product = (typeof Product)[keyof typeof Product]; diff --git a/src/api/types/ProductType.ts b/src/api/types/ProductType.ts index 0c279973d..8eb954886 100644 --- a/src/api/types/ProductType.ts +++ b/src/api/types/ProductType.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type ProductType = "TERMINAL_API"; diff --git a/src/api/types/PublishInvoiceResponse.ts b/src/api/types/PublishInvoiceResponse.ts index 88ffd3fa1..bdbf60710 100644 --- a/src/api/types/PublishInvoiceResponse.ts +++ b/src/api/types/PublishInvoiceResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Describes a `PublishInvoice` response. diff --git a/src/api/types/PublishScheduledShiftResponse.ts b/src/api/types/PublishScheduledShiftResponse.ts index 7da53fa91..daaa7dcb3 100644 --- a/src/api/types/PublishScheduledShiftResponse.ts +++ b/src/api/types/PublishScheduledShiftResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [PublishScheduledShift](api-endpoint:Labor-PublishScheduledShift) response. diff --git a/src/api/types/QrCodeOptions.ts b/src/api/types/QrCodeOptions.ts index 33df8e64b..ab7e8b989 100644 --- a/src/api/types/QrCodeOptions.ts +++ b/src/api/types/QrCodeOptions.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Fields to describe the action that displays QR-Codes. diff --git a/src/api/types/QuickPay.ts b/src/api/types/QuickPay.ts index 293e4b0a4..f0ac1d1d6 100644 --- a/src/api/types/QuickPay.ts +++ b/src/api/types/QuickPay.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Describes an ad hoc item and price to generate a quick pay checkout link. diff --git a/src/api/types/Range.ts b/src/api/types/Range.ts index e0f63ca94..041ac1f84 100644 --- a/src/api/types/Range.ts +++ b/src/api/types/Range.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The range of a number value between the specified lower and upper bounds. diff --git a/src/api/types/ReceiptOptions.ts b/src/api/types/ReceiptOptions.ts index 041b94979..28a17e87f 100644 --- a/src/api/types/ReceiptOptions.ts +++ b/src/api/types/ReceiptOptions.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Describes receipt action fields. diff --git a/src/api/types/ReceiveTransferOrderResponse.ts b/src/api/types/ReceiveTransferOrderResponse.ts deleted file mode 100644 index 4dfa8255e..000000000 --- a/src/api/types/ReceiveTransferOrderResponse.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -/** - * Response for receiving items for a transfer order - */ -export interface ReceiveTransferOrderResponse { - /** The updated transfer order */ - transferOrder?: Square.TransferOrder; - /** Any errors that occurred during the request */ - errors?: Square.Error_[]; -} diff --git a/src/api/types/RedeemLoyaltyRewardResponse.ts b/src/api/types/RedeemLoyaltyRewardResponse.ts index 714b7c0dd..b3233091b 100644 --- a/src/api/types/RedeemLoyaltyRewardResponse.ts +++ b/src/api/types/RedeemLoyaltyRewardResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response that includes the `LoyaltyEvent` published for redeeming the reward. diff --git a/src/api/types/Reference.ts b/src/api/types/Reference.ts deleted file mode 100644 index a9ae1dee8..000000000 --- a/src/api/types/Reference.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -export interface Reference { - /** - * The type of entity a channel is associated with. - * See [Type](#type-type) for possible values - */ - type?: Square.ReferenceType; - /** The id of the entity a channel is associated with. */ - id?: string; -} diff --git a/src/api/types/ReferenceType.ts b/src/api/types/ReferenceType.ts deleted file mode 100644 index 7ba9b25e5..000000000 --- a/src/api/types/ReferenceType.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** The type of platform concept a channel can represent. */ -export const ReferenceType = { - UnknownType: "UNKNOWN_TYPE", - Location: "LOCATION", - FirstPartyIntegration: "FIRST_PARTY_INTEGRATION", - OauthApplication: "OAUTH_APPLICATION", - OnlineSite: "ONLINE_SITE", - OnlineCheckout: "ONLINE_CHECKOUT", - Invoice: "INVOICE", - GiftCard: "GIFT_CARD", - GiftCardMarketplace: "GIFT_CARD_MARKETPLACE", - RecurringSubscription: "RECURRING_SUBSCRIPTION", - OnlineBookingFlow: "ONLINE_BOOKING_FLOW", - SquareAssistant: "SQUARE_ASSISTANT", - CashLocal: "CASH_LOCAL", - PointOfSale: "POINT_OF_SALE", - Kiosk: "KIOSK", -} as const; -export type ReferenceType = (typeof ReferenceType)[keyof typeof ReferenceType]; diff --git a/src/api/types/Refund.ts b/src/api/types/Refund.ts index 0c7cb554c..3614a38f5 100644 --- a/src/api/types/Refund.ts +++ b/src/api/types/Refund.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a refund processed for a Square transaction. diff --git a/src/api/types/RefundCreatedEvent.ts b/src/api/types/RefundCreatedEvent.ts index ce88d753a..39ab7bd33 100644 --- a/src/api/types/RefundCreatedEvent.ts +++ b/src/api/types/RefundCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [Refund](entity:PaymentRefund) is created. diff --git a/src/api/types/RefundCreatedEventData.ts b/src/api/types/RefundCreatedEventData.ts index 2e87f3e94..e2b8b8c75 100644 --- a/src/api/types/RefundCreatedEventData.ts +++ b/src/api/types/RefundCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface RefundCreatedEventData { /** Name of the affected object’s type, `"refund"`. */ diff --git a/src/api/types/RefundCreatedEventObject.ts b/src/api/types/RefundCreatedEventObject.ts index b81cca471..4f04f92b8 100644 --- a/src/api/types/RefundCreatedEventObject.ts +++ b/src/api/types/RefundCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface RefundCreatedEventObject { /** The created refund. */ diff --git a/src/api/types/RefundPaymentResponse.ts b/src/api/types/RefundPaymentResponse.ts index fdbe21aff..708d54360 100644 --- a/src/api/types/RefundPaymentResponse.ts +++ b/src/api/types/RefundPaymentResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the response returned by diff --git a/src/api/types/RefundStatus.ts b/src/api/types/RefundStatus.ts index 007dc5249..b090b92f1 100644 --- a/src/api/types/RefundStatus.ts +++ b/src/api/types/RefundStatus.ts @@ -1,10 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates a refund's current status. */ +/** + * Indicates a refund's current status. + */ +export type RefundStatus = "PENDING" | "APPROVED" | "REJECTED" | "FAILED"; export const RefundStatus = { Pending: "PENDING", Approved: "APPROVED", Rejected: "REJECTED", Failed: "FAILED", } as const; -export type RefundStatus = (typeof RefundStatus)[keyof typeof RefundStatus]; diff --git a/src/api/types/RefundUpdatedEvent.ts b/src/api/types/RefundUpdatedEvent.ts index cb387e198..605abdeda 100644 --- a/src/api/types/RefundUpdatedEvent.ts +++ b/src/api/types/RefundUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [Refund](entity:PaymentRefund) is updated. diff --git a/src/api/types/RefundUpdatedEventData.ts b/src/api/types/RefundUpdatedEventData.ts index 067ec2902..289303776 100644 --- a/src/api/types/RefundUpdatedEventData.ts +++ b/src/api/types/RefundUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface RefundUpdatedEventData { /** Name of the affected object’s type, `"refund"`. */ diff --git a/src/api/types/RefundUpdatedEventObject.ts b/src/api/types/RefundUpdatedEventObject.ts index baa10f146..acfb97f5b 100644 --- a/src/api/types/RefundUpdatedEventObject.ts +++ b/src/api/types/RefundUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface RefundUpdatedEventObject { /** The updated refund. */ diff --git a/src/api/types/RegisterDomainResponse.ts b/src/api/types/RegisterDomainResponse.ts index b5d13395f..840e6d51d 100644 --- a/src/api/types/RegisterDomainResponse.ts +++ b/src/api/types/RegisterDomainResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/RegisterDomainResponseStatus.ts b/src/api/types/RegisterDomainResponseStatus.ts index 48e792a9c..06dacbaf9 100644 --- a/src/api/types/RegisterDomainResponseStatus.ts +++ b/src/api/types/RegisterDomainResponseStatus.ts @@ -1,9 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The status of the domain registration. */ +/** + * The status of the domain registration. + */ +export type RegisterDomainResponseStatus = "PENDING" | "VERIFIED"; export const RegisterDomainResponseStatus = { Pending: "PENDING", Verified: "VERIFIED", } as const; -export type RegisterDomainResponseStatus = - (typeof RegisterDomainResponseStatus)[keyof typeof RegisterDomainResponseStatus]; diff --git a/src/api/types/RemoveGroupFromCustomerResponse.ts b/src/api/types/RemoveGroupFromCustomerResponse.ts index 233b5a097..964682649 100644 --- a/src/api/types/RemoveGroupFromCustomerResponse.ts +++ b/src/api/types/RemoveGroupFromCustomerResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/ResumeSubscriptionResponse.ts b/src/api/types/ResumeSubscriptionResponse.ts index d5be44ae6..286cb12aa 100644 --- a/src/api/types/ResumeSubscriptionResponse.ts +++ b/src/api/types/ResumeSubscriptionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines output parameters in a response from the diff --git a/src/api/types/RetrieveBookingCustomAttributeDefinitionResponse.ts b/src/api/types/RetrieveBookingCustomAttributeDefinitionResponse.ts index 752d28113..a2ba2f0eb 100644 --- a/src/api/types/RetrieveBookingCustomAttributeDefinitionResponse.ts +++ b/src/api/types/RetrieveBookingCustomAttributeDefinitionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [RetrieveBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-RetrieveBookingCustomAttributeDefinition) response. diff --git a/src/api/types/RetrieveBookingCustomAttributeResponse.ts b/src/api/types/RetrieveBookingCustomAttributeResponse.ts index ed933ffdd..0664f5398 100644 --- a/src/api/types/RetrieveBookingCustomAttributeResponse.ts +++ b/src/api/types/RetrieveBookingCustomAttributeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [RetrieveBookingCustomAttribute](api-endpoint:BookingCustomAttributes-RetrieveBookingCustomAttribute) response. diff --git a/src/api/types/RetrieveChannelResponse.ts b/src/api/types/RetrieveChannelResponse.ts deleted file mode 100644 index b67644b63..000000000 --- a/src/api/types/RetrieveChannelResponse.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -export interface RetrieveChannelResponse { - /** Information about errors encountered during the request. */ - errors?: Square.Error_[]; - /** The requested Channel. */ - channel?: Square.Channel; -} diff --git a/src/api/types/RetrieveJobResponse.ts b/src/api/types/RetrieveJobResponse.ts index 962d429ae..b7609f394 100644 --- a/src/api/types/RetrieveJobResponse.ts +++ b/src/api/types/RetrieveJobResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [RetrieveJob](api-endpoint:Team-RetrieveJob) response. Either `job` or `errors` diff --git a/src/api/types/RetrieveLocationBookingProfileResponse.ts b/src/api/types/RetrieveLocationBookingProfileResponse.ts index 9afcb3e94..35e4ae298 100644 --- a/src/api/types/RetrieveLocationBookingProfileResponse.ts +++ b/src/api/types/RetrieveLocationBookingProfileResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface RetrieveLocationBookingProfileResponse { /** The requested location booking profile. */ diff --git a/src/api/types/RetrieveLocationCustomAttributeDefinitionResponse.ts b/src/api/types/RetrieveLocationCustomAttributeDefinitionResponse.ts index 5a4632fd0..fa2a38bde 100644 --- a/src/api/types/RetrieveLocationCustomAttributeDefinitionResponse.ts +++ b/src/api/types/RetrieveLocationCustomAttributeDefinitionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [RetrieveLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-RetrieveLocationCustomAttributeDefinition) response. diff --git a/src/api/types/RetrieveLocationCustomAttributeResponse.ts b/src/api/types/RetrieveLocationCustomAttributeResponse.ts index 98e873c6d..20f15a340 100644 --- a/src/api/types/RetrieveLocationCustomAttributeResponse.ts +++ b/src/api/types/RetrieveLocationCustomAttributeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [RetrieveLocationCustomAttribute](api-endpoint:LocationCustomAttributes-RetrieveLocationCustomAttribute) response. diff --git a/src/api/types/RetrieveLocationSettingsResponse.ts b/src/api/types/RetrieveLocationSettingsResponse.ts index c4be1411e..41432cd77 100644 --- a/src/api/types/RetrieveLocationSettingsResponse.ts +++ b/src/api/types/RetrieveLocationSettingsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface RetrieveLocationSettingsResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/RetrieveMerchantCustomAttributeDefinitionResponse.ts b/src/api/types/RetrieveMerchantCustomAttributeDefinitionResponse.ts index 9a379dd71..a751ea6df 100644 --- a/src/api/types/RetrieveMerchantCustomAttributeDefinitionResponse.ts +++ b/src/api/types/RetrieveMerchantCustomAttributeDefinitionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [RetrieveMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-RetrieveMerchantCustomAttributeDefinition) response. diff --git a/src/api/types/RetrieveMerchantCustomAttributeResponse.ts b/src/api/types/RetrieveMerchantCustomAttributeResponse.ts index c134b2d50..2db96df0f 100644 --- a/src/api/types/RetrieveMerchantCustomAttributeResponse.ts +++ b/src/api/types/RetrieveMerchantCustomAttributeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [RetrieveMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-RetrieveMerchantCustomAttribute) response. diff --git a/src/api/types/RetrieveMerchantSettingsResponse.ts b/src/api/types/RetrieveMerchantSettingsResponse.ts index 7482610b6..2f0065bbe 100644 --- a/src/api/types/RetrieveMerchantSettingsResponse.ts +++ b/src/api/types/RetrieveMerchantSettingsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface RetrieveMerchantSettingsResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/RetrieveOrderCustomAttributeDefinitionResponse.ts b/src/api/types/RetrieveOrderCustomAttributeDefinitionResponse.ts index 3b67fea88..ad84e3d07 100644 --- a/src/api/types/RetrieveOrderCustomAttributeDefinitionResponse.ts +++ b/src/api/types/RetrieveOrderCustomAttributeDefinitionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response from getting an order custom attribute definition. diff --git a/src/api/types/RetrieveOrderCustomAttributeResponse.ts b/src/api/types/RetrieveOrderCustomAttributeResponse.ts index 62525e7fe..0d8556525 100644 --- a/src/api/types/RetrieveOrderCustomAttributeResponse.ts +++ b/src/api/types/RetrieveOrderCustomAttributeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response from getting an order custom attribute. diff --git a/src/api/types/RetrieveScheduledShiftResponse.ts b/src/api/types/RetrieveScheduledShiftResponse.ts index d2c5030ad..277fa98b4 100644 --- a/src/api/types/RetrieveScheduledShiftResponse.ts +++ b/src/api/types/RetrieveScheduledShiftResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [RetrieveScheduledShift](api-endpoint:Labor-RetrieveScheduledShift) response. diff --git a/src/api/types/RetrieveTimecardResponse.ts b/src/api/types/RetrieveTimecardResponse.ts index 9e66fc386..a3b172908 100644 --- a/src/api/types/RetrieveTimecardResponse.ts +++ b/src/api/types/RetrieveTimecardResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response to a request to get a `Timecard`. The response contains diff --git a/src/api/types/RetrieveTokenStatusResponse.ts b/src/api/types/RetrieveTokenStatusResponse.ts index 5c818baba..36f64d7c8 100644 --- a/src/api/types/RetrieveTokenStatusResponse.ts +++ b/src/api/types/RetrieveTokenStatusResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/RetrieveTransferOrderResponse.ts b/src/api/types/RetrieveTransferOrderResponse.ts deleted file mode 100644 index 140a40b67..000000000 --- a/src/api/types/RetrieveTransferOrderResponse.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -/** - * Response containing the requested transfer order - */ -export interface RetrieveTransferOrderResponse { - /** The requested transfer order */ - transferOrder?: Square.TransferOrder; - /** Any errors that occurred during the request */ - errors?: Square.Error_[]; -} diff --git a/src/api/types/RevokeTokenResponse.ts b/src/api/types/RevokeTokenResponse.ts index 10de32c37..fe48f8c9e 100644 --- a/src/api/types/RevokeTokenResponse.ts +++ b/src/api/types/RevokeTokenResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface RevokeTokenResponse { /** If the request is successful, this is `true`. */ diff --git a/src/api/types/RiskEvaluation.ts b/src/api/types/RiskEvaluation.ts index 764817688..b672456bc 100644 --- a/src/api/types/RiskEvaluation.ts +++ b/src/api/types/RiskEvaluation.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents fraud risk information for the associated payment. diff --git a/src/api/types/RiskEvaluationRiskLevel.ts b/src/api/types/RiskEvaluationRiskLevel.ts index 9449409f9..8f693e9b0 100644 --- a/src/api/types/RiskEvaluationRiskLevel.ts +++ b/src/api/types/RiskEvaluationRiskLevel.ts @@ -1,9 +1,11 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type RiskEvaluationRiskLevel = "PENDING" | "NORMAL" | "MODERATE" | "HIGH"; export const RiskEvaluationRiskLevel = { Pending: "PENDING", Normal: "NORMAL", Moderate: "MODERATE", High: "HIGH", } as const; -export type RiskEvaluationRiskLevel = (typeof RiskEvaluationRiskLevel)[keyof typeof RiskEvaluationRiskLevel]; diff --git a/src/api/types/SaveCardOptions.ts b/src/api/types/SaveCardOptions.ts index fbec5bc0f..78f8c0223 100644 --- a/src/api/types/SaveCardOptions.ts +++ b/src/api/types/SaveCardOptions.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Describes save-card action fields. diff --git a/src/api/types/ScheduledShift.ts b/src/api/types/ScheduledShift.ts index 1db9cb57c..77abb571a 100644 --- a/src/api/types/ScheduledShift.ts +++ b/src/api/types/ScheduledShift.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a specific time slot in a work schedule. This object is used to manage the diff --git a/src/api/types/ScheduledShiftDetails.ts b/src/api/types/ScheduledShiftDetails.ts index 6419c7908..0e3900e68 100644 --- a/src/api/types/ScheduledShiftDetails.ts +++ b/src/api/types/ScheduledShiftDetails.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents shift details for draft and published versions of a [scheduled shift](entity:ScheduledShift), diff --git a/src/api/types/ScheduledShiftFilter.ts b/src/api/types/ScheduledShiftFilter.ts index f7c2c36aa..5a9ca9dd0 100644 --- a/src/api/types/ScheduledShiftFilter.ts +++ b/src/api/types/ScheduledShiftFilter.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines filter criteria for a [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) diff --git a/src/api/types/ScheduledShiftFilterAssignmentStatus.ts b/src/api/types/ScheduledShiftFilterAssignmentStatus.ts index 0c01b1bc6..4a950891a 100644 --- a/src/api/types/ScheduledShiftFilterAssignmentStatus.ts +++ b/src/api/types/ScheduledShiftFilterAssignmentStatus.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Defines valid values for the `assignment_status` filter in a @@ -6,9 +8,8 @@ * Assignment status is based on the `draft_shift_details.team_member_id` and * `published_shift_details.team_member_id` fields of the scheduled shift. */ +export type ScheduledShiftFilterAssignmentStatus = "ASSIGNED" | "UNASSIGNED"; export const ScheduledShiftFilterAssignmentStatus = { Assigned: "ASSIGNED", Unassigned: "UNASSIGNED", } as const; -export type ScheduledShiftFilterAssignmentStatus = - (typeof ScheduledShiftFilterAssignmentStatus)[keyof typeof ScheduledShiftFilterAssignmentStatus]; diff --git a/src/api/types/ScheduledShiftFilterScheduledShiftStatus.ts b/src/api/types/ScheduledShiftFilterScheduledShiftStatus.ts index 9887b1378..523a07dec 100644 --- a/src/api/types/ScheduledShiftFilterScheduledShiftStatus.ts +++ b/src/api/types/ScheduledShiftFilterScheduledShiftStatus.ts @@ -1,12 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Defines valid values for the `scheduled_shift_statuses` filter in a * [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request. */ +export type ScheduledShiftFilterScheduledShiftStatus = "DRAFT" | "PUBLISHED"; export const ScheduledShiftFilterScheduledShiftStatus = { Draft: "DRAFT", Published: "PUBLISHED", } as const; -export type ScheduledShiftFilterScheduledShiftStatus = - (typeof ScheduledShiftFilterScheduledShiftStatus)[keyof typeof ScheduledShiftFilterScheduledShiftStatus]; diff --git a/src/api/types/ScheduledShiftNotificationAudience.ts b/src/api/types/ScheduledShiftNotificationAudience.ts index 90e62c7f2..fac85e8bf 100644 --- a/src/api/types/ScheduledShiftNotificationAudience.ts +++ b/src/api/types/ScheduledShiftNotificationAudience.ts @@ -1,13 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Indicates whether Square sends an email notification to team members * when a scheduled shift is published and which team members receive the notification. */ +export type ScheduledShiftNotificationAudience = "ALL" | "AFFECTED" | "NONE"; export const ScheduledShiftNotificationAudience = { All: "ALL", Affected: "AFFECTED", None: "NONE", } as const; -export type ScheduledShiftNotificationAudience = - (typeof ScheduledShiftNotificationAudience)[keyof typeof ScheduledShiftNotificationAudience]; diff --git a/src/api/types/ScheduledShiftQuery.ts b/src/api/types/ScheduledShiftQuery.ts index eebae1ddf..ad1b5005d 100644 --- a/src/api/types/ScheduledShiftQuery.ts +++ b/src/api/types/ScheduledShiftQuery.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents filter and sort criteria for the `query` field in a diff --git a/src/api/types/ScheduledShiftSort.ts b/src/api/types/ScheduledShiftSort.ts index 1ec7bf8e3..41126ffd1 100644 --- a/src/api/types/ScheduledShiftSort.ts +++ b/src/api/types/ScheduledShiftSort.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines sort criteria for a [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) diff --git a/src/api/types/ScheduledShiftSortField.ts b/src/api/types/ScheduledShiftSortField.ts index 966ea2a4d..224510267 100644 --- a/src/api/types/ScheduledShiftSortField.ts +++ b/src/api/types/ScheduledShiftSortField.ts @@ -1,13 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Defines valid values for the `field` sort setting in a * [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) request. */ +export type ScheduledShiftSortField = "START_AT" | "END_AT" | "CREATED_AT" | "UPDATED_AT"; export const ScheduledShiftSortField = { StartAt: "START_AT", EndAt: "END_AT", CreatedAt: "CREATED_AT", UpdatedAt: "UPDATED_AT", } as const; -export type ScheduledShiftSortField = (typeof ScheduledShiftSortField)[keyof typeof ScheduledShiftSortField]; diff --git a/src/api/types/ScheduledShiftWorkday.ts b/src/api/types/ScheduledShiftWorkday.ts index fef48bd16..ea90c2756 100644 --- a/src/api/types/ScheduledShiftWorkday.ts +++ b/src/api/types/ScheduledShiftWorkday.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A `ScheduledShift` search query filter parameter that sets a range of days that diff --git a/src/api/types/ScheduledShiftWorkdayMatcher.ts b/src/api/types/ScheduledShiftWorkdayMatcher.ts index c6a3f104f..ae4bcee20 100644 --- a/src/api/types/ScheduledShiftWorkdayMatcher.ts +++ b/src/api/types/ScheduledShiftWorkdayMatcher.ts @@ -1,10 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Defines the logic used to apply a workday filter. */ +/** + * Defines the logic used to apply a workday filter. + */ +export type ScheduledShiftWorkdayMatcher = "START_AT" | "END_AT" | "INTERSECTION"; export const ScheduledShiftWorkdayMatcher = { StartAt: "START_AT", EndAt: "END_AT", Intersection: "INTERSECTION", } as const; -export type ScheduledShiftWorkdayMatcher = - (typeof ScheduledShiftWorkdayMatcher)[keyof typeof ScheduledShiftWorkdayMatcher]; diff --git a/src/api/types/SearchAvailabilityFilter.ts b/src/api/types/SearchAvailabilityFilter.ts index eb3a7fd2b..41099dbd3 100644 --- a/src/api/types/SearchAvailabilityFilter.ts +++ b/src/api/types/SearchAvailabilityFilter.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A query filter to search for buyer-accessible availabilities by. diff --git a/src/api/types/SearchAvailabilityQuery.ts b/src/api/types/SearchAvailabilityQuery.ts index 63b633021..5314cfebb 100644 --- a/src/api/types/SearchAvailabilityQuery.ts +++ b/src/api/types/SearchAvailabilityQuery.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The query used to search for buyer-accessible availabilities of bookings. diff --git a/src/api/types/SearchAvailabilityResponse.ts b/src/api/types/SearchAvailabilityResponse.ts index 3ff09f61e..a6fafea09 100644 --- a/src/api/types/SearchAvailabilityResponse.ts +++ b/src/api/types/SearchAvailabilityResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface SearchAvailabilityResponse { /** List of appointment slots available for booking. */ diff --git a/src/api/types/SearchCatalogItemsRequestStockLevel.ts b/src/api/types/SearchCatalogItemsRequestStockLevel.ts index d45ae7867..15c5d8475 100644 --- a/src/api/types/SearchCatalogItemsRequestStockLevel.ts +++ b/src/api/types/SearchCatalogItemsRequestStockLevel.ts @@ -1,9 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Defines supported stock levels of the item inventory. */ +/** + * Defines supported stock levels of the item inventory. + */ +export type SearchCatalogItemsRequestStockLevel = "OUT" | "LOW"; export const SearchCatalogItemsRequestStockLevel = { Out: "OUT", Low: "LOW", } as const; -export type SearchCatalogItemsRequestStockLevel = - (typeof SearchCatalogItemsRequestStockLevel)[keyof typeof SearchCatalogItemsRequestStockLevel]; diff --git a/src/api/types/SearchCatalogItemsResponse.ts b/src/api/types/SearchCatalogItemsResponse.ts index 3df785fbb..71e916d48 100644 --- a/src/api/types/SearchCatalogItemsResponse.ts +++ b/src/api/types/SearchCatalogItemsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the response body returned from the [SearchCatalogItems](api-endpoint:Catalog-SearchCatalogItems) endpoint. diff --git a/src/api/types/SearchCatalogObjectsResponse.ts b/src/api/types/SearchCatalogObjectsResponse.ts index f9bdc5aae..daa11c3af 100644 --- a/src/api/types/SearchCatalogObjectsResponse.ts +++ b/src/api/types/SearchCatalogObjectsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface SearchCatalogObjectsResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/SearchCustomersResponse.ts b/src/api/types/SearchCustomersResponse.ts index 73af633f4..5667827f2 100644 --- a/src/api/types/SearchCustomersResponse.ts +++ b/src/api/types/SearchCustomersResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/SearchEventsFilter.ts b/src/api/types/SearchEventsFilter.ts index 448514a81..ccbb04b26 100644 --- a/src/api/types/SearchEventsFilter.ts +++ b/src/api/types/SearchEventsFilter.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Criteria to filter events by. diff --git a/src/api/types/SearchEventsQuery.ts b/src/api/types/SearchEventsQuery.ts index 59e4319bf..c4923434d 100644 --- a/src/api/types/SearchEventsQuery.ts +++ b/src/api/types/SearchEventsQuery.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Contains query criteria for the search. diff --git a/src/api/types/SearchEventsResponse.ts b/src/api/types/SearchEventsResponse.ts index 0b51beb7f..d28d5ee28 100644 --- a/src/api/types/SearchEventsResponse.ts +++ b/src/api/types/SearchEventsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/SearchEventsSort.ts b/src/api/types/SearchEventsSort.ts index 81c4bf31a..2bedcf9cc 100644 --- a/src/api/types/SearchEventsSort.ts +++ b/src/api/types/SearchEventsSort.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Criteria to sort events by. diff --git a/src/api/types/SearchEventsSortField.ts b/src/api/types/SearchEventsSortField.ts index f9329a3e7..7995d34cb 100644 --- a/src/api/types/SearchEventsSortField.ts +++ b/src/api/types/SearchEventsSortField.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Specifies the sort key for events returned from a search. diff --git a/src/api/types/SearchInvoicesResponse.ts b/src/api/types/SearchInvoicesResponse.ts index 8e27f90b0..d8a9d2bd1 100644 --- a/src/api/types/SearchInvoicesResponse.ts +++ b/src/api/types/SearchInvoicesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Describes a `SearchInvoices` response. diff --git a/src/api/types/SearchLoyaltyAccountsRequestLoyaltyAccountQuery.ts b/src/api/types/SearchLoyaltyAccountsRequestLoyaltyAccountQuery.ts index 3fa33a4e9..01bd91e80 100644 --- a/src/api/types/SearchLoyaltyAccountsRequestLoyaltyAccountQuery.ts +++ b/src/api/types/SearchLoyaltyAccountsRequestLoyaltyAccountQuery.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The search criteria for the loyalty accounts. diff --git a/src/api/types/SearchLoyaltyAccountsResponse.ts b/src/api/types/SearchLoyaltyAccountsResponse.ts index 8e7fec6b3..e3b9e6ea4 100644 --- a/src/api/types/SearchLoyaltyAccountsResponse.ts +++ b/src/api/types/SearchLoyaltyAccountsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response that includes loyalty accounts that satisfy the search criteria. diff --git a/src/api/types/SearchLoyaltyEventsResponse.ts b/src/api/types/SearchLoyaltyEventsResponse.ts index 9ee8896b1..035520dad 100644 --- a/src/api/types/SearchLoyaltyEventsResponse.ts +++ b/src/api/types/SearchLoyaltyEventsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response that contains loyalty events that satisfy the search diff --git a/src/api/types/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.ts b/src/api/types/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.ts index 071abdc46..387555f18 100644 --- a/src/api/types/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.ts +++ b/src/api/types/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The set of search requirements. diff --git a/src/api/types/SearchLoyaltyRewardsResponse.ts b/src/api/types/SearchLoyaltyRewardsResponse.ts index 7f2d69d14..4227870d5 100644 --- a/src/api/types/SearchLoyaltyRewardsResponse.ts +++ b/src/api/types/SearchLoyaltyRewardsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response that includes the loyalty rewards satisfying the search criteria. diff --git a/src/api/types/SearchOrdersCustomerFilter.ts b/src/api/types/SearchOrdersCustomerFilter.ts index e326bd623..167772657 100644 --- a/src/api/types/SearchOrdersCustomerFilter.ts +++ b/src/api/types/SearchOrdersCustomerFilter.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * A filter based on the order `customer_id` and any tender `customer_id` diff --git a/src/api/types/SearchOrdersDateTimeFilter.ts b/src/api/types/SearchOrdersDateTimeFilter.ts index 311d88540..8895aee16 100644 --- a/src/api/types/SearchOrdersDateTimeFilter.ts +++ b/src/api/types/SearchOrdersDateTimeFilter.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Filter for `Order` objects based on whether their `CREATED_AT`, diff --git a/src/api/types/SearchOrdersFilter.ts b/src/api/types/SearchOrdersFilter.ts index c5feb11bc..f7999cca0 100644 --- a/src/api/types/SearchOrdersFilter.ts +++ b/src/api/types/SearchOrdersFilter.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Filtering criteria to use for a `SearchOrders` request. Multiple filters diff --git a/src/api/types/SearchOrdersFulfillmentFilter.ts b/src/api/types/SearchOrdersFulfillmentFilter.ts index e675fbc31..9ba85a337 100644 --- a/src/api/types/SearchOrdersFulfillmentFilter.ts +++ b/src/api/types/SearchOrdersFulfillmentFilter.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Filter based on [order fulfillment](entity:Fulfillment) information. diff --git a/src/api/types/SearchOrdersQuery.ts b/src/api/types/SearchOrdersQuery.ts index cbb97f9de..8e0d23b82 100644 --- a/src/api/types/SearchOrdersQuery.ts +++ b/src/api/types/SearchOrdersQuery.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Contains query criteria for the search. diff --git a/src/api/types/SearchOrdersResponse.ts b/src/api/types/SearchOrdersResponse.ts index 9ee27ebc5..750a9606f 100644 --- a/src/api/types/SearchOrdersResponse.ts +++ b/src/api/types/SearchOrdersResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Either the `order_entries` or `orders` field is set, depending on whether diff --git a/src/api/types/SearchOrdersSort.ts b/src/api/types/SearchOrdersSort.ts index f50185503..a2137e503 100644 --- a/src/api/types/SearchOrdersSort.ts +++ b/src/api/types/SearchOrdersSort.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Sorting criteria for a `SearchOrders` request. Results can only be sorted diff --git a/src/api/types/SearchOrdersSortField.ts b/src/api/types/SearchOrdersSortField.ts index d522c43d5..54123aa92 100644 --- a/src/api/types/SearchOrdersSortField.ts +++ b/src/api/types/SearchOrdersSortField.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Specifies which timestamp to use to sort `SearchOrder` results. */ +/** + * Specifies which timestamp to use to sort `SearchOrder` results. + */ +export type SearchOrdersSortField = "CREATED_AT" | "UPDATED_AT" | "CLOSED_AT"; export const SearchOrdersSortField = { CreatedAt: "CREATED_AT", UpdatedAt: "UPDATED_AT", ClosedAt: "CLOSED_AT", } as const; -export type SearchOrdersSortField = (typeof SearchOrdersSortField)[keyof typeof SearchOrdersSortField]; diff --git a/src/api/types/SearchOrdersSourceFilter.ts b/src/api/types/SearchOrdersSourceFilter.ts index 8b9578249..0b1475c9d 100644 --- a/src/api/types/SearchOrdersSourceFilter.ts +++ b/src/api/types/SearchOrdersSourceFilter.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * A filter based on order `source` information. diff --git a/src/api/types/SearchOrdersStateFilter.ts b/src/api/types/SearchOrdersStateFilter.ts index a1e05f0fa..fa5759b0b 100644 --- a/src/api/types/SearchOrdersStateFilter.ts +++ b/src/api/types/SearchOrdersStateFilter.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Filter by the current order `state`. diff --git a/src/api/types/SearchScheduledShiftsResponse.ts b/src/api/types/SearchScheduledShiftsResponse.ts index e22c6482e..895464c09 100644 --- a/src/api/types/SearchScheduledShiftsResponse.ts +++ b/src/api/types/SearchScheduledShiftsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a [SearchScheduledShifts](api-endpoint:Labor-SearchScheduledShifts) response. diff --git a/src/api/types/SearchShiftsResponse.ts b/src/api/types/SearchShiftsResponse.ts index e2c3c1cd1..427926dc2 100644 --- a/src/api/types/SearchShiftsResponse.ts +++ b/src/api/types/SearchShiftsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response to a request for `Shift` objects. The response contains diff --git a/src/api/types/SearchSubscriptionsFilter.ts b/src/api/types/SearchSubscriptionsFilter.ts index ba1ceae91..41b97918d 100644 --- a/src/api/types/SearchSubscriptionsFilter.ts +++ b/src/api/types/SearchSubscriptionsFilter.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents a set of query expressions (filters) to narrow the scope of targeted subscriptions returned by diff --git a/src/api/types/SearchSubscriptionsQuery.ts b/src/api/types/SearchSubscriptionsQuery.ts index 837e1601b..224516676 100644 --- a/src/api/types/SearchSubscriptionsQuery.ts +++ b/src/api/types/SearchSubscriptionsQuery.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a query, consisting of specified query expressions, used to search for subscriptions. diff --git a/src/api/types/SearchSubscriptionsResponse.ts b/src/api/types/SearchSubscriptionsResponse.ts index 05a7926d9..4e71da01a 100644 --- a/src/api/types/SearchSubscriptionsResponse.ts +++ b/src/api/types/SearchSubscriptionsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines output parameters in a response from the diff --git a/src/api/types/SearchTeamMembersFilter.ts b/src/api/types/SearchTeamMembersFilter.ts index bf2e45f31..c21df9ad8 100644 --- a/src/api/types/SearchTeamMembersFilter.ts +++ b/src/api/types/SearchTeamMembersFilter.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a filter used in a search for `TeamMember` objects. `AND` logic is applied diff --git a/src/api/types/SearchTeamMembersQuery.ts b/src/api/types/SearchTeamMembersQuery.ts index 928b1fbc6..657d67159 100644 --- a/src/api/types/SearchTeamMembersQuery.ts +++ b/src/api/types/SearchTeamMembersQuery.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents the parameters in a search for `TeamMember` objects. diff --git a/src/api/types/SearchTeamMembersResponse.ts b/src/api/types/SearchTeamMembersResponse.ts index 2e641babd..0b84c9c15 100644 --- a/src/api/types/SearchTeamMembersResponse.ts +++ b/src/api/types/SearchTeamMembersResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response from a search request containing a filtered list of `TeamMember` objects. diff --git a/src/api/types/SearchTerminalActionsResponse.ts b/src/api/types/SearchTerminalActionsResponse.ts index 9a6e4304c..243a6fb58 100644 --- a/src/api/types/SearchTerminalActionsResponse.ts +++ b/src/api/types/SearchTerminalActionsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface SearchTerminalActionsResponse { /** Information on errors encountered during the request. */ diff --git a/src/api/types/SearchTerminalCheckoutsResponse.ts b/src/api/types/SearchTerminalCheckoutsResponse.ts index f84c6db00..764c4b2f9 100644 --- a/src/api/types/SearchTerminalCheckoutsResponse.ts +++ b/src/api/types/SearchTerminalCheckoutsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface SearchTerminalCheckoutsResponse { /** Information about errors encountered during the request. */ diff --git a/src/api/types/SearchTerminalRefundsResponse.ts b/src/api/types/SearchTerminalRefundsResponse.ts index c88593777..0beaece31 100644 --- a/src/api/types/SearchTerminalRefundsResponse.ts +++ b/src/api/types/SearchTerminalRefundsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface SearchTerminalRefundsResponse { /** Information about errors encountered during the request. */ diff --git a/src/api/types/SearchTimecardsResponse.ts b/src/api/types/SearchTimecardsResponse.ts index 48b3a1b2c..7d83caa1c 100644 --- a/src/api/types/SearchTimecardsResponse.ts +++ b/src/api/types/SearchTimecardsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response to a request for `Timecard` objects. The response contains diff --git a/src/api/types/SearchTransferOrdersResponse.ts b/src/api/types/SearchTransferOrdersResponse.ts deleted file mode 100644 index f1b2e79de..000000000 --- a/src/api/types/SearchTransferOrdersResponse.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -/** - * Response for searching transfer orders - */ -export interface SearchTransferOrdersResponse { - /** List of transfer orders matching the search criteria */ - transferOrders?: Square.TransferOrder[]; - /** Pagination cursor for fetching the next page of results */ - cursor?: string; - /** Any errors that occurred during the request */ - errors?: Square.Error_[]; -} diff --git a/src/api/types/SearchVendorsRequestFilter.ts b/src/api/types/SearchVendorsRequestFilter.ts index caae2bba0..973b97569 100644 --- a/src/api/types/SearchVendorsRequestFilter.ts +++ b/src/api/types/SearchVendorsRequestFilter.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines supported query expressions to search for vendors by. diff --git a/src/api/types/SearchVendorsRequestSort.ts b/src/api/types/SearchVendorsRequestSort.ts index 772eb2105..99caa763d 100644 --- a/src/api/types/SearchVendorsRequestSort.ts +++ b/src/api/types/SearchVendorsRequestSort.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines a sorter used to sort results from [SearchVendors](api-endpoint:Vendors-SearchVendors). diff --git a/src/api/types/SearchVendorsRequestSortField.ts b/src/api/types/SearchVendorsRequestSortField.ts index 5a36387ec..daa069ea4 100644 --- a/src/api/types/SearchVendorsRequestSortField.ts +++ b/src/api/types/SearchVendorsRequestSortField.ts @@ -1,9 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The field to sort the returned [Vendor](entity:Vendor) objects by. */ +/** + * The field to sort the returned [Vendor](entity:Vendor) objects by. + */ +export type SearchVendorsRequestSortField = "NAME" | "CREATED_AT"; export const SearchVendorsRequestSortField = { Name: "NAME", CreatedAt: "CREATED_AT", } as const; -export type SearchVendorsRequestSortField = - (typeof SearchVendorsRequestSortField)[keyof typeof SearchVendorsRequestSortField]; diff --git a/src/api/types/SearchVendorsResponse.ts b/src/api/types/SearchVendorsResponse.ts index b2bd64b94..3b001cbba 100644 --- a/src/api/types/SearchVendorsResponse.ts +++ b/src/api/types/SearchVendorsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an output from a call to [SearchVendors](api-endpoint:Vendors-SearchVendors). diff --git a/src/api/types/SegmentFilter.ts b/src/api/types/SegmentFilter.ts index 94f28209c..65e099271 100644 --- a/src/api/types/SegmentFilter.ts +++ b/src/api/types/SegmentFilter.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A query filter to search for buyer-accessible appointment segments by. diff --git a/src/api/types/SelectOption.ts b/src/api/types/SelectOption.ts index e9599a034..2cb33751a 100644 --- a/src/api/types/SelectOption.ts +++ b/src/api/types/SelectOption.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface SelectOption { /** The reference id for the option. */ diff --git a/src/api/types/SelectOptions.ts b/src/api/types/SelectOptions.ts index 11dc6e58b..26d3b1af5 100644 --- a/src/api/types/SelectOptions.ts +++ b/src/api/types/SelectOptions.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface SelectOptions { /** The title text to display in the select flow on the Terminal. */ diff --git a/src/api/types/Shift.ts b/src/api/types/Shift.ts index 0c3367b3d..4b53daf35 100644 --- a/src/api/types/Shift.ts +++ b/src/api/types/Shift.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A record of the hourly rate, start, and end times for a single work shift diff --git a/src/api/types/ShiftFilter.ts b/src/api/types/ShiftFilter.ts index 0c64caf63..09bde57b1 100644 --- a/src/api/types/ShiftFilter.ts +++ b/src/api/types/ShiftFilter.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines a filter used in a search for `Shift` records. `AND` logic is diff --git a/src/api/types/ShiftFilterStatus.ts b/src/api/types/ShiftFilterStatus.ts index 72ebf9414..093144e95 100644 --- a/src/api/types/ShiftFilterStatus.ts +++ b/src/api/types/ShiftFilterStatus.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Specifies the `status` of `Shift` records to be returned. * * Deprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). */ +export type ShiftFilterStatus = "OPEN" | "CLOSED"; export const ShiftFilterStatus = { Open: "OPEN", Closed: "CLOSED", } as const; -export type ShiftFilterStatus = (typeof ShiftFilterStatus)[keyof typeof ShiftFilterStatus]; diff --git a/src/api/types/ShiftQuery.ts b/src/api/types/ShiftQuery.ts index 561eb47e8..7b977e3a3 100644 --- a/src/api/types/ShiftQuery.ts +++ b/src/api/types/ShiftQuery.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The parameters of a `Shift` search query, which includes filter and sort options. diff --git a/src/api/types/ShiftSort.ts b/src/api/types/ShiftSort.ts index f28086e2f..d12abc47d 100644 --- a/src/api/types/ShiftSort.ts +++ b/src/api/types/ShiftSort.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Sets the sort order of search results. diff --git a/src/api/types/ShiftSortField.ts b/src/api/types/ShiftSortField.ts index 56ac8b2a0..db3077922 100644 --- a/src/api/types/ShiftSortField.ts +++ b/src/api/types/ShiftSortField.ts @@ -1,14 +1,16 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Enumerates the `Shift` fields to sort on. * * Deprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). */ +export type ShiftSortField = "START_AT" | "END_AT" | "CREATED_AT" | "UPDATED_AT"; export const ShiftSortField = { StartAt: "START_AT", EndAt: "END_AT", CreatedAt: "CREATED_AT", UpdatedAt: "UPDATED_AT", } as const; -export type ShiftSortField = (typeof ShiftSortField)[keyof typeof ShiftSortField]; diff --git a/src/api/types/ShiftStatus.ts b/src/api/types/ShiftStatus.ts index 391123452..037efdb2d 100644 --- a/src/api/types/ShiftStatus.ts +++ b/src/api/types/ShiftStatus.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Enumerates the possible status of a `Shift`. * * Deprecated at Square API version 2025-05-21. See the [migration notes](https://developer.squareup.com/docs/labor-api/what-it-does#migration-notes). */ +export type ShiftStatus = "OPEN" | "CLOSED"; export const ShiftStatus = { Open: "OPEN", Closed: "CLOSED", } as const; -export type ShiftStatus = (typeof ShiftStatus)[keyof typeof ShiftStatus]; diff --git a/src/api/types/ShiftWage.ts b/src/api/types/ShiftWage.ts index a3dc08653..ad082a8cc 100644 --- a/src/api/types/ShiftWage.ts +++ b/src/api/types/ShiftWage.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The hourly wage rate used to compensate an employee for this shift. diff --git a/src/api/types/ShiftWorkday.ts b/src/api/types/ShiftWorkday.ts index d6c831bcc..dcfc185f5 100644 --- a/src/api/types/ShiftWorkday.ts +++ b/src/api/types/ShiftWorkday.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A `Shift` search query filter parameter that sets a range of days that diff --git a/src/api/types/ShiftWorkdayMatcher.ts b/src/api/types/ShiftWorkdayMatcher.ts index b54dc1533..6decb98a7 100644 --- a/src/api/types/ShiftWorkdayMatcher.ts +++ b/src/api/types/ShiftWorkdayMatcher.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Defines the logic used to apply a workday filter. */ +/** + * Defines the logic used to apply a workday filter. + */ +export type ShiftWorkdayMatcher = "START_AT" | "END_AT" | "INTERSECTION"; export const ShiftWorkdayMatcher = { StartAt: "START_AT", EndAt: "END_AT", Intersection: "INTERSECTION", } as const; -export type ShiftWorkdayMatcher = (typeof ShiftWorkdayMatcher)[keyof typeof ShiftWorkdayMatcher]; diff --git a/src/api/types/ShippingFee.ts b/src/api/types/ShippingFee.ts index b23a45ed0..9418d0a85 100644 --- a/src/api/types/ShippingFee.ts +++ b/src/api/types/ShippingFee.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface ShippingFee { /** The name for the shipping fee. */ diff --git a/src/api/types/SignatureImage.ts b/src/api/types/SignatureImage.ts index 711dc1b84..8147a46eb 100644 --- a/src/api/types/SignatureImage.ts +++ b/src/api/types/SignatureImage.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface SignatureImage { /** diff --git a/src/api/types/SignatureOptions.ts b/src/api/types/SignatureOptions.ts index b0740850f..0f8c1dd8c 100644 --- a/src/api/types/SignatureOptions.ts +++ b/src/api/types/SignatureOptions.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface SignatureOptions { /** The title text to display in the signature capture flow on the Terminal. */ diff --git a/src/api/types/Site.ts b/src/api/types/Site.ts index 31b5d143f..2980bd188 100644 --- a/src/api/types/Site.ts +++ b/src/api/types/Site.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents a Square Online site, which is an online store for a Square seller. diff --git a/src/api/types/Snippet.ts b/src/api/types/Snippet.ts index 8e414fa35..912e3fd6e 100644 --- a/src/api/types/Snippet.ts +++ b/src/api/types/Snippet.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents the snippet that is added to a Square Online site. The snippet code is injected into the `head` element of all pages on the site, except for checkout pages. diff --git a/src/api/types/SortOrder.ts b/src/api/types/SortOrder.ts index 171d4b3ab..8a6aeadfa 100644 --- a/src/api/types/SortOrder.ts +++ b/src/api/types/SortOrder.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The order (e.g., chronological or alphabetical) in which results from a request are returned. */ +/** + * The order (e.g., chronological or alphabetical) in which results from a request are returned. + */ +export type SortOrder = "DESC" | "ASC"; export const SortOrder = { Desc: "DESC", Asc: "ASC", } as const; -export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder]; diff --git a/src/api/types/SourceApplication.ts b/src/api/types/SourceApplication.ts index bc9e37214..5cbddc36b 100644 --- a/src/api/types/SourceApplication.ts +++ b/src/api/types/SourceApplication.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents information about the application used to generate a change. diff --git a/src/api/types/SquareAccountDetails.ts b/src/api/types/SquareAccountDetails.ts index 76b5f055f..edacd3d33 100644 --- a/src/api/types/SquareAccountDetails.ts +++ b/src/api/types/SquareAccountDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Additional details about Square Account payments. diff --git a/src/api/types/StandardUnitDescription.ts b/src/api/types/StandardUnitDescription.ts index d91e1caa4..66e3a9ab2 100644 --- a/src/api/types/StandardUnitDescription.ts +++ b/src/api/types/StandardUnitDescription.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Contains the name and abbreviation for standard measurement unit. diff --git a/src/api/types/StandardUnitDescriptionGroup.ts b/src/api/types/StandardUnitDescriptionGroup.ts index 6f5d77410..55625e4c6 100644 --- a/src/api/types/StandardUnitDescriptionGroup.ts +++ b/src/api/types/StandardUnitDescriptionGroup.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Group of standard measurement units. diff --git a/src/api/types/StartTransferOrderResponse.ts b/src/api/types/StartTransferOrderResponse.ts deleted file mode 100644 index 839bbb0c7..000000000 --- a/src/api/types/StartTransferOrderResponse.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -/** - * Response for starting a transfer order. - */ -export interface StartTransferOrderResponse { - /** The updated transfer order with status changed to STARTED */ - transferOrder?: Square.TransferOrder; - /** Any errors that occurred during the request */ - errors?: Square.Error_[]; -} diff --git a/src/api/types/SubmitEvidenceResponse.ts b/src/api/types/SubmitEvidenceResponse.ts index 1a880f673..5e647ee24 100644 --- a/src/api/types/SubmitEvidenceResponse.ts +++ b/src/api/types/SubmitEvidenceResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields in a `SubmitEvidence` response. diff --git a/src/api/types/Subscription.ts b/src/api/types/Subscription.ts index 6d1c1dc7f..8a209bba2 100644 --- a/src/api/types/Subscription.ts +++ b/src/api/types/Subscription.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a subscription purchased by a customer. @@ -97,6 +99,4 @@ export interface Subscription { monthlyBillingAnchorDate?: number; /** array of phases for this subscription */ phases?: Square.Phase[]; - /** The `YYYY-MM-DD`-formatted date when the subscription enters a terminal state. */ - completedDate?: string | null; } diff --git a/src/api/types/SubscriptionAction.ts b/src/api/types/SubscriptionAction.ts index 0b1e3e60f..a9542aced 100644 --- a/src/api/types/SubscriptionAction.ts +++ b/src/api/types/SubscriptionAction.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an action as a pending change to a subscription. diff --git a/src/api/types/SubscriptionActionType.ts b/src/api/types/SubscriptionActionType.ts index 007796243..c7e54059d 100644 --- a/src/api/types/SubscriptionActionType.ts +++ b/src/api/types/SubscriptionActionType.ts @@ -1,12 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Supported types of an action as a pending change to a subscription. */ +/** + * Supported types of an action as a pending change to a subscription. + */ +export type SubscriptionActionType = "CANCEL" | "PAUSE" | "RESUME" | "SWAP_PLAN" | "CHANGE_BILLING_ANCHOR_DATE"; export const SubscriptionActionType = { Cancel: "CANCEL", Pause: "PAUSE", Resume: "RESUME", SwapPlan: "SWAP_PLAN", ChangeBillingAnchorDate: "CHANGE_BILLING_ANCHOR_DATE", - Complete: "COMPLETE", } as const; -export type SubscriptionActionType = (typeof SubscriptionActionType)[keyof typeof SubscriptionActionType]; diff --git a/src/api/types/SubscriptionCadence.ts b/src/api/types/SubscriptionCadence.ts index d2c30f58a..3cf285f5f 100644 --- a/src/api/types/SubscriptionCadence.ts +++ b/src/api/types/SubscriptionCadence.ts @@ -1,6 +1,24 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Determines the billing cadence of a [Subscription](entity:Subscription) */ +/** + * Determines the billing cadence of a [Subscription](entity:Subscription) + */ +export type SubscriptionCadence = + | "DAILY" + | "WEEKLY" + | "EVERY_TWO_WEEKS" + | "THIRTY_DAYS" + | "SIXTY_DAYS" + | "NINETY_DAYS" + | "MONTHLY" + | "EVERY_TWO_MONTHS" + | "QUARTERLY" + | "EVERY_FOUR_MONTHS" + | "EVERY_SIX_MONTHS" + | "ANNUAL" + | "EVERY_TWO_YEARS"; export const SubscriptionCadence = { Daily: "DAILY", Weekly: "WEEKLY", @@ -16,4 +34,3 @@ export const SubscriptionCadence = { Annual: "ANNUAL", EveryTwoYears: "EVERY_TWO_YEARS", } as const; -export type SubscriptionCadence = (typeof SubscriptionCadence)[keyof typeof SubscriptionCadence]; diff --git a/src/api/types/SubscriptionCreatedEvent.ts b/src/api/types/SubscriptionCreatedEvent.ts index 9b936c44a..438c22f09 100644 --- a/src/api/types/SubscriptionCreatedEvent.ts +++ b/src/api/types/SubscriptionCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [Subscription](entity:Subscription) is created. diff --git a/src/api/types/SubscriptionCreatedEventData.ts b/src/api/types/SubscriptionCreatedEventData.ts index 39815dc62..560b27b55 100644 --- a/src/api/types/SubscriptionCreatedEventData.ts +++ b/src/api/types/SubscriptionCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface SubscriptionCreatedEventData { /** Name of the affected object’s type, `"subscription"`. */ diff --git a/src/api/types/SubscriptionCreatedEventObject.ts b/src/api/types/SubscriptionCreatedEventObject.ts index afbaa5321..d9c964abc 100644 --- a/src/api/types/SubscriptionCreatedEventObject.ts +++ b/src/api/types/SubscriptionCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface SubscriptionCreatedEventObject { /** The created subscription. */ diff --git a/src/api/types/SubscriptionEvent.ts b/src/api/types/SubscriptionEvent.ts index c98992180..d5e54af48 100644 --- a/src/api/types/SubscriptionEvent.ts +++ b/src/api/types/SubscriptionEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Describes changes to a subscription and the subscription status. diff --git a/src/api/types/SubscriptionEventInfo.ts b/src/api/types/SubscriptionEventInfo.ts index cd4b6d0ab..4b46a5784 100644 --- a/src/api/types/SubscriptionEventInfo.ts +++ b/src/api/types/SubscriptionEventInfo.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Provides information about the subscription event. diff --git a/src/api/types/SubscriptionEventInfoCode.ts b/src/api/types/SubscriptionEventInfoCode.ts index e68adf727..60d6365e8 100644 --- a/src/api/types/SubscriptionEventInfoCode.ts +++ b/src/api/types/SubscriptionEventInfoCode.ts @@ -1,6 +1,17 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Supported info codes of a subscription event. */ +/** + * Supported info codes of a subscription event. + */ +export type SubscriptionEventInfoCode = + | "LOCATION_NOT_ACTIVE" + | "LOCATION_CANNOT_ACCEPT_PAYMENT" + | "CUSTOMER_DELETED" + | "CUSTOMER_NO_EMAIL" + | "CUSTOMER_NO_NAME" + | "USER_PROVIDED"; export const SubscriptionEventInfoCode = { LocationNotActive: "LOCATION_NOT_ACTIVE", LocationCannotAcceptPayment: "LOCATION_CANNOT_ACCEPT_PAYMENT", @@ -9,4 +20,3 @@ export const SubscriptionEventInfoCode = { CustomerNoName: "CUSTOMER_NO_NAME", UserProvided: "USER_PROVIDED", } as const; -export type SubscriptionEventInfoCode = (typeof SubscriptionEventInfoCode)[keyof typeof SubscriptionEventInfoCode]; diff --git a/src/api/types/SubscriptionEventSubscriptionEventType.ts b/src/api/types/SubscriptionEventSubscriptionEventType.ts index 689535dd1..75f229c4a 100644 --- a/src/api/types/SubscriptionEventSubscriptionEventType.ts +++ b/src/api/types/SubscriptionEventSubscriptionEventType.ts @@ -1,6 +1,18 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Supported types of an event occurred to a subscription. */ +/** + * Supported types of an event occurred to a subscription. + */ +export type SubscriptionEventSubscriptionEventType = + | "START_SUBSCRIPTION" + | "PLAN_CHANGE" + | "STOP_SUBSCRIPTION" + | "DEACTIVATE_SUBSCRIPTION" + | "RESUME_SUBSCRIPTION" + | "PAUSE_SUBSCRIPTION" + | "BILLING_ANCHOR_DATE_CHANGED"; export const SubscriptionEventSubscriptionEventType = { StartSubscription: "START_SUBSCRIPTION", PlanChange: "PLAN_CHANGE", @@ -10,5 +22,3 @@ export const SubscriptionEventSubscriptionEventType = { PauseSubscription: "PAUSE_SUBSCRIPTION", BillingAnchorDateChanged: "BILLING_ANCHOR_DATE_CHANGED", } as const; -export type SubscriptionEventSubscriptionEventType = - (typeof SubscriptionEventSubscriptionEventType)[keyof typeof SubscriptionEventSubscriptionEventType]; diff --git a/src/api/types/SubscriptionPhase.ts b/src/api/types/SubscriptionPhase.ts index 7466f9337..d12e92001 100644 --- a/src/api/types/SubscriptionPhase.ts +++ b/src/api/types/SubscriptionPhase.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Describes a phase in a subscription plan variation. For more information, see [Subscription Plans and Variations](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations). diff --git a/src/api/types/SubscriptionPricing.ts b/src/api/types/SubscriptionPricing.ts index 18f56de8c..26fdc06f0 100644 --- a/src/api/types/SubscriptionPricing.ts +++ b/src/api/types/SubscriptionPricing.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Describes the pricing for the subscription. diff --git a/src/api/types/SubscriptionPricingType.ts b/src/api/types/SubscriptionPricingType.ts index 44b2375ed..02e717ce1 100644 --- a/src/api/types/SubscriptionPricingType.ts +++ b/src/api/types/SubscriptionPricingType.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Determines the pricing of a [Subscription](entity:Subscription) */ +/** + * Determines the pricing of a [Subscription](entity:Subscription) + */ +export type SubscriptionPricingType = "STATIC" | "RELATIVE"; export const SubscriptionPricingType = { Static: "STATIC", Relative: "RELATIVE", } as const; -export type SubscriptionPricingType = (typeof SubscriptionPricingType)[keyof typeof SubscriptionPricingType]; diff --git a/src/api/types/SubscriptionSource.ts b/src/api/types/SubscriptionSource.ts index b19bc6954..4ca4db7df 100644 --- a/src/api/types/SubscriptionSource.ts +++ b/src/api/types/SubscriptionSource.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The origination details of the subscription. diff --git a/src/api/types/SubscriptionStatus.ts b/src/api/types/SubscriptionStatus.ts index 1f91caf88..3214410cb 100644 --- a/src/api/types/SubscriptionStatus.ts +++ b/src/api/types/SubscriptionStatus.ts @@ -1,12 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Supported subscription statuses. */ +/** + * Supported subscription statuses. + */ +export type SubscriptionStatus = "PENDING" | "ACTIVE" | "CANCELED" | "DEACTIVATED" | "PAUSED"; export const SubscriptionStatus = { Pending: "PENDING", Active: "ACTIVE", Canceled: "CANCELED", Deactivated: "DEACTIVATED", Paused: "PAUSED", - Completed: "COMPLETED", } as const; -export type SubscriptionStatus = (typeof SubscriptionStatus)[keyof typeof SubscriptionStatus]; diff --git a/src/api/types/SubscriptionTestResult.ts b/src/api/types/SubscriptionTestResult.ts index df2a6fa23..dcaa70218 100644 --- a/src/api/types/SubscriptionTestResult.ts +++ b/src/api/types/SubscriptionTestResult.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents the details of a webhook subscription, including notification URL, diff --git a/src/api/types/SubscriptionUpdatedEvent.ts b/src/api/types/SubscriptionUpdatedEvent.ts index a1103d737..6e2b3ceaa 100644 --- a/src/api/types/SubscriptionUpdatedEvent.ts +++ b/src/api/types/SubscriptionUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [Subscription](entity:Subscription) is updated. diff --git a/src/api/types/SubscriptionUpdatedEventData.ts b/src/api/types/SubscriptionUpdatedEventData.ts index 67b5964c1..5d66a89cc 100644 --- a/src/api/types/SubscriptionUpdatedEventData.ts +++ b/src/api/types/SubscriptionUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface SubscriptionUpdatedEventData { /** Name of the affected object’s type, `"subscription"`. */ diff --git a/src/api/types/SubscriptionUpdatedEventObject.ts b/src/api/types/SubscriptionUpdatedEventObject.ts index 8f9f01e06..e284b9256 100644 --- a/src/api/types/SubscriptionUpdatedEventObject.ts +++ b/src/api/types/SubscriptionUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface SubscriptionUpdatedEventObject { /** The updated subscription. */ diff --git a/src/api/types/SwapPlanResponse.ts b/src/api/types/SwapPlanResponse.ts index e3309947f..d431f6471 100644 --- a/src/api/types/SwapPlanResponse.ts +++ b/src/api/types/SwapPlanResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines output parameters in a response of the diff --git a/src/api/types/TaxCalculationPhase.ts b/src/api/types/TaxCalculationPhase.ts index a21f764a2..9627c3bd7 100644 --- a/src/api/types/TaxCalculationPhase.ts +++ b/src/api/types/TaxCalculationPhase.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** When to calculate the taxes due on a cart. */ +/** + * When to calculate the taxes due on a cart. + */ +export type TaxCalculationPhase = "TAX_SUBTOTAL_PHASE" | "TAX_TOTAL_PHASE"; export const TaxCalculationPhase = { TaxSubtotalPhase: "TAX_SUBTOTAL_PHASE", TaxTotalPhase: "TAX_TOTAL_PHASE", } as const; -export type TaxCalculationPhase = (typeof TaxCalculationPhase)[keyof typeof TaxCalculationPhase]; diff --git a/src/api/types/TaxIds.ts b/src/api/types/TaxIds.ts index 16b9ab6e1..42ce0d3f6 100644 --- a/src/api/types/TaxIds.ts +++ b/src/api/types/TaxIds.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Identifiers for the location used by various governments for tax purposes. diff --git a/src/api/types/TaxInclusionType.ts b/src/api/types/TaxInclusionType.ts index 1ea79f63c..c9ef446b9 100644 --- a/src/api/types/TaxInclusionType.ts +++ b/src/api/types/TaxInclusionType.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Whether to the tax amount should be additional to or included in the CatalogItem price. */ +/** + * Whether to the tax amount should be additional to or included in the CatalogItem price. + */ +export type TaxInclusionType = "ADDITIVE" | "INCLUSIVE"; export const TaxInclusionType = { Additive: "ADDITIVE", Inclusive: "INCLUSIVE", } as const; -export type TaxInclusionType = (typeof TaxInclusionType)[keyof typeof TaxInclusionType]; diff --git a/src/api/types/TeamMember.ts b/src/api/types/TeamMember.ts index 5d8e244c5..b878cb8b5 100644 --- a/src/api/types/TeamMember.ts +++ b/src/api/types/TeamMember.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A record representing an individual team member for a business. diff --git a/src/api/types/TeamMemberAssignedLocations.ts b/src/api/types/TeamMemberAssignedLocations.ts index 26d598737..c55f08566 100644 --- a/src/api/types/TeamMemberAssignedLocations.ts +++ b/src/api/types/TeamMemberAssignedLocations.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * An object that represents a team member's assignment to locations. diff --git a/src/api/types/TeamMemberAssignedLocationsAssignmentType.ts b/src/api/types/TeamMemberAssignedLocationsAssignmentType.ts index 38418f6d8..599714a16 100644 --- a/src/api/types/TeamMemberAssignedLocationsAssignmentType.ts +++ b/src/api/types/TeamMemberAssignedLocationsAssignmentType.ts @@ -1,9 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Enumerates the possible assignment types that the team member can have. */ +/** + * Enumerates the possible assignment types that the team member can have. + */ +export type TeamMemberAssignedLocationsAssignmentType = "ALL_CURRENT_AND_FUTURE_LOCATIONS" | "EXPLICIT_LOCATIONS"; export const TeamMemberAssignedLocationsAssignmentType = { AllCurrentAndFutureLocations: "ALL_CURRENT_AND_FUTURE_LOCATIONS", ExplicitLocations: "EXPLICIT_LOCATIONS", } as const; -export type TeamMemberAssignedLocationsAssignmentType = - (typeof TeamMemberAssignedLocationsAssignmentType)[keyof typeof TeamMemberAssignedLocationsAssignmentType]; diff --git a/src/api/types/TeamMemberBookingProfile.ts b/src/api/types/TeamMemberBookingProfile.ts index 17b3a5703..2ac2d2a8c 100644 --- a/src/api/types/TeamMemberBookingProfile.ts +++ b/src/api/types/TeamMemberBookingProfile.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The booking profile of a seller's team member, including the team member's ID, display name, description and whether the team member can be booked as a service provider. diff --git a/src/api/types/TeamMemberCreatedEvent.ts b/src/api/types/TeamMemberCreatedEvent.ts index aeff4df26..f7dfbae12 100644 --- a/src/api/types/TeamMemberCreatedEvent.ts +++ b/src/api/types/TeamMemberCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a Team Member is created. diff --git a/src/api/types/TeamMemberCreatedEventData.ts b/src/api/types/TeamMemberCreatedEventData.ts index dcf29bb2d..af2f3edfc 100644 --- a/src/api/types/TeamMemberCreatedEventData.ts +++ b/src/api/types/TeamMemberCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TeamMemberCreatedEventData { /** Name of the affected object’s type, `"team_member"`. */ diff --git a/src/api/types/TeamMemberCreatedEventObject.ts b/src/api/types/TeamMemberCreatedEventObject.ts index 803697d8f..5b001c88e 100644 --- a/src/api/types/TeamMemberCreatedEventObject.ts +++ b/src/api/types/TeamMemberCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TeamMemberCreatedEventObject { /** The created team member. */ diff --git a/src/api/types/TeamMemberInvitationStatus.ts b/src/api/types/TeamMemberInvitationStatus.ts index 519faed64..4335971bb 100644 --- a/src/api/types/TeamMemberInvitationStatus.ts +++ b/src/api/types/TeamMemberInvitationStatus.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Enumerates the possible invitation statuses the team member can have within a business. */ +/** + * Enumerates the possible invitation statuses the team member can have within a business. + */ +export type TeamMemberInvitationStatus = "UNINVITED" | "PENDING" | "ACCEPTED"; export const TeamMemberInvitationStatus = { Uninvited: "UNINVITED", Pending: "PENDING", Accepted: "ACCEPTED", } as const; -export type TeamMemberInvitationStatus = (typeof TeamMemberInvitationStatus)[keyof typeof TeamMemberInvitationStatus]; diff --git a/src/api/types/TeamMemberStatus.ts b/src/api/types/TeamMemberStatus.ts index 36a3c90d3..6ad59b666 100644 --- a/src/api/types/TeamMemberStatus.ts +++ b/src/api/types/TeamMemberStatus.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Enumerates the possible statuses the team member can have within a business. */ +/** + * Enumerates the possible statuses the team member can have within a business. + */ +export type TeamMemberStatus = "ACTIVE" | "INACTIVE"; export const TeamMemberStatus = { Active: "ACTIVE", Inactive: "INACTIVE", } as const; -export type TeamMemberStatus = (typeof TeamMemberStatus)[keyof typeof TeamMemberStatus]; diff --git a/src/api/types/TeamMemberUpdatedEvent.ts b/src/api/types/TeamMemberUpdatedEvent.ts index 28d1cde76..dc8c82260 100644 --- a/src/api/types/TeamMemberUpdatedEvent.ts +++ b/src/api/types/TeamMemberUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a Team Member is updated. diff --git a/src/api/types/TeamMemberUpdatedEventData.ts b/src/api/types/TeamMemberUpdatedEventData.ts index 59899d37d..4d7f14acc 100644 --- a/src/api/types/TeamMemberUpdatedEventData.ts +++ b/src/api/types/TeamMemberUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TeamMemberUpdatedEventData { /** Name of the affected object’s type, `"team_member"`. */ diff --git a/src/api/types/TeamMemberUpdatedEventObject.ts b/src/api/types/TeamMemberUpdatedEventObject.ts index 1a1b7f9f7..ce01e2842 100644 --- a/src/api/types/TeamMemberUpdatedEventObject.ts +++ b/src/api/types/TeamMemberUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TeamMemberUpdatedEventObject { /** The updated team member. */ diff --git a/src/api/types/TeamMemberWage.ts b/src/api/types/TeamMemberWage.ts index 0ac3c3e1a..a1e255c78 100644 --- a/src/api/types/TeamMemberWage.ts +++ b/src/api/types/TeamMemberWage.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Job and wage information for a [team member](entity:TeamMember). diff --git a/src/api/types/TeamMemberWageSettingUpdatedEvent.ts b/src/api/types/TeamMemberWageSettingUpdatedEvent.ts index ae52f72c4..a307690d4 100644 --- a/src/api/types/TeamMemberWageSettingUpdatedEvent.ts +++ b/src/api/types/TeamMemberWageSettingUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a Wage Setting is updated. diff --git a/src/api/types/TeamMemberWageSettingUpdatedEventData.ts b/src/api/types/TeamMemberWageSettingUpdatedEventData.ts index a57ccfc18..29d21b315 100644 --- a/src/api/types/TeamMemberWageSettingUpdatedEventData.ts +++ b/src/api/types/TeamMemberWageSettingUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TeamMemberWageSettingUpdatedEventData { /** Name of the affected object’s type, `"wage_setting"`. */ diff --git a/src/api/types/TeamMemberWageSettingUpdatedEventObject.ts b/src/api/types/TeamMemberWageSettingUpdatedEventObject.ts index 346542a14..5c51b6ca5 100644 --- a/src/api/types/TeamMemberWageSettingUpdatedEventObject.ts +++ b/src/api/types/TeamMemberWageSettingUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TeamMemberWageSettingUpdatedEventObject { /** The updated team member wage setting. */ diff --git a/src/api/types/Tender.ts b/src/api/types/Tender.ts index 95852af6e..d0b7b1c0a 100644 --- a/src/api/types/Tender.ts +++ b/src/api/types/Tender.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a tender (i.e., a method of payment) used in a Square transaction. diff --git a/src/api/types/TenderBankAccountDetails.ts b/src/api/types/TenderBankAccountDetails.ts index a6dd97549..1199c1800 100644 --- a/src/api/types/TenderBankAccountDetails.ts +++ b/src/api/types/TenderBankAccountDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents the details of a tender with `type` `BANK_ACCOUNT`. diff --git a/src/api/types/TenderBankAccountDetailsStatus.ts b/src/api/types/TenderBankAccountDetailsStatus.ts index 756eef3dc..ac29a9563 100644 --- a/src/api/types/TenderBankAccountDetailsStatus.ts +++ b/src/api/types/TenderBankAccountDetailsStatus.ts @@ -1,10 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates the bank account payment's current status. */ +/** + * Indicates the bank account payment's current status. + */ +export type TenderBankAccountDetailsStatus = "PENDING" | "COMPLETED" | "FAILED"; export const TenderBankAccountDetailsStatus = { Pending: "PENDING", Completed: "COMPLETED", Failed: "FAILED", } as const; -export type TenderBankAccountDetailsStatus = - (typeof TenderBankAccountDetailsStatus)[keyof typeof TenderBankAccountDetailsStatus]; diff --git a/src/api/types/TenderBuyNowPayLaterDetails.ts b/src/api/types/TenderBuyNowPayLaterDetails.ts index 756083df0..0fd644977 100644 --- a/src/api/types/TenderBuyNowPayLaterDetails.ts +++ b/src/api/types/TenderBuyNowPayLaterDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents the details of a tender with `type` `BUY_NOW_PAY_LATER`. diff --git a/src/api/types/TenderBuyNowPayLaterDetailsBrand.ts b/src/api/types/TenderBuyNowPayLaterDetailsBrand.ts index 8a387bc91..20d091150 100644 --- a/src/api/types/TenderBuyNowPayLaterDetailsBrand.ts +++ b/src/api/types/TenderBuyNowPayLaterDetailsBrand.ts @@ -1,8 +1,9 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type TenderBuyNowPayLaterDetailsBrand = "OTHER_BRAND" | "AFTERPAY"; export const TenderBuyNowPayLaterDetailsBrand = { OtherBrand: "OTHER_BRAND", Afterpay: "AFTERPAY", } as const; -export type TenderBuyNowPayLaterDetailsBrand = - (typeof TenderBuyNowPayLaterDetailsBrand)[keyof typeof TenderBuyNowPayLaterDetailsBrand]; diff --git a/src/api/types/TenderBuyNowPayLaterDetailsStatus.ts b/src/api/types/TenderBuyNowPayLaterDetailsStatus.ts index 7167b01c5..64ee06f4e 100644 --- a/src/api/types/TenderBuyNowPayLaterDetailsStatus.ts +++ b/src/api/types/TenderBuyNowPayLaterDetailsStatus.ts @@ -1,10 +1,11 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type TenderBuyNowPayLaterDetailsStatus = "AUTHORIZED" | "CAPTURED" | "VOIDED" | "FAILED"; export const TenderBuyNowPayLaterDetailsStatus = { Authorized: "AUTHORIZED", Captured: "CAPTURED", Voided: "VOIDED", Failed: "FAILED", } as const; -export type TenderBuyNowPayLaterDetailsStatus = - (typeof TenderBuyNowPayLaterDetailsStatus)[keyof typeof TenderBuyNowPayLaterDetailsStatus]; diff --git a/src/api/types/TenderCardDetails.ts b/src/api/types/TenderCardDetails.ts index 47737da84..e31bec1c8 100644 --- a/src/api/types/TenderCardDetails.ts +++ b/src/api/types/TenderCardDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents additional details of a tender with `type` `CARD` or `SQUARE_GIFT_CARD` diff --git a/src/api/types/TenderCardDetailsEntryMethod.ts b/src/api/types/TenderCardDetailsEntryMethod.ts index 87e489311..d90918f9e 100644 --- a/src/api/types/TenderCardDetailsEntryMethod.ts +++ b/src/api/types/TenderCardDetailsEntryMethod.ts @@ -1,6 +1,11 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates the method used to enter the card's details. */ +/** + * Indicates the method used to enter the card's details. + */ +export type TenderCardDetailsEntryMethod = "SWIPED" | "KEYED" | "EMV" | "ON_FILE" | "CONTACTLESS"; export const TenderCardDetailsEntryMethod = { Swiped: "SWIPED", Keyed: "KEYED", @@ -8,5 +13,3 @@ export const TenderCardDetailsEntryMethod = { OnFile: "ON_FILE", Contactless: "CONTACTLESS", } as const; -export type TenderCardDetailsEntryMethod = - (typeof TenderCardDetailsEntryMethod)[keyof typeof TenderCardDetailsEntryMethod]; diff --git a/src/api/types/TenderCardDetailsStatus.ts b/src/api/types/TenderCardDetailsStatus.ts index 7242faab1..cc694fbd5 100644 --- a/src/api/types/TenderCardDetailsStatus.ts +++ b/src/api/types/TenderCardDetailsStatus.ts @@ -1,10 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates the card transaction's current status. */ +/** + * Indicates the card transaction's current status. + */ +export type TenderCardDetailsStatus = "AUTHORIZED" | "CAPTURED" | "VOIDED" | "FAILED"; export const TenderCardDetailsStatus = { Authorized: "AUTHORIZED", Captured: "CAPTURED", Voided: "VOIDED", Failed: "FAILED", } as const; -export type TenderCardDetailsStatus = (typeof TenderCardDetailsStatus)[keyof typeof TenderCardDetailsStatus]; diff --git a/src/api/types/TenderCashDetails.ts b/src/api/types/TenderCashDetails.ts index bfb8fba6e..423925958 100644 --- a/src/api/types/TenderCashDetails.ts +++ b/src/api/types/TenderCashDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents the details of a tender with `type` `CASH`. diff --git a/src/api/types/TenderSquareAccountDetails.ts b/src/api/types/TenderSquareAccountDetails.ts index 84ae82c80..7b340004c 100644 --- a/src/api/types/TenderSquareAccountDetails.ts +++ b/src/api/types/TenderSquareAccountDetails.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents the details of a tender with `type` `SQUARE_ACCOUNT`. diff --git a/src/api/types/TenderSquareAccountDetailsStatus.ts b/src/api/types/TenderSquareAccountDetailsStatus.ts index fd5fe8a34..811f47cb2 100644 --- a/src/api/types/TenderSquareAccountDetailsStatus.ts +++ b/src/api/types/TenderSquareAccountDetailsStatus.ts @@ -1,10 +1,11 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type TenderSquareAccountDetailsStatus = "AUTHORIZED" | "CAPTURED" | "VOIDED" | "FAILED"; export const TenderSquareAccountDetailsStatus = { Authorized: "AUTHORIZED", Captured: "CAPTURED", Voided: "VOIDED", Failed: "FAILED", } as const; -export type TenderSquareAccountDetailsStatus = - (typeof TenderSquareAccountDetailsStatus)[keyof typeof TenderSquareAccountDetailsStatus]; diff --git a/src/api/types/TenderType.ts b/src/api/types/TenderType.ts index 93b9fc856..36f3223f3 100644 --- a/src/api/types/TenderType.ts +++ b/src/api/types/TenderType.ts @@ -1,6 +1,21 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates a tender's type. */ +/** + * Indicates a tender's type. + */ +export type TenderType = + | "CARD" + | "CASH" + | "THIRD_PARTY_CARD" + | "SQUARE_GIFT_CARD" + | "NO_SALE" + | "BANK_ACCOUNT" + | "WALLET" + | "BUY_NOW_PAY_LATER" + | "SQUARE_ACCOUNT" + | "OTHER"; export const TenderType = { Card: "CARD", Cash: "CASH", @@ -13,4 +28,3 @@ export const TenderType = { SquareAccount: "SQUARE_ACCOUNT", Other: "OTHER", } as const; -export type TenderType = (typeof TenderType)[keyof typeof TenderType]; diff --git a/src/api/types/TerminalAction.ts b/src/api/types/TerminalAction.ts index 7c09f61ca..0bc88412d 100644 --- a/src/api/types/TerminalAction.ts +++ b/src/api/types/TerminalAction.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an action processed by the Square Terminal. diff --git a/src/api/types/TerminalActionActionType.ts b/src/api/types/TerminalActionActionType.ts index 34a8e6162..3eea1e7c4 100644 --- a/src/api/types/TerminalActionActionType.ts +++ b/src/api/types/TerminalActionActionType.ts @@ -1,6 +1,19 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. */ +/** + * Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. + */ +export type TerminalActionActionType = + | "QR_CODE" + | "PING" + | "SAVE_CARD" + | "SIGNATURE" + | "CONFIRMATION" + | "RECEIPT" + | "DATA_COLLECTION" + | "SELECT"; export const TerminalActionActionType = { QrCode: "QR_CODE", Ping: "PING", @@ -11,4 +24,3 @@ export const TerminalActionActionType = { DataCollection: "DATA_COLLECTION", Select: "SELECT", } as const; -export type TerminalActionActionType = (typeof TerminalActionActionType)[keyof typeof TerminalActionActionType]; diff --git a/src/api/types/TerminalActionCreatedEvent.ts b/src/api/types/TerminalActionCreatedEvent.ts index d5e29af44..f2adf234a 100644 --- a/src/api/types/TerminalActionCreatedEvent.ts +++ b/src/api/types/TerminalActionCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a TerminalAction is created. diff --git a/src/api/types/TerminalActionCreatedEventData.ts b/src/api/types/TerminalActionCreatedEventData.ts index 1a7b730ae..cc97f575a 100644 --- a/src/api/types/TerminalActionCreatedEventData.ts +++ b/src/api/types/TerminalActionCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TerminalActionCreatedEventData { /** Name of the created object’s type, `"action"`. */ diff --git a/src/api/types/TerminalActionCreatedEventObject.ts b/src/api/types/TerminalActionCreatedEventObject.ts index 2ed2a2c81..abc06f71c 100644 --- a/src/api/types/TerminalActionCreatedEventObject.ts +++ b/src/api/types/TerminalActionCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TerminalActionCreatedEventObject { /** The created terminal action. */ diff --git a/src/api/types/TerminalActionQuery.ts b/src/api/types/TerminalActionQuery.ts index 9415334a8..8dcd1d695 100644 --- a/src/api/types/TerminalActionQuery.ts +++ b/src/api/types/TerminalActionQuery.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TerminalActionQuery { /** Options for filtering returned `TerminalAction`s */ diff --git a/src/api/types/TerminalActionQueryFilter.ts b/src/api/types/TerminalActionQueryFilter.ts index c96518698..b37e776e7 100644 --- a/src/api/types/TerminalActionQueryFilter.ts +++ b/src/api/types/TerminalActionQueryFilter.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TerminalActionQueryFilter { /** diff --git a/src/api/types/TerminalActionQuerySort.ts b/src/api/types/TerminalActionQuerySort.ts index b86f125f1..9bd211967 100644 --- a/src/api/types/TerminalActionQuerySort.ts +++ b/src/api/types/TerminalActionQuerySort.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TerminalActionQuerySort { /** diff --git a/src/api/types/TerminalActionUpdatedEvent.ts b/src/api/types/TerminalActionUpdatedEvent.ts index a088c272b..df9adb9ad 100644 --- a/src/api/types/TerminalActionUpdatedEvent.ts +++ b/src/api/types/TerminalActionUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a TerminalAction is updated. diff --git a/src/api/types/TerminalActionUpdatedEventData.ts b/src/api/types/TerminalActionUpdatedEventData.ts index 8ce3b78ae..785ba72e8 100644 --- a/src/api/types/TerminalActionUpdatedEventData.ts +++ b/src/api/types/TerminalActionUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TerminalActionUpdatedEventData { /** Name of the updated object’s type, `"action"`. */ diff --git a/src/api/types/TerminalActionUpdatedEventObject.ts b/src/api/types/TerminalActionUpdatedEventObject.ts index 90443407e..e287bb58d 100644 --- a/src/api/types/TerminalActionUpdatedEventObject.ts +++ b/src/api/types/TerminalActionUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TerminalActionUpdatedEventObject { /** The updated terminal action. */ diff --git a/src/api/types/TerminalCheckout.ts b/src/api/types/TerminalCheckout.ts index 9935a3fff..1247ec526 100644 --- a/src/api/types/TerminalCheckout.ts +++ b/src/api/types/TerminalCheckout.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a checkout processed by the Square Terminal. diff --git a/src/api/types/TerminalCheckoutCreatedEvent.ts b/src/api/types/TerminalCheckoutCreatedEvent.ts index f65178344..882e22032 100644 --- a/src/api/types/TerminalCheckoutCreatedEvent.ts +++ b/src/api/types/TerminalCheckoutCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [TerminalCheckout](entity:TerminalCheckout) is created. diff --git a/src/api/types/TerminalCheckoutCreatedEventData.ts b/src/api/types/TerminalCheckoutCreatedEventData.ts index 37a8ba5a0..185540003 100644 --- a/src/api/types/TerminalCheckoutCreatedEventData.ts +++ b/src/api/types/TerminalCheckoutCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TerminalCheckoutCreatedEventData { /** Name of the created object’s type, `"checkout"`. */ diff --git a/src/api/types/TerminalCheckoutCreatedEventObject.ts b/src/api/types/TerminalCheckoutCreatedEventObject.ts index 85e93c3b5..95871ff27 100644 --- a/src/api/types/TerminalCheckoutCreatedEventObject.ts +++ b/src/api/types/TerminalCheckoutCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TerminalCheckoutCreatedEventObject { /** The created terminal checkout */ diff --git a/src/api/types/TerminalCheckoutQuery.ts b/src/api/types/TerminalCheckoutQuery.ts index ebeb298a0..ff31643bc 100644 --- a/src/api/types/TerminalCheckoutQuery.ts +++ b/src/api/types/TerminalCheckoutQuery.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TerminalCheckoutQuery { /** Options for filtering returned `TerminalCheckout` objects. */ diff --git a/src/api/types/TerminalCheckoutQueryFilter.ts b/src/api/types/TerminalCheckoutQueryFilter.ts index e576423af..0bad649c3 100644 --- a/src/api/types/TerminalCheckoutQueryFilter.ts +++ b/src/api/types/TerminalCheckoutQueryFilter.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TerminalCheckoutQueryFilter { /** diff --git a/src/api/types/TerminalCheckoutQuerySort.ts b/src/api/types/TerminalCheckoutQuerySort.ts index dc6f63662..f9cec6434 100644 --- a/src/api/types/TerminalCheckoutQuerySort.ts +++ b/src/api/types/TerminalCheckoutQuerySort.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TerminalCheckoutQuerySort { /** diff --git a/src/api/types/TerminalCheckoutUpdatedEvent.ts b/src/api/types/TerminalCheckoutUpdatedEvent.ts index 92c23e301..5a3e54993 100644 --- a/src/api/types/TerminalCheckoutUpdatedEvent.ts +++ b/src/api/types/TerminalCheckoutUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [TerminalCheckout](entity:TerminalCheckout) is updated. diff --git a/src/api/types/TerminalCheckoutUpdatedEventData.ts b/src/api/types/TerminalCheckoutUpdatedEventData.ts index 7f365cce0..eec1ee3d3 100644 --- a/src/api/types/TerminalCheckoutUpdatedEventData.ts +++ b/src/api/types/TerminalCheckoutUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TerminalCheckoutUpdatedEventData { /** Name of the updated object’s type, `"checkout"`. */ diff --git a/src/api/types/TerminalCheckoutUpdatedEventObject.ts b/src/api/types/TerminalCheckoutUpdatedEventObject.ts index 2553baf16..7a51fb290 100644 --- a/src/api/types/TerminalCheckoutUpdatedEventObject.ts +++ b/src/api/types/TerminalCheckoutUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TerminalCheckoutUpdatedEventObject { /** The updated terminal checkout */ diff --git a/src/api/types/TerminalRefund.ts b/src/api/types/TerminalRefund.ts index 6d3d07efc..eb858f1e9 100644 --- a/src/api/types/TerminalRefund.ts +++ b/src/api/types/TerminalRefund.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit network) payment refunds. diff --git a/src/api/types/TerminalRefundCreatedEvent.ts b/src/api/types/TerminalRefundCreatedEvent.ts index 9e0b8a9b3..4b4dab55a 100644 --- a/src/api/types/TerminalRefundCreatedEvent.ts +++ b/src/api/types/TerminalRefundCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a Terminal API refund is created. diff --git a/src/api/types/TerminalRefundCreatedEventData.ts b/src/api/types/TerminalRefundCreatedEventData.ts index 3a9b33bb3..f8477f22a 100644 --- a/src/api/types/TerminalRefundCreatedEventData.ts +++ b/src/api/types/TerminalRefundCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TerminalRefundCreatedEventData { /** Name of the created object’s type, `"refund"`. */ diff --git a/src/api/types/TerminalRefundCreatedEventObject.ts b/src/api/types/TerminalRefundCreatedEventObject.ts index b3bead4c6..5cc3e3ac0 100644 --- a/src/api/types/TerminalRefundCreatedEventObject.ts +++ b/src/api/types/TerminalRefundCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TerminalRefundCreatedEventObject { /** The created terminal refund. */ diff --git a/src/api/types/TerminalRefundQuery.ts b/src/api/types/TerminalRefundQuery.ts index a17a12d53..99a8c3ebd 100644 --- a/src/api/types/TerminalRefundQuery.ts +++ b/src/api/types/TerminalRefundQuery.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TerminalRefundQuery { /** The filter for the Terminal refund query. */ diff --git a/src/api/types/TerminalRefundQueryFilter.ts b/src/api/types/TerminalRefundQueryFilter.ts index 82812a0b1..8afc83ed8 100644 --- a/src/api/types/TerminalRefundQueryFilter.ts +++ b/src/api/types/TerminalRefundQueryFilter.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TerminalRefundQueryFilter { /** diff --git a/src/api/types/TerminalRefundQuerySort.ts b/src/api/types/TerminalRefundQuerySort.ts index 7e2a40b2b..277d8f115 100644 --- a/src/api/types/TerminalRefundQuerySort.ts +++ b/src/api/types/TerminalRefundQuerySort.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface TerminalRefundQuerySort { /** diff --git a/src/api/types/TerminalRefundUpdatedEvent.ts b/src/api/types/TerminalRefundUpdatedEvent.ts index 8b6a14e97..fd38c9e1d 100644 --- a/src/api/types/TerminalRefundUpdatedEvent.ts +++ b/src/api/types/TerminalRefundUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a Terminal API refund is updated. diff --git a/src/api/types/TerminalRefundUpdatedEventData.ts b/src/api/types/TerminalRefundUpdatedEventData.ts index 6f170d172..ec64faf3a 100644 --- a/src/api/types/TerminalRefundUpdatedEventData.ts +++ b/src/api/types/TerminalRefundUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TerminalRefundUpdatedEventData { /** Name of the updated object’s type, `"refund"`. */ diff --git a/src/api/types/TerminalRefundUpdatedEventObject.ts b/src/api/types/TerminalRefundUpdatedEventObject.ts index 668583283..2f20e8473 100644 --- a/src/api/types/TerminalRefundUpdatedEventObject.ts +++ b/src/api/types/TerminalRefundUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface TerminalRefundUpdatedEventObject { /** The updated terminal refund. */ diff --git a/src/api/types/TestWebhookSubscriptionResponse.ts b/src/api/types/TestWebhookSubscriptionResponse.ts index e0894b973..01af77619 100644 --- a/src/api/types/TestWebhookSubscriptionResponse.ts +++ b/src/api/types/TestWebhookSubscriptionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/TimeRange.ts b/src/api/types/TimeRange.ts index 9c2fe5e69..f0624288c 100644 --- a/src/api/types/TimeRange.ts +++ b/src/api/types/TimeRange.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents a generic time range. The start and end values are diff --git a/src/api/types/Timecard.ts b/src/api/types/Timecard.ts index 37008e0d4..5e7ff025f 100644 --- a/src/api/types/Timecard.ts +++ b/src/api/types/Timecard.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A record of the hourly rate, start time, and end time of a single timecard (shift) diff --git a/src/api/types/TimecardFilter.ts b/src/api/types/TimecardFilter.ts index 11c651c03..b81f5f90f 100644 --- a/src/api/types/TimecardFilter.ts +++ b/src/api/types/TimecardFilter.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines a filter used in a search for `Timecard` records. `AND` logic is diff --git a/src/api/types/TimecardFilterStatus.ts b/src/api/types/TimecardFilterStatus.ts index 6fb11bbe8..d22fcad21 100644 --- a/src/api/types/TimecardFilterStatus.ts +++ b/src/api/types/TimecardFilterStatus.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Specifies the `status` of `Timecard` records to be returned. */ +/** + * Specifies the `status` of `Timecard` records to be returned. + */ +export type TimecardFilterStatus = "OPEN" | "CLOSED"; export const TimecardFilterStatus = { Open: "OPEN", Closed: "CLOSED", } as const; -export type TimecardFilterStatus = (typeof TimecardFilterStatus)[keyof typeof TimecardFilterStatus]; diff --git a/src/api/types/TimecardQuery.ts b/src/api/types/TimecardQuery.ts index 439c1583c..17307416c 100644 --- a/src/api/types/TimecardQuery.ts +++ b/src/api/types/TimecardQuery.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The parameters of a `Timecard` search query, which includes filter and sort options. diff --git a/src/api/types/TimecardSort.ts b/src/api/types/TimecardSort.ts index 31cf03f10..5d2e15ebc 100644 --- a/src/api/types/TimecardSort.ts +++ b/src/api/types/TimecardSort.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Sets the sort order of search results. diff --git a/src/api/types/TimecardSortField.ts b/src/api/types/TimecardSortField.ts index d53d3eafa..920b24412 100644 --- a/src/api/types/TimecardSortField.ts +++ b/src/api/types/TimecardSortField.ts @@ -1,10 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Enumerates the `Timecard` fields to sort on. */ +/** + * Enumerates the `Timecard` fields to sort on. + */ +export type TimecardSortField = "START_AT" | "END_AT" | "CREATED_AT" | "UPDATED_AT"; export const TimecardSortField = { StartAt: "START_AT", EndAt: "END_AT", CreatedAt: "CREATED_AT", UpdatedAt: "UPDATED_AT", } as const; -export type TimecardSortField = (typeof TimecardSortField)[keyof typeof TimecardSortField]; diff --git a/src/api/types/TimecardStatus.ts b/src/api/types/TimecardStatus.ts index 52aeee448..bdebe5c48 100644 --- a/src/api/types/TimecardStatus.ts +++ b/src/api/types/TimecardStatus.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** **Read only** Enumerates the possible status of a [timecard](entity:Timecard). */ +/** + * **Read only** Enumerates the possible status of a [timecard](entity:Timecard). + */ +export type TimecardStatus = "OPEN" | "CLOSED"; export const TimecardStatus = { Open: "OPEN", Closed: "CLOSED", } as const; -export type TimecardStatus = (typeof TimecardStatus)[keyof typeof TimecardStatus]; diff --git a/src/api/types/TimecardWage.ts b/src/api/types/TimecardWage.ts index f6e498e8e..1a0a11148 100644 --- a/src/api/types/TimecardWage.ts +++ b/src/api/types/TimecardWage.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The hourly wage rate used to compensate a team member for a [timecard](entity:Timecard). diff --git a/src/api/types/TimecardWorkday.ts b/src/api/types/TimecardWorkday.ts index c7db45631..260d01157 100644 --- a/src/api/types/TimecardWorkday.ts +++ b/src/api/types/TimecardWorkday.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A `Timecard` search query filter parameter that sets a range of days that diff --git a/src/api/types/TimecardWorkdayMatcher.ts b/src/api/types/TimecardWorkdayMatcher.ts index 88b397ec7..9c3285812 100644 --- a/src/api/types/TimecardWorkdayMatcher.ts +++ b/src/api/types/TimecardWorkdayMatcher.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Defines the logic used to apply a workday filter. */ +/** + * Defines the logic used to apply a workday filter. + */ +export type TimecardWorkdayMatcher = "START_AT" | "END_AT" | "INTERSECTION"; export const TimecardWorkdayMatcher = { StartAt: "START_AT", EndAt: "END_AT", Intersection: "INTERSECTION", } as const; -export type TimecardWorkdayMatcher = (typeof TimecardWorkdayMatcher)[keyof typeof TimecardWorkdayMatcher]; diff --git a/src/api/types/TipSettings.ts b/src/api/types/TipSettings.ts index d261b60d7..00b18e986 100644 --- a/src/api/types/TipSettings.ts +++ b/src/api/types/TipSettings.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface TipSettings { /** Indicates whether tipping is enabled for this checkout. Defaults to false. */ diff --git a/src/api/types/Transaction.ts b/src/api/types/Transaction.ts index c7ccdbbd1..50ccaf1a3 100644 --- a/src/api/types/Transaction.ts +++ b/src/api/types/Transaction.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a transaction processed with Square, either with the diff --git a/src/api/types/TransactionProduct.ts b/src/api/types/TransactionProduct.ts index 2b1fd275f..4d481f24d 100644 --- a/src/api/types/TransactionProduct.ts +++ b/src/api/types/TransactionProduct.ts @@ -1,6 +1,19 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicates the Square product used to process a transaction. */ +/** + * Indicates the Square product used to process a transaction. + */ +export type TransactionProduct = + | "REGISTER" + | "EXTERNAL_API" + | "BILLING" + | "APPOINTMENTS" + | "INVOICES" + | "ONLINE_STORE" + | "PAYROLL" + | "OTHER"; export const TransactionProduct = { Register: "REGISTER", ExternalApi: "EXTERNAL_API", @@ -11,4 +24,3 @@ export const TransactionProduct = { Payroll: "PAYROLL", Other: "OTHER", } as const; -export type TransactionProduct = (typeof TransactionProduct)[keyof typeof TransactionProduct]; diff --git a/src/api/types/TransactionType.ts b/src/api/types/TransactionType.ts index 7ef1d5ad0..c9e6b3317 100644 --- a/src/api/types/TransactionType.ts +++ b/src/api/types/TransactionType.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The transaction type used in the disputed payment. */ +/** + * The transaction type used in the disputed payment. + */ +export type TransactionType = "DEBIT" | "CREDIT"; export const TransactionType = { Debit: "DEBIT", Credit: "CREDIT", } as const; -export type TransactionType = (typeof TransactionType)[keyof typeof TransactionType]; diff --git a/src/api/types/TransferOrder.ts b/src/api/types/TransferOrder.ts deleted file mode 100644 index b8f235370..000000000 --- a/src/api/types/TransferOrder.ts +++ /dev/null @@ -1,104 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -/** - * Represents a transfer order for moving [CatalogItemVariation](entity:CatalogItemVariation)s - * between [Location](entity:Location)s. Transfer orders track the entire lifecycle of an inventory - * transfer, including: - * - What items and quantities are being moved - * - Source and destination locations - * - Current [TransferOrderStatus](entity:TransferOrderStatus) - * - Shipping information and tracking - * - Which [TeamMember](entity:TeamMember) initiated the transfer - * - * This object is commonly used to: - * - Track [CatalogItemVariation](entity:CatalogItemVariation) movements between [Location](entity:Location)s - * - Reconcile expected vs received quantities - * - Monitor transfer progress and shipping status - * - Audit inventory movement history - */ -export interface TransferOrder { - /** - * Unique system-generated identifier for this transfer order. Use this ID for: - * - Retrieving transfer order details - * - Tracking status changes via webhooks - * - Linking transfers in external systems - */ - id?: string; - /** - * The source [Location](entity:Location) sending the [CatalogItemVariation](entity:CatalogItemVariation)s. - * This location must: - * - Be active in your Square organization - * - Have sufficient inventory for the items being transferred - * - Not be the same as the destination location - * - * This field is not updatable. - */ - sourceLocationId?: string | null; - /** - * The destination [Location](entity:Location) receiving the [CatalogItemVariation](entity:CatalogItemVariation)s. - * This location must: - * - Be active in your Square organization - * - Not be the same as the source location - * - * This field is not updatable. - */ - destinationLocationId?: string | null; - /** - * Current [TransferOrderStatus](entity:TransferOrderStatus) indicating where the order is in its lifecycle. - * Status transitions follow this progression: - * 1. [DRAFT](entity:TransferOrderStatus) -> [STARTED](entity:TransferOrderStatus) via [StartTransferOrder](api-endpoint:TransferOrders-StartTransferOrder) - * 2. [STARTED](entity:TransferOrderStatus) -> [PARTIALLY_RECEIVED](entity:TransferOrderStatus) via [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder) - * 3. [PARTIALLY_RECEIVED](entity:TransferOrderStatus) -> [COMPLETED](entity:TransferOrderStatus) after all items received - * - * Orders can be [CANCELED](entity:TransferOrderStatus) from [STARTED](entity:TransferOrderStatus) or - * [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status. - * - * This field is read-only and reflects the current state of the transfer order, and cannot be updated directly. Use the appropriate - * endpoints (e.g. [StartPurchaseOrder](api-endpoint:TransferOrders-StartTransferOrder), to change the status. - * See [TransferOrderStatus](#type-transferorderstatus) for possible values - */ - status?: Square.TransferOrderStatus; - /** - * Timestamp when the transfer order was created, in RFC 3339 format. - * Used for: - * - Auditing transfer history - * - Tracking order age - * - Reporting and analytics - */ - createdAt?: string; - /** - * Timestamp when the transfer order was last updated, in RFC 3339 format. - * Updated when: - * - Order status changes - * - Items are received - * - Notes or metadata are modified - */ - updatedAt?: string; - /** - * Expected transfer completion date, in RFC 3339 format. - * Used for: - * - Planning inventory availability - * - Scheduling receiving staff - * - Monitoring transfer timeliness - */ - expectedAt?: string | null; - /** Timestamp when the transfer order was completed or canceled, in RFC 3339 format (e.g. "2023-10-01T12:00:00Z"). */ - completedAt?: string; - /** Optional notes about the transfer. */ - notes?: string | null; - /** Shipment tracking number for monitoring transfer progress. */ - trackingNumber?: string | null; - /** ID of the [TeamMember](entity:TeamMember) who created this transfer order. This field is not writeable by the Connect V2 API. */ - createdByTeamMemberId?: string; - /** List of [CatalogItemVariation](entity:CatalogItemVariation)s being transferred. */ - lineItems?: Square.TransferOrderLine[] | null; - /** - * Version for optimistic concurrency control. This is a monotonically increasing integer - * that changes whenever the transfer order is modified. Use this when calling - * [UpdateTransferOrder](api-endpoint:TransferOrders-UpdateTransferOrder) and other endpoints to ensure you're - * not overwriting concurrent changes. - */ - version?: bigint; -} diff --git a/src/api/types/TransferOrderCreatedEvent.ts b/src/api/types/TransferOrderCreatedEvent.ts deleted file mode 100644 index 91c7a5f05..000000000 --- a/src/api/types/TransferOrderCreatedEvent.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -/** - * Published when a transfer_order is created. - */ -export interface TransferOrderCreatedEvent { - /** The ID of the target merchant associated with the event. */ - merchantId?: string | null; - /** The type of event this represents, `"transfer_order.created"`. */ - type?: string | null; - /** A unique ID for the event. */ - eventId?: string | null; - /** Timestamp of when the event was created, in RFC 3339 format. */ - createdAt?: string; - /** Data associated with the event. */ - data?: Square.TransferOrderCreatedEventData; -} diff --git a/src/api/types/TransferOrderCreatedEventData.ts b/src/api/types/TransferOrderCreatedEventData.ts deleted file mode 100644 index bf319f75c..000000000 --- a/src/api/types/TransferOrderCreatedEventData.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -export interface TransferOrderCreatedEventData { - /** Name of the affected object’s type, `"transfer_order"`. */ - type?: string | null; - /** ID of the affected transfer_order. */ - id?: string; - /** An object containing the created transfer_order. */ - object?: Square.TransferOrderCreatedEventObject; -} diff --git a/src/api/types/TransferOrderCreatedEventObject.ts b/src/api/types/TransferOrderCreatedEventObject.ts deleted file mode 100644 index 2fd486b18..000000000 --- a/src/api/types/TransferOrderCreatedEventObject.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -export interface TransferOrderCreatedEventObject { - /** The created transfer_order. */ - transferOrder?: Square.TransferOrder; -} diff --git a/src/api/types/TransferOrderDeletedEvent.ts b/src/api/types/TransferOrderDeletedEvent.ts deleted file mode 100644 index 1396e345d..000000000 --- a/src/api/types/TransferOrderDeletedEvent.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -/** - * Published when a transfer_order is deleted. - */ -export interface TransferOrderDeletedEvent { - /** The ID of the target merchant associated with the event. */ - merchantId?: string | null; - /** The type of event this represents, `"transfer_order.deleted"`. */ - type?: string | null; - /** A unique ID for the event. */ - eventId?: string | null; - /** Timestamp of when the event was created, in RFC 3339 format. */ - createdAt?: string; - /** Data associated with the event. */ - data?: Square.TransferOrderDeletedEventData; -} diff --git a/src/api/types/TransferOrderDeletedEventData.ts b/src/api/types/TransferOrderDeletedEventData.ts deleted file mode 100644 index bbd6be345..000000000 --- a/src/api/types/TransferOrderDeletedEventData.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export interface TransferOrderDeletedEventData { - /** Name of the affected object’s type, `"transfer_order"`. */ - type?: string | null; - /** ID of the affected transfer_order. */ - id?: string; - /** Is true if the affected object was deleted. Otherwise absent. */ - deleted?: boolean | null; -} diff --git a/src/api/types/TransferOrderFilter.ts b/src/api/types/TransferOrderFilter.ts deleted file mode 100644 index 2712b6509..000000000 --- a/src/api/types/TransferOrderFilter.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -/** - * Filter criteria for searching transfer orders - */ -export interface TransferOrderFilter { - /** Filter by source location IDs */ - sourceLocationIds?: string[] | null; - /** Filter by destination location IDs */ - destinationLocationIds?: string[] | null; - /** - * Filter by order statuses - * See [TransferOrderStatus](#type-transferorderstatus) for possible values - */ - statuses?: Square.TransferOrderStatus[] | null; -} diff --git a/src/api/types/TransferOrderGoodsReceipt.ts b/src/api/types/TransferOrderGoodsReceipt.ts deleted file mode 100644 index 834639d9e..000000000 --- a/src/api/types/TransferOrderGoodsReceipt.ts +++ /dev/null @@ -1,40 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -/** - * The goods receipt details for a transfer order. This object represents a single receipt - * of goods against a transfer order, tracking: - * - * - Which [CatalogItemVariation](entity:CatalogItemVariation)s were received - * - Quantities received in good condition - * - Quantities damaged during transit/handling - * - Quantities canceled during receipt - * - * Multiple goods receipts can be created for a single transfer order to handle: - * - Partial deliveries - * - Multiple shipments - * - Split receipts across different dates - * - Cancellations of specific quantities - * - * Each receipt automatically: - * - Updates the transfer order status - * - Adjusts received quantities - * - Updates inventory levels at both source and destination [Location](entity:Location)s - */ -export interface TransferOrderGoodsReceipt { - /** - * Line items being received. Each line item specifies: - * - The item being received - * - Quantity received in good condition - * - Quantity received damaged - * - Quantity canceled - * - * Constraints: - * - Must include at least one line item - * - Maximum of 1000 line items per receipt - * - Each line item must reference a valid item from the transfer order - * - Total of received, damaged, and canceled quantities cannot exceed ordered quantity - */ - lineItems?: Square.TransferOrderGoodsReceiptLineItem[] | null; -} diff --git a/src/api/types/TransferOrderGoodsReceiptLineItem.ts b/src/api/types/TransferOrderGoodsReceiptLineItem.ts deleted file mode 100644 index 54ff5b5a6..000000000 --- a/src/api/types/TransferOrderGoodsReceiptLineItem.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * A simplified line item for goods receipts in transfer orders - */ -export interface TransferOrderGoodsReceiptLineItem { - /** The unique identifier of the Transfer Order line being received */ - transferOrderLineUid: string; - /** - * The quantity received for this line item as a decimal string (e.g. "10.5"). - * These items will be added to the destination [Location](entity:Location)'s inventory with [InventoryState](entity:InventoryState) of IN_STOCK. - */ - quantityReceived?: string | null; - /** - * The quantity that was damaged during shipping/handling as a decimal string (e.g. "1.5"). - * These items will be added to the destination [Location](entity:Location)'s inventory with [InventoryState](entity:InventoryState) of WASTE. - */ - quantityDamaged?: string | null; - /** The quantity that was canceled during shipping/handling as a decimal string (e.g. "1.5"). These will be immediately added to inventory in the source location. */ - quantityCanceled?: string | null; -} diff --git a/src/api/types/TransferOrderLine.ts b/src/api/types/TransferOrderLine.ts deleted file mode 100644 index 599a22445..000000000 --- a/src/api/types/TransferOrderLine.ts +++ /dev/null @@ -1,44 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Represents a line item in a transfer order. Each line item tracks a specific - * [CatalogItemVariation](entity:CatalogItemVariation) being transferred, including ordered quantities - * and receipt status. - */ -export interface TransferOrderLine { - /** Unique system-generated identifier for the line item. Provide when updating/removing a line via [UpdateTransferOrder](api-endpoint:TransferOrders-UpdateTransferOrder). */ - uid?: string; - /** - * The required identifier of the [CatalogItemVariation](entity:CatalogItemVariation) being transferred. Must reference - * a valid catalog item variation that exists in the [Catalog](api:Catalog). - */ - itemVariationId: string; - /** - * Total quantity ordered, formatted as a decimal string (e.g. "10 or 10.0000"). Required to be a positive number. - * - * To remove a line item, set `remove` to `true` in [UpdateTransferOrder](api-endpoint:TransferOrders-UpdateTransferOrder). - */ - quantityOrdered: string; - /** Calculated quantity of this line item's yet to be received stock. This is the difference between the total quantity ordered and the sum of quantities received, canceled, and damaged. */ - quantityPending?: string; - /** - * Quantity received at destination. These items are added to the destination - * [Location](entity:Location)'s inventory with [InventoryState](entity:InventoryState) of IN_STOCK. - * - * This field cannot be updated directly in Create/Update operations, instead use [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder). - */ - quantityReceived?: string; - /** - * Quantity received in damaged condition. These items are added to the destination - * [Location](entity:Location)'s inventory with [InventoryState](entity:InventoryState) of WASTE. - * - * This field cannot be updated directly in Create/Update operations, instead use [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder). - */ - quantityDamaged?: string; - /** - * Quantity that was canceled. These items will be immediately added to inventory in the source location. - * - * This field cannot be updated directly in Create/Update operations, instead use [ReceiveTransferOrder](api-endpoint:TransferOrders-ReceiveTransferOrder) or [CancelTransferOrder](api-endpoint:TransferOrders-CancelTransferOrder). - */ - quantityCanceled?: string; -} diff --git a/src/api/types/TransferOrderQuery.ts b/src/api/types/TransferOrderQuery.ts deleted file mode 100644 index be8f3ddc4..000000000 --- a/src/api/types/TransferOrderQuery.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -/** - * Query parameters for searching transfer orders - */ -export interface TransferOrderQuery { - /** Filter criteria */ - filter?: Square.TransferOrderFilter; - /** Sort configuration */ - sort?: Square.TransferOrderSort; -} diff --git a/src/api/types/TransferOrderSort.ts b/src/api/types/TransferOrderSort.ts deleted file mode 100644 index 0fa8c6175..000000000 --- a/src/api/types/TransferOrderSort.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -/** - * Sort configuration for search results - */ -export interface TransferOrderSort { - /** - * Field to sort by - * See [TransferOrderSortField](#type-transferordersortfield) for possible values - */ - field?: Square.TransferOrderSortField; - /** - * Sort order direction - * See [SortOrder](#type-sortorder) for possible values - */ - order?: Square.SortOrder; -} diff --git a/src/api/types/TransferOrderSortField.ts b/src/api/types/TransferOrderSortField.ts deleted file mode 100644 index f14b92d79..000000000 --- a/src/api/types/TransferOrderSortField.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Fields that can be used for sorting [TransferOrder](entity:TransferOrder)s in search results. - * Used with [SearchTransferOrders](api-endpoint:TransferOrders-SearchTransferOrders) to control - * the order of returned results. - */ -export const TransferOrderSortField = { - CreatedAt: "CREATED_AT", - UpdatedAt: "UPDATED_AT", -} as const; -export type TransferOrderSortField = (typeof TransferOrderSortField)[keyof typeof TransferOrderSortField]; diff --git a/src/api/types/TransferOrderStatus.ts b/src/api/types/TransferOrderStatus.ts deleted file mode 100644 index 23bf9f7a7..000000000 --- a/src/api/types/TransferOrderStatus.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Status values for transfer orders. Represents the current state of a - * [TransferOrder](entity:TransferOrder) in its lifecycle from creation to completion. - * Each status determines what actions are available and how inventory is affected. - */ -export const TransferOrderStatus = { - Draft: "DRAFT", - Started: "STARTED", - PartiallyReceived: "PARTIALLY_RECEIVED", - Completed: "COMPLETED", - Canceled: "CANCELED", -} as const; -export type TransferOrderStatus = (typeof TransferOrderStatus)[keyof typeof TransferOrderStatus]; diff --git a/src/api/types/TransferOrderUpdatedEvent.ts b/src/api/types/TransferOrderUpdatedEvent.ts deleted file mode 100644 index 25a5c3352..000000000 --- a/src/api/types/TransferOrderUpdatedEvent.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -/** - * Published when a transfer_order is updated. - */ -export interface TransferOrderUpdatedEvent { - /** The ID of the target merchant associated with the event. */ - merchantId?: string | null; - /** The type of event this represents, `"transfer_order.updated"`. */ - type?: string | null; - /** A unique ID for the event. */ - eventId?: string | null; - /** Timestamp of when the event was created, in RFC 3339 format. */ - createdAt?: string; - /** Data associated with the event. */ - data?: Square.TransferOrderUpdatedEventData; -} diff --git a/src/api/types/TransferOrderUpdatedEventData.ts b/src/api/types/TransferOrderUpdatedEventData.ts deleted file mode 100644 index 71839f8e5..000000000 --- a/src/api/types/TransferOrderUpdatedEventData.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -export interface TransferOrderUpdatedEventData { - /** Name of the affected object’s type, `"transfer_order"`. */ - type?: string | null; - /** ID of the affected transfer_order. */ - id?: string; - /** An object containing the updated transfer_order. */ - object?: Square.TransferOrderUpdatedEventObject; -} diff --git a/src/api/types/TransferOrderUpdatedEventObject.ts b/src/api/types/TransferOrderUpdatedEventObject.ts deleted file mode 100644 index 823eb477d..000000000 --- a/src/api/types/TransferOrderUpdatedEventObject.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -export interface TransferOrderUpdatedEventObject { - /** The updated transfer_order. */ - transferOrder?: Square.TransferOrder; -} diff --git a/src/api/types/UnlinkCustomerFromGiftCardResponse.ts b/src/api/types/UnlinkCustomerFromGiftCardResponse.ts index ed26de129..f8dec48c7 100644 --- a/src/api/types/UnlinkCustomerFromGiftCardResponse.ts +++ b/src/api/types/UnlinkCustomerFromGiftCardResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response that contains the unlinked `GiftCard` object. If the request resulted in errors, diff --git a/src/api/types/UpdateBookingCustomAttributeDefinitionResponse.ts b/src/api/types/UpdateBookingCustomAttributeDefinitionResponse.ts index 920fca044..1313eb17f 100644 --- a/src/api/types/UpdateBookingCustomAttributeDefinitionResponse.ts +++ b/src/api/types/UpdateBookingCustomAttributeDefinitionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an [UpdateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-UpdateBookingCustomAttributeDefinition) response. diff --git a/src/api/types/UpdateBookingResponse.ts b/src/api/types/UpdateBookingResponse.ts index e4cca5eea..519c8dc71 100644 --- a/src/api/types/UpdateBookingResponse.ts +++ b/src/api/types/UpdateBookingResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface UpdateBookingResponse { /** The booking that was updated. */ diff --git a/src/api/types/UpdateBreakTypeResponse.ts b/src/api/types/UpdateBreakTypeResponse.ts index 352c2a088..094813247 100644 --- a/src/api/types/UpdateBreakTypeResponse.ts +++ b/src/api/types/UpdateBreakTypeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A response to a request to update a `BreakType`. The response contains diff --git a/src/api/types/UpdateCatalogImageRequest.ts b/src/api/types/UpdateCatalogImageRequest.ts index 04a87cf16..89b7091d7 100644 --- a/src/api/types/UpdateCatalogImageRequest.ts +++ b/src/api/types/UpdateCatalogImageRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface UpdateCatalogImageRequest { /** diff --git a/src/api/types/UpdateCatalogImageResponse.ts b/src/api/types/UpdateCatalogImageResponse.ts index 6f24b5223..c574bcbf0 100644 --- a/src/api/types/UpdateCatalogImageResponse.ts +++ b/src/api/types/UpdateCatalogImageResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface UpdateCatalogImageResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/UpdateCustomerCustomAttributeDefinitionResponse.ts b/src/api/types/UpdateCustomerCustomAttributeDefinitionResponse.ts index bfe267a14..b5760da5b 100644 --- a/src/api/types/UpdateCustomerCustomAttributeDefinitionResponse.ts +++ b/src/api/types/UpdateCustomerCustomAttributeDefinitionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an [UpdateCustomerCustomAttributeDefinition](api-endpoint:CustomerCustomAttributes-UpdateCustomerCustomAttributeDefinition) response. diff --git a/src/api/types/UpdateCustomerGroupResponse.ts b/src/api/types/UpdateCustomerGroupResponse.ts index fde43363f..913d8c6f4 100644 --- a/src/api/types/UpdateCustomerGroupResponse.ts +++ b/src/api/types/UpdateCustomerGroupResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/UpdateCustomerResponse.ts b/src/api/types/UpdateCustomerResponse.ts index 1212e35bb..7f949f940 100644 --- a/src/api/types/UpdateCustomerResponse.ts +++ b/src/api/types/UpdateCustomerResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/UpdateInvoiceResponse.ts b/src/api/types/UpdateInvoiceResponse.ts index af2690e24..d6f79f3e3 100644 --- a/src/api/types/UpdateInvoiceResponse.ts +++ b/src/api/types/UpdateInvoiceResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Describes a `UpdateInvoice` response. diff --git a/src/api/types/UpdateItemModifierListsResponse.ts b/src/api/types/UpdateItemModifierListsResponse.ts index 4a13ac226..0559418e8 100644 --- a/src/api/types/UpdateItemModifierListsResponse.ts +++ b/src/api/types/UpdateItemModifierListsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface UpdateItemModifierListsResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/UpdateItemTaxesResponse.ts b/src/api/types/UpdateItemTaxesResponse.ts index 02761f4ed..d0f11d28b 100644 --- a/src/api/types/UpdateItemTaxesResponse.ts +++ b/src/api/types/UpdateItemTaxesResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface UpdateItemTaxesResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/UpdateJobResponse.ts b/src/api/types/UpdateJobResponse.ts index 256824356..a07019f8e 100644 --- a/src/api/types/UpdateJobResponse.ts +++ b/src/api/types/UpdateJobResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an [UpdateJob](api-endpoint:Team-UpdateJob) response. Either `job` or `errors` diff --git a/src/api/types/UpdateLocationCustomAttributeDefinitionResponse.ts b/src/api/types/UpdateLocationCustomAttributeDefinitionResponse.ts index 64bfbf8cb..0c649bc07 100644 --- a/src/api/types/UpdateLocationCustomAttributeDefinitionResponse.ts +++ b/src/api/types/UpdateLocationCustomAttributeDefinitionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an [UpdateLocationCustomAttributeDefinition](api-endpoint:LocationCustomAttributes-UpdateLocationCustomAttributeDefinition) response. diff --git a/src/api/types/UpdateLocationResponse.ts b/src/api/types/UpdateLocationResponse.ts index 9f875deef..25aede1c6 100644 --- a/src/api/types/UpdateLocationResponse.ts +++ b/src/api/types/UpdateLocationResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response object returned by the [UpdateLocation](api-endpoint:Locations-UpdateLocation) endpoint. diff --git a/src/api/types/UpdateLocationSettingsResponse.ts b/src/api/types/UpdateLocationSettingsResponse.ts index 5556e1f82..f6d4a37d2 100644 --- a/src/api/types/UpdateLocationSettingsResponse.ts +++ b/src/api/types/UpdateLocationSettingsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface UpdateLocationSettingsResponse { /** Any errors that occurred when updating the location settings. */ diff --git a/src/api/types/UpdateMerchantCustomAttributeDefinitionResponse.ts b/src/api/types/UpdateMerchantCustomAttributeDefinitionResponse.ts index 49f87b262..c6f872588 100644 --- a/src/api/types/UpdateMerchantCustomAttributeDefinitionResponse.ts +++ b/src/api/types/UpdateMerchantCustomAttributeDefinitionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an [UpdateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-UpdateMerchantCustomAttributeDefinition) response. diff --git a/src/api/types/UpdateMerchantSettingsResponse.ts b/src/api/types/UpdateMerchantSettingsResponse.ts index 2412c7281..51b94b7f1 100644 --- a/src/api/types/UpdateMerchantSettingsResponse.ts +++ b/src/api/types/UpdateMerchantSettingsResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface UpdateMerchantSettingsResponse { /** Any errors that occurred when updating the merchant settings. */ diff --git a/src/api/types/UpdateOrderCustomAttributeDefinitionResponse.ts b/src/api/types/UpdateOrderCustomAttributeDefinitionResponse.ts index 1cc2dbf69..85b32051f 100644 --- a/src/api/types/UpdateOrderCustomAttributeDefinitionResponse.ts +++ b/src/api/types/UpdateOrderCustomAttributeDefinitionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response from updating an order custom attribute definition. diff --git a/src/api/types/UpdateOrderResponse.ts b/src/api/types/UpdateOrderResponse.ts index ddfe56d96..50f3ff049 100644 --- a/src/api/types/UpdateOrderResponse.ts +++ b/src/api/types/UpdateOrderResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/UpdatePaymentLinkResponse.ts b/src/api/types/UpdatePaymentLinkResponse.ts index d43a05056..5db98657d 100644 --- a/src/api/types/UpdatePaymentLinkResponse.ts +++ b/src/api/types/UpdatePaymentLinkResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface UpdatePaymentLinkResponse { /** Any errors that occurred when updating the payment link. */ diff --git a/src/api/types/UpdatePaymentResponse.ts b/src/api/types/UpdatePaymentResponse.ts index 167f3b512..13c975379 100644 --- a/src/api/types/UpdatePaymentResponse.ts +++ b/src/api/types/UpdatePaymentResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the response returned by diff --git a/src/api/types/UpdateScheduledShiftResponse.ts b/src/api/types/UpdateScheduledShiftResponse.ts index ed9ab1509..eca29e68b 100644 --- a/src/api/types/UpdateScheduledShiftResponse.ts +++ b/src/api/types/UpdateScheduledShiftResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an [UpdateScheduledShift](api-endpoint:Labor-UpdateScheduledShift) response. diff --git a/src/api/types/UpdateShiftResponse.ts b/src/api/types/UpdateShiftResponse.ts index 05501782a..0acfcc969 100644 --- a/src/api/types/UpdateShiftResponse.ts +++ b/src/api/types/UpdateShiftResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response to a request to update a `Shift`. The response contains diff --git a/src/api/types/UpdateSubscriptionResponse.ts b/src/api/types/UpdateSubscriptionResponse.ts index c0898d95c..134a6ac96 100644 --- a/src/api/types/UpdateSubscriptionResponse.ts +++ b/src/api/types/UpdateSubscriptionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines output parameters in a response from the diff --git a/src/api/types/UpdateTeamMemberRequest.ts b/src/api/types/UpdateTeamMemberRequest.ts index ad8efa32c..4944b1cf6 100644 --- a/src/api/types/UpdateTeamMemberRequest.ts +++ b/src/api/types/UpdateTeamMemberRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an update request for a `TeamMember` object. diff --git a/src/api/types/UpdateTeamMemberResponse.ts b/src/api/types/UpdateTeamMemberResponse.ts index be1633ac1..498af27a0 100644 --- a/src/api/types/UpdateTeamMemberResponse.ts +++ b/src/api/types/UpdateTeamMemberResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response from an update request containing the updated `TeamMember` object or error messages. diff --git a/src/api/types/UpdateTimecardResponse.ts b/src/api/types/UpdateTimecardResponse.ts index af1bb2e00..b7fc67224 100644 --- a/src/api/types/UpdateTimecardResponse.ts +++ b/src/api/types/UpdateTimecardResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response to a request to update a `Timecard`. The response contains diff --git a/src/api/types/UpdateTransferOrderData.ts b/src/api/types/UpdateTransferOrderData.ts deleted file mode 100644 index ca341ee83..000000000 --- a/src/api/types/UpdateTransferOrderData.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -/** - * Data model for updating a transfer order. All fields are optional. - */ -export interface UpdateTransferOrderData { - /** - * The source [Location](entity:Location) that will send the items. Must be an active location - * in your Square account with sufficient inventory of the requested items. - */ - sourceLocationId?: string | null; - /** - * The destination [Location](entity:Location) that will receive the items. Must be an active location - * in your Square account. - */ - destinationLocationId?: string | null; - /** Expected transfer date in RFC 3339 format (e.g. "2023-10-01T12:00:00Z"). */ - expectedAt?: string | null; - /** Optional notes about the transfer */ - notes?: string | null; - /** Shipment tracking number */ - trackingNumber?: string | null; - /** List of items being transferred */ - lineItems?: Square.UpdateTransferOrderLineData[] | null; -} diff --git a/src/api/types/UpdateTransferOrderLineData.ts b/src/api/types/UpdateTransferOrderLineData.ts deleted file mode 100644 index 515f26cc9..000000000 --- a/src/api/types/UpdateTransferOrderLineData.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * Represents a line item update in a transfer order - */ -export interface UpdateTransferOrderLineData { - /** Line item id being updated. Required for updating/removing existing line items, but should not be set for new line items. */ - uid?: string | null; - /** - * Catalog item variation being transferred - * - * Required for new line items, but otherwise is not updatable. - */ - itemVariationId?: string | null; - /** Total quantity ordered */ - quantityOrdered?: string | null; - /** Flag to remove the line item during update. Must include `uid` in removal request */ - remove?: boolean | null; -} diff --git a/src/api/types/UpdateTransferOrderResponse.ts b/src/api/types/UpdateTransferOrderResponse.ts deleted file mode 100644 index 7bb997a5d..000000000 --- a/src/api/types/UpdateTransferOrderResponse.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -/** - * Response for updating a transfer order - */ -export interface UpdateTransferOrderResponse { - /** The updated transfer order */ - transferOrder?: Square.TransferOrder; - /** Any errors that occurred during the request */ - errors?: Square.Error_[]; -} diff --git a/src/api/types/UpdateVendorRequest.ts b/src/api/types/UpdateVendorRequest.ts index b261c750c..dcb85e48b 100644 --- a/src/api/types/UpdateVendorRequest.ts +++ b/src/api/types/UpdateVendorRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an input to a call to [UpdateVendor](api-endpoint:Vendors-UpdateVendor). diff --git a/src/api/types/UpdateVendorResponse.ts b/src/api/types/UpdateVendorResponse.ts index 6a4b62447..644dbe1c5 100644 --- a/src/api/types/UpdateVendorResponse.ts +++ b/src/api/types/UpdateVendorResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an output from a call to [UpdateVendor](api-endpoint:Vendors-UpdateVendor). diff --git a/src/api/types/UpdateWageSettingResponse.ts b/src/api/types/UpdateWageSettingResponse.ts index 0701c749e..62348f77e 100644 --- a/src/api/types/UpdateWageSettingResponse.ts +++ b/src/api/types/UpdateWageSettingResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response from an update request containing the updated `WageSetting` object diff --git a/src/api/types/UpdateWebhookSubscriptionResponse.ts b/src/api/types/UpdateWebhookSubscriptionResponse.ts index 1324668ed..c54292ac6 100644 --- a/src/api/types/UpdateWebhookSubscriptionResponse.ts +++ b/src/api/types/UpdateWebhookSubscriptionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/UpdateWebhookSubscriptionSignatureKeyResponse.ts b/src/api/types/UpdateWebhookSubscriptionSignatureKeyResponse.ts index 7ede9285a..675854985 100644 --- a/src/api/types/UpdateWebhookSubscriptionSignatureKeyResponse.ts +++ b/src/api/types/UpdateWebhookSubscriptionSignatureKeyResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/UpdateWorkweekConfigResponse.ts b/src/api/types/UpdateWorkweekConfigResponse.ts index b0f591e76..20a17afca 100644 --- a/src/api/types/UpdateWorkweekConfigResponse.ts +++ b/src/api/types/UpdateWorkweekConfigResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * The response to a request to update a `WorkweekConfig` object. The response contains diff --git a/src/api/types/UpsertBookingCustomAttributeResponse.ts b/src/api/types/UpsertBookingCustomAttributeResponse.ts index 90fbd6caf..8197bcbcb 100644 --- a/src/api/types/UpsertBookingCustomAttributeResponse.ts +++ b/src/api/types/UpsertBookingCustomAttributeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an [UpsertBookingCustomAttribute](api-endpoint:BookingCustomAttributes-UpsertBookingCustomAttribute) response. diff --git a/src/api/types/UpsertCatalogObjectResponse.ts b/src/api/types/UpsertCatalogObjectResponse.ts index deb3e3a98..8fafabd00 100644 --- a/src/api/types/UpsertCatalogObjectResponse.ts +++ b/src/api/types/UpsertCatalogObjectResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface UpsertCatalogObjectResponse { /** Any errors that occurred during the request. */ diff --git a/src/api/types/UpsertCustomerCustomAttributeResponse.ts b/src/api/types/UpsertCustomerCustomAttributeResponse.ts index e66ba0e4b..0f76c7631 100644 --- a/src/api/types/UpsertCustomerCustomAttributeResponse.ts +++ b/src/api/types/UpsertCustomerCustomAttributeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an [UpsertCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-UpsertCustomerCustomAttribute) response. diff --git a/src/api/types/UpsertLocationCustomAttributeResponse.ts b/src/api/types/UpsertLocationCustomAttributeResponse.ts index 3e52196e0..131868814 100644 --- a/src/api/types/UpsertLocationCustomAttributeResponse.ts +++ b/src/api/types/UpsertLocationCustomAttributeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an [UpsertLocationCustomAttribute](api-endpoint:LocationCustomAttributes-UpsertLocationCustomAttribute) response. diff --git a/src/api/types/UpsertMerchantCustomAttributeResponse.ts b/src/api/types/UpsertMerchantCustomAttributeResponse.ts index 49d3ca1a7..9dc89c1a8 100644 --- a/src/api/types/UpsertMerchantCustomAttributeResponse.ts +++ b/src/api/types/UpsertMerchantCustomAttributeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an [UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute) response. diff --git a/src/api/types/UpsertOrderCustomAttributeResponse.ts b/src/api/types/UpsertOrderCustomAttributeResponse.ts index 0366cf4fa..b6e8e1664 100644 --- a/src/api/types/UpsertOrderCustomAttributeResponse.ts +++ b/src/api/types/UpsertOrderCustomAttributeResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a response from upserting order custom attribute definitions. diff --git a/src/api/types/UpsertSnippetResponse.ts b/src/api/types/UpsertSnippetResponse.ts index 0e35d101d..27e12d945 100644 --- a/src/api/types/UpsertSnippetResponse.ts +++ b/src/api/types/UpsertSnippetResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents an `UpsertSnippet` response. The response can include either `snippet` or `errors`. diff --git a/src/api/types/V1GetPaymentRequest.ts b/src/api/types/V1GetPaymentRequest.ts index 461233c6c..fb4bbb8fa 100644 --- a/src/api/types/V1GetPaymentRequest.ts +++ b/src/api/types/V1GetPaymentRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type V1GetPaymentRequest = unknown; diff --git a/src/api/types/V1GetSettlementRequest.ts b/src/api/types/V1GetSettlementRequest.ts index d7417c42f..cca5a78b5 100644 --- a/src/api/types/V1GetSettlementRequest.ts +++ b/src/api/types/V1GetSettlementRequest.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type V1GetSettlementRequest = unknown; diff --git a/src/api/types/V1Money.ts b/src/api/types/V1Money.ts index cce1eddbd..3cdcdae09 100644 --- a/src/api/types/V1Money.ts +++ b/src/api/types/V1Money.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface V1Money { /** diff --git a/src/api/types/V1Order.ts b/src/api/types/V1Order.ts index b3e10b04c..106ac9982 100644 --- a/src/api/types/V1Order.ts +++ b/src/api/types/V1Order.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * V1Order diff --git a/src/api/types/V1OrderHistoryEntry.ts b/src/api/types/V1OrderHistoryEntry.ts index e9fea8e76..9781f5148 100644 --- a/src/api/types/V1OrderHistoryEntry.ts +++ b/src/api/types/V1OrderHistoryEntry.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * V1OrderHistoryEntry diff --git a/src/api/types/V1OrderHistoryEntryAction.ts b/src/api/types/V1OrderHistoryEntryAction.ts index 7d52d13ef..228dbe95f 100644 --- a/src/api/types/V1OrderHistoryEntryAction.ts +++ b/src/api/types/V1OrderHistoryEntryAction.ts @@ -1,5 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type V1OrderHistoryEntryAction = + | "ORDER_PLACED" + | "DECLINED" + | "PAYMENT_RECEIVED" + | "CANCELED" + | "COMPLETED" + | "REFUNDED" + | "EXPIRED"; export const V1OrderHistoryEntryAction = { OrderPlaced: "ORDER_PLACED", Declined: "DECLINED", @@ -9,4 +19,3 @@ export const V1OrderHistoryEntryAction = { Refunded: "REFUNDED", Expired: "EXPIRED", } as const; -export type V1OrderHistoryEntryAction = (typeof V1OrderHistoryEntryAction)[keyof typeof V1OrderHistoryEntryAction]; diff --git a/src/api/types/V1OrderState.ts b/src/api/types/V1OrderState.ts index fc40f6fa7..c11830bda 100644 --- a/src/api/types/V1OrderState.ts +++ b/src/api/types/V1OrderState.ts @@ -1,5 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type V1OrderState = "PENDING" | "OPEN" | "COMPLETED" | "CANCELED" | "REFUNDED" | "REJECTED"; export const V1OrderState = { Pending: "PENDING", Open: "OPEN", @@ -8,4 +11,3 @@ export const V1OrderState = { Refunded: "REFUNDED", Rejected: "REJECTED", } as const; -export type V1OrderState = (typeof V1OrderState)[keyof typeof V1OrderState]; diff --git a/src/api/types/V1Tender.ts b/src/api/types/V1Tender.ts index 4e0adb4cb..95e244291 100644 --- a/src/api/types/V1Tender.ts +++ b/src/api/types/V1Tender.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * A tender represents a discrete monetary exchange. Square represents this diff --git a/src/api/types/V1TenderCardBrand.ts b/src/api/types/V1TenderCardBrand.ts index 130774a03..9087fa6e3 100644 --- a/src/api/types/V1TenderCardBrand.ts +++ b/src/api/types/V1TenderCardBrand.ts @@ -1,6 +1,20 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The brand of a credit card. */ +/** + * The brand of a credit card. + */ +export type V1TenderCardBrand = + | "OTHER_BRAND" + | "VISA" + | "MASTER_CARD" + | "AMERICAN_EXPRESS" + | "DISCOVER" + | "DISCOVER_DINERS" + | "JCB" + | "CHINA_UNIONPAY" + | "SQUARE_GIFT_CARD"; export const V1TenderCardBrand = { OtherBrand: "OTHER_BRAND", Visa: "VISA", @@ -12,4 +26,3 @@ export const V1TenderCardBrand = { ChinaUnionpay: "CHINA_UNIONPAY", SquareGiftCard: "SQUARE_GIFT_CARD", } as const; -export type V1TenderCardBrand = (typeof V1TenderCardBrand)[keyof typeof V1TenderCardBrand]; diff --git a/src/api/types/V1TenderEntryMethod.ts b/src/api/types/V1TenderEntryMethod.ts index 04c0ed565..d567aee00 100644 --- a/src/api/types/V1TenderEntryMethod.ts +++ b/src/api/types/V1TenderEntryMethod.ts @@ -1,5 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type V1TenderEntryMethod = + | "MANUAL" + | "SCANNED" + | "SQUARE_CASH" + | "SQUARE_WALLET" + | "SWIPED" + | "WEB_FORM" + | "OTHER"; export const V1TenderEntryMethod = { Manual: "MANUAL", Scanned: "SCANNED", @@ -9,4 +19,3 @@ export const V1TenderEntryMethod = { WebForm: "WEB_FORM", Other: "OTHER", } as const; -export type V1TenderEntryMethod = (typeof V1TenderEntryMethod)[keyof typeof V1TenderEntryMethod]; diff --git a/src/api/types/V1TenderType.ts b/src/api/types/V1TenderType.ts index 55441a503..1f6d4569a 100644 --- a/src/api/types/V1TenderType.ts +++ b/src/api/types/V1TenderType.ts @@ -1,5 +1,16 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type V1TenderType = + | "CREDIT_CARD" + | "CASH" + | "THIRD_PARTY_CARD" + | "NO_SALE" + | "SQUARE_WALLET" + | "SQUARE_GIFT_CARD" + | "UNKNOWN" + | "OTHER"; export const V1TenderType = { CreditCard: "CREDIT_CARD", Cash: "CASH", @@ -10,4 +21,3 @@ export const V1TenderType = { Unknown: "UNKNOWN", Other: "OTHER", } as const; -export type V1TenderType = (typeof V1TenderType)[keyof typeof V1TenderType]; diff --git a/src/api/types/V1UpdateOrderRequestAction.ts b/src/api/types/V1UpdateOrderRequestAction.ts index 22e05b7d2..4b4434d3b 100644 --- a/src/api/types/V1UpdateOrderRequestAction.ts +++ b/src/api/types/V1UpdateOrderRequestAction.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type V1UpdateOrderRequestAction = "COMPLETE" | "CANCEL" | "REFUND"; export const V1UpdateOrderRequestAction = { Complete: "COMPLETE", Cancel: "CANCEL", Refund: "REFUND", } as const; -export type V1UpdateOrderRequestAction = (typeof V1UpdateOrderRequestAction)[keyof typeof V1UpdateOrderRequestAction]; diff --git a/src/api/types/Vendor.ts b/src/api/types/Vendor.ts index 9da656a37..b8b908a2a 100644 --- a/src/api/types/Vendor.ts +++ b/src/api/types/Vendor.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents a supplier to a seller. diff --git a/src/api/types/VendorContact.ts b/src/api/types/VendorContact.ts index 299b11528..e965078c5 100644 --- a/src/api/types/VendorContact.ts +++ b/src/api/types/VendorContact.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents a contact of a [Vendor](entity:Vendor). diff --git a/src/api/types/VendorCreatedEvent.ts b/src/api/types/VendorCreatedEvent.ts index e5f145959..640126d7b 100644 --- a/src/api/types/VendorCreatedEvent.ts +++ b/src/api/types/VendorCreatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [Vendor](entity:Vendor) is created. diff --git a/src/api/types/VendorCreatedEventData.ts b/src/api/types/VendorCreatedEventData.ts index b891a586e..da0989ecc 100644 --- a/src/api/types/VendorCreatedEventData.ts +++ b/src/api/types/VendorCreatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the `vendor.created` event data structure. diff --git a/src/api/types/VendorCreatedEventObject.ts b/src/api/types/VendorCreatedEventObject.ts index 146397e0e..67c918471 100644 --- a/src/api/types/VendorCreatedEventObject.ts +++ b/src/api/types/VendorCreatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface VendorCreatedEventObject { /** diff --git a/src/api/types/VendorCreatedEventObjectOperation.ts b/src/api/types/VendorCreatedEventObjectOperation.ts index e13b6caef..03a3e2265 100644 --- a/src/api/types/VendorCreatedEventObjectOperation.ts +++ b/src/api/types/VendorCreatedEventObjectOperation.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The operation that can be performed against a vendor to cause the event to be published. diff --git a/src/api/types/VendorStatus.ts b/src/api/types/VendorStatus.ts index 2d825af59..dc11fc135 100644 --- a/src/api/types/VendorStatus.ts +++ b/src/api/types/VendorStatus.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The status of the [Vendor](entity:Vendor), * whether a [Vendor](entity:Vendor) is active or inactive. */ +export type VendorStatus = "ACTIVE" | "INACTIVE"; export const VendorStatus = { Active: "ACTIVE", Inactive: "INACTIVE", } as const; -export type VendorStatus = (typeof VendorStatus)[keyof typeof VendorStatus]; diff --git a/src/api/types/VendorUpdatedEvent.ts b/src/api/types/VendorUpdatedEvent.ts index 4abe2c4db..1afc531b4 100644 --- a/src/api/types/VendorUpdatedEvent.ts +++ b/src/api/types/VendorUpdatedEvent.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Published when a [Vendor](entity:Vendor) is updated. diff --git a/src/api/types/VendorUpdatedEventData.ts b/src/api/types/VendorUpdatedEventData.ts index b34fd4df3..fd4562112 100644 --- a/src/api/types/VendorUpdatedEventData.ts +++ b/src/api/types/VendorUpdatedEventData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the `vendor.updated` event data structure. diff --git a/src/api/types/VendorUpdatedEventObject.ts b/src/api/types/VendorUpdatedEventObject.ts index b30060fbb..21f421374 100644 --- a/src/api/types/VendorUpdatedEventObject.ts +++ b/src/api/types/VendorUpdatedEventObject.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; export interface VendorUpdatedEventObject { /** diff --git a/src/api/types/VendorUpdatedEventObjectOperation.ts b/src/api/types/VendorUpdatedEventObjectOperation.ts index 7ceef20b5..58abba863 100644 --- a/src/api/types/VendorUpdatedEventObjectOperation.ts +++ b/src/api/types/VendorUpdatedEventObjectOperation.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The operation that can be performed against a vendor to cause the event to be published. diff --git a/src/api/types/VisibilityFilter.ts b/src/api/types/VisibilityFilter.ts index 5fe2bcff2..7660e6b1c 100644 --- a/src/api/types/VisibilityFilter.ts +++ b/src/api/types/VisibilityFilter.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Enumeration of visibility-filter values used to set the ability to view custom attributes or custom attribute definitions. */ +/** + * Enumeration of visibility-filter values used to set the ability to view custom attributes or custom attribute definitions. + */ +export type VisibilityFilter = "ALL" | "READ" | "READ_WRITE"; export const VisibilityFilter = { All: "ALL", Read: "READ", ReadWrite: "READ_WRITE", } as const; -export type VisibilityFilter = (typeof VisibilityFilter)[keyof typeof VisibilityFilter]; diff --git a/src/api/types/VoidTransactionResponse.ts b/src/api/types/VoidTransactionResponse.ts index d9f520d09..ad3847dbb 100644 --- a/src/api/types/VoidTransactionResponse.ts +++ b/src/api/types/VoidTransactionResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Defines the fields that are included in the response body of diff --git a/src/api/types/WageSetting.ts b/src/api/types/WageSetting.ts index ada6d6d6a..eb4401a99 100644 --- a/src/api/types/WageSetting.ts +++ b/src/api/types/WageSetting.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Represents information about the overtime exemption status, job assignments, and compensation diff --git a/src/api/types/WebhookSubscription.ts b/src/api/types/WebhookSubscription.ts index e84811873..5691d95e2 100644 --- a/src/api/types/WebhookSubscription.ts +++ b/src/api/types/WebhookSubscription.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents the details of a webhook subscription, including notification URL, diff --git a/src/api/types/Weekday.ts b/src/api/types/Weekday.ts index 7ea611f8e..f944a12bf 100644 --- a/src/api/types/Weekday.ts +++ b/src/api/types/Weekday.ts @@ -1,6 +1,11 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The days of the week. */ +/** + * The days of the week. + */ +export type Weekday = "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT" | "SUN"; export const Weekday = { Mon: "MON", Tue: "TUE", @@ -10,4 +15,3 @@ export const Weekday = { Sat: "SAT", Sun: "SUN", } as const; -export type Weekday = (typeof Weekday)[keyof typeof Weekday]; diff --git a/src/api/types/WorkweekConfig.ts b/src/api/types/WorkweekConfig.ts index ddf3003c5..5d26dd907 100644 --- a/src/api/types/WorkweekConfig.ts +++ b/src/api/types/WorkweekConfig.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../index"; +import * as Square from "../index"; /** * Sets the day of the week and hour of the day that a business starts a diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 7b318b1af..38e2271b2 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -1,7 +1,7 @@ +export * from "./AchDetails"; export * from "./AcceptDisputeResponse"; export * from "./AcceptedPaymentMethods"; export * from "./AccumulateLoyaltyPointsResponse"; -export * from "./AchDetails"; export * from "./ActionCancelReason"; export * from "./ActivityType"; export * from "./AddGroupToCustomerResponse"; @@ -30,22 +30,14 @@ export * from "./BankAccountVerifiedEventData"; export * from "./BankAccountVerifiedEventObject"; export * from "./BatchChangeInventoryRequest"; export * from "./BatchChangeInventoryResponse"; -export * from "./BatchCreateTeamMembersResponse"; -export * from "./BatchCreateVendorsResponse"; export * from "./BatchDeleteCatalogObjectsResponse"; export * from "./BatchGetCatalogObjectsResponse"; +export * from "./BatchRetrieveInventoryChangesRequest"; export * from "./BatchGetInventoryChangesResponse"; export * from "./BatchGetInventoryCountsRequest"; export * from "./BatchGetInventoryCountsResponse"; export * from "./BatchGetOrdersResponse"; -export * from "./BatchGetVendorsResponse"; -export * from "./BatchRetrieveInventoryChangesRequest"; -export * from "./BatchUpdateTeamMembersResponse"; -export * from "./BatchUpdateVendorsResponse"; export * from "./BatchUpsertCatalogObjectsResponse"; -export * from "./BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest"; -export * from "./BatchUpsertCustomerCustomAttributesResponse"; -export * from "./BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse"; export * from "./Booking"; export * from "./BookingBookingSource"; export * from "./BookingCreatedEvent"; @@ -75,6 +67,8 @@ export * from "./Break"; export * from "./BreakType"; export * from "./BulkCreateCustomerData"; export * from "./BulkCreateCustomersResponse"; +export * from "./BatchCreateTeamMembersResponse"; +export * from "./BatchCreateVendorsResponse"; export * from "./BulkDeleteBookingCustomAttributesResponse"; export * from "./BulkDeleteCustomersResponse"; export * from "./BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest"; @@ -88,14 +82,18 @@ export * from "./BulkDeleteOrderCustomAttributesResponse"; export * from "./BulkPublishScheduledShiftsData"; export * from "./BulkPublishScheduledShiftsResponse"; export * from "./BulkRetrieveBookingsResponse"; -export * from "./BulkRetrieveChannelsRequestConstants"; -export * from "./BulkRetrieveChannelsResponse"; export * from "./BulkRetrieveCustomersResponse"; export * from "./BulkRetrieveTeamMemberBookingProfilesResponse"; +export * from "./BatchGetVendorsResponse"; export * from "./BulkSwapPlanResponse"; export * from "./BulkUpdateCustomerData"; export * from "./BulkUpdateCustomersResponse"; +export * from "./BatchUpdateTeamMembersResponse"; +export * from "./BatchUpdateVendorsResponse"; export * from "./BulkUpsertBookingCustomAttributesResponse"; +export * from "./BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest"; +export * from "./BatchUpsertCustomerCustomAttributesResponse"; +export * from "./BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse"; export * from "./BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest"; export * from "./BulkUpsertLocationCustomAttributesResponse"; export * from "./BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse"; @@ -126,7 +124,6 @@ export * from "./CancelSubscriptionResponse"; export * from "./CancelTerminalActionResponse"; export * from "./CancelTerminalCheckoutResponse"; export * from "./CancelTerminalRefundResponse"; -export * from "./CancelTransferOrderResponse"; export * from "./CaptureTransactionResponse"; export * from "./Card"; export * from "./CardAutomaticallyUpdatedEvent"; @@ -201,47 +198,28 @@ export * from "./CatalogModifierListModifierType"; export * from "./CatalogModifierListSelectionType"; export * from "./CatalogModifierOverride"; export * from "./CatalogObject"; -export * from "./CatalogObjectAvailabilityPeriod"; -export * from "./CatalogObjectBase"; export * from "./CatalogObjectBatch"; export * from "./CatalogObjectCategory"; -export * from "./CatalogObjectCustomAttributeDefinition"; -export * from "./CatalogObjectDiscount"; -export * from "./CatalogObjectImage"; -export * from "./CatalogObjectItem"; -export * from "./CatalogObjectItemOption"; -export * from "./CatalogObjectItemOptionValue"; -export * from "./CatalogObjectItemVariation"; -export * from "./CatalogObjectMeasurementUnit"; -export * from "./CatalogObjectModifier"; -export * from "./CatalogObjectModifierList"; -export * from "./CatalogObjectPricingRule"; -export * from "./CatalogObjectProductSet"; -export * from "./CatalogObjectQuickAmountsSettings"; export * from "./CatalogObjectReference"; -export * from "./CatalogObjectSubscriptionPlan"; -export * from "./CatalogObjectSubscriptionPlanVariation"; -export * from "./CatalogObjectTax"; -export * from "./CatalogObjectTimePeriod"; export * from "./CatalogObjectType"; export * from "./CatalogPricingRule"; export * from "./CatalogPricingType"; export * from "./CatalogProductSet"; export * from "./CatalogQuery"; export * from "./CatalogQueryExact"; +export * from "./CatalogQueryItemVariationsForItemOptionValues"; export * from "./CatalogQueryItemsForItemOptions"; export * from "./CatalogQueryItemsForModifierList"; export * from "./CatalogQueryItemsForTax"; -export * from "./CatalogQueryItemVariationsForItemOptionValues"; export * from "./CatalogQueryPrefix"; export * from "./CatalogQueryRange"; export * from "./CatalogQuerySet"; export * from "./CatalogQuerySortedAttribute"; export * from "./CatalogQueryText"; export * from "./CatalogQuickAmount"; +export * from "./CatalogQuickAmountType"; export * from "./CatalogQuickAmountsSettings"; export * from "./CatalogQuickAmountsSettingsOption"; -export * from "./CatalogQuickAmountType"; export * from "./CatalogStockConversion"; export * from "./CatalogSubscriptionPlan"; export * from "./CatalogSubscriptionPlanVariation"; @@ -255,8 +233,6 @@ export * from "./CatalogVersionUpdatedEventObject"; export * from "./CategoryPathToRootNode"; export * from "./ChangeBillingAnchorDateResponse"; export * from "./ChangeTiming"; -export * from "./Channel"; -export * from "./ChannelStatus"; export * from "./ChargeRequestAdditionalRecipient"; export * from "./Checkout"; export * from "./CheckoutLocationSettings"; @@ -325,9 +301,6 @@ export * from "./CreateTerminalActionResponse"; export * from "./CreateTerminalCheckoutResponse"; export * from "./CreateTerminalRefundResponse"; export * from "./CreateTimecardResponse"; -export * from "./CreateTransferOrderData"; -export * from "./CreateTransferOrderLineData"; -export * from "./CreateTransferOrderResponse"; export * from "./CreateVendorResponse"; export * from "./CreateWebhookSubscriptionResponse"; export * from "./Currency"; @@ -339,6 +312,7 @@ export * from "./CustomAttributeDefinitionVisibility"; export * from "./CustomAttributeEventData"; export * from "./CustomAttributeEventDataObject"; export * from "./CustomAttributeFilter"; +export * from "./CustomField"; export * from "./Customer"; export * from "./CustomerAddressFilter"; export * from "./CustomerCreatedEvent"; @@ -363,8 +337,8 @@ export * from "./CustomerCustomAttributeDefinitionVisibleUpdatedEvent"; export * from "./CustomerCustomAttributeDeletedEvent"; export * from "./CustomerCustomAttributeDeletedPublicEvent"; export * from "./CustomerCustomAttributeFilter"; -export * from "./CustomerCustomAttributeFilters"; export * from "./CustomerCustomAttributeFilterValue"; +export * from "./CustomerCustomAttributeFilters"; export * from "./CustomerCustomAttributeOwnedDeletedEvent"; export * from "./CustomerCustomAttributeOwnedUpdatedEvent"; export * from "./CustomerCustomAttributeUpdatedEvent"; @@ -390,7 +364,6 @@ export * from "./CustomerTextFilter"; export * from "./CustomerUpdatedEvent"; export * from "./CustomerUpdatedEventData"; export * from "./CustomerUpdatedEventObject"; -export * from "./CustomField"; export * from "./DataCollectionOptions"; export * from "./DataCollectionOptionsInputType"; export * from "./DateRange"; @@ -419,7 +392,6 @@ export * from "./DeleteShiftResponse"; export * from "./DeleteSnippetResponse"; export * from "./DeleteSubscriptionActionResponse"; export * from "./DeleteTimecardResponse"; -export * from "./DeleteTransferOrderResponse"; export * from "./DeleteWebhookSubscriptionResponse"; export * from "./Destination"; export * from "./DestinationDetails"; @@ -460,7 +432,6 @@ export * from "./Dispute"; export * from "./DisputeCreatedEvent"; export * from "./DisputeCreatedEventData"; export * from "./DisputeCreatedEventObject"; -export * from "./DisputedPayment"; export * from "./DisputeEvidence"; export * from "./DisputeEvidenceAddedEvent"; export * from "./DisputeEvidenceAddedEventData"; @@ -484,6 +455,7 @@ export * from "./DisputeStateChangedEventObject"; export * from "./DisputeStateUpdatedEvent"; export * from "./DisputeStateUpdatedEventData"; export * from "./DisputeStateUpdatedEventObject"; +export * from "./DisputedPayment"; export * from "./EcomVisibility"; export * from "./Employee"; export * from "./EmployeeStatus"; @@ -514,84 +486,19 @@ export * from "./FulfillmentState"; export * from "./FulfillmentType"; export * from "./GetBankAccountByV1IdResponse"; export * from "./GetBankAccountResponse"; -export * from "./GetBookingRequest"; -export * from "./GetBookingResponse"; export * from "./GetBreakTypeResponse"; -export * from "./GetBusinessBookingProfileRequest"; -export * from "./GetBusinessBookingProfileResponse"; -export * from "./GetCardRequest"; -export * from "./GetCardResponse"; -export * from "./GetCashDrawerShiftResponse"; -export * from "./GetCatalogObjectResponse"; -export * from "./GetCustomerCustomAttributeDefinitionResponse"; -export * from "./GetCustomerCustomAttributeResponse"; -export * from "./GetCustomerGroupRequest"; -export * from "./GetCustomerGroupResponse"; -export * from "./GetCustomerRequest"; -export * from "./GetCustomerResponse"; -export * from "./GetCustomerSegmentRequest"; -export * from "./GetCustomerSegmentResponse"; export * from "./GetDeviceCodeResponse"; export * from "./GetDeviceResponse"; -export * from "./GetDisputeEvidenceRequest"; -export * from "./GetDisputeEvidenceResponse"; -export * from "./GetDisputeRequest"; -export * from "./GetDisputeResponse"; -export * from "./GetEmployeeRequest"; -export * from "./GetEmployeeResponse"; export * from "./GetEmployeeWageResponse"; -export * from "./GetGiftCardFromGanResponse"; -export * from "./GetGiftCardFromNonceResponse"; -export * from "./GetGiftCardRequest"; -export * from "./GetGiftCardResponse"; -export * from "./GetInventoryAdjustmentRequest"; -export * from "./GetInventoryAdjustmentResponse"; -export * from "./GetInventoryChangesResponse"; -export * from "./GetInventoryCountResponse"; -export * from "./GetInventoryPhysicalCountRequest"; -export * from "./GetInventoryPhysicalCountResponse"; -export * from "./GetInventoryTransferRequest"; -export * from "./GetInventoryTransferResponse"; export * from "./GetInvoiceResponse"; -export * from "./GetLocationRequest"; -export * from "./GetLocationResponse"; -export * from "./GetLoyaltyAccountRequest"; -export * from "./GetLoyaltyAccountResponse"; -export * from "./GetLoyaltyProgramRequest"; -export * from "./GetLoyaltyProgramResponse"; -export * from "./GetLoyaltyPromotionRequest"; -export * from "./GetLoyaltyPromotionResponse"; -export * from "./GetLoyaltyRewardRequest"; -export * from "./GetLoyaltyRewardResponse"; -export * from "./GetMerchantRequest"; -export * from "./GetMerchantResponse"; -export * from "./GetOrderRequest"; -export * from "./GetOrderResponse"; -export * from "./GetPaymentLinkRequest"; -export * from "./GetPaymentLinkResponse"; export * from "./GetPaymentRefundResponse"; export * from "./GetPaymentResponse"; export * from "./GetPayoutResponse"; export * from "./GetShiftResponse"; -export * from "./GetSnippetRequest"; -export * from "./GetSnippetResponse"; -export * from "./GetSubscriptionResponse"; -export * from "./GetTeamMemberBookingProfileRequest"; -export * from "./GetTeamMemberBookingProfileResponse"; -export * from "./GetTeamMemberRequest"; -export * from "./GetTeamMemberResponse"; export * from "./GetTeamMemberWageResponse"; export * from "./GetTerminalActionResponse"; export * from "./GetTerminalCheckoutResponse"; export * from "./GetTerminalRefundResponse"; -export * from "./GetTransactionRequest"; -export * from "./GetTransactionResponse"; -export * from "./GetVendorRequest"; -export * from "./GetVendorResponse"; -export * from "./GetWageSettingRequest"; -export * from "./GetWageSettingResponse"; -export * from "./GetWebhookSubscriptionRequest"; -export * from "./GetWebhookSubscriptionResponse"; export * from "./GiftCard"; export * from "./GiftCardActivity"; export * from "./GiftCardActivityActivate"; @@ -739,8 +646,6 @@ export * from "./ListCardsResponse"; export * from "./ListCashDrawerShiftEventsResponse"; export * from "./ListCashDrawerShiftsResponse"; export * from "./ListCatalogResponse"; -export * from "./ListChannelsRequestConstants"; -export * from "./ListChannelsResponse"; export * from "./ListCustomerCustomAttributeDefinitionsResponse"; export * from "./ListCustomerCustomAttributesResponse"; export * from "./ListCustomerGroupsResponse"; @@ -750,8 +655,8 @@ export * from "./ListDeviceCodesResponse"; export * from "./ListDevicesResponse"; export * from "./ListDisputeEvidenceResponse"; export * from "./ListDisputesResponse"; -export * from "./ListEmployeesResponse"; export * from "./ListEmployeeWagesResponse"; +export * from "./ListEmployeesResponse"; export * from "./ListEventTypesResponse"; export * from "./ListGiftCardActivitiesResponse"; export * from "./ListGiftCardsResponse"; @@ -822,10 +727,10 @@ export * from "./LoyaltyEvent"; export * from "./LoyaltyEventAccumulatePoints"; export * from "./LoyaltyEventAccumulatePromotionPoints"; export * from "./LoyaltyEventAdjustPoints"; +export * from "./LoyaltyEventCreateReward"; export * from "./LoyaltyEventCreatedEvent"; export * from "./LoyaltyEventCreatedEventData"; export * from "./LoyaltyEventCreatedEventObject"; -export * from "./LoyaltyEventCreateReward"; export * from "./LoyaltyEventDateTimeFilter"; export * from "./LoyaltyEventDeleteReward"; export * from "./LoyaltyEventExpirePoints"; @@ -972,6 +877,7 @@ export * from "./OrderUpdatedEvent"; export * from "./OrderUpdatedEventData"; export * from "./OrderUpdatedObject"; export * from "./PauseSubscriptionResponse"; +export * from "./PayOrderResponse"; export * from "./Payment"; export * from "./PaymentBalanceActivityAppFeeRefundDetail"; export * from "./PaymentBalanceActivityAppFeeRevenueDetail"; @@ -1009,7 +915,6 @@ export * from "./PaymentRefund"; export * from "./PaymentUpdatedEvent"; export * from "./PaymentUpdatedEventData"; export * from "./PaymentUpdatedEventObject"; -export * from "./PayOrderResponse"; export * from "./Payout"; export * from "./PayoutEntry"; export * from "./PayoutFailedEvent"; @@ -1037,10 +942,7 @@ export * from "./QrCodeOptions"; export * from "./QuickPay"; export * from "./Range"; export * from "./ReceiptOptions"; -export * from "./ReceiveTransferOrderResponse"; export * from "./RedeemLoyaltyRewardResponse"; -export * from "./Reference"; -export * from "./ReferenceType"; export * from "./Refund"; export * from "./RefundCreatedEvent"; export * from "./RefundCreatedEventData"; @@ -1056,21 +958,56 @@ export * from "./RemoveGroupFromCustomerResponse"; export * from "./ResumeSubscriptionResponse"; export * from "./RetrieveBookingCustomAttributeDefinitionResponse"; export * from "./RetrieveBookingCustomAttributeResponse"; -export * from "./RetrieveChannelResponse"; +export * from "./GetBookingResponse"; +export * from "./GetBusinessBookingProfileResponse"; +export * from "./GetCardResponse"; +export * from "./GetCashDrawerShiftResponse"; +export * from "./GetCatalogObjectResponse"; +export * from "./GetCustomerCustomAttributeDefinitionResponse"; +export * from "./GetCustomerCustomAttributeResponse"; +export * from "./GetCustomerGroupResponse"; +export * from "./GetCustomerResponse"; +export * from "./GetCustomerSegmentResponse"; +export * from "./GetDisputeEvidenceResponse"; +export * from "./GetDisputeResponse"; +export * from "./GetEmployeeResponse"; +export * from "./GetGiftCardFromGanResponse"; +export * from "./GetGiftCardFromNonceResponse"; +export * from "./GetGiftCardResponse"; +export * from "./GetInventoryAdjustmentResponse"; +export * from "./GetInventoryChangesResponse"; +export * from "./GetInventoryCountResponse"; +export * from "./GetInventoryPhysicalCountResponse"; +export * from "./GetInventoryTransferResponse"; export * from "./RetrieveJobResponse"; export * from "./RetrieveLocationBookingProfileResponse"; export * from "./RetrieveLocationCustomAttributeDefinitionResponse"; export * from "./RetrieveLocationCustomAttributeResponse"; +export * from "./GetLocationResponse"; export * from "./RetrieveLocationSettingsResponse"; +export * from "./GetLoyaltyAccountResponse"; +export * from "./GetLoyaltyProgramResponse"; +export * from "./GetLoyaltyPromotionResponse"; +export * from "./GetLoyaltyRewardResponse"; export * from "./RetrieveMerchantCustomAttributeDefinitionResponse"; export * from "./RetrieveMerchantCustomAttributeResponse"; +export * from "./GetMerchantResponse"; export * from "./RetrieveMerchantSettingsResponse"; export * from "./RetrieveOrderCustomAttributeDefinitionResponse"; export * from "./RetrieveOrderCustomAttributeResponse"; +export * from "./GetOrderResponse"; +export * from "./GetPaymentLinkResponse"; export * from "./RetrieveScheduledShiftResponse"; +export * from "./GetSnippetResponse"; +export * from "./GetSubscriptionResponse"; +export * from "./GetTeamMemberBookingProfileResponse"; +export * from "./GetTeamMemberResponse"; export * from "./RetrieveTimecardResponse"; export * from "./RetrieveTokenStatusResponse"; -export * from "./RetrieveTransferOrderResponse"; +export * from "./GetTransactionResponse"; +export * from "./GetVendorResponse"; +export * from "./GetWageSettingResponse"; +export * from "./GetWebhookSubscriptionResponse"; export * from "./RevokeTokenResponse"; export * from "./RiskEvaluation"; export * from "./RiskEvaluationRiskLevel"; @@ -1126,7 +1063,6 @@ export * from "./SearchTerminalActionsResponse"; export * from "./SearchTerminalCheckoutsResponse"; export * from "./SearchTerminalRefundsResponse"; export * from "./SearchTimecardsResponse"; -export * from "./SearchTransferOrdersResponse"; export * from "./SearchVendorsRequestFilter"; export * from "./SearchVendorsRequestSort"; export * from "./SearchVendorsRequestSortField"; @@ -1154,7 +1090,6 @@ export * from "./SourceApplication"; export * from "./SquareAccountDetails"; export * from "./StandardUnitDescription"; export * from "./StandardUnitDescriptionGroup"; -export * from "./StartTransferOrderResponse"; export * from "./SubmitEvidenceResponse"; export * from "./Subscription"; export * from "./SubscriptionAction"; @@ -1241,6 +1176,7 @@ export * from "./TerminalRefundUpdatedEvent"; export * from "./TerminalRefundUpdatedEventData"; export * from "./TerminalRefundUpdatedEventObject"; export * from "./TestWebhookSubscriptionResponse"; +export * from "./TimeRange"; export * from "./Timecard"; export * from "./TimecardFilter"; export * from "./TimecardFilterStatus"; @@ -1251,28 +1187,10 @@ export * from "./TimecardStatus"; export * from "./TimecardWage"; export * from "./TimecardWorkday"; export * from "./TimecardWorkdayMatcher"; -export * from "./TimeRange"; export * from "./TipSettings"; export * from "./Transaction"; export * from "./TransactionProduct"; export * from "./TransactionType"; -export * from "./TransferOrder"; -export * from "./TransferOrderCreatedEvent"; -export * from "./TransferOrderCreatedEventData"; -export * from "./TransferOrderCreatedEventObject"; -export * from "./TransferOrderDeletedEvent"; -export * from "./TransferOrderDeletedEventData"; -export * from "./TransferOrderFilter"; -export * from "./TransferOrderGoodsReceipt"; -export * from "./TransferOrderGoodsReceiptLineItem"; -export * from "./TransferOrderLine"; -export * from "./TransferOrderQuery"; -export * from "./TransferOrderSort"; -export * from "./TransferOrderSortField"; -export * from "./TransferOrderStatus"; -export * from "./TransferOrderUpdatedEvent"; -export * from "./TransferOrderUpdatedEventData"; -export * from "./TransferOrderUpdatedEventObject"; export * from "./UnlinkCustomerFromGiftCardResponse"; export * from "./UpdateBookingCustomAttributeDefinitionResponse"; export * from "./UpdateBookingResponse"; @@ -1301,9 +1219,6 @@ export * from "./UpdateSubscriptionResponse"; export * from "./UpdateTeamMemberRequest"; export * from "./UpdateTeamMemberResponse"; export * from "./UpdateTimecardResponse"; -export * from "./UpdateTransferOrderData"; -export * from "./UpdateTransferOrderLineData"; -export * from "./UpdateTransferOrderResponse"; export * from "./UpdateVendorRequest"; export * from "./UpdateVendorResponse"; export * from "./UpdateWageSettingResponse"; @@ -1317,8 +1232,6 @@ export * from "./UpsertLocationCustomAttributeResponse"; export * from "./UpsertMerchantCustomAttributeResponse"; export * from "./UpsertOrderCustomAttributeResponse"; export * from "./UpsertSnippetResponse"; -export * from "./V1GetPaymentRequest"; -export * from "./V1GetSettlementRequest"; export * from "./V1Money"; export * from "./V1Order"; export * from "./V1OrderHistoryEntry"; @@ -1346,3 +1259,52 @@ export * from "./WageSetting"; export * from "./WebhookSubscription"; export * from "./Weekday"; export * from "./WorkweekConfig"; +export * from "./CatalogObjectBase"; +export * from "./CatalogObjectItem"; +export * from "./CatalogObjectImage"; +export * from "./CatalogObjectItemVariation"; +export * from "./CatalogObjectTax"; +export * from "./CatalogObjectDiscount"; +export * from "./CatalogObjectModifierList"; +export * from "./CatalogObjectModifier"; +export * from "./CatalogObjectPricingRule"; +export * from "./CatalogObjectProductSet"; +export * from "./CatalogObjectTimePeriod"; +export * from "./CatalogObjectMeasurementUnit"; +export * from "./CatalogObjectSubscriptionPlanVariation"; +export * from "./CatalogObjectItemOption"; +export * from "./CatalogObjectItemOptionValue"; +export * from "./CatalogObjectCustomAttributeDefinition"; +export * from "./CatalogObjectQuickAmountsSettings"; +export * from "./CatalogObjectSubscriptionPlan"; +export * from "./CatalogObjectAvailabilityPeriod"; +export * from "./GetLoyaltyAccountRequest"; +export * from "./GetLoyaltyProgramRequest"; +export * from "./GetLoyaltyPromotionRequest"; +export * from "./GetLoyaltyRewardRequest"; +export * from "./GetCardRequest"; +export * from "./GetDisputeEvidenceRequest"; +export * from "./GetDisputeRequest"; +export * from "./V1GetPaymentRequest"; +export * from "./V1GetSettlementRequest"; +export * from "./GetCustomerGroupRequest"; +export * from "./GetCustomerRequest"; +export * from "./GetCustomerSegmentRequest"; +export * from "./GetTransactionRequest"; +export * from "./GetBookingRequest"; +export * from "./GetBusinessBookingProfileRequest"; +export * from "./GetTeamMemberBookingProfileRequest"; +export * from "./GetSnippetRequest"; +export * from "./GetInventoryAdjustmentRequest"; +export * from "./GetInventoryPhysicalCountRequest"; +export * from "./GetInventoryTransferRequest"; +export * from "./GetVendorRequest"; +export * from "./GetPaymentLinkRequest"; +export * from "./GetGiftCardRequest"; +export * from "./GetOrderRequest"; +export * from "./GetEmployeeRequest"; +export * from "./GetLocationRequest"; +export * from "./GetMerchantRequest"; +export * from "./GetTeamMemberRequest"; +export * from "./GetWageSettingRequest"; +export * from "./GetWebhookSubscriptionRequest"; diff --git a/src/core/auth/AuthProvider.ts b/src/core/auth/AuthProvider.ts deleted file mode 100644 index ed076ec5d..000000000 --- a/src/core/auth/AuthProvider.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { AuthRequest } from "./AuthRequest"; - -export interface AuthProvider { - getAuthRequest(): Promise; -} diff --git a/src/core/auth/AuthRequest.ts b/src/core/auth/AuthRequest.ts deleted file mode 100644 index f6218b422..000000000 --- a/src/core/auth/AuthRequest.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Request parameters for authentication requests. - */ -export interface AuthRequest { - /** - * The headers to be included in the request. - */ - headers: Record; -} diff --git a/src/core/auth/BasicAuth.ts b/src/core/auth/BasicAuth.ts index c6efa5e26..89a3dadae 100644 --- a/src/core/auth/BasicAuth.ts +++ b/src/core/auth/BasicAuth.ts @@ -18,8 +18,7 @@ export const BasicAuth = { fromAuthorizationHeader: (header: string): BasicAuth => { const credentials = header.replace(BASIC_AUTH_HEADER_PREFIX, ""); const decoded = base64Decode(credentials); - const [username, ...passwordParts] = decoded.split(":"); - const password = passwordParts.length > 0 ? passwordParts.join(":") : undefined; + const [username, password] = decoded.split(":", 2); if (username == null || password == null) { throw new Error("Invalid basic auth"); diff --git a/src/core/auth/index.ts b/src/core/auth/index.ts index c7786e5ba..ee293b343 100644 --- a/src/core/auth/index.ts +++ b/src/core/auth/index.ts @@ -1,4 +1,2 @@ -export type { AuthProvider } from "./AuthProvider"; -export type { AuthRequest } from "./AuthRequest"; export { BasicAuth } from "./BasicAuth"; export { BearerToken } from "./BearerToken"; diff --git a/src/core/exports.ts b/src/core/exports.ts deleted file mode 100644 index ae24c487b..000000000 --- a/src/core/exports.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./file/exports"; -export * from "./logging/exports"; -export * from "./pagination/exports"; diff --git a/src/core/fetcher/APIResponse.ts b/src/core/fetcher/APIResponse.ts index b703b0a4b..6335291bb 100644 --- a/src/core/fetcher/APIResponse.ts +++ b/src/core/fetcher/APIResponse.ts @@ -1,4 +1,4 @@ -import type { RawResponse } from "./RawResponse"; +import { RawResponse } from "./RawResponse"; /** * The response of an API call. diff --git a/src/core/fetcher/BinaryResponse.ts b/src/core/fetcher/BinaryResponse.ts index 79ab71923..614cb59b1 100644 --- a/src/core/fetcher/BinaryResponse.ts +++ b/src/core/fetcher/BinaryResponse.ts @@ -1,4 +1,4 @@ -import type { ResponseWithBody } from "./ResponseWithBody"; +import { ResponseWithBody } from "./ResponseWithBody.js"; export type BinaryResponse = { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */ diff --git a/src/core/fetcher/EndpointMetadata.ts b/src/core/fetcher/EndpointMetadata.ts deleted file mode 100644 index 998d68f5c..000000000 --- a/src/core/fetcher/EndpointMetadata.ts +++ /dev/null @@ -1,13 +0,0 @@ -export type SecuritySchemeKey = string; -/** - * A collection of security schemes, where the key is the name of the security scheme and the value is the list of scopes required for that scheme. - * All schemes in the collection must be satisfied for authentication to be successful. - */ -export type SecuritySchemeCollection = Record; -export type AuthScope = string; -export type EndpointMetadata = { - /** - * An array of security scheme collections. Each collection represents an alternative way to authenticate. - */ - security?: SecuritySchemeCollection[]; -}; diff --git a/src/core/fetcher/EndpointSupplier.ts b/src/core/fetcher/EndpointSupplier.ts deleted file mode 100644 index f4a997838..000000000 --- a/src/core/fetcher/EndpointSupplier.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { EndpointMetadata } from "./EndpointMetadata"; -import type { Supplier } from "./Supplier"; - -type EndpointSupplierFn = (arg: { endpointMetadata: EndpointMetadata }) => T | Promise; -export type EndpointSupplier = Supplier | EndpointSupplierFn; -export const EndpointSupplier = { - get: async (supplier: EndpointSupplier, arg: { endpointMetadata: EndpointMetadata }): Promise => { - if (typeof supplier === "function") { - return (supplier as EndpointSupplierFn)(arg); - } else { - return supplier; - } - }, -}; diff --git a/src/core/fetcher/Fetcher.ts b/src/core/fetcher/Fetcher.ts index d6cb76c95..88347cfbd 100644 --- a/src/core/fetcher/Fetcher.ts +++ b/src/core/fetcher/Fetcher.ts @@ -1,16 +1,13 @@ import { toJson } from "../json"; -import { createLogger, type LogConfig, type Logger } from "../logging/logger"; -import type { APIResponse } from "./APIResponse"; +import { APIResponse } from "./APIResponse"; +import { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse"; +import { Supplier } from "./Supplier"; import { createRequestUrl } from "./createRequestUrl"; -import type { EndpointMetadata } from "./EndpointMetadata"; -import { EndpointSupplier } from "./EndpointSupplier"; import { getErrorResponseBody } from "./getErrorResponseBody"; import { getFetchFn } from "./getFetchFn"; import { getRequestBody } from "./getRequestBody"; import { getResponseBody } from "./getResponseBody"; -import { Headers } from "./Headers"; import { makeRequest } from "./makeRequest"; -import { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse"; import { requestWithRetries } from "./requestWithRetries"; export type FetchFunction = (args: Fetcher.Args) => Promise>; @@ -20,19 +17,16 @@ export declare namespace Fetcher { url: string; method: string; contentType?: string; - headers?: Record | null | undefined>; - queryParameters?: Record; + headers?: Record | undefined>; + queryParameters?: Record; body?: unknown; timeoutMs?: number; maxRetries?: number; withCredentials?: boolean; abortSignal?: AbortSignal; - requestType?: "json" | "file" | "bytes" | "form" | "other"; + requestType?: "json" | "file" | "bytes"; responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer" | "binary-response"; duplex?: "half"; - endpointMetadata?: EndpointMetadata; - fetchFn?: typeof fetch; - logging?: LogConfig | Logger; } export type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError; @@ -59,164 +53,10 @@ export declare namespace Fetcher { } } -const SENSITIVE_HEADERS = new Set([ - "authorization", - "www-authenticate", - "x-api-key", - "api-key", - "apikey", - "x-api-token", - "x-auth-token", - "auth-token", - "cookie", - "set-cookie", - "proxy-authorization", - "proxy-authenticate", - "x-csrf-token", - "x-xsrf-token", - "x-session-token", - "x-access-token", -]); - -function redactHeaders(headers: Headers | Record): Record { - const filtered: Record = {}; - for (const [key, value] of headers instanceof Headers ? headers.entries() : Object.entries(headers)) { - if (SENSITIVE_HEADERS.has(key.toLowerCase())) { - filtered[key] = "[REDACTED]"; - } else { - filtered[key] = value; - } - } - return filtered; -} - -const SENSITIVE_QUERY_PARAMS = new Set([ - "api_key", - "api-key", - "apikey", - "token", - "access_token", - "access-token", - "auth_token", - "auth-token", - "password", - "passwd", - "secret", - "api_secret", - "api-secret", - "apisecret", - "key", - "session", - "session_id", - "session-id", -]); - -function redactQueryParameters(queryParameters?: Record): Record | undefined { - if (queryParameters == null) { - return queryParameters; - } - const redacted: Record = {}; - for (const [key, value] of Object.entries(queryParameters)) { - if (SENSITIVE_QUERY_PARAMS.has(key.toLowerCase())) { - redacted[key] = "[REDACTED]"; - } else { - redacted[key] = value; - } - } - return redacted; -} - -function redactUrl(url: string): string { - const protocolIndex = url.indexOf("://"); - if (protocolIndex === -1) return url; - - const afterProtocol = protocolIndex + 3; - - // Find the first delimiter that marks the end of the authority section - const pathStart = url.indexOf("/", afterProtocol); - let queryStart = url.indexOf("?", afterProtocol); - let fragmentStart = url.indexOf("#", afterProtocol); - - const firstDelimiter = Math.min( - pathStart === -1 ? url.length : pathStart, - queryStart === -1 ? url.length : queryStart, - fragmentStart === -1 ? url.length : fragmentStart, - ); - - // Find the LAST @ before the delimiter (handles multiple @ in credentials) - let atIndex = -1; - for (let i = afterProtocol; i < firstDelimiter; i++) { - if (url[i] === "@") { - atIndex = i; - } - } - - if (atIndex !== -1) { - url = `${url.slice(0, afterProtocol)}[REDACTED]@${url.slice(atIndex + 1)}`; - } - - // Recalculate queryStart since url might have changed - queryStart = url.indexOf("?"); - if (queryStart === -1) return url; - - fragmentStart = url.indexOf("#", queryStart); - const queryEnd = fragmentStart !== -1 ? fragmentStart : url.length; - const queryString = url.slice(queryStart + 1, queryEnd); - - if (queryString.length === 0) return url; - - // FAST PATH: Quick check if any sensitive keywords present - // Using indexOf is faster than regex for simple substring matching - const lower = queryString.toLowerCase(); - const hasSensitive = - lower.includes("token") || - lower.includes("key") || - lower.includes("password") || - lower.includes("passwd") || - lower.includes("secret") || - lower.includes("session") || - lower.includes("auth"); - - if (!hasSensitive) { - return url; - } - - // SLOW PATH: Parse and redact - const redactedParams: string[] = []; - const params = queryString.split("&"); - - for (const param of params) { - const equalIndex = param.indexOf("="); - if (equalIndex === -1) { - redactedParams.push(param); - continue; - } - - const key = param.slice(0, equalIndex); - let shouldRedact = SENSITIVE_QUERY_PARAMS.has(key.toLowerCase()); - - if (!shouldRedact && key.includes("%")) { - try { - const decodedKey = decodeURIComponent(key); - shouldRedact = SENSITIVE_QUERY_PARAMS.has(decodedKey.toLowerCase()); - } catch {} - } - - redactedParams.push(shouldRedact ? `${key}=[REDACTED]` : param); - } - - return url.slice(0, queryStart + 1) + redactedParams.join("&") + url.slice(queryEnd); -} - -async function getHeaders(args: Fetcher.Args): Promise { - const newHeaders: Headers = new Headers(); - - newHeaders.set( - "Accept", - args.responseType === "json" ? "application/json" : args.responseType === "text" ? "text/plain" : "*/*", - ); +async function getHeaders(args: Fetcher.Args): Promise> { + const newHeaders: Record = {}; if (args.body !== undefined && args.contentType != null) { - newHeaders.set("Content-Type", args.contentType); + newHeaders["Content-Type"] = args.contentType; } if (args.headers == null) { @@ -224,15 +64,15 @@ async function getHeaders(args: Fetcher.Args): Promise { } for (const [key, value] of Object.entries(args.headers)) { - const result = await EndpointSupplier.get(value, { endpointMetadata: args.endpointMetadata ?? {} }); + const result = await Supplier.get(value); if (typeof result === "string") { - newHeaders.set(key, result); + newHeaders[key] = result; continue; } if (result == null) { continue; } - newHeaders.set(key, `${result}`); + newHeaders[key] = `${result}`; } return newHeaders; } @@ -241,22 +81,9 @@ export async function fetcherImpl(args: Fetcher.Args): Promise(args: Fetcher.Args): Promise(args: Fetcher.Args): Promise= 200 && response.status < 400) { - if (logger.isDebug()) { - const metadata = { - method: args.method, - url: redactUrl(url), - statusCode: response.status, - responseHeaders: redactHeaders(response.headers), - }; - logger.debug("HTTP request succeeded", metadata); - } return { ok: true, body: (await getResponseBody(response, args.responseType)) as R, @@ -292,15 +110,6 @@ export async function fetcherImpl(args: Fetcher.Args): Promise(args: Fetcher.Args): Promise(args: Fetcher.Args): Promise(args: Fetcher.Args): Promise(args: Fetcher.Args): Promise case "application/ld+json": case "application/problem+json": case "application/vnd.api+json": - case "text/json": { + case "text/json": const text = await response.text(); return text.length > 0 ? fromJson(text) : undefined; - } default: if (contentType.startsWith("application/vnd.") && contentType.endsWith("+json")) { const text = await response.text(); diff --git a/src/core/fetcher/getFetchFn.ts b/src/core/fetcher/getFetchFn.ts index 0900cab18..8f4cf5e19 100644 --- a/src/core/fetcher/getFetchFn.ts +++ b/src/core/fetcher/getFetchFn.ts @@ -16,7 +16,7 @@ export async function getFetchFn(): Promise { // Otherwise the SDK uses global fetch if available, // and falls back to node-fetch. - if (typeof fetch === "function") { + if (typeof fetch == "function") { return fetch; } diff --git a/src/core/fetcher/getRequestBody.ts b/src/core/fetcher/getRequestBody.ts index 4e4a179cf..fce5589c5 100644 --- a/src/core/fetcher/getRequestBody.ts +++ b/src/core/fetcher/getRequestBody.ts @@ -1,17 +1,13 @@ import { toJson } from "../json"; -import { toQueryString } from "../url/qs"; export declare namespace GetRequestBody { interface Args { body: unknown; - type: "json" | "file" | "bytes" | "form" | "other"; + type: "json" | "file" | "bytes" | "other"; } } export async function getRequestBody({ body, type }: GetRequestBody.Args): Promise { - if (type === "form") { - return toQueryString(body, { arrayFormat: "repeat", encode: true }); - } if (type.includes("json")) { return toJson(body); } else { diff --git a/src/core/fetcher/getResponseBody.ts b/src/core/fetcher/getResponseBody.ts index c103c6aa0..ba03f424a 100644 --- a/src/core/fetcher/getResponseBody.ts +++ b/src/core/fetcher/getResponseBody.ts @@ -1,6 +1,6 @@ -import { fromJson } from "../json"; import { getBinaryResponse } from "./BinaryResponse"; import { isResponseWithBody } from "./ResponseWithBody"; +import { fromJson } from "../json"; import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; @@ -28,9 +28,9 @@ export async function getResponseBody(response: Response, responseType?: string) const text = await response.text(); if (text.length > 0) { try { - const responseBody = fromJson(text); + let responseBody = fromJson(text); return responseBody; - } catch (_err) { + } catch (err) { return { ok: false, error: { diff --git a/src/core/fetcher/index.ts b/src/core/fetcher/index.ts index 2f32091ef..9fffe7494 100644 --- a/src/core/fetcher/index.ts +++ b/src/core/fetcher/index.ts @@ -1,11 +1,9 @@ export type { APIResponse } from "./APIResponse"; -export type { BinaryResponse } from "./BinaryResponse"; -export type { EndpointMetadata } from "./EndpointMetadata"; -export { EndpointSupplier } from "./EndpointSupplier"; -export type { Fetcher, FetchFunction } from "./Fetcher"; export { fetcher } from "./Fetcher"; +export type { Fetcher, FetchFunction } from "./Fetcher"; export { getHeader } from "./getHeader"; -export { HttpResponsePromise } from "./HttpResponsePromise"; -export type { RawResponse, WithRawResponse } from "./RawResponse"; -export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse"; export { Supplier } from "./Supplier"; +export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse"; +export type { RawResponse, WithRawResponse } from "./RawResponse"; +export { HttpResponsePromise } from "./HttpResponsePromise"; +export { BinaryResponse } from "./BinaryResponse"; diff --git a/src/core/fetcher/makeRequest.ts b/src/core/fetcher/makeRequest.ts index 03a3ccbe8..1af42bb9f 100644 --- a/src/core/fetcher/makeRequest.ts +++ b/src/core/fetcher/makeRequest.ts @@ -4,7 +4,7 @@ export const makeRequest = async ( fetchFn: (url: string, init: RequestInit) => Promise, url: string, method: string, - headers: Headers | Record, + headers: Record, requestBody: BodyInit | undefined, timeoutMs?: number, abortSignal?: AbortSignal, @@ -13,17 +13,19 @@ export const makeRequest = async ( ): Promise => { const signals: AbortSignal[] = []; - let timeoutAbortId: NodeJS.Timeout | undefined; + // Add timeout signal + let timeoutAbortId: NodeJS.Timeout | undefined = undefined; if (timeoutMs != null) { const { signal, abortId } = getTimeoutSignal(timeoutMs); timeoutAbortId = abortId; signals.push(signal); } + // Add arbitrary signal if (abortSignal != null) { signals.push(abortSignal); } - const newSignals = anySignal(signals); + let newSignals = anySignal(signals); const response = await fetchFn(url, { method: method, headers, diff --git a/src/core/fetcher/requestWithRetries.ts b/src/core/fetcher/requestWithRetries.ts index 1f689688c..add3cce02 100644 --- a/src/core/fetcher/requestWithRetries.ts +++ b/src/core/fetcher/requestWithRetries.ts @@ -3,47 +3,12 @@ const MAX_RETRY_DELAY = 60000; // in milliseconds const DEFAULT_MAX_RETRIES = 2; const JITTER_FACTOR = 0.2; // 20% random jitter -function addPositiveJitter(delay: number): number { - const jitterMultiplier = 1 + Math.random() * JITTER_FACTOR; +function addJitter(delay: number): number { + // Generate a random value between -JITTER_FACTOR and +JITTER_FACTOR + const jitterMultiplier = 1 + (Math.random() * 2 - 1) * JITTER_FACTOR; return delay * jitterMultiplier; } -function addSymmetricJitter(delay: number): number { - const jitterMultiplier = 1 + (Math.random() - 0.5) * JITTER_FACTOR; - return delay * jitterMultiplier; -} - -function getRetryDelayFromHeaders(response: Response, retryAttempt: number): number { - const retryAfter = response.headers.get("Retry-After"); - if (retryAfter) { - const retryAfterSeconds = parseInt(retryAfter, 10); - if (!Number.isNaN(retryAfterSeconds) && retryAfterSeconds > 0) { - return Math.min(retryAfterSeconds * 1000, MAX_RETRY_DELAY); - } - - const retryAfterDate = new Date(retryAfter); - if (!Number.isNaN(retryAfterDate.getTime())) { - const delay = retryAfterDate.getTime() - Date.now(); - if (delay > 0) { - return Math.min(Math.max(delay, 0), MAX_RETRY_DELAY); - } - } - } - - const rateLimitReset = response.headers.get("X-RateLimit-Reset"); - if (rateLimitReset) { - const resetTime = parseInt(rateLimitReset, 10); - if (!Number.isNaN(resetTime)) { - const delay = resetTime * 1000 - Date.now(); - if (delay > 0) { - return addPositiveJitter(Math.min(delay, MAX_RETRY_DELAY)); - } - } - } - - return addSymmetricJitter(Math.min(INITIAL_RETRY_DELAY * 2 ** retryAttempt, MAX_RETRY_DELAY)); -} - export async function requestWithRetries( requestFn: () => Promise, maxRetries: number = DEFAULT_MAX_RETRIES, @@ -52,9 +17,13 @@ export async function requestWithRetries( for (let i = 0; i < maxRetries; ++i) { if ([408, 429].includes(response.status) || response.status >= 500) { - const delay = getRetryDelayFromHeaders(response, i); + // Calculate base delay using exponential backoff (in milliseconds) + const baseDelay = Math.min(INITIAL_RETRY_DELAY * Math.pow(2, i), MAX_RETRY_DELAY); + + // Add jitter to the delay + const delayWithJitter = addJitter(baseDelay); - await new Promise((resolve) => setTimeout(resolve, delay)); + await new Promise((resolve) => setTimeout(resolve, delayWithJitter)); response = await requestFn(); } else { break; diff --git a/src/core/fetcher/signals.ts b/src/core/fetcher/signals.ts index c9fcaeff1..a8d32a2e8 100644 --- a/src/core/fetcher/signals.ts +++ b/src/core/fetcher/signals.ts @@ -6,17 +6,29 @@ export function getTimeoutSignal(timeoutMs: number): { signal: AbortSignal; abor return { signal: controller.signal, abortId }; } +/** + * Returns an abort signal that is getting aborted when + * at least one of the specified abort signals is aborted. + * + * Requires at least node.js 18. + */ export function anySignal(...args: AbortSignal[] | [AbortSignal[]]): AbortSignal { + // Allowing signals to be passed either as array + // of signals or as multiple arguments. const signals = (args.length === 1 && Array.isArray(args[0]) ? args[0] : args) as AbortSignal[]; const controller = new AbortController(); for (const signal of signals) { if (signal.aborted) { + // Exiting early if one of the signals + // is already aborted. controller.abort((signal as any)?.reason); break; } + // Listening for signals and removing the listeners + // when at least one symbol is aborted. signal.addEventListener("abort", () => controller.abort((signal as any)?.reason), { signal: controller.signal, }); diff --git a/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index aae72d2f2..7d83aef24 100644 --- a/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -1,11 +1,13 @@ import type { Writable } from "readable-stream"; -import type { EventCallback, StreamWrapper } from "./chooseStreamWrapper"; +import { EventCallback, StreamWrapper } from "./chooseStreamWrapper"; -export class Node18UniversalStreamWrapper - implements - StreamWrapper | Writable | WritableStream, ReadFormat> -{ +export class Node18UniversalStreamWrapper< + ReadFormat extends Uint8Array | Uint16Array | Uint32Array, +> implements StreamWrapper< + Node18UniversalStreamWrapper | Writable | WritableStream, + ReadFormat +> { private readableStream: ReadableStream; private reader: ReadableStreamDefaultReader; private events: Record; diff --git a/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts b/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts index e0896d9ce..23c01a1a7 100644 --- a/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts +++ b/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts @@ -1,6 +1,6 @@ import type { Readable, Writable } from "readable-stream"; -import type { EventCallback, StreamWrapper } from "./chooseStreamWrapper"; +import { EventCallback, StreamWrapper } from "./chooseStreamWrapper"; export class NodePre18StreamWrapper implements StreamWrapper { private readableStream: Readable; diff --git a/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 262ac1303..e5e8b6802 100644 --- a/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -1,10 +1,11 @@ -import type { StreamWrapper } from "./chooseStreamWrapper"; +import { StreamWrapper } from "./chooseStreamWrapper"; type EventCallback = (data?: any) => void; -export class UndiciStreamWrapper - implements StreamWrapper | WritableStream, ReadFormat> -{ +export class UndiciStreamWrapper implements StreamWrapper< + UndiciStreamWrapper | WritableStream, + ReadFormat +> { private readableStream: ReadableStream; private reader: ReadableStreamDefaultReader; private events: Record; diff --git a/src/core/file/exports.ts b/src/core/file/exports.ts deleted file mode 100644 index c957cdf60..000000000 --- a/src/core/file/exports.ts +++ /dev/null @@ -1 +0,0 @@ -export type { Uploadable } from "./types"; diff --git a/src/core/file/file.ts b/src/core/file/file.ts deleted file mode 100644 index 35044a220..000000000 --- a/src/core/file/file.ts +++ /dev/null @@ -1,217 +0,0 @@ -import type { Uploadable } from "./types"; - -export async function toBinaryUploadRequest( - file: Uploadable, -): Promise<{ body: Uploadable.FileLike; headers?: Record }> { - const { data, filename, contentLength, contentType } = await getFileWithMetadata(file); - const request = { - body: data, - headers: {} as Record, - }; - if (filename) { - request.headers["Content-Disposition"] = `attachment; filename="${filename}"`; - } - if (contentType) { - request.headers["Content-Type"] = contentType; - } - if (contentLength != null) { - request.headers["Content-Length"] = contentLength.toString(); - } - return request; -} - -export async function toMultipartDataPart( - file: Uploadable, -): Promise<{ data: Uploadable.FileLike; filename?: string; contentType?: string }> { - const { data, filename, contentType } = await getFileWithMetadata(file, { - noSniffFileSize: true, - }); - return { - data, - filename, - contentType, - }; -} - -async function getFileWithMetadata( - file: Uploadable, - { noSniffFileSize }: { noSniffFileSize?: boolean } = {}, -): Promise { - if (isFileLike(file)) { - return getFileWithMetadata( - { - data: file, - }, - { noSniffFileSize }, - ); - } - - if ("path" in file) { - const fs = await import("fs"); - if (!fs || !fs.createReadStream) { - throw new Error("File path uploads are not supported in this environment."); - } - const data = fs.createReadStream(file.path); - const contentLength = - file.contentLength ?? (noSniffFileSize === true ? undefined : await tryGetFileSizeFromPath(file.path)); - const filename = file.filename ?? getNameFromPath(file.path); - return { - data, - filename, - contentType: file.contentType, - contentLength, - }; - } - if ("data" in file) { - const data = file.data; - const contentLength = - file.contentLength ?? - (await tryGetContentLengthFromFileLike(data, { - noSniffFileSize, - })); - const filename = file.filename ?? tryGetNameFromFileLike(data); - return { - data, - filename, - contentType: file.contentType ?? tryGetContentTypeFromFileLike(data), - contentLength, - }; - } - - throw new Error(`Invalid FileUpload of type ${typeof file}: ${JSON.stringify(file)}`); -} - -function isFileLike(value: unknown): value is Uploadable.FileLike { - return ( - isBuffer(value) || - isArrayBufferView(value) || - isArrayBuffer(value) || - isUint8Array(value) || - isBlob(value) || - isFile(value) || - isStreamLike(value) || - isReadableStream(value) - ); -} - -async function tryGetFileSizeFromPath(path: string): Promise { - try { - const fs = await import("fs"); - if (!fs || !fs.promises || !fs.promises.stat) { - return undefined; - } - const fileStat = await fs.promises.stat(path); - return fileStat.size; - } catch (_fallbackError) { - return undefined; - } -} - -function tryGetNameFromFileLike(data: Uploadable.FileLike): string | undefined { - if (isNamedValue(data)) { - return data.name; - } - if (isPathedValue(data)) { - return getNameFromPath(data.path.toString()); - } - return undefined; -} - -async function tryGetContentLengthFromFileLike( - data: Uploadable.FileLike, - { noSniffFileSize }: { noSniffFileSize?: boolean } = {}, -): Promise { - if (isBuffer(data)) { - return data.length; - } - if (isArrayBufferView(data)) { - return data.byteLength; - } - if (isArrayBuffer(data)) { - return data.byteLength; - } - if (isBlob(data)) { - return data.size; - } - if (isFile(data)) { - return data.size; - } - if (noSniffFileSize === true) { - return undefined; - } - if (isPathedValue(data)) { - return await tryGetFileSizeFromPath(data.path.toString()); - } - return undefined; -} - -function tryGetContentTypeFromFileLike(data: Uploadable.FileLike): string | undefined { - if (isBlob(data)) { - return data.type; - } - if (isFile(data)) { - return data.type; - } - - return undefined; -} - -function getNameFromPath(path: string): string | undefined { - const lastForwardSlash = path.lastIndexOf("/"); - const lastBackSlash = path.lastIndexOf("\\"); - const lastSlashIndex = Math.max(lastForwardSlash, lastBackSlash); - return lastSlashIndex >= 0 ? path.substring(lastSlashIndex + 1) : path; -} - -type NamedValue = { - name: string; -} & unknown; - -type PathedValue = { - path: string | { toString(): string }; -} & unknown; - -type StreamLike = { - read?: () => unknown; - pipe?: (dest: unknown) => unknown; -} & unknown; - -function isNamedValue(value: unknown): value is NamedValue { - return typeof value === "object" && value != null && "name" in value; -} - -function isPathedValue(value: unknown): value is PathedValue { - return typeof value === "object" && value != null && "path" in value; -} - -function isStreamLike(value: unknown): value is StreamLike { - return typeof value === "object" && value != null && ("read" in value || "pipe" in value); -} - -function isReadableStream(value: unknown): value is ReadableStream { - return typeof value === "object" && value != null && "getReader" in value; -} - -function isBuffer(value: unknown): value is Buffer { - return typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(value); -} - -function isArrayBufferView(value: unknown): value is ArrayBufferView { - return typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView(value); -} - -function isArrayBuffer(value: unknown): value is ArrayBuffer { - return typeof ArrayBuffer !== "undefined" && value instanceof ArrayBuffer; -} - -function isUint8Array(value: unknown): value is Uint8Array { - return typeof Uint8Array !== "undefined" && value instanceof Uint8Array; -} - -function isBlob(value: unknown): value is Blob { - return typeof Blob !== "undefined" && value instanceof Blob; -} - -function isFile(value: unknown): value is File { - return typeof File !== "undefined" && value instanceof File; -} diff --git a/src/core/file/index.ts b/src/core/file/index.ts deleted file mode 100644 index 611ebe206..000000000 --- a/src/core/file/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./file"; -export * from "./types"; diff --git a/src/core/file/types.ts b/src/core/file/types.ts deleted file mode 100644 index 531b6927f..000000000 --- a/src/core/file/types.ts +++ /dev/null @@ -1,81 +0,0 @@ -/** - * A file that can be uploaded. Can be a file-like object (stream, buffer, blob, etc.), - * a path to a file, or an object with a file-like object and metadata. - */ -export type Uploadable = Uploadable.FileLike | Uploadable.FromPath | Uploadable.WithMetadata; - -export namespace Uploadable { - /** - * Various file-like objects that can be used to upload a file. - */ - export type FileLike = - | ArrayBuffer - | ArrayBufferLike - | ArrayBufferView - | Uint8Array - | import("buffer").Buffer - | import("buffer").Blob - | import("buffer").File - | import("stream").Readable - | import("stream/web").ReadableStream - | globalThis.Blob - | globalThis.File - | ReadableStream; - - /** - * A file path with optional metadata, used for uploading a file from the file system. - */ - export type FromPath = { - /** The path to the file to upload */ - path: string; - /** - * Optional override for the file name (defaults to basename of path). - * This is used to set the `Content-Disposition` header in upload requests. - */ - filename?: string; - /** - * Optional MIME type of the file (e.g., 'image/jpeg', 'text/plain'). - * This is used to set the `Content-Type` header in upload requests. - */ - contentType?: string; - /** - * Optional file size in bytes. - * If not provided, the file size will be determined from the file system. - * The content length is used to set the `Content-Length` header in upload requests. - */ - contentLength?: number; - }; - - /** - * A file-like object with metadata, used for uploading files. - */ - export type WithMetadata = { - /** The file data */ - data: FileLike; - /** - * Optional override for the file name (defaults to basename of path). - * This is used to set the `Content-Disposition` header in upload requests. - */ - filename?: string; - /** - * Optional MIME type of the file (e.g., 'image/jpeg', 'text/plain'). - * This is used to set the `Content-Type` header in upload requests. - * - * If not provided, the content type may be determined from the data itself. - * * If the data is a `File`, `Blob`, or similar, the content type will be determined from the file itself, if the type is set. - * * Any other data type will not have a content type set, and the upload request will use `Content-Type: application/octet-stream` instead. - */ - contentType?: string; - /** - * Optional file size in bytes. - * The content length is used to set the `Content-Length` header in upload requests. - * If the content length is not provided and cannot be determined, the upload request will not include the `Content-Length` header, but will use `Transfer-Encoding: chunked` instead. - * - * If not provided, the file size will be determined depending on the data type. - * * If the data is of type `fs.ReadStream` (`createReadStream`), the size will be determined from the file system. - * * If the data is a `Buffer`, `ArrayBuffer`, `Uint8Array`, `Blob`, `File`, or similar, the size will be determined from the data itself. - * * If the data is a `Readable` or `ReadableStream`, the size will not be determined. - */ - contentLength?: number; - }; -} diff --git a/src/core/form-data-utils/FormDataWrapper.ts b/src/core/form-data-utils/FormDataWrapper.ts index 5e5ddc142..2becf2e56 100644 --- a/src/core/form-data-utils/FormDataWrapper.ts +++ b/src/core/form-data-utils/FormDataWrapper.ts @@ -1,10 +1,6 @@ -import { toMultipartDataPart, type Uploadable } from "../../core/file/index"; -import { toJson } from "../../core/json"; import { RUNTIME } from "../runtime/index"; -export async function toReadableStream( - encoder: import("form-data-encoder").FormDataEncoder, -): Promise { +export async function toReadableStream(encoder: import("form-data-encoder").FormDataEncoder) { return (await import("readable-stream")).Readable.from(encoder); } @@ -16,24 +12,36 @@ interface FormDataRequest { duplex?: "half"; } +function isNamedValue(value: unknown): value is { name: string } { + return typeof value === "object" && value != null && "name" in value; +} +function isPathedValue(value: unknown): value is { path: unknown } { + return typeof value === "object" && value != null && "path" in value; +} + +function getLastPathSegment(pathStr: string): string { + const lastForwardSlash = pathStr.lastIndexOf("/"); + const lastBackSlash = pathStr.lastIndexOf("\\"); + const lastSlashIndex = Math.max(lastForwardSlash, lastBackSlash); + return lastSlashIndex >= 0 ? pathStr.substring(lastSlashIndex + 1) : pathStr; +} + export interface CrossPlatformFormData { setup(): Promise; append(key: string, value: unknown): void; - appendFile(key: string, value: Uploadable): Promise; + appendFile(key: string, value: unknown, fileName?: string): Promise; getRequest(): MaybePromise>; } export async function newFormData(): Promise { let formdata: CrossPlatformFormData; - if (RUNTIME.type === "node") { - if (RUNTIME.parsedVersion != null && RUNTIME.parsedVersion >= 18) { - formdata = new Node18FormData(); - } else { - formdata = new Node16FormData(); - } + if (RUNTIME.type === "node" && RUNTIME.parsedVersion != null && RUNTIME.parsedVersion >= 18) { + formdata = new Node18FormData(); + } else if (RUNTIME.type === "node") { + formdata = new Node16FormData(); } else { formdata = new WebFormData(); } @@ -43,7 +51,7 @@ export async function newFormData(): Promise { export type Node18FormDataFd = | { - append(name: string, value: unknown, filename?: string): void; + append(name: string, value: unknown, fileName?: string): void; } | undefined; @@ -53,7 +61,7 @@ export type Node18FormDataFd = export class Node18FormData implements CrossPlatformFormData { private fd: Node18FormDataFd; - public async setup(): Promise { + public async setup() { this.fd = new (await import("formdata-node")).FormData(); } @@ -61,18 +69,31 @@ export class Node18FormData implements CrossPlatformFormData { this.fd?.append(key, value); } - public async appendFile(key: string, value: Uploadable): Promise { - const { data, filename } = await toMultipartDataPart(value); + private getFileName(value: any, filename?: string): string | undefined { + if (filename != null) { + return filename; + } + if (isNamedValue(value)) { + return value.name; + } + if (isPathedValue(value) && value.path) { + return getLastPathSegment(value.path.toString()); + } + return undefined; + } - if (data instanceof Blob) { - this.fd?.append(key, data, filename); + public async appendFile(key: string, value: unknown, fileName?: string): Promise { + fileName = this.getFileName(value, fileName); + + if (value instanceof Blob) { + this.fd?.append(key, value, fileName); } else { this.fd?.append(key, { type: undefined, - name: filename, + name: fileName, [Symbol.toStringTag]: "File", stream() { - return data; + return value; }, }); } @@ -122,20 +143,33 @@ export class Node16FormData implements CrossPlatformFormData { this.fd?.append(key, value); } - public async appendFile(key: string, value: Uploadable): Promise { - const { data, filename } = await toMultipartDataPart(value); + private getFileName(value: any, filename?: string): string | undefined { + if (filename != null) { + return filename; + } + if (isNamedValue(value)) { + return value.name; + } + if (isPathedValue(value) && value.path) { + return getLastPathSegment(value.path.toString()); + } + return undefined; + } + + public async appendFile(key: string, value: unknown, fileName?: string): Promise { + fileName = this.getFileName(value, fileName); let bufferedValue; - if (data instanceof Blob) { - bufferedValue = Buffer.from(await (data as any).arrayBuffer()); + if (value instanceof Blob) { + bufferedValue = Buffer.from(await (value as any).arrayBuffer()); } else { - bufferedValue = data; + bufferedValue = value; } - if (filename == null) { + if (fileName == null) { this.fd?.append(key, bufferedValue); } else { - this.fd?.append(key, bufferedValue, { filename }); + this.fd?.append(key, bufferedValue, { filename: fileName }); } } @@ -147,7 +181,7 @@ export class Node16FormData implements CrossPlatformFormData { } } -export type WebFormDataFd = { append(name: string, value: string | Blob, filename?: string): void } | undefined; +export type WebFormDataFd = { append(name: string, value: string | Blob, fileName?: string): void } | undefined; /** * Form Data Implementation for Web @@ -163,14 +197,27 @@ export class WebFormData implements CrossPlatformFormData { this.fd?.append(key, value); } - public async appendFile(key: string, value: Uploadable): Promise { - const { data, filename, contentType } = await toMultipartDataPart(value); + private getFileName(value: any, filename?: string): string | undefined { + if (filename != null) { + return filename; + } + if (isNamedValue(value)) { + return value.name; + } + if (isPathedValue(value) && value.path) { + return getLastPathSegment(value.path.toString()); + } + return undefined; + } + + public async appendFile(key: string, value: any, fileName?: string): Promise { + fileName = this.getFileName(value, fileName); - if (data instanceof Blob) { - this.fd?.append(key, data, filename); + if (value instanceof Blob) { + this.fd?.append(key, value, fileName); return; } - this.fd?.append(key, await convertToBlob(data, contentType), filename); + this.fd?.append(key, new Blob([value]), fileName); } public getRequest(): FormDataRequest { @@ -180,100 +227,3 @@ export class WebFormData implements CrossPlatformFormData { }; } } - -type StreamLike = { - read?: () => unknown; - pipe?: (dest: unknown) => unknown; -} & unknown; - -function isStreamLike(value: unknown): value is StreamLike { - return typeof value === "object" && value != null && ("read" in value || "pipe" in value); -} - -function isReadableStream(value: unknown): value is ReadableStream { - return typeof value === "object" && value != null && "getReader" in value; -} - -function isBuffer(value: unknown): value is Buffer { - return typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(value); -} - -function isArrayBufferView(value: unknown): value is ArrayBufferView { - return ArrayBuffer.isView(value); -} - -async function streamToBuffer(stream: unknown): Promise { - if (RUNTIME.type === "node") { - const { Readable } = await import("stream"); - - if (stream instanceof Readable) { - const chunks: Buffer[] = []; - for await (const chunk of stream) { - chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)); - } - return Buffer.concat(chunks); - } - } - - if (isReadableStream(stream)) { - const reader = stream.getReader(); - const chunks: Uint8Array[] = []; - - try { - while (true) { - const { done, value } = await reader.read(); - if (done) break; - chunks.push(value); - } - } finally { - reader.releaseLock(); - } - - const totalLength = chunks.reduce((sum, chunk) => sum + chunk.length, 0); - const result = new Uint8Array(totalLength); - let offset = 0; - for (const chunk of chunks) { - result.set(chunk, offset); - offset += chunk.length; - } - - return Buffer.from(result); - } - - throw new Error( - `Unsupported stream type: ${typeof stream}. Expected Node.js Readable stream or Web ReadableStream.`, - ); -} - -async function convertToBlob(value: unknown, contentType?: string): Promise { - if (isStreamLike(value) || isReadableStream(value)) { - const buffer = await streamToBuffer(value); - return new Blob([buffer], { type: contentType }); - } - - if (value instanceof Blob) { - return value; - } - - if (isBuffer(value)) { - return new Blob([value], { type: contentType }); - } - - if (value instanceof ArrayBuffer) { - return new Blob([value], { type: contentType }); - } - - if (isArrayBufferView(value)) { - return new Blob([value], { type: contentType }); - } - - if (typeof value === "string") { - return new Blob([value], { type: contentType }); - } - - if (typeof value === "object" && value !== null) { - return new Blob([toJson(value)], { type: contentType ?? "application/json" }); - } - - return new Blob([String(value)], { type: contentType }); -} diff --git a/src/core/headers.ts b/src/core/headers.ts index 78ed8b500..1b4d3308d 100644 --- a/src/core/headers.ts +++ b/src/core/headers.ts @@ -1,33 +1,33 @@ -export function mergeHeaders( - ...headersArray: (Record | null | undefined)[] -): Record { - const result: Record = {}; +import * as core from "./index"; + +export function mergeHeaders( + ...headersArray: (Record | undefined> | undefined)[] +): Record> { + const result: Record> = {}; for (const [key, value] of headersArray .filter((headers) => headers != null) .flatMap((headers) => Object.entries(headers))) { - const insensitiveKey = key.toLowerCase(); if (value != null) { - result[insensitiveKey] = value; - } else if (insensitiveKey in result) { - delete result[insensitiveKey]; + result[key] = value; + } else if (key in result) { + delete result[key]; } } return result; } -export function mergeOnlyDefinedHeaders( - ...headersArray: (Record | null | undefined)[] -): Record { - const result: Record = {}; +export function mergeOnlyDefinedHeaders( + ...headersArray: (Record | undefined> | undefined)[] +): Record> { + const result: Record> = {}; for (const [key, value] of headersArray .filter((headers) => headers != null) .flatMap((headers) => Object.entries(headers))) { - const insensitiveKey = key.toLowerCase(); if (value != null) { - result[insensitiveKey] = value; + result[key] = value; } } diff --git a/src/core/json.ts b/src/core/json.ts index b8e88f02f..cca884d32 100644 --- a/src/core/json.ts +++ b/src/core/json.ts @@ -1,37 +1,10 @@ -const BIGINT_MARKER = "#bigint#"; -const CC_0 = 0x30, - CC_9 = 0x39; -const CC_SPACE = 0x20, - CC_TAB = 0x09, - CC_LF = 0x0a, - CC_CR = 0x0d; -const CC_MINUS = 0x2d, - CC_PLUS = 0x2b, - CC_DOT = 0x2e; -const CC_QUOTE = 0x22, - CC_BACKSLASH = 0x5c; -const CC_COMMA = 0x2c, - CC_COLON = 0x3a; -const CC_LBRACE = 0x7b, - CC_RBRACE = 0x7d; -const CC_LBRACKET = 0x5b, - CC_RBRACKET = 0x5d; -const CC_E_LOWER = 0x65, - CC_E_UPPER = 0x45; -const CC_T = 0x74, - CC_R = 0x72, - CC_U = 0x75, - CC_E = 0x65; // 'true' -const CC_F = 0x66, - CC_A = 0x61, - CC_L = 0x6c, - CC_S = 0x73; // 'false' -const CC_N = 0x6e; // 'null' -const isWhitespace = (c: number) => c === CC_SPACE || c === CC_TAB || c === CC_LF || c === CC_CR; -const isDigit = (c: number) => c >= CC_0 && c <= CC_9; +// Credit to Ivan Korolenko +// Code adopted from https://github.com/Ivan-Korolenko/json-with-bigint -// Cache the regex for better performance -const BIGINT_REGEX = new RegExp(`"(-?\\d+)${BIGINT_MARKER.replace(/[#]/g, "\\$&")}"`, "g"); +/* + Function to serialize data to JSON string + Converts BigInt values to custom format (strings with digits and "n" at the end) and then converts them to proper big integers in JSON string +*/ /** * Serialize a value to JSON @@ -42,332 +15,86 @@ const BIGINT_REGEX = new RegExp(`"(-?\\d+)${BIGINT_MARKER.replace(/[#]/g, "\\$&" */ export const toJson = ( data: unknown, - replacer?: (key: string, value: unknown) => unknown, + replacer?: (this: unknown, key: string, value: unknown) => unknown, space?: string | number, ): string => { - // Use native JSON.stringify with a custom replacer for BigInt + if (typeof data === "bigint") { + return data.toString(); + } + if (typeof data !== "object") { + return JSON.stringify(data, replacer, space); + } + + // eslint-disable-next-line no-useless-escape + const bigInts = /([\[:])?"(-?\d+)n"([,\}\]])/g; const preliminaryJSON = JSON.stringify( data, - (key: string, value: unknown) => { - if (typeof value === "bigint") { - return value.toString() + BIGINT_MARKER; - } - return replacer ? replacer(key, value) : value; - }, + (key, value) => + typeof value === "bigint" + ? value.toString() + "n" + : typeof replacer === "undefined" + ? value + : replacer(key, value), space, ); - if (preliminaryJSON == null) { - return preliminaryJSON; - } + const finalJSON = preliminaryJSON.replace(bigInts, "$1$2$3"); - // Strip quotes around numbers with marker: "123#bigint#" → 123 - return preliminaryJSON.replace(BIGINT_REGEX, "$1"); + return finalJSON; }; +/* + Function to parse JSON + If JSON has values presented in a lib's custom format (strings with digits and "n" character at the end), we just parse them to BigInt values (for backward compatibility with previous versions of the lib) + If JSON has values greater than Number.MAX_SAFE_INTEGER, we convert those values to our custom format, then parse them to BigInt values. + Other types of values are not affected and parsed as native JSON.parse() would parse them. + + Big numbers are found and marked using a Regular Expression with these conditions: + + 1. Before the match there is no . and one of the following is present: + 1.1 ": + 1.2 ":[ + 1.3 ":[anyNumberOf(anyCharacters) + 1.4 , with no ":"anyNumberOf(anyCharacters) before it + All " required in the rule are not escaped. All whitespace and newline characters outside of string values are ignored. + + 2. The match itself has more than 16 digits OR (16 digits and any digit of the number is greater than that of the Number.MAX_SAFE_INTEGER). And it may have a - sign at the start. + + 3. After the match one of the following is present: + 3.1 , without anyNumberOf(anyCharacters) "} or anyNumberOf(anyCharacters) "] after it + 3.2 } without " after it + 3.3 ] without " after it + All whitespace and newline characters outside of string values are ignored. +*/ + /** * Parse JSON string to object, array, or other type * @param text A valid JSON string. * @param reviver A function that transforms the results. This function is called for each member of the object. If a member contains nested objects, the nested objects are transformed before the parent object is. * @returns Parsed object, array, or other type */ - export function fromJson( json: string, reviver?: (this: unknown, key: string, value: unknown) => unknown, ): T { - let i = 0; - const len = json.length; - - function skipWhitespace() { - while (i < len && isWhitespace(json.charCodeAt(i))) i++; + if (!json) { + return JSON.parse(json, reviver); } - function parseValue(): unknown { - skipWhitespace(); - const c = json.charCodeAt(i); - - if (c === CC_QUOTE) return parseString(); - if (c === CC_LBRACE) return parseObject(); - if (c === CC_LBRACKET) return parseArray(); - if (c === CC_MINUS || isDigit(c)) return parseNumber(); - - // Check for true/false/null using character codes - if (c === CC_T) { - if (json.charCodeAt(i + 1) === CC_R && json.charCodeAt(i + 2) === CC_U && json.charCodeAt(i + 3) === CC_E) { - i += 4; - return true; - } - } else if (c === CC_F) { - if ( - json.charCodeAt(i + 1) === CC_A && - json.charCodeAt(i + 2) === CC_L && - json.charCodeAt(i + 3) === CC_S && - json.charCodeAt(i + 4) === CC_E - ) { - i += 5; - return false; - } - } else if (c === CC_N) { - if (json.charCodeAt(i + 1) === CC_U && json.charCodeAt(i + 2) === CC_L && json.charCodeAt(i + 3) === CC_L) { - i += 4; - return null; - } - } - - throw new SyntaxError(`Unexpected character at position ${i}: ${json[i]}`); - } + const numbersBiggerThanMaxInt = // eslint-disable-next-line no-useless-escape + /(?<=[^\\]":\n*\s*[\[]?|[^\\]":\n*\s*\[.*[^\.\d*]\n*\s*|(? { + const isCustomFormatBigInt = typeof value === "string" && Boolean(value.match(/^-?\d+n$/)); - // Fast path: scan for end quote without escapes - while (i < len) { - const c = json.charCodeAt(i); - if (c === CC_QUOTE) { - const result = json.slice(start, i); - i++; - return result; - } - if (c === CC_BACKSLASH) { - break; // Hit an escape, fall through to slow path - } - i++; + if (isCustomFormatBigInt) { + return BigInt(value.substring(0, value.length - 1)); } - // Slow path: handle escapes using array for better performance - const parts = [json.slice(start, i)]; - while (i < len) { - const c = json.charCodeAt(i); - if (c === CC_QUOTE) { - i++; - return parts.join(""); - } - if (c === CC_BACKSLASH) { - i++; - const next = json.charCodeAt(i); - switch (next) { - case CC_QUOTE: - parts.push('"'); - break; - case CC_BACKSLASH: - parts.push("\\"); - break; - case 0x2f: // '/' - parts.push("/"); - break; - case 0x62: // 'b' - parts.push("\b"); - break; - case 0x66: // 'f' - parts.push("\f"); - break; - case CC_N: // 'n' - parts.push("\n"); - break; - case CC_R: // 'r' - parts.push("\r"); - break; - case CC_T: // 't' - parts.push("\t"); - break; - case CC_U: // 'u' - parts.push(String.fromCharCode(parseInt(json.slice(i + 1, i + 5), 16))); - i += 4; - break; - default: - throw new SyntaxError(`Invalid escape sequence at position ${i}`); - } - i++; - } else { - // Accumulate regular characters - const chunkStart = i; - while (i < len) { - const cc = json.charCodeAt(i); - if (cc === CC_QUOTE || cc === CC_BACKSLASH) break; - i++; - } - parts.push(json.slice(chunkStart, i)); - } - } - throw new SyntaxError("Unterminated string"); - } - - function parseNumber(): number | bigint { - const start = i; - - // Optional minus - if (json.charCodeAt(i) === CC_MINUS) i++; - - // Integer part - const digitStart = i; - if (json.charCodeAt(i) === CC_0) { - i++; - } else if (isDigit(json.charCodeAt(i))) { - while (i < len && isDigit(json.charCodeAt(i))) i++; - } - const intEnd = i; - - // Fraction part - let hasFrac = false; - if (json.charCodeAt(i) === CC_DOT) { - hasFrac = true; - i++; - while (i < len && isDigit(json.charCodeAt(i))) i++; - } - - // Exponent part - let hasExp = false; - const c = json.charCodeAt(i); - if (c === CC_E_LOWER || c === CC_E_UPPER) { - hasExp = true; - i++; - const sign = json.charCodeAt(i); - if (sign === CC_MINUS || sign === CC_PLUS) i++; - while (i < len && isDigit(json.charCodeAt(i))) i++; - } - - const numStr = json.slice(start, i); - - // If it's a pure integer, check if we should use BigInt - if (!hasFrac && !hasExp) { - const digitCount = intEnd - digitStart; - - // Quick length check - numbers > 16 digits are definitely unsafe - if (digitCount > 16) { - return BigInt(numStr); - } - - // Numbers < 15 digits are always safe - if (digitCount < 15) { - return Number(numStr); - } - - // For 15-16 digit numbers, convert and check - const num = Number(numStr); - if (!Number.isSafeInteger(num)) { - return BigInt(numStr); - } - return num; + if (typeof reviver !== "undefined") { + return reviver(key, value); } - return Number(numStr); - } - - function parseObject(): Record { - i++; // skip opening brace - skipWhitespace(); - - const obj: Record = {}; - - if (json.charCodeAt(i) === CC_RBRACE) { - i++; - return obj; - } - - while (true) { - skipWhitespace(); - const key = parseString(); - skipWhitespace(); - - if (json.charCodeAt(i) !== CC_COLON) { - throw new SyntaxError(`Expected ':' at position ${i}`); - } - i++; - - const value = parseValue(); - obj[key] = value; - - skipWhitespace(); - const c = json.charCodeAt(i); - if (c === CC_RBRACE) { - i++; - return obj; - } - if (c === CC_COMMA) { - i++; - continue; - } - throw new SyntaxError(`Expected ',' or '}' at position ${i}`); - } - } - - function parseArray(): unknown[] { - i++; // skip opening bracket - skipWhitespace(); - - const arr: unknown[] = []; - - if (json.charCodeAt(i) === CC_RBRACKET) { - i++; - return arr; - } - - while (true) { - arr.push(parseValue()); - skipWhitespace(); - - const c = json.charCodeAt(i); - if (c === CC_RBRACKET) { - i++; - return arr; - } - if (c === CC_COMMA) { - i++; - continue; - } - throw new SyntaxError(`Expected ',' or ']' at position ${i}`); - } - } - - const result = parseValue(); - skipWhitespace(); - - if (i < json.length) { - throw new SyntaxError(`Unexpected content at position ${i}`); - } - - // Apply reviver if provided - if (!reviver) return result as T; - - function reviveRecursive(holder: Record | unknown[], key: string): unknown { - let value: unknown; - if (Array.isArray(holder)) { - const idx = Number(key); - if (Number.isInteger(idx)) { - value = holder[idx]; - } else { - value = (holder as unknown as Record)[key]; - } - } else { - value = holder[key]; - } - - if (value && typeof value === "object") { - if (Array.isArray(value)) { - for (let i = 0; i < value.length; i++) { - const newValue = reviveRecursive(value, String(i)); - if (newValue !== undefined) { - value[i] = newValue; - } else { - delete value[i]; - } - } - } else { - const obj = value as Record; - for (const k of Object.keys(obj)) { - const newValue = reviveRecursive(obj, k); - if (newValue !== undefined) { - obj[k] = newValue; - } else { - delete obj[k]; - } - } - } - } - - return reviver?.call(holder, key, value); - } - - return reviveRecursive({ "": result }, "") as T; + return value; + }); } diff --git a/src/core/logging/exports.ts b/src/core/logging/exports.ts deleted file mode 100644 index a418a9c6e..000000000 --- a/src/core/logging/exports.ts +++ /dev/null @@ -1,19 +0,0 @@ -import * as logger from "./logger"; - -export namespace logging { - /** - * Configuration for logger instances. - */ - export type LogConfig = logger.LogConfig; - export type LogLevel = logger.LogLevel; - export const LogLevel: typeof logger.LogLevel = logger.LogLevel; - export type ILogger = logger.ILogger; - /** - * Console logger implementation that outputs to the console. - */ - export type ConsoleLogger = logger.ConsoleLogger; - /** - * Console logger implementation that outputs to the console. - */ - export const ConsoleLogger: typeof logger.ConsoleLogger = logger.ConsoleLogger; -} diff --git a/src/core/logging/index.ts b/src/core/logging/index.ts deleted file mode 100644 index 41c7bf273..000000000 --- a/src/core/logging/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./logger"; diff --git a/src/core/logging/logger.ts b/src/core/logging/logger.ts deleted file mode 100644 index a3f3673cd..000000000 --- a/src/core/logging/logger.ts +++ /dev/null @@ -1,203 +0,0 @@ -export const LogLevel = { - Debug: "debug", - Info: "info", - Warn: "warn", - Error: "error", -} as const; -export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel]; -const logLevelMap: Record = { - [LogLevel.Debug]: 1, - [LogLevel.Info]: 2, - [LogLevel.Warn]: 3, - [LogLevel.Error]: 4, -}; - -export interface ILogger { - /** - * Logs a debug message. - * @param message - The message to log - * @param args - Additional arguments to log - */ - debug(message: string, ...args: unknown[]): void; - /** - * Logs an info message. - * @param message - The message to log - * @param args - Additional arguments to log - */ - info(message: string, ...args: unknown[]): void; - /** - * Logs a warning message. - * @param message - The message to log - * @param args - Additional arguments to log - */ - warn(message: string, ...args: unknown[]): void; - /** - * Logs an error message. - * @param message - The message to log - * @param args - Additional arguments to log - */ - error(message: string, ...args: unknown[]): void; -} - -/** - * Configuration for logger initialization. - */ -export interface LogConfig { - /** - * Minimum log level to output. - * @default LogLevel.Info - */ - level?: LogLevel; - /** - * Logger implementation to use. - * @default new ConsoleLogger() - */ - logger?: ILogger; - /** - * Whether logging should be silenced. - * @default true - */ - silent?: boolean; -} - -/** - * Default console-based logger implementation. - */ -export class ConsoleLogger implements ILogger { - debug(message: string, ...args: unknown[]): void { - console.debug(message, ...args); - } - info(message: string, ...args: unknown[]): void { - console.info(message, ...args); - } - warn(message: string, ...args: unknown[]): void { - console.warn(message, ...args); - } - error(message: string, ...args: unknown[]): void { - console.error(message, ...args); - } -} - -/** - * Logger class that provides level-based logging functionality. - */ -export class Logger { - private readonly level: number; - private readonly logger: ILogger; - private readonly silent: boolean; - - /** - * Creates a new logger instance. - * @param config - Logger configuration - */ - constructor(config: Required) { - this.level = logLevelMap[config.level]; - this.logger = config.logger; - this.silent = config.silent; - } - - /** - * Checks if a log level should be output based on configuration. - * @param level - The log level to check - * @returns True if the level should be logged - */ - public shouldLog(level: LogLevel): boolean { - return !this.silent && this.level <= logLevelMap[level]; - } - - /** - * Checks if debug logging is enabled. - * @returns True if debug logs should be output - */ - public isDebug(): boolean { - return this.shouldLog(LogLevel.Debug); - } - - /** - * Logs a debug message if debug logging is enabled. - * @param message - The message to log - * @param args - Additional arguments to log - */ - public debug(message: string, ...args: unknown[]): void { - if (this.isDebug()) { - this.logger.debug(message, ...args); - } - } - - /** - * Checks if info logging is enabled. - * @returns True if info logs should be output - */ - public isInfo(): boolean { - return this.shouldLog(LogLevel.Info); - } - - /** - * Logs an info message if info logging is enabled. - * @param message - The message to log - * @param args - Additional arguments to log - */ - public info(message: string, ...args: unknown[]): void { - if (this.isInfo()) { - this.logger.info(message, ...args); - } - } - - /** - * Checks if warning logging is enabled. - * @returns True if warning logs should be output - */ - public isWarn(): boolean { - return this.shouldLog(LogLevel.Warn); - } - - /** - * Logs a warning message if warning logging is enabled. - * @param message - The message to log - * @param args - Additional arguments to log - */ - public warn(message: string, ...args: unknown[]): void { - if (this.isWarn()) { - this.logger.warn(message, ...args); - } - } - - /** - * Checks if error logging is enabled. - * @returns True if error logs should be output - */ - public isError(): boolean { - return this.shouldLog(LogLevel.Error); - } - - /** - * Logs an error message if error logging is enabled. - * @param message - The message to log - * @param args - Additional arguments to log - */ - public error(message: string, ...args: unknown[]): void { - if (this.isError()) { - this.logger.error(message, ...args); - } - } -} - -export function createLogger(config?: LogConfig | Logger): Logger { - if (config == null) { - return defaultLogger; - } - if (config instanceof Logger) { - return config; - } - config = config ?? {}; - config.level ??= LogLevel.Info; - config.logger ??= new ConsoleLogger(); - config.silent ??= true; - return new Logger(config as Required); -} - -const defaultLogger: Logger = new Logger({ - level: LogLevel.Info, - logger: new ConsoleLogger(), - silent: true, -}); diff --git a/src/core/pagination/Page.ts b/src/core/pagination/Page.ts index 6e884eccb..30df7280b 100644 --- a/src/core/pagination/Page.ts +++ b/src/core/pagination/Page.ts @@ -1,19 +1,18 @@ -import type { HttpResponsePromise, RawResponse } from "../fetcher/index"; +import { HttpResponsePromise, RawResponse } from "../fetcher"; /** * A page of results from a paginated API. * * @template T The type of the items in the page. - * @template R The type of the API response. */ -export class Page implements AsyncIterable { +export class Page implements AsyncIterable { public data: T[]; public rawResponse: RawResponse; - public response: R; - private _hasNextPage: (response: R) => boolean; - private getItems: (response: R) => T[]; - private loadNextPage: (response: R) => HttpResponsePromise; + private response: unknown; + private _hasNextPage: (response: unknown) => boolean; + private getItems: (response: unknown) => T[]; + private loadNextPage: (response: unknown) => HttpResponsePromise; constructor({ response, @@ -22,11 +21,11 @@ export class Page implements AsyncIterable { getItems, loadPage, }: { - response: R; + response: unknown; rawResponse: RawResponse; - hasNextPage: (response: R) => boolean; - getItems: (response: R) => T[]; - loadPage: (response: R) => HttpResponsePromise; + hasNextPage: (response: unknown) => boolean; + getItems: (response: unknown) => T[]; + loadPage: (response: unknown) => HttpResponsePromise; }) { this.response = response; this.rawResponse = rawResponse; diff --git a/src/core/pagination/Pageable.ts b/src/core/pagination/Pageable.ts new file mode 100644 index 000000000..3a5220ebd --- /dev/null +++ b/src/core/pagination/Pageable.ts @@ -0,0 +1,18 @@ +import { RawResponse } from "../fetcher"; +import { Page } from "./Page"; + +export declare namespace Pageable { + interface Args { + response: Response; + rawResponse: RawResponse; + hasNextPage: (response: Response) => boolean; + getItems: (response: Response) => Item[]; + loadPage: (response: Response) => Promise; + } +} + +export class Pageable extends Page { + constructor(args: Pageable.Args) { + super(args as any); + } +} diff --git a/src/core/pagination/exports.ts b/src/core/pagination/exports.ts deleted file mode 100644 index 8a1c4b3bd..000000000 --- a/src/core/pagination/exports.ts +++ /dev/null @@ -1 +0,0 @@ -export type { Page } from "./Page"; diff --git a/src/core/pagination/index.ts b/src/core/pagination/index.ts index 46cc304af..2ceb26844 100644 --- a/src/core/pagination/index.ts +++ b/src/core/pagination/index.ts @@ -1 +1,2 @@ export { Page } from "./Page"; +export { Pageable } from "./Pageable"; diff --git a/src/core/schemas/Schema.ts b/src/core/schemas/Schema.ts index cce732a2e..921a15466 100644 --- a/src/core/schemas/Schema.ts +++ b/src/core/schemas/Schema.ts @@ -1,4 +1,4 @@ -import type { SchemaUtils } from "./builders/index"; +import { SchemaUtils } from "./builders"; export type Schema = BaseSchema & SchemaUtils; @@ -24,7 +24,6 @@ export const SchemaType = { NUMBER: "number", STRING: "string", UNKNOWN: "unknown", - NEVER: "never", RECORD: "record", SET: "set", UNION: "union", @@ -33,7 +32,6 @@ export const SchemaType = { OPTIONAL: "optional", OPTIONAL_NULLABLE: "optionalNullable", } as const; - export type SchemaType = (typeof SchemaType)[keyof typeof SchemaType]; export type MaybeValid = Valid | Invalid; diff --git a/src/core/schemas/builders/bigint/bigint.ts b/src/core/schemas/builders/bigint/bigint.ts index 9d8a63d45..e69bb791e 100644 --- a/src/core/schemas/builders/bigint/bigint.ts +++ b/src/core/schemas/builders/bigint/bigint.ts @@ -1,7 +1,7 @@ -import { type BaseSchema, type Schema, SchemaType } from "../../Schema"; +import { BaseSchema, Schema, SchemaType } from "../../Schema"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils/index"; +import { getSchemaUtils } from "../schema-utils"; export function bigint(): Schema { const baseSchema: BaseSchema = { diff --git a/src/core/schemas/builders/date/date.ts b/src/core/schemas/builders/date/date.ts index bc507e085..b70f24b04 100644 --- a/src/core/schemas/builders/date/date.ts +++ b/src/core/schemas/builders/date/date.ts @@ -1,7 +1,7 @@ -import { type BaseSchema, type Schema, SchemaType } from "../../Schema"; +import { BaseSchema, Schema, SchemaType } from "../../Schema"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils/index"; +import { getSchemaUtils } from "../schema-utils"; // https://stackoverflow.com/questions/12756159/regex-and-iso8601-formatted-datetime const ISO_8601_REGEX = diff --git a/src/core/schemas/builders/enum/enum.ts b/src/core/schemas/builders/enum/enum.ts index c2c49a323..69aced6be 100644 --- a/src/core/schemas/builders/enum/enum.ts +++ b/src/core/schemas/builders/enum/enum.ts @@ -1,4 +1,4 @@ -import { type Schema, SchemaType } from "../../Schema"; +import { Schema, SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; diff --git a/src/core/schemas/builders/index.ts b/src/core/schemas/builders/index.ts index be23de258..65211f925 100644 --- a/src/core/schemas/builders/index.ts +++ b/src/core/schemas/builders/index.ts @@ -1,14 +1,14 @@ -export * from "./bigint/index"; -export * from "./date/index"; -export * from "./enum/index"; -export * from "./lazy/index"; -export * from "./list/index"; -export * from "./literals/index"; -export * from "./object/index"; -export * from "./object-like/index"; -export * from "./primitives/index"; -export * from "./record/index"; -export * from "./schema-utils/index"; -export * from "./set/index"; -export * from "./undiscriminated-union/index"; -export * from "./union/index"; +export * from "./bigint"; +export * from "./date"; +export * from "./enum"; +export * from "./lazy"; +export * from "./list"; +export * from "./literals"; +export * from "./object"; +export * from "./object-like"; +export * from "./primitives"; +export * from "./record"; +export * from "./schema-utils"; +export * from "./set"; +export * from "./undiscriminated-union"; +export * from "./union"; diff --git a/src/core/schemas/builders/lazy/index.ts b/src/core/schemas/builders/lazy/index.ts index 2221abd88..77420fb03 100644 --- a/src/core/schemas/builders/lazy/index.ts +++ b/src/core/schemas/builders/lazy/index.ts @@ -1,3 +1,3 @@ -export type { SchemaGetter } from "./lazy"; export { lazy } from "./lazy"; +export type { SchemaGetter } from "./lazy"; export { lazyObject } from "./lazyObject"; diff --git a/src/core/schemas/builders/lazy/lazy.ts b/src/core/schemas/builders/lazy/lazy.ts index a72735184..2962bdfe0 100644 --- a/src/core/schemas/builders/lazy/lazy.ts +++ b/src/core/schemas/builders/lazy/lazy.ts @@ -1,5 +1,5 @@ -import type { BaseSchema, Schema } from "../../Schema"; -import { getSchemaUtils } from "../schema-utils/index"; +import { BaseSchema, Schema } from "../../Schema"; +import { getSchemaUtils } from "../schema-utils"; export type SchemaGetter> = () => SchemaType; diff --git a/src/core/schemas/builders/lazy/lazyObject.ts b/src/core/schemas/builders/lazy/lazyObject.ts index 2a58a2abb..d8ee6ec5d 100644 --- a/src/core/schemas/builders/lazy/lazyObject.ts +++ b/src/core/schemas/builders/lazy/lazyObject.ts @@ -1,8 +1,8 @@ -import { getObjectUtils } from "../object/index"; -import type { BaseObjectSchema, ObjectSchema } from "../object/types"; -import { getObjectLikeUtils } from "../object-like/index"; -import { getSchemaUtils } from "../schema-utils/index"; -import { constructLazyBaseSchema, getMemoizedSchema, type SchemaGetter } from "./lazy"; +import { getObjectUtils } from "../object"; +import { getObjectLikeUtils } from "../object-like"; +import { BaseObjectSchema, ObjectSchema } from "../object/types"; +import { getSchemaUtils } from "../schema-utils"; +import { SchemaGetter, constructLazyBaseSchema, getMemoizedSchema } from "./lazy"; export function lazyObject(getter: SchemaGetter>): ObjectSchema { const baseSchema: BaseObjectSchema = { diff --git a/src/core/schemas/builders/list/list.ts b/src/core/schemas/builders/list/list.ts index 7c8fd6e87..a6167a5be 100644 --- a/src/core/schemas/builders/list/list.ts +++ b/src/core/schemas/builders/list/list.ts @@ -1,7 +1,7 @@ -import { type BaseSchema, type MaybeValid, type Schema, SchemaType, type ValidationError } from "../../Schema"; +import { BaseSchema, MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils/index"; +import { getSchemaUtils } from "../schema-utils"; export function list(schema: Schema): Schema { const baseSchema: BaseSchema = { diff --git a/src/core/schemas/builders/literals/booleanLiteral.ts b/src/core/schemas/builders/literals/booleanLiteral.ts index fb06cc00f..5c004133d 100644 --- a/src/core/schemas/builders/literals/booleanLiteral.ts +++ b/src/core/schemas/builders/literals/booleanLiteral.ts @@ -1,4 +1,4 @@ -import { type Schema, SchemaType } from "../../Schema"; +import { Schema, SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; diff --git a/src/core/schemas/builders/literals/index.ts b/src/core/schemas/builders/literals/index.ts index ae7389065..d2bf08fc6 100644 --- a/src/core/schemas/builders/literals/index.ts +++ b/src/core/schemas/builders/literals/index.ts @@ -1,2 +1,2 @@ -export { booleanLiteral } from "./booleanLiteral"; export { stringLiteral } from "./stringLiteral"; +export { booleanLiteral } from "./booleanLiteral"; diff --git a/src/core/schemas/builders/literals/stringLiteral.ts b/src/core/schemas/builders/literals/stringLiteral.ts index 98fe06223..334bbdc46 100644 --- a/src/core/schemas/builders/literals/stringLiteral.ts +++ b/src/core/schemas/builders/literals/stringLiteral.ts @@ -1,4 +1,4 @@ -import { type Schema, SchemaType } from "../../Schema"; +import { Schema, SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; diff --git a/src/core/schemas/builders/object-like/getObjectLikeUtils.ts b/src/core/schemas/builders/object-like/getObjectLikeUtils.ts index ed96cf771..8885586e2 100644 --- a/src/core/schemas/builders/object-like/getObjectLikeUtils.ts +++ b/src/core/schemas/builders/object-like/getObjectLikeUtils.ts @@ -1,9 +1,9 @@ -import type { BaseSchema } from "../../Schema"; +import { BaseSchema } from "../../Schema"; import { filterObject } from "../../utils/filterObject"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { isPlainObject } from "../../utils/isPlainObject"; -import { getSchemaUtils } from "../schema-utils/index"; -import type { ObjectLikeSchema, ObjectLikeUtils } from "./types"; +import { getSchemaUtils } from "../schema-utils"; +import { ObjectLikeSchema, ObjectLikeUtils } from "./types"; export function getObjectLikeUtils(schema: BaseSchema): ObjectLikeUtils { return { diff --git a/src/core/schemas/builders/object-like/types.ts b/src/core/schemas/builders/object-like/types.ts index a8401d7cf..75b369872 100644 --- a/src/core/schemas/builders/object-like/types.ts +++ b/src/core/schemas/builders/object-like/types.ts @@ -1,13 +1,11 @@ -import type { BaseSchema, Schema } from "../../Schema"; +import { BaseSchema, Schema } from "../../Schema"; export type ObjectLikeSchema = Schema & BaseSchema & ObjectLikeUtils; export interface ObjectLikeUtils { - withParsedProperties: >( - properties: { - [K in keyof T]: T[K] | ((parsed: Parsed) => T[K]); - }, - ) => ObjectLikeSchema; + 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 index 58ce0b48b..e3f4388db 100644 --- a/src/core/schemas/builders/object/index.ts +++ b/src/core/schemas/builders/object/index.ts @@ -1,11 +1,11 @@ export { getObjectUtils, object } from "./object"; +export { objectWithoutOptionalProperties } from "./objectWithoutOptionalProperties"; export type { inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas, inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas, } from "./objectWithoutOptionalProperties"; -export { objectWithoutOptionalProperties } from "./objectWithoutOptionalProperties"; -export type { Property } from "./property"; export { isProperty, property } from "./property"; +export type { Property } from "./property"; export type { BaseObjectSchema, inferObjectSchemaFromPropertySchemas, diff --git a/src/core/schemas/builders/object/object.ts b/src/core/schemas/builders/object/object.ts index c239249e2..05fbca8a1 100644 --- a/src/core/schemas/builders/object/object.ts +++ b/src/core/schemas/builders/object/object.ts @@ -1,4 +1,4 @@ -import { type MaybeValid, type Schema, SchemaType, type ValidationError } from "../../Schema"; +import { MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; import { entries } from "../../utils/entries"; import { filterObject } from "../../utils/filterObject"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; @@ -6,17 +6,17 @@ import { isPlainObject } from "../../utils/isPlainObject"; import { keys } from "../../utils/keys"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; import { partition } from "../../utils/partition"; -import { getObjectLikeUtils } from "../object-like/index"; -import { getSchemaUtils } from "../schema-utils/index"; +import { getObjectLikeUtils } from "../object-like"; +import { getSchemaUtils } from "../schema-utils"; import { isProperty } from "./property"; -import type { +import { BaseObjectSchema, - inferObjectSchemaFromPropertySchemas, - inferParsedObjectFromPropertySchemas, - inferRawObjectFromPropertySchemas, ObjectSchema, ObjectUtils, PropertySchemas, + inferObjectSchemaFromPropertySchemas, + inferParsedObjectFromPropertySchemas, + inferRawObjectFromPropertySchemas, } from "./types"; interface ObjectPropertyWithRawKey { diff --git a/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts b/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts index bac2e1e1a..ce4d3edca 100644 --- a/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts +++ b/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts @@ -1,10 +1,5 @@ import { object } from "./object"; -import type { - inferParsedPropertySchema, - inferRawObjectFromPropertySchemas, - ObjectSchema, - PropertySchemas, -} from "./types"; +import { ObjectSchema, PropertySchemas, inferParsedPropertySchema, inferRawObjectFromPropertySchemas } from "./types"; export function objectWithoutOptionalProperties>( schemas: T, diff --git a/src/core/schemas/builders/object/property.ts b/src/core/schemas/builders/object/property.ts index ef07c2a79..fa9a9be84 100644 --- a/src/core/schemas/builders/object/property.ts +++ b/src/core/schemas/builders/object/property.ts @@ -1,4 +1,4 @@ -import type { Schema } from "../../Schema"; +import { Schema } from "../../Schema"; export function property( rawKey: RawKey, diff --git a/src/core/schemas/builders/object/types.ts b/src/core/schemas/builders/object/types.ts index 57f874869..b4f49c884 100644 --- a/src/core/schemas/builders/object/types.ts +++ b/src/core/schemas/builders/object/types.ts @@ -1,8 +1,8 @@ -import type { BaseSchema, inferParsed, inferRaw, Schema } from "../../Schema"; -import type { addQuestionMarksToNullableProperties } from "../../utils/addQuestionMarksToNullableProperties"; -import type { ObjectLikeUtils } from "../object-like/index"; -import type { SchemaUtils } from "../schema-utils/index"; -import type { Property } from "./property"; +import { BaseSchema, Schema, inferParsed, inferRaw } from "../../Schema"; +import { addQuestionMarksToNullableProperties } from "../../utils/addQuestionMarksToNullableProperties"; +import { ObjectLikeUtils } from "../object-like"; +import { SchemaUtils } from "../schema-utils"; +import { Property } from "./property"; export type ObjectSchema = BaseObjectSchema & ObjectLikeUtils & @@ -23,9 +23,8 @@ export interface ObjectUtils { export type inferRawObject> = O extends ObjectSchema ? Raw : never; -export type inferParsedObject> = O extends ObjectSchema - ? Parsed - : never; +export type inferParsedObject> = + O extends ObjectSchema ? Parsed : never; export type inferObjectSchemaFromPropertySchemas> = ObjectSchema< inferRawObjectFromPropertySchemas, @@ -47,25 +46,11 @@ export type PropertySchemas = Recor Property | Schema >; -export type inferRawPropertySchema

| Schema> = P extends Property< - any, - infer Raw, - any -> - ? Raw - : P extends Schema - ? inferRaw

- : never; +export type inferRawPropertySchema

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

: never; -export type inferParsedPropertySchema

| Schema> = P extends Property< - any, - any, - infer Parsed -> - ? Parsed - : P extends Schema - ? inferParsed

- : never; +export type inferParsedPropertySchema

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

: never; export type inferRawKey< ParsedKey extends string | number | symbol, diff --git a/src/core/schemas/builders/primitives/any.ts b/src/core/schemas/builders/primitives/any.ts index 0652f8934..fcaeb0425 100644 --- a/src/core/schemas/builders/primitives/any.ts +++ b/src/core/schemas/builders/primitives/any.ts @@ -1,7 +1,4 @@ -import { type Schema, SchemaType } from "../../Schema"; +import { SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; -export const any: () => Schema = createIdentitySchemaCreator(SchemaType.ANY, (value) => ({ - ok: true, - value, -})); +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 index d90a6924f..2b5598810 100644 --- a/src/core/schemas/builders/primitives/boolean.ts +++ b/src/core/schemas/builders/primitives/boolean.ts @@ -1,8 +1,8 @@ -import { type Schema, SchemaType } from "../../Schema"; +import { SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -export const boolean: () => Schema = createIdentitySchemaCreator( +export const boolean = createIdentitySchemaCreator( SchemaType.BOOLEAN, (value, { breadcrumbsPrefix = [] } = {}) => { if (typeof value === "boolean") { diff --git a/src/core/schemas/builders/primitives/index.ts b/src/core/schemas/builders/primitives/index.ts index a60b5e5ad..788f9416b 100644 --- a/src/core/schemas/builders/primitives/index.ts +++ b/src/core/schemas/builders/primitives/index.ts @@ -1,6 +1,5 @@ export { any } from "./any"; export { boolean } from "./boolean"; -export { never } from "./never"; export { number } from "./number"; export { string } from "./string"; export { unknown } from "./unknown"; diff --git a/src/core/schemas/builders/primitives/never.ts b/src/core/schemas/builders/primitives/never.ts deleted file mode 100644 index 91f85d74c..000000000 --- a/src/core/schemas/builders/primitives/never.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { type Schema, SchemaType } from "../../Schema.js"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator.js"; - -export const never: () => Schema = createIdentitySchemaCreator( - SchemaType.NEVER, - (_value, { breadcrumbsPrefix = [] } = {}) => ({ - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: "Expected never", - }, - ], - }), -); diff --git a/src/core/schemas/builders/primitives/number.ts b/src/core/schemas/builders/primitives/number.ts index 8b3b32cdc..3d6be6ff7 100644 --- a/src/core/schemas/builders/primitives/number.ts +++ b/src/core/schemas/builders/primitives/number.ts @@ -1,8 +1,8 @@ -import { type Schema, SchemaType } from "../../Schema"; +import { SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -export const number: () => Schema = createIdentitySchemaCreator( +export const number = createIdentitySchemaCreator( SchemaType.NUMBER, (value, { breadcrumbsPrefix = [] } = {}) => { if (typeof value === "number") { diff --git a/src/core/schemas/builders/primitives/string.ts b/src/core/schemas/builders/primitives/string.ts index f9f8e4779..e09aceeca 100644 --- a/src/core/schemas/builders/primitives/string.ts +++ b/src/core/schemas/builders/primitives/string.ts @@ -1,8 +1,8 @@ -import { type Schema, SchemaType } from "../../Schema"; +import { SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -export const string: () => Schema = createIdentitySchemaCreator( +export const string = createIdentitySchemaCreator( SchemaType.STRING, (value, { breadcrumbsPrefix = [] } = {}) => { if (typeof value === "string") { diff --git a/src/core/schemas/builders/primitives/unknown.ts b/src/core/schemas/builders/primitives/unknown.ts index 41c9d770b..4d5249571 100644 --- a/src/core/schemas/builders/primitives/unknown.ts +++ b/src/core/schemas/builders/primitives/unknown.ts @@ -1,7 +1,4 @@ -import { type Schema, SchemaType } from "../../Schema"; +import { SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; -export const unknown: () => Schema = createIdentitySchemaCreator( - SchemaType.UNKNOWN, - (value) => ({ ok: true, value }), -); +export const unknown = createIdentitySchemaCreator(SchemaType.UNKNOWN, (value) => ({ ok: true, value })); diff --git a/src/core/schemas/builders/record/record.ts b/src/core/schemas/builders/record/record.ts index ba5307a6a..eb3e9a999 100644 --- a/src/core/schemas/builders/record/record.ts +++ b/src/core/schemas/builders/record/record.ts @@ -1,10 +1,10 @@ -import { type MaybeValid, type Schema, SchemaType, type ValidationError } from "../../Schema"; +import { MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; import { entries } from "../../utils/entries"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { isPlainObject } from "../../utils/isPlainObject"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils/index"; -import type { BaseRecordSchema, RecordSchema } from "./types"; +import { getSchemaUtils } from "../schema-utils"; +import { BaseRecordSchema, RecordSchema } from "./types"; export function record( keySchema: Schema, @@ -90,7 +90,7 @@ function validateAndTransformRecord 0 ? Number(stringKey) : NaN; - if (!Number.isNaN(numberKey)) { + if (!isNaN(numberKey)) { key = numberKey; } } diff --git a/src/core/schemas/builders/record/types.ts b/src/core/schemas/builders/record/types.ts index b99bb9d87..fec431d43 100644 --- a/src/core/schemas/builders/record/types.ts +++ b/src/core/schemas/builders/record/types.ts @@ -1,5 +1,5 @@ -import type { BaseSchema } from "../../Schema"; -import type { SchemaUtils } from "../schema-utils/index"; +import { BaseSchema } from "../../Schema"; +import { SchemaUtils } from "../schema-utils"; export type RecordSchema< RawKey extends string | number, diff --git a/src/core/schemas/builders/schema-utils/JsonError.ts b/src/core/schemas/builders/schema-utils/JsonError.ts index 7573c76be..2b89ca0e7 100644 --- a/src/core/schemas/builders/schema-utils/JsonError.ts +++ b/src/core/schemas/builders/schema-utils/JsonError.ts @@ -1,4 +1,4 @@ -import type { ValidationError } from "../../Schema"; +import { ValidationError } from "../../Schema"; import { stringifyValidationError } from "./stringifyValidationErrors"; export class JsonError extends Error { diff --git a/src/core/schemas/builders/schema-utils/ParseError.ts b/src/core/schemas/builders/schema-utils/ParseError.ts index f1914b596..d056eb45c 100644 --- a/src/core/schemas/builders/schema-utils/ParseError.ts +++ b/src/core/schemas/builders/schema-utils/ParseError.ts @@ -1,4 +1,4 @@ -import type { ValidationError } from "../../Schema"; +import { ValidationError } from "../../Schema"; import { stringifyValidationError } from "./stringifyValidationErrors"; export class ParseError extends Error { diff --git a/src/core/schemas/builders/schema-utils/getSchemaUtils.ts b/src/core/schemas/builders/schema-utils/getSchemaUtils.ts index 91381a1d6..d5e7a955d 100644 --- a/src/core/schemas/builders/schema-utils/getSchemaUtils.ts +++ b/src/core/schemas/builders/schema-utils/getSchemaUtils.ts @@ -1,4 +1,4 @@ -import { type BaseSchema, type Schema, type SchemaOptions, SchemaType } from "../../Schema"; +import { BaseSchema, Schema, SchemaOptions, SchemaType } from "../../Schema"; import { JsonError } from "./JsonError"; import { ParseError } from "./ParseError"; diff --git a/src/core/schemas/builders/schema-utils/index.ts b/src/core/schemas/builders/schema-utils/index.ts index 9d0eed7ae..aa04e051d 100644 --- a/src/core/schemas/builders/schema-utils/index.ts +++ b/src/core/schemas/builders/schema-utils/index.ts @@ -1,4 +1,4 @@ -export type { SchemaUtils } from "./getSchemaUtils"; export { getSchemaUtils, optional, transform } from "./getSchemaUtils"; +export type { SchemaUtils } from "./getSchemaUtils"; export { JsonError } from "./JsonError"; export { ParseError } from "./ParseError"; diff --git a/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts b/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts index 1066d0038..4160f0a26 100644 --- a/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts +++ b/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts @@ -1,4 +1,4 @@ -import type { ValidationError } from "../../Schema"; +import { ValidationError } from "../../Schema"; export function stringifyValidationError(error: ValidationError): string { if (error.path.length === 0) { diff --git a/src/core/schemas/builders/set/set.ts b/src/core/schemas/builders/set/set.ts index bf31bc5fd..e9e6bb7e5 100644 --- a/src/core/schemas/builders/set/set.ts +++ b/src/core/schemas/builders/set/set.ts @@ -1,8 +1,8 @@ -import { type BaseSchema, type Schema, SchemaType } from "../../Schema"; +import { BaseSchema, Schema, SchemaType } from "../../Schema"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { list } from "../list/index"; -import { getSchemaUtils } from "../schema-utils/index"; +import { list } from "../list"; +import { getSchemaUtils } from "../schema-utils"; export function set(schema: Schema): Schema> { const listSchema = list(schema); diff --git a/src/core/schemas/builders/undiscriminated-union/types.ts b/src/core/schemas/builders/undiscriminated-union/types.ts index 3ef19e2c0..4f0888aaf 100644 --- a/src/core/schemas/builders/undiscriminated-union/types.ts +++ b/src/core/schemas/builders/undiscriminated-union/types.ts @@ -1,4 +1,4 @@ -import type { inferParsed, inferRaw, Schema } from "../../Schema"; +import { Schema, inferParsed, inferRaw } from "../../Schema"; export type UndiscriminatedUnionSchema = Schema< inferRawUnidiscriminatedUnionSchema, diff --git a/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts b/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts index 26ad5f9b9..a5cf01fa5 100644 --- a/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts +++ b/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts @@ -1,14 +1,7 @@ -import { - type BaseSchema, - type MaybeValid, - type Schema, - type SchemaOptions, - SchemaType, - type ValidationError, -} from "../../Schema"; +import { BaseSchema, MaybeValid, Schema, SchemaOptions, SchemaType, ValidationError } from "../../Schema"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils/index"; -import type { inferParsedUnidiscriminatedUnionSchema, inferRawUnidiscriminatedUnionSchema } from "./types"; +import { getSchemaUtils } from "../schema-utils"; +import { inferParsedUnidiscriminatedUnionSchema, inferRawUnidiscriminatedUnionSchema } from "./types"; export function undiscriminatedUnion, ...Schema[]]>( schemas: Schemas, diff --git a/src/core/schemas/builders/union/index.ts b/src/core/schemas/builders/union/index.ts index 22289b667..85fc008a2 100644 --- a/src/core/schemas/builders/union/index.ts +++ b/src/core/schemas/builders/union/index.ts @@ -1,5 +1,5 @@ -export type { Discriminant } from "./discriminant"; export { discriminant } from "./discriminant"; +export type { Discriminant } from "./discriminant"; export type { inferParsedDiscriminant, inferParsedUnion, diff --git a/src/core/schemas/builders/union/types.ts b/src/core/schemas/builders/union/types.ts index 79753436d..7ac9d16d6 100644 --- a/src/core/schemas/builders/union/types.ts +++ b/src/core/schemas/builders/union/types.ts @@ -1,5 +1,5 @@ -import type { inferParsedObject, inferRawObject, ObjectSchema } from "../object/index"; -import type { Discriminant } from "./discriminant"; +import { ObjectSchema, inferParsedObject, inferRawObject } from "../object"; +import { Discriminant } from "./discriminant"; export type UnionSubtypes = { [K in DiscriminantValues]: ObjectSchema; diff --git a/src/core/schemas/builders/union/union.ts b/src/core/schemas/builders/union/union.ts index 7da4271a2..afdd5a1f5 100644 --- a/src/core/schemas/builders/union/union.ts +++ b/src/core/schemas/builders/union/union.ts @@ -1,20 +1,14 @@ -import { type BaseSchema, type MaybeValid, SchemaType } from "../../Schema"; +import { BaseSchema, MaybeValid, SchemaType } from "../../Schema"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { isPlainObject } from "../../utils/isPlainObject"; import { keys } from "../../utils/keys"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { enum_ } from "../enum/index"; -import type { ObjectSchema } from "../object/index"; -import { getObjectLikeUtils, type ObjectLikeSchema } from "../object-like"; -import { getSchemaUtils } from "../schema-utils/index"; -import type { Discriminant } from "./discriminant"; -import type { - inferParsedDiscriminant, - inferParsedUnion, - inferRawDiscriminant, - inferRawUnion, - UnionSubtypes, -} from "./types"; +import { enum_ } from "../enum"; +import { ObjectSchema } from "../object"; +import { ObjectLikeSchema, getObjectLikeUtils } from "../object-like"; +import { getSchemaUtils } from "../schema-utils"; +import { Discriminant } from "./discriminant"; +import { UnionSubtypes, inferParsedDiscriminant, inferParsedUnion, inferRawDiscriminant, inferRawUnion } from "./types"; export function union, U extends UnionSubtypes>( discriminant: D, diff --git a/src/core/schemas/index.ts b/src/core/schemas/index.ts index 60c0b5988..5429d8b43 100644 --- a/src/core/schemas/index.ts +++ b/src/core/schemas/index.ts @@ -1,2 +1,2 @@ -export * from "./builders/index"; +export * from "./builders"; export type { inferParsed, inferRaw, Schema, SchemaOptions } from "./Schema"; diff --git a/src/core/schemas/utils/createIdentitySchemaCreator.ts b/src/core/schemas/utils/createIdentitySchemaCreator.ts index d299ada74..4db71be4a 100644 --- a/src/core/schemas/utils/createIdentitySchemaCreator.ts +++ b/src/core/schemas/utils/createIdentitySchemaCreator.ts @@ -1,5 +1,5 @@ -import { getSchemaUtils } from "../builders/schema-utils/index"; -import type { BaseSchema, MaybeValid, Schema, SchemaOptions, SchemaType } from "../Schema"; +import { BaseSchema, MaybeValid, Schema, SchemaOptions, SchemaType } from "../Schema"; +import { getSchemaUtils } from "../builders/schema-utils"; import { maybeSkipValidation } from "./maybeSkipValidation"; export function createIdentitySchemaCreator( diff --git a/src/core/schemas/utils/maybeSkipValidation.ts b/src/core/schemas/utils/maybeSkipValidation.ts index 70be6478b..950d5f9c5 100644 --- a/src/core/schemas/utils/maybeSkipValidation.ts +++ b/src/core/schemas/utils/maybeSkipValidation.ts @@ -1,4 +1,4 @@ -import type { BaseSchema, MaybeValid, SchemaOptions } from "../Schema"; +import { BaseSchema, MaybeValid, SchemaOptions } from "../Schema"; export function maybeSkipValidation, Raw, Parsed>(schema: S): S { return { @@ -15,7 +15,7 @@ function transformAndMaybeSkipValidation( const transformed = transform(value, opts); const { skipValidation = false } = opts ?? {}; if (!transformed.ok && skipValidation) { - // biome-ignore lint/suspicious/noConsole: allow console + // eslint-disable-next-line no-console console.warn( [ "Failed to validate.", diff --git a/src/core/url/encodePathParam.ts b/src/core/url/encodePathParam.ts deleted file mode 100644 index 19b901244..000000000 --- a/src/core/url/encodePathParam.ts +++ /dev/null @@ -1,18 +0,0 @@ -export function encodePathParam(param: unknown): string { - if (param === null) { - return "null"; - } - const typeofParam = typeof param; - switch (typeofParam) { - case "undefined": - return "undefined"; - case "string": - case "number": - case "boolean": - break; - default: - param = String(param); - break; - } - return encodeURIComponent(param as string | number | boolean); -} diff --git a/src/core/url/index.ts b/src/core/url/index.ts index 62f9123be..35ed375f6 100644 --- a/src/core/url/index.ts +++ b/src/core/url/index.ts @@ -1,3 +1,2 @@ -export { encodePathParam } from "./encodePathParam"; export { join } from "./join"; export { toQueryString } from "./qs"; diff --git a/src/core/url/join.ts b/src/core/url/join.ts index 7ca7daef0..1dda77923 100644 --- a/src/core/url/join.ts +++ b/src/core/url/join.ts @@ -3,21 +3,15 @@ export function join(base: string, ...segments: string[]): string { return ""; } - if (segments.length === 0) { - return base; - } - if (base.includes("://")) { let url: URL; try { url = new URL(base); } catch { + // Fallback to path joining if URL is malformed return joinPath(base, ...segments); } - const lastSegment = segments[segments.length - 1]; - const shouldPreserveTrailingSlash = lastSegment?.endsWith("/"); - for (const segment of segments) { const cleanSegment = trimSlashes(segment); if (cleanSegment) { @@ -25,10 +19,6 @@ export function join(base: string, ...segments: string[]): string { } } - if (shouldPreserveTrailingSlash && !url.pathname.endsWith("/")) { - url.pathname += "/"; - } - return url.toString(); } @@ -36,15 +26,8 @@ export function join(base: string, ...segments: string[]): string { } function joinPath(base: string, ...segments: string[]): string { - if (segments.length === 0) { - return base; - } - let result = base; - const lastSegment = segments[segments.length - 1]; - const shouldPreserveTrailingSlash = lastSegment?.endsWith("/"); - for (const segment of segments) { const cleanSegment = trimSlashes(segment); if (cleanSegment) { @@ -52,10 +35,6 @@ function joinPath(base: string, ...segments: string[]): string { } } - if (shouldPreserveTrailingSlash && !result.endsWith("/")) { - result += "/"; - } - return result; } @@ -63,17 +42,14 @@ function joinPathSegments(left: string, right: string): string { if (left.endsWith("/")) { return left + right; } - return `${left}/${right}`; + return left + "/" + right; } function trimSlashes(str: string): string { if (!str) return str; - let start = 0; - let end = str.length; - - if (str.startsWith("/")) start = 1; - if (str.endsWith("/")) end = str.length - 1; + let start = str.startsWith("/") ? 1 : 0; + let end = str.endsWith("/") ? str.length - 1 : str.length; - return start === 0 && end === str.length ? str : str.slice(start, end); + return str.slice(start, end); } diff --git a/src/environments.ts b/src/environments.ts index 5b1f7f5bf..3f579afbe 100644 --- a/src/environments.ts +++ b/src/environments.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export const SquareEnvironment = { Production: "https://connect.squareup.com", diff --git a/src/errors/SquareTimeoutError.ts b/src/errors/SquareTimeoutError.ts index d56259097..fb095ec5d 100644 --- a/src/errors/SquareTimeoutError.ts +++ b/src/errors/SquareTimeoutError.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export class SquareTimeoutError extends Error { constructor(message: string) { diff --git a/src/exports.ts b/src/exports.ts deleted file mode 100644 index 3a8ebd66b..000000000 --- a/src/exports.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./core/exports"; diff --git a/src/serialization/index.ts b/src/serialization/index.ts index 3e15e2907..3ce0a3e38 100644 --- a/src/serialization/index.ts +++ b/src/serialization/index.ts @@ -1,2 +1,2 @@ -export * from "./resources"; export * from "./types"; +export * from "./resources"; diff --git a/src/serialization/resources/applePay/client/requests/RegisterDomainRequest.ts b/src/serialization/resources/applePay/client/requests/RegisterDomainRequest.ts index bf48c589d..97287234c 100644 --- a/src/serialization/resources/applePay/client/requests/RegisterDomainRequest.ts +++ b/src/serialization/resources/applePay/client/requests/RegisterDomainRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const RegisterDomainRequest: core.serialization.Schema< serializers.RegisterDomainRequest.Raw, diff --git a/src/serialization/resources/bookings/client/requests/BulkRetrieveBookingsRequest.ts b/src/serialization/resources/bookings/client/requests/BulkRetrieveBookingsRequest.ts index 43ce95964..e6488498f 100644 --- a/src/serialization/resources/bookings/client/requests/BulkRetrieveBookingsRequest.ts +++ b/src/serialization/resources/bookings/client/requests/BulkRetrieveBookingsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const BulkRetrieveBookingsRequest: core.serialization.Schema< serializers.BulkRetrieveBookingsRequest.Raw, diff --git a/src/serialization/resources/bookings/client/requests/BulkRetrieveTeamMemberBookingProfilesRequest.ts b/src/serialization/resources/bookings/client/requests/BulkRetrieveTeamMemberBookingProfilesRequest.ts index 230088a37..539faef24 100644 --- a/src/serialization/resources/bookings/client/requests/BulkRetrieveTeamMemberBookingProfilesRequest.ts +++ b/src/serialization/resources/bookings/client/requests/BulkRetrieveTeamMemberBookingProfilesRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const BulkRetrieveTeamMemberBookingProfilesRequest: core.serialization.Schema< serializers.BulkRetrieveTeamMemberBookingProfilesRequest.Raw, diff --git a/src/serialization/resources/bookings/client/requests/CancelBookingRequest.ts b/src/serialization/resources/bookings/client/requests/CancelBookingRequest.ts index 454883046..f56a21f2b 100644 --- a/src/serialization/resources/bookings/client/requests/CancelBookingRequest.ts +++ b/src/serialization/resources/bookings/client/requests/CancelBookingRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const CancelBookingRequest: core.serialization.Schema< serializers.CancelBookingRequest.Raw, @@ -14,7 +16,7 @@ export const CancelBookingRequest: core.serialization.Schema< export declare namespace CancelBookingRequest { export interface Raw { - idempotency_key?: (string | null | undefined) | null; - booking_version?: (number | null | undefined) | null; + idempotency_key?: (string | null) | null; + booking_version?: (number | null) | null; } } diff --git a/src/serialization/resources/bookings/client/requests/CreateBookingRequest.ts b/src/serialization/resources/bookings/client/requests/CreateBookingRequest.ts index c0a288e64..922b63ca0 100644 --- a/src/serialization/resources/bookings/client/requests/CreateBookingRequest.ts +++ b/src/serialization/resources/bookings/client/requests/CreateBookingRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { Booking } from "../../../../types/Booking"; export const CreateBookingRequest: core.serialization.Schema< diff --git a/src/serialization/resources/bookings/client/requests/SearchAvailabilityRequest.ts b/src/serialization/resources/bookings/client/requests/SearchAvailabilityRequest.ts index 479c44c35..6b06472e8 100644 --- a/src/serialization/resources/bookings/client/requests/SearchAvailabilityRequest.ts +++ b/src/serialization/resources/bookings/client/requests/SearchAvailabilityRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { SearchAvailabilityQuery } from "../../../../types/SearchAvailabilityQuery"; export const SearchAvailabilityRequest: core.serialization.Schema< diff --git a/src/serialization/resources/bookings/client/requests/UpdateBookingRequest.ts b/src/serialization/resources/bookings/client/requests/UpdateBookingRequest.ts index 11964d010..2aa348a18 100644 --- a/src/serialization/resources/bookings/client/requests/UpdateBookingRequest.ts +++ b/src/serialization/resources/bookings/client/requests/UpdateBookingRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { Booking } from "../../../../types/Booking"; export const UpdateBookingRequest: core.serialization.Schema< @@ -15,7 +17,7 @@ export const UpdateBookingRequest: core.serialization.Schema< export declare namespace UpdateBookingRequest { export interface Raw { - idempotency_key?: (string | null | undefined) | null; + idempotency_key?: (string | null) | null; booking: Booking.Raw; } } diff --git a/src/serialization/resources/bookings/client/requests/index.ts b/src/serialization/resources/bookings/client/requests/index.ts index dbfd4aed2..1aaa5675b 100644 --- a/src/serialization/resources/bookings/client/requests/index.ts +++ b/src/serialization/resources/bookings/client/requests/index.ts @@ -1,6 +1,6 @@ -export { BulkRetrieveBookingsRequest } from "./BulkRetrieveBookingsRequest"; -export { BulkRetrieveTeamMemberBookingProfilesRequest } from "./BulkRetrieveTeamMemberBookingProfilesRequest"; -export { CancelBookingRequest } from "./CancelBookingRequest"; export { CreateBookingRequest } from "./CreateBookingRequest"; export { SearchAvailabilityRequest } from "./SearchAvailabilityRequest"; +export { BulkRetrieveBookingsRequest } from "./BulkRetrieveBookingsRequest"; +export { BulkRetrieveTeamMemberBookingProfilesRequest } from "./BulkRetrieveTeamMemberBookingProfilesRequest"; export { UpdateBookingRequest } from "./UpdateBookingRequest"; +export { CancelBookingRequest } from "./CancelBookingRequest"; diff --git a/src/serialization/resources/bookings/resources/customAttributeDefinitions/client/requests/CreateBookingCustomAttributeDefinitionRequest.ts b/src/serialization/resources/bookings/resources/customAttributeDefinitions/client/requests/CreateBookingCustomAttributeDefinitionRequest.ts index 59ef9785d..a52133bc1 100644 --- a/src/serialization/resources/bookings/resources/customAttributeDefinitions/client/requests/CreateBookingCustomAttributeDefinitionRequest.ts +++ b/src/serialization/resources/bookings/resources/customAttributeDefinitions/client/requests/CreateBookingCustomAttributeDefinitionRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { CustomAttributeDefinition } from "../../../../../../types/CustomAttributeDefinition"; export const CreateBookingCustomAttributeDefinitionRequest: core.serialization.Schema< diff --git a/src/serialization/resources/bookings/resources/customAttributeDefinitions/client/requests/UpdateBookingCustomAttributeDefinitionRequest.ts b/src/serialization/resources/bookings/resources/customAttributeDefinitions/client/requests/UpdateBookingCustomAttributeDefinitionRequest.ts index 38ed10702..03dbdbd47 100644 --- a/src/serialization/resources/bookings/resources/customAttributeDefinitions/client/requests/UpdateBookingCustomAttributeDefinitionRequest.ts +++ b/src/serialization/resources/bookings/resources/customAttributeDefinitions/client/requests/UpdateBookingCustomAttributeDefinitionRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { CustomAttributeDefinition } from "../../../../../../types/CustomAttributeDefinition"; export const UpdateBookingCustomAttributeDefinitionRequest: core.serialization.Schema< @@ -16,6 +18,6 @@ export const UpdateBookingCustomAttributeDefinitionRequest: core.serialization.S export declare namespace UpdateBookingCustomAttributeDefinitionRequest { export interface Raw { custom_attribute_definition: CustomAttributeDefinition.Raw; - idempotency_key?: (string | null | undefined) | null; + idempotency_key?: (string | null) | null; } } diff --git a/src/serialization/resources/bookings/resources/customAttributes/client/requests/BulkDeleteBookingCustomAttributesRequest.ts b/src/serialization/resources/bookings/resources/customAttributes/client/requests/BulkDeleteBookingCustomAttributesRequest.ts index be26c49a4..5e7d7c93b 100644 --- a/src/serialization/resources/bookings/resources/customAttributes/client/requests/BulkDeleteBookingCustomAttributesRequest.ts +++ b/src/serialization/resources/bookings/resources/customAttributes/client/requests/BulkDeleteBookingCustomAttributesRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { BookingCustomAttributeDeleteRequest } from "../../../../../../types/BookingCustomAttributeDeleteRequest"; export const BulkDeleteBookingCustomAttributesRequest: core.serialization.Schema< diff --git a/src/serialization/resources/bookings/resources/customAttributes/client/requests/BulkUpsertBookingCustomAttributesRequest.ts b/src/serialization/resources/bookings/resources/customAttributes/client/requests/BulkUpsertBookingCustomAttributesRequest.ts index d10f55ec0..0c2323579 100644 --- a/src/serialization/resources/bookings/resources/customAttributes/client/requests/BulkUpsertBookingCustomAttributesRequest.ts +++ b/src/serialization/resources/bookings/resources/customAttributes/client/requests/BulkUpsertBookingCustomAttributesRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { BookingCustomAttributeUpsertRequest } from "../../../../../../types/BookingCustomAttributeUpsertRequest"; export const BulkUpsertBookingCustomAttributesRequest: core.serialization.Schema< diff --git a/src/serialization/resources/bookings/resources/customAttributes/client/requests/UpsertBookingCustomAttributeRequest.ts b/src/serialization/resources/bookings/resources/customAttributes/client/requests/UpsertBookingCustomAttributeRequest.ts index ba6ad659f..178e21f1e 100644 --- a/src/serialization/resources/bookings/resources/customAttributes/client/requests/UpsertBookingCustomAttributeRequest.ts +++ b/src/serialization/resources/bookings/resources/customAttributes/client/requests/UpsertBookingCustomAttributeRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { CustomAttribute } from "../../../../../../types/CustomAttribute"; export const UpsertBookingCustomAttributeRequest: core.serialization.Schema< @@ -16,6 +18,6 @@ export const UpsertBookingCustomAttributeRequest: core.serialization.Schema< export declare namespace UpsertBookingCustomAttributeRequest { export interface Raw { custom_attribute: CustomAttribute.Raw; - idempotency_key?: (string | null | undefined) | null; + idempotency_key?: (string | null) | null; } } diff --git a/src/serialization/resources/cards/client/requests/CreateCardRequest.ts b/src/serialization/resources/cards/client/requests/CreateCardRequest.ts index 9a05da154..73ff67ad7 100644 --- a/src/serialization/resources/cards/client/requests/CreateCardRequest.ts +++ b/src/serialization/resources/cards/client/requests/CreateCardRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { Card } from "../../../../types/Card"; export const CreateCardRequest: core.serialization.Schema = diff --git a/src/serialization/resources/catalog/client/requests/BatchDeleteCatalogObjectsRequest.ts b/src/serialization/resources/catalog/client/requests/BatchDeleteCatalogObjectsRequest.ts index 835d76b91..4f103bc79 100644 --- a/src/serialization/resources/catalog/client/requests/BatchDeleteCatalogObjectsRequest.ts +++ b/src/serialization/resources/catalog/client/requests/BatchDeleteCatalogObjectsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const BatchDeleteCatalogObjectsRequest: core.serialization.Schema< serializers.BatchDeleteCatalogObjectsRequest.Raw, diff --git a/src/serialization/resources/catalog/client/requests/BatchGetCatalogObjectsRequest.ts b/src/serialization/resources/catalog/client/requests/BatchGetCatalogObjectsRequest.ts index f8042b3a3..f926078f4 100644 --- a/src/serialization/resources/catalog/client/requests/BatchGetCatalogObjectsRequest.ts +++ b/src/serialization/resources/catalog/client/requests/BatchGetCatalogObjectsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const BatchGetCatalogObjectsRequest: core.serialization.Schema< serializers.BatchGetCatalogObjectsRequest.Raw, @@ -27,9 +29,9 @@ export const BatchGetCatalogObjectsRequest: core.serialization.Schema< export declare namespace BatchGetCatalogObjectsRequest { export interface Raw { object_ids: string[]; - include_related_objects?: (boolean | null | undefined) | null; - catalog_version?: ((bigint | number) | null | undefined) | null; - include_deleted_objects?: (boolean | null | undefined) | null; - include_category_path_to_root?: (boolean | null | undefined) | null; + include_related_objects?: (boolean | null) | null; + catalog_version?: ((bigint | number) | null) | null; + include_deleted_objects?: (boolean | null) | null; + include_category_path_to_root?: (boolean | null) | null; } } diff --git a/src/serialization/resources/catalog/client/requests/BatchUpsertCatalogObjectsRequest.ts b/src/serialization/resources/catalog/client/requests/BatchUpsertCatalogObjectsRequest.ts index b0f749826..406212100 100644 --- a/src/serialization/resources/catalog/client/requests/BatchUpsertCatalogObjectsRequest.ts +++ b/src/serialization/resources/catalog/client/requests/BatchUpsertCatalogObjectsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { CatalogObjectBatch } from "../../../../types/CatalogObjectBatch"; export const BatchUpsertCatalogObjectsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/catalog/client/requests/SearchCatalogItemsRequest.ts b/src/serialization/resources/catalog/client/requests/SearchCatalogItemsRequest.ts index 8f317af1a..cee9e8946 100644 --- a/src/serialization/resources/catalog/client/requests/SearchCatalogItemsRequest.ts +++ b/src/serialization/resources/catalog/client/requests/SearchCatalogItemsRequest.ts @@ -1,13 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; -import { ArchivedState } from "../../../../types/ArchivedState"; -import { CatalogItemProductType } from "../../../../types/CatalogItemProductType"; -import { CustomAttributeFilter } from "../../../../types/CustomAttributeFilter"; import { SearchCatalogItemsRequestStockLevel } from "../../../../types/SearchCatalogItemsRequestStockLevel"; import { SortOrder } from "../../../../types/SortOrder"; +import { CatalogItemProductType } from "../../../../types/CatalogItemProductType"; +import { CustomAttributeFilter } from "../../../../types/CustomAttributeFilter"; +import { ArchivedState } from "../../../../types/ArchivedState"; export const SearchCatalogItemsRequest: core.serialization.Schema< serializers.SearchCatalogItemsRequest.Raw, diff --git a/src/serialization/resources/catalog/client/requests/SearchCatalogObjectsRequest.ts b/src/serialization/resources/catalog/client/requests/SearchCatalogObjectsRequest.ts index aec46cc92..12c4e5e08 100644 --- a/src/serialization/resources/catalog/client/requests/SearchCatalogObjectsRequest.ts +++ b/src/serialization/resources/catalog/client/requests/SearchCatalogObjectsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { CatalogObjectType } from "../../../../types/CatalogObjectType"; import { CatalogQuery } from "../../../../types/CatalogQuery"; diff --git a/src/serialization/resources/catalog/client/requests/UpdateItemModifierListsRequest.ts b/src/serialization/resources/catalog/client/requests/UpdateItemModifierListsRequest.ts index 45c3c6103..21947e2ce 100644 --- a/src/serialization/resources/catalog/client/requests/UpdateItemModifierListsRequest.ts +++ b/src/serialization/resources/catalog/client/requests/UpdateItemModifierListsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const UpdateItemModifierListsRequest: core.serialization.Schema< serializers.UpdateItemModifierListsRequest.Raw, @@ -22,7 +24,7 @@ export const UpdateItemModifierListsRequest: core.serialization.Schema< export declare namespace UpdateItemModifierListsRequest { export interface Raw { item_ids: string[]; - modifier_lists_to_enable?: (string[] | null | undefined) | null; - modifier_lists_to_disable?: (string[] | null | undefined) | null; + modifier_lists_to_enable?: (string[] | null) | null; + modifier_lists_to_disable?: (string[] | null) | null; } } diff --git a/src/serialization/resources/catalog/client/requests/UpdateItemTaxesRequest.ts b/src/serialization/resources/catalog/client/requests/UpdateItemTaxesRequest.ts index 1df9dc5b2..c73ede6bf 100644 --- a/src/serialization/resources/catalog/client/requests/UpdateItemTaxesRequest.ts +++ b/src/serialization/resources/catalog/client/requests/UpdateItemTaxesRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const UpdateItemTaxesRequest: core.serialization.Schema< serializers.UpdateItemTaxesRequest.Raw, @@ -22,7 +24,7 @@ export const UpdateItemTaxesRequest: core.serialization.Schema< export declare namespace UpdateItemTaxesRequest { export interface Raw { item_ids: string[]; - taxes_to_enable?: (string[] | null | undefined) | null; - taxes_to_disable?: (string[] | null | undefined) | null; + taxes_to_enable?: (string[] | null) | null; + taxes_to_disable?: (string[] | null) | null; } } diff --git a/src/serialization/resources/catalog/client/requests/index.ts b/src/serialization/resources/catalog/client/requests/index.ts index 1d253ff9d..b6dd6da9f 100644 --- a/src/serialization/resources/catalog/client/requests/index.ts +++ b/src/serialization/resources/catalog/client/requests/index.ts @@ -1,7 +1,7 @@ export { BatchDeleteCatalogObjectsRequest } from "./BatchDeleteCatalogObjectsRequest"; export { BatchGetCatalogObjectsRequest } from "./BatchGetCatalogObjectsRequest"; export { BatchUpsertCatalogObjectsRequest } from "./BatchUpsertCatalogObjectsRequest"; -export { SearchCatalogItemsRequest } from "./SearchCatalogItemsRequest"; export { SearchCatalogObjectsRequest } from "./SearchCatalogObjectsRequest"; +export { SearchCatalogItemsRequest } from "./SearchCatalogItemsRequest"; export { UpdateItemModifierListsRequest } from "./UpdateItemModifierListsRequest"; export { UpdateItemTaxesRequest } from "./UpdateItemTaxesRequest"; diff --git a/src/serialization/resources/catalog/resources/object/client/requests/UpsertCatalogObjectRequest.ts b/src/serialization/resources/catalog/resources/object/client/requests/UpsertCatalogObjectRequest.ts index a099e90bc..23e780a0c 100644 --- a/src/serialization/resources/catalog/resources/object/client/requests/UpsertCatalogObjectRequest.ts +++ b/src/serialization/resources/catalog/resources/object/client/requests/UpsertCatalogObjectRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; -import * as core from "../../../../../../../core"; import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; +import * as core from "../../../../../../../core"; export const UpsertCatalogObjectRequest: core.serialization.Schema< serializers.catalog.UpsertCatalogObjectRequest.Raw, diff --git a/src/serialization/resources/channels/client/index.ts b/src/serialization/resources/channels/client/index.ts deleted file mode 100644 index 415726b7f..000000000 --- a/src/serialization/resources/channels/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests"; diff --git a/src/serialization/resources/channels/client/requests/BulkRetrieveChannelsRequest.ts b/src/serialization/resources/channels/client/requests/BulkRetrieveChannelsRequest.ts deleted file mode 100644 index 3510ad653..000000000 --- a/src/serialization/resources/channels/client/requests/BulkRetrieveChannelsRequest.ts +++ /dev/null @@ -1,18 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../../../../api/index"; -import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; - -export const BulkRetrieveChannelsRequest: core.serialization.Schema< - serializers.BulkRetrieveChannelsRequest.Raw, - Square.BulkRetrieveChannelsRequest -> = core.serialization.object({ - channelIds: core.serialization.property("channel_ids", core.serialization.list(core.serialization.string())), -}); - -export declare namespace BulkRetrieveChannelsRequest { - export interface Raw { - channel_ids: string[]; - } -} diff --git a/src/serialization/resources/channels/client/requests/index.ts b/src/serialization/resources/channels/client/requests/index.ts deleted file mode 100644 index 1b0856e98..000000000 --- a/src/serialization/resources/channels/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { BulkRetrieveChannelsRequest } from "./BulkRetrieveChannelsRequest"; diff --git a/src/serialization/resources/channels/index.ts b/src/serialization/resources/channels/index.ts deleted file mode 100644 index 5ec76921e..000000000 --- a/src/serialization/resources/channels/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client"; diff --git a/src/serialization/resources/checkout/client/requests/UpdateLocationSettingsRequest.ts b/src/serialization/resources/checkout/client/requests/UpdateLocationSettingsRequest.ts index c95ec97cb..f6714b1b2 100644 --- a/src/serialization/resources/checkout/client/requests/UpdateLocationSettingsRequest.ts +++ b/src/serialization/resources/checkout/client/requests/UpdateLocationSettingsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { CheckoutLocationSettings } from "../../../../types/CheckoutLocationSettings"; export const UpdateLocationSettingsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/checkout/client/requests/UpdateMerchantSettingsRequest.ts b/src/serialization/resources/checkout/client/requests/UpdateMerchantSettingsRequest.ts index bbedcbfda..669eefeb1 100644 --- a/src/serialization/resources/checkout/client/requests/UpdateMerchantSettingsRequest.ts +++ b/src/serialization/resources/checkout/client/requests/UpdateMerchantSettingsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { CheckoutMerchantSettings } from "../../../../types/CheckoutMerchantSettings"; export const UpdateMerchantSettingsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/checkout/resources/paymentLinks/client/requests/CreatePaymentLinkRequest.ts b/src/serialization/resources/checkout/resources/paymentLinks/client/requests/CreatePaymentLinkRequest.ts index 8bbb67333..be573a9cd 100644 --- a/src/serialization/resources/checkout/resources/paymentLinks/client/requests/CreatePaymentLinkRequest.ts +++ b/src/serialization/resources/checkout/resources/paymentLinks/client/requests/CreatePaymentLinkRequest.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; -import { CheckoutOptions } from "../../../../../../types/CheckoutOptions"; +import { QuickPay } from "../../../../../../types/QuickPay"; import { Order } from "../../../../../../types/Order"; +import { CheckoutOptions } from "../../../../../../types/CheckoutOptions"; import { PrePopulatedData } from "../../../../../../types/PrePopulatedData"; -import { QuickPay } from "../../../../../../types/QuickPay"; export const CreatePaymentLinkRequest: core.serialization.Schema< serializers.checkout.CreatePaymentLinkRequest.Raw, diff --git a/src/serialization/resources/checkout/resources/paymentLinks/client/requests/UpdatePaymentLinkRequest.ts b/src/serialization/resources/checkout/resources/paymentLinks/client/requests/UpdatePaymentLinkRequest.ts index dae5b0687..6e19fa86d 100644 --- a/src/serialization/resources/checkout/resources/paymentLinks/client/requests/UpdatePaymentLinkRequest.ts +++ b/src/serialization/resources/checkout/resources/paymentLinks/client/requests/UpdatePaymentLinkRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { PaymentLink } from "../../../../../../types/PaymentLink"; export const UpdatePaymentLinkRequest: core.serialization.Schema< diff --git a/src/serialization/resources/customers/client/requests/BulkCreateCustomersRequest.ts b/src/serialization/resources/customers/client/requests/BulkCreateCustomersRequest.ts index a519ab423..d42b1ff21 100644 --- a/src/serialization/resources/customers/client/requests/BulkCreateCustomersRequest.ts +++ b/src/serialization/resources/customers/client/requests/BulkCreateCustomersRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { BulkCreateCustomerData } from "../../../../types/BulkCreateCustomerData"; export const BulkCreateCustomersRequest: core.serialization.Schema< diff --git a/src/serialization/resources/customers/client/requests/BulkDeleteCustomersRequest.ts b/src/serialization/resources/customers/client/requests/BulkDeleteCustomersRequest.ts index db04e30a1..8894849f1 100644 --- a/src/serialization/resources/customers/client/requests/BulkDeleteCustomersRequest.ts +++ b/src/serialization/resources/customers/client/requests/BulkDeleteCustomersRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const BulkDeleteCustomersRequest: core.serialization.Schema< serializers.BulkDeleteCustomersRequest.Raw, diff --git a/src/serialization/resources/customers/client/requests/BulkRetrieveCustomersRequest.ts b/src/serialization/resources/customers/client/requests/BulkRetrieveCustomersRequest.ts index 266d79a42..d37cd7f6d 100644 --- a/src/serialization/resources/customers/client/requests/BulkRetrieveCustomersRequest.ts +++ b/src/serialization/resources/customers/client/requests/BulkRetrieveCustomersRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const BulkRetrieveCustomersRequest: core.serialization.Schema< serializers.BulkRetrieveCustomersRequest.Raw, diff --git a/src/serialization/resources/customers/client/requests/BulkUpdateCustomersRequest.ts b/src/serialization/resources/customers/client/requests/BulkUpdateCustomersRequest.ts index 0877084f7..510ce5a1b 100644 --- a/src/serialization/resources/customers/client/requests/BulkUpdateCustomersRequest.ts +++ b/src/serialization/resources/customers/client/requests/BulkUpdateCustomersRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { BulkUpdateCustomerData } from "../../../../types/BulkUpdateCustomerData"; export const BulkUpdateCustomersRequest: core.serialization.Schema< diff --git a/src/serialization/resources/customers/client/requests/CreateCustomerRequest.ts b/src/serialization/resources/customers/client/requests/CreateCustomerRequest.ts index 9542d7b51..95935b7f1 100644 --- a/src/serialization/resources/customers/client/requests/CreateCustomerRequest.ts +++ b/src/serialization/resources/customers/client/requests/CreateCustomerRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { Address } from "../../../../types/Address"; import { CustomerTaxIds } from "../../../../types/CustomerTaxIds"; diff --git a/src/serialization/resources/customers/client/requests/SearchCustomersRequest.ts b/src/serialization/resources/customers/client/requests/SearchCustomersRequest.ts index b823cc0e8..349ab95d6 100644 --- a/src/serialization/resources/customers/client/requests/SearchCustomersRequest.ts +++ b/src/serialization/resources/customers/client/requests/SearchCustomersRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { CustomerQuery } from "../../../../types/CustomerQuery"; export const SearchCustomersRequest: core.serialization.Schema< diff --git a/src/serialization/resources/customers/client/requests/UpdateCustomerRequest.ts b/src/serialization/resources/customers/client/requests/UpdateCustomerRequest.ts index b9fb2b856..bbf9cb37f 100644 --- a/src/serialization/resources/customers/client/requests/UpdateCustomerRequest.ts +++ b/src/serialization/resources/customers/client/requests/UpdateCustomerRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { Address } from "../../../../types/Address"; import { CustomerTaxIds } from "../../../../types/CustomerTaxIds"; @@ -26,16 +28,16 @@ export const UpdateCustomerRequest: core.serialization.Schema< export declare namespace UpdateCustomerRequest { export interface Raw { - given_name?: (string | null | undefined) | null; - family_name?: (string | null | undefined) | null; - company_name?: (string | null | undefined) | null; - nickname?: (string | null | undefined) | null; - email_address?: (string | null | undefined) | null; + given_name?: (string | null) | null; + family_name?: (string | null) | null; + company_name?: (string | null) | null; + nickname?: (string | null) | null; + email_address?: (string | null) | null; address?: Address.Raw | null; - phone_number?: (string | null | undefined) | null; - reference_id?: (string | null | undefined) | null; - note?: (string | null | undefined) | null; - birthday?: (string | null | undefined) | null; + phone_number?: (string | null) | null; + reference_id?: (string | null) | null; + note?: (string | null) | null; + birthday?: (string | null) | null; version?: (bigint | number) | null; tax_ids?: CustomerTaxIds.Raw | null; } diff --git a/src/serialization/resources/customers/client/requests/index.ts b/src/serialization/resources/customers/client/requests/index.ts index 9e37d39ff..636aa1ff9 100644 --- a/src/serialization/resources/customers/client/requests/index.ts +++ b/src/serialization/resources/customers/client/requests/index.ts @@ -1,7 +1,7 @@ +export { CreateCustomerRequest } from "./CreateCustomerRequest"; export { BulkCreateCustomersRequest } from "./BulkCreateCustomersRequest"; export { BulkDeleteCustomersRequest } from "./BulkDeleteCustomersRequest"; export { BulkRetrieveCustomersRequest } from "./BulkRetrieveCustomersRequest"; export { BulkUpdateCustomersRequest } from "./BulkUpdateCustomersRequest"; -export { CreateCustomerRequest } from "./CreateCustomerRequest"; export { SearchCustomersRequest } from "./SearchCustomersRequest"; export { UpdateCustomerRequest } from "./UpdateCustomerRequest"; diff --git a/src/serialization/resources/customers/resources/cards/client/requests/CreateCustomerCardRequest.ts b/src/serialization/resources/customers/resources/cards/client/requests/CreateCustomerCardRequest.ts index 1357f7fd3..0ea65fbb0 100644 --- a/src/serialization/resources/customers/resources/cards/client/requests/CreateCustomerCardRequest.ts +++ b/src/serialization/resources/customers/resources/cards/client/requests/CreateCustomerCardRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { Address } from "../../../../../../types/Address"; export const CreateCustomerCardRequest: core.serialization.Schema< diff --git a/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/BatchUpsertCustomerCustomAttributesRequest.ts b/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/BatchUpsertCustomerCustomAttributesRequest.ts index deb61dbe4..23170882a 100644 --- a/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/BatchUpsertCustomerCustomAttributesRequest.ts +++ b/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/BatchUpsertCustomerCustomAttributesRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest } from "../../../../../../types/BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest"; export const BatchUpsertCustomerCustomAttributesRequest: core.serialization.Schema< diff --git a/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/CreateCustomerCustomAttributeDefinitionRequest.ts b/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/CreateCustomerCustomAttributeDefinitionRequest.ts index 7636c102b..43afb4dfe 100644 --- a/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/CreateCustomerCustomAttributeDefinitionRequest.ts +++ b/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/CreateCustomerCustomAttributeDefinitionRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { CustomAttributeDefinition } from "../../../../../../types/CustomAttributeDefinition"; export const CreateCustomerCustomAttributeDefinitionRequest: core.serialization.Schema< diff --git a/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/UpdateCustomerCustomAttributeDefinitionRequest.ts b/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/UpdateCustomerCustomAttributeDefinitionRequest.ts index 5be6af2e8..f68b95d9b 100644 --- a/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/UpdateCustomerCustomAttributeDefinitionRequest.ts +++ b/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/UpdateCustomerCustomAttributeDefinitionRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { CustomAttributeDefinition } from "../../../../../../types/CustomAttributeDefinition"; export const UpdateCustomerCustomAttributeDefinitionRequest: core.serialization.Schema< @@ -16,6 +18,6 @@ export const UpdateCustomerCustomAttributeDefinitionRequest: core.serialization. export declare namespace UpdateCustomerCustomAttributeDefinitionRequest { export interface Raw { custom_attribute_definition: CustomAttributeDefinition.Raw; - idempotency_key?: (string | null | undefined) | null; + idempotency_key?: (string | null) | null; } } diff --git a/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/index.ts b/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/index.ts index 15bd6da63..3e6e7c1f4 100644 --- a/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/index.ts +++ b/src/serialization/resources/customers/resources/customAttributeDefinitions/client/requests/index.ts @@ -1,3 +1,3 @@ -export { BatchUpsertCustomerCustomAttributesRequest } from "./BatchUpsertCustomerCustomAttributesRequest"; export { CreateCustomerCustomAttributeDefinitionRequest } from "./CreateCustomerCustomAttributeDefinitionRequest"; export { UpdateCustomerCustomAttributeDefinitionRequest } from "./UpdateCustomerCustomAttributeDefinitionRequest"; +export { BatchUpsertCustomerCustomAttributesRequest } from "./BatchUpsertCustomerCustomAttributesRequest"; diff --git a/src/serialization/resources/customers/resources/customAttributes/client/requests/UpsertCustomerCustomAttributeRequest.ts b/src/serialization/resources/customers/resources/customAttributes/client/requests/UpsertCustomerCustomAttributeRequest.ts index c172e2ff0..b7fb5cecf 100644 --- a/src/serialization/resources/customers/resources/customAttributes/client/requests/UpsertCustomerCustomAttributeRequest.ts +++ b/src/serialization/resources/customers/resources/customAttributes/client/requests/UpsertCustomerCustomAttributeRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { CustomAttribute } from "../../../../../../types/CustomAttribute"; export const UpsertCustomerCustomAttributeRequest: core.serialization.Schema< @@ -16,6 +18,6 @@ export const UpsertCustomerCustomAttributeRequest: core.serialization.Schema< export declare namespace UpsertCustomerCustomAttributeRequest { export interface Raw { custom_attribute: CustomAttribute.Raw; - idempotency_key?: (string | null | undefined) | null; + idempotency_key?: (string | null) | null; } } diff --git a/src/serialization/resources/customers/resources/groups/client/requests/CreateCustomerGroupRequest.ts b/src/serialization/resources/customers/resources/groups/client/requests/CreateCustomerGroupRequest.ts index 3d7c82268..489367bda 100644 --- a/src/serialization/resources/customers/resources/groups/client/requests/CreateCustomerGroupRequest.ts +++ b/src/serialization/resources/customers/resources/groups/client/requests/CreateCustomerGroupRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { CustomerGroup } from "../../../../../../types/CustomerGroup"; export const CreateCustomerGroupRequest: core.serialization.Schema< diff --git a/src/serialization/resources/customers/resources/groups/client/requests/UpdateCustomerGroupRequest.ts b/src/serialization/resources/customers/resources/groups/client/requests/UpdateCustomerGroupRequest.ts index 7f72f61e7..763aaf1cc 100644 --- a/src/serialization/resources/customers/resources/groups/client/requests/UpdateCustomerGroupRequest.ts +++ b/src/serialization/resources/customers/resources/groups/client/requests/UpdateCustomerGroupRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { CustomerGroup } from "../../../../../../types/CustomerGroup"; export const UpdateCustomerGroupRequest: core.serialization.Schema< diff --git a/src/serialization/resources/customers/resources/index.ts b/src/serialization/resources/customers/resources/index.ts index 7f3f151e2..033a7b15f 100644 --- a/src/serialization/resources/customers/resources/index.ts +++ b/src/serialization/resources/customers/resources/index.ts @@ -1,8 +1,8 @@ -export * as cards from "./cards"; -export * from "./cards/client/requests"; export * as customAttributeDefinitions from "./customAttributeDefinitions"; export * from "./customAttributeDefinitions/client/requests"; -export * as customAttributes from "./customAttributes"; -export * from "./customAttributes/client/requests"; export * as groups from "./groups"; export * from "./groups/client/requests"; +export * as cards from "./cards"; +export * from "./cards/client/requests"; +export * as customAttributes from "./customAttributes"; +export * from "./customAttributes/client/requests"; diff --git a/src/serialization/resources/devices/resources/codes/client/requests/CreateDeviceCodeRequest.ts b/src/serialization/resources/devices/resources/codes/client/requests/CreateDeviceCodeRequest.ts index 51a11e789..de9feaac0 100644 --- a/src/serialization/resources/devices/resources/codes/client/requests/CreateDeviceCodeRequest.ts +++ b/src/serialization/resources/devices/resources/codes/client/requests/CreateDeviceCodeRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { DeviceCode } from "../../../../../../types/DeviceCode"; export const CreateDeviceCodeRequest: core.serialization.Schema< diff --git a/src/serialization/resources/disputes/client/requests/CreateDisputeEvidenceTextRequest.ts b/src/serialization/resources/disputes/client/requests/CreateDisputeEvidenceTextRequest.ts index 264ffb28d..bcb89e5ab 100644 --- a/src/serialization/resources/disputes/client/requests/CreateDisputeEvidenceTextRequest.ts +++ b/src/serialization/resources/disputes/client/requests/CreateDisputeEvidenceTextRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { DisputeEvidenceType } from "../../../../types/DisputeEvidenceType"; export const CreateDisputeEvidenceTextRequest: core.serialization.Schema< diff --git a/src/serialization/resources/events/client/requests/SearchEventsRequest.ts b/src/serialization/resources/events/client/requests/SearchEventsRequest.ts index d36eeb93b..9b03e2afd 100644 --- a/src/serialization/resources/events/client/requests/SearchEventsRequest.ts +++ b/src/serialization/resources/events/client/requests/SearchEventsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { SearchEventsQuery } from "../../../../types/SearchEventsQuery"; export const SearchEventsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/giftCards/client/requests/CreateGiftCardRequest.ts b/src/serialization/resources/giftCards/client/requests/CreateGiftCardRequest.ts index 490f53dd9..dfbbc7aa6 100644 --- a/src/serialization/resources/giftCards/client/requests/CreateGiftCardRequest.ts +++ b/src/serialization/resources/giftCards/client/requests/CreateGiftCardRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { GiftCard } from "../../../../types/GiftCard"; export const CreateGiftCardRequest: core.serialization.Schema< diff --git a/src/serialization/resources/giftCards/client/requests/GetGiftCardFromGanRequest.ts b/src/serialization/resources/giftCards/client/requests/GetGiftCardFromGanRequest.ts index 1aefc9114..809c07825 100644 --- a/src/serialization/resources/giftCards/client/requests/GetGiftCardFromGanRequest.ts +++ b/src/serialization/resources/giftCards/client/requests/GetGiftCardFromGanRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const GetGiftCardFromGanRequest: core.serialization.Schema< serializers.GetGiftCardFromGanRequest.Raw, diff --git a/src/serialization/resources/giftCards/client/requests/GetGiftCardFromNonceRequest.ts b/src/serialization/resources/giftCards/client/requests/GetGiftCardFromNonceRequest.ts index a0089a1d4..7bb8cfb6b 100644 --- a/src/serialization/resources/giftCards/client/requests/GetGiftCardFromNonceRequest.ts +++ b/src/serialization/resources/giftCards/client/requests/GetGiftCardFromNonceRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const GetGiftCardFromNonceRequest: core.serialization.Schema< serializers.GetGiftCardFromNonceRequest.Raw, diff --git a/src/serialization/resources/giftCards/client/requests/LinkCustomerToGiftCardRequest.ts b/src/serialization/resources/giftCards/client/requests/LinkCustomerToGiftCardRequest.ts index cc392782e..e04b837c1 100644 --- a/src/serialization/resources/giftCards/client/requests/LinkCustomerToGiftCardRequest.ts +++ b/src/serialization/resources/giftCards/client/requests/LinkCustomerToGiftCardRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const LinkCustomerToGiftCardRequest: core.serialization.Schema< serializers.LinkCustomerToGiftCardRequest.Raw, diff --git a/src/serialization/resources/giftCards/client/requests/UnlinkCustomerFromGiftCardRequest.ts b/src/serialization/resources/giftCards/client/requests/UnlinkCustomerFromGiftCardRequest.ts index 41aabd583..bd9fba99e 100644 --- a/src/serialization/resources/giftCards/client/requests/UnlinkCustomerFromGiftCardRequest.ts +++ b/src/serialization/resources/giftCards/client/requests/UnlinkCustomerFromGiftCardRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const UnlinkCustomerFromGiftCardRequest: core.serialization.Schema< serializers.UnlinkCustomerFromGiftCardRequest.Raw, diff --git a/src/serialization/resources/giftCards/resources/activities/client/requests/CreateGiftCardActivityRequest.ts b/src/serialization/resources/giftCards/resources/activities/client/requests/CreateGiftCardActivityRequest.ts index 80781bc21..9b8efe404 100644 --- a/src/serialization/resources/giftCards/resources/activities/client/requests/CreateGiftCardActivityRequest.ts +++ b/src/serialization/resources/giftCards/resources/activities/client/requests/CreateGiftCardActivityRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { GiftCardActivity } from "../../../../../../types/GiftCardActivity"; export const CreateGiftCardActivityRequest: core.serialization.Schema< diff --git a/src/serialization/resources/index.ts b/src/serialization/resources/index.ts index a8631a021..4ac63f244 100644 --- a/src/serialization/resources/index.ts +++ b/src/serialization/resources/index.ts @@ -1,3 +1,9 @@ +export * as v1Transactions from "./v1Transactions"; +export * as mobile from "./mobile"; +export * from "./mobile/client/requests"; +export * as oAuth from "./oAuth"; +export * from "./oAuth/client/requests"; +export * from "./v1Transactions/client/requests"; export * as applePay from "./applePay"; export * from "./applePay/client/requests"; export * as bookings from "./bookings"; @@ -6,13 +12,8 @@ export * as cards from "./cards"; export * from "./cards/client/requests"; export * as catalog from "./catalog"; export * from "./catalog/client/requests"; -export * as channels from "./channels"; -export * from "./channels/client/requests"; -export * as checkout from "./checkout"; -export * from "./checkout/client/requests"; export * as customers from "./customers"; export * from "./customers/client/requests"; -export * as devices from "./devices"; export * as disputes from "./disputes"; export * from "./disputes/client/requests"; export * as events from "./events"; @@ -27,11 +28,8 @@ export * as locations from "./locations"; export * from "./locations/client/requests"; export * as loyalty from "./loyalty"; export * from "./loyalty/client/requests"; -export * as merchants from "./merchants"; -export * as mobile from "./mobile"; -export * from "./mobile/client/requests"; -export * as oAuth from "./oAuth"; -export * from "./oAuth/client/requests"; +export * as checkout from "./checkout"; +export * from "./checkout/client/requests"; export * as orders from "./orders"; export * from "./orders/client/requests"; export * as payments from "./payments"; @@ -42,15 +40,13 @@ export * as snippets from "./snippets"; export * from "./snippets/client/requests"; export * as subscriptions from "./subscriptions"; export * from "./subscriptions/client/requests"; -export * as team from "./team"; -export * from "./team/client/requests"; export * as teamMembers from "./teamMembers"; export * from "./teamMembers/client/requests"; -export * as terminal from "./terminal"; -export * as transferOrders from "./transferOrders"; -export * from "./transferOrders/client/requests"; -export * as v1Transactions from "./v1Transactions"; -export * from "./v1Transactions/client/requests"; +export * as team from "./team"; +export * from "./team/client/requests"; export * as vendors from "./vendors"; export * from "./vendors/client/requests"; +export * as devices from "./devices"; +export * as merchants from "./merchants"; +export * as terminal from "./terminal"; export * as webhooks from "./webhooks"; diff --git a/src/serialization/resources/invoices/client/requests/CancelInvoiceRequest.ts b/src/serialization/resources/invoices/client/requests/CancelInvoiceRequest.ts index 80a79e5cd..6500b6ab0 100644 --- a/src/serialization/resources/invoices/client/requests/CancelInvoiceRequest.ts +++ b/src/serialization/resources/invoices/client/requests/CancelInvoiceRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const CancelInvoiceRequest: core.serialization.Schema< serializers.CancelInvoiceRequest.Raw, diff --git a/src/serialization/resources/invoices/client/requests/CreateInvoiceRequest.ts b/src/serialization/resources/invoices/client/requests/CreateInvoiceRequest.ts index fd8f278b0..42bcf7e22 100644 --- a/src/serialization/resources/invoices/client/requests/CreateInvoiceRequest.ts +++ b/src/serialization/resources/invoices/client/requests/CreateInvoiceRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { Invoice } from "../../../../types/Invoice"; export const CreateInvoiceRequest: core.serialization.Schema< diff --git a/src/serialization/resources/invoices/client/requests/PublishInvoiceRequest.ts b/src/serialization/resources/invoices/client/requests/PublishInvoiceRequest.ts index fe2b726f6..28315e6e4 100644 --- a/src/serialization/resources/invoices/client/requests/PublishInvoiceRequest.ts +++ b/src/serialization/resources/invoices/client/requests/PublishInvoiceRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const PublishInvoiceRequest: core.serialization.Schema< serializers.PublishInvoiceRequest.Raw, @@ -15,6 +17,6 @@ export const PublishInvoiceRequest: core.serialization.Schema< export declare namespace PublishInvoiceRequest { export interface Raw { version: number; - idempotency_key?: (string | null | undefined) | null; + idempotency_key?: (string | null) | null; } } diff --git a/src/serialization/resources/invoices/client/requests/SearchInvoicesRequest.ts b/src/serialization/resources/invoices/client/requests/SearchInvoicesRequest.ts index 4409b09d0..e4dee2e6b 100644 --- a/src/serialization/resources/invoices/client/requests/SearchInvoicesRequest.ts +++ b/src/serialization/resources/invoices/client/requests/SearchInvoicesRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { InvoiceQuery } from "../../../../types/InvoiceQuery"; export const SearchInvoicesRequest: core.serialization.Schema< diff --git a/src/serialization/resources/invoices/client/requests/UpdateInvoiceRequest.ts b/src/serialization/resources/invoices/client/requests/UpdateInvoiceRequest.ts index 463ee7cc3..750087321 100644 --- a/src/serialization/resources/invoices/client/requests/UpdateInvoiceRequest.ts +++ b/src/serialization/resources/invoices/client/requests/UpdateInvoiceRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { Invoice } from "../../../../types/Invoice"; export const UpdateInvoiceRequest: core.serialization.Schema< @@ -20,7 +22,7 @@ export const UpdateInvoiceRequest: core.serialization.Schema< export declare namespace UpdateInvoiceRequest { export interface Raw { invoice: Invoice.Raw; - idempotency_key?: (string | null | undefined) | null; - fields_to_clear?: (string[] | null | undefined) | null; + idempotency_key?: (string | null) | null; + fields_to_clear?: (string[] | null) | null; } } diff --git a/src/serialization/resources/invoices/client/requests/index.ts b/src/serialization/resources/invoices/client/requests/index.ts index 0fda37ffa..ecb9f5b77 100644 --- a/src/serialization/resources/invoices/client/requests/index.ts +++ b/src/serialization/resources/invoices/client/requests/index.ts @@ -1,5 +1,5 @@ -export { CancelInvoiceRequest } from "./CancelInvoiceRequest"; export { CreateInvoiceRequest } from "./CreateInvoiceRequest"; -export { PublishInvoiceRequest } from "./PublishInvoiceRequest"; export { SearchInvoicesRequest } from "./SearchInvoicesRequest"; export { UpdateInvoiceRequest } from "./UpdateInvoiceRequest"; +export { CancelInvoiceRequest } from "./CancelInvoiceRequest"; +export { PublishInvoiceRequest } from "./PublishInvoiceRequest"; diff --git a/src/serialization/resources/labor/client/requests/BulkPublishScheduledShiftsRequest.ts b/src/serialization/resources/labor/client/requests/BulkPublishScheduledShiftsRequest.ts index 170c4f527..2236c24ee 100644 --- a/src/serialization/resources/labor/client/requests/BulkPublishScheduledShiftsRequest.ts +++ b/src/serialization/resources/labor/client/requests/BulkPublishScheduledShiftsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { BulkPublishScheduledShiftsData } from "../../../../types/BulkPublishScheduledShiftsData"; import { ScheduledShiftNotificationAudience } from "../../../../types/ScheduledShiftNotificationAudience"; diff --git a/src/serialization/resources/labor/client/requests/CreateScheduledShiftRequest.ts b/src/serialization/resources/labor/client/requests/CreateScheduledShiftRequest.ts index f65d04fce..ad6f00fd1 100644 --- a/src/serialization/resources/labor/client/requests/CreateScheduledShiftRequest.ts +++ b/src/serialization/resources/labor/client/requests/CreateScheduledShiftRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { ScheduledShift } from "../../../../types/ScheduledShift"; export const CreateScheduledShiftRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/client/requests/CreateTimecardRequest.ts b/src/serialization/resources/labor/client/requests/CreateTimecardRequest.ts index fe17721f7..847411fd1 100644 --- a/src/serialization/resources/labor/client/requests/CreateTimecardRequest.ts +++ b/src/serialization/resources/labor/client/requests/CreateTimecardRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { Timecard } from "../../../../types/Timecard"; export const CreateTimecardRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/client/requests/PublishScheduledShiftRequest.ts b/src/serialization/resources/labor/client/requests/PublishScheduledShiftRequest.ts index c24c8ed3b..e2582095f 100644 --- a/src/serialization/resources/labor/client/requests/PublishScheduledShiftRequest.ts +++ b/src/serialization/resources/labor/client/requests/PublishScheduledShiftRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { ScheduledShiftNotificationAudience } from "../../../../types/ScheduledShiftNotificationAudience"; export const PublishScheduledShiftRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/client/requests/SearchScheduledShiftsRequest.ts b/src/serialization/resources/labor/client/requests/SearchScheduledShiftsRequest.ts index a4d91d106..dc15134fc 100644 --- a/src/serialization/resources/labor/client/requests/SearchScheduledShiftsRequest.ts +++ b/src/serialization/resources/labor/client/requests/SearchScheduledShiftsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { ScheduledShiftQuery } from "../../../../types/ScheduledShiftQuery"; export const SearchScheduledShiftsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/client/requests/SearchTimecardsRequest.ts b/src/serialization/resources/labor/client/requests/SearchTimecardsRequest.ts index b28a24ebc..afdc5165d 100644 --- a/src/serialization/resources/labor/client/requests/SearchTimecardsRequest.ts +++ b/src/serialization/resources/labor/client/requests/SearchTimecardsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { TimecardQuery } from "../../../../types/TimecardQuery"; export const SearchTimecardsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/client/requests/UpdateScheduledShiftRequest.ts b/src/serialization/resources/labor/client/requests/UpdateScheduledShiftRequest.ts index e9302bde9..7805fc348 100644 --- a/src/serialization/resources/labor/client/requests/UpdateScheduledShiftRequest.ts +++ b/src/serialization/resources/labor/client/requests/UpdateScheduledShiftRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { ScheduledShift } from "../../../../types/ScheduledShift"; export const UpdateScheduledShiftRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/client/requests/UpdateTimecardRequest.ts b/src/serialization/resources/labor/client/requests/UpdateTimecardRequest.ts index 235ad36bb..c7adb43f5 100644 --- a/src/serialization/resources/labor/client/requests/UpdateTimecardRequest.ts +++ b/src/serialization/resources/labor/client/requests/UpdateTimecardRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { Timecard } from "../../../../types/Timecard"; export const UpdateTimecardRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/client/requests/index.ts b/src/serialization/resources/labor/client/requests/index.ts index c571c9f12..86f313e34 100644 --- a/src/serialization/resources/labor/client/requests/index.ts +++ b/src/serialization/resources/labor/client/requests/index.ts @@ -1,8 +1,8 @@ -export { BulkPublishScheduledShiftsRequest } from "./BulkPublishScheduledShiftsRequest"; export { CreateScheduledShiftRequest } from "./CreateScheduledShiftRequest"; -export { CreateTimecardRequest } from "./CreateTimecardRequest"; -export { PublishScheduledShiftRequest } from "./PublishScheduledShiftRequest"; +export { BulkPublishScheduledShiftsRequest } from "./BulkPublishScheduledShiftsRequest"; export { SearchScheduledShiftsRequest } from "./SearchScheduledShiftsRequest"; -export { SearchTimecardsRequest } from "./SearchTimecardsRequest"; export { UpdateScheduledShiftRequest } from "./UpdateScheduledShiftRequest"; +export { PublishScheduledShiftRequest } from "./PublishScheduledShiftRequest"; +export { CreateTimecardRequest } from "./CreateTimecardRequest"; +export { SearchTimecardsRequest } from "./SearchTimecardsRequest"; export { UpdateTimecardRequest } from "./UpdateTimecardRequest"; diff --git a/src/serialization/resources/labor/resources/breakTypes/client/requests/CreateBreakTypeRequest.ts b/src/serialization/resources/labor/resources/breakTypes/client/requests/CreateBreakTypeRequest.ts index 55525449e..61d162374 100644 --- a/src/serialization/resources/labor/resources/breakTypes/client/requests/CreateBreakTypeRequest.ts +++ b/src/serialization/resources/labor/resources/breakTypes/client/requests/CreateBreakTypeRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { BreakType } from "../../../../../../types/BreakType"; export const CreateBreakTypeRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/resources/breakTypes/client/requests/UpdateBreakTypeRequest.ts b/src/serialization/resources/labor/resources/breakTypes/client/requests/UpdateBreakTypeRequest.ts index d9611fbfb..4fbe34a90 100644 --- a/src/serialization/resources/labor/resources/breakTypes/client/requests/UpdateBreakTypeRequest.ts +++ b/src/serialization/resources/labor/resources/breakTypes/client/requests/UpdateBreakTypeRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { BreakType } from "../../../../../../types/BreakType"; export const UpdateBreakTypeRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/resources/shifts/client/requests/CreateShiftRequest.ts b/src/serialization/resources/labor/resources/shifts/client/requests/CreateShiftRequest.ts index f854da107..60eda2e1c 100644 --- a/src/serialization/resources/labor/resources/shifts/client/requests/CreateShiftRequest.ts +++ b/src/serialization/resources/labor/resources/shifts/client/requests/CreateShiftRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { Shift } from "../../../../../../types/Shift"; export const CreateShiftRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/resources/shifts/client/requests/SearchShiftsRequest.ts b/src/serialization/resources/labor/resources/shifts/client/requests/SearchShiftsRequest.ts index 952a237c6..867f740ed 100644 --- a/src/serialization/resources/labor/resources/shifts/client/requests/SearchShiftsRequest.ts +++ b/src/serialization/resources/labor/resources/shifts/client/requests/SearchShiftsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { ShiftQuery } from "../../../../../../types/ShiftQuery"; export const SearchShiftsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/resources/shifts/client/requests/UpdateShiftRequest.ts b/src/serialization/resources/labor/resources/shifts/client/requests/UpdateShiftRequest.ts index dd9c7d93b..42026820b 100644 --- a/src/serialization/resources/labor/resources/shifts/client/requests/UpdateShiftRequest.ts +++ b/src/serialization/resources/labor/resources/shifts/client/requests/UpdateShiftRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { Shift } from "../../../../../../types/Shift"; export const UpdateShiftRequest: core.serialization.Schema< diff --git a/src/serialization/resources/labor/resources/workweekConfigs/client/requests/UpdateWorkweekConfigRequest.ts b/src/serialization/resources/labor/resources/workweekConfigs/client/requests/UpdateWorkweekConfigRequest.ts index 8e8f01510..605b45209 100644 --- a/src/serialization/resources/labor/resources/workweekConfigs/client/requests/UpdateWorkweekConfigRequest.ts +++ b/src/serialization/resources/labor/resources/workweekConfigs/client/requests/UpdateWorkweekConfigRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { WorkweekConfig } from "../../../../../../types/WorkweekConfig"; export const UpdateWorkweekConfigRequest: core.serialization.Schema< diff --git a/src/serialization/resources/locations/client/requests/CreateCheckoutRequest.ts b/src/serialization/resources/locations/client/requests/CreateCheckoutRequest.ts index d3bf045cf..b72bce12d 100644 --- a/src/serialization/resources/locations/client/requests/CreateCheckoutRequest.ts +++ b/src/serialization/resources/locations/client/requests/CreateCheckoutRequest.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; +import { CreateOrderRequest } from "../../../../types/CreateOrderRequest"; import { Address } from "../../../../types/Address"; import { ChargeRequestAdditionalRecipient } from "../../../../types/ChargeRequestAdditionalRecipient"; -import { CreateOrderRequest } from "../../../../types/CreateOrderRequest"; export const CreateCheckoutRequest: core.serialization.Schema< serializers.CreateCheckoutRequest.Raw, diff --git a/src/serialization/resources/locations/client/requests/CreateLocationRequest.ts b/src/serialization/resources/locations/client/requests/CreateLocationRequest.ts index d6589a1fa..8f2206ff5 100644 --- a/src/serialization/resources/locations/client/requests/CreateLocationRequest.ts +++ b/src/serialization/resources/locations/client/requests/CreateLocationRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { Location } from "../../../../types/Location"; export const CreateLocationRequest: core.serialization.Schema< diff --git a/src/serialization/resources/locations/client/requests/UpdateLocationRequest.ts b/src/serialization/resources/locations/client/requests/UpdateLocationRequest.ts index 4c9eb86c6..994c21745 100644 --- a/src/serialization/resources/locations/client/requests/UpdateLocationRequest.ts +++ b/src/serialization/resources/locations/client/requests/UpdateLocationRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { Location } from "../../../../types/Location"; export const UpdateLocationRequest: core.serialization.Schema< diff --git a/src/serialization/resources/locations/client/requests/index.ts b/src/serialization/resources/locations/client/requests/index.ts index 957353b7a..7527b14b5 100644 --- a/src/serialization/resources/locations/client/requests/index.ts +++ b/src/serialization/resources/locations/client/requests/index.ts @@ -1,3 +1,3 @@ -export { CreateCheckoutRequest } from "./CreateCheckoutRequest"; export { CreateLocationRequest } from "./CreateLocationRequest"; export { UpdateLocationRequest } from "./UpdateLocationRequest"; +export { CreateCheckoutRequest } from "./CreateCheckoutRequest"; diff --git a/src/serialization/resources/locations/resources/customAttributeDefinitions/client/requests/CreateLocationCustomAttributeDefinitionRequest.ts b/src/serialization/resources/locations/resources/customAttributeDefinitions/client/requests/CreateLocationCustomAttributeDefinitionRequest.ts index 99e91ad47..00faaf3fb 100644 --- a/src/serialization/resources/locations/resources/customAttributeDefinitions/client/requests/CreateLocationCustomAttributeDefinitionRequest.ts +++ b/src/serialization/resources/locations/resources/customAttributeDefinitions/client/requests/CreateLocationCustomAttributeDefinitionRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { CustomAttributeDefinition } from "../../../../../../types/CustomAttributeDefinition"; export const CreateLocationCustomAttributeDefinitionRequest: core.serialization.Schema< diff --git a/src/serialization/resources/locations/resources/customAttributeDefinitions/client/requests/UpdateLocationCustomAttributeDefinitionRequest.ts b/src/serialization/resources/locations/resources/customAttributeDefinitions/client/requests/UpdateLocationCustomAttributeDefinitionRequest.ts index 659714523..8b6169e08 100644 --- a/src/serialization/resources/locations/resources/customAttributeDefinitions/client/requests/UpdateLocationCustomAttributeDefinitionRequest.ts +++ b/src/serialization/resources/locations/resources/customAttributeDefinitions/client/requests/UpdateLocationCustomAttributeDefinitionRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { CustomAttributeDefinition } from "../../../../../../types/CustomAttributeDefinition"; export const UpdateLocationCustomAttributeDefinitionRequest: core.serialization.Schema< @@ -16,6 +18,6 @@ export const UpdateLocationCustomAttributeDefinitionRequest: core.serialization. export declare namespace UpdateLocationCustomAttributeDefinitionRequest { export interface Raw { custom_attribute_definition: CustomAttributeDefinition.Raw; - idempotency_key?: (string | null | undefined) | null; + idempotency_key?: (string | null) | null; } } diff --git a/src/serialization/resources/locations/resources/customAttributes/client/requests/BulkDeleteLocationCustomAttributesRequest.ts b/src/serialization/resources/locations/resources/customAttributes/client/requests/BulkDeleteLocationCustomAttributesRequest.ts index 3d25b5465..bf41571ed 100644 --- a/src/serialization/resources/locations/resources/customAttributes/client/requests/BulkDeleteLocationCustomAttributesRequest.ts +++ b/src/serialization/resources/locations/resources/customAttributes/client/requests/BulkDeleteLocationCustomAttributesRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest } from "../../../../../../types/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest"; export const BulkDeleteLocationCustomAttributesRequest: core.serialization.Schema< diff --git a/src/serialization/resources/locations/resources/customAttributes/client/requests/BulkUpsertLocationCustomAttributesRequest.ts b/src/serialization/resources/locations/resources/customAttributes/client/requests/BulkUpsertLocationCustomAttributesRequest.ts index f05929fb9..57f14749a 100644 --- a/src/serialization/resources/locations/resources/customAttributes/client/requests/BulkUpsertLocationCustomAttributesRequest.ts +++ b/src/serialization/resources/locations/resources/customAttributes/client/requests/BulkUpsertLocationCustomAttributesRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest } from "../../../../../../types/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest"; export const BulkUpsertLocationCustomAttributesRequest: core.serialization.Schema< diff --git a/src/serialization/resources/locations/resources/customAttributes/client/requests/UpsertLocationCustomAttributeRequest.ts b/src/serialization/resources/locations/resources/customAttributes/client/requests/UpsertLocationCustomAttributeRequest.ts index 970f7f15b..c20535527 100644 --- a/src/serialization/resources/locations/resources/customAttributes/client/requests/UpsertLocationCustomAttributeRequest.ts +++ b/src/serialization/resources/locations/resources/customAttributes/client/requests/UpsertLocationCustomAttributeRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { CustomAttribute } from "../../../../../../types/CustomAttribute"; export const UpsertLocationCustomAttributeRequest: core.serialization.Schema< @@ -16,6 +18,6 @@ export const UpsertLocationCustomAttributeRequest: core.serialization.Schema< export declare namespace UpsertLocationCustomAttributeRequest { export interface Raw { custom_attribute: CustomAttribute.Raw; - idempotency_key?: (string | null | undefined) | null; + idempotency_key?: (string | null) | null; } } diff --git a/src/serialization/resources/loyalty/client/requests/SearchLoyaltyEventsRequest.ts b/src/serialization/resources/loyalty/client/requests/SearchLoyaltyEventsRequest.ts index 854f3df9a..4a9cb5831 100644 --- a/src/serialization/resources/loyalty/client/requests/SearchLoyaltyEventsRequest.ts +++ b/src/serialization/resources/loyalty/client/requests/SearchLoyaltyEventsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { LoyaltyEventQuery } from "../../../../types/LoyaltyEventQuery"; export const SearchLoyaltyEventsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/loyalty/resources/accounts/client/requests/AccumulateLoyaltyPointsRequest.ts b/src/serialization/resources/loyalty/resources/accounts/client/requests/AccumulateLoyaltyPointsRequest.ts index 9216efa49..82798bad6 100644 --- a/src/serialization/resources/loyalty/resources/accounts/client/requests/AccumulateLoyaltyPointsRequest.ts +++ b/src/serialization/resources/loyalty/resources/accounts/client/requests/AccumulateLoyaltyPointsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { LoyaltyEventAccumulatePoints } from "../../../../../../types/LoyaltyEventAccumulatePoints"; export const AccumulateLoyaltyPointsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/loyalty/resources/accounts/client/requests/AdjustLoyaltyPointsRequest.ts b/src/serialization/resources/loyalty/resources/accounts/client/requests/AdjustLoyaltyPointsRequest.ts index 161fdb830..dd917764d 100644 --- a/src/serialization/resources/loyalty/resources/accounts/client/requests/AdjustLoyaltyPointsRequest.ts +++ b/src/serialization/resources/loyalty/resources/accounts/client/requests/AdjustLoyaltyPointsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { LoyaltyEventAdjustPoints } from "../../../../../../types/LoyaltyEventAdjustPoints"; export const AdjustLoyaltyPointsRequest: core.serialization.Schema< @@ -21,6 +23,6 @@ export declare namespace AdjustLoyaltyPointsRequest { export interface Raw { idempotency_key: string; adjust_points: LoyaltyEventAdjustPoints.Raw; - allow_negative_balance?: (boolean | null | undefined) | null; + allow_negative_balance?: (boolean | null) | null; } } diff --git a/src/serialization/resources/loyalty/resources/accounts/client/requests/CreateLoyaltyAccountRequest.ts b/src/serialization/resources/loyalty/resources/accounts/client/requests/CreateLoyaltyAccountRequest.ts index d0e596dc9..ed4e98e0a 100644 --- a/src/serialization/resources/loyalty/resources/accounts/client/requests/CreateLoyaltyAccountRequest.ts +++ b/src/serialization/resources/loyalty/resources/accounts/client/requests/CreateLoyaltyAccountRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { LoyaltyAccount } from "../../../../../../types/LoyaltyAccount"; export const CreateLoyaltyAccountRequest: core.serialization.Schema< diff --git a/src/serialization/resources/loyalty/resources/accounts/client/requests/SearchLoyaltyAccountsRequest.ts b/src/serialization/resources/loyalty/resources/accounts/client/requests/SearchLoyaltyAccountsRequest.ts index 50ce73aa8..45d7d4b8b 100644 --- a/src/serialization/resources/loyalty/resources/accounts/client/requests/SearchLoyaltyAccountsRequest.ts +++ b/src/serialization/resources/loyalty/resources/accounts/client/requests/SearchLoyaltyAccountsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { SearchLoyaltyAccountsRequestLoyaltyAccountQuery } from "../../../../../../types/SearchLoyaltyAccountsRequestLoyaltyAccountQuery"; export const SearchLoyaltyAccountsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/loyalty/resources/accounts/client/requests/index.ts b/src/serialization/resources/loyalty/resources/accounts/client/requests/index.ts index b900ccd2c..03227b225 100644 --- a/src/serialization/resources/loyalty/resources/accounts/client/requests/index.ts +++ b/src/serialization/resources/loyalty/resources/accounts/client/requests/index.ts @@ -1,4 +1,4 @@ -export { AccumulateLoyaltyPointsRequest } from "./AccumulateLoyaltyPointsRequest"; -export { AdjustLoyaltyPointsRequest } from "./AdjustLoyaltyPointsRequest"; export { CreateLoyaltyAccountRequest } from "./CreateLoyaltyAccountRequest"; export { SearchLoyaltyAccountsRequest } from "./SearchLoyaltyAccountsRequest"; +export { AccumulateLoyaltyPointsRequest } from "./AccumulateLoyaltyPointsRequest"; +export { AdjustLoyaltyPointsRequest } from "./AdjustLoyaltyPointsRequest"; diff --git a/src/serialization/resources/loyalty/resources/programs/client/requests/CalculateLoyaltyPointsRequest.ts b/src/serialization/resources/loyalty/resources/programs/client/requests/CalculateLoyaltyPointsRequest.ts index c7b29d652..5f95c2425 100644 --- a/src/serialization/resources/loyalty/resources/programs/client/requests/CalculateLoyaltyPointsRequest.ts +++ b/src/serialization/resources/loyalty/resources/programs/client/requests/CalculateLoyaltyPointsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { Money } from "../../../../../../types/Money"; export const CalculateLoyaltyPointsRequest: core.serialization.Schema< @@ -16,8 +18,8 @@ export const CalculateLoyaltyPointsRequest: core.serialization.Schema< export declare namespace CalculateLoyaltyPointsRequest { export interface Raw { - order_id?: (string | null | undefined) | null; + order_id?: (string | null) | null; transaction_amount_money?: Money.Raw | null; - loyalty_account_id?: (string | null | undefined) | null; + loyalty_account_id?: (string | null) | null; } } diff --git a/src/serialization/resources/loyalty/resources/programs/resources/promotions/client/requests/CreateLoyaltyPromotionRequest.ts b/src/serialization/resources/loyalty/resources/programs/resources/promotions/client/requests/CreateLoyaltyPromotionRequest.ts index 60cd02ed9..06a38c038 100644 --- a/src/serialization/resources/loyalty/resources/programs/resources/promotions/client/requests/CreateLoyaltyPromotionRequest.ts +++ b/src/serialization/resources/loyalty/resources/programs/resources/promotions/client/requests/CreateLoyaltyPromotionRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../../../api/index"; +import * as serializers from "../../../../../../../../index"; +import * as Square from "../../../../../../../../../api/index"; import * as core from "../../../../../../../../../core"; -import type * as serializers from "../../../../../../../../index"; import { LoyaltyPromotion } from "../../../../../../../../types/LoyaltyPromotion"; export const CreateLoyaltyPromotionRequest: core.serialization.Schema< diff --git a/src/serialization/resources/loyalty/resources/rewards/client/requests/CreateLoyaltyRewardRequest.ts b/src/serialization/resources/loyalty/resources/rewards/client/requests/CreateLoyaltyRewardRequest.ts index 60d1fa539..488fc35d8 100644 --- a/src/serialization/resources/loyalty/resources/rewards/client/requests/CreateLoyaltyRewardRequest.ts +++ b/src/serialization/resources/loyalty/resources/rewards/client/requests/CreateLoyaltyRewardRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { LoyaltyReward } from "../../../../../../types/LoyaltyReward"; export const CreateLoyaltyRewardRequest: core.serialization.Schema< diff --git a/src/serialization/resources/loyalty/resources/rewards/client/requests/RedeemLoyaltyRewardRequest.ts b/src/serialization/resources/loyalty/resources/rewards/client/requests/RedeemLoyaltyRewardRequest.ts index 3afb3a0b8..4531f813d 100644 --- a/src/serialization/resources/loyalty/resources/rewards/client/requests/RedeemLoyaltyRewardRequest.ts +++ b/src/serialization/resources/loyalty/resources/rewards/client/requests/RedeemLoyaltyRewardRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; export const RedeemLoyaltyRewardRequest: core.serialization.Schema< serializers.loyalty.RedeemLoyaltyRewardRequest.Raw, diff --git a/src/serialization/resources/loyalty/resources/rewards/client/requests/SearchLoyaltyRewardsRequest.ts b/src/serialization/resources/loyalty/resources/rewards/client/requests/SearchLoyaltyRewardsRequest.ts index 8532f667c..d29fbf38d 100644 --- a/src/serialization/resources/loyalty/resources/rewards/client/requests/SearchLoyaltyRewardsRequest.ts +++ b/src/serialization/resources/loyalty/resources/rewards/client/requests/SearchLoyaltyRewardsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { SearchLoyaltyRewardsRequestLoyaltyRewardQuery } from "../../../../../../types/SearchLoyaltyRewardsRequestLoyaltyRewardQuery"; export const SearchLoyaltyRewardsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/loyalty/resources/rewards/client/requests/index.ts b/src/serialization/resources/loyalty/resources/rewards/client/requests/index.ts index 4d08239b4..73d200ec3 100644 --- a/src/serialization/resources/loyalty/resources/rewards/client/requests/index.ts +++ b/src/serialization/resources/loyalty/resources/rewards/client/requests/index.ts @@ -1,3 +1,3 @@ export { CreateLoyaltyRewardRequest } from "./CreateLoyaltyRewardRequest"; -export { RedeemLoyaltyRewardRequest } from "./RedeemLoyaltyRewardRequest"; export { SearchLoyaltyRewardsRequest } from "./SearchLoyaltyRewardsRequest"; +export { RedeemLoyaltyRewardRequest } from "./RedeemLoyaltyRewardRequest"; diff --git a/src/serialization/resources/merchants/resources/customAttributeDefinitions/client/requests/CreateMerchantCustomAttributeDefinitionRequest.ts b/src/serialization/resources/merchants/resources/customAttributeDefinitions/client/requests/CreateMerchantCustomAttributeDefinitionRequest.ts index a7009511e..77146cbdd 100644 --- a/src/serialization/resources/merchants/resources/customAttributeDefinitions/client/requests/CreateMerchantCustomAttributeDefinitionRequest.ts +++ b/src/serialization/resources/merchants/resources/customAttributeDefinitions/client/requests/CreateMerchantCustomAttributeDefinitionRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { CustomAttributeDefinition } from "../../../../../../types/CustomAttributeDefinition"; export const CreateMerchantCustomAttributeDefinitionRequest: core.serialization.Schema< diff --git a/src/serialization/resources/merchants/resources/customAttributeDefinitions/client/requests/UpdateMerchantCustomAttributeDefinitionRequest.ts b/src/serialization/resources/merchants/resources/customAttributeDefinitions/client/requests/UpdateMerchantCustomAttributeDefinitionRequest.ts index bd8eb5b1b..786d2c616 100644 --- a/src/serialization/resources/merchants/resources/customAttributeDefinitions/client/requests/UpdateMerchantCustomAttributeDefinitionRequest.ts +++ b/src/serialization/resources/merchants/resources/customAttributeDefinitions/client/requests/UpdateMerchantCustomAttributeDefinitionRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { CustomAttributeDefinition } from "../../../../../../types/CustomAttributeDefinition"; export const UpdateMerchantCustomAttributeDefinitionRequest: core.serialization.Schema< @@ -16,6 +18,6 @@ export const UpdateMerchantCustomAttributeDefinitionRequest: core.serialization. export declare namespace UpdateMerchantCustomAttributeDefinitionRequest { export interface Raw { custom_attribute_definition: CustomAttributeDefinition.Raw; - idempotency_key?: (string | null | undefined) | null; + idempotency_key?: (string | null) | null; } } diff --git a/src/serialization/resources/merchants/resources/customAttributes/client/requests/BulkDeleteMerchantCustomAttributesRequest.ts b/src/serialization/resources/merchants/resources/customAttributes/client/requests/BulkDeleteMerchantCustomAttributesRequest.ts index 35062a679..c78a982c9 100644 --- a/src/serialization/resources/merchants/resources/customAttributes/client/requests/BulkDeleteMerchantCustomAttributesRequest.ts +++ b/src/serialization/resources/merchants/resources/customAttributes/client/requests/BulkDeleteMerchantCustomAttributesRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest } from "../../../../../../types/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest"; export const BulkDeleteMerchantCustomAttributesRequest: core.serialization.Schema< diff --git a/src/serialization/resources/merchants/resources/customAttributes/client/requests/BulkUpsertMerchantCustomAttributesRequest.ts b/src/serialization/resources/merchants/resources/customAttributes/client/requests/BulkUpsertMerchantCustomAttributesRequest.ts index d105c4094..68b2a4675 100644 --- a/src/serialization/resources/merchants/resources/customAttributes/client/requests/BulkUpsertMerchantCustomAttributesRequest.ts +++ b/src/serialization/resources/merchants/resources/customAttributes/client/requests/BulkUpsertMerchantCustomAttributesRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest } from "../../../../../../types/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest"; export const BulkUpsertMerchantCustomAttributesRequest: core.serialization.Schema< diff --git a/src/serialization/resources/merchants/resources/customAttributes/client/requests/UpsertMerchantCustomAttributeRequest.ts b/src/serialization/resources/merchants/resources/customAttributes/client/requests/UpsertMerchantCustomAttributeRequest.ts index ae67566b0..fd3d3f1f9 100644 --- a/src/serialization/resources/merchants/resources/customAttributes/client/requests/UpsertMerchantCustomAttributeRequest.ts +++ b/src/serialization/resources/merchants/resources/customAttributes/client/requests/UpsertMerchantCustomAttributeRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { CustomAttribute } from "../../../../../../types/CustomAttribute"; export const UpsertMerchantCustomAttributeRequest: core.serialization.Schema< @@ -16,6 +18,6 @@ export const UpsertMerchantCustomAttributeRequest: core.serialization.Schema< export declare namespace UpsertMerchantCustomAttributeRequest { export interface Raw { custom_attribute: CustomAttribute.Raw; - idempotency_key?: (string | null | undefined) | null; + idempotency_key?: (string | null) | null; } } diff --git a/src/serialization/resources/mobile/client/requests/CreateMobileAuthorizationCodeRequest.ts b/src/serialization/resources/mobile/client/requests/CreateMobileAuthorizationCodeRequest.ts index 5e86ddca5..0d33f8179 100644 --- a/src/serialization/resources/mobile/client/requests/CreateMobileAuthorizationCodeRequest.ts +++ b/src/serialization/resources/mobile/client/requests/CreateMobileAuthorizationCodeRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const CreateMobileAuthorizationCodeRequest: core.serialization.Schema< serializers.CreateMobileAuthorizationCodeRequest.Raw, diff --git a/src/serialization/resources/oAuth/client/requests/ObtainTokenRequest.ts b/src/serialization/resources/oAuth/client/requests/ObtainTokenRequest.ts index 566efbfae..cbde8c0d5 100644 --- a/src/serialization/resources/oAuth/client/requests/ObtainTokenRequest.ts +++ b/src/serialization/resources/oAuth/client/requests/ObtainTokenRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const ObtainTokenRequest: core.serialization.Schema< serializers.ObtainTokenRequest.Raw, @@ -23,14 +25,14 @@ export const ObtainTokenRequest: core.serialization.Schema< export declare namespace ObtainTokenRequest { export interface Raw { client_id: string; - client_secret?: (string | null | undefined) | null; - code?: (string | null | undefined) | null; - redirect_uri?: (string | null | undefined) | null; + client_secret?: (string | null) | null; + code?: (string | null) | null; + redirect_uri?: (string | null) | null; grant_type: string; - refresh_token?: (string | null | undefined) | null; - migration_token?: (string | null | undefined) | null; - scopes?: (string[] | null | undefined) | null; - short_lived?: (boolean | null | undefined) | null; - code_verifier?: (string | null | undefined) | null; + refresh_token?: (string | null) | null; + migration_token?: (string | null) | null; + scopes?: (string[] | null) | null; + short_lived?: (boolean | null) | null; + code_verifier?: (string | null) | null; } } diff --git a/src/serialization/resources/oAuth/client/requests/RevokeTokenRequest.ts b/src/serialization/resources/oAuth/client/requests/RevokeTokenRequest.ts index 89663a357..a1546b6fe 100644 --- a/src/serialization/resources/oAuth/client/requests/RevokeTokenRequest.ts +++ b/src/serialization/resources/oAuth/client/requests/RevokeTokenRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const RevokeTokenRequest: core.serialization.Schema< serializers.RevokeTokenRequest.Raw, @@ -19,9 +21,9 @@ export const RevokeTokenRequest: core.serialization.Schema< export declare namespace RevokeTokenRequest { export interface Raw { - client_id?: (string | null | undefined) | null; - access_token?: (string | null | undefined) | null; - merchant_id?: (string | null | undefined) | null; - revoke_only_access_token?: (boolean | null | undefined) | null; + client_id?: (string | null) | null; + access_token?: (string | null) | null; + merchant_id?: (string | null) | null; + revoke_only_access_token?: (boolean | null) | null; } } diff --git a/src/serialization/resources/oAuth/client/requests/index.ts b/src/serialization/resources/oAuth/client/requests/index.ts index 140a92267..3adbffa40 100644 --- a/src/serialization/resources/oAuth/client/requests/index.ts +++ b/src/serialization/resources/oAuth/client/requests/index.ts @@ -1,2 +1,2 @@ -export { ObtainTokenRequest } from "./ObtainTokenRequest"; export { RevokeTokenRequest } from "./RevokeTokenRequest"; +export { ObtainTokenRequest } from "./ObtainTokenRequest"; diff --git a/src/serialization/resources/orders/client/requests/BatchGetOrdersRequest.ts b/src/serialization/resources/orders/client/requests/BatchGetOrdersRequest.ts index 2bc9e4efd..9231fb858 100644 --- a/src/serialization/resources/orders/client/requests/BatchGetOrdersRequest.ts +++ b/src/serialization/resources/orders/client/requests/BatchGetOrdersRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const BatchGetOrdersRequest: core.serialization.Schema< serializers.BatchGetOrdersRequest.Raw, @@ -14,7 +16,7 @@ export const BatchGetOrdersRequest: core.serialization.Schema< export declare namespace BatchGetOrdersRequest { export interface Raw { - location_id?: (string | null | undefined) | null; + location_id?: (string | null) | null; order_ids: string[]; } } diff --git a/src/serialization/resources/orders/client/requests/CalculateOrderRequest.ts b/src/serialization/resources/orders/client/requests/CalculateOrderRequest.ts index 4b34b34b7..f45aa627c 100644 --- a/src/serialization/resources/orders/client/requests/CalculateOrderRequest.ts +++ b/src/serialization/resources/orders/client/requests/CalculateOrderRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { Order } from "../../../../types/Order"; import { OrderReward } from "../../../../types/OrderReward"; @@ -20,6 +22,6 @@ export const CalculateOrderRequest: core.serialization.Schema< export declare namespace CalculateOrderRequest { export interface Raw { order: Order.Raw; - proposed_rewards?: (OrderReward.Raw[] | null | undefined) | null; + proposed_rewards?: (OrderReward.Raw[] | null) | null; } } diff --git a/src/serialization/resources/orders/client/requests/CloneOrderRequest.ts b/src/serialization/resources/orders/client/requests/CloneOrderRequest.ts index 86f6eb77e..859bd99e2 100644 --- a/src/serialization/resources/orders/client/requests/CloneOrderRequest.ts +++ b/src/serialization/resources/orders/client/requests/CloneOrderRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const CloneOrderRequest: core.serialization.Schema = core.serialization.object({ @@ -15,6 +17,6 @@ export declare namespace CloneOrderRequest { export interface Raw { order_id: string; version?: number | null; - idempotency_key?: (string | null | undefined) | null; + idempotency_key?: (string | null) | null; } } diff --git a/src/serialization/resources/orders/client/requests/PayOrderRequest.ts b/src/serialization/resources/orders/client/requests/PayOrderRequest.ts index bb3a08224..bf220bf26 100644 --- a/src/serialization/resources/orders/client/requests/PayOrderRequest.ts +++ b/src/serialization/resources/orders/client/requests/PayOrderRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const PayOrderRequest: core.serialization.Schema< serializers.PayOrderRequest.Raw, @@ -19,7 +21,7 @@ export const PayOrderRequest: core.serialization.Schema< export declare namespace PayOrderRequest { export interface Raw { idempotency_key: string; - order_version?: (number | null | undefined) | null; - payment_ids?: (string[] | null | undefined) | null; + order_version?: (number | null) | null; + payment_ids?: (string[] | null) | null; } } diff --git a/src/serialization/resources/orders/client/requests/SearchOrdersRequest.ts b/src/serialization/resources/orders/client/requests/SearchOrdersRequest.ts index 958b0b162..fd836c0ad 100644 --- a/src/serialization/resources/orders/client/requests/SearchOrdersRequest.ts +++ b/src/serialization/resources/orders/client/requests/SearchOrdersRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { SearchOrdersQuery } from "../../../../types/SearchOrdersQuery"; export const SearchOrdersRequest: core.serialization.Schema< diff --git a/src/serialization/resources/orders/client/requests/UpdateOrderRequest.ts b/src/serialization/resources/orders/client/requests/UpdateOrderRequest.ts index 83a0ebce2..e67aa8934 100644 --- a/src/serialization/resources/orders/client/requests/UpdateOrderRequest.ts +++ b/src/serialization/resources/orders/client/requests/UpdateOrderRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { Order } from "../../../../types/Order"; export const UpdateOrderRequest: core.serialization.Schema< @@ -20,7 +22,7 @@ export const UpdateOrderRequest: core.serialization.Schema< export declare namespace UpdateOrderRequest { export interface Raw { order?: Order.Raw | null; - fields_to_clear?: (string[] | null | undefined) | null; - idempotency_key?: (string | null | undefined) | null; + fields_to_clear?: (string[] | null) | null; + idempotency_key?: (string | null) | null; } } diff --git a/src/serialization/resources/orders/client/requests/index.ts b/src/serialization/resources/orders/client/requests/index.ts index 7dc6823c7..cad486739 100644 --- a/src/serialization/resources/orders/client/requests/index.ts +++ b/src/serialization/resources/orders/client/requests/index.ts @@ -1,6 +1,6 @@ export { BatchGetOrdersRequest } from "./BatchGetOrdersRequest"; export { CalculateOrderRequest } from "./CalculateOrderRequest"; export { CloneOrderRequest } from "./CloneOrderRequest"; -export { PayOrderRequest } from "./PayOrderRequest"; export { SearchOrdersRequest } from "./SearchOrdersRequest"; export { UpdateOrderRequest } from "./UpdateOrderRequest"; +export { PayOrderRequest } from "./PayOrderRequest"; diff --git a/src/serialization/resources/orders/resources/customAttributeDefinitions/client/requests/CreateOrderCustomAttributeDefinitionRequest.ts b/src/serialization/resources/orders/resources/customAttributeDefinitions/client/requests/CreateOrderCustomAttributeDefinitionRequest.ts index cfcbcb9d7..d41721b2f 100644 --- a/src/serialization/resources/orders/resources/customAttributeDefinitions/client/requests/CreateOrderCustomAttributeDefinitionRequest.ts +++ b/src/serialization/resources/orders/resources/customAttributeDefinitions/client/requests/CreateOrderCustomAttributeDefinitionRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { CustomAttributeDefinition } from "../../../../../../types/CustomAttributeDefinition"; export const CreateOrderCustomAttributeDefinitionRequest: core.serialization.Schema< diff --git a/src/serialization/resources/orders/resources/customAttributeDefinitions/client/requests/UpdateOrderCustomAttributeDefinitionRequest.ts b/src/serialization/resources/orders/resources/customAttributeDefinitions/client/requests/UpdateOrderCustomAttributeDefinitionRequest.ts index cae570e4c..1f23cef83 100644 --- a/src/serialization/resources/orders/resources/customAttributeDefinitions/client/requests/UpdateOrderCustomAttributeDefinitionRequest.ts +++ b/src/serialization/resources/orders/resources/customAttributeDefinitions/client/requests/UpdateOrderCustomAttributeDefinitionRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { CustomAttributeDefinition } from "../../../../../../types/CustomAttributeDefinition"; export const UpdateOrderCustomAttributeDefinitionRequest: core.serialization.Schema< @@ -16,6 +18,6 @@ export const UpdateOrderCustomAttributeDefinitionRequest: core.serialization.Sch export declare namespace UpdateOrderCustomAttributeDefinitionRequest { export interface Raw { custom_attribute_definition: CustomAttributeDefinition.Raw; - idempotency_key?: (string | null | undefined) | null; + idempotency_key?: (string | null) | null; } } diff --git a/src/serialization/resources/orders/resources/customAttributes/client/requests/BulkDeleteOrderCustomAttributesRequest.ts b/src/serialization/resources/orders/resources/customAttributes/client/requests/BulkDeleteOrderCustomAttributesRequest.ts index 08547f639..16ed1b7f3 100644 --- a/src/serialization/resources/orders/resources/customAttributes/client/requests/BulkDeleteOrderCustomAttributesRequest.ts +++ b/src/serialization/resources/orders/resources/customAttributes/client/requests/BulkDeleteOrderCustomAttributesRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute } from "../../../../../../types/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute"; export const BulkDeleteOrderCustomAttributesRequest: core.serialization.Schema< diff --git a/src/serialization/resources/orders/resources/customAttributes/client/requests/BulkUpsertOrderCustomAttributesRequest.ts b/src/serialization/resources/orders/resources/customAttributes/client/requests/BulkUpsertOrderCustomAttributesRequest.ts index d2965ada3..2999133ec 100644 --- a/src/serialization/resources/orders/resources/customAttributes/client/requests/BulkUpsertOrderCustomAttributesRequest.ts +++ b/src/serialization/resources/orders/resources/customAttributes/client/requests/BulkUpsertOrderCustomAttributesRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute } from "../../../../../../types/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute"; export const BulkUpsertOrderCustomAttributesRequest: core.serialization.Schema< diff --git a/src/serialization/resources/orders/resources/customAttributes/client/requests/UpsertOrderCustomAttributeRequest.ts b/src/serialization/resources/orders/resources/customAttributes/client/requests/UpsertOrderCustomAttributeRequest.ts index 7fbbb4414..cd5451bfd 100644 --- a/src/serialization/resources/orders/resources/customAttributes/client/requests/UpsertOrderCustomAttributeRequest.ts +++ b/src/serialization/resources/orders/resources/customAttributes/client/requests/UpsertOrderCustomAttributeRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { CustomAttribute } from "../../../../../../types/CustomAttribute"; export const UpsertOrderCustomAttributeRequest: core.serialization.Schema< @@ -16,6 +18,6 @@ export const UpsertOrderCustomAttributeRequest: core.serialization.Schema< export declare namespace UpsertOrderCustomAttributeRequest { export interface Raw { custom_attribute: CustomAttribute.Raw; - idempotency_key?: (string | null | undefined) | null; + idempotency_key?: (string | null) | null; } } diff --git a/src/serialization/resources/payments/client/requests/CancelPaymentByIdempotencyKeyRequest.ts b/src/serialization/resources/payments/client/requests/CancelPaymentByIdempotencyKeyRequest.ts index 8c158b3b5..0efa29d7c 100644 --- a/src/serialization/resources/payments/client/requests/CancelPaymentByIdempotencyKeyRequest.ts +++ b/src/serialization/resources/payments/client/requests/CancelPaymentByIdempotencyKeyRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const CancelPaymentByIdempotencyKeyRequest: core.serialization.Schema< serializers.CancelPaymentByIdempotencyKeyRequest.Raw, diff --git a/src/serialization/resources/payments/client/requests/CompletePaymentRequest.ts b/src/serialization/resources/payments/client/requests/CompletePaymentRequest.ts index 830cf86ab..7c78bc1f1 100644 --- a/src/serialization/resources/payments/client/requests/CompletePaymentRequest.ts +++ b/src/serialization/resources/payments/client/requests/CompletePaymentRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const CompletePaymentRequest: core.serialization.Schema< serializers.CompletePaymentRequest.Raw, @@ -13,6 +15,6 @@ export const CompletePaymentRequest: core.serialization.Schema< export declare namespace CompletePaymentRequest { export interface Raw { - version_token?: (string | null | undefined) | null; + version_token?: (string | null) | null; } } diff --git a/src/serialization/resources/payments/client/requests/CreatePaymentRequest.ts b/src/serialization/resources/payments/client/requests/CreatePaymentRequest.ts index 415c665b1..35c740983 100644 --- a/src/serialization/resources/payments/client/requests/CreatePaymentRequest.ts +++ b/src/serialization/resources/payments/client/requests/CreatePaymentRequest.ts @@ -1,13 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; +import { Money } from "../../../../types/Money"; import { Address } from "../../../../types/Address"; import { CashPaymentDetails } from "../../../../types/CashPaymentDetails"; -import { CustomerDetails } from "../../../../types/CustomerDetails"; import { ExternalPaymentDetails } from "../../../../types/ExternalPaymentDetails"; -import { Money } from "../../../../types/Money"; +import { CustomerDetails } from "../../../../types/CustomerDetails"; import { OfflinePaymentDetails } from "../../../../types/OfflinePaymentDetails"; export const CreatePaymentRequest: core.serialization.Schema< diff --git a/src/serialization/resources/payments/client/requests/UpdatePaymentRequest.ts b/src/serialization/resources/payments/client/requests/UpdatePaymentRequest.ts index d0c0ff542..12d129e2f 100644 --- a/src/serialization/resources/payments/client/requests/UpdatePaymentRequest.ts +++ b/src/serialization/resources/payments/client/requests/UpdatePaymentRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { Payment } from "../../../../types/Payment"; export const UpdatePaymentRequest: core.serialization.Schema< diff --git a/src/serialization/resources/payments/client/requests/index.ts b/src/serialization/resources/payments/client/requests/index.ts index da5a6a559..4332ec649 100644 --- a/src/serialization/resources/payments/client/requests/index.ts +++ b/src/serialization/resources/payments/client/requests/index.ts @@ -1,4 +1,4 @@ -export { CancelPaymentByIdempotencyKeyRequest } from "./CancelPaymentByIdempotencyKeyRequest"; -export { CompletePaymentRequest } from "./CompletePaymentRequest"; export { CreatePaymentRequest } from "./CreatePaymentRequest"; +export { CancelPaymentByIdempotencyKeyRequest } from "./CancelPaymentByIdempotencyKeyRequest"; export { UpdatePaymentRequest } from "./UpdatePaymentRequest"; +export { CompletePaymentRequest } from "./CompletePaymentRequest"; diff --git a/src/serialization/resources/refunds/client/requests/RefundPaymentRequest.ts b/src/serialization/resources/refunds/client/requests/RefundPaymentRequest.ts index 4850d64f5..7f36428a0 100644 --- a/src/serialization/resources/refunds/client/requests/RefundPaymentRequest.ts +++ b/src/serialization/resources/refunds/client/requests/RefundPaymentRequest.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; +import { Money } from "../../../../types/Money"; import { DestinationDetailsCashRefundDetails } from "../../../../types/DestinationDetailsCashRefundDetails"; import { DestinationDetailsExternalRefundDetails } from "../../../../types/DestinationDetailsExternalRefundDetails"; -import { Money } from "../../../../types/Money"; export const RefundPaymentRequest: core.serialization.Schema< serializers.RefundPaymentRequest.Raw, @@ -37,14 +39,14 @@ export declare namespace RefundPaymentRequest { idempotency_key: string; amount_money: Money.Raw; app_fee_money?: Money.Raw | null; - payment_id?: (string | null | undefined) | null; - destination_id?: (string | null | undefined) | null; - unlinked?: (boolean | null | undefined) | null; - location_id?: (string | null | undefined) | null; - customer_id?: (string | null | undefined) | null; - reason?: (string | null | undefined) | null; - payment_version_token?: (string | null | undefined) | null; - team_member_id?: (string | null | undefined) | null; + payment_id?: (string | null) | null; + destination_id?: (string | null) | null; + unlinked?: (boolean | null) | null; + location_id?: (string | null) | null; + customer_id?: (string | null) | null; + reason?: (string | null) | null; + payment_version_token?: (string | null) | null; + team_member_id?: (string | null) | null; cash_details?: DestinationDetailsCashRefundDetails.Raw | null; external_details?: DestinationDetailsExternalRefundDetails.Raw | null; } diff --git a/src/serialization/resources/snippets/client/requests/UpsertSnippetRequest.ts b/src/serialization/resources/snippets/client/requests/UpsertSnippetRequest.ts index da9ffb04f..4e637b87f 100644 --- a/src/serialization/resources/snippets/client/requests/UpsertSnippetRequest.ts +++ b/src/serialization/resources/snippets/client/requests/UpsertSnippetRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { Snippet } from "../../../../types/Snippet"; export const UpsertSnippetRequest: core.serialization.Schema< diff --git a/src/serialization/resources/subscriptions/client/requests/BulkSwapPlanRequest.ts b/src/serialization/resources/subscriptions/client/requests/BulkSwapPlanRequest.ts index a4826deff..aa87601d5 100644 --- a/src/serialization/resources/subscriptions/client/requests/BulkSwapPlanRequest.ts +++ b/src/serialization/resources/subscriptions/client/requests/BulkSwapPlanRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const BulkSwapPlanRequest: core.serialization.Schema< serializers.BulkSwapPlanRequest.Raw, diff --git a/src/serialization/resources/subscriptions/client/requests/ChangeBillingAnchorDateRequest.ts b/src/serialization/resources/subscriptions/client/requests/ChangeBillingAnchorDateRequest.ts index 0aa5fc1ef..53291970d 100644 --- a/src/serialization/resources/subscriptions/client/requests/ChangeBillingAnchorDateRequest.ts +++ b/src/serialization/resources/subscriptions/client/requests/ChangeBillingAnchorDateRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const ChangeBillingAnchorDateRequest: core.serialization.Schema< serializers.ChangeBillingAnchorDateRequest.Raw, @@ -17,7 +19,7 @@ export const ChangeBillingAnchorDateRequest: core.serialization.Schema< export declare namespace ChangeBillingAnchorDateRequest { export interface Raw { - monthly_billing_anchor_date?: (number | null | undefined) | null; - effective_date?: (string | null | undefined) | null; + monthly_billing_anchor_date?: (number | null) | null; + effective_date?: (string | null) | null; } } diff --git a/src/serialization/resources/subscriptions/client/requests/CreateSubscriptionRequest.ts b/src/serialization/resources/subscriptions/client/requests/CreateSubscriptionRequest.ts index 9e5c53f75..f622c8ea4 100644 --- a/src/serialization/resources/subscriptions/client/requests/CreateSubscriptionRequest.ts +++ b/src/serialization/resources/subscriptions/client/requests/CreateSubscriptionRequest.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { Money } from "../../../../types/Money"; -import { Phase } from "../../../../types/Phase"; import { SubscriptionSource } from "../../../../types/SubscriptionSource"; +import { Phase } from "../../../../types/Phase"; export const CreateSubscriptionRequest: core.serialization.Schema< serializers.CreateSubscriptionRequest.Raw, diff --git a/src/serialization/resources/subscriptions/client/requests/PauseSubscriptionRequest.ts b/src/serialization/resources/subscriptions/client/requests/PauseSubscriptionRequest.ts index 288fbdd04..384d35024 100644 --- a/src/serialization/resources/subscriptions/client/requests/PauseSubscriptionRequest.ts +++ b/src/serialization/resources/subscriptions/client/requests/PauseSubscriptionRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { ChangeTiming } from "../../../../types/ChangeTiming"; export const PauseSubscriptionRequest: core.serialization.Schema< @@ -27,10 +29,10 @@ export const PauseSubscriptionRequest: core.serialization.Schema< export declare namespace PauseSubscriptionRequest { export interface Raw { - pause_effective_date?: (string | null | undefined) | null; - pause_cycle_duration?: ((bigint | number) | null | undefined) | null; - resume_effective_date?: (string | null | undefined) | null; + pause_effective_date?: (string | null) | null; + pause_cycle_duration?: ((bigint | number) | null) | null; + resume_effective_date?: (string | null) | null; resume_change_timing?: ChangeTiming.Raw | null; - pause_reason?: (string | null | undefined) | null; + pause_reason?: (string | null) | null; } } diff --git a/src/serialization/resources/subscriptions/client/requests/ResumeSubscriptionRequest.ts b/src/serialization/resources/subscriptions/client/requests/ResumeSubscriptionRequest.ts index 4b0727cf4..47f788ac0 100644 --- a/src/serialization/resources/subscriptions/client/requests/ResumeSubscriptionRequest.ts +++ b/src/serialization/resources/subscriptions/client/requests/ResumeSubscriptionRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { ChangeTiming } from "../../../../types/ChangeTiming"; export const ResumeSubscriptionRequest: core.serialization.Schema< @@ -18,7 +20,7 @@ export const ResumeSubscriptionRequest: core.serialization.Schema< export declare namespace ResumeSubscriptionRequest { export interface Raw { - resume_effective_date?: (string | null | undefined) | null; + resume_effective_date?: (string | null) | null; resume_change_timing?: ChangeTiming.Raw | null; } } diff --git a/src/serialization/resources/subscriptions/client/requests/SearchSubscriptionsRequest.ts b/src/serialization/resources/subscriptions/client/requests/SearchSubscriptionsRequest.ts index e447ce863..6bc67aa04 100644 --- a/src/serialization/resources/subscriptions/client/requests/SearchSubscriptionsRequest.ts +++ b/src/serialization/resources/subscriptions/client/requests/SearchSubscriptionsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { SearchSubscriptionsQuery } from "../../../../types/SearchSubscriptionsQuery"; export const SearchSubscriptionsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/subscriptions/client/requests/SwapPlanRequest.ts b/src/serialization/resources/subscriptions/client/requests/SwapPlanRequest.ts index 93165e5a7..20b4035e0 100644 --- a/src/serialization/resources/subscriptions/client/requests/SwapPlanRequest.ts +++ b/src/serialization/resources/subscriptions/client/requests/SwapPlanRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { PhaseInput } from "../../../../types/PhaseInput"; export const SwapPlanRequest: core.serialization.Schema< @@ -18,7 +20,7 @@ export const SwapPlanRequest: core.serialization.Schema< export declare namespace SwapPlanRequest { export interface Raw { - new_plan_variation_id?: (string | null | undefined) | null; - phases?: (PhaseInput.Raw[] | null | undefined) | null; + new_plan_variation_id?: (string | null) | null; + phases?: (PhaseInput.Raw[] | null) | null; } } diff --git a/src/serialization/resources/subscriptions/client/requests/UpdateSubscriptionRequest.ts b/src/serialization/resources/subscriptions/client/requests/UpdateSubscriptionRequest.ts index 8ffe58090..ec6826f50 100644 --- a/src/serialization/resources/subscriptions/client/requests/UpdateSubscriptionRequest.ts +++ b/src/serialization/resources/subscriptions/client/requests/UpdateSubscriptionRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { Subscription } from "../../../../types/Subscription"; export const UpdateSubscriptionRequest: core.serialization.Schema< diff --git a/src/serialization/resources/subscriptions/client/requests/index.ts b/src/serialization/resources/subscriptions/client/requests/index.ts index 53abf84bf..b48070509 100644 --- a/src/serialization/resources/subscriptions/client/requests/index.ts +++ b/src/serialization/resources/subscriptions/client/requests/index.ts @@ -1,8 +1,8 @@ +export { CreateSubscriptionRequest } from "./CreateSubscriptionRequest"; export { BulkSwapPlanRequest } from "./BulkSwapPlanRequest"; +export { SearchSubscriptionsRequest } from "./SearchSubscriptionsRequest"; +export { UpdateSubscriptionRequest } from "./UpdateSubscriptionRequest"; export { ChangeBillingAnchorDateRequest } from "./ChangeBillingAnchorDateRequest"; -export { CreateSubscriptionRequest } from "./CreateSubscriptionRequest"; export { PauseSubscriptionRequest } from "./PauseSubscriptionRequest"; export { ResumeSubscriptionRequest } from "./ResumeSubscriptionRequest"; -export { SearchSubscriptionsRequest } from "./SearchSubscriptionsRequest"; export { SwapPlanRequest } from "./SwapPlanRequest"; -export { UpdateSubscriptionRequest } from "./UpdateSubscriptionRequest"; diff --git a/src/serialization/resources/team/client/requests/CreateJobRequest.ts b/src/serialization/resources/team/client/requests/CreateJobRequest.ts index 77b51866b..7ab21c8a9 100644 --- a/src/serialization/resources/team/client/requests/CreateJobRequest.ts +++ b/src/serialization/resources/team/client/requests/CreateJobRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { Job } from "../../../../types/Job"; export const CreateJobRequest: core.serialization.Schema = diff --git a/src/serialization/resources/team/client/requests/UpdateJobRequest.ts b/src/serialization/resources/team/client/requests/UpdateJobRequest.ts index 638150000..a4b0ff74a 100644 --- a/src/serialization/resources/team/client/requests/UpdateJobRequest.ts +++ b/src/serialization/resources/team/client/requests/UpdateJobRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { Job } from "../../../../types/Job"; export const UpdateJobRequest: core.serialization.Schema< diff --git a/src/serialization/resources/teamMembers/client/requests/BatchCreateTeamMembersRequest.ts b/src/serialization/resources/teamMembers/client/requests/BatchCreateTeamMembersRequest.ts index 2819e0a94..2484c48dd 100644 --- a/src/serialization/resources/teamMembers/client/requests/BatchCreateTeamMembersRequest.ts +++ b/src/serialization/resources/teamMembers/client/requests/BatchCreateTeamMembersRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { CreateTeamMemberRequest } from "../../../../types/CreateTeamMemberRequest"; export const BatchCreateTeamMembersRequest: core.serialization.Schema< diff --git a/src/serialization/resources/teamMembers/client/requests/BatchUpdateTeamMembersRequest.ts b/src/serialization/resources/teamMembers/client/requests/BatchUpdateTeamMembersRequest.ts index ad0244d09..69b652a7c 100644 --- a/src/serialization/resources/teamMembers/client/requests/BatchUpdateTeamMembersRequest.ts +++ b/src/serialization/resources/teamMembers/client/requests/BatchUpdateTeamMembersRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { UpdateTeamMemberRequest } from "../../../../types/UpdateTeamMemberRequest"; export const BatchUpdateTeamMembersRequest: core.serialization.Schema< diff --git a/src/serialization/resources/teamMembers/client/requests/SearchTeamMembersRequest.ts b/src/serialization/resources/teamMembers/client/requests/SearchTeamMembersRequest.ts index 4631fb4e7..46826c908 100644 --- a/src/serialization/resources/teamMembers/client/requests/SearchTeamMembersRequest.ts +++ b/src/serialization/resources/teamMembers/client/requests/SearchTeamMembersRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { SearchTeamMembersQuery } from "../../../../types/SearchTeamMembersQuery"; export const SearchTeamMembersRequest: core.serialization.Schema< diff --git a/src/serialization/resources/teamMembers/resources/wageSetting/client/requests/UpdateWageSettingRequest.ts b/src/serialization/resources/teamMembers/resources/wageSetting/client/requests/UpdateWageSettingRequest.ts index 3b8c3591c..e09c0ea2b 100644 --- a/src/serialization/resources/teamMembers/resources/wageSetting/client/requests/UpdateWageSettingRequest.ts +++ b/src/serialization/resources/teamMembers/resources/wageSetting/client/requests/UpdateWageSettingRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { WageSetting } from "../../../../../../types/WageSetting"; export const UpdateWageSettingRequest: core.serialization.Schema< diff --git a/src/serialization/resources/terminal/resources/actions/client/requests/CreateTerminalActionRequest.ts b/src/serialization/resources/terminal/resources/actions/client/requests/CreateTerminalActionRequest.ts index 28ab35c9a..1dbf1be21 100644 --- a/src/serialization/resources/terminal/resources/actions/client/requests/CreateTerminalActionRequest.ts +++ b/src/serialization/resources/terminal/resources/actions/client/requests/CreateTerminalActionRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { TerminalAction } from "../../../../../../types/TerminalAction"; export const CreateTerminalActionRequest: core.serialization.Schema< diff --git a/src/serialization/resources/terminal/resources/actions/client/requests/SearchTerminalActionsRequest.ts b/src/serialization/resources/terminal/resources/actions/client/requests/SearchTerminalActionsRequest.ts index 373edeab6..0c5fc148c 100644 --- a/src/serialization/resources/terminal/resources/actions/client/requests/SearchTerminalActionsRequest.ts +++ b/src/serialization/resources/terminal/resources/actions/client/requests/SearchTerminalActionsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { TerminalActionQuery } from "../../../../../../types/TerminalActionQuery"; export const SearchTerminalActionsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/terminal/resources/checkouts/client/requests/CreateTerminalCheckoutRequest.ts b/src/serialization/resources/terminal/resources/checkouts/client/requests/CreateTerminalCheckoutRequest.ts index 1d8d6e0a1..467299dbc 100644 --- a/src/serialization/resources/terminal/resources/checkouts/client/requests/CreateTerminalCheckoutRequest.ts +++ b/src/serialization/resources/terminal/resources/checkouts/client/requests/CreateTerminalCheckoutRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { TerminalCheckout } from "../../../../../../types/TerminalCheckout"; export const CreateTerminalCheckoutRequest: core.serialization.Schema< diff --git a/src/serialization/resources/terminal/resources/checkouts/client/requests/SearchTerminalCheckoutsRequest.ts b/src/serialization/resources/terminal/resources/checkouts/client/requests/SearchTerminalCheckoutsRequest.ts index 63e3a8874..0ba1d4581 100644 --- a/src/serialization/resources/terminal/resources/checkouts/client/requests/SearchTerminalCheckoutsRequest.ts +++ b/src/serialization/resources/terminal/resources/checkouts/client/requests/SearchTerminalCheckoutsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { TerminalCheckoutQuery } from "../../../../../../types/TerminalCheckoutQuery"; export const SearchTerminalCheckoutsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/terminal/resources/refunds/client/requests/CreateTerminalRefundRequest.ts b/src/serialization/resources/terminal/resources/refunds/client/requests/CreateTerminalRefundRequest.ts index 87a011727..a871e1058 100644 --- a/src/serialization/resources/terminal/resources/refunds/client/requests/CreateTerminalRefundRequest.ts +++ b/src/serialization/resources/terminal/resources/refunds/client/requests/CreateTerminalRefundRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { TerminalRefund } from "../../../../../../types/TerminalRefund"; export const CreateTerminalRefundRequest: core.serialization.Schema< diff --git a/src/serialization/resources/terminal/resources/refunds/client/requests/SearchTerminalRefundsRequest.ts b/src/serialization/resources/terminal/resources/refunds/client/requests/SearchTerminalRefundsRequest.ts index d756e2d1a..c2d5fff3e 100644 --- a/src/serialization/resources/terminal/resources/refunds/client/requests/SearchTerminalRefundsRequest.ts +++ b/src/serialization/resources/terminal/resources/refunds/client/requests/SearchTerminalRefundsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { TerminalRefundQuery } from "../../../../../../types/TerminalRefundQuery"; export const SearchTerminalRefundsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/transferOrders/client/index.ts b/src/serialization/resources/transferOrders/client/index.ts deleted file mode 100644 index 415726b7f..000000000 --- a/src/serialization/resources/transferOrders/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests"; diff --git a/src/serialization/resources/transferOrders/client/requests/CancelTransferOrderRequest.ts b/src/serialization/resources/transferOrders/client/requests/CancelTransferOrderRequest.ts deleted file mode 100644 index 3653cf613..000000000 --- a/src/serialization/resources/transferOrders/client/requests/CancelTransferOrderRequest.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../../../../api/index"; -import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; - -export const CancelTransferOrderRequest: core.serialization.Schema< - serializers.CancelTransferOrderRequest.Raw, - Omit -> = core.serialization.object({ - idempotencyKey: core.serialization.property("idempotency_key", core.serialization.string()), - version: core.serialization.bigint().optional(), -}); - -export declare namespace CancelTransferOrderRequest { - export interface Raw { - idempotency_key: string; - version?: (bigint | number) | null; - } -} diff --git a/src/serialization/resources/transferOrders/client/requests/CreateTransferOrderRequest.ts b/src/serialization/resources/transferOrders/client/requests/CreateTransferOrderRequest.ts deleted file mode 100644 index a3e091de5..000000000 --- a/src/serialization/resources/transferOrders/client/requests/CreateTransferOrderRequest.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../../../../api/index"; -import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; -import { CreateTransferOrderData } from "../../../../types/CreateTransferOrderData"; - -export const CreateTransferOrderRequest: core.serialization.Schema< - serializers.CreateTransferOrderRequest.Raw, - Square.CreateTransferOrderRequest -> = core.serialization.object({ - idempotencyKey: core.serialization.property("idempotency_key", core.serialization.string()), - transferOrder: core.serialization.property("transfer_order", CreateTransferOrderData), -}); - -export declare namespace CreateTransferOrderRequest { - export interface Raw { - idempotency_key: string; - transfer_order: CreateTransferOrderData.Raw; - } -} diff --git a/src/serialization/resources/transferOrders/client/requests/ReceiveTransferOrderRequest.ts b/src/serialization/resources/transferOrders/client/requests/ReceiveTransferOrderRequest.ts deleted file mode 100644 index aa8d2a942..000000000 --- a/src/serialization/resources/transferOrders/client/requests/ReceiveTransferOrderRequest.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../../../../api/index"; -import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; -import { TransferOrderGoodsReceipt } from "../../../../types/TransferOrderGoodsReceipt"; - -export const ReceiveTransferOrderRequest: core.serialization.Schema< - serializers.ReceiveTransferOrderRequest.Raw, - Omit -> = core.serialization.object({ - idempotencyKey: core.serialization.property("idempotency_key", core.serialization.string()), - receipt: TransferOrderGoodsReceipt, - version: core.serialization.bigint().optional(), -}); - -export declare namespace ReceiveTransferOrderRequest { - export interface Raw { - idempotency_key: string; - receipt: TransferOrderGoodsReceipt.Raw; - version?: (bigint | number) | null; - } -} diff --git a/src/serialization/resources/transferOrders/client/requests/SearchTransferOrdersRequest.ts b/src/serialization/resources/transferOrders/client/requests/SearchTransferOrdersRequest.ts deleted file mode 100644 index 35de928b6..000000000 --- a/src/serialization/resources/transferOrders/client/requests/SearchTransferOrdersRequest.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../../../../api/index"; -import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; -import { TransferOrderQuery } from "../../../../types/TransferOrderQuery"; - -export const SearchTransferOrdersRequest: core.serialization.Schema< - serializers.SearchTransferOrdersRequest.Raw, - Square.SearchTransferOrdersRequest -> = core.serialization.object({ - query: TransferOrderQuery.optional(), - cursor: core.serialization.string().optional(), - limit: core.serialization.number().optional(), -}); - -export declare namespace SearchTransferOrdersRequest { - export interface Raw { - query?: TransferOrderQuery.Raw | null; - cursor?: string | null; - limit?: number | null; - } -} diff --git a/src/serialization/resources/transferOrders/client/requests/StartTransferOrderRequest.ts b/src/serialization/resources/transferOrders/client/requests/StartTransferOrderRequest.ts deleted file mode 100644 index 1df46c7c1..000000000 --- a/src/serialization/resources/transferOrders/client/requests/StartTransferOrderRequest.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../../../../api/index"; -import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; - -export const StartTransferOrderRequest: core.serialization.Schema< - serializers.StartTransferOrderRequest.Raw, - Omit -> = core.serialization.object({ - idempotencyKey: core.serialization.property("idempotency_key", core.serialization.string()), - version: core.serialization.bigint().optional(), -}); - -export declare namespace StartTransferOrderRequest { - export interface Raw { - idempotency_key: string; - version?: (bigint | number) | null; - } -} diff --git a/src/serialization/resources/transferOrders/client/requests/UpdateTransferOrderRequest.ts b/src/serialization/resources/transferOrders/client/requests/UpdateTransferOrderRequest.ts deleted file mode 100644 index c64ca08cc..000000000 --- a/src/serialization/resources/transferOrders/client/requests/UpdateTransferOrderRequest.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../../../../api/index"; -import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; -import { UpdateTransferOrderData } from "../../../../types/UpdateTransferOrderData"; - -export const UpdateTransferOrderRequest: core.serialization.Schema< - serializers.UpdateTransferOrderRequest.Raw, - Omit -> = core.serialization.object({ - idempotencyKey: core.serialization.property("idempotency_key", core.serialization.string()), - transferOrder: core.serialization.property("transfer_order", UpdateTransferOrderData), - version: core.serialization.bigint().optional(), -}); - -export declare namespace UpdateTransferOrderRequest { - export interface Raw { - idempotency_key: string; - transfer_order: UpdateTransferOrderData.Raw; - version?: (bigint | number) | null; - } -} diff --git a/src/serialization/resources/transferOrders/client/requests/index.ts b/src/serialization/resources/transferOrders/client/requests/index.ts deleted file mode 100644 index cd1755751..000000000 --- a/src/serialization/resources/transferOrders/client/requests/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { CancelTransferOrderRequest } from "./CancelTransferOrderRequest"; -export { CreateTransferOrderRequest } from "./CreateTransferOrderRequest"; -export { ReceiveTransferOrderRequest } from "./ReceiveTransferOrderRequest"; -export { SearchTransferOrdersRequest } from "./SearchTransferOrdersRequest"; -export { StartTransferOrderRequest } from "./StartTransferOrderRequest"; -export { UpdateTransferOrderRequest } from "./UpdateTransferOrderRequest"; diff --git a/src/serialization/resources/transferOrders/index.ts b/src/serialization/resources/transferOrders/index.ts deleted file mode 100644 index 5ec76921e..000000000 --- a/src/serialization/resources/transferOrders/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./client"; diff --git a/src/serialization/resources/v1Transactions/client/index.ts b/src/serialization/resources/v1Transactions/client/index.ts index 65c136ea7..989c4b62f 100644 --- a/src/serialization/resources/v1Transactions/client/index.ts +++ b/src/serialization/resources/v1Transactions/client/index.ts @@ -1,2 +1,2 @@ -export * from "./requests"; export * as v1ListOrders from "./v1ListOrders"; +export * from "./requests"; diff --git a/src/serialization/resources/v1Transactions/client/requests/V1UpdateOrderRequest.ts b/src/serialization/resources/v1Transactions/client/requests/V1UpdateOrderRequest.ts index 0b399e370..bb759291f 100644 --- a/src/serialization/resources/v1Transactions/client/requests/V1UpdateOrderRequest.ts +++ b/src/serialization/resources/v1Transactions/client/requests/V1UpdateOrderRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { V1UpdateOrderRequestAction } from "../../../../types/V1UpdateOrderRequestAction"; export const V1UpdateOrderRequest: core.serialization.Schema< @@ -22,9 +24,9 @@ export const V1UpdateOrderRequest: core.serialization.Schema< export declare namespace V1UpdateOrderRequest { export interface Raw { action: V1UpdateOrderRequestAction.Raw; - shipped_tracking_number?: (string | null | undefined) | null; - completed_note?: (string | null | undefined) | null; - refunded_note?: (string | null | undefined) | null; - canceled_note?: (string | null | undefined) | null; + shipped_tracking_number?: (string | null) | null; + completed_note?: (string | null) | null; + refunded_note?: (string | null) | null; + canceled_note?: (string | null) | null; } } diff --git a/src/serialization/resources/v1Transactions/client/v1ListOrders.ts b/src/serialization/resources/v1Transactions/client/v1ListOrders.ts index 74da2f8d0..76b301b14 100644 --- a/src/serialization/resources/v1Transactions/client/v1ListOrders.ts +++ b/src/serialization/resources/v1Transactions/client/v1ListOrders.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Square from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; import { V1Order } from "../../../types/V1Order"; export const Response: core.serialization.Schema< diff --git a/src/serialization/resources/vendors/client/requests/BatchCreateVendorsRequest.ts b/src/serialization/resources/vendors/client/requests/BatchCreateVendorsRequest.ts index 8faf41034..35197e5df 100644 --- a/src/serialization/resources/vendors/client/requests/BatchCreateVendorsRequest.ts +++ b/src/serialization/resources/vendors/client/requests/BatchCreateVendorsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { Vendor } from "../../../../types/Vendor"; export const BatchCreateVendorsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/vendors/client/requests/BatchGetVendorsRequest.ts b/src/serialization/resources/vendors/client/requests/BatchGetVendorsRequest.ts index 757a405b4..fc7005729 100644 --- a/src/serialization/resources/vendors/client/requests/BatchGetVendorsRequest.ts +++ b/src/serialization/resources/vendors/client/requests/BatchGetVendorsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const BatchGetVendorsRequest: core.serialization.Schema< serializers.BatchGetVendorsRequest.Raw, @@ -16,6 +18,6 @@ export const BatchGetVendorsRequest: core.serialization.Schema< export declare namespace BatchGetVendorsRequest { export interface Raw { - vendor_ids?: (string[] | null | undefined) | null; + vendor_ids?: (string[] | null) | null; } } diff --git a/src/serialization/resources/vendors/client/requests/BatchUpdateVendorsRequest.ts b/src/serialization/resources/vendors/client/requests/BatchUpdateVendorsRequest.ts index d9706b819..d9cdd6c78 100644 --- a/src/serialization/resources/vendors/client/requests/BatchUpdateVendorsRequest.ts +++ b/src/serialization/resources/vendors/client/requests/BatchUpdateVendorsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { UpdateVendorRequest } from "../../../../types/UpdateVendorRequest"; export const BatchUpdateVendorsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/vendors/client/requests/CreateVendorRequest.ts b/src/serialization/resources/vendors/client/requests/CreateVendorRequest.ts index 4a8af4e0e..64c531673 100644 --- a/src/serialization/resources/vendors/client/requests/CreateVendorRequest.ts +++ b/src/serialization/resources/vendors/client/requests/CreateVendorRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { Vendor } from "../../../../types/Vendor"; export const CreateVendorRequest: core.serialization.Schema< diff --git a/src/serialization/resources/vendors/client/requests/SearchVendorsRequest.ts b/src/serialization/resources/vendors/client/requests/SearchVendorsRequest.ts index 95b41323d..1a22317b8 100644 --- a/src/serialization/resources/vendors/client/requests/SearchVendorsRequest.ts +++ b/src/serialization/resources/vendors/client/requests/SearchVendorsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Square from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { SearchVendorsRequestFilter } from "../../../../types/SearchVendorsRequestFilter"; import { SearchVendorsRequestSort } from "../../../../types/SearchVendorsRequestSort"; diff --git a/src/serialization/resources/webhooks/resources/subscriptions/client/requests/CreateWebhookSubscriptionRequest.ts b/src/serialization/resources/webhooks/resources/subscriptions/client/requests/CreateWebhookSubscriptionRequest.ts index 45008fa6d..67ed058de 100644 --- a/src/serialization/resources/webhooks/resources/subscriptions/client/requests/CreateWebhookSubscriptionRequest.ts +++ b/src/serialization/resources/webhooks/resources/subscriptions/client/requests/CreateWebhookSubscriptionRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { WebhookSubscription } from "../../../../../../types/WebhookSubscription"; export const CreateWebhookSubscriptionRequest: core.serialization.Schema< diff --git a/src/serialization/resources/webhooks/resources/subscriptions/client/requests/TestWebhookSubscriptionRequest.ts b/src/serialization/resources/webhooks/resources/subscriptions/client/requests/TestWebhookSubscriptionRequest.ts index fb56575b8..97000bd74 100644 --- a/src/serialization/resources/webhooks/resources/subscriptions/client/requests/TestWebhookSubscriptionRequest.ts +++ b/src/serialization/resources/webhooks/resources/subscriptions/client/requests/TestWebhookSubscriptionRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; export const TestWebhookSubscriptionRequest: core.serialization.Schema< serializers.webhooks.TestWebhookSubscriptionRequest.Raw, @@ -13,6 +15,6 @@ export const TestWebhookSubscriptionRequest: core.serialization.Schema< export declare namespace TestWebhookSubscriptionRequest { export interface Raw { - event_type?: (string | null | undefined) | null; + event_type?: (string | null) | null; } } diff --git a/src/serialization/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionRequest.ts b/src/serialization/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionRequest.ts index dc254a731..495a62319 100644 --- a/src/serialization/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionRequest.ts +++ b/src/serialization/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { WebhookSubscription } from "../../../../../../types/WebhookSubscription"; export const UpdateWebhookSubscriptionRequest: core.serialization.Schema< diff --git a/src/serialization/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionSignatureKeyRequest.ts b/src/serialization/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionSignatureKeyRequest.ts index a4016b2ef..b03a6f88b 100644 --- a/src/serialization/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionSignatureKeyRequest.ts +++ b/src/serialization/resources/webhooks/resources/subscriptions/client/requests/UpdateWebhookSubscriptionSignatureKeyRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Square from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; export const UpdateWebhookSubscriptionSignatureKeyRequest: core.serialization.Schema< serializers.webhooks.UpdateWebhookSubscriptionSignatureKeyRequest.Raw, @@ -13,6 +15,6 @@ export const UpdateWebhookSubscriptionSignatureKeyRequest: core.serialization.Sc export declare namespace UpdateWebhookSubscriptionSignatureKeyRequest { export interface Raw { - idempotency_key?: (string | null | undefined) | null; + idempotency_key?: (string | null) | null; } } diff --git a/src/serialization/resources/webhooks/resources/subscriptions/client/requests/index.ts b/src/serialization/resources/webhooks/resources/subscriptions/client/requests/index.ts index f1543199e..849f59f16 100644 --- a/src/serialization/resources/webhooks/resources/subscriptions/client/requests/index.ts +++ b/src/serialization/resources/webhooks/resources/subscriptions/client/requests/index.ts @@ -1,4 +1,4 @@ export { CreateWebhookSubscriptionRequest } from "./CreateWebhookSubscriptionRequest"; -export { TestWebhookSubscriptionRequest } from "./TestWebhookSubscriptionRequest"; export { UpdateWebhookSubscriptionRequest } from "./UpdateWebhookSubscriptionRequest"; export { UpdateWebhookSubscriptionSignatureKeyRequest } from "./UpdateWebhookSubscriptionSignatureKeyRequest"; +export { TestWebhookSubscriptionRequest } from "./TestWebhookSubscriptionRequest"; diff --git a/src/serialization/types/AcceptDisputeResponse.ts b/src/serialization/types/AcceptDisputeResponse.ts index dbc7ff686..2806b9f11 100644 --- a/src/serialization/types/AcceptDisputeResponse.ts +++ b/src/serialization/types/AcceptDisputeResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Dispute } from "./Dispute"; import { Error_ } from "./Error_"; +import { Dispute } from "./Dispute"; export const AcceptDisputeResponse: core.serialization.ObjectSchema< serializers.AcceptDisputeResponse.Raw, diff --git a/src/serialization/types/AcceptedPaymentMethods.ts b/src/serialization/types/AcceptedPaymentMethods.ts index f253f9b9f..1281bce45 100644 --- a/src/serialization/types/AcceptedPaymentMethods.ts +++ b/src/serialization/types/AcceptedPaymentMethods.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const AcceptedPaymentMethods: core.serialization.ObjectSchema< serializers.AcceptedPaymentMethods.Raw, @@ -16,9 +18,9 @@ export const AcceptedPaymentMethods: core.serialization.ObjectSchema< export declare namespace AcceptedPaymentMethods { export interface Raw { - apple_pay?: (boolean | null | undefined) | null; - google_pay?: (boolean | null | undefined) | null; - cash_app_pay?: (boolean | null | undefined) | null; - afterpay_clearpay?: (boolean | null | undefined) | null; + apple_pay?: (boolean | null) | null; + google_pay?: (boolean | null) | null; + cash_app_pay?: (boolean | null) | null; + afterpay_clearpay?: (boolean | null) | null; } } diff --git a/src/serialization/types/AccumulateLoyaltyPointsResponse.ts b/src/serialization/types/AccumulateLoyaltyPointsResponse.ts index 59ea9c74c..a0b7b9f5d 100644 --- a/src/serialization/types/AccumulateLoyaltyPointsResponse.ts +++ b/src/serialization/types/AccumulateLoyaltyPointsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyEvent } from "./LoyaltyEvent"; diff --git a/src/serialization/types/AchDetails.ts b/src/serialization/types/AchDetails.ts index 24587fe73..b69297e11 100644 --- a/src/serialization/types/AchDetails.ts +++ b/src/serialization/types/AchDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const AchDetails: core.serialization.ObjectSchema = core.serialization.object({ @@ -16,8 +18,8 @@ export const AchDetails: core.serialization.ObjectSchema = core.serialization.enum_([ diff --git a/src/serialization/types/AddGroupToCustomerResponse.ts b/src/serialization/types/AddGroupToCustomerResponse.ts index 5cdd4390b..1d8d5e99c 100644 --- a/src/serialization/types/AddGroupToCustomerResponse.ts +++ b/src/serialization/types/AddGroupToCustomerResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const AddGroupToCustomerResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/AdditionalRecipient.ts b/src/serialization/types/AdditionalRecipient.ts index 513255eb1..672bb2df2 100644 --- a/src/serialization/types/AdditionalRecipient.ts +++ b/src/serialization/types/AdditionalRecipient.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const AdditionalRecipient: core.serialization.ObjectSchema< @@ -18,8 +20,8 @@ export const AdditionalRecipient: core.serialization.ObjectSchema< export declare namespace AdditionalRecipient { export interface Raw { location_id: string; - description?: (string | null | undefined) | null; + description?: (string | null) | null; amount_money: Money.Raw; - receivable_id?: (string | null | undefined) | null; + receivable_id?: (string | null) | null; } } diff --git a/src/serialization/types/Address.ts b/src/serialization/types/Address.ts index e3dcf2b39..33ed78cdc 100644 --- a/src/serialization/types/Address.ts +++ b/src/serialization/types/Address.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Country } from "./Country"; export const Address: core.serialization.ObjectSchema = @@ -34,19 +36,19 @@ export const Address: core.serialization.ObjectSchema = core.serialization.object({ @@ -11,6 +13,6 @@ export const AfterpayDetails: core.serialization.ObjectSchema = core.serialization.stringLiteral("TERMINAL_API"); diff --git a/src/serialization/types/AppointmentSegment.ts b/src/serialization/types/AppointmentSegment.ts index 90bcdc946..a159933b8 100644 --- a/src/serialization/types/AppointmentSegment.ts +++ b/src/serialization/types/AppointmentSegment.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const AppointmentSegment: core.serialization.ObjectSchema< serializers.AppointmentSegment.Raw, @@ -28,10 +30,10 @@ export const AppointmentSegment: core.serialization.ObjectSchema< export declare namespace AppointmentSegment { export interface Raw { - duration_minutes?: (number | null | undefined) | null; - service_variation_id?: (string | null | undefined) | null; + duration_minutes?: (number | null) | null; + service_variation_id?: (string | null) | null; team_member_id: string; - service_variation_version?: ((bigint | number) | null | undefined) | null; + service_variation_version?: ((bigint | number) | null) | null; intermission_minutes?: number | null; any_team_member?: boolean | null; resource_ids?: string[] | null; diff --git a/src/serialization/types/ArchivedState.ts b/src/serialization/types/ArchivedState.ts index 9b3868b0c..691716411 100644 --- a/src/serialization/types/ArchivedState.ts +++ b/src/serialization/types/ArchivedState.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ArchivedState: core.serialization.Schema = core.serialization.enum_(["ARCHIVED_STATE_NOT_ARCHIVED", "ARCHIVED_STATE_ARCHIVED", "ARCHIVED_STATE_ALL"]); diff --git a/src/serialization/types/Availability.ts b/src/serialization/types/Availability.ts index 027925ddf..367bb8fc3 100644 --- a/src/serialization/types/Availability.ts +++ b/src/serialization/types/Availability.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { AppointmentSegment } from "./AppointmentSegment"; export const Availability: core.serialization.ObjectSchema = @@ -17,8 +19,8 @@ export const Availability: core.serialization.ObjectSchema = core.serialization.object({ @@ -47,15 +49,15 @@ export declare namespace BankAccount { account_type: BankAccountType.Raw; holder_name: string; primary_bank_identification_number: string; - secondary_bank_identification_number?: (string | null | undefined) | null; - debit_mandate_reference_id?: (string | null | undefined) | null; - reference_id?: (string | null | undefined) | null; - location_id?: (string | null | undefined) | null; + secondary_bank_identification_number?: (string | null) | null; + debit_mandate_reference_id?: (string | null) | null; + reference_id?: (string | null) | null; + location_id?: (string | null) | null; status: BankAccountStatus.Raw; creditable: boolean; debitable: boolean; - fingerprint?: (string | null | undefined) | null; + fingerprint?: (string | null) | null; version?: number | null; - bank_name?: (string | null | undefined) | null; + bank_name?: (string | null) | null; } } diff --git a/src/serialization/types/BankAccountCreatedEvent.ts b/src/serialization/types/BankAccountCreatedEvent.ts index e6e8f0eab..f7b60414b 100644 --- a/src/serialization/types/BankAccountCreatedEvent.ts +++ b/src/serialization/types/BankAccountCreatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BankAccountCreatedEventData } from "./BankAccountCreatedEventData"; export const BankAccountCreatedEvent: core.serialization.ObjectSchema< @@ -19,10 +21,10 @@ export const BankAccountCreatedEvent: core.serialization.ObjectSchema< export declare namespace BankAccountCreatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - location_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + location_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: BankAccountCreatedEventData.Raw | null; } diff --git a/src/serialization/types/BankAccountCreatedEventData.ts b/src/serialization/types/BankAccountCreatedEventData.ts index bd371a101..4039ba596 100644 --- a/src/serialization/types/BankAccountCreatedEventData.ts +++ b/src/serialization/types/BankAccountCreatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BankAccountCreatedEventObject } from "./BankAccountCreatedEventObject"; export const BankAccountCreatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const BankAccountCreatedEventData: core.serialization.ObjectSchema< export declare namespace BankAccountCreatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: BankAccountCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/BankAccountCreatedEventObject.ts b/src/serialization/types/BankAccountCreatedEventObject.ts index f1d43933f..f37db6a8a 100644 --- a/src/serialization/types/BankAccountCreatedEventObject.ts +++ b/src/serialization/types/BankAccountCreatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BankAccount } from "./BankAccount"; export const BankAccountCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BankAccountDisabledEvent.ts b/src/serialization/types/BankAccountDisabledEvent.ts index 2c28a315e..816ccc1b4 100644 --- a/src/serialization/types/BankAccountDisabledEvent.ts +++ b/src/serialization/types/BankAccountDisabledEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BankAccountDisabledEventData } from "./BankAccountDisabledEventData"; export const BankAccountDisabledEvent: core.serialization.ObjectSchema< @@ -19,10 +21,10 @@ export const BankAccountDisabledEvent: core.serialization.ObjectSchema< export declare namespace BankAccountDisabledEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - location_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + location_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: BankAccountDisabledEventData.Raw | null; } diff --git a/src/serialization/types/BankAccountDisabledEventData.ts b/src/serialization/types/BankAccountDisabledEventData.ts index 9f661ccd0..713331f7c 100644 --- a/src/serialization/types/BankAccountDisabledEventData.ts +++ b/src/serialization/types/BankAccountDisabledEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BankAccountDisabledEventObject } from "./BankAccountDisabledEventObject"; export const BankAccountDisabledEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const BankAccountDisabledEventData: core.serialization.ObjectSchema< export declare namespace BankAccountDisabledEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: BankAccountDisabledEventObject.Raw | null; } diff --git a/src/serialization/types/BankAccountDisabledEventObject.ts b/src/serialization/types/BankAccountDisabledEventObject.ts index 4d84ad9c0..4ae222e30 100644 --- a/src/serialization/types/BankAccountDisabledEventObject.ts +++ b/src/serialization/types/BankAccountDisabledEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BankAccount } from "./BankAccount"; export const BankAccountDisabledEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BankAccountPaymentDetails.ts b/src/serialization/types/BankAccountPaymentDetails.ts index 8231b312c..7a5bfea80 100644 --- a/src/serialization/types/BankAccountPaymentDetails.ts +++ b/src/serialization/types/BankAccountPaymentDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { AchDetails } from "./AchDetails"; import { Error_ } from "./Error_"; @@ -28,13 +30,13 @@ export const BankAccountPaymentDetails: core.serialization.ObjectSchema< export declare namespace BankAccountPaymentDetails { export interface Raw { - bank_name?: (string | null | undefined) | null; - transfer_type?: (string | null | undefined) | null; - account_ownership_type?: (string | null | undefined) | null; - fingerprint?: (string | null | undefined) | null; - country?: (string | null | undefined) | null; - statement_description?: (string | null | undefined) | null; + bank_name?: (string | null) | null; + transfer_type?: (string | null) | null; + account_ownership_type?: (string | null) | null; + fingerprint?: (string | null) | null; + country?: (string | null) | null; + statement_description?: (string | null) | null; ach_details?: AchDetails.Raw | null; - errors?: (Error_.Raw[] | null | undefined) | null; + errors?: (Error_.Raw[] | null) | null; } } diff --git a/src/serialization/types/BankAccountStatus.ts b/src/serialization/types/BankAccountStatus.ts index 9cbc93a3a..df4c18d94 100644 --- a/src/serialization/types/BankAccountStatus.ts +++ b/src/serialization/types/BankAccountStatus.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const BankAccountStatus: core.serialization.Schema = core.serialization.enum_(["VERIFICATION_IN_PROGRESS", "VERIFIED", "DISABLED"]); diff --git a/src/serialization/types/BankAccountType.ts b/src/serialization/types/BankAccountType.ts index bff470ca0..7d7183052 100644 --- a/src/serialization/types/BankAccountType.ts +++ b/src/serialization/types/BankAccountType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const BankAccountType: core.serialization.Schema = core.serialization.enum_(["CHECKING", "SAVINGS", "INVESTMENT", "OTHER", "BUSINESS_CHECKING"]); diff --git a/src/serialization/types/BankAccountVerifiedEvent.ts b/src/serialization/types/BankAccountVerifiedEvent.ts index 956e77574..59d4dd820 100644 --- a/src/serialization/types/BankAccountVerifiedEvent.ts +++ b/src/serialization/types/BankAccountVerifiedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BankAccountVerifiedEventData } from "./BankAccountVerifiedEventData"; export const BankAccountVerifiedEvent: core.serialization.ObjectSchema< @@ -19,10 +21,10 @@ export const BankAccountVerifiedEvent: core.serialization.ObjectSchema< export declare namespace BankAccountVerifiedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - location_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + location_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: BankAccountVerifiedEventData.Raw | null; } diff --git a/src/serialization/types/BankAccountVerifiedEventData.ts b/src/serialization/types/BankAccountVerifiedEventData.ts index 117aded6f..5da93bb5e 100644 --- a/src/serialization/types/BankAccountVerifiedEventData.ts +++ b/src/serialization/types/BankAccountVerifiedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BankAccountVerifiedEventObject } from "./BankAccountVerifiedEventObject"; export const BankAccountVerifiedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const BankAccountVerifiedEventData: core.serialization.ObjectSchema< export declare namespace BankAccountVerifiedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: BankAccountVerifiedEventObject.Raw | null; } diff --git a/src/serialization/types/BankAccountVerifiedEventObject.ts b/src/serialization/types/BankAccountVerifiedEventObject.ts index bdefc643b..f9a9214d7 100644 --- a/src/serialization/types/BankAccountVerifiedEventObject.ts +++ b/src/serialization/types/BankAccountVerifiedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BankAccount } from "./BankAccount"; export const BankAccountVerifiedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BatchChangeInventoryRequest.ts b/src/serialization/types/BatchChangeInventoryRequest.ts index 207bd2487..e32418d37 100644 --- a/src/serialization/types/BatchChangeInventoryRequest.ts +++ b/src/serialization/types/BatchChangeInventoryRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { InventoryChange } from "./InventoryChange"; export const BatchChangeInventoryRequest: core.serialization.ObjectSchema< @@ -20,7 +22,7 @@ export const BatchChangeInventoryRequest: core.serialization.ObjectSchema< export declare namespace BatchChangeInventoryRequest { export interface Raw { idempotency_key: string; - changes?: (InventoryChange.Raw[] | null | undefined) | null; - ignore_unchanged_counts?: (boolean | null | undefined) | null; + changes?: (InventoryChange.Raw[] | null) | null; + ignore_unchanged_counts?: (boolean | null) | null; } } diff --git a/src/serialization/types/BatchChangeInventoryResponse.ts b/src/serialization/types/BatchChangeInventoryResponse.ts index 3cdbd9efb..277e85771 100644 --- a/src/serialization/types/BatchChangeInventoryResponse.ts +++ b/src/serialization/types/BatchChangeInventoryResponse.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; -import { InventoryChange } from "./InventoryChange"; import { InventoryCount } from "./InventoryCount"; +import { InventoryChange } from "./InventoryChange"; export const BatchChangeInventoryResponse: core.serialization.ObjectSchema< serializers.BatchChangeInventoryResponse.Raw, diff --git a/src/serialization/types/BatchCreateTeamMembersResponse.ts b/src/serialization/types/BatchCreateTeamMembersResponse.ts index 1d50e5879..9edb71dac 100644 --- a/src/serialization/types/BatchCreateTeamMembersResponse.ts +++ b/src/serialization/types/BatchCreateTeamMembersResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CreateTeamMemberResponse } from "./CreateTeamMemberResponse"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BatchCreateVendorsResponse.ts b/src/serialization/types/BatchCreateVendorsResponse.ts index 181f990bf..b23bfbbb0 100644 --- a/src/serialization/types/BatchCreateVendorsResponse.ts +++ b/src/serialization/types/BatchCreateVendorsResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { CreateVendorResponse } from "./CreateVendorResponse"; import { Error_ } from "./Error_"; +import { CreateVendorResponse } from "./CreateVendorResponse"; export const BatchCreateVendorsResponse: core.serialization.ObjectSchema< serializers.BatchCreateVendorsResponse.Raw, diff --git a/src/serialization/types/BatchDeleteCatalogObjectsResponse.ts b/src/serialization/types/BatchDeleteCatalogObjectsResponse.ts index 9ef8f924c..53c0cdcdd 100644 --- a/src/serialization/types/BatchDeleteCatalogObjectsResponse.ts +++ b/src/serialization/types/BatchDeleteCatalogObjectsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const BatchDeleteCatalogObjectsResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BatchGetCatalogObjectsResponse.ts b/src/serialization/types/BatchGetCatalogObjectsResponse.ts index 319bc9e58..de6f66a25 100644 --- a/src/serialization/types/BatchGetCatalogObjectsResponse.ts +++ b/src/serialization/types/BatchGetCatalogObjectsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; -import * as core from "../../core"; import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; import { Error_ } from "./Error_"; export const BatchGetCatalogObjectsResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BatchGetInventoryChangesResponse.ts b/src/serialization/types/BatchGetInventoryChangesResponse.ts index f4d476d59..1a100da5a 100644 --- a/src/serialization/types/BatchGetInventoryChangesResponse.ts +++ b/src/serialization/types/BatchGetInventoryChangesResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { InventoryChange } from "./InventoryChange"; diff --git a/src/serialization/types/BatchGetInventoryCountsRequest.ts b/src/serialization/types/BatchGetInventoryCountsRequest.ts index e8ee5a47f..eb8312bf6 100644 --- a/src/serialization/types/BatchGetInventoryCountsRequest.ts +++ b/src/serialization/types/BatchGetInventoryCountsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { InventoryState } from "./InventoryState"; export const BatchGetInventoryCountsRequest: core.serialization.ObjectSchema< @@ -25,11 +27,11 @@ export const BatchGetInventoryCountsRequest: core.serialization.ObjectSchema< export declare namespace BatchGetInventoryCountsRequest { export interface Raw { - catalog_object_ids?: (string[] | null | undefined) | null; - location_ids?: (string[] | null | undefined) | null; - updated_after?: (string | null | undefined) | null; - cursor?: (string | null | undefined) | null; - states?: (InventoryState.Raw[] | null | undefined) | null; - limit?: (number | null | undefined) | null; + catalog_object_ids?: (string[] | null) | null; + location_ids?: (string[] | null) | null; + updated_after?: (string | null) | null; + cursor?: (string | null) | null; + states?: (InventoryState.Raw[] | null) | null; + limit?: (number | null) | null; } } diff --git a/src/serialization/types/BatchGetInventoryCountsResponse.ts b/src/serialization/types/BatchGetInventoryCountsResponse.ts index c17b38359..030eab0a5 100644 --- a/src/serialization/types/BatchGetInventoryCountsResponse.ts +++ b/src/serialization/types/BatchGetInventoryCountsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { InventoryCount } from "./InventoryCount"; diff --git a/src/serialization/types/BatchGetOrdersResponse.ts b/src/serialization/types/BatchGetOrdersResponse.ts index 9ce2af0fe..3eb249da1 100644 --- a/src/serialization/types/BatchGetOrdersResponse.ts +++ b/src/serialization/types/BatchGetOrdersResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Order } from "./Order"; +import { Error_ } from "./Error_"; export const BatchGetOrdersResponse: core.serialization.ObjectSchema< serializers.BatchGetOrdersResponse.Raw, diff --git a/src/serialization/types/BatchGetVendorsResponse.ts b/src/serialization/types/BatchGetVendorsResponse.ts index 1c2575d44..9ece6ca65 100644 --- a/src/serialization/types/BatchGetVendorsResponse.ts +++ b/src/serialization/types/BatchGetVendorsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { GetVendorResponse } from "./GetVendorResponse"; diff --git a/src/serialization/types/BatchRetrieveInventoryChangesRequest.ts b/src/serialization/types/BatchRetrieveInventoryChangesRequest.ts index 703244b39..9183e6d0d 100644 --- a/src/serialization/types/BatchRetrieveInventoryChangesRequest.ts +++ b/src/serialization/types/BatchRetrieveInventoryChangesRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { InventoryChangeType } from "./InventoryChangeType"; import { InventoryState } from "./InventoryState"; @@ -28,13 +30,13 @@ export const BatchRetrieveInventoryChangesRequest: core.serialization.ObjectSche export declare namespace BatchRetrieveInventoryChangesRequest { export interface Raw { - catalog_object_ids?: (string[] | null | undefined) | null; - location_ids?: (string[] | null | undefined) | null; - types?: (InventoryChangeType.Raw[] | null | undefined) | null; - states?: (InventoryState.Raw[] | null | undefined) | null; - updated_after?: (string | null | undefined) | null; - updated_before?: (string | null | undefined) | null; - cursor?: (string | null | undefined) | null; - limit?: (number | null | undefined) | null; + catalog_object_ids?: (string[] | null) | null; + location_ids?: (string[] | null) | null; + types?: (InventoryChangeType.Raw[] | null) | null; + states?: (InventoryState.Raw[] | null) | null; + updated_after?: (string | null) | null; + updated_before?: (string | null) | null; + cursor?: (string | null) | null; + limit?: (number | null) | null; } } diff --git a/src/serialization/types/BatchUpdateTeamMembersResponse.ts b/src/serialization/types/BatchUpdateTeamMembersResponse.ts index ef2ac6194..faa2d592f 100644 --- a/src/serialization/types/BatchUpdateTeamMembersResponse.ts +++ b/src/serialization/types/BatchUpdateTeamMembersResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { UpdateTeamMemberResponse } from "./UpdateTeamMemberResponse"; +import { Error_ } from "./Error_"; export const BatchUpdateTeamMembersResponse: core.serialization.ObjectSchema< serializers.BatchUpdateTeamMembersResponse.Raw, diff --git a/src/serialization/types/BatchUpdateVendorsResponse.ts b/src/serialization/types/BatchUpdateVendorsResponse.ts index 10c2f6435..88d932f61 100644 --- a/src/serialization/types/BatchUpdateVendorsResponse.ts +++ b/src/serialization/types/BatchUpdateVendorsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { UpdateVendorResponse } from "./UpdateVendorResponse"; diff --git a/src/serialization/types/BatchUpsertCatalogObjectsResponse.ts b/src/serialization/types/BatchUpsertCatalogObjectsResponse.ts index 772749985..685418862 100644 --- a/src/serialization/types/BatchUpsertCatalogObjectsResponse.ts +++ b/src/serialization/types/BatchUpsertCatalogObjectsResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; -import * as core from "../../core"; import * as serializers from "../index"; -import { CatalogIdMapping } from "./CatalogIdMapping"; +import * as Square from "../../api/index"; +import * as core from "../../core"; import { Error_ } from "./Error_"; +import { CatalogIdMapping } from "./CatalogIdMapping"; export const BatchUpsertCatalogObjectsResponse: core.serialization.ObjectSchema< serializers.BatchUpsertCatalogObjectsResponse.Raw, diff --git a/src/serialization/types/BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.ts b/src/serialization/types/BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.ts index 448f1f817..888ed197a 100644 --- a/src/serialization/types/BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.ts +++ b/src/serialization/types/BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; export const BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest: core.serialization.ObjectSchema< @@ -18,6 +20,6 @@ export declare namespace BatchUpsertCustomerCustomAttributesRequestCustomerCusto export interface Raw { customer_id: string; custom_attribute: CustomAttribute.Raw; - idempotency_key?: (string | null | undefined) | null; + idempotency_key?: (string | null) | null; } } diff --git a/src/serialization/types/BatchUpsertCustomerCustomAttributesResponse.ts b/src/serialization/types/BatchUpsertCustomerCustomAttributesResponse.ts index 54d22605e..62941923e 100644 --- a/src/serialization/types/BatchUpsertCustomerCustomAttributesResponse.ts +++ b/src/serialization/types/BatchUpsertCustomerCustomAttributesResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse } from "./BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse.ts b/src/serialization/types/BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse.ts index 4222ce056..5f3a3fb24 100644 --- a/src/serialization/types/BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse.ts +++ b/src/serialization/types/BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/Booking.ts b/src/serialization/types/Booking.ts index a4950a34a..91ef5f029 100644 --- a/src/serialization/types/Booking.ts +++ b/src/serialization/types/Booking.ts @@ -1,14 +1,16 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Address } from "./Address"; -import { AppointmentSegment } from "./AppointmentSegment"; -import { BookingBookingSource } from "./BookingBookingSource"; -import { BookingCreatorDetails } from "./BookingCreatorDetails"; import { BookingStatus } from "./BookingStatus"; +import { AppointmentSegment } from "./AppointmentSegment"; import { BusinessAppointmentSettingsBookingLocationType } from "./BusinessAppointmentSettingsBookingLocationType"; +import { BookingCreatorDetails } from "./BookingCreatorDetails"; +import { BookingBookingSource } from "./BookingBookingSource"; +import { Address } from "./Address"; export const Booking: core.serialization.ObjectSchema = core.serialization.object({ @@ -47,12 +49,12 @@ export declare namespace Booking { status?: BookingStatus.Raw | null; created_at?: string | null; updated_at?: string | null; - start_at?: (string | null | undefined) | null; - location_id?: (string | null | undefined) | null; - customer_id?: (string | null | undefined) | null; - customer_note?: (string | null | undefined) | null; - seller_note?: (string | null | undefined) | null; - appointment_segments?: (AppointmentSegment.Raw[] | null | undefined) | null; + start_at?: (string | null) | null; + location_id?: (string | null) | null; + customer_id?: (string | null) | null; + customer_note?: (string | null) | null; + seller_note?: (string | null) | null; + appointment_segments?: (AppointmentSegment.Raw[] | null) | null; transition_time_minutes?: number | null; all_day?: boolean | null; location_type?: BusinessAppointmentSettingsBookingLocationType.Raw | null; diff --git a/src/serialization/types/BookingBookingSource.ts b/src/serialization/types/BookingBookingSource.ts index f8a39552e..b056aab33 100644 --- a/src/serialization/types/BookingBookingSource.ts +++ b/src/serialization/types/BookingBookingSource.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const BookingBookingSource: core.serialization.Schema< serializers.BookingBookingSource.Raw, diff --git a/src/serialization/types/BookingCreatedEvent.ts b/src/serialization/types/BookingCreatedEvent.ts index 4a65f044c..0b4853f56 100644 --- a/src/serialization/types/BookingCreatedEvent.ts +++ b/src/serialization/types/BookingCreatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BookingCreatedEventData } from "./BookingCreatedEventData"; export const BookingCreatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const BookingCreatedEvent: core.serialization.ObjectSchema< export declare namespace BookingCreatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: BookingCreatedEventData.Raw | null; } diff --git a/src/serialization/types/BookingCreatedEventData.ts b/src/serialization/types/BookingCreatedEventData.ts index f909238f2..2634c25da 100644 --- a/src/serialization/types/BookingCreatedEventData.ts +++ b/src/serialization/types/BookingCreatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BookingCreatedEventObject } from "./BookingCreatedEventObject"; export const BookingCreatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const BookingCreatedEventData: core.serialization.ObjectSchema< export declare namespace BookingCreatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: BookingCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/BookingCreatedEventObject.ts b/src/serialization/types/BookingCreatedEventObject.ts index 8321d0b49..24f223757 100644 --- a/src/serialization/types/BookingCreatedEventObject.ts +++ b/src/serialization/types/BookingCreatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Booking } from "./Booking"; export const BookingCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BookingCreatorDetails.ts b/src/serialization/types/BookingCreatorDetails.ts index b502e58c5..cd64d6781 100644 --- a/src/serialization/types/BookingCreatorDetails.ts +++ b/src/serialization/types/BookingCreatorDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BookingCreatorDetailsCreatorType } from "./BookingCreatorDetailsCreatorType"; export const BookingCreatorDetails: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BookingCreatorDetailsCreatorType.ts b/src/serialization/types/BookingCreatorDetailsCreatorType.ts index 764071806..a7b1a513a 100644 --- a/src/serialization/types/BookingCreatorDetailsCreatorType.ts +++ b/src/serialization/types/BookingCreatorDetailsCreatorType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const BookingCreatorDetailsCreatorType: core.serialization.Schema< serializers.BookingCreatorDetailsCreatorType.Raw, diff --git a/src/serialization/types/BookingCustomAttributeDefinitionOwnedCreatedEvent.ts b/src/serialization/types/BookingCustomAttributeDefinitionOwnedCreatedEvent.ts index 12f80db93..32240578b 100644 --- a/src/serialization/types/BookingCustomAttributeDefinitionOwnedCreatedEvent.ts +++ b/src/serialization/types/BookingCustomAttributeDefinitionOwnedCreatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const BookingCustomAttributeDefinitionOwnedCreatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const BookingCustomAttributeDefinitionOwnedCreatedEvent: core.serializati export declare namespace BookingCustomAttributeDefinitionOwnedCreatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/BookingCustomAttributeDefinitionOwnedDeletedEvent.ts b/src/serialization/types/BookingCustomAttributeDefinitionOwnedDeletedEvent.ts index 2989f4c8f..33b42ada4 100644 --- a/src/serialization/types/BookingCustomAttributeDefinitionOwnedDeletedEvent.ts +++ b/src/serialization/types/BookingCustomAttributeDefinitionOwnedDeletedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const BookingCustomAttributeDefinitionOwnedDeletedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const BookingCustomAttributeDefinitionOwnedDeletedEvent: core.serializati export declare namespace BookingCustomAttributeDefinitionOwnedDeletedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/BookingCustomAttributeDefinitionOwnedUpdatedEvent.ts b/src/serialization/types/BookingCustomAttributeDefinitionOwnedUpdatedEvent.ts index a14e20cbb..42143c6fb 100644 --- a/src/serialization/types/BookingCustomAttributeDefinitionOwnedUpdatedEvent.ts +++ b/src/serialization/types/BookingCustomAttributeDefinitionOwnedUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const BookingCustomAttributeDefinitionOwnedUpdatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const BookingCustomAttributeDefinitionOwnedUpdatedEvent: core.serializati export declare namespace BookingCustomAttributeDefinitionOwnedUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/BookingCustomAttributeDefinitionVisibleCreatedEvent.ts b/src/serialization/types/BookingCustomAttributeDefinitionVisibleCreatedEvent.ts index 385d15acb..92130d330 100644 --- a/src/serialization/types/BookingCustomAttributeDefinitionVisibleCreatedEvent.ts +++ b/src/serialization/types/BookingCustomAttributeDefinitionVisibleCreatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const BookingCustomAttributeDefinitionVisibleCreatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const BookingCustomAttributeDefinitionVisibleCreatedEvent: core.serializa export declare namespace BookingCustomAttributeDefinitionVisibleCreatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/BookingCustomAttributeDefinitionVisibleDeletedEvent.ts b/src/serialization/types/BookingCustomAttributeDefinitionVisibleDeletedEvent.ts index c31b36a3c..97f7b7586 100644 --- a/src/serialization/types/BookingCustomAttributeDefinitionVisibleDeletedEvent.ts +++ b/src/serialization/types/BookingCustomAttributeDefinitionVisibleDeletedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const BookingCustomAttributeDefinitionVisibleDeletedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const BookingCustomAttributeDefinitionVisibleDeletedEvent: core.serializa export declare namespace BookingCustomAttributeDefinitionVisibleDeletedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/BookingCustomAttributeDefinitionVisibleUpdatedEvent.ts b/src/serialization/types/BookingCustomAttributeDefinitionVisibleUpdatedEvent.ts index 7b16577a5..dcdef9d35 100644 --- a/src/serialization/types/BookingCustomAttributeDefinitionVisibleUpdatedEvent.ts +++ b/src/serialization/types/BookingCustomAttributeDefinitionVisibleUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const BookingCustomAttributeDefinitionVisibleUpdatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const BookingCustomAttributeDefinitionVisibleUpdatedEvent: core.serializa export declare namespace BookingCustomAttributeDefinitionVisibleUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/BookingCustomAttributeDeleteRequest.ts b/src/serialization/types/BookingCustomAttributeDeleteRequest.ts index 2e1fbaaec..0700eb5e3 100644 --- a/src/serialization/types/BookingCustomAttributeDeleteRequest.ts +++ b/src/serialization/types/BookingCustomAttributeDeleteRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const BookingCustomAttributeDeleteRequest: core.serialization.ObjectSchema< serializers.BookingCustomAttributeDeleteRequest.Raw, diff --git a/src/serialization/types/BookingCustomAttributeDeleteResponse.ts b/src/serialization/types/BookingCustomAttributeDeleteResponse.ts index 6e5f9a309..c0703fe23 100644 --- a/src/serialization/types/BookingCustomAttributeDeleteResponse.ts +++ b/src/serialization/types/BookingCustomAttributeDeleteResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const BookingCustomAttributeDeleteResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BookingCustomAttributeOwnedDeletedEvent.ts b/src/serialization/types/BookingCustomAttributeOwnedDeletedEvent.ts index b4100fae9..c3aa6d573 100644 --- a/src/serialization/types/BookingCustomAttributeOwnedDeletedEvent.ts +++ b/src/serialization/types/BookingCustomAttributeOwnedDeletedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const BookingCustomAttributeOwnedDeletedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const BookingCustomAttributeOwnedDeletedEvent: core.serialization.ObjectS export declare namespace BookingCustomAttributeOwnedDeletedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/BookingCustomAttributeOwnedUpdatedEvent.ts b/src/serialization/types/BookingCustomAttributeOwnedUpdatedEvent.ts index 4baadde8d..4d98023a8 100644 --- a/src/serialization/types/BookingCustomAttributeOwnedUpdatedEvent.ts +++ b/src/serialization/types/BookingCustomAttributeOwnedUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const BookingCustomAttributeOwnedUpdatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const BookingCustomAttributeOwnedUpdatedEvent: core.serialization.ObjectS export declare namespace BookingCustomAttributeOwnedUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/BookingCustomAttributeUpsertRequest.ts b/src/serialization/types/BookingCustomAttributeUpsertRequest.ts index 6dfaea813..4a794c637 100644 --- a/src/serialization/types/BookingCustomAttributeUpsertRequest.ts +++ b/src/serialization/types/BookingCustomAttributeUpsertRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; export const BookingCustomAttributeUpsertRequest: core.serialization.ObjectSchema< @@ -18,6 +20,6 @@ export declare namespace BookingCustomAttributeUpsertRequest { export interface Raw { booking_id: string; custom_attribute: CustomAttribute.Raw; - idempotency_key?: (string | null | undefined) | null; + idempotency_key?: (string | null) | null; } } diff --git a/src/serialization/types/BookingCustomAttributeUpsertResponse.ts b/src/serialization/types/BookingCustomAttributeUpsertResponse.ts index 664d03fba..7d26a7ecd 100644 --- a/src/serialization/types/BookingCustomAttributeUpsertResponse.ts +++ b/src/serialization/types/BookingCustomAttributeUpsertResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BookingCustomAttributeVisibleDeletedEvent.ts b/src/serialization/types/BookingCustomAttributeVisibleDeletedEvent.ts index 1a2279a32..586fef885 100644 --- a/src/serialization/types/BookingCustomAttributeVisibleDeletedEvent.ts +++ b/src/serialization/types/BookingCustomAttributeVisibleDeletedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const BookingCustomAttributeVisibleDeletedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const BookingCustomAttributeVisibleDeletedEvent: core.serialization.Objec export declare namespace BookingCustomAttributeVisibleDeletedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/BookingCustomAttributeVisibleUpdatedEvent.ts b/src/serialization/types/BookingCustomAttributeVisibleUpdatedEvent.ts index 59d8eb420..5cd434ad0 100644 --- a/src/serialization/types/BookingCustomAttributeVisibleUpdatedEvent.ts +++ b/src/serialization/types/BookingCustomAttributeVisibleUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const BookingCustomAttributeVisibleUpdatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const BookingCustomAttributeVisibleUpdatedEvent: core.serialization.Objec export declare namespace BookingCustomAttributeVisibleUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/BookingStatus.ts b/src/serialization/types/BookingStatus.ts index e18dd03b5..23f9f5841 100644 --- a/src/serialization/types/BookingStatus.ts +++ b/src/serialization/types/BookingStatus.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const BookingStatus: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/BookingUpdatedEvent.ts b/src/serialization/types/BookingUpdatedEvent.ts index e317a7f29..5b7414856 100644 --- a/src/serialization/types/BookingUpdatedEvent.ts +++ b/src/serialization/types/BookingUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BookingUpdatedEventData } from "./BookingUpdatedEventData"; export const BookingUpdatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const BookingUpdatedEvent: core.serialization.ObjectSchema< export declare namespace BookingUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: BookingUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/BookingUpdatedEventData.ts b/src/serialization/types/BookingUpdatedEventData.ts index bf4b6ca2a..1e4adbe2e 100644 --- a/src/serialization/types/BookingUpdatedEventData.ts +++ b/src/serialization/types/BookingUpdatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BookingUpdatedEventObject } from "./BookingUpdatedEventObject"; export const BookingUpdatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const BookingUpdatedEventData: core.serialization.ObjectSchema< export declare namespace BookingUpdatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: BookingUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/BookingUpdatedEventObject.ts b/src/serialization/types/BookingUpdatedEventObject.ts index 239221c2d..5dcf7f4cc 100644 --- a/src/serialization/types/BookingUpdatedEventObject.ts +++ b/src/serialization/types/BookingUpdatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Booking } from "./Booking"; export const BookingUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/Break.ts b/src/serialization/types/Break.ts index cbf5e3bd8..3490d3e2d 100644 --- a/src/serialization/types/Break.ts +++ b/src/serialization/types/Break.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const Break: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string().optional(), @@ -18,7 +20,7 @@ export declare namespace Break { export interface Raw { id?: string | null; start_at: string; - end_at?: (string | null | undefined) | null; + end_at?: (string | null) | null; break_type_id: string; name: string; expected_duration: string; diff --git a/src/serialization/types/BreakType.ts b/src/serialization/types/BreakType.ts index 8f9e9079d..391ff6e5d 100644 --- a/src/serialization/types/BreakType.ts +++ b/src/serialization/types/BreakType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const BreakType: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/BulkCreateCustomerData.ts b/src/serialization/types/BulkCreateCustomerData.ts index a58153ff6..8cf11f262 100644 --- a/src/serialization/types/BulkCreateCustomerData.ts +++ b/src/serialization/types/BulkCreateCustomerData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Address } from "./Address"; import { CustomerTaxIds } from "./CustomerTaxIds"; @@ -25,16 +27,16 @@ export const BulkCreateCustomerData: core.serialization.ObjectSchema< export declare namespace BulkCreateCustomerData { export interface Raw { - given_name?: (string | null | undefined) | null; - family_name?: (string | null | undefined) | null; - company_name?: (string | null | undefined) | null; - nickname?: (string | null | undefined) | null; - email_address?: (string | null | undefined) | null; + given_name?: (string | null) | null; + family_name?: (string | null) | null; + company_name?: (string | null) | null; + nickname?: (string | null) | null; + email_address?: (string | null) | null; address?: Address.Raw | null; - phone_number?: (string | null | undefined) | null; - reference_id?: (string | null | undefined) | null; - note?: (string | null | undefined) | null; - birthday?: (string | null | undefined) | null; + phone_number?: (string | null) | null; + reference_id?: (string | null) | null; + note?: (string | null) | null; + birthday?: (string | null) | null; tax_ids?: CustomerTaxIds.Raw | null; } } diff --git a/src/serialization/types/BulkCreateCustomersResponse.ts b/src/serialization/types/BulkCreateCustomersResponse.ts index bd8d3f0f8..54f9631e5 100644 --- a/src/serialization/types/BulkCreateCustomersResponse.ts +++ b/src/serialization/types/BulkCreateCustomersResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CreateCustomerResponse } from "./CreateCustomerResponse"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BulkDeleteBookingCustomAttributesResponse.ts b/src/serialization/types/BulkDeleteBookingCustomAttributesResponse.ts index f121a962b..194589a54 100644 --- a/src/serialization/types/BulkDeleteBookingCustomAttributesResponse.ts +++ b/src/serialization/types/BulkDeleteBookingCustomAttributesResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BookingCustomAttributeDeleteResponse } from "./BookingCustomAttributeDeleteResponse"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BulkDeleteCustomersResponse.ts b/src/serialization/types/BulkDeleteCustomersResponse.ts index 231114ee2..a14b5cdbc 100644 --- a/src/serialization/types/BulkDeleteCustomersResponse.ts +++ b/src/serialization/types/BulkDeleteCustomersResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { DeleteCustomerResponse } from "./DeleteCustomerResponse"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.ts b/src/serialization/types/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.ts index 99ae91cf1..8ec39ae53 100644 --- a/src/serialization/types/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.ts +++ b/src/serialization/types/BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest: core.serialization.ObjectSchema< serializers.BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest.Raw, diff --git a/src/serialization/types/BulkDeleteLocationCustomAttributesResponse.ts b/src/serialization/types/BulkDeleteLocationCustomAttributesResponse.ts index 6cb5f853b..8e7a81dff 100644 --- a/src/serialization/types/BulkDeleteLocationCustomAttributesResponse.ts +++ b/src/serialization/types/BulkDeleteLocationCustomAttributesResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse } from "./BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse.ts b/src/serialization/types/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse.ts index bdb602d03..22d88c11a 100644 --- a/src/serialization/types/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse.ts +++ b/src/serialization/types/BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.ts b/src/serialization/types/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.ts index b5da98daf..2ccbd2d85 100644 --- a/src/serialization/types/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.ts +++ b/src/serialization/types/BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest: core.serialization.ObjectSchema< serializers.BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest.Raw, diff --git a/src/serialization/types/BulkDeleteMerchantCustomAttributesResponse.ts b/src/serialization/types/BulkDeleteMerchantCustomAttributesResponse.ts index 40f3f2432..c03b88e57 100644 --- a/src/serialization/types/BulkDeleteMerchantCustomAttributesResponse.ts +++ b/src/serialization/types/BulkDeleteMerchantCustomAttributesResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse } from "./BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse.ts b/src/serialization/types/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse.ts index 1916ccb5e..f6923054b 100644 --- a/src/serialization/types/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse.ts +++ b/src/serialization/types/BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.ts b/src/serialization/types/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.ts index 0525fb8f5..c7d3eea93 100644 --- a/src/serialization/types/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.ts +++ b/src/serialization/types/BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute: core.serialization.ObjectSchema< serializers.BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute.Raw, diff --git a/src/serialization/types/BulkDeleteOrderCustomAttributesResponse.ts b/src/serialization/types/BulkDeleteOrderCustomAttributesResponse.ts index 9dab74717..09cb65491 100644 --- a/src/serialization/types/BulkDeleteOrderCustomAttributesResponse.ts +++ b/src/serialization/types/BulkDeleteOrderCustomAttributesResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { DeleteOrderCustomAttributeResponse } from "./DeleteOrderCustomAttributeResponse"; import { Error_ } from "./Error_"; +import { DeleteOrderCustomAttributeResponse } from "./DeleteOrderCustomAttributeResponse"; export const BulkDeleteOrderCustomAttributesResponse: core.serialization.ObjectSchema< serializers.BulkDeleteOrderCustomAttributesResponse.Raw, diff --git a/src/serialization/types/BulkPublishScheduledShiftsData.ts b/src/serialization/types/BulkPublishScheduledShiftsData.ts index 129fe34c2..4d241bb60 100644 --- a/src/serialization/types/BulkPublishScheduledShiftsData.ts +++ b/src/serialization/types/BulkPublishScheduledShiftsData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const BulkPublishScheduledShiftsData: core.serialization.ObjectSchema< serializers.BulkPublishScheduledShiftsData.Raw, diff --git a/src/serialization/types/BulkPublishScheduledShiftsResponse.ts b/src/serialization/types/BulkPublishScheduledShiftsResponse.ts index d67494a6c..4b47bd202 100644 --- a/src/serialization/types/BulkPublishScheduledShiftsResponse.ts +++ b/src/serialization/types/BulkPublishScheduledShiftsResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { PublishScheduledShiftResponse } from "./PublishScheduledShiftResponse"; +import { Error_ } from "./Error_"; export const BulkPublishScheduledShiftsResponse: core.serialization.ObjectSchema< serializers.BulkPublishScheduledShiftsResponse.Raw, diff --git a/src/serialization/types/BulkRetrieveBookingsResponse.ts b/src/serialization/types/BulkRetrieveBookingsResponse.ts index 1f2b72f8c..002ff6a60 100644 --- a/src/serialization/types/BulkRetrieveBookingsResponse.ts +++ b/src/serialization/types/BulkRetrieveBookingsResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { GetBookingResponse } from "./GetBookingResponse"; +import { Error_ } from "./Error_"; export const BulkRetrieveBookingsResponse: core.serialization.ObjectSchema< serializers.BulkRetrieveBookingsResponse.Raw, diff --git a/src/serialization/types/BulkRetrieveChannelsRequestConstants.ts b/src/serialization/types/BulkRetrieveChannelsRequestConstants.ts deleted file mode 100644 index bfdb8150b..000000000 --- a/src/serialization/types/BulkRetrieveChannelsRequestConstants.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const BulkRetrieveChannelsRequestConstants: core.serialization.Schema< - serializers.BulkRetrieveChannelsRequestConstants.Raw, - Square.BulkRetrieveChannelsRequestConstants -> = core.serialization.stringLiteral("MAX_BATCH_SIZE"); - -export declare namespace BulkRetrieveChannelsRequestConstants { - export type Raw = "MAX_BATCH_SIZE"; -} diff --git a/src/serialization/types/BulkRetrieveChannelsResponse.ts b/src/serialization/types/BulkRetrieveChannelsResponse.ts deleted file mode 100644 index 9a075ffad..000000000 --- a/src/serialization/types/BulkRetrieveChannelsResponse.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; -import { RetrieveChannelResponse } from "./RetrieveChannelResponse"; - -export const BulkRetrieveChannelsResponse: core.serialization.ObjectSchema< - serializers.BulkRetrieveChannelsResponse.Raw, - Square.BulkRetrieveChannelsResponse -> = core.serialization.object({ - errors: core.serialization.list(Error_).optional(), - responses: core.serialization.record(core.serialization.string(), RetrieveChannelResponse).optional(), -}); - -export declare namespace BulkRetrieveChannelsResponse { - export interface Raw { - errors?: Error_.Raw[] | null; - responses?: Record | null; - } -} diff --git a/src/serialization/types/BulkRetrieveCustomersResponse.ts b/src/serialization/types/BulkRetrieveCustomersResponse.ts index 239bddb68..1a7485668 100644 --- a/src/serialization/types/BulkRetrieveCustomersResponse.ts +++ b/src/serialization/types/BulkRetrieveCustomersResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { GetCustomerResponse } from "./GetCustomerResponse"; +import { Error_ } from "./Error_"; export const BulkRetrieveCustomersResponse: core.serialization.ObjectSchema< serializers.BulkRetrieveCustomersResponse.Raw, diff --git a/src/serialization/types/BulkRetrieveTeamMemberBookingProfilesResponse.ts b/src/serialization/types/BulkRetrieveTeamMemberBookingProfilesResponse.ts index e1cd56b7b..8853ea123 100644 --- a/src/serialization/types/BulkRetrieveTeamMemberBookingProfilesResponse.ts +++ b/src/serialization/types/BulkRetrieveTeamMemberBookingProfilesResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { GetTeamMemberBookingProfileResponse } from "./GetTeamMemberBookingProfileResponse"; +import { Error_ } from "./Error_"; export const BulkRetrieveTeamMemberBookingProfilesResponse: core.serialization.ObjectSchema< serializers.BulkRetrieveTeamMemberBookingProfilesResponse.Raw, diff --git a/src/serialization/types/BulkSwapPlanResponse.ts b/src/serialization/types/BulkSwapPlanResponse.ts index 9cf98fd36..7381468f1 100644 --- a/src/serialization/types/BulkSwapPlanResponse.ts +++ b/src/serialization/types/BulkSwapPlanResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const BulkSwapPlanResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BulkUpdateCustomerData.ts b/src/serialization/types/BulkUpdateCustomerData.ts index 66d469882..d496cc57a 100644 --- a/src/serialization/types/BulkUpdateCustomerData.ts +++ b/src/serialization/types/BulkUpdateCustomerData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Address } from "./Address"; import { CustomerTaxIds } from "./CustomerTaxIds"; @@ -26,16 +28,16 @@ export const BulkUpdateCustomerData: core.serialization.ObjectSchema< export declare namespace BulkUpdateCustomerData { export interface Raw { - given_name?: (string | null | undefined) | null; - family_name?: (string | null | undefined) | null; - company_name?: (string | null | undefined) | null; - nickname?: (string | null | undefined) | null; - email_address?: (string | null | undefined) | null; + given_name?: (string | null) | null; + family_name?: (string | null) | null; + company_name?: (string | null) | null; + nickname?: (string | null) | null; + email_address?: (string | null) | null; address?: Address.Raw | null; - phone_number?: (string | null | undefined) | null; - reference_id?: (string | null | undefined) | null; - note?: (string | null | undefined) | null; - birthday?: (string | null | undefined) | null; + phone_number?: (string | null) | null; + reference_id?: (string | null) | null; + note?: (string | null) | null; + birthday?: (string | null) | null; tax_ids?: CustomerTaxIds.Raw | null; version?: (bigint | number) | null; } diff --git a/src/serialization/types/BulkUpdateCustomersResponse.ts b/src/serialization/types/BulkUpdateCustomersResponse.ts index 0b7b76652..07cb6cb3e 100644 --- a/src/serialization/types/BulkUpdateCustomersResponse.ts +++ b/src/serialization/types/BulkUpdateCustomersResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { UpdateCustomerResponse } from "./UpdateCustomerResponse"; +import { Error_ } from "./Error_"; export const BulkUpdateCustomersResponse: core.serialization.ObjectSchema< serializers.BulkUpdateCustomersResponse.Raw, diff --git a/src/serialization/types/BulkUpsertBookingCustomAttributesResponse.ts b/src/serialization/types/BulkUpsertBookingCustomAttributesResponse.ts index 1d3b33cb1..d155e7850 100644 --- a/src/serialization/types/BulkUpsertBookingCustomAttributesResponse.ts +++ b/src/serialization/types/BulkUpsertBookingCustomAttributesResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BookingCustomAttributeUpsertResponse } from "./BookingCustomAttributeUpsertResponse"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.ts b/src/serialization/types/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.ts index 149ef3ffc..b4c2f7b5c 100644 --- a/src/serialization/types/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.ts +++ b/src/serialization/types/BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; export const BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest: core.serialization.ObjectSchema< @@ -18,6 +20,6 @@ export declare namespace BulkUpsertLocationCustomAttributesRequestLocationCustom export interface Raw { location_id: string; custom_attribute: CustomAttribute.Raw; - idempotency_key?: (string | null | undefined) | null; + idempotency_key?: (string | null) | null; } } diff --git a/src/serialization/types/BulkUpsertLocationCustomAttributesResponse.ts b/src/serialization/types/BulkUpsertLocationCustomAttributesResponse.ts index 119d8b4eb..85a6fbbed 100644 --- a/src/serialization/types/BulkUpsertLocationCustomAttributesResponse.ts +++ b/src/serialization/types/BulkUpsertLocationCustomAttributesResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse } from "./BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse.ts b/src/serialization/types/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse.ts index 5ae1fe24d..2742b461c 100644 --- a/src/serialization/types/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse.ts +++ b/src/serialization/types/BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.ts b/src/serialization/types/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.ts index aadf2ec6c..1a0307bc8 100644 --- a/src/serialization/types/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.ts +++ b/src/serialization/types/BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; export const BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest: core.serialization.ObjectSchema< @@ -18,6 +20,6 @@ export declare namespace BulkUpsertMerchantCustomAttributesRequestMerchantCustom export interface Raw { merchant_id: string; custom_attribute: CustomAttribute.Raw; - idempotency_key?: (string | null | undefined) | null; + idempotency_key?: (string | null) | null; } } diff --git a/src/serialization/types/BulkUpsertMerchantCustomAttributesResponse.ts b/src/serialization/types/BulkUpsertMerchantCustomAttributesResponse.ts index a517a39d4..14fdbfe1d 100644 --- a/src/serialization/types/BulkUpsertMerchantCustomAttributesResponse.ts +++ b/src/serialization/types/BulkUpsertMerchantCustomAttributesResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse } from "./BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse.ts b/src/serialization/types/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse.ts index 19569bede..479912102 100644 --- a/src/serialization/types/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse.ts +++ b/src/serialization/types/BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.ts b/src/serialization/types/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.ts index a9d62549b..01fb99457 100644 --- a/src/serialization/types/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.ts +++ b/src/serialization/types/BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; export const BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute: core.serialization.ObjectSchema< @@ -17,7 +19,7 @@ export const BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute: core.s export declare namespace BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute { export interface Raw { custom_attribute: CustomAttribute.Raw; - idempotency_key?: (string | null | undefined) | null; + idempotency_key?: (string | null) | null; order_id: string; } } diff --git a/src/serialization/types/BulkUpsertOrderCustomAttributesResponse.ts b/src/serialization/types/BulkUpsertOrderCustomAttributesResponse.ts index 248ab907c..814fb79fa 100644 --- a/src/serialization/types/BulkUpsertOrderCustomAttributesResponse.ts +++ b/src/serialization/types/BulkUpsertOrderCustomAttributesResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { UpsertOrderCustomAttributeResponse } from "./UpsertOrderCustomAttributeResponse"; diff --git a/src/serialization/types/BusinessAppointmentSettings.ts b/src/serialization/types/BusinessAppointmentSettings.ts index ffbbf4d16..bcb5b8250 100644 --- a/src/serialization/types/BusinessAppointmentSettings.ts +++ b/src/serialization/types/BusinessAppointmentSettings.ts @@ -1,13 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { BusinessAppointmentSettingsAlignmentTime } from "./BusinessAppointmentSettingsAlignmentTime"; import { BusinessAppointmentSettingsBookingLocationType } from "./BusinessAppointmentSettingsBookingLocationType"; -import { BusinessAppointmentSettingsCancellationPolicy } from "./BusinessAppointmentSettingsCancellationPolicy"; +import { BusinessAppointmentSettingsAlignmentTime } from "./BusinessAppointmentSettingsAlignmentTime"; import { BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType } from "./BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType"; import { Money } from "./Money"; +import { BusinessAppointmentSettingsCancellationPolicy } from "./BusinessAppointmentSettingsCancellationPolicy"; export const BusinessAppointmentSettings: core.serialization.ObjectSchema< serializers.BusinessAppointmentSettings.Raw, @@ -63,18 +65,18 @@ export const BusinessAppointmentSettings: core.serialization.ObjectSchema< export declare namespace BusinessAppointmentSettings { export interface Raw { - location_types?: (BusinessAppointmentSettingsBookingLocationType.Raw[] | null | undefined) | null; + location_types?: (BusinessAppointmentSettingsBookingLocationType.Raw[] | null) | null; alignment_time?: BusinessAppointmentSettingsAlignmentTime.Raw | null; - min_booking_lead_time_seconds?: (number | null | undefined) | null; - max_booking_lead_time_seconds?: (number | null | undefined) | null; - any_team_member_booking_enabled?: (boolean | null | undefined) | null; - multiple_service_booking_enabled?: (boolean | null | undefined) | null; + min_booking_lead_time_seconds?: (number | null) | null; + max_booking_lead_time_seconds?: (number | null) | null; + any_team_member_booking_enabled?: (boolean | null) | null; + multiple_service_booking_enabled?: (boolean | null) | null; max_appointments_per_day_limit_type?: BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType.Raw | null; - max_appointments_per_day_limit?: (number | null | undefined) | null; - cancellation_window_seconds?: (number | null | undefined) | null; + max_appointments_per_day_limit?: (number | null) | null; + cancellation_window_seconds?: (number | null) | null; cancellation_fee_money?: Money.Raw | null; cancellation_policy?: BusinessAppointmentSettingsCancellationPolicy.Raw | null; - cancellation_policy_text?: (string | null | undefined) | null; - skip_booking_flow_staff_selection?: (boolean | null | undefined) | null; + cancellation_policy_text?: (string | null) | null; + skip_booking_flow_staff_selection?: (boolean | null) | null; } } diff --git a/src/serialization/types/BusinessAppointmentSettingsAlignmentTime.ts b/src/serialization/types/BusinessAppointmentSettingsAlignmentTime.ts index f0e4a2178..b0eaf681a 100644 --- a/src/serialization/types/BusinessAppointmentSettingsAlignmentTime.ts +++ b/src/serialization/types/BusinessAppointmentSettingsAlignmentTime.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const BusinessAppointmentSettingsAlignmentTime: core.serialization.Schema< serializers.BusinessAppointmentSettingsAlignmentTime.Raw, diff --git a/src/serialization/types/BusinessAppointmentSettingsBookingLocationType.ts b/src/serialization/types/BusinessAppointmentSettingsBookingLocationType.ts index 1f718339c..bcb0aa343 100644 --- a/src/serialization/types/BusinessAppointmentSettingsBookingLocationType.ts +++ b/src/serialization/types/BusinessAppointmentSettingsBookingLocationType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const BusinessAppointmentSettingsBookingLocationType: core.serialization.Schema< serializers.BusinessAppointmentSettingsBookingLocationType.Raw, diff --git a/src/serialization/types/BusinessAppointmentSettingsCancellationPolicy.ts b/src/serialization/types/BusinessAppointmentSettingsCancellationPolicy.ts index 2895aa468..018750741 100644 --- a/src/serialization/types/BusinessAppointmentSettingsCancellationPolicy.ts +++ b/src/serialization/types/BusinessAppointmentSettingsCancellationPolicy.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const BusinessAppointmentSettingsCancellationPolicy: core.serialization.Schema< serializers.BusinessAppointmentSettingsCancellationPolicy.Raw, diff --git a/src/serialization/types/BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType.ts b/src/serialization/types/BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType.ts index 33fb69833..8441815be 100644 --- a/src/serialization/types/BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType.ts +++ b/src/serialization/types/BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType: core.serialization.Schema< serializers.BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType.Raw, diff --git a/src/serialization/types/BusinessBookingProfile.ts b/src/serialization/types/BusinessBookingProfile.ts index 57f2c7d7d..4176f585b 100644 --- a/src/serialization/types/BusinessBookingProfile.ts +++ b/src/serialization/types/BusinessBookingProfile.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { BusinessAppointmentSettings } from "./BusinessAppointmentSettings"; -import { BusinessBookingProfileBookingPolicy } from "./BusinessBookingProfileBookingPolicy"; import { BusinessBookingProfileCustomerTimezoneChoice } from "./BusinessBookingProfileCustomerTimezoneChoice"; +import { BusinessBookingProfileBookingPolicy } from "./BusinessBookingProfileBookingPolicy"; +import { BusinessAppointmentSettings } from "./BusinessAppointmentSettings"; export const BusinessBookingProfile: core.serialization.ObjectSchema< serializers.BusinessBookingProfile.Raw, @@ -32,13 +34,13 @@ export const BusinessBookingProfile: core.serialization.ObjectSchema< export declare namespace BusinessBookingProfile { export interface Raw { - seller_id?: (string | null | undefined) | null; + seller_id?: (string | null) | null; created_at?: string | null; - booking_enabled?: (boolean | null | undefined) | null; + booking_enabled?: (boolean | null) | null; customer_timezone_choice?: BusinessBookingProfileCustomerTimezoneChoice.Raw | null; booking_policy?: BusinessBookingProfileBookingPolicy.Raw | null; - allow_user_cancel?: (boolean | null | undefined) | null; + allow_user_cancel?: (boolean | null) | null; business_appointment_settings?: BusinessAppointmentSettings.Raw | null; - support_seller_level_writes?: (boolean | null | undefined) | null; + support_seller_level_writes?: (boolean | null) | null; } } diff --git a/src/serialization/types/BusinessBookingProfileBookingPolicy.ts b/src/serialization/types/BusinessBookingProfileBookingPolicy.ts index 6e89df42d..26f3122b0 100644 --- a/src/serialization/types/BusinessBookingProfileBookingPolicy.ts +++ b/src/serialization/types/BusinessBookingProfileBookingPolicy.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const BusinessBookingProfileBookingPolicy: core.serialization.Schema< serializers.BusinessBookingProfileBookingPolicy.Raw, diff --git a/src/serialization/types/BusinessBookingProfileCustomerTimezoneChoice.ts b/src/serialization/types/BusinessBookingProfileCustomerTimezoneChoice.ts index 57d11c2bb..e4b5e2f3c 100644 --- a/src/serialization/types/BusinessBookingProfileCustomerTimezoneChoice.ts +++ b/src/serialization/types/BusinessBookingProfileCustomerTimezoneChoice.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const BusinessBookingProfileCustomerTimezoneChoice: core.serialization.Schema< serializers.BusinessBookingProfileCustomerTimezoneChoice.Raw, diff --git a/src/serialization/types/BusinessHours.ts b/src/serialization/types/BusinessHours.ts index 8f3cf57a6..56f2933eb 100644 --- a/src/serialization/types/BusinessHours.ts +++ b/src/serialization/types/BusinessHours.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BusinessHoursPeriod } from "./BusinessHoursPeriod"; export const BusinessHours: core.serialization.ObjectSchema = @@ -12,6 +14,6 @@ export const BusinessHours: core.serialization.ObjectSchema = core.serialization.object({ - transferOrder: core.serialization.property("transfer_order", TransferOrder.optional()), - errors: core.serialization.list(Error_).optional(), -}); - -export declare namespace CancelTransferOrderResponse { - export interface Raw { - transfer_order?: TransferOrder.Raw | null; - errors?: Error_.Raw[] | null; - } -} diff --git a/src/serialization/types/CaptureTransactionResponse.ts b/src/serialization/types/CaptureTransactionResponse.ts index 0c6b2cbc3..548384cf9 100644 --- a/src/serialization/types/CaptureTransactionResponse.ts +++ b/src/serialization/types/CaptureTransactionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const CaptureTransactionResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/Card.ts b/src/serialization/types/Card.ts index b8ebb8222..655f7e139 100644 --- a/src/serialization/types/Card.ts +++ b/src/serialization/types/Card.ts @@ -1,14 +1,16 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Address } from "./Address"; import { CardBrand } from "./CardBrand"; +import { Address } from "./Address"; +import { CardType } from "./CardType"; +import { CardPrepaidType } from "./CardPrepaidType"; import { CardCoBrand } from "./CardCoBrand"; import { CardIssuerAlert } from "./CardIssuerAlert"; -import { CardPrepaidType } from "./CardPrepaidType"; -import { CardType } from "./CardType"; export const Card: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string().optional(), @@ -38,14 +40,14 @@ export declare namespace Card { id?: string | null; card_brand?: CardBrand.Raw | null; last_4?: string | null; - exp_month?: ((bigint | number) | null | undefined) | null; - exp_year?: ((bigint | number) | null | undefined) | null; - cardholder_name?: (string | null | undefined) | null; + exp_month?: ((bigint | number) | null) | null; + exp_year?: ((bigint | number) | null) | null; + cardholder_name?: (string | null) | null; billing_address?: Address.Raw | null; fingerprint?: string | null; - customer_id?: (string | null | undefined) | null; + customer_id?: (string | null) | null; merchant_id?: string | null; - reference_id?: (string | null | undefined) | null; + reference_id?: (string | null) | null; enabled?: boolean | null; card_type?: CardType.Raw | null; prepaid_type?: CardPrepaidType.Raw | null; diff --git a/src/serialization/types/CardAutomaticallyUpdatedEvent.ts b/src/serialization/types/CardAutomaticallyUpdatedEvent.ts index f2c4231e5..c99f5340c 100644 --- a/src/serialization/types/CardAutomaticallyUpdatedEvent.ts +++ b/src/serialization/types/CardAutomaticallyUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CardAutomaticallyUpdatedEventData } from "./CardAutomaticallyUpdatedEventData"; export const CardAutomaticallyUpdatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CardAutomaticallyUpdatedEvent: core.serialization.ObjectSchema< export declare namespace CardAutomaticallyUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CardAutomaticallyUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/CardAutomaticallyUpdatedEventData.ts b/src/serialization/types/CardAutomaticallyUpdatedEventData.ts index b051eeb60..c785306c8 100644 --- a/src/serialization/types/CardAutomaticallyUpdatedEventData.ts +++ b/src/serialization/types/CardAutomaticallyUpdatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CardAutomaticallyUpdatedEventObject } from "./CardAutomaticallyUpdatedEventObject"; export const CardAutomaticallyUpdatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const CardAutomaticallyUpdatedEventData: core.serialization.ObjectSchema< export declare namespace CardAutomaticallyUpdatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: CardAutomaticallyUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/CardAutomaticallyUpdatedEventObject.ts b/src/serialization/types/CardAutomaticallyUpdatedEventObject.ts index 02000e1c8..c326dd874 100644 --- a/src/serialization/types/CardAutomaticallyUpdatedEventObject.ts +++ b/src/serialization/types/CardAutomaticallyUpdatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Card } from "./Card"; export const CardAutomaticallyUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CardBrand.ts b/src/serialization/types/CardBrand.ts index 166051ab7..c42e88c83 100644 --- a/src/serialization/types/CardBrand.ts +++ b/src/serialization/types/CardBrand.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CardBrand: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/CardCoBrand.ts b/src/serialization/types/CardCoBrand.ts index fddfd3bf9..61e447c20 100644 --- a/src/serialization/types/CardCoBrand.ts +++ b/src/serialization/types/CardCoBrand.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CardCoBrand: core.serialization.Schema = core.serialization.enum_(["UNKNOWN", "AFTERPAY", "CLEARPAY"]); diff --git a/src/serialization/types/CardCreatedEvent.ts b/src/serialization/types/CardCreatedEvent.ts index 3b9a9ee9c..b028b724b 100644 --- a/src/serialization/types/CardCreatedEvent.ts +++ b/src/serialization/types/CardCreatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CardCreatedEventData } from "./CardCreatedEventData"; export const CardCreatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CardCreatedEvent: core.serialization.ObjectSchema< export declare namespace CardCreatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CardCreatedEventData.Raw | null; } diff --git a/src/serialization/types/CardCreatedEventData.ts b/src/serialization/types/CardCreatedEventData.ts index ea99bf5bb..862a2f3be 100644 --- a/src/serialization/types/CardCreatedEventData.ts +++ b/src/serialization/types/CardCreatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CardCreatedEventObject } from "./CardCreatedEventObject"; export const CardCreatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const CardCreatedEventData: core.serialization.ObjectSchema< export declare namespace CardCreatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: CardCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/CardCreatedEventObject.ts b/src/serialization/types/CardCreatedEventObject.ts index 70e7c1468..3899a5f66 100644 --- a/src/serialization/types/CardCreatedEventObject.ts +++ b/src/serialization/types/CardCreatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Card } from "./Card"; export const CardCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CardDisabledEvent.ts b/src/serialization/types/CardDisabledEvent.ts index d4dc328b4..5db7cd7b1 100644 --- a/src/serialization/types/CardDisabledEvent.ts +++ b/src/serialization/types/CardDisabledEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CardDisabledEventData } from "./CardDisabledEventData"; export const CardDisabledEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CardDisabledEvent: core.serialization.ObjectSchema< export declare namespace CardDisabledEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CardDisabledEventData.Raw | null; } diff --git a/src/serialization/types/CardDisabledEventData.ts b/src/serialization/types/CardDisabledEventData.ts index c0d72ad4e..ef3a1e42b 100644 --- a/src/serialization/types/CardDisabledEventData.ts +++ b/src/serialization/types/CardDisabledEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CardDisabledEventObject } from "./CardDisabledEventObject"; export const CardDisabledEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const CardDisabledEventData: core.serialization.ObjectSchema< export declare namespace CardDisabledEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: CardDisabledEventObject.Raw | null; } diff --git a/src/serialization/types/CardDisabledEventObject.ts b/src/serialization/types/CardDisabledEventObject.ts index ac0d46893..9e3b79fa9 100644 --- a/src/serialization/types/CardDisabledEventObject.ts +++ b/src/serialization/types/CardDisabledEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Card } from "./Card"; export const CardDisabledEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CardForgottenEvent.ts b/src/serialization/types/CardForgottenEvent.ts index 042249a1f..f13d157f2 100644 --- a/src/serialization/types/CardForgottenEvent.ts +++ b/src/serialization/types/CardForgottenEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CardForgottenEventData } from "./CardForgottenEventData"; export const CardForgottenEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CardForgottenEvent: core.serialization.ObjectSchema< export declare namespace CardForgottenEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CardForgottenEventData.Raw | null; } diff --git a/src/serialization/types/CardForgottenEventCard.ts b/src/serialization/types/CardForgottenEventCard.ts index af873ddde..4e246906e 100644 --- a/src/serialization/types/CardForgottenEventCard.ts +++ b/src/serialization/types/CardForgottenEventCard.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CardForgottenEventCard: core.serialization.ObjectSchema< serializers.CardForgottenEventCard.Raw, @@ -19,10 +21,10 @@ export const CardForgottenEventCard: core.serialization.ObjectSchema< export declare namespace CardForgottenEventCard { export interface Raw { id?: string | null; - customer_id?: (string | null | undefined) | null; - enabled?: (boolean | null | undefined) | null; - reference_id?: (string | null | undefined) | null; + customer_id?: (string | null) | null; + enabled?: (boolean | null) | null; + reference_id?: (string | null) | null; version?: (bigint | number) | null; - merchant_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; } } diff --git a/src/serialization/types/CardForgottenEventData.ts b/src/serialization/types/CardForgottenEventData.ts index 2b3118d48..fd8adc9f8 100644 --- a/src/serialization/types/CardForgottenEventData.ts +++ b/src/serialization/types/CardForgottenEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CardForgottenEventObject } from "./CardForgottenEventObject"; export const CardForgottenEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const CardForgottenEventData: core.serialization.ObjectSchema< export declare namespace CardForgottenEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: CardForgottenEventObject.Raw | null; } diff --git a/src/serialization/types/CardForgottenEventObject.ts b/src/serialization/types/CardForgottenEventObject.ts index 9240f88df..fc22e5208 100644 --- a/src/serialization/types/CardForgottenEventObject.ts +++ b/src/serialization/types/CardForgottenEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CardForgottenEventCard } from "./CardForgottenEventCard"; export const CardForgottenEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CardIssuerAlert.ts b/src/serialization/types/CardIssuerAlert.ts index 04b6ee2fe..2eb7755cd 100644 --- a/src/serialization/types/CardIssuerAlert.ts +++ b/src/serialization/types/CardIssuerAlert.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CardIssuerAlert: core.serialization.Schema = core.serialization.stringLiteral("ISSUER_ALERT_CARD_CLOSED"); diff --git a/src/serialization/types/CardPaymentDetails.ts b/src/serialization/types/CardPaymentDetails.ts index 9187abe1a..a7be16b2c 100644 --- a/src/serialization/types/CardPaymentDetails.ts +++ b/src/serialization/types/CardPaymentDetails.ts @@ -1,61 +1,72 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Card } from "./Card"; -import { CardPaymentTimeline } from "./CardPaymentTimeline"; import { DeviceDetails } from "./DeviceDetails"; +import { CardPaymentTimeline } from "./CardPaymentTimeline"; import { Error_ } from "./Error_"; export const CardPaymentDetails: core.serialization.ObjectSchema< serializers.CardPaymentDetails.Raw, Square.CardPaymentDetails > = core.serialization.object({ - status: core.serialization.string().optional(), + status: core.serialization.string().optionalNullable(), card: Card.optional(), - entryMethod: core.serialization.property("entry_method", core.serialization.string().optional()), - cvvStatus: core.serialization.property("cvv_status", core.serialization.string().optional()), - avsStatus: core.serialization.property("avs_status", core.serialization.string().optional()), - authResultCode: core.serialization.property("auth_result_code", core.serialization.string().optional()), + entryMethod: core.serialization.property("entry_method", core.serialization.string().optionalNullable()), + cvvStatus: core.serialization.property("cvv_status", core.serialization.string().optionalNullable()), + avsStatus: core.serialization.property("avs_status", core.serialization.string().optionalNullable()), + authResultCode: core.serialization.property("auth_result_code", core.serialization.string().optionalNullable()), applicationIdentifier: core.serialization.property( "application_identifier", - core.serialization.string().optional(), + core.serialization.string().optionalNullable(), ), - applicationName: core.serialization.property("application_name", core.serialization.string().optional()), + applicationName: core.serialization.property("application_name", core.serialization.string().optionalNullable()), applicationCryptogram: core.serialization.property( "application_cryptogram", - core.serialization.string().optional(), + core.serialization.string().optionalNullable(), + ), + verificationMethod: core.serialization.property( + "verification_method", + core.serialization.string().optionalNullable(), + ), + verificationResults: core.serialization.property( + "verification_results", + core.serialization.string().optionalNullable(), + ), + statementDescription: core.serialization.property( + "statement_description", + core.serialization.string().optionalNullable(), ), - verificationMethod: core.serialization.property("verification_method", core.serialization.string().optional()), - verificationResults: core.serialization.property("verification_results", core.serialization.string().optional()), - statementDescription: core.serialization.property("statement_description", core.serialization.string().optional()), deviceDetails: core.serialization.property("device_details", DeviceDetails.optional()), cardPaymentTimeline: core.serialization.property("card_payment_timeline", CardPaymentTimeline.optional()), refundRequiresCardPresence: core.serialization.property( "refund_requires_card_presence", - core.serialization.boolean().optional(), + core.serialization.boolean().optionalNullable(), ), - errors: core.serialization.list(Error_).optional(), + errors: core.serialization.list(Error_).optionalNullable(), }); export declare namespace CardPaymentDetails { export interface Raw { - status?: string | null; + status?: (string | null) | null; card?: Card.Raw | null; - entry_method?: string | null; - cvv_status?: string | null; - avs_status?: string | null; - auth_result_code?: string | null; - application_identifier?: string | null; - application_name?: string | null; - application_cryptogram?: string | null; - verification_method?: string | null; - verification_results?: string | null; - statement_description?: string | null; + entry_method?: (string | null) | null; + cvv_status?: (string | null) | null; + avs_status?: (string | null) | null; + auth_result_code?: (string | null) | null; + application_identifier?: (string | null) | null; + application_name?: (string | null) | null; + application_cryptogram?: (string | null) | null; + verification_method?: (string | null) | null; + verification_results?: (string | null) | null; + statement_description?: (string | null) | null; device_details?: DeviceDetails.Raw | null; card_payment_timeline?: CardPaymentTimeline.Raw | null; - refund_requires_card_presence?: boolean | null; - errors?: Error_.Raw[] | null; + refund_requires_card_presence?: (boolean | null) | null; + errors?: (Error_.Raw[] | null) | null; } } diff --git a/src/serialization/types/CardPaymentTimeline.ts b/src/serialization/types/CardPaymentTimeline.ts index 7e5f1a67e..8c3915d0c 100644 --- a/src/serialization/types/CardPaymentTimeline.ts +++ b/src/serialization/types/CardPaymentTimeline.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CardPaymentTimeline: core.serialization.ObjectSchema< serializers.CardPaymentTimeline.Raw, @@ -15,8 +17,8 @@ export const CardPaymentTimeline: core.serialization.ObjectSchema< export declare namespace CardPaymentTimeline { export interface Raw { - authorized_at?: (string | null | undefined) | null; - captured_at?: (string | null | undefined) | null; - voided_at?: (string | null | undefined) | null; + authorized_at?: (string | null) | null; + captured_at?: (string | null) | null; + voided_at?: (string | null) | null; } } diff --git a/src/serialization/types/CardPrepaidType.ts b/src/serialization/types/CardPrepaidType.ts index eebdb0bac..5a5e94558 100644 --- a/src/serialization/types/CardPrepaidType.ts +++ b/src/serialization/types/CardPrepaidType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CardPrepaidType: core.serialization.Schema = core.serialization.enum_(["UNKNOWN_PREPAID_TYPE", "NOT_PREPAID", "PREPAID"]); diff --git a/src/serialization/types/CardType.ts b/src/serialization/types/CardType.ts index ef4eca226..c3f72ee5a 100644 --- a/src/serialization/types/CardType.ts +++ b/src/serialization/types/CardType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CardType: core.serialization.Schema = core.serialization.enum_([ "UNKNOWN_CARD_TYPE", diff --git a/src/serialization/types/CardUpdatedEvent.ts b/src/serialization/types/CardUpdatedEvent.ts index 5167aae33..e5cd408bf 100644 --- a/src/serialization/types/CardUpdatedEvent.ts +++ b/src/serialization/types/CardUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CardUpdatedEventData } from "./CardUpdatedEventData"; export const CardUpdatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CardUpdatedEvent: core.serialization.ObjectSchema< export declare namespace CardUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CardUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/CardUpdatedEventData.ts b/src/serialization/types/CardUpdatedEventData.ts index b48693c00..3cd16e1cb 100644 --- a/src/serialization/types/CardUpdatedEventData.ts +++ b/src/serialization/types/CardUpdatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CardUpdatedEventObject } from "./CardUpdatedEventObject"; export const CardUpdatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const CardUpdatedEventData: core.serialization.ObjectSchema< export declare namespace CardUpdatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: CardUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/CardUpdatedEventObject.ts b/src/serialization/types/CardUpdatedEventObject.ts index 30e2d5b3c..4609f9e56 100644 --- a/src/serialization/types/CardUpdatedEventObject.ts +++ b/src/serialization/types/CardUpdatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Card } from "./Card"; export const CardUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CashAppDetails.ts b/src/serialization/types/CashAppDetails.ts index 9c7b37738..0697dd1c6 100644 --- a/src/serialization/types/CashAppDetails.ts +++ b/src/serialization/types/CashAppDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CashAppDetails: core.serialization.ObjectSchema = core.serialization.object({ @@ -16,8 +18,8 @@ export const CashAppDetails: core.serialization.ObjectSchema = core.serialization.object({ @@ -48,10 +50,10 @@ export declare namespace CashDrawerShift { export interface Raw { id?: string | null; state?: CashDrawerShiftState.Raw | null; - opened_at?: (string | null | undefined) | null; - ended_at?: (string | null | undefined) | null; - closed_at?: (string | null | undefined) | null; - description?: (string | null | undefined) | null; + opened_at?: (string | null) | null; + ended_at?: (string | null) | null; + closed_at?: (string | null) | null; + description?: (string | null) | null; opened_cash_money?: Money.Raw | null; cash_payment_money?: Money.Raw | null; cash_refunds_money?: Money.Raw | null; diff --git a/src/serialization/types/CashDrawerShiftEvent.ts b/src/serialization/types/CashDrawerShiftEvent.ts index 7bcaad054..985d7ba91 100644 --- a/src/serialization/types/CashDrawerShiftEvent.ts +++ b/src/serialization/types/CashDrawerShiftEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CashDrawerEventType } from "./CashDrawerEventType"; import { Money } from "./Money"; @@ -24,7 +26,7 @@ export declare namespace CashDrawerShiftEvent { event_type?: CashDrawerEventType.Raw | null; event_money?: Money.Raw | null; created_at?: string | null; - description?: (string | null | undefined) | null; + description?: (string | null) | null; team_member_id?: string | null; } } diff --git a/src/serialization/types/CashDrawerShiftState.ts b/src/serialization/types/CashDrawerShiftState.ts index 46c7e776d..b12dcc804 100644 --- a/src/serialization/types/CashDrawerShiftState.ts +++ b/src/serialization/types/CashDrawerShiftState.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CashDrawerShiftState: core.serialization.Schema< serializers.CashDrawerShiftState.Raw, diff --git a/src/serialization/types/CashDrawerShiftSummary.ts b/src/serialization/types/CashDrawerShiftSummary.ts index 0415c2b65..e9d476cac 100644 --- a/src/serialization/types/CashDrawerShiftSummary.ts +++ b/src/serialization/types/CashDrawerShiftSummary.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CashDrawerShiftState } from "./CashDrawerShiftState"; import { Money } from "./Money"; @@ -28,10 +30,10 @@ export declare namespace CashDrawerShiftSummary { export interface Raw { id?: string | null; state?: CashDrawerShiftState.Raw | null; - opened_at?: (string | null | undefined) | null; - ended_at?: (string | null | undefined) | null; - closed_at?: (string | null | undefined) | null; - description?: (string | null | undefined) | null; + opened_at?: (string | null) | null; + ended_at?: (string | null) | null; + closed_at?: (string | null) | null; + description?: (string | null) | null; opened_cash_money?: Money.Raw | null; expected_cash_money?: Money.Raw | null; closed_cash_money?: Money.Raw | null; diff --git a/src/serialization/types/CashPaymentDetails.ts b/src/serialization/types/CashPaymentDetails.ts index 0a1e4bc3b..022fc849c 100644 --- a/src/serialization/types/CashPaymentDetails.ts +++ b/src/serialization/types/CashPaymentDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const CashPaymentDetails: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CatalogAvailabilityPeriod.ts b/src/serialization/types/CatalogAvailabilityPeriod.ts index 5ca70bb86..c775afe16 100644 --- a/src/serialization/types/CatalogAvailabilityPeriod.ts +++ b/src/serialization/types/CatalogAvailabilityPeriod.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { DayOfWeek } from "./DayOfWeek"; export const CatalogAvailabilityPeriod: core.serialization.ObjectSchema< @@ -16,8 +18,8 @@ export const CatalogAvailabilityPeriod: core.serialization.ObjectSchema< export declare namespace CatalogAvailabilityPeriod { export interface Raw { - start_local_time?: (string | null | undefined) | null; - end_local_time?: (string | null | undefined) | null; + start_local_time?: (string | null) | null; + end_local_time?: (string | null) | null; day_of_week?: DayOfWeek.Raw | null; } } diff --git a/src/serialization/types/CatalogCategory.ts b/src/serialization/types/CatalogCategory.ts index e1306d82a..98df942d4 100644 --- a/src/serialization/types/CatalogCategory.ts +++ b/src/serialization/types/CatalogCategory.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; -import * as core from "../../core"; import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; import { CatalogCategoryType } from "./CatalogCategoryType"; import { CatalogEcomSeoData } from "./CatalogEcomSeoData"; import { CategoryPathToRootNode } from "./CategoryPathToRootNode"; @@ -39,16 +41,16 @@ export const CatalogCategory: core.serialization.ObjectSchema = core.serialization.object({ @@ -21,12 +23,12 @@ export const CatalogDiscount: core.serialization.ObjectSchema = core.serialization.object({ @@ -17,9 +19,9 @@ export const CatalogImage: core.serialization.ObjectSchema = core.serialization.object({ @@ -74,30 +76,30 @@ export const CatalogItem: core.serialization.ObjectSchema = core.serialization.object({ @@ -23,13 +25,13 @@ export const CatalogModifier: core.serialization.ObjectSchema = core.serialization diff --git a/src/serialization/types/CatalogObjectAvailabilityPeriod.ts b/src/serialization/types/CatalogObjectAvailabilityPeriod.ts index a271c8108..cd9824124 100644 --- a/src/serialization/types/CatalogObjectAvailabilityPeriod.ts +++ b/src/serialization/types/CatalogObjectAvailabilityPeriod.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CatalogAvailabilityPeriod } from "./CatalogAvailabilityPeriod"; import { CatalogObjectBase } from "./CatalogObjectBase"; diff --git a/src/serialization/types/CatalogObjectBase.ts b/src/serialization/types/CatalogObjectBase.ts index 853250d76..05fba814b 100644 --- a/src/serialization/types/CatalogObjectBase.ts +++ b/src/serialization/types/CatalogObjectBase.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CatalogCustomAttributeValue } from "./CatalogCustomAttributeValue"; import { CatalogV1Id } from "./CatalogV1Id"; diff --git a/src/serialization/types/CatalogObjectBatch.ts b/src/serialization/types/CatalogObjectBatch.ts index 269ae77d2..74f6e1640 100644 --- a/src/serialization/types/CatalogObjectBatch.ts +++ b/src/serialization/types/CatalogObjectBatch.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; -import * as core from "../../core"; import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; export const CatalogObjectBatch: core.serialization.ObjectSchema< serializers.CatalogObjectBatch.Raw, diff --git a/src/serialization/types/CatalogObjectCategory.ts b/src/serialization/types/CatalogObjectCategory.ts index 15687d513..ff3966146 100644 --- a/src/serialization/types/CatalogObjectCategory.ts +++ b/src/serialization/types/CatalogObjectCategory.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; -import * as core from "../../core"; import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; import { CatalogCustomAttributeValue } from "./CatalogCustomAttributeValue"; import { CatalogV1Id } from "./CatalogV1Id"; @@ -43,7 +45,7 @@ export const CatalogObjectCategory: core.serialization.ObjectSchema< export declare namespace CatalogObjectCategory { export interface Raw { id?: string | null; - ordinal?: ((bigint | number) | null | undefined) | null; + ordinal?: ((bigint | number) | null) | null; type?: "CATEGORY" | null; category_data?: serializers.CatalogCategory.Raw | null; updated_at?: string | null; diff --git a/src/serialization/types/CatalogObjectCustomAttributeDefinition.ts b/src/serialization/types/CatalogObjectCustomAttributeDefinition.ts index cf4abb9e6..d2857d7e0 100644 --- a/src/serialization/types/CatalogObjectCustomAttributeDefinition.ts +++ b/src/serialization/types/CatalogObjectCustomAttributeDefinition.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CatalogCustomAttributeDefinition } from "./CatalogCustomAttributeDefinition"; import { CatalogObjectBase } from "./CatalogObjectBase"; diff --git a/src/serialization/types/CatalogObjectDiscount.ts b/src/serialization/types/CatalogObjectDiscount.ts index a2832788c..8fa372b7f 100644 --- a/src/serialization/types/CatalogObjectDiscount.ts +++ b/src/serialization/types/CatalogObjectDiscount.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CatalogDiscount } from "./CatalogDiscount"; import { CatalogObjectBase } from "./CatalogObjectBase"; diff --git a/src/serialization/types/CatalogObjectImage.ts b/src/serialization/types/CatalogObjectImage.ts index 7a5773046..8fed46189 100644 --- a/src/serialization/types/CatalogObjectImage.ts +++ b/src/serialization/types/CatalogObjectImage.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CatalogImage } from "./CatalogImage"; import { CatalogObjectBase } from "./CatalogObjectBase"; diff --git a/src/serialization/types/CatalogObjectItem.ts b/src/serialization/types/CatalogObjectItem.ts index 832623eb1..b7b91e20f 100644 --- a/src/serialization/types/CatalogObjectItem.ts +++ b/src/serialization/types/CatalogObjectItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; -import * as core from "../../core"; import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; import { CatalogObjectBase } from "./CatalogObjectBase"; export const CatalogObjectItem: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CatalogObjectItemOption.ts b/src/serialization/types/CatalogObjectItemOption.ts index f851abcf8..fa36313a8 100644 --- a/src/serialization/types/CatalogObjectItemOption.ts +++ b/src/serialization/types/CatalogObjectItemOption.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; -import * as core from "../../core"; import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; import { CatalogObjectBase } from "./CatalogObjectBase"; export const CatalogObjectItemOption: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CatalogObjectItemOptionValue.ts b/src/serialization/types/CatalogObjectItemOptionValue.ts index 8125c0cc4..7326bfd59 100644 --- a/src/serialization/types/CatalogObjectItemOptionValue.ts +++ b/src/serialization/types/CatalogObjectItemOptionValue.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CatalogItemOptionValue } from "./CatalogItemOptionValue"; import { CatalogObjectBase } from "./CatalogObjectBase"; diff --git a/src/serialization/types/CatalogObjectItemVariation.ts b/src/serialization/types/CatalogObjectItemVariation.ts index 1cb98082b..88d8f4c80 100644 --- a/src/serialization/types/CatalogObjectItemVariation.ts +++ b/src/serialization/types/CatalogObjectItemVariation.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CatalogItemVariation } from "./CatalogItemVariation"; import { CatalogObjectBase } from "./CatalogObjectBase"; diff --git a/src/serialization/types/CatalogObjectMeasurementUnit.ts b/src/serialization/types/CatalogObjectMeasurementUnit.ts index 4df149203..753f727e8 100644 --- a/src/serialization/types/CatalogObjectMeasurementUnit.ts +++ b/src/serialization/types/CatalogObjectMeasurementUnit.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CatalogMeasurementUnit } from "./CatalogMeasurementUnit"; import { CatalogObjectBase } from "./CatalogObjectBase"; diff --git a/src/serialization/types/CatalogObjectModifier.ts b/src/serialization/types/CatalogObjectModifier.ts index 50f92cc54..c2e146e43 100644 --- a/src/serialization/types/CatalogObjectModifier.ts +++ b/src/serialization/types/CatalogObjectModifier.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CatalogModifier } from "./CatalogModifier"; import { CatalogObjectBase } from "./CatalogObjectBase"; diff --git a/src/serialization/types/CatalogObjectModifierList.ts b/src/serialization/types/CatalogObjectModifierList.ts index eecb3708e..0e98634e9 100644 --- a/src/serialization/types/CatalogObjectModifierList.ts +++ b/src/serialization/types/CatalogObjectModifierList.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; -import * as core from "../../core"; import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; import { CatalogObjectBase } from "./CatalogObjectBase"; export const CatalogObjectModifierList: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CatalogObjectPricingRule.ts b/src/serialization/types/CatalogObjectPricingRule.ts index 27a2bf498..442c3483c 100644 --- a/src/serialization/types/CatalogObjectPricingRule.ts +++ b/src/serialization/types/CatalogObjectPricingRule.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { CatalogObjectBase } from "./CatalogObjectBase"; import { CatalogPricingRule } from "./CatalogPricingRule"; +import { CatalogObjectBase } from "./CatalogObjectBase"; export const CatalogObjectPricingRule: core.serialization.ObjectSchema< serializers.CatalogObjectPricingRule.Raw, diff --git a/src/serialization/types/CatalogObjectProductSet.ts b/src/serialization/types/CatalogObjectProductSet.ts index fb98de849..862eda0e1 100644 --- a/src/serialization/types/CatalogObjectProductSet.ts +++ b/src/serialization/types/CatalogObjectProductSet.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { CatalogObjectBase } from "./CatalogObjectBase"; import { CatalogProductSet } from "./CatalogProductSet"; +import { CatalogObjectBase } from "./CatalogObjectBase"; export const CatalogObjectProductSet: core.serialization.ObjectSchema< serializers.CatalogObjectProductSet.Raw, diff --git a/src/serialization/types/CatalogObjectQuickAmountsSettings.ts b/src/serialization/types/CatalogObjectQuickAmountsSettings.ts index daba9dbf4..34ca8497d 100644 --- a/src/serialization/types/CatalogObjectQuickAmountsSettings.ts +++ b/src/serialization/types/CatalogObjectQuickAmountsSettings.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { CatalogObjectBase } from "./CatalogObjectBase"; import { CatalogQuickAmountsSettings } from "./CatalogQuickAmountsSettings"; +import { CatalogObjectBase } from "./CatalogObjectBase"; export const CatalogObjectQuickAmountsSettings: core.serialization.ObjectSchema< serializers.CatalogObjectQuickAmountsSettings.Raw, diff --git a/src/serialization/types/CatalogObjectReference.ts b/src/serialization/types/CatalogObjectReference.ts index 1f7af7511..c7e20761c 100644 --- a/src/serialization/types/CatalogObjectReference.ts +++ b/src/serialization/types/CatalogObjectReference.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CatalogObjectReference: core.serialization.ObjectSchema< serializers.CatalogObjectReference.Raw, @@ -14,7 +16,7 @@ export const CatalogObjectReference: core.serialization.ObjectSchema< export declare namespace CatalogObjectReference { export interface Raw { - object_id?: (string | null | undefined) | null; - catalog_version?: ((bigint | number) | null | undefined) | null; + object_id?: (string | null) | null; + catalog_version?: ((bigint | number) | null) | null; } } diff --git a/src/serialization/types/CatalogObjectSubscriptionPlan.ts b/src/serialization/types/CatalogObjectSubscriptionPlan.ts index 4003b3bb0..ac4fffc44 100644 --- a/src/serialization/types/CatalogObjectSubscriptionPlan.ts +++ b/src/serialization/types/CatalogObjectSubscriptionPlan.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; -import * as core from "../../core"; import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; import { CatalogObjectBase } from "./CatalogObjectBase"; export const CatalogObjectSubscriptionPlan: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CatalogObjectSubscriptionPlanVariation.ts b/src/serialization/types/CatalogObjectSubscriptionPlanVariation.ts index db285970f..e21dca783 100644 --- a/src/serialization/types/CatalogObjectSubscriptionPlanVariation.ts +++ b/src/serialization/types/CatalogObjectSubscriptionPlanVariation.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { CatalogObjectBase } from "./CatalogObjectBase"; import { CatalogSubscriptionPlanVariation } from "./CatalogSubscriptionPlanVariation"; +import { CatalogObjectBase } from "./CatalogObjectBase"; export const CatalogObjectSubscriptionPlanVariation: core.serialization.ObjectSchema< serializers.CatalogObjectSubscriptionPlanVariation.Raw, diff --git a/src/serialization/types/CatalogObjectTax.ts b/src/serialization/types/CatalogObjectTax.ts index 9ab57722b..890d0cb15 100644 --- a/src/serialization/types/CatalogObjectTax.ts +++ b/src/serialization/types/CatalogObjectTax.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { CatalogObjectBase } from "./CatalogObjectBase"; import { CatalogTax } from "./CatalogTax"; +import { CatalogObjectBase } from "./CatalogObjectBase"; export const CatalogObjectTax: core.serialization.ObjectSchema< serializers.CatalogObjectTax.Raw, diff --git a/src/serialization/types/CatalogObjectTimePeriod.ts b/src/serialization/types/CatalogObjectTimePeriod.ts index 426ab397c..b199b9374 100644 --- a/src/serialization/types/CatalogObjectTimePeriod.ts +++ b/src/serialization/types/CatalogObjectTimePeriod.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { CatalogObjectBase } from "./CatalogObjectBase"; import { CatalogTimePeriod } from "./CatalogTimePeriod"; +import { CatalogObjectBase } from "./CatalogObjectBase"; export const CatalogObjectTimePeriod: core.serialization.ObjectSchema< serializers.CatalogObjectTimePeriod.Raw, diff --git a/src/serialization/types/CatalogObjectType.ts b/src/serialization/types/CatalogObjectType.ts index 44c6592f8..178202e9d 100644 --- a/src/serialization/types/CatalogObjectType.ts +++ b/src/serialization/types/CatalogObjectType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CatalogObjectType: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/CatalogPricingRule.ts b/src/serialization/types/CatalogPricingRule.ts index cf835669c..083f32b61 100644 --- a/src/serialization/types/CatalogPricingRule.ts +++ b/src/serialization/types/CatalogPricingRule.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { ExcludeStrategy } from "./ExcludeStrategy"; import { Money } from "./Money"; @@ -42,18 +44,18 @@ export const CatalogPricingRule: core.serialization.ObjectSchema< export declare namespace CatalogPricingRule { export interface Raw { - name?: (string | null | undefined) | null; - time_period_ids?: (string[] | null | undefined) | null; - discount_id?: (string | null | undefined) | null; - match_products_id?: (string | null | undefined) | null; - apply_products_id?: (string | null | undefined) | null; - exclude_products_id?: (string | null | undefined) | null; - valid_from_date?: (string | null | undefined) | null; - valid_from_local_time?: (string | null | undefined) | null; - valid_until_date?: (string | null | undefined) | null; - valid_until_local_time?: (string | null | undefined) | null; + name?: (string | null) | null; + time_period_ids?: (string[] | null) | null; + discount_id?: (string | null) | null; + match_products_id?: (string | null) | null; + apply_products_id?: (string | null) | null; + exclude_products_id?: (string | null) | null; + valid_from_date?: (string | null) | null; + valid_from_local_time?: (string | null) | null; + valid_until_date?: (string | null) | null; + valid_until_local_time?: (string | null) | null; exclude_strategy?: ExcludeStrategy.Raw | null; minimum_order_subtotal_money?: Money.Raw | null; - customer_group_ids_any?: (string[] | null | undefined) | null; + customer_group_ids_any?: (string[] | null) | null; } } diff --git a/src/serialization/types/CatalogPricingType.ts b/src/serialization/types/CatalogPricingType.ts index aece42bd0..3a4a30619 100644 --- a/src/serialization/types/CatalogPricingType.ts +++ b/src/serialization/types/CatalogPricingType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CatalogPricingType: core.serialization.Schema< serializers.CatalogPricingType.Raw, diff --git a/src/serialization/types/CatalogProductSet.ts b/src/serialization/types/CatalogProductSet.ts index 24c0cfc15..f8c98f1db 100644 --- a/src/serialization/types/CatalogProductSet.ts +++ b/src/serialization/types/CatalogProductSet.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CatalogProductSet: core.serialization.ObjectSchema< serializers.CatalogProductSet.Raw, @@ -25,12 +27,12 @@ export const CatalogProductSet: core.serialization.ObjectSchema< export declare namespace CatalogProductSet { export interface Raw { - name?: (string | null | undefined) | null; - product_ids_any?: (string[] | null | undefined) | null; - product_ids_all?: (string[] | null | undefined) | null; - quantity_exact?: ((bigint | number) | null | undefined) | null; - quantity_min?: ((bigint | number) | null | undefined) | null; - quantity_max?: ((bigint | number) | null | undefined) | null; - all_products?: (boolean | null | undefined) | null; + name?: (string | null) | null; + product_ids_any?: (string[] | null) | null; + product_ids_all?: (string[] | null) | null; + quantity_exact?: ((bigint | number) | null) | null; + quantity_min?: ((bigint | number) | null) | null; + quantity_max?: ((bigint | number) | null) | null; + all_products?: (boolean | null) | null; } } diff --git a/src/serialization/types/CatalogQuery.ts b/src/serialization/types/CatalogQuery.ts index 1680f801a..120ca5426 100644 --- a/src/serialization/types/CatalogQuery.ts +++ b/src/serialization/types/CatalogQuery.ts @@ -1,18 +1,20 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; +import { CatalogQuerySortedAttribute } from "./CatalogQuerySortedAttribute"; import { CatalogQueryExact } from "./CatalogQueryExact"; -import { CatalogQueryItemsForItemOptions } from "./CatalogQueryItemsForItemOptions"; -import { CatalogQueryItemsForModifierList } from "./CatalogQueryItemsForModifierList"; -import { CatalogQueryItemsForTax } from "./CatalogQueryItemsForTax"; -import { CatalogQueryItemVariationsForItemOptionValues } from "./CatalogQueryItemVariationsForItemOptionValues"; +import { CatalogQuerySet } from "./CatalogQuerySet"; import { CatalogQueryPrefix } from "./CatalogQueryPrefix"; import { CatalogQueryRange } from "./CatalogQueryRange"; -import { CatalogQuerySet } from "./CatalogQuerySet"; -import { CatalogQuerySortedAttribute } from "./CatalogQuerySortedAttribute"; import { CatalogQueryText } from "./CatalogQueryText"; +import { CatalogQueryItemsForTax } from "./CatalogQueryItemsForTax"; +import { CatalogQueryItemsForModifierList } from "./CatalogQueryItemsForModifierList"; +import { CatalogQueryItemsForItemOptions } from "./CatalogQueryItemsForItemOptions"; +import { CatalogQueryItemVariationsForItemOptionValues } from "./CatalogQueryItemVariationsForItemOptionValues"; export const CatalogQuery: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/CatalogQueryExact.ts b/src/serialization/types/CatalogQueryExact.ts index febdb6f60..6e990610c 100644 --- a/src/serialization/types/CatalogQueryExact.ts +++ b/src/serialization/types/CatalogQueryExact.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CatalogQueryExact: core.serialization.ObjectSchema< serializers.CatalogQueryExact.Raw, diff --git a/src/serialization/types/CatalogQueryItemVariationsForItemOptionValues.ts b/src/serialization/types/CatalogQueryItemVariationsForItemOptionValues.ts index b73f1a714..9c2698c6d 100644 --- a/src/serialization/types/CatalogQueryItemVariationsForItemOptionValues.ts +++ b/src/serialization/types/CatalogQueryItemVariationsForItemOptionValues.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CatalogQueryItemVariationsForItemOptionValues: core.serialization.ObjectSchema< serializers.CatalogQueryItemVariationsForItemOptionValues.Raw, @@ -16,6 +18,6 @@ export const CatalogQueryItemVariationsForItemOptionValues: core.serialization.O export declare namespace CatalogQueryItemVariationsForItemOptionValues { export interface Raw { - item_option_value_ids?: (string[] | null | undefined) | null; + item_option_value_ids?: (string[] | null) | null; } } diff --git a/src/serialization/types/CatalogQueryItemsForItemOptions.ts b/src/serialization/types/CatalogQueryItemsForItemOptions.ts index b3339029a..820bc6bcd 100644 --- a/src/serialization/types/CatalogQueryItemsForItemOptions.ts +++ b/src/serialization/types/CatalogQueryItemsForItemOptions.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CatalogQueryItemsForItemOptions: core.serialization.ObjectSchema< serializers.CatalogQueryItemsForItemOptions.Raw, @@ -16,6 +18,6 @@ export const CatalogQueryItemsForItemOptions: core.serialization.ObjectSchema< export declare namespace CatalogQueryItemsForItemOptions { export interface Raw { - item_option_ids?: (string[] | null | undefined) | null; + item_option_ids?: (string[] | null) | null; } } diff --git a/src/serialization/types/CatalogQueryItemsForModifierList.ts b/src/serialization/types/CatalogQueryItemsForModifierList.ts index a9521751d..bdf2752f9 100644 --- a/src/serialization/types/CatalogQueryItemsForModifierList.ts +++ b/src/serialization/types/CatalogQueryItemsForModifierList.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CatalogQueryItemsForModifierList: core.serialization.ObjectSchema< serializers.CatalogQueryItemsForModifierList.Raw, diff --git a/src/serialization/types/CatalogQueryItemsForTax.ts b/src/serialization/types/CatalogQueryItemsForTax.ts index d73362f4d..de63f3cd6 100644 --- a/src/serialization/types/CatalogQueryItemsForTax.ts +++ b/src/serialization/types/CatalogQueryItemsForTax.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CatalogQueryItemsForTax: core.serialization.ObjectSchema< serializers.CatalogQueryItemsForTax.Raw, diff --git a/src/serialization/types/CatalogQueryPrefix.ts b/src/serialization/types/CatalogQueryPrefix.ts index 58691b750..d3bb0198f 100644 --- a/src/serialization/types/CatalogQueryPrefix.ts +++ b/src/serialization/types/CatalogQueryPrefix.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CatalogQueryPrefix: core.serialization.ObjectSchema< serializers.CatalogQueryPrefix.Raw, diff --git a/src/serialization/types/CatalogQueryRange.ts b/src/serialization/types/CatalogQueryRange.ts index 94555a389..0a62d5286 100644 --- a/src/serialization/types/CatalogQueryRange.ts +++ b/src/serialization/types/CatalogQueryRange.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CatalogQueryRange: core.serialization.ObjectSchema< serializers.CatalogQueryRange.Raw, @@ -22,7 +24,7 @@ export const CatalogQueryRange: core.serialization.ObjectSchema< export declare namespace CatalogQueryRange { export interface Raw { attribute_name: string; - attribute_min_value?: ((bigint | number) | null | undefined) | null; - attribute_max_value?: ((bigint | number) | null | undefined) | null; + attribute_min_value?: ((bigint | number) | null) | null; + attribute_max_value?: ((bigint | number) | null) | null; } } diff --git a/src/serialization/types/CatalogQuerySet.ts b/src/serialization/types/CatalogQuerySet.ts index 7e204e97e..0c42e01f7 100644 --- a/src/serialization/types/CatalogQuerySet.ts +++ b/src/serialization/types/CatalogQuerySet.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CatalogQuerySet: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/CatalogQuerySortedAttribute.ts b/src/serialization/types/CatalogQuerySortedAttribute.ts index fa27821f6..5ff24ef07 100644 --- a/src/serialization/types/CatalogQuerySortedAttribute.ts +++ b/src/serialization/types/CatalogQuerySortedAttribute.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SortOrder } from "./SortOrder"; export const CatalogQuerySortedAttribute: core.serialization.ObjectSchema< @@ -20,7 +22,7 @@ export const CatalogQuerySortedAttribute: core.serialization.ObjectSchema< export declare namespace CatalogQuerySortedAttribute { export interface Raw { attribute_name: string; - initial_attribute_value?: (string | null | undefined) | null; + initial_attribute_value?: (string | null) | null; sort_order?: SortOrder.Raw | null; } } diff --git a/src/serialization/types/CatalogQueryText.ts b/src/serialization/types/CatalogQueryText.ts index c1df4fece..b94fc9a29 100644 --- a/src/serialization/types/CatalogQueryText.ts +++ b/src/serialization/types/CatalogQueryText.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CatalogQueryText: core.serialization.ObjectSchema< serializers.CatalogQueryText.Raw, diff --git a/src/serialization/types/CatalogQuickAmount.ts b/src/serialization/types/CatalogQuickAmount.ts index 1e6fb21d8..3ff6828ca 100644 --- a/src/serialization/types/CatalogQuickAmount.ts +++ b/src/serialization/types/CatalogQuickAmount.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CatalogQuickAmountType } from "./CatalogQuickAmountType"; import { Money } from "./Money"; @@ -20,7 +22,7 @@ export declare namespace CatalogQuickAmount { export interface Raw { type: CatalogQuickAmountType.Raw; amount: Money.Raw; - score?: ((bigint | number) | null | undefined) | null; - ordinal?: ((bigint | number) | null | undefined) | null; + score?: ((bigint | number) | null) | null; + ordinal?: ((bigint | number) | null) | null; } } diff --git a/src/serialization/types/CatalogQuickAmountType.ts b/src/serialization/types/CatalogQuickAmountType.ts index 4ae4644c3..10cbf99ae 100644 --- a/src/serialization/types/CatalogQuickAmountType.ts +++ b/src/serialization/types/CatalogQuickAmountType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CatalogQuickAmountType: core.serialization.Schema< serializers.CatalogQuickAmountType.Raw, diff --git a/src/serialization/types/CatalogQuickAmountsSettings.ts b/src/serialization/types/CatalogQuickAmountsSettings.ts index 3f8652de6..efe43eff6 100644 --- a/src/serialization/types/CatalogQuickAmountsSettings.ts +++ b/src/serialization/types/CatalogQuickAmountsSettings.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { CatalogQuickAmount } from "./CatalogQuickAmount"; import { CatalogQuickAmountsSettingsOption } from "./CatalogQuickAmountsSettingsOption"; +import { CatalogQuickAmount } from "./CatalogQuickAmount"; export const CatalogQuickAmountsSettings: core.serialization.ObjectSchema< serializers.CatalogQuickAmountsSettings.Raw, @@ -21,7 +23,7 @@ export const CatalogQuickAmountsSettings: core.serialization.ObjectSchema< export declare namespace CatalogQuickAmountsSettings { export interface Raw { option: CatalogQuickAmountsSettingsOption.Raw; - eligible_for_auto_amounts?: (boolean | null | undefined) | null; - amounts?: (CatalogQuickAmount.Raw[] | null | undefined) | null; + eligible_for_auto_amounts?: (boolean | null) | null; + amounts?: (CatalogQuickAmount.Raw[] | null) | null; } } diff --git a/src/serialization/types/CatalogQuickAmountsSettingsOption.ts b/src/serialization/types/CatalogQuickAmountsSettingsOption.ts index d07a1ec2b..dc5cd9051 100644 --- a/src/serialization/types/CatalogQuickAmountsSettingsOption.ts +++ b/src/serialization/types/CatalogQuickAmountsSettingsOption.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CatalogQuickAmountsSettingsOption: core.serialization.Schema< serializers.CatalogQuickAmountsSettingsOption.Raw, diff --git a/src/serialization/types/CatalogStockConversion.ts b/src/serialization/types/CatalogStockConversion.ts index 7a3f0ddf1..365449418 100644 --- a/src/serialization/types/CatalogStockConversion.ts +++ b/src/serialization/types/CatalogStockConversion.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CatalogStockConversion: core.serialization.ObjectSchema< serializers.CatalogStockConversion.Raw, diff --git a/src/serialization/types/CatalogSubscriptionPlan.ts b/src/serialization/types/CatalogSubscriptionPlan.ts index ce76273c3..189e4b302 100644 --- a/src/serialization/types/CatalogSubscriptionPlan.ts +++ b/src/serialization/types/CatalogSubscriptionPlan.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; -import * as core from "../../core"; import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; import { SubscriptionPhase } from "./SubscriptionPhase"; export const CatalogSubscriptionPlan: core.serialization.ObjectSchema< @@ -29,10 +31,10 @@ export const CatalogSubscriptionPlan: core.serialization.ObjectSchema< export declare namespace CatalogSubscriptionPlan { export interface Raw { name: string; - phases?: (SubscriptionPhase.Raw[] | null | undefined) | null; - subscription_plan_variations?: (serializers.CatalogObject.Raw[] | null | undefined) | null; - eligible_item_ids?: (string[] | null | undefined) | null; - eligible_category_ids?: (string[] | null | undefined) | null; - all_items?: (boolean | null | undefined) | null; + phases?: (SubscriptionPhase.Raw[] | null) | null; + subscription_plan_variations?: (serializers.CatalogObject.Raw[] | null) | null; + eligible_item_ids?: (string[] | null) | null; + eligible_category_ids?: (string[] | null) | null; + all_items?: (boolean | null) | null; } } diff --git a/src/serialization/types/CatalogSubscriptionPlanVariation.ts b/src/serialization/types/CatalogSubscriptionPlanVariation.ts index 2a080f2bb..0a5fb2298 100644 --- a/src/serialization/types/CatalogSubscriptionPlanVariation.ts +++ b/src/serialization/types/CatalogSubscriptionPlanVariation.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SubscriptionPhase } from "./SubscriptionPhase"; export const CatalogSubscriptionPlanVariation: core.serialization.ObjectSchema< @@ -30,9 +32,9 @@ export declare namespace CatalogSubscriptionPlanVariation { export interface Raw { name: string; phases: SubscriptionPhase.Raw[]; - subscription_plan_id?: (string | null | undefined) | null; - monthly_billing_anchor_date?: ((bigint | number) | null | undefined) | null; - can_prorate?: (boolean | null | undefined) | null; - successor_plan_variation_id?: (string | null | undefined) | null; + subscription_plan_id?: (string | null) | null; + monthly_billing_anchor_date?: ((bigint | number) | null) | null; + can_prorate?: (boolean | null) | null; + successor_plan_variation_id?: (string | null) | null; } } diff --git a/src/serialization/types/CatalogTax.ts b/src/serialization/types/CatalogTax.ts index 9e27bccd9..be8da258b 100644 --- a/src/serialization/types/CatalogTax.ts +++ b/src/serialization/types/CatalogTax.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { TaxCalculationPhase } from "./TaxCalculationPhase"; import { TaxInclusionType } from "./TaxInclusionType"; @@ -25,12 +27,12 @@ export const CatalogTax: core.serialization.ObjectSchema = core.serialization.object({ @@ -12,7 +14,7 @@ export const CatalogV1Id: core.serialization.ObjectSchema = core.serialization.enum_(["IMMEDIATE", "END_OF_BILLING_CYCLE"]); diff --git a/src/serialization/types/Channel.ts b/src/serialization/types/Channel.ts deleted file mode 100644 index 569e21a3d..000000000 --- a/src/serialization/types/Channel.ts +++ /dev/null @@ -1,32 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { ChannelStatus } from "./ChannelStatus"; -import { Reference } from "./Reference"; - -export const Channel: core.serialization.ObjectSchema = - core.serialization.object({ - id: core.serialization.string().optional(), - merchantId: core.serialization.property("merchant_id", core.serialization.string().optional()), - name: core.serialization.string().optionalNullable(), - version: core.serialization.number().optional(), - reference: Reference.optional(), - status: ChannelStatus.optional(), - createdAt: core.serialization.property("created_at", core.serialization.string().optional()), - updatedAt: core.serialization.property("updated_at", core.serialization.string().optional()), - }); - -export declare namespace Channel { - export interface Raw { - id?: string | null; - merchant_id?: string | null; - name?: (string | null | undefined) | null; - version?: number | null; - reference?: Reference.Raw | null; - status?: ChannelStatus.Raw | null; - created_at?: string | null; - updated_at?: string | null; - } -} diff --git a/src/serialization/types/ChannelStatus.ts b/src/serialization/types/ChannelStatus.ts deleted file mode 100644 index 48c3ab100..000000000 --- a/src/serialization/types/ChannelStatus.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const ChannelStatus: core.serialization.Schema = - core.serialization.enum_(["ACTIVE", "INACTIVE"]); - -export declare namespace ChannelStatus { - export type Raw = "ACTIVE" | "INACTIVE"; -} diff --git a/src/serialization/types/ChargeRequestAdditionalRecipient.ts b/src/serialization/types/ChargeRequestAdditionalRecipient.ts index eba44d6a4..7da0d9bbe 100644 --- a/src/serialization/types/ChargeRequestAdditionalRecipient.ts +++ b/src/serialization/types/ChargeRequestAdditionalRecipient.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const ChargeRequestAdditionalRecipient: core.serialization.ObjectSchema< diff --git a/src/serialization/types/Checkout.ts b/src/serialization/types/Checkout.ts index 123e60b30..af318ff29 100644 --- a/src/serialization/types/Checkout.ts +++ b/src/serialization/types/Checkout.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { AdditionalRecipient } from "./AdditionalRecipient"; import { Address } from "./Address"; import { Order } from "./Order"; +import { AdditionalRecipient } from "./AdditionalRecipient"; export const Checkout: core.serialization.ObjectSchema = core.serialization.object({ @@ -39,14 +41,14 @@ export const Checkout: core.serialization.ObjectSchema = core.serialization.object({ @@ -11,6 +13,6 @@ export const ClearpayDetails: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/CompletePaymentResponse.ts b/src/serialization/types/CompletePaymentResponse.ts index 5119395a1..ad790d62a 100644 --- a/src/serialization/types/CompletePaymentResponse.ts +++ b/src/serialization/types/CompletePaymentResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Payment } from "./Payment"; diff --git a/src/serialization/types/Component.ts b/src/serialization/types/Component.ts index 0d7da3cf9..18d3c09e9 100644 --- a/src/serialization/types/Component.ts +++ b/src/serialization/types/Component.ts @@ -1,14 +1,16 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { ComponentComponentType } from "./ComponentComponentType"; import { DeviceComponentDetailsApplicationDetails } from "./DeviceComponentDetailsApplicationDetails"; -import { DeviceComponentDetailsBatteryDetails } from "./DeviceComponentDetailsBatteryDetails"; import { DeviceComponentDetailsCardReaderDetails } from "./DeviceComponentDetailsCardReaderDetails"; -import { DeviceComponentDetailsEthernetDetails } from "./DeviceComponentDetailsEthernetDetails"; +import { DeviceComponentDetailsBatteryDetails } from "./DeviceComponentDetailsBatteryDetails"; import { DeviceComponentDetailsWiFiDetails } from "./DeviceComponentDetailsWiFiDetails"; +import { DeviceComponentDetailsEthernetDetails } from "./DeviceComponentDetailsEthernetDetails"; export const Component: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/ComponentComponentType.ts b/src/serialization/types/ComponentComponentType.ts index b5ea5779b..fab0e16b3 100644 --- a/src/serialization/types/ComponentComponentType.ts +++ b/src/serialization/types/ComponentComponentType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ComponentComponentType: core.serialization.Schema< serializers.ComponentComponentType.Raw, diff --git a/src/serialization/types/ConfirmationDecision.ts b/src/serialization/types/ConfirmationDecision.ts index 79f0b898e..d857306bd 100644 --- a/src/serialization/types/ConfirmationDecision.ts +++ b/src/serialization/types/ConfirmationDecision.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ConfirmationDecision: core.serialization.ObjectSchema< serializers.ConfirmationDecision.Raw, diff --git a/src/serialization/types/ConfirmationOptions.ts b/src/serialization/types/ConfirmationOptions.ts index a7c2e989c..285a1f77f 100644 --- a/src/serialization/types/ConfirmationOptions.ts +++ b/src/serialization/types/ConfirmationOptions.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { ConfirmationDecision } from "./ConfirmationDecision"; export const ConfirmationOptions: core.serialization.ObjectSchema< @@ -24,7 +26,7 @@ export declare namespace ConfirmationOptions { title: string; body: string; agree_button_text: string; - disagree_button_text?: (string | null | undefined) | null; + disagree_button_text?: (string | null) | null; decision?: ConfirmationDecision.Raw | null; } } diff --git a/src/serialization/types/Coordinates.ts b/src/serialization/types/Coordinates.ts index 35acb4fa7..aeb171690 100644 --- a/src/serialization/types/Coordinates.ts +++ b/src/serialization/types/Coordinates.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const Coordinates: core.serialization.ObjectSchema = core.serialization.object({ @@ -12,7 +14,7 @@ export const Coordinates: core.serialization.ObjectSchema = core.serialization.enum_([ "ZZ", diff --git a/src/serialization/types/CreateBookingCustomAttributeDefinitionResponse.ts b/src/serialization/types/CreateBookingCustomAttributeDefinitionResponse.ts index f736c596f..39c595962 100644 --- a/src/serialization/types/CreateBookingCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/CreateBookingCustomAttributeDefinitionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/CreateBookingResponse.ts b/src/serialization/types/CreateBookingResponse.ts index 0b1cf8a0a..6bf71e49a 100644 --- a/src/serialization/types/CreateBookingResponse.ts +++ b/src/serialization/types/CreateBookingResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Booking } from "./Booking"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/CreateBreakTypeResponse.ts b/src/serialization/types/CreateBreakTypeResponse.ts index 9a3ad9201..8abe550a8 100644 --- a/src/serialization/types/CreateBreakTypeResponse.ts +++ b/src/serialization/types/CreateBreakTypeResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BreakType } from "./BreakType"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/CreateCardResponse.ts b/src/serialization/types/CreateCardResponse.ts index a00625cdf..374cd9d34 100644 --- a/src/serialization/types/CreateCardResponse.ts +++ b/src/serialization/types/CreateCardResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Card } from "./Card"; import { Error_ } from "./Error_"; +import { Card } from "./Card"; export const CreateCardResponse: core.serialization.ObjectSchema< serializers.CreateCardResponse.Raw, diff --git a/src/serialization/types/CreateCatalogImageRequest.ts b/src/serialization/types/CreateCatalogImageRequest.ts index 0ce50617c..861ed5f4a 100644 --- a/src/serialization/types/CreateCatalogImageRequest.ts +++ b/src/serialization/types/CreateCatalogImageRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; -import * as core from "../../core"; import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; export const CreateCatalogImageRequest: core.serialization.ObjectSchema< serializers.CreateCatalogImageRequest.Raw, diff --git a/src/serialization/types/CreateCatalogImageResponse.ts b/src/serialization/types/CreateCatalogImageResponse.ts index e58a072d4..9dd799d61 100644 --- a/src/serialization/types/CreateCatalogImageResponse.ts +++ b/src/serialization/types/CreateCatalogImageResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; -import * as core from "../../core"; import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; import { Error_ } from "./Error_"; export const CreateCatalogImageResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CreateCheckoutResponse.ts b/src/serialization/types/CreateCheckoutResponse.ts index 0781dc5b9..9eb703880 100644 --- a/src/serialization/types/CreateCheckoutResponse.ts +++ b/src/serialization/types/CreateCheckoutResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Checkout } from "./Checkout"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/CreateCustomerCardResponse.ts b/src/serialization/types/CreateCustomerCardResponse.ts index 96e3358d7..8449b3850 100644 --- a/src/serialization/types/CreateCustomerCardResponse.ts +++ b/src/serialization/types/CreateCustomerCardResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Card } from "./Card"; import { Error_ } from "./Error_"; +import { Card } from "./Card"; export const CreateCustomerCardResponse: core.serialization.ObjectSchema< serializers.CreateCustomerCardResponse.Raw, diff --git a/src/serialization/types/CreateCustomerCustomAttributeDefinitionResponse.ts b/src/serialization/types/CreateCustomerCustomAttributeDefinitionResponse.ts index 9a8f7a1a8..2b97ef4b6 100644 --- a/src/serialization/types/CreateCustomerCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/CreateCustomerCustomAttributeDefinitionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/CreateCustomerGroupResponse.ts b/src/serialization/types/CreateCustomerGroupResponse.ts index 26b0ddca5..40cf55199 100644 --- a/src/serialization/types/CreateCustomerGroupResponse.ts +++ b/src/serialization/types/CreateCustomerGroupResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { CustomerGroup } from "./CustomerGroup"; import { Error_ } from "./Error_"; +import { CustomerGroup } from "./CustomerGroup"; export const CreateCustomerGroupResponse: core.serialization.ObjectSchema< serializers.CreateCustomerGroupResponse.Raw, diff --git a/src/serialization/types/CreateCustomerResponse.ts b/src/serialization/types/CreateCustomerResponse.ts index 007731dbf..6d01d42c7 100644 --- a/src/serialization/types/CreateCustomerResponse.ts +++ b/src/serialization/types/CreateCustomerResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Customer } from "./Customer"; import { Error_ } from "./Error_"; +import { Customer } from "./Customer"; export const CreateCustomerResponse: core.serialization.ObjectSchema< serializers.CreateCustomerResponse.Raw, diff --git a/src/serialization/types/CreateDeviceCodeResponse.ts b/src/serialization/types/CreateDeviceCodeResponse.ts index 841008250..ce85dd674 100644 --- a/src/serialization/types/CreateDeviceCodeResponse.ts +++ b/src/serialization/types/CreateDeviceCodeResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { DeviceCode } from "./DeviceCode"; import { Error_ } from "./Error_"; +import { DeviceCode } from "./DeviceCode"; export const CreateDeviceCodeResponse: core.serialization.ObjectSchema< serializers.CreateDeviceCodeResponse.Raw, diff --git a/src/serialization/types/CreateDisputeEvidenceFileRequest.ts b/src/serialization/types/CreateDisputeEvidenceFileRequest.ts index b50f73445..1d3fca2bf 100644 --- a/src/serialization/types/CreateDisputeEvidenceFileRequest.ts +++ b/src/serialization/types/CreateDisputeEvidenceFileRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { DisputeEvidenceType } from "./DisputeEvidenceType"; export const CreateDisputeEvidenceFileRequest: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CreateDisputeEvidenceFileResponse.ts b/src/serialization/types/CreateDisputeEvidenceFileResponse.ts index c23f6806a..38f77d069 100644 --- a/src/serialization/types/CreateDisputeEvidenceFileResponse.ts +++ b/src/serialization/types/CreateDisputeEvidenceFileResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { DisputeEvidence } from "./DisputeEvidence"; import { Error_ } from "./Error_"; +import { DisputeEvidence } from "./DisputeEvidence"; export const CreateDisputeEvidenceFileResponse: core.serialization.ObjectSchema< serializers.CreateDisputeEvidenceFileResponse.Raw, diff --git a/src/serialization/types/CreateDisputeEvidenceTextResponse.ts b/src/serialization/types/CreateDisputeEvidenceTextResponse.ts index 655b4a400..9e278727c 100644 --- a/src/serialization/types/CreateDisputeEvidenceTextResponse.ts +++ b/src/serialization/types/CreateDisputeEvidenceTextResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { DisputeEvidence } from "./DisputeEvidence"; import { Error_ } from "./Error_"; +import { DisputeEvidence } from "./DisputeEvidence"; export const CreateDisputeEvidenceTextResponse: core.serialization.ObjectSchema< serializers.CreateDisputeEvidenceTextResponse.Raw, diff --git a/src/serialization/types/CreateGiftCardActivityResponse.ts b/src/serialization/types/CreateGiftCardActivityResponse.ts index d98a93f35..dd25beb58 100644 --- a/src/serialization/types/CreateGiftCardActivityResponse.ts +++ b/src/serialization/types/CreateGiftCardActivityResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { GiftCardActivity } from "./GiftCardActivity"; diff --git a/src/serialization/types/CreateGiftCardResponse.ts b/src/serialization/types/CreateGiftCardResponse.ts index dcc4ec22d..441867d59 100644 --- a/src/serialization/types/CreateGiftCardResponse.ts +++ b/src/serialization/types/CreateGiftCardResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { GiftCard } from "./GiftCard"; diff --git a/src/serialization/types/CreateInvoiceAttachmentRequestData.ts b/src/serialization/types/CreateInvoiceAttachmentRequestData.ts index 0a8a1d03c..56bd40f1e 100644 --- a/src/serialization/types/CreateInvoiceAttachmentRequestData.ts +++ b/src/serialization/types/CreateInvoiceAttachmentRequestData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CreateInvoiceAttachmentRequestData: core.serialization.ObjectSchema< serializers.CreateInvoiceAttachmentRequestData.Raw, diff --git a/src/serialization/types/CreateInvoiceAttachmentResponse.ts b/src/serialization/types/CreateInvoiceAttachmentResponse.ts index b7c85d500..b5f7e474d 100644 --- a/src/serialization/types/CreateInvoiceAttachmentResponse.ts +++ b/src/serialization/types/CreateInvoiceAttachmentResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { InvoiceAttachment } from "./InvoiceAttachment"; +import { Error_ } from "./Error_"; export const CreateInvoiceAttachmentResponse: core.serialization.ObjectSchema< serializers.CreateInvoiceAttachmentResponse.Raw, diff --git a/src/serialization/types/CreateInvoiceResponse.ts b/src/serialization/types/CreateInvoiceResponse.ts index 260b07be1..30246acab 100644 --- a/src/serialization/types/CreateInvoiceResponse.ts +++ b/src/serialization/types/CreateInvoiceResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Invoice } from "./Invoice"; +import { Error_ } from "./Error_"; export const CreateInvoiceResponse: core.serialization.ObjectSchema< serializers.CreateInvoiceResponse.Raw, diff --git a/src/serialization/types/CreateJobResponse.ts b/src/serialization/types/CreateJobResponse.ts index a322653c8..8d8376f63 100644 --- a/src/serialization/types/CreateJobResponse.ts +++ b/src/serialization/types/CreateJobResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Job } from "./Job"; +import { Error_ } from "./Error_"; export const CreateJobResponse: core.serialization.ObjectSchema< serializers.CreateJobResponse.Raw, diff --git a/src/serialization/types/CreateLocationCustomAttributeDefinitionResponse.ts b/src/serialization/types/CreateLocationCustomAttributeDefinitionResponse.ts index b178be0be..ff829065c 100644 --- a/src/serialization/types/CreateLocationCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/CreateLocationCustomAttributeDefinitionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/CreateLocationResponse.ts b/src/serialization/types/CreateLocationResponse.ts index f1c2a7908..d4a35dbc3 100644 --- a/src/serialization/types/CreateLocationResponse.ts +++ b/src/serialization/types/CreateLocationResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Location } from "./Location"; diff --git a/src/serialization/types/CreateLoyaltyAccountResponse.ts b/src/serialization/types/CreateLoyaltyAccountResponse.ts index cca5d2218..719616e98 100644 --- a/src/serialization/types/CreateLoyaltyAccountResponse.ts +++ b/src/serialization/types/CreateLoyaltyAccountResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyAccount } from "./LoyaltyAccount"; diff --git a/src/serialization/types/CreateLoyaltyPromotionResponse.ts b/src/serialization/types/CreateLoyaltyPromotionResponse.ts index d0d562080..3bb2dea21 100644 --- a/src/serialization/types/CreateLoyaltyPromotionResponse.ts +++ b/src/serialization/types/CreateLoyaltyPromotionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyPromotion } from "./LoyaltyPromotion"; diff --git a/src/serialization/types/CreateLoyaltyRewardResponse.ts b/src/serialization/types/CreateLoyaltyRewardResponse.ts index 7c0bda76d..fd4404dbd 100644 --- a/src/serialization/types/CreateLoyaltyRewardResponse.ts +++ b/src/serialization/types/CreateLoyaltyRewardResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyReward } from "./LoyaltyReward"; diff --git a/src/serialization/types/CreateMerchantCustomAttributeDefinitionResponse.ts b/src/serialization/types/CreateMerchantCustomAttributeDefinitionResponse.ts index 3196ce6f0..6fa86f3f4 100644 --- a/src/serialization/types/CreateMerchantCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/CreateMerchantCustomAttributeDefinitionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/CreateMobileAuthorizationCodeResponse.ts b/src/serialization/types/CreateMobileAuthorizationCodeResponse.ts index e61b7baf9..9e00f3fab 100644 --- a/src/serialization/types/CreateMobileAuthorizationCodeResponse.ts +++ b/src/serialization/types/CreateMobileAuthorizationCodeResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const CreateMobileAuthorizationCodeResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CreateOrderCustomAttributeDefinitionResponse.ts b/src/serialization/types/CreateOrderCustomAttributeDefinitionResponse.ts index d8eecf673..0c269b0d2 100644 --- a/src/serialization/types/CreateOrderCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/CreateOrderCustomAttributeDefinitionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/CreateOrderRequest.ts b/src/serialization/types/CreateOrderRequest.ts index cb813a188..97b072a82 100644 --- a/src/serialization/types/CreateOrderRequest.ts +++ b/src/serialization/types/CreateOrderRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Order } from "./Order"; export const CreateOrderRequest: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CreateOrderResponse.ts b/src/serialization/types/CreateOrderResponse.ts index 5685b52d1..3cdc089b7 100644 --- a/src/serialization/types/CreateOrderResponse.ts +++ b/src/serialization/types/CreateOrderResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Order } from "./Order"; +import { Error_ } from "./Error_"; export const CreateOrderResponse: core.serialization.ObjectSchema< serializers.CreateOrderResponse.Raw, diff --git a/src/serialization/types/CreatePaymentLinkResponse.ts b/src/serialization/types/CreatePaymentLinkResponse.ts index a4d54090e..e56b6d267 100644 --- a/src/serialization/types/CreatePaymentLinkResponse.ts +++ b/src/serialization/types/CreatePaymentLinkResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { PaymentLink } from "./PaymentLink"; import { PaymentLinkRelatedResources } from "./PaymentLinkRelatedResources"; diff --git a/src/serialization/types/CreatePaymentResponse.ts b/src/serialization/types/CreatePaymentResponse.ts index b5bd438f1..5ab32549a 100644 --- a/src/serialization/types/CreatePaymentResponse.ts +++ b/src/serialization/types/CreatePaymentResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Payment } from "./Payment"; diff --git a/src/serialization/types/CreateScheduledShiftResponse.ts b/src/serialization/types/CreateScheduledShiftResponse.ts index 2e921021a..6fa3bebf9 100644 --- a/src/serialization/types/CreateScheduledShiftResponse.ts +++ b/src/serialization/types/CreateScheduledShiftResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { ScheduledShift } from "./ScheduledShift"; +import { Error_ } from "./Error_"; export const CreateScheduledShiftResponse: core.serialization.ObjectSchema< serializers.CreateScheduledShiftResponse.Raw, diff --git a/src/serialization/types/CreateShiftResponse.ts b/src/serialization/types/CreateShiftResponse.ts index 354767de3..367047732 100644 --- a/src/serialization/types/CreateShiftResponse.ts +++ b/src/serialization/types/CreateShiftResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Shift } from "./Shift"; +import { Error_ } from "./Error_"; export const CreateShiftResponse: core.serialization.ObjectSchema< serializers.CreateShiftResponse.Raw, diff --git a/src/serialization/types/CreateSubscriptionResponse.ts b/src/serialization/types/CreateSubscriptionResponse.ts index 6e876b2cc..925fff48a 100644 --- a/src/serialization/types/CreateSubscriptionResponse.ts +++ b/src/serialization/types/CreateSubscriptionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Subscription } from "./Subscription"; diff --git a/src/serialization/types/CreateTeamMemberRequest.ts b/src/serialization/types/CreateTeamMemberRequest.ts index 7967b9171..2dfc3ea28 100644 --- a/src/serialization/types/CreateTeamMemberRequest.ts +++ b/src/serialization/types/CreateTeamMemberRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { TeamMember } from "./TeamMember"; export const CreateTeamMemberRequest: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CreateTeamMemberResponse.ts b/src/serialization/types/CreateTeamMemberResponse.ts index 9516b41a3..817631b00 100644 --- a/src/serialization/types/CreateTeamMemberResponse.ts +++ b/src/serialization/types/CreateTeamMemberResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { TeamMember } from "./TeamMember"; +import { Error_ } from "./Error_"; export const CreateTeamMemberResponse: core.serialization.ObjectSchema< serializers.CreateTeamMemberResponse.Raw, diff --git a/src/serialization/types/CreateTerminalActionResponse.ts b/src/serialization/types/CreateTerminalActionResponse.ts index 5aa87eae1..10002c68c 100644 --- a/src/serialization/types/CreateTerminalActionResponse.ts +++ b/src/serialization/types/CreateTerminalActionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalAction } from "./TerminalAction"; diff --git a/src/serialization/types/CreateTerminalCheckoutResponse.ts b/src/serialization/types/CreateTerminalCheckoutResponse.ts index 1c1790627..7c30fb814 100644 --- a/src/serialization/types/CreateTerminalCheckoutResponse.ts +++ b/src/serialization/types/CreateTerminalCheckoutResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalCheckout } from "./TerminalCheckout"; diff --git a/src/serialization/types/CreateTerminalRefundResponse.ts b/src/serialization/types/CreateTerminalRefundResponse.ts index b6b564231..028548ff9 100644 --- a/src/serialization/types/CreateTerminalRefundResponse.ts +++ b/src/serialization/types/CreateTerminalRefundResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalRefund } from "./TerminalRefund"; diff --git a/src/serialization/types/CreateTimecardResponse.ts b/src/serialization/types/CreateTimecardResponse.ts index e80f43f83..6b9d87ec4 100644 --- a/src/serialization/types/CreateTimecardResponse.ts +++ b/src/serialization/types/CreateTimecardResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Timecard } from "./Timecard"; +import { Error_ } from "./Error_"; export const CreateTimecardResponse: core.serialization.ObjectSchema< serializers.CreateTimecardResponse.Raw, diff --git a/src/serialization/types/CreateTransferOrderData.ts b/src/serialization/types/CreateTransferOrderData.ts deleted file mode 100644 index 0acd46cc4..000000000 --- a/src/serialization/types/CreateTransferOrderData.ts +++ /dev/null @@ -1,37 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { CreateTransferOrderLineData } from "./CreateTransferOrderLineData"; - -export const CreateTransferOrderData: core.serialization.ObjectSchema< - serializers.CreateTransferOrderData.Raw, - Square.CreateTransferOrderData -> = core.serialization.object({ - sourceLocationId: core.serialization.property("source_location_id", core.serialization.string()), - destinationLocationId: core.serialization.property("destination_location_id", core.serialization.string()), - expectedAt: core.serialization.property("expected_at", core.serialization.string().optionalNullable()), - notes: core.serialization.string().optionalNullable(), - trackingNumber: core.serialization.property("tracking_number", core.serialization.string().optionalNullable()), - createdByTeamMemberId: core.serialization.property( - "created_by_team_member_id", - core.serialization.string().optionalNullable(), - ), - lineItems: core.serialization.property( - "line_items", - core.serialization.list(CreateTransferOrderLineData).optionalNullable(), - ), -}); - -export declare namespace CreateTransferOrderData { - export interface Raw { - source_location_id: string; - destination_location_id: string; - expected_at?: (string | null | undefined) | null; - notes?: (string | null | undefined) | null; - tracking_number?: (string | null | undefined) | null; - created_by_team_member_id?: (string | null | undefined) | null; - line_items?: (CreateTransferOrderLineData.Raw[] | null | undefined) | null; - } -} diff --git a/src/serialization/types/CreateTransferOrderLineData.ts b/src/serialization/types/CreateTransferOrderLineData.ts deleted file mode 100644 index f3334035e..000000000 --- a/src/serialization/types/CreateTransferOrderLineData.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const CreateTransferOrderLineData: core.serialization.ObjectSchema< - serializers.CreateTransferOrderLineData.Raw, - Square.CreateTransferOrderLineData -> = core.serialization.object({ - itemVariationId: core.serialization.property("item_variation_id", core.serialization.string()), - quantityOrdered: core.serialization.property("quantity_ordered", core.serialization.string()), -}); - -export declare namespace CreateTransferOrderLineData { - export interface Raw { - item_variation_id: string; - quantity_ordered: string; - } -} diff --git a/src/serialization/types/CreateTransferOrderResponse.ts b/src/serialization/types/CreateTransferOrderResponse.ts deleted file mode 100644 index a23c988e7..000000000 --- a/src/serialization/types/CreateTransferOrderResponse.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; -import { TransferOrder } from "./TransferOrder"; - -export const CreateTransferOrderResponse: core.serialization.ObjectSchema< - serializers.CreateTransferOrderResponse.Raw, - Square.CreateTransferOrderResponse -> = core.serialization.object({ - transferOrder: core.serialization.property("transfer_order", TransferOrder.optional()), - errors: core.serialization.list(Error_).optional(), -}); - -export declare namespace CreateTransferOrderResponse { - export interface Raw { - transfer_order?: TransferOrder.Raw | null; - errors?: Error_.Raw[] | null; - } -} diff --git a/src/serialization/types/CreateVendorResponse.ts b/src/serialization/types/CreateVendorResponse.ts index 5ba661c51..eb5ee83a0 100644 --- a/src/serialization/types/CreateVendorResponse.ts +++ b/src/serialization/types/CreateVendorResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Vendor } from "./Vendor"; diff --git a/src/serialization/types/CreateWebhookSubscriptionResponse.ts b/src/serialization/types/CreateWebhookSubscriptionResponse.ts index ac3b2e724..3d7ae7166 100644 --- a/src/serialization/types/CreateWebhookSubscriptionResponse.ts +++ b/src/serialization/types/CreateWebhookSubscriptionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { WebhookSubscription } from "./WebhookSubscription"; diff --git a/src/serialization/types/Currency.ts b/src/serialization/types/Currency.ts index 1c159ecb7..4842418f9 100644 --- a/src/serialization/types/Currency.ts +++ b/src/serialization/types/Currency.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const Currency: core.serialization.Schema = core.serialization.enum_([ "UNKNOWN_CURRENCY", diff --git a/src/serialization/types/CustomAttribute.ts b/src/serialization/types/CustomAttribute.ts index fc02580fc..2f671981f 100644 --- a/src/serialization/types/CustomAttribute.ts +++ b/src/serialization/types/CustomAttribute.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { CustomAttributeDefinitionVisibility } from "./CustomAttributeDefinitionVisibility"; +import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; export const CustomAttribute: core.serialization.ObjectSchema = core.serialization.object({ @@ -19,8 +21,8 @@ export const CustomAttribute: core.serialization.ObjectSchema | null | undefined) | null; - name?: (string | null | undefined) | null; - description?: (string | null | undefined) | null; + key?: (string | null) | null; + schema?: (Record | null) | null; + name?: (string | null) | null; + description?: (string | null) | null; visibility?: CustomAttributeDefinitionVisibility.Raw | null; version?: number | null; updated_at?: string | null; diff --git a/src/serialization/types/CustomAttributeDefinitionEventData.ts b/src/serialization/types/CustomAttributeDefinitionEventData.ts index ffec2b90b..c18b9bfa7 100644 --- a/src/serialization/types/CustomAttributeDefinitionEventData.ts +++ b/src/serialization/types/CustomAttributeDefinitionEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinitionEventDataObject } from "./CustomAttributeDefinitionEventDataObject"; export const CustomAttributeDefinitionEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const CustomAttributeDefinitionEventData: core.serialization.ObjectSchema export declare namespace CustomAttributeDefinitionEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: CustomAttributeDefinitionEventDataObject.Raw | null; } diff --git a/src/serialization/types/CustomAttributeDefinitionEventDataObject.ts b/src/serialization/types/CustomAttributeDefinitionEventDataObject.ts index d521bf1b6..29edfb185 100644 --- a/src/serialization/types/CustomAttributeDefinitionEventDataObject.ts +++ b/src/serialization/types/CustomAttributeDefinitionEventDataObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; export const CustomAttributeDefinitionEventDataObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CustomAttributeDefinitionVisibility.ts b/src/serialization/types/CustomAttributeDefinitionVisibility.ts index 32f251a78..09e71c424 100644 --- a/src/serialization/types/CustomAttributeDefinitionVisibility.ts +++ b/src/serialization/types/CustomAttributeDefinitionVisibility.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CustomAttributeDefinitionVisibility: core.serialization.Schema< serializers.CustomAttributeDefinitionVisibility.Raw, diff --git a/src/serialization/types/CustomAttributeEventData.ts b/src/serialization/types/CustomAttributeEventData.ts index ee77b9e2f..7b5a892d1 100644 --- a/src/serialization/types/CustomAttributeEventData.ts +++ b/src/serialization/types/CustomAttributeEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeEventDataObject } from "./CustomAttributeEventDataObject"; export const CustomAttributeEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const CustomAttributeEventData: core.serialization.ObjectSchema< export declare namespace CustomAttributeEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: CustomAttributeEventDataObject.Raw | null; } diff --git a/src/serialization/types/CustomAttributeEventDataObject.ts b/src/serialization/types/CustomAttributeEventDataObject.ts index 3eab1b327..f67e51e7f 100644 --- a/src/serialization/types/CustomAttributeEventDataObject.ts +++ b/src/serialization/types/CustomAttributeEventDataObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; export const CustomAttributeEventDataObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CustomAttributeFilter.ts b/src/serialization/types/CustomAttributeFilter.ts index bf54888a6..9e6d947af 100644 --- a/src/serialization/types/CustomAttributeFilter.ts +++ b/src/serialization/types/CustomAttributeFilter.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Range } from "./Range"; export const CustomAttributeFilter: core.serialization.ObjectSchema< @@ -25,11 +27,11 @@ export const CustomAttributeFilter: core.serialization.ObjectSchema< export declare namespace CustomAttributeFilter { export interface Raw { - custom_attribute_definition_id?: (string | null | undefined) | null; - key?: (string | null | undefined) | null; - string_filter?: (string | null | undefined) | null; + custom_attribute_definition_id?: (string | null) | null; + key?: (string | null) | null; + string_filter?: (string | null) | null; number_filter?: Range.Raw | null; - selection_uids_filter?: (string[] | null | undefined) | null; - bool_filter?: (boolean | null | undefined) | null; + selection_uids_filter?: (string[] | null) | null; + bool_filter?: (boolean | null) | null; } } diff --git a/src/serialization/types/CustomField.ts b/src/serialization/types/CustomField.ts index 9abc54570..112388b70 100644 --- a/src/serialization/types/CustomField.ts +++ b/src/serialization/types/CustomField.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CustomField: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/Customer.ts b/src/serialization/types/Customer.ts index 8cb9ed8e5..ec7ddfd7f 100644 --- a/src/serialization/types/Customer.ts +++ b/src/serialization/types/Customer.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Address } from "./Address"; -import { CustomerCreationSource } from "./CustomerCreationSource"; import { CustomerPreferences } from "./CustomerPreferences"; +import { CustomerCreationSource } from "./CustomerCreationSource"; import { CustomerTaxIds } from "./CustomerTaxIds"; export const Customer: core.serialization.ObjectSchema = @@ -42,20 +44,20 @@ export declare namespace Customer { id?: string | null; created_at?: string | null; updated_at?: string | null; - given_name?: (string | null | undefined) | null; - family_name?: (string | null | undefined) | null; - nickname?: (string | null | undefined) | null; - company_name?: (string | null | undefined) | null; - email_address?: (string | null | undefined) | null; + given_name?: (string | null) | null; + family_name?: (string | null) | null; + nickname?: (string | null) | null; + company_name?: (string | null) | null; + email_address?: (string | null) | null; address?: Address.Raw | null; - phone_number?: (string | null | undefined) | null; - birthday?: (string | null | undefined) | null; - reference_id?: (string | null | undefined) | null; - note?: (string | null | undefined) | null; + phone_number?: (string | null) | null; + birthday?: (string | null) | null; + reference_id?: (string | null) | null; + note?: (string | null) | null; preferences?: CustomerPreferences.Raw | null; creation_source?: CustomerCreationSource.Raw | null; - group_ids?: (string[] | null | undefined) | null; - segment_ids?: (string[] | null | undefined) | null; + group_ids?: (string[] | null) | null; + segment_ids?: (string[] | null) | null; version?: (bigint | number) | null; tax_ids?: CustomerTaxIds.Raw | null; } diff --git a/src/serialization/types/CustomerAddressFilter.ts b/src/serialization/types/CustomerAddressFilter.ts index 50478cf62..536e3fec7 100644 --- a/src/serialization/types/CustomerAddressFilter.ts +++ b/src/serialization/types/CustomerAddressFilter.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Country } from "./Country"; import { CustomerTextFilter } from "./CustomerTextFilter"; +import { Country } from "./Country"; export const CustomerAddressFilter: core.serialization.ObjectSchema< serializers.CustomerAddressFilter.Raw, diff --git a/src/serialization/types/CustomerCreatedEvent.ts b/src/serialization/types/CustomerCreatedEvent.ts index 6dd540ee5..db327a752 100644 --- a/src/serialization/types/CustomerCreatedEvent.ts +++ b/src/serialization/types/CustomerCreatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomerCreatedEventData } from "./CustomerCreatedEventData"; export const CustomerCreatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CustomerCreatedEvent: core.serialization.ObjectSchema< export declare namespace CustomerCreatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomerCreatedEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCreatedEventData.ts b/src/serialization/types/CustomerCreatedEventData.ts index 32d5293f7..e6d13d800 100644 --- a/src/serialization/types/CustomerCreatedEventData.ts +++ b/src/serialization/types/CustomerCreatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomerCreatedEventObject } from "./CustomerCreatedEventObject"; export const CustomerCreatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const CustomerCreatedEventData: core.serialization.ObjectSchema< export declare namespace CustomerCreatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: CustomerCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/CustomerCreatedEventEventContext.ts b/src/serialization/types/CustomerCreatedEventEventContext.ts index cad3283de..560bad1d8 100644 --- a/src/serialization/types/CustomerCreatedEventEventContext.ts +++ b/src/serialization/types/CustomerCreatedEventEventContext.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomerCreatedEventEventContextMerge } from "./CustomerCreatedEventEventContextMerge"; export const CustomerCreatedEventEventContext: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CustomerCreatedEventEventContextMerge.ts b/src/serialization/types/CustomerCreatedEventEventContextMerge.ts index 20e9901d5..ddf65c816 100644 --- a/src/serialization/types/CustomerCreatedEventEventContextMerge.ts +++ b/src/serialization/types/CustomerCreatedEventEventContextMerge.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CustomerCreatedEventEventContextMerge: core.serialization.ObjectSchema< serializers.CustomerCreatedEventEventContextMerge.Raw, @@ -17,7 +19,7 @@ export const CustomerCreatedEventEventContextMerge: core.serialization.ObjectSch export declare namespace CustomerCreatedEventEventContextMerge { export interface Raw { - from_customer_ids?: (string[] | null | undefined) | null; - to_customer_id?: (string | null | undefined) | null; + from_customer_ids?: (string[] | null) | null; + to_customer_id?: (string | null) | null; } } diff --git a/src/serialization/types/CustomerCreatedEventObject.ts b/src/serialization/types/CustomerCreatedEventObject.ts index d8a1b0392..8becea722 100644 --- a/src/serialization/types/CustomerCreatedEventObject.ts +++ b/src/serialization/types/CustomerCreatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Customer } from "./Customer"; import { CustomerCreatedEventEventContext } from "./CustomerCreatedEventEventContext"; diff --git a/src/serialization/types/CustomerCreationSource.ts b/src/serialization/types/CustomerCreationSource.ts index 92db3021a..aa8551b3f 100644 --- a/src/serialization/types/CustomerCreationSource.ts +++ b/src/serialization/types/CustomerCreationSource.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CustomerCreationSource: core.serialization.Schema< serializers.CustomerCreationSource.Raw, diff --git a/src/serialization/types/CustomerCreationSourceFilter.ts b/src/serialization/types/CustomerCreationSourceFilter.ts index 9e34d96b2..514cd7c2b 100644 --- a/src/serialization/types/CustomerCreationSourceFilter.ts +++ b/src/serialization/types/CustomerCreationSourceFilter.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomerCreationSource } from "./CustomerCreationSource"; import { CustomerInclusionExclusion } from "./CustomerInclusionExclusion"; @@ -16,7 +18,7 @@ export const CustomerCreationSourceFilter: core.serialization.ObjectSchema< export declare namespace CustomerCreationSourceFilter { export interface Raw { - values?: (CustomerCreationSource.Raw[] | null | undefined) | null; + values?: (CustomerCreationSource.Raw[] | null) | null; rule?: CustomerInclusionExclusion.Raw | null; } } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionCreatedEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionCreatedEvent.ts index 78e4542e7..32262ad64 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionCreatedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionCreatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionCreatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CustomerCustomAttributeDefinitionCreatedEvent: core.serialization.O export declare namespace CustomerCustomAttributeDefinitionCreatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionCreatedPublicEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionCreatedPublicEvent.ts index 6e8a40e5c..721e2b517 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionCreatedPublicEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionCreatedPublicEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionCreatedPublicEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CustomerCustomAttributeDefinitionCreatedPublicEvent: core.serializa export declare namespace CustomerCustomAttributeDefinitionCreatedPublicEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionDeletedEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionDeletedEvent.ts index 4c3e4519b..3d67c4401 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionDeletedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionDeletedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionDeletedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CustomerCustomAttributeDefinitionDeletedEvent: core.serialization.O export declare namespace CustomerCustomAttributeDefinitionDeletedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionDeletedPublicEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionDeletedPublicEvent.ts index 99d066042..137b4d34e 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionDeletedPublicEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionDeletedPublicEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionDeletedPublicEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CustomerCustomAttributeDefinitionDeletedPublicEvent: core.serializa export declare namespace CustomerCustomAttributeDefinitionDeletedPublicEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionOwnedCreatedEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionOwnedCreatedEvent.ts index 74630b92e..b601b0b63 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionOwnedCreatedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionOwnedCreatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionOwnedCreatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CustomerCustomAttributeDefinitionOwnedCreatedEvent: core.serializat export declare namespace CustomerCustomAttributeDefinitionOwnedCreatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionOwnedDeletedEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionOwnedDeletedEvent.ts index 96904c020..fff983f58 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionOwnedDeletedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionOwnedDeletedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionOwnedDeletedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CustomerCustomAttributeDefinitionOwnedDeletedEvent: core.serializat export declare namespace CustomerCustomAttributeDefinitionOwnedDeletedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionOwnedUpdatedEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionOwnedUpdatedEvent.ts index 3aa0ee8bb..ebdf5a959 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionOwnedUpdatedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionOwnedUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionOwnedUpdatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CustomerCustomAttributeDefinitionOwnedUpdatedEvent: core.serializat export declare namespace CustomerCustomAttributeDefinitionOwnedUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionUpdatedEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionUpdatedEvent.ts index ea30929de..cab3773a0 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionUpdatedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionUpdatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CustomerCustomAttributeDefinitionUpdatedEvent: core.serialization.O export declare namespace CustomerCustomAttributeDefinitionUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionUpdatedPublicEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionUpdatedPublicEvent.ts index d1c80fdc0..12b4a1c93 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionUpdatedPublicEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionUpdatedPublicEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionUpdatedPublicEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CustomerCustomAttributeDefinitionUpdatedPublicEvent: core.serializa export declare namespace CustomerCustomAttributeDefinitionUpdatedPublicEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionVisibleCreatedEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionVisibleCreatedEvent.ts index c4f572985..00dfa6b54 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionVisibleCreatedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionVisibleCreatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionVisibleCreatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CustomerCustomAttributeDefinitionVisibleCreatedEvent: core.serializ export declare namespace CustomerCustomAttributeDefinitionVisibleCreatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionVisibleDeletedEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionVisibleDeletedEvent.ts index 72a45e24f..0a5fbbce2 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionVisibleDeletedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionVisibleDeletedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionVisibleDeletedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CustomerCustomAttributeDefinitionVisibleDeletedEvent: core.serializ export declare namespace CustomerCustomAttributeDefinitionVisibleDeletedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDefinitionVisibleUpdatedEvent.ts b/src/serialization/types/CustomerCustomAttributeDefinitionVisibleUpdatedEvent.ts index b60771f68..d22362803 100644 --- a/src/serialization/types/CustomerCustomAttributeDefinitionVisibleUpdatedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDefinitionVisibleUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinitionEventData } from "./CustomAttributeDefinitionEventData"; export const CustomerCustomAttributeDefinitionVisibleUpdatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CustomerCustomAttributeDefinitionVisibleUpdatedEvent: core.serializ export declare namespace CustomerCustomAttributeDefinitionVisibleUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeDefinitionEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDeletedEvent.ts b/src/serialization/types/CustomerCustomAttributeDeletedEvent.ts index 38da6f0c7..c0202a40b 100644 --- a/src/serialization/types/CustomerCustomAttributeDeletedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDeletedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const CustomerCustomAttributeDeletedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CustomerCustomAttributeDeletedEvent: core.serialization.ObjectSchem export declare namespace CustomerCustomAttributeDeletedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeDeletedPublicEvent.ts b/src/serialization/types/CustomerCustomAttributeDeletedPublicEvent.ts index 14e509c61..cd997be55 100644 --- a/src/serialization/types/CustomerCustomAttributeDeletedPublicEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeDeletedPublicEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const CustomerCustomAttributeDeletedPublicEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CustomerCustomAttributeDeletedPublicEvent: core.serialization.Objec export declare namespace CustomerCustomAttributeDeletedPublicEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeFilter.ts b/src/serialization/types/CustomerCustomAttributeFilter.ts index d43602a21..4f4fd1320 100644 --- a/src/serialization/types/CustomerCustomAttributeFilter.ts +++ b/src/serialization/types/CustomerCustomAttributeFilter.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomerCustomAttributeFilterValue } from "./CustomerCustomAttributeFilterValue"; import { TimeRange } from "./TimeRange"; diff --git a/src/serialization/types/CustomerCustomAttributeFilterValue.ts b/src/serialization/types/CustomerCustomAttributeFilterValue.ts index 3653d5d91..855a127f2 100644 --- a/src/serialization/types/CustomerCustomAttributeFilterValue.ts +++ b/src/serialization/types/CustomerCustomAttributeFilterValue.ts @@ -1,13 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { CustomerAddressFilter } from "./CustomerAddressFilter"; import { CustomerTextFilter } from "./CustomerTextFilter"; import { FilterValue } from "./FilterValue"; -import { FloatNumberRange } from "./FloatNumberRange"; import { TimeRange } from "./TimeRange"; +import { FloatNumberRange } from "./FloatNumberRange"; +import { CustomerAddressFilter } from "./CustomerAddressFilter"; export const CustomerCustomAttributeFilterValue: core.serialization.ObjectSchema< serializers.CustomerCustomAttributeFilterValue.Raw, @@ -31,7 +33,7 @@ export declare namespace CustomerCustomAttributeFilterValue { selection?: FilterValue.Raw | null; date?: TimeRange.Raw | null; number?: FloatNumberRange.Raw | null; - boolean?: (boolean | null | undefined) | null; + boolean?: (boolean | null) | null; address?: CustomerAddressFilter.Raw | null; } } diff --git a/src/serialization/types/CustomerCustomAttributeFilters.ts b/src/serialization/types/CustomerCustomAttributeFilters.ts index ec6fe13a4..b7fa2ed18 100644 --- a/src/serialization/types/CustomerCustomAttributeFilters.ts +++ b/src/serialization/types/CustomerCustomAttributeFilters.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomerCustomAttributeFilter } from "./CustomerCustomAttributeFilter"; export const CustomerCustomAttributeFilters: core.serialization.ObjectSchema< @@ -14,6 +16,6 @@ export const CustomerCustomAttributeFilters: core.serialization.ObjectSchema< export declare namespace CustomerCustomAttributeFilters { export interface Raw { - filters?: (CustomerCustomAttributeFilter.Raw[] | null | undefined) | null; + filters?: (CustomerCustomAttributeFilter.Raw[] | null) | null; } } diff --git a/src/serialization/types/CustomerCustomAttributeOwnedDeletedEvent.ts b/src/serialization/types/CustomerCustomAttributeOwnedDeletedEvent.ts index a986ae47f..da3885373 100644 --- a/src/serialization/types/CustomerCustomAttributeOwnedDeletedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeOwnedDeletedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const CustomerCustomAttributeOwnedDeletedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CustomerCustomAttributeOwnedDeletedEvent: core.serialization.Object export declare namespace CustomerCustomAttributeOwnedDeletedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeOwnedUpdatedEvent.ts b/src/serialization/types/CustomerCustomAttributeOwnedUpdatedEvent.ts index 8d57c1797..bd97c5a50 100644 --- a/src/serialization/types/CustomerCustomAttributeOwnedUpdatedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeOwnedUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const CustomerCustomAttributeOwnedUpdatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CustomerCustomAttributeOwnedUpdatedEvent: core.serialization.Object export declare namespace CustomerCustomAttributeOwnedUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeUpdatedEvent.ts b/src/serialization/types/CustomerCustomAttributeUpdatedEvent.ts index 240476e0a..f16aa1bc0 100644 --- a/src/serialization/types/CustomerCustomAttributeUpdatedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const CustomerCustomAttributeUpdatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CustomerCustomAttributeUpdatedEvent: core.serialization.ObjectSchem export declare namespace CustomerCustomAttributeUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeUpdatedPublicEvent.ts b/src/serialization/types/CustomerCustomAttributeUpdatedPublicEvent.ts index 223445576..3a99d562c 100644 --- a/src/serialization/types/CustomerCustomAttributeUpdatedPublicEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeUpdatedPublicEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const CustomerCustomAttributeUpdatedPublicEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CustomerCustomAttributeUpdatedPublicEvent: core.serialization.Objec export declare namespace CustomerCustomAttributeUpdatedPublicEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeVisibleDeletedEvent.ts b/src/serialization/types/CustomerCustomAttributeVisibleDeletedEvent.ts index a419c3d2b..0e34c5245 100644 --- a/src/serialization/types/CustomerCustomAttributeVisibleDeletedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeVisibleDeletedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const CustomerCustomAttributeVisibleDeletedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CustomerCustomAttributeVisibleDeletedEvent: core.serialization.Obje export declare namespace CustomerCustomAttributeVisibleDeletedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/CustomerCustomAttributeVisibleUpdatedEvent.ts b/src/serialization/types/CustomerCustomAttributeVisibleUpdatedEvent.ts index 86d2570de..1e10fbf45 100644 --- a/src/serialization/types/CustomerCustomAttributeVisibleUpdatedEvent.ts +++ b/src/serialization/types/CustomerCustomAttributeVisibleUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeEventData } from "./CustomAttributeEventData"; export const CustomerCustomAttributeVisibleUpdatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CustomerCustomAttributeVisibleUpdatedEvent: core.serialization.Obje export declare namespace CustomerCustomAttributeVisibleUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomAttributeEventData.Raw | null; } diff --git a/src/serialization/types/CustomerDeletedEvent.ts b/src/serialization/types/CustomerDeletedEvent.ts index 68104d19d..1c2c5317a 100644 --- a/src/serialization/types/CustomerDeletedEvent.ts +++ b/src/serialization/types/CustomerDeletedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomerDeletedEventData } from "./CustomerDeletedEventData"; export const CustomerDeletedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const CustomerDeletedEvent: core.serialization.ObjectSchema< export declare namespace CustomerDeletedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: CustomerDeletedEventData.Raw | null; } diff --git a/src/serialization/types/CustomerDeletedEventData.ts b/src/serialization/types/CustomerDeletedEventData.ts index 9553c4f1b..6f46eb424 100644 --- a/src/serialization/types/CustomerDeletedEventData.ts +++ b/src/serialization/types/CustomerDeletedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomerDeletedEventObject } from "./CustomerDeletedEventObject"; export const CustomerDeletedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const CustomerDeletedEventData: core.serialization.ObjectSchema< export declare namespace CustomerDeletedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: CustomerDeletedEventObject.Raw | null; } diff --git a/src/serialization/types/CustomerDeletedEventEventContext.ts b/src/serialization/types/CustomerDeletedEventEventContext.ts index 928c5cd36..4c0617f8c 100644 --- a/src/serialization/types/CustomerDeletedEventEventContext.ts +++ b/src/serialization/types/CustomerDeletedEventEventContext.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomerDeletedEventEventContextMerge } from "./CustomerDeletedEventEventContextMerge"; export const CustomerDeletedEventEventContext: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CustomerDeletedEventEventContextMerge.ts b/src/serialization/types/CustomerDeletedEventEventContextMerge.ts index b5b3a8181..0c39c236c 100644 --- a/src/serialization/types/CustomerDeletedEventEventContextMerge.ts +++ b/src/serialization/types/CustomerDeletedEventEventContextMerge.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CustomerDeletedEventEventContextMerge: core.serialization.ObjectSchema< serializers.CustomerDeletedEventEventContextMerge.Raw, @@ -17,7 +19,7 @@ export const CustomerDeletedEventEventContextMerge: core.serialization.ObjectSch export declare namespace CustomerDeletedEventEventContextMerge { export interface Raw { - from_customer_ids?: (string[] | null | undefined) | null; - to_customer_id?: (string | null | undefined) | null; + from_customer_ids?: (string[] | null) | null; + to_customer_id?: (string | null) | null; } } diff --git a/src/serialization/types/CustomerDeletedEventObject.ts b/src/serialization/types/CustomerDeletedEventObject.ts index 57a957659..51db7af38 100644 --- a/src/serialization/types/CustomerDeletedEventObject.ts +++ b/src/serialization/types/CustomerDeletedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Customer } from "./Customer"; import { CustomerDeletedEventEventContext } from "./CustomerDeletedEventEventContext"; diff --git a/src/serialization/types/CustomerDetails.ts b/src/serialization/types/CustomerDetails.ts index efb59aa24..04afde920 100644 --- a/src/serialization/types/CustomerDetails.ts +++ b/src/serialization/types/CustomerDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CustomerDetails: core.serialization.ObjectSchema = core.serialization.object({ @@ -15,7 +17,7 @@ export const CustomerDetails: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/CustomerGroup.ts b/src/serialization/types/CustomerGroup.ts index e54f12bd4..7375e075e 100644 --- a/src/serialization/types/CustomerGroup.ts +++ b/src/serialization/types/CustomerGroup.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CustomerGroup: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/CustomerInclusionExclusion.ts b/src/serialization/types/CustomerInclusionExclusion.ts index e6302f636..70cbbbb21 100644 --- a/src/serialization/types/CustomerInclusionExclusion.ts +++ b/src/serialization/types/CustomerInclusionExclusion.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CustomerInclusionExclusion: core.serialization.Schema< serializers.CustomerInclusionExclusion.Raw, diff --git a/src/serialization/types/CustomerPreferences.ts b/src/serialization/types/CustomerPreferences.ts index a42352232..c9f3a7d35 100644 --- a/src/serialization/types/CustomerPreferences.ts +++ b/src/serialization/types/CustomerPreferences.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CustomerPreferences: core.serialization.ObjectSchema< serializers.CustomerPreferences.Raw, @@ -16,6 +18,6 @@ export const CustomerPreferences: core.serialization.ObjectSchema< export declare namespace CustomerPreferences { export interface Raw { - email_unsubscribed?: (boolean | null | undefined) | null; + email_unsubscribed?: (boolean | null) | null; } } diff --git a/src/serialization/types/CustomerQuery.ts b/src/serialization/types/CustomerQuery.ts index 85fb0c6f2..74c50bc41 100644 --- a/src/serialization/types/CustomerQuery.ts +++ b/src/serialization/types/CustomerQuery.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomerFilter } from "./CustomerFilter"; import { CustomerSort } from "./CustomerSort"; diff --git a/src/serialization/types/CustomerSegment.ts b/src/serialization/types/CustomerSegment.ts index 4d60767af..7303e6880 100644 --- a/src/serialization/types/CustomerSegment.ts +++ b/src/serialization/types/CustomerSegment.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CustomerSegment: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/CustomerSort.ts b/src/serialization/types/CustomerSort.ts index fd1eb15ff..2b9ef32f7 100644 --- a/src/serialization/types/CustomerSort.ts +++ b/src/serialization/types/CustomerSort.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomerSortField } from "./CustomerSortField"; import { SortOrder } from "./SortOrder"; diff --git a/src/serialization/types/CustomerSortField.ts b/src/serialization/types/CustomerSortField.ts index e33da6e4f..21e2203c2 100644 --- a/src/serialization/types/CustomerSortField.ts +++ b/src/serialization/types/CustomerSortField.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CustomerSortField: core.serialization.Schema = core.serialization.enum_(["DEFAULT", "CREATED_AT"]); diff --git a/src/serialization/types/CustomerTaxIds.ts b/src/serialization/types/CustomerTaxIds.ts index a1952186c..cef8a8edb 100644 --- a/src/serialization/types/CustomerTaxIds.ts +++ b/src/serialization/types/CustomerTaxIds.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CustomerTaxIds: core.serialization.ObjectSchema = core.serialization.object({ @@ -11,6 +13,6 @@ export const CustomerTaxIds: core.serialization.ObjectSchema = core.serialization.object({ @@ -12,7 +14,7 @@ export const DateRange: core.serialization.ObjectSchema = core.serialization.enum_(["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]); diff --git a/src/serialization/types/DeleteBookingCustomAttributeDefinitionResponse.ts b/src/serialization/types/DeleteBookingCustomAttributeDefinitionResponse.ts index 386abe6e8..0a4b638fc 100644 --- a/src/serialization/types/DeleteBookingCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/DeleteBookingCustomAttributeDefinitionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteBookingCustomAttributeDefinitionResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteBookingCustomAttributeResponse.ts b/src/serialization/types/DeleteBookingCustomAttributeResponse.ts index 606dd0b49..ef33e73a4 100644 --- a/src/serialization/types/DeleteBookingCustomAttributeResponse.ts +++ b/src/serialization/types/DeleteBookingCustomAttributeResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteBookingCustomAttributeResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteBreakTypeResponse.ts b/src/serialization/types/DeleteBreakTypeResponse.ts index 73eb6c842..32a9fd7b4 100644 --- a/src/serialization/types/DeleteBreakTypeResponse.ts +++ b/src/serialization/types/DeleteBreakTypeResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteBreakTypeResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteCatalogObjectResponse.ts b/src/serialization/types/DeleteCatalogObjectResponse.ts index e32233924..8cd03bde4 100644 --- a/src/serialization/types/DeleteCatalogObjectResponse.ts +++ b/src/serialization/types/DeleteCatalogObjectResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteCatalogObjectResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteCustomerCardResponse.ts b/src/serialization/types/DeleteCustomerCardResponse.ts index 030a82d89..de93fa722 100644 --- a/src/serialization/types/DeleteCustomerCardResponse.ts +++ b/src/serialization/types/DeleteCustomerCardResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteCustomerCardResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteCustomerCustomAttributeDefinitionResponse.ts b/src/serialization/types/DeleteCustomerCustomAttributeDefinitionResponse.ts index 1cb56b60a..b74465071 100644 --- a/src/serialization/types/DeleteCustomerCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/DeleteCustomerCustomAttributeDefinitionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteCustomerCustomAttributeDefinitionResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteCustomerCustomAttributeResponse.ts b/src/serialization/types/DeleteCustomerCustomAttributeResponse.ts index cfc2b57aa..0a64db0d8 100644 --- a/src/serialization/types/DeleteCustomerCustomAttributeResponse.ts +++ b/src/serialization/types/DeleteCustomerCustomAttributeResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteCustomerCustomAttributeResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteCustomerGroupResponse.ts b/src/serialization/types/DeleteCustomerGroupResponse.ts index d6089f5c9..ceefcf781 100644 --- a/src/serialization/types/DeleteCustomerGroupResponse.ts +++ b/src/serialization/types/DeleteCustomerGroupResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteCustomerGroupResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteCustomerResponse.ts b/src/serialization/types/DeleteCustomerResponse.ts index 34a213f22..b6b31e040 100644 --- a/src/serialization/types/DeleteCustomerResponse.ts +++ b/src/serialization/types/DeleteCustomerResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteCustomerResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteDisputeEvidenceResponse.ts b/src/serialization/types/DeleteDisputeEvidenceResponse.ts index e2586e5b5..5462a5275 100644 --- a/src/serialization/types/DeleteDisputeEvidenceResponse.ts +++ b/src/serialization/types/DeleteDisputeEvidenceResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteDisputeEvidenceResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteInvoiceAttachmentResponse.ts b/src/serialization/types/DeleteInvoiceAttachmentResponse.ts index 66cfc201b..6385db0c8 100644 --- a/src/serialization/types/DeleteInvoiceAttachmentResponse.ts +++ b/src/serialization/types/DeleteInvoiceAttachmentResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteInvoiceAttachmentResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteInvoiceResponse.ts b/src/serialization/types/DeleteInvoiceResponse.ts index 6b495a0fc..3475aa54b 100644 --- a/src/serialization/types/DeleteInvoiceResponse.ts +++ b/src/serialization/types/DeleteInvoiceResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteInvoiceResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteLocationCustomAttributeDefinitionResponse.ts b/src/serialization/types/DeleteLocationCustomAttributeDefinitionResponse.ts index f7c7e9219..acf03bfd2 100644 --- a/src/serialization/types/DeleteLocationCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/DeleteLocationCustomAttributeDefinitionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteLocationCustomAttributeDefinitionResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteLocationCustomAttributeResponse.ts b/src/serialization/types/DeleteLocationCustomAttributeResponse.ts index 3d4a4b238..fa3d0ed2b 100644 --- a/src/serialization/types/DeleteLocationCustomAttributeResponse.ts +++ b/src/serialization/types/DeleteLocationCustomAttributeResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteLocationCustomAttributeResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteLoyaltyRewardResponse.ts b/src/serialization/types/DeleteLoyaltyRewardResponse.ts index 4601c9615..5d3fbc7bc 100644 --- a/src/serialization/types/DeleteLoyaltyRewardResponse.ts +++ b/src/serialization/types/DeleteLoyaltyRewardResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteLoyaltyRewardResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteMerchantCustomAttributeDefinitionResponse.ts b/src/serialization/types/DeleteMerchantCustomAttributeDefinitionResponse.ts index 896bada8a..4bb4141e6 100644 --- a/src/serialization/types/DeleteMerchantCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/DeleteMerchantCustomAttributeDefinitionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteMerchantCustomAttributeDefinitionResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteMerchantCustomAttributeResponse.ts b/src/serialization/types/DeleteMerchantCustomAttributeResponse.ts index f454716b4..5c68b8813 100644 --- a/src/serialization/types/DeleteMerchantCustomAttributeResponse.ts +++ b/src/serialization/types/DeleteMerchantCustomAttributeResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteMerchantCustomAttributeResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteOrderCustomAttributeDefinitionResponse.ts b/src/serialization/types/DeleteOrderCustomAttributeDefinitionResponse.ts index d99b0f8dd..3b3ff726a 100644 --- a/src/serialization/types/DeleteOrderCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/DeleteOrderCustomAttributeDefinitionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteOrderCustomAttributeDefinitionResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteOrderCustomAttributeResponse.ts b/src/serialization/types/DeleteOrderCustomAttributeResponse.ts index 44617c32c..b9edcc24a 100644 --- a/src/serialization/types/DeleteOrderCustomAttributeResponse.ts +++ b/src/serialization/types/DeleteOrderCustomAttributeResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteOrderCustomAttributeResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeletePaymentLinkResponse.ts b/src/serialization/types/DeletePaymentLinkResponse.ts index a223f903e..a78fac4ba 100644 --- a/src/serialization/types/DeletePaymentLinkResponse.ts +++ b/src/serialization/types/DeletePaymentLinkResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeletePaymentLinkResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteShiftResponse.ts b/src/serialization/types/DeleteShiftResponse.ts index eee1e85ee..46c572ab5 100644 --- a/src/serialization/types/DeleteShiftResponse.ts +++ b/src/serialization/types/DeleteShiftResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteShiftResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteSnippetResponse.ts b/src/serialization/types/DeleteSnippetResponse.ts index 2d611ef0c..1c7670975 100644 --- a/src/serialization/types/DeleteSnippetResponse.ts +++ b/src/serialization/types/DeleteSnippetResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteSnippetResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteSubscriptionActionResponse.ts b/src/serialization/types/DeleteSubscriptionActionResponse.ts index 53d3ed995..1f25108ee 100644 --- a/src/serialization/types/DeleteSubscriptionActionResponse.ts +++ b/src/serialization/types/DeleteSubscriptionActionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Subscription } from "./Subscription"; diff --git a/src/serialization/types/DeleteTimecardResponse.ts b/src/serialization/types/DeleteTimecardResponse.ts index c65df7f4f..4b02939b8 100644 --- a/src/serialization/types/DeleteTimecardResponse.ts +++ b/src/serialization/types/DeleteTimecardResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteTimecardResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeleteTransferOrderResponse.ts b/src/serialization/types/DeleteTransferOrderResponse.ts deleted file mode 100644 index d32ee233f..000000000 --- a/src/serialization/types/DeleteTransferOrderResponse.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; - -export const DeleteTransferOrderResponse: core.serialization.ObjectSchema< - serializers.DeleteTransferOrderResponse.Raw, - Square.DeleteTransferOrderResponse -> = core.serialization.object({ - errors: core.serialization.list(Error_).optional(), -}); - -export declare namespace DeleteTransferOrderResponse { - export interface Raw { - errors?: Error_.Raw[] | null; - } -} diff --git a/src/serialization/types/DeleteWebhookSubscriptionResponse.ts b/src/serialization/types/DeleteWebhookSubscriptionResponse.ts index ed5971d76..b56bfc771 100644 --- a/src/serialization/types/DeleteWebhookSubscriptionResponse.ts +++ b/src/serialization/types/DeleteWebhookSubscriptionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DeleteWebhookSubscriptionResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/Destination.ts b/src/serialization/types/Destination.ts index 5c282c657..366eff6d8 100644 --- a/src/serialization/types/Destination.ts +++ b/src/serialization/types/Destination.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { DestinationType } from "./DestinationType"; export const Destination: core.serialization.ObjectSchema = diff --git a/src/serialization/types/DestinationDetails.ts b/src/serialization/types/DestinationDetails.ts index 8ae5bb9dc..a75499ab1 100644 --- a/src/serialization/types/DestinationDetails.ts +++ b/src/serialization/types/DestinationDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { DestinationDetailsCardRefundDetails } from "./DestinationDetailsCardRefundDetails"; import { DestinationDetailsCashRefundDetails } from "./DestinationDetailsCashRefundDetails"; import { DestinationDetailsExternalRefundDetails } from "./DestinationDetailsExternalRefundDetails"; diff --git a/src/serialization/types/DestinationDetailsCardRefundDetails.ts b/src/serialization/types/DestinationDetailsCardRefundDetails.ts index 9eee46dd3..e7aeb6e32 100644 --- a/src/serialization/types/DestinationDetailsCardRefundDetails.ts +++ b/src/serialization/types/DestinationDetailsCardRefundDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Card } from "./Card"; export const DestinationDetailsCardRefundDetails: core.serialization.ObjectSchema< @@ -17,7 +19,7 @@ export const DestinationDetailsCardRefundDetails: core.serialization.ObjectSchem export declare namespace DestinationDetailsCardRefundDetails { export interface Raw { card?: Card.Raw | null; - entry_method?: (string | null | undefined) | null; - auth_result_code?: (string | null | undefined) | null; + entry_method?: (string | null) | null; + auth_result_code?: (string | null) | null; } } diff --git a/src/serialization/types/DestinationDetailsCashRefundDetails.ts b/src/serialization/types/DestinationDetailsCashRefundDetails.ts index 0271bab5d..a34890e16 100644 --- a/src/serialization/types/DestinationDetailsCashRefundDetails.ts +++ b/src/serialization/types/DestinationDetailsCashRefundDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const DestinationDetailsCashRefundDetails: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DestinationDetailsExternalRefundDetails.ts b/src/serialization/types/DestinationDetailsExternalRefundDetails.ts index 3661023e0..d6cc57509 100644 --- a/src/serialization/types/DestinationDetailsExternalRefundDetails.ts +++ b/src/serialization/types/DestinationDetailsExternalRefundDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const DestinationDetailsExternalRefundDetails: core.serialization.ObjectSchema< serializers.DestinationDetailsExternalRefundDetails.Raw, @@ -17,6 +19,6 @@ export declare namespace DestinationDetailsExternalRefundDetails { export interface Raw { type: string; source: string; - source_id?: (string | null | undefined) | null; + source_id?: (string | null) | null; } } diff --git a/src/serialization/types/DestinationType.ts b/src/serialization/types/DestinationType.ts index 88ce291d6..8d5966cf5 100644 --- a/src/serialization/types/DestinationType.ts +++ b/src/serialization/types/DestinationType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const DestinationType: core.serialization.Schema = core.serialization.enum_(["BANK_ACCOUNT", "CARD", "SQUARE_BALANCE", "SQUARE_STORED_BALANCE"]); diff --git a/src/serialization/types/Device.ts b/src/serialization/types/Device.ts index 599ba2e7b..bdfa1bd46 100644 --- a/src/serialization/types/Device.ts +++ b/src/serialization/types/Device.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Component } from "./Component"; import { DeviceAttributes } from "./DeviceAttributes"; +import { Component } from "./Component"; import { DeviceStatus } from "./DeviceStatus"; export const Device: core.serialization.ObjectSchema = core.serialization.object( @@ -20,7 +22,7 @@ export declare namespace Device { export interface Raw { id?: string | null; attributes: DeviceAttributes.Raw; - components?: (Component.Raw[] | null | undefined) | null; + components?: (Component.Raw[] | null) | null; status?: DeviceStatus.Raw | null; } } diff --git a/src/serialization/types/DeviceAttributes.ts b/src/serialization/types/DeviceAttributes.ts index 64a0c0954..364f6f982 100644 --- a/src/serialization/types/DeviceAttributes.ts +++ b/src/serialization/types/DeviceAttributes.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { DeviceAttributesDeviceType } from "./DeviceAttributesDeviceType"; export const DeviceAttributes: core.serialization.ObjectSchema< @@ -23,11 +25,11 @@ export declare namespace DeviceAttributes { export interface Raw { type: DeviceAttributesDeviceType.Raw; manufacturer: string; - model?: (string | null | undefined) | null; - name?: (string | null | undefined) | null; - manufacturers_id?: (string | null | undefined) | null; + model?: (string | null) | null; + name?: (string | null) | null; + manufacturers_id?: (string | null) | null; updated_at?: string | null; version?: string | null; - merchant_token?: (string | null | undefined) | null; + merchant_token?: (string | null) | null; } } diff --git a/src/serialization/types/DeviceAttributesDeviceType.ts b/src/serialization/types/DeviceAttributesDeviceType.ts index 6e5fea54d..cd9d9fb54 100644 --- a/src/serialization/types/DeviceAttributesDeviceType.ts +++ b/src/serialization/types/DeviceAttributesDeviceType.ts @@ -1,14 +1,16 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const DeviceAttributesDeviceType: core.serialization.Schema< serializers.DeviceAttributesDeviceType.Raw, Square.DeviceAttributesDeviceType -> = core.serialization.enum_(["TERMINAL", "HANDHELD"]); +> = core.serialization.stringLiteral("TERMINAL"); export declare namespace DeviceAttributesDeviceType { - export type Raw = "TERMINAL" | "HANDHELD"; + export type Raw = "TERMINAL"; } diff --git a/src/serialization/types/DeviceCheckoutOptions.ts b/src/serialization/types/DeviceCheckoutOptions.ts index 0905829fd..b9498253e 100644 --- a/src/serialization/types/DeviceCheckoutOptions.ts +++ b/src/serialization/types/DeviceCheckoutOptions.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { TipSettings } from "./TipSettings"; export const DeviceCheckoutOptions: core.serialization.ObjectSchema< @@ -25,9 +27,9 @@ export const DeviceCheckoutOptions: core.serialization.ObjectSchema< export declare namespace DeviceCheckoutOptions { export interface Raw { device_id: string; - skip_receipt_screen?: (boolean | null | undefined) | null; - collect_signature?: (boolean | null | undefined) | null; + skip_receipt_screen?: (boolean | null) | null; + collect_signature?: (boolean | null) | null; tip_settings?: TipSettings.Raw | null; - show_itemized_cart?: (boolean | null | undefined) | null; + show_itemized_cart?: (boolean | null) | null; } } diff --git a/src/serialization/types/DeviceCode.ts b/src/serialization/types/DeviceCode.ts index 6dabba6c6..d21f97aa2 100644 --- a/src/serialization/types/DeviceCode.ts +++ b/src/serialization/types/DeviceCode.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { DeviceCodeStatus } from "./DeviceCodeStatus"; import { ProductType } from "./ProductType"; +import { DeviceCodeStatus } from "./DeviceCodeStatus"; export const DeviceCode: core.serialization.ObjectSchema = core.serialization.object({ @@ -24,11 +26,11 @@ export const DeviceCode: core.serialization.ObjectSchema = core.serialization.enum_(["UNKNOWN", "UNPAIRED", "PAIRED", "EXPIRED"]); diff --git a/src/serialization/types/DeviceComponentDetailsApplicationDetails.ts b/src/serialization/types/DeviceComponentDetailsApplicationDetails.ts index 101991653..b0c35e557 100644 --- a/src/serialization/types/DeviceComponentDetailsApplicationDetails.ts +++ b/src/serialization/types/DeviceComponentDetailsApplicationDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { ApplicationType } from "./ApplicationType"; export const DeviceComponentDetailsApplicationDetails: core.serialization.ObjectSchema< @@ -19,7 +21,7 @@ export declare namespace DeviceComponentDetailsApplicationDetails { export interface Raw { application_type?: ApplicationType.Raw | null; version?: string | null; - session_location?: (string | null | undefined) | null; - device_code_id?: (string | null | undefined) | null; + session_location?: (string | null) | null; + device_code_id?: (string | null) | null; } } diff --git a/src/serialization/types/DeviceComponentDetailsBatteryDetails.ts b/src/serialization/types/DeviceComponentDetailsBatteryDetails.ts index a84eec9f4..12e3b61d6 100644 --- a/src/serialization/types/DeviceComponentDetailsBatteryDetails.ts +++ b/src/serialization/types/DeviceComponentDetailsBatteryDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { DeviceComponentDetailsExternalPower } from "./DeviceComponentDetailsExternalPower"; export const DeviceComponentDetailsBatteryDetails: core.serialization.ObjectSchema< @@ -15,7 +17,7 @@ export const DeviceComponentDetailsBatteryDetails: core.serialization.ObjectSche export declare namespace DeviceComponentDetailsBatteryDetails { export interface Raw { - visible_percent?: (number | null | undefined) | null; + visible_percent?: (number | null) | null; external_power?: DeviceComponentDetailsExternalPower.Raw | null; } } diff --git a/src/serialization/types/DeviceComponentDetailsCardReaderDetails.ts b/src/serialization/types/DeviceComponentDetailsCardReaderDetails.ts index c572c46ae..5904dbe18 100644 --- a/src/serialization/types/DeviceComponentDetailsCardReaderDetails.ts +++ b/src/serialization/types/DeviceComponentDetailsCardReaderDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const DeviceComponentDetailsCardReaderDetails: core.serialization.ObjectSchema< serializers.DeviceComponentDetailsCardReaderDetails.Raw, diff --git a/src/serialization/types/DeviceComponentDetailsEthernetDetails.ts b/src/serialization/types/DeviceComponentDetailsEthernetDetails.ts index 84493e399..9fd0da52a 100644 --- a/src/serialization/types/DeviceComponentDetailsEthernetDetails.ts +++ b/src/serialization/types/DeviceComponentDetailsEthernetDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const DeviceComponentDetailsEthernetDetails: core.serialization.ObjectSchema< serializers.DeviceComponentDetailsEthernetDetails.Raw, @@ -10,13 +12,11 @@ export const DeviceComponentDetailsEthernetDetails: core.serialization.ObjectSch > = core.serialization.object({ active: core.serialization.boolean().optionalNullable(), ipAddressV4: core.serialization.property("ip_address_v4", core.serialization.string().optionalNullable()), - macAddress: core.serialization.property("mac_address", core.serialization.string().optionalNullable()), }); export declare namespace DeviceComponentDetailsEthernetDetails { export interface Raw { - active?: (boolean | null | undefined) | null; - ip_address_v4?: (string | null | undefined) | null; - mac_address?: (string | null | undefined) | null; + active?: (boolean | null) | null; + ip_address_v4?: (string | null) | null; } } diff --git a/src/serialization/types/DeviceComponentDetailsExternalPower.ts b/src/serialization/types/DeviceComponentDetailsExternalPower.ts index 611faef29..0f81b7fee 100644 --- a/src/serialization/types/DeviceComponentDetailsExternalPower.ts +++ b/src/serialization/types/DeviceComponentDetailsExternalPower.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const DeviceComponentDetailsExternalPower: core.serialization.Schema< serializers.DeviceComponentDetailsExternalPower.Raw, diff --git a/src/serialization/types/DeviceComponentDetailsMeasurement.ts b/src/serialization/types/DeviceComponentDetailsMeasurement.ts index d745fde92..6a6bfea0b 100644 --- a/src/serialization/types/DeviceComponentDetailsMeasurement.ts +++ b/src/serialization/types/DeviceComponentDetailsMeasurement.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const DeviceComponentDetailsMeasurement: core.serialization.ObjectSchema< serializers.DeviceComponentDetailsMeasurement.Raw, @@ -13,6 +15,6 @@ export const DeviceComponentDetailsMeasurement: core.serialization.ObjectSchema< export declare namespace DeviceComponentDetailsMeasurement { export interface Raw { - value?: (number | null | undefined) | null; + value?: (number | null) | null; } } diff --git a/src/serialization/types/DeviceComponentDetailsWiFiDetails.ts b/src/serialization/types/DeviceComponentDetailsWiFiDetails.ts index 863daea09..f8d34847c 100644 --- a/src/serialization/types/DeviceComponentDetailsWiFiDetails.ts +++ b/src/serialization/types/DeviceComponentDetailsWiFiDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { DeviceComponentDetailsMeasurement } from "./DeviceComponentDetailsMeasurement"; export const DeviceComponentDetailsWiFiDetails: core.serialization.ObjectSchema< @@ -14,16 +16,14 @@ export const DeviceComponentDetailsWiFiDetails: core.serialization.ObjectSchema< ipAddressV4: core.serialization.property("ip_address_v4", core.serialization.string().optionalNullable()), secureConnection: core.serialization.property("secure_connection", core.serialization.string().optionalNullable()), signalStrength: core.serialization.property("signal_strength", DeviceComponentDetailsMeasurement.optional()), - macAddress: core.serialization.property("mac_address", core.serialization.string().optionalNullable()), }); export declare namespace DeviceComponentDetailsWiFiDetails { export interface Raw { - active?: (boolean | null | undefined) | null; - ssid?: (string | null | undefined) | null; - ip_address_v4?: (string | null | undefined) | null; - secure_connection?: (string | null | undefined) | null; + active?: (boolean | null) | null; + ssid?: (string | null) | null; + ip_address_v4?: (string | null) | null; + secure_connection?: (string | null) | null; signal_strength?: DeviceComponentDetailsMeasurement.Raw | null; - mac_address?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/DeviceCreatedEvent.ts b/src/serialization/types/DeviceCreatedEvent.ts index 7af6c6699..2f888c6be 100644 --- a/src/serialization/types/DeviceCreatedEvent.ts +++ b/src/serialization/types/DeviceCreatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { DeviceCreatedEventData } from "./DeviceCreatedEventData"; export const DeviceCreatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const DeviceCreatedEvent: core.serialization.ObjectSchema< export declare namespace DeviceCreatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: DeviceCreatedEventData.Raw | null; } diff --git a/src/serialization/types/DeviceCreatedEventData.ts b/src/serialization/types/DeviceCreatedEventData.ts index 744f7810b..1e03bb561 100644 --- a/src/serialization/types/DeviceCreatedEventData.ts +++ b/src/serialization/types/DeviceCreatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { DeviceCreatedEventObject } from "./DeviceCreatedEventObject"; export const DeviceCreatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const DeviceCreatedEventData: core.serialization.ObjectSchema< export declare namespace DeviceCreatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: DeviceCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/DeviceCreatedEventObject.ts b/src/serialization/types/DeviceCreatedEventObject.ts index c8318c441..f4a3bde8f 100644 --- a/src/serialization/types/DeviceCreatedEventObject.ts +++ b/src/serialization/types/DeviceCreatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Device } from "./Device"; export const DeviceCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DeviceDetails.ts b/src/serialization/types/DeviceDetails.ts index 818bc0e95..569bd6b08 100644 --- a/src/serialization/types/DeviceDetails.ts +++ b/src/serialization/types/DeviceDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const DeviceDetails: core.serialization.ObjectSchema = core.serialization.object({ @@ -16,8 +18,8 @@ export const DeviceDetails: core.serialization.ObjectSchema = core.serialization.object({ @@ -34,17 +36,17 @@ export const DeviceMetadata: core.serialization.ObjectSchema = diff --git a/src/serialization/types/DeviceStatusCategory.ts b/src/serialization/types/DeviceStatusCategory.ts index 220e882b5..35f539b5b 100644 --- a/src/serialization/types/DeviceStatusCategory.ts +++ b/src/serialization/types/DeviceStatusCategory.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const DeviceStatusCategory: core.serialization.Schema< serializers.DeviceStatusCategory.Raw, diff --git a/src/serialization/types/DigitalWalletDetails.ts b/src/serialization/types/DigitalWalletDetails.ts index cb2f18027..22a338e6f 100644 --- a/src/serialization/types/DigitalWalletDetails.ts +++ b/src/serialization/types/DigitalWalletDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CashAppDetails } from "./CashAppDetails"; export const DigitalWalletDetails: core.serialization.ObjectSchema< @@ -16,8 +18,8 @@ export const DigitalWalletDetails: core.serialization.ObjectSchema< export declare namespace DigitalWalletDetails { export interface Raw { - status?: (string | null | undefined) | null; - brand?: (string | null | undefined) | null; + status?: (string | null) | null; + brand?: (string | null) | null; cash_app_details?: CashAppDetails.Raw | null; } } diff --git a/src/serialization/types/DisableCardResponse.ts b/src/serialization/types/DisableCardResponse.ts index 272d8726a..9b0895fff 100644 --- a/src/serialization/types/DisableCardResponse.ts +++ b/src/serialization/types/DisableCardResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Card } from "./Card"; import { Error_ } from "./Error_"; +import { Card } from "./Card"; export const DisableCardResponse: core.serialization.ObjectSchema< serializers.DisableCardResponse.Raw, diff --git a/src/serialization/types/DisableEventsResponse.ts b/src/serialization/types/DisableEventsResponse.ts index e5d7bb3c2..c00d6bce6 100644 --- a/src/serialization/types/DisableEventsResponse.ts +++ b/src/serialization/types/DisableEventsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const DisableEventsResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DismissTerminalActionResponse.ts b/src/serialization/types/DismissTerminalActionResponse.ts index 7af9353a4..31c15cb00 100644 --- a/src/serialization/types/DismissTerminalActionResponse.ts +++ b/src/serialization/types/DismissTerminalActionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalAction } from "./TerminalAction"; diff --git a/src/serialization/types/DismissTerminalCheckoutResponse.ts b/src/serialization/types/DismissTerminalCheckoutResponse.ts index 23d87fa94..355ace5b7 100644 --- a/src/serialization/types/DismissTerminalCheckoutResponse.ts +++ b/src/serialization/types/DismissTerminalCheckoutResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalCheckout } from "./TerminalCheckout"; diff --git a/src/serialization/types/DismissTerminalRefundResponse.ts b/src/serialization/types/DismissTerminalRefundResponse.ts index d28bd33b7..533b62e3a 100644 --- a/src/serialization/types/DismissTerminalRefundResponse.ts +++ b/src/serialization/types/DismissTerminalRefundResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalRefund } from "./TerminalRefund"; diff --git a/src/serialization/types/Dispute.ts b/src/serialization/types/Dispute.ts index 379b04da4..bff1b3f70 100644 --- a/src/serialization/types/Dispute.ts +++ b/src/serialization/types/Dispute.ts @@ -1,13 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { CardBrand } from "./CardBrand"; -import { DisputedPayment } from "./DisputedPayment"; +import { Money } from "./Money"; import { DisputeReason } from "./DisputeReason"; import { DisputeState } from "./DisputeState"; -import { Money } from "./Money"; +import { DisputedPayment } from "./DisputedPayment"; +import { CardBrand } from "./CardBrand"; export const Dispute: core.serialization.ObjectSchema = core.serialization.object({ @@ -34,21 +36,21 @@ export const Dispute: core.serialization.ObjectSchema = core.serialization.enum_([ diff --git a/src/serialization/types/DisputeState.ts b/src/serialization/types/DisputeState.ts index fd46f43eb..815e152bd 100644 --- a/src/serialization/types/DisputeState.ts +++ b/src/serialization/types/DisputeState.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const DisputeState: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/DisputeStateChangedEvent.ts b/src/serialization/types/DisputeStateChangedEvent.ts index 9ce0a10e9..39ef9cf13 100644 --- a/src/serialization/types/DisputeStateChangedEvent.ts +++ b/src/serialization/types/DisputeStateChangedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { DisputeStateChangedEventData } from "./DisputeStateChangedEventData"; export const DisputeStateChangedEvent: core.serialization.ObjectSchema< @@ -19,10 +21,10 @@ export const DisputeStateChangedEvent: core.serialization.ObjectSchema< export declare namespace DisputeStateChangedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - location_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + location_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: DisputeStateChangedEventData.Raw | null; } diff --git a/src/serialization/types/DisputeStateChangedEventData.ts b/src/serialization/types/DisputeStateChangedEventData.ts index 3276c853c..48c566bae 100644 --- a/src/serialization/types/DisputeStateChangedEventData.ts +++ b/src/serialization/types/DisputeStateChangedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { DisputeStateChangedEventObject } from "./DisputeStateChangedEventObject"; export const DisputeStateChangedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const DisputeStateChangedEventData: core.serialization.ObjectSchema< export declare namespace DisputeStateChangedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: DisputeStateChangedEventObject.Raw | null; } diff --git a/src/serialization/types/DisputeStateChangedEventObject.ts b/src/serialization/types/DisputeStateChangedEventObject.ts index e2a52d0c7..9384df171 100644 --- a/src/serialization/types/DisputeStateChangedEventObject.ts +++ b/src/serialization/types/DisputeStateChangedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Dispute } from "./Dispute"; export const DisputeStateChangedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DisputeStateUpdatedEvent.ts b/src/serialization/types/DisputeStateUpdatedEvent.ts index 88189017c..7c05a6f04 100644 --- a/src/serialization/types/DisputeStateUpdatedEvent.ts +++ b/src/serialization/types/DisputeStateUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { DisputeStateUpdatedEventData } from "./DisputeStateUpdatedEventData"; export const DisputeStateUpdatedEvent: core.serialization.ObjectSchema< @@ -19,10 +21,10 @@ export const DisputeStateUpdatedEvent: core.serialization.ObjectSchema< export declare namespace DisputeStateUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - location_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + location_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: DisputeStateUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/DisputeStateUpdatedEventData.ts b/src/serialization/types/DisputeStateUpdatedEventData.ts index 754d1f7a8..ff28f07a8 100644 --- a/src/serialization/types/DisputeStateUpdatedEventData.ts +++ b/src/serialization/types/DisputeStateUpdatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { DisputeStateUpdatedEventObject } from "./DisputeStateUpdatedEventObject"; export const DisputeStateUpdatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const DisputeStateUpdatedEventData: core.serialization.ObjectSchema< export declare namespace DisputeStateUpdatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: DisputeStateUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/DisputeStateUpdatedEventObject.ts b/src/serialization/types/DisputeStateUpdatedEventObject.ts index cc2901cda..4bd6d4d02 100644 --- a/src/serialization/types/DisputeStateUpdatedEventObject.ts +++ b/src/serialization/types/DisputeStateUpdatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Dispute } from "./Dispute"; export const DisputeStateUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/DisputedPayment.ts b/src/serialization/types/DisputedPayment.ts index 4088af7ab..5c0798547 100644 --- a/src/serialization/types/DisputedPayment.ts +++ b/src/serialization/types/DisputedPayment.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const DisputedPayment: core.serialization.ObjectSchema = core.serialization.object({ @@ -11,6 +13,6 @@ export const DisputedPayment: core.serialization.ObjectSchema = core.serialization.enum_(["UNINDEXED", "UNAVAILABLE", "HIDDEN", "VISIBLE"]); diff --git a/src/serialization/types/Employee.ts b/src/serialization/types/Employee.ts index 7dbe7f0a7..860e08f00 100644 --- a/src/serialization/types/Employee.ts +++ b/src/serialization/types/Employee.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { EmployeeStatus } from "./EmployeeStatus"; export const Employee: core.serialization.ObjectSchema = @@ -25,13 +27,13 @@ export const Employee: core.serialization.ObjectSchema = core.serialization.enum_(["ACTIVE", "INACTIVE"]); diff --git a/src/serialization/types/EmployeeWage.ts b/src/serialization/types/EmployeeWage.ts index 0c1c8be2d..14437ed3b 100644 --- a/src/serialization/types/EmployeeWage.ts +++ b/src/serialization/types/EmployeeWage.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const EmployeeWage: core.serialization.ObjectSchema = @@ -16,8 +18,8 @@ export const EmployeeWage: core.serialization.ObjectSchema = core.serialization.enum_([ diff --git a/src/serialization/types/ErrorCode.ts b/src/serialization/types/ErrorCode.ts index 7f3267bff..ffbff6731 100644 --- a/src/serialization/types/ErrorCode.ts +++ b/src/serialization/types/ErrorCode.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ErrorCode: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/Error_.ts b/src/serialization/types/Error_.ts index e8c1212e8..00b51db34 100644 --- a/src/serialization/types/Error_.ts +++ b/src/serialization/types/Error_.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { ErrorCategory } from "./ErrorCategory"; import { ErrorCode } from "./ErrorCode"; diff --git a/src/serialization/types/Event.ts b/src/serialization/types/Event.ts index c00dec3af..4c24c847c 100644 --- a/src/serialization/types/Event.ts +++ b/src/serialization/types/Event.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { EventData } from "./EventData"; export const Event: core.serialization.ObjectSchema = core.serialization.object({ @@ -16,10 +18,10 @@ export const Event: core.serialization.ObjectSchema = core.serialization.object({ @@ -14,9 +16,9 @@ export const EventData: core.serialization.ObjectSchema | null | undefined) | null; + deleted?: (boolean | null) | null; + object?: (Record | null) | null; } } diff --git a/src/serialization/types/EventMetadata.ts b/src/serialization/types/EventMetadata.ts index f7374a432..6e97d0967 100644 --- a/src/serialization/types/EventMetadata.ts +++ b/src/serialization/types/EventMetadata.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const EventMetadata: core.serialization.ObjectSchema = core.serialization.object({ @@ -12,7 +14,7 @@ export const EventMetadata: core.serialization.ObjectSchema = core.serialization.enum_(["LEAST_EXPENSIVE", "MOST_EXPENSIVE"]); diff --git a/src/serialization/types/ExternalPaymentDetails.ts b/src/serialization/types/ExternalPaymentDetails.ts index 8e8281bc7..957fe6370 100644 --- a/src/serialization/types/ExternalPaymentDetails.ts +++ b/src/serialization/types/ExternalPaymentDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const ExternalPaymentDetails: core.serialization.ObjectSchema< @@ -19,7 +21,7 @@ export declare namespace ExternalPaymentDetails { export interface Raw { type: string; source: string; - source_id?: (string | null | undefined) | null; + source_id?: (string | null) | null; source_fee_money?: Money.Raw | null; } } diff --git a/src/serialization/types/FilterValue.ts b/src/serialization/types/FilterValue.ts index 17934a5a4..b16ce73bd 100644 --- a/src/serialization/types/FilterValue.ts +++ b/src/serialization/types/FilterValue.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const FilterValue: core.serialization.ObjectSchema = core.serialization.object({ @@ -13,8 +15,8 @@ export const FilterValue: core.serialization.ObjectSchema = core.serialization.object({ @@ -31,12 +33,12 @@ export const Fulfillment: core.serialization.ObjectSchema | null | undefined) | null; + metadata?: (Record | null) | null; pickup_details?: FulfillmentPickupDetails.Raw | null; shipment_details?: FulfillmentShipmentDetails.Raw | null; delivery_details?: FulfillmentDeliveryDetails.Raw | null; diff --git a/src/serialization/types/FulfillmentDeliveryDetails.ts b/src/serialization/types/FulfillmentDeliveryDetails.ts index 3980933f8..fc6a290f3 100644 --- a/src/serialization/types/FulfillmentDeliveryDetails.ts +++ b/src/serialization/types/FulfillmentDeliveryDetails.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType } from "./FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType"; import { FulfillmentRecipient } from "./FulfillmentRecipient"; +import { FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType } from "./FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType"; export const FulfillmentDeliveryDetails: core.serialization.ObjectSchema< serializers.FulfillmentDeliveryDetails.Raw, @@ -61,25 +63,25 @@ export declare namespace FulfillmentDeliveryDetails { recipient?: FulfillmentRecipient.Raw | null; schedule_type?: FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.Raw | null; placed_at?: string | null; - deliver_at?: (string | null | undefined) | null; - prep_time_duration?: (string | null | undefined) | null; - delivery_window_duration?: (string | null | undefined) | null; - note?: (string | null | undefined) | null; - completed_at?: (string | null | undefined) | null; + deliver_at?: (string | null) | null; + prep_time_duration?: (string | null) | null; + delivery_window_duration?: (string | null) | null; + note?: (string | null) | null; + completed_at?: (string | null) | null; in_progress_at?: string | null; rejected_at?: string | null; ready_at?: string | null; delivered_at?: string | null; canceled_at?: string | null; - cancel_reason?: (string | null | undefined) | null; - courier_pickup_at?: (string | null | undefined) | null; - courier_pickup_window_duration?: (string | null | undefined) | null; - is_no_contact_delivery?: (boolean | null | undefined) | null; - dropoff_notes?: (string | null | undefined) | null; - courier_provider_name?: (string | null | undefined) | null; - courier_support_phone_number?: (string | null | undefined) | null; - square_delivery_id?: (string | null | undefined) | null; - external_delivery_id?: (string | null | undefined) | null; - managed_delivery?: (boolean | null | undefined) | null; + cancel_reason?: (string | null) | null; + courier_pickup_at?: (string | null) | null; + courier_pickup_window_duration?: (string | null) | null; + is_no_contact_delivery?: (boolean | null) | null; + dropoff_notes?: (string | null) | null; + courier_provider_name?: (string | null) | null; + courier_support_phone_number?: (string | null) | null; + square_delivery_id?: (string | null) | null; + external_delivery_id?: (string | null) | null; + managed_delivery?: (boolean | null) | null; } } diff --git a/src/serialization/types/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.ts b/src/serialization/types/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.ts index 3d276df83..dd1d97b1e 100644 --- a/src/serialization/types/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.ts +++ b/src/serialization/types/FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType: core.serialization.Schema< serializers.FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType.Raw, diff --git a/src/serialization/types/FulfillmentFulfillmentEntry.ts b/src/serialization/types/FulfillmentFulfillmentEntry.ts index bcefb9b10..da586b64f 100644 --- a/src/serialization/types/FulfillmentFulfillmentEntry.ts +++ b/src/serialization/types/FulfillmentFulfillmentEntry.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const FulfillmentFulfillmentEntry: core.serialization.ObjectSchema< serializers.FulfillmentFulfillmentEntry.Raw, @@ -18,9 +20,9 @@ export const FulfillmentFulfillmentEntry: core.serialization.ObjectSchema< export declare namespace FulfillmentFulfillmentEntry { export interface Raw { - uid?: (string | null | undefined) | null; + uid?: (string | null) | null; line_item_uid: string; quantity: string; - metadata?: (Record | null | undefined) | null; + metadata?: (Record | null) | null; } } diff --git a/src/serialization/types/FulfillmentFulfillmentLineItemApplication.ts b/src/serialization/types/FulfillmentFulfillmentLineItemApplication.ts index 70b06c255..0a3c8ab9e 100644 --- a/src/serialization/types/FulfillmentFulfillmentLineItemApplication.ts +++ b/src/serialization/types/FulfillmentFulfillmentLineItemApplication.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const FulfillmentFulfillmentLineItemApplication: core.serialization.Schema< serializers.FulfillmentFulfillmentLineItemApplication.Raw, diff --git a/src/serialization/types/FulfillmentPickupDetails.ts b/src/serialization/types/FulfillmentPickupDetails.ts index 51a6310cd..f88d88241 100644 --- a/src/serialization/types/FulfillmentPickupDetails.ts +++ b/src/serialization/types/FulfillmentPickupDetails.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { FulfillmentPickupDetailsCurbsidePickupDetails } from "./FulfillmentPickupDetailsCurbsidePickupDetails"; -import { FulfillmentPickupDetailsScheduleType } from "./FulfillmentPickupDetailsScheduleType"; import { FulfillmentRecipient } from "./FulfillmentRecipient"; +import { FulfillmentPickupDetailsScheduleType } from "./FulfillmentPickupDetailsScheduleType"; +import { FulfillmentPickupDetailsCurbsidePickupDetails } from "./FulfillmentPickupDetailsCurbsidePickupDetails"; export const FulfillmentPickupDetails: core.serialization.ObjectSchema< serializers.FulfillmentPickupDetails.Raw, @@ -46,13 +48,13 @@ export const FulfillmentPickupDetails: core.serialization.ObjectSchema< export declare namespace FulfillmentPickupDetails { export interface Raw { recipient?: FulfillmentRecipient.Raw | null; - expires_at?: (string | null | undefined) | null; - auto_complete_duration?: (string | null | undefined) | null; + expires_at?: (string | null) | null; + auto_complete_duration?: (string | null) | null; schedule_type?: FulfillmentPickupDetailsScheduleType.Raw | null; - pickup_at?: (string | null | undefined) | null; - pickup_window_duration?: (string | null | undefined) | null; - prep_time_duration?: (string | null | undefined) | null; - note?: (string | null | undefined) | null; + pickup_at?: (string | null) | null; + pickup_window_duration?: (string | null) | null; + prep_time_duration?: (string | null) | null; + note?: (string | null) | null; placed_at?: string | null; accepted_at?: string | null; rejected_at?: string | null; @@ -60,8 +62,8 @@ export declare namespace FulfillmentPickupDetails { expired_at?: string | null; picked_up_at?: string | null; canceled_at?: string | null; - cancel_reason?: (string | null | undefined) | null; - is_curbside_pickup?: (boolean | null | undefined) | null; + cancel_reason?: (string | null) | null; + is_curbside_pickup?: (boolean | null) | null; curbside_pickup_details?: FulfillmentPickupDetailsCurbsidePickupDetails.Raw | null; } } diff --git a/src/serialization/types/FulfillmentPickupDetailsCurbsidePickupDetails.ts b/src/serialization/types/FulfillmentPickupDetailsCurbsidePickupDetails.ts index ed06beb55..ce8f1eb19 100644 --- a/src/serialization/types/FulfillmentPickupDetailsCurbsidePickupDetails.ts +++ b/src/serialization/types/FulfillmentPickupDetailsCurbsidePickupDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const FulfillmentPickupDetailsCurbsidePickupDetails: core.serialization.ObjectSchema< serializers.FulfillmentPickupDetailsCurbsidePickupDetails.Raw, @@ -14,7 +16,7 @@ export const FulfillmentPickupDetailsCurbsidePickupDetails: core.serialization.O export declare namespace FulfillmentPickupDetailsCurbsidePickupDetails { export interface Raw { - curbside_details?: (string | null | undefined) | null; - buyer_arrived_at?: (string | null | undefined) | null; + curbside_details?: (string | null) | null; + buyer_arrived_at?: (string | null) | null; } } diff --git a/src/serialization/types/FulfillmentPickupDetailsScheduleType.ts b/src/serialization/types/FulfillmentPickupDetailsScheduleType.ts index 65a9528e9..1d5ad7e9b 100644 --- a/src/serialization/types/FulfillmentPickupDetailsScheduleType.ts +++ b/src/serialization/types/FulfillmentPickupDetailsScheduleType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const FulfillmentPickupDetailsScheduleType: core.serialization.Schema< serializers.FulfillmentPickupDetailsScheduleType.Raw, diff --git a/src/serialization/types/FulfillmentRecipient.ts b/src/serialization/types/FulfillmentRecipient.ts index 32b327644..43148eacb 100644 --- a/src/serialization/types/FulfillmentRecipient.ts +++ b/src/serialization/types/FulfillmentRecipient.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Address } from "./Address"; export const FulfillmentRecipient: core.serialization.ObjectSchema< @@ -18,10 +20,10 @@ export const FulfillmentRecipient: core.serialization.ObjectSchema< export declare namespace FulfillmentRecipient { export interface Raw { - customer_id?: (string | null | undefined) | null; - display_name?: (string | null | undefined) | null; - email_address?: (string | null | undefined) | null; - phone_number?: (string | null | undefined) | null; + customer_id?: (string | null) | null; + display_name?: (string | null) | null; + email_address?: (string | null) | null; + phone_number?: (string | null) | null; address?: Address.Raw | null; } } diff --git a/src/serialization/types/FulfillmentShipmentDetails.ts b/src/serialization/types/FulfillmentShipmentDetails.ts index a67791df3..b79f6229d 100644 --- a/src/serialization/types/FulfillmentShipmentDetails.ts +++ b/src/serialization/types/FulfillmentShipmentDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { FulfillmentRecipient } from "./FulfillmentRecipient"; export const FulfillmentShipmentDetails: core.serialization.ObjectSchema< @@ -32,19 +34,19 @@ export const FulfillmentShipmentDetails: core.serialization.ObjectSchema< export declare namespace FulfillmentShipmentDetails { export interface Raw { recipient?: FulfillmentRecipient.Raw | null; - carrier?: (string | null | undefined) | null; - shipping_note?: (string | null | undefined) | null; - shipping_type?: (string | null | undefined) | null; - tracking_number?: (string | null | undefined) | null; - tracking_url?: (string | null | undefined) | null; + carrier?: (string | null) | null; + shipping_note?: (string | null) | null; + shipping_type?: (string | null) | null; + tracking_number?: (string | null) | null; + tracking_url?: (string | null) | null; placed_at?: string | null; in_progress_at?: string | null; packaged_at?: string | null; - expected_shipped_at?: (string | null | undefined) | null; + expected_shipped_at?: (string | null) | null; shipped_at?: string | null; - canceled_at?: (string | null | undefined) | null; - cancel_reason?: (string | null | undefined) | null; + canceled_at?: (string | null) | null; + cancel_reason?: (string | null) | null; failed_at?: string | null; - failure_reason?: (string | null | undefined) | null; + failure_reason?: (string | null) | null; } } diff --git a/src/serialization/types/FulfillmentState.ts b/src/serialization/types/FulfillmentState.ts index 5b40133bd..d624ac9e3 100644 --- a/src/serialization/types/FulfillmentState.ts +++ b/src/serialization/types/FulfillmentState.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const FulfillmentState: core.serialization.Schema = core.serialization.enum_(["PROPOSED", "RESERVED", "PREPARED", "COMPLETED", "CANCELED", "FAILED"]); diff --git a/src/serialization/types/FulfillmentType.ts b/src/serialization/types/FulfillmentType.ts index 049042b57..88783a472 100644 --- a/src/serialization/types/FulfillmentType.ts +++ b/src/serialization/types/FulfillmentType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const FulfillmentType: core.serialization.Schema = core.serialization.enum_(["PICKUP", "SHIPMENT", "DELIVERY"]); diff --git a/src/serialization/types/GetBankAccountByV1IdResponse.ts b/src/serialization/types/GetBankAccountByV1IdResponse.ts index 207f7cffe..f4c5e2568 100644 --- a/src/serialization/types/GetBankAccountByV1IdResponse.ts +++ b/src/serialization/types/GetBankAccountByV1IdResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { BankAccount } from "./BankAccount"; import { Error_ } from "./Error_"; +import { BankAccount } from "./BankAccount"; export const GetBankAccountByV1IdResponse: core.serialization.ObjectSchema< serializers.GetBankAccountByV1IdResponse.Raw, diff --git a/src/serialization/types/GetBankAccountResponse.ts b/src/serialization/types/GetBankAccountResponse.ts index 2d2bc324e..cb4e4e99d 100644 --- a/src/serialization/types/GetBankAccountResponse.ts +++ b/src/serialization/types/GetBankAccountResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { BankAccount } from "./BankAccount"; import { Error_ } from "./Error_"; +import { BankAccount } from "./BankAccount"; export const GetBankAccountResponse: core.serialization.ObjectSchema< serializers.GetBankAccountResponse.Raw, diff --git a/src/serialization/types/GetBookingRequest.ts b/src/serialization/types/GetBookingRequest.ts index aa5f5c8d5..d408951cc 100644 --- a/src/serialization/types/GetBookingRequest.ts +++ b/src/serialization/types/GetBookingRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetBookingRequest: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/GetBookingResponse.ts b/src/serialization/types/GetBookingResponse.ts index d950d35a3..2a90fa6d8 100644 --- a/src/serialization/types/GetBookingResponse.ts +++ b/src/serialization/types/GetBookingResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Booking } from "./Booking"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/GetBreakTypeResponse.ts b/src/serialization/types/GetBreakTypeResponse.ts index 5381c3001..026c809cc 100644 --- a/src/serialization/types/GetBreakTypeResponse.ts +++ b/src/serialization/types/GetBreakTypeResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BreakType } from "./BreakType"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/GetBusinessBookingProfileRequest.ts b/src/serialization/types/GetBusinessBookingProfileRequest.ts index 02ab5cf13..26bfcf738 100644 --- a/src/serialization/types/GetBusinessBookingProfileRequest.ts +++ b/src/serialization/types/GetBusinessBookingProfileRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetBusinessBookingProfileRequest: core.serialization.Schema< serializers.GetBusinessBookingProfileRequest.Raw, diff --git a/src/serialization/types/GetBusinessBookingProfileResponse.ts b/src/serialization/types/GetBusinessBookingProfileResponse.ts index aa8b35013..9c7bd48c6 100644 --- a/src/serialization/types/GetBusinessBookingProfileResponse.ts +++ b/src/serialization/types/GetBusinessBookingProfileResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BusinessBookingProfile } from "./BusinessBookingProfile"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/GetCardRequest.ts b/src/serialization/types/GetCardRequest.ts index fe2460dd5..12ae29f20 100644 --- a/src/serialization/types/GetCardRequest.ts +++ b/src/serialization/types/GetCardRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetCardRequest: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/GetCardResponse.ts b/src/serialization/types/GetCardResponse.ts index 688735618..4f32f7c94 100644 --- a/src/serialization/types/GetCardResponse.ts +++ b/src/serialization/types/GetCardResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Card } from "./Card"; import { Error_ } from "./Error_"; +import { Card } from "./Card"; export const GetCardResponse: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/GetCashDrawerShiftResponse.ts b/src/serialization/types/GetCashDrawerShiftResponse.ts index 2163cd7ff..7dbb57527 100644 --- a/src/serialization/types/GetCashDrawerShiftResponse.ts +++ b/src/serialization/types/GetCashDrawerShiftResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CashDrawerShift } from "./CashDrawerShift"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/GetCatalogObjectResponse.ts b/src/serialization/types/GetCatalogObjectResponse.ts index b6a7cfecc..bfaac4ff3 100644 --- a/src/serialization/types/GetCatalogObjectResponse.ts +++ b/src/serialization/types/GetCatalogObjectResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; -import * as core from "../../core"; import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; import { Error_ } from "./Error_"; export const GetCatalogObjectResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GetCustomerCustomAttributeDefinitionResponse.ts b/src/serialization/types/GetCustomerCustomAttributeDefinitionResponse.ts index 6059a67a1..1472950ac 100644 --- a/src/serialization/types/GetCustomerCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/GetCustomerCustomAttributeDefinitionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/GetCustomerCustomAttributeResponse.ts b/src/serialization/types/GetCustomerCustomAttributeResponse.ts index ce2f98b7f..b927cf0fa 100644 --- a/src/serialization/types/GetCustomerCustomAttributeResponse.ts +++ b/src/serialization/types/GetCustomerCustomAttributeResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/GetCustomerGroupRequest.ts b/src/serialization/types/GetCustomerGroupRequest.ts index 7cf623abb..f4dfa52b9 100644 --- a/src/serialization/types/GetCustomerGroupRequest.ts +++ b/src/serialization/types/GetCustomerGroupRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetCustomerGroupRequest: core.serialization.Schema< serializers.GetCustomerGroupRequest.Raw, diff --git a/src/serialization/types/GetCustomerGroupResponse.ts b/src/serialization/types/GetCustomerGroupResponse.ts index 1bd8a0d56..a7006053f 100644 --- a/src/serialization/types/GetCustomerGroupResponse.ts +++ b/src/serialization/types/GetCustomerGroupResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { CustomerGroup } from "./CustomerGroup"; import { Error_ } from "./Error_"; +import { CustomerGroup } from "./CustomerGroup"; export const GetCustomerGroupResponse: core.serialization.ObjectSchema< serializers.GetCustomerGroupResponse.Raw, diff --git a/src/serialization/types/GetCustomerRequest.ts b/src/serialization/types/GetCustomerRequest.ts index bc9d98057..8526416bd 100644 --- a/src/serialization/types/GetCustomerRequest.ts +++ b/src/serialization/types/GetCustomerRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetCustomerRequest: core.serialization.Schema< serializers.GetCustomerRequest.Raw, diff --git a/src/serialization/types/GetCustomerResponse.ts b/src/serialization/types/GetCustomerResponse.ts index 37db6b63a..f590308e1 100644 --- a/src/serialization/types/GetCustomerResponse.ts +++ b/src/serialization/types/GetCustomerResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Customer } from "./Customer"; import { Error_ } from "./Error_"; +import { Customer } from "./Customer"; export const GetCustomerResponse: core.serialization.ObjectSchema< serializers.GetCustomerResponse.Raw, diff --git a/src/serialization/types/GetCustomerSegmentRequest.ts b/src/serialization/types/GetCustomerSegmentRequest.ts index fc9d6ed21..c247de446 100644 --- a/src/serialization/types/GetCustomerSegmentRequest.ts +++ b/src/serialization/types/GetCustomerSegmentRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetCustomerSegmentRequest: core.serialization.Schema< serializers.GetCustomerSegmentRequest.Raw, diff --git a/src/serialization/types/GetCustomerSegmentResponse.ts b/src/serialization/types/GetCustomerSegmentResponse.ts index f08dfb59d..40aa558b5 100644 --- a/src/serialization/types/GetCustomerSegmentResponse.ts +++ b/src/serialization/types/GetCustomerSegmentResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { CustomerSegment } from "./CustomerSegment"; import { Error_ } from "./Error_"; +import { CustomerSegment } from "./CustomerSegment"; export const GetCustomerSegmentResponse: core.serialization.ObjectSchema< serializers.GetCustomerSegmentResponse.Raw, diff --git a/src/serialization/types/GetDeviceCodeResponse.ts b/src/serialization/types/GetDeviceCodeResponse.ts index 89a5ecc15..ce9400994 100644 --- a/src/serialization/types/GetDeviceCodeResponse.ts +++ b/src/serialization/types/GetDeviceCodeResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { DeviceCode } from "./DeviceCode"; import { Error_ } from "./Error_"; +import { DeviceCode } from "./DeviceCode"; export const GetDeviceCodeResponse: core.serialization.ObjectSchema< serializers.GetDeviceCodeResponse.Raw, diff --git a/src/serialization/types/GetDeviceResponse.ts b/src/serialization/types/GetDeviceResponse.ts index 0dd6da898..0de28714a 100644 --- a/src/serialization/types/GetDeviceResponse.ts +++ b/src/serialization/types/GetDeviceResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Device } from "./Device"; import { Error_ } from "./Error_"; +import { Device } from "./Device"; export const GetDeviceResponse: core.serialization.ObjectSchema< serializers.GetDeviceResponse.Raw, diff --git a/src/serialization/types/GetDisputeEvidenceRequest.ts b/src/serialization/types/GetDisputeEvidenceRequest.ts index 313fb8ace..63effcd24 100644 --- a/src/serialization/types/GetDisputeEvidenceRequest.ts +++ b/src/serialization/types/GetDisputeEvidenceRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetDisputeEvidenceRequest: core.serialization.Schema< serializers.GetDisputeEvidenceRequest.Raw, diff --git a/src/serialization/types/GetDisputeEvidenceResponse.ts b/src/serialization/types/GetDisputeEvidenceResponse.ts index b029ce773..df9d25569 100644 --- a/src/serialization/types/GetDisputeEvidenceResponse.ts +++ b/src/serialization/types/GetDisputeEvidenceResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { DisputeEvidence } from "./DisputeEvidence"; import { Error_ } from "./Error_"; +import { DisputeEvidence } from "./DisputeEvidence"; export const GetDisputeEvidenceResponse: core.serialization.ObjectSchema< serializers.GetDisputeEvidenceResponse.Raw, diff --git a/src/serialization/types/GetDisputeRequest.ts b/src/serialization/types/GetDisputeRequest.ts index 7633de060..e8d3f5ce1 100644 --- a/src/serialization/types/GetDisputeRequest.ts +++ b/src/serialization/types/GetDisputeRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetDisputeRequest: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/GetDisputeResponse.ts b/src/serialization/types/GetDisputeResponse.ts index 44660732c..182b44846 100644 --- a/src/serialization/types/GetDisputeResponse.ts +++ b/src/serialization/types/GetDisputeResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Dispute } from "./Dispute"; import { Error_ } from "./Error_"; +import { Dispute } from "./Dispute"; export const GetDisputeResponse: core.serialization.ObjectSchema< serializers.GetDisputeResponse.Raw, diff --git a/src/serialization/types/GetEmployeeRequest.ts b/src/serialization/types/GetEmployeeRequest.ts index 9f662a9be..136c96bbe 100644 --- a/src/serialization/types/GetEmployeeRequest.ts +++ b/src/serialization/types/GetEmployeeRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetEmployeeRequest: core.serialization.Schema< serializers.GetEmployeeRequest.Raw, diff --git a/src/serialization/types/GetEmployeeResponse.ts b/src/serialization/types/GetEmployeeResponse.ts index fea595974..268f84fc5 100644 --- a/src/serialization/types/GetEmployeeResponse.ts +++ b/src/serialization/types/GetEmployeeResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Employee } from "./Employee"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/GetEmployeeWageResponse.ts b/src/serialization/types/GetEmployeeWageResponse.ts index ae9dc566c..5181efdb6 100644 --- a/src/serialization/types/GetEmployeeWageResponse.ts +++ b/src/serialization/types/GetEmployeeWageResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { EmployeeWage } from "./EmployeeWage"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/GetGiftCardFromGanResponse.ts b/src/serialization/types/GetGiftCardFromGanResponse.ts index 4925b3682..cf88fa9ad 100644 --- a/src/serialization/types/GetGiftCardFromGanResponse.ts +++ b/src/serialization/types/GetGiftCardFromGanResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { GiftCard } from "./GiftCard"; diff --git a/src/serialization/types/GetGiftCardFromNonceResponse.ts b/src/serialization/types/GetGiftCardFromNonceResponse.ts index 3e3213606..242d8b966 100644 --- a/src/serialization/types/GetGiftCardFromNonceResponse.ts +++ b/src/serialization/types/GetGiftCardFromNonceResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { GiftCard } from "./GiftCard"; diff --git a/src/serialization/types/GetGiftCardRequest.ts b/src/serialization/types/GetGiftCardRequest.ts index 4730ba070..3c705f1c6 100644 --- a/src/serialization/types/GetGiftCardRequest.ts +++ b/src/serialization/types/GetGiftCardRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetGiftCardRequest: core.serialization.Schema< serializers.GetGiftCardRequest.Raw, diff --git a/src/serialization/types/GetGiftCardResponse.ts b/src/serialization/types/GetGiftCardResponse.ts index 8c4eaf1df..467a46cc0 100644 --- a/src/serialization/types/GetGiftCardResponse.ts +++ b/src/serialization/types/GetGiftCardResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { GiftCard } from "./GiftCard"; diff --git a/src/serialization/types/GetInventoryAdjustmentRequest.ts b/src/serialization/types/GetInventoryAdjustmentRequest.ts index 78061be14..4902f518c 100644 --- a/src/serialization/types/GetInventoryAdjustmentRequest.ts +++ b/src/serialization/types/GetInventoryAdjustmentRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetInventoryAdjustmentRequest: core.serialization.Schema< serializers.GetInventoryAdjustmentRequest.Raw, diff --git a/src/serialization/types/GetInventoryAdjustmentResponse.ts b/src/serialization/types/GetInventoryAdjustmentResponse.ts index 8d797b655..74163baa7 100644 --- a/src/serialization/types/GetInventoryAdjustmentResponse.ts +++ b/src/serialization/types/GetInventoryAdjustmentResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { InventoryAdjustment } from "./InventoryAdjustment"; diff --git a/src/serialization/types/GetInventoryChangesResponse.ts b/src/serialization/types/GetInventoryChangesResponse.ts index 22249f5fa..1c75db603 100644 --- a/src/serialization/types/GetInventoryChangesResponse.ts +++ b/src/serialization/types/GetInventoryChangesResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { InventoryChange } from "./InventoryChange"; diff --git a/src/serialization/types/GetInventoryCountResponse.ts b/src/serialization/types/GetInventoryCountResponse.ts index e2eaa127f..f9f487d37 100644 --- a/src/serialization/types/GetInventoryCountResponse.ts +++ b/src/serialization/types/GetInventoryCountResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { InventoryCount } from "./InventoryCount"; diff --git a/src/serialization/types/GetInventoryPhysicalCountRequest.ts b/src/serialization/types/GetInventoryPhysicalCountRequest.ts index 642d5ce9c..0df7bf141 100644 --- a/src/serialization/types/GetInventoryPhysicalCountRequest.ts +++ b/src/serialization/types/GetInventoryPhysicalCountRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetInventoryPhysicalCountRequest: core.serialization.Schema< serializers.GetInventoryPhysicalCountRequest.Raw, diff --git a/src/serialization/types/GetInventoryPhysicalCountResponse.ts b/src/serialization/types/GetInventoryPhysicalCountResponse.ts index 59fec0f1a..74e4f9b41 100644 --- a/src/serialization/types/GetInventoryPhysicalCountResponse.ts +++ b/src/serialization/types/GetInventoryPhysicalCountResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { InventoryPhysicalCount } from "./InventoryPhysicalCount"; diff --git a/src/serialization/types/GetInventoryTransferRequest.ts b/src/serialization/types/GetInventoryTransferRequest.ts index 8b0dc78bf..7d7383fce 100644 --- a/src/serialization/types/GetInventoryTransferRequest.ts +++ b/src/serialization/types/GetInventoryTransferRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetInventoryTransferRequest: core.serialization.Schema< serializers.GetInventoryTransferRequest.Raw, diff --git a/src/serialization/types/GetInventoryTransferResponse.ts b/src/serialization/types/GetInventoryTransferResponse.ts index e0dfe3168..2094d9103 100644 --- a/src/serialization/types/GetInventoryTransferResponse.ts +++ b/src/serialization/types/GetInventoryTransferResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { InventoryTransfer } from "./InventoryTransfer"; diff --git a/src/serialization/types/GetInvoiceResponse.ts b/src/serialization/types/GetInvoiceResponse.ts index d96701e49..038461e76 100644 --- a/src/serialization/types/GetInvoiceResponse.ts +++ b/src/serialization/types/GetInvoiceResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Invoice } from "./Invoice"; +import { Error_ } from "./Error_"; export const GetInvoiceResponse: core.serialization.ObjectSchema< serializers.GetInvoiceResponse.Raw, diff --git a/src/serialization/types/GetLocationRequest.ts b/src/serialization/types/GetLocationRequest.ts index 8e0c39a11..461c0c8cc 100644 --- a/src/serialization/types/GetLocationRequest.ts +++ b/src/serialization/types/GetLocationRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetLocationRequest: core.serialization.Schema< serializers.GetLocationRequest.Raw, diff --git a/src/serialization/types/GetLocationResponse.ts b/src/serialization/types/GetLocationResponse.ts index 67af211fc..7d4112fd7 100644 --- a/src/serialization/types/GetLocationResponse.ts +++ b/src/serialization/types/GetLocationResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Location } from "./Location"; diff --git a/src/serialization/types/GetLoyaltyAccountRequest.ts b/src/serialization/types/GetLoyaltyAccountRequest.ts index 396130002..689c3491a 100644 --- a/src/serialization/types/GetLoyaltyAccountRequest.ts +++ b/src/serialization/types/GetLoyaltyAccountRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetLoyaltyAccountRequest: core.serialization.Schema< serializers.GetLoyaltyAccountRequest.Raw, diff --git a/src/serialization/types/GetLoyaltyAccountResponse.ts b/src/serialization/types/GetLoyaltyAccountResponse.ts index 0c151c9c2..15b8eeb30 100644 --- a/src/serialization/types/GetLoyaltyAccountResponse.ts +++ b/src/serialization/types/GetLoyaltyAccountResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyAccount } from "./LoyaltyAccount"; diff --git a/src/serialization/types/GetLoyaltyProgramRequest.ts b/src/serialization/types/GetLoyaltyProgramRequest.ts index 183c04ce3..c7ab0be0a 100644 --- a/src/serialization/types/GetLoyaltyProgramRequest.ts +++ b/src/serialization/types/GetLoyaltyProgramRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetLoyaltyProgramRequest: core.serialization.Schema< serializers.GetLoyaltyProgramRequest.Raw, diff --git a/src/serialization/types/GetLoyaltyProgramResponse.ts b/src/serialization/types/GetLoyaltyProgramResponse.ts index 0a81208d0..c054699c1 100644 --- a/src/serialization/types/GetLoyaltyProgramResponse.ts +++ b/src/serialization/types/GetLoyaltyProgramResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyProgram } from "./LoyaltyProgram"; diff --git a/src/serialization/types/GetLoyaltyPromotionRequest.ts b/src/serialization/types/GetLoyaltyPromotionRequest.ts index f673a2d7f..36531ed2e 100644 --- a/src/serialization/types/GetLoyaltyPromotionRequest.ts +++ b/src/serialization/types/GetLoyaltyPromotionRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetLoyaltyPromotionRequest: core.serialization.Schema< serializers.GetLoyaltyPromotionRequest.Raw, diff --git a/src/serialization/types/GetLoyaltyPromotionResponse.ts b/src/serialization/types/GetLoyaltyPromotionResponse.ts index cb686c182..d300d9cbd 100644 --- a/src/serialization/types/GetLoyaltyPromotionResponse.ts +++ b/src/serialization/types/GetLoyaltyPromotionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyPromotion } from "./LoyaltyPromotion"; diff --git a/src/serialization/types/GetLoyaltyRewardRequest.ts b/src/serialization/types/GetLoyaltyRewardRequest.ts index d54285fb8..d8ecd561b 100644 --- a/src/serialization/types/GetLoyaltyRewardRequest.ts +++ b/src/serialization/types/GetLoyaltyRewardRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetLoyaltyRewardRequest: core.serialization.Schema< serializers.GetLoyaltyRewardRequest.Raw, diff --git a/src/serialization/types/GetLoyaltyRewardResponse.ts b/src/serialization/types/GetLoyaltyRewardResponse.ts index 0ae8a962b..d936de9af 100644 --- a/src/serialization/types/GetLoyaltyRewardResponse.ts +++ b/src/serialization/types/GetLoyaltyRewardResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyReward } from "./LoyaltyReward"; diff --git a/src/serialization/types/GetMerchantRequest.ts b/src/serialization/types/GetMerchantRequest.ts index 87f099df4..23b622a5b 100644 --- a/src/serialization/types/GetMerchantRequest.ts +++ b/src/serialization/types/GetMerchantRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetMerchantRequest: core.serialization.Schema< serializers.GetMerchantRequest.Raw, diff --git a/src/serialization/types/GetMerchantResponse.ts b/src/serialization/types/GetMerchantResponse.ts index 207a42c13..4f6ed35c3 100644 --- a/src/serialization/types/GetMerchantResponse.ts +++ b/src/serialization/types/GetMerchantResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Merchant } from "./Merchant"; diff --git a/src/serialization/types/GetOrderRequest.ts b/src/serialization/types/GetOrderRequest.ts index c5ab643b9..90f21d792 100644 --- a/src/serialization/types/GetOrderRequest.ts +++ b/src/serialization/types/GetOrderRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetOrderRequest: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/GetOrderResponse.ts b/src/serialization/types/GetOrderResponse.ts index 25d97fec6..903ce0f8c 100644 --- a/src/serialization/types/GetOrderResponse.ts +++ b/src/serialization/types/GetOrderResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Order } from "./Order"; +import { Error_ } from "./Error_"; export const GetOrderResponse: core.serialization.ObjectSchema< serializers.GetOrderResponse.Raw, diff --git a/src/serialization/types/GetPaymentLinkRequest.ts b/src/serialization/types/GetPaymentLinkRequest.ts index 2a8a3092a..96dd5d8a5 100644 --- a/src/serialization/types/GetPaymentLinkRequest.ts +++ b/src/serialization/types/GetPaymentLinkRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetPaymentLinkRequest: core.serialization.Schema< serializers.GetPaymentLinkRequest.Raw, diff --git a/src/serialization/types/GetPaymentLinkResponse.ts b/src/serialization/types/GetPaymentLinkResponse.ts index 378b03cd2..bcdcca186 100644 --- a/src/serialization/types/GetPaymentLinkResponse.ts +++ b/src/serialization/types/GetPaymentLinkResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { PaymentLink } from "./PaymentLink"; diff --git a/src/serialization/types/GetPaymentRefundResponse.ts b/src/serialization/types/GetPaymentRefundResponse.ts index 132afd024..9711d4d39 100644 --- a/src/serialization/types/GetPaymentRefundResponse.ts +++ b/src/serialization/types/GetPaymentRefundResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { PaymentRefund } from "./PaymentRefund"; diff --git a/src/serialization/types/GetPaymentResponse.ts b/src/serialization/types/GetPaymentResponse.ts index 3293401ff..0f380cf2f 100644 --- a/src/serialization/types/GetPaymentResponse.ts +++ b/src/serialization/types/GetPaymentResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Payment } from "./Payment"; diff --git a/src/serialization/types/GetPayoutResponse.ts b/src/serialization/types/GetPayoutResponse.ts index 86765db6f..cebd3beca 100644 --- a/src/serialization/types/GetPayoutResponse.ts +++ b/src/serialization/types/GetPayoutResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Payout } from "./Payout"; +import { Error_ } from "./Error_"; export const GetPayoutResponse: core.serialization.ObjectSchema< serializers.GetPayoutResponse.Raw, diff --git a/src/serialization/types/GetShiftResponse.ts b/src/serialization/types/GetShiftResponse.ts index bbc0f950e..9c02f8677 100644 --- a/src/serialization/types/GetShiftResponse.ts +++ b/src/serialization/types/GetShiftResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Shift } from "./Shift"; +import { Error_ } from "./Error_"; export const GetShiftResponse: core.serialization.ObjectSchema< serializers.GetShiftResponse.Raw, diff --git a/src/serialization/types/GetSnippetRequest.ts b/src/serialization/types/GetSnippetRequest.ts index 115afa0c9..8bcf10913 100644 --- a/src/serialization/types/GetSnippetRequest.ts +++ b/src/serialization/types/GetSnippetRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetSnippetRequest: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/GetSnippetResponse.ts b/src/serialization/types/GetSnippetResponse.ts index e2722065a..a0a418678 100644 --- a/src/serialization/types/GetSnippetResponse.ts +++ b/src/serialization/types/GetSnippetResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Snippet } from "./Snippet"; diff --git a/src/serialization/types/GetSubscriptionResponse.ts b/src/serialization/types/GetSubscriptionResponse.ts index c42a12c76..76695322b 100644 --- a/src/serialization/types/GetSubscriptionResponse.ts +++ b/src/serialization/types/GetSubscriptionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Subscription } from "./Subscription"; diff --git a/src/serialization/types/GetTeamMemberBookingProfileRequest.ts b/src/serialization/types/GetTeamMemberBookingProfileRequest.ts index 36ca6e118..ff7ab4a1e 100644 --- a/src/serialization/types/GetTeamMemberBookingProfileRequest.ts +++ b/src/serialization/types/GetTeamMemberBookingProfileRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetTeamMemberBookingProfileRequest: core.serialization.Schema< serializers.GetTeamMemberBookingProfileRequest.Raw, diff --git a/src/serialization/types/GetTeamMemberBookingProfileResponse.ts b/src/serialization/types/GetTeamMemberBookingProfileResponse.ts index 887529bd7..5069af0aa 100644 --- a/src/serialization/types/GetTeamMemberBookingProfileResponse.ts +++ b/src/serialization/types/GetTeamMemberBookingProfileResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { TeamMemberBookingProfile } from "./TeamMemberBookingProfile"; +import { Error_ } from "./Error_"; export const GetTeamMemberBookingProfileResponse: core.serialization.ObjectSchema< serializers.GetTeamMemberBookingProfileResponse.Raw, diff --git a/src/serialization/types/GetTeamMemberRequest.ts b/src/serialization/types/GetTeamMemberRequest.ts index 852bfd32a..b65d724ff 100644 --- a/src/serialization/types/GetTeamMemberRequest.ts +++ b/src/serialization/types/GetTeamMemberRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetTeamMemberRequest: core.serialization.Schema< serializers.GetTeamMemberRequest.Raw, diff --git a/src/serialization/types/GetTeamMemberResponse.ts b/src/serialization/types/GetTeamMemberResponse.ts index 1312aa31f..4023d83fe 100644 --- a/src/serialization/types/GetTeamMemberResponse.ts +++ b/src/serialization/types/GetTeamMemberResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { TeamMember } from "./TeamMember"; +import { Error_ } from "./Error_"; export const GetTeamMemberResponse: core.serialization.ObjectSchema< serializers.GetTeamMemberResponse.Raw, diff --git a/src/serialization/types/GetTeamMemberWageResponse.ts b/src/serialization/types/GetTeamMemberWageResponse.ts index ffc241079..d226f40f6 100644 --- a/src/serialization/types/GetTeamMemberWageResponse.ts +++ b/src/serialization/types/GetTeamMemberWageResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { TeamMemberWage } from "./TeamMemberWage"; +import { Error_ } from "./Error_"; export const GetTeamMemberWageResponse: core.serialization.ObjectSchema< serializers.GetTeamMemberWageResponse.Raw, diff --git a/src/serialization/types/GetTerminalActionResponse.ts b/src/serialization/types/GetTerminalActionResponse.ts index 94450c190..701202b83 100644 --- a/src/serialization/types/GetTerminalActionResponse.ts +++ b/src/serialization/types/GetTerminalActionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalAction } from "./TerminalAction"; diff --git a/src/serialization/types/GetTerminalCheckoutResponse.ts b/src/serialization/types/GetTerminalCheckoutResponse.ts index c2ed4a7be..2a89d63a4 100644 --- a/src/serialization/types/GetTerminalCheckoutResponse.ts +++ b/src/serialization/types/GetTerminalCheckoutResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalCheckout } from "./TerminalCheckout"; diff --git a/src/serialization/types/GetTerminalRefundResponse.ts b/src/serialization/types/GetTerminalRefundResponse.ts index 66cf6e5fa..87febea02 100644 --- a/src/serialization/types/GetTerminalRefundResponse.ts +++ b/src/serialization/types/GetTerminalRefundResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalRefund } from "./TerminalRefund"; diff --git a/src/serialization/types/GetTransactionRequest.ts b/src/serialization/types/GetTransactionRequest.ts index 2c65b93ce..f3adb132a 100644 --- a/src/serialization/types/GetTransactionRequest.ts +++ b/src/serialization/types/GetTransactionRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetTransactionRequest: core.serialization.Schema< serializers.GetTransactionRequest.Raw, diff --git a/src/serialization/types/GetTransactionResponse.ts b/src/serialization/types/GetTransactionResponse.ts index a7ccd9cdb..c91a94d24 100644 --- a/src/serialization/types/GetTransactionResponse.ts +++ b/src/serialization/types/GetTransactionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Transaction } from "./Transaction"; diff --git a/src/serialization/types/GetVendorRequest.ts b/src/serialization/types/GetVendorRequest.ts index 805d24a40..4c6a3fd38 100644 --- a/src/serialization/types/GetVendorRequest.ts +++ b/src/serialization/types/GetVendorRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetVendorRequest: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/GetVendorResponse.ts b/src/serialization/types/GetVendorResponse.ts index 178a37ce4..e2c170739 100644 --- a/src/serialization/types/GetVendorResponse.ts +++ b/src/serialization/types/GetVendorResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Vendor } from "./Vendor"; diff --git a/src/serialization/types/GetWageSettingRequest.ts b/src/serialization/types/GetWageSettingRequest.ts index d8238a568..52ba32b82 100644 --- a/src/serialization/types/GetWageSettingRequest.ts +++ b/src/serialization/types/GetWageSettingRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetWageSettingRequest: core.serialization.Schema< serializers.GetWageSettingRequest.Raw, diff --git a/src/serialization/types/GetWageSettingResponse.ts b/src/serialization/types/GetWageSettingResponse.ts index a5504c3e4..cb181e5e7 100644 --- a/src/serialization/types/GetWageSettingResponse.ts +++ b/src/serialization/types/GetWageSettingResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { WageSetting } from "./WageSetting"; +import { Error_ } from "./Error_"; export const GetWageSettingResponse: core.serialization.ObjectSchema< serializers.GetWageSettingResponse.Raw, diff --git a/src/serialization/types/GetWebhookSubscriptionRequest.ts b/src/serialization/types/GetWebhookSubscriptionRequest.ts index 19b89a6bf..2e6771793 100644 --- a/src/serialization/types/GetWebhookSubscriptionRequest.ts +++ b/src/serialization/types/GetWebhookSubscriptionRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GetWebhookSubscriptionRequest: core.serialization.Schema< serializers.GetWebhookSubscriptionRequest.Raw, diff --git a/src/serialization/types/GetWebhookSubscriptionResponse.ts b/src/serialization/types/GetWebhookSubscriptionResponse.ts index 5c83563bb..3e02e9e12 100644 --- a/src/serialization/types/GetWebhookSubscriptionResponse.ts +++ b/src/serialization/types/GetWebhookSubscriptionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { WebhookSubscription } from "./WebhookSubscription"; diff --git a/src/serialization/types/GiftCard.ts b/src/serialization/types/GiftCard.ts index 1f0a0dd6c..87199f596 100644 --- a/src/serialization/types/GiftCard.ts +++ b/src/serialization/types/GiftCard.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; +import { GiftCardType } from "./GiftCardType"; import { GiftCardGanSource } from "./GiftCardGanSource"; import { GiftCardStatus } from "./GiftCardStatus"; -import { GiftCardType } from "./GiftCardType"; import { Money } from "./Money"; export const GiftCard: core.serialization.ObjectSchema = @@ -30,7 +32,7 @@ export declare namespace GiftCard { gan_source?: GiftCardGanSource.Raw | null; state?: GiftCardStatus.Raw | null; balance_money?: Money.Raw | null; - gan?: (string | null | undefined) | null; + gan?: (string | null) | null; created_at?: string | null; customer_ids?: string[] | null; } diff --git a/src/serialization/types/GiftCardActivity.ts b/src/serialization/types/GiftCardActivity.ts index dc9da478a..5f2f95243 100644 --- a/src/serialization/types/GiftCardActivity.ts +++ b/src/serialization/types/GiftCardActivity.ts @@ -1,25 +1,27 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; +import { GiftCardActivityType } from "./GiftCardActivityType"; +import { Money } from "./Money"; +import { GiftCardActivityLoad } from "./GiftCardActivityLoad"; import { GiftCardActivityActivate } from "./GiftCardActivityActivate"; -import { GiftCardActivityAdjustDecrement } from "./GiftCardActivityAdjustDecrement"; -import { GiftCardActivityAdjustIncrement } from "./GiftCardActivityAdjustIncrement"; -import { GiftCardActivityBlock } from "./GiftCardActivityBlock"; +import { GiftCardActivityRedeem } from "./GiftCardActivityRedeem"; import { GiftCardActivityClearBalance } from "./GiftCardActivityClearBalance"; import { GiftCardActivityDeactivate } from "./GiftCardActivityDeactivate"; +import { GiftCardActivityAdjustIncrement } from "./GiftCardActivityAdjustIncrement"; +import { GiftCardActivityAdjustDecrement } from "./GiftCardActivityAdjustDecrement"; +import { GiftCardActivityRefund } from "./GiftCardActivityRefund"; +import { GiftCardActivityUnlinkedActivityRefund } from "./GiftCardActivityUnlinkedActivityRefund"; import { GiftCardActivityImport } from "./GiftCardActivityImport"; +import { GiftCardActivityBlock } from "./GiftCardActivityBlock"; +import { GiftCardActivityUnblock } from "./GiftCardActivityUnblock"; import { GiftCardActivityImportReversal } from "./GiftCardActivityImportReversal"; -import { GiftCardActivityLoad } from "./GiftCardActivityLoad"; -import { GiftCardActivityRedeem } from "./GiftCardActivityRedeem"; -import { GiftCardActivityRefund } from "./GiftCardActivityRefund"; -import { GiftCardActivityTransferBalanceFrom } from "./GiftCardActivityTransferBalanceFrom"; import { GiftCardActivityTransferBalanceTo } from "./GiftCardActivityTransferBalanceTo"; -import { GiftCardActivityType } from "./GiftCardActivityType"; -import { GiftCardActivityUnblock } from "./GiftCardActivityUnblock"; -import { GiftCardActivityUnlinkedActivityRefund } from "./GiftCardActivityUnlinkedActivityRefund"; -import { Money } from "./Money"; +import { GiftCardActivityTransferBalanceFrom } from "./GiftCardActivityTransferBalanceFrom"; export const GiftCardActivity: core.serialization.ObjectSchema< serializers.GiftCardActivity.Raw, @@ -82,8 +84,8 @@ export declare namespace GiftCardActivity { type: GiftCardActivityType.Raw; location_id: string; created_at?: string | null; - gift_card_id?: (string | null | undefined) | null; - gift_card_gan?: (string | null | undefined) | null; + gift_card_id?: (string | null) | null; + gift_card_gan?: (string | null) | null; gift_card_balance_money?: Money.Raw | null; load_activity_details?: GiftCardActivityLoad.Raw | null; activate_activity_details?: GiftCardActivityActivate.Raw | null; diff --git a/src/serialization/types/GiftCardActivityActivate.ts b/src/serialization/types/GiftCardActivityActivate.ts index 99ac6dea6..f4643ba31 100644 --- a/src/serialization/types/GiftCardActivityActivate.ts +++ b/src/serialization/types/GiftCardActivityActivate.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const GiftCardActivityActivate: core.serialization.ObjectSchema< @@ -22,9 +24,9 @@ export const GiftCardActivityActivate: core.serialization.ObjectSchema< export declare namespace GiftCardActivityActivate { export interface Raw { amount_money?: Money.Raw | null; - order_id?: (string | null | undefined) | null; - line_item_uid?: (string | null | undefined) | null; - reference_id?: (string | null | undefined) | null; - buyer_payment_instrument_ids?: (string[] | null | undefined) | null; + order_id?: (string | null) | null; + line_item_uid?: (string | null) | null; + reference_id?: (string | null) | null; + buyer_payment_instrument_ids?: (string[] | null) | null; } } diff --git a/src/serialization/types/GiftCardActivityAdjustDecrement.ts b/src/serialization/types/GiftCardActivityAdjustDecrement.ts index 7573f4985..2f77e39a1 100644 --- a/src/serialization/types/GiftCardActivityAdjustDecrement.ts +++ b/src/serialization/types/GiftCardActivityAdjustDecrement.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { GiftCardActivityAdjustDecrementReason } from "./GiftCardActivityAdjustDecrementReason"; import { Money } from "./Money"; +import { GiftCardActivityAdjustDecrementReason } from "./GiftCardActivityAdjustDecrementReason"; export const GiftCardActivityAdjustDecrement: core.serialization.ObjectSchema< serializers.GiftCardActivityAdjustDecrement.Raw, diff --git a/src/serialization/types/GiftCardActivityAdjustDecrementReason.ts b/src/serialization/types/GiftCardActivityAdjustDecrementReason.ts index d3d3cfe52..9d2d0fbd3 100644 --- a/src/serialization/types/GiftCardActivityAdjustDecrementReason.ts +++ b/src/serialization/types/GiftCardActivityAdjustDecrementReason.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GiftCardActivityAdjustDecrementReason: core.serialization.Schema< serializers.GiftCardActivityAdjustDecrementReason.Raw, diff --git a/src/serialization/types/GiftCardActivityAdjustIncrement.ts b/src/serialization/types/GiftCardActivityAdjustIncrement.ts index bc0cbdcb5..49f48b1e2 100644 --- a/src/serialization/types/GiftCardActivityAdjustIncrement.ts +++ b/src/serialization/types/GiftCardActivityAdjustIncrement.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { GiftCardActivityAdjustIncrementReason } from "./GiftCardActivityAdjustIncrementReason"; import { Money } from "./Money"; +import { GiftCardActivityAdjustIncrementReason } from "./GiftCardActivityAdjustIncrementReason"; export const GiftCardActivityAdjustIncrement: core.serialization.ObjectSchema< serializers.GiftCardActivityAdjustIncrement.Raw, diff --git a/src/serialization/types/GiftCardActivityAdjustIncrementReason.ts b/src/serialization/types/GiftCardActivityAdjustIncrementReason.ts index 1378aae91..cadc8cc9a 100644 --- a/src/serialization/types/GiftCardActivityAdjustIncrementReason.ts +++ b/src/serialization/types/GiftCardActivityAdjustIncrementReason.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GiftCardActivityAdjustIncrementReason: core.serialization.Schema< serializers.GiftCardActivityAdjustIncrementReason.Raw, diff --git a/src/serialization/types/GiftCardActivityBlock.ts b/src/serialization/types/GiftCardActivityBlock.ts index 5a47b1560..e1d40a989 100644 --- a/src/serialization/types/GiftCardActivityBlock.ts +++ b/src/serialization/types/GiftCardActivityBlock.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { GiftCardActivityBlockReason } from "./GiftCardActivityBlockReason"; export const GiftCardActivityBlock: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GiftCardActivityBlockReason.ts b/src/serialization/types/GiftCardActivityBlockReason.ts index 6a4e9b3e2..d24d63096 100644 --- a/src/serialization/types/GiftCardActivityBlockReason.ts +++ b/src/serialization/types/GiftCardActivityBlockReason.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GiftCardActivityBlockReason: core.serialization.Schema< serializers.GiftCardActivityBlockReason.Raw, diff --git a/src/serialization/types/GiftCardActivityClearBalance.ts b/src/serialization/types/GiftCardActivityClearBalance.ts index 98af55446..14f5d1d26 100644 --- a/src/serialization/types/GiftCardActivityClearBalance.ts +++ b/src/serialization/types/GiftCardActivityClearBalance.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { GiftCardActivityClearBalanceReason } from "./GiftCardActivityClearBalanceReason"; export const GiftCardActivityClearBalance: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GiftCardActivityClearBalanceReason.ts b/src/serialization/types/GiftCardActivityClearBalanceReason.ts index 9a726ed35..5fe86e635 100644 --- a/src/serialization/types/GiftCardActivityClearBalanceReason.ts +++ b/src/serialization/types/GiftCardActivityClearBalanceReason.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GiftCardActivityClearBalanceReason: core.serialization.Schema< serializers.GiftCardActivityClearBalanceReason.Raw, diff --git a/src/serialization/types/GiftCardActivityCreatedEvent.ts b/src/serialization/types/GiftCardActivityCreatedEvent.ts index 0012d64ac..82935bdd9 100644 --- a/src/serialization/types/GiftCardActivityCreatedEvent.ts +++ b/src/serialization/types/GiftCardActivityCreatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { GiftCardActivityCreatedEventData } from "./GiftCardActivityCreatedEventData"; export const GiftCardActivityCreatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const GiftCardActivityCreatedEvent: core.serialization.ObjectSchema< export declare namespace GiftCardActivityCreatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: GiftCardActivityCreatedEventData.Raw | null; } diff --git a/src/serialization/types/GiftCardActivityCreatedEventData.ts b/src/serialization/types/GiftCardActivityCreatedEventData.ts index 33656f69a..1d274aa2b 100644 --- a/src/serialization/types/GiftCardActivityCreatedEventData.ts +++ b/src/serialization/types/GiftCardActivityCreatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { GiftCardActivityCreatedEventObject } from "./GiftCardActivityCreatedEventObject"; export const GiftCardActivityCreatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const GiftCardActivityCreatedEventData: core.serialization.ObjectSchema< export declare namespace GiftCardActivityCreatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: GiftCardActivityCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/GiftCardActivityCreatedEventObject.ts b/src/serialization/types/GiftCardActivityCreatedEventObject.ts index 2f33232e9..736486217 100644 --- a/src/serialization/types/GiftCardActivityCreatedEventObject.ts +++ b/src/serialization/types/GiftCardActivityCreatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { GiftCardActivity } from "./GiftCardActivity"; export const GiftCardActivityCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GiftCardActivityDeactivate.ts b/src/serialization/types/GiftCardActivityDeactivate.ts index c456a8d3f..490a74c9e 100644 --- a/src/serialization/types/GiftCardActivityDeactivate.ts +++ b/src/serialization/types/GiftCardActivityDeactivate.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { GiftCardActivityDeactivateReason } from "./GiftCardActivityDeactivateReason"; export const GiftCardActivityDeactivate: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GiftCardActivityDeactivateReason.ts b/src/serialization/types/GiftCardActivityDeactivateReason.ts index 7708d558f..47ecedbf1 100644 --- a/src/serialization/types/GiftCardActivityDeactivateReason.ts +++ b/src/serialization/types/GiftCardActivityDeactivateReason.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GiftCardActivityDeactivateReason: core.serialization.Schema< serializers.GiftCardActivityDeactivateReason.Raw, diff --git a/src/serialization/types/GiftCardActivityImport.ts b/src/serialization/types/GiftCardActivityImport.ts index d38b2b95d..3a84bf94b 100644 --- a/src/serialization/types/GiftCardActivityImport.ts +++ b/src/serialization/types/GiftCardActivityImport.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const GiftCardActivityImport: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GiftCardActivityImportReversal.ts b/src/serialization/types/GiftCardActivityImportReversal.ts index f5a3e2f94..f7627916d 100644 --- a/src/serialization/types/GiftCardActivityImportReversal.ts +++ b/src/serialization/types/GiftCardActivityImportReversal.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const GiftCardActivityImportReversal: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GiftCardActivityLoad.ts b/src/serialization/types/GiftCardActivityLoad.ts index a2bc16590..610635f63 100644 --- a/src/serialization/types/GiftCardActivityLoad.ts +++ b/src/serialization/types/GiftCardActivityLoad.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const GiftCardActivityLoad: core.serialization.ObjectSchema< @@ -22,9 +24,9 @@ export const GiftCardActivityLoad: core.serialization.ObjectSchema< export declare namespace GiftCardActivityLoad { export interface Raw { amount_money?: Money.Raw | null; - order_id?: (string | null | undefined) | null; - line_item_uid?: (string | null | undefined) | null; - reference_id?: (string | null | undefined) | null; - buyer_payment_instrument_ids?: (string[] | null | undefined) | null; + order_id?: (string | null) | null; + line_item_uid?: (string | null) | null; + reference_id?: (string | null) | null; + buyer_payment_instrument_ids?: (string[] | null) | null; } } diff --git a/src/serialization/types/GiftCardActivityRedeem.ts b/src/serialization/types/GiftCardActivityRedeem.ts index 00883b159..0e43c3bc3 100644 --- a/src/serialization/types/GiftCardActivityRedeem.ts +++ b/src/serialization/types/GiftCardActivityRedeem.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { GiftCardActivityRedeemStatus } from "./GiftCardActivityRedeemStatus"; import { Money } from "./Money"; +import { GiftCardActivityRedeemStatus } from "./GiftCardActivityRedeemStatus"; export const GiftCardActivityRedeem: core.serialization.ObjectSchema< serializers.GiftCardActivityRedeem.Raw, @@ -20,7 +22,7 @@ export declare namespace GiftCardActivityRedeem { export interface Raw { amount_money: Money.Raw; payment_id?: string | null; - reference_id?: (string | null | undefined) | null; + reference_id?: (string | null) | null; status?: GiftCardActivityRedeemStatus.Raw | null; } } diff --git a/src/serialization/types/GiftCardActivityRedeemStatus.ts b/src/serialization/types/GiftCardActivityRedeemStatus.ts index b5a89bd79..ea0717145 100644 --- a/src/serialization/types/GiftCardActivityRedeemStatus.ts +++ b/src/serialization/types/GiftCardActivityRedeemStatus.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GiftCardActivityRedeemStatus: core.serialization.Schema< serializers.GiftCardActivityRedeemStatus.Raw, diff --git a/src/serialization/types/GiftCardActivityRefund.ts b/src/serialization/types/GiftCardActivityRefund.ts index 38d60c91b..b2983e9be 100644 --- a/src/serialization/types/GiftCardActivityRefund.ts +++ b/src/serialization/types/GiftCardActivityRefund.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const GiftCardActivityRefund: core.serialization.ObjectSchema< @@ -17,9 +19,9 @@ export const GiftCardActivityRefund: core.serialization.ObjectSchema< export declare namespace GiftCardActivityRefund { export interface Raw { - redeem_activity_id?: (string | null | undefined) | null; + redeem_activity_id?: (string | null) | null; amount_money?: Money.Raw | null; - reference_id?: (string | null | undefined) | null; + reference_id?: (string | null) | null; payment_id?: string | null; } } diff --git a/src/serialization/types/GiftCardActivityTransferBalanceFrom.ts b/src/serialization/types/GiftCardActivityTransferBalanceFrom.ts index ecd579db6..852fb7857 100644 --- a/src/serialization/types/GiftCardActivityTransferBalanceFrom.ts +++ b/src/serialization/types/GiftCardActivityTransferBalanceFrom.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const GiftCardActivityTransferBalanceFrom: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GiftCardActivityTransferBalanceTo.ts b/src/serialization/types/GiftCardActivityTransferBalanceTo.ts index bbf8b92b5..147277398 100644 --- a/src/serialization/types/GiftCardActivityTransferBalanceTo.ts +++ b/src/serialization/types/GiftCardActivityTransferBalanceTo.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const GiftCardActivityTransferBalanceTo: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GiftCardActivityType.ts b/src/serialization/types/GiftCardActivityType.ts index 04b1734ce..2c628dac9 100644 --- a/src/serialization/types/GiftCardActivityType.ts +++ b/src/serialization/types/GiftCardActivityType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GiftCardActivityType: core.serialization.Schema< serializers.GiftCardActivityType.Raw, diff --git a/src/serialization/types/GiftCardActivityUnblock.ts b/src/serialization/types/GiftCardActivityUnblock.ts index 4dc7199ef..6cf9f515b 100644 --- a/src/serialization/types/GiftCardActivityUnblock.ts +++ b/src/serialization/types/GiftCardActivityUnblock.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { GiftCardActivityUnblockReason } from "./GiftCardActivityUnblockReason"; export const GiftCardActivityUnblock: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GiftCardActivityUnblockReason.ts b/src/serialization/types/GiftCardActivityUnblockReason.ts index b5e5ae0b3..1ffb7a9bb 100644 --- a/src/serialization/types/GiftCardActivityUnblockReason.ts +++ b/src/serialization/types/GiftCardActivityUnblockReason.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GiftCardActivityUnblockReason: core.serialization.Schema< serializers.GiftCardActivityUnblockReason.Raw, diff --git a/src/serialization/types/GiftCardActivityUnlinkedActivityRefund.ts b/src/serialization/types/GiftCardActivityUnlinkedActivityRefund.ts index a2b4c0a4e..5e5cd0347 100644 --- a/src/serialization/types/GiftCardActivityUnlinkedActivityRefund.ts +++ b/src/serialization/types/GiftCardActivityUnlinkedActivityRefund.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const GiftCardActivityUnlinkedActivityRefund: core.serialization.ObjectSchema< @@ -17,7 +19,7 @@ export const GiftCardActivityUnlinkedActivityRefund: core.serialization.ObjectSc export declare namespace GiftCardActivityUnlinkedActivityRefund { export interface Raw { amount_money: Money.Raw; - reference_id?: (string | null | undefined) | null; + reference_id?: (string | null) | null; payment_id?: string | null; } } diff --git a/src/serialization/types/GiftCardActivityUpdatedEvent.ts b/src/serialization/types/GiftCardActivityUpdatedEvent.ts index 465c24ca4..31442efd6 100644 --- a/src/serialization/types/GiftCardActivityUpdatedEvent.ts +++ b/src/serialization/types/GiftCardActivityUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { GiftCardActivityUpdatedEventData } from "./GiftCardActivityUpdatedEventData"; export const GiftCardActivityUpdatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const GiftCardActivityUpdatedEvent: core.serialization.ObjectSchema< export declare namespace GiftCardActivityUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: GiftCardActivityUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/GiftCardActivityUpdatedEventData.ts b/src/serialization/types/GiftCardActivityUpdatedEventData.ts index 0a6b6b94e..b7be9ff4d 100644 --- a/src/serialization/types/GiftCardActivityUpdatedEventData.ts +++ b/src/serialization/types/GiftCardActivityUpdatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { GiftCardActivityUpdatedEventObject } from "./GiftCardActivityUpdatedEventObject"; export const GiftCardActivityUpdatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const GiftCardActivityUpdatedEventData: core.serialization.ObjectSchema< export declare namespace GiftCardActivityUpdatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: GiftCardActivityUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/GiftCardActivityUpdatedEventObject.ts b/src/serialization/types/GiftCardActivityUpdatedEventObject.ts index a9ae773db..0a0f6804f 100644 --- a/src/serialization/types/GiftCardActivityUpdatedEventObject.ts +++ b/src/serialization/types/GiftCardActivityUpdatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { GiftCardActivity } from "./GiftCardActivity"; export const GiftCardActivityUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GiftCardCreatedEvent.ts b/src/serialization/types/GiftCardCreatedEvent.ts index e2cccbfed..5a8b97b7a 100644 --- a/src/serialization/types/GiftCardCreatedEvent.ts +++ b/src/serialization/types/GiftCardCreatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { GiftCardCreatedEventData } from "./GiftCardCreatedEventData"; export const GiftCardCreatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const GiftCardCreatedEvent: core.serialization.ObjectSchema< export declare namespace GiftCardCreatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: GiftCardCreatedEventData.Raw | null; } diff --git a/src/serialization/types/GiftCardCreatedEventData.ts b/src/serialization/types/GiftCardCreatedEventData.ts index 4665cc402..1339cb783 100644 --- a/src/serialization/types/GiftCardCreatedEventData.ts +++ b/src/serialization/types/GiftCardCreatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { GiftCardCreatedEventObject } from "./GiftCardCreatedEventObject"; export const GiftCardCreatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const GiftCardCreatedEventData: core.serialization.ObjectSchema< export declare namespace GiftCardCreatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: GiftCardCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/GiftCardCreatedEventObject.ts b/src/serialization/types/GiftCardCreatedEventObject.ts index 166af4075..34de654f4 100644 --- a/src/serialization/types/GiftCardCreatedEventObject.ts +++ b/src/serialization/types/GiftCardCreatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { GiftCard } from "./GiftCard"; export const GiftCardCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/GiftCardCustomerLinkedEvent.ts b/src/serialization/types/GiftCardCustomerLinkedEvent.ts index 369f6fa59..3bda42ea3 100644 --- a/src/serialization/types/GiftCardCustomerLinkedEvent.ts +++ b/src/serialization/types/GiftCardCustomerLinkedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { GiftCardCustomerLinkedEventData } from "./GiftCardCustomerLinkedEventData"; export const GiftCardCustomerLinkedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const GiftCardCustomerLinkedEvent: core.serialization.ObjectSchema< export declare namespace GiftCardCustomerLinkedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: GiftCardCustomerLinkedEventData.Raw | null; } diff --git a/src/serialization/types/GiftCardCustomerLinkedEventData.ts b/src/serialization/types/GiftCardCustomerLinkedEventData.ts index 4700111a1..08fd44bc4 100644 --- a/src/serialization/types/GiftCardCustomerLinkedEventData.ts +++ b/src/serialization/types/GiftCardCustomerLinkedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { GiftCardCustomerLinkedEventObject } from "./GiftCardCustomerLinkedEventObject"; export const GiftCardCustomerLinkedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const GiftCardCustomerLinkedEventData: core.serialization.ObjectSchema< export declare namespace GiftCardCustomerLinkedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: GiftCardCustomerLinkedEventObject.Raw | null; } diff --git a/src/serialization/types/GiftCardCustomerLinkedEventObject.ts b/src/serialization/types/GiftCardCustomerLinkedEventObject.ts index c8b1e7557..78d7baf47 100644 --- a/src/serialization/types/GiftCardCustomerLinkedEventObject.ts +++ b/src/serialization/types/GiftCardCustomerLinkedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { GiftCard } from "./GiftCard"; export const GiftCardCustomerLinkedEventObject: core.serialization.ObjectSchema< @@ -16,6 +18,6 @@ export const GiftCardCustomerLinkedEventObject: core.serialization.ObjectSchema< export declare namespace GiftCardCustomerLinkedEventObject { export interface Raw { gift_card?: GiftCard.Raw | null; - linked_customer_id?: (string | null | undefined) | null; + linked_customer_id?: (string | null) | null; } } diff --git a/src/serialization/types/GiftCardCustomerUnlinkedEvent.ts b/src/serialization/types/GiftCardCustomerUnlinkedEvent.ts index 3dcb5f1f6..fc128d347 100644 --- a/src/serialization/types/GiftCardCustomerUnlinkedEvent.ts +++ b/src/serialization/types/GiftCardCustomerUnlinkedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { GiftCardCustomerUnlinkedEventData } from "./GiftCardCustomerUnlinkedEventData"; export const GiftCardCustomerUnlinkedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const GiftCardCustomerUnlinkedEvent: core.serialization.ObjectSchema< export declare namespace GiftCardCustomerUnlinkedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: GiftCardCustomerUnlinkedEventData.Raw | null; } diff --git a/src/serialization/types/GiftCardCustomerUnlinkedEventData.ts b/src/serialization/types/GiftCardCustomerUnlinkedEventData.ts index e398c3062..3208e670e 100644 --- a/src/serialization/types/GiftCardCustomerUnlinkedEventData.ts +++ b/src/serialization/types/GiftCardCustomerUnlinkedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { GiftCardCustomerUnlinkedEventObject } from "./GiftCardCustomerUnlinkedEventObject"; export const GiftCardCustomerUnlinkedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const GiftCardCustomerUnlinkedEventData: core.serialization.ObjectSchema< export declare namespace GiftCardCustomerUnlinkedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: GiftCardCustomerUnlinkedEventObject.Raw | null; } diff --git a/src/serialization/types/GiftCardCustomerUnlinkedEventObject.ts b/src/serialization/types/GiftCardCustomerUnlinkedEventObject.ts index 7de0d8242..2c74d9e6d 100644 --- a/src/serialization/types/GiftCardCustomerUnlinkedEventObject.ts +++ b/src/serialization/types/GiftCardCustomerUnlinkedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { GiftCard } from "./GiftCard"; export const GiftCardCustomerUnlinkedEventObject: core.serialization.ObjectSchema< @@ -19,6 +21,6 @@ export const GiftCardCustomerUnlinkedEventObject: core.serialization.ObjectSchem export declare namespace GiftCardCustomerUnlinkedEventObject { export interface Raw { gift_card?: GiftCard.Raw | null; - unlinked_customer_id?: (string | null | undefined) | null; + unlinked_customer_id?: (string | null) | null; } } diff --git a/src/serialization/types/GiftCardGanSource.ts b/src/serialization/types/GiftCardGanSource.ts index d56c42f44..759e10061 100644 --- a/src/serialization/types/GiftCardGanSource.ts +++ b/src/serialization/types/GiftCardGanSource.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GiftCardGanSource: core.serialization.Schema = core.serialization.enum_(["SQUARE", "OTHER"]); diff --git a/src/serialization/types/GiftCardStatus.ts b/src/serialization/types/GiftCardStatus.ts index 30d3cd5fe..eeb183e8f 100644 --- a/src/serialization/types/GiftCardStatus.ts +++ b/src/serialization/types/GiftCardStatus.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GiftCardStatus: core.serialization.Schema = core.serialization.enum_(["ACTIVE", "DEACTIVATED", "BLOCKED", "PENDING"]); diff --git a/src/serialization/types/GiftCardType.ts b/src/serialization/types/GiftCardType.ts index 3f2def67d..42a52afa9 100644 --- a/src/serialization/types/GiftCardType.ts +++ b/src/serialization/types/GiftCardType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const GiftCardType: core.serialization.Schema = core.serialization.enum_(["PHYSICAL", "DIGITAL"]); diff --git a/src/serialization/types/GiftCardUpdatedEvent.ts b/src/serialization/types/GiftCardUpdatedEvent.ts index f3cb27c61..e947e260c 100644 --- a/src/serialization/types/GiftCardUpdatedEvent.ts +++ b/src/serialization/types/GiftCardUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { GiftCardUpdatedEventData } from "./GiftCardUpdatedEventData"; export const GiftCardUpdatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const GiftCardUpdatedEvent: core.serialization.ObjectSchema< export declare namespace GiftCardUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: GiftCardUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/GiftCardUpdatedEventData.ts b/src/serialization/types/GiftCardUpdatedEventData.ts index 75d0b589d..d5dd91b53 100644 --- a/src/serialization/types/GiftCardUpdatedEventData.ts +++ b/src/serialization/types/GiftCardUpdatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { GiftCardUpdatedEventObject } from "./GiftCardUpdatedEventObject"; export const GiftCardUpdatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const GiftCardUpdatedEventData: core.serialization.ObjectSchema< export declare namespace GiftCardUpdatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: GiftCardUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/GiftCardUpdatedEventObject.ts b/src/serialization/types/GiftCardUpdatedEventObject.ts index ea933f07a..d550374cc 100644 --- a/src/serialization/types/GiftCardUpdatedEventObject.ts +++ b/src/serialization/types/GiftCardUpdatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { GiftCard } from "./GiftCard"; export const GiftCardUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/InventoryAdjustment.ts b/src/serialization/types/InventoryAdjustment.ts index 0a0201f12..c0f813c6f 100644 --- a/src/serialization/types/InventoryAdjustment.ts +++ b/src/serialization/types/InventoryAdjustment.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { InventoryAdjustmentGroup } from "./InventoryAdjustmentGroup"; import { InventoryState } from "./InventoryState"; import { Money } from "./Money"; import { SourceApplication } from "./SourceApplication"; +import { InventoryAdjustmentGroup } from "./InventoryAdjustmentGroup"; export const InventoryAdjustment: core.serialization.ObjectSchema< serializers.InventoryAdjustment.Raw, @@ -39,19 +41,19 @@ export const InventoryAdjustment: core.serialization.ObjectSchema< export declare namespace InventoryAdjustment { export interface Raw { id?: string | null; - reference_id?: (string | null | undefined) | null; + reference_id?: (string | null) | null; from_state?: InventoryState.Raw | null; to_state?: InventoryState.Raw | null; - location_id?: (string | null | undefined) | null; - catalog_object_id?: (string | null | undefined) | null; - catalog_object_type?: (string | null | undefined) | null; - quantity?: (string | null | undefined) | null; + location_id?: (string | null) | null; + catalog_object_id?: (string | null) | null; + catalog_object_type?: (string | null) | null; + quantity?: (string | null) | null; total_price_money?: Money.Raw | null; - occurred_at?: (string | null | undefined) | null; + occurred_at?: (string | null) | null; created_at?: string | null; source?: SourceApplication.Raw | null; - employee_id?: (string | null | undefined) | null; - team_member_id?: (string | null | undefined) | null; + employee_id?: (string | null) | null; + team_member_id?: (string | null) | null; transaction_id?: string | null; refund_id?: string | null; purchase_order_id?: string | null; diff --git a/src/serialization/types/InventoryAdjustmentGroup.ts b/src/serialization/types/InventoryAdjustmentGroup.ts index 5adc519cd..d32aa7ef2 100644 --- a/src/serialization/types/InventoryAdjustmentGroup.ts +++ b/src/serialization/types/InventoryAdjustmentGroup.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { InventoryState } from "./InventoryState"; export const InventoryAdjustmentGroup: core.serialization.ObjectSchema< diff --git a/src/serialization/types/InventoryAlertType.ts b/src/serialization/types/InventoryAlertType.ts index a68e59c2e..d89842f58 100644 --- a/src/serialization/types/InventoryAlertType.ts +++ b/src/serialization/types/InventoryAlertType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const InventoryAlertType: core.serialization.Schema< serializers.InventoryAlertType.Raw, diff --git a/src/serialization/types/InventoryChange.ts b/src/serialization/types/InventoryChange.ts index da96b6a37..ef50a81b7 100644 --- a/src/serialization/types/InventoryChange.ts +++ b/src/serialization/types/InventoryChange.ts @@ -1,13 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { CatalogMeasurementUnit } from "./CatalogMeasurementUnit"; -import { InventoryAdjustment } from "./InventoryAdjustment"; import { InventoryChangeType } from "./InventoryChangeType"; import { InventoryPhysicalCount } from "./InventoryPhysicalCount"; +import { InventoryAdjustment } from "./InventoryAdjustment"; import { InventoryTransfer } from "./InventoryTransfer"; +import { CatalogMeasurementUnit } from "./CatalogMeasurementUnit"; export const InventoryChange: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/InventoryChangeType.ts b/src/serialization/types/InventoryChangeType.ts index 384938781..6598bec3a 100644 --- a/src/serialization/types/InventoryChangeType.ts +++ b/src/serialization/types/InventoryChangeType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const InventoryChangeType: core.serialization.Schema< serializers.InventoryChangeType.Raw, diff --git a/src/serialization/types/InventoryCount.ts b/src/serialization/types/InventoryCount.ts index 44f8582c7..5bc02050e 100644 --- a/src/serialization/types/InventoryCount.ts +++ b/src/serialization/types/InventoryCount.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { InventoryState } from "./InventoryState"; export const InventoryCount: core.serialization.ObjectSchema = @@ -24,11 +26,11 @@ export const InventoryCount: core.serialization.ObjectSchema = core.serialization.enum_([ diff --git a/src/serialization/types/InventoryTransfer.ts b/src/serialization/types/InventoryTransfer.ts index 57ba1005c..27a01f6ad 100644 --- a/src/serialization/types/InventoryTransfer.ts +++ b/src/serialization/types/InventoryTransfer.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { InventoryState } from "./InventoryState"; import { SourceApplication } from "./SourceApplication"; @@ -31,17 +33,17 @@ export const InventoryTransfer: core.serialization.ObjectSchema< export declare namespace InventoryTransfer { export interface Raw { id?: string | null; - reference_id?: (string | null | undefined) | null; + reference_id?: (string | null) | null; state?: InventoryState.Raw | null; - from_location_id?: (string | null | undefined) | null; - to_location_id?: (string | null | undefined) | null; - catalog_object_id?: (string | null | undefined) | null; - catalog_object_type?: (string | null | undefined) | null; - quantity?: (string | null | undefined) | null; - occurred_at?: (string | null | undefined) | null; + from_location_id?: (string | null) | null; + to_location_id?: (string | null) | null; + catalog_object_id?: (string | null) | null; + catalog_object_type?: (string | null) | null; + quantity?: (string | null) | null; + occurred_at?: (string | null) | null; created_at?: string | null; source?: SourceApplication.Raw | null; - employee_id?: (string | null | undefined) | null; - team_member_id?: (string | null | undefined) | null; + employee_id?: (string | null) | null; + team_member_id?: (string | null) | null; } } diff --git a/src/serialization/types/Invoice.ts b/src/serialization/types/Invoice.ts index ce7542211..cefcdd375 100644 --- a/src/serialization/types/Invoice.ts +++ b/src/serialization/types/Invoice.ts @@ -1,16 +1,18 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { InvoiceAcceptedPaymentMethods } from "./InvoiceAcceptedPaymentMethods"; -import { InvoiceAttachment } from "./InvoiceAttachment"; -import { InvoiceCustomField } from "./InvoiceCustomField"; -import { InvoiceDeliveryMethod } from "./InvoiceDeliveryMethod"; -import { InvoicePaymentRequest } from "./InvoicePaymentRequest"; import { InvoiceRecipient } from "./InvoiceRecipient"; -import { InvoiceStatus } from "./InvoiceStatus"; +import { InvoicePaymentRequest } from "./InvoicePaymentRequest"; +import { InvoiceDeliveryMethod } from "./InvoiceDeliveryMethod"; import { Money } from "./Money"; +import { InvoiceStatus } from "./InvoiceStatus"; +import { InvoiceAcceptedPaymentMethods } from "./InvoiceAcceptedPaymentMethods"; +import { InvoiceCustomField } from "./InvoiceCustomField"; +import { InvoiceAttachment } from "./InvoiceAttachment"; export const Invoice: core.serialization.ObjectSchema = core.serialization.object({ @@ -66,15 +68,15 @@ export declare namespace Invoice { export interface Raw { id?: string | null; version?: number | null; - location_id?: (string | null | undefined) | null; - order_id?: (string | null | undefined) | null; + location_id?: (string | null) | null; + order_id?: (string | null) | null; primary_recipient?: InvoiceRecipient.Raw | null; - payment_requests?: (InvoicePaymentRequest.Raw[] | null | undefined) | null; + payment_requests?: (InvoicePaymentRequest.Raw[] | null) | null; delivery_method?: InvoiceDeliveryMethod.Raw | null; - invoice_number?: (string | null | undefined) | null; - title?: (string | null | undefined) | null; - description?: (string | null | undefined) | null; - scheduled_at?: (string | null | undefined) | null; + invoice_number?: (string | null) | null; + title?: (string | null) | null; + description?: (string | null) | null; + scheduled_at?: (string | null) | null; public_url?: string | null; next_payment_amount_money?: Money.Raw | null; status?: InvoiceStatus.Raw | null; @@ -82,11 +84,11 @@ export declare namespace Invoice { created_at?: string | null; updated_at?: string | null; accepted_payment_methods?: InvoiceAcceptedPaymentMethods.Raw | null; - custom_fields?: (InvoiceCustomField.Raw[] | null | undefined) | null; + custom_fields?: (InvoiceCustomField.Raw[] | null) | null; subscription_id?: string | null; - sale_or_service_date?: (string | null | undefined) | null; - payment_conditions?: (string | null | undefined) | null; - store_payment_method_enabled?: (boolean | null | undefined) | null; + sale_or_service_date?: (string | null) | null; + payment_conditions?: (string | null) | null; + store_payment_method_enabled?: (boolean | null) | null; attachments?: InvoiceAttachment.Raw[] | null; creator_team_member_id?: string | null; } diff --git a/src/serialization/types/InvoiceAcceptedPaymentMethods.ts b/src/serialization/types/InvoiceAcceptedPaymentMethods.ts index 16eb48467..17a0fc90e 100644 --- a/src/serialization/types/InvoiceAcceptedPaymentMethods.ts +++ b/src/serialization/types/InvoiceAcceptedPaymentMethods.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const InvoiceAcceptedPaymentMethods: core.serialization.ObjectSchema< serializers.InvoiceAcceptedPaymentMethods.Raw, @@ -17,10 +19,10 @@ export const InvoiceAcceptedPaymentMethods: core.serialization.ObjectSchema< export declare namespace InvoiceAcceptedPaymentMethods { export interface Raw { - card?: (boolean | null | undefined) | null; - square_gift_card?: (boolean | null | undefined) | null; - bank_account?: (boolean | null | undefined) | null; - buy_now_pay_later?: (boolean | null | undefined) | null; - cash_app_pay?: (boolean | null | undefined) | null; + card?: (boolean | null) | null; + square_gift_card?: (boolean | null) | null; + bank_account?: (boolean | null) | null; + buy_now_pay_later?: (boolean | null) | null; + cash_app_pay?: (boolean | null) | null; } } diff --git a/src/serialization/types/InvoiceAttachment.ts b/src/serialization/types/InvoiceAttachment.ts index 1ceae0954..8479a3ba1 100644 --- a/src/serialization/types/InvoiceAttachment.ts +++ b/src/serialization/types/InvoiceAttachment.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const InvoiceAttachment: core.serialization.ObjectSchema< serializers.InvoiceAttachment.Raw, diff --git a/src/serialization/types/InvoiceAutomaticPaymentSource.ts b/src/serialization/types/InvoiceAutomaticPaymentSource.ts index c33a48f9b..f40f3b0cb 100644 --- a/src/serialization/types/InvoiceAutomaticPaymentSource.ts +++ b/src/serialization/types/InvoiceAutomaticPaymentSource.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const InvoiceAutomaticPaymentSource: core.serialization.Schema< serializers.InvoiceAutomaticPaymentSource.Raw, diff --git a/src/serialization/types/InvoiceCanceledEvent.ts b/src/serialization/types/InvoiceCanceledEvent.ts index 286a89ae2..dde974a8a 100644 --- a/src/serialization/types/InvoiceCanceledEvent.ts +++ b/src/serialization/types/InvoiceCanceledEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { InvoiceCanceledEventData } from "./InvoiceCanceledEventData"; export const InvoiceCanceledEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const InvoiceCanceledEvent: core.serialization.ObjectSchema< export declare namespace InvoiceCanceledEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: InvoiceCanceledEventData.Raw | null; } diff --git a/src/serialization/types/InvoiceCanceledEventData.ts b/src/serialization/types/InvoiceCanceledEventData.ts index 5bdb9cfe3..8de734272 100644 --- a/src/serialization/types/InvoiceCanceledEventData.ts +++ b/src/serialization/types/InvoiceCanceledEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { InvoiceCanceledEventObject } from "./InvoiceCanceledEventObject"; export const InvoiceCanceledEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const InvoiceCanceledEventData: core.serialization.ObjectSchema< export declare namespace InvoiceCanceledEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: InvoiceCanceledEventObject.Raw | null; } diff --git a/src/serialization/types/InvoiceCanceledEventObject.ts b/src/serialization/types/InvoiceCanceledEventObject.ts index 0b3819d84..65ee37ad2 100644 --- a/src/serialization/types/InvoiceCanceledEventObject.ts +++ b/src/serialization/types/InvoiceCanceledEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Invoice } from "./Invoice"; export const InvoiceCanceledEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/InvoiceCreatedEvent.ts b/src/serialization/types/InvoiceCreatedEvent.ts index 1b7c18e27..d9e40bc13 100644 --- a/src/serialization/types/InvoiceCreatedEvent.ts +++ b/src/serialization/types/InvoiceCreatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { InvoiceCreatedEventData } from "./InvoiceCreatedEventData"; export const InvoiceCreatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const InvoiceCreatedEvent: core.serialization.ObjectSchema< export declare namespace InvoiceCreatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: InvoiceCreatedEventData.Raw | null; } diff --git a/src/serialization/types/InvoiceCreatedEventData.ts b/src/serialization/types/InvoiceCreatedEventData.ts index a5df90058..264b2d10c 100644 --- a/src/serialization/types/InvoiceCreatedEventData.ts +++ b/src/serialization/types/InvoiceCreatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { InvoiceCreatedEventObject } from "./InvoiceCreatedEventObject"; export const InvoiceCreatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const InvoiceCreatedEventData: core.serialization.ObjectSchema< export declare namespace InvoiceCreatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: InvoiceCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/InvoiceCreatedEventObject.ts b/src/serialization/types/InvoiceCreatedEventObject.ts index fa97990b3..e2599d833 100644 --- a/src/serialization/types/InvoiceCreatedEventObject.ts +++ b/src/serialization/types/InvoiceCreatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Invoice } from "./Invoice"; export const InvoiceCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/InvoiceCustomField.ts b/src/serialization/types/InvoiceCustomField.ts index 4a653892c..b68fb4a50 100644 --- a/src/serialization/types/InvoiceCustomField.ts +++ b/src/serialization/types/InvoiceCustomField.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { InvoiceCustomFieldPlacement } from "./InvoiceCustomFieldPlacement"; export const InvoiceCustomField: core.serialization.ObjectSchema< @@ -16,8 +18,8 @@ export const InvoiceCustomField: core.serialization.ObjectSchema< export declare namespace InvoiceCustomField { export interface Raw { - label?: (string | null | undefined) | null; - value?: (string | null | undefined) | null; + label?: (string | null) | null; + value?: (string | null) | null; placement?: InvoiceCustomFieldPlacement.Raw | null; } } diff --git a/src/serialization/types/InvoiceCustomFieldPlacement.ts b/src/serialization/types/InvoiceCustomFieldPlacement.ts index 5a1085a94..65e63c445 100644 --- a/src/serialization/types/InvoiceCustomFieldPlacement.ts +++ b/src/serialization/types/InvoiceCustomFieldPlacement.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const InvoiceCustomFieldPlacement: core.serialization.Schema< serializers.InvoiceCustomFieldPlacement.Raw, diff --git a/src/serialization/types/InvoiceDeletedEvent.ts b/src/serialization/types/InvoiceDeletedEvent.ts index c27491bab..ce27bea56 100644 --- a/src/serialization/types/InvoiceDeletedEvent.ts +++ b/src/serialization/types/InvoiceDeletedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { InvoiceDeletedEventData } from "./InvoiceDeletedEventData"; export const InvoiceDeletedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const InvoiceDeletedEvent: core.serialization.ObjectSchema< export declare namespace InvoiceDeletedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: InvoiceDeletedEventData.Raw | null; } diff --git a/src/serialization/types/InvoiceDeletedEventData.ts b/src/serialization/types/InvoiceDeletedEventData.ts index fd835acb8..13530b55b 100644 --- a/src/serialization/types/InvoiceDeletedEventData.ts +++ b/src/serialization/types/InvoiceDeletedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const InvoiceDeletedEventData: core.serialization.ObjectSchema< serializers.InvoiceDeletedEventData.Raw, @@ -15,8 +17,8 @@ export const InvoiceDeletedEventData: core.serialization.ObjectSchema< export declare namespace InvoiceDeletedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; - deleted?: (boolean | null | undefined) | null; + deleted?: (boolean | null) | null; } } diff --git a/src/serialization/types/InvoiceDeliveryMethod.ts b/src/serialization/types/InvoiceDeliveryMethod.ts index 38f5a2249..42ecaeb2d 100644 --- a/src/serialization/types/InvoiceDeliveryMethod.ts +++ b/src/serialization/types/InvoiceDeliveryMethod.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const InvoiceDeliveryMethod: core.serialization.Schema< serializers.InvoiceDeliveryMethod.Raw, diff --git a/src/serialization/types/InvoiceFilter.ts b/src/serialization/types/InvoiceFilter.ts index f7ffb3734..2660f6970 100644 --- a/src/serialization/types/InvoiceFilter.ts +++ b/src/serialization/types/InvoiceFilter.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const InvoiceFilter: core.serialization.ObjectSchema = core.serialization.object({ @@ -16,6 +18,6 @@ export const InvoiceFilter: core.serialization.ObjectSchema = core.serialization.stringLiteral("INVOICE_SORT_DATE"); diff --git a/src/serialization/types/InvoiceStatus.ts b/src/serialization/types/InvoiceStatus.ts index da8962573..0d5019adb 100644 --- a/src/serialization/types/InvoiceStatus.ts +++ b/src/serialization/types/InvoiceStatus.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const InvoiceStatus: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/InvoiceUpdatedEvent.ts b/src/serialization/types/InvoiceUpdatedEvent.ts index ef61ece76..11a6e1e61 100644 --- a/src/serialization/types/InvoiceUpdatedEvent.ts +++ b/src/serialization/types/InvoiceUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { InvoiceUpdatedEventData } from "./InvoiceUpdatedEventData"; export const InvoiceUpdatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const InvoiceUpdatedEvent: core.serialization.ObjectSchema< export declare namespace InvoiceUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: InvoiceUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/InvoiceUpdatedEventData.ts b/src/serialization/types/InvoiceUpdatedEventData.ts index 766cf7138..ce58d91bb 100644 --- a/src/serialization/types/InvoiceUpdatedEventData.ts +++ b/src/serialization/types/InvoiceUpdatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { InvoiceUpdatedEventObject } from "./InvoiceUpdatedEventObject"; export const InvoiceUpdatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const InvoiceUpdatedEventData: core.serialization.ObjectSchema< export declare namespace InvoiceUpdatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: InvoiceUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/InvoiceUpdatedEventObject.ts b/src/serialization/types/InvoiceUpdatedEventObject.ts index 1638fe927..00246a6d1 100644 --- a/src/serialization/types/InvoiceUpdatedEventObject.ts +++ b/src/serialization/types/InvoiceUpdatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Invoice } from "./Invoice"; export const InvoiceUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/ItemVariationLocationOverrides.ts b/src/serialization/types/ItemVariationLocationOverrides.ts index 7ae89dcb6..f960fa211 100644 --- a/src/serialization/types/ItemVariationLocationOverrides.ts +++ b/src/serialization/types/ItemVariationLocationOverrides.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; +import { Money } from "./Money"; import { CatalogPricingType } from "./CatalogPricingType"; import { InventoryAlertType } from "./InventoryAlertType"; -import { Money } from "./Money"; export const ItemVariationLocationOverrides: core.serialization.ObjectSchema< serializers.ItemVariationLocationOverrides.Raw, @@ -26,12 +28,12 @@ export const ItemVariationLocationOverrides: core.serialization.ObjectSchema< export declare namespace ItemVariationLocationOverrides { export interface Raw { - location_id?: (string | null | undefined) | null; + location_id?: (string | null) | null; price_money?: Money.Raw | null; pricing_type?: CatalogPricingType.Raw | null; - track_inventory?: (boolean | null | undefined) | null; + track_inventory?: (boolean | null) | null; inventory_alert_type?: InventoryAlertType.Raw | null; - inventory_alert_threshold?: ((bigint | number) | null | undefined) | null; + inventory_alert_threshold?: ((bigint | number) | null) | null; sold_out?: boolean | null; sold_out_valid_until?: string | null; } diff --git a/src/serialization/types/Job.ts b/src/serialization/types/Job.ts index 35a046b9b..8e0104ca1 100644 --- a/src/serialization/types/Job.ts +++ b/src/serialization/types/Job.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const Job: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string().optional(), @@ -16,8 +18,8 @@ export const Job: core.serialization.ObjectSchema = @@ -16,9 +18,9 @@ export const JobCreatedEvent: core.serialization.ObjectSchema = @@ -16,9 +18,9 @@ export const JobUpdatedEvent: core.serialization.ObjectSchema = core.serialization.stringLiteral("MAX_PAGE_SIZE"); - -export declare namespace ListChannelsRequestConstants { - export type Raw = "MAX_PAGE_SIZE"; -} diff --git a/src/serialization/types/ListChannelsResponse.ts b/src/serialization/types/ListChannelsResponse.ts deleted file mode 100644 index 58c24e665..000000000 --- a/src/serialization/types/ListChannelsResponse.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { Channel } from "./Channel"; -import { Error_ } from "./Error_"; - -export const ListChannelsResponse: core.serialization.ObjectSchema< - serializers.ListChannelsResponse.Raw, - Square.ListChannelsResponse -> = core.serialization.object({ - errors: core.serialization.list(Error_).optional(), - channels: core.serialization.list(Channel).optional(), - cursor: core.serialization.string().optional(), -}); - -export declare namespace ListChannelsResponse { - export interface Raw { - errors?: Error_.Raw[] | null; - channels?: Channel.Raw[] | null; - cursor?: string | null; - } -} diff --git a/src/serialization/types/ListCustomerCustomAttributeDefinitionsResponse.ts b/src/serialization/types/ListCustomerCustomAttributeDefinitionsResponse.ts index 4e7ad2005..d73872e4f 100644 --- a/src/serialization/types/ListCustomerCustomAttributeDefinitionsResponse.ts +++ b/src/serialization/types/ListCustomerCustomAttributeDefinitionsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/ListCustomerCustomAttributesResponse.ts b/src/serialization/types/ListCustomerCustomAttributesResponse.ts index c053c55c1..ef66ceeaf 100644 --- a/src/serialization/types/ListCustomerCustomAttributesResponse.ts +++ b/src/serialization/types/ListCustomerCustomAttributesResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/ListCustomerGroupsResponse.ts b/src/serialization/types/ListCustomerGroupsResponse.ts index c189d0099..c8e2b0a90 100644 --- a/src/serialization/types/ListCustomerGroupsResponse.ts +++ b/src/serialization/types/ListCustomerGroupsResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { CustomerGroup } from "./CustomerGroup"; import { Error_ } from "./Error_"; +import { CustomerGroup } from "./CustomerGroup"; export const ListCustomerGroupsResponse: core.serialization.ObjectSchema< serializers.ListCustomerGroupsResponse.Raw, diff --git a/src/serialization/types/ListCustomerSegmentsResponse.ts b/src/serialization/types/ListCustomerSegmentsResponse.ts index 2af0e8932..e6f3c59b8 100644 --- a/src/serialization/types/ListCustomerSegmentsResponse.ts +++ b/src/serialization/types/ListCustomerSegmentsResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { CustomerSegment } from "./CustomerSegment"; import { Error_ } from "./Error_"; +import { CustomerSegment } from "./CustomerSegment"; export const ListCustomerSegmentsResponse: core.serialization.ObjectSchema< serializers.ListCustomerSegmentsResponse.Raw, diff --git a/src/serialization/types/ListCustomersResponse.ts b/src/serialization/types/ListCustomersResponse.ts index 4ecc9dae4..697809709 100644 --- a/src/serialization/types/ListCustomersResponse.ts +++ b/src/serialization/types/ListCustomersResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Customer } from "./Customer"; import { Error_ } from "./Error_"; +import { Customer } from "./Customer"; export const ListCustomersResponse: core.serialization.ObjectSchema< serializers.ListCustomersResponse.Raw, diff --git a/src/serialization/types/ListDeviceCodesResponse.ts b/src/serialization/types/ListDeviceCodesResponse.ts index 717d86839..67bd8848f 100644 --- a/src/serialization/types/ListDeviceCodesResponse.ts +++ b/src/serialization/types/ListDeviceCodesResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { DeviceCode } from "./DeviceCode"; import { Error_ } from "./Error_"; +import { DeviceCode } from "./DeviceCode"; export const ListDeviceCodesResponse: core.serialization.ObjectSchema< serializers.ListDeviceCodesResponse.Raw, diff --git a/src/serialization/types/ListDevicesResponse.ts b/src/serialization/types/ListDevicesResponse.ts index 6da1b5ef0..cd6940182 100644 --- a/src/serialization/types/ListDevicesResponse.ts +++ b/src/serialization/types/ListDevicesResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Device } from "./Device"; import { Error_ } from "./Error_"; +import { Device } from "./Device"; export const ListDevicesResponse: core.serialization.ObjectSchema< serializers.ListDevicesResponse.Raw, diff --git a/src/serialization/types/ListDisputeEvidenceResponse.ts b/src/serialization/types/ListDisputeEvidenceResponse.ts index ba637adf9..e9788cd53 100644 --- a/src/serialization/types/ListDisputeEvidenceResponse.ts +++ b/src/serialization/types/ListDisputeEvidenceResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { DisputeEvidence } from "./DisputeEvidence"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/ListDisputesResponse.ts b/src/serialization/types/ListDisputesResponse.ts index e53e80995..84a1eaa91 100644 --- a/src/serialization/types/ListDisputesResponse.ts +++ b/src/serialization/types/ListDisputesResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Dispute } from "./Dispute"; import { Error_ } from "./Error_"; +import { Dispute } from "./Dispute"; export const ListDisputesResponse: core.serialization.ObjectSchema< serializers.ListDisputesResponse.Raw, diff --git a/src/serialization/types/ListEmployeeWagesResponse.ts b/src/serialization/types/ListEmployeeWagesResponse.ts index c317b9f2d..d6143cbdb 100644 --- a/src/serialization/types/ListEmployeeWagesResponse.ts +++ b/src/serialization/types/ListEmployeeWagesResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { EmployeeWage } from "./EmployeeWage"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/ListEmployeesResponse.ts b/src/serialization/types/ListEmployeesResponse.ts index 8d7cc15be..77807351e 100644 --- a/src/serialization/types/ListEmployeesResponse.ts +++ b/src/serialization/types/ListEmployeesResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Employee } from "./Employee"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/ListEventTypesResponse.ts b/src/serialization/types/ListEventTypesResponse.ts index 08f207f67..928ab03c9 100644 --- a/src/serialization/types/ListEventTypesResponse.ts +++ b/src/serialization/types/ListEventTypesResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { EventTypeMetadata } from "./EventTypeMetadata"; diff --git a/src/serialization/types/ListGiftCardActivitiesResponse.ts b/src/serialization/types/ListGiftCardActivitiesResponse.ts index e0bb1cbfb..4b120a9dc 100644 --- a/src/serialization/types/ListGiftCardActivitiesResponse.ts +++ b/src/serialization/types/ListGiftCardActivitiesResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { GiftCardActivity } from "./GiftCardActivity"; diff --git a/src/serialization/types/ListGiftCardsResponse.ts b/src/serialization/types/ListGiftCardsResponse.ts index bd74eb8da..c3404662a 100644 --- a/src/serialization/types/ListGiftCardsResponse.ts +++ b/src/serialization/types/ListGiftCardsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { GiftCard } from "./GiftCard"; diff --git a/src/serialization/types/ListInvoicesResponse.ts b/src/serialization/types/ListInvoicesResponse.ts index 220c453c1..7397ad716 100644 --- a/src/serialization/types/ListInvoicesResponse.ts +++ b/src/serialization/types/ListInvoicesResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Invoice } from "./Invoice"; +import { Error_ } from "./Error_"; export const ListInvoicesResponse: core.serialization.ObjectSchema< serializers.ListInvoicesResponse.Raw, diff --git a/src/serialization/types/ListJobsResponse.ts b/src/serialization/types/ListJobsResponse.ts index a122941b4..40768cd12 100644 --- a/src/serialization/types/ListJobsResponse.ts +++ b/src/serialization/types/ListJobsResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Job } from "./Job"; +import { Error_ } from "./Error_"; export const ListJobsResponse: core.serialization.ObjectSchema< serializers.ListJobsResponse.Raw, diff --git a/src/serialization/types/ListLocationBookingProfilesResponse.ts b/src/serialization/types/ListLocationBookingProfilesResponse.ts index cf98f29de..1bf45e1b1 100644 --- a/src/serialization/types/ListLocationBookingProfilesResponse.ts +++ b/src/serialization/types/ListLocationBookingProfilesResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { LocationBookingProfile } from "./LocationBookingProfile"; +import { Error_ } from "./Error_"; export const ListLocationBookingProfilesResponse: core.serialization.ObjectSchema< serializers.ListLocationBookingProfilesResponse.Raw, diff --git a/src/serialization/types/ListLocationCustomAttributeDefinitionsResponse.ts b/src/serialization/types/ListLocationCustomAttributeDefinitionsResponse.ts index b631ecea4..a5ed1021b 100644 --- a/src/serialization/types/ListLocationCustomAttributeDefinitionsResponse.ts +++ b/src/serialization/types/ListLocationCustomAttributeDefinitionsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/ListLocationCustomAttributesResponse.ts b/src/serialization/types/ListLocationCustomAttributesResponse.ts index 96d6b21fc..0866efabd 100644 --- a/src/serialization/types/ListLocationCustomAttributesResponse.ts +++ b/src/serialization/types/ListLocationCustomAttributesResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/ListLocationsResponse.ts b/src/serialization/types/ListLocationsResponse.ts index 5fff4be0f..877b12961 100644 --- a/src/serialization/types/ListLocationsResponse.ts +++ b/src/serialization/types/ListLocationsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Location } from "./Location"; diff --git a/src/serialization/types/ListLoyaltyProgramsResponse.ts b/src/serialization/types/ListLoyaltyProgramsResponse.ts index 9b6b19845..85b9e0855 100644 --- a/src/serialization/types/ListLoyaltyProgramsResponse.ts +++ b/src/serialization/types/ListLoyaltyProgramsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyProgram } from "./LoyaltyProgram"; diff --git a/src/serialization/types/ListLoyaltyPromotionsResponse.ts b/src/serialization/types/ListLoyaltyPromotionsResponse.ts index 0001c55f5..90889f9a2 100644 --- a/src/serialization/types/ListLoyaltyPromotionsResponse.ts +++ b/src/serialization/types/ListLoyaltyPromotionsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyPromotion } from "./LoyaltyPromotion"; diff --git a/src/serialization/types/ListMerchantCustomAttributeDefinitionsResponse.ts b/src/serialization/types/ListMerchantCustomAttributeDefinitionsResponse.ts index 7d6e0fef1..97bcd71bd 100644 --- a/src/serialization/types/ListMerchantCustomAttributeDefinitionsResponse.ts +++ b/src/serialization/types/ListMerchantCustomAttributeDefinitionsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/ListMerchantCustomAttributesResponse.ts b/src/serialization/types/ListMerchantCustomAttributesResponse.ts index fa0f4fd80..bdc90edc2 100644 --- a/src/serialization/types/ListMerchantCustomAttributesResponse.ts +++ b/src/serialization/types/ListMerchantCustomAttributesResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/ListMerchantsResponse.ts b/src/serialization/types/ListMerchantsResponse.ts index af1001007..5129540da 100644 --- a/src/serialization/types/ListMerchantsResponse.ts +++ b/src/serialization/types/ListMerchantsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Merchant } from "./Merchant"; diff --git a/src/serialization/types/ListOrderCustomAttributeDefinitionsResponse.ts b/src/serialization/types/ListOrderCustomAttributeDefinitionsResponse.ts index 3bd88de6b..25c06a63e 100644 --- a/src/serialization/types/ListOrderCustomAttributeDefinitionsResponse.ts +++ b/src/serialization/types/ListOrderCustomAttributeDefinitionsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/ListOrderCustomAttributesResponse.ts b/src/serialization/types/ListOrderCustomAttributesResponse.ts index 6f535c213..e1a445ef3 100644 --- a/src/serialization/types/ListOrderCustomAttributesResponse.ts +++ b/src/serialization/types/ListOrderCustomAttributesResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/ListPaymentLinksResponse.ts b/src/serialization/types/ListPaymentLinksResponse.ts index ab6d19abe..b5eaf0acf 100644 --- a/src/serialization/types/ListPaymentLinksResponse.ts +++ b/src/serialization/types/ListPaymentLinksResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { PaymentLink } from "./PaymentLink"; diff --git a/src/serialization/types/ListPaymentRefundsRequestSortField.ts b/src/serialization/types/ListPaymentRefundsRequestSortField.ts index 1196eace3..2f8f790b8 100644 --- a/src/serialization/types/ListPaymentRefundsRequestSortField.ts +++ b/src/serialization/types/ListPaymentRefundsRequestSortField.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ListPaymentRefundsRequestSortField: core.serialization.Schema< serializers.ListPaymentRefundsRequestSortField.Raw, diff --git a/src/serialization/types/ListPaymentRefundsResponse.ts b/src/serialization/types/ListPaymentRefundsResponse.ts index 24aa7baa8..8ce9c8655 100644 --- a/src/serialization/types/ListPaymentRefundsResponse.ts +++ b/src/serialization/types/ListPaymentRefundsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { PaymentRefund } from "./PaymentRefund"; diff --git a/src/serialization/types/ListPaymentsRequestSortField.ts b/src/serialization/types/ListPaymentsRequestSortField.ts index da645c8c7..07efc7589 100644 --- a/src/serialization/types/ListPaymentsRequestSortField.ts +++ b/src/serialization/types/ListPaymentsRequestSortField.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ListPaymentsRequestSortField: core.serialization.Schema< serializers.ListPaymentsRequestSortField.Raw, diff --git a/src/serialization/types/ListPaymentsResponse.ts b/src/serialization/types/ListPaymentsResponse.ts index 04057e27c..e7aaddf4a 100644 --- a/src/serialization/types/ListPaymentsResponse.ts +++ b/src/serialization/types/ListPaymentsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Payment } from "./Payment"; diff --git a/src/serialization/types/ListPayoutEntriesResponse.ts b/src/serialization/types/ListPayoutEntriesResponse.ts index 5281111cc..55da07c34 100644 --- a/src/serialization/types/ListPayoutEntriesResponse.ts +++ b/src/serialization/types/ListPayoutEntriesResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { PayoutEntry } from "./PayoutEntry"; +import { Error_ } from "./Error_"; export const ListPayoutEntriesResponse: core.serialization.ObjectSchema< serializers.ListPayoutEntriesResponse.Raw, diff --git a/src/serialization/types/ListPayoutsResponse.ts b/src/serialization/types/ListPayoutsResponse.ts index e4b2779d2..94bd7a835 100644 --- a/src/serialization/types/ListPayoutsResponse.ts +++ b/src/serialization/types/ListPayoutsResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Payout } from "./Payout"; +import { Error_ } from "./Error_"; export const ListPayoutsResponse: core.serialization.ObjectSchema< serializers.ListPayoutsResponse.Raw, diff --git a/src/serialization/types/ListSitesResponse.ts b/src/serialization/types/ListSitesResponse.ts index 970d9460f..557dc290c 100644 --- a/src/serialization/types/ListSitesResponse.ts +++ b/src/serialization/types/ListSitesResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Site } from "./Site"; diff --git a/src/serialization/types/ListSubscriptionEventsResponse.ts b/src/serialization/types/ListSubscriptionEventsResponse.ts index 6b293dc4e..55be5a067 100644 --- a/src/serialization/types/ListSubscriptionEventsResponse.ts +++ b/src/serialization/types/ListSubscriptionEventsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { SubscriptionEvent } from "./SubscriptionEvent"; diff --git a/src/serialization/types/ListTeamMemberBookingProfilesResponse.ts b/src/serialization/types/ListTeamMemberBookingProfilesResponse.ts index 557bd6089..8cf951929 100644 --- a/src/serialization/types/ListTeamMemberBookingProfilesResponse.ts +++ b/src/serialization/types/ListTeamMemberBookingProfilesResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { TeamMemberBookingProfile } from "./TeamMemberBookingProfile"; +import { Error_ } from "./Error_"; export const ListTeamMemberBookingProfilesResponse: core.serialization.ObjectSchema< serializers.ListTeamMemberBookingProfilesResponse.Raw, diff --git a/src/serialization/types/ListTeamMemberWagesResponse.ts b/src/serialization/types/ListTeamMemberWagesResponse.ts index dc8207116..3b5d52b44 100644 --- a/src/serialization/types/ListTeamMemberWagesResponse.ts +++ b/src/serialization/types/ListTeamMemberWagesResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { TeamMemberWage } from "./TeamMemberWage"; +import { Error_ } from "./Error_"; export const ListTeamMemberWagesResponse: core.serialization.ObjectSchema< serializers.ListTeamMemberWagesResponse.Raw, diff --git a/src/serialization/types/ListTransactionsResponse.ts b/src/serialization/types/ListTransactionsResponse.ts index 12fe6c13e..219aaedd3 100644 --- a/src/serialization/types/ListTransactionsResponse.ts +++ b/src/serialization/types/ListTransactionsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Transaction } from "./Transaction"; diff --git a/src/serialization/types/ListWebhookEventTypesResponse.ts b/src/serialization/types/ListWebhookEventTypesResponse.ts index b58b10e7f..a0d1c8bbb 100644 --- a/src/serialization/types/ListWebhookEventTypesResponse.ts +++ b/src/serialization/types/ListWebhookEventTypesResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { EventTypeMetadata } from "./EventTypeMetadata"; diff --git a/src/serialization/types/ListWebhookSubscriptionsResponse.ts b/src/serialization/types/ListWebhookSubscriptionsResponse.ts index 8fbce8824..331d5e18a 100644 --- a/src/serialization/types/ListWebhookSubscriptionsResponse.ts +++ b/src/serialization/types/ListWebhookSubscriptionsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { WebhookSubscription } from "./WebhookSubscription"; diff --git a/src/serialization/types/ListWorkweekConfigsResponse.ts b/src/serialization/types/ListWorkweekConfigsResponse.ts index 72ce54d75..ab9d168d1 100644 --- a/src/serialization/types/ListWorkweekConfigsResponse.ts +++ b/src/serialization/types/ListWorkweekConfigsResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { WorkweekConfig } from "./WorkweekConfig"; +import { Error_ } from "./Error_"; export const ListWorkweekConfigsResponse: core.serialization.ObjectSchema< serializers.ListWorkweekConfigsResponse.Raw, diff --git a/src/serialization/types/Location.ts b/src/serialization/types/Location.ts index 374284914..699cf9ea9 100644 --- a/src/serialization/types/Location.ts +++ b/src/serialization/types/Location.ts @@ -1,16 +1,18 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Address } from "./Address"; -import { BusinessHours } from "./BusinessHours"; -import { Coordinates } from "./Coordinates"; -import { Country } from "./Country"; -import { Currency } from "./Currency"; import { LocationCapability } from "./LocationCapability"; import { LocationStatus } from "./LocationStatus"; +import { Country } from "./Country"; +import { Currency } from "./Currency"; import { LocationType } from "./LocationType"; +import { BusinessHours } from "./BusinessHours"; +import { Coordinates } from "./Coordinates"; import { TaxIds } from "./TaxIds"; export const Location: core.serialization.ObjectSchema = @@ -53,30 +55,30 @@ export const Location: core.serialization.ObjectSchema = core.serialization.enum_(["ACTIVE", "INACTIVE"]); diff --git a/src/serialization/types/LocationType.ts b/src/serialization/types/LocationType.ts index 62380a5aa..d2003c9d2 100644 --- a/src/serialization/types/LocationType.ts +++ b/src/serialization/types/LocationType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LocationType: core.serialization.Schema = core.serialization.enum_(["PHYSICAL", "MOBILE"]); diff --git a/src/serialization/types/LocationUpdatedEvent.ts b/src/serialization/types/LocationUpdatedEvent.ts index b062c2e74..7604abbb9 100644 --- a/src/serialization/types/LocationUpdatedEvent.ts +++ b/src/serialization/types/LocationUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LocationUpdatedEventData } from "./LocationUpdatedEventData"; export const LocationUpdatedEvent: core.serialization.ObjectSchema< @@ -19,10 +21,10 @@ export const LocationUpdatedEvent: core.serialization.ObjectSchema< export declare namespace LocationUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - location_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + location_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: LocationUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/LocationUpdatedEventData.ts b/src/serialization/types/LocationUpdatedEventData.ts index c319cfcc2..c46891648 100644 --- a/src/serialization/types/LocationUpdatedEventData.ts +++ b/src/serialization/types/LocationUpdatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LocationUpdatedEventData: core.serialization.ObjectSchema< serializers.LocationUpdatedEventData.Raw, @@ -14,7 +16,7 @@ export const LocationUpdatedEventData: core.serialization.ObjectSchema< export declare namespace LocationUpdatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; } } diff --git a/src/serialization/types/LoyaltyAccount.ts b/src/serialization/types/LoyaltyAccount.ts index f9d565fce..78a50fcf0 100644 --- a/src/serialization/types/LoyaltyAccount.ts +++ b/src/serialization/types/LoyaltyAccount.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { LoyaltyAccountExpiringPointDeadline } from "./LoyaltyAccountExpiringPointDeadline"; import { LoyaltyAccountMapping } from "./LoyaltyAccountMapping"; +import { LoyaltyAccountExpiringPointDeadline } from "./LoyaltyAccountExpiringPointDeadline"; export const LoyaltyAccount: core.serialization.ObjectSchema = core.serialization.object({ @@ -29,11 +31,11 @@ export declare namespace LoyaltyAccount { program_id: string; balance?: number | null; lifetime_points?: number | null; - customer_id?: (string | null | undefined) | null; - enrolled_at?: (string | null | undefined) | null; + customer_id?: (string | null) | null; + enrolled_at?: (string | null) | null; created_at?: string | null; updated_at?: string | null; mapping?: LoyaltyAccountMapping.Raw | null; - expiring_point_deadlines?: (LoyaltyAccountExpiringPointDeadline.Raw[] | null | undefined) | null; + expiring_point_deadlines?: (LoyaltyAccountExpiringPointDeadline.Raw[] | null) | null; } } diff --git a/src/serialization/types/LoyaltyAccountCreatedEvent.ts b/src/serialization/types/LoyaltyAccountCreatedEvent.ts index 7bbd1fa23..a2493dc53 100644 --- a/src/serialization/types/LoyaltyAccountCreatedEvent.ts +++ b/src/serialization/types/LoyaltyAccountCreatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyAccountCreatedEventData } from "./LoyaltyAccountCreatedEventData"; export const LoyaltyAccountCreatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const LoyaltyAccountCreatedEvent: core.serialization.ObjectSchema< export declare namespace LoyaltyAccountCreatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: LoyaltyAccountCreatedEventData.Raw | null; } diff --git a/src/serialization/types/LoyaltyAccountCreatedEventData.ts b/src/serialization/types/LoyaltyAccountCreatedEventData.ts index f2cd45407..2845ba72c 100644 --- a/src/serialization/types/LoyaltyAccountCreatedEventData.ts +++ b/src/serialization/types/LoyaltyAccountCreatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyAccountCreatedEventObject } from "./LoyaltyAccountCreatedEventObject"; export const LoyaltyAccountCreatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const LoyaltyAccountCreatedEventData: core.serialization.ObjectSchema< export declare namespace LoyaltyAccountCreatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: LoyaltyAccountCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/LoyaltyAccountCreatedEventObject.ts b/src/serialization/types/LoyaltyAccountCreatedEventObject.ts index 03c628394..ceb16bfca 100644 --- a/src/serialization/types/LoyaltyAccountCreatedEventObject.ts +++ b/src/serialization/types/LoyaltyAccountCreatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyAccount } from "./LoyaltyAccount"; export const LoyaltyAccountCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyAccountDeletedEvent.ts b/src/serialization/types/LoyaltyAccountDeletedEvent.ts index b37b53334..877fa1328 100644 --- a/src/serialization/types/LoyaltyAccountDeletedEvent.ts +++ b/src/serialization/types/LoyaltyAccountDeletedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyAccountDeletedEventData } from "./LoyaltyAccountDeletedEventData"; export const LoyaltyAccountDeletedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const LoyaltyAccountDeletedEvent: core.serialization.ObjectSchema< export declare namespace LoyaltyAccountDeletedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: LoyaltyAccountDeletedEventData.Raw | null; } diff --git a/src/serialization/types/LoyaltyAccountDeletedEventData.ts b/src/serialization/types/LoyaltyAccountDeletedEventData.ts index b8801da40..3cfa1878d 100644 --- a/src/serialization/types/LoyaltyAccountDeletedEventData.ts +++ b/src/serialization/types/LoyaltyAccountDeletedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyAccountDeletedEventObject } from "./LoyaltyAccountDeletedEventObject"; export const LoyaltyAccountDeletedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const LoyaltyAccountDeletedEventData: core.serialization.ObjectSchema< export declare namespace LoyaltyAccountDeletedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: LoyaltyAccountDeletedEventObject.Raw | null; } diff --git a/src/serialization/types/LoyaltyAccountDeletedEventObject.ts b/src/serialization/types/LoyaltyAccountDeletedEventObject.ts index 82d8f527f..ad10cb8a4 100644 --- a/src/serialization/types/LoyaltyAccountDeletedEventObject.ts +++ b/src/serialization/types/LoyaltyAccountDeletedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyAccount } from "./LoyaltyAccount"; export const LoyaltyAccountDeletedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyAccountExpiringPointDeadline.ts b/src/serialization/types/LoyaltyAccountExpiringPointDeadline.ts index 7c69ff6ac..8da4115ca 100644 --- a/src/serialization/types/LoyaltyAccountExpiringPointDeadline.ts +++ b/src/serialization/types/LoyaltyAccountExpiringPointDeadline.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyAccountExpiringPointDeadline: core.serialization.ObjectSchema< serializers.LoyaltyAccountExpiringPointDeadline.Raw, diff --git a/src/serialization/types/LoyaltyAccountMapping.ts b/src/serialization/types/LoyaltyAccountMapping.ts index 011c71cec..6c3ac7656 100644 --- a/src/serialization/types/LoyaltyAccountMapping.ts +++ b/src/serialization/types/LoyaltyAccountMapping.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyAccountMapping: core.serialization.ObjectSchema< serializers.LoyaltyAccountMapping.Raw, @@ -17,6 +19,6 @@ export declare namespace LoyaltyAccountMapping { export interface Raw { id?: string | null; created_at?: string | null; - phone_number?: (string | null | undefined) | null; + phone_number?: (string | null) | null; } } diff --git a/src/serialization/types/LoyaltyAccountMappingType.ts b/src/serialization/types/LoyaltyAccountMappingType.ts index 80f690ec9..c7d2af17e 100644 --- a/src/serialization/types/LoyaltyAccountMappingType.ts +++ b/src/serialization/types/LoyaltyAccountMappingType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyAccountMappingType: core.serialization.Schema< serializers.LoyaltyAccountMappingType.Raw, diff --git a/src/serialization/types/LoyaltyAccountUpdatedEvent.ts b/src/serialization/types/LoyaltyAccountUpdatedEvent.ts index 1047e9d33..ffe6e38af 100644 --- a/src/serialization/types/LoyaltyAccountUpdatedEvent.ts +++ b/src/serialization/types/LoyaltyAccountUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyAccountUpdatedEventData } from "./LoyaltyAccountUpdatedEventData"; export const LoyaltyAccountUpdatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const LoyaltyAccountUpdatedEvent: core.serialization.ObjectSchema< export declare namespace LoyaltyAccountUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: LoyaltyAccountUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/LoyaltyAccountUpdatedEventData.ts b/src/serialization/types/LoyaltyAccountUpdatedEventData.ts index 05c425030..f3171bd9c 100644 --- a/src/serialization/types/LoyaltyAccountUpdatedEventData.ts +++ b/src/serialization/types/LoyaltyAccountUpdatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyAccountUpdatedEventObject } from "./LoyaltyAccountUpdatedEventObject"; export const LoyaltyAccountUpdatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const LoyaltyAccountUpdatedEventData: core.serialization.ObjectSchema< export declare namespace LoyaltyAccountUpdatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: LoyaltyAccountUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/LoyaltyAccountUpdatedEventObject.ts b/src/serialization/types/LoyaltyAccountUpdatedEventObject.ts index 588229da0..9ab327ced 100644 --- a/src/serialization/types/LoyaltyAccountUpdatedEventObject.ts +++ b/src/serialization/types/LoyaltyAccountUpdatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyAccount } from "./LoyaltyAccount"; export const LoyaltyAccountUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyEvent.ts b/src/serialization/types/LoyaltyEvent.ts index d62607706..4503c375b 100644 --- a/src/serialization/types/LoyaltyEvent.ts +++ b/src/serialization/types/LoyaltyEvent.ts @@ -1,18 +1,20 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; +import { LoyaltyEventType } from "./LoyaltyEventType"; import { LoyaltyEventAccumulatePoints } from "./LoyaltyEventAccumulatePoints"; -import { LoyaltyEventAccumulatePromotionPoints } from "./LoyaltyEventAccumulatePromotionPoints"; -import { LoyaltyEventAdjustPoints } from "./LoyaltyEventAdjustPoints"; import { LoyaltyEventCreateReward } from "./LoyaltyEventCreateReward"; +import { LoyaltyEventRedeemReward } from "./LoyaltyEventRedeemReward"; import { LoyaltyEventDeleteReward } from "./LoyaltyEventDeleteReward"; +import { LoyaltyEventAdjustPoints } from "./LoyaltyEventAdjustPoints"; +import { LoyaltyEventSource } from "./LoyaltyEventSource"; import { LoyaltyEventExpirePoints } from "./LoyaltyEventExpirePoints"; import { LoyaltyEventOther } from "./LoyaltyEventOther"; -import { LoyaltyEventRedeemReward } from "./LoyaltyEventRedeemReward"; -import { LoyaltyEventSource } from "./LoyaltyEventSource"; -import { LoyaltyEventType } from "./LoyaltyEventType"; +import { LoyaltyEventAccumulatePromotionPoints } from "./LoyaltyEventAccumulatePromotionPoints"; export const LoyaltyEvent: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/LoyaltyEventAccumulatePoints.ts b/src/serialization/types/LoyaltyEventAccumulatePoints.ts index 1b30eb735..d04eda5e4 100644 --- a/src/serialization/types/LoyaltyEventAccumulatePoints.ts +++ b/src/serialization/types/LoyaltyEventAccumulatePoints.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyEventAccumulatePoints: core.serialization.ObjectSchema< serializers.LoyaltyEventAccumulatePoints.Raw, @@ -16,7 +18,7 @@ export const LoyaltyEventAccumulatePoints: core.serialization.ObjectSchema< export declare namespace LoyaltyEventAccumulatePoints { export interface Raw { loyalty_program_id?: string | null; - points?: (number | null | undefined) | null; - order_id?: (string | null | undefined) | null; + points?: (number | null) | null; + order_id?: (string | null) | null; } } diff --git a/src/serialization/types/LoyaltyEventAccumulatePromotionPoints.ts b/src/serialization/types/LoyaltyEventAccumulatePromotionPoints.ts index a98987d6b..bae7b7806 100644 --- a/src/serialization/types/LoyaltyEventAccumulatePromotionPoints.ts +++ b/src/serialization/types/LoyaltyEventAccumulatePromotionPoints.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyEventAccumulatePromotionPoints: core.serialization.ObjectSchema< serializers.LoyaltyEventAccumulatePromotionPoints.Raw, diff --git a/src/serialization/types/LoyaltyEventAdjustPoints.ts b/src/serialization/types/LoyaltyEventAdjustPoints.ts index fb71e8fd1..f1be0699c 100644 --- a/src/serialization/types/LoyaltyEventAdjustPoints.ts +++ b/src/serialization/types/LoyaltyEventAdjustPoints.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyEventAdjustPoints: core.serialization.ObjectSchema< serializers.LoyaltyEventAdjustPoints.Raw, @@ -17,6 +19,6 @@ export declare namespace LoyaltyEventAdjustPoints { export interface Raw { loyalty_program_id?: string | null; points: number; - reason?: (string | null | undefined) | null; + reason?: (string | null) | null; } } diff --git a/src/serialization/types/LoyaltyEventCreateReward.ts b/src/serialization/types/LoyaltyEventCreateReward.ts index 5ef82473d..c677f1508 100644 --- a/src/serialization/types/LoyaltyEventCreateReward.ts +++ b/src/serialization/types/LoyaltyEventCreateReward.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyEventCreateReward: core.serialization.ObjectSchema< serializers.LoyaltyEventCreateReward.Raw, diff --git a/src/serialization/types/LoyaltyEventCreatedEvent.ts b/src/serialization/types/LoyaltyEventCreatedEvent.ts index ddedcefc4..21655eb60 100644 --- a/src/serialization/types/LoyaltyEventCreatedEvent.ts +++ b/src/serialization/types/LoyaltyEventCreatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyEventCreatedEventData } from "./LoyaltyEventCreatedEventData"; export const LoyaltyEventCreatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const LoyaltyEventCreatedEvent: core.serialization.ObjectSchema< export declare namespace LoyaltyEventCreatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: LoyaltyEventCreatedEventData.Raw | null; } diff --git a/src/serialization/types/LoyaltyEventCreatedEventData.ts b/src/serialization/types/LoyaltyEventCreatedEventData.ts index b807724bc..65f9620c7 100644 --- a/src/serialization/types/LoyaltyEventCreatedEventData.ts +++ b/src/serialization/types/LoyaltyEventCreatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyEventCreatedEventObject } from "./LoyaltyEventCreatedEventObject"; export const LoyaltyEventCreatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const LoyaltyEventCreatedEventData: core.serialization.ObjectSchema< export declare namespace LoyaltyEventCreatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: LoyaltyEventCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/LoyaltyEventCreatedEventObject.ts b/src/serialization/types/LoyaltyEventCreatedEventObject.ts index 04d87aefa..994636b16 100644 --- a/src/serialization/types/LoyaltyEventCreatedEventObject.ts +++ b/src/serialization/types/LoyaltyEventCreatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyEvent } from "./LoyaltyEvent"; export const LoyaltyEventCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyEventDateTimeFilter.ts b/src/serialization/types/LoyaltyEventDateTimeFilter.ts index 5ffd775d5..c8675f7a3 100644 --- a/src/serialization/types/LoyaltyEventDateTimeFilter.ts +++ b/src/serialization/types/LoyaltyEventDateTimeFilter.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { TimeRange } from "./TimeRange"; export const LoyaltyEventDateTimeFilter: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyEventDeleteReward.ts b/src/serialization/types/LoyaltyEventDeleteReward.ts index 6b89885ef..b0e883563 100644 --- a/src/serialization/types/LoyaltyEventDeleteReward.ts +++ b/src/serialization/types/LoyaltyEventDeleteReward.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyEventDeleteReward: core.serialization.ObjectSchema< serializers.LoyaltyEventDeleteReward.Raw, diff --git a/src/serialization/types/LoyaltyEventExpirePoints.ts b/src/serialization/types/LoyaltyEventExpirePoints.ts index 83009f31f..f8ab6e654 100644 --- a/src/serialization/types/LoyaltyEventExpirePoints.ts +++ b/src/serialization/types/LoyaltyEventExpirePoints.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyEventExpirePoints: core.serialization.ObjectSchema< serializers.LoyaltyEventExpirePoints.Raw, diff --git a/src/serialization/types/LoyaltyEventFilter.ts b/src/serialization/types/LoyaltyEventFilter.ts index 1f1cf8be4..145b2ddc6 100644 --- a/src/serialization/types/LoyaltyEventFilter.ts +++ b/src/serialization/types/LoyaltyEventFilter.ts @@ -1,13 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; +import { LoyaltyEventLoyaltyAccountFilter } from "./LoyaltyEventLoyaltyAccountFilter"; +import { LoyaltyEventTypeFilter } from "./LoyaltyEventTypeFilter"; import { LoyaltyEventDateTimeFilter } from "./LoyaltyEventDateTimeFilter"; import { LoyaltyEventLocationFilter } from "./LoyaltyEventLocationFilter"; -import { LoyaltyEventLoyaltyAccountFilter } from "./LoyaltyEventLoyaltyAccountFilter"; import { LoyaltyEventOrderFilter } from "./LoyaltyEventOrderFilter"; -import { LoyaltyEventTypeFilter } from "./LoyaltyEventTypeFilter"; export const LoyaltyEventFilter: core.serialization.ObjectSchema< serializers.LoyaltyEventFilter.Raw, diff --git a/src/serialization/types/LoyaltyEventLocationFilter.ts b/src/serialization/types/LoyaltyEventLocationFilter.ts index e86cc1054..06ae6117b 100644 --- a/src/serialization/types/LoyaltyEventLocationFilter.ts +++ b/src/serialization/types/LoyaltyEventLocationFilter.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyEventLocationFilter: core.serialization.ObjectSchema< serializers.LoyaltyEventLocationFilter.Raw, diff --git a/src/serialization/types/LoyaltyEventLoyaltyAccountFilter.ts b/src/serialization/types/LoyaltyEventLoyaltyAccountFilter.ts index f7f08703b..ea4be1b22 100644 --- a/src/serialization/types/LoyaltyEventLoyaltyAccountFilter.ts +++ b/src/serialization/types/LoyaltyEventLoyaltyAccountFilter.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyEventLoyaltyAccountFilter: core.serialization.ObjectSchema< serializers.LoyaltyEventLoyaltyAccountFilter.Raw, diff --git a/src/serialization/types/LoyaltyEventOrderFilter.ts b/src/serialization/types/LoyaltyEventOrderFilter.ts index 4f715f923..60aceb6ee 100644 --- a/src/serialization/types/LoyaltyEventOrderFilter.ts +++ b/src/serialization/types/LoyaltyEventOrderFilter.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyEventOrderFilter: core.serialization.ObjectSchema< serializers.LoyaltyEventOrderFilter.Raw, diff --git a/src/serialization/types/LoyaltyEventOther.ts b/src/serialization/types/LoyaltyEventOther.ts index 9677f234b..4cbbdd044 100644 --- a/src/serialization/types/LoyaltyEventOther.ts +++ b/src/serialization/types/LoyaltyEventOther.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyEventOther: core.serialization.ObjectSchema< serializers.LoyaltyEventOther.Raw, diff --git a/src/serialization/types/LoyaltyEventQuery.ts b/src/serialization/types/LoyaltyEventQuery.ts index 37ac5259e..f85d5e9c4 100644 --- a/src/serialization/types/LoyaltyEventQuery.ts +++ b/src/serialization/types/LoyaltyEventQuery.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyEventFilter } from "./LoyaltyEventFilter"; export const LoyaltyEventQuery: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyEventRedeemReward.ts b/src/serialization/types/LoyaltyEventRedeemReward.ts index 6e7b4e6d8..3f2bdfa6b 100644 --- a/src/serialization/types/LoyaltyEventRedeemReward.ts +++ b/src/serialization/types/LoyaltyEventRedeemReward.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyEventRedeemReward: core.serialization.ObjectSchema< serializers.LoyaltyEventRedeemReward.Raw, diff --git a/src/serialization/types/LoyaltyEventSource.ts b/src/serialization/types/LoyaltyEventSource.ts index 728fbff96..db9ffcaed 100644 --- a/src/serialization/types/LoyaltyEventSource.ts +++ b/src/serialization/types/LoyaltyEventSource.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyEventSource: core.serialization.Schema< serializers.LoyaltyEventSource.Raw, diff --git a/src/serialization/types/LoyaltyEventType.ts b/src/serialization/types/LoyaltyEventType.ts index a7c2f5ddb..7dca763aa 100644 --- a/src/serialization/types/LoyaltyEventType.ts +++ b/src/serialization/types/LoyaltyEventType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyEventType: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/LoyaltyEventTypeFilter.ts b/src/serialization/types/LoyaltyEventTypeFilter.ts index bd29686e8..405b69228 100644 --- a/src/serialization/types/LoyaltyEventTypeFilter.ts +++ b/src/serialization/types/LoyaltyEventTypeFilter.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyEventType } from "./LoyaltyEventType"; export const LoyaltyEventTypeFilter: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyProgram.ts b/src/serialization/types/LoyaltyProgram.ts index d484de8d7..d020c5377 100644 --- a/src/serialization/types/LoyaltyProgram.ts +++ b/src/serialization/types/LoyaltyProgram.ts @@ -1,13 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { LoyaltyProgramAccrualRule } from "./LoyaltyProgramAccrualRule"; -import { LoyaltyProgramExpirationPolicy } from "./LoyaltyProgramExpirationPolicy"; -import { LoyaltyProgramRewardTier } from "./LoyaltyProgramRewardTier"; import { LoyaltyProgramStatus } from "./LoyaltyProgramStatus"; +import { LoyaltyProgramRewardTier } from "./LoyaltyProgramRewardTier"; +import { LoyaltyProgramExpirationPolicy } from "./LoyaltyProgramExpirationPolicy"; import { LoyaltyProgramTerminology } from "./LoyaltyProgramTerminology"; +import { LoyaltyProgramAccrualRule } from "./LoyaltyProgramAccrualRule"; export const LoyaltyProgram: core.serialization.ObjectSchema = core.serialization.object({ @@ -35,12 +37,12 @@ export declare namespace LoyaltyProgram { export interface Raw { id?: string | null; status?: LoyaltyProgramStatus.Raw | null; - reward_tiers?: (LoyaltyProgramRewardTier.Raw[] | null | undefined) | null; + reward_tiers?: (LoyaltyProgramRewardTier.Raw[] | null) | null; expiration_policy?: LoyaltyProgramExpirationPolicy.Raw | null; terminology?: LoyaltyProgramTerminology.Raw | null; - location_ids?: (string[] | null | undefined) | null; + location_ids?: (string[] | null) | null; created_at?: string | null; updated_at?: string | null; - accrual_rules?: (LoyaltyProgramAccrualRule.Raw[] | null | undefined) | null; + accrual_rules?: (LoyaltyProgramAccrualRule.Raw[] | null) | null; } } diff --git a/src/serialization/types/LoyaltyProgramAccrualRule.ts b/src/serialization/types/LoyaltyProgramAccrualRule.ts index 7b0533814..d24f34354 100644 --- a/src/serialization/types/LoyaltyProgramAccrualRule.ts +++ b/src/serialization/types/LoyaltyProgramAccrualRule.ts @@ -1,13 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { LoyaltyProgramAccrualRuleCategoryData } from "./LoyaltyProgramAccrualRuleCategoryData"; -import { LoyaltyProgramAccrualRuleItemVariationData } from "./LoyaltyProgramAccrualRuleItemVariationData"; -import { LoyaltyProgramAccrualRuleSpendData } from "./LoyaltyProgramAccrualRuleSpendData"; import { LoyaltyProgramAccrualRuleType } from "./LoyaltyProgramAccrualRuleType"; import { LoyaltyProgramAccrualRuleVisitData } from "./LoyaltyProgramAccrualRuleVisitData"; +import { LoyaltyProgramAccrualRuleSpendData } from "./LoyaltyProgramAccrualRuleSpendData"; +import { LoyaltyProgramAccrualRuleItemVariationData } from "./LoyaltyProgramAccrualRuleItemVariationData"; +import { LoyaltyProgramAccrualRuleCategoryData } from "./LoyaltyProgramAccrualRuleCategoryData"; export const LoyaltyProgramAccrualRule: core.serialization.ObjectSchema< serializers.LoyaltyProgramAccrualRule.Raw, @@ -27,7 +29,7 @@ export const LoyaltyProgramAccrualRule: core.serialization.ObjectSchema< export declare namespace LoyaltyProgramAccrualRule { export interface Raw { accrual_type: LoyaltyProgramAccrualRuleType.Raw; - points?: (number | null | undefined) | null; + points?: (number | null) | null; visit_data?: LoyaltyProgramAccrualRuleVisitData.Raw | null; spend_data?: LoyaltyProgramAccrualRuleSpendData.Raw | null; item_variation_data?: LoyaltyProgramAccrualRuleItemVariationData.Raw | null; diff --git a/src/serialization/types/LoyaltyProgramAccrualRuleCategoryData.ts b/src/serialization/types/LoyaltyProgramAccrualRuleCategoryData.ts index 32128827e..f528cfad6 100644 --- a/src/serialization/types/LoyaltyProgramAccrualRuleCategoryData.ts +++ b/src/serialization/types/LoyaltyProgramAccrualRuleCategoryData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyProgramAccrualRuleCategoryData: core.serialization.ObjectSchema< serializers.LoyaltyProgramAccrualRuleCategoryData.Raw, diff --git a/src/serialization/types/LoyaltyProgramAccrualRuleItemVariationData.ts b/src/serialization/types/LoyaltyProgramAccrualRuleItemVariationData.ts index 335739332..afd62c584 100644 --- a/src/serialization/types/LoyaltyProgramAccrualRuleItemVariationData.ts +++ b/src/serialization/types/LoyaltyProgramAccrualRuleItemVariationData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyProgramAccrualRuleItemVariationData: core.serialization.ObjectSchema< serializers.LoyaltyProgramAccrualRuleItemVariationData.Raw, diff --git a/src/serialization/types/LoyaltyProgramAccrualRuleSpendData.ts b/src/serialization/types/LoyaltyProgramAccrualRuleSpendData.ts index e99f9ac62..392662f9c 100644 --- a/src/serialization/types/LoyaltyProgramAccrualRuleSpendData.ts +++ b/src/serialization/types/LoyaltyProgramAccrualRuleSpendData.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { LoyaltyProgramAccrualRuleTaxMode } from "./LoyaltyProgramAccrualRuleTaxMode"; import { Money } from "./Money"; +import { LoyaltyProgramAccrualRuleTaxMode } from "./LoyaltyProgramAccrualRuleTaxMode"; export const LoyaltyProgramAccrualRuleSpendData: core.serialization.ObjectSchema< serializers.LoyaltyProgramAccrualRuleSpendData.Raw, @@ -25,8 +27,8 @@ export const LoyaltyProgramAccrualRuleSpendData: core.serialization.ObjectSchema export declare namespace LoyaltyProgramAccrualRuleSpendData { export interface Raw { amount_money: Money.Raw; - excluded_category_ids?: (string[] | null | undefined) | null; - excluded_item_variation_ids?: (string[] | null | undefined) | null; + excluded_category_ids?: (string[] | null) | null; + excluded_item_variation_ids?: (string[] | null) | null; tax_mode: LoyaltyProgramAccrualRuleTaxMode.Raw; } } diff --git a/src/serialization/types/LoyaltyProgramAccrualRuleTaxMode.ts b/src/serialization/types/LoyaltyProgramAccrualRuleTaxMode.ts index fa7bfda54..cda917057 100644 --- a/src/serialization/types/LoyaltyProgramAccrualRuleTaxMode.ts +++ b/src/serialization/types/LoyaltyProgramAccrualRuleTaxMode.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyProgramAccrualRuleTaxMode: core.serialization.Schema< serializers.LoyaltyProgramAccrualRuleTaxMode.Raw, diff --git a/src/serialization/types/LoyaltyProgramAccrualRuleType.ts b/src/serialization/types/LoyaltyProgramAccrualRuleType.ts index 60067fb91..76c2c16a0 100644 --- a/src/serialization/types/LoyaltyProgramAccrualRuleType.ts +++ b/src/serialization/types/LoyaltyProgramAccrualRuleType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyProgramAccrualRuleType: core.serialization.Schema< serializers.LoyaltyProgramAccrualRuleType.Raw, diff --git a/src/serialization/types/LoyaltyProgramAccrualRuleVisitData.ts b/src/serialization/types/LoyaltyProgramAccrualRuleVisitData.ts index 79536ce02..55869b831 100644 --- a/src/serialization/types/LoyaltyProgramAccrualRuleVisitData.ts +++ b/src/serialization/types/LoyaltyProgramAccrualRuleVisitData.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { LoyaltyProgramAccrualRuleTaxMode } from "./LoyaltyProgramAccrualRuleTaxMode"; import { Money } from "./Money"; +import { LoyaltyProgramAccrualRuleTaxMode } from "./LoyaltyProgramAccrualRuleTaxMode"; export const LoyaltyProgramAccrualRuleVisitData: core.serialization.ObjectSchema< serializers.LoyaltyProgramAccrualRuleVisitData.Raw, diff --git a/src/serialization/types/LoyaltyProgramCreatedEvent.ts b/src/serialization/types/LoyaltyProgramCreatedEvent.ts index 05503521f..c32e88ec8 100644 --- a/src/serialization/types/LoyaltyProgramCreatedEvent.ts +++ b/src/serialization/types/LoyaltyProgramCreatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyProgramCreatedEventData } from "./LoyaltyProgramCreatedEventData"; export const LoyaltyProgramCreatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const LoyaltyProgramCreatedEvent: core.serialization.ObjectSchema< export declare namespace LoyaltyProgramCreatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: LoyaltyProgramCreatedEventData.Raw | null; } diff --git a/src/serialization/types/LoyaltyProgramCreatedEventData.ts b/src/serialization/types/LoyaltyProgramCreatedEventData.ts index 5609e0a54..e124e6a97 100644 --- a/src/serialization/types/LoyaltyProgramCreatedEventData.ts +++ b/src/serialization/types/LoyaltyProgramCreatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyProgramCreatedEventObject } from "./LoyaltyProgramCreatedEventObject"; export const LoyaltyProgramCreatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const LoyaltyProgramCreatedEventData: core.serialization.ObjectSchema< export declare namespace LoyaltyProgramCreatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: LoyaltyProgramCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/LoyaltyProgramCreatedEventObject.ts b/src/serialization/types/LoyaltyProgramCreatedEventObject.ts index 7e059dcfa..a8e3a404b 100644 --- a/src/serialization/types/LoyaltyProgramCreatedEventObject.ts +++ b/src/serialization/types/LoyaltyProgramCreatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyProgram } from "./LoyaltyProgram"; export const LoyaltyProgramCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyProgramExpirationPolicy.ts b/src/serialization/types/LoyaltyProgramExpirationPolicy.ts index 18f2cfc49..46559ff5e 100644 --- a/src/serialization/types/LoyaltyProgramExpirationPolicy.ts +++ b/src/serialization/types/LoyaltyProgramExpirationPolicy.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyProgramExpirationPolicy: core.serialization.ObjectSchema< serializers.LoyaltyProgramExpirationPolicy.Raw, diff --git a/src/serialization/types/LoyaltyProgramRewardTier.ts b/src/serialization/types/LoyaltyProgramRewardTier.ts index cdde10623..e728ad13c 100644 --- a/src/serialization/types/LoyaltyProgramRewardTier.ts +++ b/src/serialization/types/LoyaltyProgramRewardTier.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CatalogObjectReference } from "./CatalogObjectReference"; export const LoyaltyProgramRewardTier: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyProgramStatus.ts b/src/serialization/types/LoyaltyProgramStatus.ts index 345d9f8de..437b0cc79 100644 --- a/src/serialization/types/LoyaltyProgramStatus.ts +++ b/src/serialization/types/LoyaltyProgramStatus.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyProgramStatus: core.serialization.Schema< serializers.LoyaltyProgramStatus.Raw, diff --git a/src/serialization/types/LoyaltyProgramTerminology.ts b/src/serialization/types/LoyaltyProgramTerminology.ts index 7d293aabd..5f9aa7b54 100644 --- a/src/serialization/types/LoyaltyProgramTerminology.ts +++ b/src/serialization/types/LoyaltyProgramTerminology.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyProgramTerminology: core.serialization.ObjectSchema< serializers.LoyaltyProgramTerminology.Raw, diff --git a/src/serialization/types/LoyaltyProgramUpdatedEvent.ts b/src/serialization/types/LoyaltyProgramUpdatedEvent.ts index 3ca9e19fd..3d80c96fb 100644 --- a/src/serialization/types/LoyaltyProgramUpdatedEvent.ts +++ b/src/serialization/types/LoyaltyProgramUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyProgramUpdatedEventData } from "./LoyaltyProgramUpdatedEventData"; export const LoyaltyProgramUpdatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const LoyaltyProgramUpdatedEvent: core.serialization.ObjectSchema< export declare namespace LoyaltyProgramUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: LoyaltyProgramUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/LoyaltyProgramUpdatedEventData.ts b/src/serialization/types/LoyaltyProgramUpdatedEventData.ts index a0c50b3da..9f6562630 100644 --- a/src/serialization/types/LoyaltyProgramUpdatedEventData.ts +++ b/src/serialization/types/LoyaltyProgramUpdatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyProgramUpdatedEventObject } from "./LoyaltyProgramUpdatedEventObject"; export const LoyaltyProgramUpdatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const LoyaltyProgramUpdatedEventData: core.serialization.ObjectSchema< export declare namespace LoyaltyProgramUpdatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: LoyaltyProgramUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/LoyaltyProgramUpdatedEventObject.ts b/src/serialization/types/LoyaltyProgramUpdatedEventObject.ts index 516b282e2..d5069372e 100644 --- a/src/serialization/types/LoyaltyProgramUpdatedEventObject.ts +++ b/src/serialization/types/LoyaltyProgramUpdatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyProgram } from "./LoyaltyProgram"; export const LoyaltyProgramUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyPromotion.ts b/src/serialization/types/LoyaltyPromotion.ts index 2cac9508b..aaf228eb2 100644 --- a/src/serialization/types/LoyaltyPromotion.ts +++ b/src/serialization/types/LoyaltyPromotion.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { LoyaltyPromotionAvailableTimeData } from "./LoyaltyPromotionAvailableTimeData"; import { LoyaltyPromotionIncentive } from "./LoyaltyPromotionIncentive"; -import { LoyaltyPromotionStatus } from "./LoyaltyPromotionStatus"; +import { LoyaltyPromotionAvailableTimeData } from "./LoyaltyPromotionAvailableTimeData"; import { LoyaltyPromotionTriggerLimit } from "./LoyaltyPromotionTriggerLimit"; +import { LoyaltyPromotionStatus } from "./LoyaltyPromotionStatus"; import { Money } from "./Money"; export const LoyaltyPromotion: core.serialization.ObjectSchema< @@ -47,7 +49,7 @@ export declare namespace LoyaltyPromotion { updated_at?: string | null; loyalty_program_id?: string | null; minimum_spend_amount_money?: Money.Raw | null; - qualifying_item_variation_ids?: (string[] | null | undefined) | null; - qualifying_category_ids?: (string[] | null | undefined) | null; + qualifying_item_variation_ids?: (string[] | null) | null; + qualifying_category_ids?: (string[] | null) | null; } } diff --git a/src/serialization/types/LoyaltyPromotionAvailableTimeData.ts b/src/serialization/types/LoyaltyPromotionAvailableTimeData.ts index 876c9359c..f7b34ac92 100644 --- a/src/serialization/types/LoyaltyPromotionAvailableTimeData.ts +++ b/src/serialization/types/LoyaltyPromotionAvailableTimeData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyPromotionAvailableTimeData: core.serialization.ObjectSchema< serializers.LoyaltyPromotionAvailableTimeData.Raw, diff --git a/src/serialization/types/LoyaltyPromotionCreatedEvent.ts b/src/serialization/types/LoyaltyPromotionCreatedEvent.ts index 8794d3d40..f7068ab9d 100644 --- a/src/serialization/types/LoyaltyPromotionCreatedEvent.ts +++ b/src/serialization/types/LoyaltyPromotionCreatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyPromotionCreatedEventData } from "./LoyaltyPromotionCreatedEventData"; export const LoyaltyPromotionCreatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const LoyaltyPromotionCreatedEvent: core.serialization.ObjectSchema< export declare namespace LoyaltyPromotionCreatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: LoyaltyPromotionCreatedEventData.Raw | null; } diff --git a/src/serialization/types/LoyaltyPromotionCreatedEventData.ts b/src/serialization/types/LoyaltyPromotionCreatedEventData.ts index 54571084d..456b03b56 100644 --- a/src/serialization/types/LoyaltyPromotionCreatedEventData.ts +++ b/src/serialization/types/LoyaltyPromotionCreatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyPromotionCreatedEventObject } from "./LoyaltyPromotionCreatedEventObject"; export const LoyaltyPromotionCreatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const LoyaltyPromotionCreatedEventData: core.serialization.ObjectSchema< export declare namespace LoyaltyPromotionCreatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: LoyaltyPromotionCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/LoyaltyPromotionCreatedEventObject.ts b/src/serialization/types/LoyaltyPromotionCreatedEventObject.ts index 4e21d8d2d..a4023966d 100644 --- a/src/serialization/types/LoyaltyPromotionCreatedEventObject.ts +++ b/src/serialization/types/LoyaltyPromotionCreatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyPromotion } from "./LoyaltyPromotion"; export const LoyaltyPromotionCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyPromotionIncentive.ts b/src/serialization/types/LoyaltyPromotionIncentive.ts index a4e256e69..0301b9d63 100644 --- a/src/serialization/types/LoyaltyPromotionIncentive.ts +++ b/src/serialization/types/LoyaltyPromotionIncentive.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { LoyaltyPromotionIncentivePointsAdditionData } from "./LoyaltyPromotionIncentivePointsAdditionData"; -import { LoyaltyPromotionIncentivePointsMultiplierData } from "./LoyaltyPromotionIncentivePointsMultiplierData"; import { LoyaltyPromotionIncentiveType } from "./LoyaltyPromotionIncentiveType"; +import { LoyaltyPromotionIncentivePointsMultiplierData } from "./LoyaltyPromotionIncentivePointsMultiplierData"; +import { LoyaltyPromotionIncentivePointsAdditionData } from "./LoyaltyPromotionIncentivePointsAdditionData"; export const LoyaltyPromotionIncentive: core.serialization.ObjectSchema< serializers.LoyaltyPromotionIncentive.Raw, diff --git a/src/serialization/types/LoyaltyPromotionIncentivePointsAdditionData.ts b/src/serialization/types/LoyaltyPromotionIncentivePointsAdditionData.ts index f9e7f7068..8b0ed9225 100644 --- a/src/serialization/types/LoyaltyPromotionIncentivePointsAdditionData.ts +++ b/src/serialization/types/LoyaltyPromotionIncentivePointsAdditionData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyPromotionIncentivePointsAdditionData: core.serialization.ObjectSchema< serializers.LoyaltyPromotionIncentivePointsAdditionData.Raw, diff --git a/src/serialization/types/LoyaltyPromotionIncentivePointsMultiplierData.ts b/src/serialization/types/LoyaltyPromotionIncentivePointsMultiplierData.ts index e2a19018e..97309104c 100644 --- a/src/serialization/types/LoyaltyPromotionIncentivePointsMultiplierData.ts +++ b/src/serialization/types/LoyaltyPromotionIncentivePointsMultiplierData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyPromotionIncentivePointsMultiplierData: core.serialization.ObjectSchema< serializers.LoyaltyPromotionIncentivePointsMultiplierData.Raw, @@ -14,7 +16,7 @@ export const LoyaltyPromotionIncentivePointsMultiplierData: core.serialization.O export declare namespace LoyaltyPromotionIncentivePointsMultiplierData { export interface Raw { - points_multiplier?: (number | null | undefined) | null; - multiplier?: (string | null | undefined) | null; + points_multiplier?: (number | null) | null; + multiplier?: (string | null) | null; } } diff --git a/src/serialization/types/LoyaltyPromotionIncentiveType.ts b/src/serialization/types/LoyaltyPromotionIncentiveType.ts index bc85138ba..11ce60a53 100644 --- a/src/serialization/types/LoyaltyPromotionIncentiveType.ts +++ b/src/serialization/types/LoyaltyPromotionIncentiveType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyPromotionIncentiveType: core.serialization.Schema< serializers.LoyaltyPromotionIncentiveType.Raw, diff --git a/src/serialization/types/LoyaltyPromotionStatus.ts b/src/serialization/types/LoyaltyPromotionStatus.ts index c5c13ac37..248bc733e 100644 --- a/src/serialization/types/LoyaltyPromotionStatus.ts +++ b/src/serialization/types/LoyaltyPromotionStatus.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyPromotionStatus: core.serialization.Schema< serializers.LoyaltyPromotionStatus.Raw, diff --git a/src/serialization/types/LoyaltyPromotionTriggerLimit.ts b/src/serialization/types/LoyaltyPromotionTriggerLimit.ts index 9ee8a9d84..98aef06d2 100644 --- a/src/serialization/types/LoyaltyPromotionTriggerLimit.ts +++ b/src/serialization/types/LoyaltyPromotionTriggerLimit.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyPromotionTriggerLimitInterval } from "./LoyaltyPromotionTriggerLimitInterval"; export const LoyaltyPromotionTriggerLimit: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyPromotionTriggerLimitInterval.ts b/src/serialization/types/LoyaltyPromotionTriggerLimitInterval.ts index 0bdc79e24..ee4f88df7 100644 --- a/src/serialization/types/LoyaltyPromotionTriggerLimitInterval.ts +++ b/src/serialization/types/LoyaltyPromotionTriggerLimitInterval.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyPromotionTriggerLimitInterval: core.serialization.Schema< serializers.LoyaltyPromotionTriggerLimitInterval.Raw, diff --git a/src/serialization/types/LoyaltyPromotionUpdatedEvent.ts b/src/serialization/types/LoyaltyPromotionUpdatedEvent.ts index aa38f74a6..7c961c4e4 100644 --- a/src/serialization/types/LoyaltyPromotionUpdatedEvent.ts +++ b/src/serialization/types/LoyaltyPromotionUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyPromotionUpdatedEventData } from "./LoyaltyPromotionUpdatedEventData"; export const LoyaltyPromotionUpdatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const LoyaltyPromotionUpdatedEvent: core.serialization.ObjectSchema< export declare namespace LoyaltyPromotionUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: LoyaltyPromotionUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/LoyaltyPromotionUpdatedEventData.ts b/src/serialization/types/LoyaltyPromotionUpdatedEventData.ts index 655b21223..f19cbac42 100644 --- a/src/serialization/types/LoyaltyPromotionUpdatedEventData.ts +++ b/src/serialization/types/LoyaltyPromotionUpdatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyPromotionUpdatedEventObject } from "./LoyaltyPromotionUpdatedEventObject"; export const LoyaltyPromotionUpdatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const LoyaltyPromotionUpdatedEventData: core.serialization.ObjectSchema< export declare namespace LoyaltyPromotionUpdatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: LoyaltyPromotionUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/LoyaltyPromotionUpdatedEventObject.ts b/src/serialization/types/LoyaltyPromotionUpdatedEventObject.ts index 4b740ea71..57c1a6849 100644 --- a/src/serialization/types/LoyaltyPromotionUpdatedEventObject.ts +++ b/src/serialization/types/LoyaltyPromotionUpdatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyPromotion } from "./LoyaltyPromotion"; export const LoyaltyPromotionUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/LoyaltyReward.ts b/src/serialization/types/LoyaltyReward.ts index f4450b337..5eaeb90bc 100644 --- a/src/serialization/types/LoyaltyReward.ts +++ b/src/serialization/types/LoyaltyReward.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyRewardStatus } from "./LoyaltyRewardStatus"; export const LoyaltyReward: core.serialization.ObjectSchema = @@ -25,7 +27,7 @@ export declare namespace LoyaltyReward { loyalty_account_id: string; reward_tier_id: string; points?: number | null; - order_id?: (string | null | undefined) | null; + order_id?: (string | null) | null; created_at?: string | null; updated_at?: string | null; redeemed_at?: string | null; diff --git a/src/serialization/types/LoyaltyRewardStatus.ts b/src/serialization/types/LoyaltyRewardStatus.ts index 4653016a6..73204b87a 100644 --- a/src/serialization/types/LoyaltyRewardStatus.ts +++ b/src/serialization/types/LoyaltyRewardStatus.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const LoyaltyRewardStatus: core.serialization.Schema< serializers.LoyaltyRewardStatus.Raw, diff --git a/src/serialization/types/MeasurementUnit.ts b/src/serialization/types/MeasurementUnit.ts index 20128864a..b567cfbe7 100644 --- a/src/serialization/types/MeasurementUnit.ts +++ b/src/serialization/types/MeasurementUnit.ts @@ -1,16 +1,18 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { MeasurementUnitArea } from "./MeasurementUnitArea"; import { MeasurementUnitCustom } from "./MeasurementUnitCustom"; -import { MeasurementUnitGeneric } from "./MeasurementUnitGeneric"; +import { MeasurementUnitArea } from "./MeasurementUnitArea"; import { MeasurementUnitLength } from "./MeasurementUnitLength"; -import { MeasurementUnitTime } from "./MeasurementUnitTime"; -import { MeasurementUnitUnitType } from "./MeasurementUnitUnitType"; import { MeasurementUnitVolume } from "./MeasurementUnitVolume"; import { MeasurementUnitWeight } from "./MeasurementUnitWeight"; +import { MeasurementUnitGeneric } from "./MeasurementUnitGeneric"; +import { MeasurementUnitTime } from "./MeasurementUnitTime"; +import { MeasurementUnitUnitType } from "./MeasurementUnitUnitType"; export const MeasurementUnit: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/MeasurementUnitArea.ts b/src/serialization/types/MeasurementUnitArea.ts index c3c77fb5f..b6e8bb363 100644 --- a/src/serialization/types/MeasurementUnitArea.ts +++ b/src/serialization/types/MeasurementUnitArea.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const MeasurementUnitArea: core.serialization.Schema< serializers.MeasurementUnitArea.Raw, diff --git a/src/serialization/types/MeasurementUnitCustom.ts b/src/serialization/types/MeasurementUnitCustom.ts index b395b04a5..c1a9688ac 100644 --- a/src/serialization/types/MeasurementUnitCustom.ts +++ b/src/serialization/types/MeasurementUnitCustom.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const MeasurementUnitCustom: core.serialization.ObjectSchema< serializers.MeasurementUnitCustom.Raw, diff --git a/src/serialization/types/MeasurementUnitGeneric.ts b/src/serialization/types/MeasurementUnitGeneric.ts index 0d2ca85b9..c2a5a8fa6 100644 --- a/src/serialization/types/MeasurementUnitGeneric.ts +++ b/src/serialization/types/MeasurementUnitGeneric.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const MeasurementUnitGeneric: core.serialization.Schema< serializers.MeasurementUnitGeneric.Raw, diff --git a/src/serialization/types/MeasurementUnitLength.ts b/src/serialization/types/MeasurementUnitLength.ts index 2d98c3ba8..f2bbedab8 100644 --- a/src/serialization/types/MeasurementUnitLength.ts +++ b/src/serialization/types/MeasurementUnitLength.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const MeasurementUnitLength: core.serialization.Schema< serializers.MeasurementUnitLength.Raw, diff --git a/src/serialization/types/MeasurementUnitTime.ts b/src/serialization/types/MeasurementUnitTime.ts index 9d599c7a5..2470332b0 100644 --- a/src/serialization/types/MeasurementUnitTime.ts +++ b/src/serialization/types/MeasurementUnitTime.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const MeasurementUnitTime: core.serialization.Schema< serializers.MeasurementUnitTime.Raw, diff --git a/src/serialization/types/MeasurementUnitUnitType.ts b/src/serialization/types/MeasurementUnitUnitType.ts index 423f83d52..b1466384a 100644 --- a/src/serialization/types/MeasurementUnitUnitType.ts +++ b/src/serialization/types/MeasurementUnitUnitType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const MeasurementUnitUnitType: core.serialization.Schema< serializers.MeasurementUnitUnitType.Raw, diff --git a/src/serialization/types/MeasurementUnitVolume.ts b/src/serialization/types/MeasurementUnitVolume.ts index fd081d550..0d8db1ee4 100644 --- a/src/serialization/types/MeasurementUnitVolume.ts +++ b/src/serialization/types/MeasurementUnitVolume.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const MeasurementUnitVolume: core.serialization.Schema< serializers.MeasurementUnitVolume.Raw, diff --git a/src/serialization/types/MeasurementUnitWeight.ts b/src/serialization/types/MeasurementUnitWeight.ts index fcfb45aa8..14a458dd5 100644 --- a/src/serialization/types/MeasurementUnitWeight.ts +++ b/src/serialization/types/MeasurementUnitWeight.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const MeasurementUnitWeight: core.serialization.Schema< serializers.MeasurementUnitWeight.Raw, diff --git a/src/serialization/types/Merchant.ts b/src/serialization/types/Merchant.ts index 1888c6f08..72cc5e821 100644 --- a/src/serialization/types/Merchant.ts +++ b/src/serialization/types/Merchant.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Country } from "./Country"; import { Currency } from "./Currency"; import { MerchantStatus } from "./MerchantStatus"; @@ -22,12 +24,12 @@ export const Merchant: core.serialization.ObjectSchema = core.serialization.enum_(["ACTIVE", "INACTIVE"]); diff --git a/src/serialization/types/ModifierLocationOverrides.ts b/src/serialization/types/ModifierLocationOverrides.ts index e1912dc1c..ca69ef371 100644 --- a/src/serialization/types/ModifierLocationOverrides.ts +++ b/src/serialization/types/ModifierLocationOverrides.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const ModifierLocationOverrides: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const ModifierLocationOverrides: core.serialization.ObjectSchema< export declare namespace ModifierLocationOverrides { export interface Raw { - location_id?: (string | null | undefined) | null; + location_id?: (string | null) | null; price_money?: Money.Raw | null; sold_out?: boolean | null; } diff --git a/src/serialization/types/Money.ts b/src/serialization/types/Money.ts index 5fd287c5d..2ae0cc3be 100644 --- a/src/serialization/types/Money.ts +++ b/src/serialization/types/Money.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Currency } from "./Currency"; export const Money: core.serialization.ObjectSchema = core.serialization.object({ @@ -12,7 +14,7 @@ export const Money: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string().optional(), @@ -62,21 +64,21 @@ export declare namespace Order { export interface Raw { id?: string | null; location_id: string; - reference_id?: (string | null | undefined) | null; + reference_id?: (string | null) | null; source?: OrderSource.Raw | null; - customer_id?: (string | null | undefined) | null; - line_items?: (OrderLineItem.Raw[] | null | undefined) | null; - taxes?: (OrderLineItemTax.Raw[] | null | undefined) | null; - discounts?: (OrderLineItemDiscount.Raw[] | null | undefined) | null; - service_charges?: (OrderServiceCharge.Raw[] | null | undefined) | null; - fulfillments?: (Fulfillment.Raw[] | null | undefined) | null; + customer_id?: (string | null) | null; + line_items?: (OrderLineItem.Raw[] | null) | null; + taxes?: (OrderLineItemTax.Raw[] | null) | null; + discounts?: (OrderLineItemDiscount.Raw[] | null) | null; + service_charges?: (OrderServiceCharge.Raw[] | null) | null; + fulfillments?: (Fulfillment.Raw[] | null) | null; returns?: OrderReturn.Raw[] | null; return_amounts?: OrderMoneyAmounts.Raw | null; net_amounts?: OrderMoneyAmounts.Raw | null; rounding_adjustment?: OrderRoundingAdjustment.Raw | null; tenders?: Tender.Raw[] | null; refunds?: Refund.Raw[] | null; - metadata?: (Record | null | undefined) | null; + metadata?: (Record | null) | null; created_at?: string | null; updated_at?: string | null; closed_at?: string | null; @@ -87,7 +89,7 @@ export declare namespace Order { total_discount_money?: Money.Raw | null; total_tip_money?: Money.Raw | null; total_service_charge_money?: Money.Raw | null; - ticket_name?: (string | null | undefined) | null; + ticket_name?: (string | null) | null; pricing_options?: OrderPricingOptions.Raw | null; rewards?: OrderReward.Raw[] | null; net_amount_due_money?: Money.Raw | null; diff --git a/src/serialization/types/OrderCreated.ts b/src/serialization/types/OrderCreated.ts index 76d34766c..8123ff537 100644 --- a/src/serialization/types/OrderCreated.ts +++ b/src/serialization/types/OrderCreated.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { OrderState } from "./OrderState"; export const OrderCreated: core.serialization.ObjectSchema = @@ -16,9 +18,9 @@ export const OrderCreated: core.serialization.ObjectSchema = core.serialization.object({ @@ -13,8 +15,8 @@ export const OrderEntry: core.serialization.ObjectSchema = core.serialization.object({ @@ -54,20 +56,20 @@ export const OrderLineItem: core.serialization.ObjectSchema | null | undefined) | null; - modifiers?: (OrderLineItemModifier.Raw[] | null | undefined) | null; - applied_taxes?: (OrderLineItemAppliedTax.Raw[] | null | undefined) | null; - applied_discounts?: (OrderLineItemAppliedDiscount.Raw[] | null | undefined) | null; - applied_service_charges?: (OrderLineItemAppliedServiceCharge.Raw[] | null | undefined) | null; + metadata?: (Record | null) | null; + modifiers?: (OrderLineItemModifier.Raw[] | null) | null; + applied_taxes?: (OrderLineItemAppliedTax.Raw[] | null) | null; + applied_discounts?: (OrderLineItemAppliedDiscount.Raw[] | null) | null; + applied_service_charges?: (OrderLineItemAppliedServiceCharge.Raw[] | null) | null; base_price_money?: Money.Raw | null; variation_total_price_money?: Money.Raw | null; gross_sales_money?: Money.Raw | null; diff --git a/src/serialization/types/OrderLineItemAppliedDiscount.ts b/src/serialization/types/OrderLineItemAppliedDiscount.ts index a08443d69..2e1d5875e 100644 --- a/src/serialization/types/OrderLineItemAppliedDiscount.ts +++ b/src/serialization/types/OrderLineItemAppliedDiscount.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const OrderLineItemAppliedDiscount: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const OrderLineItemAppliedDiscount: core.serialization.ObjectSchema< export declare namespace OrderLineItemAppliedDiscount { export interface Raw { - uid?: (string | null | undefined) | null; + uid?: (string | null) | null; discount_uid: string; applied_money?: Money.Raw | null; } diff --git a/src/serialization/types/OrderLineItemAppliedServiceCharge.ts b/src/serialization/types/OrderLineItemAppliedServiceCharge.ts index 1edb66e45..36612b700 100644 --- a/src/serialization/types/OrderLineItemAppliedServiceCharge.ts +++ b/src/serialization/types/OrderLineItemAppliedServiceCharge.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const OrderLineItemAppliedServiceCharge: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const OrderLineItemAppliedServiceCharge: core.serialization.ObjectSchema< export declare namespace OrderLineItemAppliedServiceCharge { export interface Raw { - uid?: (string | null | undefined) | null; + uid?: (string | null) | null; service_charge_uid: string; applied_money?: Money.Raw | null; } diff --git a/src/serialization/types/OrderLineItemAppliedTax.ts b/src/serialization/types/OrderLineItemAppliedTax.ts index 8fbd659aa..d04a39c78 100644 --- a/src/serialization/types/OrderLineItemAppliedTax.ts +++ b/src/serialization/types/OrderLineItemAppliedTax.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const OrderLineItemAppliedTax: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const OrderLineItemAppliedTax: core.serialization.ObjectSchema< export declare namespace OrderLineItemAppliedTax { export interface Raw { - uid?: (string | null | undefined) | null; + uid?: (string | null) | null; tax_uid: string; applied_money?: Money.Raw | null; } diff --git a/src/serialization/types/OrderLineItemDiscount.ts b/src/serialization/types/OrderLineItemDiscount.ts index 4574eddc8..d4044eb07 100644 --- a/src/serialization/types/OrderLineItemDiscount.ts +++ b/src/serialization/types/OrderLineItemDiscount.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; +import { OrderLineItemDiscountType } from "./OrderLineItemDiscountType"; import { Money } from "./Money"; import { OrderLineItemDiscountScope } from "./OrderLineItemDiscountScope"; -import { OrderLineItemDiscountType } from "./OrderLineItemDiscountType"; export const OrderLineItemDiscount: core.serialization.ObjectSchema< serializers.OrderLineItemDiscount.Raw, @@ -32,15 +34,15 @@ export const OrderLineItemDiscount: core.serialization.ObjectSchema< export declare namespace OrderLineItemDiscount { export interface Raw { - uid?: (string | null | undefined) | null; - catalog_object_id?: (string | null | undefined) | null; - catalog_version?: ((bigint | number) | null | undefined) | null; - name?: (string | null | undefined) | null; + uid?: (string | null) | null; + catalog_object_id?: (string | null) | null; + catalog_version?: ((bigint | number) | null) | null; + name?: (string | null) | null; type?: OrderLineItemDiscountType.Raw | null; - percentage?: (string | null | undefined) | null; + percentage?: (string | null) | null; amount_money?: Money.Raw | null; applied_money?: Money.Raw | null; - metadata?: (Record | null | undefined) | null; + metadata?: (Record | null) | null; scope?: OrderLineItemDiscountScope.Raw | null; reward_ids?: string[] | null; pricing_rule_id?: string | null; diff --git a/src/serialization/types/OrderLineItemDiscountScope.ts b/src/serialization/types/OrderLineItemDiscountScope.ts index e056d232f..bce436185 100644 --- a/src/serialization/types/OrderLineItemDiscountScope.ts +++ b/src/serialization/types/OrderLineItemDiscountScope.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderLineItemDiscountScope: core.serialization.Schema< serializers.OrderLineItemDiscountScope.Raw, diff --git a/src/serialization/types/OrderLineItemDiscountType.ts b/src/serialization/types/OrderLineItemDiscountType.ts index c64a60114..dfb201efd 100644 --- a/src/serialization/types/OrderLineItemDiscountType.ts +++ b/src/serialization/types/OrderLineItemDiscountType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderLineItemDiscountType: core.serialization.Schema< serializers.OrderLineItemDiscountType.Raw, diff --git a/src/serialization/types/OrderLineItemItemType.ts b/src/serialization/types/OrderLineItemItemType.ts index 78a32b5ea..68533023b 100644 --- a/src/serialization/types/OrderLineItemItemType.ts +++ b/src/serialization/types/OrderLineItemItemType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderLineItemItemType: core.serialization.Schema< serializers.OrderLineItemItemType.Raw, diff --git a/src/serialization/types/OrderLineItemModifier.ts b/src/serialization/types/OrderLineItemModifier.ts index e01ddfc95..8e1eca6ac 100644 --- a/src/serialization/types/OrderLineItemModifier.ts +++ b/src/serialization/types/OrderLineItemModifier.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const OrderLineItemModifier: core.serialization.ObjectSchema< @@ -23,13 +25,13 @@ export const OrderLineItemModifier: core.serialization.ObjectSchema< export declare namespace OrderLineItemModifier { export interface Raw { - uid?: (string | null | undefined) | null; - catalog_object_id?: (string | null | undefined) | null; - catalog_version?: ((bigint | number) | null | undefined) | null; - name?: (string | null | undefined) | null; - quantity?: (string | null | undefined) | null; + uid?: (string | null) | null; + catalog_object_id?: (string | null) | null; + catalog_version?: ((bigint | number) | null) | null; + name?: (string | null) | null; + quantity?: (string | null) | null; base_price_money?: Money.Raw | null; total_price_money?: Money.Raw | null; - metadata?: (Record | null | undefined) | null; + metadata?: (Record | null) | null; } } diff --git a/src/serialization/types/OrderLineItemPricingBlocklists.ts b/src/serialization/types/OrderLineItemPricingBlocklists.ts index b63cffcad..2042642b5 100644 --- a/src/serialization/types/OrderLineItemPricingBlocklists.ts +++ b/src/serialization/types/OrderLineItemPricingBlocklists.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { OrderLineItemPricingBlocklistsBlockedDiscount } from "./OrderLineItemPricingBlocklistsBlockedDiscount"; import { OrderLineItemPricingBlocklistsBlockedTax } from "./OrderLineItemPricingBlocklistsBlockedTax"; @@ -22,7 +24,7 @@ export const OrderLineItemPricingBlocklists: core.serialization.ObjectSchema< export declare namespace OrderLineItemPricingBlocklists { export interface Raw { - blocked_discounts?: (OrderLineItemPricingBlocklistsBlockedDiscount.Raw[] | null | undefined) | null; - blocked_taxes?: (OrderLineItemPricingBlocklistsBlockedTax.Raw[] | null | undefined) | null; + blocked_discounts?: (OrderLineItemPricingBlocklistsBlockedDiscount.Raw[] | null) | null; + blocked_taxes?: (OrderLineItemPricingBlocklistsBlockedTax.Raw[] | null) | null; } } diff --git a/src/serialization/types/OrderLineItemPricingBlocklistsBlockedDiscount.ts b/src/serialization/types/OrderLineItemPricingBlocklistsBlockedDiscount.ts index 58feb53d8..2c326bb13 100644 --- a/src/serialization/types/OrderLineItemPricingBlocklistsBlockedDiscount.ts +++ b/src/serialization/types/OrderLineItemPricingBlocklistsBlockedDiscount.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderLineItemPricingBlocklistsBlockedDiscount: core.serialization.ObjectSchema< serializers.OrderLineItemPricingBlocklistsBlockedDiscount.Raw, @@ -18,8 +20,8 @@ export const OrderLineItemPricingBlocklistsBlockedDiscount: core.serialization.O export declare namespace OrderLineItemPricingBlocklistsBlockedDiscount { export interface Raw { - uid?: (string | null | undefined) | null; - discount_uid?: (string | null | undefined) | null; - discount_catalog_object_id?: (string | null | undefined) | null; + uid?: (string | null) | null; + discount_uid?: (string | null) | null; + discount_catalog_object_id?: (string | null) | null; } } diff --git a/src/serialization/types/OrderLineItemPricingBlocklistsBlockedTax.ts b/src/serialization/types/OrderLineItemPricingBlocklistsBlockedTax.ts index 13fc312fb..0909a8346 100644 --- a/src/serialization/types/OrderLineItemPricingBlocklistsBlockedTax.ts +++ b/src/serialization/types/OrderLineItemPricingBlocklistsBlockedTax.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderLineItemPricingBlocklistsBlockedTax: core.serialization.ObjectSchema< serializers.OrderLineItemPricingBlocklistsBlockedTax.Raw, @@ -18,8 +20,8 @@ export const OrderLineItemPricingBlocklistsBlockedTax: core.serialization.Object export declare namespace OrderLineItemPricingBlocklistsBlockedTax { export interface Raw { - uid?: (string | null | undefined) | null; - tax_uid?: (string | null | undefined) | null; - tax_catalog_object_id?: (string | null | undefined) | null; + uid?: (string | null) | null; + tax_uid?: (string | null) | null; + tax_catalog_object_id?: (string | null) | null; } } diff --git a/src/serialization/types/OrderLineItemTax.ts b/src/serialization/types/OrderLineItemTax.ts index 2a16d6efd..2e61af997 100644 --- a/src/serialization/types/OrderLineItemTax.ts +++ b/src/serialization/types/OrderLineItemTax.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; +import { OrderLineItemTaxType } from "./OrderLineItemTaxType"; import { Money } from "./Money"; import { OrderLineItemTaxScope } from "./OrderLineItemTaxScope"; -import { OrderLineItemTaxType } from "./OrderLineItemTaxType"; export const OrderLineItemTax: core.serialization.ObjectSchema< serializers.OrderLineItemTax.Raw, @@ -27,13 +29,13 @@ export const OrderLineItemTax: core.serialization.ObjectSchema< export declare namespace OrderLineItemTax { export interface Raw { - uid?: (string | null | undefined) | null; - catalog_object_id?: (string | null | undefined) | null; - catalog_version?: ((bigint | number) | null | undefined) | null; - name?: (string | null | undefined) | null; + uid?: (string | null) | null; + catalog_object_id?: (string | null) | null; + catalog_version?: ((bigint | number) | null) | null; + name?: (string | null) | null; type?: OrderLineItemTaxType.Raw | null; - percentage?: (string | null | undefined) | null; - metadata?: (Record | null | undefined) | null; + percentage?: (string | null) | null; + metadata?: (Record | null) | null; applied_money?: Money.Raw | null; scope?: OrderLineItemTaxScope.Raw | null; auto_applied?: boolean | null; diff --git a/src/serialization/types/OrderLineItemTaxScope.ts b/src/serialization/types/OrderLineItemTaxScope.ts index d3058cb04..c819edbed 100644 --- a/src/serialization/types/OrderLineItemTaxScope.ts +++ b/src/serialization/types/OrderLineItemTaxScope.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderLineItemTaxScope: core.serialization.Schema< serializers.OrderLineItemTaxScope.Raw, diff --git a/src/serialization/types/OrderLineItemTaxType.ts b/src/serialization/types/OrderLineItemTaxType.ts index aed8f6180..37322d402 100644 --- a/src/serialization/types/OrderLineItemTaxType.ts +++ b/src/serialization/types/OrderLineItemTaxType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderLineItemTaxType: core.serialization.Schema< serializers.OrderLineItemTaxType.Raw, diff --git a/src/serialization/types/OrderMoneyAmounts.ts b/src/serialization/types/OrderMoneyAmounts.ts index d35b8d894..40e754627 100644 --- a/src/serialization/types/OrderMoneyAmounts.ts +++ b/src/serialization/types/OrderMoneyAmounts.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const OrderMoneyAmounts: core.serialization.ObjectSchema< diff --git a/src/serialization/types/OrderPricingOptions.ts b/src/serialization/types/OrderPricingOptions.ts index 4f58b7647..cb0dd842b 100644 --- a/src/serialization/types/OrderPricingOptions.ts +++ b/src/serialization/types/OrderPricingOptions.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderPricingOptions: core.serialization.ObjectSchema< serializers.OrderPricingOptions.Raw, @@ -17,7 +19,7 @@ export const OrderPricingOptions: core.serialization.ObjectSchema< export declare namespace OrderPricingOptions { export interface Raw { - auto_apply_discounts?: (boolean | null | undefined) | null; - auto_apply_taxes?: (boolean | null | undefined) | null; + auto_apply_discounts?: (boolean | null) | null; + auto_apply_taxes?: (boolean | null) | null; } } diff --git a/src/serialization/types/OrderQuantityUnit.ts b/src/serialization/types/OrderQuantityUnit.ts index f4ffbf75d..7d67fdc6a 100644 --- a/src/serialization/types/OrderQuantityUnit.ts +++ b/src/serialization/types/OrderQuantityUnit.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { MeasurementUnit } from "./MeasurementUnit"; export const OrderQuantityUnit: core.serialization.ObjectSchema< @@ -18,8 +20,8 @@ export const OrderQuantityUnit: core.serialization.ObjectSchema< export declare namespace OrderQuantityUnit { export interface Raw { measurement_unit?: MeasurementUnit.Raw | null; - precision?: (number | null | undefined) | null; - catalog_object_id?: (string | null | undefined) | null; - catalog_version?: ((bigint | number) | null | undefined) | null; + precision?: (number | null) | null; + catalog_object_id?: (string | null) | null; + catalog_version?: ((bigint | number) | null) | null; } } diff --git a/src/serialization/types/OrderReturn.ts b/src/serialization/types/OrderReturn.ts index 72e09722f..650a90208 100644 --- a/src/serialization/types/OrderReturn.ts +++ b/src/serialization/types/OrderReturn.ts @@ -1,15 +1,17 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { OrderMoneyAmounts } from "./OrderMoneyAmounts"; -import { OrderReturnDiscount } from "./OrderReturnDiscount"; import { OrderReturnLineItem } from "./OrderReturnLineItem"; import { OrderReturnServiceCharge } from "./OrderReturnServiceCharge"; import { OrderReturnTax } from "./OrderReturnTax"; +import { OrderReturnDiscount } from "./OrderReturnDiscount"; import { OrderReturnTip } from "./OrderReturnTip"; import { OrderRoundingAdjustment } from "./OrderRoundingAdjustment"; +import { OrderMoneyAmounts } from "./OrderMoneyAmounts"; export const OrderReturn: core.serialization.ObjectSchema = core.serialization.object({ @@ -38,13 +40,13 @@ export const OrderReturn: core.serialization.ObjectSchema = core.serialization.object({ @@ -25,13 +27,13 @@ export const OrderReturnTax: core.serialization.ObjectSchema = @@ -18,9 +20,9 @@ export const OrderReturnTip: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/OrderRoundingAdjustment.ts b/src/serialization/types/OrderRoundingAdjustment.ts index 47814e563..fcdf03719 100644 --- a/src/serialization/types/OrderRoundingAdjustment.ts +++ b/src/serialization/types/OrderRoundingAdjustment.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const OrderRoundingAdjustment: core.serialization.ObjectSchema< @@ -16,8 +18,8 @@ export const OrderRoundingAdjustment: core.serialization.ObjectSchema< export declare namespace OrderRoundingAdjustment { export interface Raw { - uid?: (string | null | undefined) | null; - name?: (string | null | undefined) | null; + uid?: (string | null) | null; + name?: (string | null) | null; amount_money?: Money.Raw | null; } } diff --git a/src/serialization/types/OrderServiceCharge.ts b/src/serialization/types/OrderServiceCharge.ts index b2bad2fd2..88fbd238a 100644 --- a/src/serialization/types/OrderServiceCharge.ts +++ b/src/serialization/types/OrderServiceCharge.ts @@ -1,14 +1,16 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; -import { OrderLineItemAppliedTax } from "./OrderLineItemAppliedTax"; import { OrderServiceChargeCalculationPhase } from "./OrderServiceChargeCalculationPhase"; -import { OrderServiceChargeScope } from "./OrderServiceChargeScope"; -import { OrderServiceChargeTreatmentType } from "./OrderServiceChargeTreatmentType"; +import { OrderLineItemAppliedTax } from "./OrderLineItemAppliedTax"; import { OrderServiceChargeType } from "./OrderServiceChargeType"; +import { OrderServiceChargeTreatmentType } from "./OrderServiceChargeTreatmentType"; +import { OrderServiceChargeScope } from "./OrderServiceChargeScope"; export const OrderServiceCharge: core.serialization.ObjectSchema< serializers.OrderServiceCharge.Raw, @@ -39,19 +41,19 @@ export const OrderServiceCharge: core.serialization.ObjectSchema< export declare namespace OrderServiceCharge { export interface Raw { - uid?: (string | null | undefined) | null; - name?: (string | null | undefined) | null; - catalog_object_id?: (string | null | undefined) | null; - catalog_version?: ((bigint | number) | null | undefined) | null; - percentage?: (string | null | undefined) | null; + uid?: (string | null) | null; + name?: (string | null) | null; + catalog_object_id?: (string | null) | null; + catalog_version?: ((bigint | number) | null) | null; + percentage?: (string | null) | null; amount_money?: Money.Raw | null; applied_money?: Money.Raw | null; total_money?: Money.Raw | null; total_tax_money?: Money.Raw | null; calculation_phase?: OrderServiceChargeCalculationPhase.Raw | null; - taxable?: (boolean | null | undefined) | null; - applied_taxes?: (OrderLineItemAppliedTax.Raw[] | null | undefined) | null; - metadata?: (Record | null | undefined) | null; + taxable?: (boolean | null) | null; + applied_taxes?: (OrderLineItemAppliedTax.Raw[] | null) | null; + metadata?: (Record | null) | null; type?: OrderServiceChargeType.Raw | null; treatment_type?: OrderServiceChargeTreatmentType.Raw | null; scope?: OrderServiceChargeScope.Raw | null; diff --git a/src/serialization/types/OrderServiceChargeCalculationPhase.ts b/src/serialization/types/OrderServiceChargeCalculationPhase.ts index 7ef68b162..ac6544627 100644 --- a/src/serialization/types/OrderServiceChargeCalculationPhase.ts +++ b/src/serialization/types/OrderServiceChargeCalculationPhase.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderServiceChargeCalculationPhase: core.serialization.Schema< serializers.OrderServiceChargeCalculationPhase.Raw, diff --git a/src/serialization/types/OrderServiceChargeScope.ts b/src/serialization/types/OrderServiceChargeScope.ts index f8fcb8d5e..83faa80ea 100644 --- a/src/serialization/types/OrderServiceChargeScope.ts +++ b/src/serialization/types/OrderServiceChargeScope.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderServiceChargeScope: core.serialization.Schema< serializers.OrderServiceChargeScope.Raw, diff --git a/src/serialization/types/OrderServiceChargeTreatmentType.ts b/src/serialization/types/OrderServiceChargeTreatmentType.ts index 101cbbf62..af0aca06c 100644 --- a/src/serialization/types/OrderServiceChargeTreatmentType.ts +++ b/src/serialization/types/OrderServiceChargeTreatmentType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderServiceChargeTreatmentType: core.serialization.Schema< serializers.OrderServiceChargeTreatmentType.Raw, diff --git a/src/serialization/types/OrderServiceChargeType.ts b/src/serialization/types/OrderServiceChargeType.ts index e2e195b33..4553380e3 100644 --- a/src/serialization/types/OrderServiceChargeType.ts +++ b/src/serialization/types/OrderServiceChargeType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderServiceChargeType: core.serialization.Schema< serializers.OrderServiceChargeType.Raw, diff --git a/src/serialization/types/OrderSource.ts b/src/serialization/types/OrderSource.ts index 6052d7dee..f260b8b09 100644 --- a/src/serialization/types/OrderSource.ts +++ b/src/serialization/types/OrderSource.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderSource: core.serialization.ObjectSchema = core.serialization.object({ @@ -11,6 +13,6 @@ export const OrderSource: core.serialization.ObjectSchema = core.serialization.enum_(["OPEN", "COMPLETED", "CANCELED", "DRAFT"]); diff --git a/src/serialization/types/OrderUpdated.ts b/src/serialization/types/OrderUpdated.ts index c3a74a2e9..8d3ef5fb1 100644 --- a/src/serialization/types/OrderUpdated.ts +++ b/src/serialization/types/OrderUpdated.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { OrderState } from "./OrderState"; export const OrderUpdated: core.serialization.ObjectSchema = @@ -17,9 +19,9 @@ export const OrderUpdated: core.serialization.ObjectSchema = core.serialization.object({ @@ -89,7 +91,7 @@ export declare namespace Payment { refunded_money?: Money.Raw | null; status?: string | null; delay_duration?: string | null; - delay_action?: (string | null | undefined) | null; + delay_action?: (string | null) | null; delayed_until?: string | null; source_type?: string | null; card_details?: CardPaymentDetails.Raw | null; @@ -104,7 +106,7 @@ export declare namespace Payment { reference_id?: string | null; customer_id?: string | null; employee_id?: string | null; - team_member_id?: (string | null | undefined) | null; + team_member_id?: (string | null) | null; refund_ids?: string[] | null; risk_evaluation?: RiskEvaluation.Raw | null; terminal_checkout_id?: string | null; @@ -120,6 +122,6 @@ export declare namespace Payment { application_details?: ApplicationDetails.Raw | null; is_offline_payment?: boolean | null; offline_payment_details?: OfflinePaymentDetails.Raw | null; - version_token?: (string | null | undefined) | null; + version_token?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityAppFeeRefundDetail.ts b/src/serialization/types/PaymentBalanceActivityAppFeeRefundDetail.ts index f8866c242..93715e586 100644 --- a/src/serialization/types/PaymentBalanceActivityAppFeeRefundDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityAppFeeRefundDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivityAppFeeRefundDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityAppFeeRefundDetail.Raw, @@ -15,8 +17,8 @@ export const PaymentBalanceActivityAppFeeRefundDetail: core.serialization.Object export declare namespace PaymentBalanceActivityAppFeeRefundDetail { export interface Raw { - payment_id?: (string | null | undefined) | null; - refund_id?: (string | null | undefined) | null; - location_id?: (string | null | undefined) | null; + payment_id?: (string | null) | null; + refund_id?: (string | null) | null; + location_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityAppFeeRevenueDetail.ts b/src/serialization/types/PaymentBalanceActivityAppFeeRevenueDetail.ts index f76a9bebd..e51a7e1d7 100644 --- a/src/serialization/types/PaymentBalanceActivityAppFeeRevenueDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityAppFeeRevenueDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivityAppFeeRevenueDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityAppFeeRevenueDetail.Raw, @@ -14,7 +16,7 @@ export const PaymentBalanceActivityAppFeeRevenueDetail: core.serialization.Objec export declare namespace PaymentBalanceActivityAppFeeRevenueDetail { export interface Raw { - payment_id?: (string | null | undefined) | null; - location_id?: (string | null | undefined) | null; + payment_id?: (string | null) | null; + location_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityAutomaticSavingsDetail.ts b/src/serialization/types/PaymentBalanceActivityAutomaticSavingsDetail.ts index 91cd55ccb..5a54a9f90 100644 --- a/src/serialization/types/PaymentBalanceActivityAutomaticSavingsDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityAutomaticSavingsDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivityAutomaticSavingsDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityAutomaticSavingsDetail.Raw, @@ -14,7 +16,7 @@ export const PaymentBalanceActivityAutomaticSavingsDetail: core.serialization.Ob export declare namespace PaymentBalanceActivityAutomaticSavingsDetail { export interface Raw { - payment_id?: (string | null | undefined) | null; - payout_id?: (string | null | undefined) | null; + payment_id?: (string | null) | null; + payout_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityAutomaticSavingsReversedDetail.ts b/src/serialization/types/PaymentBalanceActivityAutomaticSavingsReversedDetail.ts index feb39fd59..936413940 100644 --- a/src/serialization/types/PaymentBalanceActivityAutomaticSavingsReversedDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityAutomaticSavingsReversedDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivityAutomaticSavingsReversedDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityAutomaticSavingsReversedDetail.Raw, @@ -14,7 +16,7 @@ export const PaymentBalanceActivityAutomaticSavingsReversedDetail: core.serializ export declare namespace PaymentBalanceActivityAutomaticSavingsReversedDetail { export interface Raw { - payment_id?: (string | null | undefined) | null; - payout_id?: (string | null | undefined) | null; + payment_id?: (string | null) | null; + payout_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityChargeDetail.ts b/src/serialization/types/PaymentBalanceActivityChargeDetail.ts index a4ebc7fe0..1106a0204 100644 --- a/src/serialization/types/PaymentBalanceActivityChargeDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityChargeDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivityChargeDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityChargeDetail.Raw, @@ -13,6 +15,6 @@ export const PaymentBalanceActivityChargeDetail: core.serialization.ObjectSchema export declare namespace PaymentBalanceActivityChargeDetail { export interface Raw { - payment_id?: (string | null | undefined) | null; + payment_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityDepositFeeDetail.ts b/src/serialization/types/PaymentBalanceActivityDepositFeeDetail.ts index 00f7572fd..8e3f3179e 100644 --- a/src/serialization/types/PaymentBalanceActivityDepositFeeDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityDepositFeeDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivityDepositFeeDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityDepositFeeDetail.Raw, @@ -13,6 +15,6 @@ export const PaymentBalanceActivityDepositFeeDetail: core.serialization.ObjectSc export declare namespace PaymentBalanceActivityDepositFeeDetail { export interface Raw { - payout_id?: (string | null | undefined) | null; + payout_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityDepositFeeReversedDetail.ts b/src/serialization/types/PaymentBalanceActivityDepositFeeReversedDetail.ts index fdf9787a5..53747895f 100644 --- a/src/serialization/types/PaymentBalanceActivityDepositFeeReversedDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityDepositFeeReversedDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivityDepositFeeReversedDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityDepositFeeReversedDetail.Raw, @@ -13,6 +15,6 @@ export const PaymentBalanceActivityDepositFeeReversedDetail: core.serialization. export declare namespace PaymentBalanceActivityDepositFeeReversedDetail { export interface Raw { - payout_id?: (string | null | undefined) | null; + payout_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityDisputeDetail.ts b/src/serialization/types/PaymentBalanceActivityDisputeDetail.ts index cb56fba67..a25697664 100644 --- a/src/serialization/types/PaymentBalanceActivityDisputeDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityDisputeDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivityDisputeDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityDisputeDetail.Raw, @@ -14,7 +16,7 @@ export const PaymentBalanceActivityDisputeDetail: core.serialization.ObjectSchem export declare namespace PaymentBalanceActivityDisputeDetail { export interface Raw { - payment_id?: (string | null | undefined) | null; - dispute_id?: (string | null | undefined) | null; + payment_id?: (string | null) | null; + dispute_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityFeeDetail.ts b/src/serialization/types/PaymentBalanceActivityFeeDetail.ts index a4025c771..30db029ff 100644 --- a/src/serialization/types/PaymentBalanceActivityFeeDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityFeeDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivityFeeDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityFeeDetail.Raw, @@ -13,6 +15,6 @@ export const PaymentBalanceActivityFeeDetail: core.serialization.ObjectSchema< export declare namespace PaymentBalanceActivityFeeDetail { export interface Raw { - payment_id?: (string | null | undefined) | null; + payment_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityFreeProcessingDetail.ts b/src/serialization/types/PaymentBalanceActivityFreeProcessingDetail.ts index 98a49d9cf..38e81759b 100644 --- a/src/serialization/types/PaymentBalanceActivityFreeProcessingDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityFreeProcessingDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivityFreeProcessingDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityFreeProcessingDetail.Raw, @@ -13,6 +15,6 @@ export const PaymentBalanceActivityFreeProcessingDetail: core.serialization.Obje export declare namespace PaymentBalanceActivityFreeProcessingDetail { export interface Raw { - payment_id?: (string | null | undefined) | null; + payment_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityHoldAdjustmentDetail.ts b/src/serialization/types/PaymentBalanceActivityHoldAdjustmentDetail.ts index 22d759bad..7add70237 100644 --- a/src/serialization/types/PaymentBalanceActivityHoldAdjustmentDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityHoldAdjustmentDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivityHoldAdjustmentDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityHoldAdjustmentDetail.Raw, @@ -13,6 +15,6 @@ export const PaymentBalanceActivityHoldAdjustmentDetail: core.serialization.Obje export declare namespace PaymentBalanceActivityHoldAdjustmentDetail { export interface Raw { - payment_id?: (string | null | undefined) | null; + payment_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityOpenDisputeDetail.ts b/src/serialization/types/PaymentBalanceActivityOpenDisputeDetail.ts index 42a1d1510..ffe15a534 100644 --- a/src/serialization/types/PaymentBalanceActivityOpenDisputeDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityOpenDisputeDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivityOpenDisputeDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityOpenDisputeDetail.Raw, @@ -14,7 +16,7 @@ export const PaymentBalanceActivityOpenDisputeDetail: core.serialization.ObjectS export declare namespace PaymentBalanceActivityOpenDisputeDetail { export interface Raw { - payment_id?: (string | null | undefined) | null; - dispute_id?: (string | null | undefined) | null; + payment_id?: (string | null) | null; + dispute_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityOtherAdjustmentDetail.ts b/src/serialization/types/PaymentBalanceActivityOtherAdjustmentDetail.ts index 41385eecc..82a2306a8 100644 --- a/src/serialization/types/PaymentBalanceActivityOtherAdjustmentDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityOtherAdjustmentDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivityOtherAdjustmentDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityOtherAdjustmentDetail.Raw, @@ -13,6 +15,6 @@ export const PaymentBalanceActivityOtherAdjustmentDetail: core.serialization.Obj export declare namespace PaymentBalanceActivityOtherAdjustmentDetail { export interface Raw { - payment_id?: (string | null | undefined) | null; + payment_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityOtherDetail.ts b/src/serialization/types/PaymentBalanceActivityOtherDetail.ts index cc36bf3dc..b630c73b3 100644 --- a/src/serialization/types/PaymentBalanceActivityOtherDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityOtherDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivityOtherDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityOtherDetail.Raw, @@ -13,6 +15,6 @@ export const PaymentBalanceActivityOtherDetail: core.serialization.ObjectSchema< export declare namespace PaymentBalanceActivityOtherDetail { export interface Raw { - payment_id?: (string | null | undefined) | null; + payment_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityRefundDetail.ts b/src/serialization/types/PaymentBalanceActivityRefundDetail.ts index e424b9092..872d98175 100644 --- a/src/serialization/types/PaymentBalanceActivityRefundDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityRefundDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivityRefundDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityRefundDetail.Raw, @@ -14,7 +16,7 @@ export const PaymentBalanceActivityRefundDetail: core.serialization.ObjectSchema export declare namespace PaymentBalanceActivityRefundDetail { export interface Raw { - payment_id?: (string | null | undefined) | null; - refund_id?: (string | null | undefined) | null; + payment_id?: (string | null) | null; + refund_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityReleaseAdjustmentDetail.ts b/src/serialization/types/PaymentBalanceActivityReleaseAdjustmentDetail.ts index f52fea44a..9cac322fd 100644 --- a/src/serialization/types/PaymentBalanceActivityReleaseAdjustmentDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityReleaseAdjustmentDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivityReleaseAdjustmentDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityReleaseAdjustmentDetail.Raw, @@ -13,6 +15,6 @@ export const PaymentBalanceActivityReleaseAdjustmentDetail: core.serialization.O export declare namespace PaymentBalanceActivityReleaseAdjustmentDetail { export interface Raw { - payment_id?: (string | null | undefined) | null; + payment_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityReserveHoldDetail.ts b/src/serialization/types/PaymentBalanceActivityReserveHoldDetail.ts index 8ff35faa3..9fb979d1b 100644 --- a/src/serialization/types/PaymentBalanceActivityReserveHoldDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityReserveHoldDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivityReserveHoldDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityReserveHoldDetail.Raw, @@ -13,6 +15,6 @@ export const PaymentBalanceActivityReserveHoldDetail: core.serialization.ObjectS export declare namespace PaymentBalanceActivityReserveHoldDetail { export interface Raw { - payment_id?: (string | null | undefined) | null; + payment_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityReserveReleaseDetail.ts b/src/serialization/types/PaymentBalanceActivityReserveReleaseDetail.ts index 67869e9d0..3c67aee14 100644 --- a/src/serialization/types/PaymentBalanceActivityReserveReleaseDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityReserveReleaseDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivityReserveReleaseDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityReserveReleaseDetail.Raw, @@ -13,6 +15,6 @@ export const PaymentBalanceActivityReserveReleaseDetail: core.serialization.Obje export declare namespace PaymentBalanceActivityReserveReleaseDetail { export interface Raw { - payment_id?: (string | null | undefined) | null; + payment_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivitySquareCapitalPaymentDetail.ts b/src/serialization/types/PaymentBalanceActivitySquareCapitalPaymentDetail.ts index 55a415929..3d6c15fa1 100644 --- a/src/serialization/types/PaymentBalanceActivitySquareCapitalPaymentDetail.ts +++ b/src/serialization/types/PaymentBalanceActivitySquareCapitalPaymentDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivitySquareCapitalPaymentDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivitySquareCapitalPaymentDetail.Raw, @@ -13,6 +15,6 @@ export const PaymentBalanceActivitySquareCapitalPaymentDetail: core.serializatio export declare namespace PaymentBalanceActivitySquareCapitalPaymentDetail { export interface Raw { - payment_id?: (string | null | undefined) | null; + payment_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivitySquareCapitalReversedPaymentDetail.ts b/src/serialization/types/PaymentBalanceActivitySquareCapitalReversedPaymentDetail.ts index 194f1a598..055245e5c 100644 --- a/src/serialization/types/PaymentBalanceActivitySquareCapitalReversedPaymentDetail.ts +++ b/src/serialization/types/PaymentBalanceActivitySquareCapitalReversedPaymentDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivitySquareCapitalReversedPaymentDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivitySquareCapitalReversedPaymentDetail.Raw, @@ -13,6 +15,6 @@ export const PaymentBalanceActivitySquareCapitalReversedPaymentDetail: core.seri export declare namespace PaymentBalanceActivitySquareCapitalReversedPaymentDetail { export interface Raw { - payment_id?: (string | null | undefined) | null; + payment_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivitySquarePayrollTransferDetail.ts b/src/serialization/types/PaymentBalanceActivitySquarePayrollTransferDetail.ts index edd19d974..5d4921bbe 100644 --- a/src/serialization/types/PaymentBalanceActivitySquarePayrollTransferDetail.ts +++ b/src/serialization/types/PaymentBalanceActivitySquarePayrollTransferDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivitySquarePayrollTransferDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivitySquarePayrollTransferDetail.Raw, @@ -13,6 +15,6 @@ export const PaymentBalanceActivitySquarePayrollTransferDetail: core.serializati export declare namespace PaymentBalanceActivitySquarePayrollTransferDetail { export interface Raw { - payment_id?: (string | null | undefined) | null; + payment_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivitySquarePayrollTransferReversedDetail.ts b/src/serialization/types/PaymentBalanceActivitySquarePayrollTransferReversedDetail.ts index 30324466d..c1788834d 100644 --- a/src/serialization/types/PaymentBalanceActivitySquarePayrollTransferReversedDetail.ts +++ b/src/serialization/types/PaymentBalanceActivitySquarePayrollTransferReversedDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivitySquarePayrollTransferReversedDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivitySquarePayrollTransferReversedDetail.Raw, @@ -13,6 +15,6 @@ export const PaymentBalanceActivitySquarePayrollTransferReversedDetail: core.ser export declare namespace PaymentBalanceActivitySquarePayrollTransferReversedDetail { export interface Raw { - payment_id?: (string | null | undefined) | null; + payment_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityTaxOnFeeDetail.ts b/src/serialization/types/PaymentBalanceActivityTaxOnFeeDetail.ts index e0f706bc5..e7b9c9ded 100644 --- a/src/serialization/types/PaymentBalanceActivityTaxOnFeeDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityTaxOnFeeDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivityTaxOnFeeDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityTaxOnFeeDetail.Raw, @@ -17,7 +19,7 @@ export const PaymentBalanceActivityTaxOnFeeDetail: core.serialization.ObjectSche export declare namespace PaymentBalanceActivityTaxOnFeeDetail { export interface Raw { - payment_id?: (string | null | undefined) | null; - tax_rate_description?: (string | null | undefined) | null; + payment_id?: (string | null) | null; + tax_rate_description?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityThirdPartyFeeDetail.ts b/src/serialization/types/PaymentBalanceActivityThirdPartyFeeDetail.ts index 20a35a162..5cd6f8826 100644 --- a/src/serialization/types/PaymentBalanceActivityThirdPartyFeeDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityThirdPartyFeeDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivityThirdPartyFeeDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityThirdPartyFeeDetail.Raw, @@ -13,6 +15,6 @@ export const PaymentBalanceActivityThirdPartyFeeDetail: core.serialization.Objec export declare namespace PaymentBalanceActivityThirdPartyFeeDetail { export interface Raw { - payment_id?: (string | null | undefined) | null; + payment_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentBalanceActivityThirdPartyFeeRefundDetail.ts b/src/serialization/types/PaymentBalanceActivityThirdPartyFeeRefundDetail.ts index 64e7f2af6..177199e56 100644 --- a/src/serialization/types/PaymentBalanceActivityThirdPartyFeeRefundDetail.ts +++ b/src/serialization/types/PaymentBalanceActivityThirdPartyFeeRefundDetail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaymentBalanceActivityThirdPartyFeeRefundDetail: core.serialization.ObjectSchema< serializers.PaymentBalanceActivityThirdPartyFeeRefundDetail.Raw, @@ -14,7 +16,7 @@ export const PaymentBalanceActivityThirdPartyFeeRefundDetail: core.serialization export declare namespace PaymentBalanceActivityThirdPartyFeeRefundDetail { export interface Raw { - payment_id?: (string | null | undefined) | null; - refund_id?: (string | null | undefined) | null; + payment_id?: (string | null) | null; + refund_id?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentCreatedEvent.ts b/src/serialization/types/PaymentCreatedEvent.ts index 047c2cc59..b34bdd905 100644 --- a/src/serialization/types/PaymentCreatedEvent.ts +++ b/src/serialization/types/PaymentCreatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { PaymentCreatedEventData } from "./PaymentCreatedEventData"; export const PaymentCreatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const PaymentCreatedEvent: core.serialization.ObjectSchema< export declare namespace PaymentCreatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: PaymentCreatedEventData.Raw | null; } diff --git a/src/serialization/types/PaymentCreatedEventData.ts b/src/serialization/types/PaymentCreatedEventData.ts index fa80d9f63..a09a44f6e 100644 --- a/src/serialization/types/PaymentCreatedEventData.ts +++ b/src/serialization/types/PaymentCreatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { PaymentCreatedEventObject } from "./PaymentCreatedEventObject"; export const PaymentCreatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const PaymentCreatedEventData: core.serialization.ObjectSchema< export declare namespace PaymentCreatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: PaymentCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/PaymentCreatedEventObject.ts b/src/serialization/types/PaymentCreatedEventObject.ts index a13abf467..9dbe956b7 100644 --- a/src/serialization/types/PaymentCreatedEventObject.ts +++ b/src/serialization/types/PaymentCreatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Payment } from "./Payment"; export const PaymentCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/PaymentLink.ts b/src/serialization/types/PaymentLink.ts index eb053e7d9..4bef5bb04 100644 --- a/src/serialization/types/PaymentLink.ts +++ b/src/serialization/types/PaymentLink.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CheckoutOptions } from "./CheckoutOptions"; import { PrePopulatedData } from "./PrePopulatedData"; @@ -25,7 +27,7 @@ export declare namespace PaymentLink { export interface Raw { id?: string | null; version: number; - description?: (string | null | undefined) | null; + description?: (string | null) | null; order_id?: string | null; checkout_options?: CheckoutOptions.Raw | null; pre_populated_data?: PrePopulatedData.Raw | null; @@ -33,6 +35,6 @@ export declare namespace PaymentLink { long_url?: string | null; created_at?: string | null; updated_at?: string | null; - payment_note?: (string | null | undefined) | null; + payment_note?: (string | null) | null; } } diff --git a/src/serialization/types/PaymentLinkRelatedResources.ts b/src/serialization/types/PaymentLinkRelatedResources.ts index 27fd151c2..b2b074e85 100644 --- a/src/serialization/types/PaymentLinkRelatedResources.ts +++ b/src/serialization/types/PaymentLinkRelatedResources.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; -import * as core from "../../core"; import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; import { Order } from "./Order"; export const PaymentLinkRelatedResources: core.serialization.ObjectSchema< @@ -18,7 +20,7 @@ export const PaymentLinkRelatedResources: core.serialization.ObjectSchema< export declare namespace PaymentLinkRelatedResources { export interface Raw { - orders?: (Order.Raw[] | null | undefined) | null; - subscription_plans?: (serializers.CatalogObject.Raw[] | null | undefined) | null; + orders?: (Order.Raw[] | null) | null; + subscription_plans?: (serializers.CatalogObject.Raw[] | null) | null; } } diff --git a/src/serialization/types/PaymentOptions.ts b/src/serialization/types/PaymentOptions.ts index fd9b858bd..35c20723c 100644 --- a/src/serialization/types/PaymentOptions.ts +++ b/src/serialization/types/PaymentOptions.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { PaymentOptionsDelayAction } from "./PaymentOptionsDelayAction"; export const PaymentOptions: core.serialization.ObjectSchema = @@ -18,9 +20,9 @@ export const PaymentOptions: core.serialization.ObjectSchema = core.serialization.object( { @@ -37,8 +39,8 @@ export declare namespace Payout { destination?: Destination.Raw | null; version?: number | null; type?: PayoutType.Raw | null; - payout_fee?: (PayoutFee.Raw[] | null | undefined) | null; - arrival_date?: (string | null | undefined) | null; - end_to_end_id?: (string | null | undefined) | null; + payout_fee?: (PayoutFee.Raw[] | null) | null; + arrival_date?: (string | null) | null; + end_to_end_id?: (string | null) | null; } } diff --git a/src/serialization/types/PayoutEntry.ts b/src/serialization/types/PayoutEntry.ts index 231d29f0e..be6a53eed 100644 --- a/src/serialization/types/PayoutEntry.ts +++ b/src/serialization/types/PayoutEntry.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { ActivityType } from "./ActivityType"; import { Money } from "./Money"; -import { PaymentBalanceActivityAppFeeRefundDetail } from "./PaymentBalanceActivityAppFeeRefundDetail"; import { PaymentBalanceActivityAppFeeRevenueDetail } from "./PaymentBalanceActivityAppFeeRevenueDetail"; +import { PaymentBalanceActivityAppFeeRefundDetail } from "./PaymentBalanceActivityAppFeeRefundDetail"; import { PaymentBalanceActivityAutomaticSavingsDetail } from "./PaymentBalanceActivityAutomaticSavingsDetail"; import { PaymentBalanceActivityAutomaticSavingsReversedDetail } from "./PaymentBalanceActivityAutomaticSavingsReversedDetail"; import { PaymentBalanceActivityChargeDetail } from "./PaymentBalanceActivityChargeDetail"; @@ -17,19 +19,19 @@ import { PaymentBalanceActivityFeeDetail } from "./PaymentBalanceActivityFeeDeta import { PaymentBalanceActivityFreeProcessingDetail } from "./PaymentBalanceActivityFreeProcessingDetail"; import { PaymentBalanceActivityHoldAdjustmentDetail } from "./PaymentBalanceActivityHoldAdjustmentDetail"; import { PaymentBalanceActivityOpenDisputeDetail } from "./PaymentBalanceActivityOpenDisputeDetail"; -import { PaymentBalanceActivityOtherAdjustmentDetail } from "./PaymentBalanceActivityOtherAdjustmentDetail"; import { PaymentBalanceActivityOtherDetail } from "./PaymentBalanceActivityOtherDetail"; +import { PaymentBalanceActivityOtherAdjustmentDetail } from "./PaymentBalanceActivityOtherAdjustmentDetail"; import { PaymentBalanceActivityRefundDetail } from "./PaymentBalanceActivityRefundDetail"; import { PaymentBalanceActivityReleaseAdjustmentDetail } from "./PaymentBalanceActivityReleaseAdjustmentDetail"; import { PaymentBalanceActivityReserveHoldDetail } from "./PaymentBalanceActivityReserveHoldDetail"; import { PaymentBalanceActivityReserveReleaseDetail } from "./PaymentBalanceActivityReserveReleaseDetail"; import { PaymentBalanceActivitySquareCapitalPaymentDetail } from "./PaymentBalanceActivitySquareCapitalPaymentDetail"; import { PaymentBalanceActivitySquareCapitalReversedPaymentDetail } from "./PaymentBalanceActivitySquareCapitalReversedPaymentDetail"; -import { PaymentBalanceActivitySquarePayrollTransferDetail } from "./PaymentBalanceActivitySquarePayrollTransferDetail"; -import { PaymentBalanceActivitySquarePayrollTransferReversedDetail } from "./PaymentBalanceActivitySquarePayrollTransferReversedDetail"; import { PaymentBalanceActivityTaxOnFeeDetail } from "./PaymentBalanceActivityTaxOnFeeDetail"; import { PaymentBalanceActivityThirdPartyFeeDetail } from "./PaymentBalanceActivityThirdPartyFeeDetail"; import { PaymentBalanceActivityThirdPartyFeeRefundDetail } from "./PaymentBalanceActivityThirdPartyFeeRefundDetail"; +import { PaymentBalanceActivitySquarePayrollTransferDetail } from "./PaymentBalanceActivitySquarePayrollTransferDetail"; +import { PaymentBalanceActivitySquarePayrollTransferReversedDetail } from "./PaymentBalanceActivitySquarePayrollTransferReversedDetail"; export const PayoutEntry: core.serialization.ObjectSchema = core.serialization.object({ @@ -143,7 +145,7 @@ export declare namespace PayoutEntry { export interface Raw { id: string; payout_id: string; - effective_at?: (string | null | undefined) | null; + effective_at?: (string | null) | null; type?: ActivityType.Raw | null; gross_amount_money?: Money.Raw | null; fee_amount_money?: Money.Raw | null; diff --git a/src/serialization/types/PayoutFailedEvent.ts b/src/serialization/types/PayoutFailedEvent.ts index 8410e3387..52458cb33 100644 --- a/src/serialization/types/PayoutFailedEvent.ts +++ b/src/serialization/types/PayoutFailedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { PayoutFailedEventData } from "./PayoutFailedEventData"; export const PayoutFailedEvent: core.serialization.ObjectSchema< @@ -19,10 +21,10 @@ export const PayoutFailedEvent: core.serialization.ObjectSchema< export declare namespace PayoutFailedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - location_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + location_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: PayoutFailedEventData.Raw | null; } diff --git a/src/serialization/types/PayoutFailedEventData.ts b/src/serialization/types/PayoutFailedEventData.ts index 04a806f2a..d756875b8 100644 --- a/src/serialization/types/PayoutFailedEventData.ts +++ b/src/serialization/types/PayoutFailedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { PayoutFailedEventObject } from "./PayoutFailedEventObject"; export const PayoutFailedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const PayoutFailedEventData: core.serialization.ObjectSchema< export declare namespace PayoutFailedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: PayoutFailedEventObject.Raw | null; } diff --git a/src/serialization/types/PayoutFailedEventObject.ts b/src/serialization/types/PayoutFailedEventObject.ts index 4681788b0..f6793cbca 100644 --- a/src/serialization/types/PayoutFailedEventObject.ts +++ b/src/serialization/types/PayoutFailedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Payout } from "./Payout"; export const PayoutFailedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/PayoutFee.ts b/src/serialization/types/PayoutFee.ts index dca34e5ba..336dee4cb 100644 --- a/src/serialization/types/PayoutFee.ts +++ b/src/serialization/types/PayoutFee.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; import { PayoutFeeType } from "./PayoutFeeType"; @@ -16,7 +18,7 @@ export const PayoutFee: core.serialization.ObjectSchema = core.serialization.enum_(["TRANSFER_FEE", "TAX_ON_TRANSFER_FEE"]); diff --git a/src/serialization/types/PayoutPaidEvent.ts b/src/serialization/types/PayoutPaidEvent.ts index b26f232bc..77f175062 100644 --- a/src/serialization/types/PayoutPaidEvent.ts +++ b/src/serialization/types/PayoutPaidEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { PayoutPaidEventData } from "./PayoutPaidEventData"; export const PayoutPaidEvent: core.serialization.ObjectSchema = @@ -17,10 +19,10 @@ export const PayoutPaidEvent: core.serialization.ObjectSchema = @@ -17,10 +19,10 @@ export const PayoutSentEvent: core.serialization.ObjectSchema = core.serialization.enum_(["SENT", "FAILED", "PAID"]); diff --git a/src/serialization/types/PayoutType.ts b/src/serialization/types/PayoutType.ts index 1a794e06d..b098f055b 100644 --- a/src/serialization/types/PayoutType.ts +++ b/src/serialization/types/PayoutType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PayoutType: core.serialization.Schema = core.serialization.enum_(["BATCH", "SIMPLE"]); diff --git a/src/serialization/types/Phase.ts b/src/serialization/types/Phase.ts index dd81e2675..729c46185 100644 --- a/src/serialization/types/Phase.ts +++ b/src/serialization/types/Phase.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const Phase: core.serialization.ObjectSchema = core.serialization.object({ uid: core.serialization.string().optionalNullable(), @@ -13,9 +15,9 @@ export const Phase: core.serialization.ObjectSchema = core.serialization.object({ @@ -16,6 +18,6 @@ export const PhaseInput: core.serialization.ObjectSchema = @@ -14,8 +16,8 @@ export const ProcessingFee: core.serialization.ObjectSchema = core.serialization.enum_([ "SQUARE_POS", diff --git a/src/serialization/types/ProductType.ts b/src/serialization/types/ProductType.ts index 12439ca7a..4c34c70bf 100644 --- a/src/serialization/types/ProductType.ts +++ b/src/serialization/types/ProductType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ProductType: core.serialization.Schema = core.serialization.stringLiteral("TERMINAL_API"); diff --git a/src/serialization/types/PublishInvoiceResponse.ts b/src/serialization/types/PublishInvoiceResponse.ts index 2434e430e..7158bd895 100644 --- a/src/serialization/types/PublishInvoiceResponse.ts +++ b/src/serialization/types/PublishInvoiceResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Invoice } from "./Invoice"; +import { Error_ } from "./Error_"; export const PublishInvoiceResponse: core.serialization.ObjectSchema< serializers.PublishInvoiceResponse.Raw, diff --git a/src/serialization/types/PublishScheduledShiftResponse.ts b/src/serialization/types/PublishScheduledShiftResponse.ts index dd36ce418..4c83f8eda 100644 --- a/src/serialization/types/PublishScheduledShiftResponse.ts +++ b/src/serialization/types/PublishScheduledShiftResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { ScheduledShift } from "./ScheduledShift"; +import { Error_ } from "./Error_"; export const PublishScheduledShiftResponse: core.serialization.ObjectSchema< serializers.PublishScheduledShiftResponse.Raw, diff --git a/src/serialization/types/QrCodeOptions.ts b/src/serialization/types/QrCodeOptions.ts index ece1f9175..441b168c5 100644 --- a/src/serialization/types/QrCodeOptions.ts +++ b/src/serialization/types/QrCodeOptions.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const QrCodeOptions: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/QuickPay.ts b/src/serialization/types/QuickPay.ts index 656d38911..d2b0867ae 100644 --- a/src/serialization/types/QuickPay.ts +++ b/src/serialization/types/QuickPay.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const QuickPay: core.serialization.ObjectSchema = diff --git a/src/serialization/types/Range.ts b/src/serialization/types/Range.ts index f8c22d864..a77159731 100644 --- a/src/serialization/types/Range.ts +++ b/src/serialization/types/Range.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const Range: core.serialization.ObjectSchema = core.serialization.object({ min: core.serialization.string().optionalNullable(), @@ -11,7 +13,7 @@ export const Range: core.serialization.ObjectSchema = core.serialization.object({ @@ -14,7 +16,7 @@ export const ReceiptOptions: core.serialization.ObjectSchema = core.serialization.object({ - transferOrder: core.serialization.property("transfer_order", TransferOrder.optional()), - errors: core.serialization.list(Error_).optional(), -}); - -export declare namespace ReceiveTransferOrderResponse { - export interface Raw { - transfer_order?: TransferOrder.Raw | null; - errors?: Error_.Raw[] | null; - } -} diff --git a/src/serialization/types/RedeemLoyaltyRewardResponse.ts b/src/serialization/types/RedeemLoyaltyRewardResponse.ts index 4f4713500..b73aec760 100644 --- a/src/serialization/types/RedeemLoyaltyRewardResponse.ts +++ b/src/serialization/types/RedeemLoyaltyRewardResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyEvent } from "./LoyaltyEvent"; diff --git a/src/serialization/types/Reference.ts b/src/serialization/types/Reference.ts deleted file mode 100644 index 3bef919ee..000000000 --- a/src/serialization/types/Reference.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { ReferenceType } from "./ReferenceType"; - -export const Reference: core.serialization.ObjectSchema = - core.serialization.object({ - type: ReferenceType.optional(), - id: core.serialization.string().optional(), - }); - -export declare namespace Reference { - export interface Raw { - type?: ReferenceType.Raw | null; - id?: string | null; - } -} diff --git a/src/serialization/types/ReferenceType.ts b/src/serialization/types/ReferenceType.ts deleted file mode 100644 index 570b0678e..000000000 --- a/src/serialization/types/ReferenceType.ts +++ /dev/null @@ -1,43 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const ReferenceType: core.serialization.Schema = - core.serialization.enum_([ - "UNKNOWN_TYPE", - "LOCATION", - "FIRST_PARTY_INTEGRATION", - "OAUTH_APPLICATION", - "ONLINE_SITE", - "ONLINE_CHECKOUT", - "INVOICE", - "GIFT_CARD", - "GIFT_CARD_MARKETPLACE", - "RECURRING_SUBSCRIPTION", - "ONLINE_BOOKING_FLOW", - "SQUARE_ASSISTANT", - "CASH_LOCAL", - "POINT_OF_SALE", - "KIOSK", - ]); - -export declare namespace ReferenceType { - export type Raw = - | "UNKNOWN_TYPE" - | "LOCATION" - | "FIRST_PARTY_INTEGRATION" - | "OAUTH_APPLICATION" - | "ONLINE_SITE" - | "ONLINE_CHECKOUT" - | "INVOICE" - | "GIFT_CARD" - | "GIFT_CARD_MARKETPLACE" - | "RECURRING_SUBSCRIPTION" - | "ONLINE_BOOKING_FLOW" - | "SQUARE_ASSISTANT" - | "CASH_LOCAL" - | "POINT_OF_SALE" - | "KIOSK"; -} diff --git a/src/serialization/types/Refund.ts b/src/serialization/types/Refund.ts index 16397e7ba..2a1c441ae 100644 --- a/src/serialization/types/Refund.ts +++ b/src/serialization/types/Refund.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { AdditionalRecipient } from "./AdditionalRecipient"; import { Money } from "./Money"; import { RefundStatus } from "./RefundStatus"; +import { AdditionalRecipient } from "./AdditionalRecipient"; export const Refund: core.serialization.ObjectSchema = core.serialization.object( { @@ -29,13 +31,13 @@ export declare namespace Refund { export interface Raw { id: string; location_id: string; - transaction_id?: (string | null | undefined) | null; - tender_id?: (string | null | undefined) | null; + transaction_id?: (string | null) | null; + tender_id?: (string | null) | null; created_at?: string | null; reason: string; amount_money: Money.Raw; status: RefundStatus.Raw; processing_fee_money?: Money.Raw | null; - additional_recipients?: (AdditionalRecipient.Raw[] | null | undefined) | null; + additional_recipients?: (AdditionalRecipient.Raw[] | null) | null; } } diff --git a/src/serialization/types/RefundCreatedEvent.ts b/src/serialization/types/RefundCreatedEvent.ts index 633a8aedc..7e67ab7ad 100644 --- a/src/serialization/types/RefundCreatedEvent.ts +++ b/src/serialization/types/RefundCreatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { RefundCreatedEventData } from "./RefundCreatedEventData"; export const RefundCreatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const RefundCreatedEvent: core.serialization.ObjectSchema< export declare namespace RefundCreatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: RefundCreatedEventData.Raw | null; } diff --git a/src/serialization/types/RefundCreatedEventData.ts b/src/serialization/types/RefundCreatedEventData.ts index a11d5f6ef..5ee47cede 100644 --- a/src/serialization/types/RefundCreatedEventData.ts +++ b/src/serialization/types/RefundCreatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { RefundCreatedEventObject } from "./RefundCreatedEventObject"; export const RefundCreatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const RefundCreatedEventData: core.serialization.ObjectSchema< export declare namespace RefundCreatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: RefundCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/RefundCreatedEventObject.ts b/src/serialization/types/RefundCreatedEventObject.ts index cefce9797..1a182a238 100644 --- a/src/serialization/types/RefundCreatedEventObject.ts +++ b/src/serialization/types/RefundCreatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { PaymentRefund } from "./PaymentRefund"; export const RefundCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/RefundPaymentResponse.ts b/src/serialization/types/RefundPaymentResponse.ts index 5d876d328..d76298edc 100644 --- a/src/serialization/types/RefundPaymentResponse.ts +++ b/src/serialization/types/RefundPaymentResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { PaymentRefund } from "./PaymentRefund"; diff --git a/src/serialization/types/RefundStatus.ts b/src/serialization/types/RefundStatus.ts index e7bd8677c..1578265c9 100644 --- a/src/serialization/types/RefundStatus.ts +++ b/src/serialization/types/RefundStatus.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const RefundStatus: core.serialization.Schema = core.serialization.enum_(["PENDING", "APPROVED", "REJECTED", "FAILED"]); diff --git a/src/serialization/types/RefundUpdatedEvent.ts b/src/serialization/types/RefundUpdatedEvent.ts index e3f052ba6..9d62c27c5 100644 --- a/src/serialization/types/RefundUpdatedEvent.ts +++ b/src/serialization/types/RefundUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { RefundUpdatedEventData } from "./RefundUpdatedEventData"; export const RefundUpdatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const RefundUpdatedEvent: core.serialization.ObjectSchema< export declare namespace RefundUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: RefundUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/RefundUpdatedEventData.ts b/src/serialization/types/RefundUpdatedEventData.ts index fa2ba1a97..3e394667b 100644 --- a/src/serialization/types/RefundUpdatedEventData.ts +++ b/src/serialization/types/RefundUpdatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { RefundUpdatedEventObject } from "./RefundUpdatedEventObject"; export const RefundUpdatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const RefundUpdatedEventData: core.serialization.ObjectSchema< export declare namespace RefundUpdatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: RefundUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/RefundUpdatedEventObject.ts b/src/serialization/types/RefundUpdatedEventObject.ts index bd568439e..297396ffd 100644 --- a/src/serialization/types/RefundUpdatedEventObject.ts +++ b/src/serialization/types/RefundUpdatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { PaymentRefund } from "./PaymentRefund"; export const RefundUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/RegisterDomainResponse.ts b/src/serialization/types/RegisterDomainResponse.ts index b00a02a68..87699cee4 100644 --- a/src/serialization/types/RegisterDomainResponse.ts +++ b/src/serialization/types/RegisterDomainResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { RegisterDomainResponseStatus } from "./RegisterDomainResponseStatus"; diff --git a/src/serialization/types/RegisterDomainResponseStatus.ts b/src/serialization/types/RegisterDomainResponseStatus.ts index 1ca4aaa0d..77fd34696 100644 --- a/src/serialization/types/RegisterDomainResponseStatus.ts +++ b/src/serialization/types/RegisterDomainResponseStatus.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const RegisterDomainResponseStatus: core.serialization.Schema< serializers.RegisterDomainResponseStatus.Raw, diff --git a/src/serialization/types/RemoveGroupFromCustomerResponse.ts b/src/serialization/types/RemoveGroupFromCustomerResponse.ts index 9b41401ed..a401b3884 100644 --- a/src/serialization/types/RemoveGroupFromCustomerResponse.ts +++ b/src/serialization/types/RemoveGroupFromCustomerResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const RemoveGroupFromCustomerResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/ResumeSubscriptionResponse.ts b/src/serialization/types/ResumeSubscriptionResponse.ts index d10aa39ab..b4713acf3 100644 --- a/src/serialization/types/ResumeSubscriptionResponse.ts +++ b/src/serialization/types/ResumeSubscriptionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Subscription } from "./Subscription"; import { SubscriptionAction } from "./SubscriptionAction"; diff --git a/src/serialization/types/RetrieveBookingCustomAttributeDefinitionResponse.ts b/src/serialization/types/RetrieveBookingCustomAttributeDefinitionResponse.ts index 3d8fd5cbc..6a4a3f8ed 100644 --- a/src/serialization/types/RetrieveBookingCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/RetrieveBookingCustomAttributeDefinitionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/RetrieveBookingCustomAttributeResponse.ts b/src/serialization/types/RetrieveBookingCustomAttributeResponse.ts index ac1e55cb5..31e84710a 100644 --- a/src/serialization/types/RetrieveBookingCustomAttributeResponse.ts +++ b/src/serialization/types/RetrieveBookingCustomAttributeResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/RetrieveChannelResponse.ts b/src/serialization/types/RetrieveChannelResponse.ts deleted file mode 100644 index 7f8d50b9b..000000000 --- a/src/serialization/types/RetrieveChannelResponse.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { Channel } from "./Channel"; -import { Error_ } from "./Error_"; - -export const RetrieveChannelResponse: core.serialization.ObjectSchema< - serializers.RetrieveChannelResponse.Raw, - Square.RetrieveChannelResponse -> = core.serialization.object({ - errors: core.serialization.list(Error_).optional(), - channel: Channel.optional(), -}); - -export declare namespace RetrieveChannelResponse { - export interface Raw { - errors?: Error_.Raw[] | null; - channel?: Channel.Raw | null; - } -} diff --git a/src/serialization/types/RetrieveJobResponse.ts b/src/serialization/types/RetrieveJobResponse.ts index 6730b25d9..a4b98803c 100644 --- a/src/serialization/types/RetrieveJobResponse.ts +++ b/src/serialization/types/RetrieveJobResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Job } from "./Job"; +import { Error_ } from "./Error_"; export const RetrieveJobResponse: core.serialization.ObjectSchema< serializers.RetrieveJobResponse.Raw, diff --git a/src/serialization/types/RetrieveLocationBookingProfileResponse.ts b/src/serialization/types/RetrieveLocationBookingProfileResponse.ts index c7c9d1a25..2ad615460 100644 --- a/src/serialization/types/RetrieveLocationBookingProfileResponse.ts +++ b/src/serialization/types/RetrieveLocationBookingProfileResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { LocationBookingProfile } from "./LocationBookingProfile"; +import { Error_ } from "./Error_"; export const RetrieveLocationBookingProfileResponse: core.serialization.ObjectSchema< serializers.RetrieveLocationBookingProfileResponse.Raw, diff --git a/src/serialization/types/RetrieveLocationCustomAttributeDefinitionResponse.ts b/src/serialization/types/RetrieveLocationCustomAttributeDefinitionResponse.ts index 75dd5840c..01ddfc6db 100644 --- a/src/serialization/types/RetrieveLocationCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/RetrieveLocationCustomAttributeDefinitionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/RetrieveLocationCustomAttributeResponse.ts b/src/serialization/types/RetrieveLocationCustomAttributeResponse.ts index f6754b680..7bf3b30d3 100644 --- a/src/serialization/types/RetrieveLocationCustomAttributeResponse.ts +++ b/src/serialization/types/RetrieveLocationCustomAttributeResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/RetrieveLocationSettingsResponse.ts b/src/serialization/types/RetrieveLocationSettingsResponse.ts index 1956f28b5..49d846137 100644 --- a/src/serialization/types/RetrieveLocationSettingsResponse.ts +++ b/src/serialization/types/RetrieveLocationSettingsResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { CheckoutLocationSettings } from "./CheckoutLocationSettings"; import { Error_ } from "./Error_"; +import { CheckoutLocationSettings } from "./CheckoutLocationSettings"; export const RetrieveLocationSettingsResponse: core.serialization.ObjectSchema< serializers.RetrieveLocationSettingsResponse.Raw, diff --git a/src/serialization/types/RetrieveMerchantCustomAttributeDefinitionResponse.ts b/src/serialization/types/RetrieveMerchantCustomAttributeDefinitionResponse.ts index 7856b3b00..7eaf410a2 100644 --- a/src/serialization/types/RetrieveMerchantCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/RetrieveMerchantCustomAttributeDefinitionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/RetrieveMerchantCustomAttributeResponse.ts b/src/serialization/types/RetrieveMerchantCustomAttributeResponse.ts index eabaf78dd..9f8d1d506 100644 --- a/src/serialization/types/RetrieveMerchantCustomAttributeResponse.ts +++ b/src/serialization/types/RetrieveMerchantCustomAttributeResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/RetrieveMerchantSettingsResponse.ts b/src/serialization/types/RetrieveMerchantSettingsResponse.ts index 36f58b8bd..c8150ff50 100644 --- a/src/serialization/types/RetrieveMerchantSettingsResponse.ts +++ b/src/serialization/types/RetrieveMerchantSettingsResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { CheckoutMerchantSettings } from "./CheckoutMerchantSettings"; import { Error_ } from "./Error_"; +import { CheckoutMerchantSettings } from "./CheckoutMerchantSettings"; export const RetrieveMerchantSettingsResponse: core.serialization.ObjectSchema< serializers.RetrieveMerchantSettingsResponse.Raw, diff --git a/src/serialization/types/RetrieveOrderCustomAttributeDefinitionResponse.ts b/src/serialization/types/RetrieveOrderCustomAttributeDefinitionResponse.ts index 35be3373c..e783fa6b5 100644 --- a/src/serialization/types/RetrieveOrderCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/RetrieveOrderCustomAttributeDefinitionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/RetrieveOrderCustomAttributeResponse.ts b/src/serialization/types/RetrieveOrderCustomAttributeResponse.ts index 989943954..29ece41ae 100644 --- a/src/serialization/types/RetrieveOrderCustomAttributeResponse.ts +++ b/src/serialization/types/RetrieveOrderCustomAttributeResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/RetrieveScheduledShiftResponse.ts b/src/serialization/types/RetrieveScheduledShiftResponse.ts index c0184a101..06799d906 100644 --- a/src/serialization/types/RetrieveScheduledShiftResponse.ts +++ b/src/serialization/types/RetrieveScheduledShiftResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { ScheduledShift } from "./ScheduledShift"; +import { Error_ } from "./Error_"; export const RetrieveScheduledShiftResponse: core.serialization.ObjectSchema< serializers.RetrieveScheduledShiftResponse.Raw, diff --git a/src/serialization/types/RetrieveTimecardResponse.ts b/src/serialization/types/RetrieveTimecardResponse.ts index 1037f18d0..f47bc2661 100644 --- a/src/serialization/types/RetrieveTimecardResponse.ts +++ b/src/serialization/types/RetrieveTimecardResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Timecard } from "./Timecard"; +import { Error_ } from "./Error_"; export const RetrieveTimecardResponse: core.serialization.ObjectSchema< serializers.RetrieveTimecardResponse.Raw, diff --git a/src/serialization/types/RetrieveTokenStatusResponse.ts b/src/serialization/types/RetrieveTokenStatusResponse.ts index 1e6530bb6..c5dfd9b72 100644 --- a/src/serialization/types/RetrieveTokenStatusResponse.ts +++ b/src/serialization/types/RetrieveTokenStatusResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const RetrieveTokenStatusResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/RetrieveTransferOrderResponse.ts b/src/serialization/types/RetrieveTransferOrderResponse.ts deleted file mode 100644 index 3dfc617f1..000000000 --- a/src/serialization/types/RetrieveTransferOrderResponse.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; -import { TransferOrder } from "./TransferOrder"; - -export const RetrieveTransferOrderResponse: core.serialization.ObjectSchema< - serializers.RetrieveTransferOrderResponse.Raw, - Square.RetrieveTransferOrderResponse -> = core.serialization.object({ - transferOrder: core.serialization.property("transfer_order", TransferOrder.optional()), - errors: core.serialization.list(Error_).optional(), -}); - -export declare namespace RetrieveTransferOrderResponse { - export interface Raw { - transfer_order?: TransferOrder.Raw | null; - errors?: Error_.Raw[] | null; - } -} diff --git a/src/serialization/types/RevokeTokenResponse.ts b/src/serialization/types/RevokeTokenResponse.ts index 0fb65dd90..28ebe9146 100644 --- a/src/serialization/types/RevokeTokenResponse.ts +++ b/src/serialization/types/RevokeTokenResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const RevokeTokenResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/RiskEvaluation.ts b/src/serialization/types/RiskEvaluation.ts index f38211ba4..d2c707c06 100644 --- a/src/serialization/types/RiskEvaluation.ts +++ b/src/serialization/types/RiskEvaluation.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { RiskEvaluationRiskLevel } from "./RiskEvaluationRiskLevel"; export const RiskEvaluation: core.serialization.ObjectSchema = diff --git a/src/serialization/types/RiskEvaluationRiskLevel.ts b/src/serialization/types/RiskEvaluationRiskLevel.ts index e29c2198f..25df8b767 100644 --- a/src/serialization/types/RiskEvaluationRiskLevel.ts +++ b/src/serialization/types/RiskEvaluationRiskLevel.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const RiskEvaluationRiskLevel: core.serialization.Schema< serializers.RiskEvaluationRiskLevel.Raw, diff --git a/src/serialization/types/SaveCardOptions.ts b/src/serialization/types/SaveCardOptions.ts index 3a1bd50e4..21e0e6b9e 100644 --- a/src/serialization/types/SaveCardOptions.ts +++ b/src/serialization/types/SaveCardOptions.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SaveCardOptions: core.serialization.ObjectSchema = core.serialization.object({ @@ -15,6 +17,6 @@ export declare namespace SaveCardOptions { export interface Raw { customer_id: string; card_id?: string | null; - reference_id?: (string | null | undefined) | null; + reference_id?: (string | null) | null; } } diff --git a/src/serialization/types/ScheduledShift.ts b/src/serialization/types/ScheduledShift.ts index ba816aa4f..0bab018f7 100644 --- a/src/serialization/types/ScheduledShift.ts +++ b/src/serialization/types/ScheduledShift.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { ScheduledShiftDetails } from "./ScheduledShiftDetails"; export const ScheduledShift: core.serialization.ObjectSchema = diff --git a/src/serialization/types/ScheduledShiftDetails.ts b/src/serialization/types/ScheduledShiftDetails.ts index 9b9f94c33..9e6e3dca7 100644 --- a/src/serialization/types/ScheduledShiftDetails.ts +++ b/src/serialization/types/ScheduledShiftDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ScheduledShiftDetails: core.serialization.ObjectSchema< serializers.ScheduledShiftDetails.Raw, @@ -20,13 +22,13 @@ export const ScheduledShiftDetails: core.serialization.ObjectSchema< export declare namespace ScheduledShiftDetails { export interface Raw { - team_member_id?: (string | null | undefined) | null; - location_id?: (string | null | undefined) | null; - job_id?: (string | null | undefined) | null; - start_at?: (string | null | undefined) | null; - end_at?: (string | null | undefined) | null; - notes?: (string | null | undefined) | null; - is_deleted?: (boolean | null | undefined) | null; + team_member_id?: (string | null) | null; + location_id?: (string | null) | null; + job_id?: (string | null) | null; + start_at?: (string | null) | null; + end_at?: (string | null) | null; + notes?: (string | null) | null; + is_deleted?: (boolean | null) | null; timezone?: string | null; } } diff --git a/src/serialization/types/ScheduledShiftFilter.ts b/src/serialization/types/ScheduledShiftFilter.ts index 2862fe48a..32cbeb75d 100644 --- a/src/serialization/types/ScheduledShiftFilter.ts +++ b/src/serialization/types/ScheduledShiftFilter.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; +import { TimeRange } from "./TimeRange"; +import { ScheduledShiftWorkday } from "./ScheduledShiftWorkday"; import { ScheduledShiftFilterAssignmentStatus } from "./ScheduledShiftFilterAssignmentStatus"; import { ScheduledShiftFilterScheduledShiftStatus } from "./ScheduledShiftFilterScheduledShiftStatus"; -import { ScheduledShiftWorkday } from "./ScheduledShiftWorkday"; -import { TimeRange } from "./TimeRange"; export const ScheduledShiftFilter: core.serialization.ObjectSchema< serializers.ScheduledShiftFilter.Raw, @@ -32,12 +34,12 @@ export const ScheduledShiftFilter: core.serialization.ObjectSchema< export declare namespace ScheduledShiftFilter { export interface Raw { - location_ids?: (string[] | null | undefined) | null; + location_ids?: (string[] | null) | null; start?: TimeRange.Raw | null; end?: TimeRange.Raw | null; workday?: ScheduledShiftWorkday.Raw | null; - team_member_ids?: (string[] | null | undefined) | null; + team_member_ids?: (string[] | null) | null; assignment_status?: ScheduledShiftFilterAssignmentStatus.Raw | null; - scheduled_shift_statuses?: (ScheduledShiftFilterScheduledShiftStatus.Raw[] | null | undefined) | null; + scheduled_shift_statuses?: (ScheduledShiftFilterScheduledShiftStatus.Raw[] | null) | null; } } diff --git a/src/serialization/types/ScheduledShiftFilterAssignmentStatus.ts b/src/serialization/types/ScheduledShiftFilterAssignmentStatus.ts index 7bdc47b72..08a43d855 100644 --- a/src/serialization/types/ScheduledShiftFilterAssignmentStatus.ts +++ b/src/serialization/types/ScheduledShiftFilterAssignmentStatus.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ScheduledShiftFilterAssignmentStatus: core.serialization.Schema< serializers.ScheduledShiftFilterAssignmentStatus.Raw, diff --git a/src/serialization/types/ScheduledShiftFilterScheduledShiftStatus.ts b/src/serialization/types/ScheduledShiftFilterScheduledShiftStatus.ts index 1678e6e27..69c5f442d 100644 --- a/src/serialization/types/ScheduledShiftFilterScheduledShiftStatus.ts +++ b/src/serialization/types/ScheduledShiftFilterScheduledShiftStatus.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ScheduledShiftFilterScheduledShiftStatus: core.serialization.Schema< serializers.ScheduledShiftFilterScheduledShiftStatus.Raw, diff --git a/src/serialization/types/ScheduledShiftNotificationAudience.ts b/src/serialization/types/ScheduledShiftNotificationAudience.ts index 73d3a9cea..a67c0d674 100644 --- a/src/serialization/types/ScheduledShiftNotificationAudience.ts +++ b/src/serialization/types/ScheduledShiftNotificationAudience.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ScheduledShiftNotificationAudience: core.serialization.Schema< serializers.ScheduledShiftNotificationAudience.Raw, diff --git a/src/serialization/types/ScheduledShiftQuery.ts b/src/serialization/types/ScheduledShiftQuery.ts index 30fef1764..90a349994 100644 --- a/src/serialization/types/ScheduledShiftQuery.ts +++ b/src/serialization/types/ScheduledShiftQuery.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { ScheduledShiftFilter } from "./ScheduledShiftFilter"; import { ScheduledShiftSort } from "./ScheduledShiftSort"; diff --git a/src/serialization/types/ScheduledShiftSort.ts b/src/serialization/types/ScheduledShiftSort.ts index 6f4ef29d1..a3cf63bc2 100644 --- a/src/serialization/types/ScheduledShiftSort.ts +++ b/src/serialization/types/ScheduledShiftSort.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { ScheduledShiftSortField } from "./ScheduledShiftSortField"; import { SortOrder } from "./SortOrder"; diff --git a/src/serialization/types/ScheduledShiftSortField.ts b/src/serialization/types/ScheduledShiftSortField.ts index 9feb9f9b9..0328dd47d 100644 --- a/src/serialization/types/ScheduledShiftSortField.ts +++ b/src/serialization/types/ScheduledShiftSortField.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ScheduledShiftSortField: core.serialization.Schema< serializers.ScheduledShiftSortField.Raw, diff --git a/src/serialization/types/ScheduledShiftWorkday.ts b/src/serialization/types/ScheduledShiftWorkday.ts index 4e0a9c355..47c89309f 100644 --- a/src/serialization/types/ScheduledShiftWorkday.ts +++ b/src/serialization/types/ScheduledShiftWorkday.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { DateRange } from "./DateRange"; import { ScheduledShiftWorkdayMatcher } from "./ScheduledShiftWorkdayMatcher"; @@ -22,6 +24,6 @@ export declare namespace ScheduledShiftWorkday { export interface Raw { date_range?: DateRange.Raw | null; match_scheduled_shifts_by?: ScheduledShiftWorkdayMatcher.Raw | null; - default_timezone?: (string | null | undefined) | null; + default_timezone?: (string | null) | null; } } diff --git a/src/serialization/types/ScheduledShiftWorkdayMatcher.ts b/src/serialization/types/ScheduledShiftWorkdayMatcher.ts index 18cd3b5d9..659056087 100644 --- a/src/serialization/types/ScheduledShiftWorkdayMatcher.ts +++ b/src/serialization/types/ScheduledShiftWorkdayMatcher.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ScheduledShiftWorkdayMatcher: core.serialization.Schema< serializers.ScheduledShiftWorkdayMatcher.Raw, diff --git a/src/serialization/types/SearchAvailabilityFilter.ts b/src/serialization/types/SearchAvailabilityFilter.ts index 122d017ef..14717622e 100644 --- a/src/serialization/types/SearchAvailabilityFilter.ts +++ b/src/serialization/types/SearchAvailabilityFilter.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { SegmentFilter } from "./SegmentFilter"; import { TimeRange } from "./TimeRange"; +import { SegmentFilter } from "./SegmentFilter"; export const SearchAvailabilityFilter: core.serialization.ObjectSchema< serializers.SearchAvailabilityFilter.Raw, @@ -22,8 +24,8 @@ export const SearchAvailabilityFilter: core.serialization.ObjectSchema< export declare namespace SearchAvailabilityFilter { export interface Raw { start_at_range: TimeRange.Raw; - location_id?: (string | null | undefined) | null; - segment_filters?: (SegmentFilter.Raw[] | null | undefined) | null; - booking_id?: (string | null | undefined) | null; + location_id?: (string | null) | null; + segment_filters?: (SegmentFilter.Raw[] | null) | null; + booking_id?: (string | null) | null; } } diff --git a/src/serialization/types/SearchAvailabilityQuery.ts b/src/serialization/types/SearchAvailabilityQuery.ts index 63ec13179..a3166bbb3 100644 --- a/src/serialization/types/SearchAvailabilityQuery.ts +++ b/src/serialization/types/SearchAvailabilityQuery.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SearchAvailabilityFilter } from "./SearchAvailabilityFilter"; export const SearchAvailabilityQuery: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SearchAvailabilityResponse.ts b/src/serialization/types/SearchAvailabilityResponse.ts index fe4628031..e2ccb73f4 100644 --- a/src/serialization/types/SearchAvailabilityResponse.ts +++ b/src/serialization/types/SearchAvailabilityResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Availability } from "./Availability"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/SearchCatalogItemsRequestStockLevel.ts b/src/serialization/types/SearchCatalogItemsRequestStockLevel.ts index a42649cc1..2f39d5598 100644 --- a/src/serialization/types/SearchCatalogItemsRequestStockLevel.ts +++ b/src/serialization/types/SearchCatalogItemsRequestStockLevel.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SearchCatalogItemsRequestStockLevel: core.serialization.Schema< serializers.SearchCatalogItemsRequestStockLevel.Raw, diff --git a/src/serialization/types/SearchCatalogItemsResponse.ts b/src/serialization/types/SearchCatalogItemsResponse.ts index eb531493e..159714d35 100644 --- a/src/serialization/types/SearchCatalogItemsResponse.ts +++ b/src/serialization/types/SearchCatalogItemsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; -import * as core from "../../core"; import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; import { Error_ } from "./Error_"; export const SearchCatalogItemsResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SearchCatalogObjectsResponse.ts b/src/serialization/types/SearchCatalogObjectsResponse.ts index 0c38d1dbd..44f718830 100644 --- a/src/serialization/types/SearchCatalogObjectsResponse.ts +++ b/src/serialization/types/SearchCatalogObjectsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; -import * as core from "../../core"; import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; import { Error_ } from "./Error_"; export const SearchCatalogObjectsResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SearchCustomersResponse.ts b/src/serialization/types/SearchCustomersResponse.ts index ccee237d2..75a06ffd6 100644 --- a/src/serialization/types/SearchCustomersResponse.ts +++ b/src/serialization/types/SearchCustomersResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Customer } from "./Customer"; import { Error_ } from "./Error_"; +import { Customer } from "./Customer"; export const SearchCustomersResponse: core.serialization.ObjectSchema< serializers.SearchCustomersResponse.Raw, diff --git a/src/serialization/types/SearchEventsFilter.ts b/src/serialization/types/SearchEventsFilter.ts index 477733d92..d146b9ba2 100644 --- a/src/serialization/types/SearchEventsFilter.ts +++ b/src/serialization/types/SearchEventsFilter.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { TimeRange } from "./TimeRange"; export const SearchEventsFilter: core.serialization.ObjectSchema< @@ -26,9 +28,9 @@ export const SearchEventsFilter: core.serialization.ObjectSchema< export declare namespace SearchEventsFilter { export interface Raw { - event_types?: (string[] | null | undefined) | null; - merchant_ids?: (string[] | null | undefined) | null; - location_ids?: (string[] | null | undefined) | null; + event_types?: (string[] | null) | null; + merchant_ids?: (string[] | null) | null; + location_ids?: (string[] | null) | null; created_at?: TimeRange.Raw | null; } } diff --git a/src/serialization/types/SearchEventsQuery.ts b/src/serialization/types/SearchEventsQuery.ts index 064e93c0c..b0bfbfc25 100644 --- a/src/serialization/types/SearchEventsQuery.ts +++ b/src/serialization/types/SearchEventsQuery.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SearchEventsFilter } from "./SearchEventsFilter"; import { SearchEventsSort } from "./SearchEventsSort"; diff --git a/src/serialization/types/SearchEventsResponse.ts b/src/serialization/types/SearchEventsResponse.ts index 07a6c07fb..1d600deda 100644 --- a/src/serialization/types/SearchEventsResponse.ts +++ b/src/serialization/types/SearchEventsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Event } from "./Event"; import { EventMetadata } from "./EventMetadata"; diff --git a/src/serialization/types/SearchEventsSort.ts b/src/serialization/types/SearchEventsSort.ts index 261b3dfc3..65685abf8 100644 --- a/src/serialization/types/SearchEventsSort.ts +++ b/src/serialization/types/SearchEventsSort.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SearchEventsSortField } from "./SearchEventsSortField"; import { SortOrder } from "./SortOrder"; diff --git a/src/serialization/types/SearchEventsSortField.ts b/src/serialization/types/SearchEventsSortField.ts index b1a465fd6..4ec6be9fb 100644 --- a/src/serialization/types/SearchEventsSortField.ts +++ b/src/serialization/types/SearchEventsSortField.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SearchEventsSortField: core.serialization.Schema< serializers.SearchEventsSortField.Raw, diff --git a/src/serialization/types/SearchInvoicesResponse.ts b/src/serialization/types/SearchInvoicesResponse.ts index 62deb22c2..e0a13eeb9 100644 --- a/src/serialization/types/SearchInvoicesResponse.ts +++ b/src/serialization/types/SearchInvoicesResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Invoice } from "./Invoice"; +import { Error_ } from "./Error_"; export const SearchInvoicesResponse: core.serialization.ObjectSchema< serializers.SearchInvoicesResponse.Raw, diff --git a/src/serialization/types/SearchLoyaltyAccountsRequestLoyaltyAccountQuery.ts b/src/serialization/types/SearchLoyaltyAccountsRequestLoyaltyAccountQuery.ts index a9615b615..3c4301a0c 100644 --- a/src/serialization/types/SearchLoyaltyAccountsRequestLoyaltyAccountQuery.ts +++ b/src/serialization/types/SearchLoyaltyAccountsRequestLoyaltyAccountQuery.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyAccountMapping } from "./LoyaltyAccountMapping"; export const SearchLoyaltyAccountsRequestLoyaltyAccountQuery: core.serialization.ObjectSchema< @@ -18,7 +20,7 @@ export const SearchLoyaltyAccountsRequestLoyaltyAccountQuery: core.serialization export declare namespace SearchLoyaltyAccountsRequestLoyaltyAccountQuery { export interface Raw { - mappings?: (LoyaltyAccountMapping.Raw[] | null | undefined) | null; - customer_ids?: (string[] | null | undefined) | null; + mappings?: (LoyaltyAccountMapping.Raw[] | null) | null; + customer_ids?: (string[] | null) | null; } } diff --git a/src/serialization/types/SearchLoyaltyAccountsResponse.ts b/src/serialization/types/SearchLoyaltyAccountsResponse.ts index 5fcec48ba..17f71231b 100644 --- a/src/serialization/types/SearchLoyaltyAccountsResponse.ts +++ b/src/serialization/types/SearchLoyaltyAccountsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyAccount } from "./LoyaltyAccount"; diff --git a/src/serialization/types/SearchLoyaltyEventsResponse.ts b/src/serialization/types/SearchLoyaltyEventsResponse.ts index ffbd49cbf..918c6f772 100644 --- a/src/serialization/types/SearchLoyaltyEventsResponse.ts +++ b/src/serialization/types/SearchLoyaltyEventsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyEvent } from "./LoyaltyEvent"; diff --git a/src/serialization/types/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.ts b/src/serialization/types/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.ts index 9a7fc2dcd..209f11035 100644 --- a/src/serialization/types/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.ts +++ b/src/serialization/types/SearchLoyaltyRewardsRequestLoyaltyRewardQuery.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { LoyaltyRewardStatus } from "./LoyaltyRewardStatus"; export const SearchLoyaltyRewardsRequestLoyaltyRewardQuery: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SearchLoyaltyRewardsResponse.ts b/src/serialization/types/SearchLoyaltyRewardsResponse.ts index 128d8a07e..e0533042c 100644 --- a/src/serialization/types/SearchLoyaltyRewardsResponse.ts +++ b/src/serialization/types/SearchLoyaltyRewardsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { LoyaltyReward } from "./LoyaltyReward"; diff --git a/src/serialization/types/SearchOrdersCustomerFilter.ts b/src/serialization/types/SearchOrdersCustomerFilter.ts index dfea65cf3..d66b8fd5c 100644 --- a/src/serialization/types/SearchOrdersCustomerFilter.ts +++ b/src/serialization/types/SearchOrdersCustomerFilter.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SearchOrdersCustomerFilter: core.serialization.ObjectSchema< serializers.SearchOrdersCustomerFilter.Raw, @@ -16,6 +18,6 @@ export const SearchOrdersCustomerFilter: core.serialization.ObjectSchema< export declare namespace SearchOrdersCustomerFilter { export interface Raw { - customer_ids?: (string[] | null | undefined) | null; + customer_ids?: (string[] | null) | null; } } diff --git a/src/serialization/types/SearchOrdersDateTimeFilter.ts b/src/serialization/types/SearchOrdersDateTimeFilter.ts index a1dee39f4..e84e1ab47 100644 --- a/src/serialization/types/SearchOrdersDateTimeFilter.ts +++ b/src/serialization/types/SearchOrdersDateTimeFilter.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { TimeRange } from "./TimeRange"; export const SearchOrdersDateTimeFilter: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SearchOrdersFilter.ts b/src/serialization/types/SearchOrdersFilter.ts index adb707766..dd1ee309e 100644 --- a/src/serialization/types/SearchOrdersFilter.ts +++ b/src/serialization/types/SearchOrdersFilter.ts @@ -1,13 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { SearchOrdersCustomerFilter } from "./SearchOrdersCustomerFilter"; +import { SearchOrdersStateFilter } from "./SearchOrdersStateFilter"; import { SearchOrdersDateTimeFilter } from "./SearchOrdersDateTimeFilter"; import { SearchOrdersFulfillmentFilter } from "./SearchOrdersFulfillmentFilter"; import { SearchOrdersSourceFilter } from "./SearchOrdersSourceFilter"; -import { SearchOrdersStateFilter } from "./SearchOrdersStateFilter"; +import { SearchOrdersCustomerFilter } from "./SearchOrdersCustomerFilter"; export const SearchOrdersFilter: core.serialization.ObjectSchema< serializers.SearchOrdersFilter.Raw, diff --git a/src/serialization/types/SearchOrdersFulfillmentFilter.ts b/src/serialization/types/SearchOrdersFulfillmentFilter.ts index d88fd8528..4fe610b63 100644 --- a/src/serialization/types/SearchOrdersFulfillmentFilter.ts +++ b/src/serialization/types/SearchOrdersFulfillmentFilter.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { FulfillmentState } from "./FulfillmentState"; import { FulfillmentType } from "./FulfillmentType"; +import { FulfillmentState } from "./FulfillmentState"; export const SearchOrdersFulfillmentFilter: core.serialization.ObjectSchema< serializers.SearchOrdersFulfillmentFilter.Raw, @@ -22,7 +24,7 @@ export const SearchOrdersFulfillmentFilter: core.serialization.ObjectSchema< export declare namespace SearchOrdersFulfillmentFilter { export interface Raw { - fulfillment_types?: (FulfillmentType.Raw[] | null | undefined) | null; - fulfillment_states?: (FulfillmentState.Raw[] | null | undefined) | null; + fulfillment_types?: (FulfillmentType.Raw[] | null) | null; + fulfillment_states?: (FulfillmentState.Raw[] | null) | null; } } diff --git a/src/serialization/types/SearchOrdersQuery.ts b/src/serialization/types/SearchOrdersQuery.ts index 958006013..633eb35ff 100644 --- a/src/serialization/types/SearchOrdersQuery.ts +++ b/src/serialization/types/SearchOrdersQuery.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SearchOrdersFilter } from "./SearchOrdersFilter"; import { SearchOrdersSort } from "./SearchOrdersSort"; diff --git a/src/serialization/types/SearchOrdersResponse.ts b/src/serialization/types/SearchOrdersResponse.ts index f56a8652d..87a447147 100644 --- a/src/serialization/types/SearchOrdersResponse.ts +++ b/src/serialization/types/SearchOrdersResponse.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; -import { Order } from "./Order"; import { OrderEntry } from "./OrderEntry"; +import { Order } from "./Order"; +import { Error_ } from "./Error_"; export const SearchOrdersResponse: core.serialization.ObjectSchema< serializers.SearchOrdersResponse.Raw, diff --git a/src/serialization/types/SearchOrdersSort.ts b/src/serialization/types/SearchOrdersSort.ts index 90da3ac9b..d8a7509d8 100644 --- a/src/serialization/types/SearchOrdersSort.ts +++ b/src/serialization/types/SearchOrdersSort.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SearchOrdersSortField } from "./SearchOrdersSortField"; import { SortOrder } from "./SortOrder"; diff --git a/src/serialization/types/SearchOrdersSortField.ts b/src/serialization/types/SearchOrdersSortField.ts index 12b21e8d8..d8e9d878f 100644 --- a/src/serialization/types/SearchOrdersSortField.ts +++ b/src/serialization/types/SearchOrdersSortField.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SearchOrdersSortField: core.serialization.Schema< serializers.SearchOrdersSortField.Raw, diff --git a/src/serialization/types/SearchOrdersSourceFilter.ts b/src/serialization/types/SearchOrdersSourceFilter.ts index d8d2a89ca..ea863d6ca 100644 --- a/src/serialization/types/SearchOrdersSourceFilter.ts +++ b/src/serialization/types/SearchOrdersSourceFilter.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SearchOrdersSourceFilter: core.serialization.ObjectSchema< serializers.SearchOrdersSourceFilter.Raw, @@ -16,6 +18,6 @@ export const SearchOrdersSourceFilter: core.serialization.ObjectSchema< export declare namespace SearchOrdersSourceFilter { export interface Raw { - source_names?: (string[] | null | undefined) | null; + source_names?: (string[] | null) | null; } } diff --git a/src/serialization/types/SearchOrdersStateFilter.ts b/src/serialization/types/SearchOrdersStateFilter.ts index eb98c47f8..351210688 100644 --- a/src/serialization/types/SearchOrdersStateFilter.ts +++ b/src/serialization/types/SearchOrdersStateFilter.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { OrderState } from "./OrderState"; export const SearchOrdersStateFilter: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SearchScheduledShiftsResponse.ts b/src/serialization/types/SearchScheduledShiftsResponse.ts index efeb051cc..423bf4333 100644 --- a/src/serialization/types/SearchScheduledShiftsResponse.ts +++ b/src/serialization/types/SearchScheduledShiftsResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { ScheduledShift } from "./ScheduledShift"; +import { Error_ } from "./Error_"; export const SearchScheduledShiftsResponse: core.serialization.ObjectSchema< serializers.SearchScheduledShiftsResponse.Raw, diff --git a/src/serialization/types/SearchShiftsResponse.ts b/src/serialization/types/SearchShiftsResponse.ts index 054e8554f..dfa97e639 100644 --- a/src/serialization/types/SearchShiftsResponse.ts +++ b/src/serialization/types/SearchShiftsResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Shift } from "./Shift"; +import { Error_ } from "./Error_"; export const SearchShiftsResponse: core.serialization.ObjectSchema< serializers.SearchShiftsResponse.Raw, diff --git a/src/serialization/types/SearchSubscriptionsFilter.ts b/src/serialization/types/SearchSubscriptionsFilter.ts index d0b763f3c..aaae83cad 100644 --- a/src/serialization/types/SearchSubscriptionsFilter.ts +++ b/src/serialization/types/SearchSubscriptionsFilter.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SearchSubscriptionsFilter: core.serialization.ObjectSchema< serializers.SearchSubscriptionsFilter.Raw, @@ -24,8 +26,8 @@ export const SearchSubscriptionsFilter: core.serialization.ObjectSchema< export declare namespace SearchSubscriptionsFilter { export interface Raw { - customer_ids?: (string[] | null | undefined) | null; - location_ids?: (string[] | null | undefined) | null; - source_names?: (string[] | null | undefined) | null; + customer_ids?: (string[] | null) | null; + location_ids?: (string[] | null) | null; + source_names?: (string[] | null) | null; } } diff --git a/src/serialization/types/SearchSubscriptionsQuery.ts b/src/serialization/types/SearchSubscriptionsQuery.ts index 4a8ac5f9f..4a85e5009 100644 --- a/src/serialization/types/SearchSubscriptionsQuery.ts +++ b/src/serialization/types/SearchSubscriptionsQuery.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SearchSubscriptionsFilter } from "./SearchSubscriptionsFilter"; export const SearchSubscriptionsQuery: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SearchSubscriptionsResponse.ts b/src/serialization/types/SearchSubscriptionsResponse.ts index 5688cf1c3..d223f1998 100644 --- a/src/serialization/types/SearchSubscriptionsResponse.ts +++ b/src/serialization/types/SearchSubscriptionsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Subscription } from "./Subscription"; diff --git a/src/serialization/types/SearchTeamMembersFilter.ts b/src/serialization/types/SearchTeamMembersFilter.ts index c568a96a6..d69ba09d6 100644 --- a/src/serialization/types/SearchTeamMembersFilter.ts +++ b/src/serialization/types/SearchTeamMembersFilter.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { TeamMemberStatus } from "./TeamMemberStatus"; export const SearchTeamMembersFilter: core.serialization.ObjectSchema< @@ -19,8 +21,8 @@ export const SearchTeamMembersFilter: core.serialization.ObjectSchema< export declare namespace SearchTeamMembersFilter { export interface Raw { - location_ids?: (string[] | null | undefined) | null; + location_ids?: (string[] | null) | null; status?: TeamMemberStatus.Raw | null; - is_owner?: (boolean | null | undefined) | null; + is_owner?: (boolean | null) | null; } } diff --git a/src/serialization/types/SearchTeamMembersQuery.ts b/src/serialization/types/SearchTeamMembersQuery.ts index b420286cd..742fe9f15 100644 --- a/src/serialization/types/SearchTeamMembersQuery.ts +++ b/src/serialization/types/SearchTeamMembersQuery.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SearchTeamMembersFilter } from "./SearchTeamMembersFilter"; export const SearchTeamMembersQuery: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SearchTeamMembersResponse.ts b/src/serialization/types/SearchTeamMembersResponse.ts index 663160d5f..e0f67291f 100644 --- a/src/serialization/types/SearchTeamMembersResponse.ts +++ b/src/serialization/types/SearchTeamMembersResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { TeamMember } from "./TeamMember"; +import { Error_ } from "./Error_"; export const SearchTeamMembersResponse: core.serialization.ObjectSchema< serializers.SearchTeamMembersResponse.Raw, diff --git a/src/serialization/types/SearchTerminalActionsResponse.ts b/src/serialization/types/SearchTerminalActionsResponse.ts index 952a64fbd..3ee9cea3c 100644 --- a/src/serialization/types/SearchTerminalActionsResponse.ts +++ b/src/serialization/types/SearchTerminalActionsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalAction } from "./TerminalAction"; diff --git a/src/serialization/types/SearchTerminalCheckoutsResponse.ts b/src/serialization/types/SearchTerminalCheckoutsResponse.ts index ad8945bc5..47691c7c8 100644 --- a/src/serialization/types/SearchTerminalCheckoutsResponse.ts +++ b/src/serialization/types/SearchTerminalCheckoutsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalCheckout } from "./TerminalCheckout"; diff --git a/src/serialization/types/SearchTerminalRefundsResponse.ts b/src/serialization/types/SearchTerminalRefundsResponse.ts index 040e56e35..cb7ed1e47 100644 --- a/src/serialization/types/SearchTerminalRefundsResponse.ts +++ b/src/serialization/types/SearchTerminalRefundsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { TerminalRefund } from "./TerminalRefund"; diff --git a/src/serialization/types/SearchTimecardsResponse.ts b/src/serialization/types/SearchTimecardsResponse.ts index 405c2a0ee..85bf7cdef 100644 --- a/src/serialization/types/SearchTimecardsResponse.ts +++ b/src/serialization/types/SearchTimecardsResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Timecard } from "./Timecard"; +import { Error_ } from "./Error_"; export const SearchTimecardsResponse: core.serialization.ObjectSchema< serializers.SearchTimecardsResponse.Raw, diff --git a/src/serialization/types/SearchTransferOrdersResponse.ts b/src/serialization/types/SearchTransferOrdersResponse.ts deleted file mode 100644 index 1a7b36a48..000000000 --- a/src/serialization/types/SearchTransferOrdersResponse.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; -import { TransferOrder } from "./TransferOrder"; - -export const SearchTransferOrdersResponse: core.serialization.ObjectSchema< - serializers.SearchTransferOrdersResponse.Raw, - Square.SearchTransferOrdersResponse -> = core.serialization.object({ - transferOrders: core.serialization.property("transfer_orders", core.serialization.list(TransferOrder).optional()), - cursor: core.serialization.string().optional(), - errors: core.serialization.list(Error_).optional(), -}); - -export declare namespace SearchTransferOrdersResponse { - export interface Raw { - transfer_orders?: TransferOrder.Raw[] | null; - cursor?: string | null; - errors?: Error_.Raw[] | null; - } -} diff --git a/src/serialization/types/SearchVendorsRequestFilter.ts b/src/serialization/types/SearchVendorsRequestFilter.ts index 2904139ff..1c68be2e6 100644 --- a/src/serialization/types/SearchVendorsRequestFilter.ts +++ b/src/serialization/types/SearchVendorsRequestFilter.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { VendorStatus } from "./VendorStatus"; export const SearchVendorsRequestFilter: core.serialization.ObjectSchema< @@ -15,7 +17,7 @@ export const SearchVendorsRequestFilter: core.serialization.ObjectSchema< export declare namespace SearchVendorsRequestFilter { export interface Raw { - name?: (string[] | null | undefined) | null; - status?: (VendorStatus.Raw[] | null | undefined) | null; + name?: (string[] | null) | null; + status?: (VendorStatus.Raw[] | null) | null; } } diff --git a/src/serialization/types/SearchVendorsRequestSort.ts b/src/serialization/types/SearchVendorsRequestSort.ts index 6e90880ee..ced89af2d 100644 --- a/src/serialization/types/SearchVendorsRequestSort.ts +++ b/src/serialization/types/SearchVendorsRequestSort.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SearchVendorsRequestSortField } from "./SearchVendorsRequestSortField"; import { SortOrder } from "./SortOrder"; diff --git a/src/serialization/types/SearchVendorsRequestSortField.ts b/src/serialization/types/SearchVendorsRequestSortField.ts index 5f3eb2bb3..123d35513 100644 --- a/src/serialization/types/SearchVendorsRequestSortField.ts +++ b/src/serialization/types/SearchVendorsRequestSortField.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SearchVendorsRequestSortField: core.serialization.Schema< serializers.SearchVendorsRequestSortField.Raw, diff --git a/src/serialization/types/SearchVendorsResponse.ts b/src/serialization/types/SearchVendorsResponse.ts index aa9abef99..520e5eb14 100644 --- a/src/serialization/types/SearchVendorsResponse.ts +++ b/src/serialization/types/SearchVendorsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Vendor } from "./Vendor"; diff --git a/src/serialization/types/SegmentFilter.ts b/src/serialization/types/SegmentFilter.ts index cf1457c2e..2b990803b 100644 --- a/src/serialization/types/SegmentFilter.ts +++ b/src/serialization/types/SegmentFilter.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { FilterValue } from "./FilterValue"; export const SegmentFilter: core.serialization.ObjectSchema = diff --git a/src/serialization/types/SelectOption.ts b/src/serialization/types/SelectOption.ts index 50bec4350..eba451cac 100644 --- a/src/serialization/types/SelectOption.ts +++ b/src/serialization/types/SelectOption.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SelectOption: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/SelectOptions.ts b/src/serialization/types/SelectOptions.ts index fd23c51cd..077fa48ec 100644 --- a/src/serialization/types/SelectOptions.ts +++ b/src/serialization/types/SelectOptions.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SelectOption } from "./SelectOption"; export const SelectOptions: core.serialization.ObjectSchema = diff --git a/src/serialization/types/Shift.ts b/src/serialization/types/Shift.ts index f7a6c2bd5..57b048af6 100644 --- a/src/serialization/types/Shift.ts +++ b/src/serialization/types/Shift.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; +import { ShiftWage } from "./ShiftWage"; import { Break } from "./Break"; -import { Money } from "./Money"; import { ShiftStatus } from "./ShiftStatus"; -import { ShiftWage } from "./ShiftWage"; +import { Money } from "./Money"; export const Shift: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string().optional(), @@ -28,18 +30,18 @@ export const Shift: core.serialization.ObjectSchema = core.serialization.object({ @@ -29,12 +31,12 @@ export const ShiftFilter: core.serialization.ObjectSchema = core.serialization.enum_(["OPEN", "CLOSED"]); diff --git a/src/serialization/types/ShiftQuery.ts b/src/serialization/types/ShiftQuery.ts index 4c3a2ccf2..28823f111 100644 --- a/src/serialization/types/ShiftQuery.ts +++ b/src/serialization/types/ShiftQuery.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { ShiftFilter } from "./ShiftFilter"; import { ShiftSort } from "./ShiftSort"; diff --git a/src/serialization/types/ShiftSort.ts b/src/serialization/types/ShiftSort.ts index 20215f151..60d726363 100644 --- a/src/serialization/types/ShiftSort.ts +++ b/src/serialization/types/ShiftSort.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { ShiftSortField } from "./ShiftSortField"; import { SortOrder } from "./SortOrder"; diff --git a/src/serialization/types/ShiftSortField.ts b/src/serialization/types/ShiftSortField.ts index b1c81e31f..096579bad 100644 --- a/src/serialization/types/ShiftSortField.ts +++ b/src/serialization/types/ShiftSortField.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ShiftSortField: core.serialization.Schema = core.serialization.enum_(["START_AT", "END_AT", "CREATED_AT", "UPDATED_AT"]); diff --git a/src/serialization/types/ShiftStatus.ts b/src/serialization/types/ShiftStatus.ts index efd5135f9..4cc8e7274 100644 --- a/src/serialization/types/ShiftStatus.ts +++ b/src/serialization/types/ShiftStatus.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ShiftStatus: core.serialization.Schema = core.serialization.enum_(["OPEN", "CLOSED"]); diff --git a/src/serialization/types/ShiftWage.ts b/src/serialization/types/ShiftWage.ts index f87a10ba5..71fc0893e 100644 --- a/src/serialization/types/ShiftWage.ts +++ b/src/serialization/types/ShiftWage.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const ShiftWage: core.serialization.ObjectSchema = @@ -15,9 +17,9 @@ export const ShiftWage: core.serialization.ObjectSchema = @@ -13,7 +15,7 @@ export const ShippingFee: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/SignatureOptions.ts b/src/serialization/types/SignatureOptions.ts index 6eafb1bf3..4c6e23be4 100644 --- a/src/serialization/types/SignatureOptions.ts +++ b/src/serialization/types/SignatureOptions.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SignatureImage } from "./SignatureImage"; export const SignatureOptions: core.serialization.ObjectSchema< diff --git a/src/serialization/types/Site.ts b/src/serialization/types/Site.ts index 83330eb39..e464ae935 100644 --- a/src/serialization/types/Site.ts +++ b/src/serialization/types/Site.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const Site: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string().optional(), @@ -16,9 +18,9 @@ export const Site: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/SortOrder.ts b/src/serialization/types/SortOrder.ts index baed04696..4e735a24e 100644 --- a/src/serialization/types/SortOrder.ts +++ b/src/serialization/types/SortOrder.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SortOrder: core.serialization.Schema = core.serialization.enum_(["DESC", "ASC"]); diff --git a/src/serialization/types/SourceApplication.ts b/src/serialization/types/SourceApplication.ts index d362f9e5e..ae209bc91 100644 --- a/src/serialization/types/SourceApplication.ts +++ b/src/serialization/types/SourceApplication.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Product } from "./Product"; export const SourceApplication: core.serialization.ObjectSchema< @@ -17,7 +19,7 @@ export const SourceApplication: core.serialization.ObjectSchema< export declare namespace SourceApplication { export interface Raw { product?: Product.Raw | null; - application_id?: (string | null | undefined) | null; - name?: (string | null | undefined) | null; + application_id?: (string | null) | null; + name?: (string | null) | null; } } diff --git a/src/serialization/types/SquareAccountDetails.ts b/src/serialization/types/SquareAccountDetails.ts index ff0799f1a..0fe060eb8 100644 --- a/src/serialization/types/SquareAccountDetails.ts +++ b/src/serialization/types/SquareAccountDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const SquareAccountDetails: core.serialization.ObjectSchema< @@ -18,7 +20,7 @@ export const SquareAccountDetails: core.serialization.ObjectSchema< export declare namespace SquareAccountDetails { export interface Raw { - payment_source_token?: (string | null | undefined) | null; - errors?: (Error_.Raw[] | null | undefined) | null; + payment_source_token?: (string | null) | null; + errors?: (Error_.Raw[] | null) | null; } } diff --git a/src/serialization/types/StandardUnitDescription.ts b/src/serialization/types/StandardUnitDescription.ts index 668e65314..6a1bf19a5 100644 --- a/src/serialization/types/StandardUnitDescription.ts +++ b/src/serialization/types/StandardUnitDescription.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { MeasurementUnit } from "./MeasurementUnit"; export const StandardUnitDescription: core.serialization.ObjectSchema< @@ -17,7 +19,7 @@ export const StandardUnitDescription: core.serialization.ObjectSchema< export declare namespace StandardUnitDescription { export interface Raw { unit?: MeasurementUnit.Raw | null; - name?: (string | null | undefined) | null; - abbreviation?: (string | null | undefined) | null; + name?: (string | null) | null; + abbreviation?: (string | null) | null; } } diff --git a/src/serialization/types/StandardUnitDescriptionGroup.ts b/src/serialization/types/StandardUnitDescriptionGroup.ts index ba236d08b..583900eff 100644 --- a/src/serialization/types/StandardUnitDescriptionGroup.ts +++ b/src/serialization/types/StandardUnitDescriptionGroup.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { StandardUnitDescription } from "./StandardUnitDescription"; export const StandardUnitDescriptionGroup: core.serialization.ObjectSchema< @@ -18,7 +20,7 @@ export const StandardUnitDescriptionGroup: core.serialization.ObjectSchema< export declare namespace StandardUnitDescriptionGroup { export interface Raw { - standard_unit_descriptions?: (StandardUnitDescription.Raw[] | null | undefined) | null; - language_code?: (string | null | undefined) | null; + standard_unit_descriptions?: (StandardUnitDescription.Raw[] | null) | null; + language_code?: (string | null) | null; } } diff --git a/src/serialization/types/StartTransferOrderResponse.ts b/src/serialization/types/StartTransferOrderResponse.ts deleted file mode 100644 index 6d98d6adf..000000000 --- a/src/serialization/types/StartTransferOrderResponse.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; -import { TransferOrder } from "./TransferOrder"; - -export const StartTransferOrderResponse: core.serialization.ObjectSchema< - serializers.StartTransferOrderResponse.Raw, - Square.StartTransferOrderResponse -> = core.serialization.object({ - transferOrder: core.serialization.property("transfer_order", TransferOrder.optional()), - errors: core.serialization.list(Error_).optional(), -}); - -export declare namespace StartTransferOrderResponse { - export interface Raw { - transfer_order?: TransferOrder.Raw | null; - errors?: Error_.Raw[] | null; - } -} diff --git a/src/serialization/types/SubmitEvidenceResponse.ts b/src/serialization/types/SubmitEvidenceResponse.ts index 6aaf4b963..424f1d059 100644 --- a/src/serialization/types/SubmitEvidenceResponse.ts +++ b/src/serialization/types/SubmitEvidenceResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Dispute } from "./Dispute"; import { Error_ } from "./Error_"; +import { Dispute } from "./Dispute"; export const SubmitEvidenceResponse: core.serialization.ObjectSchema< serializers.SubmitEvidenceResponse.Raw, diff --git a/src/serialization/types/Subscription.ts b/src/serialization/types/Subscription.ts index 09404f94e..b72d3d9bd 100644 --- a/src/serialization/types/Subscription.ts +++ b/src/serialization/types/Subscription.ts @@ -1,13 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; +import { SubscriptionStatus } from "./SubscriptionStatus"; import { Money } from "./Money"; -import { Phase } from "./Phase"; -import { SubscriptionAction } from "./SubscriptionAction"; import { SubscriptionSource } from "./SubscriptionSource"; -import { SubscriptionStatus } from "./SubscriptionStatus"; +import { SubscriptionAction } from "./SubscriptionAction"; +import { Phase } from "./Phase"; export const Subscription: core.serialization.ObjectSchema = core.serialization.object({ @@ -36,7 +38,6 @@ export const Subscription: core.serialization.ObjectSchema = core.serialization.enum_(["CANCEL", "PAUSE", "RESUME", "SWAP_PLAN", "CHANGE_BILLING_ANCHOR_DATE", "COMPLETE"]); +> = core.serialization.enum_(["CANCEL", "PAUSE", "RESUME", "SWAP_PLAN", "CHANGE_BILLING_ANCHOR_DATE"]); export declare namespace SubscriptionActionType { - export type Raw = "CANCEL" | "PAUSE" | "RESUME" | "SWAP_PLAN" | "CHANGE_BILLING_ANCHOR_DATE" | "COMPLETE"; + export type Raw = "CANCEL" | "PAUSE" | "RESUME" | "SWAP_PLAN" | "CHANGE_BILLING_ANCHOR_DATE"; } diff --git a/src/serialization/types/SubscriptionCadence.ts b/src/serialization/types/SubscriptionCadence.ts index 026bed2a6..3554022c0 100644 --- a/src/serialization/types/SubscriptionCadence.ts +++ b/src/serialization/types/SubscriptionCadence.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SubscriptionCadence: core.serialization.Schema< serializers.SubscriptionCadence.Raw, diff --git a/src/serialization/types/SubscriptionCreatedEvent.ts b/src/serialization/types/SubscriptionCreatedEvent.ts index 695ae78e9..2dac5674e 100644 --- a/src/serialization/types/SubscriptionCreatedEvent.ts +++ b/src/serialization/types/SubscriptionCreatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SubscriptionCreatedEventData } from "./SubscriptionCreatedEventData"; export const SubscriptionCreatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const SubscriptionCreatedEvent: core.serialization.ObjectSchema< export declare namespace SubscriptionCreatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: SubscriptionCreatedEventData.Raw | null; } diff --git a/src/serialization/types/SubscriptionCreatedEventData.ts b/src/serialization/types/SubscriptionCreatedEventData.ts index 0a5e601f7..c382b55f0 100644 --- a/src/serialization/types/SubscriptionCreatedEventData.ts +++ b/src/serialization/types/SubscriptionCreatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SubscriptionCreatedEventObject } from "./SubscriptionCreatedEventObject"; export const SubscriptionCreatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const SubscriptionCreatedEventData: core.serialization.ObjectSchema< export declare namespace SubscriptionCreatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: SubscriptionCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/SubscriptionCreatedEventObject.ts b/src/serialization/types/SubscriptionCreatedEventObject.ts index 71169c184..a1e2eed63 100644 --- a/src/serialization/types/SubscriptionCreatedEventObject.ts +++ b/src/serialization/types/SubscriptionCreatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Subscription } from "./Subscription"; export const SubscriptionCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SubscriptionEvent.ts b/src/serialization/types/SubscriptionEvent.ts index a497c44d6..94071625b 100644 --- a/src/serialization/types/SubscriptionEvent.ts +++ b/src/serialization/types/SubscriptionEvent.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Phase } from "./Phase"; -import { SubscriptionEventInfo } from "./SubscriptionEventInfo"; import { SubscriptionEventSubscriptionEventType } from "./SubscriptionEventSubscriptionEventType"; +import { SubscriptionEventInfo } from "./SubscriptionEventInfo"; +import { Phase } from "./Phase"; export const SubscriptionEvent: core.serialization.ObjectSchema< serializers.SubscriptionEvent.Raw, @@ -33,7 +35,7 @@ export declare namespace SubscriptionEvent { effective_date: string; monthly_billing_anchor_date?: number | null; info?: SubscriptionEventInfo.Raw | null; - phases?: (Phase.Raw[] | null | undefined) | null; + phases?: (Phase.Raw[] | null) | null; plan_variation_id: string; } } diff --git a/src/serialization/types/SubscriptionEventInfo.ts b/src/serialization/types/SubscriptionEventInfo.ts index d48ea37c6..1213901c6 100644 --- a/src/serialization/types/SubscriptionEventInfo.ts +++ b/src/serialization/types/SubscriptionEventInfo.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SubscriptionEventInfoCode } from "./SubscriptionEventInfoCode"; export const SubscriptionEventInfo: core.serialization.ObjectSchema< @@ -15,7 +17,7 @@ export const SubscriptionEventInfo: core.serialization.ObjectSchema< export declare namespace SubscriptionEventInfo { export interface Raw { - detail?: (string | null | undefined) | null; + detail?: (string | null) | null; code?: SubscriptionEventInfoCode.Raw | null; } } diff --git a/src/serialization/types/SubscriptionEventInfoCode.ts b/src/serialization/types/SubscriptionEventInfoCode.ts index 28fa5ef8f..e435d9eb3 100644 --- a/src/serialization/types/SubscriptionEventInfoCode.ts +++ b/src/serialization/types/SubscriptionEventInfoCode.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SubscriptionEventInfoCode: core.serialization.Schema< serializers.SubscriptionEventInfoCode.Raw, diff --git a/src/serialization/types/SubscriptionEventSubscriptionEventType.ts b/src/serialization/types/SubscriptionEventSubscriptionEventType.ts index d78d51b7e..62b7fc660 100644 --- a/src/serialization/types/SubscriptionEventSubscriptionEventType.ts +++ b/src/serialization/types/SubscriptionEventSubscriptionEventType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SubscriptionEventSubscriptionEventType: core.serialization.Schema< serializers.SubscriptionEventSubscriptionEventType.Raw, diff --git a/src/serialization/types/SubscriptionPhase.ts b/src/serialization/types/SubscriptionPhase.ts index 2d6f14573..3bb6e311f 100644 --- a/src/serialization/types/SubscriptionPhase.ts +++ b/src/serialization/types/SubscriptionPhase.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Money } from "./Money"; import { SubscriptionCadence } from "./SubscriptionCadence"; +import { Money } from "./Money"; import { SubscriptionPricing } from "./SubscriptionPricing"; export const SubscriptionPhase: core.serialization.ObjectSchema< @@ -21,11 +23,11 @@ export const SubscriptionPhase: core.serialization.ObjectSchema< export declare namespace SubscriptionPhase { export interface Raw { - uid?: (string | null | undefined) | null; + uid?: (string | null) | null; cadence: SubscriptionCadence.Raw; - periods?: (number | null | undefined) | null; + periods?: (number | null) | null; recurring_price_money?: Money.Raw | null; - ordinal?: ((bigint | number) | null | undefined) | null; + ordinal?: ((bigint | number) | null) | null; pricing?: SubscriptionPricing.Raw | null; } } diff --git a/src/serialization/types/SubscriptionPricing.ts b/src/serialization/types/SubscriptionPricing.ts index a26c83b2e..6fa511e8c 100644 --- a/src/serialization/types/SubscriptionPricing.ts +++ b/src/serialization/types/SubscriptionPricing.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Money } from "./Money"; import { SubscriptionPricingType } from "./SubscriptionPricingType"; +import { Money } from "./Money"; export const SubscriptionPricing: core.serialization.ObjectSchema< serializers.SubscriptionPricing.Raw, @@ -21,7 +23,7 @@ export const SubscriptionPricing: core.serialization.ObjectSchema< export declare namespace SubscriptionPricing { export interface Raw { type?: SubscriptionPricingType.Raw | null; - discount_ids?: (string[] | null | undefined) | null; + discount_ids?: (string[] | null) | null; price_money?: Money.Raw | null; } } diff --git a/src/serialization/types/SubscriptionPricingType.ts b/src/serialization/types/SubscriptionPricingType.ts index 289334525..e9f81a66d 100644 --- a/src/serialization/types/SubscriptionPricingType.ts +++ b/src/serialization/types/SubscriptionPricingType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SubscriptionPricingType: core.serialization.Schema< serializers.SubscriptionPricingType.Raw, diff --git a/src/serialization/types/SubscriptionSource.ts b/src/serialization/types/SubscriptionSource.ts index 300e8c0cb..9024e0fb7 100644 --- a/src/serialization/types/SubscriptionSource.ts +++ b/src/serialization/types/SubscriptionSource.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SubscriptionSource: core.serialization.ObjectSchema< serializers.SubscriptionSource.Raw, @@ -13,6 +15,6 @@ export const SubscriptionSource: core.serialization.ObjectSchema< export declare namespace SubscriptionSource { export interface Raw { - name?: (string | null | undefined) | null; + name?: (string | null) | null; } } diff --git a/src/serialization/types/SubscriptionStatus.ts b/src/serialization/types/SubscriptionStatus.ts index ad6edd02e..b7b49f13c 100644 --- a/src/serialization/types/SubscriptionStatus.ts +++ b/src/serialization/types/SubscriptionStatus.ts @@ -1,14 +1,16 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SubscriptionStatus: core.serialization.Schema< serializers.SubscriptionStatus.Raw, Square.SubscriptionStatus -> = core.serialization.enum_(["PENDING", "ACTIVE", "CANCELED", "DEACTIVATED", "PAUSED", "COMPLETED"]); +> = core.serialization.enum_(["PENDING", "ACTIVE", "CANCELED", "DEACTIVATED", "PAUSED"]); export declare namespace SubscriptionStatus { - export type Raw = "PENDING" | "ACTIVE" | "CANCELED" | "DEACTIVATED" | "PAUSED" | "COMPLETED"; + export type Raw = "PENDING" | "ACTIVE" | "CANCELED" | "DEACTIVATED" | "PAUSED"; } diff --git a/src/serialization/types/SubscriptionTestResult.ts b/src/serialization/types/SubscriptionTestResult.ts index 9cf4847ad..48676804e 100644 --- a/src/serialization/types/SubscriptionTestResult.ts +++ b/src/serialization/types/SubscriptionTestResult.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SubscriptionTestResult: core.serialization.ObjectSchema< serializers.SubscriptionTestResult.Raw, @@ -18,8 +20,8 @@ export const SubscriptionTestResult: core.serialization.ObjectSchema< export declare namespace SubscriptionTestResult { export interface Raw { id?: string | null; - status_code?: (number | null | undefined) | null; - payload?: (string | null | undefined) | null; + status_code?: (number | null) | null; + payload?: (string | null) | null; created_at?: string | null; updated_at?: string | null; } diff --git a/src/serialization/types/SubscriptionUpdatedEvent.ts b/src/serialization/types/SubscriptionUpdatedEvent.ts index 0625cbae7..2a83a0412 100644 --- a/src/serialization/types/SubscriptionUpdatedEvent.ts +++ b/src/serialization/types/SubscriptionUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SubscriptionUpdatedEventData } from "./SubscriptionUpdatedEventData"; export const SubscriptionUpdatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const SubscriptionUpdatedEvent: core.serialization.ObjectSchema< export declare namespace SubscriptionUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: SubscriptionUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/SubscriptionUpdatedEventData.ts b/src/serialization/types/SubscriptionUpdatedEventData.ts index cc9ae1900..cfef2da95 100644 --- a/src/serialization/types/SubscriptionUpdatedEventData.ts +++ b/src/serialization/types/SubscriptionUpdatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SubscriptionUpdatedEventObject } from "./SubscriptionUpdatedEventObject"; export const SubscriptionUpdatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const SubscriptionUpdatedEventData: core.serialization.ObjectSchema< export declare namespace SubscriptionUpdatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: SubscriptionUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/SubscriptionUpdatedEventObject.ts b/src/serialization/types/SubscriptionUpdatedEventObject.ts index bcab5f610..54055b67a 100644 --- a/src/serialization/types/SubscriptionUpdatedEventObject.ts +++ b/src/serialization/types/SubscriptionUpdatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Subscription } from "./Subscription"; export const SubscriptionUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SwapPlanResponse.ts b/src/serialization/types/SwapPlanResponse.ts index 2de5150ae..dd9d5c3e6 100644 --- a/src/serialization/types/SwapPlanResponse.ts +++ b/src/serialization/types/SwapPlanResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Subscription } from "./Subscription"; import { SubscriptionAction } from "./SubscriptionAction"; diff --git a/src/serialization/types/TaxCalculationPhase.ts b/src/serialization/types/TaxCalculationPhase.ts index d86b31848..5f58c7c01 100644 --- a/src/serialization/types/TaxCalculationPhase.ts +++ b/src/serialization/types/TaxCalculationPhase.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const TaxCalculationPhase: core.serialization.Schema< serializers.TaxCalculationPhase.Raw, diff --git a/src/serialization/types/TaxIds.ts b/src/serialization/types/TaxIds.ts index 805438fcc..6ac0e13c6 100644 --- a/src/serialization/types/TaxIds.ts +++ b/src/serialization/types/TaxIds.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const TaxIds: core.serialization.ObjectSchema = core.serialization.object( { diff --git a/src/serialization/types/TaxInclusionType.ts b/src/serialization/types/TaxInclusionType.ts index 33ce309d9..b48dcfa51 100644 --- a/src/serialization/types/TaxInclusionType.ts +++ b/src/serialization/types/TaxInclusionType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const TaxInclusionType: core.serialization.Schema = core.serialization.enum_(["ADDITIVE", "INCLUSIVE"]); diff --git a/src/serialization/types/TeamMember.ts b/src/serialization/types/TeamMember.ts index 00577f47e..e3f666d99 100644 --- a/src/serialization/types/TeamMember.ts +++ b/src/serialization/types/TeamMember.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { TeamMemberAssignedLocations } from "./TeamMemberAssignedLocations"; import { TeamMemberStatus } from "./TeamMemberStatus"; +import { TeamMemberAssignedLocations } from "./TeamMemberAssignedLocations"; import { WageSetting } from "./WageSetting"; export const TeamMember: core.serialization.ObjectSchema = @@ -26,13 +28,13 @@ export const TeamMember: core.serialization.ObjectSchema = core.serialization.enum_(["ACTIVE", "INACTIVE"]); diff --git a/src/serialization/types/TeamMemberUpdatedEvent.ts b/src/serialization/types/TeamMemberUpdatedEvent.ts index ca31a3b61..e3b71a51d 100644 --- a/src/serialization/types/TeamMemberUpdatedEvent.ts +++ b/src/serialization/types/TeamMemberUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { TeamMemberUpdatedEventData } from "./TeamMemberUpdatedEventData"; export const TeamMemberUpdatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const TeamMemberUpdatedEvent: core.serialization.ObjectSchema< export declare namespace TeamMemberUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: TeamMemberUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/TeamMemberUpdatedEventData.ts b/src/serialization/types/TeamMemberUpdatedEventData.ts index 20107dbda..fa9441cbf 100644 --- a/src/serialization/types/TeamMemberUpdatedEventData.ts +++ b/src/serialization/types/TeamMemberUpdatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { TeamMemberUpdatedEventObject } from "./TeamMemberUpdatedEventObject"; export const TeamMemberUpdatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const TeamMemberUpdatedEventData: core.serialization.ObjectSchema< export declare namespace TeamMemberUpdatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: TeamMemberUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/TeamMemberUpdatedEventObject.ts b/src/serialization/types/TeamMemberUpdatedEventObject.ts index 81776a4bc..3f32f568d 100644 --- a/src/serialization/types/TeamMemberUpdatedEventObject.ts +++ b/src/serialization/types/TeamMemberUpdatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { TeamMember } from "./TeamMember"; export const TeamMemberUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/TeamMemberWage.ts b/src/serialization/types/TeamMemberWage.ts index fec32a380..c79f7fa98 100644 --- a/src/serialization/types/TeamMemberWage.ts +++ b/src/serialization/types/TeamMemberWage.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const TeamMemberWage: core.serialization.ObjectSchema = @@ -18,10 +20,10 @@ export const TeamMemberWage: core.serialization.ObjectSchema = core.serialization.object( { @@ -46,21 +48,21 @@ export const Tender: core.serialization.ObjectSchema = core.serialization.enum_([ diff --git a/src/serialization/types/TerminalAction.ts b/src/serialization/types/TerminalAction.ts index 34b432c41..cd94a74c5 100644 --- a/src/serialization/types/TerminalAction.ts +++ b/src/serialization/types/TerminalAction.ts @@ -1,18 +1,20 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { ActionCancelReason } from "./ActionCancelReason"; -import { ConfirmationOptions } from "./ConfirmationOptions"; -import { DataCollectionOptions } from "./DataCollectionOptions"; -import { DeviceMetadata } from "./DeviceMetadata"; +import { TerminalActionActionType } from "./TerminalActionActionType"; import { QrCodeOptions } from "./QrCodeOptions"; -import { ReceiptOptions } from "./ReceiptOptions"; import { SaveCardOptions } from "./SaveCardOptions"; -import { SelectOptions } from "./SelectOptions"; import { SignatureOptions } from "./SignatureOptions"; -import { TerminalActionActionType } from "./TerminalActionActionType"; +import { ConfirmationOptions } from "./ConfirmationOptions"; +import { ReceiptOptions } from "./ReceiptOptions"; +import { DataCollectionOptions } from "./DataCollectionOptions"; +import { SelectOptions } from "./SelectOptions"; +import { DeviceMetadata } from "./DeviceMetadata"; export const TerminalAction: core.serialization.ObjectSchema = core.serialization.object({ @@ -50,8 +52,8 @@ export const TerminalAction: core.serialization.ObjectSchema = core.serialization.object({ @@ -36,7 +38,7 @@ export declare namespace TerminalRefund { amount_money: Money.Raw; reason: string; device_id: string; - deadline_duration?: (string | null | undefined) | null; + deadline_duration?: (string | null) | null; status?: string | null; cancel_reason?: ActionCancelReason.Raw | null; created_at?: string | null; diff --git a/src/serialization/types/TerminalRefundCreatedEvent.ts b/src/serialization/types/TerminalRefundCreatedEvent.ts index 6b27d12ac..ab2cd1d99 100644 --- a/src/serialization/types/TerminalRefundCreatedEvent.ts +++ b/src/serialization/types/TerminalRefundCreatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { TerminalRefundCreatedEventData } from "./TerminalRefundCreatedEventData"; export const TerminalRefundCreatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const TerminalRefundCreatedEvent: core.serialization.ObjectSchema< export declare namespace TerminalRefundCreatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: TerminalRefundCreatedEventData.Raw | null; } diff --git a/src/serialization/types/TerminalRefundCreatedEventData.ts b/src/serialization/types/TerminalRefundCreatedEventData.ts index 094071f74..be8fdfc75 100644 --- a/src/serialization/types/TerminalRefundCreatedEventData.ts +++ b/src/serialization/types/TerminalRefundCreatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { TerminalRefundCreatedEventObject } from "./TerminalRefundCreatedEventObject"; export const TerminalRefundCreatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const TerminalRefundCreatedEventData: core.serialization.ObjectSchema< export declare namespace TerminalRefundCreatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: TerminalRefundCreatedEventObject.Raw | null; } diff --git a/src/serialization/types/TerminalRefundCreatedEventObject.ts b/src/serialization/types/TerminalRefundCreatedEventObject.ts index 19d9c1074..02e35f1fa 100644 --- a/src/serialization/types/TerminalRefundCreatedEventObject.ts +++ b/src/serialization/types/TerminalRefundCreatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { TerminalRefund } from "./TerminalRefund"; export const TerminalRefundCreatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/TerminalRefundQuery.ts b/src/serialization/types/TerminalRefundQuery.ts index 218228edd..40119b8ed 100644 --- a/src/serialization/types/TerminalRefundQuery.ts +++ b/src/serialization/types/TerminalRefundQuery.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { TerminalRefundQueryFilter } from "./TerminalRefundQueryFilter"; import { TerminalRefundQuerySort } from "./TerminalRefundQuerySort"; diff --git a/src/serialization/types/TerminalRefundQueryFilter.ts b/src/serialization/types/TerminalRefundQueryFilter.ts index 0136679e2..c8ff1d3a9 100644 --- a/src/serialization/types/TerminalRefundQueryFilter.ts +++ b/src/serialization/types/TerminalRefundQueryFilter.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { TimeRange } from "./TimeRange"; export const TerminalRefundQueryFilter: core.serialization.ObjectSchema< @@ -16,8 +18,8 @@ export const TerminalRefundQueryFilter: core.serialization.ObjectSchema< export declare namespace TerminalRefundQueryFilter { export interface Raw { - device_id?: (string | null | undefined) | null; + device_id?: (string | null) | null; created_at?: TimeRange.Raw | null; - status?: (string | null | undefined) | null; + status?: (string | null) | null; } } diff --git a/src/serialization/types/TerminalRefundQuerySort.ts b/src/serialization/types/TerminalRefundQuerySort.ts index 181d96859..5a9eacc0b 100644 --- a/src/serialization/types/TerminalRefundQuerySort.ts +++ b/src/serialization/types/TerminalRefundQuerySort.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const TerminalRefundQuerySort: core.serialization.ObjectSchema< serializers.TerminalRefundQuerySort.Raw, @@ -13,6 +15,6 @@ export const TerminalRefundQuerySort: core.serialization.ObjectSchema< export declare namespace TerminalRefundQuerySort { export interface Raw { - sort_order?: (string | null | undefined) | null; + sort_order?: (string | null) | null; } } diff --git a/src/serialization/types/TerminalRefundUpdatedEvent.ts b/src/serialization/types/TerminalRefundUpdatedEvent.ts index f61978d27..cc5994403 100644 --- a/src/serialization/types/TerminalRefundUpdatedEvent.ts +++ b/src/serialization/types/TerminalRefundUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { TerminalRefundUpdatedEventData } from "./TerminalRefundUpdatedEventData"; export const TerminalRefundUpdatedEvent: core.serialization.ObjectSchema< @@ -18,9 +20,9 @@ export const TerminalRefundUpdatedEvent: core.serialization.ObjectSchema< export declare namespace TerminalRefundUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: TerminalRefundUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/TerminalRefundUpdatedEventData.ts b/src/serialization/types/TerminalRefundUpdatedEventData.ts index 5823e24ed..86349c240 100644 --- a/src/serialization/types/TerminalRefundUpdatedEventData.ts +++ b/src/serialization/types/TerminalRefundUpdatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { TerminalRefundUpdatedEventObject } from "./TerminalRefundUpdatedEventObject"; export const TerminalRefundUpdatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const TerminalRefundUpdatedEventData: core.serialization.ObjectSchema< export declare namespace TerminalRefundUpdatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: TerminalRefundUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/TerminalRefundUpdatedEventObject.ts b/src/serialization/types/TerminalRefundUpdatedEventObject.ts index 47efbf4af..955dbdb16 100644 --- a/src/serialization/types/TerminalRefundUpdatedEventObject.ts +++ b/src/serialization/types/TerminalRefundUpdatedEventObject.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { TerminalRefund } from "./TerminalRefund"; export const TerminalRefundUpdatedEventObject: core.serialization.ObjectSchema< diff --git a/src/serialization/types/TestWebhookSubscriptionResponse.ts b/src/serialization/types/TestWebhookSubscriptionResponse.ts index dc084ae54..d768ff030 100644 --- a/src/serialization/types/TestWebhookSubscriptionResponse.ts +++ b/src/serialization/types/TestWebhookSubscriptionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { SubscriptionTestResult } from "./SubscriptionTestResult"; diff --git a/src/serialization/types/TimeRange.ts b/src/serialization/types/TimeRange.ts index 1e4a022f7..28845f302 100644 --- a/src/serialization/types/TimeRange.ts +++ b/src/serialization/types/TimeRange.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const TimeRange: core.serialization.ObjectSchema = core.serialization.object({ @@ -12,7 +14,7 @@ export const TimeRange: core.serialization.ObjectSchema = core.serialization.object({ @@ -29,11 +31,11 @@ export declare namespace Timecard { export interface Raw { id?: string | null; location_id: string; - timezone?: (string | null | undefined) | null; + timezone?: (string | null) | null; start_at: string; - end_at?: (string | null | undefined) | null; + end_at?: (string | null) | null; wage?: TimecardWage.Raw | null; - breaks?: (Break.Raw[] | null | undefined) | null; + breaks?: (Break.Raw[] | null) | null; status?: TimecardStatus.Raw | null; version?: number | null; created_at?: string | null; diff --git a/src/serialization/types/TimecardFilter.ts b/src/serialization/types/TimecardFilter.ts index ed815612b..f2b671f08 100644 --- a/src/serialization/types/TimecardFilter.ts +++ b/src/serialization/types/TimecardFilter.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { TimecardFilterStatus } from "./TimecardFilterStatus"; -import { TimecardWorkday } from "./TimecardWorkday"; import { TimeRange } from "./TimeRange"; +import { TimecardWorkday } from "./TimecardWorkday"; export const TimecardFilter: core.serialization.ObjectSchema = core.serialization.object({ @@ -25,11 +27,11 @@ export const TimecardFilter: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/TimecardSortField.ts b/src/serialization/types/TimecardSortField.ts index 50d8064c8..44306fb9e 100644 --- a/src/serialization/types/TimecardSortField.ts +++ b/src/serialization/types/TimecardSortField.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const TimecardSortField: core.serialization.Schema = core.serialization.enum_(["START_AT", "END_AT", "CREATED_AT", "UPDATED_AT"]); diff --git a/src/serialization/types/TimecardStatus.ts b/src/serialization/types/TimecardStatus.ts index 34e0848b2..4dc25427d 100644 --- a/src/serialization/types/TimecardStatus.ts +++ b/src/serialization/types/TimecardStatus.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const TimecardStatus: core.serialization.Schema = core.serialization.enum_(["OPEN", "CLOSED"]); diff --git a/src/serialization/types/TimecardWage.ts b/src/serialization/types/TimecardWage.ts index 46f04433d..cd525d907 100644 --- a/src/serialization/types/TimecardWage.ts +++ b/src/serialization/types/TimecardWage.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Money } from "./Money"; export const TimecardWage: core.serialization.ObjectSchema = @@ -15,9 +17,9 @@ export const TimecardWage: core.serialization.ObjectSchema = core.serialization.object({ @@ -24,10 +26,10 @@ export const TipSettings: core.serialization.ObjectSchema = core.serialization.object({ @@ -25,14 +27,14 @@ export const Transaction: core.serialization.ObjectSchema = core.serialization.enum_(["DEBIT", "CREDIT"]); diff --git a/src/serialization/types/TransferOrder.ts b/src/serialization/types/TransferOrder.ts deleted file mode 100644 index 3fd6348c8..000000000 --- a/src/serialization/types/TransferOrder.ts +++ /dev/null @@ -1,54 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { TransferOrderLine } from "./TransferOrderLine"; -import { TransferOrderStatus } from "./TransferOrderStatus"; - -export const TransferOrder: core.serialization.ObjectSchema = - core.serialization.object({ - id: core.serialization.string().optional(), - sourceLocationId: core.serialization.property( - "source_location_id", - core.serialization.string().optionalNullable(), - ), - destinationLocationId: core.serialization.property( - "destination_location_id", - core.serialization.string().optionalNullable(), - ), - status: TransferOrderStatus.optional(), - createdAt: core.serialization.property("created_at", core.serialization.string().optional()), - updatedAt: core.serialization.property("updated_at", core.serialization.string().optional()), - expectedAt: core.serialization.property("expected_at", core.serialization.string().optionalNullable()), - completedAt: core.serialization.property("completed_at", core.serialization.string().optional()), - notes: core.serialization.string().optionalNullable(), - trackingNumber: core.serialization.property("tracking_number", core.serialization.string().optionalNullable()), - createdByTeamMemberId: core.serialization.property( - "created_by_team_member_id", - core.serialization.string().optional(), - ), - lineItems: core.serialization.property( - "line_items", - core.serialization.list(TransferOrderLine).optionalNullable(), - ), - version: core.serialization.bigint().optional(), - }); - -export declare namespace TransferOrder { - export interface Raw { - id?: string | null; - source_location_id?: (string | null | undefined) | null; - destination_location_id?: (string | null | undefined) | null; - status?: TransferOrderStatus.Raw | null; - created_at?: string | null; - updated_at?: string | null; - expected_at?: (string | null | undefined) | null; - completed_at?: string | null; - notes?: (string | null | undefined) | null; - tracking_number?: (string | null | undefined) | null; - created_by_team_member_id?: string | null; - line_items?: (TransferOrderLine.Raw[] | null | undefined) | null; - version?: (bigint | number) | null; - } -} diff --git a/src/serialization/types/TransferOrderCreatedEvent.ts b/src/serialization/types/TransferOrderCreatedEvent.ts deleted file mode 100644 index 819b71df9..000000000 --- a/src/serialization/types/TransferOrderCreatedEvent.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { TransferOrderCreatedEventData } from "./TransferOrderCreatedEventData"; - -export const TransferOrderCreatedEvent: core.serialization.ObjectSchema< - serializers.TransferOrderCreatedEvent.Raw, - Square.TransferOrderCreatedEvent -> = core.serialization.object({ - merchantId: core.serialization.property("merchant_id", core.serialization.string().optionalNullable()), - type: core.serialization.string().optionalNullable(), - eventId: core.serialization.property("event_id", core.serialization.string().optionalNullable()), - createdAt: core.serialization.property("created_at", core.serialization.string().optional()), - data: TransferOrderCreatedEventData.optional(), -}); - -export declare namespace TransferOrderCreatedEvent { - export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; - created_at?: string | null; - data?: TransferOrderCreatedEventData.Raw | null; - } -} diff --git a/src/serialization/types/TransferOrderCreatedEventData.ts b/src/serialization/types/TransferOrderCreatedEventData.ts deleted file mode 100644 index 9d8a25f4a..000000000 --- a/src/serialization/types/TransferOrderCreatedEventData.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { TransferOrderCreatedEventObject } from "./TransferOrderCreatedEventObject"; - -export const TransferOrderCreatedEventData: core.serialization.ObjectSchema< - serializers.TransferOrderCreatedEventData.Raw, - Square.TransferOrderCreatedEventData -> = core.serialization.object({ - type: core.serialization.string().optionalNullable(), - id: core.serialization.string().optional(), - object: TransferOrderCreatedEventObject.optional(), -}); - -export declare namespace TransferOrderCreatedEventData { - export interface Raw { - type?: (string | null | undefined) | null; - id?: string | null; - object?: TransferOrderCreatedEventObject.Raw | null; - } -} diff --git a/src/serialization/types/TransferOrderCreatedEventObject.ts b/src/serialization/types/TransferOrderCreatedEventObject.ts deleted file mode 100644 index 3a944126a..000000000 --- a/src/serialization/types/TransferOrderCreatedEventObject.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { TransferOrder } from "./TransferOrder"; - -export const TransferOrderCreatedEventObject: core.serialization.ObjectSchema< - serializers.TransferOrderCreatedEventObject.Raw, - Square.TransferOrderCreatedEventObject -> = core.serialization.object({ - transferOrder: core.serialization.property("transfer_order", TransferOrder.optional()), -}); - -export declare namespace TransferOrderCreatedEventObject { - export interface Raw { - transfer_order?: TransferOrder.Raw | null; - } -} diff --git a/src/serialization/types/TransferOrderDeletedEvent.ts b/src/serialization/types/TransferOrderDeletedEvent.ts deleted file mode 100644 index 9371f2e11..000000000 --- a/src/serialization/types/TransferOrderDeletedEvent.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { TransferOrderDeletedEventData } from "./TransferOrderDeletedEventData"; - -export const TransferOrderDeletedEvent: core.serialization.ObjectSchema< - serializers.TransferOrderDeletedEvent.Raw, - Square.TransferOrderDeletedEvent -> = core.serialization.object({ - merchantId: core.serialization.property("merchant_id", core.serialization.string().optionalNullable()), - type: core.serialization.string().optionalNullable(), - eventId: core.serialization.property("event_id", core.serialization.string().optionalNullable()), - createdAt: core.serialization.property("created_at", core.serialization.string().optional()), - data: TransferOrderDeletedEventData.optional(), -}); - -export declare namespace TransferOrderDeletedEvent { - export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; - created_at?: string | null; - data?: TransferOrderDeletedEventData.Raw | null; - } -} diff --git a/src/serialization/types/TransferOrderDeletedEventData.ts b/src/serialization/types/TransferOrderDeletedEventData.ts deleted file mode 100644 index 2833c3548..000000000 --- a/src/serialization/types/TransferOrderDeletedEventData.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const TransferOrderDeletedEventData: core.serialization.ObjectSchema< - serializers.TransferOrderDeletedEventData.Raw, - Square.TransferOrderDeletedEventData -> = core.serialization.object({ - type: core.serialization.string().optionalNullable(), - id: core.serialization.string().optional(), - deleted: core.serialization.boolean().optionalNullable(), -}); - -export declare namespace TransferOrderDeletedEventData { - export interface Raw { - type?: (string | null | undefined) | null; - id?: string | null; - deleted?: (boolean | null | undefined) | null; - } -} diff --git a/src/serialization/types/TransferOrderFilter.ts b/src/serialization/types/TransferOrderFilter.ts deleted file mode 100644 index 2fa7c9f9c..000000000 --- a/src/serialization/types/TransferOrderFilter.ts +++ /dev/null @@ -1,29 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { TransferOrderStatus } from "./TransferOrderStatus"; - -export const TransferOrderFilter: core.serialization.ObjectSchema< - serializers.TransferOrderFilter.Raw, - Square.TransferOrderFilter -> = core.serialization.object({ - sourceLocationIds: core.serialization.property( - "source_location_ids", - core.serialization.list(core.serialization.string()).optionalNullable(), - ), - destinationLocationIds: core.serialization.property( - "destination_location_ids", - core.serialization.list(core.serialization.string()).optionalNullable(), - ), - statuses: core.serialization.list(TransferOrderStatus).optionalNullable(), -}); - -export declare namespace TransferOrderFilter { - export interface Raw { - source_location_ids?: (string[] | null | undefined) | null; - destination_location_ids?: (string[] | null | undefined) | null; - statuses?: (TransferOrderStatus.Raw[] | null | undefined) | null; - } -} diff --git a/src/serialization/types/TransferOrderGoodsReceipt.ts b/src/serialization/types/TransferOrderGoodsReceipt.ts deleted file mode 100644 index 023b0c72a..000000000 --- a/src/serialization/types/TransferOrderGoodsReceipt.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { TransferOrderGoodsReceiptLineItem } from "./TransferOrderGoodsReceiptLineItem"; - -export const TransferOrderGoodsReceipt: core.serialization.ObjectSchema< - serializers.TransferOrderGoodsReceipt.Raw, - Square.TransferOrderGoodsReceipt -> = core.serialization.object({ - lineItems: core.serialization.property( - "line_items", - core.serialization.list(TransferOrderGoodsReceiptLineItem).optionalNullable(), - ), -}); - -export declare namespace TransferOrderGoodsReceipt { - export interface Raw { - line_items?: (TransferOrderGoodsReceiptLineItem.Raw[] | null | undefined) | null; - } -} diff --git a/src/serialization/types/TransferOrderGoodsReceiptLineItem.ts b/src/serialization/types/TransferOrderGoodsReceiptLineItem.ts deleted file mode 100644 index 261502b51..000000000 --- a/src/serialization/types/TransferOrderGoodsReceiptLineItem.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const TransferOrderGoodsReceiptLineItem: core.serialization.ObjectSchema< - serializers.TransferOrderGoodsReceiptLineItem.Raw, - Square.TransferOrderGoodsReceiptLineItem -> = core.serialization.object({ - transferOrderLineUid: core.serialization.property("transfer_order_line_uid", core.serialization.string()), - quantityReceived: core.serialization.property("quantity_received", core.serialization.string().optionalNullable()), - quantityDamaged: core.serialization.property("quantity_damaged", core.serialization.string().optionalNullable()), - quantityCanceled: core.serialization.property("quantity_canceled", core.serialization.string().optionalNullable()), -}); - -export declare namespace TransferOrderGoodsReceiptLineItem { - export interface Raw { - transfer_order_line_uid: string; - quantity_received?: (string | null | undefined) | null; - quantity_damaged?: (string | null | undefined) | null; - quantity_canceled?: (string | null | undefined) | null; - } -} diff --git a/src/serialization/types/TransferOrderLine.ts b/src/serialization/types/TransferOrderLine.ts deleted file mode 100644 index ed8e50933..000000000 --- a/src/serialization/types/TransferOrderLine.ts +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const TransferOrderLine: core.serialization.ObjectSchema< - serializers.TransferOrderLine.Raw, - Square.TransferOrderLine -> = core.serialization.object({ - uid: core.serialization.string().optional(), - itemVariationId: core.serialization.property("item_variation_id", core.serialization.string()), - quantityOrdered: core.serialization.property("quantity_ordered", core.serialization.string()), - quantityPending: core.serialization.property("quantity_pending", core.serialization.string().optional()), - quantityReceived: core.serialization.property("quantity_received", core.serialization.string().optional()), - quantityDamaged: core.serialization.property("quantity_damaged", core.serialization.string().optional()), - quantityCanceled: core.serialization.property("quantity_canceled", core.serialization.string().optional()), -}); - -export declare namespace TransferOrderLine { - export interface Raw { - uid?: string | null; - item_variation_id: string; - quantity_ordered: string; - quantity_pending?: string | null; - quantity_received?: string | null; - quantity_damaged?: string | null; - quantity_canceled?: string | null; - } -} diff --git a/src/serialization/types/TransferOrderQuery.ts b/src/serialization/types/TransferOrderQuery.ts deleted file mode 100644 index 015e5bbee..000000000 --- a/src/serialization/types/TransferOrderQuery.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { TransferOrderFilter } from "./TransferOrderFilter"; -import { TransferOrderSort } from "./TransferOrderSort"; - -export const TransferOrderQuery: core.serialization.ObjectSchema< - serializers.TransferOrderQuery.Raw, - Square.TransferOrderQuery -> = core.serialization.object({ - filter: TransferOrderFilter.optional(), - sort: TransferOrderSort.optional(), -}); - -export declare namespace TransferOrderQuery { - export interface Raw { - filter?: TransferOrderFilter.Raw | null; - sort?: TransferOrderSort.Raw | null; - } -} diff --git a/src/serialization/types/TransferOrderSort.ts b/src/serialization/types/TransferOrderSort.ts deleted file mode 100644 index 8b83337e8..000000000 --- a/src/serialization/types/TransferOrderSort.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { SortOrder } from "./SortOrder"; -import { TransferOrderSortField } from "./TransferOrderSortField"; - -export const TransferOrderSort: core.serialization.ObjectSchema< - serializers.TransferOrderSort.Raw, - Square.TransferOrderSort -> = core.serialization.object({ - field: TransferOrderSortField.optional(), - order: SortOrder.optional(), -}); - -export declare namespace TransferOrderSort { - export interface Raw { - field?: TransferOrderSortField.Raw | null; - order?: SortOrder.Raw | null; - } -} diff --git a/src/serialization/types/TransferOrderSortField.ts b/src/serialization/types/TransferOrderSortField.ts deleted file mode 100644 index 489c9d1d8..000000000 --- a/src/serialization/types/TransferOrderSortField.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const TransferOrderSortField: core.serialization.Schema< - serializers.TransferOrderSortField.Raw, - Square.TransferOrderSortField -> = core.serialization.enum_(["CREATED_AT", "UPDATED_AT"]); - -export declare namespace TransferOrderSortField { - export type Raw = "CREATED_AT" | "UPDATED_AT"; -} diff --git a/src/serialization/types/TransferOrderStatus.ts b/src/serialization/types/TransferOrderStatus.ts deleted file mode 100644 index 47408663a..000000000 --- a/src/serialization/types/TransferOrderStatus.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const TransferOrderStatus: core.serialization.Schema< - serializers.TransferOrderStatus.Raw, - Square.TransferOrderStatus -> = core.serialization.enum_(["DRAFT", "STARTED", "PARTIALLY_RECEIVED", "COMPLETED", "CANCELED"]); - -export declare namespace TransferOrderStatus { - export type Raw = "DRAFT" | "STARTED" | "PARTIALLY_RECEIVED" | "COMPLETED" | "CANCELED"; -} diff --git a/src/serialization/types/TransferOrderUpdatedEvent.ts b/src/serialization/types/TransferOrderUpdatedEvent.ts deleted file mode 100644 index 444615a88..000000000 --- a/src/serialization/types/TransferOrderUpdatedEvent.ts +++ /dev/null @@ -1,27 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { TransferOrderUpdatedEventData } from "./TransferOrderUpdatedEventData"; - -export const TransferOrderUpdatedEvent: core.serialization.ObjectSchema< - serializers.TransferOrderUpdatedEvent.Raw, - Square.TransferOrderUpdatedEvent -> = core.serialization.object({ - merchantId: core.serialization.property("merchant_id", core.serialization.string().optionalNullable()), - type: core.serialization.string().optionalNullable(), - eventId: core.serialization.property("event_id", core.serialization.string().optionalNullable()), - createdAt: core.serialization.property("created_at", core.serialization.string().optional()), - data: TransferOrderUpdatedEventData.optional(), -}); - -export declare namespace TransferOrderUpdatedEvent { - export interface Raw { - merchant_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; - created_at?: string | null; - data?: TransferOrderUpdatedEventData.Raw | null; - } -} diff --git a/src/serialization/types/TransferOrderUpdatedEventData.ts b/src/serialization/types/TransferOrderUpdatedEventData.ts deleted file mode 100644 index 80e3e8c80..000000000 --- a/src/serialization/types/TransferOrderUpdatedEventData.ts +++ /dev/null @@ -1,23 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { TransferOrderUpdatedEventObject } from "./TransferOrderUpdatedEventObject"; - -export const TransferOrderUpdatedEventData: core.serialization.ObjectSchema< - serializers.TransferOrderUpdatedEventData.Raw, - Square.TransferOrderUpdatedEventData -> = core.serialization.object({ - type: core.serialization.string().optionalNullable(), - id: core.serialization.string().optional(), - object: TransferOrderUpdatedEventObject.optional(), -}); - -export declare namespace TransferOrderUpdatedEventData { - export interface Raw { - type?: (string | null | undefined) | null; - id?: string | null; - object?: TransferOrderUpdatedEventObject.Raw | null; - } -} diff --git a/src/serialization/types/TransferOrderUpdatedEventObject.ts b/src/serialization/types/TransferOrderUpdatedEventObject.ts deleted file mode 100644 index 298ad7207..000000000 --- a/src/serialization/types/TransferOrderUpdatedEventObject.ts +++ /dev/null @@ -1,19 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { TransferOrder } from "./TransferOrder"; - -export const TransferOrderUpdatedEventObject: core.serialization.ObjectSchema< - serializers.TransferOrderUpdatedEventObject.Raw, - Square.TransferOrderUpdatedEventObject -> = core.serialization.object({ - transferOrder: core.serialization.property("transfer_order", TransferOrder.optional()), -}); - -export declare namespace TransferOrderUpdatedEventObject { - export interface Raw { - transfer_order?: TransferOrder.Raw | null; - } -} diff --git a/src/serialization/types/UnlinkCustomerFromGiftCardResponse.ts b/src/serialization/types/UnlinkCustomerFromGiftCardResponse.ts index 3142057a0..0314b5829 100644 --- a/src/serialization/types/UnlinkCustomerFromGiftCardResponse.ts +++ b/src/serialization/types/UnlinkCustomerFromGiftCardResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { GiftCard } from "./GiftCard"; diff --git a/src/serialization/types/UpdateBookingCustomAttributeDefinitionResponse.ts b/src/serialization/types/UpdateBookingCustomAttributeDefinitionResponse.ts index 1cb7232f9..06659cf5b 100644 --- a/src/serialization/types/UpdateBookingCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/UpdateBookingCustomAttributeDefinitionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/UpdateBookingResponse.ts b/src/serialization/types/UpdateBookingResponse.ts index a1ebea68e..864c93f81 100644 --- a/src/serialization/types/UpdateBookingResponse.ts +++ b/src/serialization/types/UpdateBookingResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Booking } from "./Booking"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/UpdateBreakTypeResponse.ts b/src/serialization/types/UpdateBreakTypeResponse.ts index 9d5d076c9..28bd76133 100644 --- a/src/serialization/types/UpdateBreakTypeResponse.ts +++ b/src/serialization/types/UpdateBreakTypeResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BreakType } from "./BreakType"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/UpdateCatalogImageRequest.ts b/src/serialization/types/UpdateCatalogImageRequest.ts index a4752207a..bab461bbd 100644 --- a/src/serialization/types/UpdateCatalogImageRequest.ts +++ b/src/serialization/types/UpdateCatalogImageRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const UpdateCatalogImageRequest: core.serialization.ObjectSchema< serializers.UpdateCatalogImageRequest.Raw, diff --git a/src/serialization/types/UpdateCatalogImageResponse.ts b/src/serialization/types/UpdateCatalogImageResponse.ts index 9e2b2a4d4..e51a1c853 100644 --- a/src/serialization/types/UpdateCatalogImageResponse.ts +++ b/src/serialization/types/UpdateCatalogImageResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; -import * as core from "../../core"; import * as serializers from "../index"; +import * as Square from "../../api/index"; +import * as core from "../../core"; import { Error_ } from "./Error_"; export const UpdateCatalogImageResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/UpdateCustomerCustomAttributeDefinitionResponse.ts b/src/serialization/types/UpdateCustomerCustomAttributeDefinitionResponse.ts index 074e83e24..bff994b91 100644 --- a/src/serialization/types/UpdateCustomerCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/UpdateCustomerCustomAttributeDefinitionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/UpdateCustomerGroupResponse.ts b/src/serialization/types/UpdateCustomerGroupResponse.ts index 165c4befc..01d38d9d3 100644 --- a/src/serialization/types/UpdateCustomerGroupResponse.ts +++ b/src/serialization/types/UpdateCustomerGroupResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { CustomerGroup } from "./CustomerGroup"; import { Error_ } from "./Error_"; +import { CustomerGroup } from "./CustomerGroup"; export const UpdateCustomerGroupResponse: core.serialization.ObjectSchema< serializers.UpdateCustomerGroupResponse.Raw, diff --git a/src/serialization/types/UpdateCustomerResponse.ts b/src/serialization/types/UpdateCustomerResponse.ts index aee34191d..8de103282 100644 --- a/src/serialization/types/UpdateCustomerResponse.ts +++ b/src/serialization/types/UpdateCustomerResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Customer } from "./Customer"; import { Error_ } from "./Error_"; +import { Customer } from "./Customer"; export const UpdateCustomerResponse: core.serialization.ObjectSchema< serializers.UpdateCustomerResponse.Raw, diff --git a/src/serialization/types/UpdateInvoiceResponse.ts b/src/serialization/types/UpdateInvoiceResponse.ts index 46d2fa0d6..3de8309ef 100644 --- a/src/serialization/types/UpdateInvoiceResponse.ts +++ b/src/serialization/types/UpdateInvoiceResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Invoice } from "./Invoice"; +import { Error_ } from "./Error_"; export const UpdateInvoiceResponse: core.serialization.ObjectSchema< serializers.UpdateInvoiceResponse.Raw, diff --git a/src/serialization/types/UpdateItemModifierListsResponse.ts b/src/serialization/types/UpdateItemModifierListsResponse.ts index 73b263aff..19e63ec7e 100644 --- a/src/serialization/types/UpdateItemModifierListsResponse.ts +++ b/src/serialization/types/UpdateItemModifierListsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const UpdateItemModifierListsResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/UpdateItemTaxesResponse.ts b/src/serialization/types/UpdateItemTaxesResponse.ts index ef0eea3dc..400178bb0 100644 --- a/src/serialization/types/UpdateItemTaxesResponse.ts +++ b/src/serialization/types/UpdateItemTaxesResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const UpdateItemTaxesResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/UpdateJobResponse.ts b/src/serialization/types/UpdateJobResponse.ts index a2647b9e5..43ad59fa7 100644 --- a/src/serialization/types/UpdateJobResponse.ts +++ b/src/serialization/types/UpdateJobResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Job } from "./Job"; +import { Error_ } from "./Error_"; export const UpdateJobResponse: core.serialization.ObjectSchema< serializers.UpdateJobResponse.Raw, diff --git a/src/serialization/types/UpdateLocationCustomAttributeDefinitionResponse.ts b/src/serialization/types/UpdateLocationCustomAttributeDefinitionResponse.ts index 9b21fae0c..946412d40 100644 --- a/src/serialization/types/UpdateLocationCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/UpdateLocationCustomAttributeDefinitionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/UpdateLocationResponse.ts b/src/serialization/types/UpdateLocationResponse.ts index 77e0795ca..36409929b 100644 --- a/src/serialization/types/UpdateLocationResponse.ts +++ b/src/serialization/types/UpdateLocationResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Location } from "./Location"; diff --git a/src/serialization/types/UpdateLocationSettingsResponse.ts b/src/serialization/types/UpdateLocationSettingsResponse.ts index b90e36796..25467d2b6 100644 --- a/src/serialization/types/UpdateLocationSettingsResponse.ts +++ b/src/serialization/types/UpdateLocationSettingsResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { CheckoutLocationSettings } from "./CheckoutLocationSettings"; import { Error_ } from "./Error_"; +import { CheckoutLocationSettings } from "./CheckoutLocationSettings"; export const UpdateLocationSettingsResponse: core.serialization.ObjectSchema< serializers.UpdateLocationSettingsResponse.Raw, diff --git a/src/serialization/types/UpdateMerchantCustomAttributeDefinitionResponse.ts b/src/serialization/types/UpdateMerchantCustomAttributeDefinitionResponse.ts index b33db56a3..747cc108f 100644 --- a/src/serialization/types/UpdateMerchantCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/UpdateMerchantCustomAttributeDefinitionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/UpdateMerchantSettingsResponse.ts b/src/serialization/types/UpdateMerchantSettingsResponse.ts index 2d6587c58..e474798e0 100644 --- a/src/serialization/types/UpdateMerchantSettingsResponse.ts +++ b/src/serialization/types/UpdateMerchantSettingsResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { CheckoutMerchantSettings } from "./CheckoutMerchantSettings"; import { Error_ } from "./Error_"; +import { CheckoutMerchantSettings } from "./CheckoutMerchantSettings"; export const UpdateMerchantSettingsResponse: core.serialization.ObjectSchema< serializers.UpdateMerchantSettingsResponse.Raw, diff --git a/src/serialization/types/UpdateOrderCustomAttributeDefinitionResponse.ts b/src/serialization/types/UpdateOrderCustomAttributeDefinitionResponse.ts index 78efdafab..5054f4374 100644 --- a/src/serialization/types/UpdateOrderCustomAttributeDefinitionResponse.ts +++ b/src/serialization/types/UpdateOrderCustomAttributeDefinitionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttributeDefinition } from "./CustomAttributeDefinition"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/UpdateOrderResponse.ts b/src/serialization/types/UpdateOrderResponse.ts index e645251bd..3d8fc8385 100644 --- a/src/serialization/types/UpdateOrderResponse.ts +++ b/src/serialization/types/UpdateOrderResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Order } from "./Order"; +import { Error_ } from "./Error_"; export const UpdateOrderResponse: core.serialization.ObjectSchema< serializers.UpdateOrderResponse.Raw, diff --git a/src/serialization/types/UpdatePaymentLinkResponse.ts b/src/serialization/types/UpdatePaymentLinkResponse.ts index 53869ca34..a8e948ea5 100644 --- a/src/serialization/types/UpdatePaymentLinkResponse.ts +++ b/src/serialization/types/UpdatePaymentLinkResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { PaymentLink } from "./PaymentLink"; diff --git a/src/serialization/types/UpdatePaymentResponse.ts b/src/serialization/types/UpdatePaymentResponse.ts index d7077b534..a5c33178b 100644 --- a/src/serialization/types/UpdatePaymentResponse.ts +++ b/src/serialization/types/UpdatePaymentResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Payment } from "./Payment"; diff --git a/src/serialization/types/UpdateScheduledShiftResponse.ts b/src/serialization/types/UpdateScheduledShiftResponse.ts index cee5a4f85..39117500c 100644 --- a/src/serialization/types/UpdateScheduledShiftResponse.ts +++ b/src/serialization/types/UpdateScheduledShiftResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { ScheduledShift } from "./ScheduledShift"; +import { Error_ } from "./Error_"; export const UpdateScheduledShiftResponse: core.serialization.ObjectSchema< serializers.UpdateScheduledShiftResponse.Raw, diff --git a/src/serialization/types/UpdateShiftResponse.ts b/src/serialization/types/UpdateShiftResponse.ts index eca19c57a..fa63dd4eb 100644 --- a/src/serialization/types/UpdateShiftResponse.ts +++ b/src/serialization/types/UpdateShiftResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Shift } from "./Shift"; +import { Error_ } from "./Error_"; export const UpdateShiftResponse: core.serialization.ObjectSchema< serializers.UpdateShiftResponse.Raw, diff --git a/src/serialization/types/UpdateSubscriptionResponse.ts b/src/serialization/types/UpdateSubscriptionResponse.ts index 61c622397..3e7bc8d78 100644 --- a/src/serialization/types/UpdateSubscriptionResponse.ts +++ b/src/serialization/types/UpdateSubscriptionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Subscription } from "./Subscription"; diff --git a/src/serialization/types/UpdateTeamMemberRequest.ts b/src/serialization/types/UpdateTeamMemberRequest.ts index 4d55eef3d..90f379625 100644 --- a/src/serialization/types/UpdateTeamMemberRequest.ts +++ b/src/serialization/types/UpdateTeamMemberRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { TeamMember } from "./TeamMember"; export const UpdateTeamMemberRequest: core.serialization.ObjectSchema< diff --git a/src/serialization/types/UpdateTeamMemberResponse.ts b/src/serialization/types/UpdateTeamMemberResponse.ts index 53c56b58c..5be3fd748 100644 --- a/src/serialization/types/UpdateTeamMemberResponse.ts +++ b/src/serialization/types/UpdateTeamMemberResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { TeamMember } from "./TeamMember"; +import { Error_ } from "./Error_"; export const UpdateTeamMemberResponse: core.serialization.ObjectSchema< serializers.UpdateTeamMemberResponse.Raw, diff --git a/src/serialization/types/UpdateTimecardResponse.ts b/src/serialization/types/UpdateTimecardResponse.ts index 004631136..15c266e59 100644 --- a/src/serialization/types/UpdateTimecardResponse.ts +++ b/src/serialization/types/UpdateTimecardResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { Timecard } from "./Timecard"; +import { Error_ } from "./Error_"; export const UpdateTimecardResponse: core.serialization.ObjectSchema< serializers.UpdateTimecardResponse.Raw, diff --git a/src/serialization/types/UpdateTransferOrderData.ts b/src/serialization/types/UpdateTransferOrderData.ts deleted file mode 100644 index 0358e407f..000000000 --- a/src/serialization/types/UpdateTransferOrderData.ts +++ /dev/null @@ -1,35 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { UpdateTransferOrderLineData } from "./UpdateTransferOrderLineData"; - -export const UpdateTransferOrderData: core.serialization.ObjectSchema< - serializers.UpdateTransferOrderData.Raw, - Square.UpdateTransferOrderData -> = core.serialization.object({ - sourceLocationId: core.serialization.property("source_location_id", core.serialization.string().optionalNullable()), - destinationLocationId: core.serialization.property( - "destination_location_id", - core.serialization.string().optionalNullable(), - ), - expectedAt: core.serialization.property("expected_at", core.serialization.string().optionalNullable()), - notes: core.serialization.string().optionalNullable(), - trackingNumber: core.serialization.property("tracking_number", core.serialization.string().optionalNullable()), - lineItems: core.serialization.property( - "line_items", - core.serialization.list(UpdateTransferOrderLineData).optionalNullable(), - ), -}); - -export declare namespace UpdateTransferOrderData { - export interface Raw { - source_location_id?: (string | null | undefined) | null; - destination_location_id?: (string | null | undefined) | null; - expected_at?: (string | null | undefined) | null; - notes?: (string | null | undefined) | null; - tracking_number?: (string | null | undefined) | null; - line_items?: (UpdateTransferOrderLineData.Raw[] | null | undefined) | null; - } -} diff --git a/src/serialization/types/UpdateTransferOrderLineData.ts b/src/serialization/types/UpdateTransferOrderLineData.ts deleted file mode 100644 index 4f27fe879..000000000 --- a/src/serialization/types/UpdateTransferOrderLineData.ts +++ /dev/null @@ -1,24 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const UpdateTransferOrderLineData: core.serialization.ObjectSchema< - serializers.UpdateTransferOrderLineData.Raw, - Square.UpdateTransferOrderLineData -> = core.serialization.object({ - uid: core.serialization.string().optionalNullable(), - itemVariationId: core.serialization.property("item_variation_id", core.serialization.string().optionalNullable()), - quantityOrdered: core.serialization.property("quantity_ordered", core.serialization.string().optionalNullable()), - remove: core.serialization.boolean().optionalNullable(), -}); - -export declare namespace UpdateTransferOrderLineData { - export interface Raw { - uid?: (string | null | undefined) | null; - item_variation_id?: (string | null | undefined) | null; - quantity_ordered?: (string | null | undefined) | null; - remove?: (boolean | null | undefined) | null; - } -} diff --git a/src/serialization/types/UpdateTransferOrderResponse.ts b/src/serialization/types/UpdateTransferOrderResponse.ts deleted file mode 100644 index 54fa2be0d..000000000 --- a/src/serialization/types/UpdateTransferOrderResponse.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; -import { TransferOrder } from "./TransferOrder"; - -export const UpdateTransferOrderResponse: core.serialization.ObjectSchema< - serializers.UpdateTransferOrderResponse.Raw, - Square.UpdateTransferOrderResponse -> = core.serialization.object({ - transferOrder: core.serialization.property("transfer_order", TransferOrder.optional()), - errors: core.serialization.list(Error_).optional(), -}); - -export declare namespace UpdateTransferOrderResponse { - export interface Raw { - transfer_order?: TransferOrder.Raw | null; - errors?: Error_.Raw[] | null; - } -} diff --git a/src/serialization/types/UpdateVendorRequest.ts b/src/serialization/types/UpdateVendorRequest.ts index 2fb298b7c..1517797f5 100644 --- a/src/serialization/types/UpdateVendorRequest.ts +++ b/src/serialization/types/UpdateVendorRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Vendor } from "./Vendor"; export const UpdateVendorRequest: core.serialization.ObjectSchema< @@ -15,7 +17,7 @@ export const UpdateVendorRequest: core.serialization.ObjectSchema< export declare namespace UpdateVendorRequest { export interface Raw { - idempotency_key?: (string | null | undefined) | null; + idempotency_key?: (string | null) | null; vendor: Vendor.Raw; } } diff --git a/src/serialization/types/UpdateVendorResponse.ts b/src/serialization/types/UpdateVendorResponse.ts index b867500d0..ee6505e5e 100644 --- a/src/serialization/types/UpdateVendorResponse.ts +++ b/src/serialization/types/UpdateVendorResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Vendor } from "./Vendor"; diff --git a/src/serialization/types/UpdateWageSettingResponse.ts b/src/serialization/types/UpdateWageSettingResponse.ts index 5a1728717..c7c16b35a 100644 --- a/src/serialization/types/UpdateWageSettingResponse.ts +++ b/src/serialization/types/UpdateWageSettingResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { WageSetting } from "./WageSetting"; +import { Error_ } from "./Error_"; export const UpdateWageSettingResponse: core.serialization.ObjectSchema< serializers.UpdateWageSettingResponse.Raw, diff --git a/src/serialization/types/UpdateWebhookSubscriptionResponse.ts b/src/serialization/types/UpdateWebhookSubscriptionResponse.ts index e83111b21..a15ce6e6f 100644 --- a/src/serialization/types/UpdateWebhookSubscriptionResponse.ts +++ b/src/serialization/types/UpdateWebhookSubscriptionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { WebhookSubscription } from "./WebhookSubscription"; diff --git a/src/serialization/types/UpdateWebhookSubscriptionSignatureKeyResponse.ts b/src/serialization/types/UpdateWebhookSubscriptionSignatureKeyResponse.ts index a929fbe4e..38ac5a31e 100644 --- a/src/serialization/types/UpdateWebhookSubscriptionSignatureKeyResponse.ts +++ b/src/serialization/types/UpdateWebhookSubscriptionSignatureKeyResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const UpdateWebhookSubscriptionSignatureKeyResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/UpdateWorkweekConfigResponse.ts b/src/serialization/types/UpdateWorkweekConfigResponse.ts index 3f111e623..552811bb0 100644 --- a/src/serialization/types/UpdateWorkweekConfigResponse.ts +++ b/src/serialization/types/UpdateWorkweekConfigResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Error_ } from "./Error_"; import { WorkweekConfig } from "./WorkweekConfig"; +import { Error_ } from "./Error_"; export const UpdateWorkweekConfigResponse: core.serialization.ObjectSchema< serializers.UpdateWorkweekConfigResponse.Raw, diff --git a/src/serialization/types/UpsertBookingCustomAttributeResponse.ts b/src/serialization/types/UpsertBookingCustomAttributeResponse.ts index 4754b5a75..50e3aefaa 100644 --- a/src/serialization/types/UpsertBookingCustomAttributeResponse.ts +++ b/src/serialization/types/UpsertBookingCustomAttributeResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/UpsertCatalogObjectResponse.ts b/src/serialization/types/UpsertCatalogObjectResponse.ts index e8506229a..3b4dced9c 100644 --- a/src/serialization/types/UpsertCatalogObjectResponse.ts +++ b/src/serialization/types/UpsertCatalogObjectResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; -import * as core from "../../core"; import * as serializers from "../index"; -import { CatalogIdMapping } from "./CatalogIdMapping"; +import * as Square from "../../api/index"; +import * as core from "../../core"; import { Error_ } from "./Error_"; +import { CatalogIdMapping } from "./CatalogIdMapping"; export const UpsertCatalogObjectResponse: core.serialization.ObjectSchema< serializers.UpsertCatalogObjectResponse.Raw, diff --git a/src/serialization/types/UpsertCustomerCustomAttributeResponse.ts b/src/serialization/types/UpsertCustomerCustomAttributeResponse.ts index 80c216dbf..d6706a9fe 100644 --- a/src/serialization/types/UpsertCustomerCustomAttributeResponse.ts +++ b/src/serialization/types/UpsertCustomerCustomAttributeResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/UpsertLocationCustomAttributeResponse.ts b/src/serialization/types/UpsertLocationCustomAttributeResponse.ts index 68f7d6ed4..6d03388b9 100644 --- a/src/serialization/types/UpsertLocationCustomAttributeResponse.ts +++ b/src/serialization/types/UpsertLocationCustomAttributeResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/UpsertMerchantCustomAttributeResponse.ts b/src/serialization/types/UpsertMerchantCustomAttributeResponse.ts index 8e576e8b3..05a72a090 100644 --- a/src/serialization/types/UpsertMerchantCustomAttributeResponse.ts +++ b/src/serialization/types/UpsertMerchantCustomAttributeResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/UpsertOrderCustomAttributeResponse.ts b/src/serialization/types/UpsertOrderCustomAttributeResponse.ts index bad90ba9b..5710d512a 100644 --- a/src/serialization/types/UpsertOrderCustomAttributeResponse.ts +++ b/src/serialization/types/UpsertOrderCustomAttributeResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomAttribute } from "./CustomAttribute"; import { Error_ } from "./Error_"; diff --git a/src/serialization/types/UpsertSnippetResponse.ts b/src/serialization/types/UpsertSnippetResponse.ts index f3a7cc9e4..637152d31 100644 --- a/src/serialization/types/UpsertSnippetResponse.ts +++ b/src/serialization/types/UpsertSnippetResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; import { Snippet } from "./Snippet"; diff --git a/src/serialization/types/V1GetPaymentRequest.ts b/src/serialization/types/V1GetPaymentRequest.ts index b0c942869..eb93bfcb7 100644 --- a/src/serialization/types/V1GetPaymentRequest.ts +++ b/src/serialization/types/V1GetPaymentRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const V1GetPaymentRequest: core.serialization.Schema< serializers.V1GetPaymentRequest.Raw, diff --git a/src/serialization/types/V1GetSettlementRequest.ts b/src/serialization/types/V1GetSettlementRequest.ts index c5eb186ce..1d2d826ba 100644 --- a/src/serialization/types/V1GetSettlementRequest.ts +++ b/src/serialization/types/V1GetSettlementRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const V1GetSettlementRequest: core.serialization.Schema< serializers.V1GetSettlementRequest.Raw, diff --git a/src/serialization/types/V1Money.ts b/src/serialization/types/V1Money.ts index 64e581de5..f3b326f32 100644 --- a/src/serialization/types/V1Money.ts +++ b/src/serialization/types/V1Money.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Currency } from "./Currency"; export const V1Money: core.serialization.ObjectSchema = @@ -13,7 +15,7 @@ export const V1Money: core.serialization.ObjectSchema = core.serialization.object({ @@ -53,11 +55,11 @@ export const V1Order: core.serialization.ObjectSchema = core.serialization.enum_(["PENDING", "OPEN", "COMPLETED", "CANCELED", "REFUNDED", "REJECTED"]); diff --git a/src/serialization/types/V1Tender.ts b/src/serialization/types/V1Tender.ts index 16aad3e21..ad0144d56 100644 --- a/src/serialization/types/V1Tender.ts +++ b/src/serialization/types/V1Tender.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { V1Money } from "./V1Money"; +import { V1TenderType } from "./V1TenderType"; import { V1TenderCardBrand } from "./V1TenderCardBrand"; import { V1TenderEntryMethod } from "./V1TenderEntryMethod"; -import { V1TenderType } from "./V1TenderType"; +import { V1Money } from "./V1Money"; export const V1Tender: core.serialization.ObjectSchema = core.serialization.object({ @@ -32,19 +34,19 @@ export declare namespace V1Tender { export interface Raw { id?: string | null; type?: V1TenderType.Raw | null; - name?: (string | null | undefined) | null; - employee_id?: (string | null | undefined) | null; - receipt_url?: (string | null | undefined) | null; + name?: (string | null) | null; + employee_id?: (string | null) | null; + receipt_url?: (string | null) | null; card_brand?: V1TenderCardBrand.Raw | null; - pan_suffix?: (string | null | undefined) | null; + pan_suffix?: (string | null) | null; entry_method?: V1TenderEntryMethod.Raw | null; - payment_note?: (string | null | undefined) | null; + payment_note?: (string | null) | null; total_money?: V1Money.Raw | null; tendered_money?: V1Money.Raw | null; - tendered_at?: (string | null | undefined) | null; - settled_at?: (string | null | undefined) | null; + tendered_at?: (string | null) | null; + settled_at?: (string | null) | null; change_back_money?: V1Money.Raw | null; refunded_money?: V1Money.Raw | null; - is_exchange?: (boolean | null | undefined) | null; + is_exchange?: (boolean | null) | null; } } diff --git a/src/serialization/types/V1TenderCardBrand.ts b/src/serialization/types/V1TenderCardBrand.ts index 1b82e4c06..d66f19db3 100644 --- a/src/serialization/types/V1TenderCardBrand.ts +++ b/src/serialization/types/V1TenderCardBrand.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const V1TenderCardBrand: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/V1TenderEntryMethod.ts b/src/serialization/types/V1TenderEntryMethod.ts index 34973d7a1..86ee07d8e 100644 --- a/src/serialization/types/V1TenderEntryMethod.ts +++ b/src/serialization/types/V1TenderEntryMethod.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const V1TenderEntryMethod: core.serialization.Schema< serializers.V1TenderEntryMethod.Raw, diff --git a/src/serialization/types/V1TenderType.ts b/src/serialization/types/V1TenderType.ts index 9cd13caee..838d697b5 100644 --- a/src/serialization/types/V1TenderType.ts +++ b/src/serialization/types/V1TenderType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const V1TenderType: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/V1UpdateOrderRequestAction.ts b/src/serialization/types/V1UpdateOrderRequestAction.ts index 99b834d8d..34636e4f1 100644 --- a/src/serialization/types/V1UpdateOrderRequestAction.ts +++ b/src/serialization/types/V1UpdateOrderRequestAction.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const V1UpdateOrderRequestAction: core.serialization.Schema< serializers.V1UpdateOrderRequestAction.Raw, diff --git a/src/serialization/types/Vendor.ts b/src/serialization/types/Vendor.ts index 9d9bbde08..bc4e3d0ae 100644 --- a/src/serialization/types/Vendor.ts +++ b/src/serialization/types/Vendor.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Address } from "./Address"; import { VendorContact } from "./VendorContact"; import { VendorStatus } from "./VendorStatus"; @@ -27,11 +29,11 @@ export declare namespace Vendor { id?: string | null; created_at?: string | null; updated_at?: string | null; - name?: (string | null | undefined) | null; + name?: (string | null) | null; address?: Address.Raw | null; - contacts?: (VendorContact.Raw[] | null | undefined) | null; - account_number?: (string | null | undefined) | null; - note?: (string | null | undefined) | null; + contacts?: (VendorContact.Raw[] | null) | null; + account_number?: (string | null) | null; + note?: (string | null) | null; version?: number | null; status?: VendorStatus.Raw | null; } diff --git a/src/serialization/types/VendorContact.ts b/src/serialization/types/VendorContact.ts index a3073fe4a..3ff4ff0e3 100644 --- a/src/serialization/types/VendorContact.ts +++ b/src/serialization/types/VendorContact.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const VendorContact: core.serialization.ObjectSchema = core.serialization.object({ @@ -17,10 +19,10 @@ export const VendorContact: core.serialization.ObjectSchema = core.serialization.enum_(["ACTIVE", "INACTIVE"]); diff --git a/src/serialization/types/VendorUpdatedEvent.ts b/src/serialization/types/VendorUpdatedEvent.ts index 535d3173d..ad39c7951 100644 --- a/src/serialization/types/VendorUpdatedEvent.ts +++ b/src/serialization/types/VendorUpdatedEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { VendorUpdatedEventData } from "./VendorUpdatedEventData"; export const VendorUpdatedEvent: core.serialization.ObjectSchema< @@ -19,10 +21,10 @@ export const VendorUpdatedEvent: core.serialization.ObjectSchema< export declare namespace VendorUpdatedEvent { export interface Raw { - merchant_id?: (string | null | undefined) | null; - location_id?: (string | null | undefined) | null; - type?: (string | null | undefined) | null; - event_id?: (string | null | undefined) | null; + merchant_id?: (string | null) | null; + location_id?: (string | null) | null; + type?: (string | null) | null; + event_id?: (string | null) | null; created_at?: string | null; data?: VendorUpdatedEventData.Raw | null; } diff --git a/src/serialization/types/VendorUpdatedEventData.ts b/src/serialization/types/VendorUpdatedEventData.ts index 2462b9176..708e7f3eb 100644 --- a/src/serialization/types/VendorUpdatedEventData.ts +++ b/src/serialization/types/VendorUpdatedEventData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { VendorUpdatedEventObject } from "./VendorUpdatedEventObject"; export const VendorUpdatedEventData: core.serialization.ObjectSchema< @@ -16,7 +18,7 @@ export const VendorUpdatedEventData: core.serialization.ObjectSchema< export declare namespace VendorUpdatedEventData { export interface Raw { - type?: (string | null | undefined) | null; + type?: (string | null) | null; id?: string | null; object?: VendorUpdatedEventObject.Raw | null; } diff --git a/src/serialization/types/VendorUpdatedEventObject.ts b/src/serialization/types/VendorUpdatedEventObject.ts index e815750c3..f3df0ba59 100644 --- a/src/serialization/types/VendorUpdatedEventObject.ts +++ b/src/serialization/types/VendorUpdatedEventObject.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Vendor } from "./Vendor"; import { VendorUpdatedEventObjectOperation } from "./VendorUpdatedEventObjectOperation"; +import { Vendor } from "./Vendor"; export const VendorUpdatedEventObject: core.serialization.ObjectSchema< serializers.VendorUpdatedEventObject.Raw, diff --git a/src/serialization/types/VendorUpdatedEventObjectOperation.ts b/src/serialization/types/VendorUpdatedEventObjectOperation.ts index a3cd4881e..cbe3a8cae 100644 --- a/src/serialization/types/VendorUpdatedEventObjectOperation.ts +++ b/src/serialization/types/VendorUpdatedEventObjectOperation.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const VendorUpdatedEventObjectOperation: core.serialization.Schema< serializers.VendorUpdatedEventObjectOperation.Raw, diff --git a/src/serialization/types/VisibilityFilter.ts b/src/serialization/types/VisibilityFilter.ts index 41409c8fe..c0ff5cf9e 100644 --- a/src/serialization/types/VisibilityFilter.ts +++ b/src/serialization/types/VisibilityFilter.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const VisibilityFilter: core.serialization.Schema = core.serialization.enum_(["ALL", "READ", "READ_WRITE"]); diff --git a/src/serialization/types/VoidTransactionResponse.ts b/src/serialization/types/VoidTransactionResponse.ts index e9b2df70b..963f7b427 100644 --- a/src/serialization/types/VoidTransactionResponse.ts +++ b/src/serialization/types/VoidTransactionResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Error_ } from "./Error_"; export const VoidTransactionResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/types/WageSetting.ts b/src/serialization/types/WageSetting.ts index 65f284441..cc5b4dcd4 100644 --- a/src/serialization/types/WageSetting.ts +++ b/src/serialization/types/WageSetting.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { JobAssignment } from "./JobAssignment"; export const WageSetting: core.serialization.ObjectSchema = @@ -23,9 +25,9 @@ export const WageSetting: core.serialization.ObjectSchema = core.serialization.enum_([ "MON", diff --git a/src/serialization/types/WorkweekConfig.ts b/src/serialization/types/WorkweekConfig.ts index ceca08c05..e566ce1c1 100644 --- a/src/serialization/types/WorkweekConfig.ts +++ b/src/serialization/types/WorkweekConfig.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Square from "../../api/index"; +import * as serializers from "../index"; +import * as Square from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Weekday } from "./Weekday"; export const WorkweekConfig: core.serialization.ObjectSchema = diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 7b318b1af..38e2271b2 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -1,7 +1,7 @@ +export * from "./AchDetails"; export * from "./AcceptDisputeResponse"; export * from "./AcceptedPaymentMethods"; export * from "./AccumulateLoyaltyPointsResponse"; -export * from "./AchDetails"; export * from "./ActionCancelReason"; export * from "./ActivityType"; export * from "./AddGroupToCustomerResponse"; @@ -30,22 +30,14 @@ export * from "./BankAccountVerifiedEventData"; export * from "./BankAccountVerifiedEventObject"; export * from "./BatchChangeInventoryRequest"; export * from "./BatchChangeInventoryResponse"; -export * from "./BatchCreateTeamMembersResponse"; -export * from "./BatchCreateVendorsResponse"; export * from "./BatchDeleteCatalogObjectsResponse"; export * from "./BatchGetCatalogObjectsResponse"; +export * from "./BatchRetrieveInventoryChangesRequest"; export * from "./BatchGetInventoryChangesResponse"; export * from "./BatchGetInventoryCountsRequest"; export * from "./BatchGetInventoryCountsResponse"; export * from "./BatchGetOrdersResponse"; -export * from "./BatchGetVendorsResponse"; -export * from "./BatchRetrieveInventoryChangesRequest"; -export * from "./BatchUpdateTeamMembersResponse"; -export * from "./BatchUpdateVendorsResponse"; export * from "./BatchUpsertCatalogObjectsResponse"; -export * from "./BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest"; -export * from "./BatchUpsertCustomerCustomAttributesResponse"; -export * from "./BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse"; export * from "./Booking"; export * from "./BookingBookingSource"; export * from "./BookingCreatedEvent"; @@ -75,6 +67,8 @@ export * from "./Break"; export * from "./BreakType"; export * from "./BulkCreateCustomerData"; export * from "./BulkCreateCustomersResponse"; +export * from "./BatchCreateTeamMembersResponse"; +export * from "./BatchCreateVendorsResponse"; export * from "./BulkDeleteBookingCustomAttributesResponse"; export * from "./BulkDeleteCustomersResponse"; export * from "./BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest"; @@ -88,14 +82,18 @@ export * from "./BulkDeleteOrderCustomAttributesResponse"; export * from "./BulkPublishScheduledShiftsData"; export * from "./BulkPublishScheduledShiftsResponse"; export * from "./BulkRetrieveBookingsResponse"; -export * from "./BulkRetrieveChannelsRequestConstants"; -export * from "./BulkRetrieveChannelsResponse"; export * from "./BulkRetrieveCustomersResponse"; export * from "./BulkRetrieveTeamMemberBookingProfilesResponse"; +export * from "./BatchGetVendorsResponse"; export * from "./BulkSwapPlanResponse"; export * from "./BulkUpdateCustomerData"; export * from "./BulkUpdateCustomersResponse"; +export * from "./BatchUpdateTeamMembersResponse"; +export * from "./BatchUpdateVendorsResponse"; export * from "./BulkUpsertBookingCustomAttributesResponse"; +export * from "./BatchUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest"; +export * from "./BatchUpsertCustomerCustomAttributesResponse"; +export * from "./BatchUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse"; export * from "./BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest"; export * from "./BulkUpsertLocationCustomAttributesResponse"; export * from "./BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse"; @@ -126,7 +124,6 @@ export * from "./CancelSubscriptionResponse"; export * from "./CancelTerminalActionResponse"; export * from "./CancelTerminalCheckoutResponse"; export * from "./CancelTerminalRefundResponse"; -export * from "./CancelTransferOrderResponse"; export * from "./CaptureTransactionResponse"; export * from "./Card"; export * from "./CardAutomaticallyUpdatedEvent"; @@ -201,47 +198,28 @@ export * from "./CatalogModifierListModifierType"; export * from "./CatalogModifierListSelectionType"; export * from "./CatalogModifierOverride"; export * from "./CatalogObject"; -export * from "./CatalogObjectAvailabilityPeriod"; -export * from "./CatalogObjectBase"; export * from "./CatalogObjectBatch"; export * from "./CatalogObjectCategory"; -export * from "./CatalogObjectCustomAttributeDefinition"; -export * from "./CatalogObjectDiscount"; -export * from "./CatalogObjectImage"; -export * from "./CatalogObjectItem"; -export * from "./CatalogObjectItemOption"; -export * from "./CatalogObjectItemOptionValue"; -export * from "./CatalogObjectItemVariation"; -export * from "./CatalogObjectMeasurementUnit"; -export * from "./CatalogObjectModifier"; -export * from "./CatalogObjectModifierList"; -export * from "./CatalogObjectPricingRule"; -export * from "./CatalogObjectProductSet"; -export * from "./CatalogObjectQuickAmountsSettings"; export * from "./CatalogObjectReference"; -export * from "./CatalogObjectSubscriptionPlan"; -export * from "./CatalogObjectSubscriptionPlanVariation"; -export * from "./CatalogObjectTax"; -export * from "./CatalogObjectTimePeriod"; export * from "./CatalogObjectType"; export * from "./CatalogPricingRule"; export * from "./CatalogPricingType"; export * from "./CatalogProductSet"; export * from "./CatalogQuery"; export * from "./CatalogQueryExact"; +export * from "./CatalogQueryItemVariationsForItemOptionValues"; export * from "./CatalogQueryItemsForItemOptions"; export * from "./CatalogQueryItemsForModifierList"; export * from "./CatalogQueryItemsForTax"; -export * from "./CatalogQueryItemVariationsForItemOptionValues"; export * from "./CatalogQueryPrefix"; export * from "./CatalogQueryRange"; export * from "./CatalogQuerySet"; export * from "./CatalogQuerySortedAttribute"; export * from "./CatalogQueryText"; export * from "./CatalogQuickAmount"; +export * from "./CatalogQuickAmountType"; export * from "./CatalogQuickAmountsSettings"; export * from "./CatalogQuickAmountsSettingsOption"; -export * from "./CatalogQuickAmountType"; export * from "./CatalogStockConversion"; export * from "./CatalogSubscriptionPlan"; export * from "./CatalogSubscriptionPlanVariation"; @@ -255,8 +233,6 @@ export * from "./CatalogVersionUpdatedEventObject"; export * from "./CategoryPathToRootNode"; export * from "./ChangeBillingAnchorDateResponse"; export * from "./ChangeTiming"; -export * from "./Channel"; -export * from "./ChannelStatus"; export * from "./ChargeRequestAdditionalRecipient"; export * from "./Checkout"; export * from "./CheckoutLocationSettings"; @@ -325,9 +301,6 @@ export * from "./CreateTerminalActionResponse"; export * from "./CreateTerminalCheckoutResponse"; export * from "./CreateTerminalRefundResponse"; export * from "./CreateTimecardResponse"; -export * from "./CreateTransferOrderData"; -export * from "./CreateTransferOrderLineData"; -export * from "./CreateTransferOrderResponse"; export * from "./CreateVendorResponse"; export * from "./CreateWebhookSubscriptionResponse"; export * from "./Currency"; @@ -339,6 +312,7 @@ export * from "./CustomAttributeDefinitionVisibility"; export * from "./CustomAttributeEventData"; export * from "./CustomAttributeEventDataObject"; export * from "./CustomAttributeFilter"; +export * from "./CustomField"; export * from "./Customer"; export * from "./CustomerAddressFilter"; export * from "./CustomerCreatedEvent"; @@ -363,8 +337,8 @@ export * from "./CustomerCustomAttributeDefinitionVisibleUpdatedEvent"; export * from "./CustomerCustomAttributeDeletedEvent"; export * from "./CustomerCustomAttributeDeletedPublicEvent"; export * from "./CustomerCustomAttributeFilter"; -export * from "./CustomerCustomAttributeFilters"; export * from "./CustomerCustomAttributeFilterValue"; +export * from "./CustomerCustomAttributeFilters"; export * from "./CustomerCustomAttributeOwnedDeletedEvent"; export * from "./CustomerCustomAttributeOwnedUpdatedEvent"; export * from "./CustomerCustomAttributeUpdatedEvent"; @@ -390,7 +364,6 @@ export * from "./CustomerTextFilter"; export * from "./CustomerUpdatedEvent"; export * from "./CustomerUpdatedEventData"; export * from "./CustomerUpdatedEventObject"; -export * from "./CustomField"; export * from "./DataCollectionOptions"; export * from "./DataCollectionOptionsInputType"; export * from "./DateRange"; @@ -419,7 +392,6 @@ export * from "./DeleteShiftResponse"; export * from "./DeleteSnippetResponse"; export * from "./DeleteSubscriptionActionResponse"; export * from "./DeleteTimecardResponse"; -export * from "./DeleteTransferOrderResponse"; export * from "./DeleteWebhookSubscriptionResponse"; export * from "./Destination"; export * from "./DestinationDetails"; @@ -460,7 +432,6 @@ export * from "./Dispute"; export * from "./DisputeCreatedEvent"; export * from "./DisputeCreatedEventData"; export * from "./DisputeCreatedEventObject"; -export * from "./DisputedPayment"; export * from "./DisputeEvidence"; export * from "./DisputeEvidenceAddedEvent"; export * from "./DisputeEvidenceAddedEventData"; @@ -484,6 +455,7 @@ export * from "./DisputeStateChangedEventObject"; export * from "./DisputeStateUpdatedEvent"; export * from "./DisputeStateUpdatedEventData"; export * from "./DisputeStateUpdatedEventObject"; +export * from "./DisputedPayment"; export * from "./EcomVisibility"; export * from "./Employee"; export * from "./EmployeeStatus"; @@ -514,84 +486,19 @@ export * from "./FulfillmentState"; export * from "./FulfillmentType"; export * from "./GetBankAccountByV1IdResponse"; export * from "./GetBankAccountResponse"; -export * from "./GetBookingRequest"; -export * from "./GetBookingResponse"; export * from "./GetBreakTypeResponse"; -export * from "./GetBusinessBookingProfileRequest"; -export * from "./GetBusinessBookingProfileResponse"; -export * from "./GetCardRequest"; -export * from "./GetCardResponse"; -export * from "./GetCashDrawerShiftResponse"; -export * from "./GetCatalogObjectResponse"; -export * from "./GetCustomerCustomAttributeDefinitionResponse"; -export * from "./GetCustomerCustomAttributeResponse"; -export * from "./GetCustomerGroupRequest"; -export * from "./GetCustomerGroupResponse"; -export * from "./GetCustomerRequest"; -export * from "./GetCustomerResponse"; -export * from "./GetCustomerSegmentRequest"; -export * from "./GetCustomerSegmentResponse"; export * from "./GetDeviceCodeResponse"; export * from "./GetDeviceResponse"; -export * from "./GetDisputeEvidenceRequest"; -export * from "./GetDisputeEvidenceResponse"; -export * from "./GetDisputeRequest"; -export * from "./GetDisputeResponse"; -export * from "./GetEmployeeRequest"; -export * from "./GetEmployeeResponse"; export * from "./GetEmployeeWageResponse"; -export * from "./GetGiftCardFromGanResponse"; -export * from "./GetGiftCardFromNonceResponse"; -export * from "./GetGiftCardRequest"; -export * from "./GetGiftCardResponse"; -export * from "./GetInventoryAdjustmentRequest"; -export * from "./GetInventoryAdjustmentResponse"; -export * from "./GetInventoryChangesResponse"; -export * from "./GetInventoryCountResponse"; -export * from "./GetInventoryPhysicalCountRequest"; -export * from "./GetInventoryPhysicalCountResponse"; -export * from "./GetInventoryTransferRequest"; -export * from "./GetInventoryTransferResponse"; export * from "./GetInvoiceResponse"; -export * from "./GetLocationRequest"; -export * from "./GetLocationResponse"; -export * from "./GetLoyaltyAccountRequest"; -export * from "./GetLoyaltyAccountResponse"; -export * from "./GetLoyaltyProgramRequest"; -export * from "./GetLoyaltyProgramResponse"; -export * from "./GetLoyaltyPromotionRequest"; -export * from "./GetLoyaltyPromotionResponse"; -export * from "./GetLoyaltyRewardRequest"; -export * from "./GetLoyaltyRewardResponse"; -export * from "./GetMerchantRequest"; -export * from "./GetMerchantResponse"; -export * from "./GetOrderRequest"; -export * from "./GetOrderResponse"; -export * from "./GetPaymentLinkRequest"; -export * from "./GetPaymentLinkResponse"; export * from "./GetPaymentRefundResponse"; export * from "./GetPaymentResponse"; export * from "./GetPayoutResponse"; export * from "./GetShiftResponse"; -export * from "./GetSnippetRequest"; -export * from "./GetSnippetResponse"; -export * from "./GetSubscriptionResponse"; -export * from "./GetTeamMemberBookingProfileRequest"; -export * from "./GetTeamMemberBookingProfileResponse"; -export * from "./GetTeamMemberRequest"; -export * from "./GetTeamMemberResponse"; export * from "./GetTeamMemberWageResponse"; export * from "./GetTerminalActionResponse"; export * from "./GetTerminalCheckoutResponse"; export * from "./GetTerminalRefundResponse"; -export * from "./GetTransactionRequest"; -export * from "./GetTransactionResponse"; -export * from "./GetVendorRequest"; -export * from "./GetVendorResponse"; -export * from "./GetWageSettingRequest"; -export * from "./GetWageSettingResponse"; -export * from "./GetWebhookSubscriptionRequest"; -export * from "./GetWebhookSubscriptionResponse"; export * from "./GiftCard"; export * from "./GiftCardActivity"; export * from "./GiftCardActivityActivate"; @@ -739,8 +646,6 @@ export * from "./ListCardsResponse"; export * from "./ListCashDrawerShiftEventsResponse"; export * from "./ListCashDrawerShiftsResponse"; export * from "./ListCatalogResponse"; -export * from "./ListChannelsRequestConstants"; -export * from "./ListChannelsResponse"; export * from "./ListCustomerCustomAttributeDefinitionsResponse"; export * from "./ListCustomerCustomAttributesResponse"; export * from "./ListCustomerGroupsResponse"; @@ -750,8 +655,8 @@ export * from "./ListDeviceCodesResponse"; export * from "./ListDevicesResponse"; export * from "./ListDisputeEvidenceResponse"; export * from "./ListDisputesResponse"; -export * from "./ListEmployeesResponse"; export * from "./ListEmployeeWagesResponse"; +export * from "./ListEmployeesResponse"; export * from "./ListEventTypesResponse"; export * from "./ListGiftCardActivitiesResponse"; export * from "./ListGiftCardsResponse"; @@ -822,10 +727,10 @@ export * from "./LoyaltyEvent"; export * from "./LoyaltyEventAccumulatePoints"; export * from "./LoyaltyEventAccumulatePromotionPoints"; export * from "./LoyaltyEventAdjustPoints"; +export * from "./LoyaltyEventCreateReward"; export * from "./LoyaltyEventCreatedEvent"; export * from "./LoyaltyEventCreatedEventData"; export * from "./LoyaltyEventCreatedEventObject"; -export * from "./LoyaltyEventCreateReward"; export * from "./LoyaltyEventDateTimeFilter"; export * from "./LoyaltyEventDeleteReward"; export * from "./LoyaltyEventExpirePoints"; @@ -972,6 +877,7 @@ export * from "./OrderUpdatedEvent"; export * from "./OrderUpdatedEventData"; export * from "./OrderUpdatedObject"; export * from "./PauseSubscriptionResponse"; +export * from "./PayOrderResponse"; export * from "./Payment"; export * from "./PaymentBalanceActivityAppFeeRefundDetail"; export * from "./PaymentBalanceActivityAppFeeRevenueDetail"; @@ -1009,7 +915,6 @@ export * from "./PaymentRefund"; export * from "./PaymentUpdatedEvent"; export * from "./PaymentUpdatedEventData"; export * from "./PaymentUpdatedEventObject"; -export * from "./PayOrderResponse"; export * from "./Payout"; export * from "./PayoutEntry"; export * from "./PayoutFailedEvent"; @@ -1037,10 +942,7 @@ export * from "./QrCodeOptions"; export * from "./QuickPay"; export * from "./Range"; export * from "./ReceiptOptions"; -export * from "./ReceiveTransferOrderResponse"; export * from "./RedeemLoyaltyRewardResponse"; -export * from "./Reference"; -export * from "./ReferenceType"; export * from "./Refund"; export * from "./RefundCreatedEvent"; export * from "./RefundCreatedEventData"; @@ -1056,21 +958,56 @@ export * from "./RemoveGroupFromCustomerResponse"; export * from "./ResumeSubscriptionResponse"; export * from "./RetrieveBookingCustomAttributeDefinitionResponse"; export * from "./RetrieveBookingCustomAttributeResponse"; -export * from "./RetrieveChannelResponse"; +export * from "./GetBookingResponse"; +export * from "./GetBusinessBookingProfileResponse"; +export * from "./GetCardResponse"; +export * from "./GetCashDrawerShiftResponse"; +export * from "./GetCatalogObjectResponse"; +export * from "./GetCustomerCustomAttributeDefinitionResponse"; +export * from "./GetCustomerCustomAttributeResponse"; +export * from "./GetCustomerGroupResponse"; +export * from "./GetCustomerResponse"; +export * from "./GetCustomerSegmentResponse"; +export * from "./GetDisputeEvidenceResponse"; +export * from "./GetDisputeResponse"; +export * from "./GetEmployeeResponse"; +export * from "./GetGiftCardFromGanResponse"; +export * from "./GetGiftCardFromNonceResponse"; +export * from "./GetGiftCardResponse"; +export * from "./GetInventoryAdjustmentResponse"; +export * from "./GetInventoryChangesResponse"; +export * from "./GetInventoryCountResponse"; +export * from "./GetInventoryPhysicalCountResponse"; +export * from "./GetInventoryTransferResponse"; export * from "./RetrieveJobResponse"; export * from "./RetrieveLocationBookingProfileResponse"; export * from "./RetrieveLocationCustomAttributeDefinitionResponse"; export * from "./RetrieveLocationCustomAttributeResponse"; +export * from "./GetLocationResponse"; export * from "./RetrieveLocationSettingsResponse"; +export * from "./GetLoyaltyAccountResponse"; +export * from "./GetLoyaltyProgramResponse"; +export * from "./GetLoyaltyPromotionResponse"; +export * from "./GetLoyaltyRewardResponse"; export * from "./RetrieveMerchantCustomAttributeDefinitionResponse"; export * from "./RetrieveMerchantCustomAttributeResponse"; +export * from "./GetMerchantResponse"; export * from "./RetrieveMerchantSettingsResponse"; export * from "./RetrieveOrderCustomAttributeDefinitionResponse"; export * from "./RetrieveOrderCustomAttributeResponse"; +export * from "./GetOrderResponse"; +export * from "./GetPaymentLinkResponse"; export * from "./RetrieveScheduledShiftResponse"; +export * from "./GetSnippetResponse"; +export * from "./GetSubscriptionResponse"; +export * from "./GetTeamMemberBookingProfileResponse"; +export * from "./GetTeamMemberResponse"; export * from "./RetrieveTimecardResponse"; export * from "./RetrieveTokenStatusResponse"; -export * from "./RetrieveTransferOrderResponse"; +export * from "./GetTransactionResponse"; +export * from "./GetVendorResponse"; +export * from "./GetWageSettingResponse"; +export * from "./GetWebhookSubscriptionResponse"; export * from "./RevokeTokenResponse"; export * from "./RiskEvaluation"; export * from "./RiskEvaluationRiskLevel"; @@ -1126,7 +1063,6 @@ export * from "./SearchTerminalActionsResponse"; export * from "./SearchTerminalCheckoutsResponse"; export * from "./SearchTerminalRefundsResponse"; export * from "./SearchTimecardsResponse"; -export * from "./SearchTransferOrdersResponse"; export * from "./SearchVendorsRequestFilter"; export * from "./SearchVendorsRequestSort"; export * from "./SearchVendorsRequestSortField"; @@ -1154,7 +1090,6 @@ export * from "./SourceApplication"; export * from "./SquareAccountDetails"; export * from "./StandardUnitDescription"; export * from "./StandardUnitDescriptionGroup"; -export * from "./StartTransferOrderResponse"; export * from "./SubmitEvidenceResponse"; export * from "./Subscription"; export * from "./SubscriptionAction"; @@ -1241,6 +1176,7 @@ export * from "./TerminalRefundUpdatedEvent"; export * from "./TerminalRefundUpdatedEventData"; export * from "./TerminalRefundUpdatedEventObject"; export * from "./TestWebhookSubscriptionResponse"; +export * from "./TimeRange"; export * from "./Timecard"; export * from "./TimecardFilter"; export * from "./TimecardFilterStatus"; @@ -1251,28 +1187,10 @@ export * from "./TimecardStatus"; export * from "./TimecardWage"; export * from "./TimecardWorkday"; export * from "./TimecardWorkdayMatcher"; -export * from "./TimeRange"; export * from "./TipSettings"; export * from "./Transaction"; export * from "./TransactionProduct"; export * from "./TransactionType"; -export * from "./TransferOrder"; -export * from "./TransferOrderCreatedEvent"; -export * from "./TransferOrderCreatedEventData"; -export * from "./TransferOrderCreatedEventObject"; -export * from "./TransferOrderDeletedEvent"; -export * from "./TransferOrderDeletedEventData"; -export * from "./TransferOrderFilter"; -export * from "./TransferOrderGoodsReceipt"; -export * from "./TransferOrderGoodsReceiptLineItem"; -export * from "./TransferOrderLine"; -export * from "./TransferOrderQuery"; -export * from "./TransferOrderSort"; -export * from "./TransferOrderSortField"; -export * from "./TransferOrderStatus"; -export * from "./TransferOrderUpdatedEvent"; -export * from "./TransferOrderUpdatedEventData"; -export * from "./TransferOrderUpdatedEventObject"; export * from "./UnlinkCustomerFromGiftCardResponse"; export * from "./UpdateBookingCustomAttributeDefinitionResponse"; export * from "./UpdateBookingResponse"; @@ -1301,9 +1219,6 @@ export * from "./UpdateSubscriptionResponse"; export * from "./UpdateTeamMemberRequest"; export * from "./UpdateTeamMemberResponse"; export * from "./UpdateTimecardResponse"; -export * from "./UpdateTransferOrderData"; -export * from "./UpdateTransferOrderLineData"; -export * from "./UpdateTransferOrderResponse"; export * from "./UpdateVendorRequest"; export * from "./UpdateVendorResponse"; export * from "./UpdateWageSettingResponse"; @@ -1317,8 +1232,6 @@ export * from "./UpsertLocationCustomAttributeResponse"; export * from "./UpsertMerchantCustomAttributeResponse"; export * from "./UpsertOrderCustomAttributeResponse"; export * from "./UpsertSnippetResponse"; -export * from "./V1GetPaymentRequest"; -export * from "./V1GetSettlementRequest"; export * from "./V1Money"; export * from "./V1Order"; export * from "./V1OrderHistoryEntry"; @@ -1346,3 +1259,52 @@ export * from "./WageSetting"; export * from "./WebhookSubscription"; export * from "./Weekday"; export * from "./WorkweekConfig"; +export * from "./CatalogObjectBase"; +export * from "./CatalogObjectItem"; +export * from "./CatalogObjectImage"; +export * from "./CatalogObjectItemVariation"; +export * from "./CatalogObjectTax"; +export * from "./CatalogObjectDiscount"; +export * from "./CatalogObjectModifierList"; +export * from "./CatalogObjectModifier"; +export * from "./CatalogObjectPricingRule"; +export * from "./CatalogObjectProductSet"; +export * from "./CatalogObjectTimePeriod"; +export * from "./CatalogObjectMeasurementUnit"; +export * from "./CatalogObjectSubscriptionPlanVariation"; +export * from "./CatalogObjectItemOption"; +export * from "./CatalogObjectItemOptionValue"; +export * from "./CatalogObjectCustomAttributeDefinition"; +export * from "./CatalogObjectQuickAmountsSettings"; +export * from "./CatalogObjectSubscriptionPlan"; +export * from "./CatalogObjectAvailabilityPeriod"; +export * from "./GetLoyaltyAccountRequest"; +export * from "./GetLoyaltyProgramRequest"; +export * from "./GetLoyaltyPromotionRequest"; +export * from "./GetLoyaltyRewardRequest"; +export * from "./GetCardRequest"; +export * from "./GetDisputeEvidenceRequest"; +export * from "./GetDisputeRequest"; +export * from "./V1GetPaymentRequest"; +export * from "./V1GetSettlementRequest"; +export * from "./GetCustomerGroupRequest"; +export * from "./GetCustomerRequest"; +export * from "./GetCustomerSegmentRequest"; +export * from "./GetTransactionRequest"; +export * from "./GetBookingRequest"; +export * from "./GetBusinessBookingProfileRequest"; +export * from "./GetTeamMemberBookingProfileRequest"; +export * from "./GetSnippetRequest"; +export * from "./GetInventoryAdjustmentRequest"; +export * from "./GetInventoryPhysicalCountRequest"; +export * from "./GetInventoryTransferRequest"; +export * from "./GetVendorRequest"; +export * from "./GetPaymentLinkRequest"; +export * from "./GetGiftCardRequest"; +export * from "./GetOrderRequest"; +export * from "./GetEmployeeRequest"; +export * from "./GetLocationRequest"; +export * from "./GetMerchantRequest"; +export * from "./GetTeamMemberRequest"; +export * from "./GetWageSettingRequest"; +export * from "./GetWebhookSubscriptionRequest"; diff --git a/src/version.ts b/src/version.ts index a6cd8df95..8db39c694 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "43.2.1"; +export const SDK_VERSION = "43.2.2"; diff --git a/tests/BrowserTestEnvironment.ts b/tests/BrowserTestEnvironment.ts new file mode 100644 index 000000000..0f32bf7b0 --- /dev/null +++ b/tests/BrowserTestEnvironment.ts @@ -0,0 +1,17 @@ +import { TestEnvironment } from "jest-environment-jsdom"; + +class BrowserTestEnvironment extends TestEnvironment { + async setup() { + await super.setup(); + this.global.Request = Request; + this.global.Response = Response; + this.global.ReadableStream = ReadableStream; + this.global.TextEncoder = TextEncoder; + this.global.TextDecoder = TextDecoder; + this.global.FormData = FormData; + this.global.File = File; + this.global.Blob = Blob; + } +} + +export default BrowserTestEnvironment; diff --git a/tests/bigint.setup.ts b/tests/bigint.setup.ts index abdfd3eda..d03d34f21 100644 --- a/tests/bigint.setup.ts +++ b/tests/bigint.setup.ts @@ -9,3 +9,5 @@ expect.addEqualityTesters([ return undefined; }, ]); + +export {}; diff --git a/tests/mock-server/MockServer.ts b/tests/mock-server/MockServer.ts index 954872157..6e258f172 100644 --- a/tests/mock-server/MockServer.ts +++ b/tests/mock-server/MockServer.ts @@ -1,4 +1,4 @@ -import type { RequestHandlerOptions } from "msw"; +import { RequestHandlerOptions } from "msw"; import type { SetupServer } from "msw/node"; import { mockEndpointBuilder } from "./mockEndpointBuilder"; @@ -19,7 +19,7 @@ export class MockServer { public mockEndpoint(options?: RequestHandlerOptions): ReturnType { const builder = mockEndpointBuilder({ - once: options?.once ?? true, + once: options?.once, onBuild: (handler) => { this.server.use(handler); }, diff --git a/tests/mock-server/MockServerPool.ts b/tests/mock-server/MockServerPool.ts index e1a90f7fb..81608069e 100644 --- a/tests/mock-server/MockServerPool.ts +++ b/tests/mock-server/MockServerPool.ts @@ -22,7 +22,7 @@ async function formatHttpRequest(request: Request, id?: string): Promise } else if (clone.body) { body = await clone.text(); } - } catch (_e) { + } catch (e) { body = "(unable to parse body)"; } @@ -48,7 +48,7 @@ async function formatHttpResponse(response: Response, id?: string): Promise { const formattedRequest = await formatHttpRequest(request, requestId); - console.debug(`request:start\n${formattedRequest}`); + console.debug("request:start\n" + formattedRequest); }); mswServer.events.on("request:unhandled", async ({ request, requestId }) => { const formattedRequest = await formatHttpRequest(request, requestId); - console.debug(`request:unhandled\n${formattedRequest}`); + console.debug("request:unhandled\n" + formattedRequest); }); mswServer.events.on("response:mocked", async ({ request, response, requestId }) => { const formattedResponse = await formatHttpResponse(response, requestId); - console.debug(`response:mocked\n${formattedResponse}`); + console.debug("response:mocked\n" + formattedResponse); }); } } diff --git a/tests/mock-server/mockEndpointBuilder.ts b/tests/mock-server/mockEndpointBuilder.ts index 1b0e51079..390b22568 100644 --- a/tests/mock-server/mockEndpointBuilder.ts +++ b/tests/mock-server/mockEndpointBuilder.ts @@ -1,8 +1,6 @@ -import { type DefaultBodyType, type HttpHandler, HttpResponse, type HttpResponseResolver, http } from "msw"; +import { DefaultBodyType, HttpHandler, HttpResponse, HttpResponseResolver, http } from "msw"; -import { url } from "../../src/core"; import { toJson } from "../../src/core/json"; -import { withFormUrlEncoded } from "./withFormUrlEncoded"; import { withHeaders } from "./withHeaders"; import { withJson } from "./withJson"; @@ -27,7 +25,6 @@ interface RequestHeadersStage extends RequestBodyStage, ResponseStage { interface RequestBodyStage extends ResponseStage { jsonBody(body: unknown): ResponseStage; - formUrlEncodedBody(body: unknown): ResponseStage; } interface ResponseStage { @@ -130,35 +127,28 @@ class RequestBuilder implements MethodStage, RequestHeadersStage, RequestBodySta } jsonBody(body: unknown): ResponseStage { - if (body === undefined) { - throw new Error("Undefined is not valid JSON. Do not call jsonBody if you want an empty body."); - } this.predicates.push((resolver) => withJson(body, resolver)); return this; } - formUrlEncodedBody(body: unknown): ResponseStage { - if (body === undefined) { - throw new Error( - "Undefined is not valid for form-urlencoded. Do not call formUrlEncodedBody if you want an empty body.", - ); - } - this.predicates.push((resolver) => withFormUrlEncoded(body, resolver)); - return this; - } - respondWith(): ResponseStatusStage { - return new ResponseBuilder(this.method, this.buildUrl(), this.predicates, this.handlerOptions); + return new ResponseBuilder(this.method, this.buildPath(), this.predicates, this.handlerOptions); } - private buildUrl(): string { - return url.join(this._baseUrl, this.path); + private buildPath(): string { + if (this._baseUrl.endsWith("/") && this.path.startsWith("/")) { + return this._baseUrl + this.path.slice(1); + } + if (!this._baseUrl.endsWith("/") && !this.path.startsWith("/")) { + return this._baseUrl + "/" + this.path; + } + return this._baseUrl + this.path; } } class ResponseBuilder implements ResponseStatusStage, ResponseHeaderStage, ResponseBodyStage, BuildStage { private readonly method: HttpMethod; - private readonly url: string; + private readonly path: string; private readonly requestPredicates: ((resolver: HttpResponseResolver) => HttpResponseResolver)[]; private readonly handlerOptions?: HttpHandlerBuilderOptions; @@ -168,12 +158,12 @@ class ResponseBuilder implements ResponseStatusStage, ResponseHeaderStage, Respo constructor( method: HttpMethod, - url: string, + path: string, requestPredicates: ((resolver: HttpResponseResolver) => HttpResponseResolver)[], options?: HttpHandlerBuilderOptions, ) { this.method = method; - this.url = url; + this.path = path; this.requestPredicates = requestPredicates; this.handlerOptions = options; } @@ -194,29 +184,21 @@ class ResponseBuilder implements ResponseStatusStage, ResponseHeaderStage, Respo } public jsonBody(body: unknown): BuildStage { - if (body === undefined) { - throw new Error("Undefined is not valid JSON. Do not call jsonBody if you expect an empty body."); - } this.responseBody = toJson(body); return this; } public build(): HttpHandler { const responseResolver: HttpResponseResolver = () => { - const response = new HttpResponse(this.responseBody, { + return new HttpResponse(this.responseBody, { status: this.responseStatusCode, headers: this.responseHeaders, }); - // if no Content-Type header is set, delete the default text content type that is set - if (Object.keys(this.responseHeaders).some((key) => key.toLowerCase() === "content-type") === false) { - response.headers.delete("Content-Type"); - } - return response; }; const finalResolver = this.requestPredicates.reduceRight((acc, predicate) => predicate(acc), responseResolver); - const handler = http[this.method](this.url, finalResolver, this.handlerOptions); + const handler = http[this.method](this.path, finalResolver, this.handlerOptions); this.handlerOptions?.onBuild?.(handler); return handler; } diff --git a/tests/mock-server/withFormUrlEncoded.ts b/tests/mock-server/withFormUrlEncoded.ts deleted file mode 100644 index e9e6ff2d9..000000000 --- a/tests/mock-server/withFormUrlEncoded.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { type HttpResponseResolver, passthrough } from "msw"; - -import { toJson } from "../../src/core/json"; - -/** - * Creates a request matcher that validates if the request form-urlencoded body exactly matches the expected object - * @param expectedBody - The exact body object to match against - * @param resolver - Response resolver to execute if body matches - */ -export function withFormUrlEncoded(expectedBody: unknown, resolver: HttpResponseResolver): HttpResponseResolver { - return async (args) => { - const { request } = args; - - let clonedRequest: Request; - let bodyText: string | undefined; - let actualBody: Record; - try { - clonedRequest = request.clone(); - bodyText = await clonedRequest.text(); - if (bodyText === "") { - console.error("Request body is empty, expected a form-urlencoded body."); - return passthrough(); - } - const params = new URLSearchParams(bodyText); - actualBody = {}; - for (const [key, value] of params.entries()) { - actualBody[key] = value; - } - } catch (error) { - console.error(`Error processing form-urlencoded request body:\n\tError: ${error}\n\tBody: ${bodyText}`); - return passthrough(); - } - - const mismatches = findMismatches(actualBody, expectedBody); - if (Object.keys(mismatches).length > 0) { - console.error("Form-urlencoded body mismatch:", toJson(mismatches, undefined, 2)); - return passthrough(); - } - - return resolver(args); - }; -} - -function findMismatches(actual: any, expected: any): Record { - const mismatches: Record = {}; - - if (typeof actual !== typeof expected) { - return { value: { actual, expected } }; - } - - if (typeof actual !== "object" || actual === null || expected === null) { - if (actual !== expected) { - return { value: { actual, expected } }; - } - return {}; - } - - const actualKeys = Object.keys(actual); - const expectedKeys = Object.keys(expected); - - const allKeys = new Set([...actualKeys, ...expectedKeys]); - - for (const key of allKeys) { - if (!expectedKeys.includes(key)) { - if (actual[key] === undefined) { - continue; - } - mismatches[key] = { actual: actual[key], expected: undefined }; - } else if (!actualKeys.includes(key)) { - if (expected[key] === undefined) { - continue; - } - mismatches[key] = { actual: undefined, expected: expected[key] }; - } else if (actual[key] !== expected[key]) { - mismatches[key] = { actual: actual[key], expected: expected[key] }; - } - } - - return mismatches; -} diff --git a/tests/mock-server/withHeaders.ts b/tests/mock-server/withHeaders.ts index 6599d2b4a..e77c837d9 100644 --- a/tests/mock-server/withHeaders.ts +++ b/tests/mock-server/withHeaders.ts @@ -1,4 +1,4 @@ -import { type HttpResponseResolver, passthrough } from "msw"; +import { HttpResponseResolver, passthrough } from "msw"; /** * Creates a request matcher that validates if request headers match specified criteria diff --git a/tests/mock-server/withJson.ts b/tests/mock-server/withJson.ts index b627638b0..44e3eb832 100644 --- a/tests/mock-server/withJson.ts +++ b/tests/mock-server/withJson.ts @@ -1,4 +1,4 @@ -import { type HttpResponseResolver, passthrough } from "msw"; +import { HttpResponseResolver, passthrough } from "msw"; import { fromJson, toJson } from "../../src/core/json"; @@ -12,23 +12,17 @@ export function withJson(expectedBody: unknown, resolver: HttpResponseResolver): const { request } = args; let clonedRequest: Request; - let bodyText: string | undefined; let actualBody: unknown; try { clonedRequest = request.clone(); - bodyText = await clonedRequest.text(); - if (bodyText === "") { - console.error("Request body is empty, expected a JSON object."); - return passthrough(); - } - actualBody = fromJson(bodyText); + actualBody = fromJson(await clonedRequest.text()); } catch (error) { - console.error(`Error processing request body:\n\tError: ${error}\n\tBody: ${bodyText}`); + console.error("Error processing request body:", error); return passthrough(); } const mismatches = findMismatches(actualBody, expectedBody); - if (Object.keys(mismatches).filter((key) => !key.startsWith("pagination.")).length > 0) { + if (Object.keys(mismatches).length > 0) { console.error("JSON body mismatch:", toJson(mismatches, undefined, 2)); return passthrough(); } @@ -67,7 +61,7 @@ function findMismatches(actual: any, expected: any): Record 0) { for (const [mismatchKey, mismatchValue] of Object.entries(itemMismatches)) { - arrayMismatches[`[${i}]${mismatchKey === "value" ? "" : `.${mismatchKey}`}`] = mismatchValue; + arrayMismatches[`[${i}]${mismatchKey === "value" ? "" : "." + mismatchKey}`] = mismatchValue; } } } @@ -99,7 +93,7 @@ function findMismatches(actual: any, expected: any): Record 0) { for (const [nestedKey, nestedValue] of Object.entries(nestedMismatches)) { - mismatches[`${key}${nestedKey === "value" ? "" : `.${nestedKey}`}`] = nestedValue; + mismatches[`${key}${nestedKey === "value" ? "" : "." + nestedKey}`] = nestedValue; } } } else if (actual[key] !== expected[key]) { diff --git a/tests/setup.ts b/tests/setup.ts deleted file mode 100644 index ef8d53f4c..000000000 --- a/tests/setup.ts +++ /dev/null @@ -1,87 +0,0 @@ -expect.extend({ - toContainHeaders(this: jest.MatcherContext, actual: unknown, expectedHeaders: Record) { - const isHeaders = actual instanceof Headers; - const isPlainObject = typeof actual === "object" && actual !== null && !Array.isArray(actual); - - if (!isHeaders && !isPlainObject) { - throw new TypeError("Received value must be an instance of Headers or a plain object!"); - } - - if (typeof expectedHeaders !== "object" || expectedHeaders === null || Array.isArray(expectedHeaders)) { - throw new TypeError("Expected headers must be a plain object!"); - } - - const missingHeaders: string[] = []; - const mismatchedHeaders: Array<{ key: string; expected: string; actual: string | null }> = []; - - // Create a map of lowercase header keys to actual values for case-insensitive lookup - const actualHeadersMap = new Map(); - - if (isHeaders) { - for (const [key, value] of (actual as Headers).entries()) { - actualHeadersMap.set(key.toLowerCase(), value); - } - } else { - for (const [key, value] of Object.entries(actual as Record)) { - actualHeadersMap.set(key.toLowerCase(), value); - } - } - - for (const [key, value] of Object.entries(expectedHeaders)) { - const lowerKey = key.toLowerCase(); - const actualValue = actualHeadersMap.get(lowerKey) ?? null; - - if (actualValue === null || actualValue === undefined) { - missingHeaders.push(key); - } else if (actualValue !== value) { - mismatchedHeaders.push({ key, expected: value, actual: actualValue }); - } - } - - const pass = missingHeaders.length === 0 && mismatchedHeaders.length === 0; - const actualType = isHeaders ? "Headers" : "object"; - - if (pass) { - return { - message: () => `expected ${actualType} not to contain ${this.utils.printExpected(expectedHeaders)}`, - pass: true, - }; - } else { - const messages: string[] = []; - - if (missingHeaders.length > 0) { - messages.push(`Missing headers: ${this.utils.printExpected(missingHeaders.join(", "))}`); - } - - if (mismatchedHeaders.length > 0) { - const mismatches = mismatchedHeaders.map( - ({ key, expected, actual }) => - `${key}: expected ${this.utils.printExpected(expected)} but got ${this.utils.printReceived(actual)}`, - ); - messages.push(mismatches.join("\n")); - } - - return { - message: () => - `expected ${actualType} to contain ${this.utils.printExpected(expectedHeaders)}\n\n${messages.join("\n")}`, - pass: false, - }; - } - }, -}); - -declare global { - namespace jest { - interface Matchers { - toContainHeaders(expectedHeaders: Record): R; - } - interface Expect { - toContainHeaders(expectedHeaders: Record): any; - } - interface InverseAsymmetricMatchers { - toContainHeaders(expectedHeaders: Record): any; - } - } -} - -export {}; diff --git a/tests/tsconfig.json b/tests/tsconfig.json index fe83070d2..10185ed2e 100644 --- a/tests/tsconfig.json +++ b/tests/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../tsconfig.json", + "extends": "../tsconfig.base.json", "compilerOptions": { "outDir": null, "rootDir": "..", diff --git a/tests/unit/auth/BasicAuth.test.ts b/tests/unit/auth/BasicAuth.test.ts index 9b5123364..79ef97993 100644 --- a/tests/unit/auth/BasicAuth.test.ts +++ b/tests/unit/auth/BasicAuth.test.ts @@ -1,91 +1,21 @@ import { BasicAuth } from "../../../src/core/auth/BasicAuth"; describe("BasicAuth", () => { - interface ToHeaderTestCase { - description: string; - input: { username: string; password: string }; - expected: string; - } - - interface FromHeaderTestCase { - description: string; - input: string; - expected: { username: string; password: string }; - } - - interface ErrorTestCase { - description: string; - input: string; - expectedError: string; - } - describe("toAuthorizationHeader", () => { - const toHeaderTests: ToHeaderTestCase[] = [ - { - description: "correctly converts to header", - input: { username: "username", password: "password" }, - expected: "Basic dXNlcm5hbWU6cGFzc3dvcmQ=", - }, - ]; - - toHeaderTests.forEach(({ description, input, expected }) => { - it(description, () => { - expect(BasicAuth.toAuthorizationHeader(input)).toBe(expected); - }); + it("correctly converts to header", () => { + expect( + BasicAuth.toAuthorizationHeader({ + username: "username", + password: "password", + }), + ).toBe("Basic dXNlcm5hbWU6cGFzc3dvcmQ="); }); }); - describe("fromAuthorizationHeader", () => { - const fromHeaderTests: FromHeaderTestCase[] = [ - { - description: "correctly parses header", - input: "Basic dXNlcm5hbWU6cGFzc3dvcmQ=", - expected: { username: "username", password: "password" }, - }, - { - description: "handles password with colons", - input: "Basic dXNlcjpwYXNzOndvcmQ=", - expected: { username: "user", password: "pass:word" }, - }, - { - description: "handles empty username and password (just colon)", - input: "Basic Og==", - expected: { username: "", password: "" }, - }, - { - description: "handles empty username", - input: "Basic OnBhc3N3b3Jk", - expected: { username: "", password: "password" }, - }, - { - description: "handles empty password", - input: "Basic dXNlcm5hbWU6", - expected: { username: "username", password: "" }, - }, - ]; - - fromHeaderTests.forEach(({ description, input, expected }) => { - it(description, () => { - expect(BasicAuth.fromAuthorizationHeader(input)).toEqual(expected); - }); - }); - - const errorTests: ErrorTestCase[] = [ - { - description: "throws error for completely empty credentials", - input: "Basic ", - expectedError: "Invalid basic auth", - }, - { - description: "throws error for credentials without colon", - input: "Basic dXNlcm5hbWU=", - expectedError: "Invalid basic auth", - }, - ]; - - errorTests.forEach(({ description, input, expectedError }) => { - it(description, () => { - expect(() => BasicAuth.fromAuthorizationHeader(input)).toThrow(expectedError); + it("correctly parses header", () => { + expect(BasicAuth.fromAuthorizationHeader("Basic dXNlcm5hbWU6cGFzc3dvcmQ=")).toEqual({ + username: "username", + password: "password", }); }); }); diff --git a/tests/unit/fetcher/Fetcher.test.ts b/tests/unit/fetcher/Fetcher.test.ts index c0a0deeee..847c018bc 100644 --- a/tests/unit/fetcher/Fetcher.test.ts +++ b/tests/unit/fetcher/Fetcher.test.ts @@ -1,6 +1,9 @@ import fs from "fs"; +import stream from "stream"; import { join } from "path"; -import { type Fetcher, fetcherImpl } from "../../../src/core/fetcher/Fetcher"; + +import { Fetcher, fetcherImpl } from "../../../src/core/fetcher/Fetcher"; +import { BinaryResponse } from "../../../src/core"; describe("Test fetcherImpl", () => { it("should handle successful request", async () => { @@ -11,7 +14,6 @@ describe("Test fetcherImpl", () => { body: { data: "test" }, contentType: "application/json", requestType: "json", - maxRetries: 0, responseType: "json", }; @@ -32,7 +34,7 @@ describe("Test fetcherImpl", () => { "https://httpbin.org/post", expect.objectContaining({ method: "POST", - headers: expect.toContainHeaders({ "X-Test": "x-test-header" }), + headers: expect.objectContaining({ "X-Test": "x-test-header" }), body: JSON.stringify({ data: "test" }), }), ); @@ -46,7 +48,6 @@ describe("Test fetcherImpl", () => { headers: { "X-Test": "x-test-header" }, contentType: "application/octet-stream", requestType: "bytes", - maxRetries: 0, responseType: "json", body: fs.createReadStream(join(__dirname, "test-file.txt")), }; @@ -64,7 +65,7 @@ describe("Test fetcherImpl", () => { url, expect.objectContaining({ method: "POST", - headers: expect.toContainHeaders({ "X-Test": "x-test-header" }), + headers: expect.objectContaining({ "X-Test": "x-test-header" }), body: expect.any(fs.ReadStream), }), ); diff --git a/tests/unit/fetcher/HttpResponsePromise.test.ts b/tests/unit/fetcher/HttpResponsePromise.test.ts index c063b079b..2216a33e1 100644 --- a/tests/unit/fetcher/HttpResponsePromise.test.ts +++ b/tests/unit/fetcher/HttpResponsePromise.test.ts @@ -1,7 +1,7 @@ import { beforeEach, describe, expect, it, jest } from "@jest/globals"; import { HttpResponsePromise } from "../../../src/core/fetcher/HttpResponsePromise"; -import type { RawResponse, WithRawResponse } from "../../../src/core/fetcher/RawResponse"; +import { RawResponse, WithRawResponse } from "../../../src/core/fetcher/RawResponse"; describe("HttpResponsePromise", () => { const mockRawResponse: RawResponse = { diff --git a/tests/unit/fetcher/createRequestUrl.test.ts b/tests/unit/fetcher/createRequestUrl.test.ts index a92f1b5e8..06e03b2c6 100644 --- a/tests/unit/fetcher/createRequestUrl.test.ts +++ b/tests/unit/fetcher/createRequestUrl.test.ts @@ -1,163 +1,160 @@ import { createRequestUrl } from "../../../src/core/fetcher/createRequestUrl"; describe("Test createRequestUrl", () => { - const BASE_URL = "https://api.example.com"; - - interface TestCase { - description: string; - baseUrl: string; - queryParams?: Record; - expected: string; - } - - const testCases: TestCase[] = [ - { - description: "should return the base URL when no query parameters are provided", - baseUrl: BASE_URL, - expected: BASE_URL, - }, - { - description: "should append simple query parameters", - baseUrl: BASE_URL, - queryParams: { key: "value", another: "param" }, - expected: "https://api.example.com?key=value&another=param", - }, - { - description: "should handle array query parameters", - baseUrl: BASE_URL, - queryParams: { items: ["a", "b", "c"] }, - expected: "https://api.example.com?items=a&items=b&items=c", - }, - { - description: "should handle object query parameters", - baseUrl: BASE_URL, - queryParams: { filter: { name: "John", age: 30 } }, - expected: "https://api.example.com?filter%5Bname%5D=John&filter%5Bage%5D=30", - }, - { - description: "should handle mixed types of query parameters", - baseUrl: BASE_URL, - queryParams: { - simple: "value", - array: ["x", "y"], - object: { key: "value" }, - }, - expected: "https://api.example.com?simple=value&array=x&array=y&object%5Bkey%5D=value", - }, - { - description: "should handle empty query parameters object", - baseUrl: BASE_URL, - queryParams: {}, - expected: BASE_URL, - }, - { - description: "should encode special characters in query parameters", - baseUrl: BASE_URL, - queryParams: { special: "a&b=c d" }, - expected: "https://api.example.com?special=a%26b%3Dc%20d", - }, - { - description: "should handle numeric values", - baseUrl: BASE_URL, - queryParams: { count: 42, price: 19.99, active: 1, inactive: 0 }, - expected: "https://api.example.com?count=42&price=19.99&active=1&inactive=0", - }, - { - description: "should handle boolean values", - baseUrl: BASE_URL, - queryParams: { enabled: true, disabled: false }, - expected: "https://api.example.com?enabled=true&disabled=false", - }, - { - description: "should handle null and undefined values", - baseUrl: BASE_URL, - queryParams: { - valid: "value", - nullValue: null, - undefinedValue: undefined, - emptyString: "", - }, - expected: "https://api.example.com?valid=value&nullValue=&emptyString=", - }, - { - description: "should handle deeply nested objects", - baseUrl: BASE_URL, - queryParams: { - user: { - profile: { - name: "John", - settings: { theme: "dark" }, - }, + it("should return the base URL when no query parameters are provided", () => { + const baseUrl = "https://api.example.com"; + expect(createRequestUrl(baseUrl)).toBe(baseUrl); + }); + + it("should append simple query parameters", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { key: "value", another: "param" }; + expect(createRequestUrl(baseUrl, queryParams)).toBe("https://api.example.com?key=value&another=param"); + }); + + it("should handle array query parameters", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { items: ["a", "b", "c"] }; + expect(createRequestUrl(baseUrl, queryParams)).toBe("https://api.example.com?items=a&items=b&items=c"); + }); + + it("should handle object query parameters", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { filter: { name: "John", age: 30 } }; + expect(createRequestUrl(baseUrl, queryParams)).toBe( + "https://api.example.com?filter%5Bname%5D=John&filter%5Bage%5D=30", + ); + }); + + it("should handle mixed types of query parameters", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { + simple: "value", + array: ["x", "y"], + object: { key: "value" }, + }; + expect(createRequestUrl(baseUrl, queryParams)).toBe( + "https://api.example.com?simple=value&array=x&array=y&object%5Bkey%5D=value", + ); + }); + + it("should handle empty query parameters object", () => { + const baseUrl = "https://api.example.com"; + expect(createRequestUrl(baseUrl, {})).toBe(baseUrl); + }); + + it("should encode special characters in query parameters", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { special: "a&b=c d" }; + expect(createRequestUrl(baseUrl, queryParams)).toBe("https://api.example.com?special=a%26b%3Dc%20d"); + }); + + // Additional tests for edge cases and different value types + it("should handle numeric values", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { count: 42, price: 19.99, active: 1, inactive: 0 }; + expect(createRequestUrl(baseUrl, queryParams)).toBe( + "https://api.example.com?count=42&price=19.99&active=1&inactive=0", + ); + }); + + it("should handle boolean values", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { enabled: true, disabled: false }; + expect(createRequestUrl(baseUrl, queryParams)).toBe("https://api.example.com?enabled=true&disabled=false"); + }); + + it("should handle null and undefined values", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { + valid: "value", + nullValue: null, + undefinedValue: undefined, + emptyString: "", + }; + expect(createRequestUrl(baseUrl, queryParams)).toBe( + "https://api.example.com?valid=value&nullValue=&emptyString=", + ); + }); + + it("should handle deeply nested objects", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { + user: { + profile: { + name: "John", + settings: { theme: "dark" }, }, }, - expected: - "https://api.example.com?user%5Bprofile%5D%5Bname%5D=John&user%5Bprofile%5D%5Bsettings%5D%5Btheme%5D=dark", - }, - { - description: "should handle arrays of objects", - baseUrl: BASE_URL, - queryParams: { - users: [ - { name: "John", age: 30 }, - { name: "Jane", age: 25 }, - ], - }, - expected: - "https://api.example.com?users%5Bname%5D=John&users%5Bage%5D=30&users%5Bname%5D=Jane&users%5Bage%5D=25", - }, - { - description: "should handle mixed arrays", - baseUrl: BASE_URL, - queryParams: { - mixed: ["string", 42, true, { key: "value" }], - }, - expected: "https://api.example.com?mixed=string&mixed=42&mixed=true&mixed%5Bkey%5D=value", - }, - { - description: "should handle empty arrays", - baseUrl: BASE_URL, - queryParams: { emptyArray: [] }, - expected: BASE_URL, - }, - { - description: "should handle empty objects", - baseUrl: BASE_URL, - queryParams: { emptyObject: {} }, - expected: BASE_URL, - }, - { - description: "should handle special characters in keys", - baseUrl: BASE_URL, - queryParams: { "key with spaces": "value", "key[with]brackets": "value" }, - expected: "https://api.example.com?key%20with%20spaces=value&key%5Bwith%5Dbrackets=value", - }, - { - description: "should handle URL with existing query parameters", - baseUrl: "https://api.example.com?existing=param", - queryParams: { new: "value" }, - expected: "https://api.example.com?existing=param?new=value", - }, - { - description: "should handle complex nested structures", - baseUrl: BASE_URL, - queryParams: { - filters: { - status: ["active", "pending"], - category: { - type: "electronics", - subcategories: ["phones", "laptops"], - }, + }; + expect(createRequestUrl(baseUrl, queryParams)).toBe( + "https://api.example.com?user%5Bprofile%5D%5Bname%5D=John&user%5Bprofile%5D%5Bsettings%5D%5Btheme%5D=dark", + ); + }); + + it("should handle arrays of objects", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { + users: [ + { name: "John", age: 30 }, + { name: "Jane", age: 25 }, + ], + }; + expect(createRequestUrl(baseUrl, queryParams)).toBe( + "https://api.example.com?users%5Bname%5D=John&users%5Bage%5D=30&users%5Bname%5D=Jane&users%5Bage%5D=25", + ); + }); + + it("should handle mixed arrays", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { + mixed: ["string", 42, true, { key: "value" }], + }; + expect(createRequestUrl(baseUrl, queryParams)).toBe( + "https://api.example.com?mixed=string&mixed=42&mixed=true&mixed%5Bkey%5D=value", + ); + }); + + it("should handle empty arrays", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { emptyArray: [] }; + expect(createRequestUrl(baseUrl, queryParams)).toBe(baseUrl); + }); + + it("should handle empty objects", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { emptyObject: {} }; + expect(createRequestUrl(baseUrl, queryParams)).toBe(baseUrl); + }); + + it("should handle special characters in keys", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { "key with spaces": "value", "key[with]brackets": "value" }; + expect(createRequestUrl(baseUrl, queryParams)).toBe( + "https://api.example.com?key%20with%20spaces=value&key%5Bwith%5Dbrackets=value", + ); + }); + + it("should handle URL with existing query parameters", () => { + const baseUrl = "https://api.example.com?existing=param"; + const queryParams = { new: "value" }; + expect(createRequestUrl(baseUrl, queryParams)).toBe("https://api.example.com?existing=param?new=value"); + }); + + it("should handle complex nested structures", () => { + const baseUrl = "https://api.example.com"; + const queryParams = { + filters: { + status: ["active", "pending"], + category: { + type: "electronics", + subcategories: ["phones", "laptops"], }, - sort: { field: "name", direction: "asc" }, }, - expected: - "https://api.example.com?filters%5Bstatus%5D=active&filters%5Bstatus%5D=pending&filters%5Bcategory%5D%5Btype%5D=electronics&filters%5Bcategory%5D%5Bsubcategories%5D=phones&filters%5Bcategory%5D%5Bsubcategories%5D=laptops&sort%5Bfield%5D=name&sort%5Bdirection%5D=asc", - }, - ]; - - testCases.forEach(({ description, baseUrl, queryParams, expected }) => { - it(description, () => { - expect(createRequestUrl(baseUrl, queryParams)).toBe(expected); - }); + sort: { field: "name", direction: "asc" }, + }; + expect(createRequestUrl(baseUrl, queryParams)).toBe( + "https://api.example.com?filters%5Bstatus%5D=active&filters%5Bstatus%5D=pending&filters%5Bcategory%5D%5Btype%5D=electronics&filters%5Bcategory%5D%5Bsubcategories%5D=phones&filters%5Bcategory%5D%5Bsubcategories%5D=laptops&sort%5Bfield%5D=name&sort%5Bdirection%5D=asc", + ); }); }); diff --git a/tests/unit/fetcher/getFetchFn.test.ts b/tests/unit/fetcher/getFetchFn.test.ts index ac05ab2fb..b55dbbc35 100644 --- a/tests/unit/fetcher/getFetchFn.test.ts +++ b/tests/unit/fetcher/getFetchFn.test.ts @@ -3,7 +3,7 @@ import { RUNTIME } from "../../../src/core/runtime"; describe("Test for getFetchFn", () => { it("should get node-fetch function", async () => { - if (RUNTIME.type === "node") { + if (RUNTIME.type == "node") { if (RUNTIME.parsedVersion != null && RUNTIME.parsedVersion >= 18) { expect(await getFetchFn()).toBe(fetch); } else { @@ -13,7 +13,7 @@ describe("Test for getFetchFn", () => { }); it("should get fetch function", async () => { - if (RUNTIME.type === "browser") { + if (RUNTIME.type == "browser") { const fetchFn = await getFetchFn(); expect(typeof fetchFn).toBe("function"); expect(fetchFn.name).toBe("fetch"); diff --git a/tests/unit/fetcher/getRequestBody.test.ts b/tests/unit/fetcher/getRequestBody.test.ts index 8a6c3a57e..e864c8b57 100644 --- a/tests/unit/fetcher/getRequestBody.test.ts +++ b/tests/unit/fetcher/getRequestBody.test.ts @@ -2,117 +2,15 @@ import { getRequestBody } from "../../../src/core/fetcher/getRequestBody"; import { RUNTIME } from "../../../src/core/runtime"; describe("Test getRequestBody", () => { - interface TestCase { - description: string; - input: any; - type: "json" | "form" | "file" | "bytes" | "other"; - expected: any; - skipCondition?: () => boolean; - } - - const testCases: TestCase[] = [ - { - description: "should stringify body if not FormData in Node environment", - input: { key: "value" }, - type: "json", - expected: '{"key":"value"}', - skipCondition: () => RUNTIME.type !== "node", - }, - { - description: "should stringify body if not FormData in browser environment", - input: { key: "value" }, - type: "json", - expected: '{"key":"value"}', - skipCondition: () => RUNTIME.type !== "browser", - }, - { - description: "should return the Uint8Array", - input: new Uint8Array([1, 2, 3]), - type: "bytes", - expected: new Uint8Array([1, 2, 3]), - }, - { - description: "should serialize objects for form-urlencoded content type", - input: { username: "johndoe", email: "john@example.com" }, - type: "form", - expected: "username=johndoe&email=john%40example.com", - }, - { - description: "should serialize complex nested objects and arrays for form-urlencoded content type", - input: { - user: { - profile: { - name: "John Doe", - settings: { - theme: "dark", - notifications: true, - }, - }, - tags: ["admin", "user"], - contacts: [ - { type: "email", value: "john@example.com" }, - { type: "phone", value: "+1234567890" }, - ], - }, - filters: { - status: ["active", "pending"], - metadata: { - created: "2024-01-01", - categories: ["electronics", "books"], - }, - }, - preferences: ["notifications", "updates"], - }, - type: "form", - expected: - "user%5Bprofile%5D%5Bname%5D=John%20Doe&" + - "user%5Bprofile%5D%5Bsettings%5D%5Btheme%5D=dark&" + - "user%5Bprofile%5D%5Bsettings%5D%5Bnotifications%5D=true&" + - "user%5Btags%5D=admin&" + - "user%5Btags%5D=user&" + - "user%5Bcontacts%5D%5Btype%5D=email&" + - "user%5Bcontacts%5D%5Bvalue%5D=john%40example.com&" + - "user%5Bcontacts%5D%5Btype%5D=phone&" + - "user%5Bcontacts%5D%5Bvalue%5D=%2B1234567890&" + - "filters%5Bstatus%5D=active&" + - "filters%5Bstatus%5D=pending&" + - "filters%5Bmetadata%5D%5Bcreated%5D=2024-01-01&" + - "filters%5Bmetadata%5D%5Bcategories%5D=electronics&" + - "filters%5Bmetadata%5D%5Bcategories%5D=books&" + - "preferences=notifications&" + - "preferences=updates", - }, - { - description: "should return the input for pre-serialized form-urlencoded strings", - input: "key=value&another=param", - type: "other", - expected: "key=value&another=param", - }, - { - description: "should JSON stringify objects", - input: { key: "value" }, - type: "json", - expected: '{"key":"value"}', - }, - ]; - - testCases.forEach(({ description, input, type, expected, skipCondition }) => { - it(description, async () => { - if (skipCondition?.()) { - return; - } - + it("should stringify body if not FormData in Node environment", async () => { + if (RUNTIME.type === "node") { + const body = { key: "value" }; const result = await getRequestBody({ - body: input, - type, + body, + type: "json", }); - - if (input instanceof Uint8Array) { - expect(result).toBe(input); - } else { - expect(result).toBe(expected); - } - }); + expect(result).toBe('{"key":"value"}'); + } }); it("should return FormData in browser environment", async () => { @@ -126,4 +24,42 @@ describe("Test getRequestBody", () => { expect(result).toBe(formData); } }); + + it("should stringify body if not FormData in browser environment", async () => { + if (RUNTIME.type === "browser") { + const body = { key: "value" }; + const result = await getRequestBody({ + body, + type: "json", + }); + expect(result).toBe('{"key":"value"}'); + } + }); + + it("should return the Uint8Array", async () => { + const input = new Uint8Array([1, 2, 3]); + const result = await getRequestBody({ + body: input, + type: "bytes", + }); + expect(result).toBe(input); + }); + + it("should return the input for content-type 'application/x-www-form-urlencoded'", async () => { + const input = "key=value&another=param"; + const result = await getRequestBody({ + body: input, + type: "other", + }); + expect(result).toBe(input); + }); + + it("should JSON stringify objects", async () => { + const input = { key: "value" }; + const result = await getRequestBody({ + body: input, + type: "json", + }); + expect(result).toBe('{"key":"value"}'); + }); }); diff --git a/tests/unit/fetcher/getResponseBody.test.ts b/tests/unit/fetcher/getResponseBody.test.ts index 4d8b66e04..17ef223c1 100644 --- a/tests/unit/fetcher/getResponseBody.test.ts +++ b/tests/unit/fetcher/getResponseBody.test.ts @@ -1,63 +1,9 @@ +import { RUNTIME } from "../../../src/core/runtime"; import { getResponseBody } from "../../../src/core/fetcher/getResponseBody"; import { chooseStreamWrapper } from "../../../src/core/fetcher/stream-wrappers/chooseStreamWrapper"; -import { RUNTIME } from "../../../src/core/runtime"; - describe("Test getResponseBody", () => { - interface SimpleTestCase { - description: string; - responseData: string | Record; - responseType?: "blob" | "sse" | "streaming" | "text"; - expected: any; - skipCondition?: () => boolean; - } - - const simpleTestCases: SimpleTestCase[] = [ - { - description: "should handle text response type", - responseData: "test text", - responseType: "text", - expected: "test text", - }, - { - description: "should handle JSON response", - responseData: { key: "value" }, - expected: { key: "value" }, - }, - { - description: "should handle empty response", - responseData: "", - expected: undefined, - }, - { - description: "should handle non-JSON response", - responseData: "invalid json", - expected: { - ok: false, - error: { - reason: "non-json", - statusCode: 200, - rawBody: "invalid json", - }, - }, - }, - ]; - - simpleTestCases.forEach(({ description, responseData, responseType, expected, skipCondition }) => { - it(description, async () => { - if (skipCondition?.()) { - return; - } - - const mockResponse = new Response( - typeof responseData === "string" ? responseData : JSON.stringify(responseData), - ); - const result = await getResponseBody(mockResponse, responseType); - expect(result).toEqual(expected); - }); - }); - it("should handle blob response type", async () => { const mockBlob = new Blob(["test"], { type: "text/plain" }); const mockResponse = new Response(mockBlob); @@ -84,4 +30,36 @@ describe("Test getResponseBody", () => { expect(JSON.stringify(result)).toBe(JSON.stringify(await chooseStreamWrapper(new ReadableStream()))); } }); + + it("should handle text response type", async () => { + const mockResponse = new Response("test text"); + const result = await getResponseBody(mockResponse, "text"); + expect(result).toBe("test text"); + }); + + it("should handle JSON response", async () => { + const mockJson = { key: "value" }; + const mockResponse = new Response(JSON.stringify(mockJson)); + const result = await getResponseBody(mockResponse); + expect(result).toEqual(mockJson); + }); + + it("should handle empty response", async () => { + const mockResponse = new Response(""); + const result = await getResponseBody(mockResponse); + expect(result).toBeUndefined(); + }); + + it("should handle non-JSON response", async () => { + const mockResponse = new Response("invalid json"); + const result = await getResponseBody(mockResponse); + expect(result).toEqual({ + ok: false, + error: { + reason: "non-json", + statusCode: 200, + rawBody: "invalid json", + }, + }); + }); }); diff --git a/tests/unit/fetcher/logging.test.ts b/tests/unit/fetcher/logging.test.ts deleted file mode 100644 index 267a9abaf..000000000 --- a/tests/unit/fetcher/logging.test.ts +++ /dev/null @@ -1,517 +0,0 @@ -import { fetcherImpl } from "../../../src/core/fetcher/Fetcher"; - -function createMockLogger() { - return { - debug: jest.fn(), - info: jest.fn(), - warn: jest.fn(), - error: jest.fn(), - }; -} - -function mockSuccessResponse(data: unknown = { data: "test" }, status = 200, statusText = "OK") { - global.fetch = jest.fn().mockResolvedValue( - new Response(JSON.stringify(data), { - status, - statusText, - }), - ); -} - -function mockErrorResponse(data: unknown = { error: "Error" }, status = 404, statusText = "Not Found") { - global.fetch = jest.fn().mockResolvedValue( - new Response(JSON.stringify(data), { - status, - statusText, - }), - ); -} - -describe("Fetcher Logging Integration", () => { - describe("Request Logging", () => { - it("should log successful request at debug level", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "POST", - headers: { "Content-Type": "application/json" }, - body: { test: "data" }, - contentType: "application/json", - requestType: "json", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - method: "POST", - url: "https://example.com/api", - headers: expect.toContainHeaders({ - "Content-Type": "application/json", - }), - hasBody: true, - }), - ); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "HTTP request succeeded", - expect.objectContaining({ - method: "POST", - url: "https://example.com/api", - statusCode: 200, - }), - ); - }); - - it("should not log debug messages at info level for successful requests", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "info", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).not.toHaveBeenCalled(); - expect(mockLogger.info).not.toHaveBeenCalled(); - }); - - it("should log request with body flag", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "POST", - body: { data: "test" }, - contentType: "application/json", - requestType: "json", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - hasBody: true, - }), - ); - }); - - it("should log request without body flag", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - hasBody: false, - }), - ); - }); - - it("should not log when silent mode is enabled", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: true, - }, - }); - - expect(mockLogger.debug).not.toHaveBeenCalled(); - expect(mockLogger.info).not.toHaveBeenCalled(); - expect(mockLogger.warn).not.toHaveBeenCalled(); - expect(mockLogger.error).not.toHaveBeenCalled(); - }); - - it("should not log when no logging config is provided", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - responseType: "json", - maxRetries: 0, - }); - - expect(mockLogger.debug).not.toHaveBeenCalled(); - }); - }); - - describe("Error Logging", () => { - it("should log 4xx errors at error level", async () => { - const mockLogger = createMockLogger(); - mockErrorResponse({ error: "Not found" }, 404, "Not Found"); - - const result = await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "error", - logger: mockLogger, - silent: false, - }, - }); - - expect(result.ok).toBe(false); - expect(mockLogger.error).toHaveBeenCalledWith( - "HTTP request failed with error status", - expect.objectContaining({ - method: "GET", - url: "https://example.com/api", - statusCode: 404, - }), - ); - }); - - it("should log 5xx errors at error level", async () => { - const mockLogger = createMockLogger(); - mockErrorResponse({ error: "Internal error" }, 500, "Internal Server Error"); - - const result = await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "error", - logger: mockLogger, - silent: false, - }, - }); - - expect(result.ok).toBe(false); - expect(mockLogger.error).toHaveBeenCalledWith( - "HTTP request failed with error status", - expect.objectContaining({ - method: "GET", - url: "https://example.com/api", - statusCode: 500, - }), - ); - }); - - it("should log aborted request errors", async () => { - const mockLogger = createMockLogger(); - - const abortController = new AbortController(); - abortController.abort(); - - global.fetch = jest.fn().mockRejectedValue(new Error("Aborted")); - - const result = await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - responseType: "json", - abortSignal: abortController.signal, - maxRetries: 0, - logging: { - level: "error", - logger: mockLogger, - silent: false, - }, - }); - - expect(result.ok).toBe(false); - expect(mockLogger.error).toHaveBeenCalledWith( - "HTTP request was aborted", - expect.objectContaining({ - method: "GET", - url: "https://example.com/api", - }), - ); - }); - - it("should log timeout errors", async () => { - const mockLogger = createMockLogger(); - - const timeoutError = new Error("Request timeout"); - timeoutError.name = "AbortError"; - - global.fetch = jest.fn().mockRejectedValue(timeoutError); - - const result = await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "error", - logger: mockLogger, - silent: false, - }, - }); - - expect(result.ok).toBe(false); - expect(mockLogger.error).toHaveBeenCalledWith( - "HTTP request timed out", - expect.objectContaining({ - method: "GET", - url: "https://example.com/api", - timeoutMs: undefined, - }), - ); - }); - - it("should log unknown errors", async () => { - const mockLogger = createMockLogger(); - - const unknownError = new Error("Unknown error"); - - global.fetch = jest.fn().mockRejectedValue(unknownError); - - const result = await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "error", - logger: mockLogger, - silent: false, - }, - }); - - expect(result.ok).toBe(false); - expect(mockLogger.error).toHaveBeenCalledWith( - "HTTP request failed with error", - expect.objectContaining({ - method: "GET", - url: "https://example.com/api", - errorMessage: "Unknown error", - }), - ); - }); - }); - - describe("Logging with Redaction", () => { - it("should redact sensitive data in error logs", async () => { - const mockLogger = createMockLogger(); - mockErrorResponse({ error: "Unauthorized" }, 401, "Unauthorized"); - - await fetcherImpl({ - url: "https://example.com/api?api_key=secret", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "error", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.error).toHaveBeenCalledWith( - "HTTP request failed with error status", - expect.objectContaining({ - url: "https://example.com/api?api_key=[REDACTED]", - }), - ); - }); - }); - - describe("Different HTTP Methods", () => { - it("should log GET requests", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - method: "GET", - }), - ); - }); - - it("should log POST requests", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse({ data: "test" }, 201, "Created"); - - await fetcherImpl({ - url: "https://example.com/api", - method: "POST", - body: { data: "test" }, - contentType: "application/json", - requestType: "json", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - method: "POST", - }), - ); - }); - - it("should log PUT requests", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "PUT", - body: { data: "test" }, - contentType: "application/json", - requestType: "json", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - method: "PUT", - }), - ); - }); - - it("should log DELETE requests", async () => { - const mockLogger = createMockLogger(); - global.fetch = jest.fn().mockResolvedValue( - new Response(null, { - status: 200, - statusText: "OK", - }), - ); - - await fetcherImpl({ - url: "https://example.com/api", - method: "DELETE", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - method: "DELETE", - }), - ); - }); - }); - - describe("Status Code Logging", () => { - it("should log 2xx success status codes", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse({ data: "test" }, 201, "Created"); - - await fetcherImpl({ - url: "https://example.com/api", - method: "POST", - body: { data: "test" }, - contentType: "application/json", - requestType: "json", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "HTTP request succeeded", - expect.objectContaining({ - statusCode: 201, - }), - ); - }); - - it("should log 3xx redirect status codes as success", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse({ data: "test" }, 301, "Moved Permanently"); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "HTTP request succeeded", - expect.objectContaining({ - statusCode: 301, - }), - ); - }); - }); -}); diff --git a/tests/unit/fetcher/redacting.test.ts b/tests/unit/fetcher/redacting.test.ts deleted file mode 100644 index 884ce4ccc..000000000 --- a/tests/unit/fetcher/redacting.test.ts +++ /dev/null @@ -1,1115 +0,0 @@ -import { fetcherImpl } from "../../../src/core/fetcher/Fetcher"; - -function createMockLogger() { - return { - debug: jest.fn(), - info: jest.fn(), - warn: jest.fn(), - error: jest.fn(), - }; -} - -function mockSuccessResponse(data: unknown = { data: "test" }, status = 200, statusText = "OK") { - global.fetch = jest.fn().mockResolvedValue( - new Response(JSON.stringify(data), { - status, - statusText, - }), - ); -} - -describe("Redacting Logic", () => { - describe("Header Redaction", () => { - it("should redact authorization header", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - headers: { Authorization: "Bearer secret-token-12345" }, - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - headers: expect.toContainHeaders({ - Authorization: "[REDACTED]", - }), - }), - ); - }); - - it("should redact api-key header (case-insensitive)", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - headers: { "X-API-KEY": "secret-api-key" }, - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - headers: expect.toContainHeaders({ - "X-API-KEY": "[REDACTED]", - }), - }), - ); - }); - - it("should redact cookie header", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - headers: { Cookie: "session=abc123; token=xyz789" }, - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - headers: expect.toContainHeaders({ - Cookie: "[REDACTED]", - }), - }), - ); - }); - - it("should redact x-auth-token header", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - headers: { "x-auth-token": "auth-token-12345" }, - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - headers: expect.toContainHeaders({ - "x-auth-token": "[REDACTED]", - }), - }), - ); - }); - - it("should redact proxy-authorization header", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - headers: { "Proxy-Authorization": "Basic credentials" }, - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - headers: expect.toContainHeaders({ - "Proxy-Authorization": "[REDACTED]", - }), - }), - ); - }); - - it("should redact x-csrf-token header", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - headers: { "X-CSRF-Token": "csrf-token-abc" }, - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - headers: expect.toContainHeaders({ - "X-CSRF-Token": "[REDACTED]", - }), - }), - ); - }); - - it("should redact www-authenticate header", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - headers: { "WWW-Authenticate": "Bearer realm=example" }, - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - headers: expect.toContainHeaders({ - "WWW-Authenticate": "[REDACTED]", - }), - }), - ); - }); - - it("should redact x-session-token header", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - headers: { "X-Session-Token": "session-token-xyz" }, - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - headers: expect.toContainHeaders({ - "X-Session-Token": "[REDACTED]", - }), - }), - ); - }); - - it("should not redact non-sensitive headers", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - headers: { - "Content-Type": "application/json", - "User-Agent": "Test/1.0", - Accept: "application/json", - }, - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - headers: expect.toContainHeaders({ - "Content-Type": "application/json", - "User-Agent": "Test/1.0", - Accept: "application/json", - }), - }), - ); - }); - - it("should redact multiple sensitive headers at once", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - headers: { - Authorization: "Bearer token", - "X-API-Key": "api-key", - Cookie: "session=123", - "Content-Type": "application/json", - }, - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - headers: expect.toContainHeaders({ - Authorization: "[REDACTED]", - "X-API-Key": "[REDACTED]", - Cookie: "[REDACTED]", - "Content-Type": "application/json", - }), - }), - ); - }); - }); - - describe("Response Header Redaction", () => { - it("should redact Set-Cookie in response headers", async () => { - const mockLogger = createMockLogger(); - - const mockHeaders = new Headers(); - mockHeaders.set("Set-Cookie", "session=abc123; HttpOnly; Secure"); - mockHeaders.set("Content-Type", "application/json"); - - global.fetch = jest.fn().mockResolvedValue( - new Response(JSON.stringify({ data: "test" }), { - status: 200, - statusText: "OK", - headers: mockHeaders, - }), - ); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "HTTP request succeeded", - expect.objectContaining({ - responseHeaders: expect.toContainHeaders({ - "set-cookie": "[REDACTED]", - "content-type": "application/json", - }), - }), - ); - }); - - it("should redact authorization in response headers", async () => { - const mockLogger = createMockLogger(); - - const mockHeaders = new Headers(); - mockHeaders.set("Authorization", "Bearer token-123"); - mockHeaders.set("Content-Type", "application/json"); - - global.fetch = jest.fn().mockResolvedValue( - new Response(JSON.stringify({ data: "test" }), { - status: 200, - statusText: "OK", - headers: mockHeaders, - }), - ); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "HTTP request succeeded", - expect.objectContaining({ - responseHeaders: expect.toContainHeaders({ - authorization: "[REDACTED]", - "content-type": "application/json", - }), - }), - ); - }); - - it("should redact response headers in error responses", async () => { - const mockLogger = createMockLogger(); - - const mockHeaders = new Headers(); - mockHeaders.set("WWW-Authenticate", "Bearer realm=example"); - mockHeaders.set("Content-Type", "application/json"); - - global.fetch = jest.fn().mockResolvedValue( - new Response(JSON.stringify({ error: "Unauthorized" }), { - status: 401, - statusText: "Unauthorized", - headers: mockHeaders, - }), - ); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "error", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.error).toHaveBeenCalledWith( - "HTTP request failed with error status", - expect.objectContaining({ - responseHeaders: expect.toContainHeaders({ - "www-authenticate": "[REDACTED]", - "content-type": "application/json", - }), - }), - ); - }); - }); - - describe("Query Parameter Redaction", () => { - it("should redact api_key query parameter", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - queryParameters: { api_key: "secret-key" }, - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - queryParameters: expect.objectContaining({ - api_key: "[REDACTED]", - }), - }), - ); - }); - - it("should redact token query parameter", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - queryParameters: { token: "secret-token" }, - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - queryParameters: expect.objectContaining({ - token: "[REDACTED]", - }), - }), - ); - }); - - it("should redact access_token query parameter", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - queryParameters: { access_token: "secret-access-token" }, - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - queryParameters: expect.objectContaining({ - access_token: "[REDACTED]", - }), - }), - ); - }); - - it("should redact password query parameter", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - queryParameters: { password: "secret-password" }, - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - queryParameters: expect.objectContaining({ - password: "[REDACTED]", - }), - }), - ); - }); - - it("should redact secret query parameter", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - queryParameters: { secret: "secret-value" }, - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - queryParameters: expect.objectContaining({ - secret: "[REDACTED]", - }), - }), - ); - }); - - it("should redact session_id query parameter", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - queryParameters: { session_id: "session-123" }, - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - queryParameters: expect.objectContaining({ - session_id: "[REDACTED]", - }), - }), - ); - }); - - it("should not redact non-sensitive query parameters", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - queryParameters: { - page: "1", - limit: "10", - sort: "name", - }, - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - queryParameters: expect.objectContaining({ - page: "1", - limit: "10", - sort: "name", - }), - }), - ); - }); - - it("should not redact parameters containing 'auth' substring like 'author'", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - queryParameters: { - author: "john", - authenticate: "false", - authorization_level: "user", - }, - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - queryParameters: expect.objectContaining({ - author: "john", - authenticate: "false", - authorization_level: "user", - }), - }), - ); - }); - - it("should handle undefined query parameters", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - queryParameters: undefined, - }), - ); - }); - - it("should redact case-insensitive query parameters", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - queryParameters: { API_KEY: "secret-key", Token: "secret-token" }, - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - queryParameters: expect.objectContaining({ - API_KEY: "[REDACTED]", - Token: "[REDACTED]", - }), - }), - ); - }); - }); - - describe("URL Redaction", () => { - it("should redact credentials in URL", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://user:password@example.com/api", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - url: "https://[REDACTED]@example.com/api", - }), - ); - }); - - it("should redact api_key in query string", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api?api_key=secret-key&page=1", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - url: "https://example.com/api?api_key=[REDACTED]&page=1", - }), - ); - }); - - it("should redact token in query string", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api?token=secret-token", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - url: "https://example.com/api?token=[REDACTED]", - }), - ); - }); - - it("should redact password in query string", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api?username=user&password=secret", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - url: "https://example.com/api?username=user&password=[REDACTED]", - }), - ); - }); - - it("should not redact non-sensitive query strings", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api?page=1&limit=10&sort=name", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - url: "https://example.com/api?page=1&limit=10&sort=name", - }), - ); - }); - - it("should not redact URL parameters containing 'auth' substring like 'author'", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api?author=john&authenticate=false&page=1", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - url: "https://example.com/api?author=john&authenticate=false&page=1", - }), - ); - }); - - it("should handle URL with fragment", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api?token=secret#section", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - url: "https://example.com/api?token=[REDACTED]#section", - }), - ); - }); - - it("should redact URL-encoded query parameters", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api?api%5Fkey=secret", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - url: "https://example.com/api?api%5Fkey=[REDACTED]", - }), - ); - }); - - it("should handle URL without query string", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - url: "https://example.com/api", - }), - ); - }); - - it("should handle empty query string", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api?", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - url: "https://example.com/api?", - }), - ); - }); - - it("should redact multiple sensitive parameters in URL", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api?api_key=secret1&token=secret2&page=1", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - url: "https://example.com/api?api_key=[REDACTED]&token=[REDACTED]&page=1", - }), - ); - }); - - it("should redact both credentials and query parameters", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://user:pass@example.com/api?token=secret", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - url: "https://[REDACTED]@example.com/api?token=[REDACTED]", - }), - ); - }); - - it("should use fast path for URLs without sensitive keywords", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api?page=1&limit=10&sort=name&filter=value", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - url: "https://example.com/api?page=1&limit=10&sort=name&filter=value", - }), - ); - }); - - it("should handle query parameter without value", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api?flag&token=secret", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - url: "https://example.com/api?flag&token=[REDACTED]", - }), - ); - }); - - it("should handle URL with multiple @ symbols in credentials", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://user@example.com:pass@host.com/api", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - url: "https://[REDACTED]@host.com/api", - }), - ); - }); - - it("should handle URL with @ in query parameter but not in credentials", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://example.com/api?email=user@example.com", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - url: "https://example.com/api?email=user@example.com", - }), - ); - }); - - it("should handle URL with both credentials and @ in path", async () => { - const mockLogger = createMockLogger(); - mockSuccessResponse(); - - await fetcherImpl({ - url: "https://user:pass@example.com/users/@username", - method: "GET", - responseType: "json", - maxRetries: 0, - logging: { - level: "debug", - logger: mockLogger, - silent: false, - }, - }); - - expect(mockLogger.debug).toHaveBeenCalledWith( - "Making HTTP request", - expect.objectContaining({ - url: "https://[REDACTED]@example.com/users/@username", - }), - ); - }); - }); -}); diff --git a/tests/unit/fetcher/requestWithRetries.test.ts b/tests/unit/fetcher/requestWithRetries.test.ts index 9c2aaf216..3cdaa40a5 100644 --- a/tests/unit/fetcher/requestWithRetries.test.ts +++ b/tests/unit/fetcher/requestWithRetries.test.ts @@ -9,6 +9,7 @@ describe("requestWithRetries", () => { mockFetch = jest.fn(); originalMathRandom = Math.random; + // Mock Math.random for consistent jitter Math.random = jest.fn(() => 0.5); jest.useFakeTimers({ doNotFake: ["nextTick"] }); @@ -83,67 +84,6 @@ describe("requestWithRetries", () => { } }); - interface RetryHeaderTestCase { - description: string; - headerName: string; - headerValue: string | (() => string); - expectedDelayMin: number; - expectedDelayMax: number; - } - - const retryHeaderTests: RetryHeaderTestCase[] = [ - { - description: "should respect retry-after header with seconds value", - headerName: "retry-after", - headerValue: "5", - expectedDelayMin: 4000, - expectedDelayMax: 6000, - }, - { - description: "should respect retry-after header with HTTP date value", - headerName: "retry-after", - headerValue: () => new Date(Date.now() + 3000).toUTCString(), - expectedDelayMin: 2000, - expectedDelayMax: 4000, - }, - { - description: "should respect x-ratelimit-reset header", - headerName: "x-ratelimit-reset", - headerValue: () => Math.floor((Date.now() + 4000) / 1000).toString(), - expectedDelayMin: 3000, - expectedDelayMax: 6000, - }, - ]; - - retryHeaderTests.forEach(({ description, headerName, headerValue, expectedDelayMin, expectedDelayMax }) => { - it(description, async () => { - setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { - process.nextTick(callback); - return null as any; - }); - - const value = typeof headerValue === "function" ? headerValue() : headerValue; - mockFetch - .mockResolvedValueOnce( - new Response("", { - status: 429, - headers: new Headers({ [headerName]: value }), - }), - ) - .mockResolvedValueOnce(new Response("", { status: 200 })); - - const responsePromise = requestWithRetries(() => mockFetch(), 1); - await jest.runAllTimersAsync(); - const response = await responsePromise; - - expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), expect.any(Number)); - const actualDelay = setTimeoutSpy.mock.calls[0][1]; - expect(actualDelay).toBeGreaterThan(expectedDelayMin); - expect(actualDelay).toBeLessThan(expectedDelayMax); - expect(response.status).toBe(200); - }); - }); - it("should apply correct exponential backoff with jitter", async () => { setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { process.nextTick(callback); @@ -158,6 +98,7 @@ describe("requestWithRetries", () => { await jest.runAllTimersAsync(); await responsePromise; + // Verify setTimeout calls expect(setTimeoutSpy).toHaveBeenCalledTimes(expectedDelays.length); expectedDelays.forEach((delay, index) => { @@ -188,27 +129,4 @@ describe("requestWithRetries", () => { expect(response1.status).toBe(200); expect(response2.status).toBe(200); }); - - it("should cap delay at MAX_RETRY_DELAY for large header values", async () => { - setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { - process.nextTick(callback); - return null as any; - }); - - mockFetch - .mockResolvedValueOnce( - new Response("", { - status: 429, - headers: new Headers({ "retry-after": "120" }), // 120 seconds = 120000ms > MAX_RETRY_DELAY (60000ms) - }), - ) - .mockResolvedValueOnce(new Response("", { status: 200 })); - - const responsePromise = requestWithRetries(() => mockFetch(), 1); - await jest.runAllTimersAsync(); - const response = await responsePromise; - - expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), 60000); - expect(response.status).toBe(200); - }); }); diff --git a/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts b/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts index 57892e4d9..172c1c26b 100644 --- a/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts +++ b/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts @@ -61,7 +61,7 @@ describe("Node18UniversalStreamWrapper", () => { }); const stream = new Node18UniversalStreamWrapper(rawStream); const dest = new (await import("readable-stream")).Writable({ - write(chunk, _encoding, callback) { + write(chunk, encoding, callback) { expect(chunk.toString()).toEqual("test"); callback(); }, diff --git a/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts b/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts index f47b166c2..19c26668e 100644 --- a/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts +++ b/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts @@ -37,7 +37,7 @@ describe("NodePre18StreamWrapper", () => { const rawStream = (await import("readable-stream")).Readable.from(["test", "test"]); const stream = new NodePre18StreamWrapper(rawStream); const dest = new (await import("readable-stream")).Writable({ - write(chunk, _encoding, callback) { + write(chunk, encoding, callback) { expect(chunk.toString()).toEqual("test"); callback(); }, @@ -51,7 +51,7 @@ describe("NodePre18StreamWrapper", () => { const stream = new NodePre18StreamWrapper(rawStream); const buffer: Uint8Array[] = []; const dest = new (await import("readable-stream")).Writable({ - write(chunk, _encoding, callback) { + write(chunk, encoding, callback) { buffer.push(chunk); callback(); }, diff --git a/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts b/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts index 56cba3462..5752c8af5 100644 --- a/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts +++ b/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts @@ -1,7 +1,7 @@ -import { chooseStreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/chooseStreamWrapper"; import { Node18UniversalStreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper"; import { NodePre18StreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/NodePre18StreamWrapper"; import { UndiciStreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/UndiciStreamWrapper"; +import { chooseStreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/chooseStreamWrapper"; import { RUNTIME } from "../../../../src/core/runtime"; describe("chooseStreamWrapper", () => { diff --git a/tests/unit/file/file.test.ts b/tests/unit/file/file.test.ts deleted file mode 100644 index 51a8bc463..000000000 --- a/tests/unit/file/file.test.ts +++ /dev/null @@ -1,498 +0,0 @@ -import fs from "fs"; -import { join } from "path"; -import { Readable } from "stream"; -import { toBinaryUploadRequest, type Uploadable } from "../../../src/core/file/index"; - -describe("toBinaryUploadRequest", () => { - const TEST_FILE_PATH = join(__dirname, "..", "test-file.txt"); - - beforeEach(() => { - jest.clearAllMocks(); - }); - - describe("Buffer input", () => { - it("should handle Buffer with all metadata", async () => { - const buffer = Buffer.from("test data"); - const input: Uploadable.WithMetadata = { - data: buffer, - filename: "test.txt", - contentType: "text/plain", - contentLength: 42, - }; - - const result = await toBinaryUploadRequest(input); - - expect(result.body).toBe(buffer); - expect(result.headers).toEqual({ - "Content-Disposition": 'attachment; filename="test.txt"', - "Content-Type": "text/plain", - "Content-Length": "42", - }); - }); - - it("should handle Buffer without metadata", async () => { - const buffer = Buffer.from("test data"); - const input: Uploadable.WithMetadata = { - data: buffer, - }; - - const result = await toBinaryUploadRequest(input); - - expect(result.body).toBe(buffer); - expect(result.headers).toEqual({ - "Content-Length": "9", // buffer.length - }); - }); - - it("should handle Buffer passed directly", async () => { - const buffer = Buffer.from("test data"); - - const result = await toBinaryUploadRequest(buffer); - - expect(result.body).toBe(buffer); - expect(result.headers).toEqual({ - "Content-Length": "9", // buffer.length - }); - }); - }); - - describe("ArrayBuffer input", () => { - it("should handle ArrayBuffer with metadata", async () => { - const arrayBuffer = new ArrayBuffer(10); - const input: Uploadable.WithMetadata = { - data: arrayBuffer, - filename: "data.bin", - contentType: "application/octet-stream", - }; - - const result = await toBinaryUploadRequest(input); - - expect(result.body).toBe(arrayBuffer); - expect(result.headers).toEqual({ - "Content-Disposition": 'attachment; filename="data.bin"', - "Content-Type": "application/octet-stream", - "Content-Length": "10", // arrayBuffer.byteLength - }); - }); - - it("should handle ArrayBuffer passed directly", async () => { - const arrayBuffer = new ArrayBuffer(10); - - const result = await toBinaryUploadRequest(arrayBuffer); - - expect(result.body).toBe(arrayBuffer); - expect(result.headers).toEqual({ - "Content-Length": "10", // arrayBuffer.byteLength - }); - }); - }); - - describe("Uint8Array input", () => { - it("should handle Uint8Array with metadata", async () => { - const uint8Array = new Uint8Array([1, 2, 3, 4, 5]); - const input: Uploadable.WithMetadata = { - data: uint8Array, - filename: "bytes.bin", - contentType: "application/octet-stream", - }; - - const result = await toBinaryUploadRequest(input); - - expect(result.body).toBe(uint8Array); - expect(result.headers).toEqual({ - "Content-Disposition": 'attachment; filename="bytes.bin"', - "Content-Type": "application/octet-stream", - "Content-Length": "5", // uint8Array.byteLength - }); - }); - - it("should handle Uint8Array passed directly", async () => { - const uint8Array = new Uint8Array([1, 2, 3, 4, 5]); - - const result = await toBinaryUploadRequest(uint8Array); - - expect(result.body).toBe(uint8Array); - expect(result.headers).toEqual({ - "Content-Length": "5", // uint8Array.byteLength - }); - }); - }); - - describe("Blob input", () => { - it("should handle Blob with metadata", async () => { - const blob = new Blob(["test content"], { type: "text/plain" }); - const input: Uploadable.WithMetadata = { - data: blob, - filename: "override.txt", - contentType: "text/html", // Override blob's type - }; - - const result = await toBinaryUploadRequest(input); - - expect(result.body).toBe(blob); - expect(result.headers).toEqual({ - "Content-Disposition": 'attachment; filename="override.txt"', - "Content-Type": "text/html", // Should use provided contentType - "Content-Length": "12", // blob.size - }); - }); - - it("should handle Blob with intrinsic type", async () => { - const blob = new Blob(["test content"], { type: "application/json" }); - const input: Uploadable.WithMetadata = { - data: blob, - filename: "data.json", - }; - - const result = await toBinaryUploadRequest(input); - - expect(result.body).toBe(blob); - expect(result.headers).toEqual({ - "Content-Disposition": 'attachment; filename="data.json"', - "Content-Type": "application/json", // Should use blob's type - "Content-Length": "12", // blob.size - }); - }); - - it("should handle Blob passed directly", async () => { - const blob = new Blob(["test content"], { type: "text/plain" }); - - const result = await toBinaryUploadRequest(blob); - - expect(result.body).toBe(blob); - expect(result.headers).toEqual({ - "Content-Type": "text/plain", // Should use blob's type - "Content-Length": "12", // blob.size - }); - }); - }); - - describe("File input", () => { - it("should handle File with metadata", async () => { - const file = new File(["file content"], "original.txt", { type: "text/plain" }); - const input: Uploadable.WithMetadata = { - data: file, - filename: "renamed.txt", - contentType: "text/html", // Override file's type - }; - - const result = await toBinaryUploadRequest(input); - - expect(result.body).toBe(file); - expect(result.headers).toEqual({ - "Content-Disposition": 'attachment; filename="renamed.txt"', - "Content-Type": "text/html", // Should use provided contentType - "Content-Length": "12", // file.size - }); - }); - - it("should handle File with intrinsic properties", async () => { - const file = new File(["file content"], "test.json", { type: "application/json" }); - const input: Uploadable.WithMetadata = { - data: file, - }; - - const result = await toBinaryUploadRequest(input); - - expect(result.body).toBe(file); - expect(result.headers).toEqual({ - "Content-Disposition": 'attachment; filename="test.json"', // Should use file's name - "Content-Type": "application/json", // Should use file's type - "Content-Length": "12", // file.size - }); - }); - - it("should handle File passed directly", async () => { - const file = new File(["file content"], "direct.txt", { type: "text/plain" }); - - const result = await toBinaryUploadRequest(file); - - expect(result.body).toBe(file); - expect(result.headers).toEqual({ - "Content-Disposition": 'attachment; filename="direct.txt"', - "Content-Type": "text/plain", - "Content-Length": "12", // file.size - }); - }); - }); - - describe("ReadableStream input", () => { - it("should handle ReadableStream with metadata", async () => { - const stream = new ReadableStream({ - start(controller) { - controller.enqueue(new TextEncoder().encode("stream data")); - controller.close(); - }, - }); - const input: Uploadable.WithMetadata = { - data: stream, - filename: "stream.txt", - contentType: "text/plain", - contentLength: 100, - }; - - const result = await toBinaryUploadRequest(input); - - expect(result.body).toBe(stream); - expect(result.headers).toEqual({ - "Content-Disposition": 'attachment; filename="stream.txt"', - "Content-Type": "text/plain", - "Content-Length": "100", // Should use provided contentLength - }); - }); - - it("should handle ReadableStream without size", async () => { - const stream = new ReadableStream({ - start(controller) { - controller.enqueue(new TextEncoder().encode("stream data")); - controller.close(); - }, - }); - const input: Uploadable.WithMetadata = { - data: stream, - filename: "stream.txt", - contentType: "text/plain", - }; - - const result = await toBinaryUploadRequest(input); - - expect(result.body).toBe(stream); - expect(result.headers).toEqual({ - "Content-Disposition": 'attachment; filename="stream.txt"', - "Content-Type": "text/plain", - // No Content-Length header since it cannot be determined from ReadableStream - }); - }); - - it("should handle ReadableStream passed directly", async () => { - const stream = new ReadableStream({ - start(controller) { - controller.enqueue(new TextEncoder().encode("stream data")); - controller.close(); - }, - }); - - const result = await toBinaryUploadRequest(stream); - - expect(result.body).toBe(stream); - expect(result.headers).toEqual({ - // No headers since no metadata provided and cannot be determined - }); - }); - }); - - describe("Node.js Readable stream input", () => { - it("should handle Readable stream with metadata", async () => { - const readable = new Readable({ - read() { - this.push("readable data"); - this.push(null); - }, - }); - const input: Uploadable.WithMetadata = { - data: readable, - filename: "readable.txt", - contentType: "text/plain", - contentLength: 50, - }; - - const result = await toBinaryUploadRequest(input); - - expect(result.body).toBe(readable); - expect(result.headers).toEqual({ - "Content-Disposition": 'attachment; filename="readable.txt"', - "Content-Type": "text/plain", - "Content-Length": "50", // Should use provided contentLength - }); - }); - - it("should handle Readable stream without size", async () => { - const readable = new Readable({ - read() { - this.push("readable data"); - this.push(null); - }, - }); - const input: Uploadable.WithMetadata = { - data: readable, - filename: "readable.txt", - contentType: "text/plain", - }; - - const result = await toBinaryUploadRequest(input); - - expect(result.body).toBe(readable); - expect(result.headers).toEqual({ - "Content-Disposition": 'attachment; filename="readable.txt"', - "Content-Type": "text/plain", - // No Content-Length header since it cannot be determined from Readable - }); - }); - - it("should handle Readable stream passed directly", async () => { - const readable = new Readable({ - read() { - this.push("readable data"); - this.push(null); - }, - }); - - const result = await toBinaryUploadRequest(readable); - - expect(result.body).toBe(readable); - expect(result.headers).toEqual({ - // No headers since no metadata provided and cannot be determined - }); - }); - }); - - describe("File path input (FromPath type)", () => { - it("should handle file path with all metadata", async () => { - const input: Uploadable.FromPath = { - path: TEST_FILE_PATH, - filename: "custom.txt", - contentType: "text/html", - contentLength: 42, - }; - - const result = await toBinaryUploadRequest(input); - - expect(result.body).toBeInstanceOf(fs.ReadStream); - expect(result.headers).toEqual({ - "Content-Disposition": 'attachment; filename="custom.txt"', - "Content-Type": "text/html", - "Content-Length": "42", // Should use provided contentLength - }); - }); - - it("should handle file path with minimal metadata", async () => { - const input: Uploadable.FromPath = { - path: TEST_FILE_PATH, - contentType: "text/plain", - }; - - const result = await toBinaryUploadRequest(input); - - expect(result.body).toBeInstanceOf(fs.ReadStream); - expect(result.headers).toEqual({ - "Content-Disposition": 'attachment; filename="test-file.txt"', // Should extract from path - "Content-Type": "text/plain", - "Content-Length": "21", // Should determine from file system (test file is 21 bytes) - }); - }); - - it("should handle file path with no metadata", async () => { - const input: Uploadable.FromPath = { - path: TEST_FILE_PATH, - }; - - const result = await toBinaryUploadRequest(input); - - expect(result.body).toBeInstanceOf(fs.ReadStream); - expect(result.headers).toEqual({ - "Content-Disposition": 'attachment; filename="test-file.txt"', // Should extract from path - "Content-Length": "21", // Should determine from file system (test file is 21 bytes) - }); - }); - }); - - describe("ArrayBufferView input", () => { - it("should handle ArrayBufferView with metadata", async () => { - const arrayBuffer = new ArrayBuffer(10); - const arrayBufferView = new Int8Array(arrayBuffer); - const input: Uploadable.WithMetadata = { - data: arrayBufferView, - filename: "view.bin", - contentType: "application/octet-stream", - }; - - const result = await toBinaryUploadRequest(input); - - expect(result.body).toBe(arrayBufferView); - expect(result.headers).toEqual({ - "Content-Disposition": 'attachment; filename="view.bin"', - "Content-Type": "application/octet-stream", - "Content-Length": "10", // arrayBufferView.byteLength - }); - }); - - it("should handle ArrayBufferView passed directly", async () => { - const arrayBuffer = new ArrayBuffer(10); - const arrayBufferView = new Int8Array(arrayBuffer); - - const result = await toBinaryUploadRequest(arrayBufferView); - - expect(result.body).toBe(arrayBufferView); - expect(result.headers).toEqual({ - "Content-Length": "10", // arrayBufferView.byteLength - }); - }); - }); - - describe("Edge cases", () => { - it("should handle empty headers when no metadata is available", async () => { - const buffer = Buffer.from(""); - const input: Uploadable.WithMetadata = { - data: buffer, - }; - - const result = await toBinaryUploadRequest(input); - - expect(result.body).toBe(buffer); - expect(result.headers).toEqual({ - "Content-Length": "0", - }); - }); - - it("should handle zero contentLength", async () => { - const buffer = Buffer.from("test"); - const input: Uploadable.WithMetadata = { - data: buffer, - contentLength: 0, - }; - - const result = await toBinaryUploadRequest(input); - - expect(result.body).toBe(buffer); - expect(result.headers).toEqual({ - "Content-Length": "0", // Should use provided 0 - }); - }); - - it("should handle null filename", async () => { - const buffer = Buffer.from("test"); - const input: Uploadable.WithMetadata = { - data: buffer, - filename: undefined, - contentType: "text/plain", - }; - - const result = await toBinaryUploadRequest(input); - - expect(result.body).toBe(buffer); - expect(result.headers).toEqual({ - "Content-Type": "text/plain", - "Content-Length": "4", - // No Content-Disposition since filename is undefined - }); - }); - - it("should handle null contentType", async () => { - const buffer = Buffer.from("test"); - const input: Uploadable.WithMetadata = { - data: buffer, - filename: "test.txt", - contentType: undefined, - }; - - const result = await toBinaryUploadRequest(input); - - expect(result.body).toBe(buffer); - expect(result.headers).toEqual({ - "Content-Disposition": 'attachment; filename="test.txt"', - "Content-Length": "4", - // No Content-Type since contentType is undefined - }); - }); - }); -}); diff --git a/tests/unit/form-data-utils/formDataWrapper.test.ts b/tests/unit/form-data-utils/formDataWrapper.test.ts index 28c9f9bba..095a1055b 100644 --- a/tests/unit/form-data-utils/formDataWrapper.test.ts +++ b/tests/unit/form-data-utils/formDataWrapper.test.ts @@ -14,10 +14,7 @@ describe("CrossPlatformFormData", () => { const value = (await import("stream")).Readable.from(["file content"]); const filename = "testfile.txt"; - await formData.appendFile("file", { - data: value, - filename, - }); + await formData.appendFile("file", value, filename); const request = await formData.getRequest(); const decoder = new TextDecoder("utf-8"); @@ -32,10 +29,7 @@ describe("CrossPlatformFormData", () => { const value = new Blob(["file content"], { type: "text/plain" }); const filename = "testfile.txt"; - await formData.appendFile("file", { - data: value, - filename, - }); + await formData.appendFile("file", value, filename); const request = await formData.getRequest(); const decoder = new TextDecoder("utf-8"); @@ -50,10 +44,7 @@ describe("CrossPlatformFormData", () => { const filename = "testfile.txt"; const value = new (await import("buffer")).File(["file content"], filename); - await formData.appendFile("file", { - data: value, - filename, - }); + await formData.appendFile("file", value); const request = await formData.getRequest(); const decoder = new TextDecoder("utf-8"); @@ -68,7 +59,7 @@ describe("CrossPlatformFormData", () => { const filename = "testfile.txt"; const value = new (await import("buffer")).File(["file content"], filename); - await formData.appendFile("file", { data: value, filename: "test.txt" }); + await formData.appendFile("file", value, "test.txt"); const request = await formData.getRequest(); const decoder = new TextDecoder("utf-8"); @@ -92,7 +83,7 @@ describe("CrossPlatformFormData", () => { for await (const chunk of request.body) { data += decoder.decode(chunk); } - expect(data).toContain(`Content-Disposition: form-data; name=\"file\"; filename=\"${expectedFileName}\"`); + expect(data).toContain('Content-Disposition: form-data; name="file"; filename="' + expectedFileName + '"'); }); }); @@ -108,10 +99,7 @@ describe("CrossPlatformFormData", () => { const value = (await import("stream")).Readable.from(["file content"]); const filename = "testfile.txt"; - await formData.appendFile("file", { - data: value, - filename, - }); + await formData.appendFile("file", value, filename); const request = formData.getRequest(); expect(request.body.get("file").name).toBe(filename); @@ -121,10 +109,7 @@ describe("CrossPlatformFormData", () => { const value = new Blob(["file content"], { type: "text/plain" }); const filename = "testfile.txt"; - await formData.appendFile("file", { - data: value, - filename, - }); + await formData.appendFile("file", value, filename); const request = formData.getRequest(); @@ -145,10 +130,7 @@ describe("CrossPlatformFormData", () => { const filename = "testfile.txt"; const value = new (await import("buffer")).File(["file content"], filename); - await formData.appendFile("file", { - data: value, - filename: "test.txt", - }); + await formData.appendFile("file", value, "test.txt"); const request = formData.getRequest(); expect(request.body.get("file").name).toBe("test.txt"); diff --git a/tests/unit/logging/logger.test.ts b/tests/unit/logging/logger.test.ts deleted file mode 100644 index 70cabc2aa..000000000 --- a/tests/unit/logging/logger.test.ts +++ /dev/null @@ -1,454 +0,0 @@ -import { ConsoleLogger, createLogger, Logger, LogLevel } from "../../../src/core/logging/logger"; - -function createMockLogger() { - return { - debug: jest.fn(), - info: jest.fn(), - warn: jest.fn(), - error: jest.fn(), - }; -} - -describe("Logger", () => { - describe("LogLevel", () => { - it("should have correct log levels", () => { - expect(LogLevel.Debug).toBe("debug"); - expect(LogLevel.Info).toBe("info"); - expect(LogLevel.Warn).toBe("warn"); - expect(LogLevel.Error).toBe("error"); - }); - }); - - describe("ConsoleLogger", () => { - let consoleLogger: ConsoleLogger; - let consoleSpy: { - debug: ReturnType; - info: ReturnType; - warn: ReturnType; - error: ReturnType; - }; - - beforeEach(() => { - consoleLogger = new ConsoleLogger(); - consoleSpy = { - debug: jest.spyOn(console, "debug").mockImplementation(() => {}), - info: jest.spyOn(console, "info").mockImplementation(() => {}), - warn: jest.spyOn(console, "warn").mockImplementation(() => {}), - error: jest.spyOn(console, "error").mockImplementation(() => {}), - }; - }); - - afterEach(() => { - consoleSpy.debug.mockRestore(); - consoleSpy.info.mockRestore(); - consoleSpy.warn.mockRestore(); - consoleSpy.error.mockRestore(); - }); - - it("should log debug messages", () => { - consoleLogger.debug("debug message", { data: "test" }); - expect(consoleSpy.debug).toHaveBeenCalledWith("debug message", { data: "test" }); - }); - - it("should log info messages", () => { - consoleLogger.info("info message", { data: "test" }); - expect(consoleSpy.info).toHaveBeenCalledWith("info message", { data: "test" }); - }); - - it("should log warn messages", () => { - consoleLogger.warn("warn message", { data: "test" }); - expect(consoleSpy.warn).toHaveBeenCalledWith("warn message", { data: "test" }); - }); - - it("should log error messages", () => { - consoleLogger.error("error message", { data: "test" }); - expect(consoleSpy.error).toHaveBeenCalledWith("error message", { data: "test" }); - }); - - it("should handle multiple arguments", () => { - consoleLogger.debug("message", "arg1", "arg2", { key: "value" }); - expect(consoleSpy.debug).toHaveBeenCalledWith("message", "arg1", "arg2", { key: "value" }); - }); - }); - - describe("Logger with level filtering", () => { - let mockLogger: { - debug: ReturnType; - info: ReturnType; - warn: ReturnType; - error: ReturnType; - }; - - beforeEach(() => { - mockLogger = createMockLogger(); - }); - - describe("Debug level", () => { - it("should log all levels when set to debug", () => { - const logger = new Logger({ - level: LogLevel.Debug, - logger: mockLogger, - silent: false, - }); - - logger.debug("debug"); - logger.info("info"); - logger.warn("warn"); - logger.error("error"); - - expect(mockLogger.debug).toHaveBeenCalledWith("debug"); - expect(mockLogger.info).toHaveBeenCalledWith("info"); - expect(mockLogger.warn).toHaveBeenCalledWith("warn"); - expect(mockLogger.error).toHaveBeenCalledWith("error"); - }); - - it("should report correct level checks", () => { - const logger = new Logger({ - level: LogLevel.Debug, - logger: mockLogger, - silent: false, - }); - - expect(logger.isDebug()).toBe(true); - expect(logger.isInfo()).toBe(true); - expect(logger.isWarn()).toBe(true); - expect(logger.isError()).toBe(true); - }); - }); - - describe("Info level", () => { - it("should log info, warn, and error when set to info", () => { - const logger = new Logger({ - level: LogLevel.Info, - logger: mockLogger, - silent: false, - }); - - logger.debug("debug"); - logger.info("info"); - logger.warn("warn"); - logger.error("error"); - - expect(mockLogger.debug).not.toHaveBeenCalled(); - expect(mockLogger.info).toHaveBeenCalledWith("info"); - expect(mockLogger.warn).toHaveBeenCalledWith("warn"); - expect(mockLogger.error).toHaveBeenCalledWith("error"); - }); - - it("should report correct level checks", () => { - const logger = new Logger({ - level: LogLevel.Info, - logger: mockLogger, - silent: false, - }); - - expect(logger.isDebug()).toBe(false); - expect(logger.isInfo()).toBe(true); - expect(logger.isWarn()).toBe(true); - expect(logger.isError()).toBe(true); - }); - }); - - describe("Warn level", () => { - it("should log warn and error when set to warn", () => { - const logger = new Logger({ - level: LogLevel.Warn, - logger: mockLogger, - silent: false, - }); - - logger.debug("debug"); - logger.info("info"); - logger.warn("warn"); - logger.error("error"); - - expect(mockLogger.debug).not.toHaveBeenCalled(); - expect(mockLogger.info).not.toHaveBeenCalled(); - expect(mockLogger.warn).toHaveBeenCalledWith("warn"); - expect(mockLogger.error).toHaveBeenCalledWith("error"); - }); - - it("should report correct level checks", () => { - const logger = new Logger({ - level: LogLevel.Warn, - logger: mockLogger, - silent: false, - }); - - expect(logger.isDebug()).toBe(false); - expect(logger.isInfo()).toBe(false); - expect(logger.isWarn()).toBe(true); - expect(logger.isError()).toBe(true); - }); - }); - - describe("Error level", () => { - it("should only log error when set to error", () => { - const logger = new Logger({ - level: LogLevel.Error, - logger: mockLogger, - silent: false, - }); - - logger.debug("debug"); - logger.info("info"); - logger.warn("warn"); - logger.error("error"); - - expect(mockLogger.debug).not.toHaveBeenCalled(); - expect(mockLogger.info).not.toHaveBeenCalled(); - expect(mockLogger.warn).not.toHaveBeenCalled(); - expect(mockLogger.error).toHaveBeenCalledWith("error"); - }); - - it("should report correct level checks", () => { - const logger = new Logger({ - level: LogLevel.Error, - logger: mockLogger, - silent: false, - }); - - expect(logger.isDebug()).toBe(false); - expect(logger.isInfo()).toBe(false); - expect(logger.isWarn()).toBe(false); - expect(logger.isError()).toBe(true); - }); - }); - - describe("Silent mode", () => { - it("should not log anything when silent is true", () => { - const logger = new Logger({ - level: LogLevel.Debug, - logger: mockLogger, - silent: true, - }); - - logger.debug("debug"); - logger.info("info"); - logger.warn("warn"); - logger.error("error"); - - expect(mockLogger.debug).not.toHaveBeenCalled(); - expect(mockLogger.info).not.toHaveBeenCalled(); - expect(mockLogger.warn).not.toHaveBeenCalled(); - expect(mockLogger.error).not.toHaveBeenCalled(); - }); - - it("should report all level checks as false when silent", () => { - const logger = new Logger({ - level: LogLevel.Debug, - logger: mockLogger, - silent: true, - }); - - expect(logger.isDebug()).toBe(false); - expect(logger.isInfo()).toBe(false); - expect(logger.isWarn()).toBe(false); - expect(logger.isError()).toBe(false); - }); - }); - - describe("shouldLog", () => { - it("should correctly determine if level should be logged", () => { - const logger = new Logger({ - level: LogLevel.Info, - logger: mockLogger, - silent: false, - }); - - expect(logger.shouldLog(LogLevel.Debug)).toBe(false); - expect(logger.shouldLog(LogLevel.Info)).toBe(true); - expect(logger.shouldLog(LogLevel.Warn)).toBe(true); - expect(logger.shouldLog(LogLevel.Error)).toBe(true); - }); - - it("should return false for all levels when silent", () => { - const logger = new Logger({ - level: LogLevel.Debug, - logger: mockLogger, - silent: true, - }); - - expect(logger.shouldLog(LogLevel.Debug)).toBe(false); - expect(logger.shouldLog(LogLevel.Info)).toBe(false); - expect(logger.shouldLog(LogLevel.Warn)).toBe(false); - expect(logger.shouldLog(LogLevel.Error)).toBe(false); - }); - }); - - describe("Multiple arguments", () => { - it("should pass multiple arguments to logger", () => { - const logger = new Logger({ - level: LogLevel.Debug, - logger: mockLogger, - silent: false, - }); - - logger.debug("message", "arg1", { key: "value" }, 123); - expect(mockLogger.debug).toHaveBeenCalledWith("message", "arg1", { key: "value" }, 123); - }); - }); - }); - - describe("createLogger", () => { - it("should return default logger when no config provided", () => { - const logger = createLogger(); - expect(logger).toBeInstanceOf(Logger); - }); - - it("should return same logger instance when Logger is passed", () => { - const customLogger = new Logger({ - level: LogLevel.Debug, - logger: new ConsoleLogger(), - silent: false, - }); - - const result = createLogger(customLogger); - expect(result).toBe(customLogger); - }); - - it("should create logger with custom config", () => { - const mockLogger = createMockLogger(); - - const logger = createLogger({ - level: LogLevel.Warn, - logger: mockLogger, - silent: false, - }); - - expect(logger).toBeInstanceOf(Logger); - logger.warn("test"); - expect(mockLogger.warn).toHaveBeenCalledWith("test"); - }); - - it("should use default values for missing config", () => { - const logger = createLogger({}); - expect(logger).toBeInstanceOf(Logger); - }); - - it("should override default level", () => { - const mockLogger = createMockLogger(); - - const logger = createLogger({ - level: LogLevel.Debug, - logger: mockLogger, - silent: false, - }); - - logger.debug("test"); - expect(mockLogger.debug).toHaveBeenCalledWith("test"); - }); - - it("should override default silent mode", () => { - const mockLogger = createMockLogger(); - - const logger = createLogger({ - logger: mockLogger, - silent: false, - }); - - logger.info("test"); - expect(mockLogger.info).toHaveBeenCalledWith("test"); - }); - - it("should use provided logger implementation", () => { - const customLogger = createMockLogger(); - - const logger = createLogger({ - logger: customLogger, - level: LogLevel.Debug, - silent: false, - }); - - logger.debug("test"); - expect(customLogger.debug).toHaveBeenCalledWith("test"); - }); - - it("should default to silent: true", () => { - const mockLogger = createMockLogger(); - - const logger = createLogger({ - logger: mockLogger, - level: LogLevel.Debug, - }); - - logger.debug("test"); - expect(mockLogger.debug).not.toHaveBeenCalled(); - }); - }); - - describe("Default logger", () => { - it("should have silent: true by default", () => { - const logger = createLogger(); - expect(logger.shouldLog(LogLevel.Info)).toBe(false); - }); - - it("should not log when using default logger", () => { - const logger = createLogger(); - - logger.info("test"); - expect(logger.isInfo()).toBe(false); - }); - }); - - describe("Edge cases", () => { - it("should handle empty message", () => { - const mockLogger = createMockLogger(); - - const logger = new Logger({ - level: LogLevel.Debug, - logger: mockLogger, - silent: false, - }); - - logger.debug(""); - expect(mockLogger.debug).toHaveBeenCalledWith(""); - }); - - it("should handle no arguments", () => { - const mockLogger = createMockLogger(); - - const logger = new Logger({ - level: LogLevel.Debug, - logger: mockLogger, - silent: false, - }); - - logger.debug("message"); - expect(mockLogger.debug).toHaveBeenCalledWith("message"); - }); - - it("should handle complex objects", () => { - const mockLogger = createMockLogger(); - - const logger = new Logger({ - level: LogLevel.Debug, - logger: mockLogger, - silent: false, - }); - - const complexObject = { - nested: { key: "value" }, - array: [1, 2, 3], - fn: () => "test", - }; - - logger.debug("message", complexObject); - expect(mockLogger.debug).toHaveBeenCalledWith("message", complexObject); - }); - - it("should handle errors as arguments", () => { - const mockLogger = createMockLogger(); - - const logger = new Logger({ - level: LogLevel.Error, - logger: mockLogger, - silent: false, - }); - - const error = new Error("Test error"); - logger.error("Error occurred", error); - expect(mockLogger.error).toHaveBeenCalledWith("Error occurred", error); - }); - }); -}); diff --git a/tests/unit/schemas/lazy/lazy.test.ts b/tests/unit/schemas/lazy/lazy.test.ts index 57a76df27..3a5a338d6 100644 --- a/tests/unit/schemas/lazy/lazy.test.ts +++ b/tests/unit/schemas/lazy/lazy.test.ts @@ -1,5 +1,5 @@ +import { Schema } from "../../../../src/core/schemas/Schema"; import { lazy, list, object, string } from "../../../../src/core/schemas/builders"; -import type { Schema } from "../../../../src/core/schemas/Schema"; import { itSchemaIdentity } from "../utils/itSchema"; describe("lazy", () => { diff --git a/tests/unit/schemas/primitives/never.test.ts b/tests/unit/schemas/primitives/never.test.ts deleted file mode 100644 index 1d18eba05..000000000 --- a/tests/unit/schemas/primitives/never.test.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { never } from "../../../../src/core/schemas/builders"; - -describe("never", () => { - it("always fails to parse", () => { - const schema = never(); - const result = schema.parse("test"); - expect(result.ok).toBe(false); - if (!result.ok) { - expect(result.errors).toHaveLength(1); - expect(result.errors[0]?.message).toBe("Expected never"); - } - }); - - it("always fails to json", () => { - const schema = never(); - const result = schema.json("test"); - expect(result.ok).toBe(false); - if (!result.ok) { - expect(result.errors).toHaveLength(1); - expect(result.errors[0]?.message).toBe("Expected never"); - } - }); - - it("fails with any value including undefined", () => { - const schema = never(); - expect(schema.parse(undefined).ok).toBe(false); - expect(schema.parse(null).ok).toBe(false); - expect(schema.parse(0).ok).toBe(false); - expect(schema.parse("").ok).toBe(false); - expect(schema.parse({}).ok).toBe(false); - expect(schema.parse([]).ok).toBe(false); - }); - - it("works when called without options parameter", () => { - const schema = never(); - // This tests that the default = {} parameter works correctly - const result = schema.parse("test"); - expect(result.ok).toBe(false); - if (!result.ok) { - expect(result.errors).toHaveLength(1); - expect(result.errors[0]?.message).toBe("Expected never"); - expect(result.errors[0]?.path).toEqual([]); - } - }); - - it("succeeds with skipValidation", () => { - const schema = never(); - const result = schema.parse("test", { skipValidation: true }); - expect(result.ok).toBe(true); - if (result.ok) { - expect(result.value).toBe("test"); - } - }); -}); diff --git a/tests/unit/schemas/schema-utils/getSchemaUtils.test.ts b/tests/unit/schemas/schema-utils/getSchemaUtils.test.ts index 822c3ca4e..09d594d07 100644 --- a/tests/unit/schemas/schema-utils/getSchemaUtils.test.ts +++ b/tests/unit/schemas/schema-utils/getSchemaUtils.test.ts @@ -18,7 +18,7 @@ describe("getSchemaUtils", () => { itSchema( "transform and untransform run correctly", string().transform({ - transform: (x) => `${x}X`, + transform: (x) => x + "X", untransform: (x) => (x as string).slice(0, -1), }), { @@ -36,7 +36,7 @@ describe("getSchemaUtils", () => { it("throws on invalid value", async () => { const value = () => object({ a: string(), b: string() }).parseOrThrow({ a: 24 }); - expect(value).toThrowError('a: Expected string. Received 24.; Missing required key "b"'); + expect(value).toThrowError(new Error('a: Expected string. Received 24.; Missing required key "b"')); }); }); @@ -48,7 +48,7 @@ describe("getSchemaUtils", () => { it("throws on invalid value", async () => { const value = () => object({ a: string(), b: string() }).jsonOrThrow({ a: 24 }); - expect(value).toThrowError('a: Expected string. Received 24.; Missing required key "b"'); + expect(value).toThrowError(new Error('a: Expected string. Received 24.; Missing required key "b"')); }); }); diff --git a/tests/unit/schemas/utils/itSchema.ts b/tests/unit/schemas/utils/itSchema.ts index a1e1cae92..82a538878 100644 --- a/tests/unit/schemas/utils/itSchema.ts +++ b/tests/unit/schemas/utils/itSchema.ts @@ -1,5 +1,5 @@ /* eslint-disable jest/no-export */ -import type { Schema, SchemaOptions } from "../../../../src/core/schemas/Schema"; +import { Schema, SchemaOptions } from "../../../../src/core/schemas/Schema"; export function itSchemaIdentity( schema: Schema, @@ -48,7 +48,7 @@ export function itParse( it(title, () => { const maybeValid = schema.parse(raw, opts); if (!maybeValid.ok) { - throw new Error(`Failed to parse() ${JSON.stringify(maybeValid.errors, undefined, 4)}`); + throw new Error("Failed to parse() " + JSON.stringify(maybeValid.errors, undefined, 4)); } expect(maybeValid.value).toStrictEqual(parsed); }); @@ -71,7 +71,7 @@ export function itJson( it(title, () => { const maybeValid = schema.json(parsed, opts); if (!maybeValid.ok) { - throw new Error(`Failed to json() ${JSON.stringify(maybeValid.errors, undefined, 4)}`); + 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 index ffe40cef9..ead1ca70b 100644 --- a/tests/unit/schemas/utils/itValidate.ts +++ b/tests/unit/schemas/utils/itValidate.ts @@ -1,5 +1,5 @@ /* eslint-disable jest/no-export */ -import type { Schema, SchemaOptions, ValidationError } from "../../../../src/core/schemas/Schema"; +import { Schema, SchemaOptions, ValidationError } from "../../../../src/core/schemas/Schema"; export function itValidate( title: string, diff --git a/tests/unit/test-file.txt b/tests/unit/test-file.txt deleted file mode 100644 index c66d471e3..000000000 --- a/tests/unit/test-file.txt +++ /dev/null @@ -1 +0,0 @@ -This is a test file! diff --git a/tests/unit/url/join.test.ts b/tests/unit/url/join.test.ts index 123488f08..394628995 100644 --- a/tests/unit/url/join.test.ts +++ b/tests/unit/url/join.test.ts @@ -1,223 +1,88 @@ import { join } from "../../../src/core/url/index"; describe("join", () => { - interface TestCase { - description: string; - base: string; - segments: string[]; - expected: string; - } - describe("basic functionality", () => { - const basicTests: TestCase[] = [ - { description: "should return empty string for empty base", base: "", segments: [], expected: "" }, - { - description: "should return empty string for empty base with path", - base: "", - segments: ["path"], - expected: "", - }, - { - description: "should handle single segment", - base: "base", - segments: ["segment"], - expected: "base/segment", - }, - { - description: "should handle single segment with trailing slash on base", - base: "base/", - segments: ["segment"], - expected: "base/segment", - }, - { - description: "should handle single segment with leading slash", - base: "base", - segments: ["/segment"], - expected: "base/segment", - }, - { - description: "should handle single segment with both slashes", - base: "base/", - segments: ["/segment"], - expected: "base/segment", - }, - { - description: "should handle multiple segments", - base: "base", - segments: ["path1", "path2", "path3"], - expected: "base/path1/path2/path3", - }, - { - description: "should handle multiple segments with slashes", - base: "base/", - segments: ["/path1/", "/path2/", "/path3/"], - expected: "base/path1/path2/path3/", - }, - ]; + it("should return empty string for empty base", () => { + expect(join("")).toBe(""); + expect(join("", "path")).toBe(""); + }); + + it("should handle single segment", () => { + expect(join("base", "segment")).toBe("base/segment"); + expect(join("base/", "segment")).toBe("base/segment"); + expect(join("base", "/segment")).toBe("base/segment"); + expect(join("base/", "/segment")).toBe("base/segment"); + }); - basicTests.forEach(({ description, base, segments, expected }) => { - it(description, () => { - expect(join(base, ...segments)).toBe(expected); - }); + it("should handle multiple segments", () => { + expect(join("base", "path1", "path2", "path3")).toBe("base/path1/path2/path3"); + expect(join("base/", "/path1/", "/path2/", "/path3/")).toBe("base/path1/path2/path3"); }); }); describe("URL handling", () => { - const urlTests: TestCase[] = [ - { - description: "should handle absolute URLs", - base: "https://example.com", - segments: ["api", "v1"], - expected: "https://example.com/api/v1", - }, - { - description: "should handle absolute URLs with slashes", - base: "https://example.com/", - segments: ["/api/", "/v1/"], - expected: "https://example.com/api/v1/", - }, - { - description: "should handle absolute URLs with base path", - base: "https://example.com/base", - segments: ["api", "v1"], - expected: "https://example.com/base/api/v1", - }, - { - description: "should preserve URL query parameters", - base: "https://example.com?query=1", - segments: ["api"], - expected: "https://example.com/api?query=1", - }, - { - description: "should preserve URL fragments", - base: "https://example.com#fragment", - segments: ["api"], - expected: "https://example.com/api#fragment", - }, - { - description: "should preserve URL query and fragments", - base: "https://example.com?query=1#fragment", - segments: ["api"], - expected: "https://example.com/api?query=1#fragment", - }, - { - description: "should handle http protocol", - base: "http://example.com", - segments: ["api"], - expected: "http://example.com/api", - }, - { - description: "should handle ftp protocol", - base: "ftp://example.com", - segments: ["files"], - expected: "ftp://example.com/files", - }, - { - description: "should handle ws protocol", - base: "ws://example.com", - segments: ["socket"], - expected: "ws://example.com/socket", - }, - { - description: "should fallback to path joining for malformed URLs", - base: "not-a-url://", - segments: ["path"], - expected: "not-a-url:///path", - }, - ]; + it("should handle absolute URLs", () => { + expect(join("https://example.com", "api", "v1")).toBe("https://example.com/api/v1"); + expect(join("https://example.com/", "/api/", "/v1/")).toBe("https://example.com/api/v1"); + expect(join("https://example.com/base", "api", "v1")).toBe("https://example.com/base/api/v1"); + }); + + it("should preserve URL query parameters and fragments", () => { + expect(join("https://example.com?query=1", "api")).toBe("https://example.com/api?query=1"); + expect(join("https://example.com#fragment", "api")).toBe("https://example.com/api#fragment"); + expect(join("https://example.com?query=1#fragment", "api")).toBe( + "https://example.com/api?query=1#fragment", + ); + }); + + it("should handle different protocols", () => { + expect(join("http://example.com", "api")).toBe("http://example.com/api"); + expect(join("ftp://example.com", "files")).toBe("ftp://example.com/files"); + expect(join("ws://example.com", "socket")).toBe("ws://example.com/socket"); + }); - urlTests.forEach(({ description, base, segments, expected }) => { - it(description, () => { - expect(join(base, ...segments)).toBe(expected); - }); + it("should fallback to path joining for malformed URLs", () => { + expect(join("not-a-url://", "path")).toBe("not-a-url:///path"); }); }); describe("edge cases", () => { - const edgeCaseTests: TestCase[] = [ - { - description: "should handle empty segments", - base: "base", - segments: ["", "path"], - expected: "base/path", - }, - { - description: "should handle null segments", - base: "base", - segments: [null as any, "path"], - expected: "base/path", - }, - { - description: "should handle undefined segments", - base: "base", - segments: [undefined as any, "path"], - expected: "base/path", - }, - { - description: "should handle segments with only single slash", - base: "base", - segments: ["/", "path"], - expected: "base/path", - }, - { - description: "should handle segments with only double slash", - base: "base", - segments: ["//", "path"], - expected: "base/path", - }, - { - description: "should handle base paths with trailing slashes", - base: "base/", - segments: ["path"], - expected: "base/path", - }, - { - description: "should handle complex nested paths", - base: "api/v1/", - segments: ["/users/", "/123/", "/profile"], - expected: "api/v1/users/123/profile", - }, - ]; + it("should handle empty segments", () => { + expect(join("base", "", "path")).toBe("base/path"); + expect(join("base", null as any, "path")).toBe("base/path"); + expect(join("base", undefined as any, "path")).toBe("base/path"); + }); + + it("should handle segments with only slashes", () => { + expect(join("base", "/", "path")).toBe("base/path"); + expect(join("base", "//", "path")).toBe("base/path"); + }); - edgeCaseTests.forEach(({ description, base, segments, expected }) => { - it(description, () => { - expect(join(base, ...segments)).toBe(expected); - }); + it("should handle base paths with trailing slashes", () => { + expect(join("base/", "path")).toBe("base/path"); + }); + + it("should handle complex nested paths", () => { + expect(join("api/v1/", "/users/", "/123/", "/profile")).toBe("api/v1/users/123/profile"); }); }); describe("real-world scenarios", () => { - const realWorldTests: TestCase[] = [ - { - description: "should handle API endpoint construction", - base: "https://api.example.com/v1", - segments: ["users", "123", "posts"], - expected: "https://api.example.com/v1/users/123/posts", - }, - { - description: "should handle file path construction", - base: "/var/www", - segments: ["html", "assets", "images"], - expected: "/var/www/html/assets/images", - }, - { - description: "should handle relative path construction", - base: "../parent", - segments: ["child", "grandchild"], - expected: "../parent/child/grandchild", - }, - { - description: "should handle Windows-style paths", - base: "C:\\Users", - segments: ["Documents", "file.txt"], - expected: "C:\\Users/Documents/file.txt", - }, - ]; + it("should handle API endpoint construction", () => { + const baseUrl = "https://api.example.com/v1"; + expect(join(baseUrl, "users", "123", "posts")).toBe("https://api.example.com/v1/users/123/posts"); + }); - realWorldTests.forEach(({ description, base, segments, expected }) => { - it(description, () => { - expect(join(base, ...segments)).toBe(expected); - }); + it("should handle file path construction", () => { + expect(join("/var/www", "html", "assets", "images")).toBe("/var/www/html/assets/images"); + }); + + it("should handle relative path construction", () => { + expect(join("../parent", "child", "grandchild")).toBe("../parent/child/grandchild"); + }); + + it("should handle Windows-style paths", () => { + expect(join("C:\\Users", "Documents", "file.txt")).toBe("C:\\Users/Documents/file.txt"); }); }); @@ -225,7 +90,7 @@ describe("join", () => { it("should handle many segments efficiently", () => { const segments = Array(100).fill("segment"); const result = join("base", ...segments); - expect(result).toBe(`base/${segments.join("/")}`); + expect(result).toBe("base/" + segments.join("/")); }); it("should handle long URLs", () => { @@ -233,52 +98,4 @@ describe("join", () => { expect(join("https://example.com", longPath)).toBe(`https://example.com/${longPath}`); }); }); - - describe("trailing slash preservation", () => { - const trailingSlashTests: TestCase[] = [ - { - description: - "should preserve trailing slash on final result when base has trailing slash and no segments", - base: "https://api.example.com/", - segments: [], - expected: "https://api.example.com/", - }, - { - description: "should preserve trailing slash on v1 path", - base: "https://api.example.com/v1/", - segments: [], - expected: "https://api.example.com/v1/", - }, - { - description: "should preserve trailing slash when last segment has trailing slash", - base: "https://api.example.com", - segments: ["users/"], - expected: "https://api.example.com/users/", - }, - { - description: "should preserve trailing slash with relative path", - base: "api/v1", - segments: ["users/"], - expected: "api/v1/users/", - }, - { - description: "should preserve trailing slash with multiple segments", - base: "https://api.example.com", - segments: ["v1", "collections/"], - expected: "https://api.example.com/v1/collections/", - }, - { - description: "should preserve trailing slash with base path", - base: "base", - segments: ["path1", "path2/"], - expected: "base/path1/path2/", - }, - ]; - - trailingSlashTests.forEach(({ description, base, segments, expected }) => { - it(description, () => { - expect(join(base, ...segments)).toBe(expected); - }); - }); - }); }); diff --git a/tests/unit/url/qs.test.ts b/tests/unit/url/qs.test.ts index 42cdffb9e..80e7e0444 100644 --- a/tests/unit/url/qs.test.ts +++ b/tests/unit/url/qs.test.ts @@ -1,278 +1,187 @@ import { toQueryString } from "../../../src/core/url/index"; describe("Test qs toQueryString", () => { - interface BasicTestCase { - description: string; - input: any; - expected: string; - } - describe("Basic functionality", () => { - const basicTests: BasicTestCase[] = [ - { description: "should return empty string for null", input: null, expected: "" }, - { description: "should return empty string for undefined", input: undefined, expected: "" }, - { description: "should return empty string for string primitive", input: "hello", expected: "" }, - { description: "should return empty string for number primitive", input: 42, expected: "" }, - { description: "should return empty string for true boolean", input: true, expected: "" }, - { description: "should return empty string for false boolean", input: false, expected: "" }, - { description: "should handle empty objects", input: {}, expected: "" }, - { - description: "should handle simple key-value pairs", - input: { name: "John", age: 30 }, - expected: "name=John&age=30", - }, - ]; + it("should return empty string for null/undefined", () => { + expect(toQueryString(null)).toBe(""); + expect(toQueryString(undefined)).toBe(""); + }); - basicTests.forEach(({ description, input, expected }) => { - it(description, () => { - expect(toQueryString(input)).toBe(expected); - }); + it("should return empty string for primitive values", () => { + expect(toQueryString("hello")).toBe(""); + expect(toQueryString(42)).toBe(""); + expect(toQueryString(true)).toBe(""); + expect(toQueryString(false)).toBe(""); + }); + + it("should handle empty objects", () => { + expect(toQueryString({})).toBe(""); + }); + + it("should handle simple key-value pairs", () => { + const obj = { name: "John", age: 30 }; + expect(toQueryString(obj)).toBe("name=John&age=30"); }); }); describe("Array handling", () => { - interface ArrayTestCase { - description: string; - input: any; - options?: { arrayFormat?: "repeat" | "indices" }; - expected: string; - } + it("should handle arrays with indices format (default)", () => { + const obj = { items: ["a", "b", "c"] }; + expect(toQueryString(obj)).toBe("items%5B0%5D=a&items%5B1%5D=b&items%5B2%5D=c"); + }); + + it("should handle arrays with repeat format", () => { + const obj = { items: ["a", "b", "c"] }; + expect(toQueryString(obj, { arrayFormat: "repeat" })).toBe("items=a&items=b&items=c"); + }); - const arrayTests: ArrayTestCase[] = [ - { - description: "should handle arrays with indices format (default)", - input: { items: ["a", "b", "c"] }, - expected: "items%5B0%5D=a&items%5B1%5D=b&items%5B2%5D=c", - }, - { - description: "should handle arrays with repeat format", - input: { items: ["a", "b", "c"] }, - options: { arrayFormat: "repeat" }, - expected: "items=a&items=b&items=c", - }, - { - description: "should handle empty arrays", - input: { items: [] }, - expected: "", - }, - { - description: "should handle arrays with mixed types", - input: { mixed: ["string", 42, true, false] }, - expected: "mixed%5B0%5D=string&mixed%5B1%5D=42&mixed%5B2%5D=true&mixed%5B3%5D=false", - }, - { - description: "should handle arrays with objects", - input: { users: [{ name: "John" }, { name: "Jane" }] }, - expected: "users%5B0%5D%5Bname%5D=John&users%5B1%5D%5Bname%5D=Jane", - }, - { - description: "should handle arrays with objects in repeat format", - input: { users: [{ name: "John" }, { name: "Jane" }] }, - options: { arrayFormat: "repeat" }, - expected: "users%5Bname%5D=John&users%5Bname%5D=Jane", - }, - ]; + it("should handle empty arrays", () => { + const obj = { items: [] }; + expect(toQueryString(obj)).toBe(""); + }); + + it("should handle arrays with mixed types", () => { + const obj = { mixed: ["string", 42, true, false] }; + expect(toQueryString(obj)).toBe("mixed%5B0%5D=string&mixed%5B1%5D=42&mixed%5B2%5D=true&mixed%5B3%5D=false"); + }); + + it("should handle arrays with objects", () => { + const obj = { users: [{ name: "John" }, { name: "Jane" }] }; + expect(toQueryString(obj)).toBe("users%5B0%5D%5Bname%5D=John&users%5B1%5D%5Bname%5D=Jane"); + }); - arrayTests.forEach(({ description, input, options, expected }) => { - it(description, () => { - expect(toQueryString(input, options)).toBe(expected); - }); + it("should handle arrays with objects in repeat format", () => { + const obj = { users: [{ name: "John" }, { name: "Jane" }] }; + expect(toQueryString(obj, { arrayFormat: "repeat" })).toBe("users%5Bname%5D=John&users%5Bname%5D=Jane"); }); }); describe("Nested objects", () => { - const nestedTests: BasicTestCase[] = [ - { - description: "should handle nested objects", - input: { user: { name: "John", age: 30 } }, - expected: "user%5Bname%5D=John&user%5Bage%5D=30", - }, - { - description: "should handle deeply nested objects", - input: { user: { profile: { name: "John", settings: { theme: "dark" } } } }, - expected: "user%5Bprofile%5D%5Bname%5D=John&user%5Bprofile%5D%5Bsettings%5D%5Btheme%5D=dark", - }, - { - description: "should handle empty nested objects", - input: { user: {} }, - expected: "", - }, - ]; + it("should handle nested objects", () => { + const obj = { user: { name: "John", age: 30 } }; + expect(toQueryString(obj)).toBe("user%5Bname%5D=John&user%5Bage%5D=30"); + }); + + it("should handle deeply nested objects", () => { + const obj = { user: { profile: { name: "John", settings: { theme: "dark" } } } }; + expect(toQueryString(obj)).toBe( + "user%5Bprofile%5D%5Bname%5D=John&user%5Bprofile%5D%5Bsettings%5D%5Btheme%5D=dark", + ); + }); - nestedTests.forEach(({ description, input, expected }) => { - it(description, () => { - expect(toQueryString(input)).toBe(expected); - }); + it("should handle empty nested objects", () => { + const obj = { user: {} }; + expect(toQueryString(obj)).toBe(""); }); }); describe("Encoding", () => { - interface EncodingTestCase { - description: string; - input: any; - options?: { encode?: boolean }; - expected: string; - } + it("should encode by default", () => { + const obj = { name: "John Doe", email: "john@example.com" }; + expect(toQueryString(obj)).toBe("name=John%20Doe&email=john%40example.com"); + }); - const encodingTests: EncodingTestCase[] = [ - { - description: "should encode by default", - input: { name: "John Doe", email: "john@example.com" }, - expected: "name=John%20Doe&email=john%40example.com", - }, - { - description: "should not encode when encode is false", - input: { name: "John Doe", email: "john@example.com" }, - options: { encode: false }, - expected: "name=John Doe&email=john@example.com", - }, - { - description: "should encode special characters in keys", - input: { "user name": "John", "email[primary]": "john@example.com" }, - expected: "user%20name=John&email%5Bprimary%5D=john%40example.com", - }, - { - description: "should not encode special characters in keys when encode is false", - input: { "user name": "John", "email[primary]": "john@example.com" }, - options: { encode: false }, - expected: "user name=John&email[primary]=john@example.com", - }, - ]; + it("should not encode when encode is false", () => { + const obj = { name: "John Doe", email: "john@example.com" }; + expect(toQueryString(obj, { encode: false })).toBe("name=John Doe&email=john@example.com"); + }); + + it("should encode special characters in keys", () => { + const obj = { "user name": "John", "email[primary]": "john@example.com" }; + expect(toQueryString(obj)).toBe("user%20name=John&email%5Bprimary%5D=john%40example.com"); + }); - encodingTests.forEach(({ description, input, options, expected }) => { - it(description, () => { - expect(toQueryString(input, options)).toBe(expected); - }); + it("should not encode special characters in keys when encode is false", () => { + const obj = { "user name": "John", "email[primary]": "john@example.com" }; + expect(toQueryString(obj, { encode: false })).toBe("user name=John&email[primary]=john@example.com"); }); }); describe("Mixed scenarios", () => { - interface MixedTestCase { - description: string; - input: any; - options?: { arrayFormat?: "repeat" | "indices" }; - expected: string; - } - - const mixedTests: MixedTestCase[] = [ - { - description: "should handle complex nested structures", - input: { - filters: { - status: ["active", "pending"], - category: { - type: "electronics", - subcategories: ["phones", "laptops"], - }, + it("should handle complex nested structures", () => { + const obj = { + filters: { + status: ["active", "pending"], + category: { + type: "electronics", + subcategories: ["phones", "laptops"], }, - sort: { field: "name", direction: "asc" }, }, - expected: - "filters%5Bstatus%5D%5B0%5D=active&filters%5Bstatus%5D%5B1%5D=pending&filters%5Bcategory%5D%5Btype%5D=electronics&filters%5Bcategory%5D%5Bsubcategories%5D%5B0%5D=phones&filters%5Bcategory%5D%5Bsubcategories%5D%5B1%5D=laptops&sort%5Bfield%5D=name&sort%5Bdirection%5D=asc", - }, - { - description: "should handle complex nested structures with repeat format", - input: { - filters: { - status: ["active", "pending"], - category: { - type: "electronics", - subcategories: ["phones", "laptops"], - }, + sort: { field: "name", direction: "asc" }, + }; + expect(toQueryString(obj)).toBe( + "filters%5Bstatus%5D%5B0%5D=active&filters%5Bstatus%5D%5B1%5D=pending&filters%5Bcategory%5D%5Btype%5D=electronics&filters%5Bcategory%5D%5Bsubcategories%5D%5B0%5D=phones&filters%5Bcategory%5D%5Bsubcategories%5D%5B1%5D=laptops&sort%5Bfield%5D=name&sort%5Bdirection%5D=asc", + ); + }); + + it("should handle complex nested structures with repeat format", () => { + const obj = { + filters: { + status: ["active", "pending"], + category: { + type: "electronics", + subcategories: ["phones", "laptops"], }, - sort: { field: "name", direction: "asc" }, }, - options: { arrayFormat: "repeat" }, - expected: - "filters%5Bstatus%5D=active&filters%5Bstatus%5D=pending&filters%5Bcategory%5D%5Btype%5D=electronics&filters%5Bcategory%5D%5Bsubcategories%5D=phones&filters%5Bcategory%5D%5Bsubcategories%5D=laptops&sort%5Bfield%5D=name&sort%5Bdirection%5D=asc", - }, - { - description: "should handle arrays with null/undefined values", - input: { items: ["a", null, "c", undefined, "e"] }, - expected: "items%5B0%5D=a&items%5B1%5D=&items%5B2%5D=c&items%5B4%5D=e", - }, - { - description: "should handle objects with null/undefined values", - input: { name: "John", age: null, email: undefined, active: true }, - expected: "name=John&age=&active=true", - }, - ]; + sort: { field: "name", direction: "asc" }, + }; + expect(toQueryString(obj, { arrayFormat: "repeat" })).toBe( + "filters%5Bstatus%5D=active&filters%5Bstatus%5D=pending&filters%5Bcategory%5D%5Btype%5D=electronics&filters%5Bcategory%5D%5Bsubcategories%5D=phones&filters%5Bcategory%5D%5Bsubcategories%5D=laptops&sort%5Bfield%5D=name&sort%5Bdirection%5D=asc", + ); + }); + + it("should handle arrays with null/undefined values", () => { + const obj = { items: ["a", null, "c", undefined, "e"] }; + expect(toQueryString(obj)).toBe("items%5B0%5D=a&items%5B1%5D=&items%5B2%5D=c&items%5B4%5D=e"); + }); - mixedTests.forEach(({ description, input, options, expected }) => { - it(description, () => { - expect(toQueryString(input, options)).toBe(expected); - }); + it("should handle objects with null/undefined values", () => { + const obj = { name: "John", age: null, email: undefined, active: true }; + expect(toQueryString(obj)).toBe("name=John&age=&active=true"); }); }); describe("Edge cases", () => { - const edgeCaseTests: BasicTestCase[] = [ - { - description: "should handle numeric keys", - input: { "0": "zero", "1": "one" }, - expected: "0=zero&1=one", - }, - { - description: "should handle boolean values in objects", - input: { enabled: true, disabled: false }, - expected: "enabled=true&disabled=false", - }, - { - description: "should handle empty strings", - input: { name: "", description: "test" }, - expected: "name=&description=test", - }, - { - description: "should handle zero values", - input: { count: 0, price: 0.0 }, - expected: "count=0&price=0", - }, - { - description: "should handle arrays with empty strings", - input: { items: ["a", "", "c"] }, - expected: "items%5B0%5D=a&items%5B1%5D=&items%5B2%5D=c", - }, - ]; + it("should handle numeric keys", () => { + const obj = { "0": "zero", "1": "one" }; + expect(toQueryString(obj)).toBe("0=zero&1=one"); + }); + + it("should handle boolean values in objects", () => { + const obj = { enabled: true, disabled: false }; + expect(toQueryString(obj)).toBe("enabled=true&disabled=false"); + }); + + it("should handle empty strings", () => { + const obj = { name: "", description: "test" }; + expect(toQueryString(obj)).toBe("name=&description=test"); + }); - edgeCaseTests.forEach(({ description, input, expected }) => { - it(description, () => { - expect(toQueryString(input)).toBe(expected); - }); + it("should handle zero values", () => { + const obj = { count: 0, price: 0.0 }; + expect(toQueryString(obj)).toBe("count=0&price=0"); + }); + + it("should handle arrays with empty strings", () => { + const obj = { items: ["a", "", "c"] }; + expect(toQueryString(obj)).toBe("items%5B0%5D=a&items%5B1%5D=&items%5B2%5D=c"); }); }); describe("Options combinations", () => { - interface OptionsTestCase { - description: string; - input: any; - options?: { arrayFormat?: "repeat" | "indices"; encode?: boolean }; - expected: string; - } + it("should respect both arrayFormat and encode options", () => { + const obj = { items: ["a & b", "c & d"] }; + expect(toQueryString(obj, { arrayFormat: "repeat", encode: false })).toBe("items=a & b&items=c & d"); + }); - const optionsTests: OptionsTestCase[] = [ - { - description: "should respect both arrayFormat and encode options", - input: { items: ["a & b", "c & d"] }, - options: { arrayFormat: "repeat", encode: false }, - expected: "items=a & b&items=c & d", - }, - { - description: "should use default options when none provided", - input: { items: ["a", "b"] }, - expected: "items%5B0%5D=a&items%5B1%5D=b", - }, - { - description: "should merge provided options with defaults", - input: { items: ["a", "b"], name: "John Doe" }, - options: { encode: false }, - expected: "items[0]=a&items[1]=b&name=John Doe", - }, - ]; + it("should use default options when none provided", () => { + const obj = { items: ["a", "b"] }; + expect(toQueryString(obj)).toBe("items%5B0%5D=a&items%5B1%5D=b"); + }); - optionsTests.forEach(({ description, input, options, expected }) => { - it(description, () => { - expect(toQueryString(input, options)).toBe(expected); - }); + it("should merge provided options with defaults", () => { + const obj = { items: ["a", "b"], name: "John Doe" }; + expect(toQueryString(obj, { encode: false })).toBe("items[0]=a&items[1]=b&name=John Doe"); }); }); }); diff --git a/tests/wire/applePay.test.ts b/tests/wire/applePay.test.ts index 6cdf02664..3db07c812 100644 --- a/tests/wire/applePay.test.ts +++ b/tests/wire/applePay.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("ApplePayClient", () => { +describe("ApplePay", () => { test("RegisterDomain", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { domain_name: "example.com" }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/bankAccounts.test.ts b/tests/wire/bankAccounts.test.ts index 4797efa9c..61e810ada 100644 --- a/tests/wire/bankAccounts.test.ts +++ b/tests/wire/bankAccounts.test.ts @@ -1,131 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("BankAccountsClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - bank_accounts: [ - { - id: "ao6iaQ9vhDiaQD7n3GB", - account_number_suffix: "971", - country: "US", - currency: "USD", - account_type: "CHECKING", - holder_name: "Jane Doe", - primary_bank_identification_number: "112200303", - secondary_bank_identification_number: "secondary_bank_identification_number", - debit_mandate_reference_id: "debit_mandate_reference_id", - reference_id: "reference_id", - location_id: "S8GWD5example", - status: "VERIFICATION_IN_PROGRESS", - creditable: false, - debitable: false, - fingerprint: "fingerprint", - version: 5, - bank_name: "Bank Name", - }, - { - id: "4x7WXuaxrkQkVlka3GB", - account_number_suffix: "972", - country: "US", - currency: "USD", - account_type: "CHECKING", - holder_name: "Jane Doe", - primary_bank_identification_number: "112200303", - secondary_bank_identification_number: "secondary_bank_identification_number", - debit_mandate_reference_id: "debit_mandate_reference_id", - reference_id: "reference_id", - location_id: "S8GWD5example", - status: "VERIFICATION_IN_PROGRESS", - creditable: false, - debitable: false, - fingerprint: "fingerprint", - version: 5, - bank_name: "Bank Name", - }, - ], - cursor: "cursor", - }; - server - .mockEndpoint({ once: false }) - .get("/v2/bank-accounts") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - bankAccounts: [ - { - id: "ao6iaQ9vhDiaQD7n3GB", - accountNumberSuffix: "971", - country: "US", - currency: "USD", - accountType: "CHECKING", - holderName: "Jane Doe", - primaryBankIdentificationNumber: "112200303", - secondaryBankIdentificationNumber: "secondary_bank_identification_number", - debitMandateReferenceId: "debit_mandate_reference_id", - referenceId: "reference_id", - locationId: "S8GWD5example", - status: "VERIFICATION_IN_PROGRESS", - creditable: false, - debitable: false, - fingerprint: "fingerprint", - version: 5, - bankName: "Bank Name", - }, - { - id: "4x7WXuaxrkQkVlka3GB", - accountNumberSuffix: "972", - country: "US", - currency: "USD", - accountType: "CHECKING", - holderName: "Jane Doe", - primaryBankIdentificationNumber: "112200303", - secondaryBankIdentificationNumber: "secondary_bank_identification_number", - debitMandateReferenceId: "debit_mandate_reference_id", - referenceId: "reference_id", - locationId: "S8GWD5example", - status: "VERIFICATION_IN_PROGRESS", - creditable: false, - debitable: false, - fingerprint: "fingerprint", - version: 5, - bankName: "Bank Name", - }, - ], - cursor: "cursor", - }; - const page = await client.bankAccounts.list({ - cursor: "cursor", - limit: 1, - locationId: "location_id", - }); - - expect(expected.bankAccounts).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.bankAccounts).toEqual(nextPage.data); - }); - +describe("BankAccounts", () => { test("GetByV1Id", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -193,7 +76,7 @@ describe("BankAccountsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/bookings.test.ts b/tests/wire/bookings.test.ts index c3d2d8353..8c702a91e 100644 --- a/tests/wire/bookings.test.ts +++ b/tests/wire/bookings.test.ts @@ -1,107 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("BookingsClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - bookings: [ - { - id: "zkras0xv0xwswx", - version: 1, - status: "ACCEPTED", - created_at: "2020-10-28T15:47:41Z", - updated_at: "2020-10-28T15:49:25Z", - start_at: "2020-11-26T13:00:00Z", - location_id: "LEQHH0YY8B42M", - customer_id: "EX2QSVGTZN4K1E5QE1CBFNVQ8M", - customer_note: "", - seller_note: "", - appointment_segments: [ - { - duration_minutes: 60, - service_variation_id: "RU3PBTZTK7DXZDQFCJHOK2MC", - team_member_id: "TMXUrsBWWcHTt79t", - service_variation_version: BigInt(1599775456731), - }, - ], - transition_time_minutes: 1, - all_day: true, - location_type: "BUSINESS_LOCATION", - source: "FIRST_PARTY_MERCHANT", - }, - ], - cursor: "cursor", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/bookings") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - bookings: [ - { - id: "zkras0xv0xwswx", - version: 1, - status: "ACCEPTED", - createdAt: "2020-10-28T15:47:41Z", - updatedAt: "2020-10-28T15:49:25Z", - startAt: "2020-11-26T13:00:00Z", - locationId: "LEQHH0YY8B42M", - customerId: "EX2QSVGTZN4K1E5QE1CBFNVQ8M", - customerNote: "", - sellerNote: "", - appointmentSegments: [ - { - durationMinutes: 60, - serviceVariationId: "RU3PBTZTK7DXZDQFCJHOK2MC", - teamMemberId: "TMXUrsBWWcHTt79t", - serviceVariationVersion: BigInt("1599775456731"), - }, - ], - transitionTimeMinutes: 1, - allDay: true, - locationType: "BUSINESS_LOCATION", - source: "FIRST_PARTY_MERCHANT", - }, - ], - cursor: "cursor", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }; - const page = await client.bookings.list({ - limit: 1, - cursor: "cursor", - customerId: "customer_id", - teamMemberId: "team_member_id", - locationId: "location_id", - startAtMin: "start_at_min", - startAtMax: "start_at_max", - }); - - expect(expected.bookings).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.bookings).toEqual(nextPage.data); - }); - +describe("Bookings", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { booking: {} }; const rawResponseBody = { booking: { @@ -222,7 +129,7 @@ describe("BookingsClient", () => { test("SearchAvailability", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { query: { filter: { start_at_range: {} } } }; const rawResponseBody = { availabilities: [ @@ -693,7 +600,7 @@ describe("BookingsClient", () => { test("BulkRetrieveBookings", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { booking_ids: ["booking_ids"] }; const rawResponseBody = { bookings: { @@ -850,7 +757,7 @@ describe("BookingsClient", () => { test("getBusinessProfile", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { business_booking_profile: { @@ -928,7 +835,7 @@ describe("BookingsClient", () => { test("RetrieveLocationBookingProfile", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { location_booking_profile: { @@ -968,7 +875,7 @@ describe("BookingsClient", () => { test("BulkRetrieveTeamMemberBookingProfiles", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { team_member_ids: ["team_member_ids"] }; const rawResponseBody = { team_member_booking_profiles: { @@ -1057,7 +964,7 @@ describe("BookingsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { booking: { @@ -1177,7 +1084,7 @@ describe("BookingsClient", () => { test("update", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { booking: {} }; const rawResponseBody = { booking: { @@ -1299,7 +1206,7 @@ describe("BookingsClient", () => { test("cancel", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { booking: { diff --git a/tests/wire/bookings/customAttributeDefinitions.test.ts b/tests/wire/bookings/customAttributeDefinitions.test.ts index aab6e0aca..97cadf0b2 100644 --- a/tests/wire/bookings/customAttributeDefinitions.test.ts +++ b/tests/wire/bookings/customAttributeDefinitions.test.ts @@ -1,102 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("CustomAttributeDefinitionsClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - custom_attribute_definitions: [ - { - key: "favoriteShampoo", - schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String", - }, - name: "Favorite shampoo", - description: "Update the description as desired.", - visibility: "VISIBILITY_READ_ONLY", - version: 3, - updated_at: "2022-11-16T15:39:38Z", - created_at: "2022-11-16T15:27:30Z", - }, - { - key: "partySize", - schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number", - }, - name: "Party size", - description: "Number of people in the party for dine-in", - visibility: "VISIBILITY_HIDDEN", - version: 1, - updated_at: "2022-11-16T15:49:05Z", - created_at: "2022-11-16T15:49:05Z", - }, - ], - cursor: "YEk4UPbUEsu8MUV0xouO5hCiFcD9T5ztB6UWEJq5vZnqBFmoBEi0j1j6HWYTFGMRre4p7T5wAQBj3Th1NX3XgBFcQVEVsIxUQ2NsbwjRitfoEZDml9uxxQXepowyRvCuSThHPbJSn7M7wInl3x8XypQF9ahVVQXegJ0CxEKc0SBH", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/bookings/custom-attribute-definitions") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - customAttributeDefinitions: [ - { - key: "favoriteShampoo", - schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String", - }, - name: "Favorite shampoo", - description: "Update the description as desired.", - visibility: "VISIBILITY_READ_ONLY", - version: 3, - updatedAt: "2022-11-16T15:39:38Z", - createdAt: "2022-11-16T15:27:30Z", - }, - { - key: "partySize", - schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number", - }, - name: "Party size", - description: "Number of people in the party for dine-in", - visibility: "VISIBILITY_HIDDEN", - version: 1, - updatedAt: "2022-11-16T15:49:05Z", - createdAt: "2022-11-16T15:49:05Z", - }, - ], - cursor: "YEk4UPbUEsu8MUV0xouO5hCiFcD9T5ztB6UWEJq5vZnqBFmoBEi0j1j6HWYTFGMRre4p7T5wAQBj3Th1NX3XgBFcQVEVsIxUQ2NsbwjRitfoEZDml9uxxQXepowyRvCuSThHPbJSn7M7wInl3x8XypQF9ahVVQXegJ0CxEKc0SBH", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }; - const page = await client.bookings.customAttributeDefinitions.list({ - limit: 1, - cursor: "cursor", - }); - - expect(expected.customAttributeDefinitions).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.customAttributeDefinitions).toEqual(nextPage.data); - }); - +describe("CustomAttributeDefinitions", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { custom_attribute_definition: {} }; const rawResponseBody = { custom_attribute_definition: { @@ -151,7 +63,7 @@ describe("CustomAttributeDefinitionsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { custom_attribute_definition: { @@ -206,7 +118,7 @@ describe("CustomAttributeDefinitionsClient", () => { test("update", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { custom_attribute_definition: {} }; const rawResponseBody = { custom_attribute_definition: { @@ -262,7 +174,7 @@ describe("CustomAttributeDefinitionsClient", () => { test("delete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/bookings/customAttributes.test.ts b/tests/wire/bookings/customAttributes.test.ts index 1d17c090d..602533cfe 100644 --- a/tests/wire/bookings/customAttributes.test.ts +++ b/tests/wire/bookings/customAttributes.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("CustomAttributesClient", () => { +describe("CustomAttributes", () => { test("batchDelete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { values: { key: { booking_id: "booking_id", key: "key" } } }; const rawResponseBody = { values: { @@ -85,7 +87,7 @@ describe("CustomAttributesClient", () => { test("batchUpsert", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { values: { key: { booking_id: "booking_id", custom_attribute: {} } } }; const rawResponseBody = { values: { @@ -268,85 +270,9 @@ describe("CustomAttributesClient", () => { }); }); - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - custom_attributes: [ - { - key: "favoriteShampoo", - value: "Hydro-Cool", - version: 1, - visibility: "VISIBILITY_READ_ONLY", - updated_at: "2022-11-16T15:50:27Z", - created_at: "2022-11-16T15:50:27Z", - }, - { - key: "hasShoes", - value: false, - version: 1, - visibility: "VISIBILITY_HIDDEN", - updated_at: "2022-11-16T15:51:53Z", - created_at: "2022-11-16T15:51:53Z", - }, - ], - cursor: "cursor", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/bookings/booking_id/custom-attributes") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - customAttributes: [ - { - key: "favoriteShampoo", - value: "Hydro-Cool", - version: 1, - visibility: "VISIBILITY_READ_ONLY", - updatedAt: "2022-11-16T15:50:27Z", - createdAt: "2022-11-16T15:50:27Z", - }, - { - key: "hasShoes", - value: false, - version: 1, - visibility: "VISIBILITY_HIDDEN", - updatedAt: "2022-11-16T15:51:53Z", - createdAt: "2022-11-16T15:51:53Z", - }, - ], - cursor: "cursor", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }; - const page = await client.bookings.customAttributes.list({ - bookingId: "booking_id", - limit: 1, - cursor: "cursor", - withDefinitions: true, - }); - - expect(expected.customAttributes).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.customAttributes).toEqual(nextPage.data); - }); - test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { custom_attribute: { @@ -417,7 +343,7 @@ describe("CustomAttributesClient", () => { test("upsert", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { custom_attribute: {} }; const rawResponseBody = { custom_attribute: { @@ -488,7 +414,7 @@ describe("CustomAttributesClient", () => { test("delete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/bookings/locationProfiles.test.ts b/tests/wire/bookings/locationProfiles.test.ts deleted file mode 100644 index 92ae16404..000000000 --- a/tests/wire/bookings/locationProfiles.test.ts +++ /dev/null @@ -1,64 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import { SquareClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; - -describe("LocationProfilesClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - location_booking_profiles: [ - { - location_id: "LY6WNBPVM6VGV", - booking_site_url: "https://squareup.com/book/LY6WNBPVM6VGV/testbusiness", - online_booking_enabled: true, - }, - { location_id: "PYTRNBPVMJUPV", booking_site_url: "booking_site_url", online_booking_enabled: false }, - ], - cursor: "cursor", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/bookings/location-booking-profiles") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - locationBookingProfiles: [ - { - locationId: "LY6WNBPVM6VGV", - bookingSiteUrl: "https://squareup.com/book/LY6WNBPVM6VGV/testbusiness", - onlineBookingEnabled: true, - }, - { - locationId: "PYTRNBPVMJUPV", - bookingSiteUrl: "booking_site_url", - onlineBookingEnabled: false, - }, - ], - cursor: "cursor", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }; - const page = await client.bookings.locationProfiles.list({ - limit: 1, - cursor: "cursor", - }); - - expect(expected.locationBookingProfiles).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.locationBookingProfiles).toEqual(nextPage.data); - }); -}); diff --git a/tests/wire/bookings/teamMemberProfiles.test.ts b/tests/wire/bookings/teamMemberProfiles.test.ts index e824ad876..cb71bc88d 100644 --- a/tests/wire/bookings/teamMemberProfiles.test.ts +++ b/tests/wire/bookings/teamMemberProfiles.test.ts @@ -1,84 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("TeamMemberProfilesClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - team_member_booking_profiles: [ - { - team_member_id: "TMXUrsBWWcHTt79t", - description: "description", - display_name: "Sandbox Seller", - is_bookable: true, - profile_image_url: "profile_image_url", - }, - { - team_member_id: "TMaJcbiRqPIGZuS9", - description: "description", - display_name: "Sandbox Staff", - is_bookable: true, - profile_image_url: "profile_image_url", - }, - ], - cursor: "cursor", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/bookings/team-member-booking-profiles") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - teamMemberBookingProfiles: [ - { - teamMemberId: "TMXUrsBWWcHTt79t", - description: "description", - displayName: "Sandbox Seller", - isBookable: true, - profileImageUrl: "profile_image_url", - }, - { - teamMemberId: "TMaJcbiRqPIGZuS9", - description: "description", - displayName: "Sandbox Staff", - isBookable: true, - profileImageUrl: "profile_image_url", - }, - ], - cursor: "cursor", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }; - const page = await client.bookings.teamMemberProfiles.list({ - bookableOnly: true, - limit: 1, - cursor: "cursor", - locationId: "location_id", - }); - - expect(expected.teamMemberBookingProfiles).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.teamMemberBookingProfiles).toEqual(nextPage.data); - }); - +describe("TeamMemberProfiles", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { team_member_booking_profile: { diff --git a/tests/wire/cards.test.ts b/tests/wire/cards.test.ts index 2b5d1e6e4..42ac023e4 100644 --- a/tests/wire/cards.test.ts +++ b/tests/wire/cards.test.ts @@ -1,115 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("CardsClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - cards: [ - { - id: "ccof:uIbfJXhXETSP197M3GB", - card_brand: "VISA", - last_4: "1111", - exp_month: BigInt(11), - exp_year: BigInt(2022), - cardholder_name: "Amelia Earhart", - billing_address: { - address_line_1: "500 Electric Ave", - address_line_2: "Suite 600", - locality: "New York", - administrative_district_level_1: "NY", - postal_code: "10003", - country: "US", - }, - fingerprint: "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", - customer_id: "VDKXEEKPJN48QDG3BGGFAK05P8", - merchant_id: "6SSW7HV8K2ST5", - reference_id: "user-id-1", - enabled: true, - card_type: "CREDIT", - prepaid_type: "NOT_PREPAID", - bin: "411111", - version: BigInt(1), - card_co_brand: "UNKNOWN", - issuer_alert: "ISSUER_ALERT_CARD_CLOSED", - issuer_alert_at: "issuer_alert_at", - hsa_fsa: false, - }, - ], - cursor: "cursor", - }; - server - .mockEndpoint({ once: false }) - .get("/v2/cards") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - cards: [ - { - id: "ccof:uIbfJXhXETSP197M3GB", - cardBrand: "VISA", - last4: "1111", - expMonth: BigInt("11"), - expYear: BigInt("2022"), - cardholderName: "Amelia Earhart", - billingAddress: { - addressLine1: "500 Electric Ave", - addressLine2: "Suite 600", - locality: "New York", - administrativeDistrictLevel1: "NY", - postalCode: "10003", - country: "US", - }, - fingerprint: "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q", - customerId: "VDKXEEKPJN48QDG3BGGFAK05P8", - merchantId: "6SSW7HV8K2ST5", - referenceId: "user-id-1", - enabled: true, - cardType: "CREDIT", - prepaidType: "NOT_PREPAID", - bin: "411111", - version: BigInt("1"), - cardCoBrand: "UNKNOWN", - issuerAlert: "ISSUER_ALERT_CARD_CLOSED", - issuerAlertAt: "issuer_alert_at", - hsaFsa: false, - }, - ], - cursor: "cursor", - }; - const page = await client.cards.list({ - cursor: "cursor", - customerId: "customer_id", - includeDisabled: true, - referenceId: "reference_id", - sortOrder: "DESC", - }); - - expect(expected.cards).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.cards).toEqual(nextPage.data); - }); - +describe("Cards", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "4935a656-a929-4792-b97c-8848be85c27c", source_id: "cnon:uIbfJXhXETSP197M3GB", @@ -244,7 +143,7 @@ describe("CardsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -342,7 +241,7 @@ describe("CardsClient", () => { test("disable", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/cashDrawers/shifts.test.ts b/tests/wire/cashDrawers/shifts.test.ts index c5cbbf20c..fed14a578 100644 --- a/tests/wire/cashDrawers/shifts.test.ts +++ b/tests/wire/cashDrawers/shifts.test.ts @@ -1,95 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("ShiftsClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - cursor: "cursor", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - cash_drawer_shifts: [ - { - id: "DCC99978-09A6-4926-849F-300BE9C5793A", - state: "CLOSED", - opened_at: "2019-11-22T00:42:54.000Z", - ended_at: "2019-11-22T00:44:49.000Z", - closed_at: "2019-11-22T00:44:49.000Z", - description: "Misplaced some change", - opened_cash_money: { amount: BigInt(10000), currency: "USD" }, - expected_cash_money: { amount: BigInt(10000), currency: "USD" }, - closed_cash_money: { amount: BigInt(9970), currency: "USD" }, - created_at: "created_at", - updated_at: "updated_at", - location_id: "location_id", - }, - ], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/cash-drawers/shifts") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - cursor: "cursor", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - cashDrawerShifts: [ - { - id: "DCC99978-09A6-4926-849F-300BE9C5793A", - state: "CLOSED", - openedAt: "2019-11-22T00:42:54.000Z", - endedAt: "2019-11-22T00:44:49.000Z", - closedAt: "2019-11-22T00:44:49.000Z", - description: "Misplaced some change", - openedCashMoney: { - amount: BigInt("10000"), - currency: "USD", - }, - expectedCashMoney: { - amount: BigInt("10000"), - currency: "USD", - }, - closedCashMoney: { - amount: BigInt("9970"), - currency: "USD", - }, - createdAt: "created_at", - updatedAt: "updated_at", - locationId: "location_id", - }, - ], - }; - const page = await client.cashDrawers.shifts.list({ - locationId: "location_id", - sortOrder: "DESC", - beginTime: "begin_time", - endTime: "end_time", - limit: 1, - cursor: "cursor", - }); - - expect(expected.cashDrawerShifts).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.cashDrawerShifts).toEqual(nextPage.data); - }); - +describe("Shifts", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { cash_drawer_shift: { @@ -187,162 +106,4 @@ describe("ShiftsClient", () => { ], }); }); - - test("listEvents", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - cursor: "cursor", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - cash_drawer_shift_events: [ - { - id: "9F07DB01-D85A-4B77-88C3-D5C64CEB5155", - event_type: "CASH_TENDER_PAYMENT", - event_money: { amount: BigInt(100), currency: "USD" }, - created_at: "2019-11-22T00:43:02.000Z", - description: "", - team_member_id: "", - }, - { - id: "B2854CEA-A781-49B3-8F31-C64558231F48", - event_type: "CASH_TENDER_PAYMENT", - event_money: { amount: BigInt(250), currency: "USD" }, - created_at: "2019-11-22T00:43:12.000Z", - description: "", - team_member_id: "", - }, - { - id: "B5FB7F72-95CD-44A3-974D-26C41064D042", - event_type: "CASH_TENDER_CANCELLED_PAYMENT", - event_money: { amount: BigInt(250), currency: "USD" }, - created_at: "2019-11-22T00:43:23.000Z", - description: "", - team_member_id: "", - }, - { - id: "0B425480-8504-40B4-A867-37B23543931B", - event_type: "CASH_TENDER_REFUND", - event_money: { amount: BigInt(100), currency: "USD" }, - created_at: "2019-11-22T00:43:46.000Z", - description: "", - team_member_id: "", - }, - { - id: "8C66E60E-FDCF-4EEF-A98D-3B14B7ED5CBE", - event_type: "PAID_IN", - event_money: { amount: BigInt(10000), currency: "USD" }, - created_at: "2019-11-22T00:44:18.000Z", - description: "Transfer from another drawer", - team_member_id: "", - }, - { - id: "D5ACA7FE-C64D-4ADA-8BC8-82118A2DAE4F", - event_type: "PAID_OUT", - event_money: { amount: BigInt(10000), currency: "USD" }, - created_at: "2019-11-22T00:44:29.000Z", - description: "Transfer out to another drawer", - team_member_id: "", - }, - ], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/cash-drawers/shifts/shift_id/events") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - cursor: "cursor", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - cashDrawerShiftEvents: [ - { - id: "9F07DB01-D85A-4B77-88C3-D5C64CEB5155", - eventType: "CASH_TENDER_PAYMENT", - eventMoney: { - amount: BigInt("100"), - currency: "USD", - }, - createdAt: "2019-11-22T00:43:02.000Z", - description: "", - teamMemberId: "", - }, - { - id: "B2854CEA-A781-49B3-8F31-C64558231F48", - eventType: "CASH_TENDER_PAYMENT", - eventMoney: { - amount: BigInt("250"), - currency: "USD", - }, - createdAt: "2019-11-22T00:43:12.000Z", - description: "", - teamMemberId: "", - }, - { - id: "B5FB7F72-95CD-44A3-974D-26C41064D042", - eventType: "CASH_TENDER_CANCELLED_PAYMENT", - eventMoney: { - amount: BigInt("250"), - currency: "USD", - }, - createdAt: "2019-11-22T00:43:23.000Z", - description: "", - teamMemberId: "", - }, - { - id: "0B425480-8504-40B4-A867-37B23543931B", - eventType: "CASH_TENDER_REFUND", - eventMoney: { - amount: BigInt("100"), - currency: "USD", - }, - createdAt: "2019-11-22T00:43:46.000Z", - description: "", - teamMemberId: "", - }, - { - id: "8C66E60E-FDCF-4EEF-A98D-3B14B7ED5CBE", - eventType: "PAID_IN", - eventMoney: { - amount: BigInt("10000"), - currency: "USD", - }, - createdAt: "2019-11-22T00:44:18.000Z", - description: "Transfer from another drawer", - teamMemberId: "", - }, - { - id: "D5ACA7FE-C64D-4ADA-8BC8-82118A2DAE4F", - eventType: "PAID_OUT", - eventMoney: { - amount: BigInt("10000"), - currency: "USD", - }, - createdAt: "2019-11-22T00:44:29.000Z", - description: "Transfer out to another drawer", - teamMemberId: "", - }, - ], - }; - const page = await client.cashDrawers.shifts.listEvents({ - shiftId: "shift_id", - locationId: "location_id", - limit: 1, - cursor: "cursor", - }); - - expect(expected.cashDrawerShiftEvents).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.cashDrawerShiftEvents).toEqual(nextPage.data); - }); }); diff --git a/tests/wire/catalog.test.ts b/tests/wire/catalog.test.ts index bb0c1c9ae..d28664a1b 100644 --- a/tests/wire/catalog.test.ts +++ b/tests/wire/catalog.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("CatalogClient", () => { +describe("Catalog", () => { test("batchDelete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { object_ids: ["W62UWFY35CWMYGVWK6TWJDNI", "AA27W3M2GGTF3H6AVPNB77CK"] }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -41,7 +43,7 @@ describe("CatalogClient", () => { test("batchGet", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { object_ids: ["W62UWFY35CWMYGVWK6TWJDNI", "AA27W3M2GGTF3H6AVPNB77CK"], include_related_objects: true, @@ -50,10 +52,9 @@ describe("CatalogClient", () => { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], objects: [ { - type: "ITEM", id: "id", updated_at: "updated_at", - version: BigInt(1000000), + version: 1000000, is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -61,12 +62,12 @@ describe("CatalogClient", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", + type: "ITEM", }, { - type: "ITEM", id: "id", updated_at: "updated_at", - version: BigInt(1000000), + version: 1000000, is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -74,14 +75,14 @@ describe("CatalogClient", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", + type: "ITEM", }, ], related_objects: [ { - type: "CATEGORY", id: "id", updated_at: "updated_at", - version: BigInt(1000000), + version: 1000000, is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -89,13 +90,13 @@ describe("CatalogClient", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", - ordinal: BigInt(1000000), + ordinal: 1000000, + type: "CATEGORY", }, { - type: "TAX", id: "id", updated_at: "updated_at", - version: BigInt(1000000), + version: 1000000, is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -103,6 +104,7 @@ describe("CatalogClient", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", + type: "TAX", }, ], }; @@ -162,6 +164,7 @@ describe("CatalogClient", () => { ], relatedObjects: [ { + type: "CATEGORY", id: "id", updatedAt: "updated_at", version: BigInt("1000000"), @@ -198,16 +201,16 @@ describe("CatalogClient", () => { test("batchUpsert", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "789ff020-f723-43a9-b4b5-43b5dc1fa3dc", batches: [ { objects: [ - { type: "ITEM", id: "id" }, - { type: "ITEM", id: "id" }, - { type: "ITEM", id: "id" }, - { type: "TAX", id: "id" }, + { id: "id", type: "ITEM" }, + { id: "id", type: "ITEM" }, + { id: "id", type: "ITEM" }, + { id: "id", type: "TAX" }, ], }, ], @@ -216,10 +219,9 @@ describe("CatalogClient", () => { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], objects: [ { - type: "ITEM", id: "id", updated_at: "updated_at", - version: BigInt(1000000), + version: 1000000, is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -227,12 +229,12 @@ describe("CatalogClient", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", + type: "ITEM", }, { - type: "ITEM", id: "id", updated_at: "updated_at", - version: BigInt(1000000), + version: 1000000, is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -240,12 +242,12 @@ describe("CatalogClient", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", + type: "ITEM", }, { - type: "CATEGORY", id: "id", updated_at: "updated_at", - version: BigInt(1000000), + version: 1000000, is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -253,13 +255,13 @@ describe("CatalogClient", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", - ordinal: BigInt(1000000), + ordinal: 1000000, + type: "CATEGORY", }, { - type: "TAX", id: "id", updated_at: "updated_at", - version: BigInt(1000000), + version: 1000000, is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -267,6 +269,7 @@ describe("CatalogClient", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", + type: "TAX", }, ], updated_at: "updated_at", @@ -355,6 +358,7 @@ describe("CatalogClient", () => { imageId: "image_id", }, { + type: "CATEGORY", id: "id", updatedAt: "updated_at", version: BigInt("1000000"), @@ -422,7 +426,7 @@ describe("CatalogClient", () => { test("info", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -473,110 +477,9 @@ describe("CatalogClient", () => { }); }); - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - cursor: "cursor", - objects: [ - { - type: "CATEGORY", - id: "id", - updated_at: "updated_at", - version: BigInt(1000000), - is_deleted: true, - custom_attribute_values: { key: {} }, - catalog_v1_ids: [{}], - present_at_all_locations: true, - present_at_location_ids: ["present_at_location_ids"], - absent_at_location_ids: ["absent_at_location_ids"], - image_id: "image_id", - ordinal: BigInt(1000000), - }, - { - type: "TAX", - id: "id", - updated_at: "updated_at", - version: BigInt(1000000), - is_deleted: true, - custom_attribute_values: { key: {} }, - catalog_v1_ids: [{}], - present_at_all_locations: true, - present_at_location_ids: ["present_at_location_ids"], - absent_at_location_ids: ["absent_at_location_ids"], - image_id: "image_id", - }, - ], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/catalog/list") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - cursor: "cursor", - objects: [ - { - id: "id", - updatedAt: "updated_at", - version: BigInt("1000000"), - isDeleted: true, - customAttributeValues: { - key: {}, - }, - catalogV1Ids: [{}], - presentAtAllLocations: true, - presentAtLocationIds: ["present_at_location_ids"], - absentAtLocationIds: ["absent_at_location_ids"], - imageId: "image_id", - ordinal: BigInt("1000000"), - type: "CATEGORY", - }, - { - type: "TAX", - id: "id", - updatedAt: "updated_at", - version: BigInt("1000000"), - isDeleted: true, - customAttributeValues: { - key: {}, - }, - catalogV1Ids: [{}], - presentAtAllLocations: true, - presentAtLocationIds: ["present_at_location_ids"], - absentAtLocationIds: ["absent_at_location_ids"], - imageId: "image_id", - }, - ], - }; - const page = await client.catalog.list({ - cursor: "cursor", - types: "types", - catalogVersion: BigInt("1000000"), - }); - - expect(expected.objects).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.objects).toEqual(nextPage.data); - }); - test("search", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { object_types: ["ITEM"], query: { prefix_query: { attribute_name: "name", attribute_prefix: "tea" } }, @@ -587,10 +490,9 @@ describe("CatalogClient", () => { cursor: "cursor", objects: [ { - type: "ITEM", id: "id", updated_at: "updated_at", - version: BigInt(1000000), + version: 1000000, is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -598,12 +500,12 @@ describe("CatalogClient", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", + type: "ITEM", }, { - type: "ITEM", id: "id", updated_at: "updated_at", - version: BigInt(1000000), + version: 1000000, is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -611,14 +513,14 @@ describe("CatalogClient", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", + type: "ITEM", }, ], related_objects: [ { - type: "ITEM", id: "id", updated_at: "updated_at", - version: BigInt(1000000), + version: 1000000, is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -626,6 +528,7 @@ describe("CatalogClient", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", + type: "ITEM", }, ], latest_time: "latest_time", @@ -714,7 +617,7 @@ describe("CatalogClient", () => { test("SearchItems", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { text_filter: "red", category_ids: ["WINE_CATEGORY_ID"], @@ -734,10 +637,9 @@ describe("CatalogClient", () => { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], items: [ { - type: "ITEM", id: "id", updated_at: "updated_at", - version: BigInt(1000000), + version: 1000000, is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -745,6 +647,7 @@ describe("CatalogClient", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", + type: "ITEM", }, ], cursor: "cursor", @@ -821,7 +724,7 @@ describe("CatalogClient", () => { test("UpdateItemModifierLists", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { item_ids: ["H42BRLUJ5KTZTTMPVSLFAACQ", "2JXOBJIHCWBQ4NZ3RIXQGJA6"], modifier_lists_to_enable: ["H42BRLUJ5KTZTTMPVSLFAACQ", "2JXOBJIHCWBQ4NZ3RIXQGJA6"], @@ -860,7 +763,7 @@ describe("CatalogClient", () => { test("UpdateItemTaxes", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { item_ids: ["H42BRLUJ5KTZTTMPVSLFAACQ", "2JXOBJIHCWBQ4NZ3RIXQGJA6"], taxes_to_enable: ["4WRCNHCJZDVLSNDQ35PP6YAD"], diff --git a/tests/wire/catalog/object.test.ts b/tests/wire/catalog/object.test.ts index 1b65bdb2a..39cee604a 100644 --- a/tests/wire/catalog/object.test.ts +++ b/tests/wire/catalog/object.test.ts @@ -1,23 +1,24 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("ObjectClient", () => { +describe("Object_", () => { test("upsert", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "af3d1afc-7212-4300-b463-0bfc5314a5ae", - object: { type: "ITEM", id: "id" }, + object: { id: "id", type: "ITEM" }, }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], catalog_object: { - type: "ITEM", id: "id", updated_at: "updated_at", - version: BigInt(1000000), + version: 1000000, is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -47,6 +48,7 @@ describe("ObjectClient", () => { is_archived: true, is_alcoholic: true, }, + type: "ITEM", }, id_mappings: [ { client_object_id: "#Cocoa", object_id: "R2TA2FOBUGCJZNIWJSOSNAI4" }, @@ -139,15 +141,14 @@ describe("ObjectClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], object: { - type: "ITEM", id: "id", updated_at: "updated_at", - version: BigInt(1000000), + version: 1000000, is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -177,13 +178,13 @@ describe("ObjectClient", () => { is_archived: true, is_alcoholic: true, }, + type: "ITEM", }, related_objects: [ { - type: "CATEGORY", id: "id", updated_at: "updated_at", - version: BigInt(1000000), + version: 1000000, is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -191,13 +192,13 @@ describe("ObjectClient", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", - ordinal: BigInt(1000000), + ordinal: 1000000, + type: "CATEGORY", }, { - type: "TAX", id: "id", updated_at: "updated_at", - version: BigInt(1000000), + version: 1000000, is_deleted: true, custom_attribute_values: { key: {} }, catalog_v1_ids: [{}], @@ -205,6 +206,7 @@ describe("ObjectClient", () => { present_at_location_ids: ["present_at_location_ids"], absent_at_location_ids: ["absent_at_location_ids"], image_id: "image_id", + type: "TAX", }, ], }; @@ -274,6 +276,7 @@ describe("ObjectClient", () => { }, relatedObjects: [ { + type: "CATEGORY", id: "id", updatedAt: "updated_at", version: BigInt("1000000"), @@ -310,7 +313,7 @@ describe("ObjectClient", () => { test("delete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/channels.test.ts b/tests/wire/channels.test.ts deleted file mode 100644 index 17abe8c51..000000000 --- a/tests/wire/channels.test.ts +++ /dev/null @@ -1,239 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import { SquareClient } from "../../src/Client"; -import { mockServerPool } from "../mock-server/MockServerPool"; - -describe("ChannelsClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - channels: [ - { - id: "CH_9C03D0B59", - merchant_id: "ML64FACEA", - name: "Contoso Fulfillment Application", - version: 1, - reference: { type: "OAUTH_APPLICATION", id: "OA_9C03D0444" }, - status: "ACTIVE", - created_at: "2022-10-25T16:27:00Z", - updated_at: "2022-10-25T16:48:00Z", - }, - ], - cursor: "cursor", - }; - server - .mockEndpoint({ once: false }) - .get("/v2/channels") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - channels: [ - { - id: "CH_9C03D0B59", - merchantId: "ML64FACEA", - name: "Contoso Fulfillment Application", - version: 1, - reference: { - type: "OAUTH_APPLICATION", - id: "OA_9C03D0444", - }, - status: "ACTIVE", - createdAt: "2022-10-25T16:27:00Z", - updatedAt: "2022-10-25T16:48:00Z", - }, - ], - cursor: "cursor", - }; - const page = await client.channels.list({ - referenceType: "UNKNOWN_TYPE", - referenceId: "reference_id", - status: "ACTIVE", - cursor: "cursor", - limit: 1, - }); - - expect(expected.channels).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.channels).toEqual(nextPage.data); - }); - - test("bulkRetrieve", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - const rawRequestBody = { channel_ids: ["CH_9C03D0B59", "CH_6X139B5MN", "NOT_EXISTING"] }; - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - responses: { - CH_6X139B5MN: { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR" }], - channel: { - id: "CH_6X139B5MN", - merchant_id: "ML64FACEA", - name: "Contoso Fulfillment Application", - version: 1, - reference: { type: "OAUTH_APPLICATION", id: "OA_9C03D0444" }, - status: "ACTIVE", - created_at: "2022-10-25T16:27:00Z", - updated_at: "2022-10-25T16:48:00Z", - }, - }, - CH_9C03D0B59: { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR" }], - channel: { - id: "CH_9C03D0B59", - merchant_id: "ML64FACEA", - name: "State Street Store", - version: 1, - reference: { type: "LOCATION", id: "OA_9C03D0B59" }, - status: "ACTIVE", - created_at: "2022-10-25T16:27:00Z", - updated_at: "2022-10-25T16:48:00Z", - }, - }, - NOT_EXISTING: { errors: [{ category: "API_ERROR", code: "NOT_FOUND" }] }, - }, - }; - server - .mockEndpoint() - .post("/v2/channels/bulk-retrieve") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.channels.bulkRetrieve({ - channelIds: ["CH_9C03D0B59", "CH_6X139B5MN", "NOT_EXISTING"], - }); - expect(response).toEqual({ - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - responses: { - CH_6X139B5MN: { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - }, - ], - channel: { - id: "CH_6X139B5MN", - merchantId: "ML64FACEA", - name: "Contoso Fulfillment Application", - version: 1, - reference: { - type: "OAUTH_APPLICATION", - id: "OA_9C03D0444", - }, - status: "ACTIVE", - createdAt: "2022-10-25T16:27:00Z", - updatedAt: "2022-10-25T16:48:00Z", - }, - }, - CH_9C03D0B59: { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - }, - ], - channel: { - id: "CH_9C03D0B59", - merchantId: "ML64FACEA", - name: "State Street Store", - version: 1, - reference: { - type: "LOCATION", - id: "OA_9C03D0B59", - }, - status: "ACTIVE", - createdAt: "2022-10-25T16:27:00Z", - updatedAt: "2022-10-25T16:48:00Z", - }, - }, - NOT_EXISTING: { - errors: [ - { - category: "API_ERROR", - code: "NOT_FOUND", - }, - ], - }, - }, - }); - }); - - test("get", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - channel: { - id: "CH_9C03D0B59", - merchant_id: "ML64FACEA", - name: "Contoso Fulfillment Application", - version: 1, - reference: { type: "OAUTH_APPLICATION", id: "OA_9C03D0444" }, - status: "ACTIVE", - created_at: "2022-10-25T16:27:00Z", - updated_at: "2022-10-25T16:48:00Z", - }, - }; - server - .mockEndpoint() - .get("/v2/channels/channel_id") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.channels.get({ - channelId: "channel_id", - }); - expect(response).toEqual({ - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - channel: { - id: "CH_9C03D0B59", - merchantId: "ML64FACEA", - name: "Contoso Fulfillment Application", - version: 1, - reference: { - type: "OAUTH_APPLICATION", - id: "OA_9C03D0444", - }, - status: "ACTIVE", - createdAt: "2022-10-25T16:27:00Z", - updatedAt: "2022-10-25T16:48:00Z", - }, - }); - }); -}); diff --git a/tests/wire/checkout.test.ts b/tests/wire/checkout.test.ts index ed4cbf351..cc8b24538 100644 --- a/tests/wire/checkout.test.ts +++ b/tests/wire/checkout.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("CheckoutClient", () => { +describe("Checkout", () => { test("RetrieveLocationSettings", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -76,7 +78,7 @@ describe("CheckoutClient", () => { test("UpdateLocationSettings", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { location_settings: {} }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -160,7 +162,7 @@ describe("CheckoutClient", () => { test("RetrieveMerchantSettings", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -240,7 +242,7 @@ describe("CheckoutClient", () => { test("UpdateMerchantSettings", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { merchant_settings: {} }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/checkout/paymentLinks.test.ts b/tests/wire/checkout/paymentLinks.test.ts index 89bc7d651..8710b2721 100644 --- a/tests/wire/checkout/paymentLinks.test.ts +++ b/tests/wire/checkout/paymentLinks.test.ts @@ -1,102 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("PaymentLinksClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - payment_links: [ - { - id: "TN4BWEDJ9AI5MBIV", - version: 2, - description: "description", - order_id: "Qqc6yppGvxVwc46Cch4zHTaJqc4F", - checkout_options: { ask_for_shipping_address: true }, - url: "https://square.link/u/EXAMPLE", - long_url: "long_url", - created_at: "2022-04-26T00:15:15Z", - updated_at: "2022-04-26T00:18:24Z", - payment_note: "test", - }, - { - id: "RY5UNCUMPJN5XKCT", - version: 1, - description: "", - order_id: "EmBmGt3zJD15QeO1dxzBTxMxtwfZY", - url: "https://square.link/u/EXAMPLE", - long_url: "long_url", - created_at: "2022-04-11T23:14:59Z", - updated_at: "updated_at", - payment_note: "payment_note", - }, - ], - cursor: "MTY1NQ==", - }; - server - .mockEndpoint({ once: false }) - .get("/v2/online-checkout/payment-links") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - paymentLinks: [ - { - id: "TN4BWEDJ9AI5MBIV", - version: 2, - description: "description", - orderId: "Qqc6yppGvxVwc46Cch4zHTaJqc4F", - checkoutOptions: { - askForShippingAddress: true, - }, - url: "https://square.link/u/EXAMPLE", - longUrl: "long_url", - createdAt: "2022-04-26T00:15:15Z", - updatedAt: "2022-04-26T00:18:24Z", - paymentNote: "test", - }, - { - id: "RY5UNCUMPJN5XKCT", - version: 1, - description: "", - orderId: "EmBmGt3zJD15QeO1dxzBTxMxtwfZY", - url: "https://square.link/u/EXAMPLE", - longUrl: "long_url", - createdAt: "2022-04-11T23:14:59Z", - updatedAt: "updated_at", - paymentNote: "payment_note", - }, - ], - cursor: "MTY1NQ==", - }; - const page = await client.checkout.paymentLinks.list({ - cursor: "cursor", - limit: 1, - }); - - expect(expected.paymentLinks).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.paymentLinks).toEqual(nextPage.data); - }); - +describe("PaymentLinks", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "cd9e25dc-d9f2-4430-aedb-61605070e95f", quick_pay: { @@ -169,7 +81,7 @@ describe("PaymentLinksClient", () => { total_service_charge_money: { amount: BigInt(0), currency: "USD" }, }, ], - subscription_plans: [{ type: "ITEM", id: "id" }], + subscription_plans: [{ id: "id", type: "ITEM" }], }, }; server @@ -340,7 +252,7 @@ describe("PaymentLinksClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -425,7 +337,7 @@ describe("PaymentLinksClient", () => { test("update", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { payment_link: { version: 1, checkout_options: { ask_for_shipping_address: true } } }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -517,7 +429,7 @@ describe("PaymentLinksClient", () => { test("delete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/customers.test.ts b/tests/wire/customers.test.ts index 5ed145dca..ecd022c26 100644 --- a/tests/wire/customers.test.ts +++ b/tests/wire/customers.test.ts @@ -1,115 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("CustomersClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - customers: [ - { - id: "JDKYHBWT1D4F8MFH63DBMEN8Y4", - created_at: "2016-03-23T20:21:54.859Z", - updated_at: "2016-03-23T20:21:55Z", - given_name: "Amelia", - family_name: "Earhart", - nickname: "nickname", - company_name: "company_name", - email_address: "Amelia.Earhart@example.com", - address: { - address_line_1: "500 Electric Ave", - address_line_2: "Suite 600", - locality: "New York", - administrative_district_level_1: "NY", - postal_code: "10003", - country: "US", - }, - phone_number: "+1-212-555-4240", - birthday: "birthday", - reference_id: "YOUR_REFERENCE_ID", - note: "a customer", - preferences: { email_unsubscribed: false }, - creation_source: "THIRD_PARTY", - group_ids: ["545AXB44B4XXWMVQ4W8SBT3HHF"], - segment_ids: ["1KB9JE5EGJXCW.REACHABLE"], - version: BigInt(1), - }, - ], - cursor: "cursor", - count: BigInt(1000000), - }; - server - .mockEndpoint({ once: false }) - .get("/v2/customers") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - customers: [ - { - id: "JDKYHBWT1D4F8MFH63DBMEN8Y4", - createdAt: "2016-03-23T20:21:54.859Z", - updatedAt: "2016-03-23T20:21:55Z", - givenName: "Amelia", - familyName: "Earhart", - nickname: "nickname", - companyName: "company_name", - emailAddress: "Amelia.Earhart@example.com", - address: { - addressLine1: "500 Electric Ave", - addressLine2: "Suite 600", - locality: "New York", - administrativeDistrictLevel1: "NY", - postalCode: "10003", - country: "US", - }, - phoneNumber: "+1-212-555-4240", - birthday: "birthday", - referenceId: "YOUR_REFERENCE_ID", - note: "a customer", - preferences: { - emailUnsubscribed: false, - }, - creationSource: "THIRD_PARTY", - groupIds: ["545AXB44B4XXWMVQ4W8SBT3HHF"], - segmentIds: ["1KB9JE5EGJXCW.REACHABLE"], - version: BigInt("1"), - }, - ], - cursor: "cursor", - count: BigInt("1000000"), - }; - const page = await client.customers.list({ - cursor: "cursor", - limit: 1, - sortField: "DEFAULT", - sortOrder: "DESC", - count: true, - }); - - expect(expected.customers).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.customers).toEqual(nextPage.data); - }); - +describe("Customers", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { given_name: "Amelia", family_name: "Earhart", @@ -244,7 +143,7 @@ describe("CustomersClient", () => { test("batchCreate", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { customers: { "8bb76c4f-e35d-4c5b-90de-1194cd9179f0": { @@ -461,7 +360,7 @@ describe("CustomersClient", () => { test("BulkDeleteCustomers", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { customer_ids: ["8DDA5NZVBZFGAX0V3HPF81HHE0", "N18CPRVXR5214XPBBA6BZQWF3C", "2GYD7WNXF7BJZW1PMGNXZ3Y8M8"], }; @@ -534,7 +433,7 @@ describe("CustomersClient", () => { test("BulkRetrieveCustomers", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { customer_ids: ["8DDA5NZVBZFGAX0V3HPF81HHE0", "N18CPRVXR5214XPBBA6BZQWF3C", "2GYD7WNXF7BJZW1PMGNXZ3Y8M8"], }; @@ -661,7 +560,7 @@ describe("CustomersClient", () => { test("BulkUpdateCustomers", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { customers: { "8DDA5NZVBZFGAX0V3HPF81HHE0": { @@ -788,7 +687,7 @@ describe("CustomersClient", () => { test("search", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { limit: BigInt(2), query: { @@ -972,7 +871,7 @@ describe("CustomersClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -1078,7 +977,7 @@ describe("CustomersClient", () => { test("update", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { email_address: "New.Amelia.Earhart@example.com", note: "updated customer note", @@ -1192,7 +1091,7 @@ describe("CustomersClient", () => { test("delete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/customers/cards.test.ts b/tests/wire/customers/cards.test.ts index 6301be9b6..0f8e33d61 100644 --- a/tests/wire/customers/cards.test.ts +++ b/tests/wire/customers/cards.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("CardsClient", () => { +describe("Cards", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { card_nonce: "YOUR_CARD_NONCE", billing_address: { @@ -132,7 +134,7 @@ describe("CardsClient", () => { test("delete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/customers/customAttributeDefinitions.test.ts b/tests/wire/customers/customAttributeDefinitions.test.ts index fb4680123..d6a45aafd 100644 --- a/tests/wire/customers/customAttributeDefinitions.test.ts +++ b/tests/wire/customers/customAttributeDefinitions.test.ts @@ -1,102 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("CustomAttributeDefinitionsClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - custom_attribute_definitions: [ - { - key: "favoritemovie", - schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String", - }, - name: "Favorite Movie", - description: "Update the description as desired.", - visibility: "VISIBILITY_READ_ONLY", - version: 3, - updated_at: "2022-04-26T15:39:38Z", - created_at: "2022-04-26T15:27:30Z", - }, - { - key: "ownsmovie", - schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean", - }, - name: "Owns Movie", - description: "Customer owns movie.", - visibility: "VISIBILITY_HIDDEN", - version: 1, - updated_at: "2022-04-26T15:49:05Z", - created_at: "2022-04-26T15:49:05Z", - }, - ], - cursor: "YEk4UPbUEsu8MUV0xouO5hCiFcD9T5ztB6UWEJq5vZnqBFmoBEi0j1j6HWYTFGMRre4p7T5wAQBj3Th1NX3XgBFcQVEVsIxUQ2NsbwjRitfoEZDml9uxxQXepowyRvCuSThHPbJSn7M7wInl3x8XypQF9ahVVQXegJ0CxEKc0SBH", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/customers/custom-attribute-definitions") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - customAttributeDefinitions: [ - { - key: "favoritemovie", - schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String", - }, - name: "Favorite Movie", - description: "Update the description as desired.", - visibility: "VISIBILITY_READ_ONLY", - version: 3, - updatedAt: "2022-04-26T15:39:38Z", - createdAt: "2022-04-26T15:27:30Z", - }, - { - key: "ownsmovie", - schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean", - }, - name: "Owns Movie", - description: "Customer owns movie.", - visibility: "VISIBILITY_HIDDEN", - version: 1, - updatedAt: "2022-04-26T15:49:05Z", - createdAt: "2022-04-26T15:49:05Z", - }, - ], - cursor: "YEk4UPbUEsu8MUV0xouO5hCiFcD9T5ztB6UWEJq5vZnqBFmoBEi0j1j6HWYTFGMRre4p7T5wAQBj3Th1NX3XgBFcQVEVsIxUQ2NsbwjRitfoEZDml9uxxQXepowyRvCuSThHPbJSn7M7wInl3x8XypQF9ahVVQXegJ0CxEKc0SBH", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }; - const page = await client.customers.customAttributeDefinitions.list({ - limit: 1, - cursor: "cursor", - }); - - expect(expected.customAttributeDefinitions).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.customAttributeDefinitions).toEqual(nextPage.data); - }); - +describe("CustomAttributeDefinitions", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { custom_attribute_definition: { key: "favoritemovie", @@ -169,7 +81,7 @@ describe("CustomAttributeDefinitionsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { custom_attribute_definition: { @@ -224,7 +136,7 @@ describe("CustomAttributeDefinitionsClient", () => { test("update", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { custom_attribute_definition: { description: "Update the description as desired.", @@ -288,7 +200,7 @@ describe("CustomAttributeDefinitionsClient", () => { test("delete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -318,7 +230,7 @@ describe("CustomAttributeDefinitionsClient", () => { test("batchUpsert", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { values: { id1: { diff --git a/tests/wire/customers/customAttributes.test.ts b/tests/wire/customers/customAttributes.test.ts index 29ac31498..d54d1bde3 100644 --- a/tests/wire/customers/customAttributes.test.ts +++ b/tests/wire/customers/customAttributes.test.ts @@ -1,88 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("CustomAttributesClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - custom_attributes: [ - { - key: "favoritemovie", - value: "Dune", - version: 1, - visibility: "VISIBILITY_READ_ONLY", - updated_at: "2022-04-26T15:50:27Z", - created_at: "2022-04-26T15:50:27Z", - }, - { - key: "ownsmovie", - value: false, - version: 1, - visibility: "VISIBILITY_HIDDEN", - updated_at: "2022-04-26T15:51:53Z", - created_at: "2022-04-26T15:51:53Z", - }, - ], - cursor: "cursor", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/customers/customer_id/custom-attributes") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - customAttributes: [ - { - key: "favoritemovie", - value: "Dune", - version: 1, - visibility: "VISIBILITY_READ_ONLY", - updatedAt: "2022-04-26T15:50:27Z", - createdAt: "2022-04-26T15:50:27Z", - }, - { - key: "ownsmovie", - value: false, - version: 1, - visibility: "VISIBILITY_HIDDEN", - updatedAt: "2022-04-26T15:51:53Z", - createdAt: "2022-04-26T15:51:53Z", - }, - ], - cursor: "cursor", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }; - const page = await client.customers.customAttributes.list({ - customerId: "customer_id", - limit: 1, - cursor: "cursor", - withDefinitions: true, - }); - - expect(expected.customAttributes).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.customAttributes).toEqual(nextPage.data); - }); - +describe("CustomAttributes", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { custom_attribute: { @@ -153,7 +79,7 @@ describe("CustomAttributesClient", () => { test("upsert", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { custom_attribute: { value: "Dune" } }; const rawResponseBody = { custom_attribute: { @@ -226,7 +152,7 @@ describe("CustomAttributesClient", () => { test("delete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/customers/groups.test.ts b/tests/wire/customers/groups.test.ts index 232b8ee80..80a92ceff 100644 --- a/tests/wire/customers/groups.test.ts +++ b/tests/wire/customers/groups.test.ts @@ -1,78 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("GroupsClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - groups: [ - { - id: "2TAT3CMH4Q0A9M87XJZED0WMR3", - name: "Loyal Customers", - created_at: "2020-04-13T21:54:57.863Z", - updated_at: "2020-04-13T21:54:58Z", - }, - { - id: "4XMEHESXJBNE9S9JAKZD2FGB14", - name: "Super Loyal Customers", - created_at: "2020-04-13T21:55:18.795Z", - updated_at: "2020-04-13T21:55:19Z", - }, - ], - cursor: "cursor", - }; - server - .mockEndpoint({ once: false }) - .get("/v2/customers/groups") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - groups: [ - { - id: "2TAT3CMH4Q0A9M87XJZED0WMR3", - name: "Loyal Customers", - createdAt: "2020-04-13T21:54:57.863Z", - updatedAt: "2020-04-13T21:54:58Z", - }, - { - id: "4XMEHESXJBNE9S9JAKZD2FGB14", - name: "Super Loyal Customers", - createdAt: "2020-04-13T21:55:18.795Z", - updatedAt: "2020-04-13T21:55:19Z", - }, - ], - cursor: "cursor", - }; - const page = await client.customers.groups.list({ - cursor: "cursor", - limit: 1, - }); - - expect(expected.groups).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.groups).toEqual(nextPage.data); - }); - +describe("Groups", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { group: { name: "Loyal Customers" } }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -117,7 +53,7 @@ describe("GroupsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -159,7 +95,7 @@ describe("GroupsClient", () => { test("update", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { group: { name: "Loyal Customers" } }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -205,7 +141,7 @@ describe("GroupsClient", () => { test("delete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -235,7 +171,7 @@ describe("GroupsClient", () => { test("add", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -266,7 +202,7 @@ describe("GroupsClient", () => { test("remove", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/customers/segments.test.ts b/tests/wire/customers/segments.test.ts index fc67dc35a..e891d9cb7 100644 --- a/tests/wire/customers/segments.test.ts +++ b/tests/wire/customers/segments.test.ts @@ -1,102 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("SegmentsClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - segments: [ - { - id: "GMNXRZVEXNQDF.CHURN_RISK", - name: "Lapsed", - created_at: "2020-01-09T19:33:24.469Z", - updated_at: "2020-04-13T21:47:04Z", - }, - { - id: "GMNXRZVEXNQDF.LOYAL", - name: "Regulars", - created_at: "2020-01-09T19:33:24.486Z", - updated_at: "2020-04-13T21:47:04Z", - }, - { - id: "GMNXRZVEXNQDF.REACHABLE", - name: "Reachable", - created_at: "2020-01-09T19:33:21.813Z", - updated_at: "2020-04-13T21:47:04Z", - }, - { - id: "gv2:KF92J19VXN5FK30GX2E8HSGQ20", - name: "Instant Profile", - created_at: "2020-01-09T19:33:25Z", - updated_at: "2020-04-13T23:01:03Z", - }, - ], - cursor: "cursor", - }; - server - .mockEndpoint({ once: false }) - .get("/v2/customers/segments") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - segments: [ - { - id: "GMNXRZVEXNQDF.CHURN_RISK", - name: "Lapsed", - createdAt: "2020-01-09T19:33:24.469Z", - updatedAt: "2020-04-13T21:47:04Z", - }, - { - id: "GMNXRZVEXNQDF.LOYAL", - name: "Regulars", - createdAt: "2020-01-09T19:33:24.486Z", - updatedAt: "2020-04-13T21:47:04Z", - }, - { - id: "GMNXRZVEXNQDF.REACHABLE", - name: "Reachable", - createdAt: "2020-01-09T19:33:21.813Z", - updatedAt: "2020-04-13T21:47:04Z", - }, - { - id: "gv2:KF92J19VXN5FK30GX2E8HSGQ20", - name: "Instant Profile", - createdAt: "2020-01-09T19:33:25Z", - updatedAt: "2020-04-13T23:01:03Z", - }, - ], - cursor: "cursor", - }; - const page = await client.customers.segments.list({ - cursor: "cursor", - limit: 1, - }); - - expect(expected.segments).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.segments).toEqual(nextPage.data); - }); - +describe("Segments", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/devices.test.ts b/tests/wire/devices.test.ts index 983dc0711..02e86f2dd 100644 --- a/tests/wire/devices.test.ts +++ b/tests/wire/devices.test.ts @@ -1,250 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("DevicesClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - devices: [ - { - id: "device:995CS397A6475287", - attributes: { - type: "TERMINAL", - manufacturer: "Square", - model: "Square Terminal (1st Gen, v2)", - name: "Square Terminal 5287", - manufacturers_id: "995CS397A6475287", - updated_at: "2025-08-19T13:04:56.335762883Z", - version: "5.57.0067", - merchant_token: "MLCHNZCBWFDZB", - }, - components: [ - { - type: "APPLICATION", - application_details: { - application_type: "TERMINAL_API", - version: "6.77", - session_location: "LMN2K7S3RTOU3", - }, - }, - { type: "CARD_READER", card_reader_details: { version: "4.1.51" } }, - { - type: "BATTERY", - battery_details: { visible_percent: 77, external_power: "AVAILABLE_CHARGING" }, - }, - { - type: "WIFI", - wifi_details: { - active: true, - ssid: "Staff Network", - ip_address_v4: "10.0.0.7", - secure_connection: "WPA/WPA2 PSK", - signal_strength: { value: 2 }, - }, - }, - { type: "ETHERNET", ethernet_details: { active: false } }, - ], - status: { category: "AVAILABLE" }, - }, - { - id: "device:998WS21803L03559", - attributes: { - type: "HANDHELD", - manufacturer: "Square", - model: "Square Handheld (1st Gen, v1)", - name: "Square Terminal 3559", - manufacturers_id: "998WS21803L03559", - updated_at: "2025-08-19T12:39:56.335742073Z", - version: "7.21.0017", - merchant_token: "MLCHXZCBWFGDW", - }, - components: [ - { - type: "APPLICATION", - application_details: { - application_type: "TERMINAL_API", - version: "6.77", - session_location: "LMN2K7S3RTOU3", - }, - }, - { type: "CARD_READER", card_reader_details: { version: "4.5.58" } }, - { - type: "BATTERY", - battery_details: { visible_percent: 22, external_power: "AVAILABLE_CHARGING" }, - }, - { - type: "WIFI", - wifi_details: { - active: true, - ssid: "Staff Network", - ip_address_v4: "10.0.0.7", - secure_connection: "WPA/WPA2 PSK", - signal_strength: { value: 2 }, - }, - }, - { type: "ETHERNET", ethernet_details: { active: false } }, - ], - status: { category: "NEEDS_ATTENTION" }, - }, - ], - cursor: "GcXjlV2iaizH7R0fMT6wUDbw6l4otigjzx8XOOspUKHo9EPLRByM", - }; - server - .mockEndpoint({ once: false }) - .get("/v2/devices") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - devices: [ - { - id: "device:995CS397A6475287", - attributes: { - type: "TERMINAL", - manufacturer: "Square", - model: "Square Terminal (1st Gen, v2)", - name: "Square Terminal 5287", - manufacturersId: "995CS397A6475287", - updatedAt: "2025-08-19T13:04:56.335762883Z", - version: "5.57.0067", - merchantToken: "MLCHNZCBWFDZB", - }, - components: [ - { - type: "APPLICATION", - applicationDetails: { - applicationType: "TERMINAL_API", - version: "6.77", - sessionLocation: "LMN2K7S3RTOU3", - }, - }, - { - type: "CARD_READER", - cardReaderDetails: { - version: "4.1.51", - }, - }, - { - type: "BATTERY", - batteryDetails: { - visiblePercent: 77, - externalPower: "AVAILABLE_CHARGING", - }, - }, - { - type: "WIFI", - wifiDetails: { - active: true, - ssid: "Staff Network", - ipAddressV4: "10.0.0.7", - secureConnection: "WPA/WPA2 PSK", - signalStrength: { - value: 2, - }, - }, - }, - { - type: "ETHERNET", - ethernetDetails: { - active: false, - }, - }, - ], - status: { - category: "AVAILABLE", - }, - }, - { - id: "device:998WS21803L03559", - attributes: { - type: "HANDHELD", - manufacturer: "Square", - model: "Square Handheld (1st Gen, v1)", - name: "Square Terminal 3559", - manufacturersId: "998WS21803L03559", - updatedAt: "2025-08-19T12:39:56.335742073Z", - version: "7.21.0017", - merchantToken: "MLCHXZCBWFGDW", - }, - components: [ - { - type: "APPLICATION", - applicationDetails: { - applicationType: "TERMINAL_API", - version: "6.77", - sessionLocation: "LMN2K7S3RTOU3", - }, - }, - { - type: "CARD_READER", - cardReaderDetails: { - version: "4.5.58", - }, - }, - { - type: "BATTERY", - batteryDetails: { - visiblePercent: 22, - externalPower: "AVAILABLE_CHARGING", - }, - }, - { - type: "WIFI", - wifiDetails: { - active: true, - ssid: "Staff Network", - ipAddressV4: "10.0.0.7", - secureConnection: "WPA/WPA2 PSK", - signalStrength: { - value: 2, - }, - }, - }, - { - type: "ETHERNET", - ethernetDetails: { - active: false, - }, - }, - ], - status: { - category: "NEEDS_ATTENTION", - }, - }, - ], - cursor: "GcXjlV2iaizH7R0fMT6wUDbw6l4otigjzx8XOOspUKHo9EPLRByM", - }; - const page = await client.devices.list({ - cursor: "cursor", - sortOrder: "DESC", - limit: 1, - locationId: "location_id", - }); - - expect(expected.devices).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.devices).toEqual(nextPage.data); - }); - +describe("Devices", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/devices/codes.test.ts b/tests/wire/devices/codes.test.ts index a401ad505..489f9ed99 100644 --- a/tests/wire/devices/codes.test.ts +++ b/tests/wire/devices/codes.test.ts @@ -1,108 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("CodesClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - device_codes: [ - { - id: "B3Z6NAMYQSMTM", - name: "Counter 1", - code: "EBCARJ", - device_id: "907CS13101300122", - product_type: "TERMINAL_API", - location_id: "B5E4484SHHNYH", - status: "PAIRED", - pair_by: "2020-02-06T18:49:33.000Z", - created_at: "2020-02-06T18:44:33.000Z", - status_changed_at: "2020-02-06T18:47:28.000Z", - paired_at: "paired_at", - }, - { - id: "YKGMJMYK8H4PQ", - name: "Unused device code", - code: "GVXNYN", - device_id: "device_id", - product_type: "TERMINAL_API", - location_id: "A6SYFRSV4WAFW", - status: "UNPAIRED", - pair_by: "2020-02-07T20:00:04.000Z", - created_at: "2020-02-07T19:55:04.000Z", - status_changed_at: "2020-02-07T19:55:04.000Z", - paired_at: "paired_at", - }, - ], - cursor: "cursor", - }; - server - .mockEndpoint({ once: false }) - .get("/v2/devices/codes") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - deviceCodes: [ - { - id: "B3Z6NAMYQSMTM", - name: "Counter 1", - code: "EBCARJ", - deviceId: "907CS13101300122", - productType: "TERMINAL_API", - locationId: "B5E4484SHHNYH", - status: "PAIRED", - pairBy: "2020-02-06T18:49:33.000Z", - createdAt: "2020-02-06T18:44:33.000Z", - statusChangedAt: "2020-02-06T18:47:28.000Z", - pairedAt: "paired_at", - }, - { - id: "YKGMJMYK8H4PQ", - name: "Unused device code", - code: "GVXNYN", - deviceId: "device_id", - productType: "TERMINAL_API", - locationId: "A6SYFRSV4WAFW", - status: "UNPAIRED", - pairBy: "2020-02-07T20:00:04.000Z", - createdAt: "2020-02-07T19:55:04.000Z", - statusChangedAt: "2020-02-07T19:55:04.000Z", - pairedAt: "paired_at", - }, - ], - cursor: "cursor", - }; - const page = await client.devices.codes.list({ - cursor: "cursor", - locationId: "location_id", - productType: "TERMINAL_API", - status: "UNKNOWN", - }); - - expect(expected.deviceCodes).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.deviceCodes).toEqual(nextPage.data); - }); - +describe("Codes", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "01bb00a6-0c86-4770-94ed-f5fca973cd56", device_code: { name: "Counter 1", product_type: "TERMINAL_API", location_id: "B5E4484SHHNYH" }, @@ -167,7 +73,7 @@ describe("CodesClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/disputes.test.ts b/tests/wire/disputes.test.ts index 808c0af0a..334677ebc 100644 --- a/tests/wire/disputes.test.ts +++ b/tests/wire/disputes.test.ts @@ -1,137 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("DisputesClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - disputes: [ - { - dispute_id: "dispute_id", - id: "XDgyFu7yo1E2S5lQGGpYn", - amount_money: { amount: BigInt(2500), currency: "USD" }, - reason: "NO_KNOWLEDGE", - state: "ACCEPTED", - due_at: "2022-07-13T00:00:00.000Z", - disputed_payment: { payment_id: "zhyh1ch64kRBrrlfVhwjCEjZWzNZY" }, - evidence_ids: ["evidence_ids"], - card_brand: "VISA", - created_at: "2022-06-29T18:45:22.265Z", - updated_at: "2022-07-07T19:14:42.650Z", - brand_dispute_id: "100000809947", - reported_date: "reported_date", - reported_at: "2022-06-29T00:00:00.000Z", - version: 2, - location_id: "L1HN3ZMQK64X9", - }, - { - dispute_id: "dispute_id", - id: "jLGg7aXC7lvKPr9PISt0T", - amount_money: { amount: BigInt(2209), currency: "USD" }, - reason: "NOT_AS_DESCRIBED", - state: "EVIDENCE_REQUIRED", - due_at: "2022-05-13T00:00:00.000Z", - disputed_payment: { payment_id: "zhyh1ch64kRBrrlfVhwjCEjZWzNZY" }, - evidence_ids: ["evidence_ids"], - card_brand: "VISA", - created_at: "2022-04-29T18:45:22.265Z", - updated_at: "2022-04-29T18:45:22.265Z", - brand_dispute_id: "r5Of6YaGT7AdeRaVoAGCJw", - reported_date: "reported_date", - reported_at: "2022-04-29T00:00:00.000Z", - version: 1, - location_id: "18YC4JDH91E1H", - }, - ], - cursor: "G1aSTRm48CLjJsg6Sg3hQN1b1OMaoVuG", - }; - server - .mockEndpoint({ once: false }) - .get("/v2/disputes") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - disputes: [ - { - disputeId: "dispute_id", - id: "XDgyFu7yo1E2S5lQGGpYn", - amountMoney: { - amount: BigInt("2500"), - currency: "USD", - }, - reason: "NO_KNOWLEDGE", - state: "ACCEPTED", - dueAt: "2022-07-13T00:00:00.000Z", - disputedPayment: { - paymentId: "zhyh1ch64kRBrrlfVhwjCEjZWzNZY", - }, - evidenceIds: ["evidence_ids"], - cardBrand: "VISA", - createdAt: "2022-06-29T18:45:22.265Z", - updatedAt: "2022-07-07T19:14:42.650Z", - brandDisputeId: "100000809947", - reportedDate: "reported_date", - reportedAt: "2022-06-29T00:00:00.000Z", - version: 2, - locationId: "L1HN3ZMQK64X9", - }, - { - disputeId: "dispute_id", - id: "jLGg7aXC7lvKPr9PISt0T", - amountMoney: { - amount: BigInt("2209"), - currency: "USD", - }, - reason: "NOT_AS_DESCRIBED", - state: "EVIDENCE_REQUIRED", - dueAt: "2022-05-13T00:00:00.000Z", - disputedPayment: { - paymentId: "zhyh1ch64kRBrrlfVhwjCEjZWzNZY", - }, - evidenceIds: ["evidence_ids"], - cardBrand: "VISA", - createdAt: "2022-04-29T18:45:22.265Z", - updatedAt: "2022-04-29T18:45:22.265Z", - brandDisputeId: "r5Of6YaGT7AdeRaVoAGCJw", - reportedDate: "reported_date", - reportedAt: "2022-04-29T00:00:00.000Z", - version: 1, - locationId: "18YC4JDH91E1H", - }, - ], - cursor: "G1aSTRm48CLjJsg6Sg3hQN1b1OMaoVuG", - }; - const page = await client.disputes.list({ - cursor: "cursor", - states: "INQUIRY_EVIDENCE_REQUIRED", - locationId: "location_id", - }); - - expect(expected.disputes).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.disputes).toEqual(nextPage.data); - }); - +describe("Disputes", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -202,7 +79,7 @@ describe("DisputesClient", () => { test("accept", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -273,7 +150,7 @@ describe("DisputesClient", () => { test("CreateEvidenceText", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "ed3ee3933d946f1514d505d173c82648", evidence_type: "TRACKING_NUMBER", @@ -332,7 +209,7 @@ describe("DisputesClient", () => { test("SubmitEvidence", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/disputes/evidence.test.ts b/tests/wire/disputes/evidence.test.ts index 8147f78b6..e0496da11 100644 --- a/tests/wire/disputes/evidence.test.ts +++ b/tests/wire/disputes/evidence.test.ts @@ -1,96 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("EvidenceClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - evidence: [ - { - evidence_id: "evidence_id", - id: "CpfnkwGselCwS8QFvxN6", - dispute_id: "bVTprrwk0gygTLZ96VX1oB", - evidence_file: { filename: "customer-interaction", filetype: "JPG" }, - evidence_text: "evidence_text", - uploaded_at: "2022-05-10T15:57:13.802Z", - evidence_type: "CARDHOLDER_COMMUNICATION", - }, - { - evidence_id: "evidence_id", - id: "TOomLInj6iWmP3N8qfCXrB", - dispute_id: "bVTprrwk0gygTLZ96VX1oB", - evidence_file: { filename: "", filetype: "" }, - evidence_text: "evidence_text", - uploaded_at: "2022-05-18T16:01:10.000Z", - evidence_type: "REBUTTAL_EXPLANATION", - }, - ], - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - cursor: "cursor", - }; - server - .mockEndpoint({ once: false }) - .get("/v2/disputes/dispute_id/evidence") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - evidence: [ - { - evidenceId: "evidence_id", - id: "CpfnkwGselCwS8QFvxN6", - disputeId: "bVTprrwk0gygTLZ96VX1oB", - evidenceFile: { - filename: "customer-interaction", - filetype: "JPG", - }, - evidenceText: "evidence_text", - uploadedAt: "2022-05-10T15:57:13.802Z", - evidenceType: "CARDHOLDER_COMMUNICATION", - }, - { - evidenceId: "evidence_id", - id: "TOomLInj6iWmP3N8qfCXrB", - disputeId: "bVTprrwk0gygTLZ96VX1oB", - evidenceFile: { - filename: "", - filetype: "", - }, - evidenceText: "evidence_text", - uploadedAt: "2022-05-18T16:01:10.000Z", - evidenceType: "REBUTTAL_EXPLANATION", - }, - ], - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - cursor: "cursor", - }; - const page = await client.disputes.evidence.list({ - disputeId: "dispute_id", - cursor: "cursor", - }); - - expect(expected.evidence).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.evidence).toEqual(nextPage.data); - }); - +describe("Evidence", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -142,7 +60,7 @@ describe("EvidenceClient", () => { test("delete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/employees.test.ts b/tests/wire/employees.test.ts index a11e297e6..1e270b2bb 100644 --- a/tests/wire/employees.test.ts +++ b/tests/wire/employees.test.ts @@ -1,80 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("EmployeesClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - employees: [ - { - id: "id", - first_name: "first_name", - last_name: "last_name", - email: "email", - phone_number: "phone_number", - location_ids: ["location_ids"], - status: "ACTIVE", - is_owner: true, - created_at: "created_at", - updated_at: "updated_at", - }, - ], - cursor: "cursor", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/employees") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - employees: [ - { - id: "id", - firstName: "first_name", - lastName: "last_name", - email: "email", - phoneNumber: "phone_number", - locationIds: ["location_ids"], - status: "ACTIVE", - isOwner: true, - createdAt: "created_at", - updatedAt: "updated_at", - }, - ], - cursor: "cursor", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }; - const page = await client.employees.list({ - locationId: "location_id", - status: "ACTIVE", - limit: 1, - cursor: "cursor", - }); - - expect(expected.employees).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.employees).toEqual(nextPage.data); - }); - +describe("Employees", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { employee: { diff --git a/tests/wire/events.test.ts b/tests/wire/events.test.ts index e28083774..4a20f754d 100644 --- a/tests/wire/events.test.ts +++ b/tests/wire/events.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("EventsClient", () => { +describe("Events", () => { test("SearchEvents", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -109,7 +111,7 @@ describe("EventsClient", () => { test("DisableEvents", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -131,7 +133,7 @@ describe("EventsClient", () => { test("EnableEvents", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -153,7 +155,7 @@ describe("EventsClient", () => { test("ListEventTypes", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/giftCards.test.ts b/tests/wire/giftCards.test.ts index f877a33d2..ed74f1206 100644 --- a/tests/wire/giftCards.test.ts +++ b/tests/wire/giftCards.test.ts @@ -1,103 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("GiftCardsClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - gift_cards: [ - { - id: "gftc:00113070ba5745f0b2377c1b9570cb03", - type: "DIGITAL", - gan_source: "SQUARE", - state: "ACTIVE", - balance_money: { amount: BigInt(3900), currency: "USD" }, - gan: "7783320008524605", - created_at: "2021-06-09T22:26:54.000Z", - customer_ids: ["customer_ids"], - }, - { - id: "gftc:00128a12725b41e58e0de1d20497a9dd", - type: "DIGITAL", - gan_source: "SQUARE", - state: "ACTIVE", - balance_money: { amount: BigInt(2000), currency: "USD" }, - gan: "7783320002692465", - created_at: "2021-05-20T22:26:54.000Z", - customer_ids: ["customer_ids"], - }, - ], - cursor: "JbFmyvUpaNKsfC1hoLSA4WlqkgkZXTWeKuStajR5BkP7OE0ETAbeWSi6U6u7sH", - }; - server - .mockEndpoint({ once: false }) - .get("/v2/gift-cards") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - giftCards: [ - { - id: "gftc:00113070ba5745f0b2377c1b9570cb03", - type: "DIGITAL", - ganSource: "SQUARE", - state: "ACTIVE", - balanceMoney: { - amount: BigInt("3900"), - currency: "USD", - }, - gan: "7783320008524605", - createdAt: "2021-06-09T22:26:54.000Z", - customerIds: ["customer_ids"], - }, - { - id: "gftc:00128a12725b41e58e0de1d20497a9dd", - type: "DIGITAL", - ganSource: "SQUARE", - state: "ACTIVE", - balanceMoney: { - amount: BigInt("2000"), - currency: "USD", - }, - gan: "7783320002692465", - createdAt: "2021-05-20T22:26:54.000Z", - customerIds: ["customer_ids"], - }, - ], - cursor: "JbFmyvUpaNKsfC1hoLSA4WlqkgkZXTWeKuStajR5BkP7OE0ETAbeWSi6U6u7sH", - }; - const page = await client.giftCards.list({ - type: "type", - state: "state", - limit: 1, - cursor: "cursor", - customerId: "customer_id", - }); - - expect(expected.giftCards).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.giftCards).toEqual(nextPage.data); - }); - +describe("GiftCards", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "NC9Tm69EjbjtConu", location_id: "81FN9BNFZTKS4", @@ -159,7 +70,7 @@ describe("GiftCardsClient", () => { test("getFromGAN", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { gan: "7783320001001635" }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -213,7 +124,7 @@ describe("GiftCardsClient", () => { test("getFromNonce", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { nonce: "cnon:7783322135245171" }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -267,7 +178,7 @@ describe("GiftCardsClient", () => { test("LinkCustomer", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { customer_id: "GKY0FZ3V717AH8Q2D821PNT2ZW" }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -322,7 +233,7 @@ describe("GiftCardsClient", () => { test("UnlinkCustomer", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { customer_id: "GKY0FZ3V717AH8Q2D821PNT2ZW" }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -377,7 +288,7 @@ describe("GiftCardsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/giftCards/activities.test.ts b/tests/wire/giftCards/activities.test.ts index 202f8f995..fd98a1564 100644 --- a/tests/wire/giftCards/activities.test.ts +++ b/tests/wire/giftCards/activities.test.ts @@ -1,234 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("ActivitiesClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - gift_card_activities: [ - { - id: "gcact_897698f894b44b3db46c6147e26a0e19", - type: "REDEEM", - location_id: "81FN9BNFZTKS4", - created_at: "2021-06-02T22:26:38.000Z", - gift_card_id: "gftc:6d55a72470d940c6ba09c0ab8ad08d20", - gift_card_gan: "7783320002929081", - gift_card_balance_money: { amount: BigInt(700), currency: "USD" }, - redeem_activity_details: { amount_money: { amount: BigInt(300), currency: "USD" } }, - clear_balance_activity_details: { reason: "SUSPICIOUS_ACTIVITY" }, - deactivate_activity_details: { reason: "SUSPICIOUS_ACTIVITY" }, - adjust_increment_activity_details: { amount_money: {}, reason: "COMPLIMENTARY" }, - adjust_decrement_activity_details: { amount_money: {}, reason: "SUSPICIOUS_ACTIVITY" }, - unlinked_activity_refund_activity_details: { amount_money: {} }, - import_activity_details: { amount_money: {} }, - block_activity_details: { reason: "CHARGEBACK_BLOCK" }, - unblock_activity_details: { reason: "CHARGEBACK_UNBLOCK" }, - import_reversal_activity_details: { amount_money: {} }, - transfer_balance_to_activity_details: { - transfer_from_gift_card_id: "transfer_from_gift_card_id", - amount_money: {}, - }, - transfer_balance_from_activity_details: { - transfer_to_gift_card_id: "transfer_to_gift_card_id", - amount_money: {}, - }, - }, - { - id: "gcact_b968ebfc7d46437b945be7b9e09123b4", - type: "ACTIVATE", - location_id: "81FN9BNFZTKS4", - created_at: "2021-05-20T22:26:54.000Z", - gift_card_id: "gftc:6d55a72470d940c6ba09c0ab8ad08d20", - gift_card_gan: "7783320002929081", - gift_card_balance_money: { amount: BigInt(1000), currency: "USD" }, - activate_activity_details: { - amount_money: { amount: BigInt(1000), currency: "USD" }, - order_id: "jJNGHm4gLI6XkFbwtiSLqK72KkAZY", - line_item_uid: "eIWl7X0nMuO9Ewbh0ChIx", - }, - redeem_activity_details: { amount_money: {} }, - clear_balance_activity_details: { reason: "SUSPICIOUS_ACTIVITY" }, - deactivate_activity_details: { reason: "SUSPICIOUS_ACTIVITY" }, - adjust_increment_activity_details: { amount_money: {}, reason: "COMPLIMENTARY" }, - adjust_decrement_activity_details: { amount_money: {}, reason: "SUSPICIOUS_ACTIVITY" }, - unlinked_activity_refund_activity_details: { amount_money: {} }, - import_activity_details: { amount_money: {} }, - block_activity_details: { reason: "CHARGEBACK_BLOCK" }, - unblock_activity_details: { reason: "CHARGEBACK_UNBLOCK" }, - import_reversal_activity_details: { amount_money: {} }, - transfer_balance_to_activity_details: { - transfer_from_gift_card_id: "transfer_from_gift_card_id", - amount_money: {}, - }, - transfer_balance_from_activity_details: { - transfer_to_gift_card_id: "transfer_to_gift_card_id", - amount_money: {}, - }, - }, - ], - cursor: "cursor", - }; - server - .mockEndpoint({ once: false }) - .get("/v2/gift-cards/activities") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - giftCardActivities: [ - { - id: "gcact_897698f894b44b3db46c6147e26a0e19", - type: "REDEEM", - locationId: "81FN9BNFZTKS4", - createdAt: "2021-06-02T22:26:38.000Z", - giftCardId: "gftc:6d55a72470d940c6ba09c0ab8ad08d20", - giftCardGan: "7783320002929081", - giftCardBalanceMoney: { - amount: BigInt("700"), - currency: "USD", - }, - redeemActivityDetails: { - amountMoney: { - amount: BigInt("300"), - currency: "USD", - }, - }, - clearBalanceActivityDetails: { - reason: "SUSPICIOUS_ACTIVITY", - }, - deactivateActivityDetails: { - reason: "SUSPICIOUS_ACTIVITY", - }, - adjustIncrementActivityDetails: { - amountMoney: {}, - reason: "COMPLIMENTARY", - }, - adjustDecrementActivityDetails: { - amountMoney: {}, - reason: "SUSPICIOUS_ACTIVITY", - }, - unlinkedActivityRefundActivityDetails: { - amountMoney: {}, - }, - importActivityDetails: { - amountMoney: {}, - }, - blockActivityDetails: { - reason: "CHARGEBACK_BLOCK", - }, - unblockActivityDetails: { - reason: "CHARGEBACK_UNBLOCK", - }, - importReversalActivityDetails: { - amountMoney: {}, - }, - transferBalanceToActivityDetails: { - transferFromGiftCardId: "transfer_from_gift_card_id", - amountMoney: {}, - }, - transferBalanceFromActivityDetails: { - transferToGiftCardId: "transfer_to_gift_card_id", - amountMoney: {}, - }, - }, - { - id: "gcact_b968ebfc7d46437b945be7b9e09123b4", - type: "ACTIVATE", - locationId: "81FN9BNFZTKS4", - createdAt: "2021-05-20T22:26:54.000Z", - giftCardId: "gftc:6d55a72470d940c6ba09c0ab8ad08d20", - giftCardGan: "7783320002929081", - giftCardBalanceMoney: { - amount: BigInt("1000"), - currency: "USD", - }, - activateActivityDetails: { - amountMoney: { - amount: BigInt("1000"), - currency: "USD", - }, - orderId: "jJNGHm4gLI6XkFbwtiSLqK72KkAZY", - lineItemUid: "eIWl7X0nMuO9Ewbh0ChIx", - }, - redeemActivityDetails: { - amountMoney: {}, - }, - clearBalanceActivityDetails: { - reason: "SUSPICIOUS_ACTIVITY", - }, - deactivateActivityDetails: { - reason: "SUSPICIOUS_ACTIVITY", - }, - adjustIncrementActivityDetails: { - amountMoney: {}, - reason: "COMPLIMENTARY", - }, - adjustDecrementActivityDetails: { - amountMoney: {}, - reason: "SUSPICIOUS_ACTIVITY", - }, - unlinkedActivityRefundActivityDetails: { - amountMoney: {}, - }, - importActivityDetails: { - amountMoney: {}, - }, - blockActivityDetails: { - reason: "CHARGEBACK_BLOCK", - }, - unblockActivityDetails: { - reason: "CHARGEBACK_UNBLOCK", - }, - importReversalActivityDetails: { - amountMoney: {}, - }, - transferBalanceToActivityDetails: { - transferFromGiftCardId: "transfer_from_gift_card_id", - amountMoney: {}, - }, - transferBalanceFromActivityDetails: { - transferToGiftCardId: "transfer_to_gift_card_id", - amountMoney: {}, - }, - }, - ], - cursor: "cursor", - }; - const page = await client.giftCards.activities.list({ - giftCardId: "gift_card_id", - type: "type", - locationId: "location_id", - beginTime: "begin_time", - endTime: "end_time", - limit: 1, - cursor: "cursor", - sortOrder: "sort_order", - }); - - expect(expected.giftCardActivities).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.giftCardActivities).toEqual(nextPage.data); - }); - +describe("Activities", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "U16kfr-kA70er-q4Rsym-7U7NnY", gift_card_activity: { diff --git a/tests/wire/inventory.test.ts b/tests/wire/inventory.test.ts index ef2971fa0..cf796a8b6 100644 --- a/tests/wire/inventory.test.ts +++ b/tests/wire/inventory.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("InventoryClient", () => { +describe("Inventory", () => { test("DeprecatedGetAdjustment", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -99,7 +101,7 @@ describe("InventoryClient", () => { test("getAdjustment", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -192,7 +194,7 @@ describe("InventoryClient", () => { test("DeprecatedBatchChange", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", changes: [ @@ -284,7 +286,7 @@ describe("InventoryClient", () => { test("DeprecatedBatchGetChanges", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { catalog_object_ids: ["W62UWFY35CWMYGVWK6TWJDNI"], location_ids: ["C6W5YS5QM06F5"], @@ -375,7 +377,7 @@ describe("InventoryClient", () => { test("DeprecatedBatchGetCounts", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { catalog_object_ids: ["W62UWFY35CWMYGVWK6TWJDNI"], location_ids: ["59TNP9SA8VGDA"], @@ -436,7 +438,7 @@ describe("InventoryClient", () => { test("BatchCreateChanges", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", changes: [ @@ -526,171 +528,9 @@ describe("InventoryClient", () => { }); }); - test("BatchGetChanges", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - const rawRequestBody = { - catalog_object_ids: ["W62UWFY35CWMYGVWK6TWJDNI"], - location_ids: ["C6W5YS5QM06F5"], - types: ["PHYSICAL_COUNT"], - states: ["IN_STOCK"], - updated_after: "2016-11-01T00:00:00.000Z", - updated_before: "2016-12-01T00:00:00.000Z", - }; - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - changes: [ - { - type: "PHYSICAL_COUNT", - physical_count: { - id: "46YDTW253DWGGK9HMAE6XCAO", - reference_id: "22c07cf4-5626-4224-89f9-691112019399", - catalog_object_id: "W62UWFY35CWMYGVWK6TWJDNI", - catalog_object_type: "ITEM_VARIATION", - state: "IN_STOCK", - location_id: "C6W5YS5QM06F5", - quantity: "86", - source: { - product: "SQUARE_POS", - application_id: "416ff29c-86c4-4feb-b58c-9705f21f3ea0", - name: "Square Point of Sale 4.37", - }, - team_member_id: "LRK57NSQ5X7PUD05", - occurred_at: "2016-11-16T22:24:49.028Z", - created_at: "2016-11-16T22:25:24.878Z", - }, - measurement_unit_id: "measurement_unit_id", - }, - ], - cursor: "cursor", - }; - server - .mockEndpoint({ once: false }) - .post("/v2/inventory/changes/batch-retrieve") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - changes: [ - { - type: "PHYSICAL_COUNT", - physicalCount: { - id: "46YDTW253DWGGK9HMAE6XCAO", - referenceId: "22c07cf4-5626-4224-89f9-691112019399", - catalogObjectId: "W62UWFY35CWMYGVWK6TWJDNI", - catalogObjectType: "ITEM_VARIATION", - state: "IN_STOCK", - locationId: "C6W5YS5QM06F5", - quantity: "86", - source: { - product: "SQUARE_POS", - applicationId: "416ff29c-86c4-4feb-b58c-9705f21f3ea0", - name: "Square Point of Sale 4.37", - }, - teamMemberId: "LRK57NSQ5X7PUD05", - occurredAt: "2016-11-16T22:24:49.028Z", - createdAt: "2016-11-16T22:25:24.878Z", - }, - measurementUnitId: "measurement_unit_id", - }, - ], - cursor: "cursor", - }; - const page = await client.inventory.batchGetChanges({ - catalogObjectIds: ["W62UWFY35CWMYGVWK6TWJDNI"], - locationIds: ["C6W5YS5QM06F5"], - types: ["PHYSICAL_COUNT"], - states: ["IN_STOCK"], - updatedAfter: "2016-11-01T00:00:00.000Z", - updatedBefore: "2016-12-01T00:00:00.000Z", - }); - - expect(expected.changes).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.changes).toEqual(nextPage.data); - }); - - test("BatchGetCounts", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - const rawRequestBody = { - catalog_object_ids: ["W62UWFY35CWMYGVWK6TWJDNI"], - location_ids: ["59TNP9SA8VGDA"], - updated_after: "2016-11-16T00:00:00.000Z", - }; - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - counts: [ - { - catalog_object_id: "W62UWFY35CWMYGVWK6TWJDNI", - catalog_object_type: "ITEM_VARIATION", - state: "IN_STOCK", - location_id: "59TNP9SA8VGDA", - quantity: "79", - calculated_at: "2016-11-16T22:28:01.223Z", - is_estimated: true, - }, - ], - cursor: "cursor", - }; - server - .mockEndpoint({ once: false }) - .post("/v2/inventory/counts/batch-retrieve") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - counts: [ - { - catalogObjectId: "W62UWFY35CWMYGVWK6TWJDNI", - catalogObjectType: "ITEM_VARIATION", - state: "IN_STOCK", - locationId: "59TNP9SA8VGDA", - quantity: "79", - calculatedAt: "2016-11-16T22:28:01.223Z", - isEstimated: true, - }, - ], - cursor: "cursor", - }; - const page = await client.inventory.batchGetCounts({ - catalogObjectIds: ["W62UWFY35CWMYGVWK6TWJDNI"], - locationIds: ["59TNP9SA8VGDA"], - updatedAfter: "2016-11-16T00:00:00.000Z", - }); - - expect(expected.counts).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.counts).toEqual(nextPage.data); - }); - test("deprecatedGetPhysicalCount", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -756,7 +596,7 @@ describe("InventoryClient", () => { test("getPhysicalCount", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -822,7 +662,7 @@ describe("InventoryClient", () => { test("getTransfer", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -887,159 +727,4 @@ describe("InventoryClient", () => { }, }); }); - - test("get", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - counts: [ - { - catalog_object_id: "W62UWFY35CWMYGVWK6TWJDNI", - catalog_object_type: "ITEM_VARIATION", - state: "IN_STOCK", - location_id: "C6W5YS5QM06F5", - quantity: "22", - calculated_at: "2016-11-16T22:28:01.223Z", - is_estimated: true, - }, - ], - cursor: "cursor", - }; - server - .mockEndpoint({ once: false }) - .get("/v2/inventory/catalog_object_id") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - counts: [ - { - catalogObjectId: "W62UWFY35CWMYGVWK6TWJDNI", - catalogObjectType: "ITEM_VARIATION", - state: "IN_STOCK", - locationId: "C6W5YS5QM06F5", - quantity: "22", - calculatedAt: "2016-11-16T22:28:01.223Z", - isEstimated: true, - }, - ], - cursor: "cursor", - }; - const page = await client.inventory.get({ - catalogObjectId: "catalog_object_id", - locationIds: "location_ids", - cursor: "cursor", - }); - - expect(expected.counts).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.counts).toEqual(nextPage.data); - }); - - test("changes", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - changes: [ - { - type: "ADJUSTMENT", - adjustment: { - id: "OJKJIUANKLMLQANZADNPLKAD", - reference_id: "d8207693-168f-4b44-a2fd-a7ff533ddd26", - from_state: "IN_STOCK", - to_state: "SOLD", - location_id: "C6W5YS5QM06F5", - catalog_object_id: "W62UWFY35CWMYGVWK6TWJDNI", - catalog_object_type: "ITEM_VARIATION", - quantity: "3", - total_price_money: { amount: BigInt(5000), currency: "USD" }, - occurred_at: "2016-11-16T22:25:24.878Z", - created_at: "2016-11-16T22:25:24.878Z", - source: { - product: "SQUARE_POS", - application_id: "416ff29c-86c4-4feb-b58c-9705f21f3ea0", - name: "Square Point of Sale 4.37", - }, - team_member_id: "AV7YRCGI2H1J5NQ8E1XIZCNA", - transaction_id: "5APV6JYK1SNCZD11AND2RX1Z", - }, - measurement_unit_id: "measurement_unit_id", - }, - ], - cursor: "cursor", - }; - server - .mockEndpoint({ once: false }) - .get("/v2/inventory/catalog_object_id/changes") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - changes: [ - { - type: "ADJUSTMENT", - adjustment: { - id: "OJKJIUANKLMLQANZADNPLKAD", - referenceId: "d8207693-168f-4b44-a2fd-a7ff533ddd26", - fromState: "IN_STOCK", - toState: "SOLD", - locationId: "C6W5YS5QM06F5", - catalogObjectId: "W62UWFY35CWMYGVWK6TWJDNI", - catalogObjectType: "ITEM_VARIATION", - quantity: "3", - totalPriceMoney: { - amount: BigInt("5000"), - currency: "USD", - }, - occurredAt: "2016-11-16T22:25:24.878Z", - createdAt: "2016-11-16T22:25:24.878Z", - source: { - product: "SQUARE_POS", - applicationId: "416ff29c-86c4-4feb-b58c-9705f21f3ea0", - name: "Square Point of Sale 4.37", - }, - teamMemberId: "AV7YRCGI2H1J5NQ8E1XIZCNA", - transactionId: "5APV6JYK1SNCZD11AND2RX1Z", - }, - measurementUnitId: "measurement_unit_id", - }, - ], - cursor: "cursor", - }; - const page = await client.inventory.changes({ - catalogObjectId: "catalog_object_id", - locationIds: "location_ids", - cursor: "cursor", - }); - - expect(expected.changes).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.changes).toEqual(nextPage.data); - }); }); diff --git a/tests/wire/invoices.test.ts b/tests/wire/invoices.test.ts index 139927a93..656882160 100644 --- a/tests/wire/invoices.test.ts +++ b/tests/wire/invoices.test.ts @@ -1,348 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("InvoicesClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - invoices: [ - { - id: "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", - version: 1, - location_id: "ES0RJRZYEC39A", - order_id: "CAISENgvlJ6jLWAzERDzjyHVybY", - primary_recipient: { - customer_id: "JDKYHBWT1D4F8MFH63DBMEN8Y4", - given_name: "Amelia", - family_name: "Earhart", - email_address: "Amelia.Earhart@example.com", - phone_number: "1-212-555-4240", - }, - payment_requests: [ - { - uid: "2da7964f-f3d2-4f43-81e8-5aa220bf3355", - request_type: "BALANCE", - due_date: "2030-01-24", - tipping_enabled: true, - automatic_payment_source: "NONE", - reminders: [ - { - uid: "beebd363-e47f-4075-8785-c235aaa7df11", - relative_scheduled_days: -1, - message: "Your invoice is due tomorrow", - status: "PENDING", - }, - ], - computed_amount_money: { amount: BigInt(10000), currency: "USD" }, - total_completed_amount_money: { amount: BigInt(0), currency: "USD" }, - }, - ], - delivery_method: "EMAIL", - invoice_number: "inv-100", - title: "Event Planning Services", - description: "We appreciate your business!", - scheduled_at: "2030-01-13T10:00:00Z", - public_url: "public_url", - status: "DRAFT", - timezone: "America/Los_Angeles", - created_at: "2030-01-13T17:45:13Z", - updated_at: "2030-01-13T21:24:10Z", - accepted_payment_methods: { - card: true, - square_gift_card: false, - bank_account: false, - buy_now_pay_later: false, - cash_app_pay: false, - }, - custom_fields: [ - { label: "Event Reference Number", value: "Ref. #1234", placement: "ABOVE_LINE_ITEMS" }, - { - label: "Terms of Service", - value: "The terms of service are...", - placement: "BELOW_LINE_ITEMS", - }, - ], - subscription_id: "subscription_id", - sale_or_service_date: "2030-01-24", - payment_conditions: "payment_conditions", - store_payment_method_enabled: false, - attachments: [ - { - id: "inva:0-3bB9ZuDHiziThQhuC4fwWt", - filename: "file.jpg", - description: "Service contract", - filesize: 102705, - hash: "273ee02cb6f5f8a3a8ca23604930dd53", - mime_type: "image/jpeg", - uploaded_at: "2030-01-13T21:24:10Z", - }, - ], - creator_team_member_id: "creator_team_member_id", - }, - { - id: "inv:0-ChC366qAfskpGrBI_1bozs9mEA3", - version: 3, - location_id: "ES0RJRZYEC39A", - order_id: "a65jnS8NXbfprvGJzY9F4fQTuaB", - primary_recipient: { - customer_id: "JDKYHBWT1D4F8MFH63DBMEN8Y4", - given_name: "Amelia", - family_name: "Earhart", - email_address: "Amelia.Earhart@example.com", - phone_number: "1-212-555-4240", - }, - payment_requests: [ - { - uid: "66c3bdfd-5090-4ff9-a8a0-c1e1a2ffa176", - request_type: "DEPOSIT", - due_date: "2021-01-23", - percentage_requested: "25", - tipping_enabled: false, - automatic_payment_source: "CARD_ON_FILE", - card_id: "ccof:IkWfpLj4tNHMyFii3GB", - computed_amount_money: { amount: BigInt(1000), currency: "USD" }, - total_completed_amount_money: { amount: BigInt(1000), currency: "USD" }, - }, - { - uid: "120c5e18-4f80-4f6b-b159-774cb9bf8f99", - request_type: "BALANCE", - due_date: "2021-06-15", - tipping_enabled: false, - automatic_payment_source: "CARD_ON_FILE", - card_id: "ccof:IkWfpLj4tNHMyFii3GB", - computed_amount_money: { amount: BigInt(3000), currency: "USD" }, - total_completed_amount_money: { amount: BigInt(0), currency: "USD" }, - }, - ], - delivery_method: "EMAIL", - invoice_number: "inv-455", - title: "title", - description: "description", - scheduled_at: "scheduled_at", - public_url: "https://squareup.com/pay-invoice/invtmp:5e22a2c2-47c1-46d6-b061-808764dfe2b9", - next_payment_amount_money: { amount: BigInt(3000), currency: "USD" }, - status: "PARTIALLY_PAID", - timezone: "America/Los_Angeles", - created_at: "2021-01-23T15:29:12Z", - updated_at: "2021-01-23T15:29:56Z", - accepted_payment_methods: { - card: true, - square_gift_card: true, - bank_account: false, - buy_now_pay_later: false, - cash_app_pay: false, - }, - custom_fields: [{}], - subscription_id: "subscription_id", - sale_or_service_date: "2030-01-24", - payment_conditions: "payment_conditions", - store_payment_method_enabled: false, - attachments: [{}], - creator_team_member_id: "creator_team_member_id", - }, - ], - cursor: "ChoIDhIWVm54ZVRhLXhySFBOejBBM2xJb2daUQoFCI4IGAE", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/invoices") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - invoices: [ - { - id: "inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", - version: 1, - locationId: "ES0RJRZYEC39A", - orderId: "CAISENgvlJ6jLWAzERDzjyHVybY", - primaryRecipient: { - customerId: "JDKYHBWT1D4F8MFH63DBMEN8Y4", - givenName: "Amelia", - familyName: "Earhart", - emailAddress: "Amelia.Earhart@example.com", - phoneNumber: "1-212-555-4240", - }, - paymentRequests: [ - { - uid: "2da7964f-f3d2-4f43-81e8-5aa220bf3355", - requestType: "BALANCE", - dueDate: "2030-01-24", - tippingEnabled: true, - automaticPaymentSource: "NONE", - reminders: [ - { - uid: "beebd363-e47f-4075-8785-c235aaa7df11", - relativeScheduledDays: -1, - message: "Your invoice is due tomorrow", - status: "PENDING", - }, - ], - computedAmountMoney: { - amount: BigInt("10000"), - currency: "USD", - }, - totalCompletedAmountMoney: { - amount: BigInt("0"), - currency: "USD", - }, - }, - ], - deliveryMethod: "EMAIL", - invoiceNumber: "inv-100", - title: "Event Planning Services", - description: "We appreciate your business!", - scheduledAt: "2030-01-13T10:00:00Z", - publicUrl: "public_url", - status: "DRAFT", - timezone: "America/Los_Angeles", - createdAt: "2030-01-13T17:45:13Z", - updatedAt: "2030-01-13T21:24:10Z", - acceptedPaymentMethods: { - card: true, - squareGiftCard: false, - bankAccount: false, - buyNowPayLater: false, - cashAppPay: false, - }, - customFields: [ - { - label: "Event Reference Number", - value: "Ref. #1234", - placement: "ABOVE_LINE_ITEMS", - }, - { - label: "Terms of Service", - value: "The terms of service are...", - placement: "BELOW_LINE_ITEMS", - }, - ], - subscriptionId: "subscription_id", - saleOrServiceDate: "2030-01-24", - paymentConditions: "payment_conditions", - storePaymentMethodEnabled: false, - attachments: [ - { - id: "inva:0-3bB9ZuDHiziThQhuC4fwWt", - filename: "file.jpg", - description: "Service contract", - filesize: 102705, - hash: "273ee02cb6f5f8a3a8ca23604930dd53", - mimeType: "image/jpeg", - uploadedAt: "2030-01-13T21:24:10Z", - }, - ], - creatorTeamMemberId: "creator_team_member_id", - }, - { - id: "inv:0-ChC366qAfskpGrBI_1bozs9mEA3", - version: 3, - locationId: "ES0RJRZYEC39A", - orderId: "a65jnS8NXbfprvGJzY9F4fQTuaB", - primaryRecipient: { - customerId: "JDKYHBWT1D4F8MFH63DBMEN8Y4", - givenName: "Amelia", - familyName: "Earhart", - emailAddress: "Amelia.Earhart@example.com", - phoneNumber: "1-212-555-4240", - }, - paymentRequests: [ - { - uid: "66c3bdfd-5090-4ff9-a8a0-c1e1a2ffa176", - requestType: "DEPOSIT", - dueDate: "2021-01-23", - percentageRequested: "25", - tippingEnabled: false, - automaticPaymentSource: "CARD_ON_FILE", - cardId: "ccof:IkWfpLj4tNHMyFii3GB", - computedAmountMoney: { - amount: BigInt("1000"), - currency: "USD", - }, - totalCompletedAmountMoney: { - amount: BigInt("1000"), - currency: "USD", - }, - }, - { - uid: "120c5e18-4f80-4f6b-b159-774cb9bf8f99", - requestType: "BALANCE", - dueDate: "2021-06-15", - tippingEnabled: false, - automaticPaymentSource: "CARD_ON_FILE", - cardId: "ccof:IkWfpLj4tNHMyFii3GB", - computedAmountMoney: { - amount: BigInt("3000"), - currency: "USD", - }, - totalCompletedAmountMoney: { - amount: BigInt("0"), - currency: "USD", - }, - }, - ], - deliveryMethod: "EMAIL", - invoiceNumber: "inv-455", - title: "title", - description: "description", - scheduledAt: "scheduled_at", - publicUrl: "https://squareup.com/pay-invoice/invtmp:5e22a2c2-47c1-46d6-b061-808764dfe2b9", - nextPaymentAmountMoney: { - amount: BigInt("3000"), - currency: "USD", - }, - status: "PARTIALLY_PAID", - timezone: "America/Los_Angeles", - createdAt: "2021-01-23T15:29:12Z", - updatedAt: "2021-01-23T15:29:56Z", - acceptedPaymentMethods: { - card: true, - squareGiftCard: true, - bankAccount: false, - buyNowPayLater: false, - cashAppPay: false, - }, - customFields: [{}], - subscriptionId: "subscription_id", - saleOrServiceDate: "2030-01-24", - paymentConditions: "payment_conditions", - storePaymentMethodEnabled: false, - attachments: [{}], - creatorTeamMemberId: "creator_team_member_id", - }, - ], - cursor: "ChoIDhIWVm54ZVRhLXhySFBOejBBM2xJb2daUQoFCI4IGAE", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }; - const page = await client.invoices.list({ - locationId: "location_id", - cursor: "cursor", - limit: 1, - }); - - expect(expected.invoices).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.invoices).toEqual(nextPage.data); - }); - +describe("Invoices", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { invoice: { location_id: "ES0RJRZYEC39A", @@ -593,7 +259,7 @@ describe("InvoicesClient", () => { test("search", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { query: { filter: { location_ids: ["ES0RJRZYEC39A"], customer_ids: ["JDKYHBWT1D4F8MFH63DBMEN8Y4"] }, @@ -919,7 +585,7 @@ describe("InvoicesClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { invoice: { @@ -1088,7 +754,7 @@ describe("InvoicesClient", () => { test("update", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { invoice: { version: 1, @@ -1258,7 +924,7 @@ describe("InvoicesClient", () => { test("delete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -1289,7 +955,7 @@ describe("InvoicesClient", () => { test("DeleteInvoiceAttachment", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -1320,7 +986,7 @@ describe("InvoicesClient", () => { test("cancel", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { version: 0 }; const rawResponseBody = { invoice: { @@ -1491,7 +1157,7 @@ describe("InvoicesClient", () => { test("publish", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { version: 1, idempotency_key: "32da42d0-1997-41b0-826b-f09464fc2c2e" }; const rawResponseBody = { invoice: { diff --git a/tests/wire/labor.test.ts b/tests/wire/labor.test.ts index 14c2c941c..5429ecddd 100644 --- a/tests/wire/labor.test.ts +++ b/tests/wire/labor.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("LaborClient", () => { +describe("Labor", () => { test("CreateScheduledShift", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "HIDSNG5KS478L", scheduled_shift: { @@ -113,7 +115,7 @@ describe("LaborClient", () => { test("BulkPublishScheduledShifts", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { scheduled_shifts: { key: {} }, scheduled_shift_notification_audience: "AFFECTED" }; const rawResponseBody = { responses: { @@ -234,7 +236,7 @@ describe("LaborClient", () => { test("SearchScheduledShifts", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { query: { filter: { assignment_status: "ASSIGNED" }, sort: { field: "CREATED_AT", order: "ASC" } }, limit: 2, @@ -317,7 +319,7 @@ describe("LaborClient", () => { test("RetrieveScheduledShift", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { scheduled_shift: { @@ -399,7 +401,7 @@ describe("LaborClient", () => { test("UpdateScheduledShift", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { scheduled_shift: { draft_shift_details: { @@ -507,7 +509,7 @@ describe("LaborClient", () => { test("PublishScheduledShift", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "HIDSNG5KS478L", version: 2, @@ -597,7 +599,7 @@ describe("LaborClient", () => { test("CreateTimecard", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "HIDSNG5KS478L", timecard: { @@ -742,7 +744,7 @@ describe("LaborClient", () => { test("SearchTimecards", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { query: { filter: { @@ -952,7 +954,7 @@ describe("LaborClient", () => { test("RetrieveTimecard", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { timecard: { @@ -1048,7 +1050,7 @@ describe("LaborClient", () => { test("UpdateTimecard", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { timecard: { location_id: "PAA1RJZZKXBFG", @@ -1202,7 +1204,7 @@ describe("LaborClient", () => { test("DeleteTimecard", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/labor/breakTypes.test.ts b/tests/wire/labor/breakTypes.test.ts index 26d693d71..6f5e31b29 100644 --- a/tests/wire/labor/breakTypes.test.ts +++ b/tests/wire/labor/breakTypes.test.ts @@ -1,95 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("BreakTypesClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - break_types: [ - { - id: "REGS1EQR1TPZ5", - location_id: "PAA1RJZZKXBFG", - break_name: "Coffee Break", - expected_duration: "PT5M", - is_paid: false, - version: 1, - created_at: "2019-01-22T20:47:37Z", - updated_at: "2019-01-22T20:47:37Z", - }, - { - id: "92EPDRQKJ5088", - location_id: "PAA1RJZZKXBFG", - break_name: "Lunch Break", - expected_duration: "PT1H", - is_paid: true, - version: 3, - created_at: "2019-01-25T19:26:30Z", - updated_at: "2019-01-25T19:26:30Z", - }, - ], - cursor: "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/labor/break-types") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - breakTypes: [ - { - id: "REGS1EQR1TPZ5", - locationId: "PAA1RJZZKXBFG", - breakName: "Coffee Break", - expectedDuration: "PT5M", - isPaid: false, - version: 1, - createdAt: "2019-01-22T20:47:37Z", - updatedAt: "2019-01-22T20:47:37Z", - }, - { - id: "92EPDRQKJ5088", - locationId: "PAA1RJZZKXBFG", - breakName: "Lunch Break", - expectedDuration: "PT1H", - isPaid: true, - version: 3, - createdAt: "2019-01-25T19:26:30Z", - updatedAt: "2019-01-25T19:26:30Z", - }, - ], - cursor: "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }; - const page = await client.labor.breakTypes.list({ - locationId: "location_id", - limit: 1, - cursor: "cursor", - }); - - expect(expected.breakTypes).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.breakTypes).toEqual(nextPage.data); - }); - +describe("BreakTypes", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "PAD3NG5KSN2GL", break_type: { @@ -154,7 +73,7 @@ describe("BreakTypesClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { break_type: { @@ -204,7 +123,7 @@ describe("BreakTypesClient", () => { test("update", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { break_type: { location_id: "26M7H24AZ9N6R", @@ -270,7 +189,7 @@ describe("BreakTypesClient", () => { test("delete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/labor/employeeWages.test.ts b/tests/wire/labor/employeeWages.test.ts index 20b255e15..84b376a06 100644 --- a/tests/wire/labor/employeeWages.test.ts +++ b/tests/wire/labor/employeeWages.test.ts @@ -1,115 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("EmployeeWagesClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - employee_wages: [ - { - id: "pXS3qCv7BERPnEGedM4S8mhm", - employee_id: "33fJchumvVdJwxV0H6L9", - title: "Manager", - hourly_rate: { amount: BigInt(3250), currency: "USD" }, - }, - { - id: "rZduCkzYDUVL3ovh1sQgbue6", - employee_id: "33fJchumvVdJwxV0H6L9", - title: "Cook", - hourly_rate: { amount: BigInt(2600), currency: "USD" }, - }, - { - id: "FxLbs5KpPUHa8wyt5ctjubDX", - employee_id: "33fJchumvVdJwxV0H6L9", - title: "Barista", - hourly_rate: { amount: BigInt(1600), currency: "USD" }, - }, - { - id: "vD1wCgijMDR3cX5TPnu7VXto", - employee_id: "33fJchumvVdJwxV0H6L9", - title: "Cashier", - hourly_rate: { amount: BigInt(1700), currency: "USD" }, - }, - ], - cursor: "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/labor/employee-wages") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - employeeWages: [ - { - id: "pXS3qCv7BERPnEGedM4S8mhm", - employeeId: "33fJchumvVdJwxV0H6L9", - title: "Manager", - hourlyRate: { - amount: BigInt("3250"), - currency: "USD", - }, - }, - { - id: "rZduCkzYDUVL3ovh1sQgbue6", - employeeId: "33fJchumvVdJwxV0H6L9", - title: "Cook", - hourlyRate: { - amount: BigInt("2600"), - currency: "USD", - }, - }, - { - id: "FxLbs5KpPUHa8wyt5ctjubDX", - employeeId: "33fJchumvVdJwxV0H6L9", - title: "Barista", - hourlyRate: { - amount: BigInt("1600"), - currency: "USD", - }, - }, - { - id: "vD1wCgijMDR3cX5TPnu7VXto", - employeeId: "33fJchumvVdJwxV0H6L9", - title: "Cashier", - hourlyRate: { - amount: BigInt("1700"), - currency: "USD", - }, - }, - ], - cursor: "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }; - const page = await client.labor.employeeWages.list({ - employeeId: "employee_id", - limit: 1, - cursor: "cursor", - }); - - expect(expected.employeeWages).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.employeeWages).toEqual(nextPage.data); - }); - +describe("EmployeeWages", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { employee_wage: { diff --git a/tests/wire/labor/shifts.test.ts b/tests/wire/labor/shifts.test.ts index 56086aaa4..e614b9e17 100644 --- a/tests/wire/labor/shifts.test.ts +++ b/tests/wire/labor/shifts.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("ShiftsClient", () => { +describe("Shifts", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "HIDSNG5KS478L", shift: { @@ -153,7 +155,7 @@ describe("ShiftsClient", () => { test("search", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { query: { filter: { @@ -367,7 +369,7 @@ describe("ShiftsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { shift: { @@ -465,7 +467,7 @@ describe("ShiftsClient", () => { test("update", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { shift: { location_id: "PAA1RJZZKXBFG", @@ -619,7 +621,7 @@ describe("ShiftsClient", () => { test("delete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/labor/teamMemberWages.test.ts b/tests/wire/labor/teamMemberWages.test.ts index f1b95d065..b1ccd8bd5 100644 --- a/tests/wire/labor/teamMemberWages.test.ts +++ b/tests/wire/labor/teamMemberWages.test.ts @@ -1,131 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("TeamMemberWagesClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - team_member_wages: [ - { - id: "pXS3qCv7BERPnEGedM4S8mhm", - team_member_id: "33fJchumvVdJwxV0H6L9", - title: "Manager", - hourly_rate: { amount: BigInt(3250), currency: "USD" }, - job_id: "jxJNN6eCJsLrhg5UFJrDWDGE", - tip_eligible: false, - }, - { - id: "rZduCkzYDUVL3ovh1sQgbue6", - team_member_id: "33fJchumvVdJwxV0H6L9", - title: "Cook", - hourly_rate: { amount: BigInt(2600), currency: "USD" }, - job_id: "gcbz15vKGnMKmaWJJ152kjim", - tip_eligible: true, - }, - { - id: "FxLbs5KpPUHa8wyt5ctjubDX", - team_member_id: "33fJchumvVdJwxV0H6L9", - title: "Barista", - hourly_rate: { amount: BigInt(1600), currency: "USD" }, - job_id: "FzbJAtt9qEWncK1BWgVCxQ6M", - tip_eligible: true, - }, - { - id: "vD1wCgijMDR3cX5TPnu7VXto", - team_member_id: "33fJchumvVdJwxV0H6L9", - title: "Cashier", - hourly_rate: { amount: BigInt(1700), currency: "USD" }, - job_id: "N4YKVLzFj3oGtNocqoYHYpW3", - tip_eligible: true, - }, - ], - cursor: "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/labor/team-member-wages") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - teamMemberWages: [ - { - id: "pXS3qCv7BERPnEGedM4S8mhm", - teamMemberId: "33fJchumvVdJwxV0H6L9", - title: "Manager", - hourlyRate: { - amount: BigInt("3250"), - currency: "USD", - }, - jobId: "jxJNN6eCJsLrhg5UFJrDWDGE", - tipEligible: false, - }, - { - id: "rZduCkzYDUVL3ovh1sQgbue6", - teamMemberId: "33fJchumvVdJwxV0H6L9", - title: "Cook", - hourlyRate: { - amount: BigInt("2600"), - currency: "USD", - }, - jobId: "gcbz15vKGnMKmaWJJ152kjim", - tipEligible: true, - }, - { - id: "FxLbs5KpPUHa8wyt5ctjubDX", - teamMemberId: "33fJchumvVdJwxV0H6L9", - title: "Barista", - hourlyRate: { - amount: BigInt("1600"), - currency: "USD", - }, - jobId: "FzbJAtt9qEWncK1BWgVCxQ6M", - tipEligible: true, - }, - { - id: "vD1wCgijMDR3cX5TPnu7VXto", - teamMemberId: "33fJchumvVdJwxV0H6L9", - title: "Cashier", - hourlyRate: { - amount: BigInt("1700"), - currency: "USD", - }, - jobId: "N4YKVLzFj3oGtNocqoYHYpW3", - tipEligible: true, - }, - ], - cursor: "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }; - const page = await client.labor.teamMemberWages.list({ - teamMemberId: "team_member_id", - limit: 1, - cursor: "cursor", - }); - - expect(expected.teamMemberWages).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.teamMemberWages).toEqual(nextPage.data); - }); - +describe("TeamMemberWages", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { team_member_wage: { diff --git a/tests/wire/labor/workweekConfigs.test.ts b/tests/wire/labor/workweekConfigs.test.ts index 0b110a0c0..05e8a06e0 100644 --- a/tests/wire/labor/workweekConfigs.test.ts +++ b/tests/wire/labor/workweekConfigs.test.ts @@ -1,70 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("WorkweekConfigsClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - workweek_configs: [ - { - id: "FY4VCAQN700GM", - start_of_week: "MON", - start_of_day_local_time: "10:00", - version: 11, - created_at: "2016-02-04T00:58:24Z", - updated_at: "2019-02-28T01:04:35Z", - }, - ], - cursor: "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/labor/workweek-configs") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - workweekConfigs: [ - { - id: "FY4VCAQN700GM", - startOfWeek: "MON", - startOfDayLocalTime: "10:00", - version: 11, - createdAt: "2016-02-04T00:58:24Z", - updatedAt: "2019-02-28T01:04:35Z", - }, - ], - cursor: "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }; - const page = await client.labor.workweekConfigs.list({ - limit: 1, - cursor: "cursor", - }); - - expect(expected.workweekConfigs).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.workweekConfigs).toEqual(nextPage.data); - }); - +describe("WorkweekConfigs", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { workweek_config: { start_of_week: "MON", start_of_day_local_time: "10:00", version: 10 }, }; diff --git a/tests/wire/locations.test.ts b/tests/wire/locations.test.ts index 7b0a51148..2cde675ff 100644 --- a/tests/wire/locations.test.ts +++ b/tests/wire/locations.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("LocationsClient", () => { +describe("Locations", () => { test("list", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -163,7 +165,7 @@ describe("LocationsClient", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { location: { name: "Midtown", @@ -319,7 +321,7 @@ describe("LocationsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -454,7 +456,7 @@ describe("LocationsClient", () => { test("update", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { location: { business_hours: { @@ -645,7 +647,7 @@ describe("LocationsClient", () => { test("checkouts", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "86ae1696-b1e3-4328-af6d-f1e04d947ad6", order: { diff --git a/tests/wire/locations/customAttributeDefinitions.test.ts b/tests/wire/locations/customAttributeDefinitions.test.ts index bc461d255..9981e7c1c 100644 --- a/tests/wire/locations/customAttributeDefinitions.test.ts +++ b/tests/wire/locations/customAttributeDefinitions.test.ts @@ -1,103 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("CustomAttributeDefinitionsClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - custom_attribute_definitions: [ - { - key: "phone-number", - schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.PhoneNumber", - }, - name: "phone number", - description: "Location's phone number", - visibility: "VISIBILITY_READ_ONLY", - version: 1, - updated_at: "2022-12-02T19:50:21.832Z", - created_at: "2022-12-02T19:50:21.832Z", - }, - { - key: "bestseller", - schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String", - }, - name: "Bestseller", - description: "Bestselling item at location", - visibility: "VISIBILITY_READ_WRITE_VALUES", - version: 4, - updated_at: "2022-12-03T10:17:52.341Z", - created_at: "2022-12-02T19:06:36.559Z", - }, - ], - cursor: "ImfNzWVSiAYyiAR4gEcxDJ75KZAOSjX8H2BVHUTR0ofCtp4SdYvrUKbwYY2aCH2WqZ2FsfAuylEVUlTfaINg3ecIlFpP9Y5Ie66w9NSg9nqdI5fCJ6qdH2s0za5m2plFonsjIuFaoN89j78ROUwuSOzD6mFZPcJHhJ0CxEKc0SBH", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/locations/custom-attribute-definitions") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - customAttributeDefinitions: [ - { - key: "phone-number", - schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.PhoneNumber", - }, - name: "phone number", - description: "Location's phone number", - visibility: "VISIBILITY_READ_ONLY", - version: 1, - updatedAt: "2022-12-02T19:50:21.832Z", - createdAt: "2022-12-02T19:50:21.832Z", - }, - { - key: "bestseller", - schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String", - }, - name: "Bestseller", - description: "Bestselling item at location", - visibility: "VISIBILITY_READ_WRITE_VALUES", - version: 4, - updatedAt: "2022-12-03T10:17:52.341Z", - createdAt: "2022-12-02T19:06:36.559Z", - }, - ], - cursor: "ImfNzWVSiAYyiAR4gEcxDJ75KZAOSjX8H2BVHUTR0ofCtp4SdYvrUKbwYY2aCH2WqZ2FsfAuylEVUlTfaINg3ecIlFpP9Y5Ie66w9NSg9nqdI5fCJ6qdH2s0za5m2plFonsjIuFaoN89j78ROUwuSOzD6mFZPcJHhJ0CxEKc0SBH", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }; - const page = await client.locations.customAttributeDefinitions.list({ - visibilityFilter: "ALL", - limit: 1, - cursor: "cursor", - }); - - expect(expected.customAttributeDefinitions).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.customAttributeDefinitions).toEqual(nextPage.data); - }); - +describe("CustomAttributeDefinitions", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { custom_attribute_definition: { key: "bestseller", @@ -170,7 +81,7 @@ describe("CustomAttributeDefinitionsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { custom_attribute_definition: { @@ -225,7 +136,7 @@ describe("CustomAttributeDefinitionsClient", () => { test("update", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { custom_attribute_definition: { description: "Update the description as desired.", @@ -289,7 +200,7 @@ describe("CustomAttributeDefinitionsClient", () => { test("delete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/locations/customAttributes.test.ts b/tests/wire/locations/customAttributes.test.ts index 4e9b19320..97be77755 100644 --- a/tests/wire/locations/customAttributes.test.ts +++ b/tests/wire/locations/customAttributes.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("CustomAttributesClient", () => { +describe("CustomAttributes", () => { test("batchDelete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { values: { id1: { key: "bestseller" }, id2: { key: "bestseller" }, id3: { key: "phone-number" } }, }; @@ -92,7 +94,7 @@ describe("CustomAttributesClient", () => { test("batchUpsert", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { values: { id1: { location_id: "L0TBCBTB7P8RQ", custom_attribute: { key: "bestseller", value: "hot cocoa" } }, @@ -240,86 +242,9 @@ describe("CustomAttributesClient", () => { }); }); - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - custom_attributes: [ - { - key: "phone-number", - value: "+12223334444", - version: 1, - visibility: "VISIBILITY_READ_WRITE_VALUES", - updated_at: "2022-12-12T18:13:03.745Z", - created_at: "2022-12-12T18:13:03.745Z", - }, - { - key: "bestseller", - value: "hot cocoa", - version: 1, - visibility: "VISIBILITY_READ_WRITE_VALUES", - updated_at: "2022-12-12T19:27:57.975Z", - created_at: "2022-12-12T19:27:57.975Z", - }, - ], - cursor: "cursor", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/locations/location_id/custom-attributes") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - customAttributes: [ - { - key: "phone-number", - value: "+12223334444", - version: 1, - visibility: "VISIBILITY_READ_WRITE_VALUES", - updatedAt: "2022-12-12T18:13:03.745Z", - createdAt: "2022-12-12T18:13:03.745Z", - }, - { - key: "bestseller", - value: "hot cocoa", - version: 1, - visibility: "VISIBILITY_READ_WRITE_VALUES", - updatedAt: "2022-12-12T19:27:57.975Z", - createdAt: "2022-12-12T19:27:57.975Z", - }, - ], - cursor: "cursor", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }; - const page = await client.locations.customAttributes.list({ - locationId: "location_id", - visibilityFilter: "ALL", - limit: 1, - cursor: "cursor", - withDefinitions: true, - }); - - expect(expected.customAttributes).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.customAttributes).toEqual(nextPage.data); - }); - test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { custom_attribute: { @@ -390,7 +315,7 @@ describe("CustomAttributesClient", () => { test("upsert", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { custom_attribute: { value: "hot cocoa" } }; const rawResponseBody = { custom_attribute: { @@ -463,7 +388,7 @@ describe("CustomAttributesClient", () => { test("delete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/locations/transactions.test.ts b/tests/wire/locations/transactions.test.ts index c1a5e5bf9..1c73f947a 100644 --- a/tests/wire/locations/transactions.test.ts +++ b/tests/wire/locations/transactions.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("TransactionsClient", () => { +describe("Transactions", () => { test("list", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -173,7 +175,7 @@ describe("TransactionsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -326,7 +328,7 @@ describe("TransactionsClient", () => { test("capture", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -357,7 +359,7 @@ describe("TransactionsClient", () => { test("void", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/loyalty.test.ts b/tests/wire/loyalty.test.ts index ab052ec7a..95b8cbc48 100644 --- a/tests/wire/loyalty.test.ts +++ b/tests/wire/loyalty.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("LoyaltyClient", () => { +describe("Loyalty", () => { test("searchEvents", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { query: { filter: { order_filter: { order_id: "PyATxhYLfsMqpVkcKJITPydgEYfZY" } } }, limit: 30, diff --git a/tests/wire/loyalty/accounts.test.ts b/tests/wire/loyalty/accounts.test.ts index a2fb805be..ff92ebe22 100644 --- a/tests/wire/loyalty/accounts.test.ts +++ b/tests/wire/loyalty/accounts.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("AccountsClient", () => { +describe("Accounts", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { loyalty_account: { program_id: "d619f755-2d17-41f3-990d-c04ecedd64dd", @@ -86,7 +88,7 @@ describe("AccountsClient", () => { test("search", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { query: { mappings: [{ phone_number: "+14155551234" }] }, limit: 10 }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -167,7 +169,7 @@ describe("AccountsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -234,7 +236,7 @@ describe("AccountsClient", () => { test("accumulatePoints", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { accumulate_points: { order_id: "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY" }, idempotency_key: "58b90739-c3e8-4b11-85f7-e636d48d72cb", @@ -388,7 +390,7 @@ describe("AccountsClient", () => { test("adjust", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "bc29a517-3dc9-450e-aa76-fae39ee849d1", adjust_points: { points: 10, reason: "Complimentary points" }, diff --git a/tests/wire/loyalty/programs.test.ts b/tests/wire/loyalty/programs.test.ts index 5d4c826c0..dbe16eb4d 100644 --- a/tests/wire/loyalty/programs.test.ts +++ b/tests/wire/loyalty/programs.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("ProgramsClient", () => { +describe("Programs", () => { test("list", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -112,7 +114,7 @@ describe("ProgramsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -216,7 +218,7 @@ describe("ProgramsClient", () => { test("calculate", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { order_id: "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY", loyalty_account_id: "79b807d2-d786-46a9-933b-918028d7a8c5", diff --git a/tests/wire/loyalty/programs/promotions.test.ts b/tests/wire/loyalty/programs/promotions.test.ts index b69dac25c..66a5a1ede 100644 --- a/tests/wire/loyalty/programs/promotions.test.ts +++ b/tests/wire/loyalty/programs/promotions.test.ts @@ -1,171 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../../src/Client"; import { mockServerPool } from "../../../mock-server/MockServerPool"; +import { SquareClient } from "../../../../src/Client"; -describe("PromotionsClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - loyalty_promotions: [ - { - id: "loypromo_f0f9b849-725e-378d-b810-511237e07b67", - name: "Tuesday Happy Hour Promo", - incentive: { - type: "POINTS_MULTIPLIER", - points_multiplier_data: { points_multiplier: 3, multiplier: "3.000" }, - }, - available_time: { - start_date: "2022-08-16", - time_periods: [ - "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT", - ], - }, - trigger_limit: { times: 1, interval: "DAY" }, - status: "ACTIVE", - created_at: "2022-08-16T08:38:54Z", - canceled_at: "canceled_at", - updated_at: "2022-08-16T08:38:54Z", - loyalty_program_id: "d619f755-2d17-41f3-990d-c04ecedd64dd", - qualifying_item_variation_ids: ["CJ3RYL56ITAKMD4VRCM7XERS", "AT3RYLR3TUA9C34VRCB7X5RR"], - qualifying_category_ids: ["qualifying_category_ids"], - }, - { - id: "loypromo_e696f057-2286-35ff-8108-132241328106", - name: "July Special", - incentive: { - type: "POINTS_MULTIPLIER", - points_multiplier_data: { points_multiplier: 2, multiplier: "2.000" }, - }, - available_time: { - start_date: "2022-07-01", - end_date: "2022-08-01", - time_periods: [ - "BEGIN:VEVENT\nDTSTART:20220704T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=MO\nEND:VEVENT", - "BEGIN:VEVENT\nDTSTART:20220705T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=TU\nEND:VEVENT", - "BEGIN:VEVENT\nDTSTART:20220706T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=WE\nEND:VEVENT", - "BEGIN:VEVENT\nDTSTART:20220707T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=TH\nEND:VEVENT", - "BEGIN:VEVENT\nDTSTART:20220701T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=FR\nEND:VEVENT", - ], - }, - trigger_limit: { times: 5, interval: "ALL_TIME" }, - status: "ENDED", - created_at: "2022-06-27T15:37:38Z", - canceled_at: "canceled_at", - updated_at: "2022-06-27T15:37:38Z", - loyalty_program_id: "d619f755-2d17-41f3-990d-c04ecedd64dd", - minimum_spend_amount_money: { amount: BigInt(2000), currency: "USD" }, - qualifying_item_variation_ids: ["qualifying_item_variation_ids"], - qualifying_category_ids: ["XTQPYLR3IIU9C44VRCB3XD12"], - }, - ], - cursor: "cursor", - }; - server - .mockEndpoint({ once: false }) - .get("/v2/loyalty/programs/program_id/promotions") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - loyaltyPromotions: [ - { - id: "loypromo_f0f9b849-725e-378d-b810-511237e07b67", - name: "Tuesday Happy Hour Promo", - incentive: { - type: "POINTS_MULTIPLIER", - pointsMultiplierData: { - pointsMultiplier: 3, - multiplier: "3.000", - }, - }, - availableTime: { - startDate: "2022-08-16", - timePeriods: [ - "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT", - ], - }, - triggerLimit: { - times: 1, - interval: "DAY", - }, - status: "ACTIVE", - createdAt: "2022-08-16T08:38:54Z", - canceledAt: "canceled_at", - updatedAt: "2022-08-16T08:38:54Z", - loyaltyProgramId: "d619f755-2d17-41f3-990d-c04ecedd64dd", - qualifyingItemVariationIds: ["CJ3RYL56ITAKMD4VRCM7XERS", "AT3RYLR3TUA9C34VRCB7X5RR"], - qualifyingCategoryIds: ["qualifying_category_ids"], - }, - { - id: "loypromo_e696f057-2286-35ff-8108-132241328106", - name: "July Special", - incentive: { - type: "POINTS_MULTIPLIER", - pointsMultiplierData: { - pointsMultiplier: 2, - multiplier: "2.000", - }, - }, - availableTime: { - startDate: "2022-07-01", - endDate: "2022-08-01", - timePeriods: [ - "BEGIN:VEVENT\nDTSTART:20220704T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=MO\nEND:VEVENT", - "BEGIN:VEVENT\nDTSTART:20220705T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=TU\nEND:VEVENT", - "BEGIN:VEVENT\nDTSTART:20220706T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=WE\nEND:VEVENT", - "BEGIN:VEVENT\nDTSTART:20220707T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=TH\nEND:VEVENT", - "BEGIN:VEVENT\nDTSTART:20220701T090000\nDURATION:PT8H\nRRULE:FREQ=WEEKLY;UNTIL=20220801T000000;BYDAY=FR\nEND:VEVENT", - ], - }, - triggerLimit: { - times: 5, - interval: "ALL_TIME", - }, - status: "ENDED", - createdAt: "2022-06-27T15:37:38Z", - canceledAt: "canceled_at", - updatedAt: "2022-06-27T15:37:38Z", - loyaltyProgramId: "d619f755-2d17-41f3-990d-c04ecedd64dd", - minimumSpendAmountMoney: { - amount: BigInt("2000"), - currency: "USD", - }, - qualifyingItemVariationIds: ["qualifying_item_variation_ids"], - qualifyingCategoryIds: ["XTQPYLR3IIU9C44VRCB3XD12"], - }, - ], - cursor: "cursor", - }; - const page = await client.loyalty.programs.promotions.list({ - programId: "program_id", - status: "ACTIVE", - cursor: "cursor", - limit: 1, - }); - - expect(expected.loyaltyPromotions).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.loyaltyPromotions).toEqual(nextPage.data); - }); - +describe("Promotions", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { loyalty_promotion: { name: "Tuesday Happy Hour Promo", @@ -295,7 +138,7 @@ describe("PromotionsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -387,7 +230,7 @@ describe("PromotionsClient", () => { test("cancel", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/loyalty/rewards.test.ts b/tests/wire/loyalty/rewards.test.ts index a3aad78b5..b67d8c73b 100644 --- a/tests/wire/loyalty/rewards.test.ts +++ b/tests/wire/loyalty/rewards.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("RewardsClient", () => { +describe("Rewards", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { reward: { loyalty_account_id: "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", @@ -71,7 +73,7 @@ describe("RewardsClient", () => { test("search", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { query: { loyalty_account_id: "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd" }, limit: 10 }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -199,7 +201,7 @@ describe("RewardsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -251,7 +253,7 @@ describe("RewardsClient", () => { test("delete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -281,7 +283,7 @@ describe("RewardsClient", () => { test("redeem", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "98adc7f7-6963-473b-b29c-f3c9cdd7d994", location_id: "P034NEENMD09F", diff --git a/tests/wire/merchants.test.ts b/tests/wire/merchants.test.ts index b73b6a118..e7926916c 100644 --- a/tests/wire/merchants.test.ts +++ b/tests/wire/merchants.test.ts @@ -1,73 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("MerchantsClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - merchant: [ - { - id: "DM7VKY8Q63GNP", - business_name: "Apple A Day", - country: "US", - language_code: "en-US", - currency: "USD", - status: "ACTIVE", - main_location_id: "9A65CGC72ZQG1", - created_at: "2021-12-10T19:25:52.484Z", - }, - ], - cursor: 1, - }; - server - .mockEndpoint({ once: false }) - .get("/v2/merchants") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - merchant: [ - { - id: "DM7VKY8Q63GNP", - businessName: "Apple A Day", - country: "US", - languageCode: "en-US", - currency: "USD", - status: "ACTIVE", - mainLocationId: "9A65CGC72ZQG1", - createdAt: "2021-12-10T19:25:52.484Z", - }, - ], - cursor: 1, - }; - const page = await client.merchants.list({ - cursor: 1, - }); - - expect(expected.merchant).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.merchant).toEqual(nextPage.data); - }); - +describe("Merchants", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/merchants/customAttributeDefinitions.test.ts b/tests/wire/merchants/customAttributeDefinitions.test.ts index 538d60d06..5123e9514 100644 --- a/tests/wire/merchants/customAttributeDefinitions.test.ts +++ b/tests/wire/merchants/customAttributeDefinitions.test.ts @@ -1,103 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("CustomAttributeDefinitionsClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - custom_attribute_definitions: [ - { - key: "has_seen_tutorial", - schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean", - }, - name: "NAME", - description: "Whether the merchant has seen the tutorial screen for using the app.", - visibility: "VISIBILITY_READ_WRITE_VALUES", - version: 1, - updated_at: "2023-05-05T16:50:21.832Z", - created_at: "2023-05-05T16:50:21.832Z", - }, - { - key: "alternative_seller_name", - schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String", - }, - name: "Alternative Merchant Name", - description: "This is the other name this merchant goes by.", - visibility: "VISIBILITY_READ_ONLY", - version: 4, - updated_at: "2023-05-05T10:17:52.341Z", - created_at: "2023-05-05T19:06:36.559Z", - }, - ], - cursor: "ImfNzWVSiAYyiAR4gEcxDJ75KZAOSjX8H2BVHUTR0ofCtp4SdYvrUKbwYY2aCH2WqZ2FsfAuylEVUlTfaINg3ecIlFpP9Y5Ie66w9NSg9nqdI5fCJ6qdH2s0za5m2plFonsjIuFaoN89j78ROUwuSOzD6mFZPcJHhJ0CxEKc0SBH", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/merchants/custom-attribute-definitions") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - customAttributeDefinitions: [ - { - key: "has_seen_tutorial", - schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Boolean", - }, - name: "NAME", - description: "Whether the merchant has seen the tutorial screen for using the app.", - visibility: "VISIBILITY_READ_WRITE_VALUES", - version: 1, - updatedAt: "2023-05-05T16:50:21.832Z", - createdAt: "2023-05-05T16:50:21.832Z", - }, - { - key: "alternative_seller_name", - schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String", - }, - name: "Alternative Merchant Name", - description: "This is the other name this merchant goes by.", - visibility: "VISIBILITY_READ_ONLY", - version: 4, - updatedAt: "2023-05-05T10:17:52.341Z", - createdAt: "2023-05-05T19:06:36.559Z", - }, - ], - cursor: "ImfNzWVSiAYyiAR4gEcxDJ75KZAOSjX8H2BVHUTR0ofCtp4SdYvrUKbwYY2aCH2WqZ2FsfAuylEVUlTfaINg3ecIlFpP9Y5Ie66w9NSg9nqdI5fCJ6qdH2s0za5m2plFonsjIuFaoN89j78ROUwuSOzD6mFZPcJHhJ0CxEKc0SBH", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }; - const page = await client.merchants.customAttributeDefinitions.list({ - visibilityFilter: "ALL", - limit: 1, - cursor: "cursor", - }); - - expect(expected.customAttributeDefinitions).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.customAttributeDefinitions).toEqual(nextPage.data); - }); - +describe("CustomAttributeDefinitions", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { custom_attribute_definition: { key: "alternative_seller_name", @@ -170,7 +81,7 @@ describe("CustomAttributeDefinitionsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { custom_attribute_definition: { @@ -225,7 +136,7 @@ describe("CustomAttributeDefinitionsClient", () => { test("update", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { custom_attribute_definition: { description: "Update the description as desired.", @@ -289,7 +200,7 @@ describe("CustomAttributeDefinitionsClient", () => { test("delete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/merchants/customAttributes.test.ts b/tests/wire/merchants/customAttributes.test.ts index b90cd452b..d95f40c4c 100644 --- a/tests/wire/merchants/customAttributes.test.ts +++ b/tests/wire/merchants/customAttributes.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("CustomAttributesClient", () => { +describe("CustomAttributes", () => { test("batchDelete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { values: { id1: { key: "alternative_seller_name" }, id2: { key: "has_seen_tutorial" } }, }; @@ -68,7 +70,7 @@ describe("CustomAttributesClient", () => { test("batchUpsert", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { values: { id1: { @@ -182,86 +184,9 @@ describe("CustomAttributesClient", () => { }); }); - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - custom_attributes: [ - { - key: "has_seen_tutorial", - value: true, - version: 1, - visibility: "VISIBILITY_READ_WRITE_VALUES", - updated_at: "2023-05-05T18:13:03.745Z", - created_at: "2023-05-05T18:13:03.745Z", - }, - { - key: "alternative_seller_name", - value: "Ultimate Sneaker Store", - version: 1, - visibility: "VISIBILITY_READ_ONLY", - updated_at: "2023-05-05T19:27:57.975Z", - created_at: "2023-05-05T19:27:57.975Z", - }, - ], - cursor: "cursor", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/merchants/merchant_id/custom-attributes") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - customAttributes: [ - { - key: "has_seen_tutorial", - value: true, - version: 1, - visibility: "VISIBILITY_READ_WRITE_VALUES", - updatedAt: "2023-05-05T18:13:03.745Z", - createdAt: "2023-05-05T18:13:03.745Z", - }, - { - key: "alternative_seller_name", - value: "Ultimate Sneaker Store", - version: 1, - visibility: "VISIBILITY_READ_ONLY", - updatedAt: "2023-05-05T19:27:57.975Z", - createdAt: "2023-05-05T19:27:57.975Z", - }, - ], - cursor: "cursor", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }; - const page = await client.merchants.customAttributes.list({ - merchantId: "merchant_id", - visibilityFilter: "ALL", - limit: 1, - cursor: "cursor", - withDefinitions: true, - }); - - expect(expected.customAttributes).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.customAttributes).toEqual(nextPage.data); - }); - test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { custom_attribute: { @@ -332,7 +257,7 @@ describe("CustomAttributesClient", () => { test("upsert", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { custom_attribute: { value: "Ultimate Sneaker Store" } }; const rawResponseBody = { custom_attribute: { @@ -405,7 +330,7 @@ describe("CustomAttributesClient", () => { test("delete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/mobile.test.ts b/tests/wire/mobile.test.ts index 85711e1cf..81f6b19d8 100644 --- a/tests/wire/mobile.test.ts +++ b/tests/wire/mobile.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("MobileClient", () => { +describe("Mobile", () => { test("authorizationCode", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { location_id: "YOUR_LOCATION_ID" }; const rawResponseBody = { authorization_code: "YOUR_MOBILE_AUTHORIZATION_CODE", diff --git a/tests/wire/oAuth.test.ts b/tests/wire/oAuth.test.ts index a515674c0..3f2c98074 100644 --- a/tests/wire/oAuth.test.ts +++ b/tests/wire/oAuth.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("OAuthClient", () => { +describe("OAuth", () => { test("revokeToken", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { client_id: "CLIENT_ID", access_token: "ACCESS_TOKEN" }; const rawResponseBody = { success: true, @@ -40,7 +42,7 @@ describe("OAuthClient", () => { test("obtainToken", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { client_id: "sq0idp-uaPHILoPzWZk3tlJqlML0g", client_secret: "sq0csp-30a-4C_tVOnTh14Piza2BfTPBXyLafLPWSzY1qAjeBfM", @@ -99,7 +101,7 @@ describe("OAuthClient", () => { test("RetrieveTokenStatus", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { scopes: ["PAYMENTS_READ", "PAYMENTS_WRITE"], @@ -135,7 +137,7 @@ describe("OAuthClient", () => { test("authorize", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); server.mockEndpoint().get("/oauth2/authorize").respondWith().statusCode(200).build(); diff --git a/tests/wire/orders.test.ts b/tests/wire/orders.test.ts index ccb7231a9..b1e897e29 100644 --- a/tests/wire/orders.test.ts +++ b/tests/wire/orders.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("OrdersClient", () => { +describe("Orders", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { order: { location_id: "057P5VYJ4A5X1", @@ -575,7 +577,7 @@ describe("OrdersClient", () => { test("batchGet", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { location_id: "057P5VYJ4A5X1", order_ids: ["CAISEM82RcpmcFBM0TfOyiHV3es", "CAISENgvlJ6jLWAzERDzjyHVybY"], @@ -722,7 +724,7 @@ describe("OrdersClient", () => { test("calculate", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { order: { location_id: "D7AVYMEAPJ3A3", @@ -1074,7 +1076,7 @@ describe("OrdersClient", () => { test("clone", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { order_id: "ZAISEM52YcpmcWAzERDOyiWS123", version: 3, @@ -1561,7 +1563,7 @@ describe("OrdersClient", () => { test("search", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { location_ids: ["057P5VYJ4A5X1", "18YC4JDH91E1H"], query: { @@ -1717,7 +1719,7 @@ describe("OrdersClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { order: { @@ -2032,7 +2034,7 @@ describe("OrdersClient", () => { test("update", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { order: { location_id: "location_id", @@ -2320,7 +2322,7 @@ describe("OrdersClient", () => { test("pay", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "c043a359-7ad9-4136-82a9-c3f1d66dcbff", payment_ids: ["EnZdNAlWCmfh6Mt5FMNST1o7taB", "0LRiVlbXVwe8ozu4KbZxd12mvaB"], diff --git a/tests/wire/orders/customAttributeDefinitions.test.ts b/tests/wire/orders/customAttributeDefinitions.test.ts index 4564532cd..0e45e7484 100644 --- a/tests/wire/orders/customAttributeDefinitions.test.ts +++ b/tests/wire/orders/customAttributeDefinitions.test.ts @@ -1,127 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("CustomAttributeDefinitionsClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - custom_attribute_definitions: [ - { - key: "cover-count", - schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number", - }, - name: "Cover count", - description: "The number of people seated at a table", - visibility: "VISIBILITY_READ_WRITE_VALUES", - version: 1, - updated_at: "2022-11-16T18:03:44.051Z", - created_at: "2022-11-16T18:03:44.051Z", - }, - { - key: "seat-number", - schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number", - }, - name: "Seat number", - description: "The identifier for a particular seat", - visibility: "VISIBILITY_READ_WRITE_VALUES", - version: 1, - updated_at: "2022-11-16T18:04:32.059Z", - created_at: "2022-11-16T18:04:32.059Z", - }, - { - key: "table-number", - schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number", - }, - name: "Table number", - description: "The identifier for a particular table", - visibility: "VISIBILITY_READ_WRITE_VALUES", - version: 1, - updated_at: "2022-11-16T18:04:21.912Z", - created_at: "2022-11-16T18:04:21.912Z", - }, - ], - cursor: "cursor", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/orders/custom-attribute-definitions") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - customAttributeDefinitions: [ - { - key: "cover-count", - schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number", - }, - name: "Cover count", - description: "The number of people seated at a table", - visibility: "VISIBILITY_READ_WRITE_VALUES", - version: 1, - updatedAt: "2022-11-16T18:03:44.051Z", - createdAt: "2022-11-16T18:03:44.051Z", - }, - { - key: "seat-number", - schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number", - }, - name: "Seat number", - description: "The identifier for a particular seat", - visibility: "VISIBILITY_READ_WRITE_VALUES", - version: 1, - updatedAt: "2022-11-16T18:04:32.059Z", - createdAt: "2022-11-16T18:04:32.059Z", - }, - { - key: "table-number", - schema: { - $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.Number", - }, - name: "Table number", - description: "The identifier for a particular table", - visibility: "VISIBILITY_READ_WRITE_VALUES", - version: 1, - updatedAt: "2022-11-16T18:04:21.912Z", - createdAt: "2022-11-16T18:04:21.912Z", - }, - ], - cursor: "cursor", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }; - const page = await client.orders.customAttributeDefinitions.list({ - visibilityFilter: "ALL", - cursor: "cursor", - limit: 1, - }); - - expect(expected.customAttributeDefinitions).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.customAttributeDefinitions).toEqual(nextPage.data); - }); - +describe("CustomAttributeDefinitions", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { custom_attribute_definition: { key: "cover-count", @@ -196,7 +83,7 @@ describe("CustomAttributeDefinitionsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { custom_attribute_definition: { @@ -251,7 +138,7 @@ describe("CustomAttributeDefinitionsClient", () => { test("update", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { custom_attribute_definition: { key: "cover-count", visibility: "VISIBILITY_READ_ONLY", version: 1 }, idempotency_key: "IDEMPOTENCY_KEY", @@ -315,7 +202,7 @@ describe("CustomAttributeDefinitionsClient", () => { test("delete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/orders/customAttributes.test.ts b/tests/wire/orders/customAttributes.test.ts index e62d62380..01c098e70 100644 --- a/tests/wire/orders/customAttributes.test.ts +++ b/tests/wire/orders/customAttributes.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("CustomAttributesClient", () => { +describe("CustomAttributes", () => { test("batchDelete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { values: { "cover-count": { key: "cover-count", order_id: "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" }, @@ -73,7 +75,7 @@ describe("CustomAttributesClient", () => { test("batchUpsert", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { values: { "cover-count": { @@ -184,70 +186,9 @@ describe("CustomAttributesClient", () => { }); }); - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - custom_attributes: [ - { - key: "wayne-test-15", - value: "TEST", - version: 1, - visibility: "VISIBILITY_READ_WRITE_VALUES", - updated_at: "2022-11-10T17:31:36.111Z", - created_at: "2022-11-10T17:31:36.111Z", - }, - ], - cursor: "cursor", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/orders/order_id/custom-attributes") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - customAttributes: [ - { - key: "wayne-test-15", - value: "TEST", - version: 1, - visibility: "VISIBILITY_READ_WRITE_VALUES", - updatedAt: "2022-11-10T17:31:36.111Z", - createdAt: "2022-11-10T17:31:36.111Z", - }, - ], - cursor: "cursor", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }; - const page = await client.orders.customAttributes.list({ - orderId: "order_id", - visibilityFilter: "ALL", - cursor: "cursor", - limit: 1, - withDefinitions: true, - }); - - expect(expected.customAttributes).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.customAttributes).toEqual(nextPage.data); - }); - test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { custom_attribute: { @@ -318,7 +259,7 @@ describe("CustomAttributesClient", () => { test("upsert", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { custom_attribute: { key: "table-number", value: "42", version: 1 } }; const rawResponseBody = { custom_attribute: { @@ -393,7 +334,7 @@ describe("CustomAttributesClient", () => { test("delete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/payments.test.ts b/tests/wire/payments.test.ts index 2b28dcc6c..093a49de0 100644 --- a/tests/wire/payments.test.ts +++ b/tests/wire/payments.test.ts @@ -1,212 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("PaymentsClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - payments: [ - { - id: "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", - created_at: "2021-10-13T19:34:33.524Z", - updated_at: "2021-10-13T19:34:37.261Z", - amount_money: { amount: BigInt(555), currency: "USD" }, - total_money: { amount: BigInt(555), currency: "USD" }, - approved_money: { amount: BigInt(555), currency: "USD" }, - processing_fee: [ - { - effective_at: "2021-10-13T21:34:35.000Z", - type: "INITIAL", - amount_money: { amount: BigInt(34), currency: "USD" }, - }, - ], - status: "COMPLETED", - delay_duration: "PT168H", - delay_action: "CANCEL", - delayed_until: "2021-10-20T19:34:33.524Z", - source_type: "CARD", - card_details: { - status: "CAPTURED", - card: { - card_brand: "VISA", - last_4: "1111", - exp_month: BigInt(11), - exp_year: BigInt(2022), - fingerprint: "sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ", - card_type: "DEBIT", - prepaid_type: "NOT_PREPAID", - bin: "411111", - }, - entry_method: "KEYED", - cvv_status: "CVV_ACCEPTED", - avs_status: "AVS_ACCEPTED", - auth_result_code: "2Nkw7q", - statement_description: "SQ *EXAMPLE TEST GOSQ.C", - card_payment_timeline: { - authorized_at: "2021-10-13T19:34:33.680Z", - captured_at: "2021-10-13T19:34:34.340Z", - }, - }, - cash_details: { buyer_supplied_money: {} }, - external_details: { type: "type", source: "source" }, - location_id: "L88917AVBK2S5", - order_id: "d7eKah653Z579f3gVtjlxpSlmUcZY", - reference_id: "reference_id", - customer_id: "customer_id", - employee_id: "TMoK_ogh6rH1o4dV", - team_member_id: "TMoK_ogh6rH1o4dV", - refund_ids: ["refund_ids"], - terminal_checkout_id: "terminal_checkout_id", - buyer_email_address: "buyer_email_address", - note: "Test Note", - statement_description_identifier: "statement_description_identifier", - capabilities: ["capabilities"], - receipt_number: "bP9m", - receipt_url: "https://squareup.com/receipt/preview/bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", - application_details: { - square_product: "VIRTUAL_TERMINAL", - application_id: "sq0ids-Pw67AZAlLVB7hsRmwlJPuA", - }, - is_offline_payment: true, - version_token: "vguW2km0KpVCdAXZcNTZ438qg5LlVPTP4HO5OpiHNfa6o", - }, - ], - cursor: "cursor", - }; - server - .mockEndpoint({ once: false }) - .get("/v2/payments") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - payments: [ - { - id: "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", - createdAt: "2021-10-13T19:34:33.524Z", - updatedAt: "2021-10-13T19:34:37.261Z", - amountMoney: { - amount: BigInt("555"), - currency: "USD", - }, - totalMoney: { - amount: BigInt("555"), - currency: "USD", - }, - approvedMoney: { - amount: BigInt("555"), - currency: "USD", - }, - processingFee: [ - { - effectiveAt: "2021-10-13T21:34:35.000Z", - type: "INITIAL", - amountMoney: { - amount: BigInt("34"), - currency: "USD", - }, - }, - ], - status: "COMPLETED", - delayDuration: "PT168H", - delayAction: "CANCEL", - delayedUntil: "2021-10-20T19:34:33.524Z", - sourceType: "CARD", - cardDetails: { - status: "CAPTURED", - card: { - cardBrand: "VISA", - last4: "1111", - expMonth: BigInt("11"), - expYear: BigInt("2022"), - fingerprint: "sq-1-Hxim77tbdcbGejOejnoAklBVJed2YFLTmirfl8Q5XZzObTc8qY_U8RkwzoNL8dCEcQ", - cardType: "DEBIT", - prepaidType: "NOT_PREPAID", - bin: "411111", - }, - entryMethod: "KEYED", - cvvStatus: "CVV_ACCEPTED", - avsStatus: "AVS_ACCEPTED", - authResultCode: "2Nkw7q", - statementDescription: "SQ *EXAMPLE TEST GOSQ.C", - cardPaymentTimeline: { - authorizedAt: "2021-10-13T19:34:33.680Z", - capturedAt: "2021-10-13T19:34:34.340Z", - }, - }, - cashDetails: { - buyerSuppliedMoney: {}, - }, - externalDetails: { - type: "type", - source: "source", - }, - locationId: "L88917AVBK2S5", - orderId: "d7eKah653Z579f3gVtjlxpSlmUcZY", - referenceId: "reference_id", - customerId: "customer_id", - employeeId: "TMoK_ogh6rH1o4dV", - teamMemberId: "TMoK_ogh6rH1o4dV", - refundIds: ["refund_ids"], - terminalCheckoutId: "terminal_checkout_id", - buyerEmailAddress: "buyer_email_address", - note: "Test Note", - statementDescriptionIdentifier: "statement_description_identifier", - capabilities: ["capabilities"], - receiptNumber: "bP9m", - receiptUrl: "https://squareup.com/receipt/preview/bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", - applicationDetails: { - squareProduct: "VIRTUAL_TERMINAL", - applicationId: "sq0ids-Pw67AZAlLVB7hsRmwlJPuA", - }, - isOfflinePayment: true, - versionToken: "vguW2km0KpVCdAXZcNTZ438qg5LlVPTP4HO5OpiHNfa6o", - }, - ], - cursor: "cursor", - }; - const page = await client.payments.list({ - beginTime: "begin_time", - endTime: "end_time", - sortOrder: "sort_order", - cursor: "cursor", - locationId: "location_id", - total: BigInt("1000000"), - last4: "last_4", - cardBrand: "card_brand", - limit: 1, - isOfflinePayment: true, - offlineBeginTime: "offline_begin_time", - offlineEndTime: "offline_end_time", - updatedAtBeginTime: "updated_at_begin_time", - updatedAtEndTime: "updated_at_end_time", - sortField: "CREATED_AT", - }); - - expect(expected.payments).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.payments).toEqual(nextPage.data); - }); - +describe("Payments", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { source_id: "ccof:GaJGNaZa8x4OgDJn4GB", idempotency_key: "7b0f3ec5-086a-4871-8f13-3c81b3875218", @@ -554,7 +356,7 @@ describe("PaymentsClient", () => { test("cancelByIdempotencyKey", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "a7e36d40-d24b-11e8-b568-0800200c9a66" }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -585,7 +387,7 @@ describe("PaymentsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -923,7 +725,7 @@ describe("PaymentsClient", () => { test("update", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { payment: { amount_money: { amount: BigInt(1000), currency: "USD" }, @@ -1262,7 +1064,7 @@ describe("PaymentsClient", () => { test("cancel", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -1585,7 +1387,7 @@ describe("PaymentsClient", () => { test("complete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/payouts.test.ts b/tests/wire/payouts.test.ts index 40fe8ebe0..56332359f 100644 --- a/tests/wire/payouts.test.ts +++ b/tests/wire/payouts.test.ts @@ -1,139 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("PayoutsClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - payouts: [ - { - id: "po_b345d2c7-90b3-4f0b-a2aa-df1def7f8afc", - status: "PAID", - location_id: "L88917AVBK2S5", - created_at: "2022-03-29T16:12:31Z", - updated_at: "2022-03-30T01:07:22.875Z", - amount_money: { amount: BigInt(6259) }, - destination: { type: "CARD", id: "ccof:ZPp3oedR3AeEUNd3z7" }, - version: 2, - type: "BATCH", - payout_fee: [ - { - amount_money: { amount: BigInt(95) }, - effective_at: "2022-03-29T16:12:31Z", - type: "TRANSFER_FEE", - }, - ], - arrival_date: "2022-03-29", - end_to_end_id: "L2100000005", - }, - { - id: "po_f3c0fb38-a5ce-427d-b858-52b925b72e45", - status: "PAID", - location_id: "L88917AVBK2S5", - created_at: "2022-03-24T03:07:09Z", - updated_at: "2022-03-24T03:07:09Z", - amount_money: { amount: BigInt(-103) }, - destination: { type: "BANK_ACCOUNT", id: "bact:ZPp3oedR3AeEUNd3z7" }, - version: 1, - type: "BATCH", - payout_fee: [{}], - arrival_date: "2022-03-24", - end_to_end_id: "L2100000006", - }, - ], - cursor: "EMPCyStibo64hS8wLayZPp3oedR3AeEUNd3z7u6zphi72LQZFIEMbkKVvot9eefpU", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/payouts") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - payouts: [ - { - id: "po_b345d2c7-90b3-4f0b-a2aa-df1def7f8afc", - status: "PAID", - locationId: "L88917AVBK2S5", - createdAt: "2022-03-29T16:12:31Z", - updatedAt: "2022-03-30T01:07:22.875Z", - amountMoney: { - amount: BigInt("6259"), - }, - destination: { - type: "CARD", - id: "ccof:ZPp3oedR3AeEUNd3z7", - }, - version: 2, - type: "BATCH", - payoutFee: [ - { - amountMoney: { - amount: BigInt("95"), - }, - effectiveAt: "2022-03-29T16:12:31Z", - type: "TRANSFER_FEE", - }, - ], - arrivalDate: "2022-03-29", - endToEndId: "L2100000005", - }, - { - id: "po_f3c0fb38-a5ce-427d-b858-52b925b72e45", - status: "PAID", - locationId: "L88917AVBK2S5", - createdAt: "2022-03-24T03:07:09Z", - updatedAt: "2022-03-24T03:07:09Z", - amountMoney: { - amount: BigInt("-103"), - }, - destination: { - type: "BANK_ACCOUNT", - id: "bact:ZPp3oedR3AeEUNd3z7", - }, - version: 1, - type: "BATCH", - payoutFee: [{}], - arrivalDate: "2022-03-24", - endToEndId: "L2100000006", - }, - ], - cursor: "EMPCyStibo64hS8wLayZPp3oedR3AeEUNd3z7u6zphi72LQZFIEMbkKVvot9eefpU", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }; - const page = await client.payouts.list({ - locationId: "location_id", - status: "SENT", - beginTime: "begin_time", - endTime: "end_time", - sortOrder: "DESC", - cursor: "cursor", - limit: 1, - }); - - expect(expected.payouts).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.payouts).toEqual(nextPage.data); - }); - +describe("Payouts", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { payout: { @@ -194,108 +69,4 @@ describe("PayoutsClient", () => { ], }); }); - - test("ListEntries", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - payout_entries: [ - { - id: "poe_ZQWcw41d0SGJS6IWd4cSi8mKHk", - payout_id: "po_4d28e6c4-7dd5-4de4-8ec9-a059277646a6", - effective_at: "2021-12-14T23:31:49Z", - type: "REFUND", - gross_amount_money: { amount: BigInt(-50) }, - fee_amount_money: { amount: BigInt(-2) }, - net_amount_money: { amount: BigInt(-48) }, - type_refund_details: { - payment_id: "HVdG62HeMlti8YYf94oxrN", - refund_id: "HVdG62HeMlti8YYf94oxrN_dR8Nztxg7umf94oxrN12Ji5r2KW14FAY", - }, - }, - { - id: "poe_EibbY9Ob1d0SGJS6IWd4cSiSi6wkaPk", - payout_id: "po_4d28e6c4-7dd5-4de4-8ec9-a059277646a6", - effective_at: "2021-12-14T23:31:49Z", - type: "CHARGE", - gross_amount_money: { amount: BigInt(100) }, - fee_amount_money: { amount: BigInt(19) }, - net_amount_money: { amount: BigInt(81) }, - type_charge_details: { payment_id: "HVdG62H5K3291d0SGJS6IWd4cSi8YY" }, - }, - ], - cursor: "TbfI80z98Xc2LdApCyZ2NvCYLpkPurYLR16GRIttpMJ55mrSIMzHgtkcRQdT0mOnTtfHO", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint({ once: false }) - .get("/v2/payouts/payout_id/payout-entries") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - payoutEntries: [ - { - id: "poe_ZQWcw41d0SGJS6IWd4cSi8mKHk", - payoutId: "po_4d28e6c4-7dd5-4de4-8ec9-a059277646a6", - effectiveAt: "2021-12-14T23:31:49Z", - type: "REFUND", - grossAmountMoney: { - amount: BigInt("-50"), - }, - feeAmountMoney: { - amount: BigInt("-2"), - }, - netAmountMoney: { - amount: BigInt("-48"), - }, - typeRefundDetails: { - paymentId: "HVdG62HeMlti8YYf94oxrN", - refundId: "HVdG62HeMlti8YYf94oxrN_dR8Nztxg7umf94oxrN12Ji5r2KW14FAY", - }, - }, - { - id: "poe_EibbY9Ob1d0SGJS6IWd4cSiSi6wkaPk", - payoutId: "po_4d28e6c4-7dd5-4de4-8ec9-a059277646a6", - effectiveAt: "2021-12-14T23:31:49Z", - type: "CHARGE", - grossAmountMoney: { - amount: BigInt("100"), - }, - feeAmountMoney: { - amount: BigInt("19"), - }, - netAmountMoney: { - amount: BigInt("81"), - }, - typeChargeDetails: { - paymentId: "HVdG62H5K3291d0SGJS6IWd4cSi8YY", - }, - }, - ], - cursor: "TbfI80z98Xc2LdApCyZ2NvCYLpkPurYLR16GRIttpMJ55mrSIMzHgtkcRQdT0mOnTtfHO", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }; - const page = await client.payouts.listEntries({ - payoutId: "payout_id", - sortOrder: "DESC", - cursor: "cursor", - limit: 1, - }); - - expect(expected.payoutEntries).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.payoutEntries).toEqual(nextPage.data); - }); }); diff --git a/tests/wire/refunds.test.ts b/tests/wire/refunds.test.ts index fb7aa7f87..74800ac51 100644 --- a/tests/wire/refunds.test.ts +++ b/tests/wire/refunds.test.ts @@ -1,113 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("RefundsClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - refunds: [ - { - id: "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY_69MmgHubkLqx9wGhnmenRUHOaKitE6llfZuxcWYjGxd", - status: "COMPLETED", - location_id: "L88917AVBK2S5", - unlinked: true, - destination_type: "destination_type", - amount_money: { amount: BigInt(555), currency: "USD" }, - processing_fee: [ - { - effective_at: "2021-10-13T21:34:35.000Z", - type: "INITIAL", - amount_money: { amount: BigInt(-34), currency: "USD" }, - }, - ], - payment_id: "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", - order_id: "9ltv0bx5PuvGXUYHYHxYSKEqC3IZY", - reason: "Example Refund", - created_at: "2021-10-13T19:59:05.342Z", - updated_at: "2021-10-13T20:00:03.497Z", - team_member_id: "team_member_id", - terminal_refund_id: "terminal_refund_id", - }, - ], - cursor: "5evquW1YswHoT4EoyUhzMmTsCnsSXBU9U0WJ4FU4623nrMQcocH0RGU6Up1YkwfiMcF59ood58EBTEGgzMTGHQJpocic7ExOL0NtrTXCeWcv0UJIJNk8eXb", - }; - server - .mockEndpoint({ once: false }) - .get("/v2/refunds") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - refunds: [ - { - id: "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY_69MmgHubkLqx9wGhnmenRUHOaKitE6llfZuxcWYjGxd", - status: "COMPLETED", - locationId: "L88917AVBK2S5", - unlinked: true, - destinationType: "destination_type", - amountMoney: { - amount: BigInt("555"), - currency: "USD", - }, - processingFee: [ - { - effectiveAt: "2021-10-13T21:34:35.000Z", - type: "INITIAL", - amountMoney: { - amount: BigInt("-34"), - currency: "USD", - }, - }, - ], - paymentId: "bP9mAsEMYPUGjjGNaNO5ZDVyLhSZY", - orderId: "9ltv0bx5PuvGXUYHYHxYSKEqC3IZY", - reason: "Example Refund", - createdAt: "2021-10-13T19:59:05.342Z", - updatedAt: "2021-10-13T20:00:03.497Z", - teamMemberId: "team_member_id", - terminalRefundId: "terminal_refund_id", - }, - ], - cursor: "5evquW1YswHoT4EoyUhzMmTsCnsSXBU9U0WJ4FU4623nrMQcocH0RGU6Up1YkwfiMcF59ood58EBTEGgzMTGHQJpocic7ExOL0NtrTXCeWcv0UJIJNk8eXb", - }; - const page = await client.refunds.list({ - beginTime: "begin_time", - endTime: "end_time", - sortOrder: "sort_order", - cursor: "cursor", - locationId: "location_id", - status: "status", - sourceType: "source_type", - limit: 1, - updatedAtBeginTime: "updated_at_begin_time", - updatedAtEndTime: "updated_at_end_time", - sortField: "CREATED_AT", - }); - - expect(expected.refunds).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.refunds).toEqual(nextPage.data); - }); - +describe("Refunds", () => { test("RefundPayment", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "9b7f2dcf-49da-4411-b23e-a2d6af21333a", amount_money: { amount: BigInt(1000), currency: "USD" }, @@ -207,7 +108,7 @@ describe("RefundsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/sites.test.ts b/tests/wire/sites.test.ts index 17dd33d54..0a668f8a9 100644 --- a/tests/wire/sites.test.ts +++ b/tests/wire/sites.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("SitesClient", () => { +describe("Sites", () => { test("list", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/snippets.test.ts b/tests/wire/snippets.test.ts index 4f5e9dd40..d901571c6 100644 --- a/tests/wire/snippets.test.ts +++ b/tests/wire/snippets.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("SnippetsClient", () => { +describe("Snippets", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -50,7 +52,7 @@ describe("SnippetsClient", () => { test("upsert", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { snippet: { content: "" } }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -98,7 +100,7 @@ describe("SnippetsClient", () => { test("delete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/subscriptions.test.ts b/tests/wire/subscriptions.test.ts index a2d4ee64a..0b84fc274 100644 --- a/tests/wire/subscriptions.test.ts +++ b/tests/wire/subscriptions.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("SubscriptionsClient", () => { +describe("Subscriptions", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "8193148c-9586-11e6-99f9-28cfe92138cf", location_id: "S8GWD5R9QB376", @@ -47,7 +49,6 @@ describe("SubscriptionsClient", () => { plan_phase_uid: "X2Q2AONPB3RB64Y27S25QCZP", }, ], - completed_date: "completed_date", }, }; server @@ -118,14 +119,13 @@ describe("SubscriptionsClient", () => { planPhaseUid: "X2Q2AONPB3RB64Y27S25QCZP", }, ], - completedDate: "completed_date", }, }); }); test("BulkSwapPlan", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { new_plan_variation_id: "FQ7CDXXWSLUJRPM3GFJSJGZ7", old_plan_variation_id: "6JHXF3B2CW3YKHDV4XEM674H", @@ -164,7 +164,7 @@ describe("SubscriptionsClient", () => { test("search", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { query: { filter: { @@ -196,7 +196,6 @@ describe("SubscriptionsClient", () => { actions: [{}], monthly_billing_anchor_date: 1, phases: [{}], - completed_date: "completed_date", }, { id: "56214fb2-cc85-47a1-93bc-44f3766bb56f", @@ -218,7 +217,6 @@ describe("SubscriptionsClient", () => { actions: [{}], monthly_billing_anchor_date: 1, phases: [{}], - completed_date: "completed_date", }, { id: "56214fb2-cc85-47a1-93bc-44f3766bb56f", @@ -246,7 +244,6 @@ describe("SubscriptionsClient", () => { plan_phase_uid: "X2Q2AONPB3RB64Y27S25QCZP", }, ], - completed_date: "completed_date", }, ], cursor: "cursor", @@ -300,7 +297,6 @@ describe("SubscriptionsClient", () => { actions: [{}], monthlyBillingAnchorDate: 1, phases: [{}], - completedDate: "completed_date", }, { id: "56214fb2-cc85-47a1-93bc-44f3766bb56f", @@ -327,7 +323,6 @@ describe("SubscriptionsClient", () => { actions: [{}], monthlyBillingAnchorDate: 1, phases: [{}], - completedDate: "completed_date", }, { id: "56214fb2-cc85-47a1-93bc-44f3766bb56f", @@ -357,7 +352,6 @@ describe("SubscriptionsClient", () => { planPhaseUid: "X2Q2AONPB3RB64Y27S25QCZP", }, ], - completedDate: "completed_date", }, ], cursor: "cursor", @@ -366,7 +360,7 @@ describe("SubscriptionsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -390,7 +384,6 @@ describe("SubscriptionsClient", () => { actions: [{}], monthly_billing_anchor_date: 1, phases: [{}], - completed_date: "completed_date", }, }; server @@ -439,14 +432,13 @@ describe("SubscriptionsClient", () => { actions: [{}], monthlyBillingAnchorDate: 1, phases: [{}], - completedDate: "completed_date", }, }); }); test("update", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { subscription: { card_id: "{NEW CARD ID}" } }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -470,7 +462,6 @@ describe("SubscriptionsClient", () => { actions: [{}], monthly_billing_anchor_date: 1, phases: [{}], - completed_date: "completed_date", }, }; server @@ -522,14 +513,13 @@ describe("SubscriptionsClient", () => { actions: [{}], monthlyBillingAnchorDate: 1, phases: [{}], - completedDate: "completed_date", }, }); }); test("DeleteAction", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -553,7 +543,6 @@ describe("SubscriptionsClient", () => { actions: [{}], monthly_billing_anchor_date: 1, phases: [{}], - completed_date: "completed_date", }, }; server @@ -602,14 +591,13 @@ describe("SubscriptionsClient", () => { actions: [{}], monthlyBillingAnchorDate: 1, phases: [{}], - completedDate: "completed_date", }, }); }); test("ChangeBillingAnchorDate", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { monthly_billing_anchor_date: 1 }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -640,7 +628,6 @@ describe("SubscriptionsClient", () => { plan_phase_uid: "C66BKH3ASTDYGJJCEZXQQSS7", }, ], - completed_date: "completed_date", }, actions: [ { @@ -707,7 +694,6 @@ describe("SubscriptionsClient", () => { planPhaseUid: "C66BKH3ASTDYGJJCEZXQQSS7", }, ], - completedDate: "completed_date", }, actions: [ { @@ -724,7 +710,7 @@ describe("SubscriptionsClient", () => { test("cancel", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -748,7 +734,6 @@ describe("SubscriptionsClient", () => { actions: [{}], monthly_billing_anchor_date: 1, phases: [{}], - completed_date: "completed_date", }, actions: [ { @@ -806,7 +791,6 @@ describe("SubscriptionsClient", () => { actions: [{}], monthlyBillingAnchorDate: 1, phases: [{}], - completedDate: "completed_date", }, actions: [ { @@ -821,172 +805,9 @@ describe("SubscriptionsClient", () => { }); }); - test("listEvents", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - subscription_events: [ - { - id: "06809161-3867-4598-8269-8aea5be4f9de", - subscription_event_type: "START_SUBSCRIPTION", - effective_date: "2020-04-24", - monthly_billing_anchor_date: 1, - phases: [{}], - plan_variation_id: "6JHXF3B2CW3YKHDV4XEM674H", - }, - { - id: "f2736603-cd2e-47ec-8675-f815fff54f88", - subscription_event_type: "DEACTIVATE_SUBSCRIPTION", - effective_date: "2020-05-01", - monthly_billing_anchor_date: 1, - info: { - detail: "The customer with ID `V74BMG0GPS2KNCWJE1BTYJ37Y0` does not have a name on record.", - code: "CUSTOMER_NO_NAME", - }, - phases: [{}], - plan_variation_id: "6JHXF3B2CW3YKHDV4XEM674H", - }, - { - id: "b426fc85-6859-450b-b0d0-fe3a5d1b565f", - subscription_event_type: "RESUME_SUBSCRIPTION", - effective_date: "2022-05-01", - monthly_billing_anchor_date: 1, - phases: [{}], - plan_variation_id: "6JHXF3B2CW3YKHDV4XEM674H", - }, - { - id: "09f14de1-2f53-4dae-9091-49aa53f83d01", - subscription_event_type: "PAUSE_SUBSCRIPTION", - effective_date: "2022-09-01", - monthly_billing_anchor_date: 1, - phases: [{}], - plan_variation_id: "6JHXF3B2CW3YKHDV4XEM674H", - }, - { - id: "f28a73ac-1a1b-4b0f-8eeb-709a72945776", - subscription_event_type: "RESUME_SUBSCRIPTION", - effective_date: "2022-12-01", - monthly_billing_anchor_date: 1, - phases: [{}], - plan_variation_id: "6JHXF3B2CW3YKHDV4XEM674H", - }, - { - id: "1eee8790-472d-4efe-8c69-8ad84e9cefe0", - subscription_event_type: "PLAN_CHANGE", - effective_date: "2023-04-01", - monthly_billing_anchor_date: 1, - phases: [{}], - plan_variation_id: "02CD53CFA4d1498AFAD42", - }, - { - id: "a0c08083-5db0-4800-85c7-d398de4fbb6e", - subscription_event_type: "STOP_SUBSCRIPTION", - effective_date: "2023-06-21", - monthly_billing_anchor_date: 1, - phases: [{}], - plan_variation_id: "6JHXF3B2CW3YKHDV4XEM674H", - }, - ], - cursor: "cursor", - }; - server - .mockEndpoint({ once: false }) - .get("/v2/subscriptions/subscription_id/events") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - subscriptionEvents: [ - { - id: "06809161-3867-4598-8269-8aea5be4f9de", - subscriptionEventType: "START_SUBSCRIPTION", - effectiveDate: "2020-04-24", - monthlyBillingAnchorDate: 1, - phases: [{}], - planVariationId: "6JHXF3B2CW3YKHDV4XEM674H", - }, - { - id: "f2736603-cd2e-47ec-8675-f815fff54f88", - subscriptionEventType: "DEACTIVATE_SUBSCRIPTION", - effectiveDate: "2020-05-01", - monthlyBillingAnchorDate: 1, - info: { - detail: "The customer with ID `V74BMG0GPS2KNCWJE1BTYJ37Y0` does not have a name on record.", - code: "CUSTOMER_NO_NAME", - }, - phases: [{}], - planVariationId: "6JHXF3B2CW3YKHDV4XEM674H", - }, - { - id: "b426fc85-6859-450b-b0d0-fe3a5d1b565f", - subscriptionEventType: "RESUME_SUBSCRIPTION", - effectiveDate: "2022-05-01", - monthlyBillingAnchorDate: 1, - phases: [{}], - planVariationId: "6JHXF3B2CW3YKHDV4XEM674H", - }, - { - id: "09f14de1-2f53-4dae-9091-49aa53f83d01", - subscriptionEventType: "PAUSE_SUBSCRIPTION", - effectiveDate: "2022-09-01", - monthlyBillingAnchorDate: 1, - phases: [{}], - planVariationId: "6JHXF3B2CW3YKHDV4XEM674H", - }, - { - id: "f28a73ac-1a1b-4b0f-8eeb-709a72945776", - subscriptionEventType: "RESUME_SUBSCRIPTION", - effectiveDate: "2022-12-01", - monthlyBillingAnchorDate: 1, - phases: [{}], - planVariationId: "6JHXF3B2CW3YKHDV4XEM674H", - }, - { - id: "1eee8790-472d-4efe-8c69-8ad84e9cefe0", - subscriptionEventType: "PLAN_CHANGE", - effectiveDate: "2023-04-01", - monthlyBillingAnchorDate: 1, - phases: [{}], - planVariationId: "02CD53CFA4d1498AFAD42", - }, - { - id: "a0c08083-5db0-4800-85c7-d398de4fbb6e", - subscriptionEventType: "STOP_SUBSCRIPTION", - effectiveDate: "2023-06-21", - monthlyBillingAnchorDate: 1, - phases: [{}], - planVariationId: "6JHXF3B2CW3YKHDV4XEM674H", - }, - ], - cursor: "cursor", - }; - const page = await client.subscriptions.listEvents({ - subscriptionId: "subscription_id", - cursor: "cursor", - limit: 1, - }); - - expect(expected.subscriptionEvents).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.subscriptionEvents).toEqual(nextPage.data); - }); - test("pause", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -1017,7 +838,6 @@ describe("SubscriptionsClient", () => { plan_phase_uid: "X2Q2AONPB3RB64Y27S25QCZP", }, ], - completed_date: "completed_date", }, actions: [ { @@ -1083,7 +903,6 @@ describe("SubscriptionsClient", () => { planPhaseUid: "X2Q2AONPB3RB64Y27S25QCZP", }, ], - completedDate: "completed_date", }, actions: [ { @@ -1100,7 +919,7 @@ describe("SubscriptionsClient", () => { test("resume", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -1131,7 +950,6 @@ describe("SubscriptionsClient", () => { plan_phase_uid: "X2Q2AONPB3RB64Y27S25QCZP", }, ], - completed_date: "completed_date", }, actions: [ { @@ -1197,7 +1015,6 @@ describe("SubscriptionsClient", () => { planPhaseUid: "X2Q2AONPB3RB64Y27S25QCZP", }, ], - completedDate: "completed_date", }, actions: [ { @@ -1214,7 +1031,7 @@ describe("SubscriptionsClient", () => { test("SwapPlan", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { new_plan_variation_id: "FQ7CDXXWSLUJRPM3GFJSJGZ7", phases: [{ ordinal: BigInt(0), order_template_id: "uhhnjH9osVv3shUADwaC0b3hNxQZY" }], @@ -1248,7 +1065,6 @@ describe("SubscriptionsClient", () => { plan_phase_uid: "C66BKH3ASTDYGJJCEZXQQSS7", }, ], - completed_date: "completed_date", }, actions: [ { @@ -1321,7 +1137,6 @@ describe("SubscriptionsClient", () => { planPhaseUid: "C66BKH3ASTDYGJJCEZXQQSS7", }, ], - completedDate: "completed_date", }, actions: [ { diff --git a/tests/wire/team.test.ts b/tests/wire/team.test.ts index b5e8959b4..284fee613 100644 --- a/tests/wire/team.test.ts +++ b/tests/wire/team.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("TeamClient", () => { +describe("Team", () => { test("ListJobs", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { jobs: [ @@ -74,7 +76,7 @@ describe("TeamClient", () => { test("CreateJob", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { job: { title: "Cashier", is_tip_eligible: true }, idempotency_key: "idempotency-key-0", @@ -128,7 +130,7 @@ describe("TeamClient", () => { test("RetrieveJob", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { job: { @@ -174,7 +176,7 @@ describe("TeamClient", () => { test("UpdateJob", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { job: { title: "Cashier 1", is_tip_eligible: true } }; const rawResponseBody = { job: { diff --git a/tests/wire/teamMembers.test.ts b/tests/wire/teamMembers.test.ts index ab00d9046..8133f3ebb 100644 --- a/tests/wire/teamMembers.test.ts +++ b/tests/wire/teamMembers.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("TeamMembersClient", () => { +describe("TeamMembers", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "idempotency-key-0", team_member: { @@ -188,7 +190,7 @@ describe("TeamMembersClient", () => { test("batchCreate", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { team_members: { "idempotency-key-1": { @@ -349,7 +351,7 @@ describe("TeamMembersClient", () => { test("batchUpdate", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { team_members: { "AFMwA08kR-MIF-3Vs0OE": { @@ -526,7 +528,7 @@ describe("TeamMembersClient", () => { test("search", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { query: { filter: { location_ids: ["0G5P3VGACMMQZ"], status: "ACTIVE" } }, limit: 10 }; const rawResponseBody = { team_members: [ @@ -1036,7 +1038,7 @@ describe("TeamMembersClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { team_member: { @@ -1153,7 +1155,7 @@ describe("TeamMembersClient", () => { test("update", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { team_member: { reference_id: "reference_id_1", diff --git a/tests/wire/teamMembers/wageSetting.test.ts b/tests/wire/teamMembers/wageSetting.test.ts index 6ef7b1a35..84d31a474 100644 --- a/tests/wire/teamMembers/wageSetting.test.ts +++ b/tests/wire/teamMembers/wageSetting.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("WageSettingClient", () => { +describe("WageSetting", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { wage_setting: { @@ -74,7 +76,7 @@ describe("WageSettingClient", () => { test("update", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { wage_setting: { job_assignments: [ diff --git a/tests/wire/terminal.test.ts b/tests/wire/terminal.test.ts index d4351969d..1b051a6c9 100644 --- a/tests/wire/terminal.test.ts +++ b/tests/wire/terminal.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("TerminalClient", () => { +describe("Terminal", () => { test("DismissTerminalAction", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -158,7 +160,7 @@ describe("TerminalClient", () => { test("DismissTerminalCheckout", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -269,7 +271,7 @@ describe("TerminalClient", () => { test("DismissTerminalRefund", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/terminal/actions.test.ts b/tests/wire/terminal/actions.test.ts index 86aeedc30..13989967a 100644 --- a/tests/wire/terminal/actions.test.ts +++ b/tests/wire/terminal/actions.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("ActionsClient", () => { +describe("Actions", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "thahn-70e75c10-47f7-4ab6-88cc-aaa4076d065e", action: { @@ -172,7 +174,7 @@ describe("ActionsClient", () => { test("search", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { query: { filter: { created_at: { start_at: "2022-04-01T00:00:00.000Z" } }, sort: { sort_order: "DESC" } }, limit: 2, @@ -377,7 +379,7 @@ describe("ActionsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -525,7 +527,7 @@ describe("ActionsClient", () => { test("cancel", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/terminal/checkouts.test.ts b/tests/wire/terminal/checkouts.test.ts index 818c7de3c..39ba81c5b 100644 --- a/tests/wire/terminal/checkouts.test.ts +++ b/tests/wire/terminal/checkouts.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("CheckoutsClient", () => { +describe("Checkouts", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "28a0c3bc-7839-11ea-bc55-0242ac130003", checkout: { @@ -135,7 +137,7 @@ describe("CheckoutsClient", () => { test("search", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { query: { filter: { status: "COMPLETED" } }, limit: 2 }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -283,7 +285,7 @@ describe("CheckoutsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -392,7 +394,7 @@ describe("CheckoutsClient", () => { test("cancel", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/terminal/refunds.test.ts b/tests/wire/terminal/refunds.test.ts index 15e8556b6..c21c4f0fe 100644 --- a/tests/wire/terminal/refunds.test.ts +++ b/tests/wire/terminal/refunds.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("RefundsClient", () => { +describe("Refunds", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "402a640b-b26f-401f-b406-46f839590c04", refund: { @@ -89,7 +91,7 @@ describe("RefundsClient", () => { test("search", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { query: { filter: { status: "COMPLETED" } }, limit: 1 }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -166,7 +168,7 @@ describe("RefundsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -231,7 +233,7 @@ describe("RefundsClient", () => { test("cancel", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/transferOrders.test.ts b/tests/wire/transferOrders.test.ts deleted file mode 100644 index 5967ad587..000000000 --- a/tests/wire/transferOrders.test.ts +++ /dev/null @@ -1,907 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import { SquareClient } from "../../src/Client"; -import { mockServerPool } from "../mock-server/MockServerPool"; - -describe("TransferOrdersClient", () => { - test("create", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - const rawRequestBody = { - idempotency_key: "65cc0586-3e82-384s-b524-3885cffd52", - transfer_order: { - source_location_id: "EXAMPLE_SOURCE_LOCATION_ID_123", - destination_location_id: "EXAMPLE_DEST_LOCATION_ID_456", - expected_at: "2025-11-09T05:00:00Z", - notes: "Example transfer order for inventory redistribution between locations", - tracking_number: "TRACK123456789", - created_by_team_member_id: "EXAMPLE_TEAM_MEMBER_ID_789", - line_items: [ - { item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_001", quantity_ordered: "5" }, - { item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_002", quantity_ordered: "3" }, - ], - }, - }; - const rawResponseBody = { - transfer_order: { - id: "EXAMPLE_TRANSFER_ORDER_ID_123", - source_location_id: "EXAMPLE_SOURCE_LOCATION_ID_123", - destination_location_id: "EXAMPLE_DEST_LOCATION_ID_456", - status: "DRAFT", - created_at: "2025-01-15T10:30:00Z", - updated_at: "2025-01-15T10:30:00Z", - expected_at: "2025-11-09T05:00:00Z", - completed_at: "completed_at", - notes: "Example transfer order for inventory redistribution between locations", - tracking_number: "TRACK123456789", - created_by_team_member_id: "EXAMPLE_TEAM_MEMBER_ID_789", - line_items: [ - { - uid: "1", - item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_001", - quantity_ordered: "5", - quantity_pending: "5", - quantity_received: "0", - quantity_damaged: "0", - quantity_canceled: "0", - }, - { - uid: "2", - item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_002", - quantity_ordered: "3", - quantity_pending: "3", - quantity_received: "0", - quantity_damaged: "0", - quantity_canceled: "0", - }, - ], - version: BigInt(1753109537351), - }, - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint() - .post("/v2/transfer-orders") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.transferOrders.create({ - idempotencyKey: "65cc0586-3e82-384s-b524-3885cffd52", - transferOrder: { - sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_123", - destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_456", - expectedAt: "2025-11-09T05:00:00Z", - notes: "Example transfer order for inventory redistribution between locations", - trackingNumber: "TRACK123456789", - createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", - lineItems: [ - { - itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", - quantityOrdered: "5", - }, - { - itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_002", - quantityOrdered: "3", - }, - ], - }, - }); - expect(response).toEqual({ - transferOrder: { - id: "EXAMPLE_TRANSFER_ORDER_ID_123", - sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_123", - destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_456", - status: "DRAFT", - createdAt: "2025-01-15T10:30:00Z", - updatedAt: "2025-01-15T10:30:00Z", - expectedAt: "2025-11-09T05:00:00Z", - completedAt: "completed_at", - notes: "Example transfer order for inventory redistribution between locations", - trackingNumber: "TRACK123456789", - createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", - lineItems: [ - { - uid: "1", - itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", - quantityOrdered: "5", - quantityPending: "5", - quantityReceived: "0", - quantityDamaged: "0", - quantityCanceled: "0", - }, - { - uid: "2", - itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_002", - quantityOrdered: "3", - quantityPending: "3", - quantityReceived: "0", - quantityDamaged: "0", - quantityCanceled: "0", - }, - ], - version: BigInt("1753109537351"), - }, - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }); - }); - - test("search", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - const rawRequestBody = { - query: { - filter: { - source_location_ids: ["EXAMPLE_SOURCE_LOCATION_ID_123"], - destination_location_ids: ["EXAMPLE_DEST_LOCATION_ID_456"], - statuses: ["STARTED", "PARTIALLY_RECEIVED"], - }, - sort: { field: "UPDATED_AT", order: "DESC" }, - }, - cursor: "eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTg2NjQ4NzN9", - limit: 10, - }; - const rawResponseBody = { - transfer_orders: [ - { - id: "EXAMPLE_TRANSFER_ORDER_ID_123", - source_location_id: "EXAMPLE_SOURCE_LOCATION_ID_123", - destination_location_id: "EXAMPLE_DEST_LOCATION_ID_456", - status: "STARTED", - created_at: "2025-01-15T10:30:00Z", - updated_at: "2025-01-15T10:32:00Z", - expected_at: "2025-11-09T05:00:00Z", - completed_at: "completed_at", - notes: "Inventory rebalance between stores", - tracking_number: "TRACK123456789", - created_by_team_member_id: "EXAMPLE_TEAM_MEMBER_ID_789", - line_items: [ - { - uid: "1", - item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_001", - quantity_ordered: "5", - quantity_pending: "5", - quantity_received: "0", - quantity_damaged: "0", - quantity_canceled: "0", - }, - ], - version: BigInt(1753118664873), - }, - { - id: "EXAMPLE_TRANSFER_ORDER_ID_456", - source_location_id: "EXAMPLE_SOURCE_LOCATION_ID_123", - destination_location_id: "EXAMPLE_DEST_LOCATION_ID_456", - status: "PARTIALLY_RECEIVED", - created_at: "2025-01-14T14:20:00Z", - updated_at: "2025-01-15T09:45:00Z", - expected_at: "2025-11-08T12:00:00Z", - completed_at: "completed_at", - notes: "Seasonal stock transfer", - tracking_number: "tracking_number", - created_by_team_member_id: "created_by_team_member_id", - line_items: [ - { - uid: "1", - item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_002", - quantity_ordered: "10", - quantity_pending: "3", - quantity_received: "7", - quantity_damaged: "0", - quantity_canceled: "0", - }, - ], - version: BigInt(1753115540123), - }, - ], - cursor: "eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTU1NDBfMTIzfQ==", - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint({ once: false }) - .post("/v2/transfer-orders/search") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - transferOrders: [ - { - id: "EXAMPLE_TRANSFER_ORDER_ID_123", - sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_123", - destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_456", - status: "STARTED", - createdAt: "2025-01-15T10:30:00Z", - updatedAt: "2025-01-15T10:32:00Z", - expectedAt: "2025-11-09T05:00:00Z", - completedAt: "completed_at", - notes: "Inventory rebalance between stores", - trackingNumber: "TRACK123456789", - createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", - lineItems: [ - { - uid: "1", - itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", - quantityOrdered: "5", - quantityPending: "5", - quantityReceived: "0", - quantityDamaged: "0", - quantityCanceled: "0", - }, - ], - version: BigInt("1753118664873"), - }, - { - id: "EXAMPLE_TRANSFER_ORDER_ID_456", - sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_123", - destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_456", - status: "PARTIALLY_RECEIVED", - createdAt: "2025-01-14T14:20:00Z", - updatedAt: "2025-01-15T09:45:00Z", - expectedAt: "2025-11-08T12:00:00Z", - completedAt: "completed_at", - notes: "Seasonal stock transfer", - trackingNumber: "tracking_number", - createdByTeamMemberId: "created_by_team_member_id", - lineItems: [ - { - uid: "1", - itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_002", - quantityOrdered: "10", - quantityPending: "3", - quantityReceived: "7", - quantityDamaged: "0", - quantityCanceled: "0", - }, - ], - version: BigInt("1753115540123"), - }, - ], - cursor: "eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTU1NDBfMTIzfQ==", - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }; - const page = await client.transferOrders.search({ - query: { - filter: { - sourceLocationIds: ["EXAMPLE_SOURCE_LOCATION_ID_123"], - destinationLocationIds: ["EXAMPLE_DEST_LOCATION_ID_456"], - statuses: ["STARTED", "PARTIALLY_RECEIVED"], - }, - sort: { - field: "UPDATED_AT", - order: "DESC", - }, - }, - cursor: "eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTg2NjQ4NzN9", - limit: 10, - }); - - expect(expected.transferOrders).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.transferOrders).toEqual(nextPage.data); - }); - - test("get", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - transfer_order: { - id: "EXAMPLE_TRANSFER_ORDER_ID_123", - source_location_id: "EXAMPLE_SOURCE_LOCATION_ID_123", - destination_location_id: "EXAMPLE_DEST_LOCATION_ID_456", - status: "STARTED", - created_at: "2025-01-15T10:30:00Z", - updated_at: "2025-01-15T10:35:00Z", - expected_at: "2025-11-09T05:00:00Z", - completed_at: "completed_at", - notes: "Example transfer order for inventory redistribution between locations", - tracking_number: "TRACK123456789", - created_by_team_member_id: "EXAMPLE_TEAM_MEMBER_ID_789", - line_items: [ - { - uid: "1", - item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_001", - quantity_ordered: "5", - quantity_pending: "5", - quantity_received: "0", - quantity_damaged: "0", - quantity_canceled: "0", - }, - { - uid: "2", - item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_002", - quantity_ordered: "3", - quantity_pending: "3", - quantity_received: "0", - quantity_damaged: "0", - quantity_canceled: "0", - }, - ], - version: BigInt(1753117449752), - }, - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint() - .get("/v2/transfer-orders/transfer_order_id") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.transferOrders.get({ - transferOrderId: "transfer_order_id", - }); - expect(response).toEqual({ - transferOrder: { - id: "EXAMPLE_TRANSFER_ORDER_ID_123", - sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_123", - destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_456", - status: "STARTED", - createdAt: "2025-01-15T10:30:00Z", - updatedAt: "2025-01-15T10:35:00Z", - expectedAt: "2025-11-09T05:00:00Z", - completedAt: "completed_at", - notes: "Example transfer order for inventory redistribution between locations", - trackingNumber: "TRACK123456789", - createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", - lineItems: [ - { - uid: "1", - itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", - quantityOrdered: "5", - quantityPending: "5", - quantityReceived: "0", - quantityDamaged: "0", - quantityCanceled: "0", - }, - { - uid: "2", - itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_002", - quantityOrdered: "3", - quantityPending: "3", - quantityReceived: "0", - quantityDamaged: "0", - quantityCanceled: "0", - }, - ], - version: BigInt("1753117449752"), - }, - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }); - }); - - test("update", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - const rawRequestBody = { - idempotency_key: "f47ac10b-58cc-4372-a567-0e02b2c3d479", - transfer_order: { - source_location_id: "EXAMPLE_SOURCE_LOCATION_ID_789", - destination_location_id: "EXAMPLE_DEST_LOCATION_ID_101", - expected_at: "2025-11-10T08:00:00Z", - notes: "Updated: Priority transfer due to low stock at destination", - tracking_number: "TRACK987654321", - line_items: [ - { uid: "1", quantity_ordered: "7" }, - { item_variation_id: "EXAMPLE_NEW_ITEM_VARIATION_ID_003", quantity_ordered: "2" }, - { uid: "2", remove: true }, - ], - }, - version: BigInt(1753109537351), - }; - const rawResponseBody = { - transfer_order: { - id: "EXAMPLE_TRANSFER_ORDER_ID_123", - source_location_id: "EXAMPLE_SOURCE_LOCATION_ID_789", - destination_location_id: "EXAMPLE_DEST_LOCATION_ID_101", - status: "DRAFT", - created_at: "2025-01-15T10:30:00Z", - updated_at: "2025-01-15T11:15:00Z", - expected_at: "2025-11-10T08:00:00Z", - completed_at: "completed_at", - notes: "Updated: Priority transfer due to low stock at destination", - tracking_number: "TRACK987654321", - created_by_team_member_id: "EXAMPLE_TEAM_MEMBER_ID_789", - line_items: [ - { - uid: "1", - item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_001", - quantity_ordered: "7", - quantity_pending: "7", - quantity_received: "0", - quantity_damaged: "0", - quantity_canceled: "0", - }, - { - uid: "3", - item_variation_id: "EXAMPLE_NEW_ITEM_VARIATION_ID_003", - quantity_ordered: "2", - quantity_pending: "2", - quantity_received: "0", - quantity_damaged: "0", - quantity_canceled: "0", - }, - ], - version: BigInt(1753122900456), - }, - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint() - .put("/v2/transfer-orders/transfer_order_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.transferOrders.update({ - transferOrderId: "transfer_order_id", - idempotencyKey: "f47ac10b-58cc-4372-a567-0e02b2c3d479", - transferOrder: { - sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_789", - destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_101", - expectedAt: "2025-11-10T08:00:00Z", - notes: "Updated: Priority transfer due to low stock at destination", - trackingNumber: "TRACK987654321", - lineItems: [ - { - uid: "1", - quantityOrdered: "7", - }, - { - itemVariationId: "EXAMPLE_NEW_ITEM_VARIATION_ID_003", - quantityOrdered: "2", - }, - { - uid: "2", - remove: true, - }, - ], - }, - version: BigInt("1753109537351"), - }); - expect(response).toEqual({ - transferOrder: { - id: "EXAMPLE_TRANSFER_ORDER_ID_123", - sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_789", - destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_101", - status: "DRAFT", - createdAt: "2025-01-15T10:30:00Z", - updatedAt: "2025-01-15T11:15:00Z", - expectedAt: "2025-11-10T08:00:00Z", - completedAt: "completed_at", - notes: "Updated: Priority transfer due to low stock at destination", - trackingNumber: "TRACK987654321", - createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", - lineItems: [ - { - uid: "1", - itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", - quantityOrdered: "7", - quantityPending: "7", - quantityReceived: "0", - quantityDamaged: "0", - quantityCanceled: "0", - }, - { - uid: "3", - itemVariationId: "EXAMPLE_NEW_ITEM_VARIATION_ID_003", - quantityOrdered: "2", - quantityPending: "2", - quantityReceived: "0", - quantityDamaged: "0", - quantityCanceled: "0", - }, - ], - version: BigInt("1753122900456"), - }, - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }); - }); - - test("delete", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint() - .delete("/v2/transfer-orders/transfer_order_id") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.transferOrders.delete({ - transferOrderId: "transfer_order_id", - version: BigInt("1000000"), - }); - expect(response).toEqual({ - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }); - }); - - test("cancel", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - const rawRequestBody = { - idempotency_key: "65cc0586-3e82-4d08-b524-3885cffd52", - version: BigInt(1753117449752), - }; - const rawResponseBody = { - transfer_order: { - id: "EXAMPLE_TRANSFER_ORDER_ID_123", - source_location_id: "EXAMPLE_SOURCE_LOCATION_ID_123", - destination_location_id: "EXAMPLE_DEST_LOCATION_ID_456", - status: "CANCELED", - created_at: "2025-01-15T10:30:00Z", - updated_at: "2025-01-15T10:45:00Z", - expected_at: "2025-11-09T05:00:00Z", - completed_at: "2025-01-15T10:45:00Z", - notes: "Example transfer order for inventory redistribution between locations", - tracking_number: "TRACK123456789", - created_by_team_member_id: "EXAMPLE_TEAM_MEMBER_ID_789", - line_items: [ - { - uid: "1", - item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_001", - quantity_ordered: "5", - quantity_pending: "0", - quantity_received: "0", - quantity_damaged: "0", - quantity_canceled: "5", - }, - { - uid: "2", - item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_002", - quantity_ordered: "3", - quantity_pending: "0", - quantity_received: "0", - quantity_damaged: "0", - quantity_canceled: "3", - }, - ], - version: BigInt(1753117461842), - }, - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint() - .post("/v2/transfer-orders/transfer_order_id/cancel") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.transferOrders.cancel({ - transferOrderId: "transfer_order_id", - idempotencyKey: "65cc0586-3e82-4d08-b524-3885cffd52", - version: BigInt("1753117449752"), - }); - expect(response).toEqual({ - transferOrder: { - id: "EXAMPLE_TRANSFER_ORDER_ID_123", - sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_123", - destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_456", - status: "CANCELED", - createdAt: "2025-01-15T10:30:00Z", - updatedAt: "2025-01-15T10:45:00Z", - expectedAt: "2025-11-09T05:00:00Z", - completedAt: "2025-01-15T10:45:00Z", - notes: "Example transfer order for inventory redistribution between locations", - trackingNumber: "TRACK123456789", - createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", - lineItems: [ - { - uid: "1", - itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", - quantityOrdered: "5", - quantityPending: "0", - quantityReceived: "0", - quantityDamaged: "0", - quantityCanceled: "5", - }, - { - uid: "2", - itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_002", - quantityOrdered: "3", - quantityPending: "0", - quantityReceived: "0", - quantityDamaged: "0", - quantityCanceled: "3", - }, - ], - version: BigInt("1753117461842"), - }, - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }); - }); - - test("receive", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - const rawRequestBody = { - idempotency_key: "EXAMPLE_IDEMPOTENCY_KEY_101", - receipt: { - line_items: [ - { - transfer_order_line_uid: "transfer_order_line_uid", - quantity_received: "3", - quantity_damaged: "1", - quantity_canceled: "1", - }, - { - transfer_order_line_uid: "transfer_order_line_uid", - quantity_received: "2", - quantity_canceled: "1", - }, - ], - }, - version: BigInt(1753118664873), - }; - const rawResponseBody = { - transfer_order: { - id: "EXAMPLE_TRANSFER_ORDER_ID_123", - source_location_id: "EXAMPLE_SOURCE_LOCATION_ID_123", - destination_location_id: "EXAMPLE_DEST_LOCATION_ID_456", - status: "COMPLETED", - created_at: "2025-01-15T10:30:00Z", - updated_at: "2025-01-15T10:55:00Z", - expected_at: "2025-11-09T05:00:00Z", - completed_at: "2025-01-15T10:55:00Z", - notes: "Example transfer order for inventory redistribution between locations", - tracking_number: "TRACK123456789", - created_by_team_member_id: "EXAMPLE_TEAM_MEMBER_ID_789", - line_items: [ - { - uid: "1", - item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_001", - quantity_ordered: "5", - quantity_pending: "0", - quantity_received: "3", - quantity_damaged: "1", - quantity_canceled: "1", - }, - { - uid: "2", - item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_002", - quantity_ordered: "3", - quantity_pending: "0", - quantity_received: "2", - quantity_damaged: "0", - quantity_canceled: "1", - }, - ], - version: BigInt(1753118667248), - }, - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint() - .post("/v2/transfer-orders/transfer_order_id/receive") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.transferOrders.receive({ - transferOrderId: "transfer_order_id", - idempotencyKey: "EXAMPLE_IDEMPOTENCY_KEY_101", - receipt: { - lineItems: [ - { - transferOrderLineUid: "transfer_order_line_uid", - quantityReceived: "3", - quantityDamaged: "1", - quantityCanceled: "1", - }, - { - transferOrderLineUid: "transfer_order_line_uid", - quantityReceived: "2", - quantityCanceled: "1", - }, - ], - }, - version: BigInt("1753118664873"), - }); - expect(response).toEqual({ - transferOrder: { - id: "EXAMPLE_TRANSFER_ORDER_ID_123", - sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_123", - destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_456", - status: "COMPLETED", - createdAt: "2025-01-15T10:30:00Z", - updatedAt: "2025-01-15T10:55:00Z", - expectedAt: "2025-11-09T05:00:00Z", - completedAt: "2025-01-15T10:55:00Z", - notes: "Example transfer order for inventory redistribution between locations", - trackingNumber: "TRACK123456789", - createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", - lineItems: [ - { - uid: "1", - itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", - quantityOrdered: "5", - quantityPending: "0", - quantityReceived: "3", - quantityDamaged: "1", - quantityCanceled: "1", - }, - { - uid: "2", - itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_002", - quantityOrdered: "3", - quantityPending: "0", - quantityReceived: "2", - quantityDamaged: "0", - quantityCanceled: "1", - }, - ], - version: BigInt("1753118667248"), - }, - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }); - }); - - test("start", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - const rawRequestBody = { idempotency_key: "EXAMPLE_IDEMPOTENCY_KEY_789", version: BigInt(1753109537351) }; - const rawResponseBody = { - transfer_order: { - id: "EXAMPLE_TRANSFER_ORDER_ID_123", - source_location_id: "EXAMPLE_SOURCE_LOCATION_ID_123", - destination_location_id: "EXAMPLE_DEST_LOCATION_ID_456", - status: "STARTED", - created_at: "2025-01-15T10:30:00Z", - updated_at: "2025-01-15T10:32:00Z", - expected_at: "2025-11-09T05:00:00Z", - completed_at: "completed_at", - notes: "Example transfer order for inventory redistribution between locations", - tracking_number: "TRACK123456789", - created_by_team_member_id: "EXAMPLE_TEAM_MEMBER_ID_789", - line_items: [ - { - uid: "1", - item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_001", - quantity_ordered: "5", - quantity_pending: "5", - quantity_received: "0", - quantity_damaged: "0", - quantity_canceled: "0", - }, - { - uid: "2", - item_variation_id: "EXAMPLE_ITEM_VARIATION_ID_002", - quantity_ordered: "3", - quantity_pending: "3", - quantity_received: "0", - quantity_damaged: "0", - quantity_canceled: "0", - }, - ], - version: BigInt(1753118664873), - }, - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - }; - server - .mockEndpoint() - .post("/v2/transfer-orders/transfer_order_id/start") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.transferOrders.start({ - transferOrderId: "transfer_order_id", - idempotencyKey: "EXAMPLE_IDEMPOTENCY_KEY_789", - version: BigInt("1753109537351"), - }); - expect(response).toEqual({ - transferOrder: { - id: "EXAMPLE_TRANSFER_ORDER_ID_123", - sourceLocationId: "EXAMPLE_SOURCE_LOCATION_ID_123", - destinationLocationId: "EXAMPLE_DEST_LOCATION_ID_456", - status: "STARTED", - createdAt: "2025-01-15T10:30:00Z", - updatedAt: "2025-01-15T10:32:00Z", - expectedAt: "2025-11-09T05:00:00Z", - completedAt: "completed_at", - notes: "Example transfer order for inventory redistribution between locations", - trackingNumber: "TRACK123456789", - createdByTeamMemberId: "EXAMPLE_TEAM_MEMBER_ID_789", - lineItems: [ - { - uid: "1", - itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_001", - quantityOrdered: "5", - quantityPending: "5", - quantityReceived: "0", - quantityDamaged: "0", - quantityCanceled: "0", - }, - { - uid: "2", - itemVariationId: "EXAMPLE_ITEM_VARIATION_ID_002", - quantityOrdered: "3", - quantityPending: "3", - quantityReceived: "0", - quantityDamaged: "0", - quantityCanceled: "0", - }, - ], - version: BigInt("1753118664873"), - }, - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - }); - }); -}); diff --git a/tests/wire/v1Transactions.test.ts b/tests/wire/v1Transactions.test.ts index 462f78c8e..0c9a2b361 100644 --- a/tests/wire/v1Transactions.test.ts +++ b/tests/wire/v1Transactions.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("V1TransactionsClient", () => { +describe("V1Transactions", () => { test("V1ListOrders", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = [ { @@ -160,7 +162,7 @@ describe("V1TransactionsClient", () => { test("V1RetrieveOrder", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -335,7 +337,7 @@ describe("V1TransactionsClient", () => { test("V1UpdateOrder", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { action: "COMPLETE" }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/vendors.test.ts b/tests/wire/vendors.test.ts index 438095418..13f6fcd36 100644 --- a/tests/wire/vendors.test.ts +++ b/tests/wire/vendors.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../src/Client"; import { mockServerPool } from "../mock-server/MockServerPool"; +import { SquareClient } from "../../src/Client"; -describe("VendorsClient", () => { +describe("Vendors", () => { test("batchCreate", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { vendors: { "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe": { @@ -152,7 +154,7 @@ describe("VendorsClient", () => { test("batchGet", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { vendor_ids: ["INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4"] }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -252,7 +254,7 @@ describe("VendorsClient", () => { test("batchUpdate", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { vendors: { FMCYHBWT1TPL8MFH52PBMEN92A: { vendor: {} }, INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4: { vendor: {} } }, }; @@ -420,7 +422,7 @@ describe("VendorsClient", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", vendor: { @@ -565,7 +567,7 @@ describe("VendorsClient", () => { test("search", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -654,7 +656,7 @@ describe("VendorsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -754,7 +756,7 @@ describe("VendorsClient", () => { test("update", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", vendor: { diff --git a/tests/wire/webhooks/eventTypes.test.ts b/tests/wire/webhooks/eventTypes.test.ts index bb8deaa8b..440ec0805 100644 --- a/tests/wire/webhooks/eventTypes.test.ts +++ b/tests/wire/webhooks/eventTypes.test.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("EventTypesClient", () => { +describe("EventTypes", () => { test("list", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tests/wire/webhooks/subscriptions.test.ts b/tests/wire/webhooks/subscriptions.test.ts index 135c2b0c7..79f019eab 100644 --- a/tests/wire/webhooks/subscriptions.test.ts +++ b/tests/wire/webhooks/subscriptions.test.ts @@ -1,78 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { SquareClient } from "../../../src/Client"; import { mockServerPool } from "../../mock-server/MockServerPool"; +import { SquareClient } from "../../../src/Client"; -describe("SubscriptionsClient", () => { - test("list", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - - const rawResponseBody = { - errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], - subscriptions: [ - { - id: "wbhk_b35f6b3145074cf9ad513610786c19d5", - name: "Example Webhook Subscription", - enabled: true, - event_types: ["payment.created", "payment.updated"], - notification_url: "https://example-webhook-url.com", - api_version: "2021-12-15", - signature_key: "signature_key", - created_at: "2022-01-10 23:29:48 +0000 UTC", - updated_at: "2022-01-10 23:29:48 +0000 UTC", - }, - ], - cursor: "cursor", - }; - server - .mockEndpoint({ once: false }) - .get("/v2/webhooks/subscriptions") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const expected = { - errors: [ - { - category: "API_ERROR", - code: "INTERNAL_SERVER_ERROR", - detail: "detail", - field: "field", - }, - ], - subscriptions: [ - { - id: "wbhk_b35f6b3145074cf9ad513610786c19d5", - name: "Example Webhook Subscription", - enabled: true, - eventTypes: ["payment.created", "payment.updated"], - notificationUrl: "https://example-webhook-url.com", - apiVersion: "2021-12-15", - signatureKey: "signature_key", - createdAt: "2022-01-10 23:29:48 +0000 UTC", - updatedAt: "2022-01-10 23:29:48 +0000 UTC", - }, - ], - cursor: "cursor", - }; - const page = await client.webhooks.subscriptions.list({ - cursor: "cursor", - includeDisabled: true, - sortOrder: "DESC", - limit: 1, - }); - - expect(expected.subscriptions).toEqual(page.data); - expect(page.hasNextPage()).toBe(true); - const nextPage = await page.getNextPage(); - expect(expected.subscriptions).toEqual(nextPage.data); - }); - +describe("Subscriptions", () => { test("create", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "63f84c6c-2200-4c99-846c-2670a1311fbf", subscription: { @@ -139,7 +75,7 @@ describe("SubscriptionsClient", () => { test("get", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -191,7 +127,7 @@ describe("SubscriptionsClient", () => { test("update", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { subscription: { name: "Updated Example Webhook Subscription", enabled: false } }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -248,7 +184,7 @@ describe("SubscriptionsClient", () => { test("delete", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -278,7 +214,7 @@ describe("SubscriptionsClient", () => { test("updateSignatureKey", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { idempotency_key: "ed80ae6b-0654-473b-bbab-a39aee89a60d" }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], @@ -312,7 +248,7 @@ describe("SubscriptionsClient", () => { test("test", async () => { const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); + const client = new SquareClient({ token: "test", environment: server.baseUrl }); const rawRequestBody = { event_type: "payment.created" }; const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], diff --git a/tsconfig.json b/tsconfig.json index 0140f4117..1ec87dd77 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,8 +10,6 @@ "outDir": "dist", "rootDir": "src", "baseUrl": "src", - "isolatedModules": true, - "isolatedDeclarations": true, "module": "CommonJS" }, "include": ["src"], diff --git a/yarn.lock b/yarn.lock index 580640dd6..a658253cd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13,17 +13,17 @@ tslib "^2.8.1" "@apimatic/axios-client-adapter@^0.3.7": - version "0.3.20" - resolved "https://registry.yarnpkg.com/@apimatic/axios-client-adapter/-/axios-client-adapter-0.3.20.tgz#3e305a032126d07ccc8b0297e2688b6bad93e037" - integrity sha512-HuwM3rtM+LLnJC6eu4FmniwEz3rsoy2rtTa0rcHv47JbHdp8/AR6Q1AQii1UzTLP9LA2LU7Cq+3xu1htRzvlQQ== + version "0.3.21" + resolved "https://registry.yarnpkg.com/@apimatic/axios-client-adapter/-/axios-client-adapter-0.3.21.tgz#94fa288fffefc6cade844216f6a701def1f74a63" + integrity sha512-pr/XvAvH9FjbpwM+B7vHQxM7alocOX1kLNtSpXKW3yxTYxksF3ydnUuQ85rRbCoNpyfMOIjnRBCNUBzX5p2Hnw== dependencies: - "@apimatic/convert-to-stream" "^0.1.8" + "@apimatic/convert-to-stream" "^0.1.9" "@apimatic/core-interfaces" "^0.2.14" "@apimatic/file-wrapper" "^0.3.9" "@apimatic/http-headers" "^0.3.8" "@apimatic/http-query" "^0.3.9" "@apimatic/json-bigint" "^1.2.0" - "@apimatic/proxy" "^0.1.3" + "@apimatic/proxy" "^0.1.4" axios "^1.8.4" detect-browser "^5.3.0" detect-node "^2.1.0" @@ -32,10 +32,10 @@ tiny-warning "^1.0.3" tslib "^2.8.1" -"@apimatic/convert-to-stream@^0.1.8": - version "0.1.8" - resolved "https://registry.yarnpkg.com/@apimatic/convert-to-stream/-/convert-to-stream-0.1.8.tgz#b52f99caafe556c688b9d6a3dc99ec1ade156a24" - integrity sha512-A4VO/wyGFksKtizp4aUOGGtSlejoVI1uAXLGPVymhfpion3wUwrlST/yif9SOj3faVAGeCTNx0w5A+BpVdzSEA== +"@apimatic/convert-to-stream@^0.1.9": + version "0.1.9" + resolved "https://registry.yarnpkg.com/@apimatic/convert-to-stream/-/convert-to-stream-0.1.9.tgz#4a46a66330d69e8ea5c3bff99739063bcdad90b8" + integrity sha512-C9NEKnDZoTRBRVeUGXVyAEmy6P5o+8oLwEckTKj0iBlExJLEXNt14nf4wxfzRO1KR8j5Bw8S6yStKCrQzcVERA== dependencies: tslib "2.8.1" @@ -49,11 +49,11 @@ tslib "^2.8.1" "@apimatic/core@^0.10.16": - version "0.10.28" - resolved "https://registry.yarnpkg.com/@apimatic/core/-/core-0.10.28.tgz#5d4f4e3fab522afd7963dddb30523fe0d6e61fa1" - integrity sha512-/1TsXtfuS6BOu1qRrKxnHuuBSSg3Q6ckf7ZPRyejzaA32PN0ke/eq+tK0tYGhnHrJtq869EXJ1r84mDw6Yb0zw== + version "0.10.29" + resolved "https://registry.yarnpkg.com/@apimatic/core/-/core-0.10.29.tgz#df4399643be47f38a3c8f81fe4bc2f99ac56ed0e" + integrity sha512-QhORiq0QbjlDMrw8ZZsAeG2DzE6QgGz5ukD5w2MOWE/3iIWnUDEROjmc2SfhyiGsE3GoEJ8cyhMMdjlOioP6ww== dependencies: - "@apimatic/convert-to-stream" "^0.1.8" + "@apimatic/convert-to-stream" "^0.1.9" "@apimatic/core-interfaces" "^0.2.14" "@apimatic/file-wrapper" "^0.3.9" "@apimatic/http-headers" "^0.3.8" @@ -96,10 +96,10 @@ resolved "https://registry.yarnpkg.com/@apimatic/json-bigint/-/json-bigint-1.2.0.tgz#05223455ec135976fe7a55456c2d21a3bbde56d8" integrity sha512-+bmVzYMdZu0Ya5L+my4FXFUih54OvQA/qlZsFOYdOoostyUuB27UDrVWQs/WVCmS0ADdo5vTU0eeTrrBkHoySw== -"@apimatic/proxy@^0.1.3": - version "0.1.3" - resolved "https://registry.yarnpkg.com/@apimatic/proxy/-/proxy-0.1.3.tgz#664ba7cbec92dbdc4f82bd2a025b70ba9aaa0910" - integrity sha512-2UQmmbhOxAXHgbkl6WzGiVLG96ubw7udUsm0cv3jqiCLUyC+c15NgC64pJ+jeYHpZm3BtsLG01rMA+dBdHsxYQ== +"@apimatic/proxy@^0.1.4": + version "0.1.4" + resolved "https://registry.yarnpkg.com/@apimatic/proxy/-/proxy-0.1.4.tgz#9a5b729ac3da8edc01ca5846f14e7f29b744f8d0" + integrity sha512-Vzgfu7wcA5aEJyj2SjQ00Tb06fhBof8gDo1kSsF6sZBm4QjdFywN5AMbQwhfFOKjHqcsNmJspdeqcdymUQ77jA== dependencies: http-proxy-agent "^7.0.2" https-proxy-agent "^7.0.6" @@ -111,34 +111,34 @@ dependencies: tslib "^2.8.1" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.27.1": - version "7.27.1" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.27.1.tgz#200f715e66d52a23b221a9435534a91cc13ad5be" - integrity sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.28.6.tgz#72499312ec58b1e2245ba4a4f550c132be4982f7" + integrity sha512-JYgintcMjRiCvS8mMECzaEn+m3PfoQiyqukOMCCVQtoJGYJw8j/8LBJEiqkHLkfwCcs74E3pbAUFNg7d9VNJ+Q== dependencies: - "@babel/helper-validator-identifier" "^7.27.1" + "@babel/helper-validator-identifier" "^7.28.5" js-tokens "^4.0.0" picocolors "^1.1.1" -"@babel/compat-data@^7.27.2": - version "7.28.5" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.28.5.tgz#a8a4962e1567121ac0b3b487f52107443b455c7f" - integrity sha512-6uFXyCayocRbqhZOB+6XcuZbkMNimwfVGFji8CTZnCzOHVGvDqzvitu1re2AU5LROliz7eQPhB8CpAMvnx9EjA== +"@babel/compat-data@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.28.6.tgz#103f466803fa0f059e82ccac271475470570d74c" + integrity sha512-2lfu57JtzctfIrcGMz992hyLlByuzgIk58+hhGCxjKZ3rWI82NnVLjXcaTqkI2NvlcvOskZaiZ5kjUALo3Lpxg== "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9": - version "7.28.5" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.28.5.tgz#4c81b35e51e1b734f510c99b07dfbc7bbbb48f7e" - integrity sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw== - dependencies: - "@babel/code-frame" "^7.27.1" - "@babel/generator" "^7.28.5" - "@babel/helper-compilation-targets" "^7.27.2" - "@babel/helper-module-transforms" "^7.28.3" - "@babel/helpers" "^7.28.4" - "@babel/parser" "^7.28.5" - "@babel/template" "^7.27.2" - "@babel/traverse" "^7.28.5" - "@babel/types" "^7.28.5" + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.28.6.tgz#531bf883a1126e53501ba46eb3bb414047af507f" + integrity sha512-H3mcG6ZDLTlYfaSNi0iOKkigqMFvkTKlGUYlD8GW7nNOYRrevuA46iTypPyv+06V3fEmvvazfntkBU34L0azAw== + dependencies: + "@babel/code-frame" "^7.28.6" + "@babel/generator" "^7.28.6" + "@babel/helper-compilation-targets" "^7.28.6" + "@babel/helper-module-transforms" "^7.28.6" + "@babel/helpers" "^7.28.6" + "@babel/parser" "^7.28.6" + "@babel/template" "^7.28.6" + "@babel/traverse" "^7.28.6" + "@babel/types" "^7.28.6" "@jridgewell/remapping" "^2.3.5" convert-source-map "^2.0.0" debug "^4.1.0" @@ -146,23 +146,23 @@ json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.28.5", "@babel/generator@^7.7.2": - version "7.28.5" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.28.5.tgz#712722d5e50f44d07bc7ac9fe84438742dd61298" - integrity sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ== +"@babel/generator@^7.28.6", "@babel/generator@^7.7.2": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.28.6.tgz#48dcc65d98fcc8626a48f72b62e263d25fc3c3f1" + integrity sha512-lOoVRwADj8hjf7al89tvQ2a1lf53Z+7tiXMgpZJL3maQPDxh0DgLMN62B2MKUOFcoodBHLMbDM6WAbKgNy5Suw== dependencies: - "@babel/parser" "^7.28.5" - "@babel/types" "^7.28.5" + "@babel/parser" "^7.28.6" + "@babel/types" "^7.28.6" "@jridgewell/gen-mapping" "^0.3.12" "@jridgewell/trace-mapping" "^0.3.28" jsesc "^3.0.2" -"@babel/helper-compilation-targets@^7.27.2": - version "7.27.2" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz#46a0f6efab808d51d29ce96858dd10ce8732733d" - integrity sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ== +"@babel/helper-compilation-targets@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz#32c4a3f41f12ed1532179b108a4d746e105c2b25" + integrity sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA== dependencies: - "@babel/compat-data" "^7.27.2" + "@babel/compat-data" "^7.28.6" "@babel/helper-validator-option" "^7.27.1" browserslist "^4.24.0" lru-cache "^5.1.1" @@ -173,34 +173,34 @@ resolved "https://registry.yarnpkg.com/@babel/helper-globals/-/helper-globals-7.28.0.tgz#b9430df2aa4e17bc28665eadeae8aa1d985e6674" integrity sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw== -"@babel/helper-module-imports@^7.27.1": - version "7.27.1" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz#7ef769a323e2655e126673bb6d2d6913bbead204" - integrity sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w== +"@babel/helper-module-imports@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz#60632cbd6ffb70b22823187201116762a03e2d5c" + integrity sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw== dependencies: - "@babel/traverse" "^7.27.1" - "@babel/types" "^7.27.1" + "@babel/traverse" "^7.28.6" + "@babel/types" "^7.28.6" -"@babel/helper-module-transforms@^7.28.3": - version "7.28.3" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.28.3.tgz#a2b37d3da3b2344fe085dab234426f2b9a2fa5f6" - integrity sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw== +"@babel/helper-module-transforms@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz#9312d9d9e56edc35aeb6e95c25d4106b50b9eb1e" + integrity sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA== dependencies: - "@babel/helper-module-imports" "^7.27.1" - "@babel/helper-validator-identifier" "^7.27.1" - "@babel/traverse" "^7.28.3" + "@babel/helper-module-imports" "^7.28.6" + "@babel/helper-validator-identifier" "^7.28.5" + "@babel/traverse" "^7.28.6" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.27.1", "@babel/helper-plugin-utils@^7.8.0": - version "7.27.1" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz#ddb2f876534ff8013e6c2b299bf4d39b3c51d44c" - integrity sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw== +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.28.6", "@babel/helper-plugin-utils@^7.8.0": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz#6f13ea251b68c8532e985fd532f28741a8af9ac8" + integrity sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug== "@babel/helper-string-parser@^7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz#54da796097ab19ce67ed9f88b47bb2ec49367687" integrity sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA== -"@babel/helper-validator-identifier@^7.27.1", "@babel/helper-validator-identifier@^7.28.5": +"@babel/helper-validator-identifier@^7.28.5": version "7.28.5" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz#010b6938fab7cb7df74aa2bbc06aa503b8fe5fb4" integrity sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q== @@ -210,20 +210,20 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz#fa52f5b1e7db1ab049445b421c4471303897702f" integrity sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg== -"@babel/helpers@^7.28.4": - version "7.28.4" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.28.4.tgz#fe07274742e95bdf7cf1443593eeb8926ab63827" - integrity sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w== +"@babel/helpers@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.28.6.tgz#fca903a313ae675617936e8998b814c415cbf5d7" + integrity sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw== dependencies: - "@babel/template" "^7.27.2" - "@babel/types" "^7.28.4" + "@babel/template" "^7.28.6" + "@babel/types" "^7.28.6" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.27.2", "@babel/parser@^7.28.5": - version "7.28.5" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.28.5.tgz#0b0225ee90362f030efd644e8034c99468893b08" - integrity sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.28.6.tgz#f01a8885b7fa1e56dd8a155130226cd698ef13fd" + integrity sha512-TeR9zWR18BvbfPmGbLampPMW+uW1NZnJlRuuHso8i87QZNq2JRF9i6RgxRqtEq+wQGsS19NNTWr2duhnE49mfQ== dependencies: - "@babel/types" "^7.28.5" + "@babel/types" "^7.28.6" "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -254,11 +254,11 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-import-attributes@^7.24.7": - version "7.27.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.27.1.tgz#34c017d54496f9b11b61474e7ea3dfd5563ffe07" - integrity sha512-oFT0FrKHgF53f4vOsZGi2Hh3I35PfSmVs4IBFLFj4dnafP+hIWDLg3VyKmUHfLoLHlyxY4C7DGtmHuJgn+IGww== + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.28.6.tgz#b71d5914665f60124e133696f17cd7669062c503" + integrity sha512-jiLC0ma9XkQT3TKJ9uYvlakm66Pamywo+qwL+oL8HJOvc6TWdZXVfhqJr8CCzbSGUAbDOzlGHJC1U+vRfLQDvw== dependencies: - "@babel/helper-plugin-utils" "^7.27.1" + "@babel/helper-plugin-utils" "^7.28.6" "@babel/plugin-syntax-import-meta@^7.10.4": version "7.10.4" @@ -275,11 +275,11 @@ "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-jsx@^7.7.2": - version "7.27.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.27.1.tgz#2f9beb5eff30fa507c5532d107daac7b888fa34c" - integrity sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w== + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.28.6.tgz#f8ca28bbd84883b5fea0e447c635b81ba73997ee" + integrity sha512-wgEmr06G6sIpqr8YDwA2dSRTE3bJ+V0IfpzfSY3Lfgd7YWOaAdlykvJi13ZKBt8cZHfgH1IXN+CL656W3uUa4w== dependencies: - "@babel/helper-plugin-utils" "^7.27.1" + "@babel/helper-plugin-utils" "^7.28.6" "@babel/plugin-syntax-logical-assignment-operators@^7.10.4": version "7.10.4" @@ -338,38 +338,38 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.7.2": - version "7.27.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.27.1.tgz#5147d29066a793450f220c63fa3a9431b7e6dd18" - integrity sha512-xfYCBMxveHrRMnAWl1ZlPXOZjzkN82THFvLhQhFXFt81Z5HnN+EtUkZhv/zcKpmT3fzmWZB0ywiBrbC3vogbwQ== + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.28.6.tgz#c7b2ddf1d0a811145b1de800d1abd146af92e3a2" + integrity sha512-+nDNmQye7nlnuuHDboPbGm00Vqg3oO8niRRL27/4LYHUsHYh0zJ1xWOz0uRwNFmM1Avzk8wZbc6rdiYhomzv/A== dependencies: - "@babel/helper-plugin-utils" "^7.27.1" + "@babel/helper-plugin-utils" "^7.28.6" -"@babel/template@^7.27.2", "@babel/template@^7.3.3": - version "7.27.2" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.27.2.tgz#fa78ceed3c4e7b63ebf6cb39e5852fca45f6809d" - integrity sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw== +"@babel/template@^7.28.6", "@babel/template@^7.3.3": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.28.6.tgz#0e7e56ecedb78aeef66ce7972b082fce76a23e57" + integrity sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ== dependencies: - "@babel/code-frame" "^7.27.1" - "@babel/parser" "^7.27.2" - "@babel/types" "^7.27.1" + "@babel/code-frame" "^7.28.6" + "@babel/parser" "^7.28.6" + "@babel/types" "^7.28.6" -"@babel/traverse@^7.27.1", "@babel/traverse@^7.28.3", "@babel/traverse@^7.28.5": - version "7.28.5" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.28.5.tgz#450cab9135d21a7a2ca9d2d35aa05c20e68c360b" - integrity sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ== +"@babel/traverse@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.28.6.tgz#871ddc79a80599a5030c53b1cc48cbe3a5583c2e" + integrity sha512-fgWX62k02qtjqdSNTAGxmKYY/7FSL9WAS1o2Hu5+I5m9T0yxZzr4cnrfXQ/MX0rIifthCSs6FKTlzYbJcPtMNg== dependencies: - "@babel/code-frame" "^7.27.1" - "@babel/generator" "^7.28.5" + "@babel/code-frame" "^7.28.6" + "@babel/generator" "^7.28.6" "@babel/helper-globals" "^7.28.0" - "@babel/parser" "^7.28.5" - "@babel/template" "^7.27.2" - "@babel/types" "^7.28.5" + "@babel/parser" "^7.28.6" + "@babel/template" "^7.28.6" + "@babel/types" "^7.28.6" debug "^4.3.1" -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.27.1", "@babel/types@^7.28.2", "@babel/types@^7.28.4", "@babel/types@^7.28.5", "@babel/types@^7.3.3": - version "7.28.5" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.28.5.tgz#10fc405f60897c35f07e85493c932c7b5ca0592b" - integrity sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA== +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.28.2", "@babel/types@^7.28.6", "@babel/types@^7.3.3": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.28.6.tgz#c3e9377f1b155005bcc4c46020e7e394e13089df" + integrity sha512-0ZrskXVEHSWIqZM/sQZ4EV3jZJXRkio/WCxaqKZP1g//CEWEPSfeZFcms4XeKBCHU0ZKnIkdJeU/kF+eRp5lBg== dependencies: "@babel/helper-string-parser" "^7.27.1" "@babel/helper-validator-identifier" "^7.28.5" @@ -379,74 +379,6 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@biomejs/biome@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/biome/-/biome-2.3.1.tgz#d1a9284f52986324f288cdaf450331a0f3fb1da7" - integrity sha512-A29evf1R72V5bo4o2EPxYMm5mtyGvzp2g+biZvRFx29nWebGyyeOSsDWGx3tuNNMFRepGwxmA9ZQ15mzfabK2w== - optionalDependencies: - "@biomejs/cli-darwin-arm64" "2.3.1" - "@biomejs/cli-darwin-x64" "2.3.1" - "@biomejs/cli-linux-arm64" "2.3.1" - "@biomejs/cli-linux-arm64-musl" "2.3.1" - "@biomejs/cli-linux-x64" "2.3.1" - "@biomejs/cli-linux-x64-musl" "2.3.1" - "@biomejs/cli-win32-arm64" "2.3.1" - "@biomejs/cli-win32-x64" "2.3.1" - -"@biomejs/cli-darwin-arm64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.3.1.tgz#607835f8ef043e1a80f9ad2a232c9e860941ab60" - integrity sha512-ombSf3MnTUueiYGN1SeI9tBCsDUhpWzOwS63Dove42osNh0PfE1cUtHFx6eZ1+MYCCLwXzlFlYFdrJ+U7h6LcA== - -"@biomejs/cli-darwin-x64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.3.1.tgz#654fe4aaa8ea5d5bde5457db4961ad5d214713ac" - integrity sha512-pcOfwyoQkrkbGvXxRvZNe5qgD797IowpJPovPX5biPk2FwMEV+INZqfCaz4G5bVq9hYnjwhRMamg11U4QsRXrQ== - -"@biomejs/cli-linux-arm64-musl@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.3.1.tgz#5fe502082a575c31ef808cf080cbcd4485964167" - integrity sha512-+DZYv8l7FlUtTrWs1Tdt1KcNCAmRO87PyOnxKGunbWm5HKg1oZBSbIIPkjrCtDZaeqSG1DiGx7qF+CPsquQRcg== - -"@biomejs/cli-linux-arm64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.3.1.tgz#81c02547905d379dbb312e6ff24b04908c2e320f" - integrity sha512-td5O8pFIgLs8H1sAZsD6v+5quODihyEw4nv2R8z7swUfIK1FKk+15e4eiYVLcAE4jUqngvh4j3JCNgg0Y4o4IQ== - -"@biomejs/cli-linux-x64-musl@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.3.1.tgz#c7c00beb5eda1ad25185544897e66eeec6be3b0b" - integrity sha512-Y3Ob4nqgv38Mh+6EGHltuN+Cq8aj/gyMTJYzkFZV2AEj+9XzoXB9VNljz9pjfFNHUxvLEV4b55VWyxozQTBaUQ== - -"@biomejs/cli-linux-x64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64/-/cli-linux-x64-2.3.1.tgz#7481d2e7be98d4de574df233766a5bdda037c897" - integrity sha512-PYWgEO7up7XYwSAArOpzsVCiqxBCXy53gsReAb1kKYIyXaoAlhBaBMvxR/k2Rm9aTuZ662locXUmPk/Aj+Xu+Q== - -"@biomejs/cli-win32-arm64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.3.1.tgz#dac8c7c7223e97f86cd0eed7aa95584984761481" - integrity sha512-RHIG/zgo+69idUqVvV3n8+j58dKYABRpMyDmfWu2TITC+jwGPiEaT0Q3RKD+kQHiS80mpBrST0iUGeEXT0bU9A== - -"@biomejs/cli-win32-x64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-x64/-/cli-win32-x64-2.3.1.tgz#f8818ab2c1e3a6e2ed8a656935173e5ce4c720be" - integrity sha512-izl30JJ5Dp10mi90Eko47zhxE6pYyWPcnX1NQxKpL/yMhXxf95oLTzfpu4q+MDBh/gemNqyJEwjBpe0MT5iWPA== - -"@bundled-es-modules/cookie@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@bundled-es-modules/cookie/-/cookie-2.0.1.tgz#b41376af6a06b3e32a15241d927b840a9b4de507" - integrity sha512-8o+5fRPLNbjbdGRRmJj3h6Hh1AQJf2dk3qQ/5ZFb+PXkRNiSoMGGUKlsgLfrxneb72axVJyIYji64E2+nNfYyw== - dependencies: - cookie "^0.7.2" - -"@bundled-es-modules/statuses@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@bundled-es-modules/statuses/-/statuses-1.0.1.tgz#761d10f44e51a94902c4da48675b71a76cc98872" - integrity sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg== - dependencies: - statuses "^2.0.1" - "@inquirer/ansi@^1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/@inquirer/ansi/-/ansi-1.0.2.tgz#674a4c4d81ad460695cb2a1fc69d78cd187f337e" @@ -734,10 +666,10 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" -"@mswjs/interceptors@^0.39.1": - version "0.39.8" - resolved "https://registry.yarnpkg.com/@mswjs/interceptors/-/interceptors-0.39.8.tgz#0a2cf4cf26a731214ca4156273121f67dff7ebf8" - integrity sha512-2+BzZbjRO7Ct61k8fMNHEtoKjeWI9pIlHFTqBwZ5icHpqszIgEZbjb1MW5Z0+bITTCTl3gk4PDBxs9tA/csXvA== +"@mswjs/interceptors@^0.40.0": + version "0.40.0" + resolved "https://registry.yarnpkg.com/@mswjs/interceptors/-/interceptors-0.40.0.tgz#1b45f215ba8c2983ed133763ca03af92896083d6" + integrity sha512-EFd6cVbHsgLa6wa4RljGj6Wk75qoHxUSyc5asLyyPSyuhIcdS2Q3Phw6ImS1q+CkALthJRShiYfKANcQMuMqsQ== dependencies: "@open-draft/deferred-promise" "^2.2.0" "@open-draft/logger" "^0.3.0" @@ -759,7 +691,7 @@ is-node-process "^1.2.0" outvariant "^1.4.0" -"@open-draft/until@^2.0.0", "@open-draft/until@^2.1.0": +"@open-draft/until@^2.0.0": version "2.1.0" resolved "https://registry.yarnpkg.com/@open-draft/until/-/until-2.1.0.tgz#0acf32f470af2ceaf47f095cdecd40d68666efda" integrity sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg== @@ -821,11 +753,6 @@ dependencies: "@babel/types" "^7.28.2" -"@types/cookie@^0.6.0": - version "0.6.0" - resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.6.0.tgz#eac397f28bf1d6ae0ae081363eca2f425bedf0d5" - integrity sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA== - "@types/eslint-scope@^3.7.7": version "3.7.7" resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.7.tgz#3108bd5f18b0cdb277c867b3dd449c9ed7079ac5" @@ -904,9 +831,9 @@ form-data "^4.0.4" "@types/node@*": - version "24.10.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-24.10.1.tgz#91e92182c93db8bd6224fca031e2370cef9a8f01" - integrity sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ== + version "25.0.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-25.0.9.tgz#81ce3579ddf67cae812a9d49c8a0ab90c82e7782" + integrity sha512-/rpCXHlCWeqClNBwUhDcusJxXYDjZTyE8v5oTO7WbL8eij2nKhUeU89/6xgjU7N4/Vh3He0BtyhJdQbDyhiXAw== dependencies: undici-types "~7.16.0" @@ -923,9 +850,9 @@ undici-types "~5.26.4" "@types/readable-stream@^4.0.18": - version "4.0.22" - resolved "https://registry.yarnpkg.com/@types/readable-stream/-/readable-stream-4.0.22.tgz#882fda4f17b6580acb257df3f22ca69c05470b29" - integrity sha512-/FFhJpfCLAPwAcN3mFycNUa77ddnr8jTgF5VmSNetaemWB2cIlfCA9t0YTM3JAT0wOcv8D4tjPo7pkDhK3EJIg== + version "4.0.23" + resolved "https://registry.yarnpkg.com/@types/readable-stream/-/readable-stream-4.0.23.tgz#fcd0f7472f45ceb43154f08f0083ccd1c76e53ce" + integrity sha512-wwXrtQvbMHxCbBgjHaMGEmImFTQxxpfMOR/ZoQnXxB1woqkUbdLGFDgauo00Py9IudiaqSeiBiulSV9i6XIPig== dependencies: "@types/node" "*" @@ -934,7 +861,7 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8" integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw== -"@types/statuses@^2.0.4": +"@types/statuses@^2.0.6": version "2.0.6" resolved "https://registry.yarnpkg.com/@types/statuses/-/statuses-2.0.6.tgz#66748315cc9a96d63403baa8671b2c124f8633aa" integrity sha512-xMAgYwceFhRA2zY+XbEA7mxYbA093wdiW8Vu6gZPGWy9cmOyU9XesH1tNcEWsKFd5Vzrqx5T3D38PWx1FIIXkA== @@ -1286,10 +1213,10 @@ base64-js@^1.3.1: resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== -baseline-browser-mapping@^2.8.25: - version "2.8.29" - resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.8.29.tgz#d8800b71399c783cb1bf2068c2bcc3b6cfd7892c" - integrity sha512-sXdt2elaVnhpDNRDz+1BDx1JQoJRuNk7oVlAlbGiFkLikHCAQiccexF/9e91zVi6RCgqspl04aP+6Cnl9zRLrA== +baseline-browser-mapping@^2.9.0: + version "2.9.14" + resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.9.14.tgz#3b6af0bc032445bca04de58caa9a87cfe921cbb3" + integrity sha512-B0xUquLkiGLgHhpPBqvl7GWegWBUNuujQ6kXd/r1U38ElPT6Ok8KZ8e+FpUGEc2ZoRQUzq/aUnaKFc/svWUGSg== brace-expansion@^1.1.7: version "1.1.12" @@ -1306,16 +1233,16 @@ braces@^3.0.3: dependencies: fill-range "^7.1.1" -browserslist@^4.24.0, browserslist@^4.26.3: - version "4.28.0" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.28.0.tgz#9cefece0a386a17a3cd3d22ebf67b9deca1b5929" - integrity sha512-tbydkR/CxfMwelN0vwdP/pLkDwyAASZ+VfWm4EOwlB6SWhx1sYnWLqo8N5j0rAzPfzfRaxt0mM/4wPU/Su84RQ== +browserslist@^4.24.0, browserslist@^4.28.1: + version "4.28.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.28.1.tgz#7f534594628c53c63101079e27e40de490456a95" + integrity sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA== dependencies: - baseline-browser-mapping "^2.8.25" - caniuse-lite "^1.0.30001754" - electron-to-chromium "^1.5.249" + baseline-browser-mapping "^2.9.0" + caniuse-lite "^1.0.30001759" + electron-to-chromium "^1.5.263" node-releases "^2.0.27" - update-browserslist-db "^1.1.4" + update-browserslist-db "^1.2.0" bs-logger@^0.2.6: version "0.2.6" @@ -1367,10 +1294,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001754: - version "1.0.30001756" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001756.tgz#fe80104631102f88e58cad8aa203a2c3e5ec9ebd" - integrity sha512-4HnCNKbMLkLdhJz3TToeVWHSnfJvPaq6vu/eRP0Ahub/07n484XHhBF5AJoSGHdVrS8tKFauUQz8Bp9P7LVx7A== +caniuse-lite@^1.0.30001759: + version "1.0.30001764" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001764.tgz#03206c56469f236103b90f9ae10bcb8b9e1f6005" + integrity sha512-9JGuzl2M+vPL+pz70gtMF9sHdMFbY9FJaQBi186cHKH3pSzDvzoUJUPV6fqiKIMyXbud9ZLg4F3Yza1vJ1+93g== chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" @@ -1458,10 +1385,10 @@ convert-source-map@^2.0.0: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== -cookie@^0.7.2: - version "0.7.2" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.7.2.tgz#556369c472a2ba910f2979891b526b3436237ed7" - integrity sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w== +cookie@^1.0.2: + version "1.1.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-1.1.1.tgz#3bb9bdfc82369db9c2f69c93c9c3ceb310c88b3c" + integrity sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ== create-jest@^29.7.0: version "29.7.0" @@ -1524,9 +1451,9 @@ decimal.js@^10.4.2: integrity sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg== dedent@^1.0.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.7.0.tgz#c1f9445335f0175a96587be245a282ff451446ca" - integrity sha512-HGFtf8yhuhGhqO07SV79tRp+br4MnbdjeVxotpn1QBl30pcLLCQjX5b2295ll0fv8RKDKsmWYrl05usHM9CewQ== + version "1.7.1" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.7.1.tgz#364661eea3d73f3faba7089214420ec2f8f13e15" + integrity sha512-9JmrhGZpOlEgOLdQgSm0zxFaYoQon408V1v49aqTWuXENVlnCuY9JBZcXZiCsZQWDjTm5Qf/nIvAy77mXDAjEg== deepmerge@^4.2.2: version "4.3.1" @@ -1574,10 +1501,10 @@ dunder-proto@^1.0.1: es-errors "^1.3.0" gopd "^1.2.0" -electron-to-chromium@^1.5.249: - version "1.5.258" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.258.tgz#094b0280928b1bf967b202e4be5b335aa4754b69" - integrity sha512-rHUggNV5jKQ0sSdWwlaRDkFc3/rRJIVnOSe9yR4zrR07m3ZxhP4N27Hlg8VeJGGYgFTxK5NqDmWI4DSH72vIJg== +electron-to-chromium@^1.5.263: + version "1.5.267" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.267.tgz#5d84f2df8cdb6bfe7e873706bb21bd4bfb574dc7" + integrity sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw== emittery@^0.13.1: version "0.13.1" @@ -1589,10 +1516,10 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -enhanced-resolve@^5.0.0, enhanced-resolve@^5.17.3: - version "5.18.3" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.18.3.tgz#9b5f4c5c076b8787c78fe540392ce76a88855b44" - integrity sha512-d4lC8xfavMeBjzGr2vECC3fsGXziXZQyJxD868h2M/mBI3PwAuODxAkLkq5HYuvrPYcUtiLzsTo8U3PgX3Ocww== +enhanced-resolve@^5.0.0, enhanced-resolve@^5.17.4: + version "5.18.4" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.18.4.tgz#c22d33055f3952035ce6a144ce092447c525f828" + integrity sha512-LgQMM4WXU3QI+SYgEc2liRgznaD5ojbmY3sb8LxyguVkIg5FxdpTkvk72te2R38/TGKxH634oLxXRGY6d7AP+Q== dependencies: graceful-fs "^4.2.4" tapable "^2.2.0" @@ -1619,10 +1546,10 @@ es-errors@^1.3.0: resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== -es-module-lexer@^1.2.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.7.0.tgz#9159601561880a85f2734560a9099b2c31e5372a" - integrity sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA== +es-module-lexer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-2.0.0.tgz#f657cd7a9448dcdda9c070a3cb75e5dc1e85f5b1" + integrity sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw== es-object-atoms@^1.0.0, es-object-atoms@^1.1.1: version "1.1.1" @@ -1887,7 +1814,7 @@ graceful-fs@^4.1.2, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.9: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== -graphql@^16.8.1: +graphql@^16.12.0: version "16.12.0" resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.12.0.tgz#28cc2462435b1ac3fdc6976d030cef83a0c13ac7" integrity sha512-DKKrynuQRne0PNpEbzuEdHlYOMksHSUI8Zc9Unei5gTsMNA2/vMpoMz/yKba50pejK56qj98qM0SjYxAKi13gQ== @@ -2687,29 +2614,28 @@ ms@^2.1.3: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -msw@2.11.2: - version "2.11.2" - resolved "https://registry.yarnpkg.com/msw/-/msw-2.11.2.tgz#622d83855f456a5f93b1528f6eb6f4c0114623c3" - integrity sha512-MI54hLCsrMwiflkcqlgYYNJJddY5/+S0SnONvhv1owOplvqohKSQyGejpNdUGyCwgs4IH7PqaNbPw/sKOEze9Q== +msw@^2.8.4: + version "2.12.7" + resolved "https://registry.yarnpkg.com/msw/-/msw-2.12.7.tgz#755fa4a0df51133bf76ebc9b7d4bdcc4355f0c8e" + integrity sha512-retd5i3xCZDVWMYjHEVuKTmhqY8lSsxujjVrZiGbbdoxxIBg5S7rCuYy/YQpfrTYIxpd/o0Kyb/3H+1udBMoYg== dependencies: - "@bundled-es-modules/cookie" "^2.0.1" - "@bundled-es-modules/statuses" "^1.0.1" "@inquirer/confirm" "^5.0.0" - "@mswjs/interceptors" "^0.39.1" + "@mswjs/interceptors" "^0.40.0" "@open-draft/deferred-promise" "^2.2.0" - "@open-draft/until" "^2.1.0" - "@types/cookie" "^0.6.0" - "@types/statuses" "^2.0.4" - graphql "^16.8.1" + "@types/statuses" "^2.0.6" + cookie "^1.0.2" + graphql "^16.12.0" headers-polyfill "^4.0.2" is-node-process "^1.2.0" outvariant "^1.4.3" path-to-regexp "^6.3.0" picocolors "^1.1.1" rettime "^0.7.0" + statuses "^2.0.2" strict-event-emitter "^0.5.1" tough-cookie "^6.0.0" - type-fest "^4.26.1" + type-fest "^5.2.0" + until-async "^3.0.2" yargs "^17.7.2" mute-stream@^2.0.0: @@ -2757,9 +2683,9 @@ npm-run-path@^4.0.1: path-key "^3.0.0" nwsapi@^2.2.2: - version "2.2.22" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.22.tgz#109f9530cda6c156d6a713cdf5939e9f0de98b9d" - integrity sha512-ujSMe1OWVn55euT1ihwCI1ZcAaAU3nxUiDwfDQldc51ZXaB9m2AyOn6/jh1BLe2t/G8xd6uKG1UBF2aZJeg2SQ== + version "2.2.23" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.23.tgz#59712c3a88e6de2bb0b6ccc1070397267019cf6c" + integrity sha512-7wfH4sLbt4M0gCDzGE6vzQBo0bfTKjU7Sfpqy/7gs1qBfYz2vEJH6vXcBKpO3+6Yu1telwd0t9HpyOoLEQQbIQ== once@^1.3.0: version "1.4.0" @@ -2870,6 +2796,11 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" +prettier@^3.4.2: + version "3.8.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.8.0.tgz#f72cf71505133f40cfa2ef77a2668cdc558fcd69" + integrity sha512-yEPsovQfpxYfgWNhCfECjG5AQaO+K3dp6XERmOepyPDVqcJm+bjyCVO3pmU+nAPe0N5dDvekfGezt/EIiRe1TA== + pretty-format@^29.0.0, pretty-format@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" @@ -3114,7 +3045,7 @@ stack-utils@^2.0.3: dependencies: escape-string-regexp "^2.0.0" -statuses@^2.0.1: +statuses@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.2.tgz#8f75eecef765b5e1cfcdc080da59409ed424e382" integrity sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw== @@ -3194,15 +3125,20 @@ symbol-tree@^3.2.4: resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== +tagged-tag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/tagged-tag/-/tagged-tag-1.0.0.tgz#a0b5917c2864cba54841495abfa3f6b13edcf4d6" + integrity sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng== + tapable@^2.2.0, tapable@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.3.0.tgz#7e3ea6d5ca31ba8e078b560f0d83ce9a14aa8be6" integrity sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg== -terser-webpack-plugin@^5.3.11: - version "5.3.14" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.14.tgz#9031d48e57ab27567f02ace85c7d690db66c3e06" - integrity sha512-vkZjpUjb6OMS7dhV+tILUW6BhpDR7P2L/aQSAv+Uwk+m8KATX9EccViHTJR2qDtACKPIYndLGCyl3FMo+r2LMw== +terser-webpack-plugin@^5.3.16: + version "5.3.16" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.16.tgz#741e448cc3f93d8026ebe4f7ef9e4afacfd56330" + integrity sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q== dependencies: "@jridgewell/trace-mapping" "^0.3.25" jest-worker "^27.4.5" @@ -3211,9 +3147,9 @@ terser-webpack-plugin@^5.3.11: terser "^5.31.1" terser@^5.31.1: - version "5.44.1" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.44.1.tgz#e391e92175c299b8c284ad6ded609e37303b0a9c" - integrity sha512-t/R3R/n0MSwnnazuPpPNVO60LX0SKL45pyl9YlvxIdkH0Of7D5qM2EVe+yASRIlY5pZ73nclYJfNANGWPwFDZw== + version "5.46.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.46.0.tgz#1b81e560d584bbdd74a8ede87b4d9477b0ff9695" + integrity sha512-jTwoImyr/QbOWFFso3YoU3ik0jBBDJ6JTOQiy/J2YxVJdZCc+5u7skhNwiOR3FQIygFqVUPHl7qbbxtjW2K3Qg== dependencies: "@jridgewell/source-map" "^0.3.3" acorn "^8.15.0" @@ -3234,17 +3170,17 @@ tiny-warning@^1.0.3: resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754" integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA== -tldts-core@^7.0.18: - version "7.0.18" - resolved "https://registry.yarnpkg.com/tldts-core/-/tldts-core-7.0.18.tgz#78edfd38e8c35e20fb4d2cde63c759139e169d31" - integrity sha512-jqJC13oP4FFAahv4JT/0WTDrCF9Okv7lpKtOZUGPLiAnNbACcSg8Y8T+Z9xthOmRBqi/Sob4yi0TE0miRCvF7Q== +tldts-core@^7.0.19: + version "7.0.19" + resolved "https://registry.yarnpkg.com/tldts-core/-/tldts-core-7.0.19.tgz#9dd8a457a09b4e65c8266c029f1847fa78dead20" + integrity sha512-lJX2dEWx0SGH4O6p+7FPwYmJ/bu1JbcGJ8RLaG9b7liIgZ85itUVEPbMtWRVrde/0fnDPEPHW10ZsKW3kVsE9A== tldts@^7.0.5: - version "7.0.18" - resolved "https://registry.yarnpkg.com/tldts/-/tldts-7.0.18.tgz#72cac7a2bdb6bba78f8a09fdf7ef84843b09aa94" - integrity sha512-lCcgTAgMxQ1JKOWrVGo6E69Ukbnx4Gc1wiYLRf6J5NN4HRYJtCby1rPF8rkQ4a6qqoFBK5dvjJ1zJ0F7VfDSvw== + version "7.0.19" + resolved "https://registry.yarnpkg.com/tldts/-/tldts-7.0.19.tgz#84cd7a7f04e68ec93b93b106fac038c527b99368" + integrity sha512-8PWx8tvC4jDB39BQw1m4x8y5MH1BcQ5xHeL2n7UVFulMPH/3Q0uiamahFJ3lXA0zO2SUyRXuVVbWSDmstlt9YA== dependencies: - tldts-core "^7.0.18" + tldts-core "^7.0.19" tmpl@1.0.5: version "1.0.5" @@ -3288,9 +3224,9 @@ tr46@~0.0.3: integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== ts-jest@^29.3.4: - version "29.4.5" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.4.5.tgz#a6b0dc401e521515d5342234be87f1ca96390a6f" - integrity sha512-HO3GyiWn2qvTQA4kTgjDcXiMwYQt68a1Y8+JuLRVpdIzm+UOLSHgl/XqR4c6nzJkq5rOkjc02O2I7P7l/Yof0Q== + version "29.4.6" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.4.6.tgz#51cb7c133f227396818b71297ad7409bb77106e9" + integrity sha512-fSpWtOO/1AjSNQguk43hb/JCo16oJDnMJf3CdEGNkqsEX3t0KX96xvyX1D7PfLCpVoKu4MfVrqUkFyblYoY4lA== dependencies: bs-logger "^0.2.6" fast-json-stable-stringify "^2.1.0" @@ -3328,11 +3264,18 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== -type-fest@^4.26.1, type-fest@^4.41.0: +type-fest@^4.41.0: version "4.41.0" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.41.0.tgz#6ae1c8e5731273c2bf1f58ad39cbae2c91a46c58" integrity sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA== +type-fest@^5.2.0: + version "5.4.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-5.4.1.tgz#aa9eaadcdc0acb0b5bd52e54f966ee3e38e125d2" + integrity sha512-xygQcmneDyzsEuKZrFbRMne5HDqMs++aFzefrJTgEIKjQ3rekM+RPfFCVq2Gp1VIDqddoYeppCj4Pcb+RZW0GQ== + dependencies: + tagged-tag "^1.0.0" + typescript@~5.7.2: version "5.7.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.3.tgz#919b44a7dbb8583a9b856d162be24a54bf80073e" @@ -3358,10 +3301,15 @@ universalify@^0.2.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== -update-browserslist-db@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.4.tgz#7802aa2ae91477f255b86e0e46dbc787a206ad4a" - integrity sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A== +until-async@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/until-async/-/until-async-3.0.2.tgz#447f1531fdd7bb2b4c7a98869bdb1a4c2a23865f" + integrity sha512-IiSk4HlzAMqTUseHHe3VhIGyuFmN90zMTpD3Z3y8jeQbzLIq500MVM7Jq2vUAnTKAFPJrqwkzr6PoTcPhGcOiw== + +update-browserslist-db@^1.2.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz#64d76db58713136acbeb4c49114366cc6cc2e80d" + integrity sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w== dependencies: escalade "^3.2.0" picocolors "^1.1.1" @@ -3398,9 +3346,9 @@ walker@^1.0.8: makeerror "1.0.12" watchpack@^2.4.4: - version "2.4.4" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.4.tgz#473bda72f0850453da6425081ea46fc0d7602947" - integrity sha512-c5EGNOiyxxV5qmTtAB7rbiXxi1ooX1pQKMLX/MIabJjRA0SJBQOjKF+KSVfHkr9U1cADPon0mRiVe/riyaiDUA== + version "2.5.1" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.5.1.tgz#dd38b601f669e0cbf567cb802e75cead82cde102" + integrity sha512-Zn5uXdcFNIA1+1Ei5McRd+iRzfhENPCe7LeABkJtNulSxjma+l7ltNx55BWZkRlwRnpOgHqxnjyaDgJnNXnqzg== dependencies: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" @@ -3421,9 +3369,9 @@ webpack-sources@^3.3.3: integrity sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg== webpack@^5.97.1: - version "5.103.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.103.0.tgz#17a7c5a5020d5a3a37c118d002eade5ee2c6f3da" - integrity sha512-HU1JOuV1OavsZ+mfigY0j8d1TgQgbZ6M+J75zDkpEAwYeXjWSqrGJtgnPblJjd/mAyTNQ7ygw0MiKOn6etz8yw== + version "5.104.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.104.1.tgz#94bd41eb5dbf06e93be165ba8be41b8260d4fb1a" + integrity sha512-Qphch25abbMNtekmEGJmeRUhLDbe+QfiWTiqpKYkpCOWY64v9eyl+KRRLmqOFA2AvKPpc9DC6+u2n76tQLBoaA== dependencies: "@types/eslint-scope" "^3.7.7" "@types/estree" "^1.0.8" @@ -3433,10 +3381,10 @@ webpack@^5.97.1: "@webassemblyjs/wasm-parser" "^1.14.1" acorn "^8.15.0" acorn-import-phases "^1.0.3" - browserslist "^4.26.3" + browserslist "^4.28.1" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.17.3" - es-module-lexer "^1.2.1" + enhanced-resolve "^5.17.4" + es-module-lexer "^2.0.0" eslint-scope "5.1.1" events "^3.2.0" glob-to-regexp "^0.4.1" @@ -3447,7 +3395,7 @@ webpack@^5.97.1: neo-async "^2.6.2" schema-utils "^4.3.3" tapable "^2.3.0" - terser-webpack-plugin "^5.3.11" + terser-webpack-plugin "^5.3.16" watchpack "^2.4.4" webpack-sources "^3.3.3" @@ -3523,9 +3471,9 @@ write-file-atomic@^4.0.2: signal-exit "^3.0.7" ws@^8.11.0: - version "8.18.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.3.tgz#b56b88abffde62791c639170400c93dcb0c95472" - integrity sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg== + version "8.19.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.19.0.tgz#ddc2bdfa5b9ad860204f5a72a4863a8895fd8c8b" + integrity sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg== xml-name-validator@^4.0.0: version "4.0.0"