@gethydra/sdk 0.1.10 → 0.1.12
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 +363 -56
- package/dist/index.js +76 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -833,6 +833,31 @@ interface components {
|
|
|
833
833
|
GenerateVariantsResult: {
|
|
834
834
|
variants: components["schemas"]["Variant"][];
|
|
835
835
|
};
|
|
836
|
+
CustomerPhoto: {
|
|
837
|
+
id: string;
|
|
838
|
+
product_id: string;
|
|
839
|
+
image_url: string;
|
|
840
|
+
bucket_path: string;
|
|
841
|
+
width: number;
|
|
842
|
+
height: number;
|
|
843
|
+
/** @enum {string} */
|
|
844
|
+
aspect_ratio: "1:1" | "4:5";
|
|
845
|
+
file_size: number;
|
|
846
|
+
credit: string | null;
|
|
847
|
+
link_url: string | null;
|
|
848
|
+
link_text: string | null;
|
|
849
|
+
customer_id: string | null;
|
|
850
|
+
customer_email: string | null;
|
|
851
|
+
alt_text: string | null;
|
|
852
|
+
show_in_gallery: boolean;
|
|
853
|
+
/** @enum {string} */
|
|
854
|
+
status: "pending" | "approved" | "rejected";
|
|
855
|
+
moderated_at: string | null;
|
|
856
|
+
moderated_by: string | null;
|
|
857
|
+
moderation_notes: string | null;
|
|
858
|
+
created_at: string;
|
|
859
|
+
updated_at: string;
|
|
860
|
+
};
|
|
836
861
|
VariantPrice: {
|
|
837
862
|
/** @example wholesale */
|
|
838
863
|
slug: string;
|
|
@@ -6779,6 +6804,26 @@ interface operations {
|
|
|
6779
6804
|
};
|
|
6780
6805
|
};
|
|
6781
6806
|
};
|
|
6807
|
+
getProductCustomerPhotos: {
|
|
6808
|
+
parameters: {
|
|
6809
|
+
query?: never;
|
|
6810
|
+
header?: never;
|
|
6811
|
+
path: {
|
|
6812
|
+
id: string;
|
|
6813
|
+
};
|
|
6814
|
+
cookie?: never;
|
|
6815
|
+
};
|
|
6816
|
+
requestBody?: never;
|
|
6817
|
+
responses: {
|
|
6818
|
+
/** @description List of approved customer photos */
|
|
6819
|
+
200: {
|
|
6820
|
+
headers: {
|
|
6821
|
+
[name: string]: unknown;
|
|
6822
|
+
};
|
|
6823
|
+
content?: never;
|
|
6824
|
+
};
|
|
6825
|
+
};
|
|
6826
|
+
};
|
|
6782
6827
|
listProductLinks: {
|
|
6783
6828
|
parameters: {
|
|
6784
6829
|
query?: never;
|
|
@@ -6985,6 +7030,209 @@ interface operations {
|
|
|
6985
7030
|
};
|
|
6986
7031
|
};
|
|
6987
7032
|
};
|
|
7033
|
+
listCustomerPhotos: {
|
|
7034
|
+
parameters: {
|
|
7035
|
+
query?: {
|
|
7036
|
+
limit?: number;
|
|
7037
|
+
cursor?: string;
|
|
7038
|
+
fields?: string;
|
|
7039
|
+
product_id?: string;
|
|
7040
|
+
status?: "pending" | "approved" | "rejected";
|
|
7041
|
+
};
|
|
7042
|
+
header?: never;
|
|
7043
|
+
path?: never;
|
|
7044
|
+
cookie?: never;
|
|
7045
|
+
};
|
|
7046
|
+
requestBody?: never;
|
|
7047
|
+
responses: {
|
|
7048
|
+
/** @description List of customer photos */
|
|
7049
|
+
200: {
|
|
7050
|
+
headers: {
|
|
7051
|
+
[name: string]: unknown;
|
|
7052
|
+
};
|
|
7053
|
+
content: {
|
|
7054
|
+
"application/json": {
|
|
7055
|
+
data: components["schemas"]["CustomerPhoto"][];
|
|
7056
|
+
pagination: {
|
|
7057
|
+
cursor: string | null;
|
|
7058
|
+
has_more: boolean;
|
|
7059
|
+
total: number;
|
|
7060
|
+
};
|
|
7061
|
+
};
|
|
7062
|
+
};
|
|
7063
|
+
};
|
|
7064
|
+
};
|
|
7065
|
+
};
|
|
7066
|
+
uploadCustomerPhoto: {
|
|
7067
|
+
parameters: {
|
|
7068
|
+
query?: never;
|
|
7069
|
+
header?: never;
|
|
7070
|
+
path?: never;
|
|
7071
|
+
cookie?: never;
|
|
7072
|
+
};
|
|
7073
|
+
requestBody?: {
|
|
7074
|
+
content: {
|
|
7075
|
+
"multipart/form-data": {
|
|
7076
|
+
/** Format: binary */
|
|
7077
|
+
image?: string;
|
|
7078
|
+
product_id: string;
|
|
7079
|
+
credit?: string;
|
|
7080
|
+
/** Format: uri */
|
|
7081
|
+
link_url?: string;
|
|
7082
|
+
link_text?: string;
|
|
7083
|
+
alt_text?: string;
|
|
7084
|
+
/** Format: email */
|
|
7085
|
+
customer_email?: string;
|
|
7086
|
+
};
|
|
7087
|
+
};
|
|
7088
|
+
};
|
|
7089
|
+
responses: {
|
|
7090
|
+
/** @description Photo uploaded successfully */
|
|
7091
|
+
201: {
|
|
7092
|
+
headers: {
|
|
7093
|
+
[name: string]: unknown;
|
|
7094
|
+
};
|
|
7095
|
+
content: {
|
|
7096
|
+
"application/json": {
|
|
7097
|
+
data: components["schemas"]["CustomerPhoto"];
|
|
7098
|
+
};
|
|
7099
|
+
};
|
|
7100
|
+
};
|
|
7101
|
+
};
|
|
7102
|
+
};
|
|
7103
|
+
getCustomerPhoto: {
|
|
7104
|
+
parameters: {
|
|
7105
|
+
query?: never;
|
|
7106
|
+
header?: never;
|
|
7107
|
+
path: {
|
|
7108
|
+
id: string;
|
|
7109
|
+
};
|
|
7110
|
+
cookie?: never;
|
|
7111
|
+
};
|
|
7112
|
+
requestBody?: never;
|
|
7113
|
+
responses: {
|
|
7114
|
+
/** @description Customer photo details */
|
|
7115
|
+
200: {
|
|
7116
|
+
headers: {
|
|
7117
|
+
[name: string]: unknown;
|
|
7118
|
+
};
|
|
7119
|
+
content: {
|
|
7120
|
+
"application/json": {
|
|
7121
|
+
data: components["schemas"]["CustomerPhoto"];
|
|
7122
|
+
};
|
|
7123
|
+
};
|
|
7124
|
+
};
|
|
7125
|
+
};
|
|
7126
|
+
};
|
|
7127
|
+
deleteCustomerPhoto: {
|
|
7128
|
+
parameters: {
|
|
7129
|
+
query?: never;
|
|
7130
|
+
header?: never;
|
|
7131
|
+
path: {
|
|
7132
|
+
id: string;
|
|
7133
|
+
};
|
|
7134
|
+
cookie?: never;
|
|
7135
|
+
};
|
|
7136
|
+
requestBody?: never;
|
|
7137
|
+
responses: {
|
|
7138
|
+
/** @description Photo deleted successfully */
|
|
7139
|
+
204: {
|
|
7140
|
+
headers: {
|
|
7141
|
+
[name: string]: unknown;
|
|
7142
|
+
};
|
|
7143
|
+
content?: never;
|
|
7144
|
+
};
|
|
7145
|
+
};
|
|
7146
|
+
};
|
|
7147
|
+
updateCustomerPhoto: {
|
|
7148
|
+
parameters: {
|
|
7149
|
+
query?: never;
|
|
7150
|
+
header?: never;
|
|
7151
|
+
path: {
|
|
7152
|
+
id: string;
|
|
7153
|
+
};
|
|
7154
|
+
cookie?: never;
|
|
7155
|
+
};
|
|
7156
|
+
requestBody?: {
|
|
7157
|
+
content: {
|
|
7158
|
+
"application/json": {
|
|
7159
|
+
credit?: string | null;
|
|
7160
|
+
/** Format: uri */
|
|
7161
|
+
link_url?: string | null;
|
|
7162
|
+
link_text?: string | null;
|
|
7163
|
+
alt_text?: string | null;
|
|
7164
|
+
show_in_gallery?: boolean;
|
|
7165
|
+
};
|
|
7166
|
+
};
|
|
7167
|
+
};
|
|
7168
|
+
responses: {
|
|
7169
|
+
/** @description Photo updated successfully */
|
|
7170
|
+
200: {
|
|
7171
|
+
headers: {
|
|
7172
|
+
[name: string]: unknown;
|
|
7173
|
+
};
|
|
7174
|
+
content: {
|
|
7175
|
+
"application/json": {
|
|
7176
|
+
data: components["schemas"]["CustomerPhoto"];
|
|
7177
|
+
};
|
|
7178
|
+
};
|
|
7179
|
+
};
|
|
7180
|
+
};
|
|
7181
|
+
};
|
|
7182
|
+
approveCustomerPhoto: {
|
|
7183
|
+
parameters: {
|
|
7184
|
+
query?: never;
|
|
7185
|
+
header?: never;
|
|
7186
|
+
path: {
|
|
7187
|
+
id: string;
|
|
7188
|
+
};
|
|
7189
|
+
cookie?: never;
|
|
7190
|
+
};
|
|
7191
|
+
requestBody?: never;
|
|
7192
|
+
responses: {
|
|
7193
|
+
/** @description Photo approved successfully */
|
|
7194
|
+
200: {
|
|
7195
|
+
headers: {
|
|
7196
|
+
[name: string]: unknown;
|
|
7197
|
+
};
|
|
7198
|
+
content: {
|
|
7199
|
+
"application/json": {
|
|
7200
|
+
data: components["schemas"]["CustomerPhoto"];
|
|
7201
|
+
};
|
|
7202
|
+
};
|
|
7203
|
+
};
|
|
7204
|
+
};
|
|
7205
|
+
};
|
|
7206
|
+
rejectCustomerPhoto: {
|
|
7207
|
+
parameters: {
|
|
7208
|
+
query?: never;
|
|
7209
|
+
header?: never;
|
|
7210
|
+
path: {
|
|
7211
|
+
id: string;
|
|
7212
|
+
};
|
|
7213
|
+
cookie?: never;
|
|
7214
|
+
};
|
|
7215
|
+
requestBody?: {
|
|
7216
|
+
content: {
|
|
7217
|
+
"application/json": {
|
|
7218
|
+
notes?: string;
|
|
7219
|
+
};
|
|
7220
|
+
};
|
|
7221
|
+
};
|
|
7222
|
+
responses: {
|
|
7223
|
+
/** @description Photo rejected successfully */
|
|
7224
|
+
200: {
|
|
7225
|
+
headers: {
|
|
7226
|
+
[name: string]: unknown;
|
|
7227
|
+
};
|
|
7228
|
+
content: {
|
|
7229
|
+
"application/json": {
|
|
7230
|
+
data: components["schemas"]["CustomerPhoto"];
|
|
7231
|
+
};
|
|
7232
|
+
};
|
|
7233
|
+
};
|
|
7234
|
+
};
|
|
7235
|
+
};
|
|
6988
7236
|
getVariant: {
|
|
6989
7237
|
parameters: {
|
|
6990
7238
|
query?: {
|
|
@@ -12081,7 +12329,7 @@ interface operations {
|
|
|
12081
12329
|
* "order.paid"
|
|
12082
12330
|
* ]
|
|
12083
12331
|
*/
|
|
12084
|
-
events: ("product.created" | "product.updated" | "product.deleted" | "order.created" | "order.paid" | "order.fulfilled" | "order.cancelled" | "order.refunded" | "company.created" | "company.updated" | "company.deleted" | "customer.created" | "customer.updated" | "discount.created" | "discount.updated" | "discount.deleted" | "draft_order.created" | "draft_order.updated" | "draft_order.completed" | "draft_order.deleted" | "filter_attribute.created" | "filter_attribute.updated" | "filter_attribute.deleted" | "fulfillment.created" | "fulfillment.updated" | "fulfillment.cancelled" | "fulfillment_order.created" | "inventory.low" | "location.created" | "location.updated" | "location.deleted" | "navigation.created" | "navigation.updated" | "navigation.deleted" | "shipping.zone.created" | "shipping.zone.updated" | "shipping.zone.deleted" | "post.created" | "post.updated" | "post.deleted" | "post.published" | "post.unpublished" | "promotion.created" | "promotion.updated" | "promotion.deleted" | "purchase_order.created" | "purchase_order.updated" | "purchase_order.received" | "purchase_order.cancelled" | "refund.created" | "refund.succeeded" | "refund.failed" | "return.requested" | "return.approved" | "return.received" | "return.rejected" | "return.cancelled" | "return.closed" | "store.published" | "store_credit.issued" | "store_credit.used" | "store_credit.expired" | "membership.created" | "membership.updated" | "membership.cancelled" | "membership.expired" | "usage.warning")[];
|
|
12332
|
+
events: ("product.created" | "product.updated" | "product.deleted" | "order.created" | "order.paid" | "order.fulfilled" | "order.cancelled" | "order.refunded" | "company.created" | "company.updated" | "company.deleted" | "customer.created" | "customer.updated" | "customer_photo.submitted" | "customer_photo.approved" | "customer_photo.rejected" | "discount.created" | "discount.updated" | "discount.deleted" | "draft_order.created" | "draft_order.updated" | "draft_order.completed" | "draft_order.deleted" | "filter_attribute.created" | "filter_attribute.updated" | "filter_attribute.deleted" | "fulfillment.created" | "fulfillment.updated" | "fulfillment.cancelled" | "fulfillment_order.created" | "inventory.low" | "location.created" | "location.updated" | "location.deleted" | "navigation.created" | "navigation.updated" | "navigation.deleted" | "shipping.zone.created" | "shipping.zone.updated" | "shipping.zone.deleted" | "post.created" | "post.updated" | "post.deleted" | "post.published" | "post.unpublished" | "promotion.created" | "promotion.updated" | "promotion.deleted" | "purchase_order.created" | "purchase_order.updated" | "purchase_order.received" | "purchase_order.cancelled" | "refund.created" | "refund.succeeded" | "refund.failed" | "return.requested" | "return.approved" | "return.received" | "return.rejected" | "return.cancelled" | "return.closed" | "store.published" | "store_credit.issued" | "store_credit.used" | "store_credit.expired" | "membership.created" | "membership.updated" | "membership.cancelled" | "membership.expired" | "usage.warning")[];
|
|
12085
12333
|
/**
|
|
12086
12334
|
* @default active
|
|
12087
12335
|
* @example active
|
|
@@ -12175,7 +12423,7 @@ interface operations {
|
|
|
12175
12423
|
* "product.updated"
|
|
12176
12424
|
* ]
|
|
12177
12425
|
*/
|
|
12178
|
-
events?: ("product.created" | "product.updated" | "product.deleted" | "order.created" | "order.paid" | "order.fulfilled" | "order.cancelled" | "order.refunded" | "company.created" | "company.updated" | "company.deleted" | "customer.created" | "customer.updated" | "discount.created" | "discount.updated" | "discount.deleted" | "draft_order.created" | "draft_order.updated" | "draft_order.completed" | "draft_order.deleted" | "filter_attribute.created" | "filter_attribute.updated" | "filter_attribute.deleted" | "fulfillment.created" | "fulfillment.updated" | "fulfillment.cancelled" | "fulfillment_order.created" | "inventory.low" | "location.created" | "location.updated" | "location.deleted" | "navigation.created" | "navigation.updated" | "navigation.deleted" | "shipping.zone.created" | "shipping.zone.updated" | "shipping.zone.deleted" | "post.created" | "post.updated" | "post.deleted" | "post.published" | "post.unpublished" | "promotion.created" | "promotion.updated" | "promotion.deleted" | "purchase_order.created" | "purchase_order.updated" | "purchase_order.received" | "purchase_order.cancelled" | "refund.created" | "refund.succeeded" | "refund.failed" | "return.requested" | "return.approved" | "return.received" | "return.rejected" | "return.cancelled" | "return.closed" | "store.published" | "store_credit.issued" | "store_credit.used" | "store_credit.expired" | "membership.created" | "membership.updated" | "membership.cancelled" | "membership.expired" | "usage.warning")[];
|
|
12426
|
+
events?: ("product.created" | "product.updated" | "product.deleted" | "order.created" | "order.paid" | "order.fulfilled" | "order.cancelled" | "order.refunded" | "company.created" | "company.updated" | "company.deleted" | "customer.created" | "customer.updated" | "customer_photo.submitted" | "customer_photo.approved" | "customer_photo.rejected" | "discount.created" | "discount.updated" | "discount.deleted" | "draft_order.created" | "draft_order.updated" | "draft_order.completed" | "draft_order.deleted" | "filter_attribute.created" | "filter_attribute.updated" | "filter_attribute.deleted" | "fulfillment.created" | "fulfillment.updated" | "fulfillment.cancelled" | "fulfillment_order.created" | "inventory.low" | "location.created" | "location.updated" | "location.deleted" | "navigation.created" | "navigation.updated" | "navigation.deleted" | "shipping.zone.created" | "shipping.zone.updated" | "shipping.zone.deleted" | "post.created" | "post.updated" | "post.deleted" | "post.published" | "post.unpublished" | "promotion.created" | "promotion.updated" | "promotion.deleted" | "purchase_order.created" | "purchase_order.updated" | "purchase_order.received" | "purchase_order.cancelled" | "refund.created" | "refund.succeeded" | "refund.failed" | "return.requested" | "return.approved" | "return.received" | "return.rejected" | "return.cancelled" | "return.closed" | "store.published" | "store_credit.issued" | "store_credit.used" | "store_credit.expired" | "membership.created" | "membership.updated" | "membership.cancelled" | "membership.expired" | "usage.warning")[];
|
|
12179
12427
|
/**
|
|
12180
12428
|
* @example active
|
|
12181
12429
|
* @enum {string}
|
|
@@ -17107,6 +17355,7 @@ type Image$2 = components['schemas']['Image'];
|
|
|
17107
17355
|
type Collection$1 = components['schemas']['Collection'];
|
|
17108
17356
|
type Customer$1 = components['schemas']['Customer'];
|
|
17109
17357
|
type CustomerGroup$1 = components['schemas']['CustomerGroup'];
|
|
17358
|
+
type CustomerPhoto$1 = components['schemas']['CustomerPhoto'];
|
|
17110
17359
|
type Company$1 = components['schemas']['Company'];
|
|
17111
17360
|
type Cart$1 = components['schemas']['Cart'];
|
|
17112
17361
|
type CartItem = components['schemas']['CartItem'];
|
|
@@ -17188,9 +17437,9 @@ type ProductStats = components['schemas']['ProductStats'];
|
|
|
17188
17437
|
type Variant$1 = components['schemas']['Variant'];
|
|
17189
17438
|
type Image$1 = components['schemas']['Image'];
|
|
17190
17439
|
type GenerateVariantsResult = components['schemas']['GenerateVariantsResult'];
|
|
17191
|
-
type ListParams$
|
|
17440
|
+
type ListParams$s = NonNullable<operations['listProducts']['parameters']['query']>;
|
|
17192
17441
|
type CreateBody$n = NonNullable<operations['createProduct']['requestBody']>['content']['application/json'];
|
|
17193
|
-
type UpdateBody$
|
|
17442
|
+
type UpdateBody$o = NonNullable<operations['updateProduct']['requestBody']>['content']['application/json'];
|
|
17194
17443
|
type DuplicateBody = NonNullable<operations['duplicateProduct']['requestBody']>['content']['application/json'];
|
|
17195
17444
|
type CreateVariantBody = NonNullable<operations['createProductVariant']['requestBody']>['content']['application/json'];
|
|
17196
17445
|
type GenerateVariantsBody = NonNullable<operations['generateProductVariants']['requestBody']>['content']['application/json'];
|
|
@@ -17200,14 +17449,14 @@ type CreateProductLinkBody = NonNullable<operations['createProductLink']['reques
|
|
|
17200
17449
|
declare class ProductsResource {
|
|
17201
17450
|
private client;
|
|
17202
17451
|
constructor(client: Hydra);
|
|
17203
|
-
list(params?: ListParams$
|
|
17204
|
-
iterate(params?: Omit<ListParams$
|
|
17205
|
-
toArray(params?: Omit<ListParams$
|
|
17452
|
+
list(params?: ListParams$s): Promise<ListResponse<Product>>;
|
|
17453
|
+
iterate(params?: Omit<ListParams$s, 'cursor'>, options?: PaginateOptions): AsyncGenerator<Product, void, undefined>;
|
|
17454
|
+
toArray(params?: Omit<ListParams$s, 'cursor'>, options?: PaginateOptions & {
|
|
17206
17455
|
limit?: number;
|
|
17207
17456
|
}): Promise<Product[]>;
|
|
17208
|
-
get(id: string, params?: Pick<ListParams$
|
|
17457
|
+
get(id: string, params?: Pick<ListParams$s, 'expand' | 'currency' | 'fields'>): Promise<DataResponse<Product>>;
|
|
17209
17458
|
create(body: CreateBody$n, options?: ResourceRequestOptions): Promise<DataResponse<Product>>;
|
|
17210
|
-
update(id: string, body: UpdateBody$
|
|
17459
|
+
update(id: string, body: UpdateBody$o): Promise<DataResponse<Product>>;
|
|
17211
17460
|
delete(id: string): Promise<void>;
|
|
17212
17461
|
batchCreate(body: {
|
|
17213
17462
|
products: CreateBody$n[];
|
|
@@ -17231,7 +17480,7 @@ declare class ProductsResource {
|
|
|
17231
17480
|
|
|
17232
17481
|
type Variant = components['schemas']['Variant'];
|
|
17233
17482
|
type VariantPrice = components['schemas']['VariantPrice'];
|
|
17234
|
-
type UpdateBody$
|
|
17483
|
+
type UpdateBody$n = NonNullable<operations['updateVariant']['requestBody']>['content']['application/json'];
|
|
17235
17484
|
type UpsertPriceBody = NonNullable<operations['upsertVariantPrice']['requestBody']>['content']['application/json'];
|
|
17236
17485
|
declare class VariantsResource {
|
|
17237
17486
|
private client;
|
|
@@ -17241,7 +17490,7 @@ declare class VariantsResource {
|
|
|
17241
17490
|
currency?: string;
|
|
17242
17491
|
fields?: string;
|
|
17243
17492
|
}): Promise<DataResponse<Variant>>;
|
|
17244
|
-
update(id: string, body: UpdateBody$
|
|
17493
|
+
update(id: string, body: UpdateBody$n): Promise<DataResponse<Variant>>;
|
|
17245
17494
|
delete(id: string): Promise<void>;
|
|
17246
17495
|
listPrices(variantId: string): Promise<DataResponse<Record<string, VariantPrice>>>;
|
|
17247
17496
|
upsertPrice(variantId: string, priceKeySlug: string, body: UpsertPriceBody): Promise<DataResponse<VariantPrice>>;
|
|
@@ -17253,23 +17502,23 @@ declare class VariantsResource {
|
|
|
17253
17502
|
}
|
|
17254
17503
|
|
|
17255
17504
|
type Collection = components['schemas']['Collection'];
|
|
17256
|
-
type ListParams$
|
|
17505
|
+
type ListParams$r = NonNullable<operations['listCollections']['parameters']['query']>;
|
|
17257
17506
|
type CreateBody$m = NonNullable<operations['createCollection']['requestBody']>['content']['application/json'];
|
|
17258
|
-
type UpdateBody$
|
|
17507
|
+
type UpdateBody$m = NonNullable<operations['updateCollection']['requestBody']>['content']['application/json'];
|
|
17259
17508
|
type AddProductsBody = NonNullable<operations['addCollectionProducts']['requestBody']>['content']['application/json'];
|
|
17260
17509
|
type ReorderProductsBody = NonNullable<operations['reorderCollectionProducts']['requestBody']>['content']['application/json'];
|
|
17261
17510
|
type ReorderCollectionsBody = NonNullable<operations['reorderCollections']['requestBody']>['content']['application/json'];
|
|
17262
17511
|
declare class CollectionsResource {
|
|
17263
17512
|
private client;
|
|
17264
17513
|
constructor(client: Hydra);
|
|
17265
|
-
list(params?: ListParams$
|
|
17266
|
-
iterate(params?: Omit<ListParams$
|
|
17267
|
-
toArray(params?: Omit<ListParams$
|
|
17514
|
+
list(params?: ListParams$r): Promise<ListResponse<Collection>>;
|
|
17515
|
+
iterate(params?: Omit<ListParams$r, 'cursor'>, options?: PaginateOptions): AsyncGenerator<Collection, void, undefined>;
|
|
17516
|
+
toArray(params?: Omit<ListParams$r, 'cursor'>, options?: PaginateOptions & {
|
|
17268
17517
|
limit?: number;
|
|
17269
17518
|
}): Promise<Collection[]>;
|
|
17270
|
-
get(id: string, params?: Pick<ListParams$
|
|
17519
|
+
get(id: string, params?: Pick<ListParams$r, 'expand' | 'fields'>): Promise<DataResponse<Collection>>;
|
|
17271
17520
|
create(body: CreateBody$m, options?: ResourceRequestOptions): Promise<DataResponse<Collection>>;
|
|
17272
|
-
update(id: string, body: UpdateBody$
|
|
17521
|
+
update(id: string, body: UpdateBody$m): Promise<DataResponse<Collection>>;
|
|
17273
17522
|
delete(id: string): Promise<void>;
|
|
17274
17523
|
tree(): Promise<DataResponse<unknown>>;
|
|
17275
17524
|
reorder(body: ReorderCollectionsBody): Promise<void>;
|
|
@@ -17316,15 +17565,15 @@ declare class CheckoutResource {
|
|
|
17316
17565
|
|
|
17317
17566
|
type Order$1 = components['schemas']['Order'];
|
|
17318
17567
|
type FulfillmentOrder$1 = components['schemas']['FulfillmentOrder'];
|
|
17319
|
-
type ListParams$
|
|
17568
|
+
type ListParams$q = NonNullable<operations['listOrders']['parameters']['query']>;
|
|
17320
17569
|
type CreateBody$k = NonNullable<operations['createOrder']['requestBody']>['content']['application/json'];
|
|
17321
|
-
type UpdateBody$
|
|
17570
|
+
type UpdateBody$l = NonNullable<operations['updateOrder']['requestBody']>['content']['application/json'];
|
|
17322
17571
|
declare class OrdersResource {
|
|
17323
17572
|
private client;
|
|
17324
17573
|
constructor(client: Hydra);
|
|
17325
|
-
list(params?: ListParams$
|
|
17326
|
-
iterate(params?: Omit<ListParams$
|
|
17327
|
-
toArray(params?: Omit<ListParams$
|
|
17574
|
+
list(params?: ListParams$q): Promise<ListResponse<Order$1>>;
|
|
17575
|
+
iterate(params?: Omit<ListParams$q, 'cursor'>, options?: PaginateOptions): AsyncGenerator<Order$1, void, undefined>;
|
|
17576
|
+
toArray(params?: Omit<ListParams$q, 'cursor'>, options?: PaginateOptions & {
|
|
17328
17577
|
limit?: number;
|
|
17329
17578
|
}): Promise<Order$1[]>;
|
|
17330
17579
|
get(id: string, params?: {
|
|
@@ -17333,7 +17582,7 @@ declare class OrdersResource {
|
|
|
17333
17582
|
fields?: string;
|
|
17334
17583
|
}): Promise<DataResponse<Order$1>>;
|
|
17335
17584
|
create(body: CreateBody$k, options?: ResourceRequestOptions): Promise<DataResponse<Order$1>>;
|
|
17336
|
-
update(id: string, body: UpdateBody$
|
|
17585
|
+
update(id: string, body: UpdateBody$l): Promise<DataResponse<Order$1>>;
|
|
17337
17586
|
listFulfillmentOrders(orderId: string): Promise<DataResponse<FulfillmentOrder$1[]>>;
|
|
17338
17587
|
/**
|
|
17339
17588
|
* Returns the API path for downloading the invoice PDF for an order.
|
|
@@ -17348,26 +17597,26 @@ declare class OrdersResource {
|
|
|
17348
17597
|
|
|
17349
17598
|
type Fulfillment = components['schemas']['Fulfillment'];
|
|
17350
17599
|
type CreateBody$j = NonNullable<operations['createFulfillment']['requestBody']>['content']['application/json'];
|
|
17351
|
-
type UpdateBody$
|
|
17600
|
+
type UpdateBody$k = NonNullable<operations['updateFulfillment']['requestBody']>['content']['application/json'];
|
|
17352
17601
|
type CancelBody = NonNullable<operations['cancelFulfillment']['requestBody']>['content']['application/json'];
|
|
17353
17602
|
declare class FulfillmentsResource {
|
|
17354
17603
|
private client;
|
|
17355
17604
|
constructor(client: Hydra);
|
|
17356
17605
|
/** Create a fulfillment for a fulfillment order */
|
|
17357
17606
|
create(fulfillmentOrderId: string, body: CreateBody$j, options?: ResourceRequestOptions): Promise<DataResponse<Fulfillment>>;
|
|
17358
|
-
update(id: string, body: UpdateBody$
|
|
17607
|
+
update(id: string, body: UpdateBody$k): Promise<DataResponse<Fulfillment>>;
|
|
17359
17608
|
cancel(id: string, body?: CancelBody): Promise<DataResponse<Fulfillment>>;
|
|
17360
17609
|
}
|
|
17361
17610
|
|
|
17362
17611
|
type Refund = components['schemas']['Refund'];
|
|
17363
|
-
type ListParams$
|
|
17612
|
+
type ListParams$p = NonNullable<operations['listRefunds']['parameters']['query']>;
|
|
17364
17613
|
type CreateBody$i = NonNullable<operations['createOrderRefund']['requestBody']>['content']['application/json'];
|
|
17365
17614
|
declare class RefundsResource {
|
|
17366
17615
|
private client;
|
|
17367
17616
|
constructor(client: Hydra);
|
|
17368
|
-
list(params?: ListParams$
|
|
17369
|
-
iterate(params?: Omit<ListParams$
|
|
17370
|
-
toArray(params?: Omit<ListParams$
|
|
17617
|
+
list(params?: ListParams$p): Promise<ListResponse<Refund>>;
|
|
17618
|
+
iterate(params?: Omit<ListParams$p, 'cursor'>, options?: PaginateOptions): AsyncGenerator<Refund, void, undefined>;
|
|
17619
|
+
toArray(params?: Omit<ListParams$p, 'cursor'>, options?: PaginateOptions & {
|
|
17371
17620
|
limit?: number;
|
|
17372
17621
|
}): Promise<Refund[]>;
|
|
17373
17622
|
get(id: string, params?: {
|
|
@@ -17385,17 +17634,17 @@ declare class RefundsResource {
|
|
|
17385
17634
|
}
|
|
17386
17635
|
|
|
17387
17636
|
type Return = components['schemas']['Return'];
|
|
17388
|
-
type ListParams$
|
|
17637
|
+
type ListParams$o = NonNullable<operations['listReturns']['parameters']['query']>;
|
|
17389
17638
|
type CreateBody$h = NonNullable<operations['createOrderReturn']['requestBody']>['content']['application/json'];
|
|
17390
17639
|
type ApproveBody = NonNullable<operations['approveReturn']['requestBody']>['content']['application/json'];
|
|
17391
17640
|
type ReceiveBody$1 = NonNullable<operations['receiveReturn']['requestBody']>['content']['application/json'];
|
|
17392
|
-
type RejectBody = NonNullable<operations['rejectReturn']['requestBody']>['content']['application/json'];
|
|
17641
|
+
type RejectBody$1 = NonNullable<operations['rejectReturn']['requestBody']>['content']['application/json'];
|
|
17393
17642
|
declare class ReturnsResource {
|
|
17394
17643
|
private client;
|
|
17395
17644
|
constructor(client: Hydra);
|
|
17396
|
-
list(params?: ListParams$
|
|
17397
|
-
iterate(params?: Omit<ListParams$
|
|
17398
|
-
toArray(params?: Omit<ListParams$
|
|
17645
|
+
list(params?: ListParams$o): Promise<ListResponse<Return>>;
|
|
17646
|
+
iterate(params?: Omit<ListParams$o, 'cursor'>, options?: PaginateOptions): AsyncGenerator<Return, void, undefined>;
|
|
17647
|
+
toArray(params?: Omit<ListParams$o, 'cursor'>, options?: PaginateOptions & {
|
|
17399
17648
|
limit?: number;
|
|
17400
17649
|
}): Promise<Return[]>;
|
|
17401
17650
|
get(id: string, params?: {
|
|
@@ -17407,24 +17656,24 @@ declare class ReturnsResource {
|
|
|
17407
17656
|
approve(id: string, body?: ApproveBody): Promise<DataResponse<Return>>;
|
|
17408
17657
|
receive(id: string, body?: ReceiveBody$1): Promise<DataResponse<Return>>;
|
|
17409
17658
|
close(id: string): Promise<DataResponse<Return>>;
|
|
17410
|
-
reject(id: string, body?: RejectBody): Promise<DataResponse<Return>>;
|
|
17659
|
+
reject(id: string, body?: RejectBody$1): Promise<DataResponse<Return>>;
|
|
17411
17660
|
cancel(id: string): Promise<DataResponse<Return>>;
|
|
17412
17661
|
}
|
|
17413
17662
|
|
|
17414
17663
|
type DraftOrder = components['schemas']['DraftOrder'];
|
|
17415
17664
|
type DraftOrderLineItem = components['schemas']['DraftOrderLineItem'];
|
|
17416
17665
|
type Order = components['schemas']['Order'];
|
|
17417
|
-
type ListParams$
|
|
17666
|
+
type ListParams$n = NonNullable<operations['listDraftOrders']['parameters']['query']>;
|
|
17418
17667
|
type CreateBody$g = NonNullable<operations['createDraftOrder']['requestBody']>['content']['application/json'];
|
|
17419
|
-
type UpdateBody$
|
|
17668
|
+
type UpdateBody$j = NonNullable<operations['updateDraftOrder']['requestBody']>['content']['application/json'];
|
|
17420
17669
|
type AddItemsBody = NonNullable<operations['addDraftOrderItems']['requestBody']>['content']['application/json'];
|
|
17421
17670
|
type UpdateItemBody$2 = NonNullable<operations['updateDraftOrderItem']['requestBody']>['content']['application/json'];
|
|
17422
17671
|
declare class DraftOrdersResource {
|
|
17423
17672
|
private client;
|
|
17424
17673
|
constructor(client: Hydra);
|
|
17425
|
-
list(params?: ListParams$
|
|
17426
|
-
iterate(params?: Omit<ListParams$
|
|
17427
|
-
toArray(params?: Omit<ListParams$
|
|
17674
|
+
list(params?: ListParams$n): Promise<ListResponse<DraftOrder>>;
|
|
17675
|
+
iterate(params?: Omit<ListParams$n, 'cursor'>, options?: PaginateOptions): AsyncGenerator<DraftOrder, void, undefined>;
|
|
17676
|
+
toArray(params?: Omit<ListParams$n, 'cursor'>, options?: PaginateOptions & {
|
|
17428
17677
|
limit?: number;
|
|
17429
17678
|
}): Promise<DraftOrder[]>;
|
|
17430
17679
|
get(id: string, params?: {
|
|
@@ -17433,7 +17682,7 @@ declare class DraftOrdersResource {
|
|
|
17433
17682
|
fields?: string;
|
|
17434
17683
|
}): Promise<DataResponse<DraftOrder>>;
|
|
17435
17684
|
create(body: CreateBody$g, options?: ResourceRequestOptions): Promise<DataResponse<DraftOrder>>;
|
|
17436
|
-
update(id: string, body: UpdateBody$
|
|
17685
|
+
update(id: string, body: UpdateBody$j): Promise<DataResponse<DraftOrder>>;
|
|
17437
17686
|
delete(id: string): Promise<void>;
|
|
17438
17687
|
addItems(draftOrderId: string, body: AddItemsBody): Promise<DataResponse<DraftOrderLineItem[]>>;
|
|
17439
17688
|
updateItem(draftOrderId: string, itemId: string, body: UpdateItemBody$2): Promise<DataResponse<DraftOrderLineItem>>;
|
|
@@ -17448,22 +17697,22 @@ declare class DraftOrdersResource {
|
|
|
17448
17697
|
}
|
|
17449
17698
|
|
|
17450
17699
|
type Customer = components['schemas']['Customer'];
|
|
17451
|
-
type ListParams$
|
|
17700
|
+
type ListParams$m = NonNullable<operations['listCustomers']['parameters']['query']>;
|
|
17452
17701
|
type CreateBody$f = NonNullable<operations['createCustomer']['requestBody']>['content']['application/json'];
|
|
17453
|
-
type UpdateBody$
|
|
17702
|
+
type UpdateBody$i = NonNullable<operations['updateCustomer']['requestBody']>['content']['application/json'];
|
|
17454
17703
|
type CreateAddressBody$1 = NonNullable<operations['createCustomerAddress']['requestBody']>['content']['application/json'];
|
|
17455
17704
|
type CreateNoteBody$1 = NonNullable<operations['createCustomerNote']['requestBody']>['content']['application/json'];
|
|
17456
17705
|
declare class CustomersResource {
|
|
17457
17706
|
private client;
|
|
17458
17707
|
constructor(client: Hydra);
|
|
17459
|
-
list(params?: ListParams$
|
|
17460
|
-
iterate(params?: Omit<ListParams$
|
|
17461
|
-
toArray(params?: Omit<ListParams$
|
|
17708
|
+
list(params?: ListParams$m): Promise<ListResponse<Customer>>;
|
|
17709
|
+
iterate(params?: Omit<ListParams$m, 'cursor'>, options?: PaginateOptions): AsyncGenerator<Customer, void, undefined>;
|
|
17710
|
+
toArray(params?: Omit<ListParams$m, 'cursor'>, options?: PaginateOptions & {
|
|
17462
17711
|
limit?: number;
|
|
17463
17712
|
}): Promise<Customer[]>;
|
|
17464
|
-
get(id: string, params?: Pick<ListParams$
|
|
17713
|
+
get(id: string, params?: Pick<ListParams$m, 'expand' | 'fields'>): Promise<DataResponse<Customer>>;
|
|
17465
17714
|
create(body: CreateBody$f, options?: ResourceRequestOptions): Promise<DataResponse<Customer>>;
|
|
17466
|
-
update(id: string, body: UpdateBody$
|
|
17715
|
+
update(id: string, body: UpdateBody$i): Promise<DataResponse<Customer>>;
|
|
17467
17716
|
delete(id: string): Promise<void>;
|
|
17468
17717
|
listAddresses(customerId: string): Promise<DataResponse<unknown[]>>;
|
|
17469
17718
|
createAddress(customerId: string, body: CreateAddressBody$1): Promise<DataResponse<unknown>>;
|
|
@@ -17477,26 +17726,83 @@ declare class CustomersResource {
|
|
|
17477
17726
|
}
|
|
17478
17727
|
|
|
17479
17728
|
type CustomerGroup = components['schemas']['CustomerGroup'];
|
|
17480
|
-
type ListParams$
|
|
17729
|
+
type ListParams$l = NonNullable<operations['listCustomerGroups']['parameters']['query']>;
|
|
17481
17730
|
type CreateBody$e = NonNullable<operations['createCustomerGroup']['requestBody']>['content']['application/json'];
|
|
17482
|
-
type UpdateBody$
|
|
17731
|
+
type UpdateBody$h = NonNullable<operations['updateCustomerGroup']['requestBody']>['content']['application/json'];
|
|
17483
17732
|
type AddMembersBody = NonNullable<operations['addCustomerGroupMembers']['requestBody']>['content']['application/json'];
|
|
17484
17733
|
declare class CustomerGroupsResource {
|
|
17485
17734
|
private client;
|
|
17486
17735
|
constructor(client: Hydra);
|
|
17487
|
-
list(params?: ListParams$
|
|
17488
|
-
iterate(params?: Omit<ListParams$
|
|
17489
|
-
toArray(params?: Omit<ListParams$
|
|
17736
|
+
list(params?: ListParams$l): Promise<ListResponse<CustomerGroup>>;
|
|
17737
|
+
iterate(params?: Omit<ListParams$l, 'cursor'>, options?: PaginateOptions): AsyncGenerator<CustomerGroup, void, undefined>;
|
|
17738
|
+
toArray(params?: Omit<ListParams$l, 'cursor'>, options?: PaginateOptions & {
|
|
17490
17739
|
limit?: number;
|
|
17491
17740
|
}): Promise<CustomerGroup[]>;
|
|
17492
17741
|
get(id: string): Promise<DataResponse<CustomerGroup>>;
|
|
17493
17742
|
create(body: CreateBody$e, options?: ResourceRequestOptions): Promise<DataResponse<CustomerGroup>>;
|
|
17494
|
-
update(id: string, body: UpdateBody$
|
|
17743
|
+
update(id: string, body: UpdateBody$h): Promise<DataResponse<CustomerGroup>>;
|
|
17495
17744
|
delete(id: string): Promise<void>;
|
|
17496
17745
|
addMembers(groupId: string, body: AddMembersBody): Promise<void>;
|
|
17497
17746
|
removeMember(groupId: string, customerId: string): Promise<void>;
|
|
17498
17747
|
}
|
|
17499
17748
|
|
|
17749
|
+
type CustomerPhoto = components['schemas']['CustomerPhoto'];
|
|
17750
|
+
type ListParams$k = NonNullable<operations['listCustomerPhotos']['parameters']['query']>;
|
|
17751
|
+
type UpdateBody$g = NonNullable<operations['updateCustomerPhoto']['requestBody']>['content']['application/json'];
|
|
17752
|
+
type RejectBody = NonNullable<operations['rejectCustomerPhoto']['requestBody']>['content']['application/json'];
|
|
17753
|
+
declare class CustomerPhotosResource {
|
|
17754
|
+
private client;
|
|
17755
|
+
constructor(client: Hydra);
|
|
17756
|
+
/**
|
|
17757
|
+
* List customer photos (secret key only).
|
|
17758
|
+
* Filter by product, status, etc.
|
|
17759
|
+
*/
|
|
17760
|
+
list(params?: ListParams$k): Promise<ListResponse<CustomerPhoto>>;
|
|
17761
|
+
/**
|
|
17762
|
+
* Iterate through all customer photos with automatic pagination.
|
|
17763
|
+
*/
|
|
17764
|
+
iterate(params?: Omit<ListParams$k, 'cursor'>, options?: PaginateOptions): AsyncGenerator<CustomerPhoto, void, undefined>;
|
|
17765
|
+
/**
|
|
17766
|
+
* Fetch all customer photos as an array (use with caution on large datasets).
|
|
17767
|
+
*/
|
|
17768
|
+
toArray(params?: Omit<ListParams$k, 'cursor'>, options?: PaginateOptions & {
|
|
17769
|
+
limit?: number;
|
|
17770
|
+
}): Promise<CustomerPhoto[]>;
|
|
17771
|
+
/**
|
|
17772
|
+
* Upload a customer photo (publishable or secret key).
|
|
17773
|
+
* Accepts FormData with: image, product_id, credit, link_url, link_text, alt_text, customer_email.
|
|
17774
|
+
*/
|
|
17775
|
+
upload(formData: FormData): Promise<DataResponse<CustomerPhoto>>;
|
|
17776
|
+
/**
|
|
17777
|
+
* Get a single customer photo by ID (secret key only).
|
|
17778
|
+
*/
|
|
17779
|
+
get(id: string): Promise<DataResponse<CustomerPhoto>>;
|
|
17780
|
+
/**
|
|
17781
|
+
* Update customer photo metadata (secret key only).
|
|
17782
|
+
* Fields: credit, link_url, link_text, alt_text, show_in_gallery.
|
|
17783
|
+
*/
|
|
17784
|
+
update(id: string, body: UpdateBody$g): Promise<DataResponse<CustomerPhoto>>;
|
|
17785
|
+
/**
|
|
17786
|
+
* Approve a customer photo (secret key only).
|
|
17787
|
+
* Sets status to 'approved' and makes it visible on storefront.
|
|
17788
|
+
*/
|
|
17789
|
+
approve(id: string): Promise<DataResponse<CustomerPhoto>>;
|
|
17790
|
+
/**
|
|
17791
|
+
* Reject a customer photo (secret key only).
|
|
17792
|
+
* Sets status to 'rejected'. Optionally include rejection notes.
|
|
17793
|
+
*/
|
|
17794
|
+
reject(id: string, body?: RejectBody): Promise<DataResponse<CustomerPhoto>>;
|
|
17795
|
+
/**
|
|
17796
|
+
* Delete a customer photo (soft delete, secret key only).
|
|
17797
|
+
*/
|
|
17798
|
+
delete(id: string): Promise<void>;
|
|
17799
|
+
/**
|
|
17800
|
+
* Get approved customer photos for a product (storefront-safe, publishable key works).
|
|
17801
|
+
* Returns up to 24 approved photos for display on product pages.
|
|
17802
|
+
*/
|
|
17803
|
+
getForProduct(productId: string): Promise<DataResponse<CustomerPhoto[]>>;
|
|
17804
|
+
}
|
|
17805
|
+
|
|
17500
17806
|
type UpdateBody$f = NonNullable<operations['updateAddress']['requestBody']>['content']['application/json'];
|
|
17501
17807
|
declare class AddressesResource {
|
|
17502
17808
|
private client;
|
|
@@ -18168,6 +18474,7 @@ declare class Hydra {
|
|
|
18168
18474
|
readonly draftOrders: DraftOrdersResource;
|
|
18169
18475
|
readonly customers: CustomersResource;
|
|
18170
18476
|
readonly customerGroups: CustomerGroupsResource;
|
|
18477
|
+
readonly customerPhotos: CustomerPhotosResource;
|
|
18171
18478
|
readonly addresses: AddressesResource;
|
|
18172
18479
|
readonly storeCredit: StoreCreditResource;
|
|
18173
18480
|
readonly inventory: InventoryResource;
|
|
@@ -18275,4 +18582,4 @@ declare class HydraIdempotencyError extends HydraError {
|
|
|
18275
18582
|
constructor(body: HydraErrorBody, headers: Headers);
|
|
18276
18583
|
}
|
|
18277
18584
|
|
|
18278
|
-
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 Cart$1 as Cart, type CartItem, CartResource, 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 Customer$1 as Customer, type CustomerGroup$1 as CustomerGroup, CustomerGroupsResource, type CustomerMembership$1 as CustomerMembership, CustomersResource, type DataResponse, type Discount$1 as Discount, DiscountsResource, type DraftOrder$1 as DraftOrder, DraftOrdersResource, type ExchangeRate$1 as ExchangeRate, ExchangeRatesResource, type Fulfillment$1 as Fulfillment, type FulfillmentOrder$2 as FulfillmentOrder, FulfillmentOrdersResource, FulfillmentsResource, type GenerateVariantsResult$1 as GenerateVariantsResult, 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 ListResponse, type Location$1 as Location, LocationsResource, type MembershipPlan$1 as MembershipPlan, MembershipPlansResource, MetafieldsResource, type NotificationLog$1 as NotificationLog, NotificationsResource, type Order$2 as Order, OrdersResource, type PaginateOptions, type Pagination, 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 RequestOptions, type ResourceRequestOptions, type Return$1 as Return, ReturnsResource, SearchResource, type ShippingRate$1 as ShippingRate, ShippingResource, type ShippingZone$1 as ShippingZone, type Store$1 as Store, StoreCreditResource, StoreResource, type Tag$1 as Tag, TagsResource, type TaxExemption$1 as TaxExemption, type TaxGroup$1 as TaxGroup, type TaxRate$1 as TaxRate, TaxResource, type Variant$2 as Variant, type VariantPrice$1 as VariantPrice, VariantsResource, type Webhook$1 as Webhook, WebhooksResource, paginate, toArray };
|
|
18585
|
+
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 Cart$1 as Cart, type CartItem, CartResource, 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 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 Discount$1 as Discount, DiscountsResource, type DraftOrder$1 as DraftOrder, DraftOrdersResource, type ExchangeRate$1 as ExchangeRate, ExchangeRatesResource, type Fulfillment$1 as Fulfillment, type FulfillmentOrder$2 as FulfillmentOrder, FulfillmentOrdersResource, FulfillmentsResource, type GenerateVariantsResult$1 as GenerateVariantsResult, 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 ListResponse, type Location$1 as Location, LocationsResource, type MembershipPlan$1 as MembershipPlan, MembershipPlansResource, MetafieldsResource, type NotificationLog$1 as NotificationLog, NotificationsResource, type Order$2 as Order, OrdersResource, type PaginateOptions, type Pagination, 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 RequestOptions, type ResourceRequestOptions, type Return$1 as Return, ReturnsResource, SearchResource, type ShippingRate$1 as ShippingRate, ShippingResource, type ShippingZone$1 as ShippingZone, type Store$1 as Store, StoreCreditResource, StoreResource, type Tag$1 as Tag, TagsResource, type TaxExemption$1 as TaxExemption, type TaxGroup$1 as TaxGroup, type TaxRate$1 as TaxRate, TaxResource, type Variant$2 as Variant, type VariantPrice$1 as VariantPrice, VariantsResource, type Webhook$1 as Webhook, WebhooksResource, paginate, toArray };
|
package/dist/index.js
CHANGED
|
@@ -596,6 +596,80 @@ var CustomerGroupsResource = class {
|
|
|
596
596
|
}
|
|
597
597
|
};
|
|
598
598
|
|
|
599
|
+
// src/resources/customer-photos.ts
|
|
600
|
+
var CustomerPhotosResource = class {
|
|
601
|
+
constructor(client) {
|
|
602
|
+
this.client = client;
|
|
603
|
+
}
|
|
604
|
+
client;
|
|
605
|
+
/**
|
|
606
|
+
* List customer photos (secret key only).
|
|
607
|
+
* Filter by product, status, etc.
|
|
608
|
+
*/
|
|
609
|
+
async list(params) {
|
|
610
|
+
return this.client.request("GET", "/v1/customer-photos", { params });
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Iterate through all customer photos with automatic pagination.
|
|
614
|
+
*/
|
|
615
|
+
iterate(params, options) {
|
|
616
|
+
return paginate((cursor) => this.list({ ...params, cursor }), options);
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Fetch all customer photos as an array (use with caution on large datasets).
|
|
620
|
+
*/
|
|
621
|
+
async toArray(params, options) {
|
|
622
|
+
return toArray(this.iterate(params, options), options);
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* Upload a customer photo (publishable or secret key).
|
|
626
|
+
* Accepts FormData with: image, product_id, credit, link_url, link_text, alt_text, customer_email.
|
|
627
|
+
*/
|
|
628
|
+
async upload(formData) {
|
|
629
|
+
return this.client.upload("/v1/customer-photos", formData);
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* Get a single customer photo by ID (secret key only).
|
|
633
|
+
*/
|
|
634
|
+
async get(id) {
|
|
635
|
+
return this.client.request("GET", `/v1/customer-photos/${id}`);
|
|
636
|
+
}
|
|
637
|
+
/**
|
|
638
|
+
* Update customer photo metadata (secret key only).
|
|
639
|
+
* Fields: credit, link_url, link_text, alt_text, show_in_gallery.
|
|
640
|
+
*/
|
|
641
|
+
async update(id, body) {
|
|
642
|
+
return this.client.request("PATCH", `/v1/customer-photos/${id}`, { body });
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* Approve a customer photo (secret key only).
|
|
646
|
+
* Sets status to 'approved' and makes it visible on storefront.
|
|
647
|
+
*/
|
|
648
|
+
async approve(id) {
|
|
649
|
+
return this.client.request("POST", `/v1/customer-photos/${id}/approve`);
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Reject a customer photo (secret key only).
|
|
653
|
+
* Sets status to 'rejected'. Optionally include rejection notes.
|
|
654
|
+
*/
|
|
655
|
+
async reject(id, body) {
|
|
656
|
+
return this.client.request("POST", `/v1/customer-photos/${id}/reject`, { body });
|
|
657
|
+
}
|
|
658
|
+
/**
|
|
659
|
+
* Delete a customer photo (soft delete, secret key only).
|
|
660
|
+
*/
|
|
661
|
+
async delete(id) {
|
|
662
|
+
return this.client.request("DELETE", `/v1/customer-photos/${id}`);
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* Get approved customer photos for a product (storefront-safe, publishable key works).
|
|
666
|
+
* Returns up to 24 approved photos for display on product pages.
|
|
667
|
+
*/
|
|
668
|
+
async getForProduct(productId) {
|
|
669
|
+
return this.client.request("GET", `/v1/products/${productId}/customer-photos`);
|
|
670
|
+
}
|
|
671
|
+
};
|
|
672
|
+
|
|
599
673
|
// src/resources/addresses.ts
|
|
600
674
|
var AddressesResource = class {
|
|
601
675
|
constructor(client) {
|
|
@@ -1557,6 +1631,7 @@ var Hydra = class {
|
|
|
1557
1631
|
// P3: Customers
|
|
1558
1632
|
customers = new CustomersResource(this);
|
|
1559
1633
|
customerGroups = new CustomerGroupsResource(this);
|
|
1634
|
+
customerPhotos = new CustomerPhotosResource(this);
|
|
1560
1635
|
addresses = new AddressesResource(this);
|
|
1561
1636
|
storeCredit = new StoreCreditResource(this);
|
|
1562
1637
|
// P4: Commerce operations
|
|
@@ -1803,6 +1878,7 @@ export {
|
|
|
1803
1878
|
CompaniesResource,
|
|
1804
1879
|
ContentCategoriesResource,
|
|
1805
1880
|
CustomerGroupsResource,
|
|
1881
|
+
CustomerPhotosResource,
|
|
1806
1882
|
CustomersResource,
|
|
1807
1883
|
DiscountsResource,
|
|
1808
1884
|
DraftOrdersResource,
|