@vulog/aima-product 1.2.30 → 1.2.31

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.
package/dist/index.cjs ADDED
@@ -0,0 +1,13 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/getProductById.ts
3
+ const getProductById = async (client, id) => {
4
+ return client.get(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/products/${id}`).then(({ data: { fleetId, ...product } }) => product);
5
+ };
6
+ //#endregion
7
+ //#region src/getProducts.ts
8
+ const getProducts = async (client) => {
9
+ return client.get(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/products`).then(({ data }) => data.map(({ fleetId, ...product }) => product));
10
+ };
11
+ //#endregion
12
+ exports.getProductById = getProductById;
13
+ exports.getProducts = getProducts;
@@ -0,0 +1,32 @@
1
+ import { Client } from "@vulog/aima-client";
2
+
3
+ //#region src/types.d.ts
4
+ type ProductTaxe = {
5
+ taxName?: string;
6
+ taxRate: number;
7
+ [key: string]: any;
8
+ };
9
+ type Product = ProductTaxe & {
10
+ id: string;
11
+ type: string;
12
+ name: string;
13
+ price: number;
14
+ taxIncluded: boolean;
15
+ taxName: string;
16
+ priceRate?: number;
17
+ serviceIds: string[];
18
+ taxes: (ProductTaxe & {
19
+ id: string;
20
+ })[];
21
+ pricePerUnitExceedingAllowance: number;
22
+ distanceIncluded: number;
23
+ [key: string]: any;
24
+ };
25
+ //#endregion
26
+ //#region src/getProductById.d.ts
27
+ declare const getProductById: (client: Client, id: string) => Promise<Product>;
28
+ //#endregion
29
+ //#region src/getProducts.d.ts
30
+ declare const getProducts: (client: Client) => Promise<Product[]>;
31
+ //#endregion
32
+ export { type Product, type ProductTaxe, getProductById, getProducts };
package/dist/index.d.mts CHANGED
@@ -1,29 +1,32 @@
1
- import { Client } from '@vulog/aima-client';
1
+ import { Client } from "@vulog/aima-client";
2
2
 
3
+ //#region src/types.d.ts
3
4
  type ProductTaxe = {
4
- taxName?: string;
5
- taxRate: number;
6
- [key: string]: any;
5
+ taxName?: string;
6
+ taxRate: number;
7
+ [key: string]: any;
7
8
  };
8
9
  type Product = ProductTaxe & {
10
+ id: string;
11
+ type: string;
12
+ name: string;
13
+ price: number;
14
+ taxIncluded: boolean;
15
+ taxName: string;
16
+ priceRate?: number;
17
+ serviceIds: string[];
18
+ taxes: (ProductTaxe & {
9
19
  id: string;
10
- type: string;
11
- name: string;
12
- price: number;
13
- taxIncluded: boolean;
14
- taxName: string;
15
- priceRate?: number;
16
- serviceIds: string[];
17
- taxes: (ProductTaxe & {
18
- id: string;
19
- })[];
20
- pricePerUnitExceedingAllowance: number;
21
- distanceIncluded: number;
22
- [key: string]: any;
20
+ })[];
21
+ pricePerUnitExceedingAllowance: number;
22
+ distanceIncluded: number;
23
+ [key: string]: any;
23
24
  };
24
-
25
+ //#endregion
26
+ //#region src/getProductById.d.ts
25
27
  declare const getProductById: (client: Client, id: string) => Promise<Product>;
26
-
28
+ //#endregion
29
+ //#region src/getProducts.d.ts
27
30
  declare const getProducts: (client: Client) => Promise<Product[]>;
28
-
29
- export { type Product, type ProductTaxe, getProductById, getProducts };
31
+ //#endregion
32
+ export { type Product, type ProductTaxe, getProductById, getProducts };
package/dist/index.mjs CHANGED
@@ -1,13 +1,11 @@
1
- // src/getProductById.ts
2
- var getProductById = async (client, id) => {
3
- return client.get(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/products/${id}`).then(({ data: { fleetId, ...product } }) => product);
1
+ //#region src/getProductById.ts
2
+ const getProductById = async (client, id) => {
3
+ return client.get(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/products/${id}`).then(({ data: { fleetId, ...product } }) => product);
4
4
  };
5
-
6
- // src/getProducts.ts
7
- var getProducts = async (client) => {
8
- return client.get(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/products`).then(({ data }) => data.map(({ fleetId, ...product }) => product));
9
- };
10
- export {
11
- getProductById,
12
- getProducts
5
+ //#endregion
6
+ //#region src/getProducts.ts
7
+ const getProducts = async (client) => {
8
+ return client.get(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/products`).then(({ data }) => data.map(({ fleetId, ...product }) => product));
13
9
  };
10
+ //#endregion
11
+ export { getProductById, getProducts };
package/package.json CHANGED
@@ -1,13 +1,26 @@
1
1
  {
2
2
  "name": "@vulog/aima-product",
3
- "version": "1.2.30",
4
- "main": "dist/index.js",
3
+ "type": "module",
4
+ "version": "1.2.31",
5
+ "main": "dist/index.cjs",
5
6
  "module": "dist/index.mjs",
6
- "types": "dist/index.d.ts",
7
+ "types": "dist/index.d.cts",
8
+ "exports": {
9
+ ".": {
10
+ "import": {
11
+ "types": "./dist/index.d.mts",
12
+ "default": "./dist/index.mjs"
13
+ },
14
+ "require": {
15
+ "types": "./dist/index.d.cts",
16
+ "default": "./dist/index.cjs"
17
+ }
18
+ }
19
+ },
7
20
  "scripts": {
8
- "build": "tsup",
9
- "dev": "tsup --watch",
10
- "test": "vitest run",
21
+ "build": "tsdown",
22
+ "dev": "tsdown --watch",
23
+ "test": "vitest run --passWithNoTests",
11
24
  "test:watch": "vitest",
12
25
  "lint": "eslint src/**/* --ext .ts"
13
26
  },
@@ -19,8 +32,8 @@
19
32
  "author": "Vulog",
20
33
  "license": "MIT",
21
34
  "dependencies": {
22
- "@vulog/aima-client": "1.2.30",
23
- "@vulog/aima-core": "1.2.30"
35
+ "@vulog/aima-client": "1.2.31",
36
+ "@vulog/aima-core": "1.2.31"
24
37
  },
25
38
  "peerDependencies": {
26
39
  "zod": "^3.25.76"
@@ -1,4 +1,4 @@
1
- import { defineConfig } from 'tsup';
1
+ import { defineConfig } from 'tsdown';
2
2
 
3
3
  export default defineConfig({
4
4
  entry: ['src/index.ts'],
package/dist/index.d.ts DELETED
@@ -1,29 +0,0 @@
1
- import { Client } from '@vulog/aima-client';
2
-
3
- type ProductTaxe = {
4
- taxName?: string;
5
- taxRate: number;
6
- [key: string]: any;
7
- };
8
- type Product = ProductTaxe & {
9
- id: string;
10
- type: string;
11
- name: string;
12
- price: number;
13
- taxIncluded: boolean;
14
- taxName: string;
15
- priceRate?: number;
16
- serviceIds: string[];
17
- taxes: (ProductTaxe & {
18
- id: string;
19
- })[];
20
- pricePerUnitExceedingAllowance: number;
21
- distanceIncluded: number;
22
- [key: string]: any;
23
- };
24
-
25
- declare const getProductById: (client: Client, id: string) => Promise<Product>;
26
-
27
- declare const getProducts: (client: Client) => Promise<Product[]>;
28
-
29
- export { type Product, type ProductTaxe, getProductById, getProducts };
package/dist/index.js DELETED
@@ -1,41 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- getProductById: () => getProductById,
24
- getProducts: () => getProducts
25
- });
26
- module.exports = __toCommonJS(index_exports);
27
-
28
- // src/getProductById.ts
29
- var getProductById = async (client, id) => {
30
- return client.get(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/products/${id}`).then(({ data: { fleetId, ...product } }) => product);
31
- };
32
-
33
- // src/getProducts.ts
34
- var getProducts = async (client) => {
35
- return client.get(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/products`).then(({ data }) => data.map(({ fleetId, ...product }) => product));
36
- };
37
- // Annotate the CommonJS export names for ESM import in node:
38
- 0 && (module.exports = {
39
- getProductById,
40
- getProducts
41
- });
File without changes