@vulog/aima-config 1.1.63 → 1.1.65
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 +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +22 -0
- package/dist/index.mjs +21 -0
- package/package.json +3 -3
- package/src/index.ts +1 -0
- package/src/types.ts +2 -0
package/dist/index.d.mts
CHANGED
|
@@ -43,6 +43,8 @@ type PaymentParameters = {
|
|
|
43
43
|
amountValue: null | number;
|
|
44
44
|
fleetId: string;
|
|
45
45
|
providePreferredPaymentMethodPspReferences: boolean;
|
|
46
|
+
serviceId?: string;
|
|
47
|
+
modelIds?: string[];
|
|
46
48
|
};
|
|
47
49
|
|
|
48
50
|
declare const getCities: (client: Client) => Promise<City[]>;
|
|
@@ -71,4 +73,6 @@ declare const getLabels: (client: Client) => Promise<Label[]>;
|
|
|
71
73
|
declare const addLabel: (client: Client, name: string) => Promise<void>;
|
|
72
74
|
declare const removeLabel: (client: Client, labelId: number, cascade?: boolean) => Promise<void>;
|
|
73
75
|
|
|
74
|
-
|
|
76
|
+
declare const getPaymentParameters: (client: Client, serviceId?: string, modelId?: string) => Promise<PaymentParameters[] | null>;
|
|
77
|
+
|
|
78
|
+
export { type City, type FleetConf, type Label, type PaymentParameters, type Service, addLabel, getCities, getCitiesAllFranchises, getFleetConf, getLabels, getPaymentParameters, getServices, getServicesAllFranchises, removeLabel };
|
package/dist/index.d.ts
CHANGED
|
@@ -43,6 +43,8 @@ type PaymentParameters = {
|
|
|
43
43
|
amountValue: null | number;
|
|
44
44
|
fleetId: string;
|
|
45
45
|
providePreferredPaymentMethodPspReferences: boolean;
|
|
46
|
+
serviceId?: string;
|
|
47
|
+
modelIds?: string[];
|
|
46
48
|
};
|
|
47
49
|
|
|
48
50
|
declare const getCities: (client: Client) => Promise<City[]>;
|
|
@@ -71,4 +73,6 @@ declare const getLabels: (client: Client) => Promise<Label[]>;
|
|
|
71
73
|
declare const addLabel: (client: Client, name: string) => Promise<void>;
|
|
72
74
|
declare const removeLabel: (client: Client, labelId: number, cascade?: boolean) => Promise<void>;
|
|
73
75
|
|
|
74
|
-
|
|
76
|
+
declare const getPaymentParameters: (client: Client, serviceId?: string, modelId?: string) => Promise<PaymentParameters[] | null>;
|
|
77
|
+
|
|
78
|
+
export { type City, type FleetConf, type Label, type PaymentParameters, type Service, addLabel, getCities, getCitiesAllFranchises, getFleetConf, getLabels, getPaymentParameters, getServices, getServicesAllFranchises, removeLabel };
|
package/dist/index.js
CHANGED
|
@@ -25,6 +25,7 @@ __export(index_exports, {
|
|
|
25
25
|
getCitiesAllFranchises: () => getCitiesAllFranchises,
|
|
26
26
|
getFleetConf: () => getFleetConf,
|
|
27
27
|
getLabels: () => getLabels,
|
|
28
|
+
getPaymentParameters: () => getPaymentParameters,
|
|
28
29
|
getServices: () => getServices,
|
|
29
30
|
getServicesAllFranchises: () => getServicesAllFranchises,
|
|
30
31
|
removeLabel: () => removeLabel
|
|
@@ -88,6 +89,26 @@ var removeLabel = async (client, labelId, cascade = false) => {
|
|
|
88
89
|
}
|
|
89
90
|
await client.delete(`boapi/proxy/user/fleets/${client.clientOptions.fleetId}/labels/${labelId}?cascade=${cascade}`);
|
|
90
91
|
};
|
|
92
|
+
|
|
93
|
+
// src/getPaymentParameters.ts
|
|
94
|
+
var import_zod2 = require("zod");
|
|
95
|
+
var schema = import_zod2.z.object({
|
|
96
|
+
serviceId: import_zod2.z.string().uuid().optional(),
|
|
97
|
+
modelId: import_zod2.z.string().optional()
|
|
98
|
+
});
|
|
99
|
+
var getPaymentParameters = async (client, serviceId, modelId) => {
|
|
100
|
+
const validated = schema.safeParse({ serviceId, modelId });
|
|
101
|
+
if (!validated.success) {
|
|
102
|
+
throw new TypeError("Invalid parameters", {
|
|
103
|
+
cause: validated.error.issues
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
const url = `/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/payment/parameters?${new URLSearchParams({
|
|
107
|
+
...serviceId ? { serviceId } : {},
|
|
108
|
+
...modelId ? { modelId } : {}
|
|
109
|
+
}).toString()}`;
|
|
110
|
+
return client.get(url).then(({ data }) => data);
|
|
111
|
+
};
|
|
91
112
|
// Annotate the CommonJS export names for ESM import in node:
|
|
92
113
|
0 && (module.exports = {
|
|
93
114
|
addLabel,
|
|
@@ -95,6 +116,7 @@ var removeLabel = async (client, labelId, cascade = false) => {
|
|
|
95
116
|
getCitiesAllFranchises,
|
|
96
117
|
getFleetConf,
|
|
97
118
|
getLabels,
|
|
119
|
+
getPaymentParameters,
|
|
98
120
|
getServices,
|
|
99
121
|
getServicesAllFranchises,
|
|
100
122
|
removeLabel
|
package/dist/index.mjs
CHANGED
|
@@ -55,12 +55,33 @@ var removeLabel = async (client, labelId, cascade = false) => {
|
|
|
55
55
|
}
|
|
56
56
|
await client.delete(`boapi/proxy/user/fleets/${client.clientOptions.fleetId}/labels/${labelId}?cascade=${cascade}`);
|
|
57
57
|
};
|
|
58
|
+
|
|
59
|
+
// src/getPaymentParameters.ts
|
|
60
|
+
import { z as z2 } from "zod";
|
|
61
|
+
var schema = z2.object({
|
|
62
|
+
serviceId: z2.string().uuid().optional(),
|
|
63
|
+
modelId: z2.string().optional()
|
|
64
|
+
});
|
|
65
|
+
var getPaymentParameters = async (client, serviceId, modelId) => {
|
|
66
|
+
const validated = schema.safeParse({ serviceId, modelId });
|
|
67
|
+
if (!validated.success) {
|
|
68
|
+
throw new TypeError("Invalid parameters", {
|
|
69
|
+
cause: validated.error.issues
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
const url = `/boapi/proxy/user/fleets/${client.clientOptions.fleetId}/payment/parameters?${new URLSearchParams({
|
|
73
|
+
...serviceId ? { serviceId } : {},
|
|
74
|
+
...modelId ? { modelId } : {}
|
|
75
|
+
}).toString()}`;
|
|
76
|
+
return client.get(url).then(({ data }) => data);
|
|
77
|
+
};
|
|
58
78
|
export {
|
|
59
79
|
addLabel,
|
|
60
80
|
getCities,
|
|
61
81
|
getCitiesAllFranchises,
|
|
62
82
|
getFleetConf,
|
|
63
83
|
getLabels,
|
|
84
|
+
getPaymentParameters,
|
|
64
85
|
getServices,
|
|
65
86
|
getServicesAllFranchises,
|
|
66
87
|
removeLabel
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vulog/aima-config",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.65",
|
|
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": "ISC",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@vulog/aima-client": "1.1.
|
|
23
|
-
"@vulog/aima-core": "1.1.
|
|
22
|
+
"@vulog/aima-client": "1.1.65",
|
|
23
|
+
"@vulog/aima-core": "1.1.65"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"zod": "^3.24.2"
|
package/src/index.ts
CHANGED