@keboola/api-fixtures 30.0.0 → 34.0.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/AGENTS.md CHANGED
@@ -20,6 +20,9 @@ Current slices:
20
20
  surface. The three compose into one coherent app (an app's `production` names a deployment in
21
21
  `listDeployments()`; runs name deployments that exist), so a fixture added here must keep that
22
22
  join intact — `apps.test.ts` is what enforces it.
23
+ - `businessWorkspaceApi.dashboards` — `getBusinessWorkspaceDashboard()`, `listBusinessWorkspaceDashboards()`,
24
+ `getBusinessWorkspaceDashboardInput()`; one per-user Business Workspace dashboard whose `spec.id`
25
+ equals the row id, as the service enforces.
23
26
 
24
27
  ## When to use fixtures vs MSW vs real API
25
28
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,59 @@
1
1
  # @keboola/api-fixtures
2
2
 
3
+ ## 34.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add `businessWorkspaceApi.dashboards` fixtures (`getBusinessWorkspaceDashboard`, `listBusinessWorkspaceDashboards`, `getBusinessWorkspaceDashboardInput`) typed against the Business Workspace dashboards API.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies:
12
+ - @keboola/api-client@39.0.0
13
+
14
+ ## 33.0.0
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies:
19
+ - @keboola/api-client@38.0.0
20
+
21
+ ## 32.0.0
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies:
26
+ - @keboola/api-client@37.0.0
27
+
28
+ ## 31.0.0
29
+
30
+ ### Major Changes
31
+
32
+ - **Breaking:** the `apps` (`/v2` App Deployments) types are regenerated from the current canary spec, which renamed and dropped fields across `App` and `Deployment`.
33
+
34
+ `App`:
35
+ - `production.desiredId` / `actualId` → `production.desiredDeploymentId` / `actualDeploymentId`; the `desiredNumber` / `actualNumber` twins are gone.
36
+ - `state` values are camelCase and the set changed: `notDeployed | starting | running | suspended | disabled`. `SLEEPING` and `SUSPENDED` collapse into `suspended` (stopped, wakes on the next request); the new `disabled` is stopped by a failure and will not auto-wake.
37
+ - `configVersion`, `mode` and `undeployedChanges` are gone — an app no longer reports whether its config has moved past what is deployed.
38
+
39
+ `Deployment`:
40
+ - `number` and `configId` are gone; `size` → `runtimeSize`. Ids are UUIDv7, not the Kubernetes CR name.
41
+ - `buildState` is `pending | building | ready | failed` (`PREBUILT` → `ready`) and `runState` is camelCase.
42
+
43
+ Client surface:
44
+ - `unpublishApp`, `suspendApp`, `resumeApp` and `promoteDeployment` resolve with the `App` instead of `App | null` — the service answers a no-op with the app unchanged rather than `204`.
45
+ - `resetAppPassword` resolves with `{ password }` rather than the app.
46
+ - `getDeployments` takes a query (`archived`, `offset`, `limit`) between the app id and the signal.
47
+ - `createDeployment` takes `configVersion` to pin an older config version, and `createApp` requires `branchId` and `useManagedGitRepo`.
48
+ - `PATCH /apps/{appId}` is gone from the spec; it was never exposed.
49
+
50
+ `appFixtures` loses `undeployedChanges` and `sleeping`, and gains `disabled`.
51
+
52
+ ### Patch Changes
53
+
54
+ - Updated dependencies:
55
+ - @keboola/api-client@36.0.0
56
+
3
57
  ## 30.0.0
4
58
 
5
59
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1,73 +1,59 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let _keboola_api_client_constants = require("@keboola/api-client/constants");
3
3
  //#region src/clients/apps/deployments.ts
4
- /**
5
- * Deployment ids are the deterministic Kubernetes CR name — `app-{appId}-dpl-{hash}` —
6
- * so they are reproduced in that shape rather than as opaque strings.
7
- */
8
4
  const APP_ID = "374811";
9
- const deploymentId = (hash) => `app-${APP_ID}-dpl-${hash}`;
5
+ const deploymentId = (suffix) => `019f1c3a-${suffix}-7c1e-b4a2-0d9f3e6a8c15`;
10
6
  const archivedDeployment = {
11
- id: deploymentId("350e2cf5287c5665"),
12
- number: 1,
13
- configId: "01kz9kny4n49x3xk0e4k8ynpmq",
7
+ id: deploymentId("0a41"),
14
8
  configVersion: "14",
15
9
  gitCommitSha: null,
16
- size: "tiny",
17
- buildState: "PREBUILT",
18
- runState: "STOPPED",
10
+ runtimeSize: "tiny",
11
+ buildState: "ready",
12
+ runState: "stopped",
19
13
  archived: true,
20
14
  archivedAt: "2026-08-15T11:03:02+00:00",
21
15
  createdAt: "2026-08-10T09:12:44+00:00"
22
16
  };
23
17
  const liveDeployment = {
24
- id: deploymentId("7a4c1b9e0d3f2a81"),
25
- number: 2,
26
- configId: "01kz9kny4n49x3xk0e4k8ynpmq",
18
+ id: deploymentId("1b52"),
27
19
  configVersion: "16",
28
20
  gitCommitSha: null,
29
- size: "small",
30
- buildState: "PREBUILT",
31
- runState: "RUNNING",
21
+ runtimeSize: "small",
22
+ buildState: "ready",
23
+ runState: "running",
32
24
  archived: false,
33
25
  archivedAt: null,
34
26
  createdAt: "2026-08-15T11:02:58+00:00"
35
27
  };
36
28
  const stagedDeployment = {
37
- id: deploymentId("c5e83f17b204de96"),
38
- number: 3,
39
- configId: "01kz9kny4n49x3xk0e4k8ynpmq",
29
+ id: deploymentId("2c63"),
40
30
  configVersion: "18",
41
31
  gitCommitSha: null,
42
- size: "small",
43
- buildState: "PREBUILT",
44
- runState: "NEVER_RUN",
32
+ runtimeSize: "small",
33
+ buildState: "ready",
34
+ runState: "neverRun",
45
35
  archived: false,
46
36
  archivedAt: null,
47
37
  createdAt: "2026-08-17T08:41:19+00:00"
48
38
  };
49
39
  const buildFailedDeployment = {
50
- id: deploymentId("e91d47a8c6b02f35"),
51
- number: 4,
52
- configId: "01kz9kny4n49x3xk0e4k8ynpmq",
40
+ id: deploymentId("3d74"),
53
41
  configVersion: "19",
54
42
  gitCommitSha: null,
55
- size: "small",
56
- buildState: "FAILED",
57
- runState: "NEVER_RUN",
43
+ runtimeSize: "small",
44
+ buildState: "failed",
45
+ runState: "neverRun",
58
46
  archived: false,
59
47
  archivedAt: null,
60
48
  createdAt: "2026-08-17T09:05:33+00:00"
61
49
  };
62
50
  const runFailedDeployment = {
63
- id: deploymentId("2b6f0a94e7d51c83"),
64
- number: 5,
65
- configId: "01kz9kny4n49x3xk0e4k8ynpmq",
51
+ id: deploymentId("4e85"),
66
52
  configVersion: "20",
67
53
  gitCommitSha: null,
68
- size: "small",
69
- buildState: "PREBUILT",
70
- runState: "FAILED",
54
+ runtimeSize: "small",
55
+ buildState: "ready",
56
+ runState: "failed",
71
57
  archived: false,
72
58
  archivedAt: null,
73
59
  createdAt: "2026-08-17T09:31:07+00:00"
@@ -81,16 +67,16 @@ const deploymentFixtures = {
81
67
  };
82
68
  const getDeployment = () => liveDeployment;
83
69
  /**
84
- * One continuous history: #1 retired, #2 serving, #3 staged, #4 failed to build, #5 built but its
85
- * run failed.
70
+ * One continuous history: the oldest deleted, the next serving, then one staged, one that failed to
71
+ * build and one that built but whose run failed.
86
72
  *
87
- * All five, because `runFixtures.failed` names #5 as its deployment — a list that left the failed
88
- * ones out could not be joined to the runs, which is the join a timeline is built from.
73
+ * All five, because `runFixtures.failed` names the last one as its deployment — a list that left
74
+ * the failed ones out could not be joined to the runs, which is the join a timeline is built from.
89
75
  *
90
- * Returned in ascending `number` order. The endpoint does not specify an order, so consumers must
91
- * sort for themselves — this order is a fixture convention, not a contract to rely on, and it is
92
- * ascending on purpose: a consumer that assumes newest-first gets the wrong answer here rather
93
- * than in production.
76
+ * Returned oldest first. The endpoint does not specify an order, so consumers must sort for
77
+ * themselves — this order is a fixture convention, not a contract to rely on, and it is oldest
78
+ * first on purpose: a consumer that assumes newest-first gets the wrong answer here rather than in
79
+ * production.
94
80
  */
95
81
  const listDeployments = () => [
96
82
  archivedDeployment,
@@ -101,7 +87,6 @@ const listDeployments = () => [
101
87
  ];
102
88
  //#endregion
103
89
  //#region src/clients/apps/apps.ts
104
- const APP_URL = "https://hello-dashboard-374811.hub.canary-orion.keboola.dev";
105
90
  const base$1 = {
106
91
  id: APP_ID,
107
92
  projectId: "14",
@@ -109,120 +94,83 @@ const base$1 = {
109
94
  branchId: "6",
110
95
  configId: "01kz9kny4n49x3xk0e4k8ynpmq",
111
96
  type: "streamlit",
112
- mode: "prod",
113
- url: APP_URL
97
+ url: "https://hello-dashboard-374811.hub.canary-orion.keboola.dev"
114
98
  };
115
99
  const production = (deployment) => ({
116
- desiredNumber: deployment.number,
117
- desiredId: deployment.id,
118
- actualNumber: deployment.number,
119
- actualId: deployment.id
100
+ desiredDeploymentId: deployment.id,
101
+ actualDeploymentId: deployment.id
120
102
  });
103
+ const NOTHING_IN_PRODUCTION = {
104
+ desiredDeploymentId: null,
105
+ actualDeploymentId: null
106
+ };
121
107
  const neverDeployedApp = {
122
108
  ...base$1,
123
- configVersion: "1",
124
- production: {
125
- desiredNumber: null,
126
- desiredId: null,
127
- actualNumber: null,
128
- actualId: null
129
- },
130
- undeployedChanges: false,
131
- state: "NOT_DEPLOYED"
109
+ production: NOTHING_IN_PRODUCTION,
110
+ state: "notDeployed"
132
111
  };
133
112
  /**
134
- * Transcribed verbatim from canary on 17 Aug 2026 (AJDA-3140, probe P1): an app created and
135
- * started through `/v1`, serving real traffic (HTTP 200, 8340 B) at the moment this was read,
136
- * which `/v2` nonetheless reports as `NOT_DEPLOYED` with an empty `production` because it was
137
- * never adopted into the deployments model.
113
+ * An app created and started through `/v1`, serving real traffic (AJDA-3140, probe P1: HTTP 200,
114
+ * 8340 B at the moment this was read), which `/v2` nonetheless reports as `notDeployed` with an
115
+ * empty `production` because it was never adopted into the deployments model.
138
116
  *
139
117
  * The Builder must never read "is this app serving" off `state` alone — here that answer is
140
118
  * wrong in the most damaging direction.
141
119
  */
142
120
  const legacyV1ServingApp = {
143
- id: "374811",
144
- projectId: "14",
145
- componentId: "keboola.data-apps",
146
- branchId: "6",
147
- configId: "01kz9kny4n49x3xk0e4k8ynpmq",
148
- configVersion: "2",
149
- type: "streamlit",
150
- mode: "dev",
151
- url: APP_URL,
152
- production: {
153
- desiredNumber: null,
154
- desiredId: null,
155
- actualNumber: null,
156
- actualId: null
157
- },
158
- undeployedChanges: false,
159
- state: "NOT_DEPLOYED"
121
+ ...base$1,
122
+ id: "374899",
123
+ production: NOTHING_IN_PRODUCTION,
124
+ state: "notDeployed"
160
125
  };
161
126
  const runningApp = {
162
127
  ...base$1,
163
- configVersion: deploymentFixtures.live.configVersion,
164
128
  production: production(deploymentFixtures.live),
165
- undeployedChanges: false,
166
- state: "RUNNING"
129
+ state: "running"
130
+ };
131
+ /**
132
+ * A blue/green promotion in flight: the staged deployment has been asked for, the live one is still
133
+ * what traffic reaches. `state` stays `running` throughout — the rollout is only visible as
134
+ * `desiredDeploymentId !== actualDeploymentId`.
135
+ */
136
+ const promotingApp = {
137
+ ...base$1,
138
+ production: {
139
+ desiredDeploymentId: deploymentFixtures.staged.id,
140
+ actualDeploymentId: deploymentFixtures.live.id
141
+ },
142
+ state: "running"
167
143
  };
168
- const appWithUndeployedChanges = {
144
+ const suspendedApp = {
169
145
  ...base$1,
170
- configVersion: deploymentFixtures.staged.configVersion,
171
146
  production: production(deploymentFixtures.live),
172
- undeployedChanges: true,
173
- state: "RUNNING"
147
+ state: "suspended"
174
148
  };
175
149
  const appFixtures = {
176
150
  neverDeployed: neverDeployedApp,
177
151
  legacyV1Serving: legacyV1ServingApp,
178
152
  running: runningApp,
179
- undeployedChanges: appWithUndeployedChanges,
180
- promoting: {
181
- ...base$1,
182
- configVersion: deploymentFixtures.staged.configVersion,
183
- production: {
184
- desiredNumber: deploymentFixtures.staged.number,
185
- desiredId: deploymentFixtures.staged.id,
186
- actualNumber: deploymentFixtures.live.number,
187
- actualId: deploymentFixtures.live.id
188
- },
189
- undeployedChanges: true,
190
- state: "RUNNING"
191
- },
192
- sleeping: {
153
+ promoting: promotingApp,
154
+ suspended: suspendedApp,
155
+ disabled: {
193
156
  ...base$1,
194
- configVersion: deploymentFixtures.live.configVersion,
195
- production: production(deploymentFixtures.live),
196
- undeployedChanges: false,
197
- state: "SLEEPING"
198
- },
199
- suspended: {
200
- ...base$1,
201
- configVersion: deploymentFixtures.live.configVersion,
202
- production: production(deploymentFixtures.live),
203
- undeployedChanges: false,
204
- state: "SUSPENDED"
157
+ production: production(deploymentFixtures.runFailed),
158
+ state: "disabled"
205
159
  }
206
160
  };
207
161
  const getApp = () => runningApp;
208
162
  /**
209
163
  * The named fixtures above are all the *same* app in different states, which is what a detail
210
- * page shows. A listing shows different apps, so each entry past the first is re-addressed —
211
- * including the deployment ids inside `production`, which embed the app id.
164
+ * page shows. A listing shows different apps, so each entry past the first is re-addressed.
212
165
  */
213
166
  const readdress = (app, id) => ({
214
167
  ...app,
215
168
  id,
216
- url: `https://data-app-${id}.hub.canary-orion.keboola.dev`,
217
- production: {
218
- ...app.production,
219
- desiredId: app.production.desiredId?.replace("374811", id) ?? null,
220
- actualId: app.production.actualId?.replace("374811", id) ?? null
221
- }
169
+ url: `https://data-app-${id}.hub.canary-orion.keboola.dev`
222
170
  });
223
171
  const listApps = () => [
224
172
  runningApp,
225
- readdress(appWithUndeployedChanges, "374812"),
173
+ readdress(suspendedApp, "374812"),
226
174
  readdress(neverDeployedApp, "374813")
227
175
  ];
228
176
  //#endregion
@@ -313,6 +261,57 @@ const listAppRuns = () => [
313
261
  finishedRun
314
262
  ];
315
263
  //#endregion
264
+ //#region src/clients/businessWorkspaceApi/dashboards.ts
265
+ const DASHBOARD_ID = "6f1b1e0a-8c2d-4f6e-9a3b-1c2d3e4f5a6b";
266
+ const salesDashboard = {
267
+ id: DASHBOARD_ID,
268
+ ownerUserId: 7,
269
+ primaryProjectId: 42,
270
+ sourceProjectIds: [42, 43],
271
+ title: "Sales overview",
272
+ description: "Revenue and pipeline across regions",
273
+ spec: {
274
+ version: 1,
275
+ id: DASHBOARD_ID,
276
+ name: "Sales overview",
277
+ description: "Revenue and pipeline across regions",
278
+ columns: 12,
279
+ widgets: [{
280
+ id: "revenue",
281
+ type: "metric",
282
+ title: "Revenue",
283
+ layout: {
284
+ x: 0,
285
+ y: 0,
286
+ w: 4,
287
+ h: 2
288
+ },
289
+ config: { metric: "revenue" }
290
+ }]
291
+ },
292
+ createdAt: "2026-01-15T10:00:00.000Z",
293
+ updatedAt: "2026-02-01T09:30:00.000Z"
294
+ };
295
+ const getBusinessWorkspaceDashboard = () => salesDashboard;
296
+ const listBusinessWorkspaceDashboards = () => [{
297
+ id: salesDashboard.id,
298
+ ownerUserId: salesDashboard.ownerUserId,
299
+ primaryProjectId: salesDashboard.primaryProjectId,
300
+ sourceProjectIds: salesDashboard.sourceProjectIds,
301
+ title: salesDashboard.title,
302
+ description: salesDashboard.description,
303
+ createdAt: salesDashboard.createdAt,
304
+ updatedAt: salesDashboard.updatedAt
305
+ }];
306
+ const getBusinessWorkspaceDashboardInput = () => ({
307
+ id: salesDashboard.id,
308
+ title: salesDashboard.title,
309
+ description: salesDashboard.description,
310
+ spec: salesDashboard.spec,
311
+ primaryProjectId: salesDashboard.primaryProjectId,
312
+ sourceProjectIds: salesDashboard.sourceProjectIds
313
+ });
314
+ //#endregion
316
315
  //#region src/clients/developerPortal/apps.ts
317
316
  const keboolaVendor = {
318
317
  id: "keboola",
@@ -942,6 +941,11 @@ const fixtures = {
942
941
  fixtures: runFixtures
943
942
  }
944
943
  },
944
+ businessWorkspaceApi: { dashboards: {
945
+ getDashboard: getBusinessWorkspaceDashboard,
946
+ listDashboards: listBusinessWorkspaceDashboards,
947
+ getDashboardInput: getBusinessWorkspaceDashboardInput
948
+ } },
945
949
  developerPortal: {
946
950
  listPublishedApps,
947
951
  listVendorApps,
@@ -963,6 +967,8 @@ exports.developerPortalFixtures = developerPortalFixtures;
963
967
  exports.fixtures = fixtures;
964
968
  exports.getApp = getApp;
965
969
  exports.getAppRun = getAppRun;
970
+ exports.getBusinessWorkspaceDashboard = getBusinessWorkspaceDashboard;
971
+ exports.getBusinessWorkspaceDashboardInput = getBusinessWorkspaceDashboardInput;
966
972
  exports.getDeployment = getDeployment;
967
973
  exports.getDevBranches = getDevBranches;
968
974
  exports.getStackInfo = getStackInfo;
@@ -973,6 +979,7 @@ exports.listAllVendors = listAllVendors;
973
979
  exports.listAppChanges = listAppChanges;
974
980
  exports.listAppRuns = listAppRuns;
975
981
  exports.listApps = listApps;
982
+ exports.listBusinessWorkspaceDashboards = listBusinessWorkspaceDashboards;
976
983
  exports.listDeployments = listDeployments;
977
984
  exports.listPublishedApps = listPublishedApps;
978
985
  exports.listServiceAccounts = listServiceAccounts;