@gethydra/sdk 0.1.2 → 0.1.4
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 +113 -0
- package/dist/index.js +10 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -585,6 +585,10 @@ interface components {
|
|
|
585
585
|
fulfillment_type: "physical" | "digital" | "service";
|
|
586
586
|
/** @example Restocking in Q3. */
|
|
587
587
|
internal_notes: string | null;
|
|
588
|
+
/** @example Polished Titanium */
|
|
589
|
+
link_label: string | null;
|
|
590
|
+
/** @example Finish */
|
|
591
|
+
link_heading: string | null;
|
|
588
592
|
/** @example 1 */
|
|
589
593
|
qty_step: number | null;
|
|
590
594
|
/** @example 2026-09-01 */
|
|
@@ -619,6 +623,7 @@ interface components {
|
|
|
619
623
|
}[];
|
|
620
624
|
variants?: components["schemas"]["Variant"][];
|
|
621
625
|
images?: components["schemas"]["Image"][];
|
|
626
|
+
links?: components["schemas"]["ProductLink"][];
|
|
622
627
|
seo: {
|
|
623
628
|
/** @example Classic Cotton T-Shirt | My Store */
|
|
624
629
|
title?: string;
|
|
@@ -795,6 +800,22 @@ interface components {
|
|
|
795
800
|
*/
|
|
796
801
|
updated_at: string;
|
|
797
802
|
};
|
|
803
|
+
ProductLink: {
|
|
804
|
+
/** @example prod_abc123 */
|
|
805
|
+
product_id: string;
|
|
806
|
+
/** @example ring-polished-titanium */
|
|
807
|
+
handle: string;
|
|
808
|
+
/** @example Ring — Polished Titanium */
|
|
809
|
+
title: string;
|
|
810
|
+
/** @example Polished Titanium */
|
|
811
|
+
link_label: string | null;
|
|
812
|
+
/** @example https://cdn.hydrajs.dev/... */
|
|
813
|
+
image_src: string | null;
|
|
814
|
+
/** @example 0 */
|
|
815
|
+
position: number;
|
|
816
|
+
/** @example false */
|
|
817
|
+
is_current: boolean;
|
|
818
|
+
};
|
|
798
819
|
ProductStats: {
|
|
799
820
|
/** @example 42 */
|
|
800
821
|
sold_this_month: number;
|
|
@@ -5918,6 +5939,7 @@ interface operations {
|
|
|
5918
5939
|
status?: "active" | "draft" | "archived" | "preorder" | "coming_soon" | "discontinued";
|
|
5919
5940
|
/** @description Filter by exact handle (URL slug) */
|
|
5920
5941
|
handle?: string;
|
|
5942
|
+
/** @description Filter by collection membership (supports both manual and automatic collections) */
|
|
5921
5943
|
collection_id?: string;
|
|
5922
5944
|
created_after?: string;
|
|
5923
5945
|
created_before?: string;
|
|
@@ -6000,6 +6022,10 @@ interface operations {
|
|
|
6000
6022
|
fulfillment_type?: "physical" | "digital" | "service";
|
|
6001
6023
|
/** @example Restocking in Q3. */
|
|
6002
6024
|
internal_notes?: string;
|
|
6025
|
+
/** @example Polished Titanium */
|
|
6026
|
+
link_label?: string | null;
|
|
6027
|
+
/** @example Finish */
|
|
6028
|
+
link_heading?: string | null;
|
|
6003
6029
|
/** @example 1 */
|
|
6004
6030
|
qty_step?: number;
|
|
6005
6031
|
preorder_expected_date?: string | null;
|
|
@@ -6155,6 +6181,10 @@ interface operations {
|
|
|
6155
6181
|
fulfillment_type?: "physical" | "digital" | "service";
|
|
6156
6182
|
/** @example Restocking in Q3. */
|
|
6157
6183
|
internal_notes?: string;
|
|
6184
|
+
/** @example Polished Titanium */
|
|
6185
|
+
link_label?: string | null;
|
|
6186
|
+
/** @example Finish */
|
|
6187
|
+
link_heading?: string | null;
|
|
6158
6188
|
/** @example 1 */
|
|
6159
6189
|
qty_step?: number;
|
|
6160
6190
|
preorder_expected_date?: string | null;
|
|
@@ -6355,6 +6385,10 @@ interface operations {
|
|
|
6355
6385
|
fulfillment_type?: "physical" | "digital" | "service";
|
|
6356
6386
|
/** @example Restocking in Q3. */
|
|
6357
6387
|
internal_notes?: string | null;
|
|
6388
|
+
/** @example Polished Titanium */
|
|
6389
|
+
link_label?: string | null;
|
|
6390
|
+
/** @example Finish */
|
|
6391
|
+
link_heading?: string | null;
|
|
6358
6392
|
/** @example 1 */
|
|
6359
6393
|
qty_step?: number | null;
|
|
6360
6394
|
preorder_expected_date?: string | null;
|
|
@@ -6730,6 +6764,80 @@ interface operations {
|
|
|
6730
6764
|
};
|
|
6731
6765
|
};
|
|
6732
6766
|
};
|
|
6767
|
+
listProductLinks: {
|
|
6768
|
+
parameters: {
|
|
6769
|
+
query?: never;
|
|
6770
|
+
header?: never;
|
|
6771
|
+
path: {
|
|
6772
|
+
id: string;
|
|
6773
|
+
};
|
|
6774
|
+
cookie?: never;
|
|
6775
|
+
};
|
|
6776
|
+
requestBody?: never;
|
|
6777
|
+
responses: {
|
|
6778
|
+
/** @description Linked products list */
|
|
6779
|
+
200: {
|
|
6780
|
+
headers: {
|
|
6781
|
+
[name: string]: unknown;
|
|
6782
|
+
};
|
|
6783
|
+
content: {
|
|
6784
|
+
"application/json": {
|
|
6785
|
+
data: components["schemas"]["ProductLink"][];
|
|
6786
|
+
};
|
|
6787
|
+
};
|
|
6788
|
+
};
|
|
6789
|
+
};
|
|
6790
|
+
};
|
|
6791
|
+
createProductLink: {
|
|
6792
|
+
parameters: {
|
|
6793
|
+
query?: never;
|
|
6794
|
+
header?: never;
|
|
6795
|
+
path: {
|
|
6796
|
+
id: string;
|
|
6797
|
+
};
|
|
6798
|
+
cookie?: never;
|
|
6799
|
+
};
|
|
6800
|
+
requestBody?: {
|
|
6801
|
+
content: {
|
|
6802
|
+
"application/json": {
|
|
6803
|
+
/** @example prod_abc123 */
|
|
6804
|
+
target_product_id: string;
|
|
6805
|
+
/** @example 0 */
|
|
6806
|
+
position?: number;
|
|
6807
|
+
};
|
|
6808
|
+
};
|
|
6809
|
+
};
|
|
6810
|
+
responses: {
|
|
6811
|
+
/** @description Product link created */
|
|
6812
|
+
201: {
|
|
6813
|
+
headers: {
|
|
6814
|
+
[name: string]: unknown;
|
|
6815
|
+
};
|
|
6816
|
+
content?: never;
|
|
6817
|
+
};
|
|
6818
|
+
};
|
|
6819
|
+
};
|
|
6820
|
+
deleteProductLink: {
|
|
6821
|
+
parameters: {
|
|
6822
|
+
query?: never;
|
|
6823
|
+
header?: never;
|
|
6824
|
+
path: {
|
|
6825
|
+
id: string;
|
|
6826
|
+
target_id: string;
|
|
6827
|
+
};
|
|
6828
|
+
cookie?: never;
|
|
6829
|
+
};
|
|
6830
|
+
requestBody?: never;
|
|
6831
|
+
responses: {
|
|
6832
|
+
/** @description Product link deleted */
|
|
6833
|
+
204: {
|
|
6834
|
+
headers: {
|
|
6835
|
+
[name: string]: unknown;
|
|
6836
|
+
};
|
|
6837
|
+
content?: never;
|
|
6838
|
+
};
|
|
6839
|
+
};
|
|
6840
|
+
};
|
|
6733
6841
|
listProductMetafieldValues: {
|
|
6734
6842
|
parameters: {
|
|
6735
6843
|
query?: never;
|
|
@@ -17014,6 +17122,8 @@ type DuplicateBody = NonNullable<operations['duplicateProduct']['requestBody']>[
|
|
|
17014
17122
|
type CreateVariantBody = NonNullable<operations['createProductVariant']['requestBody']>['content']['application/json'];
|
|
17015
17123
|
type GenerateVariantsBody = NonNullable<operations['generateProductVariants']['requestBody']>['content']['application/json'];
|
|
17016
17124
|
type AttachImagesBody = NonNullable<operations['attachProductImages']['requestBody']>['content']['application/json'];
|
|
17125
|
+
type ProductLink = components['schemas']['ProductLink'];
|
|
17126
|
+
type CreateProductLinkBody = NonNullable<operations['createProductLink']['requestBody']>['content']['application/json'];
|
|
17017
17127
|
declare class ProductsResource {
|
|
17018
17128
|
private client;
|
|
17019
17129
|
constructor(client: Hydra);
|
|
@@ -17041,6 +17151,9 @@ declare class ProductsResource {
|
|
|
17041
17151
|
value: unknown;
|
|
17042
17152
|
}): Promise<DataResponse<unknown>>;
|
|
17043
17153
|
clearMetafield(productId: string, slug: string): Promise<void>;
|
|
17154
|
+
listLinks(productId: string): Promise<DataResponse<ProductLink[]>>;
|
|
17155
|
+
createLink(productId: string, body: CreateProductLinkBody, options?: ResourceRequestOptions): Promise<DataResponse<Record<string, string>>>;
|
|
17156
|
+
deleteLink(productId: string, targetProductId: string): Promise<void>;
|
|
17044
17157
|
}
|
|
17045
17158
|
|
|
17046
17159
|
type Variant = components['schemas']['Variant'];
|
package/dist/index.js
CHANGED
|
@@ -159,6 +159,16 @@ var ProductsResource = class {
|
|
|
159
159
|
async clearMetafield(productId, slug) {
|
|
160
160
|
return this.client.request("DELETE", `/v1/products/${productId}/metafields/${slug}`);
|
|
161
161
|
}
|
|
162
|
+
// Linked product sub-resources
|
|
163
|
+
async listLinks(productId) {
|
|
164
|
+
return this.client.request("GET", `/v1/products/${productId}/links`);
|
|
165
|
+
}
|
|
166
|
+
async createLink(productId, body, options) {
|
|
167
|
+
return this.client.request("POST", `/v1/products/${productId}/links`, { body, ...options });
|
|
168
|
+
}
|
|
169
|
+
async deleteLink(productId, targetProductId) {
|
|
170
|
+
return this.client.request("DELETE", `/v1/products/${productId}/links/${targetProductId}`);
|
|
171
|
+
}
|
|
162
172
|
};
|
|
163
173
|
|
|
164
174
|
// src/resources/variants.ts
|