From 8203dec3e277c61b7c1ab5c487738e39ffbfd5ea Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 20 Oct 2023 11:31:34 +0000 Subject: [PATCH] chore(docs): Generated Product Module Reference (#5430) Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com> --- .../docs/content/references/product/.nojekyll | 1 + .../Buffer/methods/Buffer._iterator_.mdx | 39 + .../product/Buffer/methods/Buffer.at.mdx | 47 + .../product/Buffer/methods/Buffer.compare.mdx | 122 ++ .../product/Buffer/methods/Buffer.copy.mdx | 113 ++ .../Buffer/methods/Buffer.copyWithin.mdx | 62 + .../product/Buffer/methods/Buffer.entries.mdx | 73 + .../product/Buffer/methods/Buffer.equals.mdx | 58 + .../product/Buffer/methods/Buffer.every.mdx | 53 + .../product/Buffer/methods/Buffer.fill.mdx | 117 ++ .../product/Buffer/methods/Buffer.filter.mdx | 53 + .../product/Buffer/methods/Buffer.find.mdx | 54 + .../Buffer/methods/Buffer.findIndex.mdx | 54 + .../product/Buffer/methods/Buffer.forEach.mdx | 53 + .../Buffer/methods/Buffer.includes.mdx | 86 + .../product/Buffer/methods/Buffer.indexOf.mdx | 125 ++ .../product/Buffer/methods/Buffer.join.mdx | 45 + .../product/Buffer/methods/Buffer.keys.mdx | 62 + .../Buffer/methods/Buffer.lastIndexOf.mdx | 124 ++ .../product/Buffer/methods/Buffer.map.mdx | 54 + .../Buffer/methods/Buffer.readBigInt64BE.mdx | 48 + .../Buffer/methods/Buffer.readBigInt64LE.mdx | 48 + .../Buffer/methods/Buffer.readBigUInt64BE.mdx | 56 + .../Buffer/methods/Buffer.readBigUInt64LE.mdx | 56 + .../methods/Buffer.readBigUint64BE-1.mdx | 47 + .../methods/Buffer.readBigUint64LE-1.mdx | 47 + .../Buffer/methods/Buffer.readDoubleBE.mdx | 54 + .../Buffer/methods/Buffer.readDoubleLE.mdx | 56 + .../Buffer/methods/Buffer.readFloatBE.mdx | 54 + .../Buffer/methods/Buffer.readFloatLE.mdx | 56 + .../Buffer/methods/Buffer.readInt16BE.mdx | 56 + .../Buffer/methods/Buffer.readInt16LE.mdx | 58 + .../Buffer/methods/Buffer.readInt32BE.mdx | 56 + .../Buffer/methods/Buffer.readInt32LE.mdx | 58 + .../Buffer/methods/Buffer.readInt8.mdx | 60 + .../Buffer/methods/Buffer.readIntBE.mdx | 67 + .../Buffer/methods/Buffer.readIntLE.mdx | 63 + .../Buffer/methods/Buffer.readUInt16BE.mdx | 58 + .../Buffer/methods/Buffer.readUInt16LE.mdx | 60 + .../Buffer/methods/Buffer.readUInt32BE.mdx | 56 + .../Buffer/methods/Buffer.readUInt32LE.mdx | 58 + .../Buffer/methods/Buffer.readUInt8.mdx | 60 + .../Buffer/methods/Buffer.readUIntBE.mdx | 67 + .../Buffer/methods/Buffer.readUIntLE.mdx | 65 + .../Buffer/methods/Buffer.readUint16BE-1.mdx | 47 + .../Buffer/methods/Buffer.readUint16LE-1.mdx | 47 + .../Buffer/methods/Buffer.readUint32BE-1.mdx | 47 + .../Buffer/methods/Buffer.readUint32LE-1.mdx | 47 + .../Buffer/methods/Buffer.readUint8-1.mdx | 47 + .../Buffer/methods/Buffer.readUintBE-1.mdx | 55 + .../Buffer/methods/Buffer.readUintLE-1.mdx | 55 + .../product/Buffer/methods/Buffer.reduce.mdx | 137 ++ .../Buffer/methods/Buffer.reduceRight.mdx | 137 ++ .../product/Buffer/methods/Buffer.reverse.mdx | 30 + .../product/Buffer/methods/Buffer.set.mdx | 62 + .../product/Buffer/methods/Buffer.slice.mdx | 87 + .../product/Buffer/methods/Buffer.some.mdx | 53 + .../product/Buffer/methods/Buffer.sort.mdx | 45 + .../Buffer/methods/Buffer.subarray.mdx | 110 ++ .../product/Buffer/methods/Buffer.swap16.mdx | 62 + .../product/Buffer/methods/Buffer.swap32.mdx | 52 + .../product/Buffer/methods/Buffer.swap64.mdx | 52 + .../product/Buffer/methods/Buffer.toJSON.mdx | 74 + .../Buffer/methods/Buffer.toLocaleString.mdx | 32 + .../Buffer/methods/Buffer.toString.mdx | 96 + .../product/Buffer/methods/Buffer.valueOf.mdx | 32 + .../product/Buffer/methods/Buffer.values.mdx | 74 + .../product/Buffer/methods/Buffer.write.mdx | 173 ++ .../Buffer/methods/Buffer.writeBigInt64BE.mdx | 66 + .../Buffer/methods/Buffer.writeBigInt64LE.mdx | 66 + .../methods/Buffer.writeBigUInt64BE.mdx | 66 + .../methods/Buffer.writeBigUInt64LE.mdx | 66 + .../methods/Buffer.writeBigUint64BE-1.mdx | 55 + .../methods/Buffer.writeBigUint64LE-1.mdx | 55 + .../Buffer/methods/Buffer.writeDoubleBE.mdx | 65 + .../Buffer/methods/Buffer.writeDoubleLE.mdx | 65 + .../Buffer/methods/Buffer.writeFloatBE.mdx | 65 + .../Buffer/methods/Buffer.writeFloatLE.mdx | 65 + .../Buffer/methods/Buffer.writeInt16BE.mdx | 67 + .../Buffer/methods/Buffer.writeInt16LE.mdx | 67 + .../Buffer/methods/Buffer.writeInt32BE.mdx | 67 + .../Buffer/methods/Buffer.writeInt32LE.mdx | 67 + .../Buffer/methods/Buffer.writeInt8.mdx | 69 + .../Buffer/methods/Buffer.writeIntBE.mdx | 73 + .../Buffer/methods/Buffer.writeIntLE.mdx | 73 + .../Buffer/methods/Buffer.writeUInt16BE.mdx | 68 + .../Buffer/methods/Buffer.writeUInt16LE.mdx | 68 + .../Buffer/methods/Buffer.writeUInt32BE.mdx | 67 + .../Buffer/methods/Buffer.writeUInt32LE.mdx | 67 + .../Buffer/methods/Buffer.writeUInt8.mdx | 71 + .../Buffer/methods/Buffer.writeUIntBE.mdx | 75 + .../Buffer/methods/Buffer.writeUIntLE.mdx | 75 + .../Buffer/methods/Buffer.writeUint16BE-1.mdx | 55 + .../Buffer/methods/Buffer.writeUint16LE-1.mdx | 55 + .../Buffer/methods/Buffer.writeUint32BE-1.mdx | 55 + .../Buffer/methods/Buffer.writeUint32LE-1.mdx | 55 + .../Buffer/methods/Buffer.writeUint8-1.mdx | 55 + .../Buffer/methods/Buffer.writeUintBE-1.mdx | 63 + .../Buffer/methods/Buffer.writeUintLE-1.mdx | 63 + .../methods/BufferConstructor.alloc.mdx | 101 + .../methods/BufferConstructor.allocUnsafe.mdx | 76 + .../BufferConstructor.allocUnsafeSlow.mdx | 84 + .../methods/BufferConstructor.byteLength.mdx | 75 + .../methods/BufferConstructor.compare.mdx | 65 + .../methods/BufferConstructor.concat.mdx | 85 + .../methods/BufferConstructor.from.mdx | 178 ++ .../methods/BufferConstructor.isBuffer.mdx | 55 + .../methods/BufferConstructor.isEncoding.mdx | 62 + .../methods/BufferConstructor.of.mdx | 41 + .../methods/IProductModuleService.create.mdx | 783 ++++++++ .../IProductModuleService.createCategory.mdx | 434 +++++ ...ProductModuleService.createCollections.mdx | 202 ++ .../IProductModuleService.createOptions.mdx | 187 ++ .../IProductModuleService.createTags.mdx | 162 ++ .../IProductModuleService.createTypes.mdx | 178 ++ .../methods/IProductModuleService.delete.mdx | 105 + .../IProductModuleService.deleteCategory.mdx | 105 + ...ProductModuleService.deleteCollections.mdx | 105 + .../IProductModuleService.deleteOptions.mdx | 105 + .../IProductModuleService.deleteTags.mdx | 106 + .../IProductModuleService.deleteTypes.mdx | 105 + .../methods/IProductModuleService.list.mdx | 554 ++++++ .../IProductModuleService.listAndCount.mdx | 329 ++++ ...ctModuleService.listAndCountCategories.mdx | 329 ++++ ...tModuleService.listAndCountCollections.mdx | 297 +++ ...oductModuleService.listAndCountOptions.mdx | 297 +++ ...IProductModuleService.listAndCountTags.mdx | 289 +++ ...ProductModuleService.listAndCountTypes.mdx | 289 +++ ...ductModuleService.listAndCountVariants.mdx | 305 +++ .../IProductModuleService.listCategories.mdx | 410 ++++ .../IProductModuleService.listCollections.mdx | 338 ++++ .../IProductModuleService.listOptions.mdx | 338 ++++ .../IProductModuleService.listTags.mdx | 314 +++ .../IProductModuleService.listTypes.mdx | 314 +++ .../IProductModuleService.listVariants.mdx | 498 +++++ .../methods/IProductModuleService.restore.mdx | 135 ++ .../IProductModuleService.restoreVariants.mdx | 115 ++ .../IProductModuleService.retrieve.mdx | 851 ++++++++ ...IProductModuleService.retrieveCategory.mdx | 451 +++++ ...roductModuleService.retrieveCollection.mdx | 466 +++++ .../IProductModuleService.retrieveOption.mdx | 515 +++++ .../IProductModuleService.retrieveTag.mdx | 450 +++++ .../IProductModuleService.retrieveType.mdx | 217 +++ .../IProductModuleService.retrieveVariant.mdx | 667 +++++++ .../IProductModuleService.softDelete.mdx | 135 ++ .../methods/IProductModuleService.update.mdx | 647 +++++++ .../IProductModuleService.updateCategory.mdx | 441 +++++ ...ProductModuleService.updateCollections.mdx | 219 +++ .../IProductModuleService.updateOptions.mdx | 195 ++ .../IProductModuleService.updateTags.mdx | 171 ++ .../IProductModuleService.updateTypes.mdx | 179 ++ .../methods/IterableIterator._iterator_.mdx | 26 + .../methods/IterableIterator.next.mdx | 52 + .../methods/IterableIterator.return.mdx | 52 + .../methods/IterableIterator.throw.mdx | 52 + .../Iterator/methods/Iterator.next.mdx | 39 + .../Iterator/methods/Iterator.return.mdx | 39 + .../Iterator/methods/Iterator.throw.mdx | 39 + .../methods/SharedArrayBuffer.slice.mdx | 99 + .../product/enums/ProductStatus.mdx | 31 + .../docs/content/references/product/index.md | 95 + .../product/interfaces/ArrayLike.mdx | 37 + .../product/interfaces/BaseFilterable.mdx | 43 + .../references/product/interfaces/Buffer.mdx | 161 ++ .../product/interfaces/BufferConstructor.mdx | 1009 ++++++++++ .../references/product/interfaces/Context.mdx | 69 + .../interfaces/CreateProductCategoryDTO.mdx | 70 + .../interfaces/CreateProductCollectionDTO.mdx | 46 + .../product/interfaces/CreateProductDTO.mdx | 452 +++++ .../interfaces/CreateProductOptionDTO.mdx | 30 + .../interfaces/CreateProductTagDTO.mdx | 22 + .../interfaces/CreateProductTypeDTO.mdx | 38 + .../interfaces/CreateProductVariantDTO.mdx | 167 ++ .../CreateProductVariantOptionDTO.mdx | 22 + .../FilterableProductCategoryProps.mdx | 86 + .../FilterableProductCollectionProps.mdx | 54 + .../FilterableProductOptionProps.mdx | 54 + .../interfaces/FilterableProductProps.mdx | 118 ++ .../interfaces/FilterableProductTagProps.mdx | 46 + .../interfaces/FilterableProductTypeProps.mdx | 46 + .../FilterableProductVariantProps.mdx | 70 + .../product/interfaces/FindConfig.mdx | 76 + .../interfaces/IProductModuleService.mdx | 58 + .../product/interfaces/IterableIterator.mdx | 27 + .../product/interfaces/Iterator.mdx | 42 + .../interfaces/IteratorReturnResult.mdx | 41 + .../interfaces/IteratorYieldResult.mdx | 41 + .../interfaces/JoinerServiceConfig.mdx | 68 + .../interfaces/JoinerServiceConfigAlias.mdx | 28 + .../product/interfaces/ProductCategoryDTO.mdx | 636 ++++++ .../interfaces/ProductCollectionDTO.mdx | 726 +++++++ .../product/interfaces/ProductDTO.mdx | 1707 +++++++++++++++++ .../product/interfaces/ProductImageDTO.mdx | 46 + .../product/interfaces/ProductOptionDTO.mdx | 1025 ++++++++++ .../interfaces/ProductOptionValueDTO.mdx | 876 +++++++++ .../product/interfaces/ProductTagDTO.mdx | 710 +++++++ .../product/interfaces/ProductTypeDTO.mdx | 46 + .../product/interfaces/ProductVariantDTO.mdx | 1177 ++++++++++++ .../product/interfaces/RestoreReturn.mdx | 35 + .../product/interfaces/SharedArrayBuffer.mdx | 106 + .../SharedArrayBufferConstructor.mdx | 105 + .../product/interfaces/SoftDeleteReturn.mdx | 35 + .../interfaces/UpdateProductCategoryDTO.mdx | 70 + .../interfaces/UpdateProductCollectionDTO.mdx | 62 + .../product/interfaces/UpdateProductDTO.mdx | 306 +++ .../interfaces/UpdateProductOptionDTO.mdx | 36 + .../interfaces/UpdateProductTagDTO.mdx | 30 + .../interfaces/UpdateProductTypeDTO.mdx | 38 + .../interfaces/UpdateProductVariantDTO.mdx | 175 ++ .../product/types/ArrayBufferLike.mdx | 9 + .../product/types/ArrayBufferView.mdx | 9 + .../product/types/BufferEncoding.mdx | 9 + .../references/product/types/Exclude.mdx | 32 + .../references/product/types/ExpandScalar.mdx | 22 + .../references/product/types/FilterQuery.mdx | 30 + .../references/product/types/FilterValue.mdx | 22 + .../references/product/types/FilterValue2.mdx | 22 + .../product/types/IteratorResult.mdx | 30 + .../product/types/JoinerRelationship.mdx | 78 + .../product/types/ModuleJoinerConfig.mdx | 9 + .../types/ModuleJoinerRelationship.mdx | 9 + .../content/references/product/types/Omit.mdx | 32 + .../references/product/types/OperatorMap.mdx | 179 ++ .../references/product/types/Partial.mdx | 24 + .../content/references/product/types/Pick.mdx | 32 + .../references/product/types/PrevLimit.mdx | 9 + .../references/product/types/Primary.mdx | 22 + .../references/product/types/Query.mdx | 22 + .../references/product/types/Readonly.mdx | 24 + .../product/types/ReadonlyPrimary.mdx | 22 + .../references/product/types/Record.mdx | 32 + .../references/product/types/Scalar.mdx | 9 + .../references/product/types/TypedArray.mdx | 9 + .../product/types/WithImplicitCoercion.mdx | 22 + .../references/product/variables/Buffer-1.mdx | 9 + .../product/variables/SharedArrayBuffer-1.mdx | 9 + www/apps/docs/sidebars.js | 50 +- 237 files changed, 32852 insertions(+), 2 deletions(-) create mode 100644 www/apps/docs/content/references/product/.nojekyll create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer._iterator_.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.at.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.compare.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.copy.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.copyWithin.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.entries.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.equals.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.every.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.fill.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.filter.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.find.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.findIndex.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.forEach.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.includes.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.indexOf.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.join.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.keys.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.lastIndexOf.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.map.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigInt64BE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigInt64LE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigUInt64BE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigUInt64LE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigUint64BE-1.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigUint64LE-1.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readDoubleBE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readDoubleLE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readFloatBE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readFloatLE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readInt16BE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readInt16LE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readInt32BE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readInt32LE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readInt8.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readIntBE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readIntLE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readUInt16BE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readUInt16LE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readUInt32BE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readUInt32LE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readUInt8.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readUIntBE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readUIntLE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readUint16BE-1.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readUint16LE-1.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readUint32BE-1.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readUint32LE-1.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readUint8-1.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readUintBE-1.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.readUintLE-1.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.reduce.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.reduceRight.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.reverse.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.set.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.slice.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.some.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.sort.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.subarray.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.swap16.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.swap32.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.swap64.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.toJSON.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.toLocaleString.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.toString.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.valueOf.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.values.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.write.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigInt64BE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigInt64LE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigUInt64BE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigUInt64LE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigUint64BE-1.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigUint64LE-1.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeDoubleBE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeDoubleLE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeFloatBE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeFloatLE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeInt16BE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeInt16LE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeInt32BE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeInt32LE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeInt8.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeIntBE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeIntLE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUInt16BE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUInt16LE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUInt32BE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUInt32LE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUInt8.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUIntBE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUIntLE.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUint16BE-1.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUint16LE-1.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUint32BE-1.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUint32LE-1.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUint8-1.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUintBE-1.mdx create mode 100644 www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUintLE-1.mdx create mode 100644 www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.alloc.mdx create mode 100644 www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.allocUnsafe.mdx create mode 100644 www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.allocUnsafeSlow.mdx create mode 100644 www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.byteLength.mdx create mode 100644 www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.compare.mdx create mode 100644 www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.concat.mdx create mode 100644 www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.from.mdx create mode 100644 www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.isBuffer.mdx create mode 100644 www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.isEncoding.mdx create mode 100644 www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.of.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.create.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.createCategory.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.createCollections.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.createOptions.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.createTags.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.createTypes.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.delete.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.deleteCategory.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.deleteCollections.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.deleteOptions.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.deleteTags.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.deleteTypes.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.list.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCount.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountCategories.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountCollections.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountOptions.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountTags.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountTypes.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountVariants.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listCategories.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listCollections.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listOptions.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listTags.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listTypes.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listVariants.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.restore.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.restoreVariants.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieve.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveCategory.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveCollection.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveOption.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveTag.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveType.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveVariant.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.softDelete.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.update.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.updateCategory.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.updateCollections.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.updateOptions.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.updateTags.mdx create mode 100644 www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.updateTypes.mdx create mode 100644 www/apps/docs/content/references/product/IterableIterator/methods/IterableIterator._iterator_.mdx create mode 100644 www/apps/docs/content/references/product/IterableIterator/methods/IterableIterator.next.mdx create mode 100644 www/apps/docs/content/references/product/IterableIterator/methods/IterableIterator.return.mdx create mode 100644 www/apps/docs/content/references/product/IterableIterator/methods/IterableIterator.throw.mdx create mode 100644 www/apps/docs/content/references/product/Iterator/methods/Iterator.next.mdx create mode 100644 www/apps/docs/content/references/product/Iterator/methods/Iterator.return.mdx create mode 100644 www/apps/docs/content/references/product/Iterator/methods/Iterator.throw.mdx create mode 100644 www/apps/docs/content/references/product/SharedArrayBuffer/methods/SharedArrayBuffer.slice.mdx create mode 100644 www/apps/docs/content/references/product/enums/ProductStatus.mdx create mode 100644 www/apps/docs/content/references/product/index.md create mode 100644 www/apps/docs/content/references/product/interfaces/ArrayLike.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/BaseFilterable.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/Buffer.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/BufferConstructor.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/Context.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/CreateProductCategoryDTO.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/CreateProductCollectionDTO.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/CreateProductDTO.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/CreateProductOptionDTO.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/CreateProductTagDTO.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/CreateProductTypeDTO.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/CreateProductVariantDTO.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/CreateProductVariantOptionDTO.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/FilterableProductCategoryProps.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/FilterableProductCollectionProps.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/FilterableProductOptionProps.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/FilterableProductProps.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/FilterableProductTagProps.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/FilterableProductTypeProps.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/FilterableProductVariantProps.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/FindConfig.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/IProductModuleService.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/IterableIterator.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/Iterator.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/IteratorReturnResult.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/IteratorYieldResult.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/JoinerServiceConfig.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/JoinerServiceConfigAlias.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/ProductCategoryDTO.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/ProductCollectionDTO.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/ProductDTO.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/ProductImageDTO.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/ProductOptionDTO.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/ProductOptionValueDTO.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/ProductTagDTO.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/ProductTypeDTO.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/ProductVariantDTO.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/RestoreReturn.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/SharedArrayBuffer.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/SharedArrayBufferConstructor.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/SoftDeleteReturn.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/UpdateProductCategoryDTO.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/UpdateProductCollectionDTO.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/UpdateProductDTO.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/UpdateProductOptionDTO.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/UpdateProductTagDTO.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/UpdateProductTypeDTO.mdx create mode 100644 www/apps/docs/content/references/product/interfaces/UpdateProductVariantDTO.mdx create mode 100644 www/apps/docs/content/references/product/types/ArrayBufferLike.mdx create mode 100644 www/apps/docs/content/references/product/types/ArrayBufferView.mdx create mode 100644 www/apps/docs/content/references/product/types/BufferEncoding.mdx create mode 100644 www/apps/docs/content/references/product/types/Exclude.mdx create mode 100644 www/apps/docs/content/references/product/types/ExpandScalar.mdx create mode 100644 www/apps/docs/content/references/product/types/FilterQuery.mdx create mode 100644 www/apps/docs/content/references/product/types/FilterValue.mdx create mode 100644 www/apps/docs/content/references/product/types/FilterValue2.mdx create mode 100644 www/apps/docs/content/references/product/types/IteratorResult.mdx create mode 100644 www/apps/docs/content/references/product/types/JoinerRelationship.mdx create mode 100644 www/apps/docs/content/references/product/types/ModuleJoinerConfig.mdx create mode 100644 www/apps/docs/content/references/product/types/ModuleJoinerRelationship.mdx create mode 100644 www/apps/docs/content/references/product/types/Omit.mdx create mode 100644 www/apps/docs/content/references/product/types/OperatorMap.mdx create mode 100644 www/apps/docs/content/references/product/types/Partial.mdx create mode 100644 www/apps/docs/content/references/product/types/Pick.mdx create mode 100644 www/apps/docs/content/references/product/types/PrevLimit.mdx create mode 100644 www/apps/docs/content/references/product/types/Primary.mdx create mode 100644 www/apps/docs/content/references/product/types/Query.mdx create mode 100644 www/apps/docs/content/references/product/types/Readonly.mdx create mode 100644 www/apps/docs/content/references/product/types/ReadonlyPrimary.mdx create mode 100644 www/apps/docs/content/references/product/types/Record.mdx create mode 100644 www/apps/docs/content/references/product/types/Scalar.mdx create mode 100644 www/apps/docs/content/references/product/types/TypedArray.mdx create mode 100644 www/apps/docs/content/references/product/types/WithImplicitCoercion.mdx create mode 100644 www/apps/docs/content/references/product/variables/Buffer-1.mdx create mode 100644 www/apps/docs/content/references/product/variables/SharedArrayBuffer-1.mdx diff --git a/www/apps/docs/content/references/product/.nojekyll b/www/apps/docs/content/references/product/.nojekyll new file mode 100644 index 0000000000..e2ac6616ad --- /dev/null +++ b/www/apps/docs/content/references/product/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer._iterator_.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer._iterator_.mdx new file mode 100644 index 0000000000..3e3276d005 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer._iterator_.mdx @@ -0,0 +1,39 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# [iterator] + +[Buffer](../../interfaces/Buffer.mdx).[iterator] + +**[iterator]**(): [`IterableIterator`](../../interfaces/IterableIterator.mdx)<`number`\> + +#### Returns + +[`IterableIterator`](../../interfaces/IterableIterator.mdx)<`number`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +#### Inherited from + +Uint8Array.[iterator] diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.at.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.at.mdx new file mode 100644 index 0000000000..c8c57099a0 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.at.mdx @@ -0,0 +1,47 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# at + +[Buffer](../../interfaces/Buffer.mdx).at + +**at**(`index`): `undefined` \| `number` + +Takes an integer value and returns the item at that index, +allowing for positive and negative integers. +Negative integers count back from the last item in the array. + +#### Parameters + + + +#### Returns + +`undefined` \| `number` + + + +#### Inherited from + +Uint8Array.at diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.compare.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.compare.mdx new file mode 100644 index 0000000000..a24b68928c --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.compare.mdx @@ -0,0 +1,122 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# compare + +[Buffer](../../interfaces/Buffer.mdx).compare + +**compare**(`target`, `targetStart?`, `targetEnd?`, `sourceStart?`, `sourceEnd?`): ``0`` \| ``1`` \| ``-1`` + +Compares `buf` with `target` and returns a number indicating whether `buf`comes before, after, or is the same as `target` in sort order. +Comparison is based on the actual sequence of bytes in each `Buffer`. + +* `0` is returned if `target` is the same as `buf` +* `1` is returned if `target` should come _before_`buf` when sorted. +* `-1` is returned if `target` should come _after_`buf` when sorted. + +```js +import { Buffer } from 'buffer'; + +const buf1 = Buffer.from('ABC'); +const buf2 = Buffer.from('BCD'); +const buf3 = Buffer.from('ABCD'); + +console.log(buf1.compare(buf1)); +// Prints: 0 +console.log(buf1.compare(buf2)); +// Prints: -1 +console.log(buf1.compare(buf3)); +// Prints: -1 +console.log(buf2.compare(buf1)); +// Prints: 1 +console.log(buf2.compare(buf3)); +// Prints: 1 +console.log([buf1, buf2, buf3].sort(Buffer.compare)); +// Prints: [ , , ] +// (This result is equal to: [buf1, buf3, buf2].) +``` + +The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd`arguments can be used to limit the comparison to specific ranges within `target`and `buf` respectively. + +```js +import { Buffer } from 'buffer'; + +const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]); +const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]); + +console.log(buf1.compare(buf2, 5, 9, 0, 4)); +// Prints: 0 +console.log(buf1.compare(buf2, 0, 6, 4)); +// Prints: -1 +console.log(buf1.compare(buf2, 5, 6, 5)); +// Prints: 1 +``` + +`ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`,`targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`. + +#### Parameters + + + +#### Returns + +``0`` \| ``1`` \| ``-1`` + + + +#### Since + +v0.11.13 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.copy.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.copy.mdx new file mode 100644 index 0000000000..ec0ab79ced --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.copy.mdx @@ -0,0 +1,113 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# copy + +[Buffer](../../interfaces/Buffer.mdx).copy + +**copy**(`target`, `targetStart?`, `sourceStart?`, `sourceEnd?`): `number` + +Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`. + +[`TypedArray.prototype.set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) performs the same operation, and is available +for all TypedArrays, including Node.js `Buffer`s, although it takes +different function arguments. + +```js +import { Buffer } from 'buffer'; + +// Create two `Buffer` instances. +const buf1 = Buffer.allocUnsafe(26); +const buf2 = Buffer.allocUnsafe(26).fill('!'); + +for (let i = 0; i < 26; i++) { + // 97 is the decimal ASCII value for 'a'. + buf1[i] = i + 97; +} + +// Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`. +buf1.copy(buf2, 8, 16, 20); +// This is equivalent to: +// buf2.set(buf1.subarray(16, 20), 8); + +console.log(buf2.toString('ascii', 0, 25)); +// Prints: !!!!!!!!qrst!!!!!!!!!!!!! +``` + +```js +import { Buffer } from 'buffer'; + +// Create a `Buffer` and copy data from one region to an overlapping region +// within the same `Buffer`. + +const buf = Buffer.allocUnsafe(26); + +for (let i = 0; i < 26; i++) { + // 97 is the decimal ASCII value for 'a'. + buf[i] = i + 97; +} + +buf.copy(buf, 0, 4, 10); + +console.log(buf.toString()); +// Prints: efghijghijklmnopqrstuvwxyz +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.1.90 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.copyWithin.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.copyWithin.mdx new file mode 100644 index 0000000000..c0330c368e --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.copyWithin.mdx @@ -0,0 +1,62 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# copyWithin + +[Buffer](../../interfaces/Buffer.mdx).copyWithin + +**copyWithin**(`target`, `start`, `end?`): [`Buffer`](../../variables/Buffer-1.mdx) + +Returns the this object after copying a section of the array identified by start and end +to the same array starting at position target + +#### Parameters + + + +#### Returns + +[`Buffer`](../../variables/Buffer-1.mdx) + + + +#### Inherited from + +Uint8Array.copyWithin diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.entries.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.entries.mdx new file mode 100644 index 0000000000..1cdd82f52d --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.entries.mdx @@ -0,0 +1,73 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# entries + +[Buffer](../../interfaces/Buffer.mdx).entries + +**entries**(): [`IterableIterator`](../../interfaces/IterableIterator.mdx)<[`number`, `number`]\> + +Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `[index, byte]` pairs from the contents +of `buf`. + +```js +import { Buffer } from 'buffer'; + +// Log the entire contents of a `Buffer`. + +const buf = Buffer.from('buffer'); + +for (const pair of buf.entries()) { + console.log(pair); +} +// Prints: +// [0, 98] +// [1, 117] +// [2, 102] +// [3, 102] +// [4, 101] +// [5, 114] +``` + +#### Returns + +[`IterableIterator`](../../interfaces/IterableIterator.mdx)<[`number`, `number`]\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +#### Since + +v1.1.0 + +#### Overrides + +Uint8Array.entries diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.equals.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.equals.mdx new file mode 100644 index 0000000000..34b6a2f171 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.equals.mdx @@ -0,0 +1,58 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# equals + +[Buffer](../../interfaces/Buffer.mdx).equals + +**equals**(`otherBuffer`): `boolean` + +Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`. + +```js +import { Buffer } from 'buffer'; + +const buf1 = Buffer.from('ABC'); +const buf2 = Buffer.from('414243', 'hex'); +const buf3 = Buffer.from('ABCD'); + +console.log(buf1.equals(buf2)); +// Prints: true +console.log(buf1.equals(buf3)); +// Prints: false +``` + +#### Parameters + + + +#### Returns + +`boolean` + + + +#### Since + +v0.11.13 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.every.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.every.mdx new file mode 100644 index 0000000000..46093af57a --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.every.mdx @@ -0,0 +1,53 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# every + +[Buffer](../../interfaces/Buffer.mdx).every + +**every**(`predicate`, `thisArg?`): `boolean` + +Determines whether all the members of an array satisfy the specified test. + +#### Parameters + + `unknown`", + "description": "A function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thisArg", + "type": "`any`", + "description": "An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`boolean` + + + +#### Inherited from + +Uint8Array.every diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.fill.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.fill.mdx new file mode 100644 index 0000000000..2dc68c80e1 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.fill.mdx @@ -0,0 +1,117 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# fill + +[Buffer](../../interfaces/Buffer.mdx).fill + +**fill**(`value`, `offset?`, `end?`, `encoding?`): [`Buffer`](../../variables/Buffer-1.mdx) + +Fills `buf` with the specified `value`. If the `offset` and `end` are not given, +the entire `buf` will be filled: + +```js +import { Buffer } from 'buffer'; + +// Fill a `Buffer` with the ASCII character 'h'. + +const b = Buffer.allocUnsafe(50).fill('h'); + +console.log(b.toString()); +// Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh +``` + +`value` is coerced to a `uint32` value if it is not a string, `Buffer`, or +integer. If the resulting integer is greater than `255` (decimal), `buf` will be +filled with `value & 255`. + +If the final write of a `fill()` operation falls on a multi-byte character, +then only the bytes of that character that fit into `buf` are written: + +```js +import { Buffer } from 'buffer'; + +// Fill a `Buffer` with character that takes up two bytes in UTF-8. + +console.log(Buffer.allocUnsafe(5).fill('\u0222')); +// Prints: +``` + +If `value` contains invalid characters, it is truncated; if no valid +fill data remains, an exception is thrown: + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(5); + +console.log(buf.fill('a')); +// Prints: +console.log(buf.fill('aazz', 'hex')); +// Prints: +console.log(buf.fill('zz', 'hex')); +// Throws an exception. +``` + +#### Parameters + + + +#### Returns + +[`Buffer`](../../variables/Buffer-1.mdx) + + + +#### Since + +v0.5.0 + +#### Overrides + +Uint8Array.fill diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.filter.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.filter.mdx new file mode 100644 index 0000000000..aaddeb516a --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.filter.mdx @@ -0,0 +1,53 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# filter + +[Buffer](../../interfaces/Buffer.mdx).filter + +**filter**(`predicate`, `thisArg?`): `Uint8Array` + +Returns the elements of an array that meet the condition specified in a callback function. + +#### Parameters + + `any`", + "description": "A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thisArg", + "type": "`any`", + "description": "An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Uint8Array` + + + +#### Inherited from + +Uint8Array.filter diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.find.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.find.mdx new file mode 100644 index 0000000000..bd048bbf06 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.find.mdx @@ -0,0 +1,54 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# find + +[Buffer](../../interfaces/Buffer.mdx).find + +**find**(`predicate`, `thisArg?`): `undefined` \| `number` + +Returns the value of the first element in the array where predicate is true, and undefined +otherwise. + +#### Parameters + + `boolean`", + "description": "find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, find immediately returns that element value. Otherwise, find returns undefined.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thisArg", + "type": "`any`", + "description": "If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`undefined` \| `number` + + + +#### Inherited from + +Uint8Array.find diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.findIndex.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.findIndex.mdx new file mode 100644 index 0000000000..3380721dec --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.findIndex.mdx @@ -0,0 +1,54 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# findIndex + +[Buffer](../../interfaces/Buffer.mdx).findIndex + +**findIndex**(`predicate`, `thisArg?`): `number` + +Returns the index of the first element in the array where predicate is true, and -1 +otherwise. + +#### Parameters + + `boolean`", + "description": "find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, findIndex immediately returns that element index. Otherwise, findIndex returns -1.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thisArg", + "type": "`any`", + "description": "If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`number` + + + +#### Inherited from + +Uint8Array.findIndex diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.forEach.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.forEach.mdx new file mode 100644 index 0000000000..ceae54c971 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.forEach.mdx @@ -0,0 +1,53 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# forEach + +[Buffer](../../interfaces/Buffer.mdx).forEach + +**forEach**(`callbackfn`, `thisArg?`): `void` + +Performs the specified action for each element in an array. + +#### Parameters + + `void`", + "description": "A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thisArg", + "type": "`any`", + "description": "An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`void` + + + +#### Inherited from + +Uint8Array.forEach diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.includes.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.includes.mdx new file mode 100644 index 0000000000..6b267a4689 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.includes.mdx @@ -0,0 +1,86 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# includes + +[Buffer](../../interfaces/Buffer.mdx).includes + +**includes**(`value`, `byteOffset?`, `encoding?`): `boolean` + +Equivalent to `buf.indexOf() !== -1`. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from('this is a buffer'); + +console.log(buf.includes('this')); +// Prints: true +console.log(buf.includes('is')); +// Prints: true +console.log(buf.includes(Buffer.from('a buffer'))); +// Prints: true +console.log(buf.includes(97)); +// Prints: true (97 is the decimal ASCII value for 'a') +console.log(buf.includes(Buffer.from('a buffer example'))); +// Prints: false +console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8))); +// Prints: true +console.log(buf.includes('this', 4)); +// Prints: false +``` + +#### Parameters + + + +#### Returns + +`boolean` + + + +#### Since + +v5.3.0 + +#### Overrides + +Uint8Array.includes diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.indexOf.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.indexOf.mdx new file mode 100644 index 0000000000..9a8b9fc44e --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.indexOf.mdx @@ -0,0 +1,125 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# indexOf + +[Buffer](../../interfaces/Buffer.mdx).indexOf + +**indexOf**(`value`, `byteOffset?`, `encoding?`): `number` + +If `value` is: + +* a string, `value` is interpreted according to the character encoding in`encoding`. +* a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety. +To compare a partial `Buffer`, use `buf.subarray`. +* a number, `value` will be interpreted as an unsigned 8-bit integer +value between `0` and `255`. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from('this is a buffer'); + +console.log(buf.indexOf('this')); +// Prints: 0 +console.log(buf.indexOf('is')); +// Prints: 2 +console.log(buf.indexOf(Buffer.from('a buffer'))); +// Prints: 8 +console.log(buf.indexOf(97)); +// Prints: 8 (97 is the decimal ASCII value for 'a') +console.log(buf.indexOf(Buffer.from('a buffer example'))); +// Prints: -1 +console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8))); +// Prints: 8 + +const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); + +console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le')); +// Prints: 4 +console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le')); +// Prints: 6 +``` + +If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, +an integer between 0 and 255. + +If `byteOffset` is not a number, it will be coerced to a number. If the result +of coercion is `NaN` or `0`, then the entire buffer will be searched. This +behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf). + +```js +import { Buffer } from 'buffer'; + +const b = Buffer.from('abcdef'); + +// Passing a value that's a number, but not a valid byte. +// Prints: 2, equivalent to searching for 99 or 'c'. +console.log(b.indexOf(99.9)); +console.log(b.indexOf(256 + 99)); + +// Passing a byteOffset that coerces to NaN or 0. +// Prints: 1, searching the whole buffer. +console.log(b.indexOf('b', undefined)); +console.log(b.indexOf('b', {})); +console.log(b.indexOf('b', null)); +console.log(b.indexOf('b', [])); +``` + +If `value` is an empty string or empty `Buffer` and `byteOffset` is less +than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned. + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v1.5.0 + +#### Overrides + +Uint8Array.indexOf diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.join.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.join.mdx new file mode 100644 index 0000000000..67e4239b40 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.join.mdx @@ -0,0 +1,45 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# join + +[Buffer](../../interfaces/Buffer.mdx).join + +**join**(`separator?`): `string` + +Adds all the elements of an array separated by the specified separator string. + +#### Parameters + + + +#### Returns + +`string` + + + +#### Inherited from + +Uint8Array.join diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.keys.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.keys.mdx new file mode 100644 index 0000000000..49101bf0ba --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.keys.mdx @@ -0,0 +1,62 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# keys + +[Buffer](../../interfaces/Buffer.mdx).keys + +**keys**(): [`IterableIterator`](../../interfaces/IterableIterator.mdx)<`number`\> + +Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indices). + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from('buffer'); + +for (const key of buf.keys()) { + console.log(key); +} +// Prints: +// 0 +// 1 +// 2 +// 3 +// 4 +// 5 +``` + +#### Returns + +[`IterableIterator`](../../interfaces/IterableIterator.mdx)<`number`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +#### Since + +v1.1.0 + +#### Overrides + +Uint8Array.keys diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.lastIndexOf.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.lastIndexOf.mdx new file mode 100644 index 0000000000..b39dd36f15 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.lastIndexOf.mdx @@ -0,0 +1,124 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# lastIndexOf + +[Buffer](../../interfaces/Buffer.mdx).lastIndexOf + +**lastIndexOf**(`value`, `byteOffset?`, `encoding?`): `number` + +Identical to `buf.indexOf()`, except the last occurrence of `value` is found +rather than the first occurrence. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from('this buffer is a buffer'); + +console.log(buf.lastIndexOf('this')); +// Prints: 0 +console.log(buf.lastIndexOf('buffer')); +// Prints: 17 +console.log(buf.lastIndexOf(Buffer.from('buffer'))); +// Prints: 17 +console.log(buf.lastIndexOf(97)); +// Prints: 15 (97 is the decimal ASCII value for 'a') +console.log(buf.lastIndexOf(Buffer.from('yolo'))); +// Prints: -1 +console.log(buf.lastIndexOf('buffer', 5)); +// Prints: 5 +console.log(buf.lastIndexOf('buffer', 4)); +// Prints: -1 + +const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); + +console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le')); +// Prints: 6 +console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le')); +// Prints: 4 +``` + +If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, +an integer between 0 and 255. + +If `byteOffset` is not a number, it will be coerced to a number. Any arguments +that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer. +This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf). + +```js +import { Buffer } from 'buffer'; + +const b = Buffer.from('abcdef'); + +// Passing a value that's a number, but not a valid byte. +// Prints: 2, equivalent to searching for 99 or 'c'. +console.log(b.lastIndexOf(99.9)); +console.log(b.lastIndexOf(256 + 99)); + +// Passing a byteOffset that coerces to NaN. +// Prints: 1, searching the whole buffer. +console.log(b.lastIndexOf('b', undefined)); +console.log(b.lastIndexOf('b', {})); + +// Passing a byteOffset that coerces to 0. +// Prints: -1, equivalent to passing 0. +console.log(b.lastIndexOf('b', null)); +console.log(b.lastIndexOf('b', [])); +``` + +If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned. + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v6.0.0 + +#### Overrides + +Uint8Array.lastIndexOf diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.map.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.map.mdx new file mode 100644 index 0000000000..e8b0f4525e --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.map.mdx @@ -0,0 +1,54 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# map + +[Buffer](../../interfaces/Buffer.mdx).map + +**map**(`callbackfn`, `thisArg?`): `Uint8Array` + +Calls a defined callback function on each element of an array, and returns an array that +contains the results. + +#### Parameters + + `number`", + "description": "A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thisArg", + "type": "`any`", + "description": "An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Uint8Array` + + + +#### Inherited from + +Uint8Array.map diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigInt64BE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigInt64BE.mdx new file mode 100644 index 0000000000..46a88cbc11 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigInt64BE.mdx @@ -0,0 +1,48 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readBigInt64BE + +[Buffer](../../interfaces/Buffer.mdx).readBigInt64BE + +**readBigInt64BE**(`offset?`): `bigint` + +Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`. + +Integers read from a `Buffer` are interpreted as two's complement signed +values. + +#### Parameters + + + +#### Returns + +`bigint` + + + +#### Since + +v12.0.0, v10.20.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigInt64LE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigInt64LE.mdx new file mode 100644 index 0000000000..0d58b9a24a --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigInt64LE.mdx @@ -0,0 +1,48 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readBigInt64LE + +[Buffer](../../interfaces/Buffer.mdx).readBigInt64LE + +**readBigInt64LE**(`offset?`): `bigint` + +Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`. + +Integers read from a `Buffer` are interpreted as two's complement signed +values. + +#### Parameters + + + +#### Returns + +`bigint` + + + +#### Since + +v12.0.0, v10.20.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigUInt64BE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigUInt64BE.mdx new file mode 100644 index 0000000000..7ce3c4bd75 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigUInt64BE.mdx @@ -0,0 +1,56 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readBigUInt64BE + +[Buffer](../../interfaces/Buffer.mdx).readBigUInt64BE + +**readBigUInt64BE**(`offset?`): `bigint` + +Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`. + +This function is also available under the `readBigUint64BE` alias. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); + +console.log(buf.readBigUInt64BE(0)); +// Prints: 4294967295n +``` + +#### Parameters + + + +#### Returns + +`bigint` + + + +#### Since + +v12.0.0, v10.20.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigUInt64LE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigUInt64LE.mdx new file mode 100644 index 0000000000..efd0d1372b --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigUInt64LE.mdx @@ -0,0 +1,56 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readBigUInt64LE + +[Buffer](../../interfaces/Buffer.mdx).readBigUInt64LE + +**readBigUInt64LE**(`offset?`): `bigint` + +Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offset`. + +This function is also available under the `readBigUint64LE` alias. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); + +console.log(buf.readBigUInt64LE(0)); +// Prints: 18446744069414584320n +``` + +#### Parameters + + + +#### Returns + +`bigint` + + + +#### Since + +v12.0.0, v10.20.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigUint64BE-1.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigUint64BE-1.mdx new file mode 100644 index 0000000000..f504c3d204 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigUint64BE-1.mdx @@ -0,0 +1,47 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readBigUint64BE + +[Buffer](../../interfaces/Buffer.mdx).readBigUint64BE + +**readBigUint64BE**(`offset?`): `bigint` + +#### Parameters + + + +#### Returns + +`bigint` + + + +#### Alias + +Buffer.readBigUInt64BE + +#### Since + +v14.10.0, v12.19.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigUint64LE-1.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigUint64LE-1.mdx new file mode 100644 index 0000000000..508ab497e9 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readBigUint64LE-1.mdx @@ -0,0 +1,47 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readBigUint64LE + +[Buffer](../../interfaces/Buffer.mdx).readBigUint64LE + +**readBigUint64LE**(`offset?`): `bigint` + +#### Parameters + + + +#### Returns + +`bigint` + + + +#### Alias + +Buffer.readBigUInt64LE + +#### Since + +v14.10.0, v12.19.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readDoubleBE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readDoubleBE.mdx new file mode 100644 index 0000000000..6872188972 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readDoubleBE.mdx @@ -0,0 +1,54 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readDoubleBE + +[Buffer](../../interfaces/Buffer.mdx).readDoubleBE + +**readDoubleBE**(`offset?`): `number` + +Reads a 64-bit, big-endian double from `buf` at the specified `offset`. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); + +console.log(buf.readDoubleBE(0)); +// Prints: 8.20788039913184e-304 +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.11.15 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readDoubleLE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readDoubleLE.mdx new file mode 100644 index 0000000000..ee869f19b3 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readDoubleLE.mdx @@ -0,0 +1,56 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readDoubleLE + +[Buffer](../../interfaces/Buffer.mdx).readDoubleLE + +**readDoubleLE**(`offset?`): `number` + +Reads a 64-bit, little-endian double from `buf` at the specified `offset`. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); + +console.log(buf.readDoubleLE(0)); +// Prints: 5.447603722011605e-270 +console.log(buf.readDoubleLE(1)); +// Throws ERR_OUT_OF_RANGE. +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.11.15 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readFloatBE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readFloatBE.mdx new file mode 100644 index 0000000000..64bdeab9c2 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readFloatBE.mdx @@ -0,0 +1,54 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readFloatBE + +[Buffer](../../interfaces/Buffer.mdx).readFloatBE + +**readFloatBE**(`offset?`): `number` + +Reads a 32-bit, big-endian float from `buf` at the specified `offset`. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from([1, 2, 3, 4]); + +console.log(buf.readFloatBE(0)); +// Prints: 2.387939260590663e-38 +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.11.15 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readFloatLE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readFloatLE.mdx new file mode 100644 index 0000000000..580ca8d16d --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readFloatLE.mdx @@ -0,0 +1,56 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readFloatLE + +[Buffer](../../interfaces/Buffer.mdx).readFloatLE + +**readFloatLE**(`offset?`): `number` + +Reads a 32-bit, little-endian float from `buf` at the specified `offset`. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from([1, 2, 3, 4]); + +console.log(buf.readFloatLE(0)); +// Prints: 1.539989614439558e-36 +console.log(buf.readFloatLE(1)); +// Throws ERR_OUT_OF_RANGE. +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.11.15 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readInt16BE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readInt16BE.mdx new file mode 100644 index 0000000000..7b31596221 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readInt16BE.mdx @@ -0,0 +1,56 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readInt16BE + +[Buffer](../../interfaces/Buffer.mdx).readInt16BE + +**readInt16BE**(`offset?`): `number` + +Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`. + +Integers read from a `Buffer` are interpreted as two's complement signed values. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from([0, 5]); + +console.log(buf.readInt16BE(0)); +// Prints: 5 +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.5.5 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readInt16LE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readInt16LE.mdx new file mode 100644 index 0000000000..4993a5cabc --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readInt16LE.mdx @@ -0,0 +1,58 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readInt16LE + +[Buffer](../../interfaces/Buffer.mdx).readInt16LE + +**readInt16LE**(`offset?`): `number` + +Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`. + +Integers read from a `Buffer` are interpreted as two's complement signed values. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from([0, 5]); + +console.log(buf.readInt16LE(0)); +// Prints: 1280 +console.log(buf.readInt16LE(1)); +// Throws ERR_OUT_OF_RANGE. +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.5.5 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readInt32BE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readInt32BE.mdx new file mode 100644 index 0000000000..065b8be460 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readInt32BE.mdx @@ -0,0 +1,56 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readInt32BE + +[Buffer](../../interfaces/Buffer.mdx).readInt32BE + +**readInt32BE**(`offset?`): `number` + +Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`. + +Integers read from a `Buffer` are interpreted as two's complement signed values. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from([0, 0, 0, 5]); + +console.log(buf.readInt32BE(0)); +// Prints: 5 +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.5.5 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readInt32LE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readInt32LE.mdx new file mode 100644 index 0000000000..b662b6fe37 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readInt32LE.mdx @@ -0,0 +1,58 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readInt32LE + +[Buffer](../../interfaces/Buffer.mdx).readInt32LE + +**readInt32LE**(`offset?`): `number` + +Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`. + +Integers read from a `Buffer` are interpreted as two's complement signed values. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from([0, 0, 0, 5]); + +console.log(buf.readInt32LE(0)); +// Prints: 83886080 +console.log(buf.readInt32LE(1)); +// Throws ERR_OUT_OF_RANGE. +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.5.5 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readInt8.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readInt8.mdx new file mode 100644 index 0000000000..4d5c1742ae --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readInt8.mdx @@ -0,0 +1,60 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readInt8 + +[Buffer](../../interfaces/Buffer.mdx).readInt8 + +**readInt8**(`offset?`): `number` + +Reads a signed 8-bit integer from `buf` at the specified `offset`. + +Integers read from a `Buffer` are interpreted as two's complement signed values. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from([-1, 5]); + +console.log(buf.readInt8(0)); +// Prints: -1 +console.log(buf.readInt8(1)); +// Prints: 5 +console.log(buf.readInt8(2)); +// Throws ERR_OUT_OF_RANGE. +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.5.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readIntBE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readIntBE.mdx new file mode 100644 index 0000000000..cad64b81c9 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readIntBE.mdx @@ -0,0 +1,67 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readIntBE + +[Buffer](../../interfaces/Buffer.mdx).readIntBE + +**readIntBE**(`offset`, `byteLength`): `number` + +Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a big-endian, two's complement signed value +supporting up to 48 bits of accuracy. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + +console.log(buf.readIntBE(0, 6).toString(16)); +// Prints: 1234567890ab +console.log(buf.readIntBE(1, 6).toString(16)); +// Throws ERR_OUT_OF_RANGE. +console.log(buf.readIntBE(1, 0).toString(16)); +// Throws ERR_OUT_OF_RANGE. +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.11.15 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readIntLE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readIntLE.mdx new file mode 100644 index 0000000000..0cd5a63e85 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readIntLE.mdx @@ -0,0 +1,63 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readIntLE + +[Buffer](../../interfaces/Buffer.mdx).readIntLE + +**readIntLE**(`offset`, `byteLength`): `number` + +Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a little-endian, two's complement signed value +supporting up to 48 bits of accuracy. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + +console.log(buf.readIntLE(0, 6).toString(16)); +// Prints: -546f87a9cbee +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.11.15 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUInt16BE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUInt16BE.mdx new file mode 100644 index 0000000000..a7b0fbedd7 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUInt16BE.mdx @@ -0,0 +1,58 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readUInt16BE + +[Buffer](../../interfaces/Buffer.mdx).readUInt16BE + +**readUInt16BE**(`offset?`): `number` + +Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`. + +This function is also available under the `readUint16BE` alias. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from([0x12, 0x34, 0x56]); + +console.log(buf.readUInt16BE(0).toString(16)); +// Prints: 1234 +console.log(buf.readUInt16BE(1).toString(16)); +// Prints: 3456 +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.5.5 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUInt16LE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUInt16LE.mdx new file mode 100644 index 0000000000..aebab82d48 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUInt16LE.mdx @@ -0,0 +1,60 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readUInt16LE + +[Buffer](../../interfaces/Buffer.mdx).readUInt16LE + +**readUInt16LE**(`offset?`): `number` + +Reads an unsigned, little-endian 16-bit integer from `buf` at the specified`offset`. + +This function is also available under the `readUint16LE` alias. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from([0x12, 0x34, 0x56]); + +console.log(buf.readUInt16LE(0).toString(16)); +// Prints: 3412 +console.log(buf.readUInt16LE(1).toString(16)); +// Prints: 5634 +console.log(buf.readUInt16LE(2).toString(16)); +// Throws ERR_OUT_OF_RANGE. +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.5.5 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUInt32BE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUInt32BE.mdx new file mode 100644 index 0000000000..87a31a9fd3 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUInt32BE.mdx @@ -0,0 +1,56 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readUInt32BE + +[Buffer](../../interfaces/Buffer.mdx).readUInt32BE + +**readUInt32BE**(`offset?`): `number` + +Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`. + +This function is also available under the `readUint32BE` alias. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); + +console.log(buf.readUInt32BE(0).toString(16)); +// Prints: 12345678 +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.5.5 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUInt32LE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUInt32LE.mdx new file mode 100644 index 0000000000..918e3ed3d0 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUInt32LE.mdx @@ -0,0 +1,58 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readUInt32LE + +[Buffer](../../interfaces/Buffer.mdx).readUInt32LE + +**readUInt32LE**(`offset?`): `number` + +Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offset`. + +This function is also available under the `readUint32LE` alias. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); + +console.log(buf.readUInt32LE(0).toString(16)); +// Prints: 78563412 +console.log(buf.readUInt32LE(1).toString(16)); +// Throws ERR_OUT_OF_RANGE. +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.5.5 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUInt8.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUInt8.mdx new file mode 100644 index 0000000000..564acc7c96 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUInt8.mdx @@ -0,0 +1,60 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readUInt8 + +[Buffer](../../interfaces/Buffer.mdx).readUInt8 + +**readUInt8**(`offset?`): `number` + +Reads an unsigned 8-bit integer from `buf` at the specified `offset`. + +This function is also available under the `readUint8` alias. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from([1, -2]); + +console.log(buf.readUInt8(0)); +// Prints: 1 +console.log(buf.readUInt8(1)); +// Prints: 254 +console.log(buf.readUInt8(2)); +// Throws ERR_OUT_OF_RANGE. +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.5.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUIntBE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUIntBE.mdx new file mode 100644 index 0000000000..4269d335ad --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUIntBE.mdx @@ -0,0 +1,67 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readUIntBE + +[Buffer](../../interfaces/Buffer.mdx).readUIntBE + +**readUIntBE**(`offset`, `byteLength`): `number` + +Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned big-endian integer supporting +up to 48 bits of accuracy. + +This function is also available under the `readUintBE` alias. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + +console.log(buf.readUIntBE(0, 6).toString(16)); +// Prints: 1234567890ab +console.log(buf.readUIntBE(1, 6).toString(16)); +// Throws ERR_OUT_OF_RANGE. +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.11.15 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUIntLE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUIntLE.mdx new file mode 100644 index 0000000000..276897f800 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUIntLE.mdx @@ -0,0 +1,65 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readUIntLE + +[Buffer](../../interfaces/Buffer.mdx).readUIntLE + +**readUIntLE**(`offset`, `byteLength`): `number` + +Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned, little-endian integer supporting +up to 48 bits of accuracy. + +This function is also available under the `readUintLE` alias. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + +console.log(buf.readUIntLE(0, 6).toString(16)); +// Prints: ab9078563412 +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.11.15 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUint16BE-1.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUint16BE-1.mdx new file mode 100644 index 0000000000..bed9601337 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUint16BE-1.mdx @@ -0,0 +1,47 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readUint16BE + +[Buffer](../../interfaces/Buffer.mdx).readUint16BE + +**readUint16BE**(`offset?`): `number` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Alias + +Buffer.readUInt16BE + +#### Since + +v14.9.0, v12.19.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUint16LE-1.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUint16LE-1.mdx new file mode 100644 index 0000000000..e82b16446f --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUint16LE-1.mdx @@ -0,0 +1,47 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readUint16LE + +[Buffer](../../interfaces/Buffer.mdx).readUint16LE + +**readUint16LE**(`offset?`): `number` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Alias + +Buffer.readUInt16LE + +#### Since + +v14.9.0, v12.19.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUint32BE-1.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUint32BE-1.mdx new file mode 100644 index 0000000000..990a36d508 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUint32BE-1.mdx @@ -0,0 +1,47 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readUint32BE + +[Buffer](../../interfaces/Buffer.mdx).readUint32BE + +**readUint32BE**(`offset?`): `number` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Alias + +Buffer.readUInt32BE + +#### Since + +v14.9.0, v12.19.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUint32LE-1.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUint32LE-1.mdx new file mode 100644 index 0000000000..ab2f3db074 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUint32LE-1.mdx @@ -0,0 +1,47 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readUint32LE + +[Buffer](../../interfaces/Buffer.mdx).readUint32LE + +**readUint32LE**(`offset?`): `number` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Alias + +Buffer.readUInt32LE + +#### Since + +v14.9.0, v12.19.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUint8-1.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUint8-1.mdx new file mode 100644 index 0000000000..973efa5a08 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUint8-1.mdx @@ -0,0 +1,47 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readUint8 + +[Buffer](../../interfaces/Buffer.mdx).readUint8 + +**readUint8**(`offset?`): `number` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Alias + +Buffer.readUInt8 + +#### Since + +v14.9.0, v12.19.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUintBE-1.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUintBE-1.mdx new file mode 100644 index 0000000000..aad5540265 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUintBE-1.mdx @@ -0,0 +1,55 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readUintBE + +[Buffer](../../interfaces/Buffer.mdx).readUintBE + +**readUintBE**(`offset`, `byteLength`): `number` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Alias + +Buffer.readUIntBE + +#### Since + +v14.9.0, v12.19.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUintLE-1.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUintLE-1.mdx new file mode 100644 index 0000000000..d3e564aa41 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.readUintLE-1.mdx @@ -0,0 +1,55 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# readUintLE + +[Buffer](../../interfaces/Buffer.mdx).readUintLE + +**readUintLE**(`offset`, `byteLength`): `number` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Alias + +Buffer.readUIntLE + +#### Since + +v14.9.0, v12.19.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.reduce.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.reduce.mdx new file mode 100644 index 0000000000..f3b71c0ad5 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.reduce.mdx @@ -0,0 +1,137 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# reduce + +[Buffer](../../interfaces/Buffer.mdx).reduce + +**reduce**(`callbackfn`): `number` + +Calls the specified callback function for all the elements in an array. The return value of +the callback function is the accumulated result, and is provided as an argument in the next +call to the callback function. + +#### Parameters + + `number`", + "description": "A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`number` + + + +#### Inherited from + +Uint8Array.reduce + +**reduce**(`callbackfn`, `initialValue`): `number` + +#### Parameters + + `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "initialValue", + "type": "`number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`number` + + + +#### Inherited from + +Uint8Array.reduce + +**reduce**<`U`\>(`callbackfn`, `initialValue`): `U` + +Calls the specified callback function for all the elements in an array. The return value of +the callback function is the accumulated result, and is provided as an argument in the next +call to the callback function. + + + +#### Parameters + + `U`", + "description": "A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "initialValue", + "type": "`U`", + "description": "If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`U` + + + +#### Inherited from + +Uint8Array.reduce diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.reduceRight.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.reduceRight.mdx new file mode 100644 index 0000000000..293b8a8a56 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.reduceRight.mdx @@ -0,0 +1,137 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# reduceRight + +[Buffer](../../interfaces/Buffer.mdx).reduceRight + +**reduceRight**(`callbackfn`): `number` + +Calls the specified callback function for all the elements in an array, in descending order. +The return value of the callback function is the accumulated result, and is provided as an +argument in the next call to the callback function. + +#### Parameters + + `number`", + "description": "A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`number` + + + +#### Inherited from + +Uint8Array.reduceRight + +**reduceRight**(`callbackfn`, `initialValue`): `number` + +#### Parameters + + `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "initialValue", + "type": "`number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`number` + + + +#### Inherited from + +Uint8Array.reduceRight + +**reduceRight**<`U`\>(`callbackfn`, `initialValue`): `U` + +Calls the specified callback function for all the elements in an array, in descending order. +The return value of the callback function is the accumulated result, and is provided as an +argument in the next call to the callback function. + + + +#### Parameters + + `U`", + "description": "A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "initialValue", + "type": "`U`", + "description": "If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`U` + + + +#### Inherited from + +Uint8Array.reduceRight diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.reverse.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.reverse.mdx new file mode 100644 index 0000000000..543f848f81 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.reverse.mdx @@ -0,0 +1,30 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# reverse + +[Buffer](../../interfaces/Buffer.mdx).reverse + +**reverse**(): [`Buffer`](../../variables/Buffer-1.mdx) + +#### Returns + +[`Buffer`](../../variables/Buffer-1.mdx) + + + +#### Overrides + +Uint8Array.reverse diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.set.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.set.mdx new file mode 100644 index 0000000000..8a0394da25 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.set.mdx @@ -0,0 +1,62 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# set + +[Buffer](../../interfaces/Buffer.mdx).set + +**set**(`array`, `offset?`): `void` + +Sets a value or an array of values. + +#### Parameters + +", + "description": "A typed or untyped array of values to set.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "length", + "type": "`number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "offset", + "type": "`number`", + "description": "The index in the current array at which the values are to be written.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`void` + + + +#### Inherited from + +Uint8Array.set diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.slice.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.slice.mdx new file mode 100644 index 0000000000..ef33fc3bfd --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.slice.mdx @@ -0,0 +1,87 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# slice + +[Buffer](../../interfaces/Buffer.mdx).slice + +**slice**(`start?`, `end?`): [`Buffer`](../../variables/Buffer-1.mdx) + +Returns a new `Buffer` that references the same memory as the original, but +offset and cropped by the `start` and `end` indices. + +This method is not compatible with the `Uint8Array.prototype.slice()`, +which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from('buffer'); + +const copiedBuf = Uint8Array.prototype.slice.call(buf); +copiedBuf[0]++; +console.log(copiedBuf.toString()); +// Prints: cuffer + +console.log(buf.toString()); +// Prints: buffer + +// With buf.slice(), the original buffer is modified. +const notReallyCopiedBuf = buf.slice(); +notReallyCopiedBuf[0]++; +console.log(notReallyCopiedBuf.toString()); +// Prints: cuffer +console.log(buf.toString()); +// Also prints: cuffer (!) +``` + +#### Parameters + + + +#### Returns + +[`Buffer`](../../variables/Buffer-1.mdx) + + + +#### Since + +v0.3.0 + +#### Deprecated + +Use `subarray` instead. + +#### Overrides + +Uint8Array.slice diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.some.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.some.mdx new file mode 100644 index 0000000000..b9afd84783 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.some.mdx @@ -0,0 +1,53 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# some + +[Buffer](../../interfaces/Buffer.mdx).some + +**some**(`predicate`, `thisArg?`): `boolean` + +Determines whether the specified callback function returns true for any element of an array. + +#### Parameters + + `unknown`", + "description": "A function that accepts up to three arguments. The some method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value true, or until the end of the array.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thisArg", + "type": "`any`", + "description": "An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`boolean` + + + +#### Inherited from + +Uint8Array.some diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.sort.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.sort.mdx new file mode 100644 index 0000000000..5caf987157 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.sort.mdx @@ -0,0 +1,45 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# sort + +[Buffer](../../interfaces/Buffer.mdx).sort + +**sort**(`compareFn?`): [`Buffer`](../../variables/Buffer-1.mdx) + +Sorts an array. + +#### Parameters + + `number`", + "description": "Function used to determine the order of the elements. It is expected to return a negative value if first argument is less than second argument, zero if they're equal and a positive value otherwise. If omitted, the elements are sorted in ascending order. ```ts [11,2,22,1].sort((a, b) => a - b) ```", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +[`Buffer`](../../variables/Buffer-1.mdx) + + + +#### Inherited from + +Uint8Array.sort diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.subarray.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.subarray.mdx new file mode 100644 index 0000000000..97a9cdae2f --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.subarray.mdx @@ -0,0 +1,110 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# subarray + +[Buffer](../../interfaces/Buffer.mdx).subarray + +**subarray**(`start?`, `end?`): [`Buffer`](../../variables/Buffer-1.mdx) + +Returns a new `Buffer` that references the same memory as the original, but +offset and cropped by the `start` and `end` indices. + +Specifying `end` greater than `buf.length` will return the same result as +that of `end` equal to `buf.length`. + +This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray). + +Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap. + +```js +import { Buffer } from 'buffer'; + +// Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte +// from the original `Buffer`. + +const buf1 = Buffer.allocUnsafe(26); + +for (let i = 0; i < 26; i++) { + // 97 is the decimal ASCII value for 'a'. + buf1[i] = i + 97; +} + +const buf2 = buf1.subarray(0, 3); + +console.log(buf2.toString('ascii', 0, buf2.length)); +// Prints: abc + +buf1[0] = 33; + +console.log(buf2.toString('ascii', 0, buf2.length)); +// Prints: !bc +``` + +Specifying negative indexes causes the slice to be generated relative to the +end of `buf` rather than the beginning. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from('buffer'); + +console.log(buf.subarray(-6, -1).toString()); +// Prints: buffe +// (Equivalent to buf.subarray(0, 5).) + +console.log(buf.subarray(-6, -2).toString()); +// Prints: buff +// (Equivalent to buf.subarray(0, 4).) + +console.log(buf.subarray(-5, -2).toString()); +// Prints: uff +// (Equivalent to buf.subarray(1, 4).) +``` + +#### Parameters + + + +#### Returns + +[`Buffer`](../../variables/Buffer-1.mdx) + + + +#### Since + +v3.0.0 + +#### Overrides + +Uint8Array.subarray diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.swap16.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.swap16.mdx new file mode 100644 index 0000000000..13b40abdc0 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.swap16.mdx @@ -0,0 +1,62 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# swap16 + +[Buffer](../../interfaces/Buffer.mdx).swap16 + +**swap16**(): [`Buffer`](../../variables/Buffer-1.mdx) + +Interprets `buf` as an array of unsigned 16-bit integers and swaps the +byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2. + +```js +import { Buffer } from 'buffer'; + +const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); + +console.log(buf1); +// Prints: + +buf1.swap16(); + +console.log(buf1); +// Prints: + +const buf2 = Buffer.from([0x1, 0x2, 0x3]); + +buf2.swap16(); +// Throws ERR_INVALID_BUFFER_SIZE. +``` + +One convenient use of `buf.swap16()` is to perform a fast in-place conversion +between UTF-16 little-endian and UTF-16 big-endian: + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from('This is little-endian UTF-16', 'utf16le'); +buf.swap16(); // Convert to big-endian UTF-16 text. +``` + +#### Returns + +[`Buffer`](../../variables/Buffer-1.mdx) + + + +#### Since + +v5.10.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.swap32.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.swap32.mdx new file mode 100644 index 0000000000..7dda28c42f --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.swap32.mdx @@ -0,0 +1,52 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# swap32 + +[Buffer](../../interfaces/Buffer.mdx).swap32 + +**swap32**(): [`Buffer`](../../variables/Buffer-1.mdx) + +Interprets `buf` as an array of unsigned 32-bit integers and swaps the +byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4. + +```js +import { Buffer } from 'buffer'; + +const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); + +console.log(buf1); +// Prints: + +buf1.swap32(); + +console.log(buf1); +// Prints: + +const buf2 = Buffer.from([0x1, 0x2, 0x3]); + +buf2.swap32(); +// Throws ERR_INVALID_BUFFER_SIZE. +``` + +#### Returns + +[`Buffer`](../../variables/Buffer-1.mdx) + + + +#### Since + +v5.10.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.swap64.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.swap64.mdx new file mode 100644 index 0000000000..4ac1ce7a1d --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.swap64.mdx @@ -0,0 +1,52 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# swap64 + +[Buffer](../../interfaces/Buffer.mdx).swap64 + +**swap64**(): [`Buffer`](../../variables/Buffer-1.mdx) + +Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_. +Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8. + +```js +import { Buffer } from 'buffer'; + +const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); + +console.log(buf1); +// Prints: + +buf1.swap64(); + +console.log(buf1); +// Prints: + +const buf2 = Buffer.from([0x1, 0x2, 0x3]); + +buf2.swap64(); +// Throws ERR_INVALID_BUFFER_SIZE. +``` + +#### Returns + +[`Buffer`](../../variables/Buffer-1.mdx) + + + +#### Since + +v6.3.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.toJSON.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.toJSON.mdx new file mode 100644 index 0000000000..e392ddc2ff --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.toJSON.mdx @@ -0,0 +1,74 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# toJSON + +[Buffer](../../interfaces/Buffer.mdx).toJSON + +**toJSON**(): { `data`: `number`[] ; `type`: ``"Buffer"`` } + +Returns a JSON representation of `buf`. [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) implicitly calls +this function when stringifying a `Buffer` instance. + +`Buffer.from()` accepts objects in the format returned from this method. +In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]); +const json = JSON.stringify(buf); + +console.log(json); +// Prints: {"type":"Buffer","data":[1,2,3,4,5]} + +const copy = JSON.parse(json, (key, value) => { + return value && value.type === 'Buffer' ? + Buffer.from(value) : + value; +}); + +console.log(copy); +// Prints: +``` + +#### Returns + +`object` + + + + + +#### Since + +v0.9.2 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.toLocaleString.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.toLocaleString.mdx new file mode 100644 index 0000000000..fc2a3084e3 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.toLocaleString.mdx @@ -0,0 +1,32 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# toLocaleString + +[Buffer](../../interfaces/Buffer.mdx).toLocaleString + +**toLocaleString**(): `string` + +Converts a number to a string by using the current locale. + +#### Returns + +`string` + + + +#### Inherited from + +Uint8Array.toLocaleString diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.toString.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.toString.mdx new file mode 100644 index 0000000000..6c47a5d6eb --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.toString.mdx @@ -0,0 +1,96 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# toString + +[Buffer](../../interfaces/Buffer.mdx).toString + +**toString**(`encoding?`, `start?`, `end?`): `string` + +Decodes `buf` to a string according to the specified character encoding in`encoding`. `start` and `end` may be passed to decode only a subset of `buf`. + +If `encoding` is `'utf8'` and a byte sequence in the input is not valid UTF-8, +then each invalid byte is replaced with the replacement character `U+FFFD`. + +The maximum length of a string instance (in UTF-16 code units) is available +as constants.MAX_STRING_LENGTH. + +```js +import { Buffer } from 'buffer'; + +const buf1 = Buffer.allocUnsafe(26); + +for (let i = 0; i < 26; i++) { + // 97 is the decimal ASCII value for 'a'. + buf1[i] = i + 97; +} + +console.log(buf1.toString('utf8')); +// Prints: abcdefghijklmnopqrstuvwxyz +console.log(buf1.toString('utf8', 0, 5)); +// Prints: abcde + +const buf2 = Buffer.from('tést'); + +console.log(buf2.toString('hex')); +// Prints: 74c3a97374 +console.log(buf2.toString('utf8', 0, 3)); +// Prints: té +console.log(buf2.toString(undefined, 0, 3)); +// Prints: té +``` + +#### Parameters + + + +#### Returns + +`string` + + + +#### Since + +v0.1.90 + +#### Overrides + +Uint8Array.toString diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.valueOf.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.valueOf.mdx new file mode 100644 index 0000000000..50661d29f0 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.valueOf.mdx @@ -0,0 +1,32 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# valueOf + +[Buffer](../../interfaces/Buffer.mdx).valueOf + +**valueOf**(): `Uint8Array` + +Returns the primitive value of the specified object. + +#### Returns + +`Uint8Array` + + + +#### Inherited from + +Uint8Array.valueOf diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.values.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.values.mdx new file mode 100644 index 0000000000..369fe4f961 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.values.mdx @@ -0,0 +1,74 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# values + +[Buffer](../../interfaces/Buffer.mdx).values + +**values**(): [`IterableIterator`](../../interfaces/IterableIterator.mdx)<`number`\> + +Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) for `buf` values (bytes). This function is +called automatically when a `Buffer` is used in a `for..of` statement. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.from('buffer'); + +for (const value of buf.values()) { + console.log(value); +} +// Prints: +// 98 +// 117 +// 102 +// 102 +// 101 +// 114 + +for (const value of buf) { + console.log(value); +} +// Prints: +// 98 +// 117 +// 102 +// 102 +// 101 +// 114 +``` + +#### Returns + +[`IterableIterator`](../../interfaces/IterableIterator.mdx)<`number`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +#### Since + +v1.1.0 + +#### Overrides + +Uint8Array.values diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.write.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.write.mdx new file mode 100644 index 0000000000..596106494c --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.write.mdx @@ -0,0 +1,173 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# write + +[Buffer](../../interfaces/Buffer.mdx).write + +**write**(`string`, `encoding?`): `number` + +Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did +not contain enough space to fit the entire string, only part of `string` will be +written. However, partially encoded characters will not be written. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.alloc(256); + +const len = buf.write('\u00bd + \u00bc = \u00be', 0); + +console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`); +// Prints: 12 bytes: ½ + ¼ = ¾ + +const buffer = Buffer.alloc(10); + +const length = buffer.write('abcd', 8); + +console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`); +// Prints: 2 bytes : ab +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.1.90 + +**write**(`string`, `offset`, `encoding?`): `number` + +#### Parameters + + + +#### Returns + +`number` + + + +**write**(`string`, `offset`, `length`, `encoding?`): `number` + +#### Parameters + + + +#### Returns + +`number` + + diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigInt64BE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigInt64BE.mdx new file mode 100644 index 0000000000..6c4bdad570 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigInt64BE.mdx @@ -0,0 +1,66 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeBigInt64BE + +[Buffer](../../interfaces/Buffer.mdx).writeBigInt64BE + +**writeBigInt64BE**(`value`, `offset?`): `number` + +Writes `value` to `buf` at the specified `offset` as big-endian. + +`value` is interpreted and written as a two's complement signed integer. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(8); + +buf.writeBigInt64BE(0x0102030405060708n, 0); + +console.log(buf); +// Prints: +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v12.0.0, v10.20.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigInt64LE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigInt64LE.mdx new file mode 100644 index 0000000000..025c0e597d --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigInt64LE.mdx @@ -0,0 +1,66 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeBigInt64LE + +[Buffer](../../interfaces/Buffer.mdx).writeBigInt64LE + +**writeBigInt64LE**(`value`, `offset?`): `number` + +Writes `value` to `buf` at the specified `offset` as little-endian. + +`value` is interpreted and written as a two's complement signed integer. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(8); + +buf.writeBigInt64LE(0x0102030405060708n, 0); + +console.log(buf); +// Prints: +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v12.0.0, v10.20.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigUInt64BE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigUInt64BE.mdx new file mode 100644 index 0000000000..93a4134381 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigUInt64BE.mdx @@ -0,0 +1,66 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeBigUInt64BE + +[Buffer](../../interfaces/Buffer.mdx).writeBigUInt64BE + +**writeBigUInt64BE**(`value`, `offset?`): `number` + +Writes `value` to `buf` at the specified `offset` as big-endian. + +This function is also available under the `writeBigUint64BE` alias. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(8); + +buf.writeBigUInt64BE(0xdecafafecacefaden, 0); + +console.log(buf); +// Prints: +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v12.0.0, v10.20.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigUInt64LE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigUInt64LE.mdx new file mode 100644 index 0000000000..405e74e7cf --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigUInt64LE.mdx @@ -0,0 +1,66 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeBigUInt64LE + +[Buffer](../../interfaces/Buffer.mdx).writeBigUInt64LE + +**writeBigUInt64LE**(`value`, `offset?`): `number` + +Writes `value` to `buf` at the specified `offset` as little-endian + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(8); + +buf.writeBigUInt64LE(0xdecafafecacefaden, 0); + +console.log(buf); +// Prints: +``` + +This function is also available under the `writeBigUint64LE` alias. + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v12.0.0, v10.20.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigUint64BE-1.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigUint64BE-1.mdx new file mode 100644 index 0000000000..17e5caadb9 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigUint64BE-1.mdx @@ -0,0 +1,55 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeBigUint64BE + +[Buffer](../../interfaces/Buffer.mdx).writeBigUint64BE + +**writeBigUint64BE**(`value`, `offset?`): `number` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Alias + +Buffer.writeBigUInt64BE + +#### Since + +v14.10.0, v12.19.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigUint64LE-1.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigUint64LE-1.mdx new file mode 100644 index 0000000000..161c7d413d --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeBigUint64LE-1.mdx @@ -0,0 +1,55 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeBigUint64LE + +[Buffer](../../interfaces/Buffer.mdx).writeBigUint64LE + +**writeBigUint64LE**(`value`, `offset?`): `number` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Alias + +Buffer.writeBigUInt64LE + +#### Since + +v14.10.0, v12.19.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeDoubleBE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeDoubleBE.mdx new file mode 100644 index 0000000000..611d2cc332 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeDoubleBE.mdx @@ -0,0 +1,65 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeDoubleBE + +[Buffer](../../interfaces/Buffer.mdx).writeDoubleBE + +**writeDoubleBE**(`value`, `offset?`): `number` + +Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything +other than a JavaScript number. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(8); + +buf.writeDoubleBE(123.456, 0); + +console.log(buf); +// Prints: +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.11.15 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeDoubleLE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeDoubleLE.mdx new file mode 100644 index 0000000000..b23c8b3536 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeDoubleLE.mdx @@ -0,0 +1,65 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeDoubleLE + +[Buffer](../../interfaces/Buffer.mdx).writeDoubleLE + +**writeDoubleLE**(`value`, `offset?`): `number` + +Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything +other than a JavaScript number. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(8); + +buf.writeDoubleLE(123.456, 0); + +console.log(buf); +// Prints: +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.11.15 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeFloatBE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeFloatBE.mdx new file mode 100644 index 0000000000..362b10310e --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeFloatBE.mdx @@ -0,0 +1,65 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeFloatBE + +[Buffer](../../interfaces/Buffer.mdx).writeFloatBE + +**writeFloatBE**(`value`, `offset?`): `number` + +Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is +undefined when `value` is anything other than a JavaScript number. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(4); + +buf.writeFloatBE(0xcafebabe, 0); + +console.log(buf); +// Prints: +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.11.15 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeFloatLE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeFloatLE.mdx new file mode 100644 index 0000000000..4a44277afb --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeFloatLE.mdx @@ -0,0 +1,65 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeFloatLE + +[Buffer](../../interfaces/Buffer.mdx).writeFloatLE + +**writeFloatLE**(`value`, `offset?`): `number` + +Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is +undefined when `value` is anything other than a JavaScript number. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(4); + +buf.writeFloatLE(0xcafebabe, 0); + +console.log(buf); +// Prints: +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.11.15 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeInt16BE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeInt16BE.mdx new file mode 100644 index 0000000000..b9bca132d7 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeInt16BE.mdx @@ -0,0 +1,67 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeInt16BE + +[Buffer](../../interfaces/Buffer.mdx).writeInt16BE + +**writeInt16BE**(`value`, `offset?`): `number` + +Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is +anything other than a signed 16-bit integer. + +The `value` is interpreted and written as a two's complement signed integer. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(2); + +buf.writeInt16BE(0x0102, 0); + +console.log(buf); +// Prints: +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.5.5 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeInt16LE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeInt16LE.mdx new file mode 100644 index 0000000000..5e3cd0d0cd --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeInt16LE.mdx @@ -0,0 +1,67 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeInt16LE + +[Buffer](../../interfaces/Buffer.mdx).writeInt16LE + +**writeInt16LE**(`value`, `offset?`): `number` + +Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is +anything other than a signed 16-bit integer. + +The `value` is interpreted and written as a two's complement signed integer. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(2); + +buf.writeInt16LE(0x0304, 0); + +console.log(buf); +// Prints: +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.5.5 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeInt32BE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeInt32BE.mdx new file mode 100644 index 0000000000..800fbefb66 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeInt32BE.mdx @@ -0,0 +1,67 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeInt32BE + +[Buffer](../../interfaces/Buffer.mdx).writeInt32BE + +**writeInt32BE**(`value`, `offset?`): `number` + +Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is +anything other than a signed 32-bit integer. + +The `value` is interpreted and written as a two's complement signed integer. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(4); + +buf.writeInt32BE(0x01020304, 0); + +console.log(buf); +// Prints: +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.5.5 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeInt32LE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeInt32LE.mdx new file mode 100644 index 0000000000..e3b5cc26eb --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeInt32LE.mdx @@ -0,0 +1,67 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeInt32LE + +[Buffer](../../interfaces/Buffer.mdx).writeInt32LE + +**writeInt32LE**(`value`, `offset?`): `number` + +Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is +anything other than a signed 32-bit integer. + +The `value` is interpreted and written as a two's complement signed integer. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(4); + +buf.writeInt32LE(0x05060708, 0); + +console.log(buf); +// Prints: +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.5.5 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeInt8.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeInt8.mdx new file mode 100644 index 0000000000..421b9d63fe --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeInt8.mdx @@ -0,0 +1,69 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeInt8 + +[Buffer](../../interfaces/Buffer.mdx).writeInt8 + +**writeInt8**(`value`, `offset?`): `number` + +Writes `value` to `buf` at the specified `offset`. `value` must be a valid +signed 8-bit integer. Behavior is undefined when `value` is anything other than +a signed 8-bit integer. + +`value` is interpreted and written as a two's complement signed integer. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(2); + +buf.writeInt8(2, 0); +buf.writeInt8(-2, 1); + +console.log(buf); +// Prints: +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.5.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeIntBE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeIntBE.mdx new file mode 100644 index 0000000000..91073bb29d --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeIntBE.mdx @@ -0,0 +1,73 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeIntBE + +[Buffer](../../interfaces/Buffer.mdx).writeIntBE + +**writeIntBE**(`value`, `offset`, `byteLength`): `number` + +Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a +signed integer. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(6); + +buf.writeIntBE(0x1234567890ab, 0, 6); + +console.log(buf); +// Prints: +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.11.15 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeIntLE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeIntLE.mdx new file mode 100644 index 0000000000..5fd76110d7 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeIntLE.mdx @@ -0,0 +1,73 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeIntLE + +[Buffer](../../interfaces/Buffer.mdx).writeIntLE + +**writeIntLE**(`value`, `offset`, `byteLength`): `number` + +Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined +when `value` is anything other than a signed integer. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(6); + +buf.writeIntLE(0x1234567890ab, 0, 6); + +console.log(buf); +// Prints: +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.11.15 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUInt16BE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUInt16BE.mdx new file mode 100644 index 0000000000..72b2b6ee2a --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUInt16BE.mdx @@ -0,0 +1,68 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeUInt16BE + +[Buffer](../../interfaces/Buffer.mdx).writeUInt16BE + +**writeUInt16BE**(`value`, `offset?`): `number` + +Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an +unsigned 16-bit integer. + +This function is also available under the `writeUint16BE` alias. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(4); + +buf.writeUInt16BE(0xdead, 0); +buf.writeUInt16BE(0xbeef, 2); + +console.log(buf); +// Prints: +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.5.5 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUInt16LE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUInt16LE.mdx new file mode 100644 index 0000000000..691cda442a --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUInt16LE.mdx @@ -0,0 +1,68 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeUInt16LE + +[Buffer](../../interfaces/Buffer.mdx).writeUInt16LE + +**writeUInt16LE**(`value`, `offset?`): `number` + +Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is +anything other than an unsigned 16-bit integer. + +This function is also available under the `writeUint16LE` alias. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(4); + +buf.writeUInt16LE(0xdead, 0); +buf.writeUInt16LE(0xbeef, 2); + +console.log(buf); +// Prints: +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.5.5 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUInt32BE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUInt32BE.mdx new file mode 100644 index 0000000000..04aef8b04d --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUInt32BE.mdx @@ -0,0 +1,67 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeUInt32BE + +[Buffer](../../interfaces/Buffer.mdx).writeUInt32BE + +**writeUInt32BE**(`value`, `offset?`): `number` + +Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an +unsigned 32-bit integer. + +This function is also available under the `writeUint32BE` alias. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(4); + +buf.writeUInt32BE(0xfeedface, 0); + +console.log(buf); +// Prints: +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.5.5 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUInt32LE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUInt32LE.mdx new file mode 100644 index 0000000000..4bc2b73d26 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUInt32LE.mdx @@ -0,0 +1,67 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeUInt32LE + +[Buffer](../../interfaces/Buffer.mdx).writeUInt32LE + +**writeUInt32LE**(`value`, `offset?`): `number` + +Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is +anything other than an unsigned 32-bit integer. + +This function is also available under the `writeUint32LE` alias. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(4); + +buf.writeUInt32LE(0xfeedface, 0); + +console.log(buf); +// Prints: +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.5.5 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUInt8.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUInt8.mdx new file mode 100644 index 0000000000..c649a95327 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUInt8.mdx @@ -0,0 +1,71 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeUInt8 + +[Buffer](../../interfaces/Buffer.mdx).writeUInt8 + +**writeUInt8**(`value`, `offset?`): `number` + +Writes `value` to `buf` at the specified `offset`. `value` must be a +valid unsigned 8-bit integer. Behavior is undefined when `value` is anything +other than an unsigned 8-bit integer. + +This function is also available under the `writeUint8` alias. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(4); + +buf.writeUInt8(0x3, 0); +buf.writeUInt8(0x4, 1); +buf.writeUInt8(0x23, 2); +buf.writeUInt8(0x42, 3); + +console.log(buf); +// Prints: +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.5.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUIntBE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUIntBE.mdx new file mode 100644 index 0000000000..c157ed3d53 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUIntBE.mdx @@ -0,0 +1,75 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeUIntBE + +[Buffer](../../interfaces/Buffer.mdx).writeUIntBE + +**writeUIntBE**(`value`, `offset`, `byteLength`): `number` + +Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined +when `value` is anything other than an unsigned integer. + +This function is also available under the `writeUintBE` alias. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(6); + +buf.writeUIntBE(0x1234567890ab, 0, 6); + +console.log(buf); +// Prints: +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.5.5 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUIntLE.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUIntLE.mdx new file mode 100644 index 0000000000..b00fd44b8e --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUIntLE.mdx @@ -0,0 +1,75 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeUIntLE + +[Buffer](../../interfaces/Buffer.mdx).writeUIntLE + +**writeUIntLE**(`value`, `offset`, `byteLength`): `number` + +Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined +when `value` is anything other than an unsigned integer. + +This function is also available under the `writeUintLE` alias. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(6); + +buf.writeUIntLE(0x1234567890ab, 0, 6); + +console.log(buf); +// Prints: +``` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.5.5 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUint16BE-1.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUint16BE-1.mdx new file mode 100644 index 0000000000..c02e07575c --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUint16BE-1.mdx @@ -0,0 +1,55 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeUint16BE + +[Buffer](../../interfaces/Buffer.mdx).writeUint16BE + +**writeUint16BE**(`value`, `offset?`): `number` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Alias + +Buffer.writeUInt16BE + +#### Since + +v14.9.0, v12.19.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUint16LE-1.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUint16LE-1.mdx new file mode 100644 index 0000000000..53c375336b --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUint16LE-1.mdx @@ -0,0 +1,55 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeUint16LE + +[Buffer](../../interfaces/Buffer.mdx).writeUint16LE + +**writeUint16LE**(`value`, `offset?`): `number` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Alias + +Buffer.writeUInt16LE + +#### Since + +v14.9.0, v12.19.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUint32BE-1.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUint32BE-1.mdx new file mode 100644 index 0000000000..b1662ad190 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUint32BE-1.mdx @@ -0,0 +1,55 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeUint32BE + +[Buffer](../../interfaces/Buffer.mdx).writeUint32BE + +**writeUint32BE**(`value`, `offset?`): `number` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Alias + +Buffer.writeUInt32BE + +#### Since + +v14.9.0, v12.19.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUint32LE-1.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUint32LE-1.mdx new file mode 100644 index 0000000000..8b19e6a459 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUint32LE-1.mdx @@ -0,0 +1,55 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeUint32LE + +[Buffer](../../interfaces/Buffer.mdx).writeUint32LE + +**writeUint32LE**(`value`, `offset?`): `number` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Alias + +Buffer.writeUInt32LE + +#### Since + +v14.9.0, v12.19.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUint8-1.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUint8-1.mdx new file mode 100644 index 0000000000..d7ee650d2d --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUint8-1.mdx @@ -0,0 +1,55 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeUint8 + +[Buffer](../../interfaces/Buffer.mdx).writeUint8 + +**writeUint8**(`value`, `offset?`): `number` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Alias + +Buffer.writeUInt8 + +#### Since + +v14.9.0, v12.19.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUintBE-1.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUintBE-1.mdx new file mode 100644 index 0000000000..ee7006e7ab --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUintBE-1.mdx @@ -0,0 +1,63 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeUintBE + +[Buffer](../../interfaces/Buffer.mdx).writeUintBE + +**writeUintBE**(`value`, `offset`, `byteLength`): `number` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Alias + +Buffer.writeUIntBE + +#### Since + +v14.9.0, v12.19.0 diff --git a/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUintLE-1.mdx b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUintLE-1.mdx new file mode 100644 index 0000000000..1abd2af1e2 --- /dev/null +++ b/www/apps/docs/content/references/product/Buffer/methods/Buffer.writeUintLE-1.mdx @@ -0,0 +1,63 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# writeUintLE + +[Buffer](../../interfaces/Buffer.mdx).writeUintLE + +**writeUintLE**(`value`, `offset`, `byteLength`): `number` + +#### Parameters + + + +#### Returns + +`number` + + + +#### Alias + +Buffer.writeUIntLE + +#### Since + +v14.9.0, v12.19.0 diff --git a/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.alloc.mdx b/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.alloc.mdx new file mode 100644 index 0000000000..19827ab19d --- /dev/null +++ b/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.alloc.mdx @@ -0,0 +1,101 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# alloc + +[BufferConstructor](../../interfaces/BufferConstructor.mdx).alloc + +**alloc**(`size`, `fill?`, `encoding?`): [`Buffer`](../../variables/Buffer-1.mdx) + +Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.alloc(5); + +console.log(buf); +// Prints: +``` + +If `size` is larger than constants.MAX_LENGTH or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. + +If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.alloc(5, 'a'); + +console.log(buf); +// Prints: +``` + +If both `fill` and `encoding` are specified, the allocated `Buffer` will be +initialized by calling `buf.fill(fill, encoding)`. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); + +console.log(buf); +// Prints: +``` + +Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance +contents will never contain sensitive data from previous allocations, including +data that might not have been allocated for `Buffer`s. + +A `TypeError` will be thrown if `size` is not a number. + +#### Parameters + + + +#### Returns + +[`Buffer`](../../variables/Buffer-1.mdx) + + + +#### Since + +v5.10.0 diff --git a/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.allocUnsafe.mdx b/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.allocUnsafe.mdx new file mode 100644 index 0000000000..58ac4404ca --- /dev/null +++ b/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.allocUnsafe.mdx @@ -0,0 +1,76 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# allocUnsafe + +[BufferConstructor](../../interfaces/BufferConstructor.mdx).allocUnsafe + +**allocUnsafe**(`size`): [`Buffer`](../../variables/Buffer-1.mdx) + +Allocates a new `Buffer` of `size` bytes. If `size` is larger than constants.MAX_LENGTH or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. + +The underlying memory for `Buffer` instances created in this way is _not_ +_initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes. + +```js +import { Buffer } from 'buffer'; + +const buf = Buffer.allocUnsafe(10); + +console.log(buf); +// Prints (contents may vary): + +buf.fill(0); + +console.log(buf); +// Prints: +``` + +A `TypeError` will be thrown if `size` is not a number. + +The `Buffer` module pre-allocates an internal `Buffer` instance of +size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`,`Buffer.from(array)`, `Buffer.concat()`, and the +deprecated`new Buffer(size)` constructor only when `size` is less than or equal +to `Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). + +Use of this pre-allocated internal memory pool is a key difference between +calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. +Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less +than or equal to half `Buffer.poolSize`. The +difference is subtle but can be important when an application requires the +additional performance that `Buffer.allocUnsafe()` provides. + +#### Parameters + + + +#### Returns + +[`Buffer`](../../variables/Buffer-1.mdx) + + + +#### Since + +v5.10.0 diff --git a/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.allocUnsafeSlow.mdx b/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.allocUnsafeSlow.mdx new file mode 100644 index 0000000000..b7d04c5142 --- /dev/null +++ b/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.allocUnsafeSlow.mdx @@ -0,0 +1,84 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# allocUnsafeSlow + +[BufferConstructor](../../interfaces/BufferConstructor.mdx).allocUnsafeSlow + +**allocUnsafeSlow**(`size`): [`Buffer`](../../variables/Buffer-1.mdx) + +Allocates a new `Buffer` of `size` bytes. If `size` is larger than constants.MAX_LENGTH or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. A zero-length `Buffer` is created +if `size` is 0. + +The underlying memory for `Buffer` instances created in this way is _not_ +_initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize +such `Buffer` instances with zeroes. + +When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, +allocations under 4 KB are sliced from a single pre-allocated `Buffer`. This +allows applications to avoid the garbage collection overhead of creating many +individually allocated `Buffer` instances. This approach improves both +performance and memory usage by eliminating the need to track and clean up as +many individual `ArrayBuffer` objects. + +However, in the case where a developer may need to retain a small chunk of +memory from a pool for an indeterminate amount of time, it may be appropriate +to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and +then copying out the relevant bits. + +```js +import { Buffer } from 'buffer'; + +// Need to keep around a few small chunks of memory. +const store = []; + +socket.on('readable', () => { + let data; + while (null !== (data = readable.read())) { + // Allocate for retained data. + const sb = Buffer.allocUnsafeSlow(10); + + // Copy the data into the new allocation. + data.copy(sb, 0, 0, 10); + + store.push(sb); + } +}); +``` + +A `TypeError` will be thrown if `size` is not a number. + +#### Parameters + + + +#### Returns + +[`Buffer`](../../variables/Buffer-1.mdx) + + + +#### Since + +v5.12.0 diff --git a/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.byteLength.mdx b/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.byteLength.mdx new file mode 100644 index 0000000000..265a1717f2 --- /dev/null +++ b/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.byteLength.mdx @@ -0,0 +1,75 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# byteLength + +[BufferConstructor](../../interfaces/BufferConstructor.mdx).byteLength + +**byteLength**(`string`, `encoding?`): `number` + +Returns the byte length of a string when encoded using `encoding`. +This is not the same as [`String.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), which does not account +for the encoding that is used to convert the string into bytes. + +For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input. +For strings that contain non-base64/hex-encoded data (e.g. whitespace), the +return value might be greater than the length of a `Buffer` created from the +string. + +```js +import { Buffer } from 'buffer'; + +const str = '\u00bd + \u00bc = \u00be'; + +console.log(`${str}: ${str.length} characters, ` + + `${Buffer.byteLength(str, 'utf8')} bytes`); +// Prints: ½ + ¼ = ¾: 9 characters, 12 bytes +``` + +When `string` is a +`Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/- +Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop- +er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned. + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v0.1.90 diff --git a/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.compare.mdx b/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.compare.mdx new file mode 100644 index 0000000000..64b46bd8c0 --- /dev/null +++ b/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.compare.mdx @@ -0,0 +1,65 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# compare + +[BufferConstructor](../../interfaces/BufferConstructor.mdx).compare + +**compare**(`buf1`, `buf2`): ``0`` \| ``1`` \| ``-1`` + +Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of`Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`. + +```js +import { Buffer } from 'buffer'; + +const buf1 = Buffer.from('1234'); +const buf2 = Buffer.from('0123'); +const arr = [buf1, buf2]; + +console.log(arr.sort(Buffer.compare)); +// Prints: [ , ] +// (This result is equal to: [buf2, buf1].) +``` + +#### Parameters + + + +#### Returns + +``0`` \| ``1`` \| ``-1`` + + + +#### Since + +v0.11.13 diff --git a/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.concat.mdx b/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.concat.mdx new file mode 100644 index 0000000000..aaf18abc95 --- /dev/null +++ b/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.concat.mdx @@ -0,0 +1,85 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# concat + +[BufferConstructor](../../interfaces/BufferConstructor.mdx).concat + +**concat**(`list`, `totalLength?`): [`Buffer`](../../variables/Buffer-1.mdx) + +Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together. + +If the list has no items, or if the `totalLength` is 0, then a new zero-length`Buffer` is returned. + +If `totalLength` is not provided, it is calculated from the `Buffer` instances +in `list` by adding their lengths. + +If `totalLength` is provided, it is coerced to an unsigned integer. If the +combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is +truncated to `totalLength`. + +```js +import { Buffer } from 'buffer'; + +// Create a single `Buffer` from a list of three `Buffer` instances. + +const buf1 = Buffer.alloc(10); +const buf2 = Buffer.alloc(14); +const buf3 = Buffer.alloc(18); +const totalLength = buf1.length + buf2.length + buf3.length; + +console.log(totalLength); +// Prints: 42 + +const bufA = Buffer.concat([buf1, buf2, buf3], totalLength); + +console.log(bufA); +// Prints: +console.log(bufA.length); +// Prints: 42 +``` + +`Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does. + +#### Parameters + + + +#### Returns + +[`Buffer`](../../variables/Buffer-1.mdx) + + + +#### Since + +v0.7.11 diff --git a/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.from.mdx b/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.from.mdx new file mode 100644 index 0000000000..52feb5c9e5 --- /dev/null +++ b/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.from.mdx @@ -0,0 +1,178 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# from + +[BufferConstructor](../../interfaces/BufferConstructor.mdx).from + +**from**(`arrayBuffer`, `byteOffset?`, `length?`): [`Buffer`](../../variables/Buffer-1.mdx) + +Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`. +Array entries outside that range will be truncated to fit into it. + +```js +import { Buffer } from 'buffer'; + +// Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'. +const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); +``` + +A `TypeError` will be thrown if `array` is not an `Array` or another type +appropriate for `Buffer.from()` variants. + +`Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does. + +#### Parameters + +", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "byteOffset", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +[`Buffer`](../../variables/Buffer-1.mdx) + + + +#### Since + +v5.10.0 + +**from**(`data`): [`Buffer`](../../variables/Buffer-1.mdx) + +Creates a new Buffer using the passed {data} + +#### Parameters + + + +#### Returns + +[`Buffer`](../../variables/Buffer-1.mdx) + + + +**from**(`data`): [`Buffer`](../../variables/Buffer-1.mdx) + +#### Parameters + +", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +[`Buffer`](../../variables/Buffer-1.mdx) + + + +**from**(`str`, `encoding?`): [`Buffer`](../../variables/Buffer-1.mdx) + +Creates a new Buffer containing the given JavaScript string {str}. +If provided, the {encoding} parameter identifies the character encoding. +If not provided, {encoding} defaults to 'utf8'. + +#### Parameters + + \\| { `[toPrimitive]`: Method [toPrimitive] }", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "encoding", + "type": "[`BufferEncoding`](../../types/BufferEncoding.mdx)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +[`Buffer`](../../variables/Buffer-1.mdx) + + diff --git a/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.isBuffer.mdx b/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.isBuffer.mdx new file mode 100644 index 0000000000..d407a0f469 --- /dev/null +++ b/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.isBuffer.mdx @@ -0,0 +1,55 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# isBuffer + +[BufferConstructor](../../interfaces/BufferConstructor.mdx).isBuffer + +**isBuffer**(`obj`): obj is Buffer + +Returns `true` if `obj` is a `Buffer`, `false` otherwise. + +```js +import { Buffer } from 'buffer'; + +Buffer.isBuffer(Buffer.alloc(10)); // true +Buffer.isBuffer(Buffer.from('foo')); // true +Buffer.isBuffer('a string'); // false +Buffer.isBuffer([]); // false +Buffer.isBuffer(new Uint8Array(1024)); // false +``` + +#### Parameters + + + +#### Returns + +obj is Buffer + + + +#### Since + +v0.1.101 diff --git a/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.isEncoding.mdx b/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.isEncoding.mdx new file mode 100644 index 0000000000..08e81e0616 --- /dev/null +++ b/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.isEncoding.mdx @@ -0,0 +1,62 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# isEncoding + +[BufferConstructor](../../interfaces/BufferConstructor.mdx).isEncoding + +**isEncoding**(`encoding`): encoding is BufferEncoding + +Returns `true` if `encoding` is the name of a supported character encoding, +or `false` otherwise. + +```js +import { Buffer } from 'buffer'; + +console.log(Buffer.isEncoding('utf8')); +// Prints: true + +console.log(Buffer.isEncoding('hex')); +// Prints: true + +console.log(Buffer.isEncoding('utf/8')); +// Prints: false + +console.log(Buffer.isEncoding('')); +// Prints: false +``` + +#### Parameters + + + +#### Returns + +encoding is BufferEncoding + + + +#### Since + +v0.9.1 diff --git a/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.of.mdx b/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.of.mdx new file mode 100644 index 0000000000..180286b226 --- /dev/null +++ b/www/apps/docs/content/references/product/BufferConstructor/methods/BufferConstructor.of.mdx @@ -0,0 +1,41 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# of + +[BufferConstructor](../../interfaces/BufferConstructor.mdx).of + +**of**(`...items`): [`Buffer`](../../variables/Buffer-1.mdx) + +Creates a new Buffer using the passed {data} + +#### Parameters + + + +#### Returns + +[`Buffer`](../../variables/Buffer-1.mdx) + + diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.create.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.create.mdx new file mode 100644 index 0000000000..69f8094d0d --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.create.mdx @@ -0,0 +1,783 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/create +sidebar_label: create +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# create - Product Module Reference + +This documentation provides a reference to the create method. This belongs to the Product Module. + +This method is used to create a product. + +## Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function createProduct (title: string) { + const productModule = await initializeProductModule() + + const products = await productModule.create([ + { + title + } + ]) + + // do something with the products or return them +} +``` + +## Parameters + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "`string`", + "description": "The MID Code of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`CreateProductOptionDTO`](../../interfaces/CreateProductOptionDTO.mdx)[]", + "description": "The product options to be created and associated with the product.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "product_id", + "type": "`string`", + "description": "The ID of the associated product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The product option's title.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "origin_country", + "type": "`string`", + "description": "The origin country of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../../enums/ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../../enums/ProductStatus.mdx).", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "DRAFT", + "type": "``\"draft\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "PROPOSED", + "type": "``\"proposed\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "PUBLISHED", + "type": "``\"published\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "REJECTED", + "type": "``\"rejected\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "subtitle", + "type": "`string`", + "description": "The subttle of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`CreateProductTagDTO`](../../interfaces/CreateProductTagDTO.mdx)[]", + "description": "The product tags to be created and associated with the product.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "value", + "type": "`string`", + "description": "The value of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "thumbnail", + "type": "`string`", + "description": "The URL of the product's thumbnail.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`CreateProductTypeDTO`](../../interfaces/CreateProductTypeDTO.mdx)", + "description": "The product type to create and associate with the product.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The product type's ID.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The product type's value.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "type_id", + "type": "`string`", + "description": "The product type to be associated with the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`CreateProductVariantDTO`](../../interfaces/CreateProductVariantDTO.mdx)[]", + "description": "The product variants to be created and associated with the product.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "allow_backorder", + "type": "`boolean`", + "description": "Whether the product variant can be ordered when it's out of stock.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "barcode", + "type": "`string`", + "description": "The barcode of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "ean", + "type": "`string`", + "description": "The EAN of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "`number`", + "description": "The height of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "`string`", + "description": "The HS Code of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "inventory_quantity", + "type": "`number`", + "description": "The inventory quantiy of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "`number`", + "description": "The length of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manage_inventory", + "type": "`boolean`", + "description": "Whether the product variant's inventory should be managed by the core system.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "`string`", + "description": "The material of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "`string`", + "description": "The MID Code of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`CreateProductVariantOptionDTO`](../../interfaces/CreateProductVariantOptionDTO.mdx)[]", + "description": "The product variant options to create and associate with the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "`string`", + "description": "The origin country of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "`string`", + "description": "The SKU of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The tile of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "`string`", + "description": "The UPC of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "`number`", + "description": "The weight of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "`number`", + "description": "The width of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "weight", + "type": "`number`", + "description": "The weight of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "`number`", + "description": "The width of the product.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of created products.", + "children": [ + { + "name": "ProductDTO[]", + "type": "[`ProductDTO`](../../interfaces/ProductDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "categories", + "type": "``null`` \\| [`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)[]", + "description": "The associated product categories. It may only be available if the `categories` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection", + "type": "[`ProductCollectionDTO`](../../interfaces/ProductCollectionDTO.mdx)", + "description": "The associated product collection. It may only be available if the `collection` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product was created.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "``null`` \\| `string`", + "description": "The description of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discountable", + "type": "`boolean`", + "description": "Whether the product can be discounted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "external_id", + "type": "``null`` \\| `string`", + "description": "The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain a reference to the ID in the integrated service.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "``null`` \\| `string`", + "description": "The handle of the product. The handle can be used to create slug URL paths. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "images", + "type": "[`ProductImageDTO`](../../interfaces/ProductImageDTO.mdx)[]", + "description": "The associated product images. It may only be available if the `images` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_giftcard", + "type": "`boolean`", + "description": "Whether the product is a gift card.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](../../interfaces/ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../../enums/ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../../enums/ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](../../interfaces/ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](../../interfaces/ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](../../interfaces/ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.createCategory.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.createCategory.mdx new file mode 100644 index 0000000000..369a974f4c --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.createCategory.mdx @@ -0,0 +1,434 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/createCategory +sidebar_label: createCategory +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# createCategory - Product Module Reference + +This documentation provides a reference to the createCategory method. This belongs to the Product Module. + +This method is used to create a product category. + +## Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function createCategory (name: string, parent_category_id: string | null) { + const productModule = await initializeProductModule() + + const category = await productModule.createCategory({ + name, + parent_category_id + }) + + // do something with the product category or return it +} +``` + +## Parameters + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The product category's name.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category_id", + "type": "``null`` \\| `string`", + "description": "The ID of the parent product category, if it has any. It may also be `null`.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rank", + "type": "`number`", + "description": "The ranking of the category among sibling categories.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The created product category.", + "children": [ + { + "name": "category_children", + "type": "[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)[]", + "description": "The associated child categories. It may only be available if the `category_children` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "category_children", + "type": "[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)[]", + "description": "The associated child categories. It may only be available if the `category_children` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product category was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "`string`", + "description": "The description of the product category.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product category. The handle can be used to create slug URL paths.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_active", + "type": "`boolean`", + "description": "Whether the product category is active.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "is_internal", + "type": "`boolean`", + "description": "Whether the product category is internal. This can be used to only show the product category to admins and hide it from customers.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category", + "type": "[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)", + "description": "The associated parent category. It may only be available if the `parent_category` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rank", + "type": "`number`", + "description": "The ranking of the product category among sibling categories.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product category was updated.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product category was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "`string`", + "description": "The description of the product category.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product category. The handle can be used to create slug URL paths.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_active", + "type": "`boolean`", + "description": "Whether the product category is active.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "is_internal", + "type": "`boolean`", + "description": "Whether the product category is internal. This can be used to only show the product category to admins and hide it from customers.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category", + "type": "[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)", + "description": "The associated parent category. It may only be available if the `parent_category` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "category_children", + "type": "[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)[]", + "description": "The associated child categories. It may only be available if the `category_children` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product category was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "`string`", + "description": "The description of the product category.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product category. The handle can be used to create slug URL paths.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_active", + "type": "`boolean`", + "description": "Whether the product category is active.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "is_internal", + "type": "`boolean`", + "description": "Whether the product category is internal. This can be used to only show the product category to admins and hide it from customers.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category", + "type": "[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)", + "description": "The associated parent category. It may only be available if the `parent_category` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rank", + "type": "`number`", + "description": "The ranking of the product category among sibling categories.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product category was updated.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "rank", + "type": "`number`", + "description": "The ranking of the product category among sibling categories.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product category was updated.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.createCollections.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.createCollections.mdx new file mode 100644 index 0000000000..6f99388bff --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.createCollections.mdx @@ -0,0 +1,202 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/createCollections +sidebar_label: createCollections +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# createCollections - Product Module Reference + +This documentation provides a reference to the createCollections method. This belongs to the Product Module. + +This method is used to create product collections. + +## Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function createCollection (title: string) { + const productModule = await initializeProductModule() + + const collections = await productModule.createCollections([ + { + title + } + ]) + + // do something with the product collections or return them +} +``` + +## Parameters + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product_ids", + "type": "`string`[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The product collection's title.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of created product collections.", + "children": [ + { + "name": "ProductCollectionDTO[]", + "type": "[`ProductCollectionDTO`](../../interfaces/ProductCollectionDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product collection was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product collection. The handle can be used to create slug URL paths.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](../../interfaces/ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.createOptions.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.createOptions.mdx new file mode 100644 index 0000000000..e20534307d --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.createOptions.mdx @@ -0,0 +1,187 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/createOptions +sidebar_label: createOptions +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# createOptions - Product Module Reference + +This documentation provides a reference to the createOptions method. This belongs to the Product Module. + +This method is used to create product options. + +## Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function createProductOption (title: string, productId: string) { + const productModule = await initializeProductModule() + + const productOptions = await productModule.createOptions([ + { + title, + product_id: productId + } + ]) + + // do something with the product options or return them +} +``` + +## Parameters + + + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of created product options.", + "children": [ + { + "name": "ProductOptionDTO[]", + "type": "[`ProductOptionDTO`](../../interfaces/ProductOptionDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](../../interfaces/ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "values", + "type": "[`ProductOptionValueDTO`](../../interfaces/ProductOptionValueDTO.mdx)[]", + "description": "The associated product option values. It may only be available if the `values` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.createTags.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.createTags.mdx new file mode 100644 index 0000000000..93e330de34 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.createTags.mdx @@ -0,0 +1,162 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/createTags +sidebar_label: createTags +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# createTags - Product Module Reference + +This documentation provides a reference to the createTags method. This belongs to the Product Module. + +This method is used to create product tags. + +## Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function createProductTags (values: string[]) { + const productModule = await initializeProductModule() + + const productTags = await productModule.createTags( + values.map((value) => ({ + value + })) + ) + + // do something with the product tags or return them +} +``` + +## Parameters + + + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of product tags.", + "children": [ + { + "name": "ProductTagDTO[]", + "type": "[`ProductTagDTO`](../../interfaces/ProductTagDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](../../interfaces/ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.createTypes.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.createTypes.mdx new file mode 100644 index 0000000000..d30f3508e3 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.createTypes.mdx @@ -0,0 +1,178 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/createTypes +sidebar_label: createTypes +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# createTypes - Product Module Reference + +This documentation provides a reference to the createTypes method. This belongs to the Product Module. + +This method is used to create a product type. + +## Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function createProductType (value: string) { + const productModule = await initializeProductModule() + + const productTypes = await productModule.createTypes([ + { + value + } + ]) + + // do something with the product types or return them +} +``` + +## Parameters + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The product type's value.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of created product types.", + "children": [ + { + "name": "ProductTypeDTO[]", + "type": "[`ProductTypeDTO`](../../interfaces/ProductTypeDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product type was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.delete.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.delete.mdx new file mode 100644 index 0000000000..902da182c0 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.delete.mdx @@ -0,0 +1,105 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/delete +sidebar_label: delete +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# delete - Product Module Reference + +This documentation provides a reference to the delete method. This belongs to the Product Module. + +This method is used to delete products. Unlike the [softDelete](IProductModuleService.softDelete.mdx) method, this method will completely remove the products and they can no longer be accessed or retrieved. + +## Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function deleteProducts (ids: string[]) { + const productModule = await initializeProductModule() + + await productModule.delete(ids) +} +``` + +## Parameters + + + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "Resolves when the products are successfully deleted.", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.deleteCategory.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.deleteCategory.mdx new file mode 100644 index 0000000000..8b79fb4414 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.deleteCategory.mdx @@ -0,0 +1,105 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/deleteCategory +sidebar_label: deleteCategory +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# deleteCategory - Product Module Reference + +This documentation provides a reference to the deleteCategory method. This belongs to the Product Module. + +This method is used to delete a product category by its ID. + +## Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function deleteCategory (id: string) { + const productModule = await initializeProductModule() + + await productModule.deleteCategory(id) +} +``` + +## Parameters + + + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "Resolves when the product category is successfully deleted.", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.deleteCollections.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.deleteCollections.mdx new file mode 100644 index 0000000000..b2ff4846df --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.deleteCollections.mdx @@ -0,0 +1,105 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/deleteCollections +sidebar_label: deleteCollections +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# deleteCollections - Product Module Reference + +This documentation provides a reference to the deleteCollections method. This belongs to the Product Module. + +This method is used to delete collections by their ID. + +## Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function deleteCollection (ids: string[]) { + const productModule = await initializeProductModule() + + await productModule.deleteCollections(ids) +} +``` + +## Parameters + + + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "Resolves when the product options are successfully deleted.", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.deleteOptions.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.deleteOptions.mdx new file mode 100644 index 0000000000..0b58704301 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.deleteOptions.mdx @@ -0,0 +1,105 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/deleteOptions +sidebar_label: deleteOptions +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# deleteOptions - Product Module Reference + +This documentation provides a reference to the deleteOptions method. This belongs to the Product Module. + +This method is used to delete a product option. + +## Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function deleteProductOptions (ids: string[]) { + const productModule = await initializeProductModule() + + await productModule.deleteOptions(ids) +} +``` + +## Parameters + + + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "Resolves when the product options are successfully deleted.", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.deleteTags.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.deleteTags.mdx new file mode 100644 index 0000000000..2d1bbe7df4 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.deleteTags.mdx @@ -0,0 +1,106 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/deleteTags +sidebar_label: deleteTags +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# deleteTags - Product Module Reference + +This documentation provides a reference to the deleteTags method. This belongs to the Product Module. + +This method is used to delete product tags by their ID. + +## Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function deleteProductTags (ids: string[]) { + const productModule = await initializeProductModule() + + await productModule.deleteTags(ids) + +} +``` + +## Parameters + + + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "Resolves when the product tags are successfully deleted.", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.deleteTypes.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.deleteTypes.mdx new file mode 100644 index 0000000000..53b67c988c --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.deleteTypes.mdx @@ -0,0 +1,105 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/deleteTypes +sidebar_label: deleteTypes +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# deleteTypes - Product Module Reference + +This documentation provides a reference to the deleteTypes method. This belongs to the Product Module. + +This method is used to delete a product type. + +## Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function deleteProductTypes (ids: string[]) { + const productModule = await initializeProductModule() + + await productModule.deleteTypes(ids) +} +``` + +## Parameters + + + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "Resolves when the product types are successfully deleted.", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.list.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.list.mdx new file mode 100644 index 0000000000..d4f43f1adf --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.list.mdx @@ -0,0 +1,554 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/list +sidebar_label: list +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# list - Product Module Reference + +This documentation provides a reference to the list method. This belongs to the Product Module. + +This method is used to retrieve a paginated list of price sets based on optional filters and configuration. + +## Example + +To retrieve a list of products using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProducts (ids: string[]) { + const productModule = await initializeProductModule() + + const products = await productModule.list({ + id: ids + }) + + // do something with the products or return them +} +``` + +To specify relations that should be retrieved within the products: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProducts (ids: string[]) { + const productModule = await initializeProductModule() + + const products = await productModule.list({ + id: ids + }, { + relations: ["categories"] + }) + + // do something with the products or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProducts (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const products = await productModule.list({ + id: ids + }, { + relations: ["categories"], + skip, + take + }) + + // do something with the products or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProducts (ids: string[], title: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const products = await productModule.list({ + $and: [ + { + id: ids + }, + { + q: title + } + ] + }, { + relations: ["categories"], + skip, + take + }) + + // do something with the products or return them +} +``` + +## Parameters + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductProps`](../../interfaces/FilterableProductProps.mdx) \\| [`BaseFilterable`](../../interfaces/BaseFilterable.mdx)<[`FilterableProductProps`](../../interfaces/FilterableProductProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "categories", + "type": "`object`", + "description": "Filters on a product's categories.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "category_id", + "type": "`string` \\| `string`[] \\| [`OperatorMap`](../../types/OperatorMap.mdx)<`string`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection_id", + "type": "`string` \\| `string`[] \\| [`OperatorMap`](../../types/OperatorMap.mdx)<`string`\\>", + "description": "Filters a product by its associated collections.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string` \\| `string`[]", + "description": "The handles to filter products by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter products by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "q", + "type": "`string`", + "description": "Search through the products' attributes, such as titles and descriptions, using this search term.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "`object`", + "description": "Filters on a product's tags.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "config", + "type": "[`FindConfig`](../../interfaces/FindConfig.mdx)<[`ProductDTO`](../../interfaces/ProductDTO.mdx)\\>", + "description": "The configurations determining how the products are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "order", + "type": "`object`", + "description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "relations", + "type": "`string`[]", + "description": "An array of strings, each being relation names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "select", + "type": "(`string` \\| keyof `Entity`)[]", + "description": "An array of strings, each being attribute names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "A number indicating the number of records to skip before retrieving the results.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "A number indicating the number of records to return in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "withDeleted", + "type": "`boolean`", + "description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of products.", + "children": [ + { + "name": "ProductDTO[]", + "type": "[`ProductDTO`](../../interfaces/ProductDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "categories", + "type": "``null`` \\| [`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)[]", + "description": "The associated product categories. It may only be available if the `categories` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection", + "type": "[`ProductCollectionDTO`](../../interfaces/ProductCollectionDTO.mdx)", + "description": "The associated product collection. It may only be available if the `collection` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product was created.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "``null`` \\| `string`", + "description": "The description of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discountable", + "type": "`boolean`", + "description": "Whether the product can be discounted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "external_id", + "type": "``null`` \\| `string`", + "description": "The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain a reference to the ID in the integrated service.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "``null`` \\| `string`", + "description": "The handle of the product. The handle can be used to create slug URL paths. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "images", + "type": "[`ProductImageDTO`](../../interfaces/ProductImageDTO.mdx)[]", + "description": "The associated product images. It may only be available if the `images` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_giftcard", + "type": "`boolean`", + "description": "Whether the product is a gift card.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](../../interfaces/ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../../enums/ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../../enums/ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](../../interfaces/ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](../../interfaces/ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](../../interfaces/ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCount.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCount.mdx new file mode 100644 index 0000000000..0d1693596a --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCount.mdx @@ -0,0 +1,329 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/listAndCount +sidebar_label: listAndCount +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# listAndCount - Product Module Reference + +This documentation provides a reference to the listAndCount method. This belongs to the Product Module. + +This method is used to retrieve a paginated list of products along with the total count of available products satisfying the provided filters. + +## Example + +To retrieve a list of products using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProducts (ids: string[]) { + const productModule = await initializeProductModule() + + const [products, count] = await productModule.listAndCount({ + id: ids + }) + + // do something with the products or return them +} +``` + +To specify relations that should be retrieved within the products: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProducts (ids: string[]) { + const productModule = await initializeProductModule() + + const [products, count] = await productModule.listAndCount({ + id: ids + }, { + relations: ["categories"] + }) + + // do something with the products or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProducts (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const [products, count] = await productModule.listAndCount({ + id: ids + }, { + relations: ["categories"], + skip, + take + }) + + // do something with the products or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProducts (ids: string[], title: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const [products, count] = await productModule.listAndCount({ + $and: [ + { + id: ids + }, + { + q: title + } + ] + }, { + relations: ["categories"], + skip, + take + }) + + // do something with the products or return them +} +``` + +## Parameters + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductProps`](../../interfaces/FilterableProductProps.mdx) \\| [`BaseFilterable`](../../interfaces/BaseFilterable.mdx)<[`FilterableProductProps`](../../interfaces/FilterableProductProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "categories", + "type": "`object`", + "description": "Filters on a product's categories.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "category_id", + "type": "`string` \\| `string`[] \\| [`OperatorMap`](../../types/OperatorMap.mdx)<`string`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection_id", + "type": "`string` \\| `string`[] \\| [`OperatorMap`](../../types/OperatorMap.mdx)<`string`\\>", + "description": "Filters a product by its associated collections.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string` \\| `string`[]", + "description": "The handles to filter products by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter products by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "q", + "type": "`string`", + "description": "Search through the products' attributes, such as titles and descriptions, using this search term.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "`object`", + "description": "Filters on a product's tags.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "config", + "type": "[`FindConfig`](../../interfaces/FindConfig.mdx)<[`ProductDTO`](../../interfaces/ProductDTO.mdx)\\>", + "description": "The configurations determining how the products are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "order", + "type": "`object`", + "description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "relations", + "type": "`string`[]", + "description": "An array of strings, each being relation names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "select", + "type": "(`string` \\| keyof `Entity`)[]", + "description": "An array of strings, each being attribute names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "A number indicating the number of records to skip before retrieving the results.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "A number indicating the number of records to return in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "withDeleted", + "type": "`boolean`", + "description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of products along with the total count.", + "children": [ + { + "name": "ProductDTO[]", + "type": "[`ProductDTO`](../../interfaces/ProductDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountCategories.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountCategories.mdx new file mode 100644 index 0000000000..c1f17ae7a6 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountCategories.mdx @@ -0,0 +1,329 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/listAndCountCategories +sidebar_label: listAndCountCategories +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# listAndCountCategories - Product Module Reference + +This documentation provides a reference to the listAndCountCategories method. This belongs to the Product Module. + +This method is used to retrieve a paginated list of product categories along with the total count of available product categories satisfying the provided filters. + +## Example + +To retrieve a list of product categories using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCategories (ids: string[]) { + const productModule = await initializeProductModule() + + const [categories, count] = await productModule.listAndCountCategories({ + id: ids + }) + + // do something with the product category or return it +} +``` + +To specify relations that should be retrieved within the product categories: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCategories (ids: string[]) { + const productModule = await initializeProductModule() + + const [categories, count] = await productModule.listAndCountCategories({ + id: ids + }, { + relations: ["parent_category"] + }) + + // do something with the product category or return it +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCategories (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const [categories, count] = await productModule.listAndCountCategories({ + id: ids + }, { + relations: ["parent_category"], + skip, + take + }) + + // do something with the product category or return it +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCategories (ids: string[], name: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const [categories, count] = await productModule.listAndCountCategories({ + $or: [ + { + id: ids + }, + { + name + } + ] + }, { + relations: ["parent_category"], + skip, + take + }) + + // do something with the product category or return it +} +``` + +## Parameters + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductCategoryProps`](../../interfaces/FilterableProductCategoryProps.mdx) \\| [`BaseFilterable`](../../interfaces/BaseFilterable.mdx)<[`FilterableProductCategoryProps`](../../interfaces/FilterableProductCategoryProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string` \\| `string`[]", + "description": "The handles to filter product categories by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product categories by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "include_descendants_tree", + "type": "`boolean`", + "description": "Whether to include children of retrieved product categories.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "is_active", + "type": "`boolean`", + "description": "Filter product categories by whether they're active.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "is_internal", + "type": "`boolean`", + "description": "Filter product categories by whether they're internal.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string` \\| `string`[]", + "description": "The names to filter product categories by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category_id", + "type": "``null`` \\| `string` \\| `string`[]", + "description": "Filter product categories by their parent category's ID.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "config", + "type": "[`FindConfig`](../../interfaces/FindConfig.mdx)<[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)\\>", + "description": "The configurations determining how the product categories are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product category.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "order", + "type": "`object`", + "description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "relations", + "type": "`string`[]", + "description": "An array of strings, each being relation names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "select", + "type": "(`string` \\| keyof `Entity`)[]", + "description": "An array of strings, each being attribute names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "A number indicating the number of records to skip before retrieving the results.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "A number indicating the number of records to return in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "withDeleted", + "type": "`boolean`", + "description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of product categories along with their total count.", + "children": [ + { + "name": "ProductCategoryDTO[]", + "type": "[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountCollections.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountCollections.mdx new file mode 100644 index 0000000000..56c3679896 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountCollections.mdx @@ -0,0 +1,297 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/listAndCountCollections +sidebar_label: listAndCountCollections +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# listAndCountCollections - Product Module Reference + +This documentation provides a reference to the listAndCountCollections method. This belongs to the Product Module. + +This method is used to retrieve a paginated list of product collections along with the total count of available product collections satisfying the provided filters. + +## Example + +To retrieve a list of product collections using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCollections (ids: string[]) { + const productModule = await initializeProductModule() + + const [collections, count] = await productModule.listAndCountCollections({ + id: ids + }) + + // do something with the product collections or return them +} +``` + +To specify relations that should be retrieved within the product collections: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCollections (ids: string[]) { + const productModule = await initializeProductModule() + + const [collections, count] = await productModule.listAndCountCollections({ + id: ids + }, { + relations: ["products"] + }) + + // do something with the product collections or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCollections (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const [collections, count] = await productModule.listAndCountCollections({ + id: ids + }, { + relations: ["products"], + skip, + take + }) + + // do something with the product collections or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCollections (ids: string[], title: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const [collections, count] = await productModule.listAndCountCollections({ + $and: [ + { + id: ids + }, + { + title + } + ] + }, { + relations: ["products"], + skip, + take + }) + + // do something with the product collections or return them +} +``` + +## Parameters + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductCollectionProps`](../../interfaces/FilterableProductCollectionProps.mdx) \\| [`BaseFilterable`](../../interfaces/BaseFilterable.mdx)<[`FilterableProductCollectionProps`](../../interfaces/FilterableProductCollectionProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string` \\| `string`[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product collections by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title to filter product collections by.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "config", + "type": "[`FindConfig`](../../interfaces/FindConfig.mdx)<[`ProductCollectionDTO`](../../interfaces/ProductCollectionDTO.mdx)\\>", + "description": "The configurations determining how the product collections are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product collection.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "order", + "type": "`object`", + "description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "relations", + "type": "`string`[]", + "description": "An array of strings, each being relation names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "select", + "type": "(`string` \\| keyof `Entity`)[]", + "description": "An array of strings, each being attribute names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "A number indicating the number of records to skip before retrieving the results.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "A number indicating the number of records to return in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "withDeleted", + "type": "`boolean`", + "description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of product collections along with the total count.", + "children": [ + { + "name": "ProductCollectionDTO[]", + "type": "[`ProductCollectionDTO`](../../interfaces/ProductCollectionDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountOptions.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountOptions.mdx new file mode 100644 index 0000000000..2a7af35f2f --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountOptions.mdx @@ -0,0 +1,297 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/listAndCountOptions +sidebar_label: listAndCountOptions +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# listAndCountOptions - Product Module Reference + +This documentation provides a reference to the listAndCountOptions method. This belongs to the Product Module. + +This method is used to retrieve a paginated list of product options along with the total count of available product options satisfying the provided filters. + +## Example + +To retrieve a list of product options using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductOptions (ids: string[]) { + const productModule = await initializeProductModule() + + const [productOptions, count] = await productModule.listAndCountOptions({ + id: ids + }) + + // do something with the product options or return them +} +``` + +To specify relations that should be retrieved within the product types: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductOptions (ids: string[]) { + const productModule = await initializeProductModule() + + const [productOptions, count] = await productModule.listAndCountOptions({ + id: ids + }, { + relations: ["product"] + }) + + // do something with the product options or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductOptions (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const [productOptions, count] = await productModule.listAndCountOptions({ + id: ids + }, { + relations: ["product"], + skip, + take + }) + + // do something with the product options or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductOptions (ids: string[], title: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const [productOptions, count] = await productModule.listAndCountOptions({ + $and: [ + { + id: ids + }, + { + title + } + ] + }, { + relations: ["product"], + skip, + take + }) + + // do something with the product options or return them +} +``` + +## Parameters + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductOptionProps`](../../interfaces/FilterableProductOptionProps.mdx) \\| [`BaseFilterable`](../../interfaces/BaseFilterable.mdx)<[`FilterableProductOptionProps`](../../interfaces/FilterableProductOptionProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product options by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product_id", + "type": "`string` \\| `string`[]", + "description": "Filter the product options by their associated products' IDs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The titles to filter product options by.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "config", + "type": "[`FindConfig`](../../interfaces/FindConfig.mdx)<[`ProductOptionDTO`](../../interfaces/ProductOptionDTO.mdx)\\>", + "description": "The configurations determining how the product options are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product option.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "order", + "type": "`object`", + "description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "relations", + "type": "`string`[]", + "description": "An array of strings, each being relation names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "select", + "type": "(`string` \\| keyof `Entity`)[]", + "description": "An array of strings, each being attribute names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "A number indicating the number of records to skip before retrieving the results.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "A number indicating the number of records to return in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "withDeleted", + "type": "`boolean`", + "description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of product options along with the total count.", + "children": [ + { + "name": "ProductOptionDTO[]", + "type": "[`ProductOptionDTO`](../../interfaces/ProductOptionDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountTags.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountTags.mdx new file mode 100644 index 0000000000..5961c144a7 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountTags.mdx @@ -0,0 +1,289 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/listAndCountTags +sidebar_label: listAndCountTags +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# listAndCountTags - Product Module Reference + +This documentation provides a reference to the listAndCountTags method. This belongs to the Product Module. + +This method is used to retrieve a paginated list of product tags along with the total count of available product tags satisfying the provided filters. + +## Example + +To retrieve a list of product tags using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTag (tagIds: string[]) { + const productModule = await initializeProductModule() + + const [productTags, count] = await productModule.listAndCountTags({ + id: tagIds + }) + + // do something with the product tags or return them +} +``` + +To specify relations that should be retrieved within the product tags: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTag (tagIds: string[]) { + const productModule = await initializeProductModule() + + const [productTags, count] = await productModule.listAndCountTags({ + id: tagIds + }, { + relations: ["products"] + }) + + // do something with the product tags or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTag (tagIds: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const [productTags, count] = await productModule.listAndCountTags({ + id: tagIds + }, { + relations: ["products"], + skip, + take + }) + + // do something with the product tags or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTag (tagIds: string[], value: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const [productTags, count] = await productModule.listAndCountTags({ + $and: [ + { + id: tagIds + }, + { + value + } + ] + }, { + relations: ["products"], + skip, + take + }) + + // do something with the product tags or return them +} +``` + +## Parameters + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductTagProps`](../../interfaces/FilterableProductTagProps.mdx) \\| [`BaseFilterable`](../../interfaces/BaseFilterable.mdx)<[`FilterableProductTagProps`](../../interfaces/FilterableProductTagProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product tags by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value to filter product tags by.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "config", + "type": "[`FindConfig`](../../interfaces/FindConfig.mdx)<[`ProductTagDTO`](../../interfaces/ProductTagDTO.mdx)\\>", + "description": "The configurations determining how the product tags are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product tag.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "order", + "type": "`object`", + "description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "relations", + "type": "`string`[]", + "description": "An array of strings, each being relation names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "select", + "type": "(`string` \\| keyof `Entity`)[]", + "description": "An array of strings, each being attribute names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "A number indicating the number of records to skip before retrieving the results.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "A number indicating the number of records to return in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "withDeleted", + "type": "`boolean`", + "description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of product tags along with the total count.", + "children": [ + { + "name": "ProductTagDTO[]", + "type": "[`ProductTagDTO`](../../interfaces/ProductTagDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountTypes.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountTypes.mdx new file mode 100644 index 0000000000..2c45308146 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountTypes.mdx @@ -0,0 +1,289 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/listAndCountTypes +sidebar_label: listAndCountTypes +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# listAndCountTypes - Product Module Reference + +This documentation provides a reference to the listAndCountTypes method. This belongs to the Product Module. + +This method is used to retrieve a paginated list of product types along with the total count of available product types satisfying the provided filters. + +## Example + +To retrieve a list of product types using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTypes (ids: string[]) { + const productModule = await initializeProductModule() + + const [productTypes, count] = await productModule.listAndCountTypes({ + id: ids + }) + + // do something with the product types or return them +} +``` + +To specify attributes that should be retrieved within the product types: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTypes (ids: string[]) { + const productModule = await initializeProductModule() + + const [productTypes, count] = await productModule.listAndCountTypes({ + id: ids + }, { + select: ["value"] + }) + + // do something with the product types or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTypes (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const [productTypes, count] = await productModule.listAndCountTypes({ + id: ids + }, { + select: ["value"], + skip, + take + }) + + // do something with the product types or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTypes (ids: string[], value: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const [productTypes, count] = await productModule.listAndCountTypes({ + $and: [ + { + id: ids + }, + { + value + } + ] + }, { + select: ["value"], + skip, + take + }) + + // do something with the product types or return them +} +``` + +## Parameters + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductTypeProps`](../../interfaces/FilterableProductTypeProps.mdx) \\| [`BaseFilterable`](../../interfaces/BaseFilterable.mdx)<[`FilterableProductTypeProps`](../../interfaces/FilterableProductTypeProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product types by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value to filter product types by.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "config", + "type": "[`FindConfig`](../../interfaces/FindConfig.mdx)<[`ProductTypeDTO`](../../interfaces/ProductTypeDTO.mdx)\\>", + "description": "The configurations determining how the product types are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product type.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "order", + "type": "`object`", + "description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "relations", + "type": "`string`[]", + "description": "An array of strings, each being relation names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "select", + "type": "(`string` \\| keyof `Entity`)[]", + "description": "An array of strings, each being attribute names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "A number indicating the number of records to skip before retrieving the results.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "A number indicating the number of records to return in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "withDeleted", + "type": "`boolean`", + "description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of product types along with their total count.", + "children": [ + { + "name": "ProductTypeDTO[]", + "type": "[`ProductTypeDTO`](../../interfaces/ProductTypeDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountVariants.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountVariants.mdx new file mode 100644 index 0000000000..a4ae0d286d --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listAndCountVariants.mdx @@ -0,0 +1,305 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/listAndCountVariants +sidebar_label: listAndCountVariants +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# listAndCountVariants - Product Module Reference + +This documentation provides a reference to the listAndCountVariants method. This belongs to the Product Module. + +This method is used to retrieve a paginated list of product variants along with the total count of available product variants satisfying the provided filters. + +## Example + +To retrieve a list of product variants using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductVariants (ids: string[]) { + const productModule = await initializeProductModule() + + const [variants, count] = await productModule.listAndCountVariants({ + id: ids + }) + + // do something with the product variants or return them +} +``` + +To specify relations that should be retrieved within the product variants: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductVariants (ids: string[]) { + const productModule = await initializeProductModule() + + const [variants, count] = await productModule.listAndCountVariants({ + id: ids + }, { + relations: ["options"] + }) + + // do something with the product variants or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductVariants (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const [variants, count] = await productModule.listAndCountVariants({ + id: ids + }, { + relations: ["options"], + skip, + take + }) + + // do something with the product variants or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductVariants (ids: string[], sku: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const [variants, count] = await productModule.listAndCountVariants({ + $and: [ + { + id: ids + }, + { + sku + } + ] + }, { + relations: ["options"], + skip, + take + }) + + // do something with the product variants or return them +} +``` + +## Parameters + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductVariantProps`](../../interfaces/FilterableProductVariantProps.mdx) \\| [`BaseFilterable`](../../interfaces/BaseFilterable.mdx)<[`FilterableProductVariantProps`](../../interfaces/FilterableProductVariantProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product variants by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "`object`", + "description": "Filter product variants by their associated options.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product_id", + "type": "`string` \\| `string`[]", + "description": "Filter the product variants by their associated products' IDs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "`string` \\| `string`[]", + "description": "The SKUs to filter product variants by.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "config", + "type": "[`FindConfig`](../../interfaces/FindConfig.mdx)<[`ProductVariantDTO`](../../interfaces/ProductVariantDTO.mdx)\\>", + "description": "The configurations determining how the product variants are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product variant.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "order", + "type": "`object`", + "description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "relations", + "type": "`string`[]", + "description": "An array of strings, each being relation names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "select", + "type": "(`string` \\| keyof `Entity`)[]", + "description": "An array of strings, each being attribute names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "A number indicating the number of records to skip before retrieving the results.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "A number indicating the number of records to return in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "withDeleted", + "type": "`boolean`", + "description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of product variants along with their total count.", + "children": [ + { + "name": "ProductVariantDTO[]", + "type": "[`ProductVariantDTO`](../../interfaces/ProductVariantDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listCategories.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listCategories.mdx new file mode 100644 index 0000000000..18b01dd689 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listCategories.mdx @@ -0,0 +1,410 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/listCategories +sidebar_label: listCategories +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# listCategories - Product Module Reference + +This documentation provides a reference to the listCategories method. This belongs to the Product Module. + +This method is used to retrieve a paginated list of product categories based on optional filters and configuration. + +## Example + +To retrieve a list of product categories using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCategories (ids: string[]) { + const productModule = await initializeProductModule() + + const categories = await productModule.listCategories({ + id: ids + }) + + // do something with the product category or return it +} +``` + +To specify relations that should be retrieved within the product categories: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCategories (ids: string[]) { + const productModule = await initializeProductModule() + + const categories = await productModule.listCategories({ + id: ids + }, { + relations: ["parent_category"] + }) + + // do something with the product category or return it +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCategories (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const categories = await productModule.listCategories({ + id: ids + }, { + relations: ["parent_category"], + skip, + take + }) + + // do something with the product category or return it +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCategories (ids: string[], name: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const categories = await productModule.listCategories({ + $or: [ + { + id: ids + }, + { + name + } + ] + }, { + relations: ["parent_category"], + skip, + take + }) + + // do something with the product category or return it +} +``` + +## Parameters + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductCategoryProps`](../../interfaces/FilterableProductCategoryProps.mdx) \\| [`BaseFilterable`](../../interfaces/BaseFilterable.mdx)<[`FilterableProductCategoryProps`](../../interfaces/FilterableProductCategoryProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string` \\| `string`[]", + "description": "The handles to filter product categories by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product categories by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "include_descendants_tree", + "type": "`boolean`", + "description": "Whether to include children of retrieved product categories.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "is_active", + "type": "`boolean`", + "description": "Filter product categories by whether they're active.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "is_internal", + "type": "`boolean`", + "description": "Filter product categories by whether they're internal.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string` \\| `string`[]", + "description": "The names to filter product categories by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category_id", + "type": "``null`` \\| `string` \\| `string`[]", + "description": "Filter product categories by their parent category's ID.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "config", + "type": "[`FindConfig`](../../interfaces/FindConfig.mdx)<[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)\\>", + "description": "The configurations determining how the product categories are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product category.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "order", + "type": "`object`", + "description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "relations", + "type": "`string`[]", + "description": "An array of strings, each being relation names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "select", + "type": "(`string` \\| keyof `Entity`)[]", + "description": "An array of strings, each being attribute names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "A number indicating the number of records to skip before retrieving the results.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "A number indicating the number of records to return in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "withDeleted", + "type": "`boolean`", + "description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of product categories.", + "children": [ + { + "name": "ProductCategoryDTO[]", + "type": "[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "category_children", + "type": "[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)[]", + "description": "The associated child categories. It may only be available if the `category_children` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product category was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "`string`", + "description": "The description of the product category.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product category. The handle can be used to create slug URL paths.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_active", + "type": "`boolean`", + "description": "Whether the product category is active.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "is_internal", + "type": "`boolean`", + "description": "Whether the product category is internal. This can be used to only show the product category to admins and hide it from customers.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category", + "type": "[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)", + "description": "The associated parent category. It may only be available if the `parent_category` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rank", + "type": "`number`", + "description": "The ranking of the product category among sibling categories.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product category was updated.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listCollections.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listCollections.mdx new file mode 100644 index 0000000000..3f8441a63a --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listCollections.mdx @@ -0,0 +1,338 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/listCollections +sidebar_label: listCollections +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# listCollections - Product Module Reference + +This documentation provides a reference to the listCollections method. This belongs to the Product Module. + +This method is used to retrieve a paginated list of product collections based on optional filters and configuration. + +## Example + +To retrieve a list of product collections using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCollections (ids: string[]) { + const productModule = await initializeProductModule() + + const collections = await productModule.listCollections({ + id: ids + }) + + // do something with the product collections or return them +} +``` + +To specify relations that should be retrieved within the product collections: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCollections (ids: string[]) { + const productModule = await initializeProductModule() + + const collections = await productModule.listCollections({ + id: ids + }, { + relations: ["products"] + }) + + // do something with the product collections or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCollections (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const collections = await productModule.listCollections({ + id: ids + }, { + relations: ["products"], + skip, + take + }) + + // do something with the product collections or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCollections (ids: string[], title: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const collections = await productModule.listCollections({ + $and: [ + { + id: ids + }, + { + title + } + ] + }, { + relations: ["products"], + skip, + take + }) + + // do something with the product collections or return them +} +``` + +## Parameters + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductCollectionProps`](../../interfaces/FilterableProductCollectionProps.mdx) \\| [`BaseFilterable`](../../interfaces/BaseFilterable.mdx)<[`FilterableProductCollectionProps`](../../interfaces/FilterableProductCollectionProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string` \\| `string`[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product collections by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title to filter product collections by.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "config", + "type": "[`FindConfig`](../../interfaces/FindConfig.mdx)<[`ProductCollectionDTO`](../../interfaces/ProductCollectionDTO.mdx)\\>", + "description": "The configurations determining how the product collections are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product collection.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "order", + "type": "`object`", + "description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "relations", + "type": "`string`[]", + "description": "An array of strings, each being relation names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "select", + "type": "(`string` \\| keyof `Entity`)[]", + "description": "An array of strings, each being attribute names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "A number indicating the number of records to skip before retrieving the results.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "A number indicating the number of records to return in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "withDeleted", + "type": "`boolean`", + "description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of product collections.", + "children": [ + { + "name": "ProductCollectionDTO[]", + "type": "[`ProductCollectionDTO`](../../interfaces/ProductCollectionDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product collection was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product collection. The handle can be used to create slug URL paths.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](../../interfaces/ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listOptions.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listOptions.mdx new file mode 100644 index 0000000000..6270277b6c --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listOptions.mdx @@ -0,0 +1,338 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/listOptions +sidebar_label: listOptions +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# listOptions - Product Module Reference + +This documentation provides a reference to the listOptions method. This belongs to the Product Module. + +This method is used to retrieve a paginated list of product options based on optional filters and configuration. + +## Example + +To retrieve a list of product options using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductOptions (ids: string[]) { + const productModule = await initializeProductModule() + + const productOptions = await productModule.listOptions({ + id: ids + }) + + // do something with the product options or return them +} +``` + +To specify relations that should be retrieved within the product types: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductOptions (ids: string[]) { + const productModule = await initializeProductModule() + + const productOptions = await productModule.listOptions({ + id: ids + }, { + relations: ["product"] + }) + + // do something with the product options or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductOptions (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const productOptions = await productModule.listOptions({ + id: ids + }, { + relations: ["product"], + skip, + take + }) + + // do something with the product options or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductOptions (ids: string[], title: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const productOptions = await productModule.listOptions({ + $and: [ + { + id: ids + }, + { + title + } + ] + }, { + relations: ["product"], + skip, + take + }) + + // do something with the product options or return them +} +``` + +## Parameters + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductOptionProps`](../../interfaces/FilterableProductOptionProps.mdx) \\| [`BaseFilterable`](../../interfaces/BaseFilterable.mdx)<[`FilterableProductOptionProps`](../../interfaces/FilterableProductOptionProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product options by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product_id", + "type": "`string` \\| `string`[]", + "description": "Filter the product options by their associated products' IDs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The titles to filter product options by.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "config", + "type": "[`FindConfig`](../../interfaces/FindConfig.mdx)<[`ProductOptionDTO`](../../interfaces/ProductOptionDTO.mdx)\\>", + "description": "The configurations determining how the product options are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product option.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "order", + "type": "`object`", + "description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "relations", + "type": "`string`[]", + "description": "An array of strings, each being relation names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "select", + "type": "(`string` \\| keyof `Entity`)[]", + "description": "An array of strings, each being attribute names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "A number indicating the number of records to skip before retrieving the results.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "A number indicating the number of records to return in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "withDeleted", + "type": "`boolean`", + "description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of product options.", + "children": [ + { + "name": "ProductOptionDTO[]", + "type": "[`ProductOptionDTO`](../../interfaces/ProductOptionDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](../../interfaces/ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "values", + "type": "[`ProductOptionValueDTO`](../../interfaces/ProductOptionValueDTO.mdx)[]", + "description": "The associated product option values. It may only be available if the `values` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listTags.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listTags.mdx new file mode 100644 index 0000000000..0fca54c150 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listTags.mdx @@ -0,0 +1,314 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/listTags +sidebar_label: listTags +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# listTags - Product Module Reference + +This documentation provides a reference to the listTags method. This belongs to the Product Module. + +This method is used to retrieve a paginated list of tags based on optional filters and configuration. + +## Example + +To retrieve a list of product tags using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTag (tagIds: string[]) { + const productModule = await initializeProductModule() + + const productTags = await productModule.listTags({ + id: tagIds + }) + + // do something with the product tags or return them +} +``` + +To specify relations that should be retrieved within the product tags: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTag (tagIds: string[]) { + const productModule = await initializeProductModule() + + const productTags = await productModule.listTags({ + id: tagIds + }, { + relations: ["products"] + }) + + // do something with the product tags or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTag (tagIds: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const productTags = await productModule.listTags({ + id: tagIds + }, { + relations: ["products"], + skip, + take + }) + + // do something with the product tags or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTag (tagIds: string[], value: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const productTags = await productModule.listTags({ + $and: [ + { + id: tagIds + }, + { + value + } + ] + }, { + relations: ["products"], + skip, + take + }) + + // do something with the product tags or return them +} +``` + +## Parameters + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductTagProps`](../../interfaces/FilterableProductTagProps.mdx) \\| [`BaseFilterable`](../../interfaces/BaseFilterable.mdx)<[`FilterableProductTagProps`](../../interfaces/FilterableProductTagProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product tags by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value to filter product tags by.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "config", + "type": "[`FindConfig`](../../interfaces/FindConfig.mdx)<[`ProductTagDTO`](../../interfaces/ProductTagDTO.mdx)\\>", + "description": "The configurations determining how the product tags are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product tag.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "order", + "type": "`object`", + "description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "relations", + "type": "`string`[]", + "description": "An array of strings, each being relation names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "select", + "type": "(`string` \\| keyof `Entity`)[]", + "description": "An array of strings, each being attribute names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "A number indicating the number of records to skip before retrieving the results.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "A number indicating the number of records to return in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "withDeleted", + "type": "`boolean`", + "description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of product tags.", + "children": [ + { + "name": "ProductTagDTO[]", + "type": "[`ProductTagDTO`](../../interfaces/ProductTagDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](../../interfaces/ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listTypes.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listTypes.mdx new file mode 100644 index 0000000000..55e69c9e9d --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listTypes.mdx @@ -0,0 +1,314 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/listTypes +sidebar_label: listTypes +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# listTypes - Product Module Reference + +This documentation provides a reference to the listTypes method. This belongs to the Product Module. + +This method is used to retrieve a paginated list of product types based on optional filters and configuration. + +## Example + +To retrieve a list of product types using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTypes (ids: string[]) { + const productModule = await initializeProductModule() + + const productTypes = await productModule.listTypes({ + id: ids + }) + + // do something with the product types or return them +} +``` + +To specify attributes that should be retrieved within the product types: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTypes (ids: string[]) { + const productModule = await initializeProductModule() + + const productTypes = await productModule.listTypes({ + id: ids + }, { + select: ["value"] + }) + + // do something with the product types or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTypes (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const productTypes = await productModule.listTypes({ + id: ids + }, { + select: ["value"], + skip, + take + }) + + // do something with the product types or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTypes (ids: string[], value: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const productTypes = await productModule.listTypes({ + $and: [ + { + id: ids + }, + { + value + } + ] + }, { + select: ["value"], + skip, + take + }) + + // do something with the product types or return them +} +``` + +## Parameters + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductTypeProps`](../../interfaces/FilterableProductTypeProps.mdx) \\| [`BaseFilterable`](../../interfaces/BaseFilterable.mdx)<[`FilterableProductTypeProps`](../../interfaces/FilterableProductTypeProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product types by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value to filter product types by.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "config", + "type": "[`FindConfig`](../../interfaces/FindConfig.mdx)<[`ProductTypeDTO`](../../interfaces/ProductTypeDTO.mdx)\\>", + "description": "The configurations determining how the product types are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product type.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "order", + "type": "`object`", + "description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "relations", + "type": "`string`[]", + "description": "An array of strings, each being relation names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "select", + "type": "(`string` \\| keyof `Entity`)[]", + "description": "An array of strings, each being attribute names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "A number indicating the number of records to skip before retrieving the results.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "A number indicating the number of records to return in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "withDeleted", + "type": "`boolean`", + "description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of product types.", + "children": [ + { + "name": "ProductTypeDTO[]", + "type": "[`ProductTypeDTO`](../../interfaces/ProductTypeDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product type was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listVariants.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listVariants.mdx new file mode 100644 index 0000000000..ce75812ed1 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.listVariants.mdx @@ -0,0 +1,498 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/listVariants +sidebar_label: listVariants +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# listVariants - Product Module Reference + +This documentation provides a reference to the listVariants method. This belongs to the Product Module. + +This method is used to retrieve a paginated list of product variants based on optional filters and configuration. + +## Example + +To retrieve a list of product variants using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductVariants (ids: string[]) { + const productModule = await initializeProductModule() + + const variants = await productModule.listVariants({ + id: ids + }) + + // do something with the product variants or return them +} +``` + +To specify relations that should be retrieved within the product variants: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductVariants (ids: string[]) { + const productModule = await initializeProductModule() + + const variants = await productModule.listVariants({ + id: ids + }, { + relations: ["options"] + }) + + // do something with the product variants or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductVariants (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const variants = await productModule.listVariants({ + id: ids + }, { + relations: ["options"], + skip, + take + }) + + // do something with the product variants or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductVariants (ids: string[], sku: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const variants = await productModule.listVariants({ + $and: [ + { + id: ids + }, + { + sku + } + ] + }, { + relations: ["options"], + skip, + take + }) + + // do something with the product variants or return them +} +``` + +## Parameters + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductVariantProps`](../../interfaces/FilterableProductVariantProps.mdx) \\| [`BaseFilterable`](../../interfaces/BaseFilterable.mdx)<[`FilterableProductVariantProps`](../../interfaces/FilterableProductVariantProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product variants by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "`object`", + "description": "Filter product variants by their associated options.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product_id", + "type": "`string` \\| `string`[]", + "description": "Filter the product variants by their associated products' IDs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "`string` \\| `string`[]", + "description": "The SKUs to filter product variants by.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "config", + "type": "[`FindConfig`](../../interfaces/FindConfig.mdx)<[`ProductVariantDTO`](../../interfaces/ProductVariantDTO.mdx)\\>", + "description": "The configurations determining how the product variants are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product variant.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "order", + "type": "`object`", + "description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "relations", + "type": "`string`[]", + "description": "An array of strings, each being relation names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "select", + "type": "(`string` \\| keyof `Entity`)[]", + "description": "An array of strings, each being attribute names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "A number indicating the number of records to skip before retrieving the results.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "A number indicating the number of records to return in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "withDeleted", + "type": "`boolean`", + "description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of product variants.", + "children": [ + { + "name": "ProductVariantDTO[]", + "type": "[`ProductVariantDTO`](../../interfaces/ProductVariantDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "allow_backorder", + "type": "`boolean`", + "description": "Whether the product variant can be ordered when it's out of stock.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "barcode", + "type": "``null`` \\| `string`", + "description": "The barcode of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was deleted.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "ean", + "type": "``null`` \\| `string`", + "description": "The EAN of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "inventory_quantity", + "type": "`number`", + "description": "The inventory quantiy of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manage_inventory", + "type": "`boolean`", + "description": "Whether the product variant's inventory should be managed by the core system.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionValueDTO`](../../interfaces/ProductOptionValueDTO.mdx)", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](../../interfaces/ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "product_id", + "type": "`string`", + "description": "The ID of the associated product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "``null`` \\| `string`", + "description": "The SKU of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The tile of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "``null`` \\| `string`", + "description": "The UPC of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was updated.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant_rank", + "type": "``null`` \\| `number`", + "description": "The ranking of the variant among other variants associated with the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "The width of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.restore.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.restore.mdx new file mode 100644 index 0000000000..7659fbf41e --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.restore.mdx @@ -0,0 +1,135 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/restore +sidebar_label: restore +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# restore - Product Module Reference + +This documentation provides a reference to the restore method. This belongs to the Product Module. + +This method is used to restore products which were deleted using the [softDelete](IProductModuleService.softDelete.mdx) method. + +## Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function restoreProducts (ids: string[]) { + const productModule = await initializeProductModule() + + const cascadedEntities = await productModule.restore(ids, { + returnLinkableKeys: ["variant_id"] + }) + + // do something with the returned cascaded entity IDs or return them +} +``` + +## Parameters + +", + "description": "Configurations determining which relations to restore along with the each of the products. You can pass to its `returnLinkableKeys` property any of the product's relation attribute names, such as `variant_id`.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "returnLinkableKeys", + "type": "`TReturnableLinkableKeys`[]", + "description": "An array of strings, each being the ID attribute names of the entity's relations.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +\\>", + "optional": false, + "defaultValue": "", + "description": "An object that includes the IDs of related records that were restored, such as the ID of associated product variants. The object's keys are the ID attribute names of the product entity's relations, such as `variant_id`, and its value is an array of strings, each being the ID of the record associated with the product through this relation, such as the IDs of associated product variants.\n\nIf there are no related records that were restored, the promise resolved to `void`.", + "children": [ + { + "name": "void \\| Record", + "type": "`void` \\| Record<`string`, `string`[]\\>", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.restoreVariants.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.restoreVariants.mdx new file mode 100644 index 0000000000..84a276ada2 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.restoreVariants.mdx @@ -0,0 +1,115 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/restoreVariants +sidebar_label: restoreVariants +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# restoreVariants - Product Module Reference + +This documentation provides a reference to the restoreVariants method. This belongs to the Product Module. + +## Parameters + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "returnLinkableKeys", + "type": "`TReturnableLinkableKeys`[]", + "description": "An array of strings, each being the ID attribute names of the entity's relations.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +\\>", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "void \\| Record", + "type": "`void` \\| Record<`string`, `string`[]\\>", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieve.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieve.mdx new file mode 100644 index 0000000000..812974cb51 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieve.mdx @@ -0,0 +1,851 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/retrieve +sidebar_label: retrieve +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# retrieve - Product Module Reference + +This documentation provides a reference to the retrieve method. This belongs to the Product Module. + +This method is used to retrieve a product by its ID + +## Example + +A simple example that retrieves a product by its ID: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProduct (id: string) { + const productModule = await initializeProductModule() + + const product = await productModule.retrieve(id) + + // do something with the product or return it +} +``` + +To specify relations that should be retrieved: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSet (priceSetId: string) { + const pricingService = await initializePricingModule() + + const priceSet = await pricingService.retrieve( + priceSetId, + { + relations: ["money_amounts"] + } + ) + + // do something with the price set or return it +} +``` + +## Parameters + +", + "description": "The configurations determining how the product is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "order", + "type": "`object`", + "description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "relations", + "type": "`string`[]", + "description": "An array of strings, each being relation names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "select", + "type": "(`string` \\| keyof `Entity`)[]", + "description": "An array of strings, each being attribute names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "A number indicating the number of records to skip before retrieving the results.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "A number indicating the number of records to return in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "withDeleted", + "type": "`boolean`", + "description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The retrieved product.", + "children": [ + { + "name": "categories", + "type": "``null`` \\| [`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)[]", + "description": "The associated product categories. It may only be available if the `categories` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection", + "type": "[`ProductCollectionDTO`](../../interfaces/ProductCollectionDTO.mdx)", + "description": "The associated product collection. It may only be available if the `collection` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product collection was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product collection. The handle can be used to create slug URL paths.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](../../interfaces/ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product was created.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "``null`` \\| `string`", + "description": "The description of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discountable", + "type": "`boolean`", + "description": "Whether the product can be discounted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "external_id", + "type": "``null`` \\| `string`", + "description": "The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain a reference to the ID in the integrated service.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "``null`` \\| `string`", + "description": "The handle of the product. The handle can be used to create slug URL paths. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "images", + "type": "[`ProductImageDTO`](../../interfaces/ProductImageDTO.mdx)[]", + "description": "The associated product images. It may only be available if the `images` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product image was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product image.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "url", + "type": "`string`", + "description": "The URL of the product image.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "is_giftcard", + "type": "`boolean`", + "description": "Whether the product is a gift card.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](../../interfaces/ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](../../interfaces/ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "values", + "type": "[`ProductOptionValueDTO`](../../interfaces/ProductOptionValueDTO.mdx)[]", + "description": "The associated product option values. It may only be available if the `values` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../../enums/ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../../enums/ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "DRAFT", + "type": "``\"draft\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "PROPOSED", + "type": "``\"proposed\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "PUBLISHED", + "type": "``\"published\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "REJECTED", + "type": "``\"rejected\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](../../interfaces/ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](../../interfaces/ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](../../interfaces/ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product type was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](../../interfaces/ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "allow_backorder", + "type": "`boolean`", + "description": "Whether the product variant can be ordered when it's out of stock.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "barcode", + "type": "``null`` \\| `string`", + "description": "The barcode of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was deleted.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "ean", + "type": "``null`` \\| `string`", + "description": "The EAN of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "inventory_quantity", + "type": "`number`", + "description": "The inventory quantiy of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manage_inventory", + "type": "`boolean`", + "description": "Whether the product variant's inventory should be managed by the core system.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionValueDTO`](../../interfaces/ProductOptionValueDTO.mdx)", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](../../interfaces/ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "product_id", + "type": "`string`", + "description": "The ID of the associated product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "``null`` \\| `string`", + "description": "The SKU of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The tile of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "``null`` \\| `string`", + "description": "The UPC of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was updated.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant_rank", + "type": "``null`` \\| `number`", + "description": "The ranking of the variant among other variants associated with the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "The width of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveCategory.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveCategory.mdx new file mode 100644 index 0000000000..ec0ef80902 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveCategory.mdx @@ -0,0 +1,451 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/retrieveCategory +sidebar_label: retrieveCategory +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# retrieveCategory - Product Module Reference + +This documentation provides a reference to the retrieveCategory method. This belongs to the Product Module. + +This method is used to retrieve a product category by its ID. + +## Example + +A simple example that retrieves a product category by its ID: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCategory (id: string) { + const productModule = await initializeProductModule() + + const category = await productModule.retrieveCategory(id) + + // do something with the product category or return it +} +``` + +To specify relations that should be retrieved: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCategory (id: string) { + const productModule = await initializeProductModule() + + const category = await productModule.retrieveCategory(id, { + relations: ["parent_category"] + }) + + // do something with the product category or return it +} +``` + +## Parameters + +", + "description": "The configurations determining how the product category is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product category.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "order", + "type": "`object`", + "description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "relations", + "type": "`string`[]", + "description": "An array of strings, each being relation names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "select", + "type": "(`string` \\| keyof `Entity`)[]", + "description": "An array of strings, each being attribute names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "A number indicating the number of records to skip before retrieving the results.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "A number indicating the number of records to return in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "withDeleted", + "type": "`boolean`", + "description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The retrieved product category.", + "children": [ + { + "name": "category_children", + "type": "[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)[]", + "description": "The associated child categories. It may only be available if the `category_children` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "category_children", + "type": "[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)[]", + "description": "The associated child categories. It may only be available if the `category_children` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product category was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "`string`", + "description": "The description of the product category.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product category. The handle can be used to create slug URL paths.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_active", + "type": "`boolean`", + "description": "Whether the product category is active.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "is_internal", + "type": "`boolean`", + "description": "Whether the product category is internal. This can be used to only show the product category to admins and hide it from customers.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category", + "type": "[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)", + "description": "The associated parent category. It may only be available if the `parent_category` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rank", + "type": "`number`", + "description": "The ranking of the product category among sibling categories.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product category was updated.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product category was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "`string`", + "description": "The description of the product category.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product category. The handle can be used to create slug URL paths.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_active", + "type": "`boolean`", + "description": "Whether the product category is active.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "is_internal", + "type": "`boolean`", + "description": "Whether the product category is internal. This can be used to only show the product category to admins and hide it from customers.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category", + "type": "[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)", + "description": "The associated parent category. It may only be available if the `parent_category` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "category_children", + "type": "[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)[]", + "description": "The associated child categories. It may only be available if the `category_children` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product category was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "`string`", + "description": "The description of the product category.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product category. The handle can be used to create slug URL paths.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_active", + "type": "`boolean`", + "description": "Whether the product category is active.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "is_internal", + "type": "`boolean`", + "description": "Whether the product category is internal. This can be used to only show the product category to admins and hide it from customers.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category", + "type": "[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)", + "description": "The associated parent category. It may only be available if the `parent_category` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rank", + "type": "`number`", + "description": "The ranking of the product category among sibling categories.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product category was updated.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "rank", + "type": "`number`", + "description": "The ranking of the product category among sibling categories.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product category was updated.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveCollection.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveCollection.mdx new file mode 100644 index 0000000000..e66aa2f179 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveCollection.mdx @@ -0,0 +1,466 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/retrieveCollection +sidebar_label: retrieveCollection +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# retrieveCollection - Product Module Reference + +This documentation provides a reference to the retrieveCollection method. This belongs to the Product Module. + +This method is used to retrieve a product collection by its ID. + +## Example + +A simple example that retrieves a product collection by its ID: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCollection (id: string) { + const productModule = await initializeProductModule() + + const collection = await productModule.retrieveCollection(id) + + // do something with the product collection or return it +} +``` + +To specify relations that should be retrieved: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCollection (id: string) { + const productModule = await initializeProductModule() + + const collection = await productModule.retrieveCollection(id, { + relations: ["products"] + }) + + // do something with the product collection or return it +} +``` + +## Parameters + +", + "description": "The configurations determining how the product collection is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product collection.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "order", + "type": "`object`", + "description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "relations", + "type": "`string`[]", + "description": "An array of strings, each being relation names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "select", + "type": "(`string` \\| keyof `Entity`)[]", + "description": "An array of strings, each being attribute names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "A number indicating the number of records to skip before retrieving the results.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "A number indicating the number of records to return in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "withDeleted", + "type": "`boolean`", + "description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The retrieved product collection.", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product collection was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product collection. The handle can be used to create slug URL paths.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](../../interfaces/ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "categories", + "type": "``null`` \\| [`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)[]", + "description": "The associated product categories. It may only be available if the `categories` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection", + "type": "[`ProductCollectionDTO`](../../interfaces/ProductCollectionDTO.mdx)", + "description": "The associated product collection. It may only be available if the `collection` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product was created.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "``null`` \\| `string`", + "description": "The description of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discountable", + "type": "`boolean`", + "description": "Whether the product can be discounted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "external_id", + "type": "``null`` \\| `string`", + "description": "The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain a reference to the ID in the integrated service.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "``null`` \\| `string`", + "description": "The handle of the product. The handle can be used to create slug URL paths. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "images", + "type": "[`ProductImageDTO`](../../interfaces/ProductImageDTO.mdx)[]", + "description": "The associated product images. It may only be available if the `images` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_giftcard", + "type": "`boolean`", + "description": "Whether the product is a gift card.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](../../interfaces/ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../../enums/ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../../enums/ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](../../interfaces/ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](../../interfaces/ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](../../interfaces/ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveOption.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveOption.mdx new file mode 100644 index 0000000000..c1ef9d323b --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveOption.mdx @@ -0,0 +1,515 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/retrieveOption +sidebar_label: retrieveOption +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# retrieveOption - Product Module Reference + +This documentation provides a reference to the retrieveOption method. This belongs to the Product Module. + +This method is used to retrieve a product option by its ID. + +## Example + +A simple example that retrieves a product option by its ID: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductOption (id: string) { + const productModule = await initializeProductModule() + + const productOption = await productModule.retrieveOption(id) + + // do something with the product option or return it +} +``` + +To specify relations that should be retrieved: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductOption (id: string) { + const productModule = await initializeProductModule() + + const productOption = await productModule.retrieveOption(id, { + relations: ["product"] + }) + + // do something with the product option or return it +} +``` + +## Parameters + +", + "description": "The configurations determining how the product option is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product option.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "order", + "type": "`object`", + "description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "relations", + "type": "`string`[]", + "description": "An array of strings, each being relation names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "select", + "type": "(`string` \\| keyof `Entity`)[]", + "description": "An array of strings, each being attribute names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "A number indicating the number of records to skip before retrieving the results.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "A number indicating the number of records to return in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "withDeleted", + "type": "`boolean`", + "description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The retrieved product option.", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](../../interfaces/ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "categories", + "type": "``null`` \\| [`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)[]", + "description": "The associated product categories. It may only be available if the `categories` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection", + "type": "[`ProductCollectionDTO`](../../interfaces/ProductCollectionDTO.mdx)", + "description": "The associated product collection. It may only be available if the `collection` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product was created.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "``null`` \\| `string`", + "description": "The description of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discountable", + "type": "`boolean`", + "description": "Whether the product can be discounted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "external_id", + "type": "``null`` \\| `string`", + "description": "The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain a reference to the ID in the integrated service.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "``null`` \\| `string`", + "description": "The handle of the product. The handle can be used to create slug URL paths. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "images", + "type": "[`ProductImageDTO`](../../interfaces/ProductImageDTO.mdx)[]", + "description": "The associated product images. It may only be available if the `images` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_giftcard", + "type": "`boolean`", + "description": "Whether the product is a gift card.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](../../interfaces/ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../../enums/ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../../enums/ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](../../interfaces/ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](../../interfaces/ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](../../interfaces/ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "values", + "type": "[`ProductOptionValueDTO`](../../interfaces/ProductOptionValueDTO.mdx)[]", + "description": "The associated product option values. It may only be available if the `values` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option value was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option value.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "option", + "type": "[`ProductOptionDTO`](../../interfaces/ProductOptionDTO.mdx)", + "description": "The associated product option. It may only be available if the `option` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product option value.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant", + "type": "[`ProductVariantDTO`](../../interfaces/ProductVariantDTO.mdx)", + "description": "The associated product variant. It may only be available if the `variant` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveTag.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveTag.mdx new file mode 100644 index 0000000000..cee3b64817 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveTag.mdx @@ -0,0 +1,450 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/retrieveTag +sidebar_label: retrieveTag +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# retrieveTag - Product Module Reference + +This documentation provides a reference to the retrieveTag method. This belongs to the Product Module. + +This method is used to retrieve a tag by its ID. + +## Example + +A simple example that retrieves a product tag by its ID: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTag (tagId: string) { + const productModule = await initializeProductModule() + + const productTag = await productModule.retrieveTag(tagId) + + // do something with the product tag or return it +} +``` + +To specify relations that should be retrieved: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTag (tagId: string) { + const productModule = await initializeProductModule() + + const productTag = await productModule.retrieveTag(tagId, { + relations: ["products"] + }) + + // do something with the product tag or return it +} +``` + +## Parameters + +", + "description": "The configurations determining how the product tag is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product tag.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "order", + "type": "`object`", + "description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "relations", + "type": "`string`[]", + "description": "An array of strings, each being relation names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "select", + "type": "(`string` \\| keyof `Entity`)[]", + "description": "An array of strings, each being attribute names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "A number indicating the number of records to skip before retrieving the results.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "A number indicating the number of records to return in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "withDeleted", + "type": "`boolean`", + "description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The retrieved product tag.", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](../../interfaces/ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "categories", + "type": "``null`` \\| [`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)[]", + "description": "The associated product categories. It may only be available if the `categories` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection", + "type": "[`ProductCollectionDTO`](../../interfaces/ProductCollectionDTO.mdx)", + "description": "The associated product collection. It may only be available if the `collection` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product was created.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "``null`` \\| `string`", + "description": "The description of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discountable", + "type": "`boolean`", + "description": "Whether the product can be discounted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "external_id", + "type": "``null`` \\| `string`", + "description": "The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain a reference to the ID in the integrated service.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "``null`` \\| `string`", + "description": "The handle of the product. The handle can be used to create slug URL paths. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "images", + "type": "[`ProductImageDTO`](../../interfaces/ProductImageDTO.mdx)[]", + "description": "The associated product images. It may only be available if the `images` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_giftcard", + "type": "`boolean`", + "description": "Whether the product is a gift card.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](../../interfaces/ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../../enums/ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../../enums/ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](../../interfaces/ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](../../interfaces/ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](../../interfaces/ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveType.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveType.mdx new file mode 100644 index 0000000000..b538e73780 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveType.mdx @@ -0,0 +1,217 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/retrieveType +sidebar_label: retrieveType +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# retrieveType - Product Module Reference + +This documentation provides a reference to the retrieveType method. This belongs to the Product Module. + +This method is used to retrieve a product type by its ID. + +## Example + +A simple example that retrieves a product type by its ID: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductType (id: string) { + const productModule = await initializeProductModule() + + const productType = await productModule.retrieveType(id) + + // do something with the product type or return it +} +``` + +To specify attributes that should be retrieved: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductType (id: string) { + const productModule = await initializeProductModule() + + const productType = await productModule.retrieveType(id, { + select: ["value"] + }) + + // do something with the product type or return it +} +``` + +## Parameters + +", + "description": "The configurations determining how the product type is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product type.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "order", + "type": "`object`", + "description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "relations", + "type": "`string`[]", + "description": "An array of strings, each being relation names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "select", + "type": "(`string` \\| keyof `Entity`)[]", + "description": "An array of strings, each being attribute names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "A number indicating the number of records to skip before retrieving the results.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "A number indicating the number of records to return in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "withDeleted", + "type": "`boolean`", + "description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The retrieved product type.", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product type was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveVariant.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveVariant.mdx new file mode 100644 index 0000000000..82e2aad066 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.retrieveVariant.mdx @@ -0,0 +1,667 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/retrieveVariant +sidebar_label: retrieveVariant +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# retrieveVariant - Product Module Reference + +This documentation provides a reference to the retrieveVariant method. This belongs to the Product Module. + +This method is used to retrieve a product variant by its ID. + +## Example + +A simple example that retrieves a product variant by its ID: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductVariant (id: string) { + const productModule = await initializeProductModule() + + const variant = await productModule.retrieveVariant(id) + + // do something with the product variant or return it +} +``` + +To specify relations that should be retrieved: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductVariant (id: string) { + const productModule = await initializeProductModule() + + const variant = await productModule.retrieveVariant(id, { + relations: ["options"] + }) + + // do something with the product variant or return it +} +``` + +## Parameters + +", + "description": "The configurations determining how the product variant is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product variant.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "order", + "type": "`object`", + "description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "relations", + "type": "`string`[]", + "description": "An array of strings, each being relation names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "select", + "type": "(`string` \\| keyof `Entity`)[]", + "description": "An array of strings, each being attribute names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "A number indicating the number of records to skip before retrieving the results.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "A number indicating the number of records to return in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "withDeleted", + "type": "`boolean`", + "description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The retrieved product variant.", + "children": [ + { + "name": "allow_backorder", + "type": "`boolean`", + "description": "Whether the product variant can be ordered when it's out of stock.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "barcode", + "type": "``null`` \\| `string`", + "description": "The barcode of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was deleted.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "ean", + "type": "``null`` \\| `string`", + "description": "The EAN of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "inventory_quantity", + "type": "`number`", + "description": "The inventory quantiy of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manage_inventory", + "type": "`boolean`", + "description": "Whether the product variant's inventory should be managed by the core system.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionValueDTO`](../../interfaces/ProductOptionValueDTO.mdx)", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option value was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option value.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "option", + "type": "[`ProductOptionDTO`](../../interfaces/ProductOptionDTO.mdx)", + "description": "The associated product option. It may only be available if the `option` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product option value.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant", + "type": "[`ProductVariantDTO`](../../interfaces/ProductVariantDTO.mdx)", + "description": "The associated product variant. It may only be available if the `variant` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](../../interfaces/ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "categories", + "type": "``null`` \\| [`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)[]", + "description": "The associated product categories. It may only be available if the `categories` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection", + "type": "[`ProductCollectionDTO`](../../interfaces/ProductCollectionDTO.mdx)", + "description": "The associated product collection. It may only be available if the `collection` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product was created.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "``null`` \\| `string`", + "description": "The description of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discountable", + "type": "`boolean`", + "description": "Whether the product can be discounted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "external_id", + "type": "``null`` \\| `string`", + "description": "The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain a reference to the ID in the integrated service.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "``null`` \\| `string`", + "description": "The handle of the product. The handle can be used to create slug URL paths. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "images", + "type": "[`ProductImageDTO`](../../interfaces/ProductImageDTO.mdx)[]", + "description": "The associated product images. It may only be available if the `images` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_giftcard", + "type": "`boolean`", + "description": "Whether the product is a gift card.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](../../interfaces/ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../../enums/ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../../enums/ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](../../interfaces/ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](../../interfaces/ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](../../interfaces/ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "product_id", + "type": "`string`", + "description": "The ID of the associated product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "``null`` \\| `string`", + "description": "The SKU of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The tile of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "``null`` \\| `string`", + "description": "The UPC of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was updated.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant_rank", + "type": "``null`` \\| `number`", + "description": "The ranking of the variant among other variants associated with the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "The width of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.softDelete.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.softDelete.mdx new file mode 100644 index 0000000000..2a2c857fd4 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.softDelete.mdx @@ -0,0 +1,135 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/softDelete +sidebar_label: softDelete +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# softDelete - Product Module Reference + +This documentation provides a reference to the softDelete method. This belongs to the Product Module. + +This method is used to delete products. Unlike the [delete](IProductModuleService.delete.mdx) method, this method won't completely remove the product. It can still be accessed or retrieved using methods like [retrieve](IProductModuleService.retrieve.mdx) if you pass the `withDeleted` property to the `config` object parameter. + +The soft-deleted products can be restored using the [restore](IProductModuleService.restore.mdx) method. + +## Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function deleteProducts (ids: string[]) { + const productModule = await initializeProductModule() + + const cascadedEntities = await productModule.softDelete(ids) + + // do something with the returned cascaded entity IDs or return them +} +``` + +## Parameters + +", + "description": "Configurations determining which relations to soft delete along with the each of the products. You can pass to its `returnLinkableKeys` property any of the product's relation attribute names, such as `variant_id`.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "returnLinkableKeys", + "type": "`TReturnableLinkableKeys`[]", + "description": "An array of strings, each being the ID attribute names of the entity's relations.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +\\>", + "optional": false, + "defaultValue": "", + "description": "An object that includes the IDs of related records that were also soft deleted, such as the ID of associated product variants. The object's keys are the ID attribute names of the product entity's relations, such as `variant_id`, and its value is an array of strings, each being the ID of a record associated with the product through this relation, such as the IDs of associated product variants.\n\nIf there are no related records, the promise resolved to `void`.", + "children": [ + { + "name": "void \\| Record", + "type": "`void` \\| Record<`string`, `string`[]\\>", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.update.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.update.mdx new file mode 100644 index 0000000000..335d5b4ab3 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.update.mdx @@ -0,0 +1,647 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/update +sidebar_label: update +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# update - Product Module Reference + +This documentation provides a reference to the update method. This belongs to the Product Module. + +This method is used to update a product. + +## Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function updateProduct (id: string, title: string) { + const productModule = await initializeProductModule() + + const products = await productModule.update([ + { + id, + title + } + ]) + + // do something with the products or return them +} +``` + +## Parameters + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "`string`", + "description": "The MID Code of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`CreateProductOptionDTO`](../../interfaces/CreateProductOptionDTO.mdx)[]", + "description": "The product options to be created and associated with the product.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "product_id", + "type": "`string`", + "description": "The ID of the associated product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The product option's title.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "origin_country", + "type": "`string`", + "description": "The origin country of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../../enums/ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../../enums/ProductStatus.mdx).", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "DRAFT", + "type": "``\"draft\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "PROPOSED", + "type": "``\"proposed\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "PUBLISHED", + "type": "``\"published\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "REJECTED", + "type": "``\"rejected\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "subtitle", + "type": "`string`", + "description": "The subttle of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`CreateProductTagDTO`](../../interfaces/CreateProductTagDTO.mdx)[]", + "description": "The product tags to be created and associated with the product.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "value", + "type": "`string`", + "description": "The value of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "thumbnail", + "type": "`string`", + "description": "The URL of the product's thumbnail.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`CreateProductTypeDTO`](../../interfaces/CreateProductTypeDTO.mdx)", + "description": "The product type to create and associate with the product.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The product type's ID.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The product type's value.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "type_id", + "type": "``null`` \\| `string`", + "description": "The product type to be associated with the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "([`CreateProductVariantDTO`](../../interfaces/CreateProductVariantDTO.mdx) \\| [`UpdateProductVariantDTO`](../../interfaces/UpdateProductVariantDTO.mdx))[]", + "description": "The product variants to be created and associated with the product. You can also update existing product variants associated with the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "`number`", + "description": "The weight of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "`number`", + "description": "The width of the product.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of updated products.", + "children": [ + { + "name": "ProductDTO[]", + "type": "[`ProductDTO`](../../interfaces/ProductDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "categories", + "type": "``null`` \\| [`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)[]", + "description": "The associated product categories. It may only be available if the `categories` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection", + "type": "[`ProductCollectionDTO`](../../interfaces/ProductCollectionDTO.mdx)", + "description": "The associated product collection. It may only be available if the `collection` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product was created.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "``null`` \\| `string`", + "description": "The description of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discountable", + "type": "`boolean`", + "description": "Whether the product can be discounted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "external_id", + "type": "``null`` \\| `string`", + "description": "The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain a reference to the ID in the integrated service.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "``null`` \\| `string`", + "description": "The handle of the product. The handle can be used to create slug URL paths. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "images", + "type": "[`ProductImageDTO`](../../interfaces/ProductImageDTO.mdx)[]", + "description": "The associated product images. It may only be available if the `images` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_giftcard", + "type": "`boolean`", + "description": "Whether the product is a gift card.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](../../interfaces/ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../../enums/ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../../enums/ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](../../interfaces/ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](../../interfaces/ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](../../interfaces/ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.updateCategory.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.updateCategory.mdx new file mode 100644 index 0000000000..69beb3d06d --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.updateCategory.mdx @@ -0,0 +1,441 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/updateCategory +sidebar_label: updateCategory +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# updateCategory - Product Module Reference + +This documentation provides a reference to the updateCategory method. This belongs to the Product Module. + +This method is used to update a product category by its ID. + +## Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function updateCategory (id: string, name: string) { + const productModule = await initializeProductModule() + + const category = await productModule.updateCategory(id, { + name, + }) + + // do something with the product category or return it +} +``` + +## Parameters + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the product category.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category_id", + "type": "``null`` \\| `string`", + "description": "The ID of the parent product category, if it has any. It may also be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rank", + "type": "`number`", + "description": "The ranking of the category among sibling categories.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The updated product category.", + "children": [ + { + "name": "category_children", + "type": "[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)[]", + "description": "The associated child categories. It may only be available if the `category_children` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "category_children", + "type": "[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)[]", + "description": "The associated child categories. It may only be available if the `category_children` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product category was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "`string`", + "description": "The description of the product category.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product category. The handle can be used to create slug URL paths.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_active", + "type": "`boolean`", + "description": "Whether the product category is active.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "is_internal", + "type": "`boolean`", + "description": "Whether the product category is internal. This can be used to only show the product category to admins and hide it from customers.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category", + "type": "[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)", + "description": "The associated parent category. It may only be available if the `parent_category` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rank", + "type": "`number`", + "description": "The ranking of the product category among sibling categories.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product category was updated.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product category was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "`string`", + "description": "The description of the product category.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product category. The handle can be used to create slug URL paths.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_active", + "type": "`boolean`", + "description": "Whether the product category is active.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "is_internal", + "type": "`boolean`", + "description": "Whether the product category is internal. This can be used to only show the product category to admins and hide it from customers.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category", + "type": "[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)", + "description": "The associated parent category. It may only be available if the `parent_category` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "category_children", + "type": "[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)[]", + "description": "The associated child categories. It may only be available if the `category_children` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product category was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "`string`", + "description": "The description of the product category.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product category. The handle can be used to create slug URL paths.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_active", + "type": "`boolean`", + "description": "Whether the product category is active.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "is_internal", + "type": "`boolean`", + "description": "Whether the product category is internal. This can be used to only show the product category to admins and hide it from customers.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category", + "type": "[`ProductCategoryDTO`](../../interfaces/ProductCategoryDTO.mdx)", + "description": "The associated parent category. It may only be available if the `parent_category` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rank", + "type": "`number`", + "description": "The ranking of the product category among sibling categories.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product category was updated.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "rank", + "type": "`number`", + "description": "The ranking of the product category among sibling categories.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product category was updated.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.updateCollections.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.updateCollections.mdx new file mode 100644 index 0000000000..d590269443 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.updateCollections.mdx @@ -0,0 +1,219 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/updateCollections +sidebar_label: updateCollections +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# updateCollections - Product Module Reference + +This documentation provides a reference to the updateCollections method. This belongs to the Product Module. + +This method is used to update existing product collections. + +## Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function updateCollection (id: string, title: string) { + const productModule = await initializeProductModule() + + const collections = await productModule.updateCollections([ + { + id, + title + } + ]) + + // do something with the product collections or return them +} +``` + +## Parameters + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product_ids", + "type": "`string`[]", + "description": "The IDs of the products to associate with the product collection.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product collection.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product collection.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of updated product collections.", + "children": [ + { + "name": "ProductCollectionDTO[]", + "type": "[`ProductCollectionDTO`](../../interfaces/ProductCollectionDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product collection was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product collection. The handle can be used to create slug URL paths.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](../../interfaces/ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.updateOptions.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.updateOptions.mdx new file mode 100644 index 0000000000..9a433c562c --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.updateOptions.mdx @@ -0,0 +1,195 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/updateOptions +sidebar_label: updateOptions +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# updateOptions - Product Module Reference + +This documentation provides a reference to the updateOptions method. This belongs to the Product Module. + +This method is used to update existing product options. + +## Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function updateProductOption (id: string, title: string) { + const productModule = await initializeProductModule() + + const productOptions = await productModule.updateOptions([ + { + id, + title + } + ]) + + // do something with the product options or return them +} +``` + +## Parameters + + + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of updated product options.", + "children": [ + { + "name": "ProductOptionDTO[]", + "type": "[`ProductOptionDTO`](../../interfaces/ProductOptionDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](../../interfaces/ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "values", + "type": "[`ProductOptionValueDTO`](../../interfaces/ProductOptionValueDTO.mdx)[]", + "description": "The associated product option values. It may only be available if the `values` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.updateTags.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.updateTags.mdx new file mode 100644 index 0000000000..e66e6ee9c7 --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.updateTags.mdx @@ -0,0 +1,171 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/updateTags +sidebar_label: updateTags +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# updateTags - Product Module Reference + +This documentation provides a reference to the updateTags method. This belongs to the Product Module. + +This method is used to update existing product tags. + +## Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function updateProductTag (id: string, value: string) { + const productModule = await initializeProductModule() + + const productTags = await productModule.updateTags([ + { + id, + value + } + ]) + + // do something with the product tags or return them +} +``` + +## Parameters + + + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of updated product tags.", + "children": [ + { + "name": "ProductTagDTO[]", + "type": "[`ProductTagDTO`](../../interfaces/ProductTagDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](../../interfaces/ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.updateTypes.mdx b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.updateTypes.mdx new file mode 100644 index 0000000000..0272e0fd8b --- /dev/null +++ b/www/apps/docs/content/references/product/IProductModuleService/methods/IProductModuleService.updateTypes.mdx @@ -0,0 +1,179 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product/updateTypes +sidebar_label: updateTypes +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# updateTypes - Product Module Reference + +This documentation provides a reference to the updateTypes method. This belongs to the Product Module. + +This method is used to update a product type + +## Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function updateProductType (id: string, value: string) { + const productModule = await initializeProductModule() + + const productTypes = await productModule.updateTypes([ + { + id, + value + } + ]) + + // do something with the product types or return them +} +``` + +## Parameters + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The new value of the product type.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of updated product types.", + "children": [ + { + "name": "ProductTypeDTO[]", + "type": "[`ProductTypeDTO`](../../interfaces/ProductTypeDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product type was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/IterableIterator/methods/IterableIterator._iterator_.mdx b/www/apps/docs/content/references/product/IterableIterator/methods/IterableIterator._iterator_.mdx new file mode 100644 index 0000000000..5f344d8dce --- /dev/null +++ b/www/apps/docs/content/references/product/IterableIterator/methods/IterableIterator._iterator_.mdx @@ -0,0 +1,26 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# [iterator] + +[IterableIterator](../../interfaces/IterableIterator.mdx).[iterator] + +**[iterator]**(): [`IterableIterator`](../../interfaces/IterableIterator.mdx)<`T`\> + +#### Returns + +[`IterableIterator`](../../interfaces/IterableIterator.mdx)<`T`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/IterableIterator/methods/IterableIterator.next.mdx b/www/apps/docs/content/references/product/IterableIterator/methods/IterableIterator.next.mdx new file mode 100644 index 0000000000..b30720a5af --- /dev/null +++ b/www/apps/docs/content/references/product/IterableIterator/methods/IterableIterator.next.mdx @@ -0,0 +1,52 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# next + +[IterableIterator](../../interfaces/IterableIterator.mdx).next + +**next**(`...args`): [`IteratorResult`](../../types/IteratorResult.mdx)<`T`, `any`\> + +#### Parameters + + + +#### Returns + +[`IteratorResult`](../../types/IteratorResult.mdx)<`T`, `any`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "any", + "type": "`any`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +#### Inherited from + +[Iterator](../../interfaces/Iterator.mdx).[next](../../Iterator/methods/Iterator.next.mdx) diff --git a/www/apps/docs/content/references/product/IterableIterator/methods/IterableIterator.return.mdx b/www/apps/docs/content/references/product/IterableIterator/methods/IterableIterator.return.mdx new file mode 100644 index 0000000000..586920af46 --- /dev/null +++ b/www/apps/docs/content/references/product/IterableIterator/methods/IterableIterator.return.mdx @@ -0,0 +1,52 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# return + +[IterableIterator](../../interfaces/IterableIterator.mdx).return + +`Optional` **return**(`value?`): [`IteratorResult`](../../types/IteratorResult.mdx)<`T`, `any`\> + +#### Parameters + + + +#### Returns + +[`IteratorResult`](../../types/IteratorResult.mdx)<`T`, `any`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "any", + "type": "`any`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +#### Inherited from + +[Iterator](../../interfaces/Iterator.mdx).[return](../../Iterator/methods/Iterator.return.mdx) diff --git a/www/apps/docs/content/references/product/IterableIterator/methods/IterableIterator.throw.mdx b/www/apps/docs/content/references/product/IterableIterator/methods/IterableIterator.throw.mdx new file mode 100644 index 0000000000..050f9c38f9 --- /dev/null +++ b/www/apps/docs/content/references/product/IterableIterator/methods/IterableIterator.throw.mdx @@ -0,0 +1,52 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# throw + +[IterableIterator](../../interfaces/IterableIterator.mdx).throw + +`Optional` **throw**(`e?`): [`IteratorResult`](../../types/IteratorResult.mdx)<`T`, `any`\> + +#### Parameters + + + +#### Returns + +[`IteratorResult`](../../types/IteratorResult.mdx)<`T`, `any`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "any", + "type": "`any`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +#### Inherited from + +[Iterator](../../interfaces/Iterator.mdx).[throw](../../Iterator/methods/Iterator.throw.mdx) diff --git a/www/apps/docs/content/references/product/Iterator/methods/Iterator.next.mdx b/www/apps/docs/content/references/product/Iterator/methods/Iterator.next.mdx new file mode 100644 index 0000000000..3a898dba7b --- /dev/null +++ b/www/apps/docs/content/references/product/Iterator/methods/Iterator.next.mdx @@ -0,0 +1,39 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# next + +[Iterator](../../interfaces/Iterator.mdx).next + +**next**(`...args`): [`IteratorResult`](../../types/IteratorResult.mdx)<`T`, `TReturn`\> + +#### Parameters + + + +#### Returns + +[`IteratorResult`](../../types/IteratorResult.mdx)<`T`, `TReturn`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/Iterator/methods/Iterator.return.mdx b/www/apps/docs/content/references/product/Iterator/methods/Iterator.return.mdx new file mode 100644 index 0000000000..e6194eb8c8 --- /dev/null +++ b/www/apps/docs/content/references/product/Iterator/methods/Iterator.return.mdx @@ -0,0 +1,39 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# return + +[Iterator](../../interfaces/Iterator.mdx).return + +`Optional` **return**(`value?`): [`IteratorResult`](../../types/IteratorResult.mdx)<`T`, `TReturn`\> + +#### Parameters + + + +#### Returns + +[`IteratorResult`](../../types/IteratorResult.mdx)<`T`, `TReturn`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/Iterator/methods/Iterator.throw.mdx b/www/apps/docs/content/references/product/Iterator/methods/Iterator.throw.mdx new file mode 100644 index 0000000000..22b5ec6445 --- /dev/null +++ b/www/apps/docs/content/references/product/Iterator/methods/Iterator.throw.mdx @@ -0,0 +1,39 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# throw + +[Iterator](../../interfaces/Iterator.mdx).throw + +`Optional` **throw**(`e?`): [`IteratorResult`](../../types/IteratorResult.mdx)<`T`, `TReturn`\> + +#### Parameters + + + +#### Returns + +[`IteratorResult`](../../types/IteratorResult.mdx)<`T`, `TReturn`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/SharedArrayBuffer/methods/SharedArrayBuffer.slice.mdx b/www/apps/docs/content/references/product/SharedArrayBuffer/methods/SharedArrayBuffer.slice.mdx new file mode 100644 index 0000000000..7b7be3192f --- /dev/null +++ b/www/apps/docs/content/references/product/SharedArrayBuffer/methods/SharedArrayBuffer.slice.mdx @@ -0,0 +1,99 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# slice + +[SharedArrayBuffer](../../interfaces/SharedArrayBuffer.mdx).slice + +**slice**(`begin`, `end?`): [`SharedArrayBuffer`](../../variables/SharedArrayBuffer-1.mdx) + +Returns a section of an SharedArrayBuffer. + +#### Parameters + + + +#### Returns + +[`SharedArrayBuffer`](../../variables/SharedArrayBuffer-1.mdx) + + [`SharedArrayBuffer`](../../variables/SharedArrayBuffer-1.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "prototype", + "type": "[`SharedArrayBuffer`](../../variables/SharedArrayBuffer-1.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "[species]", + "type": "[`SharedArrayBuffer`](../../variables/SharedArrayBuffer-1.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "[toStringTag]", + "type": "``\"SharedArrayBuffer\"``", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "byteLength", + "type": "`number`", + "description": "Read-only. The length of the ArrayBuffer (in bytes).", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "slice", + "type": "(`begin`: `number`, `end?`: `number`) => [`SharedArrayBuffer`](../../variables/SharedArrayBuffer-1.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/enums/ProductStatus.mdx b/www/apps/docs/content/references/product/enums/ProductStatus.mdx new file mode 100644 index 0000000000..45d8ce09c1 --- /dev/null +++ b/www/apps/docs/content/references/product/enums/ProductStatus.mdx @@ -0,0 +1,31 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ProductStatus + +## Enumeration Members + +### DRAFT + + **DRAFT** = ``"draft"`` + +___ + +### PROPOSED + + **PROPOSED** = ``"proposed"`` + +___ + +### PUBLISHED + + **PUBLISHED** = ``"published"`` + +___ + +### REJECTED + + **REJECTED** = ``"rejected"`` diff --git a/www/apps/docs/content/references/product/index.md b/www/apps/docs/content/references/product/index.md new file mode 100644 index 0000000000..b93f559fbc --- /dev/null +++ b/www/apps/docs/content/references/product/index.md @@ -0,0 +1,95 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Product Module Reference Reference + +## Enumerations + +- [ProductStatus](enums/ProductStatus.mdx) + +## Interfaces + +- [ArrayLike](interfaces/ArrayLike.mdx) +- [BaseFilterable](interfaces/BaseFilterable.mdx) +- [Buffer](interfaces/Buffer.mdx) +- [BufferConstructor](interfaces/BufferConstructor.mdx) +- [Context](interfaces/Context.mdx) +- [CreateProductCategoryDTO](interfaces/CreateProductCategoryDTO.mdx) +- [CreateProductCollectionDTO](interfaces/CreateProductCollectionDTO.mdx) +- [CreateProductDTO](interfaces/CreateProductDTO.mdx) +- [CreateProductOptionDTO](interfaces/CreateProductOptionDTO.mdx) +- [CreateProductTagDTO](interfaces/CreateProductTagDTO.mdx) +- [CreateProductTypeDTO](interfaces/CreateProductTypeDTO.mdx) +- [CreateProductVariantDTO](interfaces/CreateProductVariantDTO.mdx) +- [CreateProductVariantOptionDTO](interfaces/CreateProductVariantOptionDTO.mdx) +- [FilterableProductCategoryProps](interfaces/FilterableProductCategoryProps.mdx) +- [FilterableProductCollectionProps](interfaces/FilterableProductCollectionProps.mdx) +- [FilterableProductOptionProps](interfaces/FilterableProductOptionProps.mdx) +- [FilterableProductProps](interfaces/FilterableProductProps.mdx) +- [FilterableProductTagProps](interfaces/FilterableProductTagProps.mdx) +- [FilterableProductTypeProps](interfaces/FilterableProductTypeProps.mdx) +- [FilterableProductVariantProps](interfaces/FilterableProductVariantProps.mdx) +- [FindConfig](interfaces/FindConfig.mdx) +- [IProductModuleService](interfaces/IProductModuleService.mdx) +- [IterableIterator](interfaces/IterableIterator.mdx) +- [Iterator](interfaces/Iterator.mdx) +- [IteratorReturnResult](interfaces/IteratorReturnResult.mdx) +- [IteratorYieldResult](interfaces/IteratorYieldResult.mdx) +- [JoinerServiceConfig](interfaces/JoinerServiceConfig.mdx) +- [JoinerServiceConfigAlias](interfaces/JoinerServiceConfigAlias.mdx) +- [ProductCategoryDTO](interfaces/ProductCategoryDTO.mdx) +- [ProductCollectionDTO](interfaces/ProductCollectionDTO.mdx) +- [ProductDTO](interfaces/ProductDTO.mdx) +- [ProductImageDTO](interfaces/ProductImageDTO.mdx) +- [ProductOptionDTO](interfaces/ProductOptionDTO.mdx) +- [ProductOptionValueDTO](interfaces/ProductOptionValueDTO.mdx) +- [ProductTagDTO](interfaces/ProductTagDTO.mdx) +- [ProductTypeDTO](interfaces/ProductTypeDTO.mdx) +- [ProductVariantDTO](interfaces/ProductVariantDTO.mdx) +- [RestoreReturn](interfaces/RestoreReturn.mdx) +- [SharedArrayBuffer](interfaces/SharedArrayBuffer.mdx) +- [SharedArrayBufferConstructor](interfaces/SharedArrayBufferConstructor.mdx) +- [SoftDeleteReturn](interfaces/SoftDeleteReturn.mdx) +- [UpdateProductCategoryDTO](interfaces/UpdateProductCategoryDTO.mdx) +- [UpdateProductCollectionDTO](interfaces/UpdateProductCollectionDTO.mdx) +- [UpdateProductDTO](interfaces/UpdateProductDTO.mdx) +- [UpdateProductOptionDTO](interfaces/UpdateProductOptionDTO.mdx) +- [UpdateProductTagDTO](interfaces/UpdateProductTagDTO.mdx) +- [UpdateProductTypeDTO](interfaces/UpdateProductTypeDTO.mdx) +- [UpdateProductVariantDTO](interfaces/UpdateProductVariantDTO.mdx) + +## Type Aliases + +- [ArrayBufferLike](types/ArrayBufferLike.mdx) +- [ArrayBufferView](types/ArrayBufferView.mdx) +- [BufferEncoding](types/BufferEncoding.mdx) +- [Exclude](types/Exclude.mdx) +- [ExpandScalar](types/ExpandScalar.mdx) +- [FilterQuery](types/FilterQuery.mdx) +- [FilterValue](types/FilterValue.mdx) +- [FilterValue2](types/FilterValue2.mdx) +- [IteratorResult](types/IteratorResult.mdx) +- [JoinerRelationship](types/JoinerRelationship.mdx) +- [ModuleJoinerConfig](types/ModuleJoinerConfig.mdx) +- [ModuleJoinerRelationship](types/ModuleJoinerRelationship.mdx) +- [Omit](types/Omit.mdx) +- [OperatorMap](types/OperatorMap.mdx) +- [Partial](types/Partial.mdx) +- [Pick](types/Pick.mdx) +- [PrevLimit](types/PrevLimit.mdx) +- [Primary](types/Primary.mdx) +- [Query](types/Query.mdx) +- [Readonly](types/Readonly.mdx) +- [ReadonlyPrimary](types/ReadonlyPrimary.mdx) +- [Record](types/Record.mdx) +- [Scalar](types/Scalar.mdx) +- [TypedArray](types/TypedArray.mdx) +- [WithImplicitCoercion](types/WithImplicitCoercion.mdx) + +## Variables + +- [Buffer](variables/Buffer-1.mdx) +- [SharedArrayBuffer](variables/SharedArrayBuffer-1.mdx) diff --git a/www/apps/docs/content/references/product/interfaces/ArrayLike.mdx b/www/apps/docs/content/references/product/interfaces/ArrayLike.mdx new file mode 100644 index 0000000000..f2f09122d2 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/ArrayLike.mdx @@ -0,0 +1,37 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ArrayLike + +## Type parameters + + + +## Indexable + +▪ [n: `number`]: `T` + +## Properties + + diff --git a/www/apps/docs/content/references/product/interfaces/BaseFilterable.mdx b/www/apps/docs/content/references/product/interfaces/BaseFilterable.mdx new file mode 100644 index 0000000000..1d31bd59c4 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/BaseFilterable.mdx @@ -0,0 +1,43 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# BaseFilterable + +An object used to allow specifying flexible queries with and/or conditions. + +## Type parameters + + + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "(`T` \\| [`BaseFilterable`](BaseFilterable.mdx)<`T`\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/Buffer.mdx b/www/apps/docs/content/references/product/interfaces/Buffer.mdx new file mode 100644 index 0000000000..9956b363d6 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/Buffer.mdx @@ -0,0 +1,161 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Buffer + +## Methods + +- [[iterator]](../Buffer/methods/Buffer._iterator_.mdx) +- [at](../Buffer/methods/Buffer.at.mdx) +- [compare](../Buffer/methods/Buffer.compare.mdx) +- [copy](../Buffer/methods/Buffer.copy.mdx) +- [copyWithin](../Buffer/methods/Buffer.copyWithin.mdx) +- [entries](../Buffer/methods/Buffer.entries.mdx) +- [equals](../Buffer/methods/Buffer.equals.mdx) +- [every](../Buffer/methods/Buffer.every.mdx) +- [fill](../Buffer/methods/Buffer.fill.mdx) +- [filter](../Buffer/methods/Buffer.filter.mdx) +- [find](../Buffer/methods/Buffer.find.mdx) +- [findIndex](../Buffer/methods/Buffer.findIndex.mdx) +- [forEach](../Buffer/methods/Buffer.forEach.mdx) +- [includes](../Buffer/methods/Buffer.includes.mdx) +- [indexOf](../Buffer/methods/Buffer.indexOf.mdx) +- [join](../Buffer/methods/Buffer.join.mdx) +- [keys](../Buffer/methods/Buffer.keys.mdx) +- [lastIndexOf](../Buffer/methods/Buffer.lastIndexOf.mdx) +- [map](../Buffer/methods/Buffer.map.mdx) +- [readBigInt64BE](../Buffer/methods/Buffer.readBigInt64BE.mdx) +- [readBigInt64LE](../Buffer/methods/Buffer.readBigInt64LE.mdx) +- [readBigUInt64BE](../Buffer/methods/Buffer.readBigUInt64BE.mdx) +- [readBigUInt64LE](../Buffer/methods/Buffer.readBigUInt64LE.mdx) +- [readBigUint64BE](../Buffer/methods/Buffer.readBigUint64BE-1.mdx) +- [readBigUint64LE](../Buffer/methods/Buffer.readBigUint64LE-1.mdx) +- [readDoubleBE](../Buffer/methods/Buffer.readDoubleBE.mdx) +- [readDoubleLE](../Buffer/methods/Buffer.readDoubleLE.mdx) +- [readFloatBE](../Buffer/methods/Buffer.readFloatBE.mdx) +- [readFloatLE](../Buffer/methods/Buffer.readFloatLE.mdx) +- [readInt16BE](../Buffer/methods/Buffer.readInt16BE.mdx) +- [readInt16LE](../Buffer/methods/Buffer.readInt16LE.mdx) +- [readInt32BE](../Buffer/methods/Buffer.readInt32BE.mdx) +- [readInt32LE](../Buffer/methods/Buffer.readInt32LE.mdx) +- [readInt8](../Buffer/methods/Buffer.readInt8.mdx) +- [readIntBE](../Buffer/methods/Buffer.readIntBE.mdx) +- [readIntLE](../Buffer/methods/Buffer.readIntLE.mdx) +- [readUInt16BE](../Buffer/methods/Buffer.readUInt16BE.mdx) +- [readUInt16LE](../Buffer/methods/Buffer.readUInt16LE.mdx) +- [readUInt32BE](../Buffer/methods/Buffer.readUInt32BE.mdx) +- [readUInt32LE](../Buffer/methods/Buffer.readUInt32LE.mdx) +- [readUInt8](../Buffer/methods/Buffer.readUInt8.mdx) +- [readUIntBE](../Buffer/methods/Buffer.readUIntBE.mdx) +- [readUIntLE](../Buffer/methods/Buffer.readUIntLE.mdx) +- [readUint16BE](../Buffer/methods/Buffer.readUint16BE-1.mdx) +- [readUint16LE](../Buffer/methods/Buffer.readUint16LE-1.mdx) +- [readUint32BE](../Buffer/methods/Buffer.readUint32BE-1.mdx) +- [readUint32LE](../Buffer/methods/Buffer.readUint32LE-1.mdx) +- [readUint8](../Buffer/methods/Buffer.readUint8-1.mdx) +- [readUintBE](../Buffer/methods/Buffer.readUintBE-1.mdx) +- [readUintLE](../Buffer/methods/Buffer.readUintLE-1.mdx) +- [reduce](../Buffer/methods/Buffer.reduce.mdx) +- [reduceRight](../Buffer/methods/Buffer.reduceRight.mdx) +- [reverse](../Buffer/methods/Buffer.reverse.mdx) +- [set](../Buffer/methods/Buffer.set.mdx) +- [slice](../Buffer/methods/Buffer.slice.mdx) +- [some](../Buffer/methods/Buffer.some.mdx) +- [sort](../Buffer/methods/Buffer.sort.mdx) +- [subarray](../Buffer/methods/Buffer.subarray.mdx) +- [swap16](../Buffer/methods/Buffer.swap16.mdx) +- [swap32](../Buffer/methods/Buffer.swap32.mdx) +- [swap64](../Buffer/methods/Buffer.swap64.mdx) +- [toJSON](../Buffer/methods/Buffer.toJSON.mdx) +- [toLocaleString](../Buffer/methods/Buffer.toLocaleString.mdx) +- [toString](../Buffer/methods/Buffer.toString.mdx) +- [valueOf](../Buffer/methods/Buffer.valueOf.mdx) +- [values](../Buffer/methods/Buffer.values.mdx) +- [write](../Buffer/methods/Buffer.write.mdx) +- [writeBigInt64BE](../Buffer/methods/Buffer.writeBigInt64BE.mdx) +- [writeBigInt64LE](../Buffer/methods/Buffer.writeBigInt64LE.mdx) +- [writeBigUInt64BE](../Buffer/methods/Buffer.writeBigUInt64BE.mdx) +- [writeBigUInt64LE](../Buffer/methods/Buffer.writeBigUInt64LE.mdx) +- [writeBigUint64BE](../Buffer/methods/Buffer.writeBigUint64BE-1.mdx) +- [writeBigUint64LE](../Buffer/methods/Buffer.writeBigUint64LE-1.mdx) +- [writeDoubleBE](../Buffer/methods/Buffer.writeDoubleBE.mdx) +- [writeDoubleLE](../Buffer/methods/Buffer.writeDoubleLE.mdx) +- [writeFloatBE](../Buffer/methods/Buffer.writeFloatBE.mdx) +- [writeFloatLE](../Buffer/methods/Buffer.writeFloatLE.mdx) +- [writeInt16BE](../Buffer/methods/Buffer.writeInt16BE.mdx) +- [writeInt16LE](../Buffer/methods/Buffer.writeInt16LE.mdx) +- [writeInt32BE](../Buffer/methods/Buffer.writeInt32BE.mdx) +- [writeInt32LE](../Buffer/methods/Buffer.writeInt32LE.mdx) +- [writeInt8](../Buffer/methods/Buffer.writeInt8.mdx) +- [writeIntBE](../Buffer/methods/Buffer.writeIntBE.mdx) +- [writeIntLE](../Buffer/methods/Buffer.writeIntLE.mdx) +- [writeUInt16BE](../Buffer/methods/Buffer.writeUInt16BE.mdx) +- [writeUInt16LE](../Buffer/methods/Buffer.writeUInt16LE.mdx) +- [writeUInt32BE](../Buffer/methods/Buffer.writeUInt32BE.mdx) +- [writeUInt32LE](../Buffer/methods/Buffer.writeUInt32LE.mdx) +- [writeUInt8](../Buffer/methods/Buffer.writeUInt8.mdx) +- [writeUIntBE](../Buffer/methods/Buffer.writeUIntBE.mdx) +- [writeUIntLE](../Buffer/methods/Buffer.writeUIntLE.mdx) +- [writeUint16BE](../Buffer/methods/Buffer.writeUint16BE-1.mdx) +- [writeUint16LE](../Buffer/methods/Buffer.writeUint16LE-1.mdx) +- [writeUint32BE](../Buffer/methods/Buffer.writeUint32BE-1.mdx) +- [writeUint32LE](../Buffer/methods/Buffer.writeUint32LE-1.mdx) +- [writeUint8](../Buffer/methods/Buffer.writeUint8-1.mdx) +- [writeUintBE](../Buffer/methods/Buffer.writeUintBE-1.mdx) +- [writeUintLE](../Buffer/methods/Buffer.writeUintLE-1.mdx) + +## Properties + + diff --git a/www/apps/docs/content/references/product/interfaces/BufferConstructor.mdx b/www/apps/docs/content/references/product/interfaces/BufferConstructor.mdx new file mode 100644 index 0000000000..96e1fc0b55 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/BufferConstructor.mdx @@ -0,0 +1,1009 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# BufferConstructor + +Raw data is stored in instances of the Buffer class. +A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. +Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'base64url'|'binary'(deprecated)|'hex' + +## Methods + +- [alloc](../BufferConstructor/methods/BufferConstructor.alloc.mdx) +- [allocUnsafe](../BufferConstructor/methods/BufferConstructor.allocUnsafe.mdx) +- [allocUnsafeSlow](../BufferConstructor/methods/BufferConstructor.allocUnsafeSlow.mdx) +- [byteLength](../BufferConstructor/methods/BufferConstructor.byteLength.mdx) +- [compare](../BufferConstructor/methods/BufferConstructor.compare.mdx) +- [concat](../BufferConstructor/methods/BufferConstructor.concat.mdx) +- [from](../BufferConstructor/methods/BufferConstructor.from.mdx) +- [isBuffer](../BufferConstructor/methods/BufferConstructor.isBuffer.mdx) +- [isEncoding](../BufferConstructor/methods/BufferConstructor.isEncoding.mdx) +- [of](../BufferConstructor/methods/BufferConstructor.of.mdx) + +## Constructors + +### constructor + +**new BufferConstructor**(`str`, `encoding?`) + +Allocates a new buffer containing the given {str}. + +#### Parameters + + + +#### Deprecated + +since v10.0.0 - Use `Buffer.from(string[, encoding])` instead. + +**new BufferConstructor**(`size`) + +Allocates a new buffer of {size} octets. + +#### Parameters + + + +#### Deprecated + +since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`). + +**new BufferConstructor**(`array`) + +Allocates a new buffer containing the given {array} of octets. + +#### Parameters + + + +#### Deprecated + +since v10.0.0 - Use `Buffer.from(array)` instead. + +**new BufferConstructor**(`arrayBuffer`) + +Produces a Buffer backed by the same allocated memory as +the given {ArrayBuffer}/{SharedArrayBuffer}. + +#### Parameters + + + +#### Deprecated + +since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead. + +**new BufferConstructor**(`array`) + +Allocates a new buffer containing the given {array} of octets. + +#### Parameters + + + +#### Deprecated + +since v10.0.0 - Use `Buffer.from(array)` instead. + +**new BufferConstructor**(`buffer`) + +Copies the passed {buffer} data onto a new {Buffer} instance. + +#### Parameters + + [`IterableIterator`](IterableIterator.mdx)<`number`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "at", + "type": "(`index`: `number`) => `undefined` \\| `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "compare", + "type": "(`target`: `Uint8Array`, `targetStart?`: `number`, `targetEnd?`: `number`, `sourceStart?`: `number`, `sourceEnd?`: `number`) => ``0`` \\| ``1`` \\| ``-1``", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "copy", + "type": "(`target`: `Uint8Array`, `targetStart?`: `number`, `sourceStart?`: `number`, `sourceEnd?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "copyWithin", + "type": "(`target`: `number`, `start`: `number`, `end?`: `number`) => [`Buffer`](../variables/Buffer-1.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "entries", + "type": "() => [`IterableIterator`](IterableIterator.mdx)<[`number`, `number`]\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "equals", + "type": "(`otherBuffer`: `Uint8Array`) => `boolean`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "every", + "type": "(`predicate`: (`value`: `number`, `index`: `number`, `array`: `Uint8Array`) => `unknown`, `thisArg?`: `any`) => `boolean`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "fill", + "type": "(`value`: `string` \\| `number` \\| `Uint8Array`, `offset?`: `number`, `end?`: `number`, `encoding?`: [`BufferEncoding`](../types/BufferEncoding.mdx)) => [`Buffer`](../variables/Buffer-1.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "filter", + "type": "(`predicate`: (`value`: `number`, `index`: `number`, `array`: `Uint8Array`) => `any`, `thisArg?`: `any`) => `Uint8Array`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "find", + "type": "(`predicate`: (`value`: `number`, `index`: `number`, `obj`: `Uint8Array`) => `boolean`, `thisArg?`: `any`) => `undefined` \\| `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "findIndex", + "type": "(`predicate`: (`value`: `number`, `index`: `number`, `obj`: `Uint8Array`) => `boolean`, `thisArg?`: `any`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "forEach", + "type": "(`callbackfn`: (`value`: `number`, `index`: `number`, `array`: `Uint8Array`) => `void`, `thisArg?`: `any`) => `void`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "includes", + "type": "(`value`: `string` \\| `number` \\| [`Buffer`](../variables/Buffer-1.mdx), `byteOffset?`: `number`, `encoding?`: [`BufferEncoding`](../types/BufferEncoding.mdx)) => `boolean`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "indexOf", + "type": "(`value`: `string` \\| `number` \\| `Uint8Array`, `byteOffset?`: `number`, `encoding?`: [`BufferEncoding`](../types/BufferEncoding.mdx)) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "join", + "type": "(`separator?`: `string`) => `string`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "keys", + "type": "() => [`IterableIterator`](IterableIterator.mdx)<`number`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "lastIndexOf", + "type": "(`value`: `string` \\| `number` \\| `Uint8Array`, `byteOffset?`: `number`, `encoding?`: [`BufferEncoding`](../types/BufferEncoding.mdx)) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "map", + "type": "(`callbackfn`: (`value`: `number`, `index`: `number`, `array`: `Uint8Array`) => `number`, `thisArg?`: `any`) => `Uint8Array`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readBigInt64BE", + "type": "(`offset?`: `number`) => `bigint`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readBigInt64LE", + "type": "(`offset?`: `number`) => `bigint`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readBigUInt64BE", + "type": "(`offset?`: `number`) => `bigint`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readBigUInt64LE", + "type": "(`offset?`: `number`) => `bigint`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readBigUint64BE", + "type": "(`offset?`: `number`) => `bigint`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readBigUint64LE", + "type": "(`offset?`: `number`) => `bigint`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readDoubleBE", + "type": "(`offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readDoubleLE", + "type": "(`offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readFloatBE", + "type": "(`offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readFloatLE", + "type": "(`offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readInt16BE", + "type": "(`offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readInt16LE", + "type": "(`offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readInt32BE", + "type": "(`offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readInt32LE", + "type": "(`offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readInt8", + "type": "(`offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readIntBE", + "type": "(`offset`: `number`, `byteLength`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readIntLE", + "type": "(`offset`: `number`, `byteLength`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readUInt16BE", + "type": "(`offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readUInt16LE", + "type": "(`offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readUInt32BE", + "type": "(`offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readUInt32LE", + "type": "(`offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readUInt8", + "type": "(`offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readUIntBE", + "type": "(`offset`: `number`, `byteLength`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readUIntLE", + "type": "(`offset`: `number`, `byteLength`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readUint16BE", + "type": "(`offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readUint16LE", + "type": "(`offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readUint32BE", + "type": "(`offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readUint32LE", + "type": "(`offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readUint8", + "type": "(`offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readUintBE", + "type": "(`offset`: `number`, `byteLength`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "readUintLE", + "type": "(`offset`: `number`, `byteLength`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "reduce", + "type": "(`callbackfn`: (`previousValue`: `number`, `currentValue`: `number`, `currentIndex`: `number`, `array`: `Uint8Array`) => `number`) => `number`(`callbackfn`: (`previousValue`: `number`, `currentValue`: `number`, `currentIndex`: `number`, `array`: `Uint8Array`) => `number`, `initialValue`: `number`) => `number`(`callbackfn`: (`previousValue`: `U`, `currentValue`: `number`, `currentIndex`: `number`, `array`: `Uint8Array`) => `U`, `initialValue`: `U`) => `U`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "reduceRight", + "type": "(`callbackfn`: (`previousValue`: `number`, `currentValue`: `number`, `currentIndex`: `number`, `array`: `Uint8Array`) => `number`) => `number`(`callbackfn`: (`previousValue`: `number`, `currentValue`: `number`, `currentIndex`: `number`, `array`: `Uint8Array`) => `number`, `initialValue`: `number`) => `number`(`callbackfn`: (`previousValue`: `U`, `currentValue`: `number`, `currentIndex`: `number`, `array`: `Uint8Array`) => `U`, `initialValue`: `U`) => `U`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "reverse", + "type": "() => [`Buffer`](../variables/Buffer-1.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "set", + "type": "(`array`: [`ArrayLike`](ArrayLike.mdx)<`number`\\>, `offset?`: `number`) => `void`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "slice", + "type": "(`start?`: `number`, `end?`: `number`) => [`Buffer`](../variables/Buffer-1.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "some", + "type": "(`predicate`: (`value`: `number`, `index`: `number`, `array`: `Uint8Array`) => `unknown`, `thisArg?`: `any`) => `boolean`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "sort", + "type": "(`compareFn?`: (`a`: `number`, `b`: `number`) => `number`) => [`Buffer`](../variables/Buffer-1.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "subarray", + "type": "(`start?`: `number`, `end?`: `number`) => [`Buffer`](../variables/Buffer-1.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "swap16", + "type": "() => [`Buffer`](../variables/Buffer-1.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "swap32", + "type": "() => [`Buffer`](../variables/Buffer-1.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "swap64", + "type": "() => [`Buffer`](../variables/Buffer-1.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "toJSON", + "type": "() => { `data`: `number`[] ; `type`: ``\"Buffer\"`` }", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "toLocaleString", + "type": "() => `string`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "toString", + "type": "(`encoding?`: [`BufferEncoding`](../types/BufferEncoding.mdx), `start?`: `number`, `end?`: `number`) => `string`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "valueOf", + "type": "() => `Uint8Array`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "values", + "type": "() => [`IterableIterator`](IterableIterator.mdx)<`number`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "write", + "type": "(`string`: `string`, `encoding?`: [`BufferEncoding`](../types/BufferEncoding.mdx)) => `number`(`string`: `string`, `offset`: `number`, `encoding?`: [`BufferEncoding`](../types/BufferEncoding.mdx)) => `number`(`string`: `string`, `offset`: `number`, `length`: `number`, `encoding?`: [`BufferEncoding`](../types/BufferEncoding.mdx)) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeBigInt64BE", + "type": "(`value`: `bigint`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeBigInt64LE", + "type": "(`value`: `bigint`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeBigUInt64BE", + "type": "(`value`: `bigint`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeBigUInt64LE", + "type": "(`value`: `bigint`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeBigUint64BE", + "type": "(`value`: `bigint`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeBigUint64LE", + "type": "(`value`: `bigint`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeDoubleBE", + "type": "(`value`: `number`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeDoubleLE", + "type": "(`value`: `number`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeFloatBE", + "type": "(`value`: `number`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeFloatLE", + "type": "(`value`: `number`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeInt16BE", + "type": "(`value`: `number`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeInt16LE", + "type": "(`value`: `number`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeInt32BE", + "type": "(`value`: `number`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeInt32LE", + "type": "(`value`: `number`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeInt8", + "type": "(`value`: `number`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeIntBE", + "type": "(`value`: `number`, `offset`: `number`, `byteLength`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeIntLE", + "type": "(`value`: `number`, `offset`: `number`, `byteLength`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeUInt16BE", + "type": "(`value`: `number`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeUInt16LE", + "type": "(`value`: `number`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeUInt32BE", + "type": "(`value`: `number`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeUInt32LE", + "type": "(`value`: `number`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeUInt8", + "type": "(`value`: `number`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeUIntBE", + "type": "(`value`: `number`, `offset`: `number`, `byteLength`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeUIntLE", + "type": "(`value`: `number`, `offset`: `number`, `byteLength`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeUint16BE", + "type": "(`value`: `number`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeUint16LE", + "type": "(`value`: `number`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeUint32BE", + "type": "(`value`: `number`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeUint32LE", + "type": "(`value`: `number`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeUint8", + "type": "(`value`: `number`, `offset?`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeUintBE", + "type": "(`value`: `number`, `offset`: `number`, `byteLength`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "writeUintLE", + "type": "(`value`: `number`, `offset`: `number`, `byteLength`: `number`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +#### Deprecated + +since v10.0.0 - Use `Buffer.from(buffer)` instead. + +## Properties + + diff --git a/www/apps/docs/content/references/product/interfaces/Context.mdx b/www/apps/docs/content/references/product/interfaces/Context.mdx new file mode 100644 index 0000000000..b2ae1d2dd6 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/Context.mdx @@ -0,0 +1,69 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Context + +The interface tag is used to ensure that the type is documented similar to interfaces. + +A shared context object that is used to share resources between the application and the module. + +## Type parameters + + + +## Properties + + diff --git a/www/apps/docs/content/references/product/interfaces/CreateProductCategoryDTO.mdx b/www/apps/docs/content/references/product/interfaces/CreateProductCategoryDTO.mdx new file mode 100644 index 0000000000..10615c09ba --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/CreateProductCategoryDTO.mdx @@ -0,0 +1,70 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductCategoryDTO + +A product category to create. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The product category's name.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category_id", + "type": "``null`` \\| `string`", + "description": "The ID of the parent product category, if it has any. It may also be `null`.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rank", + "type": "`number`", + "description": "The ranking of the category among sibling categories.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/CreateProductCollectionDTO.mdx b/www/apps/docs/content/references/product/interfaces/CreateProductCollectionDTO.mdx new file mode 100644 index 0000000000..1411bbe62c --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/CreateProductCollectionDTO.mdx @@ -0,0 +1,46 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductCollectionDTO + +A product collection to create. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product_ids", + "type": "`string`[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The product collection's title.", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/CreateProductDTO.mdx b/www/apps/docs/content/references/product/interfaces/CreateProductDTO.mdx new file mode 100644 index 0000000000..b3fb1fc2d6 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/CreateProductDTO.mdx @@ -0,0 +1,452 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductDTO + +A product to create. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "`string`", + "description": "The MID Code of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`CreateProductOptionDTO`](CreateProductOptionDTO.mdx)[]", + "description": "The product options to be created and associated with the product.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "product_id", + "type": "`string`", + "description": "The ID of the associated product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The product option's title.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "origin_country", + "type": "`string`", + "description": "The origin country of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../enums/ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../enums/ProductStatus.mdx).", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "DRAFT", + "type": "``\"draft\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "PROPOSED", + "type": "``\"proposed\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "PUBLISHED", + "type": "``\"published\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "REJECTED", + "type": "``\"rejected\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "subtitle", + "type": "`string`", + "description": "The subttle of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`CreateProductTagDTO`](CreateProductTagDTO.mdx)[]", + "description": "The product tags to be created and associated with the product.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "value", + "type": "`string`", + "description": "The value of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "thumbnail", + "type": "`string`", + "description": "The URL of the product's thumbnail.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`CreateProductTypeDTO`](CreateProductTypeDTO.mdx)", + "description": "The product type to create and associate with the product.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The product type's ID.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The product type's value.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "type_id", + "type": "`string`", + "description": "The product type to be associated with the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`CreateProductVariantDTO`](CreateProductVariantDTO.mdx)[]", + "description": "The product variants to be created and associated with the product.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "allow_backorder", + "type": "`boolean`", + "description": "Whether the product variant can be ordered when it's out of stock.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "barcode", + "type": "`string`", + "description": "The barcode of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "ean", + "type": "`string`", + "description": "The EAN of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "`number`", + "description": "The height of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "`string`", + "description": "The HS Code of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "inventory_quantity", + "type": "`number`", + "description": "The inventory quantiy of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "`number`", + "description": "The length of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manage_inventory", + "type": "`boolean`", + "description": "Whether the product variant's inventory should be managed by the core system.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "`string`", + "description": "The material of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "`string`", + "description": "The MID Code of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`CreateProductVariantOptionDTO`](CreateProductVariantOptionDTO.mdx)[]", + "description": "The product variant options to create and associate with the product variant.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "value", + "type": "`string`", + "description": "The value of a product variant option.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "origin_country", + "type": "`string`", + "description": "The origin country of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "`string`", + "description": "The SKU of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The tile of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "`string`", + "description": "The UPC of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "`number`", + "description": "The weight of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "`number`", + "description": "The width of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "weight", + "type": "`number`", + "description": "The weight of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "`number`", + "description": "The width of the product.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/CreateProductOptionDTO.mdx b/www/apps/docs/content/references/product/interfaces/CreateProductOptionDTO.mdx new file mode 100644 index 0000000000..52b62d95a0 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/CreateProductOptionDTO.mdx @@ -0,0 +1,30 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductOptionDTO + +A product option to create. + +## Properties + + diff --git a/www/apps/docs/content/references/product/interfaces/CreateProductTagDTO.mdx b/www/apps/docs/content/references/product/interfaces/CreateProductTagDTO.mdx new file mode 100644 index 0000000000..456fc42bb1 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/CreateProductTagDTO.mdx @@ -0,0 +1,22 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductTagDTO + +A product tag to create. + +## Properties + + diff --git a/www/apps/docs/content/references/product/interfaces/CreateProductTypeDTO.mdx b/www/apps/docs/content/references/product/interfaces/CreateProductTypeDTO.mdx new file mode 100644 index 0000000000..a49c363270 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/CreateProductTypeDTO.mdx @@ -0,0 +1,38 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductTypeDTO + +A product type to create. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The product type's value.", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/CreateProductVariantDTO.mdx b/www/apps/docs/content/references/product/interfaces/CreateProductVariantDTO.mdx new file mode 100644 index 0000000000..ed77a4dd83 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/CreateProductVariantDTO.mdx @@ -0,0 +1,167 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductVariantDTO + +A product variant to create. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "`string`", + "description": "The MID Code of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`CreateProductVariantOptionDTO`](CreateProductVariantOptionDTO.mdx)[]", + "description": "The product variant options to create and associate with the product variant.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "value", + "type": "`string`", + "description": "The value of a product variant option.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "origin_country", + "type": "`string`", + "description": "The origin country of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "`string`", + "description": "The SKU of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The tile of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "`string`", + "description": "The UPC of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "`number`", + "description": "The weight of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "`number`", + "description": "The width of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/CreateProductVariantOptionDTO.mdx b/www/apps/docs/content/references/product/interfaces/CreateProductVariantOptionDTO.mdx new file mode 100644 index 0000000000..8ca73ea014 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/CreateProductVariantOptionDTO.mdx @@ -0,0 +1,22 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductVariantOptionDTO + +A product variant option to create. + +## Properties + + diff --git a/www/apps/docs/content/references/product/interfaces/FilterableProductCategoryProps.mdx b/www/apps/docs/content/references/product/interfaces/FilterableProductCategoryProps.mdx new file mode 100644 index 0000000000..7280ba474c --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/FilterableProductCategoryProps.mdx @@ -0,0 +1,86 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterableProductCategoryProps + +The filters to apply on retrieved product categories. + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductCategoryProps`](FilterableProductCategoryProps.mdx) \\| [`BaseFilterable`](BaseFilterable.mdx)<[`FilterableProductCategoryProps`](FilterableProductCategoryProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string` \\| `string`[]", + "description": "The handles to filter product categories by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product categories by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "include_descendants_tree", + "type": "`boolean`", + "description": "Whether to include children of retrieved product categories.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "is_active", + "type": "`boolean`", + "description": "Filter product categories by whether they're active.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "is_internal", + "type": "`boolean`", + "description": "Filter product categories by whether they're internal.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string` \\| `string`[]", + "description": "The names to filter product categories by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category_id", + "type": "``null`` \\| `string` \\| `string`[]", + "description": "Filter product categories by their parent category's ID.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/FilterableProductCollectionProps.mdx b/www/apps/docs/content/references/product/interfaces/FilterableProductCollectionProps.mdx new file mode 100644 index 0000000000..4fe92c8913 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/FilterableProductCollectionProps.mdx @@ -0,0 +1,54 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterableProductCollectionProps + +The filters to apply on retrieved product collections. + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductCollectionProps`](FilterableProductCollectionProps.mdx) \\| [`BaseFilterable`](BaseFilterable.mdx)<[`FilterableProductCollectionProps`](FilterableProductCollectionProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string` \\| `string`[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product collections by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title to filter product collections by.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/FilterableProductOptionProps.mdx b/www/apps/docs/content/references/product/interfaces/FilterableProductOptionProps.mdx new file mode 100644 index 0000000000..8da8d7d3bf --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/FilterableProductOptionProps.mdx @@ -0,0 +1,54 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterableProductOptionProps + +The filters to apply on retrieved product options. + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductOptionProps`](FilterableProductOptionProps.mdx) \\| [`BaseFilterable`](BaseFilterable.mdx)<[`FilterableProductOptionProps`](FilterableProductOptionProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product options by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product_id", + "type": "`string` \\| `string`[]", + "description": "Filter the product options by their associated products' IDs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The titles to filter product options by.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/FilterableProductProps.mdx b/www/apps/docs/content/references/product/interfaces/FilterableProductProps.mdx new file mode 100644 index 0000000000..36f22be442 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/FilterableProductProps.mdx @@ -0,0 +1,118 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterableProductProps + +The filters to apply on retrieved products. + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductProps`](FilterableProductProps.mdx) \\| [`BaseFilterable`](BaseFilterable.mdx)<[`FilterableProductProps`](FilterableProductProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "categories", + "type": "`object`", + "description": "Filters on a product's categories.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "categories.id", + "type": "`string` \\| `string`[] \\| [`OperatorMap`](../types/OperatorMap.mdx)<`string`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "categories.is_active", + "type": "`boolean`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "categories.is_internal", + "type": "`boolean`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "category_id", + "type": "`string` \\| `string`[] \\| [`OperatorMap`](../types/OperatorMap.mdx)<`string`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection_id", + "type": "`string` \\| `string`[] \\| [`OperatorMap`](../types/OperatorMap.mdx)<`string`\\>", + "description": "Filters a product by its associated collections.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string` \\| `string`[]", + "description": "The handles to filter products by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter products by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "q", + "type": "`string`", + "description": "Search through the products' attributes, such as titles and descriptions, using this search term.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "`object`", + "description": "Filters on a product's tags.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags.value", + "type": "`string`[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/FilterableProductTagProps.mdx b/www/apps/docs/content/references/product/interfaces/FilterableProductTagProps.mdx new file mode 100644 index 0000000000..2385a6e60b --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/FilterableProductTagProps.mdx @@ -0,0 +1,46 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterableProductTagProps + +The filters to apply on retrieved product tags. + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductTagProps`](FilterableProductTagProps.mdx) \\| [`BaseFilterable`](BaseFilterable.mdx)<[`FilterableProductTagProps`](FilterableProductTagProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product tags by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value to filter product tags by.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/FilterableProductTypeProps.mdx b/www/apps/docs/content/references/product/interfaces/FilterableProductTypeProps.mdx new file mode 100644 index 0000000000..6c4d9e11d4 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/FilterableProductTypeProps.mdx @@ -0,0 +1,46 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterableProductTypeProps + +The filters to apply on retrieved product types. + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductTypeProps`](FilterableProductTypeProps.mdx) \\| [`BaseFilterable`](BaseFilterable.mdx)<[`FilterableProductTypeProps`](FilterableProductTypeProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product types by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value to filter product types by.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/FilterableProductVariantProps.mdx b/www/apps/docs/content/references/product/interfaces/FilterableProductVariantProps.mdx new file mode 100644 index 0000000000..f0c777806f --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/FilterableProductVariantProps.mdx @@ -0,0 +1,70 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterableProductVariantProps + +The filters to apply on retrieved product variants. + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductVariantProps`](FilterableProductVariantProps.mdx) \\| [`BaseFilterable`](BaseFilterable.mdx)<[`FilterableProductVariantProps`](FilterableProductVariantProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product variants by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "`object`", + "description": "Filter product variants by their associated options.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options.id", + "type": "`string`[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product_id", + "type": "`string` \\| `string`[]", + "description": "Filter the product variants by their associated products' IDs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "`string` \\| `string`[]", + "description": "The SKUs to filter product variants by.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/FindConfig.mdx b/www/apps/docs/content/references/product/interfaces/FindConfig.mdx new file mode 100644 index 0000000000..976abb9efb --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/FindConfig.mdx @@ -0,0 +1,76 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FindConfig + +An object that is used to configure how an entity is retrieved from the database. It accepts as a typed parameter an `Entity` class, +which provides correct typing of field names in its properties. + +## Type parameters + + + +## Properties + + diff --git a/www/apps/docs/content/references/product/interfaces/IProductModuleService.mdx b/www/apps/docs/content/references/product/interfaces/IProductModuleService.mdx new file mode 100644 index 0000000000..85f3a5cfe4 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/IProductModuleService.mdx @@ -0,0 +1,58 @@ +--- +displayed_sidebar: productReference +badge: + variant: orange + text: Beta +slug: /references/product +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# IProductModuleService Reference + +This section of the documentation provides a reference to the `IProductModuleService` interface’s methods. This is the interface developers use to use the functionalities provided by the Product Module. + +## Methods + +- [create](../IProductModuleService/methods/IProductModuleService.create.mdx) +- [createCategory](../IProductModuleService/methods/IProductModuleService.createCategory.mdx) +- [createCollections](../IProductModuleService/methods/IProductModuleService.createCollections.mdx) +- [createOptions](../IProductModuleService/methods/IProductModuleService.createOptions.mdx) +- [createTags](../IProductModuleService/methods/IProductModuleService.createTags.mdx) +- [createTypes](../IProductModuleService/methods/IProductModuleService.createTypes.mdx) +- [delete](../IProductModuleService/methods/IProductModuleService.delete.mdx) +- [deleteCategory](../IProductModuleService/methods/IProductModuleService.deleteCategory.mdx) +- [deleteCollections](../IProductModuleService/methods/IProductModuleService.deleteCollections.mdx) +- [deleteOptions](../IProductModuleService/methods/IProductModuleService.deleteOptions.mdx) +- [deleteTags](../IProductModuleService/methods/IProductModuleService.deleteTags.mdx) +- [deleteTypes](../IProductModuleService/methods/IProductModuleService.deleteTypes.mdx) +- [list](../IProductModuleService/methods/IProductModuleService.list.mdx) +- [listAndCount](../IProductModuleService/methods/IProductModuleService.listAndCount.mdx) +- [listAndCountCategories](../IProductModuleService/methods/IProductModuleService.listAndCountCategories.mdx) +- [listAndCountCollections](../IProductModuleService/methods/IProductModuleService.listAndCountCollections.mdx) +- [listAndCountOptions](../IProductModuleService/methods/IProductModuleService.listAndCountOptions.mdx) +- [listAndCountTags](../IProductModuleService/methods/IProductModuleService.listAndCountTags.mdx) +- [listAndCountTypes](../IProductModuleService/methods/IProductModuleService.listAndCountTypes.mdx) +- [listAndCountVariants](../IProductModuleService/methods/IProductModuleService.listAndCountVariants.mdx) +- [listCategories](../IProductModuleService/methods/IProductModuleService.listCategories.mdx) +- [listCollections](../IProductModuleService/methods/IProductModuleService.listCollections.mdx) +- [listOptions](../IProductModuleService/methods/IProductModuleService.listOptions.mdx) +- [listTags](../IProductModuleService/methods/IProductModuleService.listTags.mdx) +- [listTypes](../IProductModuleService/methods/IProductModuleService.listTypes.mdx) +- [listVariants](../IProductModuleService/methods/IProductModuleService.listVariants.mdx) +- [restore](../IProductModuleService/methods/IProductModuleService.restore.mdx) +- [restoreVariants](../IProductModuleService/methods/IProductModuleService.restoreVariants.mdx) +- [retrieve](../IProductModuleService/methods/IProductModuleService.retrieve.mdx) +- [retrieveCategory](../IProductModuleService/methods/IProductModuleService.retrieveCategory.mdx) +- [retrieveCollection](../IProductModuleService/methods/IProductModuleService.retrieveCollection.mdx) +- [retrieveOption](../IProductModuleService/methods/IProductModuleService.retrieveOption.mdx) +- [retrieveTag](../IProductModuleService/methods/IProductModuleService.retrieveTag.mdx) +- [retrieveType](../IProductModuleService/methods/IProductModuleService.retrieveType.mdx) +- [retrieveVariant](../IProductModuleService/methods/IProductModuleService.retrieveVariant.mdx) +- [softDelete](../IProductModuleService/methods/IProductModuleService.softDelete.mdx) +- [update](../IProductModuleService/methods/IProductModuleService.update.mdx) +- [updateCategory](../IProductModuleService/methods/IProductModuleService.updateCategory.mdx) +- [updateCollections](../IProductModuleService/methods/IProductModuleService.updateCollections.mdx) +- [updateOptions](../IProductModuleService/methods/IProductModuleService.updateOptions.mdx) +- [updateTags](../IProductModuleService/methods/IProductModuleService.updateTags.mdx) +- [updateTypes](../IProductModuleService/methods/IProductModuleService.updateTypes.mdx) diff --git a/www/apps/docs/content/references/product/interfaces/IterableIterator.mdx b/www/apps/docs/content/references/product/interfaces/IterableIterator.mdx new file mode 100644 index 0000000000..4a99d6c3c9 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/IterableIterator.mdx @@ -0,0 +1,27 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# IterableIterator + +## Type parameters + + + +## Methods + +- [[iterator]](../IterableIterator/methods/IterableIterator._iterator_.mdx) +- [next](../IterableIterator/methods/IterableIterator.next.mdx) +- [return](../IterableIterator/methods/IterableIterator.return.mdx) +- [throw](../IterableIterator/methods/IterableIterator.throw.mdx) diff --git a/www/apps/docs/content/references/product/interfaces/Iterator.mdx b/www/apps/docs/content/references/product/interfaces/Iterator.mdx new file mode 100644 index 0000000000..9e7d5912c6 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/Iterator.mdx @@ -0,0 +1,42 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Iterator + +## Type parameters + + + +## Methods + +- [next](../Iterator/methods/Iterator.next.mdx) +- [return](../Iterator/methods/Iterator.return.mdx) +- [throw](../Iterator/methods/Iterator.throw.mdx) diff --git a/www/apps/docs/content/references/product/interfaces/IteratorReturnResult.mdx b/www/apps/docs/content/references/product/interfaces/IteratorReturnResult.mdx new file mode 100644 index 0000000000..e260171a0d --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/IteratorReturnResult.mdx @@ -0,0 +1,41 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# IteratorReturnResult + +## Type parameters + + + +## Properties + + diff --git a/www/apps/docs/content/references/product/interfaces/IteratorYieldResult.mdx b/www/apps/docs/content/references/product/interfaces/IteratorYieldResult.mdx new file mode 100644 index 0000000000..60abdec626 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/IteratorYieldResult.mdx @@ -0,0 +1,41 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# IteratorYieldResult + +## Type parameters + + + +## Properties + + diff --git a/www/apps/docs/content/references/product/interfaces/JoinerServiceConfig.mdx b/www/apps/docs/content/references/product/interfaces/JoinerServiceConfig.mdx new file mode 100644 index 0000000000..6dde04c48c --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/JoinerServiceConfig.mdx @@ -0,0 +1,68 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# JoinerServiceConfig + +## Properties + +", + "description": "Extra arguments to pass to the remoteFetchData callback", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "extends", + "type": "{ `relationship`: [`JoinerRelationship`](../types/JoinerRelationship.mdx) ; `serviceName`: `string` }[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "fieldAlias", + "type": "Record<`string`, `string` \\| { `forwardArgumentsOnPath`: `string`[] ; `path`: `string` }\\>", + "description": "alias for deeper nested relationships (e.g. { 'price': 'prices.calculated_price_set.amount' })", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "primaryKeys", + "type": "`string`[]", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "relationships", + "type": "[`JoinerRelationship`](../types/JoinerRelationship.mdx)[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "serviceName", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/JoinerServiceConfigAlias.mdx b/www/apps/docs/content/references/product/interfaces/JoinerServiceConfigAlias.mdx new file mode 100644 index 0000000000..2575b19c61 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/JoinerServiceConfigAlias.mdx @@ -0,0 +1,28 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# JoinerServiceConfigAlias + +## Properties + +", + "description": "Extra arguments to pass to the remoteFetchData callback", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/ProductCategoryDTO.mdx b/www/apps/docs/content/references/product/interfaces/ProductCategoryDTO.mdx new file mode 100644 index 0000000000..d9e8d720b1 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/ProductCategoryDTO.mdx @@ -0,0 +1,636 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ProductCategoryDTO + +A product category's data. + +## Properties + + diff --git a/www/apps/docs/content/references/product/interfaces/ProductCollectionDTO.mdx b/www/apps/docs/content/references/product/interfaces/ProductCollectionDTO.mdx new file mode 100644 index 0000000000..5b9e5e97d5 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/ProductCollectionDTO.mdx @@ -0,0 +1,726 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ProductCollectionDTO + +A product collection's data. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "categories", + "type": "``null`` \\| [`ProductCategoryDTO`](ProductCategoryDTO.mdx)[]", + "description": "The associated product categories. It may only be available if the `categories` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection", + "type": "[`ProductCollectionDTO`](ProductCollectionDTO.mdx)", + "description": "The associated product collection. It may only be available if the `collection` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product collection was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product collection. The handle can be used to create slug URL paths.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product was created.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "``null`` \\| `string`", + "description": "The description of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discountable", + "type": "`boolean`", + "description": "Whether the product can be discounted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "external_id", + "type": "``null`` \\| `string`", + "description": "The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain a reference to the ID in the integrated service.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "``null`` \\| `string`", + "description": "The handle of the product. The handle can be used to create slug URL paths. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "images", + "type": "[`ProductImageDTO`](ProductImageDTO.mdx)[]", + "description": "The associated product images. It may only be available if the `images` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product image was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product image.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "url", + "type": "`string`", + "description": "The URL of the product image.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "is_giftcard", + "type": "`boolean`", + "description": "Whether the product is a gift card.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "values", + "type": "[`ProductOptionValueDTO`](ProductOptionValueDTO.mdx)[]", + "description": "The associated product option values. It may only be available if the `values` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../enums/ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../enums/ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "DRAFT", + "type": "``\"draft\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "PROPOSED", + "type": "``\"proposed\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "PUBLISHED", + "type": "``\"published\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "REJECTED", + "type": "``\"rejected\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product type was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "allow_backorder", + "type": "`boolean`", + "description": "Whether the product variant can be ordered when it's out of stock.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "barcode", + "type": "``null`` \\| `string`", + "description": "The barcode of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was deleted.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "ean", + "type": "``null`` \\| `string`", + "description": "The EAN of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "inventory_quantity", + "type": "`number`", + "description": "The inventory quantiy of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manage_inventory", + "type": "`boolean`", + "description": "Whether the product variant's inventory should be managed by the core system.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionValueDTO`](ProductOptionValueDTO.mdx)", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "product_id", + "type": "`string`", + "description": "The ID of the associated product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "``null`` \\| `string`", + "description": "The SKU of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The tile of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "``null`` \\| `string`", + "description": "The UPC of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was updated.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant_rank", + "type": "``null`` \\| `number`", + "description": "The ranking of the variant among other variants associated with the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "The width of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/ProductDTO.mdx b/www/apps/docs/content/references/product/interfaces/ProductDTO.mdx new file mode 100644 index 0000000000..5c93ca6132 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/ProductDTO.mdx @@ -0,0 +1,1707 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ProductDTO + +A product's data. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "categories", + "type": "``null`` \\| [`ProductCategoryDTO`](ProductCategoryDTO.mdx)[]", + "description": "The associated product categories. It may only be available if the `categories` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection", + "type": "[`ProductCollectionDTO`](ProductCollectionDTO.mdx)", + "description": "The associated product collection. It may only be available if the `collection` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product was created.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "``null`` \\| `string`", + "description": "The description of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discountable", + "type": "`boolean`", + "description": "Whether the product can be discounted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "external_id", + "type": "``null`` \\| `string`", + "description": "The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain a reference to the ID in the integrated service.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "``null`` \\| `string`", + "description": "The handle of the product. The handle can be used to create slug URL paths. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "images", + "type": "[`ProductImageDTO`](ProductImageDTO.mdx)[]", + "description": "The associated product images. It may only be available if the `images` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_giftcard", + "type": "`boolean`", + "description": "Whether the product is a gift card.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../enums/ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../enums/ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product was created.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "``null`` \\| `string`", + "description": "The description of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discountable", + "type": "`boolean`", + "description": "Whether the product can be discounted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "external_id", + "type": "``null`` \\| `string`", + "description": "The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain a reference to the ID in the integrated service.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "``null`` \\| `string`", + "description": "The handle of the product. The handle can be used to create slug URL paths. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "images", + "type": "[`ProductImageDTO`](ProductImageDTO.mdx)[]", + "description": "The associated product images. It may only be available if the `images` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product image was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product image.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "url", + "type": "`string`", + "description": "The URL of the product image.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "is_giftcard", + "type": "`boolean`", + "description": "Whether the product is a gift card.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "categories", + "type": "``null`` \\| [`ProductCategoryDTO`](ProductCategoryDTO.mdx)[]", + "description": "The associated product categories. It may only be available if the `categories` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection", + "type": "[`ProductCollectionDTO`](ProductCollectionDTO.mdx)", + "description": "The associated product collection. It may only be available if the `collection` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product was created.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "``null`` \\| `string`", + "description": "The description of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discountable", + "type": "`boolean`", + "description": "Whether the product can be discounted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "external_id", + "type": "``null`` \\| `string`", + "description": "The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain a reference to the ID in the integrated service.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "``null`` \\| `string`", + "description": "The handle of the product. The handle can be used to create slug URL paths. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "images", + "type": "[`ProductImageDTO`](ProductImageDTO.mdx)[]", + "description": "The associated product images. It may only be available if the `images` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_giftcard", + "type": "`boolean`", + "description": "Whether the product is a gift card.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../enums/ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../enums/ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "values", + "type": "[`ProductOptionValueDTO`](ProductOptionValueDTO.mdx)[]", + "description": "The associated product option values. It may only be available if the `values` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option value was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option value.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "option", + "type": "[`ProductOptionDTO`](ProductOptionDTO.mdx)", + "description": "The associated product option. It may only be available if the `option` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product option value.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant", + "type": "[`ProductVariantDTO`](ProductVariantDTO.mdx)", + "description": "The associated product variant. It may only be available if the `variant` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../enums/ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../enums/ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "DRAFT", + "type": "``\"draft\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "PROPOSED", + "type": "``\"proposed\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "PUBLISHED", + "type": "``\"published\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "REJECTED", + "type": "``\"rejected\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "categories", + "type": "``null`` \\| [`ProductCategoryDTO`](ProductCategoryDTO.mdx)[]", + "description": "The associated product categories. It may only be available if the `categories` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection", + "type": "[`ProductCollectionDTO`](ProductCollectionDTO.mdx)", + "description": "The associated product collection. It may only be available if the `collection` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product was created.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "``null`` \\| `string`", + "description": "The description of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discountable", + "type": "`boolean`", + "description": "Whether the product can be discounted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "external_id", + "type": "``null`` \\| `string`", + "description": "The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain a reference to the ID in the integrated service.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "``null`` \\| `string`", + "description": "The handle of the product. The handle can be used to create slug URL paths. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "images", + "type": "[`ProductImageDTO`](ProductImageDTO.mdx)[]", + "description": "The associated product images. It may only be available if the `images` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_giftcard", + "type": "`boolean`", + "description": "Whether the product is a gift card.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../enums/ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../enums/ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product type was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "allow_backorder", + "type": "`boolean`", + "description": "Whether the product variant can be ordered when it's out of stock.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "barcode", + "type": "``null`` \\| `string`", + "description": "The barcode of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was deleted.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "ean", + "type": "``null`` \\| `string`", + "description": "The EAN of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "inventory_quantity", + "type": "`number`", + "description": "The inventory quantiy of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manage_inventory", + "type": "`boolean`", + "description": "Whether the product variant's inventory should be managed by the core system.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionValueDTO`](ProductOptionValueDTO.mdx)", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option value was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option value.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "option", + "type": "[`ProductOptionDTO`](ProductOptionDTO.mdx)", + "description": "The associated product option. It may only be available if the `option` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product option value.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant", + "type": "[`ProductVariantDTO`](ProductVariantDTO.mdx)", + "description": "The associated product variant. It may only be available if the `variant` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "categories", + "type": "``null`` \\| [`ProductCategoryDTO`](ProductCategoryDTO.mdx)[]", + "description": "The associated product categories. It may only be available if the `categories` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection", + "type": "[`ProductCollectionDTO`](ProductCollectionDTO.mdx)", + "description": "The associated product collection. It may only be available if the `collection` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product was created.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "``null`` \\| `string`", + "description": "The description of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discountable", + "type": "`boolean`", + "description": "Whether the product can be discounted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "external_id", + "type": "``null`` \\| `string`", + "description": "The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain a reference to the ID in the integrated service.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "``null`` \\| `string`", + "description": "The handle of the product. The handle can be used to create slug URL paths. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "images", + "type": "[`ProductImageDTO`](ProductImageDTO.mdx)[]", + "description": "The associated product images. It may only be available if the `images` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_giftcard", + "type": "`boolean`", + "description": "Whether the product is a gift card.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../enums/ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../enums/ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "product_id", + "type": "`string`", + "description": "The ID of the associated product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "``null`` \\| `string`", + "description": "The SKU of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The tile of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "``null`` \\| `string`", + "description": "The UPC of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was updated.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant_rank", + "type": "``null`` \\| `number`", + "description": "The ranking of the variant among other variants associated with the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "The width of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/ProductImageDTO.mdx b/www/apps/docs/content/references/product/interfaces/ProductImageDTO.mdx new file mode 100644 index 0000000000..4f41cce784 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/ProductImageDTO.mdx @@ -0,0 +1,46 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ProductImageDTO + +The product image's data. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "url", + "type": "`string`", + "description": "The URL of the product image.", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/ProductOptionDTO.mdx b/www/apps/docs/content/references/product/interfaces/ProductOptionDTO.mdx new file mode 100644 index 0000000000..e85337969e --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/ProductOptionDTO.mdx @@ -0,0 +1,1025 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ProductOptionDTO + +A product option's data. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "categories", + "type": "``null`` \\| [`ProductCategoryDTO`](ProductCategoryDTO.mdx)[]", + "description": "The associated product categories. It may only be available if the `categories` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection", + "type": "[`ProductCollectionDTO`](ProductCollectionDTO.mdx)", + "description": "The associated product collection. It may only be available if the `collection` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product collection was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product collection. The handle can be used to create slug URL paths.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product was created.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "``null`` \\| `string`", + "description": "The description of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discountable", + "type": "`boolean`", + "description": "Whether the product can be discounted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "external_id", + "type": "``null`` \\| `string`", + "description": "The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain a reference to the ID in the integrated service.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "``null`` \\| `string`", + "description": "The handle of the product. The handle can be used to create slug URL paths. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "images", + "type": "[`ProductImageDTO`](ProductImageDTO.mdx)[]", + "description": "The associated product images. It may only be available if the `images` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product image was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product image.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "url", + "type": "`string`", + "description": "The URL of the product image.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "is_giftcard", + "type": "`boolean`", + "description": "Whether the product is a gift card.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "values", + "type": "[`ProductOptionValueDTO`](ProductOptionValueDTO.mdx)[]", + "description": "The associated product option values. It may only be available if the `values` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../enums/ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../enums/ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "DRAFT", + "type": "``\"draft\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "PROPOSED", + "type": "``\"proposed\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "PUBLISHED", + "type": "``\"published\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "REJECTED", + "type": "``\"rejected\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product type was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "allow_backorder", + "type": "`boolean`", + "description": "Whether the product variant can be ordered when it's out of stock.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "barcode", + "type": "``null`` \\| `string`", + "description": "The barcode of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was deleted.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "ean", + "type": "``null`` \\| `string`", + "description": "The EAN of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "inventory_quantity", + "type": "`number`", + "description": "The inventory quantiy of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manage_inventory", + "type": "`boolean`", + "description": "Whether the product variant's inventory should be managed by the core system.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionValueDTO`](ProductOptionValueDTO.mdx)", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "product_id", + "type": "`string`", + "description": "The ID of the associated product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "``null`` \\| `string`", + "description": "The SKU of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The tile of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "``null`` \\| `string`", + "description": "The UPC of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was updated.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant_rank", + "type": "``null`` \\| `number`", + "description": "The ranking of the variant among other variants associated with the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "The width of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "values", + "type": "[`ProductOptionValueDTO`](ProductOptionValueDTO.mdx)[]", + "description": "The associated product option values. It may only be available if the `values` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option value was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option value.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "option", + "type": "[`ProductOptionDTO`](ProductOptionDTO.mdx)", + "description": "The associated product option. It may only be available if the `option` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "values", + "type": "[`ProductOptionValueDTO`](ProductOptionValueDTO.mdx)[]", + "description": "The associated product option values. It may only be available if the `values` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product option value.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant", + "type": "[`ProductVariantDTO`](ProductVariantDTO.mdx)", + "description": "The associated product variant. It may only be available if the `variant` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "allow_backorder", + "type": "`boolean`", + "description": "Whether the product variant can be ordered when it's out of stock.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "barcode", + "type": "``null`` \\| `string`", + "description": "The barcode of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was deleted.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "ean", + "type": "``null`` \\| `string`", + "description": "The EAN of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "inventory_quantity", + "type": "`number`", + "description": "The inventory quantiy of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manage_inventory", + "type": "`boolean`", + "description": "Whether the product variant's inventory should be managed by the core system.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionValueDTO`](ProductOptionValueDTO.mdx)", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "product_id", + "type": "`string`", + "description": "The ID of the associated product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "``null`` \\| `string`", + "description": "The SKU of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The tile of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "``null`` \\| `string`", + "description": "The UPC of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was updated.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant_rank", + "type": "``null`` \\| `number`", + "description": "The ranking of the variant among other variants associated with the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "The width of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/ProductOptionValueDTO.mdx b/www/apps/docs/content/references/product/interfaces/ProductOptionValueDTO.mdx new file mode 100644 index 0000000000..dcc7e9d4a1 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/ProductOptionValueDTO.mdx @@ -0,0 +1,876 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ProductOptionValueDTO + +The product option value's data. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "option", + "type": "[`ProductOptionDTO`](ProductOptionDTO.mdx)", + "description": "The associated product option. It may only be available if the `option` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "categories", + "type": "``null`` \\| [`ProductCategoryDTO`](ProductCategoryDTO.mdx)[]", + "description": "The associated product categories. It may only be available if the `categories` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection", + "type": "[`ProductCollectionDTO`](ProductCollectionDTO.mdx)", + "description": "The associated product collection. It may only be available if the `collection` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product was created.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "``null`` \\| `string`", + "description": "The description of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discountable", + "type": "`boolean`", + "description": "Whether the product can be discounted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "external_id", + "type": "``null`` \\| `string`", + "description": "The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain a reference to the ID in the integrated service.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "``null`` \\| `string`", + "description": "The handle of the product. The handle can be used to create slug URL paths. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "images", + "type": "[`ProductImageDTO`](ProductImageDTO.mdx)[]", + "description": "The associated product images. It may only be available if the `images` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_giftcard", + "type": "`boolean`", + "description": "Whether the product is a gift card.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../enums/ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../enums/ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "values", + "type": "[`ProductOptionValueDTO`](ProductOptionValueDTO.mdx)[]", + "description": "The associated product option values. It may only be available if the `values` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option value was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option value.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "option", + "type": "[`ProductOptionDTO`](ProductOptionDTO.mdx)", + "description": "The associated product option. It may only be available if the `option` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product option value.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant", + "type": "[`ProductVariantDTO`](ProductVariantDTO.mdx)", + "description": "The associated product variant. It may only be available if the `variant` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product option value.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant", + "type": "[`ProductVariantDTO`](ProductVariantDTO.mdx)", + "description": "The associated product variant. It may only be available if the `variant` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "allow_backorder", + "type": "`boolean`", + "description": "Whether the product variant can be ordered when it's out of stock.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "barcode", + "type": "``null`` \\| `string`", + "description": "The barcode of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was deleted.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "ean", + "type": "``null`` \\| `string`", + "description": "The EAN of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "inventory_quantity", + "type": "`number`", + "description": "The inventory quantiy of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manage_inventory", + "type": "`boolean`", + "description": "Whether the product variant's inventory should be managed by the core system.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionValueDTO`](ProductOptionValueDTO.mdx)", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option value was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option value.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "option", + "type": "[`ProductOptionDTO`](ProductOptionDTO.mdx)", + "description": "The associated product option. It may only be available if the `option` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product option value.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant", + "type": "[`ProductVariantDTO`](ProductVariantDTO.mdx)", + "description": "The associated product variant. It may only be available if the `variant` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "categories", + "type": "``null`` \\| [`ProductCategoryDTO`](ProductCategoryDTO.mdx)[]", + "description": "The associated product categories. It may only be available if the `categories` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection", + "type": "[`ProductCollectionDTO`](ProductCollectionDTO.mdx)", + "description": "The associated product collection. It may only be available if the `collection` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product was created.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "``null`` \\| `string`", + "description": "The description of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discountable", + "type": "`boolean`", + "description": "Whether the product can be discounted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "external_id", + "type": "``null`` \\| `string`", + "description": "The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain a reference to the ID in the integrated service.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "``null`` \\| `string`", + "description": "The handle of the product. The handle can be used to create slug URL paths. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "images", + "type": "[`ProductImageDTO`](ProductImageDTO.mdx)[]", + "description": "The associated product images. It may only be available if the `images` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_giftcard", + "type": "`boolean`", + "description": "Whether the product is a gift card.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../enums/ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../enums/ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "product_id", + "type": "`string`", + "description": "The ID of the associated product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "``null`` \\| `string`", + "description": "The SKU of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The tile of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "``null`` \\| `string`", + "description": "The UPC of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was updated.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant_rank", + "type": "``null`` \\| `number`", + "description": "The ranking of the variant among other variants associated with the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "The width of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/ProductTagDTO.mdx b/www/apps/docs/content/references/product/interfaces/ProductTagDTO.mdx new file mode 100644 index 0000000000..187c92279a --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/ProductTagDTO.mdx @@ -0,0 +1,710 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ProductTagDTO + +A product tag's data. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "categories", + "type": "``null`` \\| [`ProductCategoryDTO`](ProductCategoryDTO.mdx)[]", + "description": "The associated product categories. It may only be available if the `categories` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection", + "type": "[`ProductCollectionDTO`](ProductCollectionDTO.mdx)", + "description": "The associated product collection. It may only be available if the `collection` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product collection was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product collection. The handle can be used to create slug URL paths.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product was created.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "``null`` \\| `string`", + "description": "The description of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discountable", + "type": "`boolean`", + "description": "Whether the product can be discounted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "external_id", + "type": "``null`` \\| `string`", + "description": "The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain a reference to the ID in the integrated service.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "``null`` \\| `string`", + "description": "The handle of the product. The handle can be used to create slug URL paths. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "images", + "type": "[`ProductImageDTO`](ProductImageDTO.mdx)[]", + "description": "The associated product images. It may only be available if the `images` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product image was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product image.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "url", + "type": "`string`", + "description": "The URL of the product image.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "is_giftcard", + "type": "`boolean`", + "description": "Whether the product is a gift card.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "values", + "type": "[`ProductOptionValueDTO`](ProductOptionValueDTO.mdx)[]", + "description": "The associated product option values. It may only be available if the `values` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../enums/ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../enums/ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "DRAFT", + "type": "``\"draft\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "PROPOSED", + "type": "``\"proposed\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "PUBLISHED", + "type": "``\"published\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "REJECTED", + "type": "``\"rejected\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product type was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "allow_backorder", + "type": "`boolean`", + "description": "Whether the product variant can be ordered when it's out of stock.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "barcode", + "type": "``null`` \\| `string`", + "description": "The barcode of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was deleted.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "ean", + "type": "``null`` \\| `string`", + "description": "The EAN of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "inventory_quantity", + "type": "`number`", + "description": "The inventory quantiy of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manage_inventory", + "type": "`boolean`", + "description": "Whether the product variant's inventory should be managed by the core system.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionValueDTO`](ProductOptionValueDTO.mdx)", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "product_id", + "type": "`string`", + "description": "The ID of the associated product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "``null`` \\| `string`", + "description": "The SKU of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The tile of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "``null`` \\| `string`", + "description": "The UPC of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was updated.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant_rank", + "type": "``null`` \\| `number`", + "description": "The ranking of the variant among other variants associated with the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "The width of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/ProductTypeDTO.mdx b/www/apps/docs/content/references/product/interfaces/ProductTypeDTO.mdx new file mode 100644 index 0000000000..f30868556b --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/ProductTypeDTO.mdx @@ -0,0 +1,46 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ProductTypeDTO + +A product type's data. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/ProductVariantDTO.mdx b/www/apps/docs/content/references/product/interfaces/ProductVariantDTO.mdx new file mode 100644 index 0000000000..87d109d47b --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/ProductVariantDTO.mdx @@ -0,0 +1,1177 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ProductVariantDTO + +A product variant's data. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionValueDTO`](ProductOptionValueDTO.mdx)", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option value was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option value.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "option", + "type": "[`ProductOptionDTO`](ProductOptionDTO.mdx)", + "description": "The associated product option. It may only be available if the `option` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "values", + "type": "[`ProductOptionValueDTO`](ProductOptionValueDTO.mdx)[]", + "description": "The associated product option values. It may only be available if the `values` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product option value.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant", + "type": "[`ProductVariantDTO`](ProductVariantDTO.mdx)", + "description": "The associated product variant. It may only be available if the `variant` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "allow_backorder", + "type": "`boolean`", + "description": "Whether the product variant can be ordered when it's out of stock.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "barcode", + "type": "``null`` \\| `string`", + "description": "The barcode of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was deleted.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "ean", + "type": "``null`` \\| `string`", + "description": "The EAN of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "inventory_quantity", + "type": "`number`", + "description": "The inventory quantiy of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manage_inventory", + "type": "`boolean`", + "description": "Whether the product variant's inventory should be managed by the core system.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionValueDTO`](ProductOptionValueDTO.mdx)", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "product_id", + "type": "`string`", + "description": "The ID of the associated product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "``null`` \\| `string`", + "description": "The SKU of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The tile of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "``null`` \\| `string`", + "description": "The UPC of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was updated.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant_rank", + "type": "``null`` \\| `number`", + "description": "The ranking of the variant among other variants associated with the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "The width of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } + ] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "categories", + "type": "``null`` \\| [`ProductCategoryDTO`](ProductCategoryDTO.mdx)[]", + "description": "The associated product categories. It may only be available if the `categories` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection", + "type": "[`ProductCollectionDTO`](ProductCollectionDTO.mdx)", + "description": "The associated product collection. It may only be available if the `collection` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product collection was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product collection. The handle can be used to create slug URL paths.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product was created.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "``null`` \\| `string`", + "description": "The description of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discountable", + "type": "`boolean`", + "description": "Whether the product can be discounted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "external_id", + "type": "``null`` \\| `string`", + "description": "The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain a reference to the ID in the integrated service.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "``null`` \\| `string`", + "description": "The handle of the product. The handle can be used to create slug URL paths. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "images", + "type": "[`ProductImageDTO`](ProductImageDTO.mdx)[]", + "description": "The associated product images. It may only be available if the `images` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product image was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product image.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "url", + "type": "`string`", + "description": "The URL of the product image.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "is_giftcard", + "type": "`boolean`", + "description": "Whether the product is a gift card.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "values", + "type": "[`ProductOptionValueDTO`](ProductOptionValueDTO.mdx)[]", + "description": "The associated product option values. It may only be available if the `values` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../enums/ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../enums/ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "DRAFT", + "type": "``\"draft\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "PROPOSED", + "type": "``\"proposed\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "PUBLISHED", + "type": "``\"published\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "REJECTED", + "type": "``\"rejected\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product type was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "allow_backorder", + "type": "`boolean`", + "description": "Whether the product variant can be ordered when it's out of stock.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "barcode", + "type": "``null`` \\| `string`", + "description": "The barcode of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was deleted.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "ean", + "type": "``null`` \\| `string`", + "description": "The EAN of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "inventory_quantity", + "type": "`number`", + "description": "The inventory quantiy of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manage_inventory", + "type": "`boolean`", + "description": "Whether the product variant's inventory should be managed by the core system.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionValueDTO`](ProductOptionValueDTO.mdx)", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "product_id", + "type": "`string`", + "description": "The ID of the associated product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "``null`` \\| `string`", + "description": "The SKU of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The tile of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "``null`` \\| `string`", + "description": "The UPC of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was updated.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant_rank", + "type": "``null`` \\| `number`", + "description": "The ranking of the variant among other variants associated with the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "The width of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "product_id", + "type": "`string`", + "description": "The ID of the associated product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "``null`` \\| `string`", + "description": "The SKU of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The tile of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "``null`` \\| `string`", + "description": "The UPC of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was updated.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant_rank", + "type": "``null`` \\| `number`", + "description": "The ranking of the variant among other variants associated with the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "The width of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/RestoreReturn.mdx b/www/apps/docs/content/references/product/interfaces/RestoreReturn.mdx new file mode 100644 index 0000000000..1ed05a0b24 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/RestoreReturn.mdx @@ -0,0 +1,35 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# RestoreReturn + +An object that is used to specify an entity's related entities that should be restored when the main entity is restored. + +## Type parameters + + + +## Properties + + diff --git a/www/apps/docs/content/references/product/interfaces/SharedArrayBuffer.mdx b/www/apps/docs/content/references/product/interfaces/SharedArrayBuffer.mdx new file mode 100644 index 0000000000..bf08300223 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/SharedArrayBuffer.mdx @@ -0,0 +1,106 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# SharedArrayBuffer + +## Methods + +- [slice](../SharedArrayBuffer/methods/SharedArrayBuffer.slice.mdx) + +## Properties + + [`SharedArrayBuffer`](../variables/SharedArrayBuffer-1.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "[toStringTag]", + "type": "``\"SharedArrayBuffer\"``", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "byteLength", + "type": "`number`", + "description": "Read-only. The length of the ArrayBuffer (in bytes).", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "slice", + "type": "(`begin`: `number`, `end?`: `number`) => [`SharedArrayBuffer`](../variables/SharedArrayBuffer-1.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "[toStringTag]", + "type": "``\"SharedArrayBuffer\"``", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "byteLength", + "type": "`number`", + "description": "Read-only. The length of the ArrayBuffer (in bytes).", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/SharedArrayBufferConstructor.mdx b/www/apps/docs/content/references/product/interfaces/SharedArrayBufferConstructor.mdx new file mode 100644 index 0000000000..f0063268bb --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/SharedArrayBufferConstructor.mdx @@ -0,0 +1,105 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# SharedArrayBufferConstructor + +## Constructors + +### constructor + +**new SharedArrayBufferConstructor**(`byteLength`) + +#### Parameters + + + +## Properties + + [`SharedArrayBuffer`](../variables/SharedArrayBuffer-1.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "[toStringTag]", + "type": "``\"SharedArrayBuffer\"``", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "byteLength", + "type": "`number`", + "description": "Read-only. The length of the ArrayBuffer (in bytes).", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "slice", + "type": "(`begin`: `number`, `end?`: `number`) => [`SharedArrayBuffer`](../variables/SharedArrayBuffer-1.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/SoftDeleteReturn.mdx b/www/apps/docs/content/references/product/interfaces/SoftDeleteReturn.mdx new file mode 100644 index 0000000000..d4206515b5 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/SoftDeleteReturn.mdx @@ -0,0 +1,35 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# SoftDeleteReturn + +An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted. + +## Type parameters + + + +## Properties + + diff --git a/www/apps/docs/content/references/product/interfaces/UpdateProductCategoryDTO.mdx b/www/apps/docs/content/references/product/interfaces/UpdateProductCategoryDTO.mdx new file mode 100644 index 0000000000..2f6b6bc1e8 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/UpdateProductCategoryDTO.mdx @@ -0,0 +1,70 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductCategoryDTO + +The data to update in a product category. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the product category.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category_id", + "type": "``null`` \\| `string`", + "description": "The ID of the parent product category, if it has any. It may also be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rank", + "type": "`number`", + "description": "The ranking of the category among sibling categories.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/UpdateProductCollectionDTO.mdx b/www/apps/docs/content/references/product/interfaces/UpdateProductCollectionDTO.mdx new file mode 100644 index 0000000000..43c43b596b --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/UpdateProductCollectionDTO.mdx @@ -0,0 +1,62 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductCollectionDTO + +The data to update in a product collection. The `id` is used to identify which product collection to update. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product_ids", + "type": "`string`[]", + "description": "The IDs of the products to associate with the product collection.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product collection.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product collection.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/UpdateProductDTO.mdx b/www/apps/docs/content/references/product/interfaces/UpdateProductDTO.mdx new file mode 100644 index 0000000000..d5c00aec4d --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/UpdateProductDTO.mdx @@ -0,0 +1,306 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductDTO + +The data to update in a product. The `id` is used to identify which product to update. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "`string`", + "description": "The MID Code of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`CreateProductOptionDTO`](CreateProductOptionDTO.mdx)[]", + "description": "The product options to be created and associated with the product.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "product_id", + "type": "`string`", + "description": "The ID of the associated product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The product option's title.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "origin_country", + "type": "`string`", + "description": "The origin country of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../enums/ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../enums/ProductStatus.mdx).", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "DRAFT", + "type": "``\"draft\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "PROPOSED", + "type": "``\"proposed\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "PUBLISHED", + "type": "``\"published\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "REJECTED", + "type": "``\"rejected\"``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "subtitle", + "type": "`string`", + "description": "The subttle of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`CreateProductTagDTO`](CreateProductTagDTO.mdx)[]", + "description": "The product tags to be created and associated with the product.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "value", + "type": "`string`", + "description": "The value of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "thumbnail", + "type": "`string`", + "description": "The URL of the product's thumbnail.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`CreateProductTypeDTO`](CreateProductTypeDTO.mdx)", + "description": "The product type to create and associate with the product.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The product type's ID.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The product type's value.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "type_id", + "type": "``null`` \\| `string`", + "description": "The product type to be associated with the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "([`CreateProductVariantDTO`](CreateProductVariantDTO.mdx) \\| [`UpdateProductVariantDTO`](UpdateProductVariantDTO.mdx))[]", + "description": "The product variants to be created and associated with the product. You can also update existing product variants associated with the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "`number`", + "description": "The weight of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "`number`", + "description": "The width of the product.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/UpdateProductOptionDTO.mdx b/www/apps/docs/content/references/product/interfaces/UpdateProductOptionDTO.mdx new file mode 100644 index 0000000000..c841e9ab5a --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/UpdateProductOptionDTO.mdx @@ -0,0 +1,36 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductOptionDTO + +## Properties + + diff --git a/www/apps/docs/content/references/product/interfaces/UpdateProductTagDTO.mdx b/www/apps/docs/content/references/product/interfaces/UpdateProductTagDTO.mdx new file mode 100644 index 0000000000..507d60b592 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/UpdateProductTagDTO.mdx @@ -0,0 +1,30 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductTagDTO + +The data to update in a product tag. The `id` is used to identify which product tag to update. + +## Properties + + diff --git a/www/apps/docs/content/references/product/interfaces/UpdateProductTypeDTO.mdx b/www/apps/docs/content/references/product/interfaces/UpdateProductTypeDTO.mdx new file mode 100644 index 0000000000..9621f836d6 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/UpdateProductTypeDTO.mdx @@ -0,0 +1,38 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductTypeDTO + +The data to update in a product type. The `id` is used to identify which product type to update. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The new value of the product type.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/interfaces/UpdateProductVariantDTO.mdx b/www/apps/docs/content/references/product/interfaces/UpdateProductVariantDTO.mdx new file mode 100644 index 0000000000..1fae38b6a7 --- /dev/null +++ b/www/apps/docs/content/references/product/interfaces/UpdateProductVariantDTO.mdx @@ -0,0 +1,175 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductVariantDTO + +The data to update in a product variant. The `id` is used to identify which product variant to update. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "`string`", + "description": "The MID Code of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`CreateProductVariantOptionDTO`](CreateProductVariantOptionDTO.mdx)[]", + "description": "The product variant options to create and associate with the product variant.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "value", + "type": "`string`", + "description": "The value of a product variant option.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "origin_country", + "type": "`string`", + "description": "The origin country of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "`string`", + "description": "The SKU of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The tile of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "`string`", + "description": "The UPC of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "`number`", + "description": "The weight of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "`number`", + "description": "The width of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/types/ArrayBufferLike.mdx b/www/apps/docs/content/references/product/types/ArrayBufferLike.mdx new file mode 100644 index 0000000000..1606c40a62 --- /dev/null +++ b/www/apps/docs/content/references/product/types/ArrayBufferLike.mdx @@ -0,0 +1,9 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ArrayBufferLike + + **ArrayBufferLike**: `ArrayBufferTypes`[keyof `ArrayBufferTypes`] diff --git a/www/apps/docs/content/references/product/types/ArrayBufferView.mdx b/www/apps/docs/content/references/product/types/ArrayBufferView.mdx new file mode 100644 index 0000000000..00367ba9df --- /dev/null +++ b/www/apps/docs/content/references/product/types/ArrayBufferView.mdx @@ -0,0 +1,9 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ArrayBufferView + + **ArrayBufferView**: [`TypedArray`](TypedArray.mdx) \| `DataView` diff --git a/www/apps/docs/content/references/product/types/BufferEncoding.mdx b/www/apps/docs/content/references/product/types/BufferEncoding.mdx new file mode 100644 index 0000000000..8c981dc888 --- /dev/null +++ b/www/apps/docs/content/references/product/types/BufferEncoding.mdx @@ -0,0 +1,9 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# BufferEncoding + + **BufferEncoding**: ``"ascii"`` \| ``"utf8"`` \| ``"utf-8"`` \| ``"utf16le"`` \| ``"ucs2"`` \| ``"ucs-2"`` \| ``"base64"`` \| ``"base64url"`` \| ``"latin1"`` \| ``"binary"`` \| ``"hex"`` diff --git a/www/apps/docs/content/references/product/types/Exclude.mdx b/www/apps/docs/content/references/product/types/Exclude.mdx new file mode 100644 index 0000000000..cd50b88ab7 --- /dev/null +++ b/www/apps/docs/content/references/product/types/Exclude.mdx @@ -0,0 +1,32 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Exclude + + **Exclude**<`T`, `U`\>: `T` extends `U` ? `never` : `T` + +Exclude from T those types that are assignable to U + +#### Type parameters + + diff --git a/www/apps/docs/content/references/product/types/ExpandScalar.mdx b/www/apps/docs/content/references/product/types/ExpandScalar.mdx new file mode 100644 index 0000000000..9dd515d4da --- /dev/null +++ b/www/apps/docs/content/references/product/types/ExpandScalar.mdx @@ -0,0 +1,22 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ExpandScalar + + **ExpandScalar**<`T`\>: ``null`` \| `T` extends `string` ? `string` \| `RegExp` : `T` extends `Date` ? `Date` \| `string` : `T` + +#### Type parameters + + diff --git a/www/apps/docs/content/references/product/types/FilterQuery.mdx b/www/apps/docs/content/references/product/types/FilterQuery.mdx new file mode 100644 index 0000000000..c95ca6f320 --- /dev/null +++ b/www/apps/docs/content/references/product/types/FilterQuery.mdx @@ -0,0 +1,30 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterQuery + + **FilterQuery**<`T`, `Prev`\>: `Prev` extends `never` ? `never` : { [Key in keyof T]?: T[Key] extends boolean \| number \| string \| bigint \| symbol \| Date ? T[Key] \| OperatorMap : T[Key] extends infer U ? U extends Object ? V extends object ? FilterQuery, PrevLimit[Prev]\\> : never : never : never } + +#### Type parameters + + diff --git a/www/apps/docs/content/references/product/types/FilterValue.mdx b/www/apps/docs/content/references/product/types/FilterValue.mdx new file mode 100644 index 0000000000..991ce47ef6 --- /dev/null +++ b/www/apps/docs/content/references/product/types/FilterValue.mdx @@ -0,0 +1,22 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterValue + + **FilterValue**<`T`\>: [`OperatorMap`](OperatorMap.mdx)<[`FilterValue2`](FilterValue2.mdx)<`T`\>\> \| [`FilterValue2`](FilterValue2.mdx)<`T`\> \| [`FilterValue2`](FilterValue2.mdx)<`T`\>[] \| ``null`` + +#### Type parameters + + diff --git a/www/apps/docs/content/references/product/types/FilterValue2.mdx b/www/apps/docs/content/references/product/types/FilterValue2.mdx new file mode 100644 index 0000000000..11124cd428 --- /dev/null +++ b/www/apps/docs/content/references/product/types/FilterValue2.mdx @@ -0,0 +1,22 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterValue2 + + **FilterValue2**<`T`\>: `T` \| [`ExpandScalar`](ExpandScalar.mdx)<`T`\> \| [`Primary`](Primary.mdx)<`T`\> + +#### Type parameters + + diff --git a/www/apps/docs/content/references/product/types/IteratorResult.mdx b/www/apps/docs/content/references/product/types/IteratorResult.mdx new file mode 100644 index 0000000000..10f2dd1afd --- /dev/null +++ b/www/apps/docs/content/references/product/types/IteratorResult.mdx @@ -0,0 +1,30 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# IteratorResult + + **IteratorResult**<`T`, `TReturn`\>: [`IteratorYieldResult`](../interfaces/IteratorYieldResult.mdx)<`T`\> \| [`IteratorReturnResult`](../interfaces/IteratorReturnResult.mdx)<`TReturn`\> + +#### Type parameters + + diff --git a/www/apps/docs/content/references/product/types/JoinerRelationship.mdx b/www/apps/docs/content/references/product/types/JoinerRelationship.mdx new file mode 100644 index 0000000000..6b8d8a7875 --- /dev/null +++ b/www/apps/docs/content/references/product/types/JoinerRelationship.mdx @@ -0,0 +1,78 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# JoinerRelationship + + **JoinerRelationship**: `Object` + +#### Type declaration + +", + "description": "Extra arguments to pass to the remoteFetchData callback", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "foreignKey", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "inverse", + "type": "`boolean`", + "description": "In an inverted relationship the foreign key is on the other service and the primary key is on the current service", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isInternalService", + "type": "`boolean`", + "description": "If true, the relationship is an internal service from the medusa core TODO: Remove when there are no more \"internal\" services", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isList", + "type": "`boolean`", + "description": "Force the relationship to return a list", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "primaryKey", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "serviceName", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/types/ModuleJoinerConfig.mdx b/www/apps/docs/content/references/product/types/ModuleJoinerConfig.mdx new file mode 100644 index 0000000000..304fa3e644 --- /dev/null +++ b/www/apps/docs/content/references/product/types/ModuleJoinerConfig.mdx @@ -0,0 +1,9 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ModuleJoinerConfig + + **ModuleJoinerConfig**: [`Omit`](Omit.mdx)<[`JoinerServiceConfig`](../interfaces/JoinerServiceConfig.mdx), ``"serviceName"`` \| ``"primaryKeys"`` \| ``"relationships"`` \| ``"extends"``\> & { `databaseConfig?`: { `extraFields?`: Record<`string`, { `defaultValue?`: `string` ; `nullable?`: `boolean` ; `options?`: Record<`string`, `unknown`\> ; `type`: ``"date"`` \| ``"time"`` \| ``"datetime"`` \| ``"bigint"`` \| ``"blob"`` \| ``"uint8array"`` \| ``"array"`` \| ``"enumArray"`` \| ``"enum"`` \| ``"json"`` \| ``"integer"`` \| ``"smallint"`` \| ``"tinyint"`` \| ``"mediumint"`` \| ``"float"`` \| ``"double"`` \| ``"boolean"`` \| ``"decimal"`` \| ``"string"`` \| ``"uuid"`` \| ``"text"`` }\> ; `idPrefix?`: `string` ; `tableName?`: `string` } ; `extends?`: { `fieldAlias?`: Record<`string`, `string` \| { `forwardArgumentsOnPath`: `string`[] ; `path`: `string` }\> ; `relationship`: [`ModuleJoinerRelationship`](ModuleJoinerRelationship.mdx) ; `serviceName`: `string` }[] ; `isLink?`: `boolean` ; `isReadOnlyLink?`: `boolean` ; `linkableKeys?`: Record<`string`, `string`\> ; `primaryKeys?`: `string`[] ; `relationships?`: [`ModuleJoinerRelationship`](ModuleJoinerRelationship.mdx)[] ; `schema?`: `string` ; `serviceName?`: `string` } diff --git a/www/apps/docs/content/references/product/types/ModuleJoinerRelationship.mdx b/www/apps/docs/content/references/product/types/ModuleJoinerRelationship.mdx new file mode 100644 index 0000000000..c7d0944d55 --- /dev/null +++ b/www/apps/docs/content/references/product/types/ModuleJoinerRelationship.mdx @@ -0,0 +1,9 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ModuleJoinerRelationship + + **ModuleJoinerRelationship**: [`JoinerRelationship`](JoinerRelationship.mdx) & { `deleteCascade?`: `boolean` ; `isInternalService?`: `boolean` } diff --git a/www/apps/docs/content/references/product/types/Omit.mdx b/www/apps/docs/content/references/product/types/Omit.mdx new file mode 100644 index 0000000000..e3b2e9dbe1 --- /dev/null +++ b/www/apps/docs/content/references/product/types/Omit.mdx @@ -0,0 +1,32 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Omit + + **Omit**<`T`, `K`\>: [`Pick`](Pick.mdx)<`T`, [`Exclude`](Exclude.mdx)\> + +Construct a type with the properties of T except for those in type K. + +#### Type parameters + + diff --git a/www/apps/docs/content/references/product/types/OperatorMap.mdx b/www/apps/docs/content/references/product/types/OperatorMap.mdx new file mode 100644 index 0000000000..dad514c747 --- /dev/null +++ b/www/apps/docs/content/references/product/types/OperatorMap.mdx @@ -0,0 +1,179 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# OperatorMap + + **OperatorMap**<`T`\>: `Object` + +#### Type parameters + + + +#### Type declaration + +[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$contained", + "type": "`string`[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$contains", + "type": "`string`[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$eq", + "type": "[`ExpandScalar`](ExpandScalar.mdx)<`T`\\> \\| [`ExpandScalar`](ExpandScalar.mdx)<`T`\\>[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$exists", + "type": "`boolean`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$fulltext", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$gt", + "type": "[`ExpandScalar`](ExpandScalar.mdx)<`T`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$gte", + "type": "[`ExpandScalar`](ExpandScalar.mdx)<`T`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$ilike", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$in", + "type": "[`ExpandScalar`](ExpandScalar.mdx)<`T`\\>[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$like", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$lt", + "type": "[`ExpandScalar`](ExpandScalar.mdx)<`T`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$lte", + "type": "[`ExpandScalar`](ExpandScalar.mdx)<`T`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$ne", + "type": "[`ExpandScalar`](ExpandScalar.mdx)<`T`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$nin", + "type": "[`ExpandScalar`](ExpandScalar.mdx)<`T`\\>[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$not", + "type": "[`Query`](Query.mdx)<`T`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "[`Query`](Query.mdx)<`T`\\>[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$overlap", + "type": "`string`[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$re", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/product/types/Partial.mdx b/www/apps/docs/content/references/product/types/Partial.mdx new file mode 100644 index 0000000000..f2ebfcd808 --- /dev/null +++ b/www/apps/docs/content/references/product/types/Partial.mdx @@ -0,0 +1,24 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Partial + + **Partial**<`T`\>: { [P in keyof T]?: T[P] } + +Make all properties in T optional + +#### Type parameters + + diff --git a/www/apps/docs/content/references/product/types/Pick.mdx b/www/apps/docs/content/references/product/types/Pick.mdx new file mode 100644 index 0000000000..a0f305e86b --- /dev/null +++ b/www/apps/docs/content/references/product/types/Pick.mdx @@ -0,0 +1,32 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Pick + + **Pick**<`T`, `K`\>: { [P in K]: T[P] } + +From T, pick a set of properties whose keys are in the union K + +#### Type parameters + + diff --git a/www/apps/docs/content/references/product/types/PrevLimit.mdx b/www/apps/docs/content/references/product/types/PrevLimit.mdx new file mode 100644 index 0000000000..b3baa75608 --- /dev/null +++ b/www/apps/docs/content/references/product/types/PrevLimit.mdx @@ -0,0 +1,9 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# PrevLimit + + **PrevLimit**: [`never`, ``1``, ``2``, ``3``] diff --git a/www/apps/docs/content/references/product/types/Primary.mdx b/www/apps/docs/content/references/product/types/Primary.mdx new file mode 100644 index 0000000000..58196f1617 --- /dev/null +++ b/www/apps/docs/content/references/product/types/Primary.mdx @@ -0,0 +1,22 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Primary + + **Primary**<`T`\>: `T` extends { `[PrimaryKeyType]?`: infer PK } ? [`ReadonlyPrimary`](ReadonlyPrimary.mdx)<`PK`\> : `T` extends { `_id?`: infer PK } ? [`ReadonlyPrimary`](ReadonlyPrimary.mdx)<`PK`\> \| `string` : `T` extends { `uuid?`: infer PK } ? [`ReadonlyPrimary`](ReadonlyPrimary.mdx)<`PK`\> : `T` extends { `id?`: infer PK } ? [`ReadonlyPrimary`](ReadonlyPrimary.mdx)<`PK`\> : `never` + +#### Type parameters + + diff --git a/www/apps/docs/content/references/product/types/Query.mdx b/www/apps/docs/content/references/product/types/Query.mdx new file mode 100644 index 0000000000..a2581d16df --- /dev/null +++ b/www/apps/docs/content/references/product/types/Query.mdx @@ -0,0 +1,22 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Query + + **Query**<`T`\>: `T` extends `object` ? `T` extends [`Scalar`](Scalar.mdx) ? `never` : [`FilterQuery`](FilterQuery.mdx)<`T`\> : [`FilterValue`](FilterValue.mdx)<`T`\> + +#### Type parameters + + diff --git a/www/apps/docs/content/references/product/types/Readonly.mdx b/www/apps/docs/content/references/product/types/Readonly.mdx new file mode 100644 index 0000000000..83b0dd44ff --- /dev/null +++ b/www/apps/docs/content/references/product/types/Readonly.mdx @@ -0,0 +1,24 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Readonly + + **Readonly**<`T`\>: { readonly [P in keyof T]: T[P] } + +Make all properties in T readonly + +#### Type parameters + + diff --git a/www/apps/docs/content/references/product/types/ReadonlyPrimary.mdx b/www/apps/docs/content/references/product/types/ReadonlyPrimary.mdx new file mode 100644 index 0000000000..7fcc2208b9 --- /dev/null +++ b/www/apps/docs/content/references/product/types/ReadonlyPrimary.mdx @@ -0,0 +1,22 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ReadonlyPrimary + + **ReadonlyPrimary**<`T`\>: `T` extends `any`[] ? [`Readonly`](Readonly.mdx)<`T`\> : `T` + +#### Type parameters + + diff --git a/www/apps/docs/content/references/product/types/Record.mdx b/www/apps/docs/content/references/product/types/Record.mdx new file mode 100644 index 0000000000..bce659e1b9 --- /dev/null +++ b/www/apps/docs/content/references/product/types/Record.mdx @@ -0,0 +1,32 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Record + + **Record**<`K`, `T`\>: { [P in K]: T } + +Construct a type with a set of properties K of type T + +#### Type parameters + + diff --git a/www/apps/docs/content/references/product/types/Scalar.mdx b/www/apps/docs/content/references/product/types/Scalar.mdx new file mode 100644 index 0000000000..12620a0182 --- /dev/null +++ b/www/apps/docs/content/references/product/types/Scalar.mdx @@ -0,0 +1,9 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Scalar + + **Scalar**: `boolean` \| `number` \| `string` \| `bigint` \| `symbol` \| `Date` \| `RegExp` \| [`Buffer`](../variables/Buffer-1.mdx) \| { `toHexString`: Method toHexString } diff --git a/www/apps/docs/content/references/product/types/TypedArray.mdx b/www/apps/docs/content/references/product/types/TypedArray.mdx new file mode 100644 index 0000000000..6829a04f92 --- /dev/null +++ b/www/apps/docs/content/references/product/types/TypedArray.mdx @@ -0,0 +1,9 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# TypedArray + + **TypedArray**: `Uint8Array` \| `Uint8ClampedArray` \| `Uint16Array` \| `Uint32Array` \| `Int8Array` \| `Int16Array` \| `Int32Array` \| `BigUint64Array` \| `BigInt64Array` \| `Float32Array` \| `Float64Array` diff --git a/www/apps/docs/content/references/product/types/WithImplicitCoercion.mdx b/www/apps/docs/content/references/product/types/WithImplicitCoercion.mdx new file mode 100644 index 0000000000..aff639ab27 --- /dev/null +++ b/www/apps/docs/content/references/product/types/WithImplicitCoercion.mdx @@ -0,0 +1,22 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# WithImplicitCoercion + + **WithImplicitCoercion**<`T`\>: `T` \| { `valueOf`: Method valueOf } + +#### Type parameters + + diff --git a/www/apps/docs/content/references/product/variables/Buffer-1.mdx b/www/apps/docs/content/references/product/variables/Buffer-1.mdx new file mode 100644 index 0000000000..a03f538c53 --- /dev/null +++ b/www/apps/docs/content/references/product/variables/Buffer-1.mdx @@ -0,0 +1,9 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Buffer + + **Buffer**: [`BufferConstructor`](../interfaces/BufferConstructor.mdx) diff --git a/www/apps/docs/content/references/product/variables/SharedArrayBuffer-1.mdx b/www/apps/docs/content/references/product/variables/SharedArrayBuffer-1.mdx new file mode 100644 index 0000000000..db17ca940b --- /dev/null +++ b/www/apps/docs/content/references/product/variables/SharedArrayBuffer-1.mdx @@ -0,0 +1,9 @@ +--- +displayed_sidebar: productReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# SharedArrayBuffer + + **SharedArrayBuffer**: [`SharedArrayBufferConstructor`](../interfaces/SharedArrayBufferConstructor.mdx) diff --git a/www/apps/docs/sidebars.js b/www/apps/docs/sidebars.js index ee0bd9fb45..34a9e47514 100644 --- a/www/apps/docs/sidebars.js +++ b/www/apps/docs/sidebars.js @@ -638,6 +638,18 @@ module.exports = { id: "modules/products/categories", label: "Categories", }, + { + type: "html", + value: "References", + customProps: { + sidebar_is_group_divider: true, + }, + }, + { + type: "ref", + id: "references/product/interfaces/IProductModuleService", + label: "Product Module Interface Reference", + }, { type: "html", value: "How-to", @@ -1141,7 +1153,7 @@ module.exports = { { type: "ref", id: "references/pricing/interfaces/IPricingModuleService", - label: "Pricing Module Service Reference", + label: "Pricing Module Interface Reference", }, { type: "html", @@ -2997,7 +3009,7 @@ module.exports = { { type: "doc", id: "references/pricing/interfaces/IPricingModuleService", - label: "Pricing Module Service Reference", + label: "Pricing Module Interface Reference", customProps: { sidebar_is_title: true, sidebar_icon: "folder-open", @@ -3018,4 +3030,38 @@ module.exports = { ], }, ], + productReference: [ + { + type: "ref", + id: "modules/overview", + label: "Back to Commerce Modules", + customProps: { + sidebar_is_back_link: true, + sidebar_icon: "back-arrow", + }, + }, + { + type: "doc", + id: "references/product/interfaces/IProductModuleService", + label: "Product Module Interface Reference", + customProps: { + sidebar_is_title: true, + sidebar_icon: "folder-open", + }, + }, + { + type: "category", + label: "Methods", + collapsible: false, + customProps: { + sidebar_is_group_headline: true, + }, + items: [ + { + type: "autogenerated", + dirName: "references/product/IProductModuleService/methods", + }, + ], + }, + ], }