@partium/js-sdk 14.9.0 → 14.10.0

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,6 +1,6 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
2
  import { Observable } from 'rxjs';
3
- import { HttpsClientService } from '../../../services/http/https-client/https-client.service.interface';
3
+ import { HttpsClientService, RequestOptions } from '../../../services/http/https-client/https-client.service.interface';
4
4
  /**
5
5
  * Implementation of the HttpsClientService for providing basic https calls
6
6
  * on browsers.
@@ -16,9 +16,10 @@ export declare class AxiosHttpsClientService extends HttpsClientService {
16
16
  * @param url the full server url
17
17
  * @param urlParams array of url parameters (as objects) which will be appended to the url <url>?p1=x&p2=y
18
18
  * @param headers object with the request headers
19
+ * @param requestOptions options for the request
19
20
  * @returns Observable that resolves with the request result
20
21
  */
21
- get(url: string, urlParams?: Array<Object>, headers?: Object): Observable<any>;
22
+ get(url: string, urlParams?: Array<Object>, headers?: Object, requestOptions?: RequestOptions): Observable<any>;
22
23
  /**
23
24
  * Send POST request to the server with the given url and content.
24
25
  *
@@ -26,9 +27,10 @@ export declare class AxiosHttpsClientService extends HttpsClientService {
26
27
  * @param data the data to be sent with the post request
27
28
  * @param urlParams array of url parameters (as objects) which will be appended to the url <url>?p1=x&p2=y
28
29
  * @param headers object with the request headers
30
+ * @param requestOptions options for the request
29
31
  * @returns Observable that resolves with the request result
30
32
  */
31
- post(url: string, data: any, urlParams?: Array<Object>, headers?: Object): Observable<any>;
33
+ post(url: string, data: any, urlParams?: Array<Object>, headers?: Object, requestOptions?: RequestOptions): Observable<any>;
32
34
  /**
33
35
  * Send PATCH request to the server with the given url and content.
34
36
  *
@@ -36,9 +38,10 @@ export declare class AxiosHttpsClientService extends HttpsClientService {
36
38
  * @param data the data to be sent with the patch request
37
39
  * @param urlParams array of url parameters (as objects) which will be appended to the url <url>?p1=x&p2=y
38
40
  * @param headers object with the request headers
41
+ * @param requestOptions options for the request
39
42
  * @returns Observable that resolves with the request result
40
43
  */
41
- patch(url: string, data: any, urlParams?: Array<Object>, headers?: Object): Observable<any>;
44
+ patch(url: string, data: any, urlParams?: Array<Object>, headers?: Object, requestOptions?: RequestOptions): Observable<any>;
42
45
  /**
43
46
  * Send DELETE request to the server with the given url and content.
44
47
  *
@@ -46,9 +49,10 @@ export declare class AxiosHttpsClientService extends HttpsClientService {
46
49
  * @param data the data to be sent with the patch request
47
50
  * @param urlParams array of url parameters (as objects) which will be appended to the url <url>?p1=x&p2=y
48
51
  * @param headers object with the request headers
52
+ * @param requestOptions options for the request
49
53
  * @returns Observable that resolves with the request result
50
54
  */
51
- delete(url: string, data?: any, urlParams?: Array<Object>, headers?: Object): Observable<any>;
55
+ delete(url: string, data?: any, urlParams?: Array<Object>, headers?: Object, requestOptions?: RequestOptions): Observable<any>;
52
56
  /**
53
57
  * Send put request to the server with the given url and content.
54
58
  *
@@ -56,9 +60,10 @@ export declare class AxiosHttpsClientService extends HttpsClientService {
56
60
  * @param data the data to be sent with the patch request
57
61
  * @param urlParams array of url parameters (as objects) which will be appended to the url <url>?p1=x&p2=y
58
62
  * @param headers object with the request headers
63
+ * @param requestOptions options for the request
59
64
  * @returns Observable that resolves with the request result
60
65
  */
61
- put(url: string, data: any, urlParams?: Array<Object>, headers?: Object): Observable<any>;
66
+ put(url: string, data: any, urlParams?: Array<Object>, headers?: Object, requestOptions?: RequestOptions): Observable<any>;
62
67
  /**
63
68
  * Wraps the requests with necessary rxjs operators for processing response
64
69
  * and errors.
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";var __extends=this&&this.__extends||function(){var e=function(r,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])},e(r,t)};return function(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function s(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.AxiosHttpsClientService=void 0;var rxjs_1=require("rxjs"),axios_observable_1=require("axios-observable"),operators_1=require("rxjs/operators"),https_client_service_interface_1=require("../../../services/http/https-client/https-client.service.interface"),handle_axios_error_helper_1=require("../handle-axios-error-helper"),device_status_service_interface_1=require("../../../services/device-status.service.interface"),error_1=require("../../../models/error"),AxiosHttpsClientService=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return __extends(r,e),r.prototype.onCreate=function(){e.prototype.onCreate.call(this),this.deviceStatusService=this.serviceProvider.getService(device_status_service_interface_1.DeviceStatusService)},r.prototype.get=function(e,r,t){return this.requestAsObservable({method:"GET",url:this.addUrlParameters(e,r),headers:t,withCredentials:!0})},r.prototype.post=function(e,r,t,s){return this.requestAsObservable({method:"POST",url:this.addUrlParameters(e,t),data:r,headers:s,withCredentials:!0})},r.prototype.patch=function(e,r,t,s){return this.requestAsObservable({method:"PATCH",url:this.addUrlParameters(e,t),data:r,headers:s,withCredentials:!0})},r.prototype.delete=function(e,r,t,s){return this.requestAsObservable({method:"DELETE",url:this.addUrlParameters(e,t),data:r,headers:s,withCredentials:!0})},r.prototype.put=function(e,r,t,s){return this.requestAsObservable({method:"PUT",url:this.addUrlParameters(e,t),data:r,headers:s,withCredentials:!0})},r.prototype.requestAsObservable=function(e){var r=this;return(0,rxjs_1.defer)((function(){return r.validateIsKnownUrlOrCry(e.url),axios_observable_1.default.request(e)})).pipe((0,operators_1.map)((function(e){return r.processResponse(e)})),(0,operators_1.catchError)((function(e){return r.checkInternetConnectivity(e)})),(0,operators_1.catchError)(handle_axios_error_helper_1.HandleAxiosErrorHelper.processError))},r.prototype.processResponse=function(e){if(e.status){if(e.status>=400&&e.status<500)throw console.log("HttpsService - Client Error"),e;if(e.status>=500&&e.status<600)throw console.log("HttpsService - Server Error"),e;return e.data}throw e},r.prototype.checkInternetConnectivity=function(e){return(0,rxjs_1.from)(this.deviceStatusService.isConnectionAvailable()).pipe((0,operators_1.map)((function(r){throw r?e:new error_1.SdkError(error_1.SDK_ERROR_CODES.NO_INTERNET,e)})))},r}(https_client_service_interface_1.HttpsClientService);exports.AxiosHttpsClientService=AxiosHttpsClientService;
2
+ "use strict";var __extends=this&&this.__extends||function(){var e=function(r,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])},e(r,t)};return function(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function s(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.AxiosHttpsClientService=void 0;var rxjs_1=require("rxjs"),axios_observable_1=require("axios-observable"),operators_1=require("rxjs/operators"),https_client_service_interface_1=require("../../../services/http/https-client/https-client.service.interface"),handle_axios_error_helper_1=require("../handle-axios-error-helper"),device_status_service_interface_1=require("../../../services/device-status.service.interface"),error_1=require("../../../models/error"),AxiosHttpsClientService=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return __extends(r,e),r.prototype.onCreate=function(){e.prototype.onCreate.call(this),this.deviceStatusService=this.serviceProvider.getService(device_status_service_interface_1.DeviceStatusService)},r.prototype.get=function(e,r,t,s){var o;return this.requestAsObservable({method:"GET",url:this.addUrlParameters(e,r),headers:t,withCredentials:null!==(o=null==s?void 0:s.withCredentials)&&void 0!==o&&o})},r.prototype.post=function(e,r,t,s,o){var i;return this.requestAsObservable({method:"POST",url:this.addUrlParameters(e,t),data:r,headers:s,withCredentials:null!==(i=null==o?void 0:o.withCredentials)&&void 0!==i&&i})},r.prototype.patch=function(e,r,t,s,o){var i;return this.requestAsObservable({method:"PATCH",url:this.addUrlParameters(e,t),data:r,headers:s,withCredentials:null!==(i=null==o?void 0:o.withCredentials)&&void 0!==i&&i})},r.prototype.delete=function(e,r,t,s,o){var i;return this.requestAsObservable({method:"DELETE",url:this.addUrlParameters(e,t),data:r,headers:s,withCredentials:null!==(i=null==o?void 0:o.withCredentials)&&void 0!==i&&i})},r.prototype.put=function(e,r,t,s,o){var i;return this.requestAsObservable({method:"PUT",url:this.addUrlParameters(e,t),data:r,headers:s,withCredentials:null!==(i=null==o?void 0:o.withCredentials)&&void 0!==i&&i})},r.prototype.requestAsObservable=function(e){var r=this;return(0,rxjs_1.defer)((function(){return r.validateIsKnownUrlOrCry(e.url),axios_observable_1.default.request(e)})).pipe((0,operators_1.map)((function(e){return r.processResponse(e)})),(0,operators_1.catchError)((function(e){return r.checkInternetConnectivity(e)})),(0,operators_1.catchError)(handle_axios_error_helper_1.HandleAxiosErrorHelper.processError))},r.prototype.processResponse=function(e){if(e.status){if(e.status>=400&&e.status<500)throw console.log("HttpsService - Client Error"),e;if(e.status>=500&&e.status<600)throw console.log("HttpsService - Server Error"),e;return e.data}throw e},r.prototype.checkInternetConnectivity=function(e){return(0,rxjs_1.from)(this.deviceStatusService.isConnectionAvailable()).pipe((0,operators_1.map)((function(r){throw r?e:new error_1.SdkError(error_1.SDK_ERROR_CODES.NO_INTERNET,e)})))},r}(https_client_service_interface_1.HttpsClientService);exports.AxiosHttpsClientService=AxiosHttpsClientService;
@@ -1,6 +1,6 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
2
  import { Observable } from 'rxjs';
3
- import { HttpsClientService } from '../../../services/http/https-client/https-client.service.interface';
3
+ import { HttpsClientService, RequestOptions } from '../../../services/http/https-client/https-client.service.interface';
4
4
  /**
5
5
  * Implementation of the HttpsClientService for providing basic https calls
6
6
  * on browsers by using the fetch API.
@@ -16,9 +16,10 @@ export declare class FetchAPIHttpsClientService extends HttpsClientService {
16
16
  * @param url the full server url
17
17
  * @param urlParams array of url parameters (as objects) which will be appended to the url <url>?p1=x&p2=y
18
18
  * @param headers object with the request headers
19
+ * @param requestOptions options for the request
19
20
  * @returns Observable that resolves with the request result
20
21
  */
21
- get(url: string, urlParams?: Array<Object>, headers?: Object): Observable<any>;
22
+ get(url: string, urlParams?: Array<Object>, headers?: Object, requestOptions?: RequestOptions): Observable<any>;
22
23
  /**
23
24
  * Send POST request to the server with the given url and content.
24
25
  *
@@ -26,9 +27,10 @@ export declare class FetchAPIHttpsClientService extends HttpsClientService {
26
27
  * @param data the data to be sent with the post request
27
28
  * @param urlParams array of url parameters (as objects) which will be appended to the url <url>?p1=x&p2=y
28
29
  * @param headers object with the request headers
30
+ * @param requestOptions options for the request
29
31
  * @returns Observable that resolves with the request result
30
32
  */
31
- post(url: string, data: Object, urlParams?: Array<Object>, headers?: Object): Observable<any>;
33
+ post(url: string, data: Object, urlParams?: Array<Object>, headers?: Object, requestOptions?: RequestOptions): Observable<any>;
32
34
  /**
33
35
  * Send PATCH request to the server with the given url and content.
34
36
  *
@@ -36,9 +38,10 @@ export declare class FetchAPIHttpsClientService extends HttpsClientService {
36
38
  * @param data the data to be sent with the patch request
37
39
  * @param urlParams array of url parameters (as objects) which will be appended to the url <url>?p1=x&p2=y
38
40
  * @param headers object with the request headers
41
+ * @param requestOptions options for the request
39
42
  * @returns Observable that resolves with the request result
40
43
  */
41
- patch(url: string, data: Object, urlParams?: Array<Object>, headers?: Object): Observable<any>;
44
+ patch(url: string, data: Object, urlParams?: Array<Object>, headers?: Object, requestOptions?: RequestOptions): Observable<any>;
42
45
  /**
43
46
  * Send DELETE request to the server with the given url and content.
44
47
  *
@@ -46,9 +49,10 @@ export declare class FetchAPIHttpsClientService extends HttpsClientService {
46
49
  * @param data the data to be sent with the patch request
47
50
  * @param urlParams array of url parameters (as objects) which will be appended to the url <url>?p1=x&p2=y
48
51
  * @param headers object with the request headers
52
+ * @param requestOptions options for the request
49
53
  * @returns Observable that resolves with the request result
50
54
  */
51
- delete(url: string, data?: Object, urlParams?: Array<Object>, headers?: Object): Observable<any>;
55
+ delete(url: string, data?: Object, urlParams?: Array<Object>, headers?: Object, requestOptions?: RequestOptions): Observable<any>;
52
56
  /**
53
57
  * Send put request to the server with the given url and content.
54
58
  *
@@ -56,9 +60,10 @@ export declare class FetchAPIHttpsClientService extends HttpsClientService {
56
60
  * @param data the data to be sent with the patch request
57
61
  * @param urlParams array of url parameters (as objects) which will be appended to the url <url>?p1=x&p2=y
58
62
  * @param headers object with the request headers
63
+ * @param requestOptions options for the request
59
64
  * @returns Observable that resolves with the request result
60
65
  */
61
- put(url: string, data: Object, urlParams?: Array<Object>, headers?: Object): Observable<any>;
66
+ put(url: string, data: Object, urlParams?: Array<Object>, headers?: Object, requestOptions?: RequestOptions): Observable<any>;
62
67
  /**
63
68
  * Wraps the requests with necessary rxjs operators for processing response
64
69
  * and errors.
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";var __extends=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function s(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(s.prototype=r.prototype,new s)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,r=1,s=arguments.length;r<s;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},__assign.apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.FetchAPIHttpsClientService=void 0;var rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),fetch_api_http_error_helper_1=require("../fetch-api-http-error-helper"),https_client_service_interface_1=require("../../../services/http/https-client/https-client.service.interface"),device_status_service_interface_1=require("../../../services/device-status.service.interface"),error_1=require("../../../models/error"),FetchAPIHttpsClientService=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.onCreate=function(){e.prototype.onCreate.call(this),this.deviceStatusService=this.serviceProvider.getService(device_status_service_interface_1.DeviceStatusService)},t.prototype.get=function(e,t,r){return this.requestAsObservable(this.addUrlParameters(e,t),__assign({method:"GET",credentials:"include"},r&&{headers:Object.entries(r)}))},t.prototype.post=function(e,t,r,s){return t instanceof FormData&&delete s["Content-Type"],this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"POST",credentials:"include"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}))},t.prototype.patch=function(e,t,r,s){return this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"PATCH",credentials:"include"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}))},t.prototype.delete=function(e,t,r,s){return this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"DELETE",credentials:"include"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}))},t.prototype.put=function(e,t,r,s){return this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"PUT",credentials:"include"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}))},t.prototype.requestAsObservable=function(e,t){var r=this;return new rxjs_1.Observable((function(s){r.validateIsKnownUrlOrCry(e),fetch(e,t).then((function(e){s.next(e),s.complete()})).catch((function(e){s.error(e)}))})).pipe((0,operators_1.mergeMap)((function(e){return r.processResponse(e)})),(0,operators_1.catchError)((function(e){return r.checkInternetConnectivity(e)})),(0,operators_1.catchError)(fetch_api_http_error_helper_1.FetchAPIHttpErrorHelper.processError))},t.prototype.processResponse=function(e){if(e.status){if(e.status>=400&&e.status<500)throw console.log("HttpsService - Client Error"),e;if(e.status>=500&&e.status<600)throw console.log("HttpsService - Server Error"),e;return 204===e.status?(0,rxjs_1.of)({}):(0,rxjs_1.from)(e.clone().json())}throw e},t.prototype.checkInternetConnectivity=function(e){return(0,rxjs_1.from)(this.deviceStatusService.isConnectionAvailable()).pipe((0,operators_1.map)((function(t){throw t?e:new error_1.SdkError(error_1.SDK_ERROR_CODES.NO_INTERNET,e)})))},t.prototype.createBody=function(e){return"string"==typeof e||e instanceof FormData?e:JSON.stringify(e)},t}(https_client_service_interface_1.HttpsClientService);exports.FetchAPIHttpsClientService=FetchAPIHttpsClientService;
2
+ "use strict";var __extends=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function s(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(s.prototype=r.prototype,new s)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,r=1,s=arguments.length;r<s;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},__assign.apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.FetchAPIHttpsClientService=void 0;var rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),fetch_api_http_error_helper_1=require("../fetch-api-http-error-helper"),https_client_service_interface_1=require("../../../services/http/https-client/https-client.service.interface"),device_status_service_interface_1=require("../../../services/device-status.service.interface"),error_1=require("../../../models/error"),FetchAPIHttpsClientService=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.onCreate=function(){e.prototype.onCreate.call(this),this.deviceStatusService=this.serviceProvider.getService(device_status_service_interface_1.DeviceStatusService)},t.prototype.get=function(e,t,r,s){return this.requestAsObservable(this.addUrlParameters(e,t),__assign({method:"GET",credentials:(null==s?void 0:s.withCredentials)?"include":"same-origin"},r&&{headers:Object.entries(r)}))},t.prototype.post=function(e,t,r,s,i){return t instanceof FormData&&delete s["Content-Type"],this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"POST",credentials:(null==i?void 0:i.withCredentials)?"include":"same-origin"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}))},t.prototype.patch=function(e,t,r,s,i){return this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"PATCH",credentials:(null==i?void 0:i.withCredentials)?"include":"same-origin"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}))},t.prototype.delete=function(e,t,r,s,i){return this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"DELETE",credentials:(null==i?void 0:i.withCredentials)?"include":"same-origin"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}))},t.prototype.put=function(e,t,r,s,i){return this.requestAsObservable(this.addUrlParameters(e,r),__assign(__assign({method:"PUT",credentials:(null==i?void 0:i.withCredentials)?"include":"same-origin"},t&&{body:this.createBody(t)}),s&&{headers:Object.entries(s)}))},t.prototype.requestAsObservable=function(e,t){var r=this;return new rxjs_1.Observable((function(s){r.validateIsKnownUrlOrCry(e),fetch(e,t).then((function(e){s.next(e),s.complete()})).catch((function(e){s.error(e)}))})).pipe((0,operators_1.mergeMap)((function(e){return r.processResponse(e)})),(0,operators_1.catchError)((function(e){return r.checkInternetConnectivity(e)})),(0,operators_1.catchError)(fetch_api_http_error_helper_1.FetchAPIHttpErrorHelper.processError))},t.prototype.processResponse=function(e){if(e.status){if(e.status>=400&&e.status<500)throw console.log("HttpsService - Client Error"),e;if(e.status>=500&&e.status<600)throw console.log("HttpsService - Server Error"),e;return 204===e.status?(0,rxjs_1.of)({}):(0,rxjs_1.from)(e.clone().json())}throw e},t.prototype.checkInternetConnectivity=function(e){return(0,rxjs_1.from)(this.deviceStatusService.isConnectionAvailable()).pipe((0,operators_1.map)((function(t){throw t?e:new error_1.SdkError(error_1.SDK_ERROR_CODES.NO_INTERNET,e)})))},t.prototype.createBody=function(e){return"string"==typeof e||e instanceof FormData?e:JSON.stringify(e)},t}(https_client_service_interface_1.HttpsClientService);exports.FetchAPIHttpsClientService=FetchAPIHttpsClientService;
@@ -2,6 +2,12 @@
2
2
  import { Observable } from 'rxjs';
3
3
  import { BaseService } from '../../base.service';
4
4
  import { ServiceProvider } from '../../service-provider';
5
+ /**
6
+ * Options for the request.
7
+ */
8
+ export interface RequestOptions {
9
+ withCredentials: boolean;
10
+ }
5
11
  /**
6
12
  * Https-Client-Service is an interface that should be implemented by the platform/framework
7
13
  * that uses the JS-SDK. It should provide functions to do basic https-calls (like GET, POST, ...)
@@ -31,7 +37,7 @@ export declare class HttpsClientService extends BaseService {
31
37
  * @param headers object with the request headers
32
38
  * @returns Observable that resolves with the request result
33
39
  */
34
- get(url: string, urlParams?: Array<Object>, headers?: Object): Observable<any>;
40
+ get(url: string, urlParams?: Array<Object>, headers?: Object, requestOptions?: RequestOptions): Observable<any>;
35
41
  /**
36
42
  * Send POST request to the server with the given url and content.
37
43
  *
@@ -41,7 +47,7 @@ export declare class HttpsClientService extends BaseService {
41
47
  * @param headers object with the request headers
42
48
  * @returns Observable that resolves with the request result
43
49
  */
44
- post(url: string, data: Object, urlParams?: Array<Object>, headers?: Object): Observable<any>;
50
+ post(url: string, data: Object, urlParams?: Array<Object>, headers?: Object, requestOptions?: RequestOptions): Observable<any>;
45
51
  /**
46
52
  * Send PUT request to the server with the given url and content.
47
53
  *
@@ -51,7 +57,7 @@ export declare class HttpsClientService extends BaseService {
51
57
  * @param headers object with the request headers
52
58
  * @returns Observable that resolves with the request result
53
59
  */
54
- put(url: string, data: Object, urlParams?: Array<Object>, headers?: Object): Observable<any>;
60
+ put(url: string, data: Object, urlParams?: Array<Object>, headers?: Object, requestOptions?: RequestOptions): Observable<any>;
55
61
  /**
56
62
  * Send PATCH request to the server with the given url and content.
57
63
  *
@@ -61,7 +67,7 @@ export declare class HttpsClientService extends BaseService {
61
67
  * @param headers object with the request headers
62
68
  * @returns Observable that resolves with the request result
63
69
  */
64
- patch(url: string, data: Object, urlParams?: Array<Object>, headers?: Object): Observable<any>;
70
+ patch(url: string, data: Object, urlParams?: Array<Object>, headers?: Object, requestOptions?: RequestOptions): Observable<any>;
65
71
  /**
66
72
  * Send DELETE request to the server with the given url and content.
67
73
  *
@@ -70,7 +76,7 @@ export declare class HttpsClientService extends BaseService {
70
76
  * @param headers object with the request headers
71
77
  * @returns Observable that resolves with the request result
72
78
  */
73
- delete(url: string, data?: Object, urlParams?: Array<Object>, headers?: Object): Observable<any>;
79
+ delete(url: string, data?: Object, urlParams?: Array<Object>, headers?: Object, requestOptions?: RequestOptions): Observable<any>;
74
80
  /**
75
81
  * Add url parameters to the given url and return it as string.
76
82
  * If one of the parameter already exists, it will be replaced with
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";var __extends=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),__decorate=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(exports,"__esModule",{value:!0}),exports.HttpsClientService=void 0;var injection_identifier_1=require("../../../decorators/injection-identifier"),general_helper_1=require("../../../utils/general-helper"),base_service_1=require("../../base.service"),HttpsClientService=function(e){function t(t,r){var n=e.call(this,t)||this;return n.knownBaseUrls=r.map((function(e){return e.toLowerCase()})),n}return __extends(t,e),t.prototype.validateIsKnownUrlOrCry=function(e){for(var t=e.toLowerCase(),r=0,n=this.knownBaseUrls;r<n.length;r++){var o=n[r];if(t.startsWith(o))return}throw new Error('The given URL is not a known service "'.concat(e,'".'))},t.prototype.get=function(e,t,r){throw new Error("In order to use the get HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.post=function(e,t,r,n){throw new Error("In order to use the post HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.put=function(e,t,r,n){throw new Error("In order to use the put HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.patch=function(e,t,r,n){throw new Error("In order to use the patch HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.delete=function(e,t,r,n){throw new Error("In order to use the delete HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.addUrlParameters=function(e,t){return(0,general_helper_1.addUrlParameters)(e,t)},t.prototype.addUrlParameter=function(e,t){return(0,general_helper_1.addUrlParameter)(e,t)},t=__decorate([(0,injection_identifier_1.InjectionIdentifier)("HttpsClientService")],t)}(base_service_1.BaseService);exports.HttpsClientService=HttpsClientService;
2
+ "use strict";var __extends=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),__decorate=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(exports,"__esModule",{value:!0}),exports.HttpsClientService=void 0;var injection_identifier_1=require("../../../decorators/injection-identifier"),general_helper_1=require("../../../utils/general-helper"),base_service_1=require("../../base.service"),HttpsClientService=function(e){function t(t,r){var n=e.call(this,t)||this;return n.knownBaseUrls=r.map((function(e){return e.toLowerCase()})),n}return __extends(t,e),t.prototype.validateIsKnownUrlOrCry=function(e){for(var t=e.toLowerCase(),r=0,n=this.knownBaseUrls;r<n.length;r++){var o=n[r];if(t.startsWith(o))return}throw new Error('The given URL is not a known service "'.concat(e,'".'))},t.prototype.get=function(e,t,r,n){throw new Error("In order to use the get HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.post=function(e,t,r,n,o){throw new Error("In order to use the post HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.put=function(e,t,r,n,o){throw new Error("In order to use the put HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.patch=function(e,t,r,n,o){throw new Error("In order to use the patch HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.delete=function(e,t,r,n,o){throw new Error("In order to use the delete HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.addUrlParameters=function(e,t){return(0,general_helper_1.addUrlParameters)(e,t)},t.prototype.addUrlParameter=function(e,t){return(0,general_helper_1.addUrlParameter)(e,t)},t=__decorate([(0,injection_identifier_1.InjectionIdentifier)("HttpsClientService")],t)}(base_service_1.BaseService);exports.HttpsClientService=HttpsClientService;
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- export declare const SDK_VERSION_NUMBER = "14.9.0";
2
+ export declare const SDK_VERSION_NUMBER = "14.10.0";
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SDK_VERSION_NUMBER=void 0,exports.SDK_VERSION_NUMBER="14.9.0";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SDK_VERSION_NUMBER=void 0,exports.SDK_VERSION_NUMBER="14.10.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@partium/js-sdk",
3
- "version": "14.9.0",
3
+ "version": "14.10.0",
4
4
  "author": "Partium Inc.",
5
5
  "license": "See LICENSE.txt",
6
6
  "description": "The Partium Find SDK enables integration of Partium’s parts and materials search capabilities into JavaScript-based applications.",