@partium/js-sdk 14.0.0-alpha3 → 14.0.1

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,2 +1,2 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";var __extends=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var a in e=arguments[n])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t},__assign.apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Part=exports.DATA_ORIGIN=exports.DUPLICATE_DATA_AREA=exports.SUBSTITUTE_ROLE=exports.RELATION_TYPE=exports.PartMountingLocation=void 0;var RELATION_TYPE,SUBSTITUTE_ROLE,DUPLICATE_DATA_AREA,DATA_ORIGIN,core_1=require("../../core"),attribute_1=require("./attribute"),image_1=require("./image"),mounting_location_1=require("./mounting-location"),part_enrichment_data_1=require("./part-enrichment-data"),mounting_location_2=require("./mounting-location");Object.defineProperty(exports,"PartMountingLocation",{enumerable:!0,get:function(){return mounting_location_2.PartMountingLocation}}),function(t){t.DUPLICATE="duplicate",t.SUBSTITUTE="substitute",t.EQUIVALENT="equivalent",t.NOT_RELATED="not_related"}(RELATION_TYPE||(exports.RELATION_TYPE=RELATION_TYPE={})),function(t){t.SUCCESSOR="successor",t.PREDECESSOR="predecessor"}(SUBSTITUTE_ROLE||(exports.SUBSTITUTE_ROLE=SUBSTITUTE_ROLE={})),function(t){t.IMAGE="IMAGE",t.NAME="NAME",t.DATA="DATA"}(DUPLICATE_DATA_AREA||(exports.DUPLICATE_DATA_AREA=DUPLICATE_DATA_AREA={})),function(t){t[t.SEARCH_RESULT=0]="SEARCH_RESULT",t[t.PARTIAL=0]="PARTIAL",t[t.SERVER=2]="SERVER",t[t.DATA_API=2]="DATA_API",t[t.FIND_API=3]="FIND_API"}(DATA_ORIGIN||(exports.DATA_ORIGIN=DATA_ORIGIN={}));var Part=function(t){function e(e){var n=t.call(this)||this;return Object.assign(n,e),n}return __extends(e,t),e.prototype.updatePart=function(t){Object.assign(this,t)},e.prototype.updateName=function(t){this.name=t},e.prototype.updateDescription=function(t){this.description=t},e.fromAPIResponse=function(t,n,r){var a;if(void 0===n&&(n=DATA_ORIGIN.DATA_API),n===DATA_ORIGIN.FIND_API){var i=(u=t).mountingLocationsCount,o=u.nameLanguage||r,A=u.attributes;return new e(__assign(__assign(__assign(__assign({partiumId:u.partiumId,externalId:u.id,name:new core_1.i18nString((a={},a[o]=u.name,a)),images:u.images?u.images.map((function(t){return image_1.Image.fromAPIResponse(t,core_1.BACKEND_SERVICE.FIND)})):[],dataOrigin:DATA_ORIGIN.FIND_API},A&&{attributes:u.attributes.map((function(t){return attribute_1.Attribute.fromAPIResponse(t,n)}))}),{mountingLocationsCount:i||null,mountingLocations:null}),u.duplicateType&&{duplicateType:this.getDuplicateType(u.duplicateType)}),{highlights:u.highlights?u.highlights:null,relatedPartsSummary:u.relatedPartsSummary?u.relatedPartsSummary:null}))}var u,_=(u=t).organization,s=(A=u.attributes,u.mounting_locations);return new e(__assign(__assign(__assign({partiumId:u.uuid,externalId:u.external_id,externalPayload:u.metadata,name:new core_1.i18nString(u.name),images:u.images?u.images.filter((function(t){return"display"===t.type})).map((function(t){return image_1.Image.fromAPIResponse(t,core_1.BACKEND_SERVICE.DATA)})):[],dataOrigin:DATA_ORIGIN.DATA_API},_&&{organization:new core_1.Organization({partiumId:_.uuid,name:_.name,displayName:_.name})}),A&&{attributes:u.attributes.map((function(t){return attribute_1.Attribute.fromAPIResponse(t,n)}))}),{mountingLocationsCount:u.total_mounting_locations_count||0,mountingLocations:(null==s?void 0:s.map((function(t){return mounting_location_1.PartMountingLocation.fromAPIResponse(t)})))||[],summary:u.summary?{summaryId:u.summary.summary_id,summary:u.summary.summary.map((function(t){return{key:new core_1.i18nString(t.key),values:t.values.map((function(t){return new core_1.i18nString(t)}))}}))}:null,enrichment:u.enrichment?part_enrichment_data_1.PartEnrichmentData.fromAPIResponse(u.enrichment):null,highlights:null}))},e.fromRelatedPartsAPIResponse=function(t){var n=e.fromAPIResponse(null==t?void 0:t.part,DATA_ORIGIN.DATA_API);return n.relationType=t.type,t.created&&(n.relationCreatedAt=new Date(t.created)),"anchor_part"===t.part_role?n.partRole=SUBSTITUTE_ROLE.PREDECESSOR:"related_part"===t.part_role&&(n.partRole=SUBSTITUTE_ROLE.SUCCESSOR),n},e.getDuplicateType=function(t){switch(t){case"IMAGE_NAME_AND_DATA":return[DUPLICATE_DATA_AREA.IMAGE,DUPLICATE_DATA_AREA.NAME,DUPLICATE_DATA_AREA.DATA];case"NAME_AND_DATA":return[DUPLICATE_DATA_AREA.NAME,DUPLICATE_DATA_AREA.DATA];case"IMAGE":return[DUPLICATE_DATA_AREA.IMAGE]}},e}(core_1.APIObject);exports.Part=Part;
2
+ "use strict";var __extends=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var a in e=arguments[n])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t},__assign.apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Part=exports.DATA_ORIGIN=exports.DUPLICATE_DATA_AREA=exports.SUBSTITUTE_ROLE=exports.RELATION_TYPE=exports.PartMountingLocation=void 0;var RELATION_TYPE,SUBSTITUTE_ROLE,DUPLICATE_DATA_AREA,DATA_ORIGIN,core_1=require("../../core"),attribute_1=require("./attribute"),image_1=require("./image"),mounting_location_1=require("./mounting-location"),part_enrichment_data_1=require("./part-enrichment-data"),mounting_location_2=require("./mounting-location");Object.defineProperty(exports,"PartMountingLocation",{enumerable:!0,get:function(){return mounting_location_2.PartMountingLocation}}),function(t){t.DUPLICATE="duplicate",t.SUBSTITUTE="substitute",t.EQUIVALENT="equivalent",t.NOT_RELATED="not_related"}(RELATION_TYPE||(exports.RELATION_TYPE=RELATION_TYPE={})),function(t){t.SUCCESSOR="successor",t.PREDECESSOR="predecessor"}(SUBSTITUTE_ROLE||(exports.SUBSTITUTE_ROLE=SUBSTITUTE_ROLE={})),function(t){t.IMAGE="IMAGE",t.NAME="NAME",t.DATA="DATA"}(DUPLICATE_DATA_AREA||(exports.DUPLICATE_DATA_AREA=DUPLICATE_DATA_AREA={})),function(t){t[t.SEARCH_RESULT=0]="SEARCH_RESULT",t[t.PARTIAL=0]="PARTIAL",t[t.SERVER=2]="SERVER",t[t.DATA_API=2]="DATA_API",t[t.FIND_API=3]="FIND_API"}(DATA_ORIGIN||(exports.DATA_ORIGIN=DATA_ORIGIN={}));var Part=function(t){function e(e){var n=t.call(this)||this;return Object.assign(n,e),n}return __extends(e,t),e.prototype.updatePart=function(t){Object.assign(this,t)},e.prototype.updateName=function(t){this.name=t},e.prototype.updateDescription=function(t){this.description=t},e.fromAPIResponse=function(t,n,r){var a;if(void 0===n&&(n=DATA_ORIGIN.DATA_API),n===DATA_ORIGIN.FIND_API){var i=(u=t).mountingLocationsCount,o=u.nameLanguage||r,A=u.attributes;return new e(__assign(__assign(__assign(__assign({partiumId:u.partiumId,externalId:u.id,name:new core_1.i18nString((a={},a[o]=u.name,a)),images:u.images?u.images.map((function(t){return image_1.Image.fromAPIResponse(t,core_1.BACKEND_SERVICE.DATA)})):[],dataOrigin:DATA_ORIGIN.FIND_API},A&&{attributes:u.attributes.map((function(t){return attribute_1.Attribute.fromAPIResponse(t,n)}))}),{mountingLocationsCount:i||null,mountingLocations:null}),u.duplicateType&&{duplicateType:this.getDuplicateType(u.duplicateType)}),{highlights:u.highlights?u.highlights:null,relatedPartsSummary:u.relatedPartsSummary?u.relatedPartsSummary:null}))}var u,_=(u=t).organization,s=(A=u.attributes,u.mounting_locations);return new e(__assign(__assign(__assign({partiumId:u.uuid,externalId:u.external_id,externalPayload:u.metadata,name:new core_1.i18nString(u.name),images:u.images?u.images.filter((function(t){return"display"===t.type})).map((function(t){return image_1.Image.fromAPIResponse(t,core_1.BACKEND_SERVICE.DATA)})):[],dataOrigin:DATA_ORIGIN.DATA_API},_&&{organization:new core_1.Organization({partiumId:_.uuid,name:_.name,displayName:_.name})}),A&&{attributes:u.attributes.map((function(t){return attribute_1.Attribute.fromAPIResponse(t,n)}))}),{mountingLocationsCount:u.total_mounting_locations_count||0,mountingLocations:(null==s?void 0:s.map((function(t){return mounting_location_1.PartMountingLocation.fromAPIResponse(t)})))||[],summary:u.summary?{summaryId:u.summary.summary_id,summary:u.summary.summary.map((function(t){return{key:new core_1.i18nString(t.key),values:t.values.map((function(t){return new core_1.i18nString(t)}))}}))}:null,enrichment:u.enrichment?part_enrichment_data_1.PartEnrichmentData.fromAPIResponse(u.enrichment):null,highlights:null}))},e.fromRelatedPartsAPIResponse=function(t){var n=e.fromAPIResponse(null==t?void 0:t.part,DATA_ORIGIN.DATA_API);return n.relationType=t.type,t.created&&(n.relationCreatedAt=new Date(t.created)),"anchor_part"===t.part_role?n.partRole=SUBSTITUTE_ROLE.PREDECESSOR:"related_part"===t.part_role&&(n.partRole=SUBSTITUTE_ROLE.SUCCESSOR),n},e.getDuplicateType=function(t){switch(t){case"IMAGE_NAME_AND_DATA":return[DUPLICATE_DATA_AREA.IMAGE,DUPLICATE_DATA_AREA.NAME,DUPLICATE_DATA_AREA.DATA];case"NAME_AND_DATA":return[DUPLICATE_DATA_AREA.NAME,DUPLICATE_DATA_AREA.DATA];case"IMAGE":return[DUPLICATE_DATA_AREA.IMAGE]}},e}(core_1.APIObject);exports.Part=Part;
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- export declare const SDK_VERSION_NUMBER = "14.0.0";
2
+ export declare const SDK_VERSION_NUMBER = "14.0.1";
@@ -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.0.0";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SDK_VERSION_NUMBER=void 0,exports.SDK_VERSION_NUMBER="14.0.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@partium/js-sdk",
3
- "version": "14.0.0-alpha3",
3
+ "version": "14.0.1",
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.",