@gethydra/sdk 0.1.9 → 0.1.11

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 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;
@@ -2261,6 +2286,13 @@ interface components {
2261
2286
  * ]
2262
2287
  */
2263
2288
  tags: string[];
2289
+ /**
2290
+ * @example [
2291
+ * "SKU-001",
2292
+ * "SKU-002"
2293
+ * ]
2294
+ */
2295
+ skus: string[];
2264
2296
  /** @example 2999 */
2265
2297
  price: number | null;
2266
2298
  /** @example 3999 */
@@ -2320,7 +2352,7 @@ interface components {
2320
2352
  * @example product
2321
2353
  * @enum {string}
2322
2354
  */
2323
- type: "product" | "collection" | "product_type" | "tag";
2355
+ type: "product" | "collection" | "product_type" | "tag" | "variant";
2324
2356
  /** @example prod_abc123 */
2325
2357
  id?: string;
2326
2358
  /** @example classic-cotton-t-shirt */
@@ -6772,6 +6804,26 @@ interface operations {
6772
6804
  };
6773
6805
  };
6774
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
+ };
6775
6827
  listProductLinks: {
6776
6828
  parameters: {
6777
6829
  query?: never;
@@ -6978,6 +7030,223 @@ interface operations {
6978
7030
  };
6979
7031
  };
6980
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
+ /** Format: email */
7084
+ customer_email?: string;
7085
+ };
7086
+ };
7087
+ };
7088
+ responses: {
7089
+ /** @description Photo uploaded successfully */
7090
+ 201: {
7091
+ headers: {
7092
+ [name: string]: unknown;
7093
+ };
7094
+ content: {
7095
+ "application/json": {
7096
+ data: components["schemas"]["CustomerPhoto"];
7097
+ };
7098
+ };
7099
+ };
7100
+ };
7101
+ };
7102
+ getCustomerPhoto: {
7103
+ parameters: {
7104
+ query?: never;
7105
+ header?: never;
7106
+ path: {
7107
+ id: {
7108
+ /** @example prod_abc123 */
7109
+ id: string;
7110
+ };
7111
+ };
7112
+ cookie?: never;
7113
+ };
7114
+ requestBody?: never;
7115
+ responses: {
7116
+ /** @description Customer photo details */
7117
+ 200: {
7118
+ headers: {
7119
+ [name: string]: unknown;
7120
+ };
7121
+ content: {
7122
+ "application/json": {
7123
+ data: components["schemas"]["CustomerPhoto"];
7124
+ };
7125
+ };
7126
+ };
7127
+ };
7128
+ };
7129
+ deleteCustomerPhoto: {
7130
+ parameters: {
7131
+ query?: never;
7132
+ header?: never;
7133
+ path: {
7134
+ id: {
7135
+ /** @example prod_abc123 */
7136
+ id: string;
7137
+ };
7138
+ };
7139
+ cookie?: never;
7140
+ };
7141
+ requestBody?: never;
7142
+ responses: {
7143
+ /** @description Photo deleted successfully */
7144
+ 204: {
7145
+ headers: {
7146
+ [name: string]: unknown;
7147
+ };
7148
+ content?: never;
7149
+ };
7150
+ };
7151
+ };
7152
+ updateCustomerPhoto: {
7153
+ parameters: {
7154
+ query?: never;
7155
+ header?: never;
7156
+ path: {
7157
+ id: {
7158
+ /** @example prod_abc123 */
7159
+ id: string;
7160
+ };
7161
+ };
7162
+ cookie?: never;
7163
+ };
7164
+ requestBody?: {
7165
+ content: {
7166
+ "application/json": {
7167
+ credit?: string | null;
7168
+ /** Format: uri */
7169
+ link_url?: string | null;
7170
+ link_text?: string | null;
7171
+ alt_text?: string | null;
7172
+ show_in_gallery?: boolean;
7173
+ };
7174
+ };
7175
+ };
7176
+ responses: {
7177
+ /** @description Photo updated successfully */
7178
+ 200: {
7179
+ headers: {
7180
+ [name: string]: unknown;
7181
+ };
7182
+ content: {
7183
+ "application/json": {
7184
+ data: components["schemas"]["CustomerPhoto"];
7185
+ };
7186
+ };
7187
+ };
7188
+ };
7189
+ };
7190
+ approveCustomerPhoto: {
7191
+ parameters: {
7192
+ query?: never;
7193
+ header?: never;
7194
+ path: {
7195
+ id: {
7196
+ /** @example prod_abc123 */
7197
+ id: string;
7198
+ };
7199
+ };
7200
+ cookie?: never;
7201
+ };
7202
+ requestBody?: never;
7203
+ responses: {
7204
+ /** @description Photo approved successfully */
7205
+ 200: {
7206
+ headers: {
7207
+ [name: string]: unknown;
7208
+ };
7209
+ content: {
7210
+ "application/json": {
7211
+ data: components["schemas"]["CustomerPhoto"];
7212
+ };
7213
+ };
7214
+ };
7215
+ };
7216
+ };
7217
+ rejectCustomerPhoto: {
7218
+ parameters: {
7219
+ query?: never;
7220
+ header?: never;
7221
+ path: {
7222
+ id: {
7223
+ /** @example prod_abc123 */
7224
+ id: string;
7225
+ };
7226
+ };
7227
+ cookie?: never;
7228
+ };
7229
+ requestBody?: {
7230
+ content: {
7231
+ "application/json": {
7232
+ notes?: string;
7233
+ };
7234
+ };
7235
+ };
7236
+ responses: {
7237
+ /** @description Photo rejected successfully */
7238
+ 200: {
7239
+ headers: {
7240
+ [name: string]: unknown;
7241
+ };
7242
+ content: {
7243
+ "application/json": {
7244
+ data: components["schemas"]["CustomerPhoto"];
7245
+ };
7246
+ };
7247
+ };
7248
+ };
7249
+ };
6981
7250
  getVariant: {
6982
7251
  parameters: {
6983
7252
  query?: {
@@ -12074,7 +12343,7 @@ interface operations {
12074
12343
  * "order.paid"
12075
12344
  * ]
12076
12345
  */
12077
- 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")[];
12346
+ 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")[];
12078
12347
  /**
12079
12348
  * @default active
12080
12349
  * @example active
@@ -12168,7 +12437,7 @@ interface operations {
12168
12437
  * "product.updated"
12169
12438
  * ]
12170
12439
  */
12171
- 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")[];
12440
+ 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")[];
12172
12441
  /**
12173
12442
  * @example active
12174
12443
  * @enum {string}
@@ -17100,6 +17369,7 @@ type Image$2 = components['schemas']['Image'];
17100
17369
  type Collection$1 = components['schemas']['Collection'];
17101
17370
  type Customer$1 = components['schemas']['Customer'];
17102
17371
  type CustomerGroup$1 = components['schemas']['CustomerGroup'];
17372
+ type CustomerPhoto$1 = components['schemas']['CustomerPhoto'];
17103
17373
  type Company$1 = components['schemas']['Company'];
17104
17374
  type Cart$1 = components['schemas']['Cart'];
17105
17375
  type CartItem = components['schemas']['CartItem'];
@@ -17181,9 +17451,9 @@ type ProductStats = components['schemas']['ProductStats'];
17181
17451
  type Variant$1 = components['schemas']['Variant'];
17182
17452
  type Image$1 = components['schemas']['Image'];
17183
17453
  type GenerateVariantsResult = components['schemas']['GenerateVariantsResult'];
17184
- type ListParams$r = NonNullable<operations['listProducts']['parameters']['query']>;
17454
+ type ListParams$s = NonNullable<operations['listProducts']['parameters']['query']>;
17185
17455
  type CreateBody$n = NonNullable<operations['createProduct']['requestBody']>['content']['application/json'];
17186
- type UpdateBody$n = NonNullable<operations['updateProduct']['requestBody']>['content']['application/json'];
17456
+ type UpdateBody$o = NonNullable<operations['updateProduct']['requestBody']>['content']['application/json'];
17187
17457
  type DuplicateBody = NonNullable<operations['duplicateProduct']['requestBody']>['content']['application/json'];
17188
17458
  type CreateVariantBody = NonNullable<operations['createProductVariant']['requestBody']>['content']['application/json'];
17189
17459
  type GenerateVariantsBody = NonNullable<operations['generateProductVariants']['requestBody']>['content']['application/json'];
@@ -17193,14 +17463,14 @@ type CreateProductLinkBody = NonNullable<operations['createProductLink']['reques
17193
17463
  declare class ProductsResource {
17194
17464
  private client;
17195
17465
  constructor(client: Hydra);
17196
- list(params?: ListParams$r): Promise<ListResponse<Product>>;
17197
- iterate(params?: Omit<ListParams$r, 'cursor'>, options?: PaginateOptions): AsyncGenerator<Product, void, undefined>;
17198
- toArray(params?: Omit<ListParams$r, 'cursor'>, options?: PaginateOptions & {
17466
+ list(params?: ListParams$s): Promise<ListResponse<Product>>;
17467
+ iterate(params?: Omit<ListParams$s, 'cursor'>, options?: PaginateOptions): AsyncGenerator<Product, void, undefined>;
17468
+ toArray(params?: Omit<ListParams$s, 'cursor'>, options?: PaginateOptions & {
17199
17469
  limit?: number;
17200
17470
  }): Promise<Product[]>;
17201
- get(id: string, params?: Pick<ListParams$r, 'expand' | 'currency' | 'fields'>): Promise<DataResponse<Product>>;
17471
+ get(id: string, params?: Pick<ListParams$s, 'expand' | 'currency' | 'fields'>): Promise<DataResponse<Product>>;
17202
17472
  create(body: CreateBody$n, options?: ResourceRequestOptions): Promise<DataResponse<Product>>;
17203
- update(id: string, body: UpdateBody$n): Promise<DataResponse<Product>>;
17473
+ update(id: string, body: UpdateBody$o): Promise<DataResponse<Product>>;
17204
17474
  delete(id: string): Promise<void>;
17205
17475
  batchCreate(body: {
17206
17476
  products: CreateBody$n[];
@@ -17224,7 +17494,7 @@ declare class ProductsResource {
17224
17494
 
17225
17495
  type Variant = components['schemas']['Variant'];
17226
17496
  type VariantPrice = components['schemas']['VariantPrice'];
17227
- type UpdateBody$m = NonNullable<operations['updateVariant']['requestBody']>['content']['application/json'];
17497
+ type UpdateBody$n = NonNullable<operations['updateVariant']['requestBody']>['content']['application/json'];
17228
17498
  type UpsertPriceBody = NonNullable<operations['upsertVariantPrice']['requestBody']>['content']['application/json'];
17229
17499
  declare class VariantsResource {
17230
17500
  private client;
@@ -17234,7 +17504,7 @@ declare class VariantsResource {
17234
17504
  currency?: string;
17235
17505
  fields?: string;
17236
17506
  }): Promise<DataResponse<Variant>>;
17237
- update(id: string, body: UpdateBody$m): Promise<DataResponse<Variant>>;
17507
+ update(id: string, body: UpdateBody$n): Promise<DataResponse<Variant>>;
17238
17508
  delete(id: string): Promise<void>;
17239
17509
  listPrices(variantId: string): Promise<DataResponse<Record<string, VariantPrice>>>;
17240
17510
  upsertPrice(variantId: string, priceKeySlug: string, body: UpsertPriceBody): Promise<DataResponse<VariantPrice>>;
@@ -17246,23 +17516,23 @@ declare class VariantsResource {
17246
17516
  }
17247
17517
 
17248
17518
  type Collection = components['schemas']['Collection'];
17249
- type ListParams$q = NonNullable<operations['listCollections']['parameters']['query']>;
17519
+ type ListParams$r = NonNullable<operations['listCollections']['parameters']['query']>;
17250
17520
  type CreateBody$m = NonNullable<operations['createCollection']['requestBody']>['content']['application/json'];
17251
- type UpdateBody$l = NonNullable<operations['updateCollection']['requestBody']>['content']['application/json'];
17521
+ type UpdateBody$m = NonNullable<operations['updateCollection']['requestBody']>['content']['application/json'];
17252
17522
  type AddProductsBody = NonNullable<operations['addCollectionProducts']['requestBody']>['content']['application/json'];
17253
17523
  type ReorderProductsBody = NonNullable<operations['reorderCollectionProducts']['requestBody']>['content']['application/json'];
17254
17524
  type ReorderCollectionsBody = NonNullable<operations['reorderCollections']['requestBody']>['content']['application/json'];
17255
17525
  declare class CollectionsResource {
17256
17526
  private client;
17257
17527
  constructor(client: Hydra);
17258
- list(params?: ListParams$q): Promise<ListResponse<Collection>>;
17259
- iterate(params?: Omit<ListParams$q, 'cursor'>, options?: PaginateOptions): AsyncGenerator<Collection, void, undefined>;
17260
- toArray(params?: Omit<ListParams$q, 'cursor'>, options?: PaginateOptions & {
17528
+ list(params?: ListParams$r): Promise<ListResponse<Collection>>;
17529
+ iterate(params?: Omit<ListParams$r, 'cursor'>, options?: PaginateOptions): AsyncGenerator<Collection, void, undefined>;
17530
+ toArray(params?: Omit<ListParams$r, 'cursor'>, options?: PaginateOptions & {
17261
17531
  limit?: number;
17262
17532
  }): Promise<Collection[]>;
17263
- get(id: string, params?: Pick<ListParams$q, 'expand' | 'fields'>): Promise<DataResponse<Collection>>;
17533
+ get(id: string, params?: Pick<ListParams$r, 'expand' | 'fields'>): Promise<DataResponse<Collection>>;
17264
17534
  create(body: CreateBody$m, options?: ResourceRequestOptions): Promise<DataResponse<Collection>>;
17265
- update(id: string, body: UpdateBody$l): Promise<DataResponse<Collection>>;
17535
+ update(id: string, body: UpdateBody$m): Promise<DataResponse<Collection>>;
17266
17536
  delete(id: string): Promise<void>;
17267
17537
  tree(): Promise<DataResponse<unknown>>;
17268
17538
  reorder(body: ReorderCollectionsBody): Promise<void>;
@@ -17309,15 +17579,15 @@ declare class CheckoutResource {
17309
17579
 
17310
17580
  type Order$1 = components['schemas']['Order'];
17311
17581
  type FulfillmentOrder$1 = components['schemas']['FulfillmentOrder'];
17312
- type ListParams$p = NonNullable<operations['listOrders']['parameters']['query']>;
17582
+ type ListParams$q = NonNullable<operations['listOrders']['parameters']['query']>;
17313
17583
  type CreateBody$k = NonNullable<operations['createOrder']['requestBody']>['content']['application/json'];
17314
- type UpdateBody$k = NonNullable<operations['updateOrder']['requestBody']>['content']['application/json'];
17584
+ type UpdateBody$l = NonNullable<operations['updateOrder']['requestBody']>['content']['application/json'];
17315
17585
  declare class OrdersResource {
17316
17586
  private client;
17317
17587
  constructor(client: Hydra);
17318
- list(params?: ListParams$p): Promise<ListResponse<Order$1>>;
17319
- iterate(params?: Omit<ListParams$p, 'cursor'>, options?: PaginateOptions): AsyncGenerator<Order$1, void, undefined>;
17320
- toArray(params?: Omit<ListParams$p, 'cursor'>, options?: PaginateOptions & {
17588
+ list(params?: ListParams$q): Promise<ListResponse<Order$1>>;
17589
+ iterate(params?: Omit<ListParams$q, 'cursor'>, options?: PaginateOptions): AsyncGenerator<Order$1, void, undefined>;
17590
+ toArray(params?: Omit<ListParams$q, 'cursor'>, options?: PaginateOptions & {
17321
17591
  limit?: number;
17322
17592
  }): Promise<Order$1[]>;
17323
17593
  get(id: string, params?: {
@@ -17326,7 +17596,7 @@ declare class OrdersResource {
17326
17596
  fields?: string;
17327
17597
  }): Promise<DataResponse<Order$1>>;
17328
17598
  create(body: CreateBody$k, options?: ResourceRequestOptions): Promise<DataResponse<Order$1>>;
17329
- update(id: string, body: UpdateBody$k): Promise<DataResponse<Order$1>>;
17599
+ update(id: string, body: UpdateBody$l): Promise<DataResponse<Order$1>>;
17330
17600
  listFulfillmentOrders(orderId: string): Promise<DataResponse<FulfillmentOrder$1[]>>;
17331
17601
  /**
17332
17602
  * Returns the API path for downloading the invoice PDF for an order.
@@ -17341,26 +17611,26 @@ declare class OrdersResource {
17341
17611
 
17342
17612
  type Fulfillment = components['schemas']['Fulfillment'];
17343
17613
  type CreateBody$j = NonNullable<operations['createFulfillment']['requestBody']>['content']['application/json'];
17344
- type UpdateBody$j = NonNullable<operations['updateFulfillment']['requestBody']>['content']['application/json'];
17614
+ type UpdateBody$k = NonNullable<operations['updateFulfillment']['requestBody']>['content']['application/json'];
17345
17615
  type CancelBody = NonNullable<operations['cancelFulfillment']['requestBody']>['content']['application/json'];
17346
17616
  declare class FulfillmentsResource {
17347
17617
  private client;
17348
17618
  constructor(client: Hydra);
17349
17619
  /** Create a fulfillment for a fulfillment order */
17350
17620
  create(fulfillmentOrderId: string, body: CreateBody$j, options?: ResourceRequestOptions): Promise<DataResponse<Fulfillment>>;
17351
- update(id: string, body: UpdateBody$j): Promise<DataResponse<Fulfillment>>;
17621
+ update(id: string, body: UpdateBody$k): Promise<DataResponse<Fulfillment>>;
17352
17622
  cancel(id: string, body?: CancelBody): Promise<DataResponse<Fulfillment>>;
17353
17623
  }
17354
17624
 
17355
17625
  type Refund = components['schemas']['Refund'];
17356
- type ListParams$o = NonNullable<operations['listRefunds']['parameters']['query']>;
17626
+ type ListParams$p = NonNullable<operations['listRefunds']['parameters']['query']>;
17357
17627
  type CreateBody$i = NonNullable<operations['createOrderRefund']['requestBody']>['content']['application/json'];
17358
17628
  declare class RefundsResource {
17359
17629
  private client;
17360
17630
  constructor(client: Hydra);
17361
- list(params?: ListParams$o): Promise<ListResponse<Refund>>;
17362
- iterate(params?: Omit<ListParams$o, 'cursor'>, options?: PaginateOptions): AsyncGenerator<Refund, void, undefined>;
17363
- toArray(params?: Omit<ListParams$o, 'cursor'>, options?: PaginateOptions & {
17631
+ list(params?: ListParams$p): Promise<ListResponse<Refund>>;
17632
+ iterate(params?: Omit<ListParams$p, 'cursor'>, options?: PaginateOptions): AsyncGenerator<Refund, void, undefined>;
17633
+ toArray(params?: Omit<ListParams$p, 'cursor'>, options?: PaginateOptions & {
17364
17634
  limit?: number;
17365
17635
  }): Promise<Refund[]>;
17366
17636
  get(id: string, params?: {
@@ -17378,17 +17648,17 @@ declare class RefundsResource {
17378
17648
  }
17379
17649
 
17380
17650
  type Return = components['schemas']['Return'];
17381
- type ListParams$n = NonNullable<operations['listReturns']['parameters']['query']>;
17651
+ type ListParams$o = NonNullable<operations['listReturns']['parameters']['query']>;
17382
17652
  type CreateBody$h = NonNullable<operations['createOrderReturn']['requestBody']>['content']['application/json'];
17383
17653
  type ApproveBody = NonNullable<operations['approveReturn']['requestBody']>['content']['application/json'];
17384
17654
  type ReceiveBody$1 = NonNullable<operations['receiveReturn']['requestBody']>['content']['application/json'];
17385
- type RejectBody = NonNullable<operations['rejectReturn']['requestBody']>['content']['application/json'];
17655
+ type RejectBody$1 = NonNullable<operations['rejectReturn']['requestBody']>['content']['application/json'];
17386
17656
  declare class ReturnsResource {
17387
17657
  private client;
17388
17658
  constructor(client: Hydra);
17389
- list(params?: ListParams$n): Promise<ListResponse<Return>>;
17390
- iterate(params?: Omit<ListParams$n, 'cursor'>, options?: PaginateOptions): AsyncGenerator<Return, void, undefined>;
17391
- toArray(params?: Omit<ListParams$n, 'cursor'>, options?: PaginateOptions & {
17659
+ list(params?: ListParams$o): Promise<ListResponse<Return>>;
17660
+ iterate(params?: Omit<ListParams$o, 'cursor'>, options?: PaginateOptions): AsyncGenerator<Return, void, undefined>;
17661
+ toArray(params?: Omit<ListParams$o, 'cursor'>, options?: PaginateOptions & {
17392
17662
  limit?: number;
17393
17663
  }): Promise<Return[]>;
17394
17664
  get(id: string, params?: {
@@ -17400,24 +17670,24 @@ declare class ReturnsResource {
17400
17670
  approve(id: string, body?: ApproveBody): Promise<DataResponse<Return>>;
17401
17671
  receive(id: string, body?: ReceiveBody$1): Promise<DataResponse<Return>>;
17402
17672
  close(id: string): Promise<DataResponse<Return>>;
17403
- reject(id: string, body?: RejectBody): Promise<DataResponse<Return>>;
17673
+ reject(id: string, body?: RejectBody$1): Promise<DataResponse<Return>>;
17404
17674
  cancel(id: string): Promise<DataResponse<Return>>;
17405
17675
  }
17406
17676
 
17407
17677
  type DraftOrder = components['schemas']['DraftOrder'];
17408
17678
  type DraftOrderLineItem = components['schemas']['DraftOrderLineItem'];
17409
17679
  type Order = components['schemas']['Order'];
17410
- type ListParams$m = NonNullable<operations['listDraftOrders']['parameters']['query']>;
17680
+ type ListParams$n = NonNullable<operations['listDraftOrders']['parameters']['query']>;
17411
17681
  type CreateBody$g = NonNullable<operations['createDraftOrder']['requestBody']>['content']['application/json'];
17412
- type UpdateBody$i = NonNullable<operations['updateDraftOrder']['requestBody']>['content']['application/json'];
17682
+ type UpdateBody$j = NonNullable<operations['updateDraftOrder']['requestBody']>['content']['application/json'];
17413
17683
  type AddItemsBody = NonNullable<operations['addDraftOrderItems']['requestBody']>['content']['application/json'];
17414
17684
  type UpdateItemBody$2 = NonNullable<operations['updateDraftOrderItem']['requestBody']>['content']['application/json'];
17415
17685
  declare class DraftOrdersResource {
17416
17686
  private client;
17417
17687
  constructor(client: Hydra);
17418
- list(params?: ListParams$m): Promise<ListResponse<DraftOrder>>;
17419
- iterate(params?: Omit<ListParams$m, 'cursor'>, options?: PaginateOptions): AsyncGenerator<DraftOrder, void, undefined>;
17420
- toArray(params?: Omit<ListParams$m, 'cursor'>, options?: PaginateOptions & {
17688
+ list(params?: ListParams$n): Promise<ListResponse<DraftOrder>>;
17689
+ iterate(params?: Omit<ListParams$n, 'cursor'>, options?: PaginateOptions): AsyncGenerator<DraftOrder, void, undefined>;
17690
+ toArray(params?: Omit<ListParams$n, 'cursor'>, options?: PaginateOptions & {
17421
17691
  limit?: number;
17422
17692
  }): Promise<DraftOrder[]>;
17423
17693
  get(id: string, params?: {
@@ -17426,7 +17696,7 @@ declare class DraftOrdersResource {
17426
17696
  fields?: string;
17427
17697
  }): Promise<DataResponse<DraftOrder>>;
17428
17698
  create(body: CreateBody$g, options?: ResourceRequestOptions): Promise<DataResponse<DraftOrder>>;
17429
- update(id: string, body: UpdateBody$i): Promise<DataResponse<DraftOrder>>;
17699
+ update(id: string, body: UpdateBody$j): Promise<DataResponse<DraftOrder>>;
17430
17700
  delete(id: string): Promise<void>;
17431
17701
  addItems(draftOrderId: string, body: AddItemsBody): Promise<DataResponse<DraftOrderLineItem[]>>;
17432
17702
  updateItem(draftOrderId: string, itemId: string, body: UpdateItemBody$2): Promise<DataResponse<DraftOrderLineItem>>;
@@ -17441,22 +17711,22 @@ declare class DraftOrdersResource {
17441
17711
  }
17442
17712
 
17443
17713
  type Customer = components['schemas']['Customer'];
17444
- type ListParams$l = NonNullable<operations['listCustomers']['parameters']['query']>;
17714
+ type ListParams$m = NonNullable<operations['listCustomers']['parameters']['query']>;
17445
17715
  type CreateBody$f = NonNullable<operations['createCustomer']['requestBody']>['content']['application/json'];
17446
- type UpdateBody$h = NonNullable<operations['updateCustomer']['requestBody']>['content']['application/json'];
17716
+ type UpdateBody$i = NonNullable<operations['updateCustomer']['requestBody']>['content']['application/json'];
17447
17717
  type CreateAddressBody$1 = NonNullable<operations['createCustomerAddress']['requestBody']>['content']['application/json'];
17448
17718
  type CreateNoteBody$1 = NonNullable<operations['createCustomerNote']['requestBody']>['content']['application/json'];
17449
17719
  declare class CustomersResource {
17450
17720
  private client;
17451
17721
  constructor(client: Hydra);
17452
- list(params?: ListParams$l): Promise<ListResponse<Customer>>;
17453
- iterate(params?: Omit<ListParams$l, 'cursor'>, options?: PaginateOptions): AsyncGenerator<Customer, void, undefined>;
17454
- toArray(params?: Omit<ListParams$l, 'cursor'>, options?: PaginateOptions & {
17722
+ list(params?: ListParams$m): Promise<ListResponse<Customer>>;
17723
+ iterate(params?: Omit<ListParams$m, 'cursor'>, options?: PaginateOptions): AsyncGenerator<Customer, void, undefined>;
17724
+ toArray(params?: Omit<ListParams$m, 'cursor'>, options?: PaginateOptions & {
17455
17725
  limit?: number;
17456
17726
  }): Promise<Customer[]>;
17457
- get(id: string, params?: Pick<ListParams$l, 'expand' | 'fields'>): Promise<DataResponse<Customer>>;
17727
+ get(id: string, params?: Pick<ListParams$m, 'expand' | 'fields'>): Promise<DataResponse<Customer>>;
17458
17728
  create(body: CreateBody$f, options?: ResourceRequestOptions): Promise<DataResponse<Customer>>;
17459
- update(id: string, body: UpdateBody$h): Promise<DataResponse<Customer>>;
17729
+ update(id: string, body: UpdateBody$i): Promise<DataResponse<Customer>>;
17460
17730
  delete(id: string): Promise<void>;
17461
17731
  listAddresses(customerId: string): Promise<DataResponse<unknown[]>>;
17462
17732
  createAddress(customerId: string, body: CreateAddressBody$1): Promise<DataResponse<unknown>>;
@@ -17470,26 +17740,83 @@ declare class CustomersResource {
17470
17740
  }
17471
17741
 
17472
17742
  type CustomerGroup = components['schemas']['CustomerGroup'];
17473
- type ListParams$k = NonNullable<operations['listCustomerGroups']['parameters']['query']>;
17743
+ type ListParams$l = NonNullable<operations['listCustomerGroups']['parameters']['query']>;
17474
17744
  type CreateBody$e = NonNullable<operations['createCustomerGroup']['requestBody']>['content']['application/json'];
17475
- type UpdateBody$g = NonNullable<operations['updateCustomerGroup']['requestBody']>['content']['application/json'];
17745
+ type UpdateBody$h = NonNullable<operations['updateCustomerGroup']['requestBody']>['content']['application/json'];
17476
17746
  type AddMembersBody = NonNullable<operations['addCustomerGroupMembers']['requestBody']>['content']['application/json'];
17477
17747
  declare class CustomerGroupsResource {
17478
17748
  private client;
17479
17749
  constructor(client: Hydra);
17480
- list(params?: ListParams$k): Promise<ListResponse<CustomerGroup>>;
17481
- iterate(params?: Omit<ListParams$k, 'cursor'>, options?: PaginateOptions): AsyncGenerator<CustomerGroup, void, undefined>;
17482
- toArray(params?: Omit<ListParams$k, 'cursor'>, options?: PaginateOptions & {
17750
+ list(params?: ListParams$l): Promise<ListResponse<CustomerGroup>>;
17751
+ iterate(params?: Omit<ListParams$l, 'cursor'>, options?: PaginateOptions): AsyncGenerator<CustomerGroup, void, undefined>;
17752
+ toArray(params?: Omit<ListParams$l, 'cursor'>, options?: PaginateOptions & {
17483
17753
  limit?: number;
17484
17754
  }): Promise<CustomerGroup[]>;
17485
17755
  get(id: string): Promise<DataResponse<CustomerGroup>>;
17486
17756
  create(body: CreateBody$e, options?: ResourceRequestOptions): Promise<DataResponse<CustomerGroup>>;
17487
- update(id: string, body: UpdateBody$g): Promise<DataResponse<CustomerGroup>>;
17757
+ update(id: string, body: UpdateBody$h): Promise<DataResponse<CustomerGroup>>;
17488
17758
  delete(id: string): Promise<void>;
17489
17759
  addMembers(groupId: string, body: AddMembersBody): Promise<void>;
17490
17760
  removeMember(groupId: string, customerId: string): Promise<void>;
17491
17761
  }
17492
17762
 
17763
+ type CustomerPhoto = components['schemas']['CustomerPhoto'];
17764
+ type ListParams$k = NonNullable<operations['listCustomerPhotos']['parameters']['query']>;
17765
+ type UpdateBody$g = NonNullable<operations['updateCustomerPhoto']['requestBody']>['content']['application/json'];
17766
+ type RejectBody = NonNullable<operations['rejectCustomerPhoto']['requestBody']>['content']['application/json'];
17767
+ declare class CustomerPhotosResource {
17768
+ private client;
17769
+ constructor(client: Hydra);
17770
+ /**
17771
+ * List customer photos (secret key only).
17772
+ * Filter by product, status, etc.
17773
+ */
17774
+ list(params?: ListParams$k): Promise<ListResponse<CustomerPhoto>>;
17775
+ /**
17776
+ * Iterate through all customer photos with automatic pagination.
17777
+ */
17778
+ iterate(params?: Omit<ListParams$k, 'cursor'>, options?: PaginateOptions): AsyncGenerator<CustomerPhoto, void, undefined>;
17779
+ /**
17780
+ * Fetch all customer photos as an array (use with caution on large datasets).
17781
+ */
17782
+ toArray(params?: Omit<ListParams$k, 'cursor'>, options?: PaginateOptions & {
17783
+ limit?: number;
17784
+ }): Promise<CustomerPhoto[]>;
17785
+ /**
17786
+ * Upload a customer photo (publishable or secret key).
17787
+ * Accepts FormData with: image, product_id, credit, link_url, link_text, customer_email.
17788
+ */
17789
+ upload(formData: FormData): Promise<DataResponse<CustomerPhoto>>;
17790
+ /**
17791
+ * Get a single customer photo by ID (secret key only).
17792
+ */
17793
+ get(id: string): Promise<DataResponse<CustomerPhoto>>;
17794
+ /**
17795
+ * Update customer photo metadata (secret key only).
17796
+ * Fields: credit, link_url, link_text, alt_text, show_in_gallery.
17797
+ */
17798
+ update(id: string, body: UpdateBody$g): Promise<DataResponse<CustomerPhoto>>;
17799
+ /**
17800
+ * Approve a customer photo (secret key only).
17801
+ * Sets status to 'approved' and makes it visible on storefront.
17802
+ */
17803
+ approve(id: string): Promise<DataResponse<CustomerPhoto>>;
17804
+ /**
17805
+ * Reject a customer photo (secret key only).
17806
+ * Sets status to 'rejected'. Optionally include rejection notes.
17807
+ */
17808
+ reject(id: string, body?: RejectBody): Promise<DataResponse<CustomerPhoto>>;
17809
+ /**
17810
+ * Delete a customer photo (soft delete, secret key only).
17811
+ */
17812
+ delete(id: string): Promise<void>;
17813
+ /**
17814
+ * Get approved customer photos for a product (storefront-safe, publishable key works).
17815
+ * Returns up to 24 approved photos for display on product pages.
17816
+ */
17817
+ getForProduct(productId: string): Promise<DataResponse<CustomerPhoto[]>>;
17818
+ }
17819
+
17493
17820
  type UpdateBody$f = NonNullable<operations['updateAddress']['requestBody']>['content']['application/json'];
17494
17821
  declare class AddressesResource {
17495
17822
  private client;
@@ -18161,6 +18488,7 @@ declare class Hydra {
18161
18488
  readonly draftOrders: DraftOrdersResource;
18162
18489
  readonly customers: CustomersResource;
18163
18490
  readonly customerGroups: CustomerGroupsResource;
18491
+ readonly customerPhotos: CustomerPhotosResource;
18164
18492
  readonly addresses: AddressesResource;
18165
18493
  readonly storeCredit: StoreCreditResource;
18166
18494
  readonly inventory: InventoryResource;
@@ -18268,4 +18596,4 @@ declare class HydraIdempotencyError extends HydraError {
18268
18596
  constructor(body: HydraErrorBody, headers: Headers);
18269
18597
  }
18270
18598
 
18271
- 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 };
18599
+ 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, 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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gethydra/sdk",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "Official TypeScript SDK for the Hydra Commerce API",
5
5
  "license": "MIT",
6
6
  "author": "Grant Capital Group",