@regressionbot/sdk 2.4.0 → 2.5.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/README.md CHANGED
@@ -74,6 +74,14 @@ the builder, intent-aware verdicts, environment gates, baseline policies, and
74
74
  scheduling. `scheduleHourUtc` needs API 2.7.0 or later — on an older API the
75
75
  field is accepted and ignored, and the schedule stays anchored to its first run.
76
76
 
77
+ ### 2.5.0
78
+
79
+ - **`updateProject()` now returns `baselinesInvalidated`.** The API has always sent it
80
+ back alongside the updated project; the 2.0 unwrap kept the project and dropped it, so
81
+ a caller had to re-derive whether a patch invalidated baselines from which fields they
82
+ sent. Read it directly instead — true only when this patch discarded baselines that
83
+ existed, never on a create.
84
+
77
85
  ### 2.4.0
78
86
 
79
87
  Needs API 2.9.0 or later. On an older API the new fields are simply absent.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { VRConfig, Viewport, Viewports, JobStatus, JobSummary, JobProgress, PageResult, ProjectConfig, ProjectPath, ProjectScan, JobAiSummary, RegionVerdict, ResultVerdict, VerdictDecision, RegressionbotSummaryItem, RunContext, IntentAssessment, BaselinePolicy, ProjectSchedule, ProjectConfigUpdate, EnvGate, SummaryStatus, ApproveResult, ApproveWhere, Change, ChangeType, StyleDelta, ChangeBox } from './types';
1
+ import { VRConfig, Viewport, Viewports, JobStatus, JobSummary, JobProgress, PageResult, ProjectConfig, ProjectPath, ProjectScan, JobAiSummary, RegionVerdict, ResultVerdict, VerdictDecision, RegressionbotSummaryItem, RunContext, IntentAssessment, BaselinePolicy, ProjectSchedule, ProjectConfigUpdate, ProjectUpdateResult, EnvGate, SummaryStatus, ApproveResult, ApproveWhere, Change, ChangeType, StyleDelta, ChangeBox } from './types';
2
2
  import { sanitizeFilename, sanitizeUrlToPath } from './security';
3
3
  export { sanitizeFilename, sanitizeUrlToPath, Viewports };
4
- export type { PageResult, JobProgress, JobStatus, JobSummary, Viewport, VRConfig, ProjectConfig, ProjectPath, ProjectScan, JobAiSummary, RegionVerdict, ResultVerdict, VerdictDecision, RegressionbotSummaryItem, RunContext, IntentAssessment, BaselinePolicy, ProjectSchedule, ProjectConfigUpdate, EnvGate, SummaryStatus, ApproveResult, ApproveWhere, Change, ChangeType, StyleDelta, ChangeBox };
4
+ export type { PageResult, JobProgress, JobStatus, JobSummary, Viewport, VRConfig, ProjectConfig, ProjectPath, ProjectScan, JobAiSummary, RegionVerdict, ResultVerdict, VerdictDecision, RegressionbotSummaryItem, RunContext, IntentAssessment, BaselinePolicy, ProjectSchedule, ProjectConfigUpdate, ProjectUpdateResult, EnvGate, SummaryStatus, ApproveResult, ApproveWhere, Change, ChangeType, StyleDelta, ChangeBox };
5
5
  export declare class RegressionBot {
6
6
  private apiKey;
7
7
  private apiUrl;
@@ -57,7 +57,7 @@ export declare class RegressionBot {
57
57
  * Changing anything that decides what a capture looks like invalidates the
58
58
  * stored baselines — see {@link ProjectConfigUpdate}.
59
59
  */
60
- updateProject(projectName: string, config: ProjectConfigUpdate): Promise<ProjectConfig>;
60
+ updateProject(projectName: string, config: ProjectConfigUpdate): Promise<ProjectUpdateResult>;
61
61
  _request<T>(path: string, method?: string, body?: any): Promise<T>;
62
62
  }
63
63
  export declare class JobBuilder {
package/dist/index.js CHANGED
@@ -64,9 +64,9 @@ class RegressionBot {
64
64
  * stored baselines — see {@link ProjectConfigUpdate}.
65
65
  */
66
66
  async updateProject(projectName, config) {
67
- // The API wraps the updated project in { message, project }.
67
+ // The API wraps the updated project in { message, baselinesInvalidated, project }.
68
68
  const res = await this._request(`/project/${encodeURIComponent(projectName)}`, 'PUT', config);
69
- return res.project;
69
+ return { ...res.project, baselinesInvalidated: res.baselinesInvalidated };
70
70
  }
71
71
  // Internal fetch wrapper
72
72
  async _request(path, method = 'GET', body) {
package/dist/types.d.ts CHANGED
@@ -98,6 +98,14 @@ export interface ProjectConfig {
98
98
  baselineVersion?: string;
99
99
  baselineInvalidatedAt?: string;
100
100
  }
101
+ /**
102
+ * What updateProject() returns: the saved config plus whether this patch
103
+ * discarded the stored baselines, so a caller does not have to re-derive that
104
+ * from which fields they sent. Never true on a create.
105
+ */
106
+ export interface ProjectUpdateResult extends ProjectConfig {
107
+ baselinesInvalidated: boolean;
108
+ }
101
109
  /**
102
110
  * The fields updateProject() accepts.
103
111
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regressionbot/sdk",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "The official SDK for regressionbot.com - the simplest way to automate visual regression testing.",
5
5
  "homepage": "https://regressionbot.com",
6
6
  "repository": {