@gooday_corp/gooday-api-client 4.5.53 → 4.5.55

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 +1 @@
1
- 7.18.0
1
+ 7.19.0
package/api.ts CHANGED
@@ -18,7 +18,7 @@ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
18
18
  import globalAxios from 'axios';
19
19
  // Some imports not used depending on template conditions
20
20
  // @ts-ignore
21
- import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
21
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded } from './common';
22
22
  import type { RequestArgs } from './base';
23
23
  // @ts-ignore
24
24
  import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base';
@@ -599,6 +599,10 @@ export interface BookingPaymentPayloadDTO {
599
599
  * Mobile number
600
600
  */
601
601
  'mobile'?: string;
602
+ /**
603
+ * Email
604
+ */
605
+ 'email'?: string;
602
606
  }
603
607
  export interface BookingRSVPResponse {
604
608
  'going': UserEntity;
package/common.ts CHANGED
@@ -66,7 +66,7 @@ export const setOAuthToObject = async function (object: any, name: string, scope
66
66
  function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
67
67
  if (parameter == null) return;
68
68
  if (typeof parameter === "object") {
69
- if (Array.isArray(parameter)) {
69
+ if (Array.isArray(parameter) || parameter instanceof Set) {
70
70
  (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
71
71
  }
72
72
  else {
@@ -91,13 +91,26 @@ export const setSearchParams = function (url: URL, ...objects: any[]) {
91
91
  url.search = searchParams.toString();
92
92
  }
93
93
 
94
+ /**
95
+ * JSON serialization helper function which replaces instances of unserializable types with serializable ones.
96
+ * This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
97
+ * Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
98
+ */
99
+ export const replaceWithSerializableTypeIfNeeded = function(key: any, value: any) {
100
+ if (value instanceof Set) {
101
+ return Array.from(value);
102
+ } else {
103
+ return value;
104
+ }
105
+ }
106
+
94
107
  export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {
95
108
  const nonString = typeof value !== 'string';
96
109
  const needsSerialization = nonString && configuration && configuration.isJsonMime
97
110
  ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
98
111
  : nonString;
99
112
  return needsSerialization
100
- ? JSON.stringify(value !== undefined ? value : {})
113
+ ? JSON.stringify(value !== undefined ? value : {}, replaceWithSerializableTypeIfNeeded)
101
114
  : (value || "");
102
115
  }
103
116
 
@@ -7,6 +7,7 @@ Name | Type | Description | Notes
7
7
  ------------ | ------------- | ------------- | -------------
8
8
  **id** | **string** | Booking ID | [default to undefined]
9
9
  **mobile** | **string** | Mobile number | [optional] [default to undefined]
10
+ **email** | **string** | Email | [optional] [default to undefined]
10
11
 
11
12
  ## Example
12
13
 
@@ -16,6 +17,7 @@ import { BookingPaymentPayloadDTO } from './api';
16
17
  const instance: BookingPaymentPayloadDTO = {
17
18
  id,
18
19
  mobile,
20
+ email,
19
21
  };
20
22
  ```
21
23
 
@@ -6,8 +6,8 @@
6
6
  Name | Type | Description | Notes
7
7
  ------------ | ------------- | ------------- | -------------
8
8
  **title** | **string** | The title of the booking | [default to 'Default Booking Title']
9
- **date** | **string** | The start date of the booking | [default to 2026-01-19T12:48:10Z]
10
- **recurrenceEndDate** | **string** | The start date of the booking | [optional] [default to 2026-01-19T12:48:10Z]
9
+ **date** | **string** | The start date of the booking | [default to 2026-01-22T17:22Z]
10
+ **recurrenceEndDate** | **string** | The start date of the booking | [optional] [default to 2026-01-22T17:22Z]
11
11
  **from** | **string** | | [optional] [default to undefined]
12
12
  **to** | **string** | | [optional] [default to undefined]
13
13
  **venue** | **string** | The venue of the booking | [default to undefined]
@@ -6,8 +6,8 @@
6
6
  Name | Type | Description | Notes
7
7
  ------------ | ------------- | ------------- | -------------
8
8
  **title** | **string** | The title of the booking | [default to 'Default Booking Title']
9
- **startDate** | **string** | The start date of the booking | [default to 2026-01-19T12:48:10Z]
10
- **endDate** | **string** | The start date of the booking | [default to 2026-01-19T12:48:10Z]
9
+ **startDate** | **string** | The start date of the booking | [default to 2026-01-22T17:22Z]
10
+ **endDate** | **string** | The start date of the booking | [default to 2026-01-22T17:22Z]
11
11
  **note** | **string** | Notes attached with booking | [optional] [default to undefined]
12
12
  **occasion** | **string** | Occasion id | [optional] [default to undefined]
13
13
  **calendar** | **Array<string>** | Calendar attached with booking | [optional] [default to undefined]
@@ -6,8 +6,8 @@
6
6
  Name | Type | Description | Notes
7
7
  ------------ | ------------- | ------------- | -------------
8
8
  **title** | **string** | The title of the booking | [default to 'Default Booking Title']
9
- **startDate** | **string** | The start date of the booking | [default to 2026-01-19T12:48:10Z]
10
- **endDate** | **string** | The start date of the booking | [default to 2026-01-19T12:48:10Z]
9
+ **startDate** | **string** | The start date of the booking | [default to 2026-01-22T17:22Z]
10
+ **endDate** | **string** | The start date of the booking | [default to 2026-01-22T17:22Z]
11
11
  **note** | **string** | Notes attached with booking | [optional] [default to undefined]
12
12
  **occasion** | **string** | Occasion id | [optional] [default to undefined]
13
13
  **calendar** | **Array<string>** | Calendar attached with booking | [optional] [default to undefined]
@@ -8,8 +8,8 @@ Name | Type | Description | Notes
8
8
  **whatsOnId** | **string** | Event ID | [optional] [default to undefined]
9
9
  **serviceId** | **string** | Service ID | [optional] [default to undefined]
10
10
  **rsvpId** | **string** | RSVP ID | [optional] [default to undefined]
11
- **startDate** | **string** | The start date of the booking | [optional] [default to 2026-01-19T12:48:08Z]
12
- **endDate** | **string** | The end date of the booking | [optional] [default to 2026-01-19T12:48:08Z]
11
+ **startDate** | **string** | The start date of the booking | [optional] [default to 2026-01-22T17:21:58Z]
12
+ **endDate** | **string** | The end date of the booking | [optional] [default to 2026-01-22T17:21:58Z]
13
13
  **discountId** | **string** | Discount ID | [optional] [default to undefined]
14
14
  **selectedStaff** | **string** | Staff ID | [optional] [default to undefined]
15
15
  **quantity** | **number** | | [optional] [default to 0]
@@ -5,7 +5,7 @@
5
5
 
6
6
  Name | Type | Description | Notes
7
7
  ------------ | ------------- | ------------- | -------------
8
- **date** | **string** | The start date of the booking | [default to 2026-01-19T12:48:10Z]
8
+ **date** | **string** | The start date of the booking | [default to 2026-01-22T17:22Z]
9
9
  **from** | **string** | | [optional] [default to undefined]
10
10
  **to** | **string** | | [optional] [default to undefined]
11
11
  **notes** | **string** | | [optional] [default to undefined]
@@ -5,8 +5,8 @@
5
5
 
6
6
  Name | Type | Description | Notes
7
7
  ------------ | ------------- | ------------- | -------------
8
- **startDate** | **string** | The start date of the waitlist | [default to 2026-01-19T12:48:10Z]
9
- **endDate** | **string** | The end date of the waitlist | [default to 2026-01-19T13:48:10Z]
8
+ **startDate** | **string** | The start date of the waitlist | [default to 2026-01-22T17:22Z]
9
+ **endDate** | **string** | The end date of the waitlist | [default to 2026-01-22T18:22Z]
10
10
  **venue** | **string** | The venue of the waitlist | [default to undefined]
11
11
  **business** | **string** | The business associated with the waitlist | [default to undefined]
12
12
  **collaborators** | [**Array<CreateWaitlistBookingCollaboratorPayload>**](CreateWaitlistBookingCollaboratorPayload.md) | The list of collaborators associated with the waitlist | [default to undefined]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooday_corp/gooday-api-client",
3
- "version": "4.5.53",
3
+ "version": "4.5.55",
4
4
  "description": "API client for Gooday",
5
5
  "main": "index.ts",
6
6
  "scripts": {},