@attlaz/client 1.109.0 → 1.110.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.
@@ -20,15 +20,14 @@ export declare class CrawlJobEndpoint extends Endpoint {
20
20
  create(vendorId: string, isPartial?: boolean): Promise<CrawlJob>;
21
21
  /** Update a crawl job's status ('started', 'finished', 'cancelled'). */
22
22
  updateStatus(crawlJobId: string, status: CrawlJobStatus): Promise<CrawlJob>;
23
- /** A vendor's crawl jobs (newest first), each with progress (`total` / `processed`). */
24
- getByVendor(vendorId: string, pagination?: CursorPagination | null): Promise<CollectionResult<CrawlJob>>;
25
23
  /**
26
- * Crawl jobs across every competitor of a catalog (newest first).
24
+ * Crawl jobs across every competitor of a catalog (newest first), each with progress
25
+ * (`total` / `processed`). Pass `vendorId` to narrow to one competitor.
27
26
  *
28
27
  * A crawl job belongs to a vendor, not to a catalog — the API resolves the catalog's competitors
29
- * and returns the jobs of their vendors.
28
+ * and returns the jobs of their vendors. A `vendorId` outside this catalog is rejected.
30
29
  */
31
- getByCatalog(catalogId: CatalogId | string, pagination?: CursorPagination | null): Promise<CollectionResult<CrawlJob>>;
30
+ getByCatalog(catalogId: CatalogId | string, pagination?: CursorPagination | null, vendorId?: string | null): Promise<CollectionResult<CrawlJob>>;
32
31
  /** The crawl job with this id, or null. */
33
32
  getById(crawlJobId: string): Promise<CrawlJob | null>;
34
33
  /** Register the pages this crawl will process (idempotent server-side). */
@@ -33,21 +33,19 @@ export class CrawlJobEndpoint extends Endpoint {
33
33
  }
34
34
  return job;
35
35
  }
36
- /** A vendor's crawl jobs (newest first), each with progress (`total` / `processed`). */
37
- async getByVendor(vendorId, pagination = null) {
38
- const queryString = new QueryString(path('/pulse/vendors/:vendorId/crawl-jobs', { vendorId }));
39
- queryString.addPagination(pagination);
40
- return await this.requestCollection(queryString, CrawlJob.parse);
41
- }
42
36
  /**
43
- * Crawl jobs across every competitor of a catalog (newest first).
37
+ * Crawl jobs across every competitor of a catalog (newest first), each with progress
38
+ * (`total` / `processed`). Pass `vendorId` to narrow to one competitor.
44
39
  *
45
40
  * A crawl job belongs to a vendor, not to a catalog — the API resolves the catalog's competitors
46
- * and returns the jobs of their vendors.
41
+ * and returns the jobs of their vendors. A `vendorId` outside this catalog is rejected.
47
42
  */
48
- async getByCatalog(catalogId, pagination = null) {
43
+ async getByCatalog(catalogId, pagination = null, vendorId = null) {
49
44
  const queryString = new QueryString(path('/pulse/catalogs/:catalogId/crawl-jobs', { catalogId: catalogId.toString() }));
50
45
  queryString.addPagination(pagination);
46
+ if (vendorId !== null) {
47
+ queryString.set('vendor', vendorId);
48
+ }
51
49
  return await this.requestCollection(queryString, CrawlJob.parse);
52
50
  }
53
51
  /** The crawl job with this id, or null. */
@@ -9,10 +9,11 @@ import { VendorStatus } from '../Model/VendorStatus.js';
9
9
  * can be matched — and the resulting per-vendor freshness status.
10
10
  */
11
11
  export declare class IndexJobEndpoint extends Endpoint {
12
- /** Index jobs across every competitor of a catalog, newest first. */
13
- getByCatalog(catalogId: CatalogId | string, pagination?: CursorPagination | null): Promise<CollectionResult<IndexJob>>;
14
- /** Index jobs of one competitor. */
15
- getByVendor(catalogId: CatalogId | string, vendorId: string, pagination?: CursorPagination | null): Promise<CollectionResult<IndexJob>>;
12
+ /**
13
+ * Index jobs across every competitor of a catalog, newest first. Pass `vendorId` to narrow to one
14
+ * competitor; a vendor outside this catalog is rejected.
15
+ */
16
+ getByCatalog(catalogId: CatalogId | string, pagination?: CursorPagination | null, vendorId?: string | null): Promise<CollectionResult<IndexJob>>;
16
17
  /** Queue a re-index of a competitor's products, so later matching sees current data. */
17
18
  requestReindex(catalogId: CatalogId | string, vendorId: string): Promise<void>;
18
19
  /** How fresh a competitor's index and matches are, plus any match job running right now. */
@@ -8,16 +8,16 @@ import { VendorStatus } from '../Model/VendorStatus.js';
8
8
  * can be matched — and the resulting per-vendor freshness status.
9
9
  */
10
10
  export class IndexJobEndpoint extends Endpoint {
11
- /** Index jobs across every competitor of a catalog, newest first. */
12
- async getByCatalog(catalogId, pagination = null) {
11
+ /**
12
+ * Index jobs across every competitor of a catalog, newest first. Pass `vendorId` to narrow to one
13
+ * competitor; a vendor outside this catalog is rejected.
14
+ */
15
+ async getByCatalog(catalogId, pagination = null, vendorId = null) {
13
16
  const queryString = new QueryString(path('/pulse/catalogs/:catalogId/index-jobs', { catalogId: catalogId.toString() }));
14
17
  queryString.addPagination(pagination);
15
- return await this.requestCollection(queryString, IndexJob.parse);
16
- }
17
- /** Index jobs of one competitor. */
18
- async getByVendor(catalogId, vendorId, pagination = null) {
19
- const queryString = new QueryString(path('/pulse/catalogs/:catalogId/vendors/:vendorId/index-jobs', { catalogId: catalogId.toString(), vendorId }));
20
- queryString.addPagination(pagination);
18
+ if (vendorId !== null) {
19
+ queryString.set('vendor', vendorId);
20
+ }
21
21
  return await this.requestCollection(queryString, IndexJob.parse);
22
22
  }
23
23
  /** Queue a re-index of a competitor's products, so later matching sees current data. */
@@ -8,10 +8,11 @@ import { Endpoint } from '../../Service/Endpoint.js';
8
8
  * so they share {@link ProductMatchJob}.
9
9
  */
10
10
  export declare class ProductMatchJobEndpoint extends Endpoint {
11
- /** Every match job of a catalog, newest first. */
12
- getByCatalog(catalogId: CatalogId | string, pagination?: CursorPagination | null): Promise<CollectionResult<ProductMatchJob>>;
13
- /** The match jobs of one of the catalog's competitors. */
14
- getByVendor(catalogId: CatalogId | string, vendorId: string, pagination?: CursorPagination | null): Promise<CollectionResult<ProductMatchJob>>;
11
+ /**
12
+ * Every match job of a catalog, newest first. Pass `vendorId` to narrow to one of its
13
+ * competitors; a vendor outside this catalog is rejected.
14
+ */
15
+ getByCatalog(catalogId: CatalogId | string, pagination?: CursorPagination | null, vendorId?: string | null): Promise<CollectionResult<ProductMatchJob>>;
15
16
  /** Queue a matching run of the catalog against one competitor. */
16
17
  requestMatching(catalogId: CatalogId | string, vendorId: string): Promise<void>;
17
18
  /** The match job with this id, or null. */
@@ -7,16 +7,16 @@ import { Endpoint } from '../../Service/Endpoint.js';
7
7
  * so they share {@link ProductMatchJob}.
8
8
  */
9
9
  export class ProductMatchJobEndpoint extends Endpoint {
10
- /** Every match job of a catalog, newest first. */
11
- async getByCatalog(catalogId, pagination = null) {
10
+ /**
11
+ * Every match job of a catalog, newest first. Pass `vendorId` to narrow to one of its
12
+ * competitors; a vendor outside this catalog is rejected.
13
+ */
14
+ async getByCatalog(catalogId, pagination = null, vendorId = null) {
12
15
  const queryString = new QueryString(path('/pulse/catalogs/:catalogId/match-jobs', { catalogId: catalogId.toString() }));
13
16
  queryString.addPagination(pagination);
14
- return await this.requestCollection(queryString, ProductMatchJob.parse);
15
- }
16
- /** The match jobs of one of the catalog's competitors. */
17
- async getByVendor(catalogId, vendorId, pagination = null) {
18
- const queryString = new QueryString(path('/pulse/catalogs/:catalogId/vendors/:vendorId/match-jobs', { catalogId: catalogId.toString(), vendorId }));
19
- queryString.addPagination(pagination);
17
+ if (vendorId !== null) {
18
+ queryString.set('vendor', vendorId);
19
+ }
20
20
  return await this.requestCollection(queryString, ProductMatchJob.parse);
21
21
  }
22
22
  /** Queue a matching run of the catalog against one competitor. */
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.108.0";
1
+ export declare const VERSION = "1.109.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "1.108.0";
1
+ export const VERSION = "1.109.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@attlaz/client",
3
- "version": "1.109.0",
3
+ "version": "1.110.0",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",