@longvansoftware/storefront-js-client 4.2.7 → 4.2.9

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.
@@ -1,4 +1,5 @@
1
1
  export declare const GET_PRODUCT_BY_ID_QUERY: import("graphql").DocumentNode;
2
+ export declare const GET_SIMPLE_PRODUCT_BY_ID_QUERY: import("graphql").DocumentNode;
2
3
  export declare const GET_PRODUCT_BY_SLUG_QUERY: import("graphql").DocumentNode;
3
4
  export declare const GET_SIMPLE_PRODUCTS_QUERY: import("graphql").DocumentNode;
4
5
  export declare const GET_CATEGORIES_QUERY: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_CATEGORY_BY_HANDLE = exports.GET_CATEGORY_BY_ID = exports.GET_PRODUCT_BY_GROUPID = exports.GET_TAGS = exports.GET_BRAND = exports.GET_GROUPS = exports.GET_PRODUCT_TEMPLATES = exports.GET_PRODUCT_VARIANT_BY_ID = exports.GET_UNITS = exports.GET_PRODUCT = exports.GET_PRODUCT_IMAGE = exports.GET_DETAIL_STORES = exports.GET_STORES = exports.GET_POLICY = exports.GET_PRODUCT_OPTION = exports.GET_BRAND_DETAIL_QUERY = exports.GET_BRANDS_BY_CATEGORY_QUERY = exports.GET_BRANDS_QUERY = exports.GET_CATEGORY_BY_ID_QUERY = exports.GET_CATEGORY_BY_HANDLE_QUERY = exports.GET_CATEGORIES_QUERY = exports.GET_SIMPLE_PRODUCTS_QUERY = exports.GET_PRODUCT_BY_SLUG_QUERY = exports.GET_PRODUCT_BY_ID_QUERY = void 0;
3
+ exports.GET_CATEGORY_BY_HANDLE = exports.GET_CATEGORY_BY_ID = exports.GET_PRODUCT_BY_GROUPID = exports.GET_TAGS = exports.GET_BRAND = exports.GET_GROUPS = exports.GET_PRODUCT_TEMPLATES = exports.GET_PRODUCT_VARIANT_BY_ID = exports.GET_UNITS = exports.GET_PRODUCT = exports.GET_PRODUCT_IMAGE = exports.GET_DETAIL_STORES = exports.GET_STORES = exports.GET_POLICY = exports.GET_PRODUCT_OPTION = exports.GET_BRAND_DETAIL_QUERY = exports.GET_BRANDS_BY_CATEGORY_QUERY = exports.GET_BRANDS_QUERY = exports.GET_CATEGORY_BY_ID_QUERY = exports.GET_CATEGORY_BY_HANDLE_QUERY = exports.GET_CATEGORIES_QUERY = exports.GET_SIMPLE_PRODUCTS_QUERY = exports.GET_PRODUCT_BY_SLUG_QUERY = exports.GET_SIMPLE_PRODUCT_BY_ID_QUERY = exports.GET_PRODUCT_BY_ID_QUERY = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  // export const GET_PRODUCT_BY_ID_QUERY = gql`
6
6
  // query GetProductById(
@@ -175,6 +175,138 @@ exports.GET_PRODUCT_BY_ID_QUERY = (0, graphql_tag_1.gql) `
175
175
  description
176
176
  createStamp
177
177
  createdBy
178
+ usedCreatedChild
179
+ valuesFull {
180
+ id
181
+ name
182
+ }
183
+ }
184
+ }
185
+ featureTypes {
186
+ id
187
+ name
188
+ values
189
+ valuesFull {
190
+ id
191
+ name
192
+ }
193
+ }
194
+ categories {
195
+ id
196
+ title
197
+ handle
198
+ }
199
+ unitDTO {
200
+ id
201
+ name
202
+ }
203
+ }
204
+ }
205
+ `;
206
+ exports.GET_SIMPLE_PRODUCT_BY_ID_QUERY = (0, graphql_tag_1.gql) `
207
+ query GetSimpleProductById(
208
+ $partnerId: String!
209
+ $storeChannel: String!
210
+ $productId: String!
211
+ ) {
212
+ getSimpleProductById(
213
+ partnerId: $partnerId
214
+ storeChannel: $storeChannel
215
+ productId: $productId
216
+ ) {
217
+ id
218
+ title
219
+ description
220
+ sku
221
+ shortDescription
222
+ weight
223
+ width
224
+ depth
225
+ height
226
+ vat
227
+ priceType
228
+ qualify
229
+ parentId
230
+ handle
231
+ price
232
+ options
233
+ optionsRelationship
234
+ compareAtPrice
235
+ featuredImage
236
+ images
237
+ tags
238
+ version
239
+ brand {
240
+ id
241
+ createStamp
242
+ createdBy
243
+ name
244
+ image
245
+ imageIcon
246
+ }
247
+ featureTypes {
248
+ id
249
+ keyId
250
+ name
251
+ position
252
+ type
253
+ subType
254
+ fill
255
+ requireData
256
+ otherItem
257
+ values
258
+ description
259
+ createStamp
260
+ createdBy
261
+ usedCreatedChild
262
+ }
263
+ attributeDTOS {
264
+ id
265
+ key
266
+ extendFromSource
267
+ value {
268
+ name
269
+ value
270
+ }
271
+ metadata {
272
+ type
273
+ dataFrom
274
+ description
275
+ requiredData
276
+ otherItem
277
+ fill
278
+ }
279
+ }
280
+ productAttributes {
281
+ attributeName
282
+ attributeValue
283
+ }
284
+ variants {
285
+ id
286
+ handle
287
+ title
288
+ price
289
+ compareAtPrice
290
+ options
291
+ optionsIds
292
+ featuredImage
293
+ sku
294
+ priceType
295
+ featureTypeDTOS {
296
+ id
297
+ keyId
298
+ name
299
+ position
300
+ type
301
+ subType
302
+ fill
303
+ requireData
304
+ otherItem
305
+ values
306
+ description
307
+ createStamp
308
+ createdBy
309
+ usedCreatedChild
178
310
  valuesFull {
179
311
  id
180
312
  name
@@ -18,6 +18,7 @@ export declare class ProductService extends Service {
18
18
  * @throws If an error occurs while fetching the product.
19
19
  */
20
20
  getProductById(productId: string): Promise<any>;
21
+ getSimpleProductById(productId: string): Promise<any>;
21
22
  /**
22
23
  * Retrieves a product by its slug.
23
24
  * @param slug - The slug of the product.
@@ -66,6 +66,24 @@ class ProductService extends serviceSDK_1.Service {
66
66
  }
67
67
  });
68
68
  }
69
+ getSimpleProductById(productId) {
70
+ return __awaiter(this, void 0, void 0, function* () {
71
+ const query = queries_1.GET_SIMPLE_PRODUCT_BY_ID_QUERY;
72
+ const variables = {
73
+ partnerId: this.orgId,
74
+ storeChannel: this.storeId,
75
+ productId,
76
+ };
77
+ try {
78
+ const response = yield this.graphqlQuery(query, variables);
79
+ return response.getSimpleProductById;
80
+ }
81
+ catch (error) {
82
+ console.log(`Error fetching product by ID: ${error}`);
83
+ throw error;
84
+ }
85
+ });
86
+ }
69
87
  /**
70
88
  * Retrieves a product by its slug.
71
89
  * @param slug - The slug of the product.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "4.2.7",
3
+ "version": "4.2.9",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [