@partium/js-sdk 15.19.0 → 16.0.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 +1 -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/user.d.ts +7 -43
- package/core/models/user.js +1 -1
- package/core/services/http/https.service.interface.d.ts +18 -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 +20 -1
- package/data/models/part-data.js +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 +14 -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/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';
|
|
@@ -103,18 +102,25 @@ export declare class Partium {
|
|
|
103
102
|
*/
|
|
104
103
|
static getInitializationStatus(): Observable<INITIALIZATION_STATUS>;
|
|
105
104
|
/**
|
|
106
|
-
* Returns
|
|
105
|
+
* Returns the first page of Organizations of the currently logged in user.
|
|
107
106
|
*
|
|
108
|
-
* @returns a promise that resolves with an array with all available organizations for a customer.
|
|
107
|
+
* @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
108
|
*/
|
|
110
|
-
static getOrganizations(): Promise<
|
|
109
|
+
static getOrganizations(request: GetOrganizationsRequest): Promise<OrganizationsResponse>;
|
|
111
110
|
/**
|
|
112
|
-
* Set organization with the given
|
|
111
|
+
* Set organization with the given partiumId as the current organization to be used in the session.
|
|
113
112
|
*
|
|
114
|
-
* @param
|
|
113
|
+
* @param organizationId organization-id
|
|
115
114
|
* @returns void if organization is found, otherwise throws an error
|
|
116
115
|
*/
|
|
117
|
-
static
|
|
116
|
+
static useOrganizationById(organizationId: string): Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* Set organization with the given name as the current organization to be used in the session.
|
|
119
|
+
*
|
|
120
|
+
* @param organizationName organization-name
|
|
121
|
+
* @returns void if organization is found, otherwise throws an error
|
|
122
|
+
*/
|
|
123
|
+
static useOrganizationByName(organizationName: string): Promise<void>;
|
|
118
124
|
/**
|
|
119
125
|
* Get a service from the service-singleton provider
|
|
120
126
|
*
|
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");!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}),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])},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.0.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.",
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
import { APIObject } from './api-object';
|
|
3
|
-
export interface OrganizationFromAPI {
|
|
4
|
-
partiumId: string;
|
|
5
|
-
name: string;
|
|
6
|
-
displayName?: string;
|
|
7
|
-
requiresAdditionalAuthentication?: boolean;
|
|
8
|
-
config?: {
|
|
9
|
-
defaultSearchLanguage?: string;
|
|
10
|
-
availableSearchLanguages?: string[];
|
|
11
|
-
availableUiLanguages?: string[];
|
|
12
|
-
smmsLanguages?: string[];
|
|
13
|
-
ecr?: {
|
|
14
|
-
email?: string;
|
|
15
|
-
contactPhoneNumber?: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
featureFlags?: {
|
|
19
|
-
assemblyNavigationEnabled?: boolean;
|
|
20
|
-
imageSearchEnabled?: boolean;
|
|
21
|
-
codeScannerEnabled?: boolean;
|
|
22
|
-
hybridTextSearchEnabled?: boolean;
|
|
23
|
-
ecrEnabled?: boolean;
|
|
24
|
-
trackingEnabled?: boolean;
|
|
25
|
-
enrichedPartMetadataEnabled?: boolean;
|
|
26
|
-
partRelationsEnabled?: boolean;
|
|
27
|
-
catalogOptimizationEnabled?: boolean;
|
|
28
|
-
dataEnrichmentEnabled?: boolean;
|
|
29
|
-
shoppingCartEnabled?: boolean;
|
|
30
|
-
inquiriesEnabled?: boolean;
|
|
31
|
-
};
|
|
32
|
-
ci?: {
|
|
33
|
-
format?: string;
|
|
34
|
-
theme?: 'dark' | 'light';
|
|
35
|
-
colors?: {
|
|
36
|
-
[id: string]: string;
|
|
37
|
-
};
|
|
38
|
-
assets?: {
|
|
39
|
-
[id: string]: string;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
subOrgs?: OrganizationFromAPI[];
|
|
43
|
-
}
|
|
44
|
-
export declare enum THEME {
|
|
45
|
-
LIGHT = "light",
|
|
46
|
-
DARK = "dark"
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Advanced configuration parameters for this organization
|
|
50
|
-
*/
|
|
51
|
-
export declare class OrganizationConfig {
|
|
52
|
-
defaultSearchLanguage?: string;
|
|
53
|
-
/** @deprecated use defaultSearchLanguage instead */
|
|
54
|
-
defaultLanguage?: string;
|
|
55
|
-
availableSearchLanguages?: string[];
|
|
56
|
-
/** @deprecated use availableSearchLanguages instead */
|
|
57
|
-
availableLanguages?: string[];
|
|
58
|
-
availableUiLanguages?: string[];
|
|
59
|
-
smmsLanguages?: string[];
|
|
60
|
-
ecr?: {
|
|
61
|
-
email?: string;
|
|
62
|
-
contactPhoneNumber?: string;
|
|
63
|
-
};
|
|
64
|
-
/** @deprecated use OrganizationFeatureFlags.assemblyNavigationEnabled instead */
|
|
65
|
-
assemblyNavigationEnabled?: boolean;
|
|
66
|
-
/** @deprecated use OrganizationFeatureFlags.trackingEnabled instead */
|
|
67
|
-
trackingEnabled?: boolean;
|
|
68
|
-
/** @deprecated use OrganizationFeatureFlags.codeScannerEnabled instead */
|
|
69
|
-
codeScannerEnabled?: boolean;
|
|
70
|
-
/** @deprecated use OrganizationFeatureFlags.hybridTextSearchEnabled instead */
|
|
71
|
-
hybridTextSearchEnabled?: boolean;
|
|
72
|
-
/** @deprecated use OrganizationFeatureFlags.ecrEnabled instead */
|
|
73
|
-
csaEnabled?: boolean;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Feature flags for this organization
|
|
77
|
-
*/
|
|
78
|
-
export declare class OrganizationFeatureFlags {
|
|
79
|
-
assemblyNavigationEnabled?: boolean;
|
|
80
|
-
imageSearchEnabled?: boolean;
|
|
81
|
-
codeScannerEnabled?: boolean;
|
|
82
|
-
hybridTextSearchEnabled?: boolean;
|
|
83
|
-
ecrEnabled?: boolean;
|
|
84
|
-
trackingEnabled?: boolean;
|
|
85
|
-
enrichedPartMetadataEnabled?: boolean;
|
|
86
|
-
partRelationsEnabled?: boolean;
|
|
87
|
-
catalogOptimizationEnabled?: boolean;
|
|
88
|
-
dataEnrichmentEnabled?: boolean;
|
|
89
|
-
shoppingCartEnabled?: boolean;
|
|
90
|
-
inquiriesEnabled?: boolean;
|
|
91
|
-
}
|
|
92
|
-
export declare class OrganizationCI {
|
|
93
|
-
format?: string;
|
|
94
|
-
theme?: THEME;
|
|
95
|
-
colors?: {
|
|
96
|
-
[id: string]: string;
|
|
97
|
-
};
|
|
98
|
-
assets?: {
|
|
99
|
-
[id: string]: string;
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* An Organization and its configuration data
|
|
104
|
-
*/
|
|
105
|
-
export declare class Organization extends APIObject {
|
|
106
|
-
partiumId: string;
|
|
107
|
-
/** @deprecated not supported anymore, use partiumId or name instead */
|
|
108
|
-
searchDomainId?: string;
|
|
109
|
-
name: string;
|
|
110
|
-
displayName?: string;
|
|
111
|
-
requiresAdditionalAuthentication?: boolean;
|
|
112
|
-
config?: OrganizationConfig;
|
|
113
|
-
featureFlags?: OrganizationFeatureFlags;
|
|
114
|
-
ci?: OrganizationCI;
|
|
115
|
-
/** @deprecated use config.ecr instead */
|
|
116
|
-
csa?: {
|
|
117
|
-
emailAddress: string | null;
|
|
118
|
-
contactPhone: string | null;
|
|
119
|
-
};
|
|
120
|
-
subOrgs?: Organization[];
|
|
121
|
-
constructor(init?: Partial<Organization>);
|
|
122
|
-
static fromAPIResponse(organizationFromAPI: Partial<OrganizationFromAPI>): Organization;
|
|
123
|
-
private static mapOrgConfig;
|
|
124
|
-
private static mapFeatureFlags;
|
|
125
|
-
private static mapCI;
|
|
126
|
-
private static mapSubOrgs;
|
|
127
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";var __extends=this&&this.__extends||function(){var a=function(n,e){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,n){a.__proto__=n}||function(a,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(a[e]=n[e])},a(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=n}a(n,e),n.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(a){for(var n,e=1,i=arguments.length;e<i;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(a[o]=n[o]);return a},__assign.apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Organization=exports.OrganizationCI=exports.OrganizationFeatureFlags=exports.OrganizationConfig=exports.THEME=void 0;var THEME,api_object_1=require("./api-object"),lodash_1=require("lodash");!function(a){a.LIGHT="light",a.DARK="dark"}(THEME||(exports.THEME=THEME={}));var OrganizationConfig=function(){};exports.OrganizationConfig=OrganizationConfig;var OrganizationFeatureFlags=function(){};exports.OrganizationFeatureFlags=OrganizationFeatureFlags;var OrganizationCI=function(){};exports.OrganizationCI=OrganizationCI;var Organization=function(a){function n(n){var e=a.call(this)||this;return Object.assign(e,n),e}return __extends(n,a),n.fromAPIResponse=function(a){var e,i,o,t,r=new n({partiumId:a.partiumId,searchDomainId:a.partiumId,name:a.name,displayName:a.displayName||a.name,requiresAdditionalAuthentication:a.requiresAdditionalAuthentication,config:this.mapOrgConfig(a),featureFlags:this.mapFeatureFlags(a),ci:this.mapCI(a),csa:{emailAddress:null===(i=null===(e=a.config)||void 0===e?void 0:e.ecr)||void 0===i?void 0:i.email,contactPhone:null===(t=null===(o=a.config)||void 0===o?void 0:o.ecr)||void 0===t?void 0:t.contactPhoneNumber}}),l=this.mapSubOrgs(a);return l&&(r.subOrgs=l),r},n.mapOrgConfig=function(a){var n,e,i,o,t,r,l,u,d,s,g,c,v,f,b,p,h,m;return{defaultSearchLanguage:((null===(n=a.config)||void 0===n?void 0:n.defaultSearchLanguage)||"").toLowerCase(),defaultLanguage:((null===(e=a.config)||void 0===e?void 0:e.defaultSearchLanguage)||"").toLowerCase(),availableSearchLanguages:((null===(i=a.config)||void 0===i?void 0:i.availableSearchLanguages)||[]).map((function(a){return a.toLowerCase()})),availableLanguages:((null===(o=a.config)||void 0===o?void 0:o.availableSearchLanguages)||[]).map((function(a){return a.toLowerCase()})),availableUiLanguages:((null===(r=null===(t=a.config)||void 0===t?void 0:t.availableUiLanguages)||void 0===r?void 0:r.length)>0?null===(l=a.config)||void 0===l?void 0:l.availableUiLanguages:(null===(u=a.config)||void 0===u?void 0:u.availableSearchLanguages)||[]).map((function(a){return a.toLowerCase()})),smmsLanguages:((null===(d=a.config)||void 0===d?void 0:d.smmsLanguages)||[]).map((function(a){return a.toLowerCase()})),ecr:{email:null===(g=null===(s=a.config)||void 0===s?void 0:s.ecr)||void 0===g?void 0:g.email,contactPhoneNumber:null===(v=null===(c=a.config)||void 0===c?void 0:c.ecr)||void 0===v?void 0:v.contactPhoneNumber},csaEnabled:null===(f=a.featureFlags)||void 0===f?void 0:f.ecrEnabled,codeScannerEnabled:null===(b=a.featureFlags)||void 0===b?void 0:b.codeScannerEnabled,hybridTextSearchEnabled:null===(p=a.featureFlags)||void 0===p?void 0:p.hybridTextSearchEnabled,assemblyNavigationEnabled:null===(h=a.featureFlags)||void 0===h?void 0:h.assemblyNavigationEnabled,trackingEnabled:null===(m=a.featureFlags)||void 0===m?void 0:m.trackingEnabled}},n.mapFeatureFlags=function(a){var n,e,i,o,t,r,l,u,d,s,g,c;return{assemblyNavigationEnabled:null===(n=a.featureFlags)||void 0===n?void 0:n.assemblyNavigationEnabled,imageSearchEnabled:null===(e=a.featureFlags)||void 0===e?void 0:e.imageSearchEnabled,codeScannerEnabled:null===(i=a.featureFlags)||void 0===i?void 0:i.codeScannerEnabled,hybridTextSearchEnabled:null===(o=a.featureFlags)||void 0===o?void 0:o.hybridTextSearchEnabled,ecrEnabled:null===(t=a.featureFlags)||void 0===t?void 0:t.ecrEnabled,trackingEnabled:null===(r=a.featureFlags)||void 0===r?void 0:r.trackingEnabled,enrichedPartMetadataEnabled:null===(l=a.featureFlags)||void 0===l?void 0:l.enrichedPartMetadataEnabled,partRelationsEnabled:null===(u=a.featureFlags)||void 0===u?void 0:u.partRelationsEnabled,catalogOptimizationEnabled:null===(d=a.featureFlags)||void 0===d?void 0:d.catalogOptimizationEnabled,dataEnrichmentEnabled:null===(s=a.featureFlags)||void 0===s?void 0:s.dataEnrichmentEnabled,shoppingCartEnabled:null===(g=a.featureFlags)||void 0===g?void 0:g.shoppingCartEnabled,inquiriesEnabled:null===(c=a.featureFlags)||void 0===c?void 0:c.inquiriesEnabled}},n.mapCI=function(a){var n,e,i,o;return{format:null===(n=a.ci)||void 0===n?void 0:n.format,theme:null===(e=a.ci)||void 0===e?void 0:e.theme,colors:null===(i=a.ci)||void 0===i?void 0:i.colors,assets:null===(o=a.ci)||void 0===o?void 0:o.assets}},n.mapSubOrgs=function(a){var e,i=__assign(__assign({},a),{subOrgs:null});return null===(e=a.subOrgs)||void 0===e?void 0:e.map((function(a){return n.fromAPIResponse(__assign(__assign({},(0,lodash_1.mergeWith)({},i,a,(function(a,n){if(Array.isArray(a))return n}))),{subOrgs:null}))}))},n}(api_object_1.APIObject);exports.Organization=Organization;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { Organization } from '../models/organization';
|
|
4
|
-
import { Role } from '../models/user';
|
|
5
|
-
import { BaseService } from './base.service';
|
|
6
|
-
import { ServiceProvider } from './service-provider';
|
|
7
|
-
export declare class OrganizationService extends BaseService {
|
|
8
|
-
private httpsService;
|
|
9
|
-
private organizations$;
|
|
10
|
-
constructor(serviceProvider: ServiceProvider);
|
|
11
|
-
onCreate(): void;
|
|
12
|
-
/**
|
|
13
|
-
* initializes the service by requesting the backend to get the organizations, and caching them
|
|
14
|
-
* should be called whenever the logged-in user and his associated organization changes (i.e. on login)
|
|
15
|
-
*/
|
|
16
|
-
init(): Promise<void>;
|
|
17
|
-
/**
|
|
18
|
-
* gets all organizations of the logged-in user is associated with
|
|
19
|
-
*/
|
|
20
|
-
getOrganizations(): Promise<Array<Organization>>;
|
|
21
|
-
/**
|
|
22
|
-
* Gets the first organization of the organization that the logged-in user is associated with, which does not need
|
|
23
|
-
* additional authentication.
|
|
24
|
-
*/
|
|
25
|
-
getFirstOrganization(): Promise<Organization | undefined>;
|
|
26
|
-
/**
|
|
27
|
-
* gets an organization by id
|
|
28
|
-
* @param string // organization id
|
|
29
|
-
* @param includeSubOrgs // if true, the organizations sub-orgs will also be included in the response
|
|
30
|
-
* @returns Promise<Organization>
|
|
31
|
-
*/
|
|
32
|
-
getOrganization(organizationId: string, includeSubOrgs?: boolean): Promise<Organization | undefined>;
|
|
33
|
-
/**
|
|
34
|
-
* gets the first 100 organizations for the current user by roles
|
|
35
|
-
* @param string[] // roles
|
|
36
|
-
* @returns Promise<Organization>
|
|
37
|
-
* @deprecated use getOrganizationsListByRoles instead
|
|
38
|
-
*/
|
|
39
|
-
getOrganizationsByRoles(roles: Role[]): Promise<Organization[]>;
|
|
40
|
-
/**
|
|
41
|
-
* gets all organizations for the current user by roles with reduced organization data. It makes multiple requests to retrieve all the organizations.
|
|
42
|
-
* @param string[] // roles
|
|
43
|
-
* @param pageSize // number
|
|
44
|
-
* @returns Observable<Organization>
|
|
45
|
-
*/
|
|
46
|
-
getOrganizationsListByRoles(roles: Role[], pageSize?: number): Observable<Organization[]>;
|
|
47
|
-
private getOrganizationsRequest;
|
|
48
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
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 n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),__decorate=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,a=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,r,a):i(e,r))||a);return o>3&&a&&Object.defineProperty(e,r,a),a},__awaiter=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},__generator=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.OrganizationService=void 0;var rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),injection_identifier_1=require("../decorators/injection-identifier"),organization_1=require("../models/organization"),base_service_1=require("./base.service"),https_service_interface_1=require("./http/https.service.interface"),OrganizationService=function(t){function e(e){var r=t.call(this,e)||this;return r.organizations$=new rxjs_1.ReplaySubject(1),r}return __extends(e,t),e.prototype.onCreate=function(){this.httpsService=this.serviceProvider.getService(https_service_interface_1.HttpsService)},e.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return console.log("OrganizationService - init"),[4,this.getOrganizationsRequest()];case 1:return t=e.sent(),this.organizations$.next(t.map((function(t){return new organization_1.Organization(t)}))),console.log("..initialized organization.service (organizations: ".concat(t.length,")")),[2]}}))}))},e.prototype.getOrganizations=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.organizations$.pipe((0,operators_1.take)(1)).toPromise()]}))}))},e.prototype.getFirstOrganization=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.getOrganizations()];case 1:return[2,(t=e.sent()).find((function(t){return!t.requiresAdditionalAuthentication}))||t[0]]}}))}))},e.prototype.getOrganization=function(t){return __awaiter(this,arguments,void 0,(function(t,e){return void 0===e&&(e=!1),__generator(this,(function(r){return[2,this.httpsService.get("organizations-ui/".concat(t),[{includeSubOrgs:e}],https_service_interface_1.BACKEND_SERVICE.DATA).pipe((0,operators_1.map)((function(t){return organization_1.Organization.fromAPIResponse(t)}))).toPromise()]}))}))},e.prototype.getOrganizationsByRoles=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.httpsService.get("organizations",[{roles:t.join(",")}],https_service_interface_1.BACKEND_SERVICE.DATA).pipe((0,operators_1.map)((function(t){return(t.results||[]).map((function(t){return organization_1.Organization.fromAPIResponse(t)}))}))).toPromise()]}))}))},e.prototype.getOrganizationsListByRoles=function(t,e){var r=this;void 0===e&&(e=1e3);var n="organizations-list";return this.httpsService.get(n,[{roles:t.join(","),page_size:e}],https_service_interface_1.BACKEND_SERVICE.DATA).pipe((0,operators_1.expand)((function(i){var o=!(!i.pagination||!i.pagination.next),a=parseInt(i.pagination.page)+1;return o?r.httpsService.get(n,[{roles:t.join(","),page_size:e,page:a}],https_service_interface_1.BACKEND_SERVICE.DATA):rxjs_1.EMPTY})),(0,operators_1.reduce)((function(t,e){return t.concat(e.results)}),[]),(0,operators_1.takeWhile)((function(t){return null!==t}),!0),(0,operators_1.map)((function(t){return(t||[]).map((function(t){return organization_1.Organization.fromAPIResponse(t)}))})))},e.prototype.getOrganizationsRequest=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.httpsService.get("organizations-ui",[{includeSubOrgs:!0}],https_service_interface_1.BACKEND_SERVICE.DATA).pipe((0,operators_1.map)((function(t){return t.map((function(t){return organization_1.Organization.fromAPIResponse(t)}))}))).toPromise()]}))}))},e=__decorate([(0,injection_identifier_1.InjectionIdentifier)("OrganizationService")],e)}(base_service_1.BaseService);exports.OrganizationService=OrganizationService;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
import { Observable } from "rxjs";
|
|
3
|
-
import { BaseService } from "../../core/services/base.service";
|
|
4
|
-
import { ServiceProvider } from "../../core/services/service-provider";
|
|
5
|
-
import { AssemblyHierarchyNode } from "../models/assembly-hierarchy-node";
|
|
6
|
-
export declare class CSAHelperService extends BaseService {
|
|
7
|
-
private searchFilterService;
|
|
8
|
-
private assemblyHierarchyNodesService;
|
|
9
|
-
constructor(serviceProvider: ServiceProvider);
|
|
10
|
-
onCreate(): void;
|
|
11
|
-
/**
|
|
12
|
-
* Returns all hierarchy-nodes that should be displayed to the user
|
|
13
|
-
* as applied hierarchy-filters. This considers excluded nodes.
|
|
14
|
-
* The list of filters does not equal the applied hierarchy-filters,
|
|
15
|
-
* but it contains also siblings of excluded nodes, which don't
|
|
16
|
-
* explicitly have to be added in the filter-service, but it's more
|
|
17
|
-
* readable to the user like this.
|
|
18
|
-
* Also loads nodes from later pages than page one.
|
|
19
|
-
*
|
|
20
|
-
* @returns Observable that resolves with an array of AssemblyHierarchyNodes that represent all applied filters
|
|
21
|
-
* @deprecated not needed anymore as HierarchyPartiumIdFilter is deprecated
|
|
22
|
-
*/
|
|
23
|
-
getHierarchyFilterNodesForUI(): Observable<AssemblyHierarchyNode[]>;
|
|
24
|
-
/**
|
|
25
|
-
* Loads all direct children of the node with the given id.
|
|
26
|
-
* (Does not only load the first page, but iteratively loads all pages)
|
|
27
|
-
*
|
|
28
|
-
* @param partiumId id of the parent node
|
|
29
|
-
* @returns Observable that resolves with all direct child nodes
|
|
30
|
-
*/
|
|
31
|
-
private loadAllChildren;
|
|
32
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";var __extends=this&&this.__extends||function(){var e=function(r,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])},e(r,t)};return function(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}}(),__decorate=this&&this.__decorate||function(e,r,t,i){var o,n=arguments.length,s=n<3?r:null===i?i=Object.getOwnPropertyDescriptor(r,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,r,t,i);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(s=(n<3?o(s):n>3?o(r,t,s):o(r,t))||s);return n>3&&s&&Object.defineProperty(r,t,s),s};Object.defineProperty(exports,"__esModule",{value:!0}),exports.CSAHelperService=void 0;var lodash_1=require("lodash"),rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),injection_identifier_1=require("../../core/decorators/injection-identifier"),base_service_1=require("../../core/services/base.service"),search_filter_1=require("../../find/models/search-filter"),search_filter_service_1=require("../../find/services/search-filter.service"),assembly_hierarchy_nodes_service_1=require("./assembly-hierarchy-nodes.service"),CSAHelperService=function(e){function r(r){return e.call(this,r)||this}return __extends(r,e),r.prototype.onCreate=function(){this.searchFilterService=this.serviceProvider.getService(search_filter_service_1.SearchFilterServiceImpl),this.assemblyHierarchyNodesService=this.serviceProvider.getService(assembly_hierarchy_nodes_service_1.AssemblyHierarchyNodesServiceImpl)},r.prototype.getHierarchyFilterNodesForUI=function(){var e,r,t,i=this,o=this.searchFilterService.getSearchFilters().pipe((0,operators_1.first)()),n=this.searchFilterService.getExcludedHierarchyFilterNodes().pipe((0,operators_1.first)());return(0,rxjs_1.forkJoin)([o,n]).pipe((0,operators_1.mergeMap)((function(o){var n=o[0],s=o[1];e=[],r=[],t=s;var c=n.find((function(e){return e instanceof search_filter_1.HierarchyPartiumIdFilter}));c&&e.push.apply(e,c.include);for(var a=0,l=Object.values(t);a<l.length;a++)for(var u=function(t){r.filter((function(e){return e===t.partiumId})).length<1&&r.push(t.partiumId),e=e.filter((function(e){return e!==t.partiumId}))},p=0,f=l[a].breadcrumbs;p<f.length;p++){u(f[p])}for(var _=[],h=0,d=r;h<d.length;h++){var v=d[h];_.push(i.loadAllChildren(v))}return _.length>0?(0,rxjs_1.forkJoin)(_):(0,rxjs_1.of)([])})),(0,operators_1.mergeMap)((function(o){for(var n=0,s=o;n<s.length;n++)for(var c=0,a=s[n];c<a.length;c++){var l=a[c];Object.keys(t).includes(l.partiumId)||r.includes(l.partiumId)||e.includes(l.partiumId)||e.push(l.partiumId)}return i.assemblyHierarchyNodesService.getAssemblyHierarchyNodes(e).pipe((0,operators_1.map)((function(e){return e.filter((function(e){return null!=e}))})))})),(0,operators_1.map)((function(e){return(0,lodash_1.sortBy)(e,(function(e){return e.breadcrumbs.length}))})))},r.prototype.loadAllChildren=function(e){var r=new rxjs_1.Subject,t=this.assemblyHierarchyNodesService.getAssemblyHierarchyNodesByParentId(e);return t.loadInitialPage(!0).pipe((0,operators_1.first)(),(0,operators_1.mergeMap)((function(e){return e.moreResultsAvailable()?(0,rxjs_1.defer)((function(){return t.loadMore()})).pipe((0,operators_1.first)(),(0,operators_1.tap)((function(e){e.moreResultsAvailable()?setTimeout((function(){r.next()})):r.complete()})),(0,operators_1.repeatWhen)((function(){return r.asObservable()}))):(0,rxjs_1.of)(e)})),(0,operators_1.map)((function(e){return e.items})))},r=__decorate([(0,injection_identifier_1.InjectionIdentifier)("CSAHelperService")],r)}(base_service_1.BaseService);exports.CSAHelperService=CSAHelperService;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
import { PFile } from "../../../core";
|
|
3
|
-
export declare enum ASSET_STATUS {
|
|
4
|
-
NEW = 0,// asset is only available local or just being generated
|
|
5
|
-
PREPARING = 1,// prepare asset request on the server is currently running
|
|
6
|
-
PREPARED = 2,// asset is prepared for upload
|
|
7
|
-
UPLOADING = 3,// assets is currently uploading to the server
|
|
8
|
-
UPLOADED = 4,// asset was successfully uploaded to the server
|
|
9
|
-
VERIFYING = 5,// the verify request is currently active
|
|
10
|
-
VERIFIED = 6,// the asset upload was verified with the BE
|
|
11
|
-
ERROR = 7
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Asset of any type that exists in the Partium ecosystem.
|
|
15
|
-
*/
|
|
16
|
-
export declare class Asset {
|
|
17
|
-
referenceId: string;
|
|
18
|
-
uploadUrl: string;
|
|
19
|
-
private status;
|
|
20
|
-
file: PFile;
|
|
21
|
-
constructor(file: PFile);
|
|
22
|
-
setStatus(newStatus: ASSET_STATUS): void;
|
|
23
|
-
getStatus(): ASSET_STATUS;
|
|
24
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";var ASSET_STATUS;Object.defineProperty(exports,"__esModule",{value:!0}),exports.Asset=exports.ASSET_STATUS=void 0,function(t){t[t.NEW=0]="NEW",t[t.PREPARING=1]="PREPARING",t[t.PREPARED=2]="PREPARED",t[t.UPLOADING=3]="UPLOADING",t[t.UPLOADED=4]="UPLOADED",t[t.VERIFYING=5]="VERIFYING",t[t.VERIFIED=6]="VERIFIED",t[t.ERROR=7]="ERROR"}(ASSET_STATUS||(exports.ASSET_STATUS=ASSET_STATUS={}));var Asset=function(){function t(t){this.file=t,this.status=ASSET_STATUS.NEW}return t.prototype.setStatus=function(t){this.status=t},t.prototype.getStatus=function(){return this.status},t}();exports.Asset=Asset;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated not needed for new search, use search.performSearch and SearchInput.
|
|
4
|
-
*/
|
|
5
|
-
export declare enum SearchFilterType {
|
|
6
|
-
CategoryFilter = "category",
|
|
7
|
-
IncludeExcludeFilter = "includeExclude",
|
|
8
|
-
KvpHardFilter = "kvpHardFilter"
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Search-filters that can be applied to a search-session, in order to narrow down the search.
|
|
12
|
-
*
|
|
13
|
-
* @deprecated not needed for new search, use search.performSearch and SearchInput.
|
|
14
|
-
*/
|
|
15
|
-
export declare class SearchFilter {
|
|
16
|
-
key: string;
|
|
17
|
-
type: SearchFilterType;
|
|
18
|
-
header?: string;
|
|
19
|
-
constructor(key: string, type: SearchFilterType);
|
|
20
|
-
/**
|
|
21
|
-
* checks equality between filters. Need to be overriden by sub types to correctly determine equality.
|
|
22
|
-
* @param other
|
|
23
|
-
* @returns true if they can be considered equal, false if not
|
|
24
|
-
*/
|
|
25
|
-
equals(other: SearchFilter): boolean;
|
|
26
|
-
/**
|
|
27
|
-
* checks if the filter has any value set.
|
|
28
|
-
* @returns true if the filter has no value set
|
|
29
|
-
*/
|
|
30
|
-
isEmpty(): boolean;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* @deprecated this filter class is deprecated. Use the KvpHardFilter instead.
|
|
34
|
-
*/
|
|
35
|
-
export declare class CategoryFilter extends SearchFilter {
|
|
36
|
-
value: string | string[];
|
|
37
|
-
label?: string;
|
|
38
|
-
constructor(key: string, value: string | string[], label?: string);
|
|
39
|
-
equals(other: SearchFilter): boolean;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* @deprecated not needed for new search, use search.performSearch and SearchInput.
|
|
43
|
-
*/
|
|
44
|
-
export declare class IncludeExcludeFilter extends SearchFilter {
|
|
45
|
-
include: string[];
|
|
46
|
-
exclude: string[];
|
|
47
|
-
label?: string;
|
|
48
|
-
constructor(key: string, include: string[], exclude: string[], label?: string);
|
|
49
|
-
equals(other: SearchFilter): boolean;
|
|
50
|
-
isEmpty(): boolean;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* @deprecated not needed for new search, use search.performSearch and SearchInput.
|
|
54
|
-
*/
|
|
55
|
-
export declare class ExternalPayloadFilter extends CategoryFilter {
|
|
56
|
-
constructor(field: string, value: string, label?: string);
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* @deprecated this filter class is deprecated and will be removed in a future version of the SDK, use HierarchyPartiumIdFilter instead
|
|
60
|
-
*/
|
|
61
|
-
export declare class HierarchyFilter extends CategoryFilter {
|
|
62
|
-
constructor(partiumId: string, label?: string);
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Hierarchy search filter that allows filtering for assembly hierarchy nodes by their partiumId.
|
|
66
|
-
* This is an IncludeExcludeFilter, which means that nodes can be included, as well as excluded in the search.
|
|
67
|
-
* For example it is possible to exclude nodes and search only in the nodes that are not excluded.
|
|
68
|
-
* This is also combinable with the include, e.g. a parent node can be included, but some of its child nodes can be excluded from the search
|
|
69
|
-
*
|
|
70
|
-
* @deprecated not needed for new search, use search.performSearch and SearchInput.
|
|
71
|
-
*/
|
|
72
|
-
export declare class HierarchyPartiumIdFilter extends IncludeExcludeFilter {
|
|
73
|
-
static readonly KEY = "hierarchy-partium-id";
|
|
74
|
-
constructor(include: string[], exclude?: string[], label?: string);
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Key-value hard filters
|
|
78
|
-
*
|
|
79
|
-
* @deprecated not needed for new search, use search.performSearch and SearchInput.
|
|
80
|
-
*/
|
|
81
|
-
export declare class KvpHardFilter extends SearchFilter {
|
|
82
|
-
label: string;
|
|
83
|
-
values: string[];
|
|
84
|
-
constructor(partiumId: string, label: string, values: string[]);
|
|
85
|
-
equals(other: SearchFilter): boolean;
|
|
86
|
-
isEmpty(): boolean;
|
|
87
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";var SearchFilterType,__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)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.KvpHardFilter=exports.HierarchyPartiumIdFilter=exports.HierarchyFilter=exports.ExternalPayloadFilter=exports.IncludeExcludeFilter=exports.CategoryFilter=exports.SearchFilter=exports.SearchFilterType=void 0,function(e){e.CategoryFilter="category",e.IncludeExcludeFilter="includeExclude",e.KvpHardFilter="kvpHardFilter"}(SearchFilterType||(exports.SearchFilterType=SearchFilterType={}));var SearchFilter=function(){function e(e,t){this.key=e,this.type=t}return e.prototype.equals=function(e){return this.key===e.key},e.prototype.isEmpty=function(){return!0},e}();exports.SearchFilter=SearchFilter;var CategoryFilter=function(e){function t(t,r,i){var n=e.call(this,t,SearchFilterType.CategoryFilter)||this;return n.value=r,n.label=i,n}return __extends(t,e),t.prototype.equals=function(e){return e instanceof t&&(this.key==e.key&&this.value==e.value)},t}(SearchFilter);exports.CategoryFilter=CategoryFilter;var IncludeExcludeFilter=function(e){function t(t,r,i,n){var l=e.call(this,t,SearchFilterType.IncludeExcludeFilter)||this;return l.include=r,l.exclude=i,l.label=n,l}return __extends(t,e),t.prototype.equals=function(e){if(!(e instanceof t))return!1;if(this.key!==e.key)return!1;if(this.include.length!==e.include.length)return!1;for(var r=0,i=this.include;r<i.length;r++){var n=i[r];if(!e.include.includes(n))return!1}if(this.exclude.length!==e.exclude.length)return!1;for(var l=0,u=this.exclude;l<u.length;l++){n=u[l];if(!e.exclude.includes(n))return!1}return!0},t.prototype.isEmpty=function(){var e;return!((null===(e=this.include)||void 0===e?void 0:e.length)>0)},t}(SearchFilter);exports.IncludeExcludeFilter=IncludeExcludeFilter;var ExternalPayloadFilter=function(e){function t(t,r,i){return e.call(this,"external_payload."+t,r,i)||this}return __extends(t,e),t}(CategoryFilter);exports.ExternalPayloadFilter=ExternalPayloadFilter;var HierarchyFilter=function(e){function t(t,r){return e.call(this,"hierarchy-partium-id",t,r)||this}return __extends(t,e),t}(CategoryFilter);exports.HierarchyFilter=HierarchyFilter;var HierarchyPartiumIdFilter=function(e){function t(r,i,n){return void 0===i&&(i=[]),e.call(this,t.KEY,r,i,n)||this}return __extends(t,e),t.KEY="hierarchy-partium-id",t}(IncludeExcludeFilter);exports.HierarchyPartiumIdFilter=HierarchyPartiumIdFilter;var KvpHardFilter=function(e){function t(t,r,i){var n=e.call(this,t,SearchFilterType.KvpHardFilter)||this;return n.values=i,n.label=r,n}return __extends(t,e),t.prototype.equals=function(e){if(!(e instanceof t))return!1;if(this.key!==e.key)return!1;if(this.label!==e.label)return!1;if(this.values.length!==e.values.length)return!1;for(var r=0,i=this.values;r<i.length;r++){var n=i[r];if(!e.values.includes(n))return!1}return!0},t.prototype.isEmpty=function(){var e;return!((null===(e=this.values)||void 0===e?void 0:e.length)>0)},t}(SearchFilter);exports.KvpHardFilter=KvpHardFilter;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
export declare enum SEARCH_RESULT_STATUS {
|
|
3
|
-
CREATED = "created",
|
|
4
|
-
RUNNING = "running",
|
|
5
|
-
FINISHED = "finished"
|
|
6
|
-
}
|
|
7
|
-
export declare enum ASYNC_TAG_STATUS {
|
|
8
|
-
PENDING = "pending",
|
|
9
|
-
RECEIVED = "received",
|
|
10
|
-
WILL_NOT_RECEIVE = "will-not-receive"
|
|
11
|
-
}
|
|
12
|
-
export declare enum ASYNC_RESULT_STATUS {
|
|
13
|
-
PENDING = "pending",
|
|
14
|
-
RECEIVED = "received",
|
|
15
|
-
WILL_NOT_RECEIVE = "will-not-receive"
|
|
16
|
-
}
|
|
17
|
-
export declare enum SMART_FILTERS_STATUS {
|
|
18
|
-
PENDING = "pending",
|
|
19
|
-
RECEIVED = "received",
|
|
20
|
-
WILL_NOT_RECEIVE = "will-not-receive"
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Status of a search session.
|
|
24
|
-
*
|
|
25
|
-
* @deprecated with the new search, the SDK will not save the status of a search-session anymore. This has to be managed on the Application level.
|
|
26
|
-
*/
|
|
27
|
-
export declare class SearchResultStatus {
|
|
28
|
-
status: SEARCH_RESULT_STATUS;
|
|
29
|
-
asyncTagsStatus: ASYNC_TAG_STATUS;
|
|
30
|
-
asyncResultsStatus: ASYNC_RESULT_STATUS;
|
|
31
|
-
asyncSmartFiltersStatus: SMART_FILTERS_STATUS;
|
|
32
|
-
constructor(init?: Partial<SearchResultStatus>);
|
|
33
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";var SEARCH_RESULT_STATUS,ASYNC_TAG_STATUS,ASYNC_RESULT_STATUS,SMART_FILTERS_STATUS;Object.defineProperty(exports,"__esModule",{value:!0}),exports.SearchResultStatus=exports.SMART_FILTERS_STATUS=exports.ASYNC_RESULT_STATUS=exports.ASYNC_TAG_STATUS=exports.SEARCH_RESULT_STATUS=void 0,function(S){S.CREATED="created",S.RUNNING="running",S.FINISHED="finished"}(SEARCH_RESULT_STATUS||(exports.SEARCH_RESULT_STATUS=SEARCH_RESULT_STATUS={})),function(S){S.PENDING="pending",S.RECEIVED="received",S.WILL_NOT_RECEIVE="will-not-receive"}(ASYNC_TAG_STATUS||(exports.ASYNC_TAG_STATUS=ASYNC_TAG_STATUS={})),function(S){S.PENDING="pending",S.RECEIVED="received",S.WILL_NOT_RECEIVE="will-not-receive"}(ASYNC_RESULT_STATUS||(exports.ASYNC_RESULT_STATUS=ASYNC_RESULT_STATUS={})),function(S){S.PENDING="pending",S.RECEIVED="received",S.WILL_NOT_RECEIVE="will-not-receive"}(SMART_FILTERS_STATUS||(exports.SMART_FILTERS_STATUS=SMART_FILTERS_STATUS={}));var SearchResultStatus=function(S){Object.assign(this,S)};exports.SearchResultStatus=SearchResultStatus;
|