@vulog/aima-pricing 1.2.25 → 1.2.26

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.d.mts CHANGED
@@ -30,7 +30,32 @@ type Pricing = {
30
30
  taxIncluded: boolean;
31
31
  [key: string]: any;
32
32
  };
33
+ type PricingJsonConfig = {
34
+ isTaxIncluded: boolean;
35
+ } | {
36
+ taxRates: PricingTaxRate[];
37
+ } | {
38
+ PricingParameters: Partial<PricingParameters>;
39
+ } | {
40
+ plans: PricingPlan[];
41
+ } | {
42
+ [key: string]: any;
43
+ };
44
+ type PricingResponse = {
45
+ enable: boolean;
46
+ fleetId: string;
47
+ id: string;
48
+ updateDate: string;
49
+ userId: string;
50
+ version: number;
51
+ jsonSegment: {
52
+ jsonConfig: PricingJsonConfig;
53
+ [key: string]: any;
54
+ };
55
+ };
33
56
 
34
57
  declare const getPricingById: (client: Client, id: string) => Promise<Pricing>;
35
58
 
36
- export { type Pricing, type PricingParameters, type PricingPlan, type PricingTaxRate, getPricingById };
59
+ declare const getPricingByParameter: (client: Client, pricingParameters?: Partial<PricingParameters>) => Promise<PricingResponse>;
60
+
61
+ export { type Pricing, type PricingJsonConfig, type PricingParameters, type PricingPlan, type PricingResponse, type PricingTaxRate, getPricingById, getPricingByParameter };
package/dist/index.d.ts CHANGED
@@ -30,7 +30,32 @@ type Pricing = {
30
30
  taxIncluded: boolean;
31
31
  [key: string]: any;
32
32
  };
33
+ type PricingJsonConfig = {
34
+ isTaxIncluded: boolean;
35
+ } | {
36
+ taxRates: PricingTaxRate[];
37
+ } | {
38
+ PricingParameters: Partial<PricingParameters>;
39
+ } | {
40
+ plans: PricingPlan[];
41
+ } | {
42
+ [key: string]: any;
43
+ };
44
+ type PricingResponse = {
45
+ enable: boolean;
46
+ fleetId: string;
47
+ id: string;
48
+ updateDate: string;
49
+ userId: string;
50
+ version: number;
51
+ jsonSegment: {
52
+ jsonConfig: PricingJsonConfig;
53
+ [key: string]: any;
54
+ };
55
+ };
33
56
 
34
57
  declare const getPricingById: (client: Client, id: string) => Promise<Pricing>;
35
58
 
36
- export { type Pricing, type PricingParameters, type PricingPlan, type PricingTaxRate, getPricingById };
59
+ declare const getPricingByParameter: (client: Client, pricingParameters?: Partial<PricingParameters>) => Promise<PricingResponse>;
60
+
61
+ export { type Pricing, type PricingJsonConfig, type PricingParameters, type PricingPlan, type PricingResponse, type PricingTaxRate, getPricingById, getPricingByParameter };
package/dist/index.js CHANGED
@@ -20,7 +20,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
- getPricingById: () => getPricingById
23
+ getPricingById: () => getPricingById,
24
+ getPricingByParameter: () => getPricingByParameter
24
25
  });
25
26
  module.exports = __toCommonJS(index_exports);
26
27
 
@@ -35,7 +36,13 @@ var getPricingById = async (client, id) => {
35
36
  }
36
37
  return client.get(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/pricing/${id}`).then(({ data }) => data);
37
38
  };
39
+
40
+ // src/getPricingByParameter.ts
41
+ var getPricingByParameter = async (client, pricingParameters) => {
42
+ return client.post(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/pricing`, pricingParameters).then(({ data }) => data);
43
+ };
38
44
  // Annotate the CommonJS export names for ESM import in node:
39
45
  0 && (module.exports = {
40
- getPricingById
46
+ getPricingById,
47
+ getPricingByParameter
41
48
  });
package/dist/index.mjs CHANGED
@@ -9,6 +9,12 @@ var getPricingById = async (client, id) => {
9
9
  }
10
10
  return client.get(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/pricing/${id}`).then(({ data }) => data);
11
11
  };
12
+
13
+ // src/getPricingByParameter.ts
14
+ var getPricingByParameter = async (client, pricingParameters) => {
15
+ return client.post(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/pricing`, pricingParameters).then(({ data }) => data);
16
+ };
12
17
  export {
13
- getPricingById
18
+ getPricingById,
19
+ getPricingByParameter
14
20
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vulog/aima-pricing",
3
- "version": "1.2.25",
3
+ "version": "1.2.26",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -19,8 +19,8 @@
19
19
  "author": "Vulog",
20
20
  "license": "MIT",
21
21
  "dependencies": {
22
- "@vulog/aima-client": "1.2.25",
23
- "@vulog/aima-core": "1.2.25"
22
+ "@vulog/aima-client": "1.2.26",
23
+ "@vulog/aima-core": "1.2.26"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "zod": "^3.25.76"
@@ -0,0 +1,12 @@
1
+ import { Client } from '@vulog/aima-client';
2
+
3
+ import { PricingResponse, PricingParameters } from './types';
4
+
5
+ export const getPricingByParameter = async (
6
+ client: Client,
7
+ pricingParameters?: Partial<PricingParameters>
8
+ ): Promise<PricingResponse> => {
9
+ return client
10
+ .post<PricingResponse>(`/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/pricing`, pricingParameters)
11
+ .then(({ data }) => data);
12
+ };
package/src/index.ts CHANGED
@@ -1,2 +1,3 @@
1
- export { getPricingById } from './getPricingById';
2
- export type { Pricing, PricingParameters, PricingPlan, PricingTaxRate } from './types';
1
+ export * from './getPricingById';
2
+ export * from './getPricingByParameter';
3
+ export * from './types';
package/src/types.ts CHANGED
@@ -28,3 +28,23 @@ export type Pricing = {
28
28
  taxIncluded: boolean;
29
29
  [key: string]: any;
30
30
  };
31
+
32
+ export type PricingJsonConfig =
33
+ | { isTaxIncluded: boolean }
34
+ | { taxRates: PricingTaxRate[] }
35
+ | { PricingParameters: Partial<PricingParameters> }
36
+ | { plans: PricingPlan[] }
37
+ | { [key: string]: any };
38
+
39
+ export type PricingResponse = {
40
+ enable: boolean;
41
+ fleetId: string;
42
+ id: string;
43
+ updateDate: string;
44
+ userId: string;
45
+ version: number;
46
+ jsonSegment: {
47
+ jsonConfig: PricingJsonConfig;
48
+ [key: string]: any;
49
+ };
50
+ };