@partium/js-sdk 14.5.0 → 14.6.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.
Files changed (39) hide show
  1. package/datacuration/index.d.ts +15 -1
  2. package/datacuration/index.js +1 -1
  3. package/datacuration/models/approve-image-submission-request.d.ts +14 -0
  4. package/datacuration/models/approve-image-submission-response.d.ts +24 -0
  5. package/datacuration/models/approve-image-submission-response.js +2 -0
  6. package/datacuration/models/base-submission-response.d.ts +35 -0
  7. package/datacuration/models/base-submission-response.js +2 -0
  8. package/datacuration/models/get-image-submissions-request.d.ts +26 -0
  9. package/datacuration/models/get-image-submissions-request.js +2 -0
  10. package/datacuration/models/get-image-submissions-response.d.ts +37 -0
  11. package/datacuration/models/get-image-submissions-response.js +2 -0
  12. package/datacuration/models/image-submission-content-type.d.ts +18 -0
  13. package/datacuration/models/image-submission-content-type.js +2 -0
  14. package/datacuration/models/image-submission-status.d.ts +18 -0
  15. package/datacuration/models/image-submission-status.js +2 -0
  16. package/datacuration/models/image-submission.d.ts +40 -0
  17. package/datacuration/models/image-submission.js +2 -0
  18. package/datacuration/models/reject-image-submission-request.d.ts +14 -0
  19. package/datacuration/models/reject-image-submission-request.js +2 -0
  20. package/datacuration/models/reject-image-submission-response.d.ts +24 -0
  21. package/datacuration/models/reject-image-submission-response.js +2 -0
  22. package/datacuration/models/submit-images-request.d.ts +33 -0
  23. package/datacuration/models/submit-images-request.js +2 -0
  24. package/datacuration/models/{submitted-image-response.d.ts → submit-images-response.d.ts} +5 -8
  25. package/datacuration/models/submit-images-response.js +2 -0
  26. package/datacuration/models/update-image-submission-request.d.ts +69 -0
  27. package/datacuration/models/update-image-submission-request.js +2 -0
  28. package/datacuration/models/update-image-submission-response.d.ts +28 -0
  29. package/datacuration/models/update-image-submission-response.js +2 -0
  30. package/datacuration/services/image-submission.service.d.ts +69 -10
  31. package/datacuration/services/image-submission.service.js +1 -1
  32. package/gen/sdk-version.d.ts +1 -1
  33. package/gen/sdk-version.js +1 -1
  34. package/index.d.ts +1 -1
  35. package/index.js +1 -1
  36. package/package.json +1 -1
  37. package/datacuration/models/image-submission-request.d.ts +0 -55
  38. package/datacuration/models/image-submission-request.js +0 -2
  39. /package/datacuration/models/{submitted-image-response.js → approve-image-submission-request.js} +0 -0
@@ -1,2 +1,16 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- export * from './models/image-submission-request';
2
+ export * from './models/approve-image-submission-request';
3
+ export * from './models/approve-image-submission-response';
4
+ export * from './models/base-submission-response';
5
+ export * from './models/get-image-submissions-request';
6
+ export * from './models/get-image-submissions-response';
7
+ export * from './models/image-submission-content-type';
8
+ export * from './models/image-submission-status';
9
+ export * from './models/image-submission';
10
+ export * from './models/reject-image-submission-request';
11
+ export * from './models/reject-image-submission-response';
12
+ export * from './models/submit-images-request';
13
+ export * from './models/submit-images-response';
14
+ export * from './models/update-image-submission-request';
15
+ export * from './models/update-image-submission-response';
16
+ export * from './services/image-submission.service';
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),__exportStar=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||__createBinding(t,e,r)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./models/image-submission-request"),exports);
2
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,r,s,t){void 0===t&&(t=s);var o=Object.getOwnPropertyDescriptor(r,s);o&&!("get"in o?!r.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return r[s]}}),Object.defineProperty(e,t,o)}:function(e,r,s,t){void 0===t&&(t=s),e[t]=r[s]}),__exportStar=this&&this.__exportStar||function(e,r){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(r,s)||__createBinding(r,e,s)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./models/approve-image-submission-request"),exports),__exportStar(require("./models/approve-image-submission-response"),exports),__exportStar(require("./models/base-submission-response"),exports),__exportStar(require("./models/get-image-submissions-request"),exports),__exportStar(require("./models/get-image-submissions-response"),exports),__exportStar(require("./models/image-submission-content-type"),exports),__exportStar(require("./models/image-submission-status"),exports),__exportStar(require("./models/image-submission"),exports),__exportStar(require("./models/reject-image-submission-request"),exports),__exportStar(require("./models/reject-image-submission-response"),exports),__exportStar(require("./models/submit-images-request"),exports),__exportStar(require("./models/submit-images-response"),exports),__exportStar(require("./models/update-image-submission-request"),exports),__exportStar(require("./models/update-image-submission-response"),exports),__exportStar(require("./services/image-submission.service"),exports);
@@ -0,0 +1,14 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ /**
3
+ * Request for approving image submissions.
4
+ */
5
+ export interface ApproveImageSubmissionRequest {
6
+ /**
7
+ * The organization name.
8
+ */
9
+ organization: string;
10
+ /**
11
+ * The IDs of the images to approve.
12
+ */
13
+ imageIds: string[];
14
+ }
@@ -0,0 +1,24 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ import { BaseSubmissionResponse } from './base-submission-response';
3
+ /**
4
+ * An approved image submission.
5
+ */
6
+ export interface ApprovedImageSubmission {
7
+ /**
8
+ * The ID of the part.
9
+ */
10
+ partId: string;
11
+ /**
12
+ * The ID of the image.
13
+ */
14
+ imageId: string;
15
+ }
16
+ /**
17
+ * Response for approving image submissions.
18
+ */
19
+ export interface ApproveImageSubmissionResponse extends BaseSubmissionResponse {
20
+ /**
21
+ * The approved images.
22
+ */
23
+ images?: ApprovedImageSubmission[];
24
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -0,0 +1,35 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ /**
3
+ * An error in a submission.
4
+ */
5
+ export interface SubmissionError {
6
+ /**
7
+ * The context of the submission error.
8
+ */
9
+ ctx: Record<string, number>;
10
+ /**
11
+ * The location of the submission error.
12
+ */
13
+ loc: Array<string | number>;
14
+ /**
15
+ * The message of the submission error.
16
+ */
17
+ msg: string;
18
+ /**
19
+ * The type of the submission error.
20
+ */
21
+ type: string;
22
+ }
23
+ /**
24
+ * A detail of a submission error.
25
+ */
26
+ export type SubmissionErrorDetail = Array<string | SubmissionError>;
27
+ /**
28
+ * A base response for a submission.
29
+ */
30
+ export interface BaseSubmissionResponse {
31
+ /**
32
+ * The details of the submission errors.
33
+ */
34
+ detail?: SubmissionErrorDetail;
35
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -0,0 +1,26 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ /**
3
+ * Request for getting image submissions.
4
+ */
5
+ export interface GetImageSubmissionsRequest {
6
+ /**
7
+ * The organization name.
8
+ */
9
+ organization?: string;
10
+ /**
11
+ * The language of the image submissions.
12
+ */
13
+ language: string;
14
+ /**
15
+ * Whether the image submissions are reviewed.
16
+ */
17
+ reviewed?: boolean;
18
+ /**
19
+ * The cursor to get the next page of image submissions.
20
+ */
21
+ cursor?: string;
22
+ /**
23
+ * The page size of the image submissions.
24
+ */
25
+ pageSize?: number;
26
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -0,0 +1,37 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ import { BaseSubmissionResponse } from './base-submission-response';
3
+ import { ImageSubmission } from './image-submission';
4
+ /**
5
+ * A part image submission.
6
+ */
7
+ export interface PartImageSubmission {
8
+ /**
9
+ * The ID of the part.
10
+ */
11
+ partId: string;
12
+ /**
13
+ * The name of the part.
14
+ */
15
+ partName: string;
16
+ /**
17
+ * The language of the part name.
18
+ */
19
+ partNameLanguage: string;
20
+ /**
21
+ * The images of the part.
22
+ */
23
+ images: ImageSubmission[];
24
+ }
25
+ /**
26
+ * Response for getting image submissions.
27
+ */
28
+ export interface GetImageSubmissionsResponse extends BaseSubmissionResponse {
29
+ /**
30
+ * The part image submissions.
31
+ */
32
+ results?: PartImageSubmission[];
33
+ /**
34
+ * The next cursor to get the next page of image submissions.
35
+ */
36
+ next?: string;
37
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -0,0 +1,18 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ /**
3
+ * The content type of an image submission.
4
+ */
5
+ export declare enum ImageSubmissionContentType {
6
+ /**
7
+ * The part itself.
8
+ */
9
+ PART = "part",
10
+ /**
11
+ * Part's label, specifications sheet, or similar.
12
+ */
13
+ SPECIFICATIONS = "specifications",
14
+ /**
15
+ * An assembly, box, etc.
16
+ */
17
+ OTHER = "other"
18
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ "use strict";var ImageSubmissionContentType;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ImageSubmissionContentType=void 0,function(e){e.PART="part",e.SPECIFICATIONS="specifications",e.OTHER="other"}(ImageSubmissionContentType||(exports.ImageSubmissionContentType=ImageSubmissionContentType={}));
@@ -0,0 +1,18 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ /**
3
+ * The status of an image submission.
4
+ */
5
+ export declare enum ImageSubmissionStatus {
6
+ /**
7
+ * The image is pending review.
8
+ */
9
+ PENDING = "pending",
10
+ /**
11
+ * The image is approved.
12
+ */
13
+ APPROVED = "approved",
14
+ /**
15
+ * The image is rejected.
16
+ */
17
+ REJECTED = "rejected"
18
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ "use strict";var ImageSubmissionStatus;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ImageSubmissionStatus=void 0,function(e){e.PENDING="pending",e.APPROVED="approved",e.REJECTED="rejected"}(ImageSubmissionStatus||(exports.ImageSubmissionStatus=ImageSubmissionStatus={}));
@@ -0,0 +1,40 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ import { ImageSubmissionContentType } from './image-submission-content-type';
3
+ import { ImageSubmissionStatus } from './image-submission-status';
4
+ /**
5
+ * An image submission.
6
+ */
7
+ export interface ImageSubmission {
8
+ /**
9
+ * The ID of the image submission.
10
+ */
11
+ imageId: string;
12
+ /**
13
+ * The URL of the image submission.
14
+ */
15
+ url: string;
16
+ /**
17
+ * Whether the image submission is searchable.
18
+ */
19
+ searchable: boolean;
20
+ /**
21
+ * Whether the image submission is displayed.
22
+ */
23
+ display: boolean;
24
+ /**
25
+ * Whether the image submission is the primary image.
26
+ */
27
+ isPrimaryImage: boolean;
28
+ /**
29
+ * The content type of the image submission.
30
+ */
31
+ content: ImageSubmissionContentType;
32
+ /**
33
+ * The date the image submission was uploaded.
34
+ */
35
+ uploadedAt: string;
36
+ /**
37
+ * The status of the image submission.
38
+ */
39
+ status: ImageSubmissionStatus;
40
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -0,0 +1,14 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ /**
3
+ * Request for rejecting image submissions.
4
+ */
5
+ export interface RejectImageSubmissionRequest {
6
+ /**
7
+ * The organization name.
8
+ */
9
+ organization: string;
10
+ /**
11
+ * The IDs of the images to reject.
12
+ */
13
+ imageIds: string[];
14
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -0,0 +1,24 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ import { BaseSubmissionResponse } from './base-submission-response';
3
+ /**
4
+ * A rejected image submission.
5
+ */
6
+ export interface RejectedImageSubmission {
7
+ /**
8
+ * The ID of the part.
9
+ */
10
+ partId: string;
11
+ /**
12
+ * The ID of the image.
13
+ */
14
+ imageId: string;
15
+ }
16
+ /**
17
+ * Response for rejecting image submissions.
18
+ */
19
+ export interface RejectImageSubmissionResponse extends BaseSubmissionResponse {
20
+ /**
21
+ * The rejected images.
22
+ */
23
+ images?: RejectedImageSubmission[];
24
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -0,0 +1,33 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ import { ImageSubmissionContentType } from './image-submission-content-type';
3
+ /**
4
+ * Metadata for a submission image.
5
+ */
6
+ export interface ImageSubmissionMetadata {
7
+ /**
8
+ * The external ID of the part.
9
+ */
10
+ partId: string;
11
+ /**
12
+ * The content type of the submission image.
13
+ */
14
+ content: ImageSubmissionContentType;
15
+ }
16
+ /**
17
+ * Request for submitting images.
18
+ */
19
+ export interface SubmitImagesRequest {
20
+ /**
21
+ * The organization name.
22
+ */
23
+ organization: string;
24
+ /**
25
+ * Array of image metadata corresponding to each file
26
+ * The array indices should match between files and images arrays
27
+ */
28
+ images: ImageSubmissionMetadata[];
29
+ /**
30
+ * Array of File objects containing the image data to upload
31
+ */
32
+ files: File[];
33
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1,27 +1,24 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ import { BaseSubmissionResponse } from './base-submission-response';
2
3
  /**
3
4
  * A submitted image.
4
- *
5
- * @see SubmittedImageResponse
6
5
  */
7
6
  export interface SubmittedImage {
8
7
  /**
9
- * The ID of the image.
8
+ * The ID of the image submission.
10
9
  */
11
10
  imageId: string;
12
11
  /**
13
- * The ID of the part.
12
+ * The ID of the part associated with the image.
14
13
  */
15
14
  partId: string;
16
15
  }
17
16
  /**
18
17
  * A response containing submitted images.
19
- *
20
- * @see SubmittedImage
21
18
  */
22
- export interface SubmittedImageResponse {
19
+ export interface SubmitImagesResponse extends BaseSubmissionResponse {
23
20
  /**
24
21
  * The submitted images.
25
22
  */
26
- images: SubmittedImage[];
23
+ images?: SubmittedImage[];
27
24
  }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -0,0 +1,69 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ import { ImageSubmissionContentType } from './image-submission-content-type';
3
+ /**
4
+ * An interest area of an image.
5
+ */
6
+ export interface ImageInterestArea {
7
+ /**
8
+ * The x coordinate of the top-left corner of the interest area.
9
+ */
10
+ x1: number;
11
+ /**
12
+ * The y coordinate of the top-left corner of the interest area.
13
+ */
14
+ y1: number;
15
+ /**
16
+ * The x coordinate of the bottom-right corner of the interest area.
17
+ */
18
+ x2: number;
19
+ /**
20
+ * The y coordinate of the bottom-right corner of the interest area.
21
+ */
22
+ y2: number;
23
+ }
24
+ /**
25
+ * An image submission to update.
26
+ */
27
+ export interface UpdateImageSubmission {
28
+ /**
29
+ * The ID of the part.
30
+ */
31
+ partId: string;
32
+ /**
33
+ * The ID of the image.
34
+ */
35
+ imageId: string;
36
+ /**
37
+ * Whether the image is searchable.
38
+ */
39
+ searchable?: boolean;
40
+ /**
41
+ * Whether the image is displayed.
42
+ */
43
+ display?: boolean;
44
+ /**
45
+ * Whether the image is the primary image.
46
+ */
47
+ isPrimaryImage?: boolean;
48
+ /**
49
+ * The content type of the image.
50
+ */
51
+ content?: ImageSubmissionContentType;
52
+ /**
53
+ * The interest area of the image.
54
+ */
55
+ areaOfInterest?: ImageInterestArea;
56
+ }
57
+ /**
58
+ * Request for updating image submissions.
59
+ */
60
+ export interface UpdateImageSubmissionRequest {
61
+ /**
62
+ * The organization name.
63
+ */
64
+ organization: string;
65
+ /**
66
+ * The images to update.
67
+ */
68
+ images: UpdateImageSubmission[];
69
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -0,0 +1,28 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ import { BaseSubmissionResponse } from './base-submission-response';
3
+ /**
4
+ * An updated image submission.
5
+ */
6
+ export interface UpdatedImageSubmission {
7
+ /**
8
+ * The ID of the part.
9
+ */
10
+ partId: string;
11
+ /**
12
+ * The ID of the image.
13
+ */
14
+ imageId: string;
15
+ /**
16
+ * The URL of the image.
17
+ */
18
+ url: string;
19
+ }
20
+ /**
21
+ * Response for updating image submissions.
22
+ */
23
+ export interface UpdateImageSubmissionResponse extends BaseSubmissionResponse {
24
+ /**
25
+ * The updated images.
26
+ */
27
+ images?: UpdatedImageSubmission[];
28
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1,15 +1,19 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
2
  import { Observable } from 'rxjs';
3
3
  import { BaseService } from '../../core';
4
- import { ImageSubmissionRequest } from '../models/image-submission-request';
5
- import { SubmittedImageResponse } from '../models/submitted-image-response';
4
+ import { SubmitImagesRequest } from '../models/submit-images-request';
5
+ import { SubmitImagesResponse } from '../models/submit-images-response';
6
+ import { GetImageSubmissionsRequest } from '../models/get-image-submissions-request';
7
+ import { GetImageSubmissionsResponse } from '../models/get-image-submissions-response';
8
+ import { ApproveImageSubmissionRequest } from '../models/approve-image-submission-request';
9
+ import { ApproveImageSubmissionResponse } from '../models/approve-image-submission-response';
10
+ import { RejectImageSubmissionRequest } from '../models/reject-image-submission-request';
11
+ import { RejectImageSubmissionResponse } from '../models/reject-image-submission-response';
12
+ import { UpdateImageSubmissionRequest } from '../models/update-image-submission-request';
13
+ import { UpdateImageSubmissionResponse } from '../models/update-image-submission-response';
6
14
  /**
7
- /**
8
- * Service for submitting images and metadata to the datacuration backend for AI ingestion.
9
- *
10
- * @see ImageSubmissionRequest
11
- * @see SubmittedImageResponse
12
- */
15
+ * Service for submitting images and metadata to the datacuration backend for AI ingestion.
16
+ */
13
17
  export interface ImageSubmissionService {
14
18
  /**
15
19
  * Submits images.
@@ -17,10 +21,65 @@ export interface ImageSubmissionService {
17
21
  * @param request - The request containing the images to submit.
18
22
  * @returns An Observable that emits the submitted images.
19
23
  */
20
- submitImages(request: ImageSubmissionRequest): Observable<SubmittedImageResponse>;
24
+ submit(request: SubmitImagesRequest): Observable<SubmitImagesResponse>;
25
+ /**
26
+ * Gets image submissions.
27
+ *
28
+ * @param request - The request containing the parameters for the image submissions to get.
29
+ * @returns An Observable that emits the image submissions.
30
+ * @throws An error if the language is not provided.
31
+ */
32
+ loadInitialSubmissions(request: GetImageSubmissionsRequest): Observable<GetImageSubmissionsResponse>;
33
+ /**
34
+ * Loads more image submissions using the initial request parameters.
35
+ *
36
+ * @returns An Observable that emits the image submissions.
37
+ * @throws An error if loadInitialSubmissions has not been called first.
38
+ */
39
+ loadMoreSubmissions(): Observable<GetImageSubmissionsResponse>;
40
+ /**
41
+ * Returns true if there are more results available to load, false otherwise.
42
+ */
43
+ hasMoreResultsAvailable(): boolean;
44
+ /**
45
+ * Approves image submissions.
46
+ *
47
+ * @param request - The request containing the image submissions to approve.
48
+ * @returns An Observable that emits the approved image submissions.
49
+ * @throws An error if the organization is not provided.
50
+ * @throws An error if the image IDs are not provided.
51
+ */
52
+ approve(request: ApproveImageSubmissionRequest): Observable<ApproveImageSubmissionResponse>;
53
+ /**
54
+ * Rejects image submissions.
55
+ *
56
+ * @param request - The request containing the image submissions to reject.
57
+ * @returns An Observable that emits the rejected image submissions.
58
+ * @throws An error if the organization is not provided.
59
+ * @throws An error if the image IDs are not provided.
60
+ */
61
+ reject(request: RejectImageSubmissionRequest): Observable<RejectImageSubmissionResponse>;
62
+ /**
63
+ * Updates image submissions.
64
+ *
65
+ * @param request - The request containing the image submissions to update.
66
+ * @returns An Observable that emits the updated image submissions.
67
+ * @throws An error if the organization is not provided.
68
+ * @throws An error if the image IDs are not provided.
69
+ */
70
+ update(request: UpdateImageSubmissionRequest): Observable<UpdateImageSubmissionResponse>;
21
71
  }
22
72
  export declare class ImageSubmissionServiceImpl extends BaseService implements ImageSubmissionService {
23
73
  private httpsService;
74
+ private initialRequest?;
75
+ private nextCursor?;
24
76
  onCreate(): void;
25
- submitImages(request: ImageSubmissionRequest): Observable<SubmittedImageResponse>;
77
+ submit(request: SubmitImagesRequest): Observable<SubmitImagesResponse>;
78
+ loadInitialSubmissions(request: GetImageSubmissionsRequest): Observable<GetImageSubmissionsResponse>;
79
+ loadMoreSubmissions(): Observable<GetImageSubmissionsResponse>;
80
+ approve(request: ApproveImageSubmissionRequest): Observable<ApproveImageSubmissionResponse>;
81
+ reject(request: RejectImageSubmissionRequest): Observable<RejectImageSubmissionResponse>;
82
+ update(request: UpdateImageSubmissionRequest): Observable<UpdateImageSubmissionResponse>;
83
+ hasMoreResultsAvailable(): boolean;
84
+ private fetchSubmissionsPage;
26
85
  }
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";var __extends=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),__decorate=this&&this.__decorate||function(e,t,r,o){var i,n=arguments.length,s=n<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--)(i=e[c])&&(s=(n<3?i(s):n>3?i(t,r,s):i(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s};Object.defineProperty(exports,"__esModule",{value:!0}),exports.ImageSubmissionServiceImpl=void 0;var core_1=require("../../core"),ImageSubmissionServiceImpl=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.onCreate=function(){this.httpsService=this.serviceProvider.getService(core_1.HttpsService)},t.prototype.submitImages=function(e){var t=new FormData;if(!e.organization)throw new Error("Organization is required");if(!e.images.length)throw new Error("Images are required");if(!e.files.length)throw new Error("Files are required");return t.append("images",JSON.stringify({organization:e.organization,images:e.images})),e.files.forEach((function(e){t.append("files",e,e.name)})),this.httpsService.post("submissions/images/upload",t,void 0,core_1.BACKEND_SERVICE.DATACURATION,{"Content-Type":"multipart/form-data"})},t=__decorate([(0,core_1.InjectionIdentifier)("ImageSubmissionService")],t)}(core_1.BaseService);exports.ImageSubmissionServiceImpl=ImageSubmissionServiceImpl;
2
+ "use strict";var __extends=this&&this.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,e){r.__proto__=e}||function(r,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])},r(e,t)};return function(e,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=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(r){for(var e,t=1,i=arguments.length;t<i;t++)for(var n in e=arguments[t])Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},__assign.apply(this,arguments)},__decorate=this&&this.__decorate||function(r,e,t,i){var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(n=r[a])&&(s=(o<3?n(s):o>3?n(e,t,s):n(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s};Object.defineProperty(exports,"__esModule",{value:!0}),exports.ImageSubmissionServiceImpl=void 0;var rxjs_1=require("rxjs"),core_1=require("../../core"),ImageSubmissionServiceImpl=function(r){function e(){return null!==r&&r.apply(this,arguments)||this}return __extends(e,r),e.prototype.onCreate=function(){this.httpsService=this.serviceProvider.getService(core_1.HttpsService)},e.prototype.submit=function(r){var e=new FormData;return r.organization?r.images.length?r.files.length?(e.append("images",JSON.stringify({organization:r.organization,images:r.images})),r.files.forEach((function(r){e.append("files",r,r.name)})),this.httpsService.post("submissions/images/upload",e,void 0,core_1.BACKEND_SERVICE.DATACURATION,{"Content-Type":"multipart/form-data"})):(0,rxjs_1.throwError)((function(){return new Error("Files are required")})):(0,rxjs_1.throwError)((function(){return new Error("Images are required")})):(0,rxjs_1.throwError)((function(){return new Error("Organization is required")}))},e.prototype.loadInitialSubmissions=function(r){return this.initialRequest=__assign({},r),this.nextCursor=void 0,this.fetchSubmissionsPage(r)},e.prototype.loadMoreSubmissions=function(){if(!this.initialRequest)return(0,rxjs_1.throwError)((function(){return new Error("Initial request is not set. Call loadInitialSubmissions first.")}));if(!this.nextCursor)return(0,rxjs_1.throwError)((function(){return new Error("No more pages available")}));var r=__assign(__assign({},this.initialRequest),{cursor:this.nextCursor});return this.fetchSubmissionsPage(r)},e.prototype.approve=function(r){return r.organization?r.imageIds.length?this.httpsService.post("submissions/images/approve",r,void 0,core_1.BACKEND_SERVICE.DATACURATION):(0,rxjs_1.throwError)((function(){return new Error("Image IDs are required")})):(0,rxjs_1.throwError)((function(){return new Error("Organization is required")}))},e.prototype.reject=function(r){return r.organization?r.imageIds.length?this.httpsService.post("submissions/images/reject",r,void 0,core_1.BACKEND_SERVICE.DATACURATION):(0,rxjs_1.throwError)((function(){return new Error("Image IDs are required")})):(0,rxjs_1.throwError)((function(){return new Error("Organization is required")}))},e.prototype.update=function(r){return r.organization?r.images.length?this.httpsService.patch("submissions/images/update",r,void 0,core_1.BACKEND_SERVICE.DATACURATION):(0,rxjs_1.throwError)((function(){return new Error("Images are required")})):(0,rxjs_1.throwError)((function(){return new Error("Organization is required")}))},e.prototype.hasMoreResultsAvailable=function(){return!!this.nextCursor},e.prototype.fetchSubmissionsPage=function(r){var e=this;if(!r.language)return(0,rxjs_1.throwError)((function(){return new Error("Language is required")}));var t=Object.entries(r).map((function(r){var e,t=r[0],i=r[1];return(e={})[t]=i,e}));return this.httpsService.get("submissions/images",t,core_1.BACKEND_SERVICE.DATACURATION).pipe((0,rxjs_1.tap)((function(r){if(r.next){var t=new URL(r.next).searchParams;e.nextCursor=t.get("cursor")}else e.nextCursor=void 0})))},e=__decorate([(0,core_1.InjectionIdentifier)("ImageSubmissionService")],e)}(core_1.BaseService);exports.ImageSubmissionServiceImpl=ImageSubmissionServiceImpl;
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- export declare const SDK_VERSION_NUMBER = "14.5.0";
2
+ export declare const SDK_VERSION_NUMBER = "14.6.0";
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SDK_VERSION_NUMBER=void 0,exports.SDK_VERSION_NUMBER="14.5.0";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SDK_VERSION_NUMBER=void 0,exports.SDK_VERSION_NUMBER="14.6.0";
package/index.d.ts CHANGED
@@ -25,7 +25,7 @@ import { RelatedPartsService } from './data/services/related-parts.service';
25
25
  import { ApiKeyService } from './management';
26
26
  import { PartEnrichmentService } from './data/services/part-enrichment.service';
27
27
  import { ImagesService } from './catalog/services/images.service';
28
- import { ImageSubmissionService } from './datacuration/services/image-submission.service';
28
+ import { ImageSubmissionService } from './datacuration';
29
29
  export declare enum INITIALIZATION_STATUS {
30
30
  NOT_INITIALIZED = 0,
31
31
  INITIALIZING = 1,
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Partium=exports.INITIALIZATION_STATUS=void 0;var INITIALIZATION_STATUS,rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),core_1=require("./core"),auth_config_1=require("./core/models/auth-config"),partium_config_1=require("./core/models/partium-config"),backend_status_service_1=require("./core/services/backend-status.service"),device_status_service_interface_1=require("./core/services/device-status.service.interface"),file_service_interface_1=require("./core/services/file.service.interface"),file_transfer_service_interface_1=require("./core/services/http/file-transfer/file-transfer.service.interface"),https_client_service_interface_1=require("./core/services/http/https-client/https-client.service.interface"),https_service_interface_1=require("./core/services/http/https.service.interface"),local_storage_service_interface_1=require("./core/services/local-storage.service.interface"),log_service_1=require("./core/services/log.service"),service_provider_1=require("./core/services/service-provider"),session_service_interface_1=require("./core/services/session/session.service.interface"),data_1=require("./data"),filter_service_1=require("./data/services/filter.service"),part_attribute_service_1=require("./data/services/part-attribute.service"),part_service_1=require("./data/services/part.service"),request_list_service_1=require("./user-data/services/request-list/request-list.service"),favorite_service_1=require("./user-data/services/favorite/favorite.service"),asset_service_1=require("./find/services/asset.service"),search_service_1=require("./find/services/search/search.service"),sdk_version_1=require("./gen/sdk-version"),recent_text_search_queries_service_1=require("./find/services/search/recent-text-search-queries.service"),ocr_1=require("./ocr"),shopping_cart_service_1=require("./data/services/shopping-cart.service"),inquiry_service_1=require("./data/services/inquiry.service"),announcement_service_1=require("./data/services/announcement.service"),related_parts_service_1=require("./data/services/related-parts.service"),constants_1=require("./core/constants/constants"),management_1=require("./management"),part_enrichment_service_1=require("./data/services/part-enrichment.service"),images_service_1=require("./catalog/services/images.service"),image_submission_service_1=require("./datacuration/services/image-submission.service");!function(e){e[e.NOT_INITIALIZED=0]="NOT_INITIALIZED",e[e.INITIALIZING=1]="INITIALIZING",e[e.INITIALIZED=2]="INITIALIZED",e[e.INITIALIZATION_ERROR=3]="INITIALIZATION_ERROR"}(INITIALIZATION_STATUS||(exports.INITIALIZATION_STATUS=INITIALIZATION_STATUS={}));var Partium=function(){function e(){}return Object.defineProperty(e,"search",{get:function(){return e.getService(search_service_1.SearchServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"asset",{get:function(){return e.getService(asset_service_1.AssetServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"https",{get:function(){return e.getService(https_service_interface_1.HttpsService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"fileTransfer",{get:function(){return e.getService(file_transfer_service_interface_1.FileTransferService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"session",{get:function(){return e.getService(session_service_interface_1.SessionService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"assemblyHierarchyNode",{get:function(){return e.getService(data_1.AssemblyHierarchyNodesServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"part",{get:function(){return e.getService(part_service_1.PartServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"partEnrichment",{get:function(){return e.getService(part_enrichment_service_1.PartEnrichmentServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"relatedParts",{get:function(){return e.getService(related_parts_service_1.RelatedPartsServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"requestList",{get:function(){return e.getService(request_list_service_1.RequestListServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"shoppingCart",{get:function(){return e.getService(shopping_cart_service_1.ShoppingCartServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"partAttribute",{get:function(){return e.getService(part_attribute_service_1.PartAttributeServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"inquiry",{get:function(){return e.getService(inquiry_service_1.InquiryServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"announcement",{get:function(){return e.getService(announcement_service_1.AnnouncementServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"customerServiceAssistance",{get:function(){return e.getService(data_1.CustomerServiceAssistanceServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"log",{get:function(){return e.getService(log_service_1.LogServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"file",{get:function(){return e.getService(file_service_interface_1.FileService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"recentParts",{get:function(){return e.getService(core_1.RecentPartsServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"favorites",{get:function(){return e.getService(favorite_service_1.FavoriteServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"filters",{get:function(){return e.getService(filter_service_1.FilterServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"organization",{get:function(){return e.getService(core_1.OrganizationService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ocr",{get:function(){return e.getService(ocr_1.OcrServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"apiKey",{get:function(){return e.getService(management_1.ApiKeyServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"localStorage",{get:function(){return e.getService(local_storage_service_interface_1.LocalStorageService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"images",{get:function(){return e.getService(images_service_1.ImagesServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"imageSubmission",{get:function(){return e.getService(image_submission_service_1.ImageSubmissionServiceImpl)},enumerable:!1,configurable:!0}),e.init=function(r){e._initializationStatus$.next(INITIALIZATION_STATUS.INITIALIZING),e._serviceProvider||(e._serviceProvider=new service_provider_1.ServiceProvider);var i=[r.partiumApiBaseUrl,r.partiumLoginUrl];switch(e._serviceProvider.useService(r.httpsClientService,https_client_service_interface_1.HttpsClientService,i),e._serviceProvider.useService(r.fileTransferService,file_transfer_service_interface_1.FileTransferService,i),e._serviceProvider.useService(r.localStorageService,local_storage_service_interface_1.LocalStorageService),e._serviceProvider.useService(r.deviceStatusService,device_status_service_interface_1.DeviceStatusService),e._serviceProvider.useService(r.fileService,file_service_interface_1.FileService),r.authenticationMethod){case partium_config_1.AUTHENTICATION_METHOD.OAUTH_API_KEY:case partium_config_1.AUTHENTICATION_METHOD.OAUTH:e._serviceProvider.useService(r.authenticationConfig.oauthHttpsService,https_service_interface_1.HttpsService),e._serviceProvider.useService(r.authenticationConfig.oauthSessionService,session_service_interface_1.SessionService)}e._serviceProvider.serviceSelectionFinished();var t=e.getService(session_service_interface_1.SessionService),c=e.getService(local_storage_service_interface_1.LocalStorageService);t.registerLoginInitService(c,1);var n=e.getService(asset_service_1.AssetServiceImpl);t.registerLoginInitService(n,2);var s=e.getService(core_1.RecentPartsServiceImpl);t.registerLoginInitService(s,2);var a=e.getService(recent_text_search_queries_service_1.RecentTextSearchQueriesServiceImpl);t.registerLoginInitService(a,2);var _=e.getService(favorite_service_1.FavoriteServiceImpl);t.registerLoginInitService(_,2);var o=e.getService(data_1.CustomerServiceAssistanceServiceImpl);t.registerLoginInitService(o,2);var u=e.getService(search_service_1.SearchServiceImpl);t.registerLoginInitService(u,2);var v=e.getService(log_service_1.LogServiceImpl);t.registerLoginInitService(v,2);var l=e.getService(https_service_interface_1.HttpsService),I=e.getService(backend_status_service_1.BackendStatusService);return I.init(sdk_version_1.SDK_VERSION_NUMBER,"en",e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_STATUS_API_URL]),constants_1.BACKEND_STATUS_FALLBACK_URL),I.checkCompatibility().pipe((0,operators_1.mergeMap)((function(){return I.checkAvailability()})),(0,operators_1.mergeMap)((function(){return t.init(r)})),(0,operators_1.mergeMap)((function(){return l.init({partiumApiBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION)]),findBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_FIND_API_URL]),dataBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_DATA_API_URL]),csaBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_CSA_API_URL]),logBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_LOGS_API_URL]),userDataBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_USER_DATA_API_URL]),ocrBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_OCR_API_URL]),managementBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_MANAGEMENT_API_URL]),catalogBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_CATALOG_API_URL]),datacurationBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_DATACURATION_API_URL])},r.authenticationConfig)})),(0,operators_1.tap)((function(){l.setCurrentOrganization(t.getCurrentOrganization$())})),(0,operators_1.tap)((function(){e._initializationStatus$.next(INITIALIZATION_STATUS.INITIALIZED)})),(0,operators_1.catchError)((function(r){return e._initializationStatus$.next(INITIALIZATION_STATUS.INITIALIZATION_ERROR),e.reset(),(0,rxjs_1.throwError)(r)})))},e.initApiKey=function(r){return e.init(new partium_config_1.PartiumConfig({authenticationConfig:new auth_config_1.OauthApiKeyAuthenticationConfig({apiKey:r})}))},e.reset=function(){e._serviceProvider=null,e._initializationStatus$.next(INITIALIZATION_STATUS.NOT_INITIALIZED)},e.getInitializationStatus=function(){return e._initializationStatus$.asObservable()},e.getOrganizations=function(){return e.ensureInitialized(),e.getService(core_1.OrganizationService).getOrganizations()},e.useOrganization=function(r){return e.ensureInitialized(),e.session.useOrganization(r)},e.getService=function(r){return e._serviceProvider||(e._serviceProvider=new service_provider_1.ServiceProvider),e._serviceProvider.getService(r)},e.isInitialized=function(){return e._initializationStatus$.value===INITIALIZATION_STATUS.INITIALIZED},e.ensureInitialized=function(){if(!e.isInitialized())throw"Partium-JS-SDK not initialized. Make sure to initialize the Partium-JS-SDK before you try to use it's features!"},e.buildUrl=function(e){for(var r=[],i=0,t=e;i<t.length;i++){var c=t[i];r.push(c.replace(/^\/+/,"").replace(/\/+$/,""))}return r.join("/")},e._initializationStatus$=new rxjs_1.BehaviorSubject(INITIALIZATION_STATUS.NOT_INITIALIZED),e}();exports.Partium=Partium;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Partium=exports.INITIALIZATION_STATUS=void 0;var INITIALIZATION_STATUS,rxjs_1=require("rxjs"),operators_1=require("rxjs/operators"),core_1=require("./core"),auth_config_1=require("./core/models/auth-config"),partium_config_1=require("./core/models/partium-config"),backend_status_service_1=require("./core/services/backend-status.service"),device_status_service_interface_1=require("./core/services/device-status.service.interface"),file_service_interface_1=require("./core/services/file.service.interface"),file_transfer_service_interface_1=require("./core/services/http/file-transfer/file-transfer.service.interface"),https_client_service_interface_1=require("./core/services/http/https-client/https-client.service.interface"),https_service_interface_1=require("./core/services/http/https.service.interface"),local_storage_service_interface_1=require("./core/services/local-storage.service.interface"),log_service_1=require("./core/services/log.service"),service_provider_1=require("./core/services/service-provider"),session_service_interface_1=require("./core/services/session/session.service.interface"),data_1=require("./data"),filter_service_1=require("./data/services/filter.service"),part_attribute_service_1=require("./data/services/part-attribute.service"),part_service_1=require("./data/services/part.service"),request_list_service_1=require("./user-data/services/request-list/request-list.service"),favorite_service_1=require("./user-data/services/favorite/favorite.service"),asset_service_1=require("./find/services/asset.service"),search_service_1=require("./find/services/search/search.service"),sdk_version_1=require("./gen/sdk-version"),recent_text_search_queries_service_1=require("./find/services/search/recent-text-search-queries.service"),ocr_1=require("./ocr"),shopping_cart_service_1=require("./data/services/shopping-cart.service"),inquiry_service_1=require("./data/services/inquiry.service"),announcement_service_1=require("./data/services/announcement.service"),related_parts_service_1=require("./data/services/related-parts.service"),constants_1=require("./core/constants/constants"),management_1=require("./management"),part_enrichment_service_1=require("./data/services/part-enrichment.service"),images_service_1=require("./catalog/services/images.service"),datacuration_1=require("./datacuration");!function(e){e[e.NOT_INITIALIZED=0]="NOT_INITIALIZED",e[e.INITIALIZING=1]="INITIALIZING",e[e.INITIALIZED=2]="INITIALIZED",e[e.INITIALIZATION_ERROR=3]="INITIALIZATION_ERROR"}(INITIALIZATION_STATUS||(exports.INITIALIZATION_STATUS=INITIALIZATION_STATUS={}));var Partium=function(){function e(){}return Object.defineProperty(e,"search",{get:function(){return e.getService(search_service_1.SearchServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"asset",{get:function(){return e.getService(asset_service_1.AssetServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"https",{get:function(){return e.getService(https_service_interface_1.HttpsService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"fileTransfer",{get:function(){return e.getService(file_transfer_service_interface_1.FileTransferService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"session",{get:function(){return e.getService(session_service_interface_1.SessionService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"assemblyHierarchyNode",{get:function(){return e.getService(data_1.AssemblyHierarchyNodesServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"part",{get:function(){return e.getService(part_service_1.PartServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"partEnrichment",{get:function(){return e.getService(part_enrichment_service_1.PartEnrichmentServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"relatedParts",{get:function(){return e.getService(related_parts_service_1.RelatedPartsServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"requestList",{get:function(){return e.getService(request_list_service_1.RequestListServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"shoppingCart",{get:function(){return e.getService(shopping_cart_service_1.ShoppingCartServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"partAttribute",{get:function(){return e.getService(part_attribute_service_1.PartAttributeServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"inquiry",{get:function(){return e.getService(inquiry_service_1.InquiryServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"announcement",{get:function(){return e.getService(announcement_service_1.AnnouncementServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"customerServiceAssistance",{get:function(){return e.getService(data_1.CustomerServiceAssistanceServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"log",{get:function(){return e.getService(log_service_1.LogServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"file",{get:function(){return e.getService(file_service_interface_1.FileService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"recentParts",{get:function(){return e.getService(core_1.RecentPartsServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"favorites",{get:function(){return e.getService(favorite_service_1.FavoriteServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"filters",{get:function(){return e.getService(filter_service_1.FilterServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"organization",{get:function(){return e.getService(core_1.OrganizationService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ocr",{get:function(){return e.getService(ocr_1.OcrServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"apiKey",{get:function(){return e.getService(management_1.ApiKeyServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"localStorage",{get:function(){return e.getService(local_storage_service_interface_1.LocalStorageService)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"images",{get:function(){return e.getService(images_service_1.ImagesServiceImpl)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"imageSubmission",{get:function(){return e.getService(datacuration_1.ImageSubmissionServiceImpl)},enumerable:!1,configurable:!0}),e.init=function(r){e._initializationStatus$.next(INITIALIZATION_STATUS.INITIALIZING),e._serviceProvider||(e._serviceProvider=new service_provider_1.ServiceProvider);var i=[r.partiumApiBaseUrl,r.partiumLoginUrl];switch(e._serviceProvider.useService(r.httpsClientService,https_client_service_interface_1.HttpsClientService,i),e._serviceProvider.useService(r.fileTransferService,file_transfer_service_interface_1.FileTransferService,i),e._serviceProvider.useService(r.localStorageService,local_storage_service_interface_1.LocalStorageService),e._serviceProvider.useService(r.deviceStatusService,device_status_service_interface_1.DeviceStatusService),e._serviceProvider.useService(r.fileService,file_service_interface_1.FileService),r.authenticationMethod){case partium_config_1.AUTHENTICATION_METHOD.OAUTH_API_KEY:case partium_config_1.AUTHENTICATION_METHOD.OAUTH:e._serviceProvider.useService(r.authenticationConfig.oauthHttpsService,https_service_interface_1.HttpsService),e._serviceProvider.useService(r.authenticationConfig.oauthSessionService,session_service_interface_1.SessionService)}e._serviceProvider.serviceSelectionFinished();var t=e.getService(session_service_interface_1.SessionService),c=e.getService(local_storage_service_interface_1.LocalStorageService);t.registerLoginInitService(c,1);var n=e.getService(asset_service_1.AssetServiceImpl);t.registerLoginInitService(n,2);var s=e.getService(core_1.RecentPartsServiceImpl);t.registerLoginInitService(s,2);var a=e.getService(recent_text_search_queries_service_1.RecentTextSearchQueriesServiceImpl);t.registerLoginInitService(a,2);var o=e.getService(favorite_service_1.FavoriteServiceImpl);t.registerLoginInitService(o,2);var _=e.getService(data_1.CustomerServiceAssistanceServiceImpl);t.registerLoginInitService(_,2);var u=e.getService(search_service_1.SearchServiceImpl);t.registerLoginInitService(u,2);var v=e.getService(log_service_1.LogServiceImpl);t.registerLoginInitService(v,2);var l=e.getService(https_service_interface_1.HttpsService),I=e.getService(backend_status_service_1.BackendStatusService);return I.init(sdk_version_1.SDK_VERSION_NUMBER,"en",e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_STATUS_API_URL]),constants_1.BACKEND_STATUS_FALLBACK_URL),I.checkCompatibility().pipe((0,operators_1.mergeMap)((function(){return I.checkAvailability()})),(0,operators_1.mergeMap)((function(){return t.init(r)})),(0,operators_1.mergeMap)((function(){return l.init({partiumApiBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION)]),findBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_FIND_API_URL]),dataBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_DATA_API_URL]),csaBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_CSA_API_URL]),logBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_LOGS_API_URL]),userDataBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_USER_DATA_API_URL]),ocrBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_OCR_API_URL]),managementBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_MANAGEMENT_API_URL]),catalogBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_CATALOG_API_URL]),datacurationBeBaseUrl:e.buildUrl([r.partiumApiBaseUrl,"".concat(constants_1.PARTIUM_API_VERSION),constants_1.REL_DATACURATION_API_URL])},r.authenticationConfig)})),(0,operators_1.tap)((function(){l.setCurrentOrganization(t.getCurrentOrganization$())})),(0,operators_1.tap)((function(){e._initializationStatus$.next(INITIALIZATION_STATUS.INITIALIZED)})),(0,operators_1.catchError)((function(r){return e._initializationStatus$.next(INITIALIZATION_STATUS.INITIALIZATION_ERROR),e.reset(),(0,rxjs_1.throwError)(r)})))},e.initApiKey=function(r){return e.init(new partium_config_1.PartiumConfig({authenticationConfig:new auth_config_1.OauthApiKeyAuthenticationConfig({apiKey:r})}))},e.reset=function(){e._serviceProvider=null,e._initializationStatus$.next(INITIALIZATION_STATUS.NOT_INITIALIZED)},e.getInitializationStatus=function(){return e._initializationStatus$.asObservable()},e.getOrganizations=function(){return e.ensureInitialized(),e.getService(core_1.OrganizationService).getOrganizations()},e.useOrganization=function(r){return e.ensureInitialized(),e.session.useOrganization(r)},e.getService=function(r){return e._serviceProvider||(e._serviceProvider=new service_provider_1.ServiceProvider),e._serviceProvider.getService(r)},e.isInitialized=function(){return e._initializationStatus$.value===INITIALIZATION_STATUS.INITIALIZED},e.ensureInitialized=function(){if(!e.isInitialized())throw"Partium-JS-SDK not initialized. Make sure to initialize the Partium-JS-SDK before you try to use it's features!"},e.buildUrl=function(e){for(var r=[],i=0,t=e;i<t.length;i++){var c=t[i];r.push(c.replace(/^\/+/,"").replace(/\/+$/,""))}return r.join("/")},e._initializationStatus$=new rxjs_1.BehaviorSubject(INITIALIZATION_STATUS.NOT_INITIALIZED),e}();exports.Partium=Partium;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@partium/js-sdk",
3
- "version": "14.5.0",
3
+ "version": "14.6.0",
4
4
  "author": "Partium Inc.",
5
5
  "license": "See LICENSE.txt",
6
6
  "description": "The Partium Find SDK enables integration of Partium’s parts and materials search capabilities into JavaScript-based applications.",
@@ -1,55 +0,0 @@
1
- // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- /**
3
- * The content type of a submission image.
4
- *
5
- * @see SubmissionImageMetadata
6
- */
7
- export declare enum SubmissionImageContentType {
8
- /**
9
- * The part itself.
10
- */
11
- PART = "part",
12
- /**
13
- * Part's label, specifications sheet, or similar.
14
- */
15
- SPECIFICATIONS = "specifications",
16
- /**
17
- * An assembly, box, etc.
18
- */
19
- OTHER = "other"
20
- }
21
- /**
22
- * Metadata for a submission image.
23
- *
24
- * @see ImageSubmissionRequest
25
- */
26
- export interface SubmissionImageMetadata {
27
- /**
28
- * The external ID of the part.
29
- */
30
- partId: string;
31
- /**
32
- * The content type of the submission image.
33
- */
34
- content: SubmissionImageContentType;
35
- }
36
- /**
37
- * Request for submitting images.
38
- *
39
- * @see SubmissionImageMetadata
40
- */
41
- export interface ImageSubmissionRequest {
42
- /**
43
- * The organization name.
44
- */
45
- organization: string;
46
- /**
47
- * Array of image metadata corresponding to each file
48
- * The array indices should match between files and images arrays
49
- */
50
- images: SubmissionImageMetadata[];
51
- /**
52
- * Array of File objects containing the image data to upload
53
- */
54
- files: File[];
55
- }
@@ -1,2 +0,0 @@
1
- // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
- "use strict";var SubmissionImageContentType;Object.defineProperty(exports,"__esModule",{value:!0}),exports.SubmissionImageContentType=void 0,function(e){e.PART="part",e.SPECIFICATIONS="specifications",e.OTHER="other"}(SubmissionImageContentType||(exports.SubmissionImageContentType=SubmissionImageContentType={}));