Skip to content

Commit af9cb3d

Browse files
docs: add TSDocs for 923a869
1 parent 923a869 commit af9cb3d

File tree

3 files changed

+142
-2
lines changed

3 files changed

+142
-2
lines changed

packages/core/types/src/http/product/admin/queries.ts

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ import { BaseFilterable, OperatorMap } from "../../../dal"
22
import { FindParams } from "../../common"
33
import { BaseProductListParams, BaseProductOptionParams } from "../common"
44

5+
/**
6+
* The product option's details.
7+
*/
58
export interface AdminProductOptionParams
69
extends Omit<BaseProductOptionParams, "product_id"> {}
10+
/**
11+
* The filters to apply on the retrieved product variants.
12+
*/
713
export interface AdminProductVariantParams
814
extends FindParams,
915
BaseFilterable<AdminProductVariantParams> {
@@ -53,6 +59,9 @@ export interface AdminProductVariantParams
5359
*/
5460
deleted_at?: OperatorMap<string>
5561
}
62+
/**
63+
* The filters to apply on the retrieved products.
64+
*/
5665
export interface AdminProductListParams
5766
extends Omit<BaseProductListParams, "categories"> {
5867
/**
@@ -65,20 +74,62 @@ export interface AdminProductListParams
6574
variants?: Omit<AdminProductVariantParams, "q">
6675
}
6776

77+
/**
78+
* The filters to apply on the retrieved products to export.
79+
*/
6880
export interface AdminProductExportParams extends Omit<AdminProductListParams, "tags" | "variants"> {
81+
/**
82+
* Filter by tag ID(s).
83+
*/
6984
tags?: {
85+
/**
86+
* The tag ID(s) to filter by.
87+
*/
7088
id?: string[]
7189
}
90+
/**
91+
* Apply filters on the product variants.
92+
*/
7293
variants?: {
73-
94+
/**
95+
* Filter by variant sku(s).
96+
*
97+
* @since 2.13.7
98+
*/
7499
sku?: string | string[] | OperatorMap<string | string[]>
100+
/**
101+
* Filter by variant ean(s).
102+
*
103+
* @since 2.13.7
104+
*/
75105
ean?: string | string[] | OperatorMap<string | string[]>
106+
/**
107+
* Filter by variant upc(s).
108+
*
109+
* @since 2.13.7
110+
*/
76111
upc?: string | string[] | OperatorMap<string | string[]>
112+
/**
113+
* Filter by variant barcode(s).
114+
*
115+
* @since 2.13.7
116+
*/
77117
barcode?: string | string[] | OperatorMap<string | string[]>
78-
118+
/**
119+
* Apply filters on the product variant's options.
120+
*/
79121
options?: {
122+
/**
123+
* Filter by option value(s).
124+
*/
80125
value?: string
126+
/**
127+
* Filter by option ID(s).
128+
*/
81129
option_id?: string
130+
/**
131+
* Apply filters on the option.
132+
*/
82133
option?: Record<string, any>
83134
}
84135
}

packages/core/types/src/http/product/common.ts

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ import { BaseProductCategory } from "../product-category/common"
66
import { BaseProductTag } from "../product-tag/common"
77
import { BaseProductType } from "../product-type/common"
88

9+
/**
10+
* The product's status.
11+
*/
912
export type ProductStatus = "draft" | "proposed" | "published" | "rejected"
13+
/**
14+
* The product's details.
15+
*/
1016
export interface BaseProduct {
1117
/**
1218
* The product's ID.
@@ -134,6 +140,9 @@ export interface BaseProduct {
134140
metadata?: Record<string, unknown> | null
135141
}
136142

143+
/**
144+
* The product variant's details.
145+
*/
137146
export interface BaseProductVariant {
138147
/**
139148
* The variant's ID.
@@ -255,6 +264,9 @@ export interface BaseProductVariant {
255264
metadata?: Record<string, unknown> | null
256265
}
257266

267+
/**
268+
* The product option's details.
269+
*/
258270
export interface BaseProductOption {
259271
/**
260272
* The option's ID.
@@ -294,6 +306,9 @@ export interface BaseProductOption {
294306
deleted_at?: string | null
295307
}
296308

309+
/**
310+
* The product image's details.
311+
*/
297312
export interface BaseProductImage {
298313
/**
299314
* The image's ID.
@@ -325,6 +340,9 @@ export interface BaseProductImage {
325340
metadata?: Record<string, unknown> | null
326341
}
327342

343+
/**
344+
* The product option value's details.
345+
*/
328346
export interface BaseProductOptionValue {
329347
/**
330348
* The option value's ID.
@@ -360,6 +378,9 @@ export interface BaseProductOptionValue {
360378
deleted_at?: string | null
361379
}
362380

381+
/**
382+
* The filters to apply on the retrieved products.
383+
*/
363384
export interface BaseProductListParams
364385
extends FindParams,
365386
BaseFilterable<BaseProductListParams> {
@@ -429,29 +450,91 @@ export interface BaseProductListParams
429450
deleted_at?: OperatorMap<string>
430451
}
431452

453+
/**
454+
* The filters to apply on the retrieved product options.
455+
*/
432456
export interface BaseProductOptionParams
433457
extends FindParams,
434458
BaseFilterable<BaseProductOptionParams> {
459+
/**
460+
* Query or keywords to filter the option's searchable fields.
461+
*/
435462
q?: string
463+
/**
464+
* Filter by option ID(s).
465+
*/
436466
id?: string | string[]
467+
/**
468+
* Filter by option title(s).
469+
*/
437470
title?: string | string[]
471+
/**
472+
* Filter by product ID(s).
473+
*/
438474
product_id?: string | string[]
439475
}
440476

477+
/**
478+
* The filters to apply on the retrieved product variants.
479+
*/
441480
export interface BaseProductVariantParams
442481
extends FindParams,
443482
BaseFilterable<BaseProductVariantParams> {
483+
/**
484+
* Query or keywords to filter the variant's searchable fields.
485+
*/
444486
q?: string
487+
/**
488+
* Filter by variant ID(s).
489+
*/
445490
id?: string | string[]
491+
/**
492+
* Apply filters on the variant's options.
493+
*/
446494
options?: {
495+
/**
496+
* Filter by option value.
497+
*/
447498
value: string
499+
/**
500+
* Filter by option ID.
501+
*/
448502
option_id: string
449503
},
504+
/**
505+
* Filter by variant sku(s).
506+
*
507+
* @since 2.13.7
508+
*/
450509
sku?: string | string[]
510+
/**
511+
* Filter by variant ean(s).
512+
*
513+
* @since 2.13.7
514+
*/
451515
ean?: string | string[]
516+
/**
517+
* Filter by variant upc(s).
518+
*
519+
* @since 2.13.7
520+
*/
452521
upc?: string | string[]
522+
/**
523+
* Filter by variant barcode(s).
524+
*
525+
* @since 2.13.7
526+
*/
453527
barcode?: string | string[]
528+
/**
529+
* Apply filters on the variant's creation date.
530+
*/
454531
created_at?: OperatorMap<string>
532+
/**
533+
* Apply filters on the variant's update date.
534+
*/
455535
updated_at?: OperatorMap<string>
536+
/**
537+
* Apply filters on the variant's deletion date.
538+
*/
456539
deleted_at?: OperatorMap<string>
457540
}

packages/core/types/src/http/product/store/queries.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ import {
55
BaseProductVariantParams,
66
} from "../common"
77

8+
/**
9+
* The product option's details.
10+
*/
811
export interface StoreProductOptionParams extends BaseProductOptionParams {}
12+
/**
13+
* The filters to apply on the retrieved product variants.
14+
*/
915
export interface StoreProductVariantParams extends BaseProductVariantParams {}
1016
export interface StoreProductPricingContext {
1117
/**

0 commit comments

Comments
 (0)