@onemineral/pms-js-sdk 0.1.35 → 0.1.36
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/cjs/generated/amenity.d.ts +2 -2
- package/dist/cjs/generated/booking.d.ts +2 -2
- package/dist/cjs/generated/collection.d.ts +2 -2
- package/dist/cjs/generated/location.d.ts +2 -2
- package/dist/cjs/generated/property.d.ts +3 -3
- package/dist/cjs/generated/shared.d.ts +6 -0
- package/dist/cjs/generated/stay.d.ts +3 -2
- package/dist/cjs/generated/stay.js.map +1 -1
- package/dist/cjs/generated/tenant.d.ts +3 -3
- package/dist/cjs/generated/website-channel.d.ts +2 -2
- package/dist/cjs/multipart.js +10 -0
- package/dist/cjs/multipart.js.map +1 -1
- package/dist/cjs/utils.d.ts +2 -0
- package/dist/cjs/utils.js +7 -2
- package/dist/cjs/utils.js.map +1 -1
- package/dist/esm/generated/amenity.d.ts +2 -2
- package/dist/esm/generated/booking.d.ts +2 -2
- package/dist/esm/generated/collection.d.ts +2 -2
- package/dist/esm/generated/location.d.ts +2 -2
- package/dist/esm/generated/property.d.ts +3 -3
- package/dist/esm/generated/shared.d.ts +6 -0
- package/dist/esm/generated/stay.d.ts +3 -2
- package/dist/esm/generated/stay.js.map +1 -1
- package/dist/esm/generated/tenant.d.ts +3 -3
- package/dist/esm/generated/website-channel.d.ts +2 -2
- package/dist/esm/multipart.js +11 -1
- package/dist/esm/multipart.js.map +1 -1
- package/dist/esm/utils.d.ts +2 -0
- package/dist/esm/utils.js +5 -1
- package/dist/esm/utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { TranslatedText } from './shared';
|
|
2
|
+
import { TranslatedText, NodeFileUpload } from './shared';
|
|
3
3
|
import { AmenityGroup } from './amenity-group';
|
|
4
4
|
import { Image } from './image';
|
|
5
5
|
import { Property } from './property';
|
|
@@ -111,7 +111,7 @@ export interface AmenityHistoryParams {
|
|
|
111
111
|
export interface AmenityUploadImageParams {
|
|
112
112
|
id: number;
|
|
113
113
|
description?: string | null;
|
|
114
|
-
file: string | Blob | Buffer;
|
|
114
|
+
file: string | Blob | Buffer | NodeFileUpload;
|
|
115
115
|
}
|
|
116
116
|
export interface AmenityDeleteImageParams {
|
|
117
117
|
id: number;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Property } from './property';
|
|
3
3
|
import { PartnerAccount } from './partner-account';
|
|
4
4
|
import { Currency } from './currency';
|
|
5
|
-
import { DateRange } from './shared';
|
|
5
|
+
import { DateRange, NodeFileUpload } from './shared';
|
|
6
6
|
import { Channel } from './channel';
|
|
7
7
|
import { BookingProduct } from './booking-product';
|
|
8
8
|
import { ServiceRequest } from './service-request';
|
|
@@ -489,7 +489,7 @@ export interface BookingImportBookingsParams {
|
|
|
489
489
|
}>;
|
|
490
490
|
}
|
|
491
491
|
export interface BookingImportFromFileParams {
|
|
492
|
-
file: string | Blob | Buffer;
|
|
492
|
+
file: string | Blob | Buffer | NodeFileUpload;
|
|
493
493
|
}
|
|
494
494
|
export interface BookingUpdateTaCommissionParams {
|
|
495
495
|
booking: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Image } from './image';
|
|
3
|
-
import { TranslatedText } from './shared';
|
|
3
|
+
import { TranslatedText, NodeFileUpload } from './shared';
|
|
4
4
|
import { Seo } from './seo';
|
|
5
5
|
import { Property } from './property';
|
|
6
6
|
import { Location } from './location';
|
|
@@ -124,7 +124,7 @@ export interface CollectionSyncTagsParams {
|
|
|
124
124
|
export interface CollectionUploadImageParams {
|
|
125
125
|
id: number;
|
|
126
126
|
description?: string | null;
|
|
127
|
-
file: string | Blob | Buffer;
|
|
127
|
+
file: string | Blob | Buffer | NodeFileUpload;
|
|
128
128
|
}
|
|
129
129
|
export interface CollectionUpdateImageParams {
|
|
130
130
|
id: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Image } from './image';
|
|
3
|
-
import { TranslatedText, Geo } from './shared';
|
|
3
|
+
import { TranslatedText, Geo, NodeFileUpload } from './shared';
|
|
4
4
|
import { Country } from './country';
|
|
5
5
|
import { Collection } from './collection';
|
|
6
6
|
import { Tag } from './tag';
|
|
@@ -131,7 +131,7 @@ export interface LocationAutocompleteParams {
|
|
|
131
131
|
export interface LocationUploadImageParams {
|
|
132
132
|
id: number;
|
|
133
133
|
description?: string | null;
|
|
134
|
-
file: string | Blob | Buffer;
|
|
134
|
+
file: string | Blob | Buffer | NodeFileUpload;
|
|
135
135
|
}
|
|
136
136
|
export interface LocationUpdateImageParams {
|
|
137
137
|
id: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Image } from './image';
|
|
3
|
-
import { TranslatedText, Geo, DateRange } from './shared';
|
|
3
|
+
import { TranslatedText, Geo, DateRange, NodeFileUpload } from './shared';
|
|
4
4
|
import { Location } from './location';
|
|
5
5
|
import { PropertyType } from './property-type';
|
|
6
6
|
import { Currency } from './currency';
|
|
@@ -446,7 +446,7 @@ export interface PropertyImportParams {
|
|
|
446
446
|
export interface PropertyUploadImageParams {
|
|
447
447
|
id: number;
|
|
448
448
|
description?: string | null;
|
|
449
|
-
file: string | Blob | Buffer;
|
|
449
|
+
file: string | Blob | Buffer | NodeFileUpload;
|
|
450
450
|
}
|
|
451
451
|
export interface PropertyDeleteImageParams {
|
|
452
452
|
id: number;
|
|
@@ -901,7 +901,7 @@ export interface PropertyCreateHomeownerBookingParams {
|
|
|
901
901
|
export interface PropertyUploadFloorImageParams {
|
|
902
902
|
id: number;
|
|
903
903
|
description?: string | null;
|
|
904
|
-
file: string | Blob | Buffer;
|
|
904
|
+
file: string | Blob | Buffer | NodeFileUpload;
|
|
905
905
|
}
|
|
906
906
|
export interface PropertyDeleteFloorImageParams {
|
|
907
907
|
id: number;
|
|
@@ -4,6 +4,7 @@ import { Image } from './image';
|
|
|
4
4
|
import { ApiClient } from '../api-client';
|
|
5
5
|
import { RequestOptions } from '../request-options';
|
|
6
6
|
import { Response } from '../response';
|
|
7
|
+
import { NodeFileUpload } from './shared';
|
|
7
8
|
export interface Stay {
|
|
8
9
|
id: number;
|
|
9
10
|
booking?: Booking;
|
|
@@ -99,12 +100,12 @@ export interface StayUpdateParams {
|
|
|
99
100
|
export interface StayUploadIdentificationDocumentParams {
|
|
100
101
|
id: number;
|
|
101
102
|
description?: string | null;
|
|
102
|
-
file: string | Blob | Buffer;
|
|
103
|
+
file: string | Blob | Buffer | NodeFileUpload;
|
|
103
104
|
}
|
|
104
105
|
export interface StayUploadSignatureParams {
|
|
105
106
|
id: number;
|
|
106
107
|
description?: string | null;
|
|
107
|
-
file: string | Blob | Buffer;
|
|
108
|
+
file: string | Blob | Buffer | NodeFileUpload;
|
|
108
109
|
}
|
|
109
110
|
export interface StayUpdateVisitorsParams {
|
|
110
111
|
booking: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stay.js","sourceRoot":"","sources":["../../../src/generated/stay.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"stay.js","sourceRoot":"","sources":["../../../src/generated/stay.ts"],"names":[],"mappings":";;;;AA4CA,MAAa,UAAU;IACnB,YAAoC,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;QAEhD,SAAI,GAAW,MAAM,CAAC;IAF6B,CAAC;IAI/C,KAAK,CACd,MAAuB,EACvB,OAAwB;;YAExB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,QAAQ,EAAE;gBAChD,MAAM;gBACN,OAAO;aACV,CAAC,CAAC;QACP,CAAC;KAAA;IAEY,MAAM,CACf,MAAwB,EACxB,OAAwB;;YAExB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,SAAS,EAAE;gBACjD,MAAM;gBACN,OAAO;aACV,CAAC,CAAC;QACP,CAAC;KAAA;IAEY,4BAA4B,CACrC,MAA8C,EAC9C,OAAwB;;YAExB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CACzB,GAAG,IAAI,CAAC,IAAI,iCAAiC,EAC7C,EAAE,MAAM,EAAE,OAAO,kCAAO,OAAO,KAAE,UAAU,EAAE,IAAI,GAAE,EAAE,CACxD,CAAC;QACN,CAAC;KAAA;IAEY,eAAe,CACxB,MAAiC,EACjC,OAAwB;;YAExB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,mBAAmB,EAAE;gBAC3D,MAAM;gBACN,OAAO,kCAAO,OAAO,KAAE,UAAU,EAAE,IAAI,GAAE;aAC5C,CAAC,CAAC;QACP,CAAC;KAAA;IAEY,cAAc,CACvB,MAAgC,EAChC,OAAwB;;YAExB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,kBAAkB,EAAE;gBAC1D,MAAM;gBACN,OAAO;aACV,CAAC,CAAC;QACP,CAAC;KAAA;IAEY,0BAA0B,CACnC,MAA4C,EAC5C,OAAwB;;YAExB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CACzB,GAAG,IAAI,CAAC,IAAI,+BAA+B,EAC3C,EAAE,MAAM,EAAE,OAAO,EAAE,CACtB,CAAC;QACN,CAAC;KAAA;IAEY,gBAAgB,CACzB,MAAkC,EAClC,OAAwB;;YAExB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,qBAAqB,EAAE;gBAC7D,MAAM;gBACN,OAAO;aACV,CAAC,CAAC;QACP,CAAC;KAAA;CACJ;AA1ED,gCA0EC"}
|
|
@@ -8,7 +8,7 @@ import { TenantBilling } from './tenant-billing';
|
|
|
8
8
|
import { GuestAgreementConfig } from './guest-agreement-config';
|
|
9
9
|
import { User } from './user';
|
|
10
10
|
import { ApiClient } from '../api-client';
|
|
11
|
-
import { TranslatedText } from './shared';
|
|
11
|
+
import { TranslatedText, NodeFileUpload } from './shared';
|
|
12
12
|
import { RequestOptions } from '../request-options';
|
|
13
13
|
import { Response, PaginatedResponse } from '../response';
|
|
14
14
|
export interface Tenant {
|
|
@@ -84,10 +84,10 @@ export interface TenantUpdateParams {
|
|
|
84
84
|
logo_dark?: number | null;
|
|
85
85
|
}
|
|
86
86
|
export interface TenantUploadLogoDarkParams {
|
|
87
|
-
file: string | Blob | Buffer;
|
|
87
|
+
file: string | Blob | Buffer | NodeFileUpload;
|
|
88
88
|
}
|
|
89
89
|
export interface TenantUploadLogoLightParams {
|
|
90
|
-
file: string | Blob | Buffer;
|
|
90
|
+
file: string | Blob | Buffer | NodeFileUpload;
|
|
91
91
|
}
|
|
92
92
|
export interface TenantFetchParams {
|
|
93
93
|
id: number;
|
|
@@ -6,7 +6,7 @@ import { GroupedWebsiteNavigation } from './grouped-website-navigation';
|
|
|
6
6
|
import { ApiClient } from '../api-client';
|
|
7
7
|
import { RequestOptions } from '../request-options';
|
|
8
8
|
import { Response, PaginatedResponse } from '../response';
|
|
9
|
-
import { TranslatedText } from './shared';
|
|
9
|
+
import { NodeFileUpload, TranslatedText } from './shared';
|
|
10
10
|
export interface WebsiteChannel {
|
|
11
11
|
id: number;
|
|
12
12
|
name: string;
|
|
@@ -74,7 +74,7 @@ export interface WebsiteChannelQueryImagesParams {
|
|
|
74
74
|
export interface WebsiteChannelUploadImageParams {
|
|
75
75
|
id: number;
|
|
76
76
|
description?: string | null;
|
|
77
|
-
file: string | Blob | Buffer;
|
|
77
|
+
file: string | Blob | Buffer | NodeFileUpload;
|
|
78
78
|
}
|
|
79
79
|
export interface WebsiteChannelUpdateThemeParams {
|
|
80
80
|
channel: number;
|
package/dist/cjs/multipart.js
CHANGED
|
@@ -12,6 +12,16 @@ function multipartDataGenerator(data, headers) {
|
|
|
12
12
|
continue;
|
|
13
13
|
}
|
|
14
14
|
const data = flattened[k];
|
|
15
|
+
if ((0, utils_1.isNodeUpload)(data)) {
|
|
16
|
+
const options = {
|
|
17
|
+
filename: data.filename,
|
|
18
|
+
filepath: data.filepath,
|
|
19
|
+
contentType: data.contentType,
|
|
20
|
+
};
|
|
21
|
+
// @ts-expect-error in nodejs options define the file
|
|
22
|
+
formData.append(k, data.stream, options);
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
15
25
|
if (data.fileName) {
|
|
16
26
|
formData.append(k, data, data.fileName);
|
|
17
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multipart.js","sourceRoot":"","sources":["../../src/multipart.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"multipart.js","sourceRoot":"","sources":["../../src/multipart.ts"],"names":[],"mappings":";;;;AAAA,mCAA4D;AAC5D,oEAAmC;AAEnC,SAAgB,sBAAsB,CAAC,IAAS,EAAE,OAAY;IAC1D,MAAM,QAAQ,GAAG,IAAI,mBAAQ,EAAE,CAAC;IAEhC,MAAM,SAAS,GAAG,IAAA,2BAAmB,EAAC,IAAI,CAAC,CAAC;IAE5C,KAAK,MAAM,CAAC,IAAI,SAAS,EAAE;QACvB,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE;YAC9B,SAAS;SACZ;QAED,MAAM,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;QAC1B,IAAI,IAAA,oBAAY,EAAC,IAAI,CAAC,EAAE;YACpB,MAAM,OAAO,GAAG;gBACZ,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,WAAW,EAAE,IAAI,CAAC,WAAW;aAChC,CAAC;YAEF,qDAAqD;YACrD,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YACzC,SAAS;SACZ;QAED,IAAI,IAAI,CAAC,QAAQ,EAAE;YACf,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;SAC3C;aAAM;YACH,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;SAC5B;KACJ;IAED,2DAA2D;IAC3D,mBAAmB;IACnB,IAAI,QAAQ,CAAC,WAAW,KAAK,SAAS,EAAE;QACpC,mBAAmB;QACnB,MAAM,QAAQ,GAAW,QAAQ,CAAC,WAAW,EAAE,CAAC;QAChD,OAAO,CAAC,cAAc,CAAC,GAAG,iCAAiC,QAAQ,EAAE,CAAC;KACzE;IAED,OAAO,QAAQ,CAAC;AACpB,CAAC;AAvCD,wDAuCC"}
|
package/dist/cjs/utils.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import { NodeFileUpload } from './generated/shared';
|
|
2
3
|
declare type AnyObject = {
|
|
3
4
|
[key: string]: any;
|
|
4
5
|
};
|
|
5
6
|
export declare function flattenAndStringify(data: AnyObject): AnyObject;
|
|
6
7
|
export declare function isObject(obj: any): obj is AnyObject;
|
|
7
8
|
export declare function isBlob(obj: any): obj is Blob;
|
|
9
|
+
export declare function isNodeUpload(obj: any): obj is NodeFileUpload;
|
|
8
10
|
export declare function isBuffer(obj: any): obj is Buffer;
|
|
9
11
|
export declare function isFileObject(obj: any): boolean;
|
|
10
12
|
export {};
|
package/dist/cjs/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isFileObject = exports.isBuffer = exports.isBlob = exports.isObject = exports.flattenAndStringify = void 0;
|
|
3
|
+
exports.isFileObject = exports.isBuffer = exports.isNodeUpload = exports.isBlob = exports.isObject = exports.flattenAndStringify = void 0;
|
|
4
4
|
// taken from https://github.com/stripe/stripe-node/blob/master/lib/utils.js#L377
|
|
5
5
|
function flattenAndStringify(data) {
|
|
6
6
|
const result = {};
|
|
@@ -11,7 +11,8 @@ function flattenAndStringify(data) {
|
|
|
11
11
|
if (isObject(value)) {
|
|
12
12
|
if (!isBuffer(value) &&
|
|
13
13
|
!isBlob(value) &&
|
|
14
|
-
!isFileObject(value)
|
|
14
|
+
!isFileObject(value) &&
|
|
15
|
+
!isNodeUpload(value)) {
|
|
15
16
|
return step(value, newKey);
|
|
16
17
|
}
|
|
17
18
|
else {
|
|
@@ -40,6 +41,10 @@ function isBlob(obj) {
|
|
|
40
41
|
return maybeBlob;
|
|
41
42
|
}
|
|
42
43
|
exports.isBlob = isBlob;
|
|
44
|
+
function isNodeUpload(obj) {
|
|
45
|
+
return typeof obj.stream !== 'undefined';
|
|
46
|
+
}
|
|
47
|
+
exports.isNodeUpload = isNodeUpload;
|
|
43
48
|
function isBuffer(obj) {
|
|
44
49
|
let maybeBuffer = obj instanceof Uint8Array;
|
|
45
50
|
if (typeof Buffer !== 'undefined') {
|
package/dist/cjs/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;AAIA,iFAAiF;AACjF,SAAgB,mBAAmB,CAAC,IAAe;IAC/C,MAAM,MAAM,GAAc,EAAE,CAAC;IAE7B,MAAM,IAAI,GAAG,CAAC,GAAc,EAAE,OAAgB,EAAE,EAAE;QAC9C,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAC7B,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;YAEvB,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;YAEpD,IAAI,QAAQ,CAAC,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C/B,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;KACtC;IAED,OAAO,WAAW,CAAC;AACvB,CAAC;AAPD,4BAOC;AAED,SAAgB,YAAY,CAAC,GAAQ;IACjC,OAAO,CACH,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC;QAC1B,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC;QAC1B,GAAG,CAAC,IAAI,KAAK,0BAA0B,CAC1C,CAAC;AACN,CAAC;AAND,oCAMC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { TranslatedText } from './shared';
|
|
2
|
+
import { TranslatedText, NodeFileUpload } from './shared';
|
|
3
3
|
import { AmenityGroup } from './amenity-group';
|
|
4
4
|
import { Image } from './image';
|
|
5
5
|
import { Property } from './property';
|
|
@@ -111,7 +111,7 @@ export interface AmenityHistoryParams {
|
|
|
111
111
|
export interface AmenityUploadImageParams {
|
|
112
112
|
id: number;
|
|
113
113
|
description?: string | null;
|
|
114
|
-
file: string | Blob | Buffer;
|
|
114
|
+
file: string | Blob | Buffer | NodeFileUpload;
|
|
115
115
|
}
|
|
116
116
|
export interface AmenityDeleteImageParams {
|
|
117
117
|
id: number;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Property } from './property';
|
|
3
3
|
import { PartnerAccount } from './partner-account';
|
|
4
4
|
import { Currency } from './currency';
|
|
5
|
-
import { DateRange } from './shared';
|
|
5
|
+
import { DateRange, NodeFileUpload } from './shared';
|
|
6
6
|
import { Channel } from './channel';
|
|
7
7
|
import { BookingProduct } from './booking-product';
|
|
8
8
|
import { ServiceRequest } from './service-request';
|
|
@@ -489,7 +489,7 @@ export interface BookingImportBookingsParams {
|
|
|
489
489
|
}>;
|
|
490
490
|
}
|
|
491
491
|
export interface BookingImportFromFileParams {
|
|
492
|
-
file: string | Blob | Buffer;
|
|
492
|
+
file: string | Blob | Buffer | NodeFileUpload;
|
|
493
493
|
}
|
|
494
494
|
export interface BookingUpdateTaCommissionParams {
|
|
495
495
|
booking: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Image } from './image';
|
|
3
|
-
import { TranslatedText } from './shared';
|
|
3
|
+
import { TranslatedText, NodeFileUpload } from './shared';
|
|
4
4
|
import { Seo } from './seo';
|
|
5
5
|
import { Property } from './property';
|
|
6
6
|
import { Location } from './location';
|
|
@@ -124,7 +124,7 @@ export interface CollectionSyncTagsParams {
|
|
|
124
124
|
export interface CollectionUploadImageParams {
|
|
125
125
|
id: number;
|
|
126
126
|
description?: string | null;
|
|
127
|
-
file: string | Blob | Buffer;
|
|
127
|
+
file: string | Blob | Buffer | NodeFileUpload;
|
|
128
128
|
}
|
|
129
129
|
export interface CollectionUpdateImageParams {
|
|
130
130
|
id: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Image } from './image';
|
|
3
|
-
import { TranslatedText, Geo } from './shared';
|
|
3
|
+
import { TranslatedText, Geo, NodeFileUpload } from './shared';
|
|
4
4
|
import { Country } from './country';
|
|
5
5
|
import { Collection } from './collection';
|
|
6
6
|
import { Tag } from './tag';
|
|
@@ -131,7 +131,7 @@ export interface LocationAutocompleteParams {
|
|
|
131
131
|
export interface LocationUploadImageParams {
|
|
132
132
|
id: number;
|
|
133
133
|
description?: string | null;
|
|
134
|
-
file: string | Blob | Buffer;
|
|
134
|
+
file: string | Blob | Buffer | NodeFileUpload;
|
|
135
135
|
}
|
|
136
136
|
export interface LocationUpdateImageParams {
|
|
137
137
|
id: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Image } from './image';
|
|
3
|
-
import { TranslatedText, Geo, DateRange } from './shared';
|
|
3
|
+
import { TranslatedText, Geo, DateRange, NodeFileUpload } from './shared';
|
|
4
4
|
import { Location } from './location';
|
|
5
5
|
import { PropertyType } from './property-type';
|
|
6
6
|
import { Currency } from './currency';
|
|
@@ -446,7 +446,7 @@ export interface PropertyImportParams {
|
|
|
446
446
|
export interface PropertyUploadImageParams {
|
|
447
447
|
id: number;
|
|
448
448
|
description?: string | null;
|
|
449
|
-
file: string | Blob | Buffer;
|
|
449
|
+
file: string | Blob | Buffer | NodeFileUpload;
|
|
450
450
|
}
|
|
451
451
|
export interface PropertyDeleteImageParams {
|
|
452
452
|
id: number;
|
|
@@ -901,7 +901,7 @@ export interface PropertyCreateHomeownerBookingParams {
|
|
|
901
901
|
export interface PropertyUploadFloorImageParams {
|
|
902
902
|
id: number;
|
|
903
903
|
description?: string | null;
|
|
904
|
-
file: string | Blob | Buffer;
|
|
904
|
+
file: string | Blob | Buffer | NodeFileUpload;
|
|
905
905
|
}
|
|
906
906
|
export interface PropertyDeleteFloorImageParams {
|
|
907
907
|
id: number;
|
|
@@ -4,6 +4,7 @@ import { Image } from './image';
|
|
|
4
4
|
import { ApiClient } from '../api-client';
|
|
5
5
|
import { RequestOptions } from '../request-options';
|
|
6
6
|
import { Response } from '../response';
|
|
7
|
+
import { NodeFileUpload } from './shared';
|
|
7
8
|
export interface Stay {
|
|
8
9
|
id: number;
|
|
9
10
|
booking?: Booking;
|
|
@@ -99,12 +100,12 @@ export interface StayUpdateParams {
|
|
|
99
100
|
export interface StayUploadIdentificationDocumentParams {
|
|
100
101
|
id: number;
|
|
101
102
|
description?: string | null;
|
|
102
|
-
file: string | Blob | Buffer;
|
|
103
|
+
file: string | Blob | Buffer | NodeFileUpload;
|
|
103
104
|
}
|
|
104
105
|
export interface StayUploadSignatureParams {
|
|
105
106
|
id: number;
|
|
106
107
|
description?: string | null;
|
|
107
|
-
file: string | Blob | Buffer;
|
|
108
|
+
file: string | Blob | Buffer | NodeFileUpload;
|
|
108
109
|
}
|
|
109
110
|
export interface StayUpdateVisitorsParams {
|
|
110
111
|
booking: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stay.js","sourceRoot":"","sources":["../../../src/generated/stay.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"stay.js","sourceRoot":"","sources":["../../../src/generated/stay.ts"],"names":[],"mappings":";AA4CA,MAAM,OAAO,UAAU;IACnB,YAAoC,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;QAEhD,SAAI,GAAW,MAAM,CAAC;IAF6B,CAAC;IAI/C,KAAK,CACd,MAAuB,EACvB,OAAwB;;YAExB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,QAAQ,EAAE;gBAChD,MAAM;gBACN,OAAO;aACV,CAAC,CAAC;QACP,CAAC;KAAA;IAEY,MAAM,CACf,MAAwB,EACxB,OAAwB;;YAExB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,SAAS,EAAE;gBACjD,MAAM;gBACN,OAAO;aACV,CAAC,CAAC;QACP,CAAC;KAAA;IAEY,4BAA4B,CACrC,MAA8C,EAC9C,OAAwB;;YAExB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CACzB,GAAG,IAAI,CAAC,IAAI,iCAAiC,EAC7C,EAAE,MAAM,EAAE,OAAO,kCAAO,OAAO,KAAE,UAAU,EAAE,IAAI,GAAE,EAAE,CACxD,CAAC;QACN,CAAC;KAAA;IAEY,eAAe,CACxB,MAAiC,EACjC,OAAwB;;YAExB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,mBAAmB,EAAE;gBAC3D,MAAM;gBACN,OAAO,kCAAO,OAAO,KAAE,UAAU,EAAE,IAAI,GAAE;aAC5C,CAAC,CAAC;QACP,CAAC;KAAA;IAEY,cAAc,CACvB,MAAgC,EAChC,OAAwB;;YAExB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,kBAAkB,EAAE;gBAC1D,MAAM;gBACN,OAAO;aACV,CAAC,CAAC;QACP,CAAC;KAAA;IAEY,0BAA0B,CACnC,MAA4C,EAC5C,OAAwB;;YAExB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CACzB,GAAG,IAAI,CAAC,IAAI,+BAA+B,EAC3C,EAAE,MAAM,EAAE,OAAO,EAAE,CACtB,CAAC;QACN,CAAC;KAAA;IAEY,gBAAgB,CACzB,MAAkC,EAClC,OAAwB;;YAExB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,qBAAqB,EAAE;gBAC7D,MAAM;gBACN,OAAO;aACV,CAAC,CAAC;QACP,CAAC;KAAA;CACJ"}
|
|
@@ -8,7 +8,7 @@ import { TenantBilling } from './tenant-billing';
|
|
|
8
8
|
import { GuestAgreementConfig } from './guest-agreement-config';
|
|
9
9
|
import { User } from './user';
|
|
10
10
|
import { ApiClient } from '../api-client';
|
|
11
|
-
import { TranslatedText } from './shared';
|
|
11
|
+
import { TranslatedText, NodeFileUpload } from './shared';
|
|
12
12
|
import { RequestOptions } from '../request-options';
|
|
13
13
|
import { Response, PaginatedResponse } from '../response';
|
|
14
14
|
export interface Tenant {
|
|
@@ -84,10 +84,10 @@ export interface TenantUpdateParams {
|
|
|
84
84
|
logo_dark?: number | null;
|
|
85
85
|
}
|
|
86
86
|
export interface TenantUploadLogoDarkParams {
|
|
87
|
-
file: string | Blob | Buffer;
|
|
87
|
+
file: string | Blob | Buffer | NodeFileUpload;
|
|
88
88
|
}
|
|
89
89
|
export interface TenantUploadLogoLightParams {
|
|
90
|
-
file: string | Blob | Buffer;
|
|
90
|
+
file: string | Blob | Buffer | NodeFileUpload;
|
|
91
91
|
}
|
|
92
92
|
export interface TenantFetchParams {
|
|
93
93
|
id: number;
|
|
@@ -6,7 +6,7 @@ import { GroupedWebsiteNavigation } from './grouped-website-navigation';
|
|
|
6
6
|
import { ApiClient } from '../api-client';
|
|
7
7
|
import { RequestOptions } from '../request-options';
|
|
8
8
|
import { Response, PaginatedResponse } from '../response';
|
|
9
|
-
import { TranslatedText } from './shared';
|
|
9
|
+
import { NodeFileUpload, TranslatedText } from './shared';
|
|
10
10
|
export interface WebsiteChannel {
|
|
11
11
|
id: number;
|
|
12
12
|
name: string;
|
|
@@ -74,7 +74,7 @@ export interface WebsiteChannelQueryImagesParams {
|
|
|
74
74
|
export interface WebsiteChannelUploadImageParams {
|
|
75
75
|
id: number;
|
|
76
76
|
description?: string | null;
|
|
77
|
-
file: string | Blob | Buffer;
|
|
77
|
+
file: string | Blob | Buffer | NodeFileUpload;
|
|
78
78
|
}
|
|
79
79
|
export interface WebsiteChannelUpdateThemeParams {
|
|
80
80
|
channel: number;
|
package/dist/esm/multipart.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { flattenAndStringify } from './utils';
|
|
1
|
+
import { flattenAndStringify, isNodeUpload } from './utils';
|
|
2
2
|
import FormData from './form-data';
|
|
3
3
|
export function multipartDataGenerator(data, headers) {
|
|
4
4
|
const formData = new FormData();
|
|
@@ -8,6 +8,16 @@ export function multipartDataGenerator(data, headers) {
|
|
|
8
8
|
continue;
|
|
9
9
|
}
|
|
10
10
|
const data = flattened[k];
|
|
11
|
+
if (isNodeUpload(data)) {
|
|
12
|
+
const options = {
|
|
13
|
+
filename: data.filename,
|
|
14
|
+
filepath: data.filepath,
|
|
15
|
+
contentType: data.contentType,
|
|
16
|
+
};
|
|
17
|
+
// @ts-expect-error in nodejs options define the file
|
|
18
|
+
formData.append(k, data.stream, options);
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
11
21
|
if (data.fileName) {
|
|
12
22
|
formData.append(k, data, data.fileName);
|
|
13
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multipart.js","sourceRoot":"","sources":["../../src/multipart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"multipart.js","sourceRoot":"","sources":["../../src/mult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AAC"}
|
package/dist/esm/utils.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import { NodeFileUpload } from './generated/shared';
|
|
2
3
|
declare type AnyObject = {
|
|
3
4
|
[key: string]: any;
|
|
4
5
|
};
|
|
5
6
|
export declare function flattenAndStringify(data: AnyObject): AnyObject;
|
|
6
7
|
export declare function isObject(obj: any): obj is AnyObject;
|
|
7
8
|
export declare function isBlob(obj: any): obj is Blob;
|
|
9
|
+
export declare function isNodeUpload(obj: any): obj is NodeFileUpload;
|
|
8
10
|
export declare function isBuffer(obj: any): obj is Buffer;
|
|
9
11
|
export declare function isFileObject(obj: any): boolean;
|
|
10
12
|
export {};
|
package/dist/esm/utils.js
CHANGED
|
@@ -8,7 +8,8 @@ export function flattenAndStringify(data) {
|
|
|
8
8
|
if (isObject(value)) {
|
|
9
9
|
if (!isBuffer(value) &&
|
|
10
10
|
!isBlob(value) &&
|
|
11
|
-
!isFileObject(value)
|
|
11
|
+
!isFileObject(value) &&
|
|
12
|
+
!isNodeUpload(value)) {
|
|
12
13
|
return step(value, newKey);
|
|
13
14
|
}
|
|
14
15
|
else {
|
|
@@ -34,6 +35,9 @@ export function isBlob(obj) {
|
|
|
34
35
|
}
|
|
35
36
|
return maybeBlob;
|
|
36
37
|
}
|
|
38
|
+
export function isNodeUpload(obj) {
|
|
39
|
+
return typeof obj.stream !== 'undefined';
|
|
40
|
+
}
|
|
37
41
|
export function isBuffer(obj) {
|
|
38
42
|
let maybeBuffer = obj instanceof Uint8Array;
|
|
39
43
|
if (typeof Buffer !== 'undefined') {
|
package/dist/esm/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAIA,iFAAiF;AACjF,MAAM,UAAU,mBA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