@gethydra/sdk 0.5.0 → 0.6.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.ts +63 -1
- package/dist/index.js +37 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -23934,6 +23934,67 @@ declare class GeoResource {
|
|
|
23934
23934
|
}>;
|
|
23935
23935
|
}
|
|
23936
23936
|
|
|
23937
|
+
interface DeployHook {
|
|
23938
|
+
id: string;
|
|
23939
|
+
name: string;
|
|
23940
|
+
type: 'github_actions' | 'http';
|
|
23941
|
+
url: string;
|
|
23942
|
+
/** Masked on read; full value returned only on creation */
|
|
23943
|
+
secret: string | null;
|
|
23944
|
+
event_type: string | null;
|
|
23945
|
+
status: 'active' | 'paused';
|
|
23946
|
+
last_triggered_at: string | null;
|
|
23947
|
+
last_status: 'success' | 'failed' | null;
|
|
23948
|
+
last_http_status: number | null;
|
|
23949
|
+
last_error: string | null;
|
|
23950
|
+
consecutive_failures: number;
|
|
23951
|
+
auto_pause_threshold: number;
|
|
23952
|
+
created_at: string;
|
|
23953
|
+
updated_at: string;
|
|
23954
|
+
}
|
|
23955
|
+
interface DeployHookTestResult {
|
|
23956
|
+
hook_id: string;
|
|
23957
|
+
success: boolean;
|
|
23958
|
+
http_status: number | null;
|
|
23959
|
+
error: string | null;
|
|
23960
|
+
}
|
|
23961
|
+
interface ListDeployHooksParams {
|
|
23962
|
+
limit?: number;
|
|
23963
|
+
cursor?: string;
|
|
23964
|
+
order?: 'asc' | 'desc';
|
|
23965
|
+
fields?: string;
|
|
23966
|
+
}
|
|
23967
|
+
interface CreateDeployHookBody {
|
|
23968
|
+
name: string;
|
|
23969
|
+
type: 'github_actions' | 'http';
|
|
23970
|
+
url: string;
|
|
23971
|
+
secret?: string;
|
|
23972
|
+
event_type?: string;
|
|
23973
|
+
auto_pause_threshold?: number;
|
|
23974
|
+
}
|
|
23975
|
+
interface UpdateDeployHookBody {
|
|
23976
|
+
name?: string;
|
|
23977
|
+
url?: string;
|
|
23978
|
+
secret?: string;
|
|
23979
|
+
event_type?: string;
|
|
23980
|
+
status?: 'active' | 'paused';
|
|
23981
|
+
auto_pause_threshold?: number;
|
|
23982
|
+
}
|
|
23983
|
+
declare class DeployHooksResource {
|
|
23984
|
+
private client;
|
|
23985
|
+
constructor(client: Hydra);
|
|
23986
|
+
list(params?: ListDeployHooksParams): Promise<ListResponse<DeployHook>>;
|
|
23987
|
+
iterate(params?: Omit<ListDeployHooksParams, 'cursor'>, options?: PaginateOptions): AsyncGenerator<DeployHook, void, undefined>;
|
|
23988
|
+
toArray(params?: Omit<ListDeployHooksParams, 'cursor'>, options?: PaginateOptions & {
|
|
23989
|
+
limit?: number;
|
|
23990
|
+
}): Promise<DeployHook[]>;
|
|
23991
|
+
get(id: string): Promise<DataResponse<DeployHook>>;
|
|
23992
|
+
create(body: CreateDeployHookBody, options?: ResourceRequestOptions): Promise<DataResponse<DeployHook>>;
|
|
23993
|
+
update(id: string, body: UpdateDeployHookBody): Promise<DataResponse<DeployHook>>;
|
|
23994
|
+
delete(id: string): Promise<void>;
|
|
23995
|
+
test(id: string): Promise<DataResponse<DeployHookTestResult>>;
|
|
23996
|
+
}
|
|
23997
|
+
|
|
23937
23998
|
interface AppInfo {
|
|
23938
23999
|
/** Integration/plugin name (e.g. "MyShopTheme") */
|
|
23939
24000
|
name: string;
|
|
@@ -24033,6 +24094,7 @@ declare class Hydra {
|
|
|
24033
24094
|
readonly directoryCategories: DirectoryCategoriesResource;
|
|
24034
24095
|
readonly directoryTiers: DirectoryTiersResource;
|
|
24035
24096
|
readonly geo: GeoResource;
|
|
24097
|
+
readonly deployHooks: DeployHooksResource;
|
|
24036
24098
|
constructor(config: HydraConfig);
|
|
24037
24099
|
request<T>(method: string, path: string, options?: RequestOptions): Promise<T>;
|
|
24038
24100
|
/** Multipart upload for file-based endpoints (e.g. images) */
|
|
@@ -24114,4 +24176,4 @@ declare class HydraIdempotencyError extends HydraError {
|
|
|
24114
24176
|
constructor(body: HydraErrorBody, headers: Headers);
|
|
24115
24177
|
}
|
|
24116
24178
|
|
|
24117
|
-
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 GeoCity, type GeoCountry, type GeoCountrySummary, type GeoOutcode, type GeoPostcode, type GeoRegion, GeoResource, 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 ListGeoCitiesParams, type ListGeoOutcodesParams, type ListGeoRegionsParams, 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 };
|
|
24179
|
+
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 CreateDeployHookBody, 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, type DeployHook, type DeployHookTestResult, DeployHooksResource, 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 GeoCity, type GeoCountry, type GeoCountrySummary, type GeoOutcode, type GeoPostcode, type GeoRegion, GeoResource, 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 ListDeployHooksParams, type ListDirectoryListingsParams, type ListGeoCitiesParams, type ListGeoOutcodesParams, type ListGeoRegionsParams, 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 UpdateDeployHookBody, 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
|
@@ -2198,6 +2198,40 @@ var GeoResource = class {
|
|
|
2198
2198
|
}
|
|
2199
2199
|
};
|
|
2200
2200
|
|
|
2201
|
+
// src/resources/deploy-hooks.ts
|
|
2202
|
+
var DeployHooksResource = class {
|
|
2203
|
+
constructor(client) {
|
|
2204
|
+
this.client = client;
|
|
2205
|
+
}
|
|
2206
|
+
client;
|
|
2207
|
+
async list(params) {
|
|
2208
|
+
return this.client.request("GET", "/v1/store/deploy-hooks", {
|
|
2209
|
+
params
|
|
2210
|
+
});
|
|
2211
|
+
}
|
|
2212
|
+
iterate(params, options) {
|
|
2213
|
+
return paginate((cursor) => this.list({ ...params, cursor }), options);
|
|
2214
|
+
}
|
|
2215
|
+
async toArray(params, options) {
|
|
2216
|
+
return toArray(this.iterate(params, options), options);
|
|
2217
|
+
}
|
|
2218
|
+
async get(id) {
|
|
2219
|
+
return this.client.request("GET", `/v1/store/deploy-hooks/${id}`);
|
|
2220
|
+
}
|
|
2221
|
+
async create(body, options) {
|
|
2222
|
+
return this.client.request("POST", "/v1/store/deploy-hooks", { body, ...options });
|
|
2223
|
+
}
|
|
2224
|
+
async update(id, body) {
|
|
2225
|
+
return this.client.request("PATCH", `/v1/store/deploy-hooks/${id}`, { body });
|
|
2226
|
+
}
|
|
2227
|
+
async delete(id) {
|
|
2228
|
+
return this.client.request("DELETE", `/v1/store/deploy-hooks/${id}`);
|
|
2229
|
+
}
|
|
2230
|
+
async test(id) {
|
|
2231
|
+
return this.client.request("POST", `/v1/store/deploy-hooks/${id}/test`);
|
|
2232
|
+
}
|
|
2233
|
+
};
|
|
2234
|
+
|
|
2201
2235
|
// src/client.ts
|
|
2202
2236
|
var SDK_VERSION = "0.1.0";
|
|
2203
2237
|
var INITIAL_RETRY_DELAY = 0.5;
|
|
@@ -2309,6 +2343,8 @@ var Hydra = class {
|
|
|
2309
2343
|
directoryTiers = new DirectoryTiersResource(this);
|
|
2310
2344
|
// P15: Geo Reference Data
|
|
2311
2345
|
geo = new GeoResource(this);
|
|
2346
|
+
// P16: Deploy Hooks
|
|
2347
|
+
deployHooks = new DeployHooksResource(this);
|
|
2312
2348
|
constructor(config) {
|
|
2313
2349
|
for (const key of Object.keys(config)) {
|
|
2314
2350
|
if (!VALID_CONFIG_KEYS.has(key)) {
|
|
@@ -2538,6 +2574,7 @@ export {
|
|
|
2538
2574
|
CustomerGroupsResource,
|
|
2539
2575
|
CustomerPhotosResource,
|
|
2540
2576
|
CustomersResource,
|
|
2577
|
+
DeployHooksResource,
|
|
2541
2578
|
DirectoryCategoriesResource,
|
|
2542
2579
|
DirectoryResource,
|
|
2543
2580
|
DirectoryTiersResource,
|