@partium/js-sdk 14.15.2 → 14.16.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/LICENSE.txt +1 -1
- package/catalog/index.d.ts +1 -1
- package/catalog/index.js +1 -1
- package/catalog/models/catalog-image-info.d.ts +1 -1
- package/catalog/models/catalog-image-info.js +1 -1
- package/catalog/models/catalog-image.d.ts +1 -1
- package/catalog/models/catalog-image.js +1 -1
- package/catalog/models/upsert-catalog-images-dto.d.ts +1 -1
- package/catalog/models/upsert-catalog-images-dto.js +1 -1
- package/catalog/models/upsert-images-result.d.ts +1 -1
- package/catalog/models/upsert-images-result.js +1 -1
- package/catalog/services/images.service.d.ts +1 -1
- package/catalog/services/images.service.js +1 -1
- package/core/constants/constants.d.ts +1 -1
- package/core/constants/constants.js +1 -1
- package/core/decorators/injection-identifier.d.ts +1 -1
- package/core/decorators/injection-identifier.js +1 -1
- package/core/factories/paginated-request-service.factory.d.ts +1 -1
- package/core/factories/paginated-request-service.factory.js +1 -1
- package/core/index.d.ts +1 -1
- package/core/index.js +1 -1
- package/core/integration-defaults/http/fetch-api-http-error-helper.d.ts +1 -1
- package/core/integration-defaults/http/fetch-api-http-error-helper.js +1 -1
- package/core/integration-defaults/http/file-transfer/axios-file-transfer.service.d.ts +1 -1
- package/core/integration-defaults/http/file-transfer/axios-file-transfer.service.js +1 -1
- package/core/integration-defaults/http/file-transfer/fetch-api-file-transfer.service.d.ts +1 -1
- package/core/integration-defaults/http/file-transfer/fetch-api-file-transfer.service.js +1 -1
- package/core/integration-defaults/http/handle-axios-error-helper.d.ts +1 -1
- package/core/integration-defaults/http/handle-axios-error-helper.js +1 -1
- package/core/integration-defaults/http/https-client/axios-https-client.service.d.ts +1 -1
- 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.d.ts +1 -1
- package/core/integration-defaults/http/https-client/fetch-api-https-client.service.js +1 -1
- package/core/integration-defaults/http/js-oauth-keycloak-https.service.d.ts +1 -1
- package/core/integration-defaults/http/js-oauth-keycloak-https.service.js +1 -1
- package/core/integration-defaults/js-p-file.d.ts +1 -1
- package/core/integration-defaults/js-p-file.js +1 -1
- package/core/integration-defaults/session/js-oauth-api-key-session.service.d.ts +1 -1
- package/core/integration-defaults/session/js-oauth-api-key-session.service.js +1 -1
- package/core/integration-defaults/session/js-oauth-keycloak-auth-config.d.ts +1 -1
- package/core/integration-defaults/session/js-oauth-keycloak-auth-config.js +1 -1
- package/core/integration-defaults/session/js-oauth-keycloak-session.service.d.ts +1 -1
- package/core/integration-defaults/session/js-oauth-keycloak-session.service.js +1 -1
- package/core/integration-defaults/web-device-status.service.d.ts +1 -1
- package/core/integration-defaults/web-device-status.service.js +1 -1
- package/core/integration-defaults/web-file.service.d.ts +1 -1
- package/core/integration-defaults/web-file.service.js +1 -1
- package/core/integration-defaults/web-indexeddb.service.d.ts +1 -1
- package/core/integration-defaults/web-indexeddb.service.js +1 -1
- package/core/integration-defaults/web-local-storage.service.d.ts +1 -1
- package/core/integration-defaults/web-local-storage.service.js +1 -1
- package/core/models/api-object.d.ts +1 -1
- package/core/models/api-object.js +1 -1
- package/core/models/auth-config.d.ts +1 -1
- package/core/models/auth-config.js +1 -1
- package/core/models/base-paginated-request.d.ts +1 -1
- package/core/models/base-paginated-request.js +1 -1
- package/core/models/base-paginated-response.d.ts +1 -1
- package/core/models/base-paginated-response.js +1 -1
- package/core/models/base-response.d.ts +1 -1
- package/core/models/base-response.js +1 -1
- package/core/models/default-get-paginated-request-pagination-context.d.ts +1 -1
- package/core/models/default-get-paginated-request-pagination-context.js +1 -1
- package/core/models/device-info.d.ts +1 -1
- package/core/models/device-info.js +1 -1
- package/core/models/error.d.ts +1 -1
- package/core/models/error.js +1 -1
- package/core/models/formatted-string.d.ts +1 -1
- package/core/models/formatted-string.js +1 -1
- package/core/models/i18n-map.d.ts +1 -1
- package/core/models/i18n-map.js +1 -1
- package/core/models/i18n-string.d.ts +1 -1
- package/core/models/i18n-string.js +1 -1
- package/core/models/log.d.ts +1 -1
- package/core/models/log.js +1 -1
- package/core/models/organization.d.ts +1 -1
- package/core/models/organization.js +1 -1
- package/core/models/p-file.d.ts +1 -1
- package/core/models/p-file.js +1 -1
- package/core/models/paginated-list.d.ts +1 -1
- package/core/models/paginated-list.js +1 -1
- package/core/models/partium-config.d.ts +1 -1
- package/core/models/partium-config.js +1 -1
- package/core/models/user-token.d.ts +1 -1
- package/core/models/user-token.js +1 -1
- package/core/models/user.d.ts +1 -1
- package/core/models/user.js +1 -1
- package/core/services/backend-status.service.d.ts +1 -1
- package/core/services/backend-status.service.js +1 -1
- package/core/services/base-login-init.service.d.ts +1 -1
- package/core/services/base-login-init.service.js +1 -1
- package/core/services/base.service.d.ts +1 -1
- package/core/services/base.service.js +1 -1
- package/core/services/device-status.service.interface.d.ts +1 -1
- package/core/services/device-status.service.interface.js +1 -1
- package/core/services/file.service.interface.d.ts +1 -1
- package/core/services/file.service.interface.js +1 -1
- package/core/services/http/file-transfer/file-transfer.service.interface.d.ts +1 -1
- package/core/services/http/file-transfer/file-transfer.service.interface.js +1 -1
- package/core/services/http/https-client/https-client.service.interface.d.ts +1 -1
- package/core/services/http/https-client/https-client.service.interface.js +1 -1
- package/core/services/http/https.service.interface.d.ts +1 -1
- package/core/services/http/https.service.interface.js +1 -1
- package/core/services/http/oauth-https.service.d.ts +1 -1
- package/core/services/http/oauth-https.service.js +1 -1
- package/core/services/local-storage.service.interface.d.ts +1 -1
- package/core/services/local-storage.service.interface.js +1 -1
- package/core/services/log.service.d.ts +1 -1
- package/core/services/log.service.js +1 -1
- package/core/services/organization.service.d.ts +1 -1
- package/core/services/organization.service.js +1 -1
- package/core/services/paginated-request.service.d.ts +1 -1
- package/core/services/paginated-request.service.js +1 -1
- package/core/services/recent-parts.service.d.ts +1 -1
- package/core/services/recent-parts.service.js +1 -1
- package/core/services/service-provider.d.ts +1 -1
- package/core/services/service-provider.js +1 -1
- package/core/services/session/oauth-session.service.d.ts +1 -1
- package/core/services/session/oauth-session.service.js +1 -1
- package/core/services/session/session.service.interface.d.ts +1 -1
- package/core/services/session/session.service.interface.js +1 -1
- package/core/utils/general-helper.d.ts +1 -1
- package/core/utils/general-helper.js +1 -1
- package/data/index.d.ts +1 -1
- package/data/index.js +1 -1
- package/data/models/announcement.d.ts +1 -1
- package/data/models/announcement.js +1 -1
- package/data/models/assembly-hierarchy-node-breadcrumb.d.ts +1 -1
- package/data/models/assembly-hierarchy-node-breadcrumb.js +1 -1
- package/data/models/assembly-hierarchy-node.d.ts +1 -1
- package/data/models/assembly-hierarchy-node.js +1 -1
- package/data/models/attribute.d.ts +1 -1
- package/data/models/attribute.js +1 -1
- package/data/models/csa-request-search.d.ts +1 -1
- package/data/models/csa-request-search.js +1 -1
- package/data/models/csa-request-status.d.ts +1 -1
- package/data/models/csa-request-status.js +1 -1
- package/data/models/csa-request.d.ts +1 -1
- package/data/models/csa-request.js +1 -1
- package/data/models/document.d.ts +1 -1
- package/data/models/document.js +1 -1
- package/data/models/filter-key.d.ts +1 -1
- package/data/models/filter-key.js +1 -1
- package/data/models/filter-option-value.d.ts +1 -1
- package/data/models/filter-option-value.js +1 -1
- package/data/models/get-part-data-request.d.ts +1 -1
- package/data/models/get-part-data-request.js +1 -1
- package/data/models/get-part-data-response.d.ts +1 -1
- package/data/models/get-part-data-response.js +1 -1
- package/data/models/image.d.ts +1 -1
- package/data/models/image.js +1 -1
- package/data/models/inquiry.d.ts +1 -1
- package/data/models/inquiry.js +1 -1
- package/data/models/mounting-location.d.ts +1 -1
- package/data/models/mounting-location.js +1 -1
- package/data/models/multiple-expert-searches.d.ts +1 -1
- package/data/models/multiple-expert-searches.js +1 -1
- package/data/models/part-data.d.ts +1 -1
- package/data/models/part-data.js +1 -1
- package/data/models/part-enrichment-data.d.ts +1 -1
- package/data/models/part-enrichment-data.js +1 -1
- package/data/models/part.d.ts +1 -1
- package/data/models/part.js +1 -1
- package/data/models/shopping-cart.d.ts +1 -1
- package/data/models/shopping-cart.js +1 -1
- package/data/services/announcement.service.d.ts +1 -1
- package/data/services/announcement.service.js +1 -1
- package/data/services/assembly-hierarchy-nodes.service.d.ts +1 -1
- package/data/services/assembly-hierarchy-nodes.service.js +1 -1
- package/data/services/csa-helper.service.d.ts +1 -1
- package/data/services/csa-helper.service.js +1 -1
- package/data/services/customer-service-assistance.service.d.ts +1 -1
- package/data/services/customer-service-assistance.service.js +1 -1
- package/data/services/data.service.d.ts +1 -1
- package/data/services/data.service.js +1 -1
- package/data/services/filter.service.d.ts +1 -1
- package/data/services/filter.service.js +1 -1
- package/data/services/inquiry.service.d.ts +1 -1
- package/data/services/inquiry.service.js +1 -1
- package/data/services/part-attribute.service.d.ts +1 -1
- package/data/services/part-attribute.service.js +1 -1
- package/data/services/part-enrichment.service.d.ts +1 -1
- package/data/services/part-enrichment.service.js +1 -1
- package/data/services/part.service.d.ts +1 -1
- package/data/services/part.service.js +1 -1
- package/data/services/related-parts.service.d.ts +1 -1
- package/data/services/related-parts.service.js +1 -1
- package/data/services/shopping-cart.service.d.ts +1 -1
- package/data/services/shopping-cart.service.js +1 -1
- package/datacuration/index.d.ts +1 -1
- package/datacuration/index.js +1 -1
- package/datacuration/models/approve-image-submission-request.d.ts +1 -1
- package/datacuration/models/approve-image-submission-request.js +1 -1
- package/datacuration/models/approve-image-submission-response.d.ts +1 -1
- package/datacuration/models/approve-image-submission-response.js +1 -1
- package/datacuration/models/base-submission-response.d.ts +1 -1
- package/datacuration/models/base-submission-response.js +1 -1
- package/datacuration/models/get-image-submissions-request.d.ts +1 -1
- package/datacuration/models/get-image-submissions-request.js +1 -1
- package/datacuration/models/get-image-submissions-response.d.ts +1 -1
- package/datacuration/models/get-image-submissions-response.js +1 -1
- package/datacuration/models/image-submission-content-type.d.ts +1 -1
- package/datacuration/models/image-submission-content-type.js +1 -1
- package/datacuration/models/image-submission-status.d.ts +1 -1
- package/datacuration/models/image-submission-status.js +1 -1
- package/datacuration/models/image-submission.d.ts +1 -1
- package/datacuration/models/image-submission.js +1 -1
- package/datacuration/models/reject-image-submission-request.d.ts +1 -1
- package/datacuration/models/reject-image-submission-request.js +1 -1
- package/datacuration/models/reject-image-submission-response.d.ts +1 -1
- package/datacuration/models/reject-image-submission-response.js +1 -1
- package/datacuration/models/submit-images-request.d.ts +1 -1
- package/datacuration/models/submit-images-request.js +1 -1
- package/datacuration/models/submit-images-response.d.ts +1 -1
- package/datacuration/models/submit-images-response.js +1 -1
- package/datacuration/models/update-image-submission-request.d.ts +1 -1
- package/datacuration/models/update-image-submission-request.js +1 -1
- package/datacuration/models/update-image-submission-response.d.ts +1 -1
- package/datacuration/models/update-image-submission-response.js +1 -1
- package/datacuration/services/image-submission.service.d.ts +1 -1
- package/datacuration/services/image-submission.service.js +1 -1
- package/enrichment/index.d.ts +1 -1
- package/enrichment/index.js +1 -1
- package/enrichment/models/create-enrichment-job-request.d.ts +1 -1
- package/enrichment/models/create-enrichment-job-request.js +1 -1
- package/enrichment/models/create-enrichment-job-response.d.ts +1 -1
- package/enrichment/models/create-enrichment-job-response.js +1 -1
- package/enrichment/models/enrichment-job-part.d.ts +1 -1
- package/enrichment/models/enrichment-job-part.js +1 -1
- package/enrichment/models/enrichment-job.d.ts +1 -1
- package/enrichment/models/enrichment-job.js +1 -1
- package/enrichment/models/get-enrichment-job-parts-request.d.ts +1 -1
- package/enrichment/models/get-enrichment-job-parts-request.js +1 -1
- package/enrichment/models/get-enrichment-job-request.d.ts +1 -1
- package/enrichment/models/get-enrichment-job-request.js +1 -1
- package/enrichment/models/submit-enrichment-job-request.d.ts +1 -1
- package/enrichment/models/submit-enrichment-job-request.js +1 -1
- package/enrichment/services/data-enrichment.service.d.ts +1 -1
- package/enrichment/services/data-enrichment.service.js +1 -1
- package/find/index.d.ts +1 -1
- package/find/index.js +1 -1
- package/find/models/assets/asset.d.ts +1 -1
- package/find/models/assets/asset.js +1 -1
- package/find/models/search-filter.d.ts +1 -1
- package/find/models/search-filter.js +1 -1
- package/find/models/search-input.d.ts +1 -1
- package/find/models/search-input.js +1 -1
- package/find/models/search-output.d.ts +1 -1
- package/find/models/search-output.js +1 -1
- package/find/models/search-result-status.d.ts +1 -1
- package/find/models/search-result-status.js +1 -1
- package/find/models/search-session-log-object.d.ts +1 -1
- package/find/models/search-session-log-object.js +1 -1
- package/find/models/search-status/cv-search-status.d.ts +1 -1
- package/find/models/search-status/cv-search-status.js +1 -1
- package/find/models/search-status/search-filter-status.d.ts +1 -1
- package/find/models/search-status/search-filter-status.js +1 -1
- package/find/models/search-status/search-status.d.ts +1 -1
- package/find/models/search-status/search-status.js +1 -1
- package/find/models/search-status/tag-search-status.d.ts +1 -1
- package/find/models/search-status/tag-search-status.js +1 -1
- package/find/models/search-status/text-search-status.d.ts +1 -1
- package/find/models/search-status/text-search-status.js +1 -1
- package/find/models/search-tag.d.ts +1 -1
- package/find/models/search-tag.js +1 -1
- package/find/models/smart-filter.d.ts +1 -1
- package/find/models/smart-filter.js +1 -1
- package/find/models/tagable/i18n-tagable.d.ts +1 -1
- package/find/models/tagable/i18n-tagable.js +1 -1
- package/find/models/tagable/tagable-base.d.ts +1 -1
- package/find/models/tagable/tagable-base.js +1 -1
- package/find/models/tagable/tagable.d.ts +1 -1
- package/find/models/tagable/tagable.js +1 -1
- package/find/models/text-search-config.d.ts +1 -1
- package/find/models/text-search-config.js +1 -1
- package/find/models/text-search-manipulator.d.ts +1 -1
- package/find/models/text-search-manipulator.js +1 -1
- package/find/models/text-search-result-item/text-search-error.d.ts +1 -1
- package/find/models/text-search-result-item/text-search-error.js +1 -1
- package/find/models/text-search-result-item/text-search-result-item-document.d.ts +1 -1
- package/find/models/text-search-result-item/text-search-result-item-document.js +1 -1
- package/find/models/text-search-result-item/text-search-result-item-part.d.ts +1 -1
- package/find/models/text-search-result-item/text-search-result-item-part.js +1 -1
- package/find/models/text-search-result-item/text-search-result-item-recent-query.d.ts +1 -1
- package/find/models/text-search-result-item/text-search-result-item-recent-query.js +1 -1
- package/find/models/text-search-result-item/text-search-result-item-unknown.d.ts +1 -1
- package/find/models/text-search-result-item/text-search-result-item-unknown.js +1 -1
- package/find/models/text-search-result-item/text-search-result-item.d.ts +1 -1
- package/find/models/text-search-result-item/text-search-result-item.js +1 -1
- package/find/services/asset.service.d.ts +1 -1
- package/find/services/asset.service.js +1 -1
- package/find/services/filter-uploaders/filter-uploader.d.ts +1 -1
- package/find/services/filter-uploaders/filter-uploader.js +1 -1
- package/find/services/filter-uploaders/update-filters-uploader.d.ts +1 -1
- package/find/services/filter-uploaders/update-filters-uploader.js +1 -1
- package/find/services/filter-uploaders/update-filters.model.d.ts +1 -1
- package/find/services/filter-uploaders/update-filters.model.js +1 -1
- package/find/services/search/cv-search.service.d.ts +1 -1
- package/find/services/search/cv-search.service.js +1 -1
- package/find/services/search/recent-text-search-queries.service.d.ts +1 -1
- package/find/services/search/recent-text-search-queries.service.js +1 -1
- package/find/services/search/search-result.service.d.ts +1 -1
- package/find/services/search/search-result.service.js +1 -1
- package/find/services/search/search.service.d.ts +1 -1
- package/find/services/search/search.service.js +1 -1
- package/find/services/search/tag-search.service.d.ts +1 -1
- package/find/services/search/tag-search.service.js +1 -1
- package/find/services/search/text-search.service.d.ts +1 -1
- package/find/services/search/text-search.service.js +1 -1
- package/find/services/search-filter.service.d.ts +1 -1
- package/find/services/search-filter.service.js +1 -1
- package/find/utils/search-helper.d.ts +1 -1
- package/find/utils/search-helper.js +1 -1
- package/gen/sdk-version.d.ts +2 -2
- package/gen/sdk-version.js +2 -2
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/management/index.d.ts +1 -1
- package/management/index.js +1 -1
- package/management/models/api-key-list-response.d.ts +1 -1
- package/management/models/api-key-list-response.js +1 -1
- package/management/models/api-key-type.d.ts +1 -1
- package/management/models/api-key-type.js +1 -1
- package/management/models/api-key.d.ts +1 -1
- package/management/models/api-key.js +1 -1
- package/management/services/api-key.service.d.ts +1 -1
- package/management/services/api-key.service.js +1 -1
- package/ocr/index.d.ts +1 -1
- package/ocr/index.js +1 -1
- package/ocr/models/detect-response.d.ts +1 -1
- package/ocr/models/detect-response.js +1 -1
- package/ocr/models/detected-text-entry.d.ts +1 -1
- package/ocr/models/detected-text-entry.js +1 -1
- package/ocr/services/ocr.service.d.ts +1 -1
- package/ocr/services/ocr.service.js +1 -1
- package/package.json +1 -1
- package/user-data/index.d.ts +1 -1
- package/user-data/index.js +1 -1
- package/user-data/models/part-with-nullable.d.ts +1 -1
- package/user-data/models/part-with-nullable.js +1 -1
- package/user-data/models/request-list/request-list.d.ts +1 -1
- package/user-data/models/request-list/request-list.js +1 -1
- package/user-data/services/favorite/favorite.service.d.ts +1 -1
- package/user-data/services/favorite/favorite.service.js +1 -1
- package/user-data/services/request-list/request-list.service.d.ts +1 -1
- package/user-data/services/request-list/request-list.service.js +1 -1
package/core/models/error.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
"use strict";var SDK_ERROR_CODES;Object.defineProperty(exports,"__esModule",{value:!0}),exports.SdkError=exports.SDK_ERROR_CODES=void 0,function(E){E.NO_INTERNET="NO_INTERNET",E.COULD_NOT_REACH_SERVER="COULD_NOT_REACH_SERVER",E.UNKNOWN_HOST_ERROR="UNKNOWN_HOST_ERROR",E.BAD_REQUEST="BAD_REQUEST",E.FORBIDDEN="FORBIDDEN",E.NOT_FOUND="NOT_FOUND",E.UNPROCESSABLE_ENTITY="UNPROCESSABLE_ENTITY",E.INTERNAL_SERVER_ERROR="INTERNAL_SERVER_ERROR",E.NOT_IMPLEMENTED="NOT_IMPLEMENTED",E.BAD_GATEWAY="BAD_GATEWAY",E.SERVICE_UNAVAILABLE="SERVICE_UNAVAILABLE",E.GATEWAY_TIMEOUT="GATEWAY_TIMEOUT",E.INVALID_AUTH_CONFIG="INVALID_AUTH_CONFIG",E.USER_UNAUTHORIZED="USER_UNAUTHORIZED",E.INVALID_API_KEY_FORMAT="INVALID_API_KEY_FORMAT",E.API_KEY_MISSING="API_KEY_MISSING",E.WRONG_AUTH_TYPE="wrongAuthType",E.NO_AUTHENTICATION_CONFIG_FOUND="NO_AUTHENTICATION_CONFIG_FOUND",E.INVALID_AUTHENTICATION="INVALID_AUTHENTICATION",E.VALIDATION_ERROR="VALIDATION_ERROR",E.INVALID_LOGIN_CONFIG="INVALID_LOGIN_CONFIG",E.UNKNOWN_ERROR="UNKNOWN_ERROR",E.NO_SEARCH_SESSION_ACTIVE="NO_SEARCH_SESSION_ACTIVE",E.RESULT_UNDEFINED="RESULT_UNDEFINED",E.INVALID_SEARCH_MODALITY_CONFIG="INVALID_SEARCH_MODALITY_CONFIG",E.INVALID_MULTIPLE_IMAGE_SEARCHES="INVALID_MULTIPLE_IMAGE_SEARCHES",E.INVALID_SEARCH_LANGUAGE="INVALID_SEARCH_LANGUAGE",E.GENERAL_SEARCH_ERROR="GENERAL_SEARCH_ERROR",E.INVALID_ASSET_STATUS="INVALID_ASSET_STATUS",E.FILE_NOT_FOUND="FILE_NOT_FOUND",E.CAPTURE_IMAGE_FAILED="CAPTURE_IMAGE_FAILED",E.LOADING_FROM_GALLERY_FAILED="LOADING_FROM_GALLERY_FAILED",E.IMAGE_SEARCH_ERROR="IMAGE_SEARCH_ERROR",E.PICK_IMAGE_ABORTED_BY_USER="PICK_IMAGE_ABORTED_BY_USER",E.SEARCH_RESULT_TIMEOUT="SEARCH_RESULT_TIMEOUT",E.TIMEOUT_ERROR="TIMEOUT_ERROR",E.INTEGRATION_ERROR="INTEGRATION_ERROR",E.INITIAL_ITEMS_NOT_YET_LOADED="INITIAL_ITEMS_NOT_YET_LOADED",E.NO_MORE_ITEMS_AVAILABLE="NO_MORE_ITEMS_AVAILABLE",E.NO_PAGINATION_CURSOR_AVAILABLE="NO_PAGINATION_CURSOR_AVAILABLE",E.UNEXPECTED_API_VERSION="UNEXPECTED_API_VERSION",E.UNEXPECTED_SEARCH_VERSION="UNEXPECTED_SEARCH_VERSION",E.SSO_USER_CERT="SSO_USER_CERT",E.SSO_TOKEN_REFRESH="SSO_TOKEN_REFRESH",E.TOKEN_EXPIRED="TOKEN_EXPIRED",E.INVALID_TOKEN="INVALID_TOKEN",E.REFRESH_TOKEN_EXPIRED="REFRESH_TOKEN_EXPIRED",E.OAUTH_ERROR="OAUTH_ERROR",E.LOGIN_CANCELLED="LOGIN_CANCELLED",E.LOGIN_ALREADY_IN_PROGRESS="LOGIN_ALREADY_IN_PROGRESS",E.MISSING_STORAGE_ACCESS_PERMISSION="MISSING_STORAGE_ACCESS_PERMISSION",E.SDK_OUTDATED="SDK_OUTDATED",E.BACKEND_DOWN="BACKEND_DOWN",E.STATUS_BACKEND_DOWN="STATUS_BACKEND_DOWN",E.INVALID_FILE_TYPE="INVALID_FILE_TYPE",E.INVALID_CROP_AREA="INVALID_CROP_AREA",E.ORGANIZATION_NOT_FOUND="ORGANIZATION_NOT_FOUND",E.NO_UPIS_FOUND="NO_UPIS_FOUND"}(SDK_ERROR_CODES||(exports.SDK_ERROR_CODES=SDK_ERROR_CODES={}));var SdkError=function(){function E(E,_,I){this.errorString="".concat(E," - ");try{this.errorString+=I||JSON.stringify(_)}catch(E){_.toString&&(this.errorString+=_.toString())}this.code=E,this.detail=_}return E.prototype.toString=function(){return this.errorString},E}();exports.SdkError=SdkError;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.FormattedString=void 0;var FormattedString=function(){};exports.FormattedString=FormattedString;
|
package/core/models/i18n-map.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.i18nMap=void 0;var i18nMap=function(){function t(t){var a=this;this.fallbackLanguage="en",this.map=new Map,t&&Object.keys(t).forEach((function(e){a.map.set(e,t[e])}))}return t.prototype.hasLanguage=function(t){return this.map.has(t)},t.prototype.getAvailableLanguages=function(){return Array.from(this.map.keys())},t.prototype.getValue=function(t){return this.map.has(t)?this.map.get(t):this.map.has(this.fallbackLanguage)?this.map.get(this.fallbackLanguage):this.map.values().next().value},t.prototype.getMap=function(){return this.map},t.prototype.getAsObject=function(){var t={};return this.map.forEach((function(a,e){return t[e]=a})),t},t}();exports.i18nMap=i18nMap;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
"use strict";var __extends=this&&this.__extends||function(){var t=function(n,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])},t(n,r)};return function(n,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function e(){this.constructor=n}t(n,r),n.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.i18nString=void 0;var i18n_map_1=require("./i18n-map"),i18nString=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return __extends(n,t),n.prototype.getText=function(t){return this.getValue(t)},n}(i18n_map_1.i18nMap);exports.i18nString=i18nString;
|
package/core/models/log.d.ts
CHANGED
package/core/models/log.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
"use strict";var EVENT,INTERFACE,PARTIUM_CONTEXT,OCR_CONTEXT,ECR_TYPE,EVENTLOG_VERSIONS,PART_RELEVANCY_LOG_TYPES,__assign=this&&this.__assign||function(){return __assign=Object.assign||function(_){for(var e,E=1,t=arguments.length;E<t;E++)for(var T in e=arguments[E])Object.prototype.hasOwnProperty.call(e,T)&&(_[T]=e[T]);return _},__assign.apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.eventLogRequestResponseAdapter=exports.EventLog=exports.PART_RELEVANCY_LOG_TYPES=exports.EVENTLOG_VERSIONS=exports.ECR_TYPE=exports.OCR_CONTEXT=exports.PARTIUM_CONTEXT=exports.INTERFACE=exports.EVENT=void 0,function(_){_.PART_COPY_ID="part_copy_id",_.PART_CONFIRMED_SEARCH="part_confirmed_search",_.PART_RELEVANCY_TO_SEARCH="part_relevancy_to_search",_.DEVICE_INFO="device_info",_.PART_DETAIL_ENTER="part_detail_enter",_.PART_DETAIL_LEAVE="part_detail_leave",_.PART_DETAIL_SET_RELATION="parts_detail_set_relation",_.PART_THUMBSUP="part_thumbsup",_.PART_THUMBSDOWN="part_thumbsdown",_.REQUEST_LIST_ADD_PART="request_list_add_part",_.REQUEST_LIST_DEL_PART="request_list_del_part",_.REQUEST_LIST_RESET_PARTS="request_list_reset_parts",_.REQUEST_LIST_SEND="request_list_send",_.REQUEST_LIST_UPDATE="request_list_update",_.REQUEST_LIST_ADD_PART_EXISTING="request_list_add_part_existing",_.ATTEMPT_UPLOAD_IMAGE_DIMENSIONS="attempt_upload_image_dimensions",_.CSA_FORM_ENTER_FROM_RESULTS="csa_form_enter_from_results",_.CSA_FORM_ENTER_FROM_PART_DETAILS="csa_form_enter_from_part_details",_.CSA_REQUEST_SEND="csa_request_send",_.CSA_CALL_EXPERT="csa_call_expert",_.CSA_EXPERT_CONFIRMS_PART="csa_expert_confirms_part",_.CSA_EXPERT_MARK_NOT_RESOLVED="csa_expert_marks_not_resolved",_.RECENT_SEARCH_QUERY_CLICKED="recent_search_query_clicked",_.SEARCH_TAG_USED="search_tag_used",_.REQUEST_LIST_EXPORTED="request_list_exported",_.CSA_EXPERT_OPENS_REQUEST="csa_expert_opens_request",_.LANGUAGE_CHANGE="language_change",_.USER_SESSION_INFO="user_session_info",_.CONFIRMED_ID_MATCHES_PART_TO_CONFIRM="confirmed_id_matches_part_to_confirm",_.SHOPPING_CART_EXPORTED="shopping_cart_exported",_.SHOPPING_CART_UPDATE="shopping_cart_update",_.SHOPPING_CART_REMOVE_ALL_PARTS="shopping_cart_remove_all_parts",_.SHOPPING_CART_REMOVE_PART="shopping_cart_remove_part",_.SHOPPING_CART_ADD_PART="shopping_cart_add_part",_.SHOPPING_CART_REQUEST_OFFER="shopping_cart_request_offer",_.FAVORITES_REMOVE="favorites_remove_part",_.FAVORITES_ADD="favorites_add_part",_.ECR_DETAILS_ENTER="ecr_details_enter",_.ECR_LIST="ecr_list",_.ECR_CALL="ecr_call",_.ECR_FORM_SUBMIT="ecr_form_submit",_.ECR_FORM_ENTER="ecr_form_enter",_.SEARCH_INPUT_CODE_SCANNING="search_input_code_scanning",_.SEARCH_INPUT_BOM_FILTER="search_input_bom_filter",_.SEARCH_INPUT_ATTRIBUTE_FILTERS="search_input_attribute_filters",_.SEARCH_INPUT_SEMANTIC_TAGS="search_input_semantic_tags",_.SEARCH_INPUT_SMART_FILTER_APPLIED="search_input_smart_filter_applied",_.SEARCH_RESULTS_STS="search_results_sts",_.SEARCH_RESULTS_VM="search_results_vm",_.SEARCH_RESULTS_HVT="search_results_hvt",_.SEARCH_RESULTS_SMMS_FLOW="search_results_smms_flow",_.SEARCH_RESULTS_FUSION="search_results_fusion",_.SEARCH_SESSION_CREATE="search_session_create",_.SEARCH_ASSISTANCE_OCR="search_assistance_ocr",_.INQUIRY_EXPORTED="inquiry_exported",_.EXPERT_OPENS_INQUIRY="expert_opens_inquiry",_.CSA_EXPERT_STARTS_EXPERT_SEARCH="csa_expert_starts_expert_search",_.CSA_INVITES_EXPERT="csa_invites_expert"}(EVENT||(exports.EVENT=EVENT={})),function(_){_.FIND_APP="find_app",_.API_ACCESS="api_access",_.AGENT_PORTAL_APP="agent_portal_app",_.ANALYTICS_APP="analytics_app",_.DATA_CLEANSING_APP="data_cleansing_app",_.DATA_ENRICHMENT_APP="data_enrichment_app",_.GLOBAL_APP="global_app"}(INTERFACE||(exports.INTERFACE=INTERFACE={})),function(_){_.SEARCH="search",_.RECENTLY_VIEWED_PARTS="recently_viewed_parts",_.FAVORITES="favorites",_.ECR="ecr",_.SHOPPING_CART="shopping_cart",_.DATA_CLEANSING="data_cleansing",_.ANALYTICS="analytics",_.DATA_INSIGHTS="data_insights",_.DATA_ENRICHMENT="data_enrichment"}(PARTIUM_CONTEXT||(exports.PARTIUM_CONTEXT=PARTIUM_CONTEXT={})),function(_){_.TEXT_SEARCH="text_search",_.BOM_FILTER="bom_filter"}(OCR_CONTEXT||(exports.OCR_CONTEXT=OCR_CONTEXT={})),function(_){_.ASK_FOR_HELP="ask_for_help",_.ASK_FOR_CONFIRMATION="ask_for_confirmation"}(ECR_TYPE||(exports.ECR_TYPE=ECR_TYPE={})),function(_){_.V_1_0_0="1.0.0",_.V_2_0_0="2.0.0"}(EVENTLOG_VERSIONS||(exports.EVENTLOG_VERSIONS=EVENTLOG_VERSIONS={})),function(_){_.MATCHES_SEARCH_EXACTLY="matches_search_exactly",_.BEST_MATCH="best_match",_.NOT_MATCH_BUT_RELATED="not_match_but_related",_.NEEDS_CHECK_ELSEWHERE="needs_check_elsewhere",_.NOT_RELEVANT="not_relevant",_.OTHER="other"}(PART_RELEVANCY_LOG_TYPES||(exports.PART_RELEVANCY_LOG_TYPES=PART_RELEVANCY_LOG_TYPES={}));var EventLog=function(_){Object.assign(this,_)};exports.EventLog=EventLog;var eventLogRequestResponseAdapter=function(_){return function(e){return new EventLog(__assign(__assign({},_),{id:e.event_id,timestamp:new Date(e.timestamp)}))}};exports.eventLogRequestResponseAdapter=eventLogRequestResponseAdapter;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
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,s,d,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===(s=a.config)||void 0===s?void 0:s.smmsLanguages)||[]).map((function(a){return a.toLowerCase()})),ecr:{email:null===(g=null===(d=a.config)||void 0===d?void 0:d.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,s;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===(s=a.featureFlags)||void 0===s?void 0:s.catalogOptimizationEnabled}},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;
|
package/core/models/p-file.d.ts
CHANGED
package/core/models/p-file.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
"use strict";var PFileType;Object.defineProperty(exports,"__esModule",{value:!0}),exports.PFile=exports.PFileType=void 0,function(e){e[e.IMAGE=0]="IMAGE",e[e.TEXT=1]="TEXT",e[e.UNKNOWN=2]="UNKNOWN"}(PFileType||(exports.PFileType=PFileType={}));var PFile=function(){};exports.PFile=PFile;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PaginatedList=void 0;var lodash_1=require("lodash"),PaginatedList=function(){function t(t,e,i,s,a,n,r){this.items=t,this.currentPageIdx=e,this.totalPages=i,this.itemsPerPage=s,this.previousPage=n,this.nextPage=a,this.cursorPaginationEnabled=r}return t.prototype.moreResultsAvailable=function(){return this.currentPageIdx<this.totalPages||!!this.nextPage&&this.cursorPaginationEnabled},t.prototype.append=function(t){this.items=this.items.concat(t.items),this.currentPageIdx=t.currentPageIdx,this.totalPages=t.totalPages,this.itemsPerPage=t.itemsPerPage,this.cursorPaginationEnabled=t.cursorPaginationEnabled,this.nextPage=t.nextPage,this.previousPage=t.previousPage},t.prototype.clone=function(){return(0,lodash_1.cloneDeep)(this)},t.EMPTY=new t([],0,0,0),t}();exports.PaginatedList=PaginatedList;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
import { HttpsClientService } from '../services/http/https-client/https-client.service.interface';
|
|
3
3
|
import { AuthenticationConfig } from './auth-config';
|
|
4
4
|
import { BaseServiceClass } from '../services/base.service';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PartiumConfig=exports.AUTHENTICATION_METHOD=void 0;var AUTHENTICATION_METHOD,auth_config_1=require("./auth-config"),fetch_api_https_client_service_1=require("../integration-defaults/http/https-client/fetch-api-https-client.service"),fetch_api_file_transfer_service_1=require("../integration-defaults/http/file-transfer/fetch-api-file-transfer.service"),web_local_storage_service_1=require("../integration-defaults/web-local-storage.service"),web_device_status_service_1=require("../integration-defaults/web-device-status.service"),web_file_service_1=require("../integration-defaults/web-file.service");!function(e){e[e.OAUTH=0]="OAUTH",e[e.OAUTH_API_KEY=1]="OAUTH_API_KEY"}(AUTHENTICATION_METHOD||(exports.AUTHENTICATION_METHOD=AUTHENTICATION_METHOD={}));var PartiumConfig=function(e){this.partiumApiBaseUrl="https://api.partium.io",this.partiumLoginUrl="https://login.partium.io",this.authenticationMethod=AUTHENTICATION_METHOD.OAUTH_API_KEY,this.recentPartsMaxPartHistoryLength=30,this.favoritePartsMaxPartLength=50,this.httpsClientService=fetch_api_https_client_service_1.FetchAPIHttpsClientService,this.fileTransferService=fetch_api_file_transfer_service_1.FetchAPIFileTransferService,this.localStorageService=web_local_storage_service_1.WebLocalStorageService,this.deviceStatusService=web_device_status_service_1.WebDeviceStatusService,this.fileService=web_file_service_1.WebFileService,Object.assign(this,e),this.authenticationMethod===AUTHENTICATION_METHOD.OAUTH&&(this.authenticationConfig||(this.authenticationConfig=new auth_config_1.OauthAuthenticationConfig))};exports.PartiumConfig=PartiumConfig;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createUserToken=createUserToken;var jwt_decode_1=require("jwt-decode");function createUserToken(e){return(0,jwt_decode_1.jwtDecode)(e)}
|
package/core/models/user.d.ts
CHANGED
package/core/models/user.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
"use strict";var Role;Object.defineProperty(exports,"__esModule",{value:!0}),exports.User=exports.Role=void 0,function(e){e.admin="admin",e.announcementsEditor="announcementsEditor",e.partiumAnnouncementsEditor="partiumAnnouncementsEditor",e.user="user",e.analyst="dataAnalyst",e.dataInsightAnalyst="dataInsightAnalyst",e.csa="csa",e.factoryWorker="factoryWorker",e.developer="developer",e.catalogAdmin="catalogAdmin",e.dataManipulator="dataManipulator",e.dataContributor="dataContributor",e.dataValidator="dataValidator",e.enrichmentRequester="enrichmentRequester"}(Role||(exports.Role=Role={}));var User=function(){function e(e,t,r,n){void 0===n&&(n=[]),this.email=e,this.role=t,this.roles=r||new Set([t]),this.groups=n}return e.createFromToken=function(t){var r=t.email||t.preferred_username,n=this.createRoles(t),o=t.groups||[];return new e(r,n.values().next().value,n,o)},e.createRoles=function(e){if(e.role)return new Set([e.role]);if(e.groups){for(var t=new Set,r=0,n=e.groups;r<n.length;r++){var o=n[r],a=this.getRoleFromGroup(o);t.add(a)}return t}return new Set},e.getRoleFromGroup=function(e){var t=this.checkPartiumRoles(e),r=e.slice(e.lastIndexOf("/")+1);return this.getRoleByString(r,t)},e.checkPartiumRoles=function(e){var t=e.split("/"),r="partium"===t[t.length-2],n=t[t.length-1],o=Object.values(Role);return r&&!!o.find((function(e){return e===n}))},e.getRoleByString=function(e,t){if(Object.values(Role).includes(e)){var r=e;return r===Role.announcementsEditor&&t?Role.partiumAnnouncementsEditor:r}return Role.factoryWorker},e}();exports.User=User;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
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 i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),__decorate=this&&this.__decorate||function(t,e,r,i){var o,n=arguments.length,c=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(c=(n<3?o(c):n>3?o(e,r,c):o(e,r))||c);return n>3&&c&&Object.defineProperty(e,r,c),c};Object.defineProperty(exports,"__esModule",{value:!0}),exports.BackendStatusService=void 0;var base_service_1=require("./base.service"),rxjs_1=require("rxjs"),error_1=require("../models/error"),operators_1=require("rxjs/operators"),https_client_service_interface_1=require("./http/https-client/https-client.service.interface"),injection_identifier_1=require("../decorators/injection-identifier"),device_status_service_interface_1=require("./device-status.service.interface"),BackendStatusService=function(t){function e(e){return t.call(this,e)||this}return __extends(e,t),e.prototype.onCreate=function(){this.httpsClientService=this.serviceProvider.getService(https_client_service_interface_1.HttpsClientService),this.deviceStatusService=this.serviceProvider.getService(device_status_service_interface_1.DeviceStatusService)},e.prototype.init=function(t,e,r,i,o){void 0===i&&(i="https://example.com"),void 0===o&&(o=3e3),this.appVersion=t,this.language=e,this.statusEndpoint=r,this.connectivityCheckFallback=i,this.timeout=o},e.prototype.checkCompatibility=function(){var t=this;return this.validateConfiguration(),this.httpsClientService.get("".concat(this.statusEndpoint,"/compatibility?appVersion=").concat(this.appVersion,"&appName=js-partium-sdk")).pipe((0,operators_1.timeout)(this.timeout),(0,operators_1.mergeMap)((function(t){return t.requiresUpdate?(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.SDK_OUTDATED,t.appDownloadLink)):(0,rxjs_1.of)(!0)})),(0,operators_1.catchError)((function(e){return t.checkAvailability().pipe((0,operators_1.map)((function(t){throw e})))})))},e.prototype.checkAvailability=function(){var t=this;return this.validateConfiguration(),(0,rxjs_1.from)(this.deviceStatusService.isConnectionAvailable()).pipe((0,operators_1.mergeMap)((function(e){if(!e)throw new error_1.SdkError(error_1.SDK_ERROR_CODES.NO_INTERNET,null);return t.httpsClientService.get("".concat(t.statusEndpoint,"/status?language=").concat(t.language)).pipe((0,operators_1.timeout)(t.timeout),(0,operators_1.mergeMap)((function(t){if(t.isUp)return(0,rxjs_1.of)(!0);throw new error_1.SdkError(error_1.SDK_ERROR_CODES.BACKEND_DOWN,t.message)})),(0,operators_1.catchError)((function(e){return e instanceof error_1.SdkError&&e.code===error_1.SDK_ERROR_CODES.BACKEND_DOWN?(0,rxjs_1.throwError)(e):t.httpsClientService.get(t.connectivityCheckFallback).pipe((0,operators_1.timeout)(t.timeout),(0,operators_1.map)((function(){throw new error_1.SdkError(error_1.SDK_ERROR_CODES.STATUS_BACKEND_DOWN,{})})),(0,operators_1.catchError)((function(t){return t instanceof error_1.SdkError&&(t.code===error_1.SDK_ERROR_CODES.BACKEND_DOWN||t.code===error_1.SDK_ERROR_CODES.STATUS_BACKEND_DOWN)?(0,rxjs_1.throwError)(t):(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.NO_INTERNET,t))})))})))})))},e.prototype.validateConfiguration=function(){if(!this.appVersion)throw new Error("Invalid configuration: appVersion is ".concat(this.appVersion));if(!this.language)throw new Error("Invalid configuration: language is ".concat(this.language));if(!this.statusEndpoint)throw new Error("Invalid configuration: statusEndpoint is ".concat(this.statusEndpoint));if(!this.connectivityCheckFallback)throw new Error("Invalid configuration: statusEndpoint is ".concat(this.connectivityCheckFallback));if("number"!=typeof this.timeout)throw new Error("Invalid configuration: timeout is ".concat(this.timeout," of type ").concat(typeof this.timeout))},e=__decorate([(0,injection_identifier_1.InjectionIdentifier)("BackendStatusService")],e)}(base_service_1.BaseService);exports.BackendStatusService=BackendStatusService;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
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 n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.BaseLoginInitService=void 0;var rxjs_1=require("rxjs"),base_service_1=require("./base.service"),BaseLoginInitService=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.init=function(e,t,r){return this.config=e,this.userEmail=t,this.currentOrganization$=r,(0,rxjs_1.of)(void 0)},t}(base_service_1.BaseService);exports.BaseLoginInitService=BaseLoginInitService;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
import { ServiceProvider } from "./service-provider";
|
|
3
3
|
export declare type BaseServiceClass<S extends BaseService> = {
|
|
4
4
|
new (ServiceProvider: any, ...initArgs: any[]): S;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BaseService=void 0;var BaseService=function(){function e(e){this.serviceProvider=e}return e.prototype.onCreate=function(){},e.getInjectionIdentifierName=function(){throw new Error("Class can not be used for Service-Injection. Add InjectionIdentifier-decorator if you want to do so.")},e}();exports.BaseService=BaseService;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
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 n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),__decorate=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,c=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(c=(i<3?o(c):i>3?o(t,r,c):o(t,r))||c);return i>3&&c&&Object.defineProperty(t,r,c),c},__awaiter=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function c(e){try{s(n.next(e))}catch(e){i(e)}}function a(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(c,a)}s((n=n.apply(e,t||[])).next())}))},__generator=this&&this.__generator||function(e,t){var r,n,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(c=0)),c;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,n=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){c.label=a[1];break}if(6===a[0]&&c.label<o[1]){c.label=o[1],o=a;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(a);break}o[2]&&c.ops.pop(),c.trys.pop();continue}a=t.call(e,c)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.DeviceStatusService=void 0;var base_service_1=require("./base.service"),injection_identifier_1=require("../decorators/injection-identifier"),DeviceStatusService=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.isConnectionAvailable=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){throw new Error("In order to use the DeviceStatusService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")}))}))},t.prototype.getDeviceInfo=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){throw new Error("In order to use the DeviceStatusService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")}))}))},t=__decorate([(0,injection_identifier_1.InjectionIdentifier)("DeviceStatusService")],t)}(base_service_1.BaseService);exports.DeviceStatusService=DeviceStatusService;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
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.FileService=void 0;var base_service_1=require("./base.service"),injection_identifier_1=require("../decorators/injection-identifier"),FileService=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.getFileType=function(e){throw new Error("In order to use the FileService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.getImageDimensions=function(e){throw new Error("In order to use the FileService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t=__decorate([(0,injection_identifier_1.InjectionIdentifier)("FileService")],t)}(base_service_1.BaseService);exports.FileService=FileService;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
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 n(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),__decorate=this&&this.__decorate||function(e,r,t,n){var o,i=arguments.length,s=i<3?r:null===n?n=Object.getOwnPropertyDescriptor(r,t):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,r,t,n);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(s=(i<3?o(s):i>3?o(r,t,s):o(r,t))||s);return i>3&&s&&Object.defineProperty(r,t,s),s},__spreadArray=this&&this.__spreadArray||function(e,r,t){if(t||2===arguments.length)for(var n,o=0,i=r.length;o<i;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return e.concat(n||Array.prototype.slice.call(r))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.FileTransferService=exports.TRANSFER_STATUS=void 0;var TRANSFER_STATUS,base_service_1=require("../../base.service"),injection_identifier_1=require("../../../decorators/injection-identifier");!function(e){e[e.TRANSFERRING=0]="TRANSFERRING",e[e.TRANSFER_FINISHED=1]="TRANSFER_FINISHED"}(TRANSFER_STATUS||(exports.TRANSFER_STATUS=TRANSFER_STATUS={}));var FileTransferService=function(e){function r(r,t){var n=e.call(this,r)||this;return n.allowedDomains=__spreadArray(__spreadArray(["cloudfront.net","amazonaws.com","windows.net"],t.map((function(e){try{return new URL(e).host}catch(r){return e}})),!0),["FILE_URL","ASSET_URL"],!1).map((function(e){return e.toLowerCase().split(".")})),n}return __extends(r,e),r.prototype.validateIsKnownUrlOrCry=function(e){var r=e.toLowerCase();try{r=new URL(e).host}catch(e){}for(var t=0,n=this.allowedDomains;t<n.length;t++){var o=n[t],i=__spreadArray([],o,!0);do{if(r.endsWith(i.join(".")))return;i.shift()}while(i.length>2)}throw new Error("Trying to transfer files to/from unknown endpoint ".concat(e))},r.prototype.uploadFile=function(e,r){throw new Error("In order to use the FileTransferService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},r.prototype.downloadFile=function(e){throw new Error("In order to use the FileTransferService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},r=__decorate([(0,injection_identifier_1.InjectionIdentifier)("FileTransferService")],r)}(base_service_1.BaseService);exports.FileTransferService=FileTransferService;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
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 n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),__decorate=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(exports,"__esModule",{value:!0}),exports.HttpsClientService=void 0;var injection_identifier_1=require("../../../decorators/injection-identifier"),general_helper_1=require("../../../utils/general-helper"),base_service_1=require("../../base.service"),HttpsClientService=function(e){function t(t,r){var n=e.call(this,t)||this;return n.knownBaseUrls=r.map((function(e){return e.toLowerCase()})),n}return __extends(t,e),t.prototype.validateIsKnownUrlOrCry=function(e){for(var t=e.toLowerCase(),r=0,n=this.knownBaseUrls;r<n.length;r++){var o=n[r];if(t.startsWith(o))return}throw new Error('The given URL is not a known service "'.concat(e,'".'))},t.prototype.get=function(e,t,r,n){throw new Error("In order to use the get HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.post=function(e,t,r,n,o){throw new Error("In order to use the post HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.put=function(e,t,r,n,o){throw new Error("In order to use the put HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.patch=function(e,t,r,n,o){throw new Error("In order to use the patch HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.delete=function(e,t,r,n,o){throw new Error("In order to use the delete HttpsClientService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.addUrlParameters=function(e,t){return(0,general_helper_1.addUrlParameters)(e,t)},t.prototype.addUrlParameter=function(e,t){return(0,general_helper_1.addUrlParameter)(e,t)},t=__decorate([(0,injection_identifier_1.InjectionIdentifier)("HttpsClientService")],t)}(base_service_1.BaseService);exports.HttpsClientService=HttpsClientService;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
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 n(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),__decorate=this&&this.__decorate||function(e,r,t,n){var o,s=arguments.length,i=s<3?r:null===n?n=Object.getOwnPropertyDescriptor(r,t):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,r,t,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(r,t,i):o(r,t))||i);return s>3&&i&&Object.defineProperty(r,t,i),i};Object.defineProperty(exports,"__esModule",{value:!0}),exports.HttpsService=exports.BACKEND_SERVICE=void 0;var BACKEND_SERVICE,base_service_1=require("../base.service"),rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),https_client_service_interface_1=require("./https-client/https-client.service.interface"),injection_identifier_1=require("../../decorators/injection-identifier");!function(e){e[e.PARTIUM=0]="PARTIUM",e[e.FIND=1]="FIND",e[e.DATA=2]="DATA",e[e.CSA=3]="CSA",e[e.LOG=4]="LOG",e[e.USER_DATA=5]="USER_DATA",e[e.OCR=6]="OCR",e[e.MANAGEMENT=7]="MANAGEMENT",e[e.CATALOG=8]="CATALOG",e[e.DATACURATION=9]="DATACURATION",e[e.DATA_V2=10]="DATA_V2",e[e.DATA_ENRICHMENT=11]="DATA_ENRICHMENT"}(BACKEND_SERVICE||(exports.BACKEND_SERVICE=BACKEND_SERVICE={}));var HttpsService=function(e){function r(r){return e.call(this,r)||this}return __extends(r,e),r.prototype.onCreate=function(){this.httpsClientService=this.serviceProvider.getService(https_client_service_interface_1.HttpsClientService)},r.prototype.init=function(e,r){return this.baseUrls=e,this.config=r,(0,rxjs_1.of)(void 0)},r.prototype.get=function(e,r,t){var n=this;return(0,rxjs_1.defer)((function(){return n.configureHeaders({},t)})).pipe((0,operators_1.mergeMap)((function(o){return n.httpsClientService.get(n.createUrl(e,t),r,o)})),(0,operators_1.retryWhen)((function(e){return n.retryWhen(e)})),(0,operators_1.catchError)((function(e){return n.processError(e)})))},r.prototype.post=function(e,r,t,n,o){var s=this;return(0,rxjs_1.defer)((function(){return s.configureHeaders(o,n)})).pipe((0,operators_1.mergeMap)((function(o){return s.httpsClientService.post(s.createUrl(e,n),r,t,o)})),(0,operators_1.retryWhen)((function(e){return s.retryWhen(e)})),(0,operators_1.catchError)((function(e){return s.processError(e)})))},r.prototype.put=function(e,r,t,n,o){var s=this;return(0,rxjs_1.defer)((function(){return s.configureHeaders(o,n)})).pipe((0,operators_1.mergeMap)((function(o){return s.httpsClientService.put(s.createUrl(e,n),r,t,o)})),(0,operators_1.retryWhen)((function(e){return s.retryWhen(e)})),(0,operators_1.catchError)((function(e){return s.processError(e)})))},r.prototype.patch=function(e,r,t,n,o){var s=this;return(0,rxjs_1.defer)((function(){return s.configureHeaders(o,n)})).pipe((0,operators_1.mergeMap)((function(o){return s.httpsClientService.patch(s.createUrl(e,n),r,t,o)})),(0,operators_1.retryWhen)((function(e){return s.retryWhen(e)})),(0,operators_1.catchError)((function(e){return s.processError(e)})))},r.prototype.delete=function(e,r,t,n){var o=this;return(0,rxjs_1.defer)((function(){return o.configureHeaders({},n)})).pipe((0,operators_1.mergeMap)((function(s){return o.httpsClientService.delete(o.createUrl(e,n),r,t,s)})),(0,operators_1.retryWhen)((function(e){return o.retryWhen(e)})),(0,operators_1.catchError)((function(e){return o.processError(e)})))},r.prototype.setCurrentOrganization=function(e){this.currentOrganization$=e},r.prototype.retryWhen=function(e){return e.pipe((0,operators_1.mergeMap)((function(e){return(0,rxjs_1.throwError)(e)})))},r.prototype.processError=function(e){return(0,rxjs_1.throwError)(e)},r.prototype.createHeaders=function(e){throw new Error("In order to use the HttpsService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},r.prototype.createUrl=function(e,r){for(void 0===r&&(r=BACKEND_SERVICE.FIND);e.startsWith("/");)e=e.substring(1);var t;switch(r){case BACKEND_SERVICE.PARTIUM:t=this.baseUrls.partiumApiBaseUrl;break;case BACKEND_SERVICE.DATA:t=this.baseUrls.dataBeBaseUrl;break;case BACKEND_SERVICE.CSA:t=this.baseUrls.csaBeBaseUrl;break;case BACKEND_SERVICE.LOG:t=this.baseUrls.logBeBaseUrl;break;case BACKEND_SERVICE.USER_DATA:t=this.baseUrls.userDataBeBaseUrl;break;case BACKEND_SERVICE.OCR:t=this.baseUrls.ocrBeBaseUrl;break;case BACKEND_SERVICE.MANAGEMENT:t=this.baseUrls.managementBeBaseUrl;break;case BACKEND_SERVICE.CATALOG:t=this.baseUrls.catalogBeBaseUrl;break;case BACKEND_SERVICE.DATACURATION:t=this.baseUrls.datacurationBeBaseUrl;break;case BACKEND_SERVICE.DATA_V2:t=this.baseUrls.dataV2BeBaseUrl;break;case BACKEND_SERVICE.DATA_ENRICHMENT:t=this.baseUrls.dataEnrichmentBeBaseUrl;break;case BACKEND_SERVICE.FIND:default:t=this.baseUrls.findBeBaseUrl}return[t,e].join("/")},r.prototype.configureHeaders=function(e,r){var t=this.createHeaders(e);return this.config.externalUserId&&r!==BACKEND_SERVICE.LOG&&(t["X-Partium-ExternalUserId"]=this.config.externalUserId),this.currentOrganization$?this.currentOrganization$.pipe((0,operators_1.first)(),(0,operators_1.map)((function(e){return(null==e?void 0:e.name)&&(t["X-Partium-Data-Organization"]=e.name),t}))):(0,rxjs_1.of)(t)},r=__decorate([(0,injection_identifier_1.InjectionIdentifier)("HttpsService")],r)}(base_service_1.BaseService);exports.HttpsService=HttpsService;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { OauthAuthenticationConfig } from '../../models/auth-config';
|
|
4
4
|
import { BACKEND_SERVICE, BaseUrls, HttpsService } from './https.service.interface';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
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 o(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.OauthHttpsService=void 0;var rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),https_service_interface_1=require("./https.service.interface"),error_1=require("../../models/error"),oauth_session_service_1=require("../session/oauth-session.service"),session_service_interface_1=require("../session/session.service.interface"),OauthHttpsService=function(e){function r(r){return e.call(this,r)||this}return __extends(r,e),r.prototype.onCreate=function(){e.prototype.onCreate.call(this),this.oauthSessionService=this.serviceProvider.getService(session_service_interface_1.SessionService)},r.prototype.init=function(r,t){return e.prototype.init.call(this,r,t),t.apiKey?this.callOauthLogin():(0,rxjs_1.of)(void 0)},r.prototype.setToken=function(e,r){this.authToken=e,this.authTokenExpiresAt=r},r.prototype.get=function(r,t,o){var i=this;return this.refreshSessionIfNeeded().pipe((0,operators_1.mergeMap)((function(){return e.prototype.get.call(i,r,t,o)})))},r.prototype.post=function(r,t,o,i,n){var s=this;return this.refreshSessionIfNeeded().pipe((0,operators_1.mergeMap)((function(){return e.prototype.post.call(s,r,t,o,i,n)})))},r.prototype.patch=function(r,t,o,i,n){var s=this;return this.refreshSessionIfNeeded().pipe((0,operators_1.mergeMap)((function(){return e.prototype.patch.call(s,r,t,o,i,n)})))},r.prototype.retryWhen=function(e){var r=this;return e.pipe((0,operators_1.mergeMap)((function(e){return e.code===error_1.SDK_ERROR_CODES.TOKEN_EXPIRED?(console.log("HttpsService - Token expired, attempting refresh"),r.refreshOrLogin()):(0,rxjs_1.throwError)(e)})))},r.prototype.createHeaders=function(e){var r={"Content-Type":"application/json"};return this.authToken&&(r.Authorization="Bearer ".concat(this.authToken)),Object.assign(r,e)},r.prototype.callOauthLogin=function(){var e=this.config;return this.oauthSessionService.login(new oauth_session_service_1.OauthLoginConfig({apiKey:e.apiKey}))},r.prototype.refreshSessionIfNeeded=function(){var e=!1;this.authTokenExpiresAt?e=(Date.now()/1e3|0)>this.authTokenExpiresAt.getTime()/1e3-60:e=!0;return e?this.refreshOrLogin():(0,rxjs_1.of)(void 0)},r.prototype.refreshOrLogin=function(){var e=this;return this.oauthSessionService.refresh().pipe((0,operators_1.catchError)((function(r){return r.code===error_1.SDK_ERROR_CODES.REFRESH_TOKEN_EXPIRED||r.code===error_1.SDK_ERROR_CODES.INVALID_TOKEN||r.code===error_1.SDK_ERROR_CODES.BAD_REQUEST||r.code===error_1.SDK_ERROR_CODES.OAUTH_ERROR?e.callOauthLogin().pipe((0,operators_1.catchError)((function(e){return e.code===error_1.SDK_ERROR_CODES.INVALID_LOGIN_CONFIG?(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.REFRESH_TOKEN_EXPIRED,r)):(0,rxjs_1.throwError)(e)}))):(0,rxjs_1.throwError)(r)})))},r}(https_service_interface_1.HttpsService);exports.OauthHttpsService=OauthHttpsService;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
"use strict";var __extends=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),__decorate=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,s=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,o);else for(var c=e.length-1;c>=0;c--)(n=e[c])&&(s=(i<3?n(s):i>3?n(t,r,s):n(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},__awaiter=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function s(e){try{a(o.next(e))}catch(e){i(e)}}function c(e){try{a(o.throw(e))}catch(e){i(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(s,c)}a((o=o.apply(e,t||[])).next())}))},__generator=this&&this.__generator||function(e,t){var r,o,n,i,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(a){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(s=0)),s;)try{if(r=1,o&&(n=2&c[0]?o.return:c[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,c[1])).done)return n;switch(o=0,n&&(c=[2&c[0],n.value]),c[0]){case 0:case 1:n=c;break;case 4:return s.label++,{value:c[1],done:!1};case 5:s.label++,o=c[1],c=[0];continue;case 7:c=s.ops.pop(),s.trys.pop();continue;default:if(!(n=s.trys,(n=n.length>0&&n[n.length-1])||6!==c[0]&&2!==c[0])){s=0;continue}if(3===c[0]&&(!n||c[1]>n[0]&&c[1]<n[3])){s.label=c[1];break}if(6===c[0]&&s.label<n[1]){s.label=n[1],n=c;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(c);break}n[2]&&s.ops.pop(),s.trys.pop();continue}c=t.call(e,s)}catch(e){c=[6,e],o=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.LocalStorageService=void 0;var injection_identifier_1=require("../decorators/injection-identifier"),rxjs_1=require("rxjs"),base_login_init_service_1=require("./base-login-init.service"),LocalStorageService=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.init=function(t,r,o){var n=this;return e.prototype.init.call(this,t,r,o),this.currentOrganization$.subscribe((function(e){n.organizationName=e.name})),(0,rxjs_1.of)(void 0)},t.prototype.setItem=function(e,t){return __awaiter(this,arguments,void 0,(function(e,t,r){return void 0===r&&(r={userEmail:!0,organizationName:!0}),__generator(this,(function(e){throw new Error("In order to use the LocalStorageService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")}))}))},t.prototype.setItemSync=function(e,t,r){throw void 0===r&&(r={userEmail:!0,organizationName:!0}),new Error("In order to use the LocalStorageService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.setItems=function(e){return __awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={userEmail:!0,organizationName:!0}),__generator(this,(function(e){throw new Error("In order to use the LocalStorageService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")}))}))},t.prototype.setItemsSync=function(e,t){throw void 0===t&&(t={userEmail:!0,organizationName:!0}),new Error("In order to use the LocalStorageService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.getItem=function(e){return __awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={userEmail:!0,organizationName:!0}),__generator(this,(function(e){throw new Error("In order to use the LocalStorageService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")}))}))},t.prototype.getItemSync=function(e,t){throw void 0===t&&(t={userEmail:!0,organizationName:!0}),new Error("In order to use the LocalStorageService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.getItems=function(e){return __awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={userEmail:!0,organizationName:!0}),__generator(this,(function(e){throw new Error("In order to use the LocalStorageService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")}))}))},t.prototype.getItemsSync=function(e,t){throw void 0===t&&(t={userEmail:!0,organizationName:!0}),new Error("In order to use the LocalStorageService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.getAll=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){throw new Error("In order to use the LocalStorageService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")}))}))},t.prototype.getAllSync=function(){throw new Error("In order to use the LocalStorageService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.deleteItem=function(e){return __awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={userEmail:!0,organizationName:!0}),__generator(this,(function(e){throw new Error("In order to use the LocalStorageService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")}))}))},t.prototype.deleteItemSync=function(e,t){throw void 0===t&&(t={userEmail:!0,organizationName:!0}),new Error("In order to use the LocalStorageService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.deleteItems=function(e){return __awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={userEmail:!0,organizationName:!0}),__generator(this,(function(e){throw new Error("In order to use the LocalStorageService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")}))}))},t.prototype.deleteItemsSync=function(e,t){throw void 0===t&&(t={userEmail:!0,organizationName:!0}),new Error("In order to use the LocalStorageService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.hasItem=function(e){return __awaiter(this,arguments,void 0,(function(e,t){return void 0===t&&(t={userEmail:!0,organizationName:!0}),__generator(this,(function(e){throw new Error("In order to use the LocalStorageService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")}))}))},t.prototype.hasItemSync=function(e,t){throw void 0===t&&(t={userEmail:!0,organizationName:!0}),new Error("In order to use the LocalStorageService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.getPrefixedKey=function(e,t){void 0===t&&(t={userEmail:!0,organizationName:!0});var r="";return t.userEmail&&(r+="".concat(this.userEmail,"-")),t.organizationName&&(r+="".concat(this.organizationName,"-")),r+=e},t=__decorate([(0,injection_identifier_1.InjectionIdentifier)("LocalStorageService")],t)}(base_login_init_service_1.BaseLoginInitService);exports.LocalStorageService=LocalStorageService;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
import { Observable, Subject } from 'rxjs';
|
|
3
3
|
import { HttpsService } from './http/https.service.interface';
|
|
4
4
|
import { EventLog, EventLogRequestBody } from '../models/log';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
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 n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),__decorate=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},__awaiter=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function c(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,c)}s((n=n.apply(e,t||[])).next())}))},__generator=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(s){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,s])}}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.LogServiceImpl=void 0;var rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),injection_identifier_1=require("../decorators/injection-identifier"),https_service_interface_1=require("./http/https.service.interface"),log_1=require("../models/log"),general_helper_1=require("../utils/general-helper"),base_login_init_service_1=require("./base-login-init.service"),LogServiceImpl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.loggedEventSource=new rxjs_1.Subject,t.loggedEvent$=t.loggedEventSource.asObservable(),t}return __extends(t,e),t.prototype.init=function(t,r,n){var o;return e.prototype.init.call(this,t,r,n),this.externalUserId=null===(o=t.authenticationConfig)||void 0===o?void 0:o.externalUserId,(0,rxjs_1.of)(void 0)},t.prototype.onCreate=function(){this.httpsService=this.serviceProvider.getService(https_service_interface_1.HttpsService)},t.prototype.logEvent=function(e){var t=this;if(e.data){var r=(0,general_helper_1.camelToSnake)(e.data);e.data=r}e.externalUserId=this.externalUserId;var n=(0,log_1.eventLogRequestResponseAdapter)(e);return(0,rxjs_1.from)(this.createRequestBody(e)).pipe((0,operators_1.mergeMap)((function(e){return t.httpsService.post("events/",e,null,https_service_interface_1.BACKEND_SERVICE.LOG)})),(0,operators_1.tap)((function(){console.log("Logged event: ",e)})),(0,operators_1.map)(n),(0,operators_1.tap)((function(e){return t.loggedEventSource.next(e)})))},t.prototype.createRequestBody=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return[4,(0,rxjs_1.firstValueFrom)(this.currentOrganization$)];case 1:return t=r.sent().partiumId,[2,{version:e.version,organization_id:e.organizationId||t,interface:e.interface,event:e.event,external_user_id:e.externalUserId,data:e.data}]}}))}))},t=__decorate([(0,injection_identifier_1.InjectionIdentifier)("LogService")],t)}(base_login_init_service_1.BaseLoginInitService);exports.LogServiceImpl=LogServiceImpl;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
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,4 +1,4 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { APIObject } from '../models/api-object';
|
|
4
4
|
import { BACKEND_SERVICE, HttpsService } from './http/https.service.interface';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
"use strict";var __assign=this&&this.__assign||function(){return __assign=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var a in e=arguments[r])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t},__assign.apply(this,arguments)},__spreadArray=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var i,a=0,n=e.length;a<n;a++)!i&&a in e||(i||(i=Array.prototype.slice.call(e,0,a)),i[a]=e[a]);return t.concat(i||Array.prototype.slice.call(e))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.PaginatedRequestServiceImpl=void 0;var rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),error_1=require("../models/error"),https_service_interface_1=require("./http/https.service.interface"),paginated_list_1=require("../models/paginated-list"),PaginatedRequestServiceImpl=function(){function t(t,e,r,i,a,n,s){void 0===i&&(i=https_service_interface_1.BACKEND_SERVICE.DATA),void 0===a&&(a=[]),void 0===n&&(n=25),void 0===s&&(s=!1),this.pageSize=-1,this.concatResult=!0,this.initialPageLoaded=!1,this.pageLoading=!1,this.cursorPaginationEnabled=!1,this.createObject=t,this.httpsService=e,this.url=r,this.backendService=i,this.pageSize=n,this.cursorPaginationEnabled=s,this.urlParams=__spreadArray(__spreadArray([],a,!0),[{page_size:this.pageSize}],!1)}return t.prototype.loadInitialPage=function(t){var e=this;return void 0===t&&(t=!0),this.concatResult=t,this.loadPage(1).pipe((0,operators_1.tap)((function(){return e.initialPageLoaded=!0})))},t.prototype.getPaginatedList=function(t){return void 0===t&&(t=!0),this.loadInitialPage(t)},t.prototype.getLoadedPaginatedList=function(){return this.paginatedList},t.prototype.isInitialPageLoaded=function(){return this.initialPageLoaded&&this.paginatedList&&(this.paginatedList.currentPageIdx>=1||this.paginatedList.items.length>=0&&this.cursorPaginationEnabled)},t.prototype.isPageLoading=function(){return this.pageLoading},t.prototype.hasMoreResultsAvailable=function(){return this.cursorPaginationEnabled?this.paginatedList&&!!this.paginatedList.nextPage:this.paginatedList&&this.paginatedList.moreResultsAvailable()},t.prototype.loadMore=function(){if(this.cursorPaginationEnabled){var t=new URL(this.paginatedList.nextPage),e=new URLSearchParams(t.search).get("cursor");return this.urlParams=this.removeUrlParam(this.urlParams,"cursor"),this.urlParams=__spreadArray(__spreadArray([],this.urlParams,!0),[{cursor:e}],!1),this.loadPage(null)}return this.isInitialPageLoaded()?this.paginatedList.currentPageIdx>=this.paginatedList.totalPages?(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.NO_MORE_ITEMS_AVAILABLE,null,"can not load more items, last page reached")):this.loadPage(this.paginatedList.currentPageIdx+1):(0,rxjs_1.throwError)(new error_1.SdkError(error_1.SDK_ERROR_CODES.INITIAL_ITEMS_NOT_YET_LOADED,null))},t.prototype.loadPage=function(t){var e=this;return(0,rxjs_1.of)(void 0).pipe((0,operators_1.tap)((function(){e.pageLoading=!0})),(0,operators_1.mergeMap)((function(){return e.fetchPaginatedListFromServer(t).pipe((0,operators_1.catchError)((function(t){return e.pageLoading=!1,console.log("Error while loading items from server.",t),(0,rxjs_1.throwError)(t)})))})),(0,operators_1.tap)((function(){e.pageLoading=!1})),(0,operators_1.map)((function(t){return e.concatResult&&e.paginatedList&&t?e.concatenateItems(e.paginatedList,t):t})),(0,operators_1.tap)((function(t){e.paginatedList=t.clone()})))},t.prototype.fetchPaginatedListFromServer=function(t){var e=this;return this.httpsService.get(this.url,__spreadArray(__spreadArray([],this.urlParams,!0),[__assign({},this.cursorPaginationEnabled?{paginator:"cursor"}:{page:t})],!1),this.backendService).pipe((0,operators_1.map)((function(r){var i=r.results.map((function(t){return e.createObject(t)}));return new paginated_list_1.PaginatedList(i,t||void 0,r.pagination.items_count||0===r.pagination.items_count?Math.ceil(r.pagination.items_count/e.pageSize):void 0,e.pageSize,r.pagination.next||void 0,r.pagination.previous||void 0,e.cursorPaginationEnabled)})))},t.prototype.concatenateItems=function(t,e){return e.items=t.items.concat(e.items),e},t.prototype.removeUrlParam=function(t,e){return t.filter((function(t){return!t[e]}))},t}();exports.PaginatedRequestServiceImpl=PaginatedRequestServiceImpl;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
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 n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),__decorate=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},__awaiter=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},__generator=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.RecentPartsServiceImpl=void 0;var rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),injection_identifier_1=require("../decorators/injection-identifier"),session_service_interface_1=require("./session/session.service.interface"),local_storage_service_interface_1=require("./local-storage.service.interface"),base_login_init_service_1=require("./base-login-init.service"),RecentPartsServiceImpl=function(e){function t(t){var r=e.call(this,t)||this;return r.initialized$=new Promise((function(e,t){r.initialized=e})),r.recentPartIds$=new rxjs_1.BehaviorSubject([]),r}return __extends(t,e),t.prototype.onCreate=function(){var e=this;this.localStorageService=this.serviceProvider.getService(local_storage_service_interface_1.LocalStorageService),this.serviceProvider.getService(session_service_interface_1.SessionService).getSessionStatusEvents().subscribe((function(t){t===session_service_interface_1.SESSION_STATUS_EVENT.SESSION_ENDED&&e.reset()}))},t.prototype.init=function(t,r,n){var i=this;return e.prototype.init.call(this,t,r,n),this.maxPartHistoryLength=t.recentPartsMaxPartHistoryLength,this.currentOrganization$.pipe((0,operators_1.filter)((function(e){return!!e})),(0,operators_1.skip)(1),(0,operators_1.distinctUntilChanged)()).subscribe((function(){i.loadRecentPartIds()})),(0,rxjs_1.defer)((function(){return i.loadRecentPartIds()})).pipe((0,operators_1.map)((function(){i.initialized()})))},t.prototype.addRecentPart=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return[4,this.getRecentPartIdsFromLocalStorage()];case 1:return(t=(t=r.sent()).filter((function(t){return t!==e}))).unshift(e),t=t.splice(0,this.maxPartHistoryLength),[4,this.saveToLocalStorage(t)];case 2:return r.sent(),this.recentPartIds$.next(t),[2]}}))}))},t.prototype.saveToLocalStorage=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.localStorageService.setItem("RECENT_PARTS_IDS",JSON.stringify(e||[]))]}))}))},t.prototype.getRecentParts=function(){var e=this;return(0,rxjs_1.from)(this.initialized$).pipe((0,operators_1.mergeMap)((function(){return e.recentPartIds$.asObservable()})))},t.prototype.loadRecentPartIds=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,this.getRecentPartIdsFromLocalStorage()];case 1:return e=t.sent(),this.recentPartIds$.next(e),[2]}}))}))},t.prototype.getRecentPartIdsFromLocalStorage=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){switch(r.label){case 0:return[4,this.localStorageService.getItem("RECENT_PARTS_IDS")];case 1:return(e=r.sent())?!(t=JSON.parse(e))||t.length<1?[2,[]]:[2,t]:[2,[]]}}))}))},t.prototype.reset=function(){this.recentPartIds$.next([])},t=__decorate([(0,injection_identifier_1.InjectionIdentifier)("RecentPartsService")],t)}(base_login_init_service_1.BaseLoginInitService);exports.RecentPartsServiceImpl=RecentPartsServiceImpl;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
"use strict";var __spreadArray=this&&this.__spreadArray||function(e,i,t){if(t||2===arguments.length)for(var r,s=0,n=i.length;s<n;s++)!r&&s in i||(r||(r=Array.prototype.slice.call(i,0,s)),r[s]=i[s]);return e.concat(r||Array.prototype.slice.call(i))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.ServiceProvider=void 0;var ServiceProvider=function(){function e(){this.services={},this.useServicePhaseEnded=!1}return e.prototype.getService=function(e){if(!this.serviceSelectionFinished)throw"Can not retrieve service, because service-selection with useService is not yet finished. Call serviceSelectionFinished to end this phase.";return this.services[e.getInjectionIdentifierName()]||(this.services[e.getInjectionIdentifierName()]=new e(this),this.useServicePhaseEnded&&this.services[e.getInjectionIdentifierName()].onCreate()),this.services[e.getInjectionIdentifierName()]},e.prototype.useService=function(e,i){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];if(this.useServicePhaseEnded)throw"You can not call useService after calling serviceSelectionFinished";this.services[i.getInjectionIdentifierName()]=new(e.bind.apply(e,__spreadArray([void 0,this],t,!1)))},e.prototype.setService=function(e,i){if(this.useServicePhaseEnded)throw"You can not call setService after calling serviceSelectionFinished";this.services[i.getInjectionIdentifierName()]=e},e.prototype.serviceSelectionFinished=function(){if(!this.useServicePhaseEnded){this.useServicePhaseEnded=!0;for(var e=0,i=Object.keys(this.services);e<i.length;e++){var t=i[e];this.services[t].onCreate()}}},e.prototype.reset=function(){this.services={},this.useServicePhaseEnded=!1},e}();exports.ServiceProvider=ServiceProvider;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
import { SessionService, LoginConfig } from './session.service.interface';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
import { ServiceProvider } from '../service-provider';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
"use strict";var __extends=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.OauthSessionService=exports.OauthStatus=exports.OauthLoginConfig=void 0;var session_service_interface_1=require("./session.service.interface"),https_service_interface_1=require("../http/https.service.interface"),OauthLoginConfig=function(e){function t(t){var r=e.call(this)||this;return Object.assign(r,t),r}return __extends(t,e),t}(session_service_interface_1.LoginConfig);exports.OauthLoginConfig=OauthLoginConfig;var OauthStatus=function(e){Object.assign(this,e)};exports.OauthStatus=OauthStatus;var OauthSessionService=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.onCreate=function(){this.httpsServiceOauth=this.serviceProvider.getService(https_service_interface_1.HttpsService)},t.prototype.login=function(e){throw new Error("In order to use the OauthSessionService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.refresh=function(){throw new Error("In order to use the OauthSessionService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.logout=function(){throw new Error("In order to use the OauthSessionService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},t.prototype.tokenUpdated=function(e,t){this.httpsServiceOauth.setToken(e,t)},t}(session_service_interface_1.SessionService);exports.OauthSessionService=OauthSessionService;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
3
3
|
import { AuthenticationConfig } from '../../models/auth-config';
|
|
4
4
|
import { PartiumConfig } from '../../models/partium-config';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
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 n,o=arguments.length,s=o<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 a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(r,t,s):n(r,t))||s);return o>3&&s&&Object.defineProperty(r,t,s),s},__awaiter=this&&this.__awaiter||function(e,r,t,i){return new(t||(t=Promise))((function(n,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var r;e.done?n(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(s,a)}c((i=i.apply(e,r||[])).next())}))},__generator=this&&this.__generator||function(e,r){var t,i,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(t=1,i&&(n=2&a[0]?i.return:a[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;switch(i=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,i=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(n=s.trys,(n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=r.call(e,s)}catch(e){a=[6,e],i=0}finally{t=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},__spreadArray=this&&this.__spreadArray||function(e,r,t){if(t||2===arguments.length)for(var i,n=0,o=r.length;n<o;n++)!i&&n in r||(i||(i=Array.prototype.slice.call(r,0,n)),i[n]=r[n]);return e.concat(i||Array.prototype.slice.call(r))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.SessionService=exports.LoginConfig=exports.SESSION_STATUS_EVENT=void 0;var SESSION_STATUS_EVENT,rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),injection_identifier_1=require("../../decorators/injection-identifier"),base_service_1=require("../base.service"),organization_service_1=require("../organization.service"),log_1=require("../../models/log"),log_service_1=require("../log.service"),device_status_service_interface_1=require("../device-status.service.interface"),sdk_version_1=require("../../../gen/sdk-version"),error_1=require("../../models/error"),local_storage_service_interface_1=require("../local-storage.service.interface");!function(e){e[e.SESSION_STARTED=0]="SESSION_STARTED",e[e.SESSION_ENDED=1]="SESSION_ENDED"}(SESSION_STATUS_EVENT||(exports.SESSION_STATUS_EVENT=SESSION_STATUS_EVENT={}));var LoginConfig=function(){};exports.LoginConfig=LoginConfig;var SessionService=function(e){function r(r){var t=e.call(this,r)||this;return t.currentOrganization$=new rxjs_1.BehaviorSubject(void 0),t.servicesToInitDuringLogin=[],t.sessionStatus$=new rxjs_1.BehaviorSubject(null),t}return __extends(r,e),r.prototype.init=function(e){var r=this;return new rxjs_1.Observable((function(t){r.authenticationConfig=e.authenticationConfig,r.partiumConfig=e,t.next(),t.complete()}))},r.prototype.login=function(e){throw new Error("In order to use the SessionService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},r.prototype.logout=function(){throw new Error("In order to use the SessionService, don't directly use this class, but one of it's descendants, by choosing a replacement with serviceProvider.useService().")},r.prototype.getSessionStatusEvents=function(){return this.sessionStatus$.asObservable()},r.prototype.getAuthConfig=function(){return this.authenticationConfig},r.prototype.setUser=function(e){this.user=e},r.prototype.getUser=function(){return this.user},r.prototype.useOrganization=function(e){return __awaiter(this,void 0,void 0,(function(){var r,t,i,n,o;return __generator(this,(function(s){switch(s.label){case 0:return[4,this.organizationService.getOrganizations()];case 1:for(r=s.sent(),t=this.getFlattenedOrganizations(r),i=0,n=t;i<n.length;i++)if((o=n[i]).partiumId===e||o.name===e)return this.currentOrganization$.next(o),this.localStorageService.setItem("lastUsedOrganizationId",o.partiumId,{organizationName:!1,userEmail:!1}),[2];throw new error_1.SdkError(error_1.SDK_ERROR_CODES.ORGANIZATION_NOT_FOUND,{organizationIdentifier:e},"Could not find organization with id/name ".concat(e))}}))}))},r.prototype.getCurrentOrganization$=function(){return this.currentOrganization$.asObservable()},r.prototype.registerLoginInitService=function(e,r){void 0===r&&(r=100),this.servicesToInitDuringLogin.push({service:e,priority:r})},r.prototype.sessionSetup=function(e){var r=this;this.organizationService=this.serviceProvider.getService(organization_service_1.OrganizationService),this.localStorageService=this.serviceProvider.getService(local_storage_service_interface_1.LocalStorageService);var t=this.serviceProvider.getService(log_service_1.LogServiceImpl),i=this.serviceProvider.getService(device_status_service_interface_1.DeviceStatusService);return(0,rxjs_1.from)(Promise.all([this.localStorageService.getItem("lastUsedOrganizationId",{organizationName:!1,userEmail:!1}),this.organizationService.init().then((function(){return r.organizationService.getOrganizations()}))])).pipe((0,operators_1.mergeMap)((function(e){var t=e[0],i=e[1];if(t){var n=r.getFlattenedOrganizations(i).find((function(e){return e.partiumId===t}));if(n&&!n.requiresAdditionalAuthentication)return(0,rxjs_1.of)(n)}return(0,rxjs_1.from)(r.organizationService.getFirstOrganization())})),(0,operators_1.map)((function(e){return r.currentOrganization$.next(e),e})),(0,operators_1.mergeMap)((function(n){return r.initializeRegisteredServices().pipe((0,operators_1.mergeMap)((function(){return(0,rxjs_1.from)(i.getDeviceInfo()).pipe((0,operators_1.tap)((function(i){r.logUserSessionInfoEvent(i,t,n,e)})))})))})),(0,operators_1.map)((function(){r.sessionStatus$.next(SESSION_STATUS_EVENT.SESSION_STARTED)})),(0,operators_1.catchError)((function(e){return r.logout().subscribe(),(0,rxjs_1.throwError)(e)})))},r.prototype.logUserSessionInfoEvent=function(e,r,t,i){var n=this.getValidLanguageUiForEvent(t,null==i?void 0:i.languageUi),o={deviceId:e.deviceId,manufacturer:e.manufacturer,model:e.model,os:e.os,osVersion:e.osVersion,deviceType:e.deviceType,deviceLanguage:e.deviceLanguage,appVersionCode:e.appVersionCode,appVersionName:e.appVersionName,partiumSdkVersion:sdk_version_1.SDK_VERSION_NUMBER,languageUi:n,browserName:e.browserName,browserVersion:e.browserVersion,cpuArchitecture:e.cpuArchitecture,engineName:e.engineName,engineVersion:e.engineVersion};r.logEvent(new log_1.EventLog({organizationId:t.partiumId,version:log_1.EVENTLOG_VERSIONS.V_2_0_0,interface:(null==i?void 0:i.eventInterface)||log_1.INTERFACE.API_ACCESS,event:log_1.EVENT.USER_SESSION_INFO,data:o})).subscribe({next:function(){},error:function(e){console.error("Error while sending log event ".concat(log_1.EVENT.USER_SESSION_INFO,": "),e)}})},r.prototype.getValidLanguageUiForEvent=function(e,r){var t;if(r&&((null===(t=e.config)||void 0===t?void 0:t.availableUiLanguages)||["en"]).includes(r))return r;return null},r.prototype.sessionEnded=function(){this.sessionStatus$.next(SESSION_STATUS_EVENT.SESSION_ENDED)},r.prototype.initializeRegisteredServices=function(){for(var e=this,r=this.servicesToInitDuringLogin.sort((function(e,r){return e.priority-r.priority})),t=[],i=-1,n=0;n<r.length;n++){var o=r[n];o.priority===i?t[t.length-1].push(o.service):(i=o.priority,t.push([o.service]))}return rxjs_1.concat.apply(void 0,t.map((function(r){return(0,rxjs_1.forkJoin)(r.map((function(r){return r.init(e.partiumConfig,e.user.email,e.getCurrentOrganization$())})))}))).pipe((0,operators_1.last)())},r.prototype.getFlattenedOrganizations=function(e){return e.reduce((function(e,r){return __spreadArray(__spreadArray(__spreadArray([],e,!0),[r],!1),r.subOrgs||[],!0)}),[])},r=__decorate([(0,injection_identifier_1.InjectionIdentifier)("SessionService")],r)}(base_service_1.BaseService);exports.SessionService=SessionService;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Copyright © 2022-
|
|
1
|
+
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
2
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addUrlParameter=exports.addUrlParameters=exports.snakeToCamelCase=exports.camelToSnake=void 0;var camelToSnake=function(e){var r={};return Object.keys(e).forEach((function(a){var t=a.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}));if(r[t]=e[a],Array.isArray(e[t])){var n=e[t];n=n.map((function(e){return e&&"object"==typeof e&&e.constructor===Object?(0,exports.camelToSnake)(e):e})),r[t]=n}})),r};exports.camelToSnake=camelToSnake;var snakeToCamelCase=function(e){var r={};return Object.keys(e).forEach((function(a){var t=a.toLowerCase().replace(/([-_][a-z])/g,(function(e){return e.toUpperCase().replace("-","").replace("_","")}));if(r[t]=e[a],Array.isArray(e[t])){var n=e[t];n=n.map((function(e){return e&&"object"==typeof e&&e.constructor===Object?(0,exports.snakeToCamelCase)(e):e})),r[t]=n}})),r};exports.snakeToCamelCase=snakeToCamelCase;var addUrlParameters=function(e,r){if(!r||r.length<1)return e;for(var a=0,t=r;a<t.length;a++){var n=t[a];e=(0,exports.addUrlParameter)(e,n)}return e};exports.addUrlParameters=addUrlParameters;var addUrlParameter=function(e,r){if(!r)return e;var a=e.split("?"),t=a[0],n=[];a.length>1&&(n=a[1].split("&").map((function(e){return e.split("=")})));for(var o=0,c=Object.keys(r);o<c.length;o++){var s=c[o],l=r[s];null!=l&&(s=encodeURIComponent(s),l=encodeURIComponent(l),n.push([s,l]))}var p=n.map((function(e){return e.join("=")}));return p.length>0?"".concat(t,"?").concat(p.join("&")):t};exports.addUrlParameter=addUrlParameter;
|
package/data/index.d.ts
CHANGED