@attlaz/client 1.96.0 → 1.97.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/dist/Catalog/Service/CatalogEndpoint.js +2 -1
- package/dist/Catalog/Service/CatalogProductEndpoint.js +3 -2
- package/dist/Client.d.ts +12 -12
- package/dist/Client.js +12 -12
- package/dist/{EnhanceData → DataEnrichment}/Service/GenerateContentEndpoint.js +3 -2
- package/dist/DataQuality/Model/QualityReportEntity.d.ts +31 -0
- package/dist/DataQuality/Model/QualityReportEntity.js +44 -0
- package/dist/DataQuality/Model/QualityReportProblem.d.ts +22 -0
- package/dist/DataQuality/Model/QualityReportProblem.js +35 -0
- package/dist/DataQuality/Model/QualityReportResult.d.ts +9 -0
- package/dist/DataQuality/Model/QualityReportResult.js +14 -0
- package/dist/DataQuality/Model/QualityScan.d.ts +19 -0
- package/dist/DataQuality/Model/QualityScan.js +28 -0
- package/dist/DataQuality/Service/QualityEndpoint.d.ts +57 -0
- package/dist/DataQuality/Service/QualityEndpoint.js +107 -21
- package/dist/FeedManagement/Service/CatalogFeedEndpoint.js +2 -1
- package/dist/Flow/Service/FlowEndpoint.js +6 -5
- package/dist/Flow/Service/FlowRunEndpoint.js +8 -7
- package/dist/Flow/Service/FlowRunRequestEndpoint.js +2 -1
- package/dist/Flow/Service/FlowRunStatsEndpoint.js +2 -1
- package/dist/Helper/LoadAllHelper.js +7 -1
- package/dist/Http/Data/Path.d.ts +11 -0
- package/dist/Http/Data/Path.js +31 -0
- package/dist/Http/HttpClient.d.ts +8 -1
- package/dist/Http/HttpClient.js +21 -1
- package/dist/Http/OAuthClientOptions.d.ts +2 -0
- package/dist/Http/OAuthClientOptions.js +3 -0
- package/dist/Http/Transport/OAuthClient.d.ts +7 -0
- package/dist/Http/Transport/OAuthClient.js +31 -4
- package/dist/Logging/Service/LogEndpoint.d.ts +5 -1
- package/dist/Logging/Service/LogEndpoint.js +14 -8
- package/dist/{Pulse → MarketPulse}/Service/CompetitorEndpoint.js +4 -3
- package/dist/{Pulse → MarketPulse}/Service/CrawlJobEndpoint.d.ts +1 -0
- package/dist/{Pulse → MarketPulse}/Service/CrawlJobEndpoint.js +8 -6
- package/dist/{Pulse → MarketPulse}/Service/IndexJobEndpoint.js +5 -4
- package/dist/{Pulse → MarketPulse}/Service/PriceAlertEndpoint.js +8 -7
- package/dist/{Pulse → MarketPulse}/Service/PricingEndpoint.js +9 -8
- package/dist/{Pulse → MarketPulse}/Service/ProductGroupEndpoint.js +4 -3
- package/dist/{Pulse → MarketPulse}/Service/ProductMatchEndpoint.js +6 -5
- package/dist/{Pulse → MarketPulse}/Service/ProductMatchJobEndpoint.js +5 -4
- package/dist/{Pulse → MarketPulse}/Service/PulseCatalogProductEndpoint.js +4 -3
- package/dist/{Pulse → MarketPulse}/Service/PulseStatisticsEndpoint.js +5 -4
- package/dist/{Pulse → MarketPulse}/Service/VendorProductEndpoint.js +11 -7
- package/dist/Service/AccessTokenEndpoint.js +3 -2
- package/dist/Service/AdapterConnectionEndpoint.js +9 -8
- package/dist/Service/AdapterEndpoint.js +3 -2
- package/dist/Service/ChannelEndpoint.js +5 -4
- package/dist/Service/CodeDeployEndpoint.js +5 -4
- package/dist/Service/CodeSourceStrategiesEndpoint.js +3 -2
- package/dist/Service/CollectionsEndpoint.js +5 -4
- package/dist/Service/CommandExecutionEndpoint.js +2 -1
- package/dist/Service/ConfigEndpoint.d.ts +6 -1
- package/dist/Service/ConfigEndpoint.js +9 -3
- package/dist/Service/ConfigurationEndpoint.js +5 -4
- package/dist/Service/HealthAlertEndpoint.js +3 -2
- package/dist/Service/PlatformEndpoint.js +3 -2
- package/dist/Service/PlatformLanguageEndpoint.js +2 -1
- package/dist/Service/ProjectEndpoint.js +3 -2
- package/dist/Service/ProjectEnvironmentEndpoint.js +3 -2
- package/dist/Service/ProviderTokenEndpoint.js +4 -3
- package/dist/Service/RunnerPoolEndpoint.js +5 -4
- package/dist/Service/SourcesAccountEndpoint.js +6 -5
- package/dist/Service/StorageEndpoint.js +8 -7
- package/dist/Service/SubscriberEndpoint.js +4 -3
- package/dist/Service/TriggerEndpoint.js +5 -4
- package/dist/Service/UserActionEndpoint.js +4 -3
- package/dist/Service/UserEndpoint.js +3 -2
- package/dist/Service/WorkspaceEndpoint.js +2 -1
- package/dist/Service/WorkspaceMemberEndpoint.js +5 -4
- package/dist/index.d.ts +50 -46
- package/dist/index.js +37 -33
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -2
- /package/dist/{EnhanceData → DataEnrichment}/Model/GenerateContentBatch.d.ts +0 -0
- /package/dist/{EnhanceData → DataEnrichment}/Model/GenerateContentBatch.js +0 -0
- /package/dist/{EnhanceData → DataEnrichment}/Model/GenerateContentBatchData.d.ts +0 -0
- /package/dist/{EnhanceData → DataEnrichment}/Model/GenerateContentBatchData.js +0 -0
- /package/dist/{EnhanceData → DataEnrichment}/Service/GenerateContentEndpoint.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/CatalogProductWithMatches.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/CatalogProductWithMatches.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/CompetingVendorProduct.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/CompetingVendorProduct.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/Competitor.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/Competitor.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/CrawlJob.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/CrawlJob.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/IndexJob.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/IndexJob.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/MarketSummaryEntry.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/MarketSummaryEntry.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/MatchHistory.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/MatchHistory.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/MatchHistoryBucket.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/MatchHistoryBucket.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/MatchHistoryInterval.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/MatchHistoryInterval.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/MatchedVendorProduct.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/MatchedVendorProduct.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/PriceAlertConfig.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/PriceAlertConfig.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/PriceAlertConfigData.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/PriceAlertConfigData.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/PriceAlertEvent.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/PriceAlertEvent.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/PriceIndexSnapshotEntry.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/PriceIndexSnapshotEntry.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/PriceSuggestion.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/PriceSuggestion.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/PricingRule.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/PricingRule.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/PricingRuleData.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/PricingRuleData.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/ProductGroup.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/ProductGroup.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/ProductGroupData.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/ProductGroupData.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/ProductMatch.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/ProductMatch.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/ProductMatchJob.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/ProductMatchJob.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/ProductSegmentType.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/ProductSegmentType.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/ProductsSegment.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/ProductsSegment.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/PulseCatalogProductFilterOptions.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/PulseCatalogProductFilterOptions.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/PulseCatalogProductFilters.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/PulseCatalogProductFilters.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/ReviewMatch.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/ReviewMatch.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/ReviewMatchFilters.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/ReviewMatchFilters.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/TopCompetitor.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/TopCompetitor.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/Vendor.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/Vendor.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/VendorProduct.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/VendorProduct.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/VendorProductPriceHistoryEntry.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/VendorProductPriceHistoryEntry.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/VendorStatus.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Model/VendorStatus.js +0 -0
- /package/dist/{Pulse → MarketPulse}/Service/CompetitorEndpoint.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Service/IndexJobEndpoint.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Service/PriceAlertEndpoint.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Service/PricingEndpoint.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Service/ProductGroupEndpoint.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Service/ProductMatchEndpoint.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Service/ProductMatchJobEndpoint.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Service/PulseCatalogProductEndpoint.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Service/PulseStatisticsEndpoint.d.ts +0 -0
- /package/dist/{Pulse → MarketPulse}/Service/VendorProductEndpoint.d.ts +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { path } from '../../Http/Data/Path.js';
|
|
1
2
|
import { QueryString } from '../../Http/Data/QueryString.js';
|
|
2
3
|
import { Endpoint } from '../../Service/Endpoint.js';
|
|
3
4
|
import { PriceSuggestion } from '../Model/PriceSuggestion.js';
|
|
@@ -8,28 +9,28 @@ import { PricingRule } from '../Model/PricingRule.js';
|
|
|
8
9
|
*/
|
|
9
10
|
export class PricingEndpoint extends Endpoint {
|
|
10
11
|
async getRules(catalogId, pagination = null) {
|
|
11
|
-
const queryString = new QueryString('/pulse/catalogs/'
|
|
12
|
+
const queryString = new QueryString(path('/pulse/catalogs/:catalogId/pricing-rules', { catalogId: catalogId.toString() }));
|
|
12
13
|
queryString.addPagination(pagination);
|
|
13
14
|
return await this.requestCollection(queryString, PricingRule.parse);
|
|
14
15
|
}
|
|
15
16
|
async getRule(pricingRuleId) {
|
|
16
|
-
const result = await this.requestObject('/pulse/pricing-rules
|
|
17
|
+
const result = await this.requestObject(path('/pulse/pricing-rules/:pricingRuleId', { pricingRuleId }), null, PricingRule.parse, 'GET');
|
|
17
18
|
return result.getData();
|
|
18
19
|
}
|
|
19
20
|
async createRule(catalogId, data) {
|
|
20
|
-
const result = await this.requestObject('/pulse/catalogs/'
|
|
21
|
+
const result = await this.requestObject(path('/pulse/catalogs/:catalogId/pricing-rules', { catalogId: catalogId.toString() }), data, PricingRule.parse, 'POST');
|
|
21
22
|
return result.getData();
|
|
22
23
|
}
|
|
23
24
|
async updateRule(pricingRuleId, data) {
|
|
24
|
-
const result = await this.requestObject('/pulse/pricing-rules
|
|
25
|
+
const result = await this.requestObject(path('/pulse/pricing-rules/:pricingRuleId', { pricingRuleId }), data, PricingRule.parse, 'PATCH');
|
|
25
26
|
return result.getData();
|
|
26
27
|
}
|
|
27
28
|
async deleteRule(pricingRuleId) {
|
|
28
|
-
await this.requestObject('/pulse/pricing-rules
|
|
29
|
+
await this.requestObject(path('/pulse/pricing-rules/:pricingRuleId', { pricingRuleId }), null, (raw) => raw, 'DELETE');
|
|
29
30
|
}
|
|
30
31
|
/** Price suggestions of a catalog, optionally only those in one status. */
|
|
31
32
|
async getSuggestions(catalogId, pagination = null, status = null) {
|
|
32
|
-
const queryString = new QueryString('/pulse/catalogs/'
|
|
33
|
+
const queryString = new QueryString(path('/pulse/catalogs/:catalogId/price-suggestions', { catalogId: catalogId.toString() }));
|
|
33
34
|
if (status !== null) {
|
|
34
35
|
queryString.set('status', status);
|
|
35
36
|
}
|
|
@@ -37,7 +38,7 @@ export class PricingEndpoint extends Endpoint {
|
|
|
37
38
|
return await this.requestCollection(queryString, PriceSuggestion.parse);
|
|
38
39
|
}
|
|
39
40
|
async getSuggestion(priceSuggestionId) {
|
|
40
|
-
const result = await this.requestObject('/pulse/price-suggestions
|
|
41
|
+
const result = await this.requestObject(path('/pulse/price-suggestions/:priceSuggestionId', { priceSuggestionId }), null, PriceSuggestion.parse, 'GET');
|
|
41
42
|
return result.getData();
|
|
42
43
|
}
|
|
43
44
|
/**
|
|
@@ -45,7 +46,7 @@ export class PricingEndpoint extends Endpoint {
|
|
|
45
46
|
* itself is done by a flow, which sets `appliedAt`.
|
|
46
47
|
*/
|
|
47
48
|
async reviewSuggestion(priceSuggestionId, status) {
|
|
48
|
-
const result = await this.requestObject('/pulse/price-suggestions
|
|
49
|
+
const result = await this.requestObject(path('/pulse/price-suggestions/:priceSuggestionId', { priceSuggestionId }), { status }, PriceSuggestion.parse, 'PATCH');
|
|
49
50
|
return result.getData();
|
|
50
51
|
}
|
|
51
52
|
}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
+
import { path } from '../../Http/Data/Path.js';
|
|
1
2
|
import { QueryString } from '../../Http/Data/QueryString.js';
|
|
2
3
|
import { Endpoint } from '../../Service/Endpoint.js';
|
|
3
4
|
import { ProductGroup } from '../Model/ProductGroup.js';
|
|
4
5
|
/** Product groups — `/pulse/catalogs/:catalogId/product-groups`. */
|
|
5
6
|
export class ProductGroupEndpoint extends Endpoint {
|
|
6
7
|
async getByCatalog(catalogId, pagination = null) {
|
|
7
|
-
const queryString = new QueryString('/pulse/catalogs/'
|
|
8
|
+
const queryString = new QueryString(path('/pulse/catalogs/:catalogId/product-groups', { catalogId: catalogId.toString() }));
|
|
8
9
|
queryString.addPagination(pagination);
|
|
9
10
|
return await this.requestCollection(queryString, ProductGroup.parse);
|
|
10
11
|
}
|
|
11
12
|
async getById(productGroupId) {
|
|
12
|
-
const result = await this.requestObject('/pulse/product-groups
|
|
13
|
+
const result = await this.requestObject(path('/pulse/product-groups/:productGroupId', { productGroupId }), null, ProductGroup.parse, 'GET');
|
|
13
14
|
return result.getData();
|
|
14
15
|
}
|
|
15
16
|
async create(catalogId, data) {
|
|
16
|
-
const result = await this.requestObject('/pulse/catalogs/'
|
|
17
|
+
const result = await this.requestObject(path('/pulse/catalogs/:catalogId/product-groups', { catalogId: catalogId.toString() }), data, ProductGroup.parse, 'POST');
|
|
17
18
|
return result.getData();
|
|
18
19
|
}
|
|
19
20
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { path } from '../../Http/Data/Path.js';
|
|
1
2
|
import { QueryString } from '../../Http/Data/QueryString.js';
|
|
2
3
|
import { Endpoint } from '../../Service/Endpoint.js';
|
|
3
4
|
import { ProductMatch } from '../Model/ProductMatch.js';
|
|
@@ -9,7 +10,7 @@ import { ReviewMatch } from '../Model/ReviewMatch.js';
|
|
|
9
10
|
export class ProductMatchEndpoint extends Endpoint {
|
|
10
11
|
/** The review queue of a catalog; pending matches unless `statuses` says otherwise. */
|
|
11
12
|
async getForReview(catalogId, pagination = null, filters = {}) {
|
|
12
|
-
const queryString = new QueryString('/pulse/catalogs/'
|
|
13
|
+
const queryString = new QueryString(path('/pulse/catalogs/:catalogId/matches', { catalogId: catalogId.toString() }));
|
|
13
14
|
queryString.set('status', (filters.statuses ?? ['pending']).join(','));
|
|
14
15
|
if (filters.competitor) {
|
|
15
16
|
queryString.set('competitor', filters.competitor);
|
|
@@ -25,20 +26,20 @@ export class ProductMatchEndpoint extends Endpoint {
|
|
|
25
26
|
}
|
|
26
27
|
/** The match record, or null. */
|
|
27
28
|
async getById(matchId) {
|
|
28
|
-
const result = await this.requestObject('/pulse/matches
|
|
29
|
+
const result = await this.requestObject(path('/pulse/matches/:matchId', { matchId }), null, ProductMatch.parse, 'GET');
|
|
29
30
|
return result.getData();
|
|
30
31
|
}
|
|
31
32
|
/** Confirm a match. `note` records why, for the reviewer's own audit trail. */
|
|
32
33
|
async accept(matchId, note = null) {
|
|
33
|
-
await this.requestObject('/pulse/matches/'
|
|
34
|
+
await this.requestObject(path('/pulse/matches/:matchId/accept', { matchId }), note === null ? {} : { note }, (raw) => raw, 'POST');
|
|
34
35
|
}
|
|
35
36
|
/** Reject a match, so it stops counting towards the competitor's price index. */
|
|
36
37
|
async decline(matchId, note = null) {
|
|
37
|
-
await this.requestObject('/pulse/matches/'
|
|
38
|
+
await this.requestObject(path('/pulse/matches/:matchId/decline', { matchId }), note === null ? {} : { note }, (raw) => raw, 'POST');
|
|
38
39
|
}
|
|
39
40
|
/** How many matches were discovered and reviewed over time, optionally for one competitor. */
|
|
40
41
|
async getHistory(catalogId, competitor = null, interval = 'day') {
|
|
41
|
-
const queryString = new QueryString('/pulse/catalogs/'
|
|
42
|
+
const queryString = new QueryString(path('/pulse/catalogs/:catalogId/matches/history', { catalogId: catalogId.toString() }));
|
|
42
43
|
queryString.set('interval', interval);
|
|
43
44
|
if (competitor !== null) {
|
|
44
45
|
queryString.set('competitor', competitor);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { path } from '../../Http/Data/Path.js';
|
|
1
2
|
import { QueryString } from '../../Http/Data/QueryString.js';
|
|
2
3
|
import { ProductMatchJob } from '../Model/ProductMatchJob.js';
|
|
3
4
|
import { Endpoint } from '../../Service/Endpoint.js';
|
|
@@ -8,23 +9,23 @@ import { Endpoint } from '../../Service/Endpoint.js';
|
|
|
8
9
|
export class ProductMatchJobEndpoint extends Endpoint {
|
|
9
10
|
/** Every match job of a catalog, newest first. */
|
|
10
11
|
async getByCatalog(catalogId, pagination = null) {
|
|
11
|
-
const queryString = new QueryString('/pulse/catalogs/'
|
|
12
|
+
const queryString = new QueryString(path('/pulse/catalogs/:catalogId/match-jobs', { catalogId: catalogId.toString() }));
|
|
12
13
|
queryString.addPagination(pagination);
|
|
13
14
|
return await this.requestCollection(queryString, ProductMatchJob.parse);
|
|
14
15
|
}
|
|
15
16
|
/** The match jobs of one of the catalog's competitors. */
|
|
16
17
|
async getByVendor(catalogId, vendorId, pagination = null) {
|
|
17
|
-
const queryString = new QueryString('/pulse/catalogs/'
|
|
18
|
+
const queryString = new QueryString(path('/pulse/catalogs/:catalogId/vendors/:vendorId/match-jobs', { catalogId: catalogId.toString(), vendorId }));
|
|
18
19
|
queryString.addPagination(pagination);
|
|
19
20
|
return await this.requestCollection(queryString, ProductMatchJob.parse);
|
|
20
21
|
}
|
|
21
22
|
/** Queue a matching run of the catalog against one competitor. */
|
|
22
23
|
async requestMatching(catalogId, vendorId) {
|
|
23
|
-
await this.requestObject('/pulse/catalogs/'
|
|
24
|
+
await this.requestObject(path('/pulse/catalogs/:catalogId/vendors/:vendorId/match', { catalogId: catalogId.toString(), vendorId }), {}, (raw) => raw, 'POST');
|
|
24
25
|
}
|
|
25
26
|
/** The match job with this id, or null. */
|
|
26
27
|
async getById(productMatchJobId) {
|
|
27
|
-
const result = await this.requestObject('/pulse/match-jobs
|
|
28
|
+
const result = await this.requestObject(path('/pulse/match-jobs/:productMatchJobId', { productMatchJobId }), null, ProductMatchJob.parse, 'GET');
|
|
28
29
|
return result.getData();
|
|
29
30
|
}
|
|
30
31
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { path } from '../../Http/Data/Path.js';
|
|
1
2
|
import { QueryString } from '../../Http/Data/QueryString.js';
|
|
2
3
|
import { Endpoint } from '../../Service/Endpoint.js';
|
|
3
4
|
import { CatalogProductWithMatches } from '../Model/CatalogProductWithMatches.js';
|
|
@@ -13,7 +14,7 @@ export class PulseCatalogProductEndpoint extends Endpoint {
|
|
|
13
14
|
* anything the simple filters cannot express.
|
|
14
15
|
*/
|
|
15
16
|
async getProducts(catalogId, pagination = null, filters = {}, filter = null) {
|
|
16
|
-
const queryString = new QueryString('/pulse/catalogs/'
|
|
17
|
+
const queryString = new QueryString(path('/pulse/catalogs/:catalogId/products', { catalogId: catalogId.toString() }));
|
|
17
18
|
queryString.set('expand', ['matches.vendor']);
|
|
18
19
|
if (filters.brand) {
|
|
19
20
|
queryString.set('brand', filters.brand);
|
|
@@ -39,7 +40,7 @@ export class PulseCatalogProductEndpoint extends Endpoint {
|
|
|
39
40
|
return await this.requestCollection(queryString, CatalogProductWithMatches.parse);
|
|
40
41
|
}
|
|
41
42
|
async getFilterOptions(catalogId) {
|
|
42
|
-
const result = await this.requestObject('/pulse/catalogs/'
|
|
43
|
+
const result = await this.requestObject(path('/pulse/catalogs/:catalogId/filter-options', { catalogId: catalogId.toString() }), null, (raw) => ({
|
|
43
44
|
brands: raw.brands ?? [],
|
|
44
45
|
categories: raw.categories ?? [],
|
|
45
46
|
productGroups: raw.product_groups ?? [],
|
|
@@ -49,6 +50,6 @@ export class PulseCatalogProductEndpoint extends Endpoint {
|
|
|
49
50
|
}
|
|
50
51
|
/** Recalculate the catalog's cached statistics (price index, match counts, segments). */
|
|
51
52
|
async recomputeStatistics(catalogId) {
|
|
52
|
-
await this.requestObject('/pulse/catalogs/'
|
|
53
|
+
await this.requestObject(path('/pulse/catalogs/:catalogId/recompute-stats', { catalogId: catalogId.toString() }), {}, (raw) => raw, 'POST');
|
|
53
54
|
}
|
|
54
55
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { path } from '../../Http/Data/Path.js';
|
|
1
2
|
import { QueryString } from '../../Http/Data/QueryString.js';
|
|
2
3
|
import { Endpoint } from '../../Service/Endpoint.js';
|
|
3
4
|
import { PriceIndexSnapshotEntry } from '../Model/PriceIndexSnapshotEntry.js';
|
|
@@ -9,7 +10,7 @@ import { TopCompetitor } from '../Model/TopCompetitor.js';
|
|
|
9
10
|
export class PulseStatisticsEndpoint extends Endpoint {
|
|
10
11
|
/** Headline figures (products tracked, matches, competitors …) against the previous period. */
|
|
11
12
|
async getAccountSummary(catalogId) {
|
|
12
|
-
return await this.requestCollection('/pulse/catalogs/'
|
|
13
|
+
return await this.requestCollection(path('/pulse/catalogs/:catalogId/statistics/account-summary', { catalogId: catalogId.toString() }), (raw) => ({
|
|
13
14
|
id: raw.id,
|
|
14
15
|
title: raw.title,
|
|
15
16
|
currentAmount: raw.current_amount ?? 0,
|
|
@@ -18,7 +19,7 @@ export class PulseStatisticsEndpoint extends Endpoint {
|
|
|
18
19
|
}
|
|
19
20
|
/** Distribution of the catalog's products across price or profit segments. */
|
|
20
21
|
async getProductSegments(catalogId, type = null) {
|
|
21
|
-
const queryString = new QueryString('/pulse/catalogs/'
|
|
22
|
+
const queryString = new QueryString(path('/pulse/catalogs/:catalogId/statistics/product-segments', { catalogId: catalogId.toString() }));
|
|
22
23
|
if (type !== null) {
|
|
23
24
|
queryString.set('type', type);
|
|
24
25
|
}
|
|
@@ -33,7 +34,7 @@ export class PulseStatisticsEndpoint extends Endpoint {
|
|
|
33
34
|
* the comparison against the previous period spans.
|
|
34
35
|
*/
|
|
35
36
|
async getTopCompetitors(catalogId, limit = null, period = null) {
|
|
36
|
-
const queryString = new QueryString('/pulse/catalogs/'
|
|
37
|
+
const queryString = new QueryString(path('/pulse/catalogs/:catalogId/statistics/top-competitors', { catalogId: catalogId.toString() }));
|
|
37
38
|
if (limit !== null) {
|
|
38
39
|
queryString.set('limit', limit);
|
|
39
40
|
}
|
|
@@ -47,7 +48,7 @@ export class PulseStatisticsEndpoint extends Endpoint {
|
|
|
47
48
|
* optionally a product group to scope to and a date range (`YYYY-MM-DD`).
|
|
48
49
|
*/
|
|
49
50
|
async getPriceIndexHistory(catalogId, competitorIds = [], options = {}) {
|
|
50
|
-
const queryString = new QueryString('/pulse/catalogs
|
|
51
|
+
const queryString = new QueryString(path('/pulse/catalogs/:catalogId/statistics/price-index-history', { catalogId: catalogId.toString() }));
|
|
51
52
|
if (competitorIds.length > 0) {
|
|
52
53
|
queryString.set('competitor', competitorIds.join(','));
|
|
53
54
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { path } from '../../Http/Data/Path.js';
|
|
1
2
|
import { QueryString } from '../../Http/Data/QueryString.js';
|
|
2
3
|
import { CompetingVendorProduct } from '../Model/CompetingVendorProduct.js';
|
|
3
4
|
import { VendorProduct } from '../Model/VendorProduct.js';
|
|
@@ -10,7 +11,7 @@ import { Endpoint } from '../../Service/Endpoint.js';
|
|
|
10
11
|
export class VendorProductEndpoint extends Endpoint {
|
|
11
12
|
/** The product with this identifier for the vendor, or null. */
|
|
12
13
|
async getByIdentifier(vendorId, identifier) {
|
|
13
|
-
const result = await this.requestCollection('/pulse/vendors/'
|
|
14
|
+
const result = await this.requestCollection(path('/pulse/vendors/:vendorId/products', { vendorId }) + '?identifier=' + encodeURIComponent(identifier), VendorProduct.parse);
|
|
14
15
|
const products = result.getData();
|
|
15
16
|
return products.length > 0 ? products[0] : null;
|
|
16
17
|
}
|
|
@@ -19,18 +20,18 @@ export class VendorProductEndpoint extends Endpoint {
|
|
|
19
20
|
* Same products as {@link getByVendor}, read through the competitor, so `competitorId` is set.
|
|
20
21
|
*/
|
|
21
22
|
async getByCompetitor(competitorId, pagination = null) {
|
|
22
|
-
const queryString = new QueryString('/pulse/competing-vendors/'
|
|
23
|
+
const queryString = new QueryString(path('/pulse/competing-vendors/:competitorId/products', { competitorId }));
|
|
23
24
|
queryString.addPagination(pagination);
|
|
24
25
|
return await this.requestCollection(queryString, CompetingVendorProduct.parse);
|
|
25
26
|
}
|
|
26
27
|
/** A single competitor product — `/pulse/competing-vendors/products/:id`. */
|
|
27
28
|
async getCompetitorProductById(competingVendorProductId) {
|
|
28
|
-
const result = await this.requestObject('/pulse/competing-vendors/products
|
|
29
|
+
const result = await this.requestObject(path('/pulse/competing-vendors/products/:competingVendorProductId', { competingVendorProductId }), null, CompetingVendorProduct.parse, 'GET');
|
|
29
30
|
return result.getData();
|
|
30
31
|
}
|
|
31
32
|
/** A vendor's products. */
|
|
32
33
|
async getByVendor(vendorId, pagination = null) {
|
|
33
|
-
const queryString = new QueryString('/pulse/vendors/'
|
|
34
|
+
const queryString = new QueryString(path('/pulse/vendors/:vendorId/products', { vendorId }));
|
|
34
35
|
queryString.addPagination(pagination);
|
|
35
36
|
return await this.requestCollection(queryString, VendorProduct.parse);
|
|
36
37
|
}
|
|
@@ -39,7 +40,7 @@ export class VendorProductEndpoint extends Endpoint {
|
|
|
39
40
|
* entries (the API defaults to 365).
|
|
40
41
|
*/
|
|
41
42
|
async getPriceHistory(vendorProductId, limit = null) {
|
|
42
|
-
const queryString = new QueryString('/pulse/vendor-products/'
|
|
43
|
+
const queryString = new QueryString(path('/pulse/vendor-products/:vendorProductId/price-history', { vendorProductId }));
|
|
43
44
|
if (limit !== null) {
|
|
44
45
|
queryString.set('limit', limit.toString());
|
|
45
46
|
}
|
|
@@ -63,7 +64,7 @@ export class VendorProductEndpoint extends Endpoint {
|
|
|
63
64
|
isInStock: product.isInStock,
|
|
64
65
|
properties: product.properties,
|
|
65
66
|
};
|
|
66
|
-
const result = await this.requestObject('/pulse/vendors/'
|
|
67
|
+
const result = await this.requestObject(path('/pulse/vendors/:vendorId/products', { vendorId: product.vendorId }), body, VendorProduct.parse, 'POST');
|
|
67
68
|
return result.getData() ?? product;
|
|
68
69
|
}
|
|
69
70
|
/** Update the mutable fields of an existing vendor product (JSON-patch style, per the API). */
|
|
@@ -79,6 +80,9 @@ export class VendorProductEndpoint extends Endpoint {
|
|
|
79
80
|
{ op: 'add', path: 'image', value: product.image },
|
|
80
81
|
{ op: 'add', path: 'properties', value: product.properties },
|
|
81
82
|
];
|
|
82
|
-
|
|
83
|
+
if (product.id === null) {
|
|
84
|
+
throw new Error('Unable to update vendor product: the product has no id. Save it first.');
|
|
85
|
+
}
|
|
86
|
+
await this.requestObject(path('/pulse/vendors/:vendorId/products/:id', { vendorId: product.vendorId, id: product.id }), operations, (raw) => raw, 'PATCH');
|
|
83
87
|
}
|
|
84
88
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { path } from '../Http/Data/Path.js';
|
|
1
2
|
import { QueryString } from '../Http/Data/QueryString.js';
|
|
2
3
|
import { UserAccessToken } from '../Model/AccessToken/UserAccessToken.js';
|
|
3
4
|
import { Endpoint } from './Endpoint.js';
|
|
@@ -43,7 +44,7 @@ export class AccessTokenEndpoint extends Endpoint {
|
|
|
43
44
|
}
|
|
44
45
|
async update(tokenId, name) {
|
|
45
46
|
try {
|
|
46
|
-
const url = '/access-tokens
|
|
47
|
+
const url = path('/access-tokens/:tokenId', { tokenId });
|
|
47
48
|
const result = await this.requestObject(url, {
|
|
48
49
|
name,
|
|
49
50
|
}, UserAccessToken.parse, 'POST');
|
|
@@ -62,7 +63,7 @@ export class AccessTokenEndpoint extends Endpoint {
|
|
|
62
63
|
}
|
|
63
64
|
async revoke(tokenId) {
|
|
64
65
|
try {
|
|
65
|
-
const url = '/access-tokens
|
|
66
|
+
const url = path('/access-tokens/:tokenId', { tokenId });
|
|
66
67
|
const parser = (raw) => ({ revoked: raw.revoked });
|
|
67
68
|
const result = await this.requestObject(url, null, parser, 'DELETE');
|
|
68
69
|
const res = result.getData();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { path } from '../Http/Data/Path.js';
|
|
1
2
|
import { AdapterConnection } from '../Model/Adapter/AdapterConnection.js';
|
|
2
3
|
import { parseTestConnectionResult } from '../Model/Adapter/TestConnectionResult.js';
|
|
3
4
|
import { QueryString } from '../Http/Data/QueryString.js';
|
|
@@ -6,7 +7,7 @@ import { Endpoint } from './Endpoint.js';
|
|
|
6
7
|
export class AdapterConnectionEndpoint extends Endpoint {
|
|
7
8
|
async getConnections(projectId, pagination) {
|
|
8
9
|
try {
|
|
9
|
-
const queryString = new QueryString('/projects/'
|
|
10
|
+
const queryString = new QueryString(path('/projects/:projectId/connections', { projectId }));
|
|
10
11
|
queryString.addPagination(pagination);
|
|
11
12
|
return await this.requestCollection(queryString, AdapterConnection.parse);
|
|
12
13
|
}
|
|
@@ -19,7 +20,7 @@ export class AdapterConnectionEndpoint extends Endpoint {
|
|
|
19
20
|
}
|
|
20
21
|
async getConnectionById(connectionId) {
|
|
21
22
|
try {
|
|
22
|
-
const url = '/connections
|
|
23
|
+
const url = path('/connections/:connectionId', { connectionId });
|
|
23
24
|
const result = await this.requestObject(url, null, AdapterConnection.parse);
|
|
24
25
|
return result.getData();
|
|
25
26
|
}
|
|
@@ -32,7 +33,7 @@ export class AdapterConnectionEndpoint extends Endpoint {
|
|
|
32
33
|
}
|
|
33
34
|
async getConnectionByKey(projectId, connectionKey) {
|
|
34
35
|
try {
|
|
35
|
-
const url = '/projects/'
|
|
36
|
+
const url = path('/projects/:projectId/connections/:connectionKey', { projectId, connectionKey });
|
|
36
37
|
const result = await this.requestObject(url, null, AdapterConnection.parse);
|
|
37
38
|
return result.getData();
|
|
38
39
|
}
|
|
@@ -45,7 +46,7 @@ export class AdapterConnectionEndpoint extends Endpoint {
|
|
|
45
46
|
}
|
|
46
47
|
async getConnectionConfiguration(connectionId) {
|
|
47
48
|
try {
|
|
48
|
-
const url = '/connections/'
|
|
49
|
+
const url = path('/connections/:connectionId/configuration', { connectionId });
|
|
49
50
|
const parser = (raw) => ({
|
|
50
51
|
id: raw.id,
|
|
51
52
|
adapterConnectionId: raw.adapter_connection,
|
|
@@ -63,7 +64,7 @@ export class AdapterConnectionEndpoint extends Endpoint {
|
|
|
63
64
|
}
|
|
64
65
|
async saveConnection(projectId, connection) {
|
|
65
66
|
try {
|
|
66
|
-
const url = '/projects/'
|
|
67
|
+
const url = path('/projects/:projectId/connections', { projectId });
|
|
67
68
|
const result = await this.requestObject(url, connection, AdapterConnection.parse, 'POST');
|
|
68
69
|
const updatedAdapterConnection = result.getData();
|
|
69
70
|
if (updatedAdapterConnection === null) {
|
|
@@ -80,7 +81,7 @@ export class AdapterConnectionEndpoint extends Endpoint {
|
|
|
80
81
|
}
|
|
81
82
|
async saveConnectionConfiguration(connectionId, configuration) {
|
|
82
83
|
try {
|
|
83
|
-
const url = '/connections/'
|
|
84
|
+
const url = path('/connections/:connectionId/configuration', { connectionId });
|
|
84
85
|
const parser = (raw) => ({ saved: raw.saved });
|
|
85
86
|
const result = await this.requestObject(url, { configuration: configuration }, parser, 'POST');
|
|
86
87
|
const res = result.getData();
|
|
@@ -97,7 +98,7 @@ export class AdapterConnectionEndpoint extends Endpoint {
|
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
async getConnectionEvents(connectionId, pagination) {
|
|
100
|
-
const queryString = new QueryString('/adapters/connections/'
|
|
101
|
+
const queryString = new QueryString(path('/adapters/connections/:connectionId/events', { connectionId }));
|
|
101
102
|
queryString.addPagination(pagination);
|
|
102
103
|
return await this.requestCollection(queryString, AdapterConnectionEvent.parse);
|
|
103
104
|
}
|
|
@@ -113,7 +114,7 @@ export class AdapterConnectionEndpoint extends Endpoint {
|
|
|
113
114
|
* `POST /connections/:id/check` route on Core-Api (removed).
|
|
114
115
|
*/
|
|
115
116
|
async testConnection(connectionId) {
|
|
116
|
-
const url = '/services/'
|
|
117
|
+
const url = path('/services/:connectionId/test-connection', { connectionId });
|
|
117
118
|
const result = await this.requestObject(url, null, parseTestConnectionResult, 'POST');
|
|
118
119
|
const data = result.getData();
|
|
119
120
|
if (data === null) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { path } from '../Http/Data/Path.js';
|
|
1
2
|
import { Adapter } from '../Model/Adapter/Adapter.js';
|
|
2
3
|
import { AdapterConfiguration } from '../Model/Adapter/AdapterConfiguration.js';
|
|
3
4
|
import { QueryString } from '../Http/Data/QueryString.js';
|
|
@@ -22,7 +23,7 @@ export class AdapterEndpoint extends Endpoint {
|
|
|
22
23
|
}
|
|
23
24
|
async getAdapter(adapterId, withMedia = false) {
|
|
24
25
|
try {
|
|
25
|
-
const queryString = new QueryString('/adapters
|
|
26
|
+
const queryString = new QueryString(path('/adapters/:adapterId', { adapterId }));
|
|
26
27
|
if (withMedia) {
|
|
27
28
|
queryString.set('with-media', true);
|
|
28
29
|
}
|
|
@@ -38,7 +39,7 @@ export class AdapterEndpoint extends Endpoint {
|
|
|
38
39
|
}
|
|
39
40
|
async getAdapterConfiguration(adapterId) {
|
|
40
41
|
try {
|
|
41
|
-
const url = '/adapters/'
|
|
42
|
+
const url = path('/adapters/:adapterId/configuration', { adapterId });
|
|
42
43
|
return await this.requestCollection(url, AdapterConfiguration.parse);
|
|
43
44
|
}
|
|
44
45
|
catch (error) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { path } from '../Http/Data/Path.js';
|
|
1
2
|
import { Channel } from '../Model/Messaging/Channel/Channel.js';
|
|
2
3
|
import { ChannelHistory } from '../Model/Messaging/ChannelHistory.js';
|
|
3
4
|
import { QueryString } from '../Http/Data/QueryString.js';
|
|
@@ -5,7 +6,7 @@ import { Endpoint } from './Endpoint.js';
|
|
|
5
6
|
export class ChannelEndpoint extends Endpoint {
|
|
6
7
|
async getById(channelId) {
|
|
7
8
|
try {
|
|
8
|
-
const result = await this.requestObject('/channels
|
|
9
|
+
const result = await this.requestObject(path('/channels/:channelId', { channelId }), null, Channel.parse);
|
|
9
10
|
return result.getData();
|
|
10
11
|
}
|
|
11
12
|
catch (ex) {
|
|
@@ -17,7 +18,7 @@ export class ChannelEndpoint extends Endpoint {
|
|
|
17
18
|
}
|
|
18
19
|
async getByWorkspace(workspaceId, pagination = null) {
|
|
19
20
|
try {
|
|
20
|
-
const queryString = new QueryString('/workspaces/'
|
|
21
|
+
const queryString = new QueryString(path('/workspaces/:workspaceId/channels', { workspaceId }));
|
|
21
22
|
queryString.addPagination(pagination);
|
|
22
23
|
const result = await this.requestCollection(queryString, Channel.parse);
|
|
23
24
|
return result;
|
|
@@ -45,7 +46,7 @@ export class ChannelEndpoint extends Endpoint {
|
|
|
45
46
|
}
|
|
46
47
|
async getMessages(channelId, pagination = null) {
|
|
47
48
|
try {
|
|
48
|
-
const querystring = new QueryString('/channels/'
|
|
49
|
+
const querystring = new QueryString(path('/channels/:channelId/messages', { channelId }));
|
|
49
50
|
querystring.addPagination(pagination);
|
|
50
51
|
const result = await this.requestCollection(querystring, ChannelHistory.parse);
|
|
51
52
|
return result;
|
|
@@ -76,7 +77,7 @@ export class ChannelEndpoint extends Endpoint {
|
|
|
76
77
|
}
|
|
77
78
|
async testChannel(subscriberChannel) {
|
|
78
79
|
try {
|
|
79
|
-
const url = '/channels/'
|
|
80
|
+
const url = path('/channels/:id/test', { id: subscriberChannel.id });
|
|
80
81
|
const parser = (raw) => ({ tested: raw.tested });
|
|
81
82
|
const result = await this.requestObject(url, {}, parser, 'POST');
|
|
82
83
|
const re = result.getData();
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { path } from '../Http/Data/Path.js';
|
|
1
2
|
import { CodeDeploy } from '../Model/Project/CodeDeploy.js';
|
|
2
3
|
import { Endpoint } from './Endpoint.js';
|
|
3
4
|
export class CodeDeployEndpoint extends Endpoint {
|
|
4
5
|
async getById(deployId) {
|
|
5
6
|
try {
|
|
6
|
-
const rawDeploy = await this.requestObject('/deploys
|
|
7
|
+
const rawDeploy = await this.requestObject(path('/deploys/:deployId', { deployId }), null, CodeDeploy.parse);
|
|
7
8
|
return rawDeploy.getData();
|
|
8
9
|
}
|
|
9
10
|
catch (error) {
|
|
@@ -15,7 +16,7 @@ export class CodeDeployEndpoint extends Endpoint {
|
|
|
15
16
|
}
|
|
16
17
|
async getLatestDeploy(codeSourceId) {
|
|
17
18
|
try {
|
|
18
|
-
const rawDeploy = await this.requestObject('/codesources/'
|
|
19
|
+
const rawDeploy = await this.requestObject(path('/codesources/:codeSourceId/latestdeploy', { codeSourceId }), null, CodeDeploy.parse);
|
|
19
20
|
return rawDeploy.getData();
|
|
20
21
|
}
|
|
21
22
|
catch (error) {
|
|
@@ -27,7 +28,7 @@ export class CodeDeployEndpoint extends Endpoint {
|
|
|
27
28
|
}
|
|
28
29
|
async getByCodeSource(codeSourceId) {
|
|
29
30
|
try {
|
|
30
|
-
const rawDeploys = await this.requestCollection('/codesources/'
|
|
31
|
+
const rawDeploys = await this.requestCollection(path('/codesources/:codeSourceId/deploys', { codeSourceId }), CodeDeploy.parse);
|
|
31
32
|
return rawDeploys;
|
|
32
33
|
}
|
|
33
34
|
catch (error) {
|
|
@@ -39,7 +40,7 @@ export class CodeDeployEndpoint extends Endpoint {
|
|
|
39
40
|
}
|
|
40
41
|
async requestDeploy(codeSourceId) {
|
|
41
42
|
try {
|
|
42
|
-
const result = await this.requestObject('/codesources/'
|
|
43
|
+
const result = await this.requestObject(path('/codesources/:codeSourceId/deploys', { codeSourceId }), null, CodeDeploy.parse, 'POST');
|
|
43
44
|
const requestedDeploy = result.getData();
|
|
44
45
|
if (requestedDeploy === null) {
|
|
45
46
|
throw new Error('Deploy not requested');
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { path } from '../Http/Data/Path.js';
|
|
1
2
|
import { CodeSourceBuildStrategy } from '../Model/Deployment/CodeSourceBuildStrategy.js';
|
|
2
3
|
import { CodeSourceRunStrategy } from '../Model/Deployment/CodeSourceRunStrategy.js';
|
|
3
4
|
import { Endpoint } from './Endpoint.js';
|
|
4
5
|
export class CodeSourceStrategiesEndpoint extends Endpoint {
|
|
5
6
|
async getAllBuildStrategies(workspaceId) {
|
|
6
|
-
const cmd = '/workspaces/'
|
|
7
|
+
const cmd = path('/workspaces/:workspaceId/codesources/buildstrategies', { workspaceId });
|
|
7
8
|
return await this.requestCollection(cmd, CodeSourceBuildStrategy.parse);
|
|
8
9
|
}
|
|
9
10
|
async getAllRunStrategies(workspaceId) {
|
|
10
|
-
const cmd = '/workspaces/'
|
|
11
|
+
const cmd = path('/workspaces/:workspaceId/codesources/runstrategies', { workspaceId });
|
|
11
12
|
return await this.requestCollection(cmd, CodeSourceRunStrategy.parse);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
import { path } from '../Http/Data/Path.js';
|
|
1
2
|
import { QueryString } from '../Http/Data/QueryString.js';
|
|
2
3
|
import { Collection } from '../Model/Collections/Collection.js';
|
|
3
4
|
import { Endpoint } from './Endpoint.js';
|
|
4
5
|
import { CollectionRecord } from '../Model/Collections/CollectionRecord.js';
|
|
5
6
|
export class CollectionsEndpoint extends Endpoint {
|
|
6
7
|
async getAll(projectId, pagination) {
|
|
7
|
-
const qs = new QueryString('/projects/'
|
|
8
|
+
const qs = new QueryString(path('/projects/:projectId/collections', { projectId }));
|
|
8
9
|
qs.addPagination(pagination);
|
|
9
10
|
return await this.requestCollection(qs, Collection.parse);
|
|
10
11
|
}
|
|
11
12
|
async getById(collectionId) {
|
|
12
13
|
try {
|
|
13
|
-
const qs = new QueryString('/collections
|
|
14
|
+
const qs = new QueryString(path('/collections/:collectionId', { collectionId }));
|
|
14
15
|
const result = await this.requestObject(qs, null, Collection.parse);
|
|
15
16
|
return result.getData();
|
|
16
17
|
}
|
|
@@ -23,7 +24,7 @@ export class CollectionsEndpoint extends Endpoint {
|
|
|
23
24
|
}
|
|
24
25
|
async getRecords(collectionId, pagination) {
|
|
25
26
|
try {
|
|
26
|
-
const qs = new QueryString('/collections/'
|
|
27
|
+
const qs = new QueryString(path('/collections/:collectionId/records', { collectionId }));
|
|
27
28
|
qs.addPagination(pagination);
|
|
28
29
|
return await this.requestCollection(qs, CollectionRecord.parse);
|
|
29
30
|
}
|
|
@@ -36,7 +37,7 @@ export class CollectionsEndpoint extends Endpoint {
|
|
|
36
37
|
}
|
|
37
38
|
async addRecord(collectionId, properties) {
|
|
38
39
|
try {
|
|
39
|
-
const qs = new QueryString('/collections
|
|
40
|
+
const qs = new QueryString(path('/collections/:collectionId', { collectionId }));
|
|
40
41
|
const result = await this.requestObject(qs, { properties }, CollectionRecord.parse, 'POST');
|
|
41
42
|
const updatedWorkspace = result.getData();
|
|
42
43
|
if (updatedWorkspace === null) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { path } from '../Http/Data/Path.js';
|
|
1
2
|
import { QueryString } from '../Http/Data/QueryString.js';
|
|
2
3
|
import { CommandExecutionHistory } from '../Model/Command/CommandExecutionHistory.js';
|
|
3
4
|
import { CommandExecutionStatus } from '../Model/Command/CommandExecutionStatus.js';
|
|
@@ -24,7 +25,7 @@ export class CommandExecutionEndpoint extends Endpoint {
|
|
|
24
25
|
return await this.requestCollection(queryString, CommandExecutionEndpoint.parse, null, 'GET');
|
|
25
26
|
}
|
|
26
27
|
async getById(id) {
|
|
27
|
-
const queryString = new QueryString('/system/command-executions
|
|
28
|
+
const queryString = new QueryString(path('/system/command-executions/:id', { id }));
|
|
28
29
|
const result = await this.requestObject(queryString, null, CommandExecutionEndpoint.parse, 'GET');
|
|
29
30
|
return result.getData();
|
|
30
31
|
}
|
|
@@ -3,6 +3,11 @@ import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
|
3
3
|
import { Endpoint } from './Endpoint.js';
|
|
4
4
|
export declare class ConfigEndpoint extends Endpoint {
|
|
5
5
|
getConfigByFlow(flowId: string, projectEnvironmentId?: string | null): Promise<CollectionResult<Config>>;
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* The id is required: the API route is `/projectenvironments/:projectEnvironmentId/configvalues`
|
|
8
|
+
* and 404s on an unknown environment. It used to default to null, which built
|
|
9
|
+
* `/projectenvironments/null/configvalues` — a request that could never succeed.
|
|
10
|
+
*/
|
|
11
|
+
getByProjectEnvironment(projectEnvironmentId: string): Promise<CollectionResult<Config>>;
|
|
7
12
|
saveConfigs(projectId: string, configs: Config[]): Promise<CollectionResult<Config>>;
|
|
8
13
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { path } from '../Http/Data/Path.js';
|
|
1
2
|
import { Utils } from '../Utils.js';
|
|
2
3
|
import { Config } from '../Model/Config.js';
|
|
3
4
|
import { Endpoint } from './Endpoint.js';
|
|
@@ -8,7 +9,7 @@ export class ConfigEndpoint extends Endpoint {
|
|
|
8
9
|
if (!Utils.isNullOrUndefined(projectEnvironmentId)) {
|
|
9
10
|
parameters = { environment: projectEnvironmentId };
|
|
10
11
|
}
|
|
11
|
-
const result = await this.requestCollection('/flows/'
|
|
12
|
+
const result = await this.requestCollection(path('/flows/:flowId/configvalues', { flowId }), Config.parse, parameters);
|
|
12
13
|
return result;
|
|
13
14
|
}
|
|
14
15
|
catch (error) {
|
|
@@ -18,9 +19,14 @@ export class ConfigEndpoint extends Endpoint {
|
|
|
18
19
|
throw error;
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
+
/**
|
|
23
|
+
* The id is required: the API route is `/projectenvironments/:projectEnvironmentId/configvalues`
|
|
24
|
+
* and 404s on an unknown environment. It used to default to null, which built
|
|
25
|
+
* `/projectenvironments/null/configvalues` — a request that could never succeed.
|
|
26
|
+
*/
|
|
27
|
+
async getByProjectEnvironment(projectEnvironmentId) {
|
|
22
28
|
try {
|
|
23
|
-
const result = await this.requestCollection('/projectenvironments/'
|
|
29
|
+
const result = await this.requestCollection(path('/projectenvironments/:projectEnvironmentId/configvalues', { projectEnvironmentId }), Config.parse);
|
|
24
30
|
return result;
|
|
25
31
|
}
|
|
26
32
|
catch (error) {
|