@uappi/public-sdk 1.11.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,27 @@
1
+ import { usePublicApi } from '..';
2
+
3
+ import type {
4
+ ApiParams,
5
+ Product,
6
+ ProductFields,
7
+ ProductConditionFields,
8
+ ProductSortFields,
9
+ } from '../types';
10
+
11
+ export function getProductById(
12
+ productId: number,
13
+ options?: Pick<
14
+ ApiParams<ProductFields, ProductSortFields, ProductConditionFields>,
15
+ 'condition' | 'fields' | 'meta'
16
+ >,
17
+ ) {
18
+ return usePublicApi<
19
+ Product,
20
+ ProductFields,
21
+ ProductSortFields,
22
+ ProductConditionFields
23
+ >({
24
+ endpoint: `/publics/products/${productId}`,
25
+ params: options,
26
+ });
27
+ }
@@ -63,6 +63,7 @@ import {
63
63
  createProductComment,
64
64
  listProductComments,
65
65
  } from './endpoints/ProductCommentComposable';
66
+ import { getProductById } from './endpoints/ProductComposable';
66
67
  import { listShipmentQuoteProduct } from './endpoints/ProductQuoteShipment';
67
68
  import {
68
69
  createProductReview,
@@ -168,6 +169,7 @@ const product = {
168
169
  getUrl,
169
170
  getVerify,
170
171
  getSearch,
172
+ getProductById,
171
173
  listShipmentQuoteProduct,
172
174
  deleteProductComment,
173
175
  createProductComment,
@@ -36,6 +36,8 @@ export interface Product {
36
36
  medias: null | Array<Media>;
37
37
  originalPrice: null;
38
38
  parentProductId: null | number;
39
+ parentProduct: null | Product;
40
+ haveChildren: boolean;
39
41
  price: null | ProductPrice;
40
42
  priceRules: null;
41
43
  relatedProducts: null;
@@ -53,6 +55,7 @@ export interface Product {
53
55
 
54
56
  combination: Array<never>;
55
57
  createdAt: string;
58
+ deletedAt: null | string;
56
59
  isGiftCard: boolean;
57
60
 
58
61
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uappi/public-sdk",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "Pacotes públicos para desenvolvimento do ecossistema Uappi",
5
5
  "main": "main.ts",
6
6
  "scripts": {