arky-sdk 0.7.46 → 0.7.47

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.
@@ -1,11 +1,12 @@
1
- import { Payment, InventoryLevel } from './types.js';
1
+ import { BookingPayment, OrderPayment, InventoryLevel } from './types.cjs';
2
2
 
3
+ type AnyPayment = Pick<BookingPayment, 'total' | 'currency'> | Pick<OrderPayment, 'total' | 'currency'>;
3
4
  declare function convertToMajor(minorAmount: number, currency: string): number;
4
5
  declare function convertToMinor(majorAmount: number, currency: string): number;
5
6
  declare function getCurrencySymbol(currency: string): string;
6
7
  declare function getCurrencyName(currency: string): string;
7
8
  declare function formatMinor(amountMinor: number, currency: string): string;
8
- declare function formatPayment(payment: Payment): string;
9
+ declare function formatPayment(payment: AnyPayment): string;
9
10
 
10
11
  declare function isValidKey(key: string): boolean;
11
12
  declare function validateKey(key: string): {
@@ -1,11 +1,12 @@
1
- import { Payment, InventoryLevel } from './types.cjs';
1
+ import { BookingPayment, OrderPayment, InventoryLevel } from './types.js';
2
2
 
3
+ type AnyPayment = Pick<BookingPayment, 'total' | 'currency'> | Pick<OrderPayment, 'total' | 'currency'>;
3
4
  declare function convertToMajor(minorAmount: number, currency: string): number;
4
5
  declare function convertToMinor(majorAmount: number, currency: string): number;
5
6
  declare function getCurrencySymbol(currency: string): string;
6
7
  declare function getCurrencyName(currency: string): string;
7
8
  declare function formatMinor(amountMinor: number, currency: string): string;
8
- declare function formatPayment(payment: Payment): string;
9
+ declare function formatPayment(payment: AnyPayment): string;
9
10
 
10
11
  declare function isValidKey(key: string): boolean;
11
12
  declare function validateKey(key: string): {
package/dist/index.cjs CHANGED
@@ -357,14 +357,6 @@ var createBusinessApi = (apiConfig) => {
357
357
  params: queryParams
358
358
  });
359
359
  },
360
- async processRefund(params, options) {
361
- const { id, ...payload } = params;
362
- return apiConfig.httpClient.post(
363
- `/v1/businesses/${id}/refund`,
364
- payload,
365
- options
366
- );
367
- },
368
360
  async oauthConnect(params, options) {
369
361
  return apiConfig.httpClient.post(
370
362
  `/v1/businesses/${params.businessId}/oauth/connect`,
@@ -881,6 +873,13 @@ var createEshopApi = (apiConfig) => {
881
873
  { ...params, businessId: apiConfig.businessId, market: apiConfig.market },
882
874
  options
883
875
  );
876
+ },
877
+ async processRefund(params, options) {
878
+ return apiConfig.httpClient.post(
879
+ `/v1/businesses/${apiConfig.businessId}/orders/${params.id}/refund`,
880
+ { amount: params.amount },
881
+ options
882
+ );
884
883
  }
885
884
  };
886
885
  };
@@ -966,6 +965,13 @@ var createBookingApi = (apiConfig) => {
966
965
  options
967
966
  );
968
967
  },
968
+ async processRefund(params, options) {
969
+ return apiConfig.httpClient.post(
970
+ `/v1/businesses/${apiConfig.businessId}/bookings/${params.id}/refund`,
971
+ { amount: params.amount },
972
+ options
973
+ );
974
+ },
969
975
  async getAvailability(params, options) {
970
976
  const { businessId, ...query } = params;
971
977
  const targetBusinessId = businessId || apiConfig.businessId;
@@ -2225,7 +2231,7 @@ function getFirstAvailableFCId(variant, quantity = 1) {
2225
2231
  }
2226
2232
 
2227
2233
  // src/index.ts
2228
- var SDK_VERSION = "0.7.26";
2234
+ var SDK_VERSION = "0.7.27";
2229
2235
  var SUPPORTED_FRAMEWORKS = [
2230
2236
  "astro",
2231
2237
  "react",