@thorprovider/types 3.2.1 → 3.3.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/dist/index.d.mts +251 -29
- package/dist/index.d.ts +251 -29
- package/dist/index.js +0 -56
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +0 -56
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/admin/MultiTenantAdmin.ts +295 -0
- package/src/admin/index.ts +1 -0
- package/src/auth.ts +15 -28
- package/src/index.ts +35 -0
- package/src/provider.ts +1 -57
package/dist/index.d.mts
CHANGED
|
@@ -1423,12 +1423,7 @@ interface GetOrdersOptions {
|
|
|
1423
1423
|
declare enum SupportedProviderType {
|
|
1424
1424
|
Mock = "mock",
|
|
1425
1425
|
Medusa = "medusa",
|
|
1426
|
-
StelOrder = "stelorder"
|
|
1427
|
-
Shopify = "shopify",
|
|
1428
|
-
BigCommerce = "bigcommerce",
|
|
1429
|
-
WooCommerce = "woocommerce",
|
|
1430
|
-
Spree = "spree",
|
|
1431
|
-
Magento = "magento"
|
|
1426
|
+
StelOrder = "stelorder"
|
|
1432
1427
|
}
|
|
1433
1428
|
/**
|
|
1434
1429
|
* Union type of all supported provider string values.
|
|
@@ -1441,7 +1436,7 @@ declare enum SupportedProviderType {
|
|
|
1441
1436
|
* }
|
|
1442
1437
|
* ```
|
|
1443
1438
|
*/
|
|
1444
|
-
type ProviderTypeString = 'mock' | 'medusa' | 'stelorder'
|
|
1439
|
+
type ProviderTypeString = 'mock' | 'medusa' | 'stelorder';
|
|
1445
1440
|
/**
|
|
1446
1441
|
* Metadata about each provider.
|
|
1447
1442
|
* Useful for UI, error messages, validation, and documentation.
|
|
@@ -1923,28 +1918,21 @@ interface AuthProvider {
|
|
|
1923
1918
|
*/
|
|
1924
1919
|
deleteCustomerAccount(): Promise<void>;
|
|
1925
1920
|
/**
|
|
1926
|
-
*
|
|
1927
|
-
*
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
*
|
|
1932
|
-
*
|
|
1933
|
-
*
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
/**
|
|
1937
|
-
* Update customer address
|
|
1938
|
-
* @param addressId - Address ID
|
|
1939
|
-
* @param data - Fields to update
|
|
1940
|
-
* @returns Updated address
|
|
1941
|
-
*/
|
|
1942
|
-
updateAddress(addressId: string, data: Partial<CreateAddressData>): Promise<Address>;
|
|
1943
|
-
/**
|
|
1944
|
-
* Delete customer address
|
|
1945
|
-
* @param addressId - Address ID
|
|
1921
|
+
* Link the currently authenticated customer to the storefront's sales channel.
|
|
1922
|
+
*
|
|
1923
|
+
* Call immediately after a successful `login()` so the customer appears in the
|
|
1924
|
+
* correct channel on the admin panel. Idempotent — repeated calls return
|
|
1925
|
+
* `{ linked: false, reason: 'already_linked' }`.
|
|
1926
|
+
*
|
|
1927
|
+
* Implements `POST /store/thor/customers/me/channels`.
|
|
1928
|
+
*
|
|
1929
|
+
* @returns `{ linked: true }` when the link was created, or
|
|
1930
|
+
* `{ linked: false, reason: 'already_linked' }` when it already existed.
|
|
1946
1931
|
*/
|
|
1947
|
-
|
|
1932
|
+
linkCustomerToChannel(): Promise<{
|
|
1933
|
+
linked: boolean;
|
|
1934
|
+
reason?: string;
|
|
1935
|
+
}>;
|
|
1948
1936
|
}
|
|
1949
1937
|
|
|
1950
1938
|
/**
|
|
@@ -3383,4 +3371,238 @@ interface SiteConfigMetadata {
|
|
|
3383
3371
|
history?: ConfigHistoryEntry[];
|
|
3384
3372
|
}
|
|
3385
3373
|
|
|
3386
|
-
|
|
3374
|
+
/**
|
|
3375
|
+
* @thorprovider/types — Multi-Tenant Admin Types
|
|
3376
|
+
*
|
|
3377
|
+
* Type definitions for admin operations on the Thor Commerce multi-tenant
|
|
3378
|
+
* backend plugin (`/admin/thor/`).
|
|
3379
|
+
*
|
|
3380
|
+
* These types map 1:1 to the API contract defined in
|
|
3381
|
+
* `multitenant-api-contract.md`.
|
|
3382
|
+
*
|
|
3383
|
+
* @module admin/MultiTenantAdmin
|
|
3384
|
+
*/
|
|
3385
|
+
/**
|
|
3386
|
+
* A customer entry as returned by the admin multi-tenant API.
|
|
3387
|
+
*/
|
|
3388
|
+
interface AdminChannelCustomer {
|
|
3389
|
+
id: string;
|
|
3390
|
+
email: string;
|
|
3391
|
+
first_name: string | null;
|
|
3392
|
+
last_name: string | null;
|
|
3393
|
+
phone: string | null;
|
|
3394
|
+
created_at: string;
|
|
3395
|
+
}
|
|
3396
|
+
/** Response for `GET /admin/thor/sales-channels/:id/customers` */
|
|
3397
|
+
interface GetChannelCustomersResponse {
|
|
3398
|
+
customers: AdminChannelCustomer[];
|
|
3399
|
+
count: number;
|
|
3400
|
+
limit: number;
|
|
3401
|
+
offset: number;
|
|
3402
|
+
}
|
|
3403
|
+
/** Options for paginating channel customers */
|
|
3404
|
+
interface GetChannelCustomersOptions {
|
|
3405
|
+
/** Max customers to return (default 20, max 100) */
|
|
3406
|
+
limit?: number;
|
|
3407
|
+
/** Pagination offset (default 0) */
|
|
3408
|
+
offset?: number;
|
|
3409
|
+
}
|
|
3410
|
+
/**
|
|
3411
|
+
* A publishable API key entry as returned by the admin multi-tenant API.
|
|
3412
|
+
*/
|
|
3413
|
+
interface AdminApiKey {
|
|
3414
|
+
id: string;
|
|
3415
|
+
title: string;
|
|
3416
|
+
token: string;
|
|
3417
|
+
type: 'publishable' | string;
|
|
3418
|
+
created_at: string;
|
|
3419
|
+
}
|
|
3420
|
+
/** Response for `GET /admin/thor/sales-channels/:id/api-keys` */
|
|
3421
|
+
interface GetChannelApiKeysResponse {
|
|
3422
|
+
api_keys: AdminApiKey[];
|
|
3423
|
+
}
|
|
3424
|
+
/**
|
|
3425
|
+
* A product category entry as returned by admin channel category endpoints.
|
|
3426
|
+
*/
|
|
3427
|
+
interface AdminChannelCategory {
|
|
3428
|
+
id: string;
|
|
3429
|
+
name: string;
|
|
3430
|
+
handle: string;
|
|
3431
|
+
description: string | null;
|
|
3432
|
+
parent_category_id: string | null;
|
|
3433
|
+
rank: number;
|
|
3434
|
+
metadata: Record<string, unknown>;
|
|
3435
|
+
}
|
|
3436
|
+
/** Response for `GET /admin/thor/sales-channels/:id/categories` */
|
|
3437
|
+
interface GetChannelCategoriesResponse {
|
|
3438
|
+
categories: AdminChannelCategory[];
|
|
3439
|
+
count: number;
|
|
3440
|
+
}
|
|
3441
|
+
/** Options for listing channel categories */
|
|
3442
|
+
interface GetChannelCategoriesOptions {
|
|
3443
|
+
/** Max categories per page (default 20, max 100) */
|
|
3444
|
+
limit?: number;
|
|
3445
|
+
/** Pagination offset (default 0) */
|
|
3446
|
+
offset?: number;
|
|
3447
|
+
/** Expand child categories in nested tree */
|
|
3448
|
+
include_descendants?: boolean;
|
|
3449
|
+
}
|
|
3450
|
+
/**
|
|
3451
|
+
* A slim sales channel reference returned when listing channels for a resource.
|
|
3452
|
+
*/
|
|
3453
|
+
interface AdminSalesChannelRef {
|
|
3454
|
+
id: string;
|
|
3455
|
+
name: string;
|
|
3456
|
+
description?: string;
|
|
3457
|
+
}
|
|
3458
|
+
/** Response for `GET /admin/thor/categories/:id/sales-channels` */
|
|
3459
|
+
interface GetCategorySalesChannelsResponse {
|
|
3460
|
+
sales_channels: AdminSalesChannelRef[];
|
|
3461
|
+
}
|
|
3462
|
+
/** Body for `POST /admin/thor/categories/:id/sales-channels` */
|
|
3463
|
+
interface AssignCategoriesToChannelsBody {
|
|
3464
|
+
sales_channel_ids: string[];
|
|
3465
|
+
}
|
|
3466
|
+
/** Response for `POST /admin/thor/categories/:id/sales-channels` */
|
|
3467
|
+
interface AssignCategoriesToChannelsResponse {
|
|
3468
|
+
message: string;
|
|
3469
|
+
linked: number;
|
|
3470
|
+
}
|
|
3471
|
+
/** Body for `DELETE /admin/thor/categories/:id/sales-channels` */
|
|
3472
|
+
interface UnassignCategoriesFromChannelsBody {
|
|
3473
|
+
sales_channel_ids: string[];
|
|
3474
|
+
}
|
|
3475
|
+
/** Response for `DELETE /admin/thor/categories/:id/sales-channels` */
|
|
3476
|
+
interface UnassignCategoriesFromChannelsResponse {
|
|
3477
|
+
message: string;
|
|
3478
|
+
dismissed: number;
|
|
3479
|
+
}
|
|
3480
|
+
/** Response for `GET /admin/thor/collections/:id/sales-channels` */
|
|
3481
|
+
interface GetCollectionSalesChannelsResponse {
|
|
3482
|
+
sales_channels: AdminSalesChannelRef[];
|
|
3483
|
+
}
|
|
3484
|
+
/** Body for `POST /admin/thor/collections/:id/sales-channels` */
|
|
3485
|
+
interface AssignCollectionsToChannelsBody {
|
|
3486
|
+
sales_channel_ids: string[];
|
|
3487
|
+
}
|
|
3488
|
+
/** Response for `POST /admin/thor/collections/:id/sales-channels` */
|
|
3489
|
+
interface AssignCollectionsToChannelsResponse {
|
|
3490
|
+
message: string;
|
|
3491
|
+
linked: number;
|
|
3492
|
+
}
|
|
3493
|
+
/** Body for `DELETE /admin/thor/collections/:id/sales-channels` */
|
|
3494
|
+
interface UnassignCollectionsFromChannelsBody {
|
|
3495
|
+
sales_channel_ids: string[];
|
|
3496
|
+
}
|
|
3497
|
+
/** Response for `DELETE /admin/thor/collections/:id/sales-channels` */
|
|
3498
|
+
interface UnassignCollectionsFromChannelsResponse {
|
|
3499
|
+
message: string;
|
|
3500
|
+
dismissed: number;
|
|
3501
|
+
}
|
|
3502
|
+
/**
|
|
3503
|
+
* SEO defaults as stored in the storefront config.
|
|
3504
|
+
*/
|
|
3505
|
+
interface AdminStorefrontSeoDefaults {
|
|
3506
|
+
title: string;
|
|
3507
|
+
description: string;
|
|
3508
|
+
ogImage?: string;
|
|
3509
|
+
}
|
|
3510
|
+
/**
|
|
3511
|
+
* Full storefront config record as returned by admin endpoints.
|
|
3512
|
+
* Uses snake_case to match the API contract response shape exactly.
|
|
3513
|
+
*/
|
|
3514
|
+
interface AdminStorefrontConfig {
|
|
3515
|
+
id: string;
|
|
3516
|
+
sales_channel_id: string;
|
|
3517
|
+
theme_accent_color: string;
|
|
3518
|
+
logo_url: string;
|
|
3519
|
+
currency_code: string;
|
|
3520
|
+
seo_defaults: AdminStorefrontSeoDefaults;
|
|
3521
|
+
frontend_webhook_url?: string;
|
|
3522
|
+
created_at: string;
|
|
3523
|
+
updated_at: string;
|
|
3524
|
+
}
|
|
3525
|
+
/** Response for `GET /admin/thor/storefront-config/:id` */
|
|
3526
|
+
interface GetAdminStorefrontConfigResponse {
|
|
3527
|
+
storefront_config: AdminStorefrontConfig;
|
|
3528
|
+
}
|
|
3529
|
+
/** Body for `PUT /admin/thor/storefront-config/:id` */
|
|
3530
|
+
interface UpdateStorefrontConfigBody {
|
|
3531
|
+
theme_accent_color: string;
|
|
3532
|
+
logo_url: string;
|
|
3533
|
+
currency_code: string;
|
|
3534
|
+
seo_defaults: {
|
|
3535
|
+
title: string;
|
|
3536
|
+
description: string;
|
|
3537
|
+
ogImage?: string;
|
|
3538
|
+
};
|
|
3539
|
+
frontend_webhook_url?: string;
|
|
3540
|
+
}
|
|
3541
|
+
/** Response for `PUT /admin/thor/storefront-config/:id` */
|
|
3542
|
+
interface UpdateStorefrontConfigResponse {
|
|
3543
|
+
storefront_config: AdminStorefrontConfig;
|
|
3544
|
+
}
|
|
3545
|
+
/**
|
|
3546
|
+
* A single history entry for the Site Designer config.
|
|
3547
|
+
*/
|
|
3548
|
+
interface AdminSiteConfigHistoryEntry {
|
|
3549
|
+
id?: string;
|
|
3550
|
+
version: string;
|
|
3551
|
+
createdAt: string;
|
|
3552
|
+
createdBy?: string;
|
|
3553
|
+
}
|
|
3554
|
+
/**
|
|
3555
|
+
* Full site config record as returned by admin endpoints.
|
|
3556
|
+
* `config` is the free-form `DesignerConfig` JSON object.
|
|
3557
|
+
*/
|
|
3558
|
+
interface AdminSiteConfig {
|
|
3559
|
+
id: string;
|
|
3560
|
+
sales_channel_id: string;
|
|
3561
|
+
version: string;
|
|
3562
|
+
/** Free-form DesignerConfig object managed by the Site Designer */
|
|
3563
|
+
config: Record<string, unknown>;
|
|
3564
|
+
history?: AdminSiteConfigHistoryEntry[];
|
|
3565
|
+
created_at?: string;
|
|
3566
|
+
updated_at?: string;
|
|
3567
|
+
}
|
|
3568
|
+
/** Response for `GET /admin/thor/site-config/:sales_channel_id` */
|
|
3569
|
+
interface GetAdminSiteConfigResponse {
|
|
3570
|
+
site_config: AdminSiteConfig;
|
|
3571
|
+
}
|
|
3572
|
+
/** Body for `PUT /admin/thor/site-config/:sales_channel_id` */
|
|
3573
|
+
type UpdateSiteConfigBody = Record<string, unknown>;
|
|
3574
|
+
/** Response for `PUT /admin/thor/site-config/:sales_channel_id` */
|
|
3575
|
+
interface UpdateSiteConfigResponse {
|
|
3576
|
+
site_config: AdminSiteConfig;
|
|
3577
|
+
}
|
|
3578
|
+
/**
|
|
3579
|
+
* A full history entry including the stored config snapshot.
|
|
3580
|
+
*/
|
|
3581
|
+
interface AdminSiteConfigHistoryEntryFull {
|
|
3582
|
+
id: string;
|
|
3583
|
+
version: string;
|
|
3584
|
+
config: Record<string, unknown>;
|
|
3585
|
+
createdAt: string;
|
|
3586
|
+
createdBy?: string;
|
|
3587
|
+
}
|
|
3588
|
+
/** Response for `GET /admin/thor/site-config/:sales_channel_id/history` */
|
|
3589
|
+
interface GetAdminSiteConfigHistoryResponse {
|
|
3590
|
+
history: AdminSiteConfigHistoryEntryFull[];
|
|
3591
|
+
count: number;
|
|
3592
|
+
}
|
|
3593
|
+
/** Options for paginating site config history */
|
|
3594
|
+
interface GetAdminSiteConfigHistoryOptions {
|
|
3595
|
+
limit?: number;
|
|
3596
|
+
offset?: number;
|
|
3597
|
+
}
|
|
3598
|
+
/** Response for `POST /admin/thor/site-config/:sales_channel_id/restore/:version` */
|
|
3599
|
+
interface RestoreSiteConfigResponse {
|
|
3600
|
+
site_config: AdminSiteConfig;
|
|
3601
|
+
}
|
|
3602
|
+
/** Response for `POST /store/thor/customers/me/channels` */
|
|
3603
|
+
interface LinkCustomerToChannelResponse {
|
|
3604
|
+
linked: boolean;
|
|
3605
|
+
reason?: 'already_linked';
|
|
3606
|
+
}
|
|
3607
|
+
|
|
3608
|
+
export { type AccountDropdownConfig, type AccountMenuItem, type ActiveFilter, type Address, type AdminApiKey, type AdminChannelCategory, type AdminChannelCustomer, type AdminProduct, type AdminProductVariant, type AdminSalesChannelRef, type AdminSiteConfig, type AdminSiteConfigHistoryEntry, type AdminSiteConfigHistoryEntryFull, type AdminStorefrontConfig, type AdminStorefrontSeoDefaults, type AdminUser, type AdvancedSearchProductsOptions, type AssignCategoriesToChannelsBody, type AssignCategoriesToChannelsResponse, type AssignCollectionsToChannelsBody, type AssignCollectionsToChannelsResponse, type AuditLog, type AuditLogAdapter, type AuthConfig, type AuthMethod, type AuthProvider, type AuthResponse, type AuthStorage, type AuthorConfig, type BackendCapabilities, type BrandConfig, type CachedPaymentMethods, type Cart, type CartCost, type CartItem, type CartLineInput, type CartLineUpdate, type CartProduct, type ChartDataPoint, type Collection, type CollectionProductsOptions, type CommerceProvider, type CompareProduct, type ConfigHistoryEntry, type Connection, type Country, type CreateAddressData, type Customer, type DashboardConfig, type DashboardMetrics, type DashboardMetricsAdapter, type DashboardOrdersAdapter, type DashboardProductsAdapter, type DesignerConfig, type DesignerHistoryEntry, type DesignerNavItem, type DesignerThemeConfig, type DesignerThemePreset, type DiscountCode, type DynamicSource, type Edge, type FilterConfig, type FilterOption, type FilterSection, type FulfillmentOption, type FulfillmentSet, type FulfillmentStatus, type GetAdminSiteConfigHistoryOptions, type GetAdminSiteConfigHistoryResponse, type GetAdminSiteConfigResponse, type GetAdminStorefrontConfigResponse, type GetCategoriesCallback, type GetCategoriesOptions, type GetCategorySalesChannelsResponse, type GetChannelApiKeysResponse, type GetChannelCategoriesOptions, type GetChannelCategoriesResponse, type GetChannelCustomersOptions, type GetChannelCustomersResponse, type GetCollectionSalesChannelsResponse, type GetCollectionsOptions, type GetCustomersCallback, type GetCustomersOptions, type GetOrdersCallback, type GetOrdersOptions, type GetProductsOptions, type HeaderLinkItem, type HeaderNavigationConfig, type IconConfig, type Image, type InventoryLevel, type LinkCustomerToChannelResponse, type LoginCredentials, type ModulesConfig, type Money, type NavigationCalloutItem, type NavigationItem, type NavigationLinkItem, type Order, type OrderItem, type OrderStatus, type OrdersMetrics, PROVIDER_METADATA, type PaginationOptions, type PasswordResetConfirm, type PasswordResetRequest, type PaymentMethod, type PaymentMethodFeatures, type PaymentMethodType, type PaymentMethodsOptions, type PaymentStatus, type PriceRange, type Product, type ProductCategory, type ProductOption, type ProductPreview, type ProductVariant, type ProductsMetrics, type ProviderConfig, type ProviderTypeString, type Region, type RegisterData, type RestoreSiteConfigResponse, type Review, type SEO, type SalesMetrics, type SearchBarConfig, type SearchResultMeta, type SelectedOption, type ShippingMethod, type SiteConfig, type SiteConfigLabels, type SiteConfigMetadata, type SocialConfig, type SortOption, type SortOptions, type StockLocation, type StockStatus, type StockValidation, type StorefrontConfig, StorefrontConfigError, type StorefrontContext, type StorefrontPlatformType, type StorefrontSeoDefaults, SupportedProviderType, type UnassignCategoriesFromChannelsBody, type UnassignCategoriesFromChannelsResponse, type UnassignCollectionsFromChannelsBody, type UnassignCollectionsFromChannelsResponse, type UpdateCustomerData, type UpdateSiteConfigBody, type UpdateSiteConfigResponse, type UpdateStorefrontConfigBody, type UpdateStorefrontConfigResponse, getProviderMetadata, isSupportedProviderType };
|
package/dist/index.d.ts
CHANGED
|
@@ -1423,12 +1423,7 @@ interface GetOrdersOptions {
|
|
|
1423
1423
|
declare enum SupportedProviderType {
|
|
1424
1424
|
Mock = "mock",
|
|
1425
1425
|
Medusa = "medusa",
|
|
1426
|
-
StelOrder = "stelorder"
|
|
1427
|
-
Shopify = "shopify",
|
|
1428
|
-
BigCommerce = "bigcommerce",
|
|
1429
|
-
WooCommerce = "woocommerce",
|
|
1430
|
-
Spree = "spree",
|
|
1431
|
-
Magento = "magento"
|
|
1426
|
+
StelOrder = "stelorder"
|
|
1432
1427
|
}
|
|
1433
1428
|
/**
|
|
1434
1429
|
* Union type of all supported provider string values.
|
|
@@ -1441,7 +1436,7 @@ declare enum SupportedProviderType {
|
|
|
1441
1436
|
* }
|
|
1442
1437
|
* ```
|
|
1443
1438
|
*/
|
|
1444
|
-
type ProviderTypeString = 'mock' | 'medusa' | 'stelorder'
|
|
1439
|
+
type ProviderTypeString = 'mock' | 'medusa' | 'stelorder';
|
|
1445
1440
|
/**
|
|
1446
1441
|
* Metadata about each provider.
|
|
1447
1442
|
* Useful for UI, error messages, validation, and documentation.
|
|
@@ -1923,28 +1918,21 @@ interface AuthProvider {
|
|
|
1923
1918
|
*/
|
|
1924
1919
|
deleteCustomerAccount(): Promise<void>;
|
|
1925
1920
|
/**
|
|
1926
|
-
*
|
|
1927
|
-
*
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
*
|
|
1932
|
-
*
|
|
1933
|
-
*
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
/**
|
|
1937
|
-
* Update customer address
|
|
1938
|
-
* @param addressId - Address ID
|
|
1939
|
-
* @param data - Fields to update
|
|
1940
|
-
* @returns Updated address
|
|
1941
|
-
*/
|
|
1942
|
-
updateAddress(addressId: string, data: Partial<CreateAddressData>): Promise<Address>;
|
|
1943
|
-
/**
|
|
1944
|
-
* Delete customer address
|
|
1945
|
-
* @param addressId - Address ID
|
|
1921
|
+
* Link the currently authenticated customer to the storefront's sales channel.
|
|
1922
|
+
*
|
|
1923
|
+
* Call immediately after a successful `login()` so the customer appears in the
|
|
1924
|
+
* correct channel on the admin panel. Idempotent — repeated calls return
|
|
1925
|
+
* `{ linked: false, reason: 'already_linked' }`.
|
|
1926
|
+
*
|
|
1927
|
+
* Implements `POST /store/thor/customers/me/channels`.
|
|
1928
|
+
*
|
|
1929
|
+
* @returns `{ linked: true }` when the link was created, or
|
|
1930
|
+
* `{ linked: false, reason: 'already_linked' }` when it already existed.
|
|
1946
1931
|
*/
|
|
1947
|
-
|
|
1932
|
+
linkCustomerToChannel(): Promise<{
|
|
1933
|
+
linked: boolean;
|
|
1934
|
+
reason?: string;
|
|
1935
|
+
}>;
|
|
1948
1936
|
}
|
|
1949
1937
|
|
|
1950
1938
|
/**
|
|
@@ -3383,4 +3371,238 @@ interface SiteConfigMetadata {
|
|
|
3383
3371
|
history?: ConfigHistoryEntry[];
|
|
3384
3372
|
}
|
|
3385
3373
|
|
|
3386
|
-
|
|
3374
|
+
/**
|
|
3375
|
+
* @thorprovider/types — Multi-Tenant Admin Types
|
|
3376
|
+
*
|
|
3377
|
+
* Type definitions for admin operations on the Thor Commerce multi-tenant
|
|
3378
|
+
* backend plugin (`/admin/thor/`).
|
|
3379
|
+
*
|
|
3380
|
+
* These types map 1:1 to the API contract defined in
|
|
3381
|
+
* `multitenant-api-contract.md`.
|
|
3382
|
+
*
|
|
3383
|
+
* @module admin/MultiTenantAdmin
|
|
3384
|
+
*/
|
|
3385
|
+
/**
|
|
3386
|
+
* A customer entry as returned by the admin multi-tenant API.
|
|
3387
|
+
*/
|
|
3388
|
+
interface AdminChannelCustomer {
|
|
3389
|
+
id: string;
|
|
3390
|
+
email: string;
|
|
3391
|
+
first_name: string | null;
|
|
3392
|
+
last_name: string | null;
|
|
3393
|
+
phone: string | null;
|
|
3394
|
+
created_at: string;
|
|
3395
|
+
}
|
|
3396
|
+
/** Response for `GET /admin/thor/sales-channels/:id/customers` */
|
|
3397
|
+
interface GetChannelCustomersResponse {
|
|
3398
|
+
customers: AdminChannelCustomer[];
|
|
3399
|
+
count: number;
|
|
3400
|
+
limit: number;
|
|
3401
|
+
offset: number;
|
|
3402
|
+
}
|
|
3403
|
+
/** Options for paginating channel customers */
|
|
3404
|
+
interface GetChannelCustomersOptions {
|
|
3405
|
+
/** Max customers to return (default 20, max 100) */
|
|
3406
|
+
limit?: number;
|
|
3407
|
+
/** Pagination offset (default 0) */
|
|
3408
|
+
offset?: number;
|
|
3409
|
+
}
|
|
3410
|
+
/**
|
|
3411
|
+
* A publishable API key entry as returned by the admin multi-tenant API.
|
|
3412
|
+
*/
|
|
3413
|
+
interface AdminApiKey {
|
|
3414
|
+
id: string;
|
|
3415
|
+
title: string;
|
|
3416
|
+
token: string;
|
|
3417
|
+
type: 'publishable' | string;
|
|
3418
|
+
created_at: string;
|
|
3419
|
+
}
|
|
3420
|
+
/** Response for `GET /admin/thor/sales-channels/:id/api-keys` */
|
|
3421
|
+
interface GetChannelApiKeysResponse {
|
|
3422
|
+
api_keys: AdminApiKey[];
|
|
3423
|
+
}
|
|
3424
|
+
/**
|
|
3425
|
+
* A product category entry as returned by admin channel category endpoints.
|
|
3426
|
+
*/
|
|
3427
|
+
interface AdminChannelCategory {
|
|
3428
|
+
id: string;
|
|
3429
|
+
name: string;
|
|
3430
|
+
handle: string;
|
|
3431
|
+
description: string | null;
|
|
3432
|
+
parent_category_id: string | null;
|
|
3433
|
+
rank: number;
|
|
3434
|
+
metadata: Record<string, unknown>;
|
|
3435
|
+
}
|
|
3436
|
+
/** Response for `GET /admin/thor/sales-channels/:id/categories` */
|
|
3437
|
+
interface GetChannelCategoriesResponse {
|
|
3438
|
+
categories: AdminChannelCategory[];
|
|
3439
|
+
count: number;
|
|
3440
|
+
}
|
|
3441
|
+
/** Options for listing channel categories */
|
|
3442
|
+
interface GetChannelCategoriesOptions {
|
|
3443
|
+
/** Max categories per page (default 20, max 100) */
|
|
3444
|
+
limit?: number;
|
|
3445
|
+
/** Pagination offset (default 0) */
|
|
3446
|
+
offset?: number;
|
|
3447
|
+
/** Expand child categories in nested tree */
|
|
3448
|
+
include_descendants?: boolean;
|
|
3449
|
+
}
|
|
3450
|
+
/**
|
|
3451
|
+
* A slim sales channel reference returned when listing channels for a resource.
|
|
3452
|
+
*/
|
|
3453
|
+
interface AdminSalesChannelRef {
|
|
3454
|
+
id: string;
|
|
3455
|
+
name: string;
|
|
3456
|
+
description?: string;
|
|
3457
|
+
}
|
|
3458
|
+
/** Response for `GET /admin/thor/categories/:id/sales-channels` */
|
|
3459
|
+
interface GetCategorySalesChannelsResponse {
|
|
3460
|
+
sales_channels: AdminSalesChannelRef[];
|
|
3461
|
+
}
|
|
3462
|
+
/** Body for `POST /admin/thor/categories/:id/sales-channels` */
|
|
3463
|
+
interface AssignCategoriesToChannelsBody {
|
|
3464
|
+
sales_channel_ids: string[];
|
|
3465
|
+
}
|
|
3466
|
+
/** Response for `POST /admin/thor/categories/:id/sales-channels` */
|
|
3467
|
+
interface AssignCategoriesToChannelsResponse {
|
|
3468
|
+
message: string;
|
|
3469
|
+
linked: number;
|
|
3470
|
+
}
|
|
3471
|
+
/** Body for `DELETE /admin/thor/categories/:id/sales-channels` */
|
|
3472
|
+
interface UnassignCategoriesFromChannelsBody {
|
|
3473
|
+
sales_channel_ids: string[];
|
|
3474
|
+
}
|
|
3475
|
+
/** Response for `DELETE /admin/thor/categories/:id/sales-channels` */
|
|
3476
|
+
interface UnassignCategoriesFromChannelsResponse {
|
|
3477
|
+
message: string;
|
|
3478
|
+
dismissed: number;
|
|
3479
|
+
}
|
|
3480
|
+
/** Response for `GET /admin/thor/collections/:id/sales-channels` */
|
|
3481
|
+
interface GetCollectionSalesChannelsResponse {
|
|
3482
|
+
sales_channels: AdminSalesChannelRef[];
|
|
3483
|
+
}
|
|
3484
|
+
/** Body for `POST /admin/thor/collections/:id/sales-channels` */
|
|
3485
|
+
interface AssignCollectionsToChannelsBody {
|
|
3486
|
+
sales_channel_ids: string[];
|
|
3487
|
+
}
|
|
3488
|
+
/** Response for `POST /admin/thor/collections/:id/sales-channels` */
|
|
3489
|
+
interface AssignCollectionsToChannelsResponse {
|
|
3490
|
+
message: string;
|
|
3491
|
+
linked: number;
|
|
3492
|
+
}
|
|
3493
|
+
/** Body for `DELETE /admin/thor/collections/:id/sales-channels` */
|
|
3494
|
+
interface UnassignCollectionsFromChannelsBody {
|
|
3495
|
+
sales_channel_ids: string[];
|
|
3496
|
+
}
|
|
3497
|
+
/** Response for `DELETE /admin/thor/collections/:id/sales-channels` */
|
|
3498
|
+
interface UnassignCollectionsFromChannelsResponse {
|
|
3499
|
+
message: string;
|
|
3500
|
+
dismissed: number;
|
|
3501
|
+
}
|
|
3502
|
+
/**
|
|
3503
|
+
* SEO defaults as stored in the storefront config.
|
|
3504
|
+
*/
|
|
3505
|
+
interface AdminStorefrontSeoDefaults {
|
|
3506
|
+
title: string;
|
|
3507
|
+
description: string;
|
|
3508
|
+
ogImage?: string;
|
|
3509
|
+
}
|
|
3510
|
+
/**
|
|
3511
|
+
* Full storefront config record as returned by admin endpoints.
|
|
3512
|
+
* Uses snake_case to match the API contract response shape exactly.
|
|
3513
|
+
*/
|
|
3514
|
+
interface AdminStorefrontConfig {
|
|
3515
|
+
id: string;
|
|
3516
|
+
sales_channel_id: string;
|
|
3517
|
+
theme_accent_color: string;
|
|
3518
|
+
logo_url: string;
|
|
3519
|
+
currency_code: string;
|
|
3520
|
+
seo_defaults: AdminStorefrontSeoDefaults;
|
|
3521
|
+
frontend_webhook_url?: string;
|
|
3522
|
+
created_at: string;
|
|
3523
|
+
updated_at: string;
|
|
3524
|
+
}
|
|
3525
|
+
/** Response for `GET /admin/thor/storefront-config/:id` */
|
|
3526
|
+
interface GetAdminStorefrontConfigResponse {
|
|
3527
|
+
storefront_config: AdminStorefrontConfig;
|
|
3528
|
+
}
|
|
3529
|
+
/** Body for `PUT /admin/thor/storefront-config/:id` */
|
|
3530
|
+
interface UpdateStorefrontConfigBody {
|
|
3531
|
+
theme_accent_color: string;
|
|
3532
|
+
logo_url: string;
|
|
3533
|
+
currency_code: string;
|
|
3534
|
+
seo_defaults: {
|
|
3535
|
+
title: string;
|
|
3536
|
+
description: string;
|
|
3537
|
+
ogImage?: string;
|
|
3538
|
+
};
|
|
3539
|
+
frontend_webhook_url?: string;
|
|
3540
|
+
}
|
|
3541
|
+
/** Response for `PUT /admin/thor/storefront-config/:id` */
|
|
3542
|
+
interface UpdateStorefrontConfigResponse {
|
|
3543
|
+
storefront_config: AdminStorefrontConfig;
|
|
3544
|
+
}
|
|
3545
|
+
/**
|
|
3546
|
+
* A single history entry for the Site Designer config.
|
|
3547
|
+
*/
|
|
3548
|
+
interface AdminSiteConfigHistoryEntry {
|
|
3549
|
+
id?: string;
|
|
3550
|
+
version: string;
|
|
3551
|
+
createdAt: string;
|
|
3552
|
+
createdBy?: string;
|
|
3553
|
+
}
|
|
3554
|
+
/**
|
|
3555
|
+
* Full site config record as returned by admin endpoints.
|
|
3556
|
+
* `config` is the free-form `DesignerConfig` JSON object.
|
|
3557
|
+
*/
|
|
3558
|
+
interface AdminSiteConfig {
|
|
3559
|
+
id: string;
|
|
3560
|
+
sales_channel_id: string;
|
|
3561
|
+
version: string;
|
|
3562
|
+
/** Free-form DesignerConfig object managed by the Site Designer */
|
|
3563
|
+
config: Record<string, unknown>;
|
|
3564
|
+
history?: AdminSiteConfigHistoryEntry[];
|
|
3565
|
+
created_at?: string;
|
|
3566
|
+
updated_at?: string;
|
|
3567
|
+
}
|
|
3568
|
+
/** Response for `GET /admin/thor/site-config/:sales_channel_id` */
|
|
3569
|
+
interface GetAdminSiteConfigResponse {
|
|
3570
|
+
site_config: AdminSiteConfig;
|
|
3571
|
+
}
|
|
3572
|
+
/** Body for `PUT /admin/thor/site-config/:sales_channel_id` */
|
|
3573
|
+
type UpdateSiteConfigBody = Record<string, unknown>;
|
|
3574
|
+
/** Response for `PUT /admin/thor/site-config/:sales_channel_id` */
|
|
3575
|
+
interface UpdateSiteConfigResponse {
|
|
3576
|
+
site_config: AdminSiteConfig;
|
|
3577
|
+
}
|
|
3578
|
+
/**
|
|
3579
|
+
* A full history entry including the stored config snapshot.
|
|
3580
|
+
*/
|
|
3581
|
+
interface AdminSiteConfigHistoryEntryFull {
|
|
3582
|
+
id: string;
|
|
3583
|
+
version: string;
|
|
3584
|
+
config: Record<string, unknown>;
|
|
3585
|
+
createdAt: string;
|
|
3586
|
+
createdBy?: string;
|
|
3587
|
+
}
|
|
3588
|
+
/** Response for `GET /admin/thor/site-config/:sales_channel_id/history` */
|
|
3589
|
+
interface GetAdminSiteConfigHistoryResponse {
|
|
3590
|
+
history: AdminSiteConfigHistoryEntryFull[];
|
|
3591
|
+
count: number;
|
|
3592
|
+
}
|
|
3593
|
+
/** Options for paginating site config history */
|
|
3594
|
+
interface GetAdminSiteConfigHistoryOptions {
|
|
3595
|
+
limit?: number;
|
|
3596
|
+
offset?: number;
|
|
3597
|
+
}
|
|
3598
|
+
/** Response for `POST /admin/thor/site-config/:sales_channel_id/restore/:version` */
|
|
3599
|
+
interface RestoreSiteConfigResponse {
|
|
3600
|
+
site_config: AdminSiteConfig;
|
|
3601
|
+
}
|
|
3602
|
+
/** Response for `POST /store/thor/customers/me/channels` */
|
|
3603
|
+
interface LinkCustomerToChannelResponse {
|
|
3604
|
+
linked: boolean;
|
|
3605
|
+
reason?: 'already_linked';
|
|
3606
|
+
}
|
|
3607
|
+
|
|
3608
|
+
export { type AccountDropdownConfig, type AccountMenuItem, type ActiveFilter, type Address, type AdminApiKey, type AdminChannelCategory, type AdminChannelCustomer, type AdminProduct, type AdminProductVariant, type AdminSalesChannelRef, type AdminSiteConfig, type AdminSiteConfigHistoryEntry, type AdminSiteConfigHistoryEntryFull, type AdminStorefrontConfig, type AdminStorefrontSeoDefaults, type AdminUser, type AdvancedSearchProductsOptions, type AssignCategoriesToChannelsBody, type AssignCategoriesToChannelsResponse, type AssignCollectionsToChannelsBody, type AssignCollectionsToChannelsResponse, type AuditLog, type AuditLogAdapter, type AuthConfig, type AuthMethod, type AuthProvider, type AuthResponse, type AuthStorage, type AuthorConfig, type BackendCapabilities, type BrandConfig, type CachedPaymentMethods, type Cart, type CartCost, type CartItem, type CartLineInput, type CartLineUpdate, type CartProduct, type ChartDataPoint, type Collection, type CollectionProductsOptions, type CommerceProvider, type CompareProduct, type ConfigHistoryEntry, type Connection, type Country, type CreateAddressData, type Customer, type DashboardConfig, type DashboardMetrics, type DashboardMetricsAdapter, type DashboardOrdersAdapter, type DashboardProductsAdapter, type DesignerConfig, type DesignerHistoryEntry, type DesignerNavItem, type DesignerThemeConfig, type DesignerThemePreset, type DiscountCode, type DynamicSource, type Edge, type FilterConfig, type FilterOption, type FilterSection, type FulfillmentOption, type FulfillmentSet, type FulfillmentStatus, type GetAdminSiteConfigHistoryOptions, type GetAdminSiteConfigHistoryResponse, type GetAdminSiteConfigResponse, type GetAdminStorefrontConfigResponse, type GetCategoriesCallback, type GetCategoriesOptions, type GetCategorySalesChannelsResponse, type GetChannelApiKeysResponse, type GetChannelCategoriesOptions, type GetChannelCategoriesResponse, type GetChannelCustomersOptions, type GetChannelCustomersResponse, type GetCollectionSalesChannelsResponse, type GetCollectionsOptions, type GetCustomersCallback, type GetCustomersOptions, type GetOrdersCallback, type GetOrdersOptions, type GetProductsOptions, type HeaderLinkItem, type HeaderNavigationConfig, type IconConfig, type Image, type InventoryLevel, type LinkCustomerToChannelResponse, type LoginCredentials, type ModulesConfig, type Money, type NavigationCalloutItem, type NavigationItem, type NavigationLinkItem, type Order, type OrderItem, type OrderStatus, type OrdersMetrics, PROVIDER_METADATA, type PaginationOptions, type PasswordResetConfirm, type PasswordResetRequest, type PaymentMethod, type PaymentMethodFeatures, type PaymentMethodType, type PaymentMethodsOptions, type PaymentStatus, type PriceRange, type Product, type ProductCategory, type ProductOption, type ProductPreview, type ProductVariant, type ProductsMetrics, type ProviderConfig, type ProviderTypeString, type Region, type RegisterData, type RestoreSiteConfigResponse, type Review, type SEO, type SalesMetrics, type SearchBarConfig, type SearchResultMeta, type SelectedOption, type ShippingMethod, type SiteConfig, type SiteConfigLabels, type SiteConfigMetadata, type SocialConfig, type SortOption, type SortOptions, type StockLocation, type StockStatus, type StockValidation, type StorefrontConfig, StorefrontConfigError, type StorefrontContext, type StorefrontPlatformType, type StorefrontSeoDefaults, SupportedProviderType, type UnassignCategoriesFromChannelsBody, type UnassignCategoriesFromChannelsResponse, type UnassignCollectionsFromChannelsBody, type UnassignCollectionsFromChannelsResponse, type UpdateCustomerData, type UpdateSiteConfigBody, type UpdateSiteConfigResponse, type UpdateStorefrontConfigBody, type UpdateStorefrontConfigResponse, getProviderMetadata, isSupportedProviderType };
|