@partium/js-sdk 15.20.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 +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
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
import { TagableBase } from "./tagable-base";
|
|
3
|
-
import { FormattedString } from "../../../core";
|
|
4
|
-
/**
|
|
5
|
-
* Models that derive from this class can be displayed as tags
|
|
6
|
-
*/
|
|
7
|
-
export declare abstract class I18nTagable extends TagableBase {
|
|
8
|
-
protected abstract getText(languageCode: string): string;
|
|
9
|
-
getTextFormattedStrings(languageCode: string): Array<FormattedString>;
|
|
10
|
-
}
|
|
@@ -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)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.I18nTagable=void 0;var tagable_base_1=require("./tagable-base"),I18nTagable=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.getTextFormattedStrings=function(t){return this.formattedStrings||(this.formattedStrings=this.getFormattedStrings(this.getText(t))),this.formattedStrings},e}(tagable_base_1.TagableBase);exports.I18nTagable=I18nTagable;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
import { FormattedString } from "../../../core";
|
|
3
|
-
/**
|
|
4
|
-
* Models that derive from this class can be displayed as tags
|
|
5
|
-
*/
|
|
6
|
-
export declare abstract class TagableBase {
|
|
7
|
-
abstract getCssClassName(): string;
|
|
8
|
-
abstract getId(): string;
|
|
9
|
-
protected formattedStrings: Array<FormattedString>;
|
|
10
|
-
protected getFormattedStrings(text: string): Array<FormattedString>;
|
|
11
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TagableBase=void 0;var core_1=require("../../../core"),TagableBase=function(){function e(){}return e.prototype.getFormattedStrings=function(e){return e.split("***").map((function(e,t){var r=new core_1.FormattedString;return r.text=e,r.fontWeight=t%2==1?"bold":"normal",r}))},e}();exports.TagableBase=TagableBase;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
import { TagableBase } from "./tagable-base";
|
|
3
|
-
import { FormattedString } from "../../../core";
|
|
4
|
-
/**
|
|
5
|
-
* Models that derive from this class can be displayed as tags
|
|
6
|
-
*/
|
|
7
|
-
export declare abstract class Tagable extends TagableBase {
|
|
8
|
-
protected abstract getText(): string;
|
|
9
|
-
getTextFormattedStrings(): Array<FormattedString>;
|
|
10
|
-
}
|
|
@@ -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)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.Tagable=void 0;var tagable_base_1=require("./tagable-base"),Tagable=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.getTextFormattedStrings=function(){return this.formattedStrings||(this.formattedStrings=this.getFormattedStrings(this.getText())),this.formattedStrings},e}(tagable_base_1.TagableBase);exports.Tagable=Tagable;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated Since temporary-search is deprecated, this config is also not needed anymore.
|
|
4
|
-
*/
|
|
5
|
-
export declare enum SEARCH_DOMAINS {
|
|
6
|
-
PART = "entity",
|
|
7
|
-
/** using SEARCH_DOMAINS.DOCUMENT will not lead to any results, because this feature was removed from the backend */
|
|
8
|
-
DOCUMENT = "document"
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated Since temporary-search is deprecated, this config is also not needed anymore.
|
|
12
|
-
*/
|
|
13
|
-
export declare enum SEARCH_TYPE {
|
|
14
|
-
FUZZY = "fuzzy",
|
|
15
|
-
EXACT = "exact"
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Types of possible temporary search results
|
|
19
|
-
*
|
|
20
|
-
* @deprecated Since temporary-search is deprecated, this config is also not needed anymore.
|
|
21
|
-
*/
|
|
22
|
-
export declare enum TEMPORARY_SEARCH_TYPE {
|
|
23
|
-
RECENT_SEARCH_QUERIES = 0,
|
|
24
|
-
/** @deprecated quick text search is deprecated and will be replaced in the future */
|
|
25
|
-
QUICK_TEXT_SEARCH = 1
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Search-configuration for a text search.
|
|
29
|
-
* Allows overriding text search default behavior
|
|
30
|
-
*
|
|
31
|
-
* @deprecated Since temporary-search is deprecated, this config is also not needed anymore.
|
|
32
|
-
*/
|
|
33
|
-
export declare class TextSearchConfig {
|
|
34
|
-
/**
|
|
35
|
-
* Quicktext search - domains to search in
|
|
36
|
-
*/
|
|
37
|
-
domains: SEARCH_DOMAINS[];
|
|
38
|
-
/**
|
|
39
|
-
* Quicktext limit - how many items the result should max contain
|
|
40
|
-
*/
|
|
41
|
-
limit: number;
|
|
42
|
-
/**
|
|
43
|
-
* Quicktext search - search type to use
|
|
44
|
-
*/
|
|
45
|
-
searchType: SEARCH_TYPE;
|
|
46
|
-
/**
|
|
47
|
-
* Quicktext fuzziness -
|
|
48
|
-
* configuration-parameter only used for search-type FUZZY. Specify a number or AUTO:[low],[high] (<low = fuzziness 0, low..high = fuzziness 1, >=high = fuzziness 2)
|
|
49
|
-
*/
|
|
50
|
-
fuzziness: string;
|
|
51
|
-
/**
|
|
52
|
-
* defines the temporary search types to use for the temporary text search.
|
|
53
|
-
* this affects what kind of search is performed and the temporary text search results.
|
|
54
|
-
*/
|
|
55
|
-
temporarySearch: TEMPORARY_SEARCH_TYPE[];
|
|
56
|
-
constructor(init?: Partial<TextSearchConfig>);
|
|
57
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";var SEARCH_DOMAINS,SEARCH_TYPE,TEMPORARY_SEARCH_TYPE;Object.defineProperty(exports,"__esModule",{value:!0}),exports.TextSearchConfig=exports.TEMPORARY_SEARCH_TYPE=exports.SEARCH_TYPE=exports.SEARCH_DOMAINS=void 0,function(E){E.PART="entity",E.DOCUMENT="document"}(SEARCH_DOMAINS||(exports.SEARCH_DOMAINS=SEARCH_DOMAINS={})),function(E){E.FUZZY="fuzzy",E.EXACT="exact"}(SEARCH_TYPE||(exports.SEARCH_TYPE=SEARCH_TYPE={})),function(E){E[E.RECENT_SEARCH_QUERIES=0]="RECENT_SEARCH_QUERIES",E[E.QUICK_TEXT_SEARCH=1]="QUICK_TEXT_SEARCH"}(TEMPORARY_SEARCH_TYPE||(exports.TEMPORARY_SEARCH_TYPE=TEMPORARY_SEARCH_TYPE={}));var TextSearchConfig=function(E){this.domains=[SEARCH_DOMAINS.PART,SEARCH_DOMAINS.DOCUMENT],this.limit=200,this.searchType=SEARCH_TYPE.FUZZY,this.fuzziness="AUTO:5,9",this.temporarySearch=[TEMPORARY_SEARCH_TYPE.QUICK_TEXT_SEARCH,TEMPORARY_SEARCH_TYPE.RECENT_SEARCH_QUERIES],Object.assign(this,E)};exports.TextSearchConfig=TextSearchConfig;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
import { TextSearchResultItem } from "./text-search-result-item/text-search-result-item";
|
|
3
|
-
import { SdkError } from "../../core";
|
|
4
|
-
/**
|
|
5
|
-
* The Text-Search can have different result-types, like parts or documents.
|
|
6
|
-
* It is possible to also have results of a type that is unknown to the Partium SDK.
|
|
7
|
-
* By default, these items will be of type TextSearchResultItemUnknown, when they are leaving the SDK.
|
|
8
|
-
* It is possible to implement the tetSearchResultManipulatorFunction to intersect this action and
|
|
9
|
-
* manipulate, replace or remove result-items. This allows the user of the SDK to add new types
|
|
10
|
-
* and replace the Unknown-Objects with objects of these new types.
|
|
11
|
-
*
|
|
12
|
-
* @deprecated this feature will not be supported anymore in the future.
|
|
13
|
-
*/
|
|
14
|
-
export declare abstract class TextSearchManipulator {
|
|
15
|
-
/**
|
|
16
|
-
* Method that can be overridden to process the text-search-result.
|
|
17
|
-
* This is currently needed for DB Schadcodes, maybe it will not be needed in the future anymore
|
|
18
|
-
* and can then be removed.
|
|
19
|
-
*
|
|
20
|
-
* The default method does nothing
|
|
21
|
-
*/
|
|
22
|
-
abstract textSearchResultManipulatorFunction(res: {
|
|
23
|
-
query: string;
|
|
24
|
-
result?: Array<TextSearchResultItem>;
|
|
25
|
-
error?: SdkError;
|
|
26
|
-
}): Promise<{
|
|
27
|
-
query: string;
|
|
28
|
-
result?: Array<TextSearchResultItem>;
|
|
29
|
-
error?: SdkError;
|
|
30
|
-
}>;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* The default implementation of the TextSearchManipulator does not do any changes to the
|
|
34
|
-
* search-result. It will just forward it with the unknown object type.
|
|
35
|
-
*/
|
|
36
|
-
export declare class TextSearchManipulatorDoNothing extends TextSearchManipulator {
|
|
37
|
-
textSearchResultManipulatorFunction(res: {
|
|
38
|
-
query: string;
|
|
39
|
-
result?: Array<TextSearchResultItem>;
|
|
40
|
-
error?: SdkError;
|
|
41
|
-
}): Promise<{
|
|
42
|
-
query: string;
|
|
43
|
-
result?: Array<TextSearchResultItem>;
|
|
44
|
-
error?: SdkError;
|
|
45
|
-
}>;
|
|
46
|
-
}
|
|
@@ -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,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),__awaiter=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{c(r.next(t))}catch(t){a(t)}}function u(t){try{c(r.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,u)}c((r=r.apply(t,e||[])).next())}))},__generator=this&&this.__generator||function(t,e){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(c){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=e.call(t,i)}catch(t){u=[6,t],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.TextSearchManipulatorDoNothing=exports.TextSearchManipulator=void 0;var TextSearchManipulator=function(){};exports.TextSearchManipulator=TextSearchManipulator;var TextSearchManipulatorDoNothing=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.textSearchResultManipulatorFunction=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,t]}))}))},e}(TextSearchManipulator);exports.TextSearchManipulatorDoNothing=TextSearchManipulatorDoNothing;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
import { TextSearchResultItem } from "./text-search-result-item";
|
|
3
|
-
import { Document } from "../../../data";
|
|
4
|
-
/**
|
|
5
|
-
* Text-search results of type document.
|
|
6
|
-
*/
|
|
7
|
-
export declare class TextSearchResultItemDocument extends TextSearchResultItem {
|
|
8
|
-
constructor(document: Document, score: number);
|
|
9
|
-
getText(languageCode: string): string;
|
|
10
|
-
}
|
|
@@ -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)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.TextSearchResultItemDocument=void 0;var text_search_result_item_1=require("./text-search-result-item"),TextSearchResultItemDocument=function(t){function e(e,r){return t.call(this,e,r)||this}return __extends(e,t),e.prototype.getText=function(t){return this.getValue().name},e}(text_search_result_item_1.TextSearchResultItem);exports.TextSearchResultItemDocument=TextSearchResultItemDocument;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
import { TextSearchResultItem } from "./text-search-result-item";
|
|
3
|
-
import { Part } from "../../../data";
|
|
4
|
-
/**
|
|
5
|
-
* Text-search results of type part.
|
|
6
|
-
*
|
|
7
|
-
* @deprecated not needed anymore
|
|
8
|
-
*/
|
|
9
|
-
export declare class TextSearchResultItemPart extends TextSearchResultItem {
|
|
10
|
-
constructor(part: Part, score: number);
|
|
11
|
-
getText(languageCode: string): string;
|
|
12
|
-
}
|
|
@@ -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)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.TextSearchResultItemPart=void 0;var text_search_result_item_1=require("./text-search-result-item"),TextSearchResultItemPart=function(t){function e(e,r){return t.call(this,e,r)||this}return __extends(e,t),e.prototype.getText=function(t){return this.getValue().name.getText(t)},e}(text_search_result_item_1.TextSearchResultItem);exports.TextSearchResultItemPart=TextSearchResultItemPart;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
import { TextSearchResultItem } from "./text-search-result-item";
|
|
3
|
-
/**
|
|
4
|
-
* Text-search results of type recent query.
|
|
5
|
-
* Recently sent text search query
|
|
6
|
-
*/
|
|
7
|
-
export declare class TextSearchResultItemRecentQuery extends TextSearchResultItem {
|
|
8
|
-
constructor(query: string, score: number);
|
|
9
|
-
getText(languageCode: string): string;
|
|
10
|
-
}
|
|
@@ -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)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.TextSearchResultItemRecentQuery=void 0;var text_search_result_item_1=require("./text-search-result-item"),TextSearchResultItemRecentQuery=function(t){function e(e,r){return t.call(this,e,r)||this}return __extends(e,t),e.prototype.getText=function(t){return this.getValue()},e}(text_search_result_item_1.TextSearchResultItem);exports.TextSearchResultItemRecentQuery=TextSearchResultItemRecentQuery;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
import { TextSearchResultItem } from "./text-search-result-item";
|
|
3
|
-
/**
|
|
4
|
-
* This Unknown-type is used as an intermediate type for all results that can't be resolved by the SDK.
|
|
5
|
-
* The app using the SDK can replace these Unknown-Items over externalTempSearchResultManipulator with
|
|
6
|
-
* other TextSearchResultItem-Types
|
|
7
|
-
*/
|
|
8
|
-
export declare class TextSearchResultItemUnknown extends TextSearchResultItem {
|
|
9
|
-
domainType: any;
|
|
10
|
-
constructor(data: any, score: number, domainType: string);
|
|
11
|
-
getText(languageCode: string): string;
|
|
12
|
-
}
|
|
@@ -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,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.TextSearchResultItemUnknown=void 0;var text_search_result_item_1=require("./text-search-result-item"),TextSearchResultItemUnknown=function(t){function e(e,n,r){var o=t.call(this,e,n)||this;return o.domainType=r,o}return __extends(e,t),e.prototype.getText=function(t){return"unknown"},e}(text_search_result_item_1.TextSearchResultItem);exports.TextSearchResultItemUnknown=TextSearchResultItemUnknown;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
export type TextSearchResultValue = any;
|
|
3
|
-
/**
|
|
4
|
-
* The text-search can have result-items of different types, like parts or documents.
|
|
5
|
-
* This is the generic super-type of text-search result-items.
|
|
6
|
-
*/
|
|
7
|
-
export declare abstract class TextSearchResultItem {
|
|
8
|
-
abstract getText(languageCode: string): string;
|
|
9
|
-
private value;
|
|
10
|
-
score: number;
|
|
11
|
-
constructor(value: TextSearchResultValue, score: number);
|
|
12
|
-
/**
|
|
13
|
-
* Get the value of the search-result item, depends on the type
|
|
14
|
-
*/
|
|
15
|
-
getValue(): TextSearchResultValue;
|
|
16
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TextSearchResultItem=void 0;var TextSearchResultItem=function(){function e(e,t){this.value=e,this.score=t}return e.prototype.getValue=function(){return this.value},e}();exports.TextSearchResultItem=TextSearchResultItem;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
import { Observable } from "rxjs";
|
|
3
|
-
import { SearchFilter } from "../../models/search-filter";
|
|
4
|
-
/**
|
|
5
|
-
* Interface that defines uploaders for different kind of filters that can be handled by the search-filter.service
|
|
6
|
-
* Implementing classes should implement the upload behavior for the respective type of filter.
|
|
7
|
-
*/
|
|
8
|
-
export interface FilterUploader {
|
|
9
|
-
reset(): any;
|
|
10
|
-
uploadFilters(filters: {
|
|
11
|
-
[filterKey: string]: SearchFilter;
|
|
12
|
-
}, searchSessionId: string): Observable<void>;
|
|
13
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { HttpsService } from '../../../core';
|
|
4
|
-
import { SearchFilter } from '../../models/search-filter';
|
|
5
|
-
import { FilterUploader } from './filter-uploader';
|
|
6
|
-
/**
|
|
7
|
-
* Implementation of the FilterUploader to update the search filters on the backend
|
|
8
|
-
*/
|
|
9
|
-
export declare class UpdateFiltersUploader implements FilterUploader {
|
|
10
|
-
private httpsService;
|
|
11
|
-
constructor(httpsService: HttpsService);
|
|
12
|
-
reset(): void;
|
|
13
|
-
uploadFilters(filters: {
|
|
14
|
-
[filterKey: string]: SearchFilter;
|
|
15
|
-
}, searchSessionId: string): Observable<void>;
|
|
16
|
-
private createUpdateFiltersOptions;
|
|
17
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";var __assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var r,t=1,a=arguments.length;t<a;t++)for(var l in r=arguments[t])Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l]);return e},__assign.apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.UpdateFiltersUploader=void 0;var core_1=require("../../../core"),search_filter_1=require("../../models/search-filter"),update_filters_model_1=require("./update-filters.model"),UpdateFiltersUploader=function(){function e(e){this.httpsService=e}return e.prototype.reset=function(){},e.prototype.uploadFilters=function(e,r){console.log("UpdateFiltersUploader.uploadFilters() searchSessionId: ".concat(r,", filters: "),e);var t=this.createUpdateFiltersOptions(e);return this.httpsService.patch("search/".concat(r),{method:"updateFilters",options:{updateFilters:__assign({},t)}})},e.prototype.createUpdateFiltersOptions=function(e){for(var r={},t=0,a=Object.entries(e);t<a.length;t++){var l=a[t],s=l[0],i=l[1];switch(i.type){case search_filter_1.SearchFilterType.KvpHardFilter:r[update_filters_model_1.KVP_HARD_FILTERS_KEY]||(r[update_filters_model_1.KVP_HARD_FILTERS_KEY]=[]);var o=i;r[update_filters_model_1.KVP_HARD_FILTERS_KEY].push({label:o.label,values:o.values});break;case search_filter_1.SearchFilterType.IncludeExcludeFilter:var c=i;r[s]={include:c.include,exclude:c.exclude};break;case search_filter_1.SearchFilterType.CategoryFilter:var p=i;r[s]={value:Array.isArray(p.value)?p.value:[p.value]};break;default:throw new core_1.SdkError(core_1.SDK_ERROR_CODES.UNKNOWN_ERROR,null,"Can not upload search filter - unsupported SearchFilterType: ".concat(i.type," (key: ").concat(i.key,")"))}}return r},e}();exports.UpdateFiltersUploader=UpdateFiltersUploader;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
import { HierarchyPartiumIdFilter } from "../../models/search-filter";
|
|
3
|
-
export type CategoryFilterToAPI = {
|
|
4
|
-
value: string[];
|
|
5
|
-
};
|
|
6
|
-
export type IncludeExcludeFilterToAPI = {
|
|
7
|
-
include: string[];
|
|
8
|
-
exclude: string[];
|
|
9
|
-
};
|
|
10
|
-
export declare const KVP_HARD_FILTERS_KEY = "hard-filters";
|
|
11
|
-
export type KvpHardFilterToAPI = {
|
|
12
|
-
label: string;
|
|
13
|
-
values: string[];
|
|
14
|
-
};
|
|
15
|
-
export type UpdateFiltersOptionsToAPI = {
|
|
16
|
-
[HierarchyPartiumIdFilter.KEY]?: IncludeExcludeFilterToAPI;
|
|
17
|
-
[KVP_HARD_FILTERS_KEY]?: KvpHardFilterToAPI[];
|
|
18
|
-
[filterKey: string]: CategoryFilterToAPI | IncludeExcludeFilterToAPI | KvpHardFilterToAPI[];
|
|
19
|
-
};
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
import { SearchStatus } from '../../models/search-status/search-status';
|
|
3
|
-
import { ImageCropArea } from '../../models/search-status/cv-search-status';
|
|
4
|
-
import { Observable } from 'rxjs';
|
|
5
|
-
import { Asset } from '../../models/assets/asset';
|
|
6
|
-
import { PFile } from '../../../core/models/p-file';
|
|
7
|
-
import { BaseService } from '../../../core/services/base.service';
|
|
8
|
-
import { ServiceProvider } from '../../../core/services/service-provider';
|
|
9
|
-
/**
|
|
10
|
-
* Service for creating CV-searches.
|
|
11
|
-
*
|
|
12
|
-
* @deprecated use SearchService.performSearch instead
|
|
13
|
-
*/
|
|
14
|
-
export interface CvSearchService {
|
|
15
|
-
/**
|
|
16
|
-
* Performs image recognition with the given ImageAsset
|
|
17
|
-
*
|
|
18
|
-
* @param imageAsset Asset of the image that should be used for image search (the image needs
|
|
19
|
-
* to be uploaded as Asset already beforehand)
|
|
20
|
-
* @param cropArea (optional) Crop area of the image that should be used to highlight the area of interest of the image (defined by user)
|
|
21
|
-
* x1/y1 defines the top left point of the crop-rectangle, x2/y2 the bottom right one (values in percent [0,1])
|
|
22
|
-
*
|
|
23
|
-
* The crop area parameter is optional to allow performing a partial image search that uses the whole image as input.
|
|
24
|
-
* Certain parts in the image search require a crop area to work, so depending on the organization configuration without the crop area it only returns search tags rather than search results.
|
|
25
|
-
* It is possible to call this method again at a later time to update the search with the crop area to receive search results.
|
|
26
|
-
*
|
|
27
|
-
* @returns promise that resolves when the image was successfully added to the search
|
|
28
|
-
*
|
|
29
|
-
* @deprecated use SearchService.performSearch instead
|
|
30
|
-
*/
|
|
31
|
-
performCV(imageAsset: Asset, cropArea?: ImageCropArea): Promise<void>;
|
|
32
|
-
/**
|
|
33
|
-
* @deprecated use SearchService.performSearch instead
|
|
34
|
-
*/
|
|
35
|
-
performCVObs(imageAsset: Asset, cropArea?: ImageCropArea): Observable<void>;
|
|
36
|
-
/**
|
|
37
|
-
* Get a subscription for always getting the current CV-Image
|
|
38
|
-
*
|
|
39
|
-
* @returns Observable that emits the current CV image whenever it changes
|
|
40
|
-
*
|
|
41
|
-
* @deprecated use SearchService.performSearch instead
|
|
42
|
-
*/
|
|
43
|
-
getCvImage(): Observable<PFile>;
|
|
44
|
-
/**
|
|
45
|
-
* Get an Observable that always resolves with the latest CV-Image value
|
|
46
|
-
* when a search is performed.
|
|
47
|
-
*
|
|
48
|
-
* @returns Observable that always resolves with the latest CV-Image value whenever changed
|
|
49
|
-
*
|
|
50
|
-
* @deprecated use SearchService.performSearch instead
|
|
51
|
-
*/
|
|
52
|
-
getCvImageValue(): Observable<PFile>;
|
|
53
|
-
}
|
|
54
|
-
export declare class CvSearchServiceImpl extends BaseService implements CvSearchService {
|
|
55
|
-
private httpsService;
|
|
56
|
-
private searchResultService;
|
|
57
|
-
private assetService;
|
|
58
|
-
private searchStatus;
|
|
59
|
-
private cvStatus;
|
|
60
|
-
private cvImage$;
|
|
61
|
-
constructor(serviceProvider: ServiceProvider);
|
|
62
|
-
onCreate(): void;
|
|
63
|
-
/**
|
|
64
|
-
* Reset the CV search status.
|
|
65
|
-
* Is called on Creation of a new search
|
|
66
|
-
*/
|
|
67
|
-
reset(searchStatus: SearchStatus): void;
|
|
68
|
-
/**
|
|
69
|
-
* Set the cv-search-status to a certain status.
|
|
70
|
-
* This can happen if an old search-session is loaded or a change of the search-input
|
|
71
|
-
* was initiated on the backend-side.
|
|
72
|
-
*
|
|
73
|
-
* Will set the assetId and crop area, but not download the asset itself. It has to
|
|
74
|
-
* be downloaded separately if needed.
|
|
75
|
-
*
|
|
76
|
-
* @param searchStatus the search-status object
|
|
77
|
-
* @param assetId id of the search-image
|
|
78
|
-
* @param searchConfig the search-config of the old session (if null => use default)
|
|
79
|
-
*/
|
|
80
|
-
setStatusExternal(searchStatus: SearchStatus, assetId: string, cropArea: ImageCropArea): void;
|
|
81
|
-
performCV(imageAsset: Asset, cropArea?: ImageCropArea): Promise<void>;
|
|
82
|
-
performCVObs(imageAsset: Asset, cropArea?: ImageCropArea): Observable<void>;
|
|
83
|
-
/**
|
|
84
|
-
* Always get the latest CV-image, whenever it changes. If the image is
|
|
85
|
-
* not there, but an assetId is available (eg: after reloading an old
|
|
86
|
-
* search-session), download the image in the given size and provide it.
|
|
87
|
-
* Else return undefined.
|
|
88
|
-
*
|
|
89
|
-
* @param size desired size of the image (will only take effect if the image
|
|
90
|
-
* is not already present, which will be the case if the image was taken
|
|
91
|
-
* during the current search-session)
|
|
92
|
-
* @returns Observable that emits the current CV image whenever it changes
|
|
93
|
-
* or the downloaded one, if none was present
|
|
94
|
-
*/
|
|
95
|
-
getCvImage(size?: string): Observable<PFile>;
|
|
96
|
-
getCvImageValue(): Observable<PFile>;
|
|
97
|
-
/**
|
|
98
|
-
* Check if the crop area is valid and throw error if not.
|
|
99
|
-
*
|
|
100
|
-
* @param cropArea the crop area to check
|
|
101
|
-
*/
|
|
102
|
-
private ensureCropAreaIsValid;
|
|
103
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
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)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},__assign.apply(this,arguments)},__decorate=this&&this.__decorate||function(e,t,r,i){var n,s=arguments.length,o=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var c=e.length-1;c>=0;c--)(n=e[c])&&(o=(s<3?n(o):s>3?n(t,r,o):n(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},__awaiter=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(n,s){function o(e){try{a(i.next(e))}catch(e){s(e)}}function c(e){try{a(i.throw(e))}catch(e){s(e)}}function a(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}a((i=i.apply(e,t||[])).next())}))},__generator=this&&this.__generator||function(e,t){var r,i,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function c(c){return function(a){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(o=0)),o;)try{if(r=1,i&&(n=2&c[0]?i.return:c[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,c[1])).done)return n;switch(i=0,n&&(c=[2&c[0],n.value]),c[0]){case 0:case 1:n=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,i=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(n=o.trys,(n=n.length>0&&n[n.length-1])||6!==c[0]&&2!==c[0])){o=0;continue}if(3===c[0]&&(!n||c[1]>n[0]&&c[1]<n[3])){o.label=c[1];break}if(6===c[0]&&o.label<n[1]){o.label=n[1],n=c;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(c);break}n[2]&&o.ops.pop(),o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e],i=0}finally{r=n=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.CvSearchServiceImpl=void 0;var rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),search_result_service_1=require("./search-result.service"),asset_service_1=require("../asset.service"),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"),file_transfer_service_interface_1=require("../../../core/services/http/file-transfer/file-transfer.service.interface"),core_1=require("../../../core"),CvSearchServiceImpl=function(e){function t(t){var r=e.call(this,t)||this;return r.cvImage$=new rxjs_1.BehaviorSubject(null),r}return __extends(t,e),t.prototype.onCreate=function(){this.httpsService=this.serviceProvider.getService(https_service_interface_1.HttpsService),this.searchResultService=this.serviceProvider.getService(search_result_service_1.SearchResultService),this.assetService=this.serviceProvider.getService(asset_service_1.AssetServiceImpl)},t.prototype.reset=function(e){this.searchStatus=e,this.cvStatus=e.cvSearchStatus,this.cvImage$.next(null)},t.prototype.setStatusExternal=function(e,t,r){var i=t!==this.cvStatus.assetId;this.searchStatus=e,this.cvStatus=e.cvSearchStatus,this.cvStatus.assetId=t,this.cvStatus.cropArea=r,i&&this.cvImage$.next(null)},t.prototype.performCV=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return[2,this.performCVObs(e,t).toPromise()]}))}))},t.prototype.performCVObs=function(e,t){var r=this;return t&&this.ensureCropAreaIsValid(t),this.cvStatus.setImage(e),this.cvStatus.cropArea=t,this.cvImage$.next(e.file),this.httpsService.patch("search/".concat(this.searchStatus.searchSessionID),{method:"imageSearch",options:{imageSearch:__assign({assetId:e.referenceId},t?{cropArea:t}:null)}}).pipe((0,operators_1.tap)((function(){r.searchResultService.startPollingForResults()})))},t.prototype.getCvImage=function(e){var t=this;return void 0===e&&(e="original"),this.cvImage$.pipe((0,operators_1.mergeMap)((function(r){var i;return r?(0,rxjs_1.of)(r):(null===(i=t.cvStatus)||void 0===i?void 0:i.assetId)?t.assetService.downloadImage(t.cvStatus.assetId,e,https_service_interface_1.BACKEND_SERVICE.FIND).pipe((0,operators_1.filter)((function(e){return e.status===file_transfer_service_interface_1.TRANSFER_STATUS.TRANSFER_FINISHED})),(0,operators_1.map)((function(e){return e.file}))):(0,rxjs_1.of)(void 0)})))},t.prototype.getCvImageValue=function(){return this.cvImage$.asObservable()},t.prototype.ensureCropAreaIsValid=function(e){if(e.x1<0||e.x1>1||e.x2<0||e.x2>1||e.y1<0||e.y1>1||e.y2<0||e.y2>1)throw new core_1.SdkError(core_1.SDK_ERROR_CODES.INVALID_CROP_AREA,null,"All values of the crop-area must be in the range [0;1].");if(e.x1>e.x2||e.y1>e.y2)throw new core_1.SdkError(core_1.SDK_ERROR_CODES.INVALID_CROP_AREA,null,"The point x1/y1 must be on the top left of x2/y2.");if(e.x1===e.x2||e.y1===e.y2)throw new core_1.SdkError(core_1.SDK_ERROR_CODES.INVALID_CROP_AREA,null,"The width and height of the crop area must be greater than 0.")},t=__decorate([(0,injection_identifier_1.InjectionIdentifier)("CvSearchService")],t)}(base_service_1.BaseService);exports.CvSearchServiceImpl=CvSearchServiceImpl;
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { SearchStatus } from '../../models/search-status/search-status';
|
|
4
|
-
import { SearchResultStatus } from '../../models/search-result-status';
|
|
5
|
-
import { Part } from '../../../data/models/part';
|
|
6
|
-
import { BaseService } from '../../../core/services/base.service';
|
|
7
|
-
import { SdkError } from '../../../core/models/error';
|
|
8
|
-
import { ServiceProvider } from '../../../core/services/service-provider';
|
|
9
|
-
import { SmartFilter } from '../../models/smart-filter';
|
|
10
|
-
export type CurResultList = {
|
|
11
|
-
results: Part[];
|
|
12
|
-
moreResultsAvailable: boolean;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Service that is responsible for polling for Search-Results, as well as
|
|
16
|
-
* Tags and provide both to listeners.
|
|
17
|
-
*
|
|
18
|
-
* @deprecated use SearchService.performSearch instead
|
|
19
|
-
*/
|
|
20
|
-
export declare class SearchResultService extends BaseService {
|
|
21
|
-
private httpsService;
|
|
22
|
-
private partService;
|
|
23
|
-
private tagSearchService;
|
|
24
|
-
private filterService;
|
|
25
|
-
private cvSearchService;
|
|
26
|
-
private textSearchService;
|
|
27
|
-
private searchFilterService;
|
|
28
|
-
private searchStatus;
|
|
29
|
-
private curResultList$;
|
|
30
|
-
private curSmartFilters$;
|
|
31
|
-
private pollingSubscription?;
|
|
32
|
-
private loadMoreResultsSubscription?;
|
|
33
|
-
private POLLING_INTERVAL;
|
|
34
|
-
private MAX_REQUEST_TIMEOUT;
|
|
35
|
-
private MAX_POLLING_TIMEOUT;
|
|
36
|
-
private prevSearchResultTimestamp;
|
|
37
|
-
private prevProposedTagsUpdatedTimestamp;
|
|
38
|
-
private prevSmartFiltersUpdateTimestamp;
|
|
39
|
-
private searchErrors;
|
|
40
|
-
private RESULT_LIST_LIMIT;
|
|
41
|
-
private resultListSkip;
|
|
42
|
-
private searchResultStatus$;
|
|
43
|
-
private filterKeys;
|
|
44
|
-
constructor(serviceProvider: ServiceProvider);
|
|
45
|
-
onCreate(): void;
|
|
46
|
-
/**
|
|
47
|
-
* Called when new search-session is started
|
|
48
|
-
*
|
|
49
|
-
* @param searchStatus a new search-status
|
|
50
|
-
*/
|
|
51
|
-
reset(searchStatus: SearchStatus): void;
|
|
52
|
-
/**
|
|
53
|
-
* Start poll for results of the current search.
|
|
54
|
-
* Polling will be continued until it is cancelled again.
|
|
55
|
-
*/
|
|
56
|
-
startPollingForResults(): void;
|
|
57
|
-
/**
|
|
58
|
-
* Stop polling.
|
|
59
|
-
*/
|
|
60
|
-
stopPollingForResults(): void;
|
|
61
|
-
/**
|
|
62
|
-
* Get an observable that always emits the current result list (paginated) every
|
|
63
|
-
* time it changes.
|
|
64
|
-
*
|
|
65
|
-
* If an error happens during the search-process in the backend, those errors will also be emitted
|
|
66
|
-
* via this Observable. An error does not necessarily mean, that the whole search failed, search-
|
|
67
|
-
* results might still be emitted. More information can be drawn out of the thrown error.
|
|
68
|
-
*
|
|
69
|
-
* @returns Observable that emits an Object of type CurResultList, every
|
|
70
|
-
* time the results change. CurResults contains the paginated list of
|
|
71
|
-
* results, as well as a boolean, whether more results can be loaded,
|
|
72
|
-
* or the last page was already reached.
|
|
73
|
-
* Emits an SdkError when an error happens during
|
|
74
|
-
* processing of the search result on the backend side.
|
|
75
|
-
|
|
76
|
-
*/
|
|
77
|
-
getCurResultList(): Observable<CurResultList | SdkError>;
|
|
78
|
-
getSearchResultStatus(): Observable<SearchResultStatus>;
|
|
79
|
-
getCurResultListLength(): number;
|
|
80
|
-
getCurResultListValue(): Array<Part>;
|
|
81
|
-
getSmartFilters(): Observable<SmartFilter[]>;
|
|
82
|
-
/**
|
|
83
|
-
* Check the response to identify if the proposed search-tags have
|
|
84
|
-
* changed, to emit new ones if necessary
|
|
85
|
-
*
|
|
86
|
-
* @param response the response of a polling request
|
|
87
|
-
* @param newTagsAreAsyncTags true if the newly received tags are async
|
|
88
|
-
*/
|
|
89
|
-
private updateProposedTags;
|
|
90
|
-
/**
|
|
91
|
-
* Check the response to identify if it contains new search-results
|
|
92
|
-
* that have not been emitted before.
|
|
93
|
-
*
|
|
94
|
-
* @param response the response of a polling request
|
|
95
|
-
*/
|
|
96
|
-
private updateSearchResults;
|
|
97
|
-
/**
|
|
98
|
-
* Update the current search-input status to the values provided from the BE
|
|
99
|
-
* search-session. This can be used to load an older search-session and even
|
|
100
|
-
* allows to continue it.
|
|
101
|
-
*
|
|
102
|
-
* TODO This function is currently only used to load the search-results of an
|
|
103
|
-
* older search-session. Loading of the search-inputs is not fully working yet
|
|
104
|
-
* and should therefore not yet be used.
|
|
105
|
-
*
|
|
106
|
-
* @param response response of the GET search-session request to find
|
|
107
|
-
*
|
|
108
|
-
* @beta
|
|
109
|
-
*/
|
|
110
|
-
private updateSearchInput;
|
|
111
|
-
/**
|
|
112
|
-
* Check the response to identify if the smart filters have
|
|
113
|
-
* changed, to emit new ones if necessary
|
|
114
|
-
*
|
|
115
|
-
* @param response the response of a polling request
|
|
116
|
-
*/
|
|
117
|
-
private updateSmartFilters;
|
|
118
|
-
private updateFilters;
|
|
119
|
-
private checkIfFiltersChanged;
|
|
120
|
-
private setMappedFilters;
|
|
121
|
-
private mapSelectedFilters;
|
|
122
|
-
/**
|
|
123
|
-
* Check the response to identify new errors that have not been emitted before.
|
|
124
|
-
*
|
|
125
|
-
* @param response the response of a polling request
|
|
126
|
-
*/
|
|
127
|
-
private updateErrors;
|
|
128
|
-
private updateCurResultList;
|
|
129
|
-
/**
|
|
130
|
-
* Process raw search results to format as a list of parts with confidences
|
|
131
|
-
*
|
|
132
|
-
* @param results The raw response of a search result request
|
|
133
|
-
* @returns The processed part with confidences list
|
|
134
|
-
*/
|
|
135
|
-
private processSearchResults;
|
|
136
|
-
/**
|
|
137
|
-
* Load more results of the current result list, based on RESULT_LIST_LIMIT and resultListSkip values
|
|
138
|
-
* The newly loaded results will emit via the getCurResultList-Observable,
|
|
139
|
-
* along with the already known results.
|
|
140
|
-
*/
|
|
141
|
-
loadMoreResults(): void;
|
|
142
|
-
}
|