@partium/js-sdk 14.6.0 → 14.8.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.
@@ -7,6 +7,7 @@ export * from './models/get-image-submissions-response';
7
7
  export * from './models/image-submission-content-type';
8
8
  export * from './models/image-submission-status';
9
9
  export * from './models/image-submission';
10
+ export * from './models/image-submission-pagination-context';
10
11
  export * from './models/reject-image-submission-request';
11
12
  export * from './models/reject-image-submission-response';
12
13
  export * from './models/submit-images-request';
@@ -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,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);
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/image-submission-pagination-context"),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);
@@ -6,7 +6,7 @@ export interface ApproveImageSubmissionRequest {
6
6
  /**
7
7
  * The organization name.
8
8
  */
9
- organization: string;
9
+ organization?: string;
10
10
  /**
11
11
  * The IDs of the images to approve.
12
12
  */
@@ -2,9 +2,9 @@
2
2
  import { BaseSubmissionResponse } from './base-submission-response';
3
3
  import { ImageSubmission } from './image-submission';
4
4
  /**
5
- * A part image submission.
5
+ * A part with image submissions.
6
6
  */
7
- export interface PartImageSubmission {
7
+ export interface PartWithImageSubmissions {
8
8
  /**
9
9
  * The ID of the part.
10
10
  */
@@ -17,19 +17,31 @@ export interface PartImageSubmission {
17
17
  * The language of the part name.
18
18
  */
19
19
  partNameLanguage: string;
20
+ /**
21
+ * The URL of the primary image of the part.
22
+ */
23
+ partPrimaryImageUrl?: string;
24
+ /**
25
+ * The expiration date of the primary image of the part.
26
+ */
27
+ partPrimaryImageUrlExpireAt?: string;
28
+ /**
29
+ * The number of images of the part.
30
+ */
31
+ partImageCount: number;
20
32
  /**
21
33
  * The images of the part.
22
34
  */
23
35
  images: ImageSubmission[];
24
36
  }
25
37
  /**
26
- * Response for getting image submissions.
38
+ * Response for getting parts with image submissions.
27
39
  */
28
40
  export interface GetImageSubmissionsResponse extends BaseSubmissionResponse {
29
41
  /**
30
- * The part image submissions.
42
+ * The part with image submissions.
31
43
  */
32
- results?: PartImageSubmission[];
44
+ results?: PartWithImageSubmissions[];
33
45
  /**
34
46
  * The next cursor to get the next page of image submissions.
35
47
  */
@@ -0,0 +1,15 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ import { GetImageSubmissionsRequest } from './get-image-submissions-request';
3
+ /**
4
+ * Pagination context for image submissions, containing the initial request and cursor state.
5
+ */
6
+ export interface ImageSubmissionPaginationContext {
7
+ /**
8
+ * The original request parameters used for the initial query.
9
+ */
10
+ initialRequest: GetImageSubmissionsRequest;
11
+ /**
12
+ * The cursor for the next page of results, if available.
13
+ */
14
+ nextCursor?: string;
15
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright © 2022-2025 Partium, Inc. DBA Partium
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -6,7 +6,7 @@ export interface RejectImageSubmissionRequest {
6
6
  /**
7
7
  * The organization name.
8
8
  */
9
- organization: string;
9
+ organization?: string;
10
10
  /**
11
11
  * The IDs of the images to reject.
12
12
  */
@@ -20,7 +20,7 @@ export interface SubmitImagesRequest {
20
20
  /**
21
21
  * The organization name.
22
22
  */
23
- organization: string;
23
+ organization?: string;
24
24
  /**
25
25
  * Array of image metadata corresponding to each file
26
26
  * The array indices should match between files and images arrays
@@ -61,7 +61,7 @@ export interface UpdateImageSubmissionRequest {
61
61
  /**
62
62
  * The organization name.
63
63
  */
64
- organization: string;
64
+ organization?: string;
65
65
  /**
66
66
  * The images to update.
67
67
  */
@@ -11,6 +11,7 @@ import { RejectImageSubmissionRequest } from '../models/reject-image-submission-
11
11
  import { RejectImageSubmissionResponse } from '../models/reject-image-submission-response';
12
12
  import { UpdateImageSubmissionRequest } from '../models/update-image-submission-request';
13
13
  import { UpdateImageSubmissionResponse } from '../models/update-image-submission-response';
14
+ import { ImageSubmissionPaginationContext } from '../models/image-submission-pagination-context';
14
15
  /**
15
16
  * Service for submitting images and metadata to the datacuration backend for AI ingestion.
16
17
  */
@@ -26,21 +27,28 @@ export interface ImageSubmissionService {
26
27
  * Gets image submissions.
27
28
  *
28
29
  * @param request - The request containing the parameters for the image submissions to get.
29
- * @returns An Observable that emits the image submissions.
30
+ * @returns An Observable that emits the image submissions with pagination context.
30
31
  * @throws An error if the language is not provided.
31
32
  */
32
- loadInitialSubmissions(request: GetImageSubmissionsRequest): Observable<GetImageSubmissionsResponse>;
33
+ loadInitialSubmissions(request: GetImageSubmissionsRequest): Observable<{
34
+ response: GetImageSubmissionsResponse;
35
+ paginationContext: ImageSubmissionPaginationContext;
36
+ }>;
33
37
  /**
34
- * Loads more image submissions using the initial request parameters.
38
+ * Loads more image submissions using the provided pagination context.
35
39
  *
36
- * @returns An Observable that emits the image submissions.
37
- * @throws An error if loadInitialSubmissions has not been called first.
40
+ * @param paginationContext - The pagination context from previous calls.
41
+ * @returns An Observable that emits the image submissions with updated pagination context.
42
+ * @throws An error if there are no more pages available.
38
43
  */
39
- loadMoreSubmissions(): Observable<GetImageSubmissionsResponse>;
44
+ loadMoreSubmissions(paginationContext: ImageSubmissionPaginationContext): Observable<{
45
+ response: GetImageSubmissionsResponse;
46
+ paginationContext: ImageSubmissionPaginationContext;
47
+ }>;
40
48
  /**
41
- * Returns true if there are more results available to load, false otherwise.
49
+ * Returns true if there are more results available to load based on the pagination context.
42
50
  */
43
- hasMoreResultsAvailable(): boolean;
51
+ hasMoreResultsAvailable(paginationContext: ImageSubmissionPaginationContext): boolean;
44
52
  /**
45
53
  * Approves image submissions.
46
54
  *
@@ -71,15 +79,20 @@ export interface ImageSubmissionService {
71
79
  }
72
80
  export declare class ImageSubmissionServiceImpl extends BaseService implements ImageSubmissionService {
73
81
  private httpsService;
74
- private initialRequest?;
75
- private nextCursor?;
76
82
  onCreate(): void;
77
83
  submit(request: SubmitImagesRequest): Observable<SubmitImagesResponse>;
78
- loadInitialSubmissions(request: GetImageSubmissionsRequest): Observable<GetImageSubmissionsResponse>;
79
- loadMoreSubmissions(): Observable<GetImageSubmissionsResponse>;
84
+ loadInitialSubmissions(request: GetImageSubmissionsRequest): Observable<{
85
+ response: GetImageSubmissionsResponse;
86
+ paginationContext: ImageSubmissionPaginationContext;
87
+ }>;
88
+ loadMoreSubmissions(paginationContext: ImageSubmissionPaginationContext): Observable<{
89
+ response: GetImageSubmissionsResponse;
90
+ paginationContext: ImageSubmissionPaginationContext;
91
+ }>;
80
92
  approve(request: ApproveImageSubmissionRequest): Observable<ApproveImageSubmissionResponse>;
81
93
  reject(request: RejectImageSubmissionRequest): Observable<RejectImageSubmissionResponse>;
82
94
  update(request: UpdateImageSubmissionRequest): Observable<UpdateImageSubmissionResponse>;
83
- hasMoreResultsAvailable(): boolean;
95
+ hasMoreResultsAvailable(paginationContext: ImageSubmissionPaginationContext): boolean;
84
96
  private fetchSubmissionsPage;
97
+ private extractNextCursor;
85
98
  }
@@ -1,2 +1,2 @@
1
1
  // Copyright © 2022-2025 Partium, Inc. DBA Partium
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;
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 n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r},__assign.apply(this,arguments)},__decorate=this&&this.__decorate||function(r,e,t,n){var o,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,t):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(r,e,t,n);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>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){var e=this;return this.fetchSubmissionsPage(r).pipe((0,rxjs_1.map)((function(t){return{response:t,paginationContext:{initialRequest:__assign({},r),nextCursor:e.extractNextCursor(t)}}})))},e.prototype.loadMoreSubmissions=function(r){var e=this;if(!r.nextCursor)return(0,rxjs_1.throwError)((function(){return new Error("No more pages available")}));var t=__assign(__assign({},r.initialRequest),{cursor:r.nextCursor});return this.fetchSubmissionsPage(t).pipe((0,rxjs_1.map)((function(t){return{response:t,paginationContext:__assign(__assign({},r),{nextCursor:e.extractNextCursor(t)})}})))},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(r){return!!r.nextCursor},e.prototype.fetchSubmissionsPage=function(r){if(!r.language)return(0,rxjs_1.throwError)((function(){return new Error("Language is required")}));var e=Object.entries(r).map((function(r){var e,t=r[0],n=r[1];return(e={})[t]=n,e}));return this.httpsService.get("submissions/images",e,core_1.BACKEND_SERVICE.DATACURATION)},e.prototype.extractNextCursor=function(r){if(r.next)return new URL(r.next).searchParams.get("cursor")||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.6.0";
2
+ export declare const SDK_VERSION_NUMBER = "14.8.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.6.0";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SDK_VERSION_NUMBER=void 0,exports.SDK_VERSION_NUMBER="14.8.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@partium/js-sdk",
3
- "version": "14.6.0",
3
+ "version": "14.8.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.",