@partium/js-sdk 15.12.2 → 15.14.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.
- package/core/index.d.ts +1 -0
- package/core/index.js +1 -1
- package/core/services/service-provider.js +1 -1
- package/core/utils/general-helper.d.ts +7 -0
- package/core/utils/general-helper.js +1 -1
- package/data/index.d.ts +3 -0
- package/data/index.js +1 -1
- package/data/models/get-selectable-attributes-request.d.ts +23 -0
- package/data/models/get-selectable-attributes-request.js +2 -0
- package/data/models/get-selectable-attributes-response.d.ts +8 -0
- package/data/models/get-selectable-attributes-response.js +2 -0
- package/data/models/selectable-attribute.d.ts +18 -0
- package/data/models/selectable-attribute.js +2 -0
- package/data/services/data.service.d.ts +10 -0
- package/data/services/data.service.js +1 -1
- package/enrichment/models/trigger-enrichment-job-request.d.ts +4 -0
- package/enrichment/services/data-enrichment.service.d.ts +0 -1
- package/enrichment/services/data-enrichment.service.js +1 -1
- package/gen/sdk-version.d.ts +1 -1
- package/gen/sdk-version.js +1 -1
- package/package.json +2 -1
package/core/index.d.ts
CHANGED
|
@@ -50,3 +50,4 @@ export * from './services/recent-parts.service';
|
|
|
50
50
|
export * from './models/base-paginated-request';
|
|
51
51
|
export * from './models/base-paginated-response';
|
|
52
52
|
export * from './models/default-get-paginated-request-pagination-context';
|
|
53
|
+
export * from './utils/general-helper';
|
package/core/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,s){void 0===s&&(s=t);var i=Object.getOwnPropertyDescriptor(r,t);i&&!("get"in i?!r.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,s,i)}:function(e,r,t,s){void 0===s&&(s=t),e[s]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./decorators/injection-identifier"),exports),__exportStar(require("./integration-defaults/js-p-file"),exports),__exportStar(require("./integration-defaults/web-local-storage.service"),exports),__exportStar(require("./integration-defaults/web-device-status.service"),exports),__exportStar(require("./integration-defaults/web-indexeddb.service"),exports),__exportStar(require("./integration-defaults/web-file.service"),exports),__exportStar(require("./integration-defaults/http/js-oauth-keycloak-https.service"),exports),__exportStar(require("./integration-defaults/http/https-client/axios-https-client.service"),exports),__exportStar(require("./integration-defaults/http/https-client/fetch-api-https-client.service"),exports),__exportStar(require("./integration-defaults/http/file-transfer/axios-file-transfer.service"),exports),__exportStar(require("./integration-defaults/http/file-transfer/fetch-api-file-transfer.service"),exports),__exportStar(require("./integration-defaults/session/js-oauth-keycloak-session.service"),exports),__exportStar(require("./integration-defaults/session/js-oauth-keycloak-auth-config"),exports),__exportStar(require("./integration-defaults/session/js-oauth-api-key-session.service"),exports),__exportStar(require("./integration-defaults/session/js-oauth-web-cookie-session.service"),exports),__exportStar(require("./models/i18n-string"),exports),__exportStar(require("./models/partium-config"),exports),__exportStar(require("./models/auth-config"),exports),__exportStar(require("./models/p-file"),exports),__exportStar(require("./models/formatted-string"),exports),__exportStar(require("./models/i18n-map"),exports),__exportStar(require("./models/error"),exports),__exportStar(require("./models/organization"),exports),__exportStar(require("./models/api-object"),exports),__exportStar(require("./models/paginated-list"),exports),__exportStar(require("./models/log"),exports),__exportStar(require("./models/device-info"),exports),__exportStar(require("./models/user-token"),exports),__exportStar(require("./models/user"),exports),__exportStar(require("./models/base-response"),exports),__exportStar(require("./services/service-provider"),exports),__exportStar(require("./services/local-storage.service.interface"),exports),__exportStar(require("./services/backend-status.service"),exports),__exportStar(require("./services/http/https.service.interface"),exports),__exportStar(require("./services/http/https-client/https-client.service.interface"),exports),__exportStar(require("./services/http/file-transfer/file-transfer.service.interface"),exports),__exportStar(require("./services/http/oauth-https.service"),exports),__exportStar(require("./services/base.service"),exports),__exportStar(require("./services/base-login-init.service"),exports),__exportStar(require("./services/device-status.service.interface"),exports),__exportStar(require("./services/session/session.service.interface"),exports),__exportStar(require("./services/session/oauth-session.service"),exports),__exportStar(require("./services/organization.service"),exports),__exportStar(require("./services/paginated-request.service"),exports),__exportStar(require("./services/log.service"),exports),__exportStar(require("./factories/paginated-request-service.factory"),exports),__exportStar(require("./services/file.service.interface"),exports),__exportStar(require("./services/recent-parts.service"),exports),__exportStar(require("./models/base-paginated-request"),exports),__exportStar(require("./models/base-paginated-response"),exports),__exportStar(require("./models/default-get-paginated-request-pagination-context"),exports);
|
|
2
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,s){void 0===s&&(s=t);var i=Object.getOwnPropertyDescriptor(r,t);i&&!("get"in i?!r.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,s,i)}:function(e,r,t,s){void 0===s&&(s=t),e[s]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./decorators/injection-identifier"),exports),__exportStar(require("./integration-defaults/js-p-file"),exports),__exportStar(require("./integration-defaults/web-local-storage.service"),exports),__exportStar(require("./integration-defaults/web-device-status.service"),exports),__exportStar(require("./integration-defaults/web-indexeddb.service"),exports),__exportStar(require("./integration-defaults/web-file.service"),exports),__exportStar(require("./integration-defaults/http/js-oauth-keycloak-https.service"),exports),__exportStar(require("./integration-defaults/http/https-client/axios-https-client.service"),exports),__exportStar(require("./integration-defaults/http/https-client/fetch-api-https-client.service"),exports),__exportStar(require("./integration-defaults/http/file-transfer/axios-file-transfer.service"),exports),__exportStar(require("./integration-defaults/http/file-transfer/fetch-api-file-transfer.service"),exports),__exportStar(require("./integration-defaults/session/js-oauth-keycloak-session.service"),exports),__exportStar(require("./integration-defaults/session/js-oauth-keycloak-auth-config"),exports),__exportStar(require("./integration-defaults/session/js-oauth-api-key-session.service"),exports),__exportStar(require("./integration-defaults/session/js-oauth-web-cookie-session.service"),exports),__exportStar(require("./models/i18n-string"),exports),__exportStar(require("./models/partium-config"),exports),__exportStar(require("./models/auth-config"),exports),__exportStar(require("./models/p-file"),exports),__exportStar(require("./models/formatted-string"),exports),__exportStar(require("./models/i18n-map"),exports),__exportStar(require("./models/error"),exports),__exportStar(require("./models/organization"),exports),__exportStar(require("./models/api-object"),exports),__exportStar(require("./models/paginated-list"),exports),__exportStar(require("./models/log"),exports),__exportStar(require("./models/device-info"),exports),__exportStar(require("./models/user-token"),exports),__exportStar(require("./models/user"),exports),__exportStar(require("./models/base-response"),exports),__exportStar(require("./services/service-provider"),exports),__exportStar(require("./services/local-storage.service.interface"),exports),__exportStar(require("./services/backend-status.service"),exports),__exportStar(require("./services/http/https.service.interface"),exports),__exportStar(require("./services/http/https-client/https-client.service.interface"),exports),__exportStar(require("./services/http/file-transfer/file-transfer.service.interface"),exports),__exportStar(require("./services/http/oauth-https.service"),exports),__exportStar(require("./services/base.service"),exports),__exportStar(require("./services/base-login-init.service"),exports),__exportStar(require("./services/device-status.service.interface"),exports),__exportStar(require("./services/session/session.service.interface"),exports),__exportStar(require("./services/session/oauth-session.service"),exports),__exportStar(require("./services/organization.service"),exports),__exportStar(require("./services/paginated-request.service"),exports),__exportStar(require("./services/log.service"),exports),__exportStar(require("./factories/paginated-request-service.factory"),exports),__exportStar(require("./services/file.service.interface"),exports),__exportStar(require("./services/recent-parts.service"),exports),__exportStar(require("./models/base-paginated-request"),exports),__exportStar(require("./models/base-paginated-response"),exports),__exportStar(require("./models/default-get-paginated-request-pagination-context"),exports),__exportStar(require("./utils/general-helper"),exports);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";var __spreadArray=this&&this.__spreadArray||function(e,i,t){if(t||2===arguments.length)for(var r,s=0,n=i.length;s<n;s++)!r&&s in i||(r||(r=Array.prototype.slice.call(i,0,s)),r[s]=i[s]);return e.concat(r||Array.prototype.slice.call(i))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.ServiceProvider=void 0;var ServiceProvider=function(){function e(){this.services={},this.useServicePhaseEnded=!1}return e.prototype.getService=function(e){if(!this.
|
|
2
|
+
"use strict";var __spreadArray=this&&this.__spreadArray||function(e,i,t){if(t||2===arguments.length)for(var r,s=0,n=i.length;s<n;s++)!r&&s in i||(r||(r=Array.prototype.slice.call(i,0,s)),r[s]=i[s]);return e.concat(r||Array.prototype.slice.call(i))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.ServiceProvider=void 0;var ServiceProvider=function(){function e(){this.services={},this.useServicePhaseEnded=!1}return e.prototype.getService=function(e){if(!this.useServicePhaseEnded)throw"Can not retrieve service, because service-selection with useService is not yet finished. Call serviceSelectionFinished to end this phase.";return this.services[e.getInjectionIdentifierName()]||(this.services[e.getInjectionIdentifierName()]=new e(this),this.useServicePhaseEnded&&this.services[e.getInjectionIdentifierName()].onCreate()),this.services[e.getInjectionIdentifierName()]},e.prototype.useService=function(e,i){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];if(this.useServicePhaseEnded)throw"You can not call useService after calling serviceSelectionFinished";this.services[i.getInjectionIdentifierName()]=new(e.bind.apply(e,__spreadArray([void 0,this],t,!1)))},e.prototype.setService=function(e,i){if(this.useServicePhaseEnded)throw"You can not call setService after calling serviceSelectionFinished";this.services[i.getInjectionIdentifierName()]=e},e.prototype.serviceSelectionFinished=function(){if(!this.useServicePhaseEnded){this.useServicePhaseEnded=!0;for(var e=0,i=Object.keys(this.services);e<i.length;e++){var t=i[e];this.services[t].onCreate()}}},e.prototype.reset=function(){this.services={},this.useServicePhaseEnded=!1},e}();exports.ServiceProvider=ServiceProvider;
|
|
@@ -33,3 +33,10 @@ export declare const addUrlParameters: (url: string, paramObjects: Array<Object>
|
|
|
33
33
|
* @returns the given url with the appended parameter
|
|
34
34
|
*/
|
|
35
35
|
export declare const addUrlParameter: (url: string, paramObject: Object) => string;
|
|
36
|
+
/**
|
|
37
|
+
* Serialize a params object into repeated single-key query param objects.
|
|
38
|
+
*
|
|
39
|
+
* @param params object with scalar or array query param values
|
|
40
|
+
* @returns query param objects consumable by HttpsService
|
|
41
|
+
*/
|
|
42
|
+
export declare const toQueryParams: (params: object) => Array<Object>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addUrlParameter=exports.addUrlParameters=exports.snakeToCamelCase=exports.camelToSnake=void 0;var camelToSnake=function(
|
|
2
|
+
"use strict";var __spreadArray=this&&this.__spreadArray||function(r,e,a){if(a||2===arguments.length)for(var t,n=0,o=e.length;n<o;n++)!t&&n in e||(t||(t=Array.prototype.slice.call(e,0,n)),t[n]=e[n]);return r.concat(t||Array.prototype.slice.call(e))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.toQueryParams=exports.addUrlParameter=exports.addUrlParameters=exports.snakeToCamelCase=exports.camelToSnake=void 0;var camelToSnake=function(r){var e={};return Object.keys(r).forEach((function(a){var t=a.replace(/[A-Z]/g,(function(r){return"_".concat(r.toLowerCase())}));if(e[t]=r[a],Array.isArray(r[t])){var n=r[t];n=n.map((function(r){return r&&"object"==typeof r&&r.constructor===Object?(0,exports.camelToSnake)(r):r})),e[t]=n}})),e};exports.camelToSnake=camelToSnake;var snakeToCamelCase=function(r){var e={};return Object.keys(r).forEach((function(a){var t=a.toLowerCase().replace(/([-_][a-z])/g,(function(r){return r.toUpperCase().replace("-","").replace("_","")}));if(e[t]=r[a],Array.isArray(r[t])){var n=r[t];n=n.map((function(r){return r&&"object"==typeof r&&r.constructor===Object?(0,exports.snakeToCamelCase)(r):r})),e[t]=n}})),e};exports.snakeToCamelCase=snakeToCamelCase;var addUrlParameters=function(r,e){if(!e||e.length<1)return r;for(var a=0,t=e;a<t.length;a++){var n=t[a];r=(0,exports.addUrlParameter)(r,n)}return r};exports.addUrlParameters=addUrlParameters;var addUrlParameter=function(r,e){if(!e)return r;var a=r.split("?"),t=a[0],n=[];a.length>1&&(n=a[1].split("&").map((function(r){return r.split("=")})));for(var o=0,s=Object.keys(e);o<s.length;o++){var c=s[o],l=e[c];null!=l&&(c=encodeURIComponent(c),l=encodeURIComponent(l),n.push([c,l]))}var u=n.map((function(r){return r.join("=")}));return u.length>0?"".concat(t,"?").concat(u.join("&")):t};exports.addUrlParameter=addUrlParameter;var toQueryParams=function(r){return Object.entries(r).reduce((function(r,e){var a,t=e[0],n=e[1];return null==n?r:Array.isArray(n)?__spreadArray(__spreadArray([],r,!0),n.map((function(r){var e;return(e={})[t]=r,e})),!0):__spreadArray(__spreadArray([],r,!0),[(a={},a[t]=n,a)],!1)}),[])};exports.toQueryParams=toQueryParams;
|
package/data/index.d.ts
CHANGED
|
@@ -18,7 +18,10 @@ export * from './models/mounting-location';
|
|
|
18
18
|
export * from './models/part-enrichment-data';
|
|
19
19
|
export * from './models/get-part-data-request';
|
|
20
20
|
export * from './models/get-part-data-response';
|
|
21
|
+
export * from './models/get-selectable-attributes-request';
|
|
22
|
+
export * from './models/get-selectable-attributes-response';
|
|
21
23
|
export * from './models/part-data';
|
|
24
|
+
export * from './models/selectable-attribute';
|
|
22
25
|
export * from './services/part.service';
|
|
23
26
|
export * from './services/part-enrichment.service';
|
|
24
27
|
export * from './services/related-parts.service';
|
package/data/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,s){void 0===s&&(s=t);var o=Object.getOwnPropertyDescriptor(r,t);o&&!("get"in o?!r.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,s,o)}:function(e,r,t,s){void 0===s&&(s=t),e[s]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./models/part"),exports),__exportStar(require("./models/document"),exports),__exportStar(require("./models/assembly-hierarchy-node"),exports),__exportStar(require("./models/assembly-hierarchy-node-breadcrumb"),exports),__exportStar(require("./models/image"),exports),__exportStar(require("./models/attribute"),exports),__exportStar(require("./models/csa-request"),exports),__exportStar(require("./models/csa-request-status"),exports),__exportStar(require("./models/filter-key"),exports),__exportStar(require("./models/filter-option-value"),exports),__exportStar(require("./models/shopping-cart"),exports),__exportStar(require("./models/multiple-expert-searches"),exports),__exportStar(require("./models/csa-request-search"),exports),__exportStar(require("./models/announcement"),exports),__exportStar(require("./models/inquiry"),exports),__exportStar(require("./models/mounting-location"),exports),__exportStar(require("./models/part-enrichment-data"),exports),__exportStar(require("./models/get-part-data-request"),exports),__exportStar(require("./models/get-part-data-response"),exports),__exportStar(require("./models/part-data"),exports),__exportStar(require("./services/part.service"),exports),__exportStar(require("./services/part-enrichment.service"),exports),__exportStar(require("./services/related-parts.service"),exports),__exportStar(require("./services/assembly-hierarchy-nodes.service"),exports),__exportStar(require("./services/part-attribute.service"),exports),__exportStar(require("./services/customer-service-assistance.service"),exports),__exportStar(require("./services/filter.service"),exports),__exportStar(require("./services/shopping-cart.service"),exports),__exportStar(require("./services/inquiry.service"),exports),__exportStar(require("./services/announcement.service"),exports),__exportStar(require("./services/data.service"),exports);
|
|
2
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,s){void 0===s&&(s=t);var o=Object.getOwnPropertyDescriptor(r,t);o&&!("get"in o?!r.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,s,o)}:function(e,r,t,s){void 0===s&&(s=t),e[s]=r[t]}),__exportStar=this&&this.__exportStar||function(e,r){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(r,t)||__createBinding(r,e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./models/part"),exports),__exportStar(require("./models/document"),exports),__exportStar(require("./models/assembly-hierarchy-node"),exports),__exportStar(require("./models/assembly-hierarchy-node-breadcrumb"),exports),__exportStar(require("./models/image"),exports),__exportStar(require("./models/attribute"),exports),__exportStar(require("./models/csa-request"),exports),__exportStar(require("./models/csa-request-status"),exports),__exportStar(require("./models/filter-key"),exports),__exportStar(require("./models/filter-option-value"),exports),__exportStar(require("./models/shopping-cart"),exports),__exportStar(require("./models/multiple-expert-searches"),exports),__exportStar(require("./models/csa-request-search"),exports),__exportStar(require("./models/announcement"),exports),__exportStar(require("./models/inquiry"),exports),__exportStar(require("./models/mounting-location"),exports),__exportStar(require("./models/part-enrichment-data"),exports),__exportStar(require("./models/get-part-data-request"),exports),__exportStar(require("./models/get-part-data-response"),exports),__exportStar(require("./models/get-selectable-attributes-request"),exports),__exportStar(require("./models/get-selectable-attributes-response"),exports),__exportStar(require("./models/part-data"),exports),__exportStar(require("./models/selectable-attribute"),exports),__exportStar(require("./services/part.service"),exports),__exportStar(require("./services/part-enrichment.service"),exports),__exportStar(require("./services/related-parts.service"),exports),__exportStar(require("./services/assembly-hierarchy-nodes.service"),exports),__exportStar(require("./services/part-attribute.service"),exports),__exportStar(require("./services/customer-service-assistance.service"),exports),__exportStar(require("./services/filter.service"),exports),__exportStar(require("./services/shopping-cart.service"),exports),__exportStar(require("./services/inquiry.service"),exports),__exportStar(require("./services/announcement.service"),exports),__exportStar(require("./services/data.service"),exports);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
+
import { BasePaginatedRequest } from '../../core';
|
|
3
|
+
/**
|
|
4
|
+
* Request for listing selectable attribute definitions.
|
|
5
|
+
*/
|
|
6
|
+
export interface GetSelectableAttributesRequest extends BasePaginatedRequest {
|
|
7
|
+
/**
|
|
8
|
+
* Organization identifier when explicitly selecting an organization.
|
|
9
|
+
*/
|
|
10
|
+
organization?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Preferred language for the attribute display names.
|
|
13
|
+
*/
|
|
14
|
+
language?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Ordered fallback languages for names when the preferred language is missing.
|
|
17
|
+
*/
|
|
18
|
+
fallbackLanguages?: string[];
|
|
19
|
+
/**
|
|
20
|
+
* Case-insensitive search term for `attributeId` or the resolved display name.
|
|
21
|
+
*/
|
|
22
|
+
search?: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
+
import { BasePaginatedResponse } from '../../core';
|
|
3
|
+
import { SelectableAttribute } from './selectable-attribute';
|
|
4
|
+
/**
|
|
5
|
+
* Response for listing selectable attribute definitions.
|
|
6
|
+
*/
|
|
7
|
+
export interface GetSelectableAttributesResponse extends BasePaginatedResponse<SelectableAttribute> {
|
|
8
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
+
/**
|
|
3
|
+
* A selectable attribute definition returned by the Data API.
|
|
4
|
+
*/
|
|
5
|
+
export interface SelectableAttribute {
|
|
6
|
+
/**
|
|
7
|
+
* Unique identifier for the attribute definition.
|
|
8
|
+
*/
|
|
9
|
+
attributeId: string;
|
|
10
|
+
/**
|
|
11
|
+
* Display name of the attribute in the requested language.
|
|
12
|
+
*/
|
|
13
|
+
name?: string | null;
|
|
14
|
+
/**
|
|
15
|
+
* True when the attribute is marked as a technical attribute.
|
|
16
|
+
*/
|
|
17
|
+
technicalAttribute: boolean;
|
|
18
|
+
}
|
|
@@ -3,6 +3,8 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
import { BaseService, ServiceProvider } from '../../core';
|
|
4
4
|
import { GetPartDataRequest } from '../models/get-part-data-request';
|
|
5
5
|
import { GetPartDataResponse } from '../models/get-part-data-response';
|
|
6
|
+
import { GetSelectableAttributesRequest } from '../models/get-selectable-attributes-request';
|
|
7
|
+
import { GetSelectableAttributesResponse } from '../models/get-selectable-attributes-response';
|
|
6
8
|
export interface DataService {
|
|
7
9
|
/**
|
|
8
10
|
* Get the data of a part.
|
|
@@ -11,10 +13,18 @@ export interface DataService {
|
|
|
11
13
|
* @returns The data of the part.
|
|
12
14
|
*/
|
|
13
15
|
getPart(request: GetPartDataRequest): Observable<GetPartDataResponse>;
|
|
16
|
+
/**
|
|
17
|
+
* List selectable attribute definitions.
|
|
18
|
+
*
|
|
19
|
+
* @param request - The request object.
|
|
20
|
+
* @returns The selectable attribute definitions.
|
|
21
|
+
*/
|
|
22
|
+
getSelectableAttributes(request?: GetSelectableAttributesRequest): Observable<GetSelectableAttributesResponse>;
|
|
14
23
|
}
|
|
15
24
|
export declare class DataServiceImpl extends BaseService implements DataService {
|
|
16
25
|
private httpsService;
|
|
17
26
|
constructor(serviceProvider: ServiceProvider);
|
|
18
27
|
onCreate(): void;
|
|
19
28
|
getPart(request?: GetPartDataRequest): Observable<GetPartDataResponse>;
|
|
29
|
+
getSelectableAttributes(request?: GetSelectableAttributesRequest): Observable<GetSelectableAttributesResponse>;
|
|
20
30
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";var __extends=this&&this.__extends||function(){var
|
|
2
|
+
"use strict";var __extends=this&&this.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},__assign.apply(this,arguments)},__decorate=this&&this.__decorate||function(t,e,r,o){var n,i=arguments.length,c=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,r,o);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(c=(i<3?n(c):i>3?n(e,r,c):n(e,r))||c);return i>3&&c&&Object.defineProperty(e,r,c),c},__rest=this&&this.__rest||function(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(r[o[n]]=t[o[n]])}return r};Object.defineProperty(exports,"__esModule",{value:!0}),exports.DataServiceImpl=void 0;var core_1=require("../../core"),DataServiceImpl=function(t){function e(e){return t.call(this,e)||this}return __extends(e,t),e.prototype.onCreate=function(){this.httpsService=this.serviceProvider.getService(core_1.HttpsService)},e.prototype.getPart=function(t){void 0===t&&(t={projection:["partiumId"]});var e=t.projection,r=t.fallbackLanguages,o=__rest(t,["projection","fallbackLanguages"]),n=Array.from(new Set(e)).join(","),i=(null==r?void 0:r.length)?Array.from(new Set(r)).join(","):void 0,c=Object.entries(__assign(__assign({},o),{projection:n,fallbackLanguages:i})).filter((function(t){return null!=t[1]})).map((function(t){var e,r=t[0],o=t[1];return(e={})[r]=o,e}));return this.httpsService.get("part",c,core_1.BACKEND_SERVICE.DATA_V2)},e.prototype.getSelectableAttributes=function(t){return void 0===t&&(t={}),this.httpsService.get("attributes",(0,core_1.toQueryParams)(t),core_1.BACKEND_SERVICE.DATA_V2)},e=__decorate([(0,core_1.InjectionIdentifier)("DataService")],e)}(core_1.BaseService);exports.DataServiceImpl=DataServiceImpl;
|
|
@@ -16,6 +16,10 @@ export interface TriggerEnrichmentJobRequest {
|
|
|
16
16
|
* Whether the job should be visible in the enrichment dashboard.
|
|
17
17
|
*/
|
|
18
18
|
visible?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Optional list of attribute identifiers used for attribute enrichment jobs.
|
|
21
|
+
*/
|
|
22
|
+
attributeIds?: string[];
|
|
19
23
|
/**
|
|
20
24
|
* Organization identifier when explicitly selecting an organization.
|
|
21
25
|
*/
|
|
@@ -130,6 +130,5 @@ export declare class DataEnrichmentServiceImpl extends BaseService implements Da
|
|
|
130
130
|
triggerEnrichmentJob(request: TriggerEnrichmentJobRequest): Observable<TriggerEnrichmentJobResponse>;
|
|
131
131
|
private fetchEnrichmentJobsPage;
|
|
132
132
|
private fetchEnrichmentJobPartsPage;
|
|
133
|
-
private toQueryParams;
|
|
134
133
|
private extractNextCursor;
|
|
135
134
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";var __extends=this&&this.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e])},r(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r},__assign.apply(this,arguments)},__decorate=this&&this.__decorate||function(r,t,e,n){var o,i=arguments.length,
|
|
2
|
+
"use strict";var __extends=this&&this.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e])},r(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]);return r},__assign.apply(this,arguments)},__decorate=this&&this.__decorate||function(r,t,e,n){var o,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,e):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(r,t,e,n);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(i<3?o(s):i>3?o(t,e,s):o(t,e))||s);return i>3&&s&&Object.defineProperty(t,e,s),s},__rest=this&&this.__rest||function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(e[n[o]]=r[n[o]])}return e},__spreadArray=this&&this.__spreadArray||function(r,t,e){if(e||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return r.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.DataEnrichmentServiceImpl=void 0;var rxjs_1=require("rxjs"),core_1=require("../../core"),enrichment_job_1=require("../models/enrichment-job"),enrichment_job_part_1=require("../models/enrichment-job-part"),DataEnrichmentServiceImpl=function(r){function t(){return null!==r&&r.apply(this,arguments)||this}return __extends(t,r),t.prototype.onCreate=function(){this.httpsService=this.serviceProvider.getService(core_1.HttpsService)},t.prototype.loadEnrichmentJobs=function(r){return this.fetchEnrichmentJobsPage(r).pipe((0,rxjs_1.map)((function(t){var e=t.jobs,n=t.nextCursor;return{jobs:e,paginationContext:{initialRequest:r,nextCursor:n}}})))},t.prototype.loadMoreEnrichmentJobs=function(r){if(!r.nextCursor)return(0,rxjs_1.throwError)((function(){return new core_1.SdkError(core_1.SDK_ERROR_CODES.NO_PAGINATION_CURSOR_AVAILABLE,null,"No cursor available")}));var t=__assign(__assign({},r.initialRequest),{cursor:r.nextCursor});return this.fetchEnrichmentJobsPage(t).pipe((0,rxjs_1.map)((function(t){var e=t.jobs,n=t.nextCursor;return{jobs:e,paginationContext:__assign(__assign({},r),{nextCursor:n})}})))},t.prototype.hasMoreEnrichmentJobsAvailable=function(r){return!!r.nextCursor},t.prototype.getEnrichmentJob=function(r){var t=r.jobId,e=__rest(r,["jobId"]);return this.httpsService.get("jobs/".concat(t),(0,core_1.toQueryParams)(e),core_1.BACKEND_SERVICE.DATA_ENRICHMENT).pipe((0,rxjs_1.map)((function(r){return(0,enrichment_job_1.enrichmentJobDetailFromAPIResponse)(r)})))},t.prototype.loadEnrichmentJobParts=function(r){return this.fetchEnrichmentJobPartsPage(r).pipe((0,rxjs_1.map)((function(t){var e=t.parts,n=t.partsSummary,o=t.nextCursor;return{parts:e,partsSummary:n,paginationContext:{initialRequest:r,nextCursor:o}}})))},t.prototype.loadMoreEnrichmentJobParts=function(r){if(!r.nextCursor)return(0,rxjs_1.throwError)((function(){return new core_1.SdkError(core_1.SDK_ERROR_CODES.NO_PAGINATION_CURSOR_AVAILABLE,null,"No cursor available")}));var t=__assign(__assign({},r.initialRequest),{cursor:r.nextCursor});return this.fetchEnrichmentJobPartsPage(t).pipe((0,rxjs_1.map)((function(t){var e=t.parts,n=t.partsSummary,o=t.nextCursor;return{parts:e,partsSummary:n,paginationContext:__assign(__assign({},r),{nextCursor:o})}})))},t.prototype.hasMoreEnrichmentJobPartsAvailable=function(r){return!!r.nextCursor},t.prototype.createEnrichmentJob=function(r){var t=new FormData;t.append("file",r.csvFile);var e=__spreadArray(__spreadArray([],r.jobType?[{jobType:r.jobType}]:[],!0),void 0!==r.organization?[{organization:r.organization}]:[],!0);return this.httpsService.post("jobs/upload",t,e,core_1.BACKEND_SERVICE.DATA_ENRICHMENT,{"Content-Type":"multipart/form-data"})},t.prototype.createEnrichmentJobWithSearchSession=function(r){var t=__spreadArray(__spreadArray([],r.jobType?[{jobType:r.jobType}]:[],!0),void 0!==r.organization?[{organization:r.organization}]:[],!0);return this.httpsService.post("jobs",r,t,core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.submitEnrichmentJob=function(r){return this.httpsService.post("jobs/".concat(r.jobId,"/submit"),r,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.triggerEnrichmentJob=function(r){var t,e=__assign(__assign({type:r.type,partIds:r.partIds,visible:null!==(t=r.visible)&&void 0!==t&&t},void 0!==r.attributeIds?{attributeIds:r.attributeIds}:{}),void 0!==r.organization?{organization:r.organization}:{});return this.httpsService.post("jobs/trigger",e,[],core_1.BACKEND_SERVICE.DATA_ENRICHMENT)},t.prototype.fetchEnrichmentJobsPage=function(r){var t=this,e=(0,core_1.toQueryParams)(r);return this.httpsService.get("jobs",e,core_1.BACKEND_SERVICE.DATA_ENRICHMENT).pipe((0,rxjs_1.map)((function(r){var e,n;return{jobs:null!==(n=null===(e=r.results)||void 0===e?void 0:e.map((function(r){return(0,enrichment_job_1.enrichmentJobFromAPIResponse)(r)})))&&void 0!==n?n:[],nextCursor:t.extractNextCursor(r)}})))},t.prototype.fetchEnrichmentJobPartsPage=function(r){var t=this,e=r.jobId,n=__rest(r,["jobId"]),o=(0,core_1.toQueryParams)(n);return this.httpsService.get("jobs/".concat(e,"/parts"),o,core_1.BACKEND_SERVICE.DATA_ENRICHMENT).pipe((0,rxjs_1.map)((function(r){var e,n;return{parts:null!==(n=null===(e=r.results)||void 0===e?void 0:e.map((function(r){return(0,enrichment_job_part_1.enrichmentJobPartFromAPIResponse)(r)})))&&void 0!==n?n:[],partsSummary:r.partsSummary,nextCursor:t.extractNextCursor(r)}})))},t.prototype.extractNextCursor=function(r){if(r.next)return new URL(r.next).searchParams.get("cursor")||void 0},t=__decorate([(0,core_1.InjectionIdentifier)("DataEnrichmentService")],t)}(core_1.BaseService);exports.DataEnrichmentServiceImpl=DataEnrichmentServiceImpl;
|
package/gen/sdk-version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
export declare const SDK_VERSION_NUMBER = "15.
|
|
2
|
+
export declare const SDK_VERSION_NUMBER = "15.14.0";
|
package/gen/sdk-version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SDK_VERSION_NUMBER=void 0,exports.SDK_VERSION_NUMBER="15.
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SDK_VERSION_NUMBER=void 0,exports.SDK_VERSION_NUMBER="15.14.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@partium/js-sdk",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.14.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.",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"watch:local": "node ../scripts/local-sdk-build.mjs watch",
|
|
25
25
|
"clean:local": "node ../scripts/local-sdk-build.mjs clean",
|
|
26
26
|
"test": "jest",
|
|
27
|
+
"test:coverage": "jest --coverage",
|
|
27
28
|
"test-compact": "jest 2>&1 | grep -E 'FAIL|●|Tests:|Test Suites:' | grep -v '● Console'"
|
|
28
29
|
},
|
|
29
30
|
"dependencies": {
|