@partium/js-sdk 15.20.0 → 16.1.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/constants/constants.d.ts +2 -2
- package/core/constants/constants.js +1 -1
- package/core/index.d.ts +2 -2
- package/core/index.js +1 -1
- package/core/integration-defaults/http/https-client/axios-https-client.service.d.ts +5 -0
- package/core/integration-defaults/http/https-client/axios-https-client.service.js +1 -1
- package/core/integration-defaults/http/https-client/fetch-api-https-client.service.js +1 -1
- package/core/integration-defaults/session/js-oauth-api-key-session.service.js +1 -1
- package/core/integration-defaults/session/js-oauth-keycloak-session.service.js +1 -1
- package/core/integration-defaults/session/js-oauth-web-cookie-session.service.js +1 -1
- package/core/models/log.d.ts +3 -1
- package/core/models/log.js +1 -1
- package/core/models/user.d.ts +7 -43
- package/core/models/user.js +1 -1
- package/core/services/http/https.service.interface.d.ts +20 -20
- package/core/services/http/https.service.interface.js +1 -1
- package/core/services/http/oauth-https.service.d.ts +3 -3
- package/core/services/local-storage.service.interface.d.ts +1 -1
- package/core/services/log.service.d.ts +1 -1
- package/core/services/organization/index.d.ts +6 -0
- package/core/services/organization/index.js +2 -0
- package/core/services/organization/models/get-organization-by-id-request.d.ts +10 -0
- package/core/services/organization/models/get-organization-by-name-request.d.ts +10 -0
- package/core/services/organization/models/get-organizations-request.d.ts +33 -0
- package/core/services/organization/models/get-organizations-request.js +2 -0
- package/core/services/organization/models/organization.d.ts +77 -0
- package/core/services/organization/models/organization.js +2 -0
- package/core/services/organization/organization.service.d.ts +81 -0
- package/core/services/organization/organization.service.js +2 -0
- package/core/services/recent-parts.service.d.ts +1 -1
- package/core/services/session/session.service.interface.d.ts +17 -5
- package/core/services/session/session.service.interface.js +1 -1
- package/core/utils/general-helper.d.ts +2 -1
- package/core/utils/general-helper.js +1 -1
- package/core/utils/multipart-upload.helper.d.ts +20 -0
- package/core/utils/multipart-upload.helper.js +2 -0
- package/data/models/attribute.d.ts +5 -5
- package/data/models/attribute.js +1 -1
- package/data/models/csa-request.d.ts +2 -3
- package/data/models/csa-request.js +1 -1
- package/data/models/image.d.ts +10 -13
- package/data/models/image.js +1 -1
- package/data/models/part-data.d.ts +1 -1
- package/data/models/part.d.ts +13 -9
- package/data/models/part.js +1 -1
- package/data/services/customer-service-assistance.service.d.ts +3 -22
- package/data/services/customer-service-assistance.service.js +1 -1
- package/data/services/data.service.js +1 -1
- package/data/services/filter.service.d.ts +0 -21
- package/data/services/filter.service.js +1 -1
- package/enrichment/models/enrichment-job-part.d.ts +2 -2
- package/enrichment/models/enrichment-job-part.js +1 -1
- package/enrichment/models/enrichment-job.d.ts +2 -2
- package/enrichment/models/enrichment-job.js +1 -1
- package/find/index.d.ts +1 -28
- package/find/index.js +1 -1
- package/find/models/image-crop-area.d.ts +7 -0
- package/find/models/search-input.d.ts +11 -3
- package/find/models/search-input.js +1 -1
- package/find/services/asset.service.d.ts +41 -102
- package/find/services/asset.service.js +1 -1
- package/find/services/search/search.service.d.ts +5 -218
- package/find/services/search/search.service.js +1 -1
- package/gen/sdk-version.d.ts +1 -1
- package/gen/sdk-version.js +1 -1
- package/index.d.ts +16 -8
- package/index.js +1 -1
- package/ocr/index.d.ts +1 -2
- package/ocr/index.js +1 -1
- package/ocr/models/ocr-response.d.ts +5 -0
- package/ocr/models/ocr-response.js +2 -0
- package/ocr/services/ocr.service.d.ts +9 -15
- package/ocr/services/ocr.service.js +1 -1
- package/package.json +1 -1
- package/selection/index.d.ts +17 -0
- package/selection/index.js +2 -0
- package/selection/models/add-all-search-session-parts-to-selection-request.d.ts +4 -0
- package/selection/models/add-all-search-session-parts-to-selection-request.js +2 -0
- package/selection/models/add-all-search-session-parts-to-selection-response.d.ts +5 -0
- package/selection/models/add-all-search-session-parts-to-selection-response.js +2 -0
- package/selection/models/add-parts-from-file-to-selection-request.d.ts +10 -0
- package/selection/models/add-parts-from-file-to-selection-request.js +2 -0
- package/selection/models/add-parts-from-file-to-selection-response.d.ts +33 -0
- package/selection/models/add-parts-from-file-to-selection-response.js +2 -0
- package/selection/models/add-parts-to-selection-request.d.ts +4 -0
- package/selection/models/add-parts-to-selection-request.js +2 -0
- package/selection/models/add-parts-to-selection-response.d.ts +5 -0
- package/selection/models/add-parts-to-selection-response.js +2 -0
- package/selection/models/check-which-parts-in-selection-request.d.ts +4 -0
- package/selection/models/check-which-parts-in-selection-request.js +2 -0
- package/selection/models/check-which-parts-in-selection-response.d.ts +4 -0
- package/selection/models/check-which-parts-in-selection-response.js +2 -0
- package/selection/models/create-selection-request.d.ts +6 -0
- package/selection/models/create-selection-request.js +2 -0
- package/selection/models/create-selection-response.d.ts +10 -0
- package/selection/models/create-selection-response.js +2 -0
- package/selection/models/remove-all-search-session-parts-from-selection-request.d.ts +4 -0
- package/selection/models/remove-all-search-session-parts-from-selection-request.js +2 -0
- package/selection/models/remove-all-search-session-parts-from-selection-response.d.ts +5 -0
- package/selection/models/remove-all-search-session-parts-from-selection-response.js +2 -0
- package/selection/models/remove-parts-from-selection-request.d.ts +4 -0
- package/selection/models/remove-parts-from-selection-request.js +2 -0
- package/selection/models/remove-parts-from-selection-response.d.ts +5 -0
- package/selection/models/remove-parts-from-selection-response.js +2 -0
- package/selection/models/selection-search-summary-response.d.ts +5 -0
- package/selection/models/selection-search-summary-response.js +2 -0
- package/selection/services/selection.service.d.ts +95 -0
- package/selection/services/selection.service.js +2 -0
- package/core/models/organization.d.ts +0 -127
- package/core/models/organization.js +0 -2
- package/core/services/organization.service.d.ts +0 -48
- package/core/services/organization.service.js +0 -2
- package/data/services/csa-helper.service.d.ts +0 -32
- package/data/services/csa-helper.service.js +0 -2
- package/find/models/assets/asset.d.ts +0 -24
- package/find/models/assets/asset.js +0 -2
- package/find/models/search-filter.d.ts +0 -87
- package/find/models/search-filter.js +0 -2
- package/find/models/search-result-status.d.ts +0 -33
- package/find/models/search-result-status.js +0 -2
- package/find/models/search-session-log-object.d.ts +0 -16
- package/find/models/search-session-log-object.js +0 -2
- package/find/models/search-status/cv-search-status.d.ts +0 -20
- package/find/models/search-status/cv-search-status.js +0 -2
- package/find/models/search-status/search-filter-status.d.ts +0 -33
- package/find/models/search-status/search-filter-status.js +0 -2
- package/find/models/search-status/search-status.d.ts +0 -34
- package/find/models/search-status/search-status.js +0 -2
- package/find/models/search-status/tag-search-status.d.ts +0 -16
- package/find/models/search-status/tag-search-status.js +0 -2
- package/find/models/search-status/text-search-status.d.ts +0 -15
- package/find/models/search-status/text-search-status.js +0 -2
- package/find/models/search-tag.d.ts +0 -12
- package/find/models/search-tag.js +0 -2
- package/find/models/tagable/i18n-tagable.d.ts +0 -10
- package/find/models/tagable/i18n-tagable.js +0 -2
- package/find/models/tagable/tagable-base.d.ts +0 -11
- package/find/models/tagable/tagable-base.js +0 -2
- package/find/models/tagable/tagable.d.ts +0 -10
- package/find/models/tagable/tagable.js +0 -2
- package/find/models/text-search-config.d.ts +0 -57
- package/find/models/text-search-config.js +0 -2
- package/find/models/text-search-manipulator.d.ts +0 -46
- package/find/models/text-search-manipulator.js +0 -2
- package/find/models/text-search-result-item/text-search-error.d.ts +0 -7
- package/find/models/text-search-result-item/text-search-error.js +0 -2
- package/find/models/text-search-result-item/text-search-result-item-document.d.ts +0 -10
- package/find/models/text-search-result-item/text-search-result-item-document.js +0 -2
- package/find/models/text-search-result-item/text-search-result-item-part.d.ts +0 -12
- package/find/models/text-search-result-item/text-search-result-item-part.js +0 -2
- package/find/models/text-search-result-item/text-search-result-item-recent-query.d.ts +0 -10
- package/find/models/text-search-result-item/text-search-result-item-recent-query.js +0 -2
- package/find/models/text-search-result-item/text-search-result-item-unknown.d.ts +0 -12
- package/find/models/text-search-result-item/text-search-result-item-unknown.js +0 -2
- package/find/models/text-search-result-item/text-search-result-item.d.ts +0 -16
- package/find/models/text-search-result-item/text-search-result-item.js +0 -2
- package/find/services/filter-uploaders/filter-uploader.d.ts +0 -13
- package/find/services/filter-uploaders/update-filters-uploader.d.ts +0 -17
- package/find/services/filter-uploaders/update-filters-uploader.js +0 -2
- package/find/services/filter-uploaders/update-filters.model.d.ts +0 -19
- package/find/services/filter-uploaders/update-filters.model.js +0 -2
- package/find/services/search/cv-search.service.d.ts +0 -103
- package/find/services/search/cv-search.service.js +0 -2
- package/find/services/search/search-result.service.d.ts +0 -142
- package/find/services/search/search-result.service.js +0 -2
- package/find/services/search/tag-search.service.d.ts +0 -66
- package/find/services/search/tag-search.service.js +0 -2
- package/find/services/search/text-search.service.d.ts +0 -116
- package/find/services/search/text-search.service.js +0 -2
- package/find/services/search-filter.service.d.ts +0 -223
- package/find/services/search-filter.service.js +0 -2
- package/find/utils/search-helper.d.ts +0 -14
- package/find/utils/search-helper.js +0 -2
- package/ocr/models/detect-response.d.ts +0 -5
- package/ocr/models/detected-text-entry.d.ts +0 -5
- /package/{find/services/filter-uploaders/filter-uploader.js → core/services/organization/models/get-organization-by-id-request.js} +0 -0
- /package/{ocr/models/detect-response.js → core/services/organization/models/get-organization-by-name-request.js} +0 -0
- /package/{ocr/models/detected-text-entry.js → find/models/image-crop-area.js} +0 -0
package/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { RecentPartsService, OrganizationService } from './core';
|
|
3
|
+
import { RecentPartsService, OrganizationService, GetOrganizationsRequest, OrganizationsResponse } from './core';
|
|
4
4
|
import { PartiumConfig } from './core/models/partium-config';
|
|
5
|
-
import { Organization } from './core/models/organization';
|
|
6
5
|
import { FileService } from './core/services/file.service.interface';
|
|
7
6
|
import { FileTransferService } from './core/services/http/file-transfer/file-transfer.service.interface';
|
|
8
7
|
import { HttpsService } from './core/services/http/https.service.interface';
|
|
@@ -27,6 +26,7 @@ import { PartEnrichmentService } from './data/services/part-enrichment.service';
|
|
|
27
26
|
import { ImagesService } from './catalog/services/images.service';
|
|
28
27
|
import { ImageSubmissionService } from './datacuration';
|
|
29
28
|
import { DataEnrichmentService } from './enrichment';
|
|
29
|
+
import { SelectionService } from './selection';
|
|
30
30
|
export declare enum INITIALIZATION_STATUS {
|
|
31
31
|
NOT_INITIALIZED = 0,
|
|
32
32
|
INITIALIZING = 1,
|
|
@@ -72,6 +72,7 @@ export declare class Partium {
|
|
|
72
72
|
static get images(): ImagesService;
|
|
73
73
|
static get imageSubmission(): ImageSubmissionService;
|
|
74
74
|
static get dataEnrichment(): DataEnrichmentService;
|
|
75
|
+
static get selection(): SelectionService;
|
|
75
76
|
/**
|
|
76
77
|
* Initialize the Partium SDK with a given configuration.
|
|
77
78
|
* The configuration defines what Authentication method is used and which
|
|
@@ -103,18 +104,25 @@ export declare class Partium {
|
|
|
103
104
|
*/
|
|
104
105
|
static getInitializationStatus(): Observable<INITIALIZATION_STATUS>;
|
|
105
106
|
/**
|
|
106
|
-
* Returns
|
|
107
|
+
* Returns the first page of Organizations of the currently logged in user.
|
|
107
108
|
*
|
|
108
|
-
* @returns a promise that resolves with an array with all available organizations for a customer.
|
|
109
|
+
* @returns a promise that resolves with an array of the first page of organizations and a pagination context with all available organizations for a customer.
|
|
109
110
|
*/
|
|
110
|
-
static getOrganizations(): Promise<
|
|
111
|
+
static getOrganizations(request: GetOrganizationsRequest): Promise<OrganizationsResponse>;
|
|
111
112
|
/**
|
|
112
|
-
* Set organization with the given
|
|
113
|
+
* Set organization with the given partiumId as the current organization to be used in the session.
|
|
113
114
|
*
|
|
114
|
-
* @param
|
|
115
|
+
* @param organizationId organization-id
|
|
115
116
|
* @returns void if organization is found, otherwise throws an error
|
|
116
117
|
*/
|
|
117
|
-
static
|
|
118
|
+
static useOrganizationById(organizationId: string): Promise<void>;
|
|
119
|
+
/**
|
|
120
|
+
* Set organization with the given name as the current organization to be used in the session.
|
|
121
|
+
*
|
|
122
|
+
* @param organizationName organization-name
|
|
123
|
+
* @returns void if organization is found, otherwise throws an error
|
|
124
|
+
*/
|
|
125
|
+
static useOrganizationByName(organizationName: string): Promise<void>;
|
|
118
126
|
/**
|
|
119
127
|
* Get a service from the service-singleton provider
|
|
120
128
|
*
|
package/index.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.Partium=exports.INITIALIZATION_STATUS=void 0;var INITIALIZATION_STATUS,rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),core_1=require("./core"),auth_config_1=require("./core/models/auth-config"),partium_config_1=require("./core/models/partium-config"),backend_status_service_1=require("./core/services/backend-status.service"),device_status_service_interface_1=require("./core/services/device-status.service.interface"),file_service_interface_1=require("./core/services/file.service.interface"),file_transfer_service_interface_1=require("./core/services/http/file-transfer/file-transfer.service.interface"),https_client_service_interface_1=require("./core/services/http/https-client/https-client.service.interface"),https_service_interface_1=require("./core/services/http/https.service.interface"),local_storage_service_interface_1=require("./core/services/local-storage.service.interface"),log_service_1=require("./core/services/log.service"),service_provider_1=require("./core/services/service-provider"),session_service_interface_1=require("./core/services/session/session.service.interface"),data_1=require("./data"),filter_service_1=require("./data/services/filter.service"),part_attribute_service_1=require("./data/services/part-attribute.service"),part_service_1=require("./data/services/part.service"),request_list_service_1=require("./user-data/services/request-list/request-list.service"),favorite_service_1=require("./user-data/services/favorite/favorite.service"),asset_service_1=require("./find/services/asset.service"),search_service_1=require("./find/services/search/search.service"),sdk_version_1=require("./gen/sdk-version"),recent_text_search_queries_service_1=require("./find/services/search/recent-text-search-queries.service"),ocr_1=require("./ocr"),shopping_cart_service_1=require("./data/services/shopping-cart.service"),inquiry_service_1=require("./data/services/inquiry.service"),announcement_service_1=require("./data/services/announcement.service"),related_parts_service_1=require("./data/services/related-parts.service"),constants_1=require("./core/constants/constants"),management_1=require("./management"),part_enrichment_service_1=require("./data/services/part-enrichment.service"),images_service_1=require("./catalog/services/images.service"),datacuration_1=require("./datacuration"),enrichment_1=require("./enrichment");!function(e){e[e.NOT_INITIALIZED=0]="NOT_INITIALIZED",e[e.INITIALIZING=1]="INITIALIZING",e[e.INITIALIZED=2]="INITIALIZED",e[e.INITIALIZATION_ERROR=3]="INITIALIZATION_ERROR"}(INITIALIZATION_STATUS||(exports.INITIALIZATION_STATUS=INITIALIZATION_STATUS={}));var Partium=function(){function e(){}return Object.defineProperty(e,"search",{get:function(){return e.getService(search_service_1.SearchServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"asset",{get:function(){return e.getService(asset_service_1.AssetServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"https",{get:function(){return e.getService(https_service_interface_1.HttpsService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"fileTransfer",{get:function(){return e.getService(file_transfer_service_interface_1.FileTransferService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"session",{get:function(){return e.getService(session_service_interface_1.SessionService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"assemblyHierarchyNode",{get:function(){return e.getService(data_1.AssemblyHierarchyNodesServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"part",{get:function(){return e.getService(part_service_1.PartServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"partEnrichment",{get:function(){return e.getService(part_enrichment_service_1.PartEnrichmentServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"relatedParts",{get:function(){return e.getService(related_parts_service_1.RelatedPartsServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"requestList",{get:function(){return e.getService(request_list_service_1.RequestListServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"shoppingCart",{get:function(){return e.getService(shopping_cart_service_1.ShoppingCartServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"partAttribute",{get:function(){return e.getService(part_attribute_service_1.PartAttributeServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"data",{get:function(){return e.getService(data_1.DataServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"inquiry",{get:function(){return e.getService(inquiry_service_1.InquiryServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"announcement",{get:function(){return e.getService(announcement_service_1.AnnouncementServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"customerServiceAssistance",{get:function(){return e.getService(data_1.CustomerServiceAssistanceServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"log",{get:function(){return e.getService(log_service_1.LogServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"file",{get:function(){return e.getService(file_service_interface_1.FileService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"recentParts",{get:function(){return e.getService(core_1.RecentPartsServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"favorites",{get:function(){return e.getService(favorite_service_1.FavoriteServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"filters",{get:function(){return e.getService(filter_service_1.FilterServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"organization",{get:function(){return e.getService(core_1.OrganizationService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ocr",{get:function(){return e.getService(ocr_1.OcrServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"apiKey",{get:function(){return e.getService(management_1.ApiKeyServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"localStorage",{get:function(){return e.getService(local_storage_service_interface_1.LocalStorageService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"images",{get:function(){return e.getService(images_service_1.ImagesServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"imageSubmission",{get:function(){return e.getService(datacuration_1.ImageSubmissionServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"dataEnrichment",{get:function(){return e.getService(enrichment_1.DataEnrichmentServiceImpl)},enumerable:!1,configurable:!0}),e.init=function(r){console.log("Initializing Partium...",r),e._initializationStatus$.next(INITIALIZATION_STATUS.INITIALIZING),e._serviceProvider||(e._serviceProvider=new service_provider_1.ServiceProvider);var i=[r.partiumApiBaseUrl,r.partiumLoginUrl].filter((function(e){return!!e}));switch(e._serviceProvider.useService(r.httpsClientService,https_client_service_interface_1.HttpsClientService,i),e._serviceProvider.useService(r.fileTransferService,file_transfer_service_interface_1.FileTransferService,i),e._serviceProvider.useService(r.localStorageService,local_storage_service_interface_1.LocalStorageService),e._serviceProvider.useService(r.deviceStatusService,device_status_service_interface_1.DeviceStatusService),e._serviceProvider.useService(r.fileService,file_service_interface_1.FileService),r.authenticationMethod){case partium_config_1.AUTHENTICATION_METHOD.OAUTH_API_KEY:case partium_config_1.AUTHENTICATION_METHOD.OAUTH:e._serviceProvider.useService(r.authenticationConfig.oauthHttpsService,https_service_interface_1.HttpsService),e._serviceProvider.useService(r.authenticationConfig.oauthSessionService,session_service_interface_1.SessionService)}e._serviceProvider.serviceSelectionFinished();var t=e.getService(session_service_interface_1.SessionService),c=e.getService(local_storage_service_interface_1.LocalStorageService);t.registerLoginInitService(c,1);var n=e.getService(asset_service_1.AssetServiceImpl);t.registerLoginInitService(n,2);var a=e.getService(core_1.RecentPartsServiceImpl);t.registerLoginInitService(a,2);var s=e.getService(recent_text_search_queries_service_1.RecentTextSearchQueriesServiceImpl);t.registerLoginInitService(s,2);var _=e.getService(favorite_service_1.FavoriteServiceImpl);t.registerLoginInitService(_,2);var o=e.getService(data_1.CustomerServiceAssistanceServiceImpl);t.registerLoginInitService(o,2);var u=e.getService(search_service_1.SearchServiceImpl);t.registerLoginInitService(u,2);var v=e.getService(log_service_1.LogServiceImpl);t.registerLoginInitService(v,2);var l=e.getService(https_service_interface_1.HttpsService),I=e.getService(backend_status_service_1.BackendStatusService);return I.init(sdk_version_1.SDK_VERSION_NUMBER,"en",e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_STATUS_API_URL]),constants_1.BACKEND_STATUS_FALLBACK_URL),I.checkCompatibility().pipe((0,operators_1.mergeMap)((function(){return I.checkAvailability()})),(0,operators_1.mergeMap)((function(){return t.init(r)})),(0,operators_1.mergeMap)((function(){return l.init({partiumApiBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION)]),findBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_FIND_API_URL]),dataBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_DATA_API_URL]),csaBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_CSA_API_URL]),logBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_LOGS_API_URL]),userDataBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_USER_DATA_API_URL]),ocrBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_OCR_API_URL]),managementBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_MANAGEMENT_API_URL]),catalogBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_CATALOG_API_URL]),datacurationBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_DATACURATION_API_URL]),dataV2BeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_DATA_V2_API_URL]),dataEnrichmentBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_DATA_ENRICHMENT_API_URL])},r.authenticationConfig)})),(0,operators_1.tap)((function(){l.setCurrentOrganization(t.getCurrentOrganization$())})),(0,operators_1.tap)((function(){e._initializationStatus$.next(INITIALIZATION_STATUS.INITIALIZED)})),(0,operators_1.catchError)((function(r){return e._initializationStatus$.next(INITIALIZATION_STATUS.INITIALIZATION_ERROR),e.reset(),(0,rxjs_1.throwError)((function(){return r}))})))},e.initApiKey=function(r){return e.init(new partium_config_1.PartiumConfig({authenticationConfig:new auth_config_1.OauthApiKeyAuthenticationConfig({apiKey:r})}))},e.reset=function(){e._serviceProvider=null,e._initializationStatus$.next(INITIALIZATION_STATUS.NOT_INITIALIZED)},e.getInitializationStatus=function(){return e._initializationStatus$.asObservable()},e.getOrganizations=function(){return e.ensureInitialized(),e.getService(core_1.OrganizationService).getOrganizations()},e.useOrganization=function(r){return e.ensureInitialized(),e.session.useOrganization(r)},e.getService=function(r){return e._serviceProvider||(e._serviceProvider=new service_provider_1.ServiceProvider),e._serviceProvider.getService(r)},e.isInitialized=function(){return e._initializationStatus$.value===INITIALIZATION_STATUS.INITIALIZED},e.ensureInitialized=function(){if(!e.isInitialized())throw"Partium-JS-SDK not initialized. Make sure to initialize the Partium-JS-SDK before you try to use it's features!"},e.buildUrl=function(e){for(var r=[],i=0,t=e;i<t.length;i++){var c=t[i];r.push(c.replace(/^\/+/,"").replace(/\/+$/,""))}return r.join("/")},e._serviceProvider=null,e._initializationStatus$=new rxjs_1.BehaviorSubject(INITIALIZATION_STATUS.NOT_INITIALIZED),e}();exports.Partium=Partium;
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Partium=exports.INITIALIZATION_STATUS=void 0;var INITIALIZATION_STATUS,rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),core_1=require("./core"),auth_config_1=require("./core/models/auth-config"),partium_config_1=require("./core/models/partium-config"),backend_status_service_1=require("./core/services/backend-status.service"),device_status_service_interface_1=require("./core/services/device-status.service.interface"),file_service_interface_1=require("./core/services/file.service.interface"),file_transfer_service_interface_1=require("./core/services/http/file-transfer/file-transfer.service.interface"),https_client_service_interface_1=require("./core/services/http/https-client/https-client.service.interface"),https_service_interface_1=require("./core/services/http/https.service.interface"),local_storage_service_interface_1=require("./core/services/local-storage.service.interface"),log_service_1=require("./core/services/log.service"),service_provider_1=require("./core/services/service-provider"),session_service_interface_1=require("./core/services/session/session.service.interface"),data_1=require("./data"),filter_service_1=require("./data/services/filter.service"),part_attribute_service_1=require("./data/services/part-attribute.service"),part_service_1=require("./data/services/part.service"),request_list_service_1=require("./user-data/services/request-list/request-list.service"),favorite_service_1=require("./user-data/services/favorite/favorite.service"),asset_service_1=require("./find/services/asset.service"),search_service_1=require("./find/services/search/search.service"),sdk_version_1=require("./gen/sdk-version"),recent_text_search_queries_service_1=require("./find/services/search/recent-text-search-queries.service"),ocr_1=require("./ocr"),shopping_cart_service_1=require("./data/services/shopping-cart.service"),inquiry_service_1=require("./data/services/inquiry.service"),announcement_service_1=require("./data/services/announcement.service"),related_parts_service_1=require("./data/services/related-parts.service"),constants_1=require("./core/constants/constants"),management_1=require("./management"),part_enrichment_service_1=require("./data/services/part-enrichment.service"),images_service_1=require("./catalog/services/images.service"),datacuration_1=require("./datacuration"),enrichment_1=require("./enrichment"),selection_1=require("./selection");!function(e){e[e.NOT_INITIALIZED=0]="NOT_INITIALIZED",e[e.INITIALIZING=1]="INITIALIZING",e[e.INITIALIZED=2]="INITIALIZED",e[e.INITIALIZATION_ERROR=3]="INITIALIZATION_ERROR"}(INITIALIZATION_STATUS||(exports.INITIALIZATION_STATUS=INITIALIZATION_STATUS={}));var Partium=function(){function e(){}return Object.defineProperty(e,"search",{get:function(){return e.getService(search_service_1.SearchServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"asset",{get:function(){return e.getService(asset_service_1.AssetServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"https",{get:function(){return e.getService(https_service_interface_1.HttpsService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"fileTransfer",{get:function(){return e.getService(file_transfer_service_interface_1.FileTransferService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"session",{get:function(){return e.getService(session_service_interface_1.SessionService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"assemblyHierarchyNode",{get:function(){return e.getService(data_1.AssemblyHierarchyNodesServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"part",{get:function(){return e.getService(part_service_1.PartServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"partEnrichment",{get:function(){return e.getService(part_enrichment_service_1.PartEnrichmentServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"relatedParts",{get:function(){return e.getService(related_parts_service_1.RelatedPartsServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"requestList",{get:function(){return e.getService(request_list_service_1.RequestListServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"shoppingCart",{get:function(){return e.getService(shopping_cart_service_1.ShoppingCartServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"partAttribute",{get:function(){return e.getService(part_attribute_service_1.PartAttributeServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"data",{get:function(){return e.getService(data_1.DataServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"inquiry",{get:function(){return e.getService(inquiry_service_1.InquiryServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"announcement",{get:function(){return e.getService(announcement_service_1.AnnouncementServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"customerServiceAssistance",{get:function(){return e.getService(data_1.CustomerServiceAssistanceServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"log",{get:function(){return e.getService(log_service_1.LogServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"file",{get:function(){return e.getService(file_service_interface_1.FileService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"recentParts",{get:function(){return e.getService(core_1.RecentPartsServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"favorites",{get:function(){return e.getService(favorite_service_1.FavoriteServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"filters",{get:function(){return e.getService(filter_service_1.FilterServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"organization",{get:function(){return e.getService(core_1.OrganizationServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ocr",{get:function(){return e.getService(ocr_1.OcrServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"apiKey",{get:function(){return e.getService(management_1.ApiKeyServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"localStorage",{get:function(){return e.getService(local_storage_service_interface_1.LocalStorageService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"images",{get:function(){return e.getService(images_service_1.ImagesServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"imageSubmission",{get:function(){return e.getService(datacuration_1.ImageSubmissionServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"dataEnrichment",{get:function(){return e.getService(enrichment_1.DataEnrichmentServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"selection",{get:function(){return e.getService(selection_1.SelectionServiceImpl)},enumerable:!1,configurable:!0}),e.init=function(r){console.log("Initializing Partium...",r),e._initializationStatus$.next(INITIALIZATION_STATUS.INITIALIZING),e._serviceProvider||(e._serviceProvider=new service_provider_1.ServiceProvider);var i=[r.partiumApiBaseUrl,r.partiumLoginUrl].filter((function(e){return!!e}));switch(e._serviceProvider.useService(r.httpsClientService,https_client_service_interface_1.HttpsClientService,i),e._serviceProvider.useService(r.fileTransferService,file_transfer_service_interface_1.FileTransferService,i),e._serviceProvider.useService(r.localStorageService,local_storage_service_interface_1.LocalStorageService),e._serviceProvider.useService(r.deviceStatusService,device_status_service_interface_1.DeviceStatusService),e._serviceProvider.useService(r.fileService,file_service_interface_1.FileService),r.authenticationMethod){case partium_config_1.AUTHENTICATION_METHOD.OAUTH_API_KEY:case partium_config_1.AUTHENTICATION_METHOD.OAUTH:e._serviceProvider.useService(r.authenticationConfig.oauthHttpsService,https_service_interface_1.HttpsService),e._serviceProvider.useService(r.authenticationConfig.oauthSessionService,session_service_interface_1.SessionService)}e._serviceProvider.serviceSelectionFinished();var t=e.getService(session_service_interface_1.SessionService),n=e.getService(local_storage_service_interface_1.LocalStorageService);t.registerLoginInitService(n,1);var c=e.getService(asset_service_1.AssetServiceImpl);t.registerLoginInitService(c,2);var a=e.getService(core_1.RecentPartsServiceImpl);t.registerLoginInitService(a,2);var s=e.getService(recent_text_search_queries_service_1.RecentTextSearchQueriesServiceImpl);t.registerLoginInitService(s,2);var o=e.getService(favorite_service_1.FavoriteServiceImpl);t.registerLoginInitService(o,2);var _=e.getService(data_1.CustomerServiceAssistanceServiceImpl);t.registerLoginInitService(_,2);var u=e.getService(search_service_1.SearchServiceImpl);t.registerLoginInitService(u,2);var v=e.getService(log_service_1.LogServiceImpl);t.registerLoginInitService(v,2);var l=e.getService(https_service_interface_1.HttpsService),I=e.getService(backend_status_service_1.BackendStatusService);return I.init(sdk_version_1.SDK_VERSION_NUMBER,"en",e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_STATUS_API_URL]),constants_1.BACKEND_STATUS_FALLBACK_URL),I.checkCompatibility().pipe((0,operators_1.mergeMap)((function(){return I.checkAvailability()})),(0,operators_1.mergeMap)((function(){return t.init(r)})),(0,operators_1.mergeMap)((function(){return l.init({partiumApiBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION)]),dataBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_DATA_API_URL]),csaBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_CSA_API_URL]),logBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_LOGS_API_URL]),userDataBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_USER_DATA_API_URL]),managementBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_MANAGEMENT_API_URL]),catalogBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_CATALOG_API_URL]),datacurationBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_DATACURATION_API_URL]),dataV2BeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_DATA_V2_API_URL]),dataEnrichmentBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_DATA_ENRICHMENT_API_URL]),backofficeBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_BACKOFFICE_API_URL]),selectionBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_SELECTION_API_URL])},r.authenticationConfig)})),(0,operators_1.tap)((function(){l.setCurrentOrganization(t.getCurrentOrganization$())})),(0,operators_1.tap)((function(){e._initializationStatus$.next(INITIALIZATION_STATUS.INITIALIZED)})),(0,operators_1.catchError)((function(r){return e._initializationStatus$.next(INITIALIZATION_STATUS.INITIALIZATION_ERROR),e.reset(),(0,rxjs_1.throwError)((function(){return r}))})))},e.initApiKey=function(r){return e.init(new partium_config_1.PartiumConfig({authenticationConfig:new auth_config_1.OauthApiKeyAuthenticationConfig({apiKey:r})}))},e.reset=function(){e._serviceProvider=null,e._initializationStatus$.next(INITIALIZATION_STATUS.NOT_INITIALIZED)},e.getInitializationStatus=function(){return e._initializationStatus$.asObservable()},e.getOrganizations=function(r){return e.ensureInitialized(),(0,rxjs_1.firstValueFrom)(e.getService(core_1.OrganizationServiceImpl).loadOrganizations(r))},e.useOrganizationById=function(r){return e.ensureInitialized(),e.session.useOrganizationById(r)},e.useOrganizationByName=function(r){return e.ensureInitialized(),e.session.useOrganizationByName(r)},e.getService=function(r){return e._serviceProvider||(e._serviceProvider=new service_provider_1.ServiceProvider),e._serviceProvider.getService(r)},e.isInitialized=function(){return e._initializationStatus$.value===INITIALIZATION_STATUS.INITIALIZED},e.ensureInitialized=function(){if(!e.isInitialized())throw"Partium-JS-SDK not initialized. Make sure to initialize the Partium-JS-SDK before you try to use it's features!"},e.buildUrl=function(e){for(var r=[],i=0,t=e;i<t.length;i++){var n=t[i];r.push(n.replace(/^\/+/,"").replace(/\/+$/,""))}return r.join("/")},e._serviceProvider=null,e._initializationStatus$=new rxjs_1.BehaviorSubject(INITIALIZATION_STATUS.NOT_INITIALIZED),e}();exports.Partium=Partium;
|
package/ocr/index.d.ts
CHANGED
package/ocr/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,t,
|
|
2
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,t,i){void 0===i&&(i=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,i,o)}:function(e,r,t,i){void 0===i&&(i=t),e[i]=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/ocr-response"),exports),__exportStar(require("./services/ocr.service"),exports);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { BaseService } from '../../core/services/base.service';
|
|
4
4
|
import { ServiceProvider } from '../../core/services/service-provider';
|
|
5
|
+
import { OcrResponse } from '../models/ocr-response';
|
|
5
6
|
import { EventContext, PFile } from '../../core';
|
|
6
7
|
export interface OCREventContext extends EventContext {
|
|
7
8
|
searchSessionId?: string;
|
|
@@ -11,26 +12,19 @@ export interface OCREventContext extends EventContext {
|
|
|
11
12
|
*/
|
|
12
13
|
export interface OcrService {
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
+
* Detect text in an image.
|
|
15
16
|
*
|
|
16
|
-
* @param
|
|
17
|
-
* @
|
|
17
|
+
* @param organizationName Name of the organization to use the OCR in.
|
|
18
|
+
* @param image PFile of the image to use (ideally cropped to the area of interest)
|
|
19
|
+
* @param eventContext (optional) OCREventContext object to add the missing data that will be logged using the log format V2.
|
|
20
|
+
* Pass a searchSessionId to associate the OCR-detection with an existing search-session.
|
|
21
|
+
* @returns The detected texts and the imageId of the image-asset that is generated during OCR-detection.
|
|
18
22
|
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Upload an image and detect text in it.
|
|
22
|
-
*
|
|
23
|
-
* @param organizationId Id of the organization to use the OCR in.
|
|
24
|
-
* @param file PFile of the image to use (ideally cropped to the area of interest)
|
|
25
|
-
* @returns The detected texts.
|
|
26
|
-
*/
|
|
27
|
-
detectFromFile(organizationId: string, file: PFile): Observable<string[]>;
|
|
23
|
+
detectFromFile(organizationName: string, image: PFile, eventContext?: OCREventContext): Observable<OcrResponse>;
|
|
28
24
|
}
|
|
29
25
|
export declare class OcrServiceImpl extends BaseService implements OcrService {
|
|
30
26
|
private httpsService;
|
|
31
|
-
private assetService;
|
|
32
27
|
constructor(serviceProvider: ServiceProvider);
|
|
33
28
|
onCreate(): void;
|
|
34
|
-
|
|
35
|
-
detectFromFile(organizationId: string, file: PFile, eventContext?: OCREventContext): Observable<string[]>;
|
|
29
|
+
detectFromFile(organizationName: string, image: PFile, eventContext?: OCREventContext): Observable<OcrResponse>;
|
|
36
30
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2026 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 i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),__decorate=this&&this.__decorate||function(e,t,r,i){var o,n=arguments.length,c=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,r,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(c=(n<3?o(c):n>3?o(t,r,c):o(t,r))||c);return n>3&&c&&Object.defineProperty(t,r,c),c};Object.defineProperty(exports,"__esModule",{value:!0}),exports.OcrServiceImpl=void 0;var
|
|
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 i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),__decorate=this&&this.__decorate||function(e,t,r,i){var o,n=arguments.length,c=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,r,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(c=(n<3?o(c):n>3?o(t,r,c):o(t,r))||c);return n>3&&c&&Object.defineProperty(t,r,c),c};Object.defineProperty(exports,"__esModule",{value:!0}),exports.OcrServiceImpl=void 0;var injection_identifier_1=require("../../core/decorators/injection-identifier"),base_service_1=require("../../core/services/base.service"),https_service_interface_1=require("../../core/services/http/https.service.interface"),multipart_upload_helper_1=require("../../core/utils/multipart-upload.helper"),OcrServiceImpl=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.onCreate=function(){this.httpsService=this.serviceProvider.getService(https_service_interface_1.HttpsService)},t.prototype.detectFromFile=function(e,t,r){var i=this;return(0,multipart_upload_helper_1.guardMultipartUpload)(t,(function(){return(0,multipart_upload_helper_1.postPFileImageMultipartRequest)(i.httpsService,{url:"/find/ocr/detect",image:t,input:{organization:e,searchSessionId:null==r?void 0:r.searchSessionId},eventInterface:null==r?void 0:r.eventInterface})}))},t=__decorate([(0,injection_identifier_1.InjectionIdentifier)("OcrService")],t)}(base_service_1.BaseService);exports.OcrServiceImpl=OcrServiceImpl;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@partium/js-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.1.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.",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
+
export * from './services/selection.service';
|
|
3
|
+
export * from './models/add-parts-from-file-to-selection-request';
|
|
4
|
+
export * from './models/add-parts-from-file-to-selection-response';
|
|
5
|
+
export * from './models/create-selection-request';
|
|
6
|
+
export * from './models/create-selection-response';
|
|
7
|
+
export * from './models/add-parts-to-selection-request';
|
|
8
|
+
export * from './models/add-parts-to-selection-response';
|
|
9
|
+
export * from './models/remove-parts-from-selection-request';
|
|
10
|
+
export * from './models/remove-parts-from-selection-response';
|
|
11
|
+
export * from './models/add-all-search-session-parts-to-selection-request';
|
|
12
|
+
export * from './models/add-all-search-session-parts-to-selection-response';
|
|
13
|
+
export * from './models/remove-all-search-session-parts-from-selection-request';
|
|
14
|
+
export * from './models/remove-all-search-session-parts-from-selection-response';
|
|
15
|
+
export * from './models/check-which-parts-in-selection-request';
|
|
16
|
+
export * from './models/check-which-parts-in-selection-response';
|
|
17
|
+
export * from './models/selection-search-summary-response';
|
|
@@ -0,0 +1,2 @@
|
|
|
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("./services/selection.service"),exports),__exportStar(require("./models/add-parts-from-file-to-selection-request"),exports),__exportStar(require("./models/add-parts-from-file-to-selection-response"),exports),__exportStar(require("./models/create-selection-request"),exports),__exportStar(require("./models/create-selection-response"),exports),__exportStar(require("./models/add-parts-to-selection-request"),exports),__exportStar(require("./models/add-parts-to-selection-response"),exports),__exportStar(require("./models/remove-parts-from-selection-request"),exports),__exportStar(require("./models/remove-parts-from-selection-response"),exports),__exportStar(require("./models/add-all-search-session-parts-to-selection-request"),exports),__exportStar(require("./models/add-all-search-session-parts-to-selection-response"),exports),__exportStar(require("./models/remove-all-search-session-parts-from-selection-request"),exports),__exportStar(require("./models/remove-all-search-session-parts-from-selection-response"),exports),__exportStar(require("./models/check-which-parts-in-selection-request"),exports),__exportStar(require("./models/check-which-parts-in-selection-response"),exports),__exportStar(require("./models/selection-search-summary-response"),exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
+
/**
|
|
3
|
+
* Request for adding parts to a selection from a file (eg CSV. file).
|
|
4
|
+
*/
|
|
5
|
+
export interface AddPartsFromFileToSelectionRequest {
|
|
6
|
+
/**
|
|
7
|
+
* The file containing the part-ids to add to the selection.
|
|
8
|
+
*/
|
|
9
|
+
file: File;
|
|
10
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
+
export declare enum AddPartsFromFileErrorType {
|
|
3
|
+
INVALID_PART_IDS = "invalid-part-ids",
|
|
4
|
+
PART_LIMIT_EXCEEDED = "part-limit-exceeded"
|
|
5
|
+
}
|
|
6
|
+
export interface InvalidPartIdsErrorDetails {
|
|
7
|
+
/**
|
|
8
|
+
* The part-ids that were invalid
|
|
9
|
+
*/
|
|
10
|
+
partIds: string[];
|
|
11
|
+
}
|
|
12
|
+
export interface PartLimitExceededErrorDetails {
|
|
13
|
+
/**
|
|
14
|
+
* The limit that was exceeded
|
|
15
|
+
*/
|
|
16
|
+
limit: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Response for adding parts to a selection from a file (eg CSV. file).
|
|
20
|
+
*/
|
|
21
|
+
export interface AddPartsFromFileToSelectionResponse {
|
|
22
|
+
/**
|
|
23
|
+
* The amount of part-ids that were added to the selection
|
|
24
|
+
*/
|
|
25
|
+
addedPartsCount: number;
|
|
26
|
+
/**
|
|
27
|
+
* The errors that occurred while adding the parts to the selection
|
|
28
|
+
*/
|
|
29
|
+
errors?: {
|
|
30
|
+
[AddPartsFromFileErrorType.INVALID_PART_IDS]?: InvalidPartIdsErrorDetails;
|
|
31
|
+
[AddPartsFromFileErrorType.PART_LIMIT_EXCEEDED]?: PartLimitExceededErrorDetails;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
+
"use strict";var AddPartsFromFileErrorType;Object.defineProperty(exports,"__esModule",{value:!0}),exports.AddPartsFromFileErrorType=void 0,function(r){r.INVALID_PART_IDS="invalid-part-ids",r.PART_LIMIT_EXCEEDED="part-limit-exceeded"}(AddPartsFromFileErrorType||(exports.AddPartsFromFileErrorType=AddPartsFromFileErrorType={}));
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { BaseService } from '../../core';
|
|
4
|
+
import { SelectionSearchSummaryResponse } from '../models/selection-search-summary-response';
|
|
5
|
+
import { AddPartsToSelectionRequest } from '../models/add-parts-to-selection-request';
|
|
6
|
+
import { AddPartsToSelectionResponse } from '../models/add-parts-to-selection-response';
|
|
7
|
+
import { RemovePartsFromSelectionRequest } from '../models/remove-parts-from-selection-request';
|
|
8
|
+
import { RemovePartsFromSelectionResponse } from '../models/remove-parts-from-selection-response';
|
|
9
|
+
import { AddAllSearchSessionPartsToSelectionRequest } from '../models/add-all-search-session-parts-to-selection-request';
|
|
10
|
+
import { AddAllSearchSessionPartsToSelectionResponse } from '../models/add-all-search-session-parts-to-selection-response';
|
|
11
|
+
import { RemoveAllSearchSessionPartsFromSelectionRequest } from '../models/remove-all-search-session-parts-from-selection-request';
|
|
12
|
+
import { RemoveAllSearchSessionPartsFromSelectionResponse } from '../models/remove-all-search-session-parts-from-selection-response';
|
|
13
|
+
import { CreateSelectionRequest } from '../models/create-selection-request';
|
|
14
|
+
import { CreateSelectionResponse } from '../models/create-selection-response';
|
|
15
|
+
import { AddPartsFromFileToSelectionRequest } from '../models/add-parts-from-file-to-selection-request';
|
|
16
|
+
import { AddPartsFromFileToSelectionResponse } from '../models/add-parts-from-file-to-selection-response';
|
|
17
|
+
import { CheckWhichPartsInSelectionRequest } from '../models/check-which-parts-in-selection-request';
|
|
18
|
+
import { CheckWhichPartsInSelectionResponse } from '../models/check-which-parts-in-selection-response';
|
|
19
|
+
/**
|
|
20
|
+
* Service for managing selections (internally modeled as part lists).
|
|
21
|
+
*/
|
|
22
|
+
export interface SelectionService {
|
|
23
|
+
/**
|
|
24
|
+
* Create a new selection.
|
|
25
|
+
*
|
|
26
|
+
* @returns An Observable that emits the response
|
|
27
|
+
*/
|
|
28
|
+
createSelection(request: CreateSelectionRequest): Observable<CreateSelectionResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Add parts to the Given selection.
|
|
31
|
+
*
|
|
32
|
+
* @param partListId - The selection id.
|
|
33
|
+
* @param request - The request containing the selection id and the part ids to add.
|
|
34
|
+
* @returns An Observable that emits the response
|
|
35
|
+
*/
|
|
36
|
+
addPartsToSelection(partListId: string, request: AddPartsToSelectionRequest): Observable<AddPartsToSelectionResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* Remove parts from the Given selection.
|
|
39
|
+
*
|
|
40
|
+
* @param partListId - The selection id.
|
|
41
|
+
* @param request - The request containing the selection id and the part ids to remove.
|
|
42
|
+
* @returns An Observable that emits the response
|
|
43
|
+
*/
|
|
44
|
+
removePartsFromSelection(partListId: string, request: RemovePartsFromSelectionRequest): Observable<RemovePartsFromSelectionResponse>;
|
|
45
|
+
/**
|
|
46
|
+
* Add all parts from the connected search session to the Given selection.
|
|
47
|
+
*
|
|
48
|
+
* @param partListId - The selection id.
|
|
49
|
+
* @param request - The request containing the search session id to add the parts to.
|
|
50
|
+
* @returns An Observable that emits the response
|
|
51
|
+
*/
|
|
52
|
+
addAllSearchSessionPartsToSelection(partListId: string, request: AddAllSearchSessionPartsToSelectionRequest): Observable<AddAllSearchSessionPartsToSelectionResponse>;
|
|
53
|
+
/**
|
|
54
|
+
* Remove all parts from the connected search session from the Given selection.
|
|
55
|
+
*
|
|
56
|
+
* @param partListId - The selection id.
|
|
57
|
+
* @param request - The request containing the search session id to remove the parts from.
|
|
58
|
+
* @returns An Observable that emits the response
|
|
59
|
+
*/
|
|
60
|
+
removeAllSearchSessionPartsFromSelection(partListId: string, request: RemoveAllSearchSessionPartsFromSelectionRequest): Observable<RemoveAllSearchSessionPartsFromSelectionResponse>;
|
|
61
|
+
/**
|
|
62
|
+
* Get the add and remove parts count for the Given selection.
|
|
63
|
+
*
|
|
64
|
+
* @param partListId - The selection id.
|
|
65
|
+
* @returns An Observable that emits the add and remove parts count.
|
|
66
|
+
*/
|
|
67
|
+
getSearchSummary(partListId: string): Observable<SelectionSearchSummaryResponse>;
|
|
68
|
+
/**
|
|
69
|
+
* Given part ids (e.g. from search), returns which of them are already in the selection.
|
|
70
|
+
*
|
|
71
|
+
* @param partListId - The selection id.
|
|
72
|
+
* @param request - Part ids to check.
|
|
73
|
+
*/
|
|
74
|
+
checkWhichPartsInSelection(partListId: string, request: CheckWhichPartsInSelectionRequest): Observable<CheckWhichPartsInSelectionResponse>;
|
|
75
|
+
/**
|
|
76
|
+
* Add parts to the Given selection from a file.
|
|
77
|
+
*
|
|
78
|
+
* @param partListId - The selection id.
|
|
79
|
+
* @param request - The request containing the file containing the part ids to add.
|
|
80
|
+
* @returns An Observable that emits the response
|
|
81
|
+
*/
|
|
82
|
+
addPartsFromFileToSelection(partListId: string, request: AddPartsFromFileToSelectionRequest): Observable<AddPartsFromFileToSelectionResponse>;
|
|
83
|
+
}
|
|
84
|
+
export declare class SelectionServiceImpl extends BaseService implements SelectionService {
|
|
85
|
+
private httpsService;
|
|
86
|
+
onCreate(): void;
|
|
87
|
+
createSelection(request: CreateSelectionRequest): Observable<CreateSelectionResponse>;
|
|
88
|
+
addPartsToSelection(partListId: string, request: AddPartsToSelectionRequest): Observable<AddPartsToSelectionResponse>;
|
|
89
|
+
removePartsFromSelection(partListId: string, request: RemovePartsFromSelectionRequest): Observable<RemovePartsFromSelectionResponse>;
|
|
90
|
+
addAllSearchSessionPartsToSelection(partListId: string, request: AddAllSearchSessionPartsToSelectionRequest): Observable<AddAllSearchSessionPartsToSelectionResponse>;
|
|
91
|
+
removeAllSearchSessionPartsFromSelection(partListId: string, request: RemoveAllSearchSessionPartsFromSelectionRequest): Observable<RemoveAllSearchSessionPartsFromSelectionResponse>;
|
|
92
|
+
getSearchSummary(partListId: string): Observable<SelectionSearchSummaryResponse>;
|
|
93
|
+
checkWhichPartsInSelection(partListId: string, request: CheckWhichPartsInSelectionRequest): Observable<CheckWhichPartsInSelectionResponse>;
|
|
94
|
+
addPartsFromFileToSelection(partListId: string, request: AddPartsFromFileToSelectionRequest): Observable<AddPartsFromFileToSelectionResponse>;
|
|
95
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// Copyright © 2022-2026 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 o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),__decorate=this&&this.__decorate||function(e,t,r,o){var c,n=arguments.length,i=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(c=e[s])&&(i=(n<3?c(i):n>3?c(t,r,i):c(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};Object.defineProperty(exports,"__esModule",{value:!0}),exports.SelectionServiceImpl=void 0;var core_1=require("../../core"),SelectionServiceImpl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.onCreate=function(){this.httpsService=this.serviceProvider.getService(core_1.HttpsService)},t.prototype.createSelection=function(e){return this.httpsService.post("selections",e,[],core_1.BACKEND_SERVICE.SELECTION)},t.prototype.addPartsToSelection=function(e,t){return this.httpsService.post("selections/".concat(e,"/parts/add"),t,[],core_1.BACKEND_SERVICE.SELECTION)},t.prototype.removePartsFromSelection=function(e,t){return this.httpsService.post("selections/".concat(e,"/parts/remove"),t,[],core_1.BACKEND_SERVICE.SELECTION)},t.prototype.addAllSearchSessionPartsToSelection=function(e,t){return this.httpsService.post("selections/".concat(e,"/search/add"),t,[],core_1.BACKEND_SERVICE.SELECTION)},t.prototype.removeAllSearchSessionPartsFromSelection=function(e,t){return this.httpsService.post("selections/".concat(e,"/search/remove"),t,[],core_1.BACKEND_SERVICE.SELECTION)},t.prototype.getSearchSummary=function(e){return this.httpsService.get("selections/".concat(e,"/search/summary"),[],core_1.BACKEND_SERVICE.SELECTION)},t.prototype.checkWhichPartsInSelection=function(e,t){return this.httpsService.post("selections/".concat(e,"/parts/check"),t,[],core_1.BACKEND_SERVICE.SELECTION)},t.prototype.addPartsFromFileToSelection=function(e,t){var r=new FormData;return r.append("file",t.file),this.httpsService.post("selections/".concat(e,"/parts/add"),r,[],core_1.BACKEND_SERVICE.SELECTION,{"Content-Type":"multipart/form-data"})},t=__decorate([(0,core_1.InjectionIdentifier)("SelectionService")],t)}(core_1.BaseService);exports.SelectionServiceImpl=SelectionServiceImpl;
|