@narrative.io/data-collaboration-sdk-ts 4.3.0 → 4.4.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/build/data-planes/types.d.ts +26 -12
- package/build/generated/api-types.d.ts +75 -23
- package/build/generated/api-types.js +1 -1
- package/build/testing/fixtures/data-planes.d.ts +20 -3
- package/build/testing/fixtures/data-planes.js +49 -3
- package/build/testing/fixtures/index.d.ts +1 -1
- package/build/testing/fixtures/index.js +1 -1
- package/build/testing/handlers/data-planes.js +5 -3
- package/build/testing/index.d.ts +12 -4
- package/build/testing/index.js +11 -3
- package/build/testing/types.d.ts +27 -1
- package/package.json +1 -1
|
@@ -38,10 +38,11 @@ export interface SnowflakePlatform {
|
|
|
38
38
|
account_name: string;
|
|
39
39
|
organization_name: string;
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
41
|
+
* The platform can fail to parse a region when provisioning the Snowflake
|
|
42
|
+
* Native App, so this is informational only. Responses always carry the key,
|
|
43
|
+
* with an explicit `null` when there is no region.
|
|
43
44
|
*/
|
|
44
|
-
region?: DataPlaneRegion;
|
|
45
|
+
region?: DataPlaneRegion | null;
|
|
45
46
|
}
|
|
46
47
|
/** Platform details returned for a data plane the calling company owns. */
|
|
47
48
|
export type DataPlanePlatform = AwsPlatform | SnowflakePlatform;
|
|
@@ -51,7 +52,8 @@ export interface AwsSharedPlatform {
|
|
|
51
52
|
}
|
|
52
53
|
export interface SnowflakeSharedPlatform {
|
|
53
54
|
type: "platform_shared_snowflake";
|
|
54
|
-
region
|
|
55
|
+
/** Nullable for the same reason as {@link SnowflakePlatform.region}. */
|
|
56
|
+
region?: DataPlaneRegion | null;
|
|
55
57
|
}
|
|
56
58
|
/**
|
|
57
59
|
* Platform details returned for a data plane shared with you. Account
|
|
@@ -84,11 +86,21 @@ export interface DataPlaneOwnedResponse {
|
|
|
84
86
|
status: DataPlaneStatus;
|
|
85
87
|
updated_at: string;
|
|
86
88
|
collaborators: DataPlaneCollaborators;
|
|
89
|
+
/**
|
|
90
|
+
* Always present, empty when the plane has no pools: the backend field is a
|
|
91
|
+
* plain `List`, never an `Option`.
|
|
92
|
+
*/
|
|
87
93
|
compute_pools: ComputePoolResponse[];
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
94
|
+
/**
|
|
95
|
+
* The response encoder does not drop nulls, so each of these four arrives as
|
|
96
|
+
* an explicit `null` when absent rather than being left out. `tags` is `null`
|
|
97
|
+
* for a plane with no tags too — `DataPlaneResponse.apply` maps an empty list
|
|
98
|
+
* to `None` — though a directly constructed response can still send `[]`.
|
|
99
|
+
*/
|
|
100
|
+
description?: string | null;
|
|
101
|
+
tags?: string[] | null;
|
|
102
|
+
last_heartbeat_at?: string | null;
|
|
103
|
+
default_compute_pool_id?: string | null;
|
|
92
104
|
}
|
|
93
105
|
/**
|
|
94
106
|
* A data plane shared with the calling company. Omits details like the external
|
|
@@ -104,11 +116,13 @@ export interface DataPlaneSharedResponse {
|
|
|
104
116
|
platform: DataPlaneSharedPlatform;
|
|
105
117
|
status: DataPlaneStatus;
|
|
106
118
|
updated_at: string;
|
|
119
|
+
/** Required for the same reason as {@link DataPlaneOwnedResponse.compute_pools}. */
|
|
107
120
|
compute_pools: ComputePoolResponse[];
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
121
|
+
/** Nullable for the same reason as on {@link DataPlaneOwnedResponse}. */
|
|
122
|
+
description?: string | null;
|
|
123
|
+
tags?: string[] | null;
|
|
124
|
+
last_heartbeat_at?: string | null;
|
|
125
|
+
default_compute_pool_id?: string | null;
|
|
112
126
|
}
|
|
113
127
|
/** Discriminated union of the owned/shared data plane response shapes. */
|
|
114
128
|
export type DataPlane = DataPlaneOwnedResponse | DataPlaneSharedResponse;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* GENERATED FILE — DO NOT EDIT.
|
|
3
3
|
*
|
|
4
4
|
* Source: https://docs-cdn.narrative.io/api-reference/main/openapi.json
|
|
5
|
-
* Spec etag: W/"
|
|
5
|
+
* Spec etag: W/"1b05b0fe6188a5d59c67bbde3678af08"
|
|
6
6
|
*
|
|
7
7
|
* Regenerate with: bun run generate:api-types
|
|
8
8
|
*/
|
|
@@ -24249,15 +24249,54 @@ export interface components {
|
|
|
24249
24249
|
provider?: components["schemas"]["Provider"];
|
|
24250
24250
|
collaborators?: components["schemas"]["ComputePoolCollaborators"];
|
|
24251
24251
|
};
|
|
24252
|
+
AwsRegion: {
|
|
24253
|
+
/**
|
|
24254
|
+
* @description discriminator enum property added by openapi-typescript
|
|
24255
|
+
* @enum {string}
|
|
24256
|
+
*/
|
|
24257
|
+
type: "region_aws";
|
|
24258
|
+
/** @description AWS region identifier, e.g. `us-east-1`. */
|
|
24259
|
+
id: string;
|
|
24260
|
+
};
|
|
24252
24261
|
AwsPlatform: {
|
|
24253
|
-
/**
|
|
24262
|
+
/**
|
|
24263
|
+
* @description discriminator enum property added by openapi-typescript
|
|
24264
|
+
* @enum {string}
|
|
24265
|
+
*/
|
|
24254
24266
|
type: "platform_aws";
|
|
24255
|
-
|
|
24267
|
+
/** @description The 12-digit AWS account ID of the account hosting the data plane. */
|
|
24268
|
+
account_id: string;
|
|
24269
|
+
region: components["schemas"]["AwsRegion"];
|
|
24256
24270
|
};
|
|
24271
|
+
AzureRegion: {
|
|
24272
|
+
/**
|
|
24273
|
+
* @description discriminator enum property added by openapi-typescript
|
|
24274
|
+
* @enum {string}
|
|
24275
|
+
*/
|
|
24276
|
+
type: "region_azure";
|
|
24277
|
+
/** @description Azure region identifier, e.g. `uaenorth`. */
|
|
24278
|
+
id: string;
|
|
24279
|
+
};
|
|
24280
|
+
GcpRegion: {
|
|
24281
|
+
/**
|
|
24282
|
+
* @description discriminator enum property added by openapi-typescript
|
|
24283
|
+
* @enum {string}
|
|
24284
|
+
*/
|
|
24285
|
+
type: "region_gcp";
|
|
24286
|
+
/** @description GCP region identifier, e.g. `us-east4`. */
|
|
24287
|
+
id: string;
|
|
24288
|
+
};
|
|
24289
|
+
Region: components["schemas"]["AwsRegion"] | components["schemas"]["AzureRegion"] | components["schemas"]["GcpRegion"];
|
|
24257
24290
|
SnowflakePlatform: {
|
|
24258
|
-
/**
|
|
24291
|
+
/**
|
|
24292
|
+
* @description discriminator enum property added by openapi-typescript
|
|
24293
|
+
* @enum {string}
|
|
24294
|
+
*/
|
|
24259
24295
|
type: "platform_snowflake";
|
|
24260
|
-
|
|
24296
|
+
account_locator: string;
|
|
24297
|
+
account_name: string;
|
|
24298
|
+
organization_name: string;
|
|
24299
|
+
region?: components["schemas"]["Region"] | null;
|
|
24261
24300
|
};
|
|
24262
24301
|
Platform: components["schemas"]["AwsPlatform"] | components["schemas"]["SnowflakePlatform"];
|
|
24263
24302
|
"data-plane-collaborators_ParticipantsAll": {
|
|
@@ -24274,7 +24313,7 @@ export interface components {
|
|
|
24274
24313
|
*/
|
|
24275
24314
|
type: "none";
|
|
24276
24315
|
};
|
|
24277
|
-
"data-plane-collaborators_CompanyId":
|
|
24316
|
+
"data-plane-collaborators_CompanyId": number;
|
|
24278
24317
|
"data-plane-collaborators_ParticipantsInclusion": {
|
|
24279
24318
|
/**
|
|
24280
24319
|
* @description discriminator enum property added by openapi-typescript
|
|
@@ -24297,60 +24336,73 @@ export interface components {
|
|
|
24297
24336
|
manage_compute_pools: components["schemas"]["DataPlaneParticipants"];
|
|
24298
24337
|
};
|
|
24299
24338
|
DataPlaneOwnedResponse: {
|
|
24300
|
-
/**
|
|
24339
|
+
/**
|
|
24340
|
+
* @description discriminator enum property added by openapi-typescript
|
|
24341
|
+
* @enum {string}
|
|
24342
|
+
*/
|
|
24301
24343
|
type: "owned";
|
|
24302
24344
|
/** Format: uuid */
|
|
24303
24345
|
id: string;
|
|
24304
24346
|
company_id: number;
|
|
24305
24347
|
/** Format: date-time */
|
|
24306
24348
|
created_at: string;
|
|
24307
|
-
description?: string;
|
|
24349
|
+
description?: string | null;
|
|
24308
24350
|
display_name: string;
|
|
24309
24351
|
external_id: string;
|
|
24310
24352
|
platform: components["schemas"]["Platform"];
|
|
24311
24353
|
/** @enum {string} */
|
|
24312
24354
|
status: "active" | "archived";
|
|
24313
24355
|
/** Format: date-time */
|
|
24314
|
-
last_heartbeat_at?: string;
|
|
24315
|
-
tags?: string[];
|
|
24356
|
+
last_heartbeat_at?: string | null;
|
|
24357
|
+
tags?: string[] | null;
|
|
24316
24358
|
/** Format: date-time */
|
|
24317
24359
|
updated_at: string;
|
|
24318
24360
|
collaborators: components["schemas"]["DataPlaneCollaborators"];
|
|
24319
24361
|
/** Format: uuid */
|
|
24320
|
-
default_compute_pool_id?: string;
|
|
24321
|
-
compute_pools
|
|
24362
|
+
default_compute_pool_id?: string | null;
|
|
24363
|
+
compute_pools: components["schemas"]["ComputePoolResponse"][];
|
|
24322
24364
|
};
|
|
24323
24365
|
AwsSharedResponse: {
|
|
24324
|
-
/**
|
|
24366
|
+
/**
|
|
24367
|
+
* @description discriminator enum property added by openapi-typescript
|
|
24368
|
+
* @enum {string}
|
|
24369
|
+
*/
|
|
24325
24370
|
type: "platform_shared_aws";
|
|
24326
|
-
region:
|
|
24371
|
+
region: components["schemas"]["AwsRegion"];
|
|
24327
24372
|
};
|
|
24328
24373
|
SnowflakeSharedResponse: {
|
|
24329
|
-
/**
|
|
24374
|
+
/**
|
|
24375
|
+
* @description discriminator enum property added by openapi-typescript
|
|
24376
|
+
* @enum {string}
|
|
24377
|
+
*/
|
|
24330
24378
|
type: "platform_shared_snowflake";
|
|
24331
|
-
region?:
|
|
24379
|
+
region?: components["schemas"]["Region"] | null;
|
|
24332
24380
|
};
|
|
24333
24381
|
PlatformSharedResponse: components["schemas"]["AwsSharedResponse"] | components["schemas"]["SnowflakeSharedResponse"];
|
|
24334
24382
|
DataPlaneSharedResponse: {
|
|
24335
|
-
/**
|
|
24383
|
+
/**
|
|
24384
|
+
* @description discriminator enum property added by openapi-typescript
|
|
24385
|
+
* @enum {string}
|
|
24386
|
+
*/
|
|
24336
24387
|
type: "shared";
|
|
24388
|
+
/** Format: uuid */
|
|
24337
24389
|
id: string;
|
|
24338
|
-
company_id:
|
|
24390
|
+
company_id: number;
|
|
24339
24391
|
/** Format: date-time */
|
|
24340
24392
|
created_at: string;
|
|
24341
|
-
description?: string;
|
|
24393
|
+
description?: string | null;
|
|
24342
24394
|
display_name: string;
|
|
24343
24395
|
platform: components["schemas"]["PlatformSharedResponse"];
|
|
24344
24396
|
/** @enum {string} */
|
|
24345
24397
|
status: "active" | "archived";
|
|
24346
24398
|
/** Format: date-time */
|
|
24347
|
-
last_heartbeat_at?: string;
|
|
24348
|
-
tags?: string[];
|
|
24399
|
+
last_heartbeat_at?: string | null;
|
|
24400
|
+
tags?: string[] | null;
|
|
24349
24401
|
/** Format: date-time */
|
|
24350
24402
|
updated_at: string;
|
|
24351
24403
|
/** Format: uuid */
|
|
24352
|
-
default_compute_pool_id?: string;
|
|
24353
|
-
compute_pools
|
|
24404
|
+
default_compute_pool_id?: string | null;
|
|
24405
|
+
compute_pools: components["schemas"]["ComputePoolResponse"][];
|
|
24354
24406
|
};
|
|
24355
24407
|
DataPlaneResponse: components["schemas"]["DataPlaneOwnedResponse"] | components["schemas"]["DataPlaneSharedResponse"];
|
|
24356
24408
|
GetDataPlanesResponse: {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* GENERATED FILE — DO NOT EDIT.
|
|
3
3
|
*
|
|
4
4
|
* Source: https://docs-cdn.narrative.io/api-reference/main/openapi.json
|
|
5
|
-
* Spec etag: W/"
|
|
5
|
+
* Spec etag: W/"1b05b0fe6188a5d59c67bbde3678af08"
|
|
6
6
|
*
|
|
7
7
|
* Regenerate with: bun run generate:api-types
|
|
8
8
|
*/
|
|
@@ -1,8 +1,25 @@
|
|
|
1
|
-
import type { DataPlaneOwnedResponse, JobResponse } from "../types";
|
|
1
|
+
import type { DataPlaneOwnedResponse, DataPlaneSharedResponse, JobResponse } from "../types";
|
|
2
2
|
/**
|
|
3
3
|
* An owned, active data plane. Every field the spec requires is filled in, so a
|
|
4
|
-
* caller only overrides what its assertion is about.
|
|
4
|
+
* caller only overrides what its assertion is about. The optional fields are
|
|
5
|
+
* present and `null`, which is what the API sends for an absent value — a mock
|
|
6
|
+
* that omitted them would let a consumer assert `undefined` and still pass.
|
|
5
7
|
*/
|
|
6
|
-
export declare function
|
|
8
|
+
export declare function createOwnedDataPlane(overrides?: Partial<DataPlaneOwnedResponse>): DataPlaneOwnedResponse;
|
|
9
|
+
/**
|
|
10
|
+
* A data plane shared with the calling company, active, on AWS. Shared planes
|
|
11
|
+
* belong to someone else, so this one carries a different `company_id` and id
|
|
12
|
+
* than {@link createOwnedDataPlane} — seeding both gives you two records.
|
|
13
|
+
*
|
|
14
|
+
* Optional fields are present and `null` for the same reason as on the owned
|
|
15
|
+
* factory. For the other platform the API serves, override it:
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* createSharedDataPlane({
|
|
19
|
+
* platform: { type: "platform_shared_snowflake", region: null },
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function createSharedDataPlane(overrides?: Partial<DataPlaneSharedResponse>): DataPlaneSharedResponse;
|
|
7
24
|
/** The job a health check enqueues, pending and not yet attempted. */
|
|
8
25
|
export declare function createHealthCheckJob(overrides?: Partial<JobResponse>): JobResponse;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
const TIMESTAMP = "2026-01-01T00:00:00Z";
|
|
2
2
|
/**
|
|
3
3
|
* An owned, active data plane. Every field the spec requires is filled in, so a
|
|
4
|
-
* caller only overrides what its assertion is about.
|
|
4
|
+
* caller only overrides what its assertion is about. The optional fields are
|
|
5
|
+
* present and `null`, which is what the API sends for an absent value — a mock
|
|
6
|
+
* that omitted them would let a consumer assert `undefined` and still pass.
|
|
5
7
|
*/
|
|
6
|
-
export function
|
|
8
|
+
export function createOwnedDataPlane(overrides = {}) {
|
|
7
9
|
return {
|
|
8
10
|
type: "owned",
|
|
9
11
|
id: "5f9d1a4e-0000-4000-8000-000000000001",
|
|
@@ -11,13 +13,57 @@ export function createDataPlane(overrides = {}) {
|
|
|
11
13
|
created_at: TIMESTAMP,
|
|
12
14
|
display_name: "Test Data Plane",
|
|
13
15
|
external_id: "test-data-plane",
|
|
14
|
-
platform: {
|
|
16
|
+
platform: {
|
|
17
|
+
type: "platform_aws",
|
|
18
|
+
account_id: "123456789000",
|
|
19
|
+
region: { type: "region_aws", id: "us-east-1" },
|
|
20
|
+
},
|
|
15
21
|
status: "active",
|
|
16
22
|
updated_at: TIMESTAMP,
|
|
17
23
|
collaborators: {
|
|
18
24
|
participants: { type: "none" },
|
|
19
25
|
manage_compute_pools: { type: "none" },
|
|
20
26
|
},
|
|
27
|
+
compute_pools: [],
|
|
28
|
+
description: null,
|
|
29
|
+
tags: null,
|
|
30
|
+
last_heartbeat_at: null,
|
|
31
|
+
default_compute_pool_id: null,
|
|
32
|
+
...overrides,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A data plane shared with the calling company, active, on AWS. Shared planes
|
|
37
|
+
* belong to someone else, so this one carries a different `company_id` and id
|
|
38
|
+
* than {@link createOwnedDataPlane} — seeding both gives you two records.
|
|
39
|
+
*
|
|
40
|
+
* Optional fields are present and `null` for the same reason as on the owned
|
|
41
|
+
* factory. For the other platform the API serves, override it:
|
|
42
|
+
*
|
|
43
|
+
* ```ts
|
|
44
|
+
* createSharedDataPlane({
|
|
45
|
+
* platform: { type: "platform_shared_snowflake", region: null },
|
|
46
|
+
* });
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export function createSharedDataPlane(overrides = {}) {
|
|
50
|
+
return {
|
|
51
|
+
type: "shared",
|
|
52
|
+
id: "5f9d1a4e-0000-4000-8000-000000000002",
|
|
53
|
+
company_id: 2,
|
|
54
|
+
created_at: TIMESTAMP,
|
|
55
|
+
display_name: "Test Shared Data Plane",
|
|
56
|
+
platform: {
|
|
57
|
+
type: "platform_shared_aws",
|
|
58
|
+
region: { type: "region_aws", id: "us-east-1" },
|
|
59
|
+
},
|
|
60
|
+
status: "active",
|
|
61
|
+
updated_at: TIMESTAMP,
|
|
62
|
+
compute_pools: [],
|
|
63
|
+
description: null,
|
|
64
|
+
tags: null,
|
|
65
|
+
last_heartbeat_at: null,
|
|
66
|
+
default_compute_pool_id: null,
|
|
21
67
|
...overrides,
|
|
22
68
|
};
|
|
23
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { createHealthCheckJob, createOwnedDataPlane, createSharedDataPlane, } from "./data-planes";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { createHealthCheckJob, createOwnedDataPlane, createSharedDataPlane, } from "./data-planes";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { rejectUnauthenticated } from "../auth";
|
|
2
|
-
import {
|
|
2
|
+
import { createHealthCheckJob, createOwnedDataPlane, } from "../fixtures/data-planes";
|
|
3
3
|
/**
|
|
4
4
|
* Records live for the lifetime of one `createHandlers()` call, so each test
|
|
5
5
|
* suite gets its own copy and writes from one test can't leak into another.
|
|
@@ -16,7 +16,7 @@ function findOwned(store, id) {
|
|
|
16
16
|
const record = store.find(id);
|
|
17
17
|
return record?.type === "owned" ? record : undefined;
|
|
18
18
|
}
|
|
19
|
-
export function createDataPlaneHandlers(http, auth, seed = [
|
|
19
|
+
export function createDataPlaneHandlers(http, auth, seed = [createOwnedDataPlane()]) {
|
|
20
20
|
const store = createStore(seed);
|
|
21
21
|
return [
|
|
22
22
|
http.get("/data-planes", ({ request, cookies, response }) => {
|
|
@@ -49,7 +49,9 @@ export function createDataPlaneHandlers(http, auth, seed = [createDataPlane()])
|
|
|
49
49
|
const record = findOwned(store, params.data_plane_id);
|
|
50
50
|
if (!record)
|
|
51
51
|
return response(404).empty();
|
|
52
|
-
|
|
52
|
+
// null, not undefined: the encoder emits the key with an explicit
|
|
53
|
+
// null, and JSON.stringify would drop an undefined one entirely.
|
|
54
|
+
record.default_compute_pool_id = null;
|
|
53
55
|
return response(200).json(record);
|
|
54
56
|
}),
|
|
55
57
|
http.post("/data-planes/{data_plane_id}/health-check", async ({ params, request, cookies, response }) => {
|
package/build/testing/index.d.ts
CHANGED
|
@@ -7,12 +7,20 @@
|
|
|
7
7
|
*
|
|
8
8
|
* ```ts
|
|
9
9
|
* import { setupServer } from "msw/node";
|
|
10
|
-
* import {
|
|
10
|
+
* import {
|
|
11
|
+
* createHandlers,
|
|
12
|
+
* createOwnedDataPlane,
|
|
13
|
+
* createSharedDataPlane,
|
|
14
|
+
* } from "@narrative.io/data-collaboration-sdk-ts/testing";
|
|
11
15
|
*
|
|
12
|
-
* const server = setupServer(
|
|
16
|
+
* const server = setupServer(
|
|
17
|
+
* ...createHandlers({
|
|
18
|
+
* dataPlanes: [createOwnedDataPlane(), createSharedDataPlane()],
|
|
19
|
+
* }),
|
|
20
|
+
* );
|
|
13
21
|
* ```
|
|
14
22
|
*/
|
|
15
|
-
export {
|
|
23
|
+
export { createHealthCheckJob, createOwnedDataPlane, createSharedDataPlane, } from "./fixtures";
|
|
16
24
|
export { createHandlers } from "./handlers";
|
|
17
25
|
export { createDataPlaneHandlers } from "./handlers/data-planes";
|
|
18
|
-
export type { AuthGuard, AuthGuardContext, CreateHandlersOptions, DataPlaneOwnedResponse, DataPlaneResponse, JobResponse, } from "./types";
|
|
26
|
+
export type { AuthGuard, AuthGuardContext, CreateHandlersOptions, DataPlaneOwnedResponse, DataPlanePlatform, DataPlaneResponse, DataPlaneSharedPlatform, DataPlaneSharedResponse, JobResponse, } from "./types";
|
package/build/testing/index.js
CHANGED
|
@@ -7,11 +7,19 @@
|
|
|
7
7
|
*
|
|
8
8
|
* ```ts
|
|
9
9
|
* import { setupServer } from "msw/node";
|
|
10
|
-
* import {
|
|
10
|
+
* import {
|
|
11
|
+
* createHandlers,
|
|
12
|
+
* createOwnedDataPlane,
|
|
13
|
+
* createSharedDataPlane,
|
|
14
|
+
* } from "@narrative.io/data-collaboration-sdk-ts/testing";
|
|
11
15
|
*
|
|
12
|
-
* const server = setupServer(
|
|
16
|
+
* const server = setupServer(
|
|
17
|
+
* ...createHandlers({
|
|
18
|
+
* dataPlanes: [createOwnedDataPlane(), createSharedDataPlane()],
|
|
19
|
+
* }),
|
|
20
|
+
* );
|
|
13
21
|
* ```
|
|
14
22
|
*/
|
|
15
|
-
export {
|
|
23
|
+
export { createHealthCheckJob, createOwnedDataPlane, createSharedDataPlane, } from "./fixtures";
|
|
16
24
|
export { createHandlers } from "./handlers";
|
|
17
25
|
export { createDataPlaneHandlers } from "./handlers/data-planes";
|
package/build/testing/types.d.ts
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
import type { components } from "../generated/api-types";
|
|
2
2
|
/** A data plane as the API returns it, owned or shared. */
|
|
3
3
|
export type DataPlaneResponse = components["schemas"]["DataPlaneResponse"];
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* A data plane this company owns. Only owned planes carry an external id and
|
|
6
|
+
* collaborators, and only they accept the default-compute-pool endpoints.
|
|
7
|
+
*/
|
|
5
8
|
export type DataPlaneOwnedResponse = components["schemas"]["DataPlaneOwnedResponse"];
|
|
9
|
+
/**
|
|
10
|
+
* A data plane shared with this company. Same shape as the owned variant minus
|
|
11
|
+
* `external_id` and `collaborators`, and its platform is one of the
|
|
12
|
+
* `platform_shared_*` types rather than the owned ones.
|
|
13
|
+
*/
|
|
14
|
+
export type DataPlaneSharedResponse = components["schemas"]["DataPlaneSharedResponse"];
|
|
15
|
+
/**
|
|
16
|
+
* The platform an owned data plane runs on — AWS or Snowflake.
|
|
17
|
+
*
|
|
18
|
+
* Both factories default to AWS, so a test that needs another variant passes
|
|
19
|
+
* this as a `platform` override. Named after the root entry point's
|
|
20
|
+
* `DataPlanePlatform` rather than the generated schema's bare `Platform`, so
|
|
21
|
+
* the two entry points read the same way — the two are assignable in both
|
|
22
|
+
* directions.
|
|
23
|
+
*/
|
|
24
|
+
export type DataPlanePlatform = components["schemas"]["Platform"];
|
|
25
|
+
/**
|
|
26
|
+
* The platform a shared data plane runs on. Distinct from
|
|
27
|
+
* {@link DataPlanePlatform}: the discriminators are the `platform_shared_*`
|
|
28
|
+
* ones, and `region` is required on the AWS variant but optional and nullable
|
|
29
|
+
* on the Snowflake one.
|
|
30
|
+
*/
|
|
31
|
+
export type DataPlaneSharedPlatform = components["schemas"]["PlatformSharedResponse"];
|
|
6
32
|
/** A job as the API returns it, including the one a health check enqueues. */
|
|
7
33
|
export type JobResponse = components["schemas"]["JobResponse"];
|
|
8
34
|
export interface AuthGuardContext {
|