**What** - Add workflow + step for detaching sales channels from pub API keys - Tweak linking error message to be more helpful - Add `removeRemoteLink` step to delete API key workflow
80 lines
1.7 KiB
TypeScript
80 lines
1.7 KiB
TypeScript
import { Modules } from "@medusajs/modules-sdk"
|
|
import { composeLinkName } from "./utils"
|
|
|
|
export const LINKS = {
|
|
ProductVariantInventoryItem: composeLinkName(
|
|
Modules.PRODUCT,
|
|
"variant_id",
|
|
Modules.INVENTORY,
|
|
"inventory_item_id"
|
|
),
|
|
ProductVariantPriceSet: composeLinkName(
|
|
Modules.PRODUCT,
|
|
"variant_id",
|
|
Modules.PRICING,
|
|
"price_set_id"
|
|
),
|
|
ShippingOptionPriceSet: composeLinkName(
|
|
Modules.FULFILLMENT,
|
|
"shipping_option_id",
|
|
Modules.PRICING,
|
|
"price_set_id"
|
|
),
|
|
CartPaymentCollection: composeLinkName(
|
|
Modules.CART,
|
|
"cart_id",
|
|
Modules.PAYMENT,
|
|
"payment_collection_id"
|
|
),
|
|
RegionPaymentProvider: composeLinkName(
|
|
Modules.REGION,
|
|
"region_id",
|
|
Modules.PAYMENT,
|
|
"payment_provider_id"
|
|
),
|
|
CartPromotion: composeLinkName(
|
|
Modules.CART,
|
|
"cart_id",
|
|
Modules.PROMOTION,
|
|
"promotion_id"
|
|
),
|
|
SalesChannelLocation: composeLinkName(
|
|
Modules.SALES_CHANNEL,
|
|
"sales_channel_id",
|
|
Modules.STOCK_LOCATION,
|
|
"location_id"
|
|
),
|
|
FulfillmentSetLocation: composeLinkName(
|
|
Modules.FULFILLMENT,
|
|
"fulfillment_set_id",
|
|
Modules.STOCK_LOCATION,
|
|
"location_id"
|
|
),
|
|
PublishableApiKeySalesChannel: composeLinkName(
|
|
Modules.API_KEY,
|
|
"api_key_id",
|
|
Modules.SALES_CHANNEL,
|
|
"sales_channel_id"
|
|
),
|
|
ProductSalesChannel: composeLinkName(
|
|
Modules.PRODUCT,
|
|
"product_id",
|
|
Modules.SALES_CHANNEL,
|
|
"sales_channel_id"
|
|
),
|
|
|
|
// Internal services
|
|
ProductShippingProfile: composeLinkName(
|
|
Modules.PRODUCT,
|
|
"variant_id",
|
|
"shippingProfileService",
|
|
"profile_id"
|
|
),
|
|
OrderSalesChannel: composeLinkName(
|
|
"orderService",
|
|
"order_id",
|
|
Modules.SALES_CHANNEL,
|
|
"sales_channel_id"
|
|
),
|
|
}
|