@gethydra/sdk 0.1.53 → 0.1.54
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.ts +251 -1
- package/dist/index.js +127 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -22358,6 +22358,253 @@ declare class MeResource {
|
|
|
22358
22358
|
getMembership(accessToken?: string): Promise<DataResponse<unknown>>;
|
|
22359
22359
|
}
|
|
22360
22360
|
|
|
22361
|
+
interface DirectoryCategory {
|
|
22362
|
+
key: string;
|
|
22363
|
+
slug: string;
|
|
22364
|
+
label: string;
|
|
22365
|
+
parent_key: string | null;
|
|
22366
|
+
position: number;
|
|
22367
|
+
icon?: string;
|
|
22368
|
+
description?: string;
|
|
22369
|
+
archived?: boolean;
|
|
22370
|
+
created_at: string;
|
|
22371
|
+
}
|
|
22372
|
+
interface DirectorySettings {
|
|
22373
|
+
default_listing_status: 'draft' | 'active';
|
|
22374
|
+
}
|
|
22375
|
+
interface CreateDirectoryCategoryBody {
|
|
22376
|
+
label: string;
|
|
22377
|
+
slug?: string;
|
|
22378
|
+
parent_key?: string | null;
|
|
22379
|
+
icon?: string;
|
|
22380
|
+
description?: string;
|
|
22381
|
+
}
|
|
22382
|
+
interface UpdateDirectoryCategoryBody {
|
|
22383
|
+
label?: string;
|
|
22384
|
+
slug?: string;
|
|
22385
|
+
parent_key?: string | null;
|
|
22386
|
+
icon?: string | null;
|
|
22387
|
+
description?: string | null;
|
|
22388
|
+
archived?: boolean;
|
|
22389
|
+
position?: number;
|
|
22390
|
+
}
|
|
22391
|
+
interface ReorderDirectoryCategoriesBody {
|
|
22392
|
+
items: Array<{
|
|
22393
|
+
key: string;
|
|
22394
|
+
parent_key: string | null;
|
|
22395
|
+
position: number;
|
|
22396
|
+
}>;
|
|
22397
|
+
}
|
|
22398
|
+
interface UpdateDirectorySettingsBody {
|
|
22399
|
+
default_listing_status?: 'draft' | 'active';
|
|
22400
|
+
}
|
|
22401
|
+
declare class DirectoryCategoriesResource {
|
|
22402
|
+
private client;
|
|
22403
|
+
constructor(client: Hydra);
|
|
22404
|
+
/** List all directory categories. Requires a secret key. */
|
|
22405
|
+
list(): Promise<DataResponse<DirectoryCategory[]>>;
|
|
22406
|
+
/** Get a single directory category by slug. Requires a secret key. */
|
|
22407
|
+
get(slug: string): Promise<DataResponse<DirectoryCategory>>;
|
|
22408
|
+
/** Create a new directory category. Requires a secret key. */
|
|
22409
|
+
create(body: CreateDirectoryCategoryBody, options?: ResourceRequestOptions): Promise<DataResponse<DirectoryCategory>>;
|
|
22410
|
+
/** Update a directory category. Requires a secret key. */
|
|
22411
|
+
update(slug: string, body: UpdateDirectoryCategoryBody): Promise<DataResponse<DirectoryCategory>>;
|
|
22412
|
+
/** Delete a directory category. Children are re-parented. Requires a secret key. */
|
|
22413
|
+
delete(slug: string): Promise<void>;
|
|
22414
|
+
/** Bulk reorder categories (parent assignments and positions). Requires a secret key. */
|
|
22415
|
+
reorder(body: ReorderDirectoryCategoriesBody): Promise<DataResponse<DirectoryCategory[]>>;
|
|
22416
|
+
/** Get directory-wide settings. Requires a secret key. */
|
|
22417
|
+
getSettings(): Promise<DataResponse<DirectorySettings>>;
|
|
22418
|
+
/** Update directory-wide settings. Requires a secret key. */
|
|
22419
|
+
updateSettings(body: UpdateDirectorySettingsBody): Promise<DataResponse<DirectorySettings>>;
|
|
22420
|
+
}
|
|
22421
|
+
|
|
22422
|
+
interface DirectoryTierRule {
|
|
22423
|
+
field: string;
|
|
22424
|
+
operator: string;
|
|
22425
|
+
value: string | number | boolean;
|
|
22426
|
+
}
|
|
22427
|
+
interface DirectoryTier {
|
|
22428
|
+
key: string;
|
|
22429
|
+
slug: string;
|
|
22430
|
+
label: string;
|
|
22431
|
+
product_id: string | null;
|
|
22432
|
+
rules: DirectoryTierRule[];
|
|
22433
|
+
position: number;
|
|
22434
|
+
archived?: boolean;
|
|
22435
|
+
created_at: string;
|
|
22436
|
+
}
|
|
22437
|
+
interface CreateDirectoryTierBody {
|
|
22438
|
+
label: string;
|
|
22439
|
+
slug?: string;
|
|
22440
|
+
product_id?: string | null;
|
|
22441
|
+
rules?: DirectoryTierRule[];
|
|
22442
|
+
}
|
|
22443
|
+
interface UpdateDirectoryTierBody {
|
|
22444
|
+
label?: string;
|
|
22445
|
+
slug?: string;
|
|
22446
|
+
product_id?: string | null;
|
|
22447
|
+
rules?: DirectoryTierRule[];
|
|
22448
|
+
archived?: boolean;
|
|
22449
|
+
position?: number;
|
|
22450
|
+
}
|
|
22451
|
+
interface ReorderDirectoryTiersBody {
|
|
22452
|
+
items: Array<{
|
|
22453
|
+
key: string;
|
|
22454
|
+
position: number;
|
|
22455
|
+
}>;
|
|
22456
|
+
}
|
|
22457
|
+
declare class DirectoryTiersResource {
|
|
22458
|
+
private client;
|
|
22459
|
+
constructor(client: Hydra);
|
|
22460
|
+
/** List all directory tiers. Requires a secret key. */
|
|
22461
|
+
list(): Promise<DataResponse<DirectoryTier[]>>;
|
|
22462
|
+
/** Get a single directory tier by slug. Requires a secret key. */
|
|
22463
|
+
get(slug: string): Promise<DataResponse<DirectoryTier>>;
|
|
22464
|
+
/** Create a new directory tier. Requires a secret key. */
|
|
22465
|
+
create(body: CreateDirectoryTierBody, options?: ResourceRequestOptions): Promise<DataResponse<DirectoryTier>>;
|
|
22466
|
+
/** Update a directory tier. Requires a secret key. */
|
|
22467
|
+
update(slug: string, body: UpdateDirectoryTierBody): Promise<DataResponse<DirectoryTier>>;
|
|
22468
|
+
/** Delete a directory tier. Requires a secret key. */
|
|
22469
|
+
delete(slug: string): Promise<void>;
|
|
22470
|
+
/** Bulk reorder tiers. Requires a secret key. */
|
|
22471
|
+
reorder(body: ReorderDirectoryTiersBody): Promise<DataResponse<DirectoryTier[]>>;
|
|
22472
|
+
}
|
|
22473
|
+
|
|
22474
|
+
interface DirectoryListing {
|
|
22475
|
+
id: string;
|
|
22476
|
+
store_id: string;
|
|
22477
|
+
name: string;
|
|
22478
|
+
slug: string;
|
|
22479
|
+
description: string | null;
|
|
22480
|
+
city: string;
|
|
22481
|
+
region: string | null;
|
|
22482
|
+
country: string | null;
|
|
22483
|
+
postcode: string | null;
|
|
22484
|
+
address: string | null;
|
|
22485
|
+
address_line_2: string | null;
|
|
22486
|
+
address_line_3: string | null;
|
|
22487
|
+
latitude: number | null;
|
|
22488
|
+
longitude: number | null;
|
|
22489
|
+
phone: string | null;
|
|
22490
|
+
email: string | null;
|
|
22491
|
+
website: string | null;
|
|
22492
|
+
category_key: string;
|
|
22493
|
+
logo_id: string | null;
|
|
22494
|
+
image_ids: string[];
|
|
22495
|
+
social: Record<string, string>;
|
|
22496
|
+
opening_hours: unknown | null;
|
|
22497
|
+
services: string[];
|
|
22498
|
+
amenities: string[];
|
|
22499
|
+
price_range: string | null;
|
|
22500
|
+
additional_details: Array<{
|
|
22501
|
+
label: string;
|
|
22502
|
+
value: string;
|
|
22503
|
+
}>;
|
|
22504
|
+
accessibility: Record<string, boolean>;
|
|
22505
|
+
claimed_by: string | null;
|
|
22506
|
+
claimed_at: string | null;
|
|
22507
|
+
verified: boolean | null;
|
|
22508
|
+
listing_tier: string | null;
|
|
22509
|
+
status: 'draft' | 'active' | 'pending' | 'suspended';
|
|
22510
|
+
source_url: string | null;
|
|
22511
|
+
created_at: string;
|
|
22512
|
+
updated_at: string;
|
|
22513
|
+
}
|
|
22514
|
+
interface DirectoryClaim {
|
|
22515
|
+
id: string;
|
|
22516
|
+
listing_id: string;
|
|
22517
|
+
customer_id: string;
|
|
22518
|
+
status: string;
|
|
22519
|
+
verification_method: string | null;
|
|
22520
|
+
verification_code: string | null;
|
|
22521
|
+
proposed_changes: Record<string, unknown> | null;
|
|
22522
|
+
admin_notes: string | null;
|
|
22523
|
+
created_at: string;
|
|
22524
|
+
updated_at: string;
|
|
22525
|
+
}
|
|
22526
|
+
interface ListDirectoryListingsParams {
|
|
22527
|
+
limit?: number;
|
|
22528
|
+
cursor?: string;
|
|
22529
|
+
sort?: 'created_at' | 'updated_at' | 'name' | 'city';
|
|
22530
|
+
order?: 'asc' | 'desc';
|
|
22531
|
+
city?: string;
|
|
22532
|
+
category_key?: string;
|
|
22533
|
+
listing_tier?: string;
|
|
22534
|
+
status?: 'draft' | 'active' | 'pending' | 'suspended';
|
|
22535
|
+
search?: string;
|
|
22536
|
+
fields?: string;
|
|
22537
|
+
}
|
|
22538
|
+
interface CreateDirectoryListingBody {
|
|
22539
|
+
name: string;
|
|
22540
|
+
slug: string;
|
|
22541
|
+
city: string;
|
|
22542
|
+
category_key: string;
|
|
22543
|
+
description?: string;
|
|
22544
|
+
phone?: string;
|
|
22545
|
+
email?: string;
|
|
22546
|
+
website?: string;
|
|
22547
|
+
address?: string;
|
|
22548
|
+
address_line_2?: string;
|
|
22549
|
+
address_line_3?: string;
|
|
22550
|
+
postcode?: string;
|
|
22551
|
+
latitude?: number;
|
|
22552
|
+
longitude?: number;
|
|
22553
|
+
region?: string;
|
|
22554
|
+
country?: string;
|
|
22555
|
+
logo_id?: string;
|
|
22556
|
+
image_ids?: string[];
|
|
22557
|
+
social?: Record<string, string>;
|
|
22558
|
+
opening_hours?: unknown;
|
|
22559
|
+
services?: string[];
|
|
22560
|
+
amenities?: string[];
|
|
22561
|
+
price_range?: string;
|
|
22562
|
+
additional_details?: Array<{
|
|
22563
|
+
label: string;
|
|
22564
|
+
value: string;
|
|
22565
|
+
}>;
|
|
22566
|
+
accessibility?: Record<string, boolean>;
|
|
22567
|
+
listing_tier?: string | null;
|
|
22568
|
+
status?: 'draft' | 'active' | 'pending' | 'suspended';
|
|
22569
|
+
verified?: boolean | null;
|
|
22570
|
+
source_url?: string;
|
|
22571
|
+
}
|
|
22572
|
+
type UpdateDirectoryListingBody = Partial<CreateDirectoryListingBody>;
|
|
22573
|
+
interface ClaimListingBody {
|
|
22574
|
+
verification_method?: 'email' | 'phone' | 'manual';
|
|
22575
|
+
proposed_changes?: Record<string, unknown>;
|
|
22576
|
+
}
|
|
22577
|
+
declare class DirectoryResource {
|
|
22578
|
+
private client;
|
|
22579
|
+
constructor(client: Hydra);
|
|
22580
|
+
/** List directory listings with optional filters and pagination. */
|
|
22581
|
+
list(params?: ListDirectoryListingsParams): Promise<ListResponse<DirectoryListing>>;
|
|
22582
|
+
/** Async iterator over all directory listings, fetching pages lazily. */
|
|
22583
|
+
iterate(params?: Omit<ListDirectoryListingsParams, 'cursor'>, options?: PaginateOptions): AsyncGenerator<DirectoryListing, void, undefined>;
|
|
22584
|
+
/** Collect all directory listings into an array. */
|
|
22585
|
+
toArray(params?: Omit<ListDirectoryListingsParams, 'cursor'>, options?: PaginateOptions & {
|
|
22586
|
+
limit?: number;
|
|
22587
|
+
}): Promise<DirectoryListing[]>;
|
|
22588
|
+
/** Get a single directory listing by ID. */
|
|
22589
|
+
get(id: string): Promise<DataResponse<DirectoryListing>>;
|
|
22590
|
+
/** Create a new directory listing. Requires a secret key. */
|
|
22591
|
+
create(body: CreateDirectoryListingBody, options?: ResourceRequestOptions): Promise<DataResponse<DirectoryListing>>;
|
|
22592
|
+
/** Update a directory listing. Requires a secret key. */
|
|
22593
|
+
update(id: string, body: UpdateDirectoryListingBody): Promise<DataResponse<DirectoryListing>>;
|
|
22594
|
+
/** Delete a directory listing. Requires a secret key. */
|
|
22595
|
+
delete(id: string): Promise<void>;
|
|
22596
|
+
/** Submit a claim request for a directory listing. */
|
|
22597
|
+
claim(id: string, body: ClaimListingBody, options?: ResourceRequestOptions): Promise<DataResponse<DirectoryClaim>>;
|
|
22598
|
+
/** Get the public category taxonomy. */
|
|
22599
|
+
getCategories(): Promise<DataResponse<{
|
|
22600
|
+
categories: DirectoryCategory[];
|
|
22601
|
+
}>>;
|
|
22602
|
+
/** Get the active tier definitions. */
|
|
22603
|
+
getTiers(): Promise<DataResponse<{
|
|
22604
|
+
tiers: DirectoryTier[];
|
|
22605
|
+
}>>;
|
|
22606
|
+
}
|
|
22607
|
+
|
|
22361
22608
|
interface AppInfo {
|
|
22362
22609
|
/** Integration/plugin name (e.g. "MyShopTheme") */
|
|
22363
22610
|
name: string;
|
|
@@ -22453,6 +22700,9 @@ declare class Hydra {
|
|
|
22453
22700
|
readonly me: MeResource;
|
|
22454
22701
|
readonly forms: FormsResource;
|
|
22455
22702
|
readonly formSubmissions: FormSubmissionsResource;
|
|
22703
|
+
readonly directory: DirectoryResource;
|
|
22704
|
+
readonly directoryCategories: DirectoryCategoriesResource;
|
|
22705
|
+
readonly directoryTiers: DirectoryTiersResource;
|
|
22456
22706
|
constructor(config: HydraConfig);
|
|
22457
22707
|
request<T>(method: string, path: string, options?: RequestOptions): Promise<T>;
|
|
22458
22708
|
/** Multipart upload for file-based endpoints (e.g. images) */
|
|
@@ -22534,4 +22784,4 @@ declare class HydraIdempotencyError extends HydraError {
|
|
|
22534
22784
|
constructor(body: HydraErrorBody, headers: Headers);
|
|
22535
22785
|
}
|
|
22536
22786
|
|
|
22537
|
-
export { AddressesResource, type AnalyticsActionItems$1 as AnalyticsActionItems, type AnalyticsOrdersSeries$1 as AnalyticsOrdersSeries, AnalyticsResource, type AnalyticsSummary$1 as AnalyticsSummary, type AnalyticsTimeSeries$1 as AnalyticsTimeSeries, type AnalyticsTopProduct$1 as AnalyticsTopProduct, type AppInfo, type Appointment$1 as Appointment, type AuthCustomer, AuthResource, type AvailabilityOverride$1 as AvailabilityOverride, BookingsResource, type Cart$1 as Cart, type CartItem, CartResource, type ChangePasswordBody, type Channel$1 as Channel, ChannelsResource, type CheckoutCreate$1 as CheckoutCreate, type CheckoutGet$1 as CheckoutGet, type CheckoutListItem$1 as CheckoutListItem, CheckoutResource, CheckoutsResource, type Collection$1 as Collection, CollectionsResource, CompaniesResource, type Company$1 as Company, ContentCategoriesResource, type ContentCategory$1 as ContentCategory, type CreateGiftCardBody, type CreditBalance, type Customer$1 as Customer, type CustomerGroup$1 as CustomerGroup, CustomerGroupsResource, type CustomerMembership$1 as CustomerMembership, type CustomerPhoto$1 as CustomerPhoto, CustomerPhotosResource, CustomersResource, type DataResponse, type DayAvailability$1 as DayAvailability, type Discount$1 as Discount, DiscountsResource, type DraftOrder$1 as DraftOrder, DraftOrdersResource, type ExchangeRate$1 as ExchangeRate, ExchangeRatesResource, type FormDefinition$1 as FormDefinition, type FormField$1 as FormField, type FormFieldPublic, type FormPublic$1 as FormPublic, type FormSubmission$1 as FormSubmission, FormSubmissionsResource, FormsResource, type Fulfillment$1 as Fulfillment, type FulfillmentOrder$2 as FulfillmentOrder, FulfillmentOrdersResource, FulfillmentsResource, type GenerateVariantsResult$1 as GenerateVariantsResult, type GiftCard, type GiftCardConvertResult, type CreditDebitBody as GiftCardCreditDebitBody, type GiftCardLookup, type GiftCardTransaction, GiftCardsResource, Hydra, HydraAuthenticationError, type HydraConfig, HydraConnectionError, HydraError, type HydraErrorBody, HydraIdempotencyError, HydraNotFoundError, HydraPermissionError, HydraRateLimitError, HydraValidationError, type Image$2 as Image, ImagesResource, IntegrationsResource, type InventoryLevel$1 as InventoryLevel, InventoryResource, type ListGiftCardTransactionsParams, type ListGiftCardsParams, type ListResponse, type Location$1 as Location, LocationsResource, type LoginBody, type Lookbook$1 as Lookbook, type LookbookTag$1 as LookbookTag, LookbooksResource, type LoyaltySummary, type CreateAddressBody as MeCreateAddressBody, type MeOrdersParams, MeResource, type UpdateAddressBody as MeUpdateAddressBody, type MembershipPlan$1 as MembershipPlan, MembershipPlansResource, type MessageResponse, MetafieldsResource, type NotificationLog$1 as NotificationLog, NotificationsResource, type Order$2 as Order, OrdersResource, type PaginateOptions, type Pagination, type PosAnalyticsDashboard, type Post$1 as Post, PostsResource, type Product$1 as Product, type ProductStats$1 as ProductStats, ProductsResource, type Promotion$1 as Promotion, PromotionsResource, type PurchaseOrder$1 as PurchaseOrder, PurchaseOrdersResource, type Redirect$1 as Redirect, RedirectsResource, type Refund$1 as Refund, RefundsResource, type RegisterBody, type RequestOptions, type ResourceRequestOptions, type Return$1 as Return, ReturnsResource, SearchResource, type ShippingRate$1 as ShippingRate, ShippingResource, type ShippingZone$1 as ShippingZone, type Slot, type Store$1 as Store, StoreCreditResource, StoreResource, type SuggestedSlot$1 as SuggestedSlot, type Tag$1 as Tag, TagsResource, type TaxExemption$1 as TaxExemption, type TaxGroup$1 as TaxGroup, type TaxRate$1 as TaxRate, TaxResource, type TokenResponse, type UpdateGiftCardBody, type UpdateProfileBody, type Variant$2 as Variant, type VariantPrice$1 as VariantPrice, VariantsResource, type Webhook$1 as Webhook, WebhooksResource, paginate, toArray };
|
|
22787
|
+
export { AddressesResource, type AnalyticsActionItems$1 as AnalyticsActionItems, type AnalyticsOrdersSeries$1 as AnalyticsOrdersSeries, AnalyticsResource, type AnalyticsSummary$1 as AnalyticsSummary, type AnalyticsTimeSeries$1 as AnalyticsTimeSeries, type AnalyticsTopProduct$1 as AnalyticsTopProduct, type AppInfo, type Appointment$1 as Appointment, type AuthCustomer, AuthResource, type AvailabilityOverride$1 as AvailabilityOverride, BookingsResource, type Cart$1 as Cart, type CartItem, CartResource, type ChangePasswordBody, type Channel$1 as Channel, ChannelsResource, type CheckoutCreate$1 as CheckoutCreate, type CheckoutGet$1 as CheckoutGet, type CheckoutListItem$1 as CheckoutListItem, CheckoutResource, CheckoutsResource, type ClaimListingBody, type Collection$1 as Collection, CollectionsResource, CompaniesResource, type Company$1 as Company, ContentCategoriesResource, type ContentCategory$1 as ContentCategory, type CreateDirectoryCategoryBody, type CreateDirectoryListingBody, type CreateDirectoryTierBody, type CreateGiftCardBody, type CreditBalance, type Customer$1 as Customer, type CustomerGroup$1 as CustomerGroup, CustomerGroupsResource, type CustomerMembership$1 as CustomerMembership, type CustomerPhoto$1 as CustomerPhoto, CustomerPhotosResource, CustomersResource, type DataResponse, type DayAvailability$1 as DayAvailability, DirectoryCategoriesResource, type DirectoryCategory, type DirectoryClaim, type DirectoryListing, DirectoryResource, type DirectorySettings, type DirectoryTier, type DirectoryTierRule, DirectoryTiersResource, type Discount$1 as Discount, DiscountsResource, type DraftOrder$1 as DraftOrder, DraftOrdersResource, type ExchangeRate$1 as ExchangeRate, ExchangeRatesResource, type FormDefinition$1 as FormDefinition, type FormField$1 as FormField, type FormFieldPublic, type FormPublic$1 as FormPublic, type FormSubmission$1 as FormSubmission, FormSubmissionsResource, FormsResource, type Fulfillment$1 as Fulfillment, type FulfillmentOrder$2 as FulfillmentOrder, FulfillmentOrdersResource, FulfillmentsResource, type GenerateVariantsResult$1 as GenerateVariantsResult, type GiftCard, type GiftCardConvertResult, type CreditDebitBody as GiftCardCreditDebitBody, type GiftCardLookup, type GiftCardTransaction, GiftCardsResource, Hydra, HydraAuthenticationError, type HydraConfig, HydraConnectionError, HydraError, type HydraErrorBody, HydraIdempotencyError, HydraNotFoundError, HydraPermissionError, HydraRateLimitError, HydraValidationError, type Image$2 as Image, ImagesResource, IntegrationsResource, type InventoryLevel$1 as InventoryLevel, InventoryResource, type ListDirectoryListingsParams, type ListGiftCardTransactionsParams, type ListGiftCardsParams, type ListResponse, type Location$1 as Location, LocationsResource, type LoginBody, type Lookbook$1 as Lookbook, type LookbookTag$1 as LookbookTag, LookbooksResource, type LoyaltySummary, type CreateAddressBody as MeCreateAddressBody, type MeOrdersParams, MeResource, type UpdateAddressBody as MeUpdateAddressBody, type MembershipPlan$1 as MembershipPlan, MembershipPlansResource, type MessageResponse, MetafieldsResource, type NotificationLog$1 as NotificationLog, NotificationsResource, type Order$2 as Order, OrdersResource, type PaginateOptions, type Pagination, type PosAnalyticsDashboard, type Post$1 as Post, PostsResource, type Product$1 as Product, type ProductStats$1 as ProductStats, ProductsResource, type Promotion$1 as Promotion, PromotionsResource, type PurchaseOrder$1 as PurchaseOrder, PurchaseOrdersResource, type Redirect$1 as Redirect, RedirectsResource, type Refund$1 as Refund, RefundsResource, type RegisterBody, type ReorderDirectoryCategoriesBody, type ReorderDirectoryTiersBody, type RequestOptions, type ResourceRequestOptions, type Return$1 as Return, ReturnsResource, SearchResource, type ShippingRate$1 as ShippingRate, ShippingResource, type ShippingZone$1 as ShippingZone, type Slot, type Store$1 as Store, StoreCreditResource, StoreResource, type SuggestedSlot$1 as SuggestedSlot, type Tag$1 as Tag, TagsResource, type TaxExemption$1 as TaxExemption, type TaxGroup$1 as TaxGroup, type TaxRate$1 as TaxRate, TaxResource, type TokenResponse, type UpdateDirectoryCategoryBody, type UpdateDirectoryListingBody, type UpdateDirectorySettingsBody, type UpdateDirectoryTierBody, type UpdateGiftCardBody, type UpdateProfileBody, type Variant$2 as Variant, type VariantPrice$1 as VariantPrice, VariantsResource, type Webhook$1 as Webhook, WebhooksResource, paginate, toArray };
|
package/dist/index.js
CHANGED
|
@@ -2028,6 +2028,126 @@ var MeResource = class {
|
|
|
2028
2028
|
}
|
|
2029
2029
|
};
|
|
2030
2030
|
|
|
2031
|
+
// src/resources/directory.ts
|
|
2032
|
+
var DirectoryResource = class {
|
|
2033
|
+
constructor(client) {
|
|
2034
|
+
this.client = client;
|
|
2035
|
+
}
|
|
2036
|
+
client;
|
|
2037
|
+
/** List directory listings with optional filters and pagination. */
|
|
2038
|
+
async list(params) {
|
|
2039
|
+
return this.client.request("GET", "/v1/directory", { params });
|
|
2040
|
+
}
|
|
2041
|
+
/** Async iterator over all directory listings, fetching pages lazily. */
|
|
2042
|
+
iterate(params, options) {
|
|
2043
|
+
return paginate((cursor) => this.list({ ...params, cursor }), options);
|
|
2044
|
+
}
|
|
2045
|
+
/** Collect all directory listings into an array. */
|
|
2046
|
+
async toArray(params, options) {
|
|
2047
|
+
return toArray(this.iterate(params, options), options);
|
|
2048
|
+
}
|
|
2049
|
+
/** Get a single directory listing by ID. */
|
|
2050
|
+
async get(id) {
|
|
2051
|
+
return this.client.request("GET", `/v1/directory/${id}`);
|
|
2052
|
+
}
|
|
2053
|
+
/** Create a new directory listing. Requires a secret key. */
|
|
2054
|
+
async create(body, options) {
|
|
2055
|
+
return this.client.request("POST", "/v1/directory", { body, ...options });
|
|
2056
|
+
}
|
|
2057
|
+
/** Update a directory listing. Requires a secret key. */
|
|
2058
|
+
async update(id, body) {
|
|
2059
|
+
return this.client.request("PATCH", `/v1/directory/${id}`, { body });
|
|
2060
|
+
}
|
|
2061
|
+
/** Delete a directory listing. Requires a secret key. */
|
|
2062
|
+
async delete(id) {
|
|
2063
|
+
return this.client.request("DELETE", `/v1/directory/${id}`);
|
|
2064
|
+
}
|
|
2065
|
+
/** Submit a claim request for a directory listing. */
|
|
2066
|
+
async claim(id, body, options) {
|
|
2067
|
+
return this.client.request("POST", `/v1/directory/${id}/claim`, { body, ...options });
|
|
2068
|
+
}
|
|
2069
|
+
/** Get the public category taxonomy. */
|
|
2070
|
+
async getCategories() {
|
|
2071
|
+
return this.client.request("GET", "/v1/directory/categories");
|
|
2072
|
+
}
|
|
2073
|
+
/** Get the active tier definitions. */
|
|
2074
|
+
async getTiers() {
|
|
2075
|
+
return this.client.request("GET", "/v1/directory/tiers");
|
|
2076
|
+
}
|
|
2077
|
+
};
|
|
2078
|
+
|
|
2079
|
+
// src/resources/directory-categories.ts
|
|
2080
|
+
var DirectoryCategoriesResource = class {
|
|
2081
|
+
constructor(client) {
|
|
2082
|
+
this.client = client;
|
|
2083
|
+
}
|
|
2084
|
+
client;
|
|
2085
|
+
/** List all directory categories. Requires a secret key. */
|
|
2086
|
+
async list() {
|
|
2087
|
+
return this.client.request("GET", "/v1/store/directory-categories");
|
|
2088
|
+
}
|
|
2089
|
+
/** Get a single directory category by slug. Requires a secret key. */
|
|
2090
|
+
async get(slug) {
|
|
2091
|
+
return this.client.request("GET", `/v1/store/directory-categories/${slug}`);
|
|
2092
|
+
}
|
|
2093
|
+
/** Create a new directory category. Requires a secret key. */
|
|
2094
|
+
async create(body, options) {
|
|
2095
|
+
return this.client.request("POST", "/v1/store/directory-categories", { body, ...options });
|
|
2096
|
+
}
|
|
2097
|
+
/** Update a directory category. Requires a secret key. */
|
|
2098
|
+
async update(slug, body) {
|
|
2099
|
+
return this.client.request("PATCH", `/v1/store/directory-categories/${slug}`, { body });
|
|
2100
|
+
}
|
|
2101
|
+
/** Delete a directory category. Children are re-parented. Requires a secret key. */
|
|
2102
|
+
async delete(slug) {
|
|
2103
|
+
return this.client.request("DELETE", `/v1/store/directory-categories/${slug}`);
|
|
2104
|
+
}
|
|
2105
|
+
/** Bulk reorder categories (parent assignments and positions). Requires a secret key. */
|
|
2106
|
+
async reorder(body) {
|
|
2107
|
+
return this.client.request("POST", "/v1/store/directory-categories/reorder", { body });
|
|
2108
|
+
}
|
|
2109
|
+
/** Get directory-wide settings. Requires a secret key. */
|
|
2110
|
+
async getSettings() {
|
|
2111
|
+
return this.client.request("GET", "/v1/store/directory-categories/settings");
|
|
2112
|
+
}
|
|
2113
|
+
/** Update directory-wide settings. Requires a secret key. */
|
|
2114
|
+
async updateSettings(body) {
|
|
2115
|
+
return this.client.request("PATCH", "/v1/store/directory-categories/settings", { body });
|
|
2116
|
+
}
|
|
2117
|
+
};
|
|
2118
|
+
|
|
2119
|
+
// src/resources/directory-tiers.ts
|
|
2120
|
+
var DirectoryTiersResource = class {
|
|
2121
|
+
constructor(client) {
|
|
2122
|
+
this.client = client;
|
|
2123
|
+
}
|
|
2124
|
+
client;
|
|
2125
|
+
/** List all directory tiers. Requires a secret key. */
|
|
2126
|
+
async list() {
|
|
2127
|
+
return this.client.request("GET", "/v1/store/directory-tiers");
|
|
2128
|
+
}
|
|
2129
|
+
/** Get a single directory tier by slug. Requires a secret key. */
|
|
2130
|
+
async get(slug) {
|
|
2131
|
+
return this.client.request("GET", `/v1/store/directory-tiers/${slug}`);
|
|
2132
|
+
}
|
|
2133
|
+
/** Create a new directory tier. Requires a secret key. */
|
|
2134
|
+
async create(body, options) {
|
|
2135
|
+
return this.client.request("POST", "/v1/store/directory-tiers", { body, ...options });
|
|
2136
|
+
}
|
|
2137
|
+
/** Update a directory tier. Requires a secret key. */
|
|
2138
|
+
async update(slug, body) {
|
|
2139
|
+
return this.client.request("PATCH", `/v1/store/directory-tiers/${slug}`, { body });
|
|
2140
|
+
}
|
|
2141
|
+
/** Delete a directory tier. Requires a secret key. */
|
|
2142
|
+
async delete(slug) {
|
|
2143
|
+
return this.client.request("DELETE", `/v1/store/directory-tiers/${slug}`);
|
|
2144
|
+
}
|
|
2145
|
+
/** Bulk reorder tiers. Requires a secret key. */
|
|
2146
|
+
async reorder(body) {
|
|
2147
|
+
return this.client.request("POST", "/v1/store/directory-tiers/reorder", { body });
|
|
2148
|
+
}
|
|
2149
|
+
};
|
|
2150
|
+
|
|
2031
2151
|
// src/client.ts
|
|
2032
2152
|
var SDK_VERSION = "0.1.0";
|
|
2033
2153
|
var INITIAL_RETRY_DELAY = 0.5;
|
|
@@ -2133,6 +2253,10 @@ var Hydra = class {
|
|
|
2133
2253
|
// P13: Forms
|
|
2134
2254
|
forms = new FormsResource(this);
|
|
2135
2255
|
formSubmissions = new FormSubmissionsResource(this);
|
|
2256
|
+
// P14: Directory
|
|
2257
|
+
directory = new DirectoryResource(this);
|
|
2258
|
+
directoryCategories = new DirectoryCategoriesResource(this);
|
|
2259
|
+
directoryTiers = new DirectoryTiersResource(this);
|
|
2136
2260
|
constructor(config) {
|
|
2137
2261
|
for (const key of Object.keys(config)) {
|
|
2138
2262
|
if (!VALID_CONFIG_KEYS.has(key)) {
|
|
@@ -2362,6 +2486,9 @@ export {
|
|
|
2362
2486
|
CustomerGroupsResource,
|
|
2363
2487
|
CustomerPhotosResource,
|
|
2364
2488
|
CustomersResource,
|
|
2489
|
+
DirectoryCategoriesResource,
|
|
2490
|
+
DirectoryResource,
|
|
2491
|
+
DirectoryTiersResource,
|
|
2365
2492
|
DiscountsResource,
|
|
2366
2493
|
DraftOrdersResource,
|
|
2367
2494
|
ExchangeRatesResource,
|