@vulog/aima-billing 1.2.16 → 1.2.17

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
@@ -12,13 +12,6 @@ type ChargeProductInfo = {
12
12
  productNotes?: string;
13
13
  originId?: string;
14
14
  chargeProductRequestId?: string;
15
- additionalInfo?: {
16
- manualPayment?: boolean;
17
- };
18
- };
19
- type ManualPayment = {
20
- online?: boolean;
21
- scope: 'RENTAL' | 'DEPOSIT';
22
15
  };
23
16
  type Invoice = {
24
17
  id: string;
@@ -164,6 +157,4 @@ declare const paths: readonly ["/availableAmount", "/percentage"];
164
157
  type Paths = (typeof paths)[number];
165
158
  declare const updateWallet: (client: Client, walletId: string, actions: PatchAction<Paths>[]) => Promise<void>;
166
159
 
167
- declare const payInvoice: (client: Client, invoiceId: string, manualPayment: ManualPayment) => Promise<Invoice>;
168
-
169
- export { type ChargeProductInfo, type Credit, type Invoice, type ManualPayment, type Paths, type Receipt, type RefundableAmount, type Wallet, addCredits, chargeProduct, getInvoiceById, getRefundableAmount, getUserCreditsByEntityId, getWalletsByEntity, payInvoice, refund, updateWallet };
160
+ export { type ChargeProductInfo, type Credit, type Invoice, type Paths, type Receipt, type RefundableAmount, type Wallet, addCredits, chargeProduct, getInvoiceById, getRefundableAmount, getUserCreditsByEntityId, getWalletsByEntity, refund, updateWallet };
package/dist/index.d.ts CHANGED
@@ -12,13 +12,6 @@ type ChargeProductInfo = {
12
12
  productNotes?: string;
13
13
  originId?: string;
14
14
  chargeProductRequestId?: string;
15
- additionalInfo?: {
16
- manualPayment?: boolean;
17
- };
18
- };
19
- type ManualPayment = {
20
- online?: boolean;
21
- scope: 'RENTAL' | 'DEPOSIT';
22
15
  };
23
16
  type Invoice = {
24
17
  id: string;
@@ -164,6 +157,4 @@ declare const paths: readonly ["/availableAmount", "/percentage"];
164
157
  type Paths = (typeof paths)[number];
165
158
  declare const updateWallet: (client: Client, walletId: string, actions: PatchAction<Paths>[]) => Promise<void>;
166
159
 
167
- declare const payInvoice: (client: Client, invoiceId: string, manualPayment: ManualPayment) => Promise<Invoice>;
168
-
169
- export { type ChargeProductInfo, type Credit, type Invoice, type ManualPayment, type Paths, type Receipt, type RefundableAmount, type Wallet, addCredits, chargeProduct, getInvoiceById, getRefundableAmount, getUserCreditsByEntityId, getWalletsByEntity, payInvoice, refund, updateWallet };
160
+ export { type ChargeProductInfo, type Credit, type Invoice, type Paths, type Receipt, type RefundableAmount, type Wallet, addCredits, chargeProduct, getInvoiceById, getRefundableAmount, getUserCreditsByEntityId, getWalletsByEntity, refund, updateWallet };
package/dist/index.js CHANGED
@@ -36,7 +36,6 @@ __export(index_exports, {
36
36
  getRefundableAmount: () => getRefundableAmount,
37
37
  getUserCreditsByEntityId: () => getUserCreditsByEntityId,
38
38
  getWalletsByEntity: () => getWalletsByEntity,
39
- payInvoice: () => payInvoice,
40
39
  refund: () => refund,
41
40
  updateWallet: () => updateWallet
42
41
  });
@@ -53,10 +52,7 @@ var schema = import_zod.default.object({
53
52
  subscriptionId: import_zod.default.string().trim().min(1).uuid().nullable().optional(),
54
53
  productNotes: import_zod.default.string().trim().nullable().optional(),
55
54
  originId: import_zod.default.string().trim().nullable().optional(),
56
- chargeProductRequestId: import_zod.default.string().trim().min(1).uuid().nullable().optional(),
57
- additionalInfo: import_zod.default.object({
58
- manualPayment: import_zod.default.boolean().optional()
59
- }).optional()
55
+ chargeProductRequestId: import_zod.default.string().trim().min(1).uuid().nullable().optional()
60
56
  });
61
57
  var chargeProduct = async (client, info) => {
62
58
  const result = schema.safeParse(info);
@@ -194,28 +190,6 @@ var updateWallet = async (client, walletId, actions) => {
194
190
  }
195
191
  });
196
192
  };
197
-
198
- // src/payInvoice.ts
199
- var import_zod9 = __toESM(require("zod"));
200
- var schema6 = import_zod9.default.object({
201
- invoiceId: import_zod9.default.string().trim().min(1).uuid(),
202
- manualPayment: import_zod9.default.object({
203
- online: import_zod9.default.boolean().default(true),
204
- scope: import_zod9.default.enum(["RENTAL", "DEPOSIT"])
205
- })
206
- });
207
- var payInvoice = async (client, invoiceId, manualPayment) => {
208
- const result = schema6.safeParse({ invoiceId, manualPayment });
209
- if (!result.success) {
210
- throw new TypeError("Invalid args", {
211
- cause: result.error.issues
212
- });
213
- }
214
- return client.post(
215
- `/boapi/proxy/billing/fleets/${client.clientOptions.fleetId}/invoices/${result.data.invoiceId}/payment`,
216
- result.data.manualPayment
217
- ).then(({ data }) => data);
218
- };
219
193
  // Annotate the CommonJS export names for ESM import in node:
220
194
  0 && (module.exports = {
221
195
  addCredits,
@@ -224,7 +198,6 @@ var payInvoice = async (client, invoiceId, manualPayment) => {
224
198
  getRefundableAmount,
225
199
  getUserCreditsByEntityId,
226
200
  getWalletsByEntity,
227
- payInvoice,
228
201
  refund,
229
202
  updateWallet
230
203
  });
package/dist/index.mjs CHANGED
@@ -9,10 +9,7 @@ var schema = z.object({
9
9
  subscriptionId: z.string().trim().min(1).uuid().nullable().optional(),
10
10
  productNotes: z.string().trim().nullable().optional(),
11
11
  originId: z.string().trim().nullable().optional(),
12
- chargeProductRequestId: z.string().trim().min(1).uuid().nullable().optional(),
13
- additionalInfo: z.object({
14
- manualPayment: z.boolean().optional()
15
- }).optional()
12
+ chargeProductRequestId: z.string().trim().min(1).uuid().nullable().optional()
16
13
  });
17
14
  var chargeProduct = async (client, info) => {
18
15
  const result = schema.safeParse(info);
@@ -150,28 +147,6 @@ var updateWallet = async (client, walletId, actions) => {
150
147
  }
151
148
  });
152
149
  };
153
-
154
- // src/payInvoice.ts
155
- import z9 from "zod";
156
- var schema6 = z9.object({
157
- invoiceId: z9.string().trim().min(1).uuid(),
158
- manualPayment: z9.object({
159
- online: z9.boolean().default(true),
160
- scope: z9.enum(["RENTAL", "DEPOSIT"])
161
- })
162
- });
163
- var payInvoice = async (client, invoiceId, manualPayment) => {
164
- const result = schema6.safeParse({ invoiceId, manualPayment });
165
- if (!result.success) {
166
- throw new TypeError("Invalid args", {
167
- cause: result.error.issues
168
- });
169
- }
170
- return client.post(
171
- `/boapi/proxy/billing/fleets/${client.clientOptions.fleetId}/invoices/${result.data.invoiceId}/payment`,
172
- result.data.manualPayment
173
- ).then(({ data }) => data);
174
- };
175
150
  export {
176
151
  addCredits,
177
152
  chargeProduct,
@@ -179,7 +154,6 @@ export {
179
154
  getRefundableAmount,
180
155
  getUserCreditsByEntityId,
181
156
  getWalletsByEntity,
182
- payInvoice,
183
157
  refund,
184
158
  updateWallet
185
159
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vulog/aima-billing",
3
- "version": "1.2.16",
3
+ "version": "1.2.17",
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.16",
23
- "@vulog/aima-core": "1.2.16"
22
+ "@vulog/aima-client": "1.2.17",
23
+ "@vulog/aima-core": "1.2.17"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "zod": "^3.25.76"
@@ -13,11 +13,6 @@ const schema = z.object({
13
13
  productNotes: z.string().trim().nullable().optional(),
14
14
  originId: z.string().trim().nullable().optional(),
15
15
  chargeProductRequestId: z.string().trim().min(1).uuid().nullable().optional(),
16
- additionalInfo: z
17
- .object({
18
- manualPayment: z.boolean().optional(),
19
- })
20
- .optional(),
21
16
  });
22
17
 
23
18
  export const chargeProduct = async (client: Client, info: ChargeProductInfo) => {
package/src/index.ts CHANGED
@@ -7,4 +7,3 @@ export * from './getRefundableAmount';
7
7
  export * from './refund';
8
8
  export * from './getWalletsByEntity';
9
9
  export * from './updateWallet';
10
- export * from './payInvoice';
package/src/types.ts CHANGED
@@ -10,14 +10,6 @@ export type ChargeProductInfo = {
10
10
  productNotes?: string;
11
11
  originId?: string;
12
12
  chargeProductRequestId?: string;
13
- additionalInfo?: {
14
- manualPayment?: boolean;
15
- };
16
- };
17
-
18
- export type ManualPayment = {
19
- online?: boolean;
20
- scope: 'RENTAL' | 'DEPOSIT';
21
13
  };
22
14
 
23
15
  export type Invoice = {
package/src/payInvoice.ts DELETED
@@ -1,28 +0,0 @@
1
- import { Client } from '@vulog/aima-client';
2
- import z from 'zod';
3
-
4
- import { Invoice, ManualPayment } from './types';
5
-
6
- const schema = z.object({
7
- invoiceId: z.string().trim().min(1).uuid(),
8
- manualPayment: z.object({
9
- online: z.boolean().default(true),
10
- scope: z.enum(['RENTAL', 'DEPOSIT']),
11
- }),
12
- });
13
-
14
- export const payInvoice = async (client: Client, invoiceId: string, manualPayment: ManualPayment) => {
15
- const result = schema.safeParse({ invoiceId, manualPayment });
16
- if (!result.success) {
17
- throw new TypeError('Invalid args', {
18
- cause: result.error.issues,
19
- });
20
- }
21
-
22
- return client
23
- .post<Invoice>(
24
- `/boapi/proxy/billing/fleets/${client.clientOptions.fleetId}/invoices/${result.data.invoiceId}/payment`,
25
- result.data.manualPayment
26
- )
27
- .then(({ data }) => data);
28
- };