@foxtware/mineral 0.1.15 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.creds.yml.sample +34 -0
- package/AGENTS.md +5 -0
- package/_build_scripts/createNewFunction.js +19 -19
- package/api/_example.js +6 -3
- package/api/_tools/log.js +22 -0
- package/api/algolia/docs.md +7 -0
- package/api/asana/asana.constants.js +7 -0
- package/api/asana/asana.utils.js +37 -0
- package/api/asana/asanaGet.js +150 -0
- package/api/asana/docs.md +5 -0
- package/api/athos/docs.md +9 -0
- package/api/bleckmann/bleckmannAsnsGet.js +3 -1
- package/api/clickup/clickup.constants.js +7 -0
- package/api/clickup/clickup.utils.js +36 -0
- package/api/clickup/clickupGet.js +150 -0
- package/api/clickup/docs.md +6 -0
- package/api/discord/discord.constants.js +7 -0
- package/api/discord/discord.utils.js +36 -0
- package/api/discord/discordGet.js +144 -0
- package/api/discord/docs.md +6 -0
- package/api/etsy/_example.get.js +68 -0
- package/api/etsy/etsy.constants.js +33 -0
- package/api/etsy/etsy.utils.js +208 -0
- package/api/etsy/etsyAccessTokenRefresh.js +106 -0
- package/api/etsy/etsyAccessTokenRequest.js +118 -0
- package/api/etsy/etsyAllListingFilesGet.js +69 -0
- package/api/etsy/etsyAllListingsGetActive.js +88 -0
- package/api/etsy/etsyAuthorizationCodeRequest.js +124 -0
- package/api/etsy/etsyBuyerTaxonomyNodePropertiesGet.js +62 -0
- package/api/etsy/etsyBuyerTaxonomyNodesGet.js +58 -0
- package/api/etsy/etsyDraftListingCreate.js +71 -0
- package/api/etsy/etsyFeaturedListingsByShopGet.js +78 -0
- package/api/etsy/etsyGet.js +150 -0
- package/api/etsy/etsyHolidayPreferencesGet.js +65 -0
- package/api/etsy/etsyHolidayPreferencesUpdate.js +75 -0
- package/api/etsy/etsyListingDelete.js +61 -0
- package/api/etsy/etsyListingFileDelete.js +72 -0
- package/api/etsy/etsyListingFileGet.js +73 -0
- package/api/etsy/etsyListingGet.js +62 -0
- package/api/etsy/etsyListingImageDelete.js +72 -0
- package/api/etsy/etsyListingImageGet.js +66 -0
- package/api/etsy/etsyListingImagesGet.js +62 -0
- package/api/etsy/etsyListingInventoryGet.js +62 -0
- package/api/etsy/etsyListingInventoryUpdate.js +99 -0
- package/api/etsy/etsyListingOfferingGet.js +70 -0
- package/api/etsy/etsyListingPersonalizationDelete.js +68 -0
- package/api/etsy/etsyListingPersonalizationGet.js +62 -0
- package/api/etsy/etsyListingPersonalizationUpdate.js +75 -0
- package/api/etsy/etsyListingProductGet.js +64 -0
- package/api/etsy/etsyListingPropertiesGet.js +69 -0
- package/api/etsy/etsyListingPropertyDelete.js +72 -0
- package/api/etsy/etsyListingPropertyGet.js +66 -0
- package/api/etsy/etsyListingPropertyUpdate.js +79 -0
- package/api/etsy/etsyListingTranslationCreate.js +79 -0
- package/api/etsy/etsyListingTranslationGet.js +73 -0
- package/api/etsy/etsyListingTranslationUpdate.js +79 -0
- package/api/etsy/etsyListingUpdate.js +75 -0
- package/api/etsy/etsyListingVariationImagesGet.js +69 -0
- package/api/etsy/etsyListingVideoDelete.js +72 -0
- package/api/etsy/etsyListingVideoGet.js +66 -0
- package/api/etsy/etsyListingVideosGet.js +62 -0
- package/api/etsy/etsyListingsByListingIdsGet.js +63 -0
- package/api/etsy/etsyListingsByShopReceiptGet.js +82 -0
- package/api/etsy/etsyListingsByShopReturnPolicyGet.js +69 -0
- package/api/etsy/etsyListingsInventoryByListingIdsGet.js +63 -0
- package/api/etsy/etsyListingsShippingByListingIdsGet.js +63 -0
- package/api/etsy/etsyMeGet.js +56 -0
- package/api/etsy/etsyOauthRedirectParse.js +201 -0
- package/api/etsy/etsyPaymentAccountLedgerEntryPaymentsGet.js +65 -0
- package/api/etsy/etsyPaymentsGet.js +65 -0
- package/api/etsy/etsyPing.js +51 -0
- package/api/etsy/etsyReceiptShipmentCreate.js +75 -0
- package/api/etsy/etsyReviewsByListingGet.js +76 -0
- package/api/etsy/etsyReviewsByShopGet.js +80 -0
- package/api/etsy/etsySellerTaxonomyNodePropertiesGet.js +62 -0
- package/api/etsy/etsySellerTaxonomyNodesGet.js +58 -0
- package/api/etsy/etsyShippingCarriersGet.js +63 -0
- package/api/etsy/etsyShopGet.js +65 -0
- package/api/etsy/etsyShopListingsActiveGet.js +82 -0
- package/api/etsy/etsyShopListingsGet.js +87 -0
- package/api/etsy/etsyShopPaymentAccountLedgerEntriesGet.js +80 -0
- package/api/etsy/etsyShopPaymentAccountLedgerEntryGet.js +69 -0
- package/api/etsy/etsyShopPaymentByReceiptIdGet.js +69 -0
- package/api/etsy/etsyShopProductionPartnersGet.js +65 -0
- package/api/etsy/etsyShopReadinessStateDefinitionCreate.js +71 -0
- package/api/etsy/etsyShopReadinessStateDefinitionDelete.js +68 -0
- package/api/etsy/etsyShopReadinessStateDefinitionGet.js +69 -0
- package/api/etsy/etsyShopReadinessStateDefinitionUpdate.js +75 -0
- package/api/etsy/etsyShopReadinessStateDefinitionsGet.js +78 -0
- package/api/etsy/etsyShopReceiptGet.js +67 -0
- package/api/etsy/etsyShopReceiptTransactionGet.js +69 -0
- package/api/etsy/etsyShopReceiptTransactionsByListingGet.js +82 -0
- package/api/etsy/etsyShopReceiptTransactionsByReceiptGet.js +69 -0
- package/api/etsy/etsyShopReceiptTransactionsByShopGet.js +78 -0
- package/api/etsy/etsyShopReceiptUpdate.js +75 -0
- package/api/etsy/etsyShopReceiptsGet.js +70 -0
- package/api/etsy/etsyShopReturnPoliciesConsolidate.js +75 -0
- package/api/etsy/etsyShopReturnPolicyCreate.js +71 -0
- package/api/etsy/etsyShopReturnPolicyDelete.js +68 -0
- package/api/etsy/etsyShopReturnPolicyGet.js +69 -0
- package/api/etsy/etsyShopReturnPolicyUpdate.js +75 -0
- package/api/etsy/etsyShopReturnsPoliciesGet.js +70 -0
- package/api/etsy/etsyShopSectionCreate.js +71 -0
- package/api/etsy/etsyShopSectionDelete.js +68 -0
- package/api/etsy/etsyShopSectionGet.js +69 -0
- package/api/etsy/etsyShopSectionListingsGet.js +86 -0
- package/api/etsy/etsyShopSectionUpdate.js +75 -0
- package/api/etsy/etsyShopSectionsGet.js +65 -0
- package/api/etsy/etsyShopShippingProfileCreate.js +71 -0
- package/api/etsy/etsyShopShippingProfileDelete.js +68 -0
- package/api/etsy/etsyShopShippingProfileDestinationCreate.js +75 -0
- package/api/etsy/etsyShopShippingProfileDestinationDelete.js +72 -0
- package/api/etsy/etsyShopShippingProfileDestinationUpdate.js +79 -0
- package/api/etsy/etsyShopShippingProfileDestinationsByShippingProfileGet.js +82 -0
- package/api/etsy/etsyShopShippingProfileGet.js +69 -0
- package/api/etsy/etsyShopShippingProfileUpdate.js +75 -0
- package/api/etsy/etsyShopShippingProfileUpgradeCreate.js +75 -0
- package/api/etsy/etsyShopShippingProfileUpgradeDelete.js +72 -0
- package/api/etsy/etsyShopShippingProfileUpgradeUpdate.js +79 -0
- package/api/etsy/etsyShopShippingProfileUpgradesGet.js +69 -0
- package/api/etsy/etsyShopShippingProfilesGet.js +65 -0
- package/api/etsy/etsyShopUpdate.js +69 -0
- package/api/etsy/etsyShopsGet.js +70 -0
- package/api/etsy/etsyTokenScopes.js +63 -0
- package/api/etsy/etsyUserAddressDelete.js +61 -0
- package/api/etsy/etsyUserAddressGet.js +62 -0
- package/api/etsy/etsyUserAddressesGet.js +70 -0
- package/api/etsy/etsyUserGet.js +62 -0
- package/api/etsy/etsyUserShopsGet.js +62 -0
- package/api/etsy/etsyVariationImagesUpdate.js +75 -0
- package/api/figma/docs.md +6 -0
- package/api/figma/figma.constants.js +7 -0
- package/api/figma/figma.utils.js +36 -0
- package/api/figma/figmaGet.js +107 -0
- package/api/github/githubReposGet.js +3 -1
- package/api/github/githubUserGet.js +3 -1
- package/api/google/docs.md +7 -0
- package/api/google/google.constants.js +9 -0
- package/api/google/google.utils.js +137 -0
- package/api/google/googlecalendarCalendarsGet.js +54 -0
- package/api/google/googlecalendarEventCreate.js +63 -0
- package/api/google/googlecalendarEventDelete.js +55 -0
- package/api/google/googlecalendarEventGet.js +55 -0
- package/api/google/googlecalendarEventsGet.js +65 -0
- package/api/google/googledriveFileDelete.js +53 -0
- package/api/google/googledriveFileGet.js +57 -0
- package/api/google/googledriveFileUpload.js +127 -0
- package/api/google/googledriveFilesGet.js +72 -0
- package/api/google/googlesheetsSpreadsheetGet.js +57 -0
- package/api/google/googlesheetsSpreadsheetSheetAdd.js +150 -0
- package/api/google/googlesheetsSpreadsheetSheetGetData.js +159 -0
- package/api/google/googlesheetsSpreadsheetTrim.js +239 -0
- package/api/gorgias/docs.md +7 -0
- package/api/logiwa/logiwaAuthGet.js +3 -1
- package/api/logiwa/logiwaInventoriesGet.js +3 -1
- package/api/logiwa/logiwaOrdersGet.js +3 -1
- package/api/logiwa/logiwaProductsGet.js +3 -1
- package/api/logiwa/logiwaReportGetInventorySnapshot.js +3 -1
- package/api/logiwa/logiwaReportGetTotalInventory.js +3 -1
- package/api/logiwa/logiwaWebhooksGet.js +3 -1
- package/api/loop/loopAllowlistItemsGet.js +3 -1
- package/api/loop/loopBlocklistItemsGet.js +3 -1
- package/api/loop/loopDestinationsGet.js +3 -1
- package/api/loop/loopReturnsGet.js +3 -1
- package/api/notion/docs.md +6 -0
- package/api/notion/notion.constants.js +9 -0
- package/api/notion/notion.utils.js +44 -0
- package/api/notion/notionGet.js +146 -0
- package/api/peoplevox/_example.js +4 -1
- package/api/peoplevox/peoplevox.sessions.js +29 -0
- package/api/peoplevox/peoplevox.utils.js +4 -38
- package/api/peoplevox/peoplevoxAuthGet.js +3 -1
- package/api/peoplevox/peoplevoxGetSingle.js +4 -2
- package/api/peoplevox/peoplevoxOrderEdit.js +8 -2
- package/api/peoplevox/peoplevoxOrderGet.js +6 -1
- package/api/peoplevox/peoplevoxReportGet.js +6 -2
- package/api/pipe17/docs.md +8 -0
- package/api/pipe17/pipe17.constants.js +47 -0
- package/api/pipe17/pipe17.utils.js +123 -0
- package/api/pipe17/pipe17ArrivalGet.js +78 -0
- package/api/pipe17/pipe17ArrivalUpdate.js +111 -0
- package/api/pipe17/pipe17ArrivalsGet.js +54 -0
- package/api/pipe17/pipe17FulfillmentGet.js +69 -0
- package/api/pipe17/pipe17FulfillmentsGet.js +54 -0
- package/api/pipe17/pipe17Get.js +151 -0
- package/api/pipe17/pipe17InventoryItemGet.js +57 -0
- package/api/pipe17/pipe17InventoryItemsGet.js +54 -0
- package/api/pipe17/pipe17JobCreate.js +95 -0
- package/api/pipe17/pipe17JobGet.js +70 -0
- package/api/pipe17/pipe17JobResultsGet.js +55 -0
- package/api/pipe17/pipe17LocationGet.js +57 -0
- package/api/pipe17/pipe17LocationsGet.js +54 -0
- package/api/pipe17/pipe17OrderGet.js +71 -0
- package/api/pipe17/pipe17OrdersGet.js +54 -0
- package/api/pipe17/pipe17ProductGet.js +57 -0
- package/api/pipe17/pipe17ProductsGet.js +54 -0
- package/api/pipe17/pipe17PurchaseGet.js +57 -0
- package/api/pipe17/pipe17PurchasesGet.js +54 -0
- package/api/pipe17/pipe17ReceiptGet.js +57 -0
- package/api/pipe17/pipe17ReceiptsGet.js +54 -0
- package/api/pipe17/pipe17ReturnGet.js +57 -0
- package/api/pipe17/pipe17ReturnsGet.js +54 -0
- package/api/printify/_example.get.js +67 -0
- package/api/printify/_example.js +59 -0
- package/api/printify/printify.constants.js +8 -0
- package/api/printify/printify.utils.js +41 -0
- package/api/printify/printifyBlueprintGet.js +60 -0
- package/api/printify/printifyBlueprintPrintProviderVariantsGet.js +77 -0
- package/api/printify/printifyBlueprintPrintProvidersGet.js +60 -0
- package/api/printify/printifyBlueprintsGet.js +38 -0
- package/api/printify/printifyGet.js +154 -0
- package/api/printify/printifyImageUpload.js +74 -0
- package/api/printify/printifyOrderCancel.js +70 -0
- package/api/printify/printifyOrderCreate.js +98 -0
- package/api/printify/printifyOrderGet.js +70 -0
- package/api/printify/printifyOrderSubmit.js +70 -0
- package/api/printify/printifyOrdersGet.js +72 -0
- package/api/printify/printifyProductCreate.js +96 -0
- package/api/printify/printifyProductDelete.js +70 -0
- package/api/printify/printifyProductGet.js +79 -0
- package/api/printify/printifyProductUpdate.js +81 -0
- package/api/printify/printifyProductsGet.js +67 -0
- package/api/printify/printifyShippingGet.js +70 -0
- package/api/printify/printifyShopsGet.js +56 -0
- package/api/printify/printifyWebhookCreate.js +84 -0
- package/api/printify/printifyWebhookDelete.js +70 -0
- package/api/printify/printifyWebhookUpdate.js +81 -0
- package/api/printify/printifyWebhooksGet.js +56 -0
- package/api/salesforce/docs.md +6 -0
- package/api/shopify/_example.create.js +2 -2
- package/api/shopify/_example.get.js +17 -4
- package/api/shopify/_example.getsingle.js +4 -1
- package/api/shopify/_example.js +4 -1
- package/api/shopify/_example.mutation.js +4 -1
- package/api/shopify/shopifyAbandonedCheckoutsGet.js +1 -1
- package/api/shopify/shopifyArticlesGet.js +1 -1
- package/api/shopify/shopifyBlogsGet.js +1 -1
- package/api/shopify/shopifyBulkMutationDo.js +2 -2
- package/api/shopify/shopifyBulkOperationsGet.js +1 -1
- package/api/shopify/shopifyCatalogsGet.js +17 -4
- package/api/shopify/shopifyChannelsGet.js +17 -4
- package/api/shopify/shopifyCheckoutAndAccountsConfigurationsGet.js +17 -4
- package/api/shopify/shopifyCollectionGet.js +4 -1
- package/api/shopify/shopifyCollectionsGet.js +17 -4
- package/api/shopify/shopifyCustomerCreate.js +2 -2
- package/api/shopify/shopifyCustomerGet.js +4 -1
- package/api/shopify/shopifyCustomerMarketingConsentUpdateSms.js +84 -0
- package/api/shopify/shopifyCustomersGet.js +18 -5
- package/api/shopify/shopifyDecodeSessionToken.js +2 -2
- package/api/shopify/shopifyDeliveryCustomizationsGet.js +1 -1
- package/api/shopify/shopifyDeliveryProfilesGet.js +17 -4
- package/api/shopify/shopifyDiscountNodesGet.js +1 -1
- package/api/shopify/shopifyDisputesGet.js +1 -1
- package/api/shopify/shopifyDraftOrdersGet.js +1 -1
- package/api/shopify/shopifyEventsGet.js +1 -1
- package/api/shopify/shopifyFilesGet.js +1 -1
- package/api/shopify/shopifyFulfillmentOrdersGet.js +17 -4
- package/api/shopify/shopifyGet.js +1 -1
- package/api/shopify/shopifyGiftCardCreate.js +4 -1
- package/api/shopify/shopifyGiftCardDeactivate.js +4 -1
- package/api/shopify/shopifyGiftCardsGet.js +17 -4
- package/api/shopify/shopifyInventoryItemsGet.js +17 -4
- package/api/shopify/shopifyLocationsGet.js +1 -1
- package/api/shopify/shopifyMarketingEventsGet.js +1 -1
- package/api/shopify/shopifyMarketsGet.js +1 -1
- package/api/shopify/shopifyMenusGet.js +1 -1
- package/api/shopify/shopifyMetafieldDefinitionCreate.js +111 -0
- package/api/shopify/shopifyMetafieldDefinitionsGet.js +18 -4
- package/api/shopify/shopifyMetafieldsDelete.js +78 -0
- package/api/shopify/shopifyMetaobjectDefinitionsGet.js +1 -1
- package/api/shopify/shopifyMetaobjectsGet.js +1 -1
- package/api/shopify/shopifyMutationDo.js +4 -1
- package/api/shopify/shopifyOrderGet.js +4 -1
- package/api/shopify/shopifyOrdersGet.js +3 -1
- package/api/shopify/shopifyPageDelete.js +4 -1
- package/api/shopify/shopifyPageGet.js +4 -1
- package/api/shopify/shopifyPageUpdate.js +5 -1
- package/api/shopify/shopifyPagesGet.js +1 -1
- package/api/shopify/shopifyPaymentCustomizationsGet.js +1 -1
- package/api/shopify/shopifyProductFeedsGet.js +1 -1
- package/api/shopify/shopifyProductGet.js +110 -0
- package/api/shopify/shopifyProductVariantsGet.js +1 -1
- package/api/shopify/shopifyProductsGet.js +17 -4
- package/api/shopify/shopifyPublicationsGet.js +17 -4
- package/api/shopify/shopifySegmentsGet.js +1 -1
- package/api/shopify/shopifyStoreCreditAccountCredit.js +144 -0
- package/api/shopify/shopifyStoreCreditAccountDebit.js +132 -0
- package/api/shopify/shopifyThemeDelete.js +4 -1
- package/api/shopify/shopifyThemeDuplicate.js +4 -1
- package/api/shopify/shopifyThemeGet.js +2 -2
- package/api/shopify/shopifyThemesGet.js +3 -1
- package/api/shopify/shopifyUrlRedirectsGet.js +1 -1
- package/api/shopify/shopifyWebhookSubscriptionsGet.js +17 -4
- package/api/snowflake/docs.md +8 -0
- package/api/starshipit/starshipitAddressesGet.js +3 -1
- package/api/starshipit/starshipitOrdersListShipped.js +3 -1
- package/api/starshipit/starshipitProductsGet.js +3 -1
- package/api/stripe/_example.js +4 -1
- package/api/stripe/stripeChargesGet.js +3 -1
- package/api/stripe/stripeRefundsGet.js +3 -1
- package/api/stylearcade/stylearcadeDataGet.js +14 -6
- package/api/stylearcade/stylearcadeMetadataGet.js +3 -1
- package/api/tagalys/docs.md +7 -0
- package/api/telnyx/docs.md +6 -0
- package/api/telnyx/telnyx.constants.js +7 -0
- package/api/telnyx/telnyx.utils.js +37 -0
- package/api/telnyx/telnyxAvailablePhoneNumbersGet.js +59 -0
- package/api/telnyx/telnyxBalanceGet.js +51 -0
- package/api/telnyx/telnyxGet.js +151 -0
- package/api/telnyx/telnyxMessageGet.js +59 -0
- package/api/telnyx/telnyxMessageSend.js +65 -0
- package/api/telnyx/telnyxMessagesGet.js +53 -0
- package/api/telnyx/telnyxMessagingProfileCreate.js +62 -0
- package/api/telnyx/telnyxMessagingProfileGet.js +59 -0
- package/api/telnyx/telnyxMessagingProfileUpdate.js +68 -0
- package/api/telnyx/telnyxMessagingProfilesGet.js +53 -0
- package/api/telnyx/telnyxNumberLookupGet.js +61 -0
- package/api/telnyx/telnyxNumberOrderCreate.js +64 -0
- package/api/telnyx/telnyxPhoneNumberGet.js +59 -0
- package/api/telnyx/telnyxPhoneNumberUpdate.js +68 -0
- package/api/telnyx/telnyxPhoneNumbersGet.js +53 -0
- package/api/telnyx/telnyxWebhookDeliveriesGet.js +58 -0
- package/api/threeclicks/threeclicksCollectionsGet.js +3 -1
- package/api/threeclicks/threeclicksPurchaseOrderCreate.js +4 -1
- package/api/threeclicks/threeclicksPurchaseOrderCreateBulk.js +4 -1
- package/api/threeclicks/threeclicksPurchaseOrderGet.js +4 -1
- package/api/threeclicks/threeclicksPurchaseOrderQuantitiesGet.js +4 -1
- package/api/threeclicks/threeclicksPurchaseOrderQuantityCreate.js +4 -1
- package/api/threeclicks/threeclicksPurchaseOrderQuantityCreateBulk.js +4 -1
- package/api/threeclicks/threeclicksPurchaseOrderUpdate.js +5 -1
- package/api/threeclicks/threeclicksPurchaseOrdersGet.js +3 -1
- package/api/threeclicks/threeclicksShipmentCreate.js +4 -1
- package/api/threeclicks/threeclicksShipmentGet.js +4 -1
- package/api/threeclicks/threeclicksShipmentOrderAdd.js +5 -1
- package/api/threeclicks/threeclicksShipmentOrderQuantityCreate.js +5 -1
- package/api/threeclicks/threeclicksShipmentQuantityUpdate.js +5 -1
- package/api/threeclicks/threeclicksShipmentStatusUpdate.js +5 -1
- package/api/threeclicks/threeclicksShipmentsGet.js +3 -1
- package/api/threeclicks/threeclicksSignatureCalculate.js +4 -4
- package/api/threeclicks/threeclicksStyleCodesGet.js +4 -1
- package/api/threeclicks/threeclicksStyleColourDelete.js +5 -1
- package/api/threeclicks/threeclicksStyleDelete.js +4 -1
- package/api/threeclicks/threeclicksStylesGet.js +3 -1
- package/api/upstash/upstashDel.js +4 -1
- package/api/upstash/upstashExists.js +4 -1
- package/api/upstash/upstashGet.js +4 -1
- package/api/utils.js +86 -6
- package/api/workable/workableJobsGet.js +3 -1
- package/api/yotpo/yotpoCampaignsGet.js +3 -1
- package/api/yotpo/yotpoCustomersRecentGet.js +3 -1
- package/api/yotpo/yotpoRedemptionOptionsGet.js +3 -1
- package/api/yotpo/yotpoVipTiersGet.js +3 -1
- package/hosting/copyCredsToEnv.js +3 -3
- package/hosting/handlerPaths.js +3 -3
- package/package.json +2 -1
- package/server.js +8 -6
- package/server.utils.js +1 -1
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
const { ArgsWarden, objHasAny } = require('../utils');
|
|
2
|
+
const { credsValidator } = require('../validators');
|
|
3
|
+
const { getGoogleSheets, googleApiCall } = require('../google/google.utils');
|
|
4
|
+
const { googlesheetsSpreadsheetTrim } = require('../google/googlesheetsSpreadsheetTrim');
|
|
5
|
+
|
|
6
|
+
const spreadsheetIdentifierValidator = (spreadsheetIdentifier) => {
|
|
7
|
+
return objHasAny(spreadsheetIdentifier, ['spreadsheetId']);
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const dataValidator = (data) => {
|
|
11
|
+
return objHasAny(data, ['objArray']) && Array.isArray(data.objArray);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const argsWarden = new ArgsWarden([
|
|
15
|
+
['credsPayload', credsValidator],
|
|
16
|
+
['spreadsheetIdentifier', spreadsheetIdentifierValidator],
|
|
17
|
+
['data', dataValidator],
|
|
18
|
+
]);
|
|
19
|
+
|
|
20
|
+
const googlesheetsSpreadsheetSheetAdd = async (
|
|
21
|
+
credsPayload,
|
|
22
|
+
spreadsheetIdentifier,
|
|
23
|
+
data,
|
|
24
|
+
{
|
|
25
|
+
sheetName = String(Date.now()),
|
|
26
|
+
trim = true,
|
|
27
|
+
} = {},
|
|
28
|
+
) => {
|
|
29
|
+
|
|
30
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
31
|
+
credsPayload,
|
|
32
|
+
spreadsheetIdentifier,
|
|
33
|
+
data,
|
|
34
|
+
});
|
|
35
|
+
if (rejectResponse) {
|
|
36
|
+
return rejectResponse;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const { spreadsheetId } = spreadsheetIdentifier;
|
|
40
|
+
const { objArray } = data;
|
|
41
|
+
|
|
42
|
+
const { client, error } = await getGoogleSheets(credsPayload);
|
|
43
|
+
|
|
44
|
+
if (error) {
|
|
45
|
+
return error;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const allKeys = new Set();
|
|
49
|
+
for (const obj of objArray) {
|
|
50
|
+
if (obj && typeof obj === 'object') {
|
|
51
|
+
Object.keys(obj).forEach((key) => allKeys.add(key));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const headers = Array.from(allKeys);
|
|
55
|
+
|
|
56
|
+
if (!headers.length) {
|
|
57
|
+
return {
|
|
58
|
+
ok: false,
|
|
59
|
+
error: {
|
|
60
|
+
code: 'EMPTY_OBJ_ARRAY',
|
|
61
|
+
message: 'objArray contains no valid objects with keys',
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const values = [
|
|
67
|
+
headers,
|
|
68
|
+
...objArray.map((obj) => {
|
|
69
|
+
return headers.map((header) => {
|
|
70
|
+
const value = obj?.[header];
|
|
71
|
+
return value === null || value === undefined ? '' : value;
|
|
72
|
+
});
|
|
73
|
+
}),
|
|
74
|
+
];
|
|
75
|
+
|
|
76
|
+
const batchUpdateResponse = await googleApiCall(() => client.spreadsheets.batchUpdate({
|
|
77
|
+
spreadsheetId,
|
|
78
|
+
requestBody: {
|
|
79
|
+
requests: [
|
|
80
|
+
{
|
|
81
|
+
addSheet: {
|
|
82
|
+
properties: {
|
|
83
|
+
title: String(sheetName),
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
}));
|
|
90
|
+
|
|
91
|
+
if (!batchUpdateResponse.ok) {
|
|
92
|
+
return batchUpdateResponse;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const newSheetId = batchUpdateResponse.data.replies[0].addSheet.properties.sheetId;
|
|
96
|
+
|
|
97
|
+
const updateResponse = await googleApiCall(() => client.spreadsheets.values.update({
|
|
98
|
+
spreadsheetId,
|
|
99
|
+
range: `${ sheetName }!A1`,
|
|
100
|
+
valueInputOption: 'RAW',
|
|
101
|
+
requestBody: {
|
|
102
|
+
values,
|
|
103
|
+
},
|
|
104
|
+
}));
|
|
105
|
+
|
|
106
|
+
if (!updateResponse.ok) {
|
|
107
|
+
return updateResponse;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (trim) {
|
|
111
|
+
googlesheetsSpreadsheetTrim(
|
|
112
|
+
credsPayload,
|
|
113
|
+
spreadsheetIdentifier,
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const sheetUrl = `https://docs.google.com/spreadsheets/d/${ spreadsheetId }/edit#gid=${ newSheetId }`;
|
|
118
|
+
|
|
119
|
+
return {
|
|
120
|
+
ok: true,
|
|
121
|
+
data: {
|
|
122
|
+
sheetId: newSheetId,
|
|
123
|
+
sheetName: String(sheetName),
|
|
124
|
+
sheetUrl,
|
|
125
|
+
rowsAdded: values.length,
|
|
126
|
+
columnsAdded: headers.length,
|
|
127
|
+
updateResponse: updateResponse.data,
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const funcApiConfig = {
|
|
133
|
+
argsWarden,
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
module.exports = {
|
|
137
|
+
googlesheetsSpreadsheetSheetAdd,
|
|
138
|
+
funcApiConfig,
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
/*
|
|
142
|
+
curl -X POST "http://localhost:8000/googlesheetsSpreadsheetSheetAdd" \
|
|
143
|
+
-H "Content-Type: application/json" \
|
|
144
|
+
-d '{
|
|
145
|
+
"credsPayload": { "credsPath": "google" },
|
|
146
|
+
"spreadsheetIdentifier": { "spreadsheetId": "ABC123" },
|
|
147
|
+
"data": { "objArray": [{ "fruit": "apple", "colour": "red" }] },
|
|
148
|
+
"options": { "sheetName": "Fruits" }
|
|
149
|
+
}'
|
|
150
|
+
*/
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
const { ArgsWarden, objHasAny } = require('../utils');
|
|
2
|
+
const { credsValidator } = require('../validators');
|
|
3
|
+
const { getGoogleSheets, googleApiCall } = require('../google/google.utils');
|
|
4
|
+
|
|
5
|
+
const spreadsheetIdentifierValidator = (spreadsheetIdentifier) => {
|
|
6
|
+
return objHasAny(spreadsheetIdentifier, ['spreadsheetId']);
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const sheetIdentifierValidator = (sheetIdentifier) => {
|
|
10
|
+
return objHasAny(sheetIdentifier, ['sheetName', 'sheetId', 'sheetIndex']);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const argsWarden = new ArgsWarden([
|
|
14
|
+
['credsPayload', credsValidator],
|
|
15
|
+
['spreadsheetIdentifier', spreadsheetIdentifierValidator],
|
|
16
|
+
['sheetIdentifier', sheetIdentifierValidator],
|
|
17
|
+
]);
|
|
18
|
+
|
|
19
|
+
const googlesheetsSpreadsheetSheetGetData = async (
|
|
20
|
+
credsPayload,
|
|
21
|
+
spreadsheetIdentifier,
|
|
22
|
+
sheetIdentifier,
|
|
23
|
+
{
|
|
24
|
+
} = {},
|
|
25
|
+
) => {
|
|
26
|
+
|
|
27
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
28
|
+
credsPayload,
|
|
29
|
+
spreadsheetIdentifier,
|
|
30
|
+
sheetIdentifier,
|
|
31
|
+
});
|
|
32
|
+
if (rejectResponse) {
|
|
33
|
+
return rejectResponse;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const { spreadsheetId } = spreadsheetIdentifier;
|
|
37
|
+
const {
|
|
38
|
+
sheetName,
|
|
39
|
+
sheetId,
|
|
40
|
+
sheetIndex,
|
|
41
|
+
} = sheetIdentifier;
|
|
42
|
+
|
|
43
|
+
const { client, error } = await getGoogleSheets(credsPayload);
|
|
44
|
+
|
|
45
|
+
if (error) {
|
|
46
|
+
return error;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const spreadsheetResponse = await googleApiCall(() => client.spreadsheets.get({
|
|
50
|
+
spreadsheetId,
|
|
51
|
+
}));
|
|
52
|
+
|
|
53
|
+
if (!spreadsheetResponse.ok) {
|
|
54
|
+
return spreadsheetResponse;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const sheetsArray = spreadsheetResponse.data?.sheets;
|
|
58
|
+
|
|
59
|
+
if (!sheetsArray?.length) {
|
|
60
|
+
return {
|
|
61
|
+
ok: false,
|
|
62
|
+
error: {
|
|
63
|
+
code: 'NO_SHEETS',
|
|
64
|
+
message: 'No sheets found in spreadsheet',
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
let resolvedSheetName = sheetName;
|
|
70
|
+
|
|
71
|
+
if (!resolvedSheetName) {
|
|
72
|
+
if (sheetId !== undefined) {
|
|
73
|
+
const sheet = sheetsArray.find((s) => s.properties.sheetId === sheetId);
|
|
74
|
+
if (!sheet) {
|
|
75
|
+
return {
|
|
76
|
+
ok: false,
|
|
77
|
+
error: {
|
|
78
|
+
code: 'SHEET_NOT_FOUND',
|
|
79
|
+
message: `Sheet with ID ${ sheetId } not found`,
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
resolvedSheetName = sheet.properties.title;
|
|
84
|
+
} else if (sheetIndex !== undefined) {
|
|
85
|
+
if (sheetIndex < 0 || sheetIndex >= sheetsArray.length) {
|
|
86
|
+
return {
|
|
87
|
+
ok: false,
|
|
88
|
+
error: {
|
|
89
|
+
code: 'SHEET_INDEX_OUT_OF_RANGE',
|
|
90
|
+
message: `Sheet index ${ sheetIndex } is out of range (0-${ sheetsArray.length - 1 })`,
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
resolvedSheetName = sheetsArray[sheetIndex].properties.title;
|
|
95
|
+
} else {
|
|
96
|
+
resolvedSheetName = sheetsArray[0].properties.title;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const valuesResponse = await googleApiCall(() => client.spreadsheets.values.get({
|
|
101
|
+
spreadsheetId,
|
|
102
|
+
range: `'${ resolvedSheetName }'!A:ZZ`,
|
|
103
|
+
}));
|
|
104
|
+
|
|
105
|
+
if (!valuesResponse.ok) {
|
|
106
|
+
return valuesResponse;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const values = valuesResponse.data?.values;
|
|
110
|
+
|
|
111
|
+
if (!values?.length) {
|
|
112
|
+
return {
|
|
113
|
+
ok: true,
|
|
114
|
+
data: [],
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const headers = values[0] || [];
|
|
119
|
+
|
|
120
|
+
if (!headers.length) {
|
|
121
|
+
return {
|
|
122
|
+
ok: true,
|
|
123
|
+
data: [],
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const dataRows = values.slice(1);
|
|
128
|
+
const data = dataRows.map((row) => {
|
|
129
|
+
const obj = {};
|
|
130
|
+
headers.forEach((header, index) => {
|
|
131
|
+
obj[header] = row[index] !== undefined ? row[index] : '';
|
|
132
|
+
});
|
|
133
|
+
return obj;
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
return {
|
|
137
|
+
ok: true,
|
|
138
|
+
data,
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const funcApiConfig = {
|
|
143
|
+
argsWarden,
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
module.exports = {
|
|
147
|
+
googlesheetsSpreadsheetSheetGetData,
|
|
148
|
+
funcApiConfig,
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
/*
|
|
152
|
+
curl -X POST "http://localhost:8000/googlesheetsSpreadsheetSheetGetData" \
|
|
153
|
+
-H "Content-Type: application/json" \
|
|
154
|
+
-d '{
|
|
155
|
+
"credsPayload": { "credsPath": "google" },
|
|
156
|
+
"spreadsheetIdentifier": { "spreadsheetId": "ABC123" },
|
|
157
|
+
"sheetIdentifier": { "sheetName": "Sheet 1" }
|
|
158
|
+
}'
|
|
159
|
+
*/
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
const { ArgsWarden, objHasAny } = require('../utils');
|
|
2
|
+
const { credsValidator } = require('../validators');
|
|
3
|
+
const { getGoogleSheets, googleApiCall } = require('../google/google.utils');
|
|
4
|
+
|
|
5
|
+
const spreadsheetIdentifierValidator = (spreadsheetIdentifier) => {
|
|
6
|
+
return objHasAny(spreadsheetIdentifier, ['spreadsheetId']);
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const argsWarden = new ArgsWarden([
|
|
10
|
+
['credsPayload', credsValidator],
|
|
11
|
+
['spreadsheetIdentifier', spreadsheetIdentifierValidator],
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
const googlesheetsSpreadsheetTrim = async (
|
|
15
|
+
credsPayload,
|
|
16
|
+
spreadsheetIdentifier,
|
|
17
|
+
{
|
|
18
|
+
} = {},
|
|
19
|
+
) => {
|
|
20
|
+
const { client, error } = await getGoogleSheets(credsPayload);
|
|
21
|
+
|
|
22
|
+
if (error) {
|
|
23
|
+
return error;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const spreadsheetResponse = await googleApiCall(() => client.spreadsheets.get({
|
|
27
|
+
spreadsheetId,
|
|
28
|
+
}));
|
|
29
|
+
|
|
30
|
+
if (!spreadsheetResponse.ok) {
|
|
31
|
+
return spreadsheetResponse;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const sheetsArray = spreadsheetResponse.data?.sheets;
|
|
35
|
+
|
|
36
|
+
if (!sheetsArray?.length) {
|
|
37
|
+
return {
|
|
38
|
+
ok: true,
|
|
39
|
+
data: {
|
|
40
|
+
message: 'No sheets found in spreadsheet',
|
|
41
|
+
trimmed: [],
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const sheetsToProcess = sheetsArray
|
|
47
|
+
.map((sheet) => {
|
|
48
|
+
const { properties } = sheet;
|
|
49
|
+
const { sheetId, title: sheetTitle, gridProperties } = properties;
|
|
50
|
+
const { rowCount, columnCount } = gridProperties || {};
|
|
51
|
+
|
|
52
|
+
if (!rowCount || !columnCount) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
sheetId,
|
|
58
|
+
sheetTitle,
|
|
59
|
+
rowCount,
|
|
60
|
+
columnCount,
|
|
61
|
+
};
|
|
62
|
+
})
|
|
63
|
+
.filter(Boolean);
|
|
64
|
+
|
|
65
|
+
if (!sheetsToProcess.length) {
|
|
66
|
+
return {
|
|
67
|
+
ok: true,
|
|
68
|
+
data: {
|
|
69
|
+
message: 'No sheets with valid grid properties found',
|
|
70
|
+
sheetsProcessed: sheetsArray.length,
|
|
71
|
+
sheetsTrimmed: 0,
|
|
72
|
+
sheetResults: [],
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const batchValuesResponse = await googleApiCall(() => client.spreadsheets.values.batchGet({
|
|
78
|
+
spreadsheetId,
|
|
79
|
+
ranges: sheetsToProcess.map((sheet) => `${ sheet.sheetTitle }!A:ZZ`),
|
|
80
|
+
}));
|
|
81
|
+
|
|
82
|
+
if (!batchValuesResponse.ok) {
|
|
83
|
+
return batchValuesResponse;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const { valueRanges } = batchValuesResponse.data;
|
|
87
|
+
|
|
88
|
+
const trimRequests = [];
|
|
89
|
+
const sheetResults = [];
|
|
90
|
+
|
|
91
|
+
for (let i = 0; i < sheetsToProcess.length; i++) {
|
|
92
|
+
const sheet = sheetsToProcess[i];
|
|
93
|
+
const { sheetId, sheetTitle, rowCount, columnCount } = sheet;
|
|
94
|
+
const valueRange = valueRanges[i];
|
|
95
|
+
const { values } = valueRange || {};
|
|
96
|
+
|
|
97
|
+
if (!values || values.length === 0) {
|
|
98
|
+
if (rowCount > 1) {
|
|
99
|
+
trimRequests.push({
|
|
100
|
+
deleteDimension: {
|
|
101
|
+
range: {
|
|
102
|
+
sheetId,
|
|
103
|
+
dimension: 'ROWS',
|
|
104
|
+
startIndex: 1,
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
if (columnCount > 1) {
|
|
110
|
+
trimRequests.push({
|
|
111
|
+
deleteDimension: {
|
|
112
|
+
range: {
|
|
113
|
+
sheetId,
|
|
114
|
+
dimension: 'COLUMNS',
|
|
115
|
+
startIndex: 1,
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
if (rowCount > 1 || columnCount > 1) {
|
|
121
|
+
sheetResults.push({
|
|
122
|
+
sheetTitle,
|
|
123
|
+
sheetId,
|
|
124
|
+
trimmed: true,
|
|
125
|
+
originalRows: rowCount,
|
|
126
|
+
originalColumns: columnCount,
|
|
127
|
+
newRows: 1,
|
|
128
|
+
newColumns: 1,
|
|
129
|
+
});
|
|
130
|
+
} else {
|
|
131
|
+
sheetResults.push({
|
|
132
|
+
sheetTitle,
|
|
133
|
+
sheetId,
|
|
134
|
+
trimmed: false,
|
|
135
|
+
message: 'No trimming needed',
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
let maxRows = values.length;
|
|
142
|
+
let maxCols = 0;
|
|
143
|
+
for (const row of values) {
|
|
144
|
+
if (row && row.length > maxCols) {
|
|
145
|
+
maxCols = row.length;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
maxRows = Math.max(1, maxRows);
|
|
150
|
+
maxCols = Math.max(1, maxCols);
|
|
151
|
+
|
|
152
|
+
if (rowCount > maxRows) {
|
|
153
|
+
trimRequests.push({
|
|
154
|
+
deleteDimension: {
|
|
155
|
+
range: {
|
|
156
|
+
sheetId,
|
|
157
|
+
dimension: 'ROWS',
|
|
158
|
+
startIndex: maxRows,
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (columnCount > maxCols) {
|
|
165
|
+
trimRequests.push({
|
|
166
|
+
deleteDimension: {
|
|
167
|
+
range: {
|
|
168
|
+
sheetId,
|
|
169
|
+
dimension: 'COLUMNS',
|
|
170
|
+
startIndex: maxCols,
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (rowCount > maxRows || columnCount > maxCols) {
|
|
177
|
+
sheetResults.push({
|
|
178
|
+
sheetTitle,
|
|
179
|
+
sheetId,
|
|
180
|
+
trimmed: true,
|
|
181
|
+
originalRows: rowCount,
|
|
182
|
+
originalColumns: columnCount,
|
|
183
|
+
newRows: maxRows,
|
|
184
|
+
newColumns: maxCols,
|
|
185
|
+
});
|
|
186
|
+
} else {
|
|
187
|
+
sheetResults.push({
|
|
188
|
+
sheetTitle,
|
|
189
|
+
sheetId,
|
|
190
|
+
trimmed: false,
|
|
191
|
+
message: 'No trimming needed',
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
let batchUpdateResult = null;
|
|
197
|
+
if (trimRequests.length > 0) {
|
|
198
|
+
const batchUpdateResponse = await googleApiCall(() => client.spreadsheets.batchUpdate({
|
|
199
|
+
spreadsheetId,
|
|
200
|
+
requestBody: {
|
|
201
|
+
requests: trimRequests,
|
|
202
|
+
},
|
|
203
|
+
}));
|
|
204
|
+
|
|
205
|
+
if (!batchUpdateResponse.ok) {
|
|
206
|
+
return batchUpdateResponse;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
batchUpdateResult = batchUpdateResponse.data;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return {
|
|
213
|
+
ok: true,
|
|
214
|
+
data: {
|
|
215
|
+
sheetsProcessed: sheetsArray.length,
|
|
216
|
+
sheetsTrimmed: sheetResults.filter((s) => s.trimmed).length,
|
|
217
|
+
sheetResults,
|
|
218
|
+
batchUpdateResult,
|
|
219
|
+
},
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
const funcApiConfig = {
|
|
224
|
+
argsWarden,
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
module.exports = {
|
|
228
|
+
googlesheetsSpreadsheetTrim,
|
|
229
|
+
funcApiConfig,
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
/*
|
|
233
|
+
curl -X POST "http://localhost:8000/googlesheetsSpreadsheetTrim" \
|
|
234
|
+
-H "Content-Type: application/json" \
|
|
235
|
+
-d '{
|
|
236
|
+
"credsPayload": { "credsPath": "google" },
|
|
237
|
+
"spreadsheetIdentifier": { "spreadsheetId": "ABC123" }
|
|
238
|
+
}'
|
|
239
|
+
*/
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Gorgias
|
|
2
|
+
|
|
3
|
+
- [Developer documentation](https://developers.gorgias.com/)
|
|
4
|
+
- [API reference](https://developers.gorgias.com/reference/introduction)
|
|
5
|
+
- [REST API credentials (helpdesk)](https://docs.gorgias.com/en-US/rest-api-208286)
|
|
6
|
+
|
|
7
|
+
Per-helpdesk REST JSON at `https://{subdomain}.gorgias.com/api/` over standard HTTP verbs, using HTTP Basic Auth (account email as username, API key as password) with cursor-based pagination and rate-limit headers.
|
|
@@ -15,7 +15,9 @@ const logiwaAuthGet = async (
|
|
|
15
15
|
} = {},
|
|
16
16
|
) => {
|
|
17
17
|
|
|
18
|
-
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
18
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
19
|
+
credsPayload,
|
|
20
|
+
});
|
|
19
21
|
if (rejectResponse) {
|
|
20
22
|
return rejectResponse;
|
|
21
23
|
}
|
|
@@ -24,7 +24,9 @@ const logiwaInventoriesGet = async (
|
|
|
24
24
|
} = {},
|
|
25
25
|
) => {
|
|
26
26
|
|
|
27
|
-
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
27
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
28
|
+
credsPayload,
|
|
29
|
+
});
|
|
28
30
|
if (rejectResponse) {
|
|
29
31
|
return rejectResponse;
|
|
30
32
|
}
|
|
@@ -33,7 +33,9 @@ const logiwaOrdersGet = async (
|
|
|
33
33
|
} = {},
|
|
34
34
|
) => {
|
|
35
35
|
|
|
36
|
-
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
36
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
37
|
+
credsPayload,
|
|
38
|
+
});
|
|
37
39
|
if (rejectResponse) {
|
|
38
40
|
return rejectResponse;
|
|
39
41
|
}
|
|
@@ -27,7 +27,9 @@ const logiwaProductsGet = async (
|
|
|
27
27
|
} = {},
|
|
28
28
|
) => {
|
|
29
29
|
|
|
30
|
-
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
30
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
31
|
+
credsPayload,
|
|
32
|
+
});
|
|
31
33
|
if (rejectResponse) {
|
|
32
34
|
return rejectResponse;
|
|
33
35
|
}
|
|
@@ -23,7 +23,9 @@ const logiwaReportGetInventorySnapshot = async (
|
|
|
23
23
|
} = {},
|
|
24
24
|
) => {
|
|
25
25
|
|
|
26
|
-
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
26
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
27
|
+
credsPayload,
|
|
28
|
+
});
|
|
27
29
|
if (rejectResponse) {
|
|
28
30
|
return rejectResponse;
|
|
29
31
|
}
|
|
@@ -26,7 +26,9 @@ const logiwaReportGetTotalInventory = async (
|
|
|
26
26
|
} = {},
|
|
27
27
|
) => {
|
|
28
28
|
|
|
29
|
-
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
29
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
30
|
+
credsPayload,
|
|
31
|
+
});
|
|
30
32
|
if (rejectResponse) {
|
|
31
33
|
return rejectResponse;
|
|
32
34
|
}
|
|
@@ -15,7 +15,9 @@ const logiwaWebhooksGet = async (
|
|
|
15
15
|
} = {},
|
|
16
16
|
) => {
|
|
17
17
|
|
|
18
|
-
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
18
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
19
|
+
credsPayload,
|
|
20
|
+
});
|
|
19
21
|
if (rejectResponse) {
|
|
20
22
|
return rejectResponse;
|
|
21
23
|
}
|
|
@@ -13,7 +13,9 @@ const loopAllowlistItemsGet = async (
|
|
|
13
13
|
} = {},
|
|
14
14
|
) => {
|
|
15
15
|
|
|
16
|
-
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
16
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
17
|
+
credsPayload,
|
|
18
|
+
});
|
|
17
19
|
if (rejectResponse) {
|
|
18
20
|
return rejectResponse;
|
|
19
21
|
}
|
|
@@ -13,7 +13,9 @@ const loopBlocklistItemsGet = async (
|
|
|
13
13
|
} = {},
|
|
14
14
|
) => {
|
|
15
15
|
|
|
16
|
-
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
16
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
17
|
+
credsPayload,
|
|
18
|
+
});
|
|
17
19
|
if (rejectResponse) {
|
|
18
20
|
return rejectResponse;
|
|
19
21
|
}
|
|
@@ -13,7 +13,9 @@ const loopDestinationsGet = async (
|
|
|
13
13
|
} = {},
|
|
14
14
|
) => {
|
|
15
15
|
|
|
16
|
-
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
16
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
17
|
+
credsPayload,
|
|
18
|
+
});
|
|
17
19
|
if (rejectResponse) {
|
|
18
20
|
return rejectResponse;
|
|
19
21
|
}
|
|
@@ -13,7 +13,9 @@ const loopReturnsGet = async (
|
|
|
13
13
|
} = {},
|
|
14
14
|
) => {
|
|
15
15
|
|
|
16
|
-
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
16
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
17
|
+
credsPayload,
|
|
18
|
+
});
|
|
17
19
|
if (rejectResponse) {
|
|
18
20
|
return rejectResponse;
|
|
19
21
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Notion
|
|
2
|
+
|
|
3
|
+
- [Developer documentation](https://developers.notion.com/)
|
|
4
|
+
- [Authorization](https://developers.notion.com/docs/authorization)
|
|
5
|
+
|
|
6
|
+
REST JSON at `https://api.notion.com/v1` scoped to shared pages/databases via integration tokens, requiring `Authorization: Bearer` plus a dated `Notion-Version` header on every request.
|