@sp-api-sdk/services-api-v1 1.10.4 → 1.10.6
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/src/api-model/common.js +19 -13
- package/dist/es/src/api-model/common.js +19 -13
- package/dist/types/src/api-model/models/appointment-slot-report.d.ts +1 -1
- package/dist/types/src/api-model/models/appointment.d.ts +1 -1
- package/dist/types/src/api-model/models/associated-item.d.ts +1 -1
- package/dist/types/src/api-model/models/capacity-type.d.ts +1 -1
- package/dist/types/src/api-model/models/day-of-week.d.ts +1 -1
- package/dist/types/src/api-model/models/encryption-details.d.ts +1 -1
- package/dist/types/src/api-model/models/model-error.d.ts +1 -1
- package/dist/types/src/api-model/models/poa.d.ts +1 -1
- package/dist/types/src/api-model/models/reservation.d.ts +1 -1
- package/dist/types/src/api-model/models/service-job.d.ts +1 -1
- package/dist/types/src/api-model/models/service-location.d.ts +1 -1
- package/dist/types/src/api-model/models/service-upload-document.d.ts +1 -1
- package/package.json +3 -3
|
@@ -80,25 +80,31 @@ const setOAuthToObject = async function (object, name, scopes, configuration) {
|
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
82
|
exports.setOAuthToObject = setOAuthToObject;
|
|
83
|
+
function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
|
|
84
|
+
if (typeof parameter === "object") {
|
|
85
|
+
if (Array.isArray(parameter)) {
|
|
86
|
+
parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
if (urlSearchParams.has(key)) {
|
|
94
|
+
urlSearchParams.append(key, parameter);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
urlSearchParams.set(key, parameter);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
83
101
|
/**
|
|
84
102
|
*
|
|
85
103
|
* @export
|
|
86
104
|
*/
|
|
87
105
|
const setSearchParams = function (url, ...objects) {
|
|
88
106
|
const searchParams = new URLSearchParams(url.search);
|
|
89
|
-
|
|
90
|
-
for (const key in object) {
|
|
91
|
-
if (Array.isArray(object[key])) {
|
|
92
|
-
searchParams.delete(key);
|
|
93
|
-
for (const item of object[key]) {
|
|
94
|
-
searchParams.append(key, item);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
searchParams.set(key, object[key]);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
107
|
+
setFlattenedQueryParams(searchParams, objects);
|
|
102
108
|
url.search = searchParams.toString();
|
|
103
109
|
};
|
|
104
110
|
exports.setSearchParams = setSearchParams;
|
|
@@ -72,25 +72,31 @@ export const setOAuthToObject = async function (object, name, scopes, configurat
|
|
|
72
72
|
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
|
+
function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
|
|
76
|
+
if (typeof parameter === "object") {
|
|
77
|
+
if (Array.isArray(parameter)) {
|
|
78
|
+
parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
if (urlSearchParams.has(key)) {
|
|
86
|
+
urlSearchParams.append(key, parameter);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
urlSearchParams.set(key, parameter);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
75
93
|
/**
|
|
76
94
|
*
|
|
77
95
|
* @export
|
|
78
96
|
*/
|
|
79
97
|
export const setSearchParams = function (url, ...objects) {
|
|
80
98
|
const searchParams = new URLSearchParams(url.search);
|
|
81
|
-
|
|
82
|
-
for (const key in object) {
|
|
83
|
-
if (Array.isArray(object[key])) {
|
|
84
|
-
searchParams.delete(key);
|
|
85
|
-
for (const item of object[key]) {
|
|
86
|
-
searchParams.append(key, item);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
searchParams.set(key, object[key]);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
99
|
+
setFlattenedQueryParams(searchParams, objects);
|
|
94
100
|
url.search = searchParams.toString();
|
|
95
101
|
};
|
|
96
102
|
/**
|
|
@@ -45,4 +45,4 @@ export declare const AppointmentSlotReportSchedulingTypeEnum: {
|
|
|
45
45
|
readonly RealTimeScheduling: "REAL_TIME_SCHEDULING";
|
|
46
46
|
readonly NonRealTimeScheduling: "NON_REAL_TIME_SCHEDULING";
|
|
47
47
|
};
|
|
48
|
-
export
|
|
48
|
+
export type AppointmentSlotReportSchedulingTypeEnum = typeof AppointmentSlotReportSchedulingTypeEnum[keyof typeof AppointmentSlotReportSchedulingTypeEnum];
|
|
@@ -60,4 +60,4 @@ export declare const AppointmentAppointmentStatusEnum: {
|
|
|
60
60
|
readonly Cancelled: "CANCELLED";
|
|
61
61
|
readonly Completed: "COMPLETED";
|
|
62
62
|
};
|
|
63
|
-
export
|
|
63
|
+
export type AppointmentAppointmentStatusEnum = typeof AppointmentAppointmentStatusEnum[keyof typeof AppointmentAppointmentStatusEnum];
|
|
@@ -65,4 +65,4 @@ export declare const AssociatedItemItemStatusEnum: {
|
|
|
65
65
|
readonly Shipped: "SHIPPED";
|
|
66
66
|
readonly Delivered: "DELIVERED";
|
|
67
67
|
};
|
|
68
|
-
export
|
|
68
|
+
export type AssociatedItemItemStatusEnum = typeof AssociatedItemItemStatusEnum[keyof typeof AssociatedItemItemStatusEnum];
|
|
@@ -20,4 +20,4 @@ export declare const CapacityType: {
|
|
|
20
20
|
readonly EncumberedCapacity: "ENCUMBERED_CAPACITY";
|
|
21
21
|
readonly ReservedCapacity: "RESERVED_CAPACITY";
|
|
22
22
|
};
|
|
23
|
-
export
|
|
23
|
+
export type CapacityType = typeof CapacityType[keyof typeof CapacityType];
|
|
@@ -37,4 +37,4 @@ export interface EncryptionDetails {
|
|
|
37
37
|
export declare const EncryptionDetailsStandardEnum: {
|
|
38
38
|
readonly Aes: "AES";
|
|
39
39
|
};
|
|
40
|
-
export
|
|
40
|
+
export type EncryptionDetailsStandardEnum = typeof EncryptionDetailsStandardEnum[keyof typeof EncryptionDetailsStandardEnum];
|
|
@@ -44,4 +44,4 @@ export declare const ModelErrorErrorLevelEnum: {
|
|
|
44
44
|
readonly Error: "ERROR";
|
|
45
45
|
readonly Warning: "WARNING";
|
|
46
46
|
};
|
|
47
|
-
export
|
|
47
|
+
export type ModelErrorErrorLevelEnum = typeof ModelErrorErrorLevelEnum[keyof typeof ModelErrorErrorLevelEnum];
|
|
@@ -54,4 +54,4 @@ export declare const PoaPoaTypeEnum: {
|
|
|
54
54
|
readonly DummyReceipt: "DUMMY_RECEIPT";
|
|
55
55
|
readonly PoaReceipt: "POA_RECEIPT";
|
|
56
56
|
};
|
|
57
|
-
export
|
|
57
|
+
export type PoaPoaTypeEnum = typeof PoaPoaTypeEnum[keyof typeof PoaPoaTypeEnum];
|
|
@@ -42,4 +42,4 @@ export declare const ReservationTypeEnum: {
|
|
|
42
42
|
readonly Break: "BREAK";
|
|
43
43
|
readonly Training: "TRAINING";
|
|
44
44
|
};
|
|
45
|
-
export
|
|
45
|
+
export type ReservationTypeEnum = typeof ReservationTypeEnum[keyof typeof ReservationTypeEnum];
|
|
@@ -117,4 +117,4 @@ export declare const ServiceJobServiceJobStatusEnum: {
|
|
|
117
117
|
readonly Hold: "HOLD";
|
|
118
118
|
readonly PaymentDeclined: "PAYMENT_DECLINED";
|
|
119
119
|
};
|
|
120
|
-
export
|
|
120
|
+
export type ServiceJobServiceJobStatusEnum = typeof ServiceJobServiceJobStatusEnum[keyof typeof ServiceJobServiceJobStatusEnum];
|
|
@@ -34,4 +34,4 @@ export declare const ServiceLocationServiceLocationTypeEnum: {
|
|
|
34
34
|
readonly InStore: "IN_STORE";
|
|
35
35
|
readonly Online: "ONLINE";
|
|
36
36
|
};
|
|
37
|
-
export
|
|
37
|
+
export type ServiceLocationServiceLocationTypeEnum = typeof ServiceLocationServiceLocationTypeEnum[keyof typeof ServiceLocationServiceLocationTypeEnum];
|
|
@@ -42,4 +42,4 @@ export declare const ServiceUploadDocumentContentTypeEnum: {
|
|
|
42
42
|
readonly Gif: "GIF";
|
|
43
43
|
readonly Pdf: "PDF";
|
|
44
44
|
};
|
|
45
|
-
export
|
|
45
|
+
export type ServiceUploadDocumentContentTypeEnum = typeof ServiceUploadDocumentContentTypeEnum[keyof typeof ServiceUploadDocumentContentTypeEnum];
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@sp-api-sdk/services-api-v1",
|
|
3
3
|
"author": "Vincent Mesquita <vincent.mesquita@bizon.solutions>",
|
|
4
4
|
"description": "With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources.",
|
|
5
|
-
"version": "1.10.
|
|
5
|
+
"version": "1.10.6",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
7
7
|
"module": "dist/es/index.js",
|
|
8
8
|
"types": "dist/types/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"test": "jest"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@sp-api-sdk/common": "^1.9.
|
|
29
|
+
"@sp-api-sdk/common": "^1.9.18",
|
|
30
30
|
"axios": "^0.27.2"
|
|
31
31
|
},
|
|
32
32
|
"repository": {
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"typedoc": {
|
|
52
52
|
"entryPoint": "./index.ts"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "59d4ae523f7261bbee380ef3bd43a368266a55a6"
|
|
55
55
|
}
|