@aimee.shop/sdk 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +144 -0
- package/dist/browser/browser-auth.d.ts +115 -0
- package/dist/browser/browser-auth.d.ts.map +1 -0
- package/dist/browser/browser-auth.js +234 -0
- package/dist/browser/browser-auth.js.map +1 -0
- package/dist/browser/index.d.ts +62 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +69 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/core/auth/api-key.authenticator.d.ts +16 -0
- package/dist/core/auth/api-key.authenticator.d.ts.map +1 -0
- package/dist/core/auth/api-key.authenticator.js +28 -0
- package/dist/core/auth/api-key.authenticator.js.map +1 -0
- package/dist/core/auth/auth-chain.d.ts +33 -0
- package/dist/core/auth/auth-chain.d.ts.map +1 -0
- package/dist/core/auth/auth-chain.js +65 -0
- package/dist/core/auth/auth-chain.js.map +1 -0
- package/dist/core/auth/authenticator.d.ts +19 -0
- package/dist/core/auth/authenticator.d.ts.map +1 -0
- package/dist/core/auth/authenticator.js +2 -0
- package/dist/core/auth/authenticator.js.map +1 -0
- package/dist/core/auth/cognito.authenticator.d.ts +28 -0
- package/dist/core/auth/cognito.authenticator.d.ts.map +1 -0
- package/dist/core/auth/cognito.authenticator.js +89 -0
- package/dist/core/auth/cognito.authenticator.js.map +1 -0
- package/dist/core/auth/index.d.ts +8 -0
- package/dist/core/auth/index.d.ts.map +1 -0
- package/dist/core/auth/index.js +6 -0
- package/dist/core/auth/index.js.map +1 -0
- package/dist/core/auth/interactive.authenticator.d.ts +22 -0
- package/dist/core/auth/interactive.authenticator.d.ts.map +1 -0
- package/dist/core/auth/interactive.authenticator.js +126 -0
- package/dist/core/auth/interactive.authenticator.js.map +1 -0
- package/dist/core/auth/lazy-interactive.authenticator.d.ts +51 -0
- package/dist/core/auth/lazy-interactive.authenticator.d.ts.map +1 -0
- package/dist/core/auth/lazy-interactive.authenticator.js +112 -0
- package/dist/core/auth/lazy-interactive.authenticator.js.map +1 -0
- package/dist/core/auth/token.authenticator.d.ts +20 -0
- package/dist/core/auth/token.authenticator.d.ts.map +1 -0
- package/dist/core/auth/token.authenticator.js +45 -0
- package/dist/core/auth/token.authenticator.js.map +1 -0
- package/dist/core/config.d.ts +72 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +120 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/errors/index.d.ts +101 -0
- package/dist/core/errors/index.d.ts.map +1 -0
- package/dist/core/errors/index.js +119 -0
- package/dist/core/errors/index.js.map +1 -0
- package/dist/core/events/event-envelope.d.ts +34 -0
- package/dist/core/events/event-envelope.d.ts.map +1 -0
- package/dist/core/events/event-envelope.js +2 -0
- package/dist/core/events/event-envelope.js.map +1 -0
- package/dist/core/events/event-names.d.ts +552 -0
- package/dist/core/events/event-names.d.ts.map +1 -0
- package/dist/core/events/event-names.js +593 -0
- package/dist/core/events/event-names.js.map +1 -0
- package/dist/core/events/index.d.ts +4 -0
- package/dist/core/events/index.d.ts.map +1 -0
- package/dist/core/events/index.js +11 -0
- package/dist/core/events/index.js.map +1 -0
- package/dist/core/http-client.d.ts +88 -0
- package/dist/core/http-client.d.ts.map +1 -0
- package/dist/core/http-client.js +293 -0
- package/dist/core/http-client.js.map +1 -0
- package/dist/core/retry.d.ts +48 -0
- package/dist/core/retry.d.ts.map +1 -0
- package/dist/core/retry.js +57 -0
- package/dist/core/retry.js.map +1 -0
- package/dist/core/sdk.d.ts +153 -0
- package/dist/core/sdk.d.ts.map +1 -0
- package/dist/core/sdk.js +327 -0
- package/dist/core/sdk.js.map +1 -0
- package/dist/core/types/address.d.ts +18 -0
- package/dist/core/types/address.d.ts.map +1 -0
- package/dist/core/types/address.js +2 -0
- package/dist/core/types/address.js.map +1 -0
- package/dist/core/types/geo.d.ts +59 -0
- package/dist/core/types/geo.d.ts.map +1 -0
- package/dist/core/types/geo.js +78 -0
- package/dist/core/types/geo.js.map +1 -0
- package/dist/core/types/pagination.d.ts +42 -0
- package/dist/core/types/pagination.d.ts.map +1 -0
- package/dist/core/types/pagination.js +2 -0
- package/dist/core/types/pagination.js.map +1 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/services/core/assets.client.d.ts +520 -0
- package/dist/services/core/assets.client.d.ts.map +1 -0
- package/dist/services/core/assets.client.js +297 -0
- package/dist/services/core/assets.client.js.map +1 -0
- package/dist/services/core/base-resource.d.ts +70 -0
- package/dist/services/core/base-resource.d.ts.map +1 -0
- package/dist/services/core/base-resource.js +97 -0
- package/dist/services/core/base-resource.js.map +1 -0
- package/dist/services/core/cart-messages/cart-messages.client.d.ts +30 -0
- package/dist/services/core/cart-messages/cart-messages.client.d.ts.map +1 -0
- package/dist/services/core/cart-messages/cart-messages.client.js +30 -0
- package/dist/services/core/cart-messages/cart-messages.client.js.map +1 -0
- package/dist/services/core/cart-messages/index.d.ts +4 -0
- package/dist/services/core/cart-messages/index.d.ts.map +1 -0
- package/dist/services/core/cart-messages/index.js +3 -0
- package/dist/services/core/cart-messages/index.js.map +1 -0
- package/dist/services/core/cart-messages/types.d.ts +106 -0
- package/dist/services/core/cart-messages/types.d.ts.map +1 -0
- package/dist/services/core/cart-messages/types.js +6 -0
- package/dist/services/core/cart-messages/types.js.map +1 -0
- package/dist/services/core/carts.client.d.ts +253 -0
- package/dist/services/core/carts.client.d.ts.map +1 -0
- package/dist/services/core/carts.client.js +110 -0
- package/dist/services/core/carts.client.js.map +1 -0
- package/dist/services/core/categories.client.d.ts +105 -0
- package/dist/services/core/categories.client.d.ts.map +1 -0
- package/dist/services/core/categories.client.js +135 -0
- package/dist/services/core/categories.client.js.map +1 -0
- package/dist/services/core/checkout.client.d.ts +414 -0
- package/dist/services/core/checkout.client.d.ts.map +1 -0
- package/dist/services/core/checkout.client.js +153 -0
- package/dist/services/core/checkout.client.js.map +1 -0
- package/dist/services/core/cms/cms.client.d.ts +111 -0
- package/dist/services/core/cms/cms.client.d.ts.map +1 -0
- package/dist/services/core/cms/cms.client.js +148 -0
- package/dist/services/core/cms/cms.client.js.map +1 -0
- package/dist/services/core/cms/collections.client.d.ts +45 -0
- package/dist/services/core/cms/collections.client.d.ts.map +1 -0
- package/dist/services/core/cms/collections.client.js +67 -0
- package/dist/services/core/cms/collections.client.js.map +1 -0
- package/dist/services/core/cms/content-types.client.d.ts +101 -0
- package/dist/services/core/cms/content-types.client.d.ts.map +1 -0
- package/dist/services/core/cms/content-types.client.js +143 -0
- package/dist/services/core/cms/content-types.client.js.map +1 -0
- package/dist/services/core/cms/entries.client.d.ts +187 -0
- package/dist/services/core/cms/entries.client.d.ts.map +1 -0
- package/dist/services/core/cms/entries.client.js +265 -0
- package/dist/services/core/cms/entries.client.js.map +1 -0
- package/dist/services/core/cms/index.d.ts +10 -0
- package/dist/services/core/cms/index.d.ts.map +1 -0
- package/dist/services/core/cms/index.js +10 -0
- package/dist/services/core/cms/index.js.map +1 -0
- package/dist/services/core/cms/media.client.d.ts +63 -0
- package/dist/services/core/cms/media.client.d.ts.map +1 -0
- package/dist/services/core/cms/media.client.js +95 -0
- package/dist/services/core/cms/media.client.js.map +1 -0
- package/dist/services/core/cms/modules.client.d.ts +64 -0
- package/dist/services/core/cms/modules.client.d.ts.map +1 -0
- package/dist/services/core/cms/modules.client.js +88 -0
- package/dist/services/core/cms/modules.client.js.map +1 -0
- package/dist/services/core/cms/navigation.client.d.ts +78 -0
- package/dist/services/core/cms/navigation.client.d.ts.map +1 -0
- package/dist/services/core/cms/navigation.client.js +116 -0
- package/dist/services/core/cms/navigation.client.js.map +1 -0
- package/dist/services/core/cms/public.client.d.ts +64 -0
- package/dist/services/core/cms/public.client.d.ts.map +1 -0
- package/dist/services/core/cms/public.client.js +102 -0
- package/dist/services/core/cms/public.client.js.map +1 -0
- package/dist/services/core/cms/types.d.ts +804 -0
- package/dist/services/core/cms/types.d.ts.map +1 -0
- package/dist/services/core/cms/types.js +43 -0
- package/dist/services/core/cms/types.js.map +1 -0
- package/dist/services/core/customers.client.d.ts +285 -0
- package/dist/services/core/customers.client.d.ts.map +1 -0
- package/dist/services/core/customers.client.js +133 -0
- package/dist/services/core/customers.client.js.map +1 -0
- package/dist/services/core/discounts.client.d.ts +197 -0
- package/dist/services/core/discounts.client.d.ts.map +1 -0
- package/dist/services/core/discounts.client.js +81 -0
- package/dist/services/core/discounts.client.js.map +1 -0
- package/dist/services/core/exports/exports.client.d.ts +55 -0
- package/dist/services/core/exports/exports.client.d.ts.map +1 -0
- package/dist/services/core/exports/exports.client.js +80 -0
- package/dist/services/core/exports/exports.client.js.map +1 -0
- package/dist/services/core/exports/index.d.ts +4 -0
- package/dist/services/core/exports/index.d.ts.map +1 -0
- package/dist/services/core/exports/index.js +3 -0
- package/dist/services/core/exports/index.js.map +1 -0
- package/dist/services/core/exports/types.d.ts +68 -0
- package/dist/services/core/exports/types.d.ts.map +1 -0
- package/dist/services/core/exports/types.js +25 -0
- package/dist/services/core/exports/types.js.map +1 -0
- package/dist/services/core/facets.client.d.ts +127 -0
- package/dist/services/core/facets.client.d.ts.map +1 -0
- package/dist/services/core/facets.client.js +81 -0
- package/dist/services/core/facets.client.js.map +1 -0
- package/dist/services/core/fulfillments.client.d.ts +94 -0
- package/dist/services/core/fulfillments.client.d.ts.map +1 -0
- package/dist/services/core/fulfillments.client.js +66 -0
- package/dist/services/core/fulfillments.client.js.map +1 -0
- package/dist/services/core/inventory/adjustments.client.d.ts +60 -0
- package/dist/services/core/inventory/adjustments.client.d.ts.map +1 -0
- package/dist/services/core/inventory/adjustments.client.js +76 -0
- package/dist/services/core/inventory/adjustments.client.js.map +1 -0
- package/dist/services/core/inventory/index.d.ts +8 -0
- package/dist/services/core/inventory/index.d.ts.map +1 -0
- package/dist/services/core/inventory/index.js +7 -0
- package/dist/services/core/inventory/index.js.map +1 -0
- package/dist/services/core/inventory/inventory.client.d.ts +90 -0
- package/dist/services/core/inventory/inventory.client.d.ts.map +1 -0
- package/dist/services/core/inventory/inventory.client.js +135 -0
- package/dist/services/core/inventory/inventory.client.js.map +1 -0
- package/dist/services/core/inventory/locations.client.d.ts +71 -0
- package/dist/services/core/inventory/locations.client.d.ts.map +1 -0
- package/dist/services/core/inventory/locations.client.js +107 -0
- package/dist/services/core/inventory/locations.client.js.map +1 -0
- package/dist/services/core/inventory/reservations.client.d.ts +58 -0
- package/dist/services/core/inventory/reservations.client.d.ts.map +1 -0
- package/dist/services/core/inventory/reservations.client.js +87 -0
- package/dist/services/core/inventory/reservations.client.js.map +1 -0
- package/dist/services/core/inventory/stock.client.d.ts +74 -0
- package/dist/services/core/inventory/stock.client.d.ts.map +1 -0
- package/dist/services/core/inventory/stock.client.js +113 -0
- package/dist/services/core/inventory/stock.client.js.map +1 -0
- package/dist/services/core/inventory/types.d.ts +337 -0
- package/dist/services/core/inventory/types.d.ts.map +1 -0
- package/dist/services/core/inventory/types.js +2 -0
- package/dist/services/core/inventory/types.js.map +1 -0
- package/dist/services/core/invoices.client.d.ts +92 -0
- package/dist/services/core/invoices.client.d.ts.map +1 -0
- package/dist/services/core/invoices.client.js +68 -0
- package/dist/services/core/invoices.client.js.map +1 -0
- package/dist/services/core/notification-config.client.d.ts +57 -0
- package/dist/services/core/notification-config.client.d.ts.map +1 -0
- package/dist/services/core/notification-config.client.js +41 -0
- package/dist/services/core/notification-config.client.js.map +1 -0
- package/dist/services/core/openai-feed.client.d.ts +90 -0
- package/dist/services/core/openai-feed.client.d.ts.map +1 -0
- package/dist/services/core/openai-feed.client.js +63 -0
- package/dist/services/core/openai-feed.client.js.map +1 -0
- package/dist/services/core/option-types.client.d.ts +119 -0
- package/dist/services/core/option-types.client.d.ts.map +1 -0
- package/dist/services/core/option-types.client.js +81 -0
- package/dist/services/core/option-types.client.js.map +1 -0
- package/dist/services/core/option-values.client.d.ts +72 -0
- package/dist/services/core/option-values.client.d.ts.map +1 -0
- package/dist/services/core/option-values.client.js +64 -0
- package/dist/services/core/option-values.client.js.map +1 -0
- package/dist/services/core/order-edits.client.d.ts +88 -0
- package/dist/services/core/order-edits.client.d.ts.map +1 -0
- package/dist/services/core/order-edits.client.js +62 -0
- package/dist/services/core/order-edits.client.js.map +1 -0
- package/dist/services/core/orders.client.d.ts +284 -0
- package/dist/services/core/orders.client.d.ts.map +1 -0
- package/dist/services/core/orders.client.js +150 -0
- package/dist/services/core/orders.client.js.map +1 -0
- package/dist/services/core/pricing/currencies.client.d.ts +109 -0
- package/dist/services/core/pricing/currencies.client.d.ts.map +1 -0
- package/dist/services/core/pricing/currencies.client.js +145 -0
- package/dist/services/core/pricing/currencies.client.js.map +1 -0
- package/dist/services/core/pricing/customer-groups.client.d.ts +126 -0
- package/dist/services/core/pricing/customer-groups.client.d.ts.map +1 -0
- package/dist/services/core/pricing/customer-groups.client.js +154 -0
- package/dist/services/core/pricing/customer-groups.client.js.map +1 -0
- package/dist/services/core/pricing/geo-zones.client.d.ts +89 -0
- package/dist/services/core/pricing/geo-zones.client.d.ts.map +1 -0
- package/dist/services/core/pricing/geo-zones.client.js +116 -0
- package/dist/services/core/pricing/geo-zones.client.js.map +1 -0
- package/dist/services/core/pricing/index.d.ts +13 -0
- package/dist/services/core/pricing/index.d.ts.map +1 -0
- package/dist/services/core/pricing/index.js +13 -0
- package/dist/services/core/pricing/index.js.map +1 -0
- package/dist/services/core/pricing/markets.client.d.ts +154 -0
- package/dist/services/core/pricing/markets.client.d.ts.map +1 -0
- package/dist/services/core/pricing/markets.client.js +194 -0
- package/dist/services/core/pricing/markets.client.js.map +1 -0
- package/dist/services/core/pricing/pricing.client.d.ts +280 -0
- package/dist/services/core/pricing/pricing.client.d.ts.map +1 -0
- package/dist/services/core/pricing/pricing.client.js +363 -0
- package/dist/services/core/pricing/pricing.client.js.map +1 -0
- package/dist/services/core/pricing/product-geo-restrictions.client.d.ts +79 -0
- package/dist/services/core/pricing/product-geo-restrictions.client.d.ts.map +1 -0
- package/dist/services/core/pricing/product-geo-restrictions.client.js +109 -0
- package/dist/services/core/pricing/product-geo-restrictions.client.js.map +1 -0
- package/dist/services/core/pricing/product-market-settings.client.d.ts +168 -0
- package/dist/services/core/pricing/product-market-settings.client.d.ts.map +1 -0
- package/dist/services/core/pricing/product-market-settings.client.js +213 -0
- package/dist/services/core/pricing/product-market-settings.client.js.map +1 -0
- package/dist/services/core/pricing/rules.client.d.ts +46 -0
- package/dist/services/core/pricing/rules.client.d.ts.map +1 -0
- package/dist/services/core/pricing/rules.client.js +57 -0
- package/dist/services/core/pricing/rules.client.js.map +1 -0
- package/dist/services/core/pricing/store-markets.client.d.ts +168 -0
- package/dist/services/core/pricing/store-markets.client.d.ts.map +1 -0
- package/dist/services/core/pricing/store-markets.client.js +209 -0
- package/dist/services/core/pricing/store-markets.client.js.map +1 -0
- package/dist/services/core/pricing/tiers.client.d.ts +57 -0
- package/dist/services/core/pricing/tiers.client.d.ts.map +1 -0
- package/dist/services/core/pricing/tiers.client.js +72 -0
- package/dist/services/core/pricing/tiers.client.js.map +1 -0
- package/dist/services/core/pricing/types.d.ts +782 -0
- package/dist/services/core/pricing/types.d.ts.map +1 -0
- package/dist/services/core/pricing/types.js +2 -0
- package/dist/services/core/pricing/types.js.map +1 -0
- package/dist/services/core/pricing/variant-prices.client.d.ts +307 -0
- package/dist/services/core/pricing/variant-prices.client.d.ts.map +1 -0
- package/dist/services/core/pricing/variant-prices.client.js +347 -0
- package/dist/services/core/pricing/variant-prices.client.js.map +1 -0
- package/dist/services/core/product-relations.client.d.ts +260 -0
- package/dist/services/core/product-relations.client.d.ts.map +1 -0
- package/dist/services/core/product-relations.client.js +141 -0
- package/dist/services/core/product-relations.client.js.map +1 -0
- package/dist/services/core/products.client.d.ts +564 -0
- package/dist/services/core/products.client.d.ts.map +1 -0
- package/dist/services/core/products.client.js +277 -0
- package/dist/services/core/products.client.js.map +1 -0
- package/dist/services/core/returns.client.d.ts +199 -0
- package/dist/services/core/returns.client.d.ts.map +1 -0
- package/dist/services/core/returns.client.js +106 -0
- package/dist/services/core/returns.client.js.map +1 -0
- package/dist/services/core/reviews.client.d.ts +218 -0
- package/dist/services/core/reviews.client.d.ts.map +1 -0
- package/dist/services/core/reviews.client.js +161 -0
- package/dist/services/core/reviews.client.js.map +1 -0
- package/dist/services/core/search.client.d.ts +127 -0
- package/dist/services/core/search.client.d.ts.map +1 -0
- package/dist/services/core/search.client.js +120 -0
- package/dist/services/core/search.client.js.map +1 -0
- package/dist/services/core/shipping/classes.client.d.ts +20 -0
- package/dist/services/core/shipping/classes.client.d.ts.map +1 -0
- package/dist/services/core/shipping/classes.client.js +43 -0
- package/dist/services/core/shipping/classes.client.js.map +1 -0
- package/dist/services/core/shipping/index.d.ts +11 -0
- package/dist/services/core/shipping/index.d.ts.map +1 -0
- package/dist/services/core/shipping/index.js +11 -0
- package/dist/services/core/shipping/index.js.map +1 -0
- package/dist/services/core/shipping/labels.client.d.ts +20 -0
- package/dist/services/core/shipping/labels.client.d.ts.map +1 -0
- package/dist/services/core/shipping/labels.client.js +49 -0
- package/dist/services/core/shipping/labels.client.js.map +1 -0
- package/dist/services/core/shipping/providers.client.d.ts +19 -0
- package/dist/services/core/shipping/providers.client.d.ts.map +1 -0
- package/dist/services/core/shipping/providers.client.js +46 -0
- package/dist/services/core/shipping/providers.client.js.map +1 -0
- package/dist/services/core/shipping/rates.client.d.ts +19 -0
- package/dist/services/core/shipping/rates.client.d.ts.map +1 -0
- package/dist/services/core/shipping/rates.client.js +37 -0
- package/dist/services/core/shipping/rates.client.js.map +1 -0
- package/dist/services/core/shipping/rules.client.d.ts +17 -0
- package/dist/services/core/shipping/rules.client.d.ts.map +1 -0
- package/dist/services/core/shipping/rules.client.js +34 -0
- package/dist/services/core/shipping/rules.client.js.map +1 -0
- package/dist/services/core/shipping/shipper-identity.client.d.ts +49 -0
- package/dist/services/core/shipping/shipper-identity.client.d.ts.map +1 -0
- package/dist/services/core/shipping/shipper-identity.client.js +61 -0
- package/dist/services/core/shipping/shipper-identity.client.js.map +1 -0
- package/dist/services/core/shipping/shipping.client.d.ts +99 -0
- package/dist/services/core/shipping/shipping.client.d.ts.map +1 -0
- package/dist/services/core/shipping/shipping.client.js +165 -0
- package/dist/services/core/shipping/shipping.client.js.map +1 -0
- package/dist/services/core/shipping/store-providers.client.d.ts +48 -0
- package/dist/services/core/shipping/store-providers.client.d.ts.map +1 -0
- package/dist/services/core/shipping/store-providers.client.js +59 -0
- package/dist/services/core/shipping/store-providers.client.js.map +1 -0
- package/dist/services/core/shipping/types.d.ts +488 -0
- package/dist/services/core/shipping/types.d.ts.map +1 -0
- package/dist/services/core/shipping/types.js +3 -0
- package/dist/services/core/shipping/types.js.map +1 -0
- package/dist/services/core/shipping/zones.client.d.ts +16 -0
- package/dist/services/core/shipping/zones.client.d.ts.map +1 -0
- package/dist/services/core/shipping/zones.client.js +29 -0
- package/dist/services/core/shipping/zones.client.js.map +1 -0
- package/dist/services/core/storefront/index.d.ts +10 -0
- package/dist/services/core/storefront/index.d.ts.map +1 -0
- package/dist/services/core/storefront/index.js +10 -0
- package/dist/services/core/storefront/index.js.map +1 -0
- package/dist/services/core/storefront/storefront-addresses.client.d.ts +67 -0
- package/dist/services/core/storefront/storefront-addresses.client.d.ts.map +1 -0
- package/dist/services/core/storefront/storefront-addresses.client.js +95 -0
- package/dist/services/core/storefront/storefront-addresses.client.js.map +1 -0
- package/dist/services/core/storefront/storefront-auth.client.d.ts +104 -0
- package/dist/services/core/storefront/storefront-auth.client.d.ts.map +1 -0
- package/dist/services/core/storefront/storefront-auth.client.js +132 -0
- package/dist/services/core/storefront/storefront-auth.client.js.map +1 -0
- package/dist/services/core/storefront/storefront-orders.client.d.ts +73 -0
- package/dist/services/core/storefront/storefront-orders.client.d.ts.map +1 -0
- package/dist/services/core/storefront/storefront-orders.client.js +78 -0
- package/dist/services/core/storefront/storefront-orders.client.js.map +1 -0
- package/dist/services/core/storefront/storefront-plans.client.d.ts +76 -0
- package/dist/services/core/storefront/storefront-plans.client.d.ts.map +1 -0
- package/dist/services/core/storefront/storefront-plans.client.js +52 -0
- package/dist/services/core/storefront/storefront-plans.client.js.map +1 -0
- package/dist/services/core/storefront/storefront-reviews.client.d.ts +60 -0
- package/dist/services/core/storefront/storefront-reviews.client.d.ts.map +1 -0
- package/dist/services/core/storefront/storefront-reviews.client.js +88 -0
- package/dist/services/core/storefront/storefront-reviews.client.js.map +1 -0
- package/dist/services/core/storefront/storefront-subscriptions.client.d.ts +199 -0
- package/dist/services/core/storefront/storefront-subscriptions.client.d.ts.map +1 -0
- package/dist/services/core/storefront/storefront-subscriptions.client.js +149 -0
- package/dist/services/core/storefront/storefront-subscriptions.client.js.map +1 -0
- package/dist/services/core/storefront/storefront.client.d.ts +166 -0
- package/dist/services/core/storefront/storefront.client.d.ts.map +1 -0
- package/dist/services/core/storefront/storefront.client.js +228 -0
- package/dist/services/core/storefront/storefront.client.js.map +1 -0
- package/dist/services/core/storefront/types.d.ts +131 -0
- package/dist/services/core/storefront/types.d.ts.map +1 -0
- package/dist/services/core/storefront/types.js +3 -0
- package/dist/services/core/storefront/types.js.map +1 -0
- package/dist/services/core/storefront-redirects/index.d.ts +4 -0
- package/dist/services/core/storefront-redirects/index.d.ts.map +1 -0
- package/dist/services/core/storefront-redirects/index.js +3 -0
- package/dist/services/core/storefront-redirects/index.js.map +1 -0
- package/dist/services/core/storefront-redirects/storefront-redirects.client.d.ts +79 -0
- package/dist/services/core/storefront-redirects/storefront-redirects.client.d.ts.map +1 -0
- package/dist/services/core/storefront-redirects/storefront-redirects.client.js +132 -0
- package/dist/services/core/storefront-redirects/storefront-redirects.client.js.map +1 -0
- package/dist/services/core/storefront-redirects/storefront-redirects.public.client.d.ts +35 -0
- package/dist/services/core/storefront-redirects/storefront-redirects.public.client.d.ts.map +1 -0
- package/dist/services/core/storefront-redirects/storefront-redirects.public.client.js +42 -0
- package/dist/services/core/storefront-redirects/storefront-redirects.public.client.js.map +1 -0
- package/dist/services/core/storefront-redirects/types.d.ts +117 -0
- package/dist/services/core/storefront-redirects/types.d.ts.map +1 -0
- package/dist/services/core/storefront-redirects/types.js +2 -0
- package/dist/services/core/storefront-redirects/types.js.map +1 -0
- package/dist/services/core/stores/ai-discovery.client.d.ts +98 -0
- package/dist/services/core/stores/ai-discovery.client.d.ts.map +1 -0
- package/dist/services/core/stores/ai-discovery.client.js +72 -0
- package/dist/services/core/stores/ai-discovery.client.js.map +1 -0
- package/dist/services/core/stores/configuration.client.d.ts +238 -0
- package/dist/services/core/stores/configuration.client.d.ts.map +1 -0
- package/dist/services/core/stores/configuration.client.js +88 -0
- package/dist/services/core/stores/configuration.client.js.map +1 -0
- package/dist/services/core/stores/index.d.ts +11 -0
- package/dist/services/core/stores/index.d.ts.map +1 -0
- package/dist/services/core/stores/index.js +6 -0
- package/dist/services/core/stores/index.js.map +1 -0
- package/dist/services/core/stores/members.client.d.ts +91 -0
- package/dist/services/core/stores/members.client.d.ts.map +1 -0
- package/dist/services/core/stores/members.client.js +70 -0
- package/dist/services/core/stores/members.client.js.map +1 -0
- package/dist/services/core/stores/stores.client.d.ts +190 -0
- package/dist/services/core/stores/stores.client.d.ts.map +1 -0
- package/dist/services/core/stores/stores.client.js +177 -0
- package/dist/services/core/stores/stores.client.js.map +1 -0
- package/dist/services/core/stores/theme.types.d.ts +109 -0
- package/dist/services/core/stores/theme.types.d.ts.map +1 -0
- package/dist/services/core/stores/theme.types.js +27 -0
- package/dist/services/core/stores/theme.types.js.map +1 -0
- package/dist/services/core/taxes/index.d.ts +7 -0
- package/dist/services/core/taxes/index.d.ts.map +1 -0
- package/dist/services/core/taxes/index.js +7 -0
- package/dist/services/core/taxes/index.js.map +1 -0
- package/dist/services/core/taxes/jurisdictions.client.d.ts +61 -0
- package/dist/services/core/taxes/jurisdictions.client.d.ts.map +1 -0
- package/dist/services/core/taxes/jurisdictions.client.js +93 -0
- package/dist/services/core/taxes/jurisdictions.client.js.map +1 -0
- package/dist/services/core/taxes/providers.client.d.ts +111 -0
- package/dist/services/core/taxes/providers.client.d.ts.map +1 -0
- package/dist/services/core/taxes/providers.client.js +188 -0
- package/dist/services/core/taxes/providers.client.js.map +1 -0
- package/dist/services/core/taxes/rates.client.d.ts +63 -0
- package/dist/services/core/taxes/rates.client.d.ts.map +1 -0
- package/dist/services/core/taxes/rates.client.js +97 -0
- package/dist/services/core/taxes/rates.client.js.map +1 -0
- package/dist/services/core/taxes/store-providers.client.d.ts +48 -0
- package/dist/services/core/taxes/store-providers.client.d.ts.map +1 -0
- package/dist/services/core/taxes/store-providers.client.js +59 -0
- package/dist/services/core/taxes/store-providers.client.js.map +1 -0
- package/dist/services/core/taxes/taxes.client.d.ts +81 -0
- package/dist/services/core/taxes/taxes.client.d.ts.map +1 -0
- package/dist/services/core/taxes/taxes.client.js +117 -0
- package/dist/services/core/taxes/taxes.client.js.map +1 -0
- package/dist/services/core/taxes/types.d.ts +406 -0
- package/dist/services/core/taxes/types.d.ts.map +1 -0
- package/dist/services/core/taxes/types.js +3 -0
- package/dist/services/core/taxes/types.js.map +1 -0
- package/dist/services/core/variants.client.d.ts +415 -0
- package/dist/services/core/variants.client.d.ts.map +1 -0
- package/dist/services/core/variants.client.js +289 -0
- package/dist/services/core/variants.client.js.map +1 -0
- package/dist/services/core/wishlists.client.d.ts +151 -0
- package/dist/services/core/wishlists.client.d.ts.map +1 -0
- package/dist/services/core/wishlists.client.js +125 -0
- package/dist/services/core/wishlists.client.js.map +1 -0
- package/dist/storefront/index.d.ts +152 -0
- package/dist/storefront/index.d.ts.map +1 -0
- package/dist/storefront/index.js +189 -0
- package/dist/storefront/index.js.map +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// ==================== Client ====================
|
|
2
|
+
export class CheckoutClient {
|
|
3
|
+
http;
|
|
4
|
+
baseUrl;
|
|
5
|
+
constructor(httpClient, baseUrl) {
|
|
6
|
+
this.http = httpClient;
|
|
7
|
+
this.baseUrl = baseUrl;
|
|
8
|
+
}
|
|
9
|
+
// ==================== Session Management ====================
|
|
10
|
+
/**
|
|
11
|
+
* Create a new checkout session from an active cart
|
|
12
|
+
*/
|
|
13
|
+
async create(data) {
|
|
14
|
+
return this.http.post(`${this.baseUrl}/v1/checkout/sessions`, data);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Get a checkout session by ID
|
|
18
|
+
*/
|
|
19
|
+
async get(id) {
|
|
20
|
+
return this.http.get(`${this.baseUrl}/v1/checkout/sessions/${id}`);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* List checkout sessions with optional filters
|
|
24
|
+
*/
|
|
25
|
+
async list(options = {}) {
|
|
26
|
+
const params = this.buildQueryParams(options);
|
|
27
|
+
return this.http.get(`${this.baseUrl}/v1/checkout/sessions`, {
|
|
28
|
+
params,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Update a checkout session
|
|
33
|
+
*/
|
|
34
|
+
async update(id, data) {
|
|
35
|
+
return this.http.put(`${this.baseUrl}/v1/checkout/sessions/${id}`, data);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Delete a checkout session
|
|
39
|
+
*/
|
|
40
|
+
async delete(id) {
|
|
41
|
+
await this.http.delete(`${this.baseUrl}/v1/checkout/sessions/${id}`);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* List checkout sessions by customer ID
|
|
45
|
+
*/
|
|
46
|
+
async listByCustomer(customerId) {
|
|
47
|
+
return this.list({ filters: { customerId } });
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* List checkout sessions by cart ID
|
|
51
|
+
*/
|
|
52
|
+
async listByCart(cartId) {
|
|
53
|
+
return this.list({ filters: { cartId } });
|
|
54
|
+
}
|
|
55
|
+
// ==================== Shipping ====================
|
|
56
|
+
/**
|
|
57
|
+
* Update the shipping address for a checkout session
|
|
58
|
+
*/
|
|
59
|
+
async updateShippingAddress(checkoutId, address) {
|
|
60
|
+
return this.http.put(`${this.baseUrl}/v1/checkout/sessions/${checkoutId}/shipping-address`, address);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Get available shipping rates for a checkout session
|
|
64
|
+
*/
|
|
65
|
+
async getShippingRates(checkoutId, options = {}) {
|
|
66
|
+
const params = {};
|
|
67
|
+
if (options.forceRecalculate !== undefined) {
|
|
68
|
+
params.forceRecalculate = String(options.forceRecalculate);
|
|
69
|
+
}
|
|
70
|
+
if (options.includeExpress !== undefined) {
|
|
71
|
+
params.includeExpress = String(options.includeExpress);
|
|
72
|
+
}
|
|
73
|
+
if (options.includeInternational !== undefined) {
|
|
74
|
+
params.includeInternational = String(options.includeInternational);
|
|
75
|
+
}
|
|
76
|
+
return this.http.get(`${this.baseUrl}/v1/checkout/sessions/${checkoutId}/shipping-rates`, { params });
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Select a shipping method for a checkout session
|
|
80
|
+
*/
|
|
81
|
+
async selectShippingMethod(checkoutId, data) {
|
|
82
|
+
return this.http.put(`${this.baseUrl}/v1/checkout/sessions/${checkoutId}/shipping-method`, data);
|
|
83
|
+
}
|
|
84
|
+
// ==================== Calculation & Validation ====================
|
|
85
|
+
/**
|
|
86
|
+
* Calculate checkout totals including tax and shipping
|
|
87
|
+
*/
|
|
88
|
+
async calculateTotals(checkoutId, options = {}) {
|
|
89
|
+
return this.http.post(`${this.baseUrl}/v1/checkout/sessions/${checkoutId}/calculate-totals`, options);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Validate checkout session for completion readiness
|
|
93
|
+
*/
|
|
94
|
+
async validate(checkoutId, options = {}) {
|
|
95
|
+
return this.http.post(`${this.baseUrl}/v1/checkout/sessions/${checkoutId}/validate`, options);
|
|
96
|
+
}
|
|
97
|
+
// ==================== Completion ====================
|
|
98
|
+
/**
|
|
99
|
+
* Complete checkout session and create order.
|
|
100
|
+
*
|
|
101
|
+
* Requires `checkout:complete`. Publishable keys cannot call this -- the pk
|
|
102
|
+
* permission ceiling excludes that grant by design. Use a secret-key (`sk_`)
|
|
103
|
+
* `ZiftrSDK` on the server after payment confirms.
|
|
104
|
+
*/
|
|
105
|
+
async complete(checkoutId, data) {
|
|
106
|
+
return this.http.post(`${this.baseUrl}/v1/checkout/sessions/${checkoutId}/complete`, data);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Mark checkout session as abandoned and save for recovery
|
|
110
|
+
*/
|
|
111
|
+
async abandon(checkoutId, data) {
|
|
112
|
+
return this.http.post(`${this.baseUrl}/v1/checkout/sessions/${checkoutId}/abandon`, data);
|
|
113
|
+
}
|
|
114
|
+
// ==================== Admin Operations ====================
|
|
115
|
+
/**
|
|
116
|
+
* Clean up expired checkout sessions (admin operation)
|
|
117
|
+
*/
|
|
118
|
+
async cleanupExpired() {
|
|
119
|
+
return this.http.post(`${this.baseUrl}/v1/checkout/cleanup-expired`, {});
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Create an order directly from a cart, bypassing the checkout state machine.
|
|
123
|
+
* Supports three payment paths:
|
|
124
|
+
* - No payment (pending draft order)
|
|
125
|
+
* - Stripe paymentIntentId (captured)
|
|
126
|
+
* - Manual/offline payment (captured)
|
|
127
|
+
*
|
|
128
|
+
* @admin Requires `orders:create` permission.
|
|
129
|
+
*/
|
|
130
|
+
async adminCreate(data) {
|
|
131
|
+
return this.http.post(`${this.baseUrl}/v1/checkout/admin`, data);
|
|
132
|
+
}
|
|
133
|
+
buildQueryParams(options) {
|
|
134
|
+
const params = {};
|
|
135
|
+
if (options.page !== undefined)
|
|
136
|
+
params.page = String(options.page);
|
|
137
|
+
if (options.limit !== undefined)
|
|
138
|
+
params.limit = String(options.limit);
|
|
139
|
+
if (options.sort !== undefined)
|
|
140
|
+
params.sort = options.sort;
|
|
141
|
+
if (options.order !== undefined)
|
|
142
|
+
params.order = options.order;
|
|
143
|
+
if (options.filters) {
|
|
144
|
+
for (const [key, value] of Object.entries(options.filters)) {
|
|
145
|
+
if (value !== undefined && value !== null) {
|
|
146
|
+
params[key] = String(value);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return params;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=checkout.client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkout.client.js","sourceRoot":"","sources":["../../../../../src/services/core/checkout.client.ts"],"names":[],"mappings":"AA8XA,mDAAmD;AAEnD,MAAM,OAAO,cAAc;IACN,IAAI,CAAa;IACjB,OAAO,CAAS;IAEnC,YAAY,UAAsB,EAAE,OAAe;QACjD,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,+DAA+D;IAE/D;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,IAA8B;QACzC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAkB,GAAG,IAAI,CAAC,OAAO,uBAAuB,EAAE,IAAI,CAAC,CAAC;IACvF,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG,CAAC,EAAU;QAClB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAkB,GAAG,IAAI,CAAC,OAAO,yBAAyB,EAAE,EAAE,CAAC,CAAC;IACtF,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAI,CACR,UAAwC,EAAE;QAE1C,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAClB,GAAG,IAAI,CAAC,OAAO,uBAAuB,EACtC;YACE,MAAM;SACP,CACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,IAA8B;QACrD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAkB,GAAG,IAAI,CAAC,OAAO,yBAAyB,EAAE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|
+
import { CmsCollectionsClient } from './collections.client.js';
|
|
3
|
+
import { CmsContentTypesClient } from './content-types.client.js';
|
|
4
|
+
import { CmsEntriesClient } from './entries.client.js';
|
|
5
|
+
import { CmsModulesClient } from './modules.client.js';
|
|
6
|
+
import { CmsMediaClient } from './media.client.js';
|
|
7
|
+
import { CmsPublicClient } from './public.client.js';
|
|
8
|
+
import { CmsNavigationClient } from './navigation.client.js';
|
|
9
|
+
/**
|
|
10
|
+
* CmsClient provides comprehensive content management with nested sub-clients.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* // Schema-backed content type + collection
|
|
15
|
+
* const { definition, version } = await sdk.cms.contentTypes.create({
|
|
16
|
+
* key: 'case_study',
|
|
17
|
+
* name: 'Case Study',
|
|
18
|
+
* fields: [
|
|
19
|
+
* { key: 'customerName', label: 'Customer', type: 'short_text', required: true },
|
|
20
|
+
* ],
|
|
21
|
+
* });
|
|
22
|
+
* await sdk.cms.contentTypes.publishVersion(definition.id, version.id);
|
|
23
|
+
*
|
|
24
|
+
* const collection = await sdk.cms.collections.create({
|
|
25
|
+
* name: 'Case Studies',
|
|
26
|
+
* slug: 'case-studies',
|
|
27
|
+
* type: 'custom',
|
|
28
|
+
* contentTypeDefinitionId: definition.id,
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* // Create a blog post with blocks
|
|
32
|
+
* const entry = await sdk.cms.entries.create({
|
|
33
|
+
* collectionId: collection.id,
|
|
34
|
+
* slug: 'welcome-post',
|
|
35
|
+
* title: 'Welcome to Our Blog',
|
|
36
|
+
* blocks: [
|
|
37
|
+
* { type: 'heading', content: { text: 'Hello!' } },
|
|
38
|
+
* { type: 'text', content: { html: '<p>Welcome...</p>' } },
|
|
39
|
+
* ],
|
|
40
|
+
* });
|
|
41
|
+
*
|
|
42
|
+
* // Publish workflow
|
|
43
|
+
* await sdk.cms.entries.submitForReview(entry.id);
|
|
44
|
+
* await sdk.cms.entries.approve(entry.id, { publishImmediately: true });
|
|
45
|
+
*
|
|
46
|
+
* // Upload media
|
|
47
|
+
* const { uploadUrl, s3Key } = await sdk.cms.media.getPresignedUrl({
|
|
48
|
+
* filename: 'hero.jpg',
|
|
49
|
+
* mimeType: 'image/jpeg',
|
|
50
|
+
* });
|
|
51
|
+
* // ... upload to S3 ...
|
|
52
|
+
* const media = await sdk.cms.media.confirmUpload({ s3Key, ... });
|
|
53
|
+
*
|
|
54
|
+
* // Create reusable modules
|
|
55
|
+
* const module = await sdk.cms.modules.create({
|
|
56
|
+
* name: 'Size Guide',
|
|
57
|
+
* slug: 'size-guide',
|
|
58
|
+
* blocks: [...],
|
|
59
|
+
* });
|
|
60
|
+
* await sdk.cms.modules.attach(module.id, {
|
|
61
|
+
* entityType: 'product',
|
|
62
|
+
* entityId: 'product-uuid',
|
|
63
|
+
* });
|
|
64
|
+
*
|
|
65
|
+
* // Public content access
|
|
66
|
+
* const posts = await sdk.cms.public.listContent('blog');
|
|
67
|
+
* const post = await sdk.cms.public.getContent('blog', 'welcome-post');
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export declare class CmsClient {
|
|
71
|
+
private readonly http;
|
|
72
|
+
private readonly baseUrl;
|
|
73
|
+
private _collections?;
|
|
74
|
+
private _contentTypes?;
|
|
75
|
+
private _entries?;
|
|
76
|
+
private _modules?;
|
|
77
|
+
private _media?;
|
|
78
|
+
private _public?;
|
|
79
|
+
private _navigation?;
|
|
80
|
+
constructor(http: HttpClient, baseUrl: string);
|
|
81
|
+
/**
|
|
82
|
+
* Collections sub-client for managing content collections
|
|
83
|
+
*/
|
|
84
|
+
get collections(): CmsCollectionsClient;
|
|
85
|
+
/**
|
|
86
|
+
* Content types sub-client for definitions, draft/publish versions, and starters.
|
|
87
|
+
* Published schema versions are immutable.
|
|
88
|
+
*/
|
|
89
|
+
get contentTypes(): CmsContentTypesClient;
|
|
90
|
+
/**
|
|
91
|
+
* Entries sub-client for managing content entries, blocks, workflow, and versions
|
|
92
|
+
*/
|
|
93
|
+
get entries(): CmsEntriesClient;
|
|
94
|
+
/**
|
|
95
|
+
* Modules sub-client for managing reusable content modules
|
|
96
|
+
*/
|
|
97
|
+
get modules(): CmsModulesClient;
|
|
98
|
+
/**
|
|
99
|
+
* Media sub-client for managing media uploads and assets
|
|
100
|
+
*/
|
|
101
|
+
get media(): CmsMediaClient;
|
|
102
|
+
/**
|
|
103
|
+
* Public sub-client for accessing published content
|
|
104
|
+
*/
|
|
105
|
+
get public(): CmsPublicClient;
|
|
106
|
+
/**
|
|
107
|
+
* Navigation sub-client for store-scoped menus and item trees
|
|
108
|
+
*/
|
|
109
|
+
get navigation(): CmsNavigationClient;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=cms.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cms.client.d.ts","sourceRoot":"","sources":["../../../../../../src/services/core/cms/cms.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,IAAI,UAAU,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,qBAAa,SAAS;IAUlB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAV1B,OAAO,CAAC,YAAY,CAAC,CAAuB;IAC5C,OAAO,CAAC,aAAa,CAAC,CAAwB;IAC9C,OAAO,CAAC,QAAQ,CAAC,CAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,CAAmB;IACpC,OAAO,CAAC,MAAM,CAAC,CAAiB;IAChC,OAAO,CAAC,OAAO,CAAC,CAAkB;IAClC,OAAO,CAAC,WAAW,CAAC,CAAsB;gBAGvB,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,MAAM;IAGlC;;OAEG;IACH,IAAI,WAAW,IAAI,oBAAoB,CAKtC;IAED;;;OAGG;IACH,IAAI,YAAY,IAAI,qBAAqB,CAKxC;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,gBAAgB,CAK9B;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,gBAAgB,CAK9B;IAED;;OAEG;IACH,IAAI,KAAK,IAAI,cAAc,CAK1B;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,eAAe,CAK5B;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,mBAAmB,CAKpC;CACF"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { CmsCollectionsClient } from './collections.client.js';
|
|
2
|
+
import { CmsContentTypesClient } from './content-types.client.js';
|
|
3
|
+
import { CmsEntriesClient } from './entries.client.js';
|
|
4
|
+
import { CmsModulesClient } from './modules.client.js';
|
|
5
|
+
import { CmsMediaClient } from './media.client.js';
|
|
6
|
+
import { CmsPublicClient } from './public.client.js';
|
|
7
|
+
import { CmsNavigationClient } from './navigation.client.js';
|
|
8
|
+
/**
|
|
9
|
+
* CmsClient provides comprehensive content management with nested sub-clients.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Schema-backed content type + collection
|
|
14
|
+
* const { definition, version } = await sdk.cms.contentTypes.create({
|
|
15
|
+
* key: 'case_study',
|
|
16
|
+
* name: 'Case Study',
|
|
17
|
+
* fields: [
|
|
18
|
+
* { key: 'customerName', label: 'Customer', type: 'short_text', required: true },
|
|
19
|
+
* ],
|
|
20
|
+
* });
|
|
21
|
+
* await sdk.cms.contentTypes.publishVersion(definition.id, version.id);
|
|
22
|
+
*
|
|
23
|
+
* const collection = await sdk.cms.collections.create({
|
|
24
|
+
* name: 'Case Studies',
|
|
25
|
+
* slug: 'case-studies',
|
|
26
|
+
* type: 'custom',
|
|
27
|
+
* contentTypeDefinitionId: definition.id,
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* // Create a blog post with blocks
|
|
31
|
+
* const entry = await sdk.cms.entries.create({
|
|
32
|
+
* collectionId: collection.id,
|
|
33
|
+
* slug: 'welcome-post',
|
|
34
|
+
* title: 'Welcome to Our Blog',
|
|
35
|
+
* blocks: [
|
|
36
|
+
* { type: 'heading', content: { text: 'Hello!' } },
|
|
37
|
+
* { type: 'text', content: { html: '<p>Welcome...</p>' } },
|
|
38
|
+
* ],
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* // Publish workflow
|
|
42
|
+
* await sdk.cms.entries.submitForReview(entry.id);
|
|
43
|
+
* await sdk.cms.entries.approve(entry.id, { publishImmediately: true });
|
|
44
|
+
*
|
|
45
|
+
* // Upload media
|
|
46
|
+
* const { uploadUrl, s3Key } = await sdk.cms.media.getPresignedUrl({
|
|
47
|
+
* filename: 'hero.jpg',
|
|
48
|
+
* mimeType: 'image/jpeg',
|
|
49
|
+
* });
|
|
50
|
+
* // ... upload to S3 ...
|
|
51
|
+
* const media = await sdk.cms.media.confirmUpload({ s3Key, ... });
|
|
52
|
+
*
|
|
53
|
+
* // Create reusable modules
|
|
54
|
+
* const module = await sdk.cms.modules.create({
|
|
55
|
+
* name: 'Size Guide',
|
|
56
|
+
* slug: 'size-guide',
|
|
57
|
+
* blocks: [...],
|
|
58
|
+
* });
|
|
59
|
+
* await sdk.cms.modules.attach(module.id, {
|
|
60
|
+
* entityType: 'product',
|
|
61
|
+
* entityId: 'product-uuid',
|
|
62
|
+
* });
|
|
63
|
+
*
|
|
64
|
+
* // Public content access
|
|
65
|
+
* const posts = await sdk.cms.public.listContent('blog');
|
|
66
|
+
* const post = await sdk.cms.public.getContent('blog', 'welcome-post');
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export class CmsClient {
|
|
70
|
+
http;
|
|
71
|
+
baseUrl;
|
|
72
|
+
_collections;
|
|
73
|
+
_contentTypes;
|
|
74
|
+
_entries;
|
|
75
|
+
_modules;
|
|
76
|
+
_media;
|
|
77
|
+
_public;
|
|
78
|
+
_navigation;
|
|
79
|
+
constructor(http, baseUrl) {
|
|
80
|
+
this.http = http;
|
|
81
|
+
this.baseUrl = baseUrl;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Collections sub-client for managing content collections
|
|
85
|
+
*/
|
|
86
|
+
get collections() {
|
|
87
|
+
if (!this._collections) {
|
|
88
|
+
this._collections = new CmsCollectionsClient(this.http, this.baseUrl);
|
|
89
|
+
}
|
|
90
|
+
return this._collections;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Content types sub-client for definitions, draft/publish versions, and starters.
|
|
94
|
+
* Published schema versions are immutable.
|
|
95
|
+
*/
|
|
96
|
+
get contentTypes() {
|
|
97
|
+
if (!this._contentTypes) {
|
|
98
|
+
this._contentTypes = new CmsContentTypesClient(this.http, this.baseUrl);
|
|
99
|
+
}
|
|
100
|
+
return this._contentTypes;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Entries sub-client for managing content entries, blocks, workflow, and versions
|
|
104
|
+
*/
|
|
105
|
+
get entries() {
|
|
106
|
+
if (!this._entries) {
|
|
107
|
+
this._entries = new CmsEntriesClient(this.http, this.baseUrl);
|
|
108
|
+
}
|
|
109
|
+
return this._entries;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Modules sub-client for managing reusable content modules
|
|
113
|
+
*/
|
|
114
|
+
get modules() {
|
|
115
|
+
if (!this._modules) {
|
|
116
|
+
this._modules = new CmsModulesClient(this.http, this.baseUrl);
|
|
117
|
+
}
|
|
118
|
+
return this._modules;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Media sub-client for managing media uploads and assets
|
|
122
|
+
*/
|
|
123
|
+
get media() {
|
|
124
|
+
if (!this._media) {
|
|
125
|
+
this._media = new CmsMediaClient(this.http, this.baseUrl);
|
|
126
|
+
}
|
|
127
|
+
return this._media;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Public sub-client for accessing published content
|
|
131
|
+
*/
|
|
132
|
+
get public() {
|
|
133
|
+
if (!this._public) {
|
|
134
|
+
this._public = new CmsPublicClient(this.http, this.baseUrl);
|
|
135
|
+
}
|
|
136
|
+
return this._public;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Navigation sub-client for store-scoped menus and item trees
|
|
140
|
+
*/
|
|
141
|
+
get navigation() {
|
|
142
|
+
if (!this._navigation) {
|
|
143
|
+
this._navigation = new CmsNavigationClient(this.http, this.baseUrl);
|
|
144
|
+
}
|
|
145
|
+
return this._navigation;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=cms.client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cms.client.js","sourceRoot":"","sources":["../../../../../../src/services/core/cms/cms.client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D;;;;;;;;;;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AAI,CAAC,OAAO,CAAC,CAAC;QAChE,CAAC;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,IAAI,KAAK;QACP,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5D,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;OAEG;IACH,IAAI,MAAM;QACR,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,IAAI,CAAC,OAAO,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,IAAI,UAAU;QACZ,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,IAAI,CAAC,WAAW,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACtE,CAAC;QACD,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { HttpClientTransport as HttpClient } from '../../../core/http-client.js';
|
|
2
|
+
import type { ContentCollection, CreateCollectionDto, UpdateCollectionDto, CollectionFilters, CollectionListResponse } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* CmsCollectionsClient manages content collections (blog, landing pages, etc.).
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* // List collections (paginated envelope -- not a bare array)
|
|
9
|
+
* const { data: collections, total } = await sdk.cms.collections.list();
|
|
10
|
+
*
|
|
11
|
+
* // Create a blog collection
|
|
12
|
+
* const blog = await sdk.cms.collections.create({
|
|
13
|
+
* name: 'Blog',
|
|
14
|
+
* slug: 'blog',
|
|
15
|
+
* type: 'blog',
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare class CmsCollectionsClient {
|
|
20
|
+
private readonly http;
|
|
21
|
+
private readonly baseUrl;
|
|
22
|
+
constructor(http: HttpClient, baseUrl: string);
|
|
23
|
+
/**
|
|
24
|
+
* List content collections (paginated).
|
|
25
|
+
* Returns `{ data, total, page, limit }` -- do not treat as T[].
|
|
26
|
+
*/
|
|
27
|
+
list(filters?: CollectionFilters): Promise<CollectionListResponse>;
|
|
28
|
+
/**
|
|
29
|
+
* Get a collection by ID
|
|
30
|
+
*/
|
|
31
|
+
get(id: string): Promise<ContentCollection>;
|
|
32
|
+
/**
|
|
33
|
+
* Create a new collection
|
|
34
|
+
*/
|
|
35
|
+
create(data: CreateCollectionDto): Promise<ContentCollection>;
|
|
36
|
+
/**
|
|
37
|
+
* Update a collection
|
|
38
|
+
*/
|
|
39
|
+
update(id: string, data: UpdateCollectionDto): Promise<ContentCollection>;
|
|
40
|
+
/**
|
|
41
|
+
* Delete a collection
|
|
42
|
+
*/
|
|
43
|
+
delete(id: string): Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=collections.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections.client.d.ts","sourceRoot":"","sources":["../../../../../../src/services/core/cms/collections.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,IAAI,UAAU,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,oBAAoB;IAE7B,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADP,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,MAAM;IAGlC;;;OAGG;IACG,IAAI,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAW5E;;OAEG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAIjD;;OAEG;IACG,MAAM,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAInE;;OAEG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAI/E;;OAEG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGxC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CmsCollectionsClient manages content collections (blog, landing pages, etc.).
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```typescript
|
|
6
|
+
* // List collections (paginated envelope -- not a bare array)
|
|
7
|
+
* const { data: collections, total } = await sdk.cms.collections.list();
|
|
8
|
+
*
|
|
9
|
+
* // Create a blog collection
|
|
10
|
+
* const blog = await sdk.cms.collections.create({
|
|
11
|
+
* name: 'Blog',
|
|
12
|
+
* slug: 'blog',
|
|
13
|
+
* type: 'blog',
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export class CmsCollectionsClient {
|
|
18
|
+
http;
|
|
19
|
+
baseUrl;
|
|
20
|
+
constructor(http, baseUrl) {
|
|
21
|
+
this.http = http;
|
|
22
|
+
this.baseUrl = baseUrl;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* List content collections (paginated).
|
|
26
|
+
* Returns `{ data, total, page, limit }` -- do not treat as T[].
|
|
27
|
+
*/
|
|
28
|
+
async list(filters = {}) {
|
|
29
|
+
const params = {};
|
|
30
|
+
if (filters.type)
|
|
31
|
+
params.type = filters.type;
|
|
32
|
+
if (filters.isActive !== undefined)
|
|
33
|
+
params.isActive = String(filters.isActive);
|
|
34
|
+
if (filters.page !== undefined)
|
|
35
|
+
params.page = String(filters.page);
|
|
36
|
+
if (filters.limit !== undefined)
|
|
37
|
+
params.limit = String(filters.limit);
|
|
38
|
+
return this.http.get(`${this.baseUrl}/v1/cms/collections`, {
|
|
39
|
+
params,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get a collection by ID
|
|
44
|
+
*/
|
|
45
|
+
async get(id) {
|
|
46
|
+
return this.http.get(`${this.baseUrl}/v1/cms/collections/${id}`);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Create a new collection
|
|
50
|
+
*/
|
|
51
|
+
async create(data) {
|
|
52
|
+
return this.http.post(`${this.baseUrl}/v1/cms/collections`, data);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Update a collection
|
|
56
|
+
*/
|
|
57
|
+
async update(id, data) {
|
|
58
|
+
return this.http.put(`${this.baseUrl}/v1/cms/collections/${id}`, data);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Delete a collection
|
|
62
|
+
*/
|
|
63
|
+
async delete(id) {
|
|
64
|
+
await this.http.delete(`${this.baseUrl}/v1/cms/collections/${id}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=collections.client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections.client.js","sourceRoot":"","sources":["../../../../../../src/services/core/cms/collections.client.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,oBAAoB;IAEZ;IACA;IAFnB,YACmB,IAAgB,EAChB,OAAe;QADf,SAAI,GAAJ,IAAI,CAAY;QAChB,YAAO,GAAP,OAAO,CAAQ;IAC/B,CAAC;IAEJ;;;OAGG;IACH,KAA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CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,uBAAuB,EAAE,EAAE,CAAC,CAAC;IACrE,CAAC;CACF"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { HttpClientTransport as HttpClient } from '../../../core/http-client.js';
|
|
2
|
+
import type { CloneContentTypeDefinitionDto, ContentTypeDefinition, ContentTypeDefinitionFilters, ContentTypeDefinitionList, ContentTypeDefinitionWithVersion, ContentTypeStarter, ContentTypeValidationResult, ContentTypeVersion, ContentTypeVersionDraftDto, CreateContentTypeDefinitionDto, InstallStarterDto, UpdateContentTypeDefinitionDto, ValidateFieldsDto, ValidateSchemaDto } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* CmsContentTypesClient manages schema-backed content type definitions,
|
|
5
|
+
* draft/publish versions, field schema validation, and tenant starters.
|
|
6
|
+
*
|
|
7
|
+
* Published versions are immutable -- only draft versions can be mutated.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* // Install a starter
|
|
12
|
+
* const def = await sdk.cms.contentTypes.installFromStarter({
|
|
13
|
+
* starterKey: 'article',
|
|
14
|
+
* });
|
|
15
|
+
*
|
|
16
|
+
* // Create a custom type with an initial draft schema
|
|
17
|
+
* const { definition, version } = await sdk.cms.contentTypes.create({
|
|
18
|
+
* key: 'case_study',
|
|
19
|
+
* name: 'Case Study',
|
|
20
|
+
* fields: [
|
|
21
|
+
* { key: 'customerName', label: 'Customer', type: 'short_text', required: true },
|
|
22
|
+
* ],
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* // Publish a draft version (becomes immutable)
|
|
26
|
+
* await sdk.cms.contentTypes.publishVersion(definition.id, version.id);
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare class CmsContentTypesClient {
|
|
30
|
+
private readonly http;
|
|
31
|
+
private readonly baseUrl;
|
|
32
|
+
constructor(http: HttpClient, baseUrl: string);
|
|
33
|
+
private get endpoint();
|
|
34
|
+
/**
|
|
35
|
+
* List available starter content type templates (code-owned catalog).
|
|
36
|
+
*/
|
|
37
|
+
listStarters(): Promise<ContentTypeStarter[]>;
|
|
38
|
+
/**
|
|
39
|
+
* Install a starter template for the tenant (idempotent).
|
|
40
|
+
*/
|
|
41
|
+
installFromStarter(data: InstallStarterDto): Promise<ContentTypeDefinition>;
|
|
42
|
+
/**
|
|
43
|
+
* Validate a content type field schema draft against the closed field DSL.
|
|
44
|
+
*/
|
|
45
|
+
validateSchema(data: ValidateSchemaDto): Promise<ContentTypeValidationResult>;
|
|
46
|
+
/**
|
|
47
|
+
* List content type definitions for the tenant.
|
|
48
|
+
*/
|
|
49
|
+
list(filters?: ContentTypeDefinitionFilters): Promise<ContentTypeDefinitionList>;
|
|
50
|
+
/**
|
|
51
|
+
* Create a custom content type definition with an initial draft version.
|
|
52
|
+
*/
|
|
53
|
+
create(data: CreateContentTypeDefinitionDto): Promise<ContentTypeDefinitionWithVersion>;
|
|
54
|
+
/**
|
|
55
|
+
* Get a content type definition by id.
|
|
56
|
+
*/
|
|
57
|
+
get(id: string): Promise<ContentTypeDefinition>;
|
|
58
|
+
/**
|
|
59
|
+
* Update content type metadata (name/description only -- not fields).
|
|
60
|
+
*/
|
|
61
|
+
update(id: string, data: UpdateContentTypeDefinitionDto): Promise<ContentTypeDefinition>;
|
|
62
|
+
/**
|
|
63
|
+
* Archive a content type definition.
|
|
64
|
+
*/
|
|
65
|
+
archive(id: string): Promise<ContentTypeDefinition>;
|
|
66
|
+
/**
|
|
67
|
+
* Restore an archived content type definition.
|
|
68
|
+
*/
|
|
69
|
+
restore(id: string): Promise<ContentTypeDefinition>;
|
|
70
|
+
/**
|
|
71
|
+
* Clone a content type definition (new definition + draft version).
|
|
72
|
+
*/
|
|
73
|
+
clone(id: string, data: CloneContentTypeDefinitionDto): Promise<ContentTypeDefinitionWithVersion>;
|
|
74
|
+
/**
|
|
75
|
+
* List versions for a content type definition.
|
|
76
|
+
*/
|
|
77
|
+
listVersions(id: string): Promise<ContentTypeVersion[]>;
|
|
78
|
+
/**
|
|
79
|
+
* Get a content type version by id.
|
|
80
|
+
*/
|
|
81
|
+
getVersion(id: string, versionId: string): Promise<ContentTypeVersion>;
|
|
82
|
+
/**
|
|
83
|
+
* Create or replace a draft content type version (fields only).
|
|
84
|
+
* Does not mutate published versions.
|
|
85
|
+
*/
|
|
86
|
+
createDraftVersion(id: string, data: ContentTypeVersionDraftDto): Promise<ContentTypeVersion>;
|
|
87
|
+
/**
|
|
88
|
+
* Update a draft content type version.
|
|
89
|
+
* Core rejects updates when the version is not draft (published are immutable).
|
|
90
|
+
*/
|
|
91
|
+
updateDraftVersion(id: string, versionId: string, data: ContentTypeVersionDraftDto): Promise<ContentTypeVersion>;
|
|
92
|
+
/**
|
|
93
|
+
* Publish a draft content type version. Published versions are immutable.
|
|
94
|
+
*/
|
|
95
|
+
publishVersion(id: string, versionId: string): Promise<ContentTypeDefinitionWithVersion>;
|
|
96
|
+
/**
|
|
97
|
+
* Validate an entry field payload against the definition's published schema.
|
|
98
|
+
*/
|
|
99
|
+
validateFields(id: string, data: ValidateFieldsDto): Promise<ContentTypeValidationResult>;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=content-types.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-types.client.d.ts","sourceRoot":"","sources":["../../../../../../src/services/core/cms/content-types.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,IAAI,UAAU,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,KAAK,EACV,6BAA6B,EAC7B,qBAAqB,EACrB,4BAA4B,EAC5B,yBAAyB,EACzB,gCAAgC,EAChC,kBAAkB,EAClB,2BAA2B,EAC3B,kBAAkB,EAClB,0BAA0B,EAC1B,8BAA8B,EAC9B,iBAAiB,EACjB,8BAA8B,EAC9B,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAEpB;;;;;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