@instockng/api-client 1.0.20 → 1.0.22

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.
@@ -26,6 +26,7 @@ export function createRpcClients(baseURL) {
26
26
  products: hc(`${fullBaseUrl}/products`),
27
27
  deliveryZones: hc(`${fullBaseUrl}/delivery-zones`),
28
28
  brands: hc(`${fullBaseUrl}/brands`),
29
+ productAddons: hc(`${fullBaseUrl}/product-addons`),
29
30
  };
30
31
  }
31
32
  /**
@@ -57,6 +58,7 @@ export function createAdminRpcClients(baseURL) {
57
58
  abandonedCarts: hc(`${fullBaseUrl}/abandoned-carts`),
58
59
  discountCodes: hc(`${fullBaseUrl}/discount-codes`),
59
60
  deliveryZones: hc(`${fullBaseUrl}/delivery-zones`),
61
+ productAddons: hc(`${fullBaseUrl}/product-addons`),
60
62
  };
61
63
  }
62
64
  /**
@@ -17,11 +17,13 @@ export declare const queryKeys: {
17
17
  orders: {
18
18
  all: readonly ["public", "orders"];
19
19
  detail: (id: string, token: string) => readonly ["public", "orders", string, string];
20
+ recommendations: (id: string, token: string, limit?: number) => readonly ["public", "orders", string, string, "recommendations", number] | readonly ["public", "orders", string, string, "recommendations"];
20
21
  };
21
22
  products: {
22
23
  all: readonly ["public", "products"];
23
24
  list: (brandId: string) => readonly ["public", "products", string];
24
25
  detail: (productId: string) => readonly ["public", "products", string];
26
+ addons: (slug: string, limit?: number) => readonly ["public", "products", string, "addons", number];
25
27
  };
26
28
  deliveryZones: {
27
29
  all: readonly ["public", "delivery-zones"];
@@ -48,6 +50,7 @@ export declare const queryKeys: {
48
50
  all: readonly ["admin", "products"];
49
51
  list: (brandId?: string) => readonly ["admin", "products", "list", string];
50
52
  detail: (id: string) => readonly ["admin", "products", string];
53
+ addons: (id: string) => readonly ["admin", "products", string, "addons"];
51
54
  };
52
55
  variants: {
53
56
  all: readonly ["admin", "variants"];
@@ -20,11 +20,15 @@ export const queryKeys = {
20
20
  orders: {
21
21
  all: ['public', 'orders'],
22
22
  detail: (id, token) => ['public', 'orders', id, token],
23
+ recommendations: (id, token, limit) => limit !== undefined
24
+ ? ['public', 'orders', id, token, 'recommendations', limit]
25
+ : ['public', 'orders', id, token, 'recommendations'],
23
26
  },
24
27
  products: {
25
28
  all: ['public', 'products'],
26
29
  list: (brandId) => ['public', 'products', brandId],
27
30
  detail: (productId) => ['public', 'products', productId],
31
+ addons: (slug, limit) => ['public', 'products', slug, 'addons', limit],
28
32
  },
29
33
  deliveryZones: {
30
34
  all: ['public', 'delivery-zones'],
@@ -52,6 +56,7 @@ export const queryKeys = {
52
56
  all: ['admin', 'products'],
53
57
  list: (brandId) => ['admin', 'products', 'list', brandId],
54
58
  detail: (id) => ['admin', 'products', id],
59
+ addons: (id) => ['admin', 'products', id, 'addons'],
55
60
  },
56
61
  variants: {
57
62
  all: ['admin', 'variants'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instockng/api-client",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "description": "React Query hooks for OMS API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,13 +22,6 @@
22
22
  "dist",
23
23
  "README.md"
24
24
  ],
25
- "scripts": {
26
- "type-check": "tsc --noEmit",
27
- "build": "tsc --project tsconfig.build.json --noEmitOnError false && node scripts/fix-dist.mjs",
28
- "generate-types": "node scripts/generate-backend-types.mjs",
29
- "prebuild": "pnpm run generate-types",
30
- "prepublishOnly": "pnpm run generate-types"
31
- },
32
25
  "keywords": [
33
26
  "api",
34
27
  "react-query",
@@ -52,5 +45,11 @@
52
45
  "axios": "^1.6.5",
53
46
  "react": "^19.0.0",
54
47
  "typescript": "^5.3.3"
48
+ },
49
+ "scripts": {
50
+ "type-check": "tsc --noEmit",
51
+ "build": "tsc --project tsconfig.build.json --noEmitOnError false && node scripts/fix-dist.mjs",
52
+ "generate-types": "node scripts/generate-backend-types.mjs",
53
+ "prebuild": "pnpm run generate-types"
55
54
  }
56
- }
55
+ }