@microsoft/rayfin-client 1.34.0-beta.1 → 1.35.0-alpha.1274
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.
|
@@ -1,7 +1,37 @@
|
|
|
1
|
-
import { createConnectorsApi, type ConnectorsSchema } from '@microsoft/rayfin-connectors';
|
|
1
|
+
import { createConnectorsApi, type ConnectorConfig, type ConnectorsRuntime, type ConnectorsSchema, type HostEnvironment } from '@microsoft/rayfin-connectors';
|
|
2
2
|
import { type EntitySchema } from '@microsoft/rayfin-data';
|
|
3
3
|
import { type FunctionsSchema } from '@microsoft/rayfin-functions';
|
|
4
4
|
import RayfinClient, { RayfinClientConfig } from '../client.js';
|
|
5
|
+
/**
|
|
6
|
+
* (Experimental) Config for `ConnectorsRayfinClient`. Extends the
|
|
7
|
+
* stable {@link RayfinClientConfig} with an optional `connectors` map so
|
|
8
|
+
* the Builder can declare each connector's runtime routing config
|
|
9
|
+
* (`{ connector: ConnectorType }`) at client construction.
|
|
10
|
+
*
|
|
11
|
+
* The map is consumed by `createConnectorsApi` to pick the right
|
|
12
|
+
* transport per connector name (Cat A GraphQL vs Cat B invoke).
|
|
13
|
+
*/
|
|
14
|
+
export interface ConnectorsRayfinClientConfig<TConnectorsSchema extends ConnectorsSchema = ConnectorsSchema> extends RayfinClientConfig {
|
|
15
|
+
/**
|
|
16
|
+
* (Experimental) Per-connector routing config keyed by the connector
|
|
17
|
+
* name used in `rayfin.yml`. Mirrors the CLI-generated
|
|
18
|
+
* `connectorConfig` constants exported from each
|
|
19
|
+
* `rayfin/connectors/<name>/schema.ts`. Required and exhaustive: every
|
|
20
|
+
* connector declared in `TConnectorsSchema` must have a runtime config.
|
|
21
|
+
*/
|
|
22
|
+
connectors: Record<keyof TConnectorsSchema & string, ConnectorConfig>;
|
|
23
|
+
/**
|
|
24
|
+
* (Experimental) Hosting environment the connectors runtime runs in. Carried
|
|
25
|
+
* on every invocation context so a registered invoke middleware can branch
|
|
26
|
+
* on it (embedded-in-Fabric vs standalone vs cli). When omitted, the host is
|
|
27
|
+
* auto-detected (`detectHost()`) so callers wire up nothing — `cli` under
|
|
28
|
+
* Node, `embedded` inside a parent frame, otherwise `standalone`. Pass an
|
|
29
|
+
* explicit value only to override detection. The connectors layer only
|
|
30
|
+
* carries this value; confirming a specific Fabric host is the job of the
|
|
31
|
+
* connector-specific package.
|
|
32
|
+
*/
|
|
33
|
+
host?: HostEnvironment;
|
|
34
|
+
}
|
|
5
35
|
/**
|
|
6
36
|
* (Experimental) Rayfin client that surfaces the typed connectors runtime as
|
|
7
37
|
* `client.connectors.<name>.<operation>(input, options?)`.
|
|
@@ -39,6 +69,22 @@ import RayfinClient, { RayfinClientConfig } from '../client.js';
|
|
|
39
69
|
* });
|
|
40
70
|
* ```
|
|
41
71
|
*
|
|
72
|
+
* Connectors whose operations return a binary stream (such as the
|
|
73
|
+
* `fabric-semanticmodel` Apache Arrow response) need a runtime decoder. Pass a
|
|
74
|
+
* {@link ConnectorsRuntime} as the second constructor argument, keyed by the
|
|
75
|
+
* same connector names used in the schema:
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* import { fabricSemanticModel } from '@microsoft/rayfin-connector-fabric-semanticmodel';
|
|
80
|
+
*
|
|
81
|
+
* const client = new ConnectorsRayfinClient<
|
|
82
|
+
* DataSchema,
|
|
83
|
+
* FunctionsSchema,
|
|
84
|
+
* AppConnectorsSchema
|
|
85
|
+
* >(config, { salesModel: fabricSemanticModel() });
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
42
88
|
* @alpha
|
|
43
89
|
* @internal
|
|
44
90
|
*/
|
|
@@ -51,11 +97,18 @@ export declare class ConnectorsRayfinClient<TSchema extends EntitySchema = Recor
|
|
|
51
97
|
readonly connectors: ReturnType<typeof createConnectorsApi<TConnectorsSchema>>;
|
|
52
98
|
/**
|
|
53
99
|
* (Experimental) Creates a Rayfin client with the connectors runtime
|
|
54
|
-
* attached. Accepts the same configuration as {@link RayfinClient}
|
|
100
|
+
* attached. Accepts the same configuration as {@link RayfinClient},
|
|
101
|
+
* plus an optional `connectors` map (see
|
|
102
|
+
* {@link ConnectorsRayfinClientConfig}) used to route Cat A vs Cat B
|
|
103
|
+
* dispatch per connector name.
|
|
55
104
|
*
|
|
56
|
-
* @param config - Client configuration, including optional auth-token
|
|
105
|
+
* @param config - Client configuration, including optional auth-token
|
|
106
|
+
* storage and per-connector routing configs.
|
|
107
|
+
* @param connectorsRuntime - Optional per-connector runtime hooks (e.g. binary
|
|
108
|
+
* decoders) keyed by connector name. Required only for connectors whose
|
|
109
|
+
* operations return a binary stream; JSON-only connectors work without it.
|
|
57
110
|
*/
|
|
58
|
-
constructor(config:
|
|
111
|
+
constructor(config: ConnectorsRayfinClientConfig<TConnectorsSchema>, connectorsRuntime?: ConnectorsRuntime);
|
|
59
112
|
}
|
|
60
113
|
export default ConnectorsRayfinClient;
|
|
61
114
|
//# sourceMappingURL=ConnectorsRayfinClient.d.ts.map
|
|
@@ -37,6 +37,22 @@ import RayfinClient from '../client.js';
|
|
|
37
37
|
* });
|
|
38
38
|
* ```
|
|
39
39
|
*
|
|
40
|
+
* Connectors whose operations return a binary stream (such as the
|
|
41
|
+
* `fabric-semanticmodel` Apache Arrow response) need a runtime decoder. Pass a
|
|
42
|
+
* {@link ConnectorsRuntime} as the second constructor argument, keyed by the
|
|
43
|
+
* same connector names used in the schema:
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* import { fabricSemanticModel } from '@microsoft/rayfin-connector-fabric-semanticmodel';
|
|
48
|
+
*
|
|
49
|
+
* const client = new ConnectorsRayfinClient<
|
|
50
|
+
* DataSchema,
|
|
51
|
+
* FunctionsSchema,
|
|
52
|
+
* AppConnectorsSchema
|
|
53
|
+
* >(config, { salesModel: fabricSemanticModel() });
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
40
56
|
* @alpha
|
|
41
57
|
* @internal
|
|
42
58
|
*/
|
|
@@ -49,13 +65,20 @@ export class ConnectorsRayfinClient extends RayfinClient {
|
|
|
49
65
|
connectors;
|
|
50
66
|
/**
|
|
51
67
|
* (Experimental) Creates a Rayfin client with the connectors runtime
|
|
52
|
-
* attached. Accepts the same configuration as {@link RayfinClient}
|
|
68
|
+
* attached. Accepts the same configuration as {@link RayfinClient},
|
|
69
|
+
* plus an optional `connectors` map (see
|
|
70
|
+
* {@link ConnectorsRayfinClientConfig}) used to route Cat A vs Cat B
|
|
71
|
+
* dispatch per connector name.
|
|
53
72
|
*
|
|
54
|
-
* @param config - Client configuration, including optional auth-token
|
|
73
|
+
* @param config - Client configuration, including optional auth-token
|
|
74
|
+
* storage and per-connector routing configs.
|
|
75
|
+
* @param connectorsRuntime - Optional per-connector runtime hooks (e.g. binary
|
|
76
|
+
* decoders) keyed by connector name. Required only for connectors whose
|
|
77
|
+
* operations return a binary stream; JSON-only connectors work without it.
|
|
55
78
|
*/
|
|
56
|
-
constructor(config) {
|
|
79
|
+
constructor(config, connectorsRuntime) {
|
|
57
80
|
super(config);
|
|
58
|
-
this.connectors = createConnectorsApi(this.apiClient);
|
|
81
|
+
this.connectors = createConnectorsApi(this.apiClient, config.connectors, connectorsRuntime, config.host);
|
|
59
82
|
}
|
|
60
83
|
}
|
|
61
84
|
export default ConnectorsRayfinClient;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { ExtendableRayfinClient, ServicePlugin, } from './ExtendableRayfinClient.js';
|
|
2
2
|
export type { TServiceClasses, ServicePluginClass, } from './ExtendableRayfinClient.js';
|
|
3
3
|
export { ConnectorsRayfinClient } from './ConnectorsRayfinClient.js';
|
|
4
|
-
export type {
|
|
4
|
+
export type { ConnectorsRayfinClientConfig } from './ConnectorsRayfinClient.js';
|
|
5
|
+
export type { ConnectorConfig, ConnectorMarker, ConnectorsSchema, OperationCatalog, OperationDef, TypedConnectorsApi, TypedConnectorClient, } from '@microsoft/rayfin-connectors';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/rayfin-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.35.0-alpha.1274",
|
|
4
4
|
"description": "Main client SDK for Rayfin services",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"assets/docs"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@microsoft/rayfin-
|
|
25
|
-
"@microsoft/rayfin-
|
|
26
|
-
"@microsoft/rayfin-
|
|
27
|
-
"@microsoft/rayfin-
|
|
28
|
-
"@microsoft/rayfin-functions": "1.
|
|
24
|
+
"@microsoft/rayfin-connectors": "1.35.0-alpha.1274",
|
|
25
|
+
"@microsoft/rayfin-auth": "1.35.0-alpha.1274",
|
|
26
|
+
"@microsoft/rayfin-data": "1.35.0-alpha.1274",
|
|
27
|
+
"@microsoft/rayfin-lib": "1.35.0-alpha.1274",
|
|
28
|
+
"@microsoft/rayfin-functions": "1.35.0-alpha.1274"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"typescript": "^5.8.3",
|