@gethydra/sdk 0.1.3 → 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 +112 -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;
|
|
@@ -6001,6 +6022,10 @@ interface operations {
|
|
|
6001
6022
|
fulfillment_type?: "physical" | "digital" | "service";
|
|
6002
6023
|
/** @example Restocking in Q3. */
|
|
6003
6024
|
internal_notes?: string;
|
|
6025
|
+
/** @example Polished Titanium */
|
|
6026
|
+
link_label?: string | null;
|
|
6027
|
+
/** @example Finish */
|
|
6028
|
+
link_heading?: string | null;
|
|
6004
6029
|
/** @example 1 */
|
|
6005
6030
|
qty_step?: number;
|
|
6006
6031
|
preorder_expected_date?: string | null;
|
|
@@ -6156,6 +6181,10 @@ interface operations {
|
|
|
6156
6181
|
fulfillment_type?: "physical" | "digital" | "service";
|
|
6157
6182
|
/** @example Restocking in Q3. */
|
|
6158
6183
|
internal_notes?: string;
|
|
6184
|
+
/** @example Polished Titanium */
|
|
6185
|
+
link_label?: string | null;
|
|
6186
|
+
/** @example Finish */
|
|
6187
|
+
link_heading?: string | null;
|
|
6159
6188
|
/** @example 1 */
|
|
6160
6189
|
qty_step?: number;
|
|
6161
6190
|
preorder_expected_date?: string | null;
|
|
@@ -6356,6 +6385,10 @@ interface operations {
|
|
|
6356
6385
|
fulfillment_type?: "physical" | "digital" | "service";
|
|
6357
6386
|
/** @example Restocking in Q3. */
|
|
6358
6387
|
internal_notes?: string | null;
|
|
6388
|
+
/** @example Polished Titanium */
|
|
6389
|
+
link_label?: string | null;
|
|
6390
|
+
/** @example Finish */
|
|
6391
|
+
link_heading?: string | null;
|
|
6359
6392
|
/** @example 1 */
|
|
6360
6393
|
qty_step?: number | null;
|
|
6361
6394
|
preorder_expected_date?: string | null;
|
|
@@ -6731,6 +6764,80 @@ interface operations {
|
|
|
6731
6764
|
};
|
|
6732
6765
|
};
|
|
6733
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
|
+
};
|
|
6734
6841
|
listProductMetafieldValues: {
|
|
6735
6842
|
parameters: {
|
|
6736
6843
|
query?: never;
|
|
@@ -17015,6 +17122,8 @@ type DuplicateBody = NonNullable<operations['duplicateProduct']['requestBody']>[
|
|
|
17015
17122
|
type CreateVariantBody = NonNullable<operations['createProductVariant']['requestBody']>['content']['application/json'];
|
|
17016
17123
|
type GenerateVariantsBody = NonNullable<operations['generateProductVariants']['requestBody']>['content']['application/json'];
|
|
17017
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'];
|
|
17018
17127
|
declare class ProductsResource {
|
|
17019
17128
|
private client;
|
|
17020
17129
|
constructor(client: Hydra);
|
|
@@ -17042,6 +17151,9 @@ declare class ProductsResource {
|
|
|
17042
17151
|
value: unknown;
|
|
17043
17152
|
}): Promise<DataResponse<unknown>>;
|
|
17044
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>;
|
|
17045
17157
|
}
|
|
17046
17158
|
|
|
17047
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
|