@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
package/.creds.yml.sample
CHANGED
|
@@ -69,3 +69,37 @@ threeclicks:
|
|
|
69
69
|
API_KEY: _______________________________
|
|
70
70
|
API_SECRET: ____________________________
|
|
71
71
|
API_DOMAIN: g40-server.instance.3clickscloud.com
|
|
72
|
+
|
|
73
|
+
printify:
|
|
74
|
+
API_KEY: _______________________________
|
|
75
|
+
|
|
76
|
+
etsy:
|
|
77
|
+
API_KEY: _______________________________
|
|
78
|
+
SHARED_SECRET: _________________________
|
|
79
|
+
|
|
80
|
+
clickup:
|
|
81
|
+
API_KEY: pk________________________________
|
|
82
|
+
|
|
83
|
+
asana:
|
|
84
|
+
ACCESS_TOKEN: __________________________
|
|
85
|
+
|
|
86
|
+
notion:
|
|
87
|
+
API_KEY: secret________________________________
|
|
88
|
+
|
|
89
|
+
discord:
|
|
90
|
+
BOT_TOKEN: ______________________________
|
|
91
|
+
|
|
92
|
+
telnyx:
|
|
93
|
+
API_KEY: KEY__________________________________
|
|
94
|
+
|
|
95
|
+
figma:
|
|
96
|
+
API_KEY: figd________________________________
|
|
97
|
+
|
|
98
|
+
pipe17:
|
|
99
|
+
API_KEY: ____________________________________
|
|
100
|
+
sandbox:
|
|
101
|
+
API_KEY: ____________________________________
|
|
102
|
+
|
|
103
|
+
google:
|
|
104
|
+
SERVICE_ACCOUNT_JSON:
|
|
105
|
+
...
|
package/AGENTS.md
CHANGED
|
@@ -12,6 +12,11 @@ Notes for AI assistants working in this directory. **Read this file at the start
|
|
|
12
12
|
- If you make a new .env or .creds.yml variable, update the correlating .sample file.
|
|
13
13
|
- In Shopify, don't normalise and take gids as inputs if you can just take the id - the non-gid number - instead.
|
|
14
14
|
- Use trailing commas wherever possible, for future git diff readability.
|
|
15
|
+
- Each platform gets its own directory, within which {platform}.constants.js holds constant values like a fixed API base URL or the max objects an API will return per page, docs.md links to documentation and briefly describes the API shape and auth, {platform}.utils.js provides a FetchClient to perform http requests, and the other files are mostly flat functions like {platform}ThingDo.js. If needed, {platform}Get.js can provide a paginated get function for reuse in e.g. {platform}ThingsGet.js.
|
|
16
|
+
- Do not deviate from the project's existing patterns unless you ask the user first. This includes nested structures, use of libraries, and layout of functions.
|
|
17
|
+
- Refer to _example.js files for reference on how functions are laid out, e.g. use of argsWarden.
|
|
18
|
+
- If other functions in the platform use fetchClient as passed through options, support it as well.
|
|
19
|
+
- skim an existing platform of the same shape before considering inventing a new pattern.
|
|
15
20
|
|
|
16
21
|
## API clients
|
|
17
22
|
- Base URLs for platform clients should live in `{platform}.constants.js`, not creds, if they are static for all users of the API.
|
|
@@ -11,9 +11,9 @@ const excludedDirs = new Set([
|
|
|
11
11
|
'node_modules',
|
|
12
12
|
]);
|
|
13
13
|
|
|
14
|
-
const
|
|
14
|
+
const normalisePath = (dirPath) => dirPath.replace(/\/$/, '');
|
|
15
15
|
|
|
16
|
-
const isMineralCwd = () =>
|
|
16
|
+
const isMineralCwd = () => normalisePath(process.cwd()) === normalisePath(mineralRoot);
|
|
17
17
|
|
|
18
18
|
const getContext = () => {
|
|
19
19
|
const inMineral = isMineralCwd();
|
|
@@ -192,7 +192,7 @@ const sortExampleFiles = (exampleFiles) => {
|
|
|
192
192
|
});
|
|
193
193
|
};
|
|
194
194
|
|
|
195
|
-
const
|
|
195
|
+
const normaliseTemplateArg = (templateArg) => {
|
|
196
196
|
if (!templateArg) {
|
|
197
197
|
return null;
|
|
198
198
|
}
|
|
@@ -227,13 +227,13 @@ const findWorkspaceTemplate = (exampleFiles, templateArg) => {
|
|
|
227
227
|
return directMatch;
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
const
|
|
231
|
-
const filenameMatches = exampleFiles.filter(file => file.filename ===
|
|
230
|
+
const normalisedFilename = normaliseTemplateArg(templateArg);
|
|
231
|
+
const filenameMatches = exampleFiles.filter(file => file.filename === normalisedFilename);
|
|
232
232
|
|
|
233
233
|
if (templateArg.includes('/')) {
|
|
234
234
|
const [ prefix, suffix ] = templateArg.split('/');
|
|
235
|
-
const
|
|
236
|
-
const prefixedMatch = exampleFiles.find(file => file.relativePath === `${ prefix }/${
|
|
235
|
+
const normalisedSuffix = normaliseTemplateArg(suffix);
|
|
236
|
+
const prefixedMatch = exampleFiles.find(file => file.relativePath === `${ prefix }/${ normalisedSuffix }`);
|
|
237
237
|
|
|
238
238
|
if (prefixedMatch) {
|
|
239
239
|
return prefixedMatch;
|
|
@@ -244,7 +244,7 @@ const findWorkspaceTemplate = (exampleFiles, templateArg) => {
|
|
|
244
244
|
return filenameMatches[0];
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
-
const suffixMatches = exampleFiles.filter(file => file.relativePath.endsWith(`/${
|
|
247
|
+
const suffixMatches = exampleFiles.filter(file => file.relativePath.endsWith(`/${ normalisedFilename }`));
|
|
248
248
|
|
|
249
249
|
if (suffixMatches.length === 1) {
|
|
250
250
|
return suffixMatches[0];
|
|
@@ -280,24 +280,24 @@ const resolveTemplateFromArg = async ({
|
|
|
280
280
|
return rootExampleJsPath;
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
-
const
|
|
283
|
+
const normalisedFilename = normaliseTemplateArg(templateArg);
|
|
284
284
|
|
|
285
285
|
const matchInDir = exampleFiles.find(file => {
|
|
286
|
-
return file.filename ===
|
|
286
|
+
return file.filename === normalisedFilename
|
|
287
287
|
|| file.displayName === templateArg
|
|
288
|
-
|| file.displayName ===
|
|
288
|
+
|| file.displayName === normalisedFilename;
|
|
289
289
|
});
|
|
290
290
|
|
|
291
291
|
if (matchInDir) {
|
|
292
292
|
return matchInDir.fullPath;
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
if (
|
|
295
|
+
if (normalisedFilename === '_example.js') {
|
|
296
296
|
await fs.access(rootExampleJsPath);
|
|
297
297
|
return rootExampleJsPath;
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
-
throw new Error(`Template not found: ${ templateArg } (looked for ${
|
|
300
|
+
throw new Error(`Template not found: ${ templateArg } (looked for ${ normalisedFilename } in api/${ dir })`);
|
|
301
301
|
};
|
|
302
302
|
|
|
303
303
|
const scriptFileContents = async (name, selectedTemplate) => {
|
|
@@ -322,7 +322,7 @@ const getDirs = async (targetApiDirectory) => {
|
|
|
322
322
|
}
|
|
323
323
|
};
|
|
324
324
|
|
|
325
|
-
const
|
|
325
|
+
const normaliseDirArg = (dirArg) => {
|
|
326
326
|
if (!dirArg || dirArg === '.' || dirArg === 'api') {
|
|
327
327
|
return '';
|
|
328
328
|
}
|
|
@@ -331,13 +331,13 @@ const normalizeDirArg = (dirArg) => {
|
|
|
331
331
|
};
|
|
332
332
|
|
|
333
333
|
const resolveDirArg = ({ dirArg, dirs, inMineral, name }) => {
|
|
334
|
-
const
|
|
334
|
+
const normalisedDir = normaliseDirArg(dirArg);
|
|
335
335
|
|
|
336
|
-
if (dirs.includes(
|
|
337
|
-
return
|
|
336
|
+
if (dirs.includes(normalisedDir)) {
|
|
337
|
+
return normalisedDir;
|
|
338
338
|
}
|
|
339
339
|
|
|
340
|
-
if (!inMineral && dirs.length === 0 &&
|
|
340
|
+
if (!inMineral && dirs.length === 0 && normalisedDir === '') {
|
|
341
341
|
return '';
|
|
342
342
|
}
|
|
343
343
|
|
|
@@ -349,7 +349,7 @@ const resolveDirArg = ({ dirArg, dirs, inMineral, name }) => {
|
|
|
349
349
|
return null;
|
|
350
350
|
}
|
|
351
351
|
|
|
352
|
-
return
|
|
352
|
+
return normalisedDir;
|
|
353
353
|
};
|
|
354
354
|
|
|
355
355
|
const buildFuncName = (dir, name) => {
|
package/api/_example.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const { credsValidator } = require('
|
|
2
|
-
const { ArgsWarden } = require('
|
|
1
|
+
const { credsValidator } = require('../validators');
|
|
2
|
+
const { ArgsWarden } = require('../utils');
|
|
3
3
|
|
|
4
4
|
const argsWarden = new ArgsWarden([
|
|
5
5
|
['credsPayload', credsValidator],
|
|
@@ -12,7 +12,10 @@ const FUNC = async (
|
|
|
12
12
|
options = {},
|
|
13
13
|
) => {
|
|
14
14
|
|
|
15
|
-
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
15
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
16
|
+
credsPayload,
|
|
17
|
+
arg,
|
|
18
|
+
});
|
|
16
19
|
if (rejectResponse) {
|
|
17
20
|
return rejectResponse;
|
|
18
21
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const { logDeep } = require('../utils');
|
|
2
|
+
|
|
3
|
+
const log = async (req) => {
|
|
4
|
+
const { headers, body } = req;
|
|
5
|
+
logDeep({ headers, body });
|
|
6
|
+
return { ok: true };
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const funcApiConfig = {
|
|
10
|
+
passThroughReq: true,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports = {
|
|
14
|
+
log,
|
|
15
|
+
funcApiConfig,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/*
|
|
19
|
+
curl -X POST "http://localhost:8000/log" \
|
|
20
|
+
-H "Content-Type: application/json" \
|
|
21
|
+
-d '{ "patrick": "star" }'
|
|
22
|
+
*/
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Algolia
|
|
2
|
+
|
|
3
|
+
- [REST API index](https://www.algolia.com/doc/rest-api)
|
|
4
|
+
- [Search API](https://www.algolia.com/doc/rest-api/search)
|
|
5
|
+
- [Search an index](https://www.algolia.com/doc/rest-api/search/search-single-index)
|
|
6
|
+
|
|
7
|
+
Multi-service REST JSON under `https://{applicationId}.algolia.net` (or `-dsn` for Distributed Search Network), authenticated with `x-algolia-application-id` and `x-algolia-api-key` on every request, with `/1/` versioned paths for search, indexing, settings, and related products.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const { ASANA_API_BASE_URL } = require('../asana/asana.constants');
|
|
2
|
+
const { resolveCreds, useBaseUrl } = require('../pipelineSteps');
|
|
3
|
+
const {
|
|
4
|
+
FetchClient,
|
|
5
|
+
fetchClientCommonSteps,
|
|
6
|
+
} = require('../utils');
|
|
7
|
+
|
|
8
|
+
const useAuthHeaders = async (state) => {
|
|
9
|
+
const { requestPayload, context } = state;
|
|
10
|
+
const { creds } = context;
|
|
11
|
+
const { ACCESS_TOKEN } = creds;
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
requestPayload: {
|
|
15
|
+
...requestPayload,
|
|
16
|
+
headers: {
|
|
17
|
+
Accept: 'application/json',
|
|
18
|
+
Authorization: `Bearer ${ ACCESS_TOKEN }`,
|
|
19
|
+
...requestPayload.headers,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const asanaClient = new FetchClient({
|
|
26
|
+
pipeline: [
|
|
27
|
+
resolveCreds,
|
|
28
|
+
useBaseUrl(ASANA_API_BASE_URL),
|
|
29
|
+
useAuthHeaders,
|
|
30
|
+
'fetch',
|
|
31
|
+
fetchClientCommonSteps.exitEarlyOnNotOk,
|
|
32
|
+
],
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
module.exports = {
|
|
36
|
+
asanaClient,
|
|
37
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
// https://developers.asana.com/reference/getuser
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden, Getter } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { asanaClient } = require('../asana/asana.utils');
|
|
6
|
+
const { MAX_PER_PAGE } = require('../asana/asana.constants');
|
|
7
|
+
|
|
8
|
+
const argsWarden = new ArgsWarden([
|
|
9
|
+
['credsPayload', credsValidator],
|
|
10
|
+
['url'],
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
const digResults = (data, resultsKey) => {
|
|
14
|
+
if (resultsKey) {
|
|
15
|
+
return data?.[resultsKey] ?? [];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (Array.isArray(data)) {
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const arrayEntry = Object.entries(data || {}).find(([, value]) => Array.isArray(value));
|
|
23
|
+
return arrayEntry ? arrayEntry[1] : [];
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const asanaGetPacket = async (
|
|
27
|
+
credsPayload,
|
|
28
|
+
url,
|
|
29
|
+
{
|
|
30
|
+
params,
|
|
31
|
+
perPage = MAX_PER_PAGE,
|
|
32
|
+
} = {},
|
|
33
|
+
) => {
|
|
34
|
+
return asanaClient.fetch({
|
|
35
|
+
requestPayload: {
|
|
36
|
+
url,
|
|
37
|
+
params: {
|
|
38
|
+
limit: Math.min(perPage, MAX_PER_PAGE),
|
|
39
|
+
...params,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
context: {
|
|
43
|
+
credsPayload,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const asanaGetPaginator = async (currentParams, response) => {
|
|
49
|
+
const { args, options } = currentParams;
|
|
50
|
+
|
|
51
|
+
if (!response?.ok) {
|
|
52
|
+
return [true];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const nextPage = response?.data?.next_page;
|
|
56
|
+
if (!nextPage?.offset) {
|
|
57
|
+
return [true];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const { params = {} } = options;
|
|
61
|
+
|
|
62
|
+
return [false, {
|
|
63
|
+
args,
|
|
64
|
+
options: {
|
|
65
|
+
...options,
|
|
66
|
+
params: {
|
|
67
|
+
...params,
|
|
68
|
+
offset: nextPage.offset,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
}];
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const asanaGet = async (
|
|
75
|
+
returnGetter,
|
|
76
|
+
|
|
77
|
+
credsPayload,
|
|
78
|
+
url,
|
|
79
|
+
{
|
|
80
|
+
params,
|
|
81
|
+
perPage = MAX_PER_PAGE,
|
|
82
|
+
resultsKey,
|
|
83
|
+
...getterOptions
|
|
84
|
+
} = {},
|
|
85
|
+
) => {
|
|
86
|
+
|
|
87
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
88
|
+
credsPayload,
|
|
89
|
+
url,
|
|
90
|
+
});
|
|
91
|
+
if (rejectResponse) {
|
|
92
|
+
return rejectResponse;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const getter = new Getter(
|
|
96
|
+
{
|
|
97
|
+
args: [credsPayload, url],
|
|
98
|
+
options: {
|
|
99
|
+
params,
|
|
100
|
+
perPage,
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
func: asanaGetPacket,
|
|
105
|
+
digester: (response) => {
|
|
106
|
+
if (!response?.ok) {
|
|
107
|
+
return [];
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (Array.isArray(response.data?.data)) {
|
|
111
|
+
return response.data.data;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return digResults(response.data, resultsKey);
|
|
115
|
+
},
|
|
116
|
+
paginator: asanaGetPaginator,
|
|
117
|
+
...getterOptions,
|
|
118
|
+
},
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
if (returnGetter) {
|
|
122
|
+
return getter;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const data = await getter.run({ returnAll: true });
|
|
126
|
+
|
|
127
|
+
return {
|
|
128
|
+
ok: true,
|
|
129
|
+
data,
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const funcApiConfig = {
|
|
134
|
+
argsWarden,
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
module.exports = {
|
|
138
|
+
asanaGet: (...args) => asanaGet(false, ...args),
|
|
139
|
+
asanaGetter: (...args) => asanaGet(true, ...args),
|
|
140
|
+
funcApiConfig,
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
/*
|
|
144
|
+
curl -X POST "http://localhost:8000/asanaGet" \
|
|
145
|
+
-H "Content-Type: application/json" \
|
|
146
|
+
-d '{
|
|
147
|
+
"credsPayload": { "credsPath": "asana" },
|
|
148
|
+
"url": "/users/me"
|
|
149
|
+
}'
|
|
150
|
+
*/
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Athos (SearchSpring)
|
|
2
|
+
|
|
3
|
+
- [API overview](https://docs.athoscommerce.com/reference/overview)
|
|
4
|
+
- [Search API](https://docs.athoscommerce.com/reference/get-search-results)
|
|
5
|
+
- [Searchspring → Athos migration guide](https://docs.athoscommerce.com/docs/migration-guide-athos)
|
|
6
|
+
|
|
7
|
+
Versioned GET-centric REST JSON on per-site hosts (`https://{siteId}.a.athoscommerce.net/v1`, plus a separate personalization base for recommendations); storefront calls use `siteId` in the subdomain (no API key on the client), while the Indexing API uses HTTP Basic Auth (`siteId` + `secretKey`).
|
|
8
|
+
|
|
9
|
+
Legacy Searchspring URLs used `https://{siteId}.a.searchspring.io/api/...` — see the migration guide for 1:1 path mapping.
|
|
@@ -21,7 +21,9 @@ const bleckmannAsnsGet = async (
|
|
|
21
21
|
} = {},
|
|
22
22
|
) => {
|
|
23
23
|
|
|
24
|
-
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
24
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
25
|
+
credsPayload,
|
|
26
|
+
});
|
|
25
27
|
if (rejectResponse) {
|
|
26
28
|
return rejectResponse;
|
|
27
29
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const { CLICKUP_API_BASE_URL } = require('../clickup/clickup.constants');
|
|
2
|
+
const { resolveCreds, useBaseUrl } = require('../pipelineSteps');
|
|
3
|
+
const {
|
|
4
|
+
FetchClient,
|
|
5
|
+
fetchClientCommonSteps,
|
|
6
|
+
} = require('../utils');
|
|
7
|
+
|
|
8
|
+
const useAuthHeaders = async (state) => {
|
|
9
|
+
const { requestPayload, context } = state;
|
|
10
|
+
const { creds } = context;
|
|
11
|
+
const { API_KEY } = creds;
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
requestPayload: {
|
|
15
|
+
...requestPayload,
|
|
16
|
+
headers: {
|
|
17
|
+
Authorization: API_KEY,
|
|
18
|
+
...requestPayload.headers,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const clickupClient = new FetchClient({
|
|
25
|
+
pipeline: [
|
|
26
|
+
resolveCreds,
|
|
27
|
+
useBaseUrl(CLICKUP_API_BASE_URL),
|
|
28
|
+
useAuthHeaders,
|
|
29
|
+
'fetch',
|
|
30
|
+
fetchClientCommonSteps.exitEarlyOnNotOk,
|
|
31
|
+
],
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
module.exports = {
|
|
35
|
+
clickupClient,
|
|
36
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
// https://developer.clickup.com/reference/getauthorizeduser
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden, Getter } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { clickupClient } = require('../clickup/clickup.utils');
|
|
6
|
+
const { MAX_PER_PAGE } = require('../clickup/clickup.constants');
|
|
7
|
+
|
|
8
|
+
const argsWarden = new ArgsWarden([
|
|
9
|
+
['credsPayload', credsValidator],
|
|
10
|
+
['url'],
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
const digResults = (data, resultsKey) => {
|
|
14
|
+
if (resultsKey) {
|
|
15
|
+
return data?.[resultsKey] ?? [];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (Array.isArray(data)) {
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const arrayEntry = Object.entries(data || {}).find(([, value]) => Array.isArray(value));
|
|
23
|
+
return arrayEntry ? arrayEntry[1] : [];
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const clickupGetPacket = async (
|
|
27
|
+
credsPayload,
|
|
28
|
+
url,
|
|
29
|
+
{
|
|
30
|
+
params,
|
|
31
|
+
perPage = MAX_PER_PAGE,
|
|
32
|
+
} = {},
|
|
33
|
+
) => {
|
|
34
|
+
return clickupClient.fetch({
|
|
35
|
+
requestPayload: {
|
|
36
|
+
url,
|
|
37
|
+
params: {
|
|
38
|
+
limit: Math.min(perPage, MAX_PER_PAGE),
|
|
39
|
+
...params,
|
|
40
|
+
page: params?.page ?? 0,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
context: {
|
|
44
|
+
credsPayload,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const clickupGetPaginator = async (currentParams, response) => {
|
|
50
|
+
const { args, options } = currentParams;
|
|
51
|
+
|
|
52
|
+
if (!response?.ok) {
|
|
53
|
+
return [true];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (response.data?.last_page !== false) {
|
|
57
|
+
return [true];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const { params = {} } = options;
|
|
61
|
+
const page = params.page ?? 0;
|
|
62
|
+
|
|
63
|
+
return [false, {
|
|
64
|
+
args,
|
|
65
|
+
options: {
|
|
66
|
+
...options,
|
|
67
|
+
params: {
|
|
68
|
+
...params,
|
|
69
|
+
page: page + 1,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
}];
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const clickupGet = async (
|
|
76
|
+
returnGetter,
|
|
77
|
+
|
|
78
|
+
credsPayload,
|
|
79
|
+
url,
|
|
80
|
+
{
|
|
81
|
+
params,
|
|
82
|
+
perPage = MAX_PER_PAGE,
|
|
83
|
+
resultsKey,
|
|
84
|
+
...getterOptions
|
|
85
|
+
} = {},
|
|
86
|
+
) => {
|
|
87
|
+
|
|
88
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
89
|
+
credsPayload,
|
|
90
|
+
url,
|
|
91
|
+
});
|
|
92
|
+
if (rejectResponse) {
|
|
93
|
+
return rejectResponse;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const getter = new Getter(
|
|
97
|
+
{
|
|
98
|
+
args: [credsPayload, url],
|
|
99
|
+
options: {
|
|
100
|
+
params,
|
|
101
|
+
perPage,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
func: clickupGetPacket,
|
|
106
|
+
digester: (response) => {
|
|
107
|
+
if (!response?.ok) {
|
|
108
|
+
return [];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return digResults(response.data, resultsKey);
|
|
112
|
+
},
|
|
113
|
+
paginator: clickupGetPaginator,
|
|
114
|
+
...getterOptions,
|
|
115
|
+
},
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
if (returnGetter) {
|
|
119
|
+
return getter;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const data = await getter.run({ returnAll: true });
|
|
123
|
+
|
|
124
|
+
return {
|
|
125
|
+
ok: true,
|
|
126
|
+
data,
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const funcApiConfig = {
|
|
131
|
+
argsWarden,
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
module.exports = {
|
|
135
|
+
clickupGet: (...args) => clickupGet(false, ...args),
|
|
136
|
+
clickupGetter: (...args) => clickupGet(true, ...args),
|
|
137
|
+
funcApiConfig,
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
/*
|
|
141
|
+
curl -X POST "http://localhost:8000/clickupGet" \
|
|
142
|
+
-H "Content-Type: application/json" \
|
|
143
|
+
-d '{
|
|
144
|
+
"credsPayload": { "credsPath": "clickup" },
|
|
145
|
+
"url": "/team",
|
|
146
|
+
"options": {
|
|
147
|
+
"resultsKey": "teams"
|
|
148
|
+
}
|
|
149
|
+
}'
|
|
150
|
+
*/
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# ClickUp
|
|
2
|
+
|
|
3
|
+
- [Developer documentation](https://developer.clickup.com/)
|
|
4
|
+
- [Authentication](https://developer.clickup.com/docs/authentication)
|
|
5
|
+
|
|
6
|
+
Versioned REST JSON under `https://api.clickup.com/api/v2`, authenticated with a personal `pk_` token or OAuth access token in the `Authorization` header (personal tokens are sent raw, without a `Bearer` prefix).
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const { DISCORD_API_BASE_URL } = require('../discord/discord.constants');
|
|
2
|
+
const { resolveCreds, useBaseUrl } = require('../pipelineSteps');
|
|
3
|
+
const {
|
|
4
|
+
FetchClient,
|
|
5
|
+
fetchClientCommonSteps,
|
|
6
|
+
} = require('../utils');
|
|
7
|
+
|
|
8
|
+
const useAuthHeaders = async (state) => {
|
|
9
|
+
const { requestPayload, context } = state;
|
|
10
|
+
const { creds } = context;
|
|
11
|
+
const { BOT_TOKEN } = creds;
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
requestPayload: {
|
|
15
|
+
...requestPayload,
|
|
16
|
+
headers: {
|
|
17
|
+
Authorization: `Bot ${ BOT_TOKEN }`,
|
|
18
|
+
...requestPayload.headers,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const discordClient = new FetchClient({
|
|
25
|
+
pipeline: [
|
|
26
|
+
resolveCreds,
|
|
27
|
+
useBaseUrl(DISCORD_API_BASE_URL),
|
|
28
|
+
useAuthHeaders,
|
|
29
|
+
'fetch',
|
|
30
|
+
fetchClientCommonSteps.exitEarlyOnNotOk,
|
|
31
|
+
],
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
module.exports = {
|
|
35
|
+
discordClient,
|
|
36
|
+
};
|