@microsoft/rayfin-client 1.34.0-alpha.1160 → 1.34.0-alpha.1221
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,26 @@
|
|
|
1
|
-
import { createConnectorsApi, type ConnectorsSchema } from '@microsoft/rayfin-connectors';
|
|
1
|
+
import { createConnectorsApi, type ConnectorConfig, type ConnectorsSchema } 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
|
+
}
|
|
5
24
|
/**
|
|
6
25
|
* (Experimental) Rayfin client that surfaces the typed connectors runtime as
|
|
7
26
|
* `client.connectors.<name>.<operation>(input, options?)`.
|
|
@@ -51,11 +70,15 @@ export declare class ConnectorsRayfinClient<TSchema extends EntitySchema = Recor
|
|
|
51
70
|
readonly connectors: ReturnType<typeof createConnectorsApi<TConnectorsSchema>>;
|
|
52
71
|
/**
|
|
53
72
|
* (Experimental) Creates a Rayfin client with the connectors runtime
|
|
54
|
-
* attached. Accepts the same configuration as {@link RayfinClient}
|
|
73
|
+
* attached. Accepts the same configuration as {@link RayfinClient},
|
|
74
|
+
* plus an optional `connectors` map (see
|
|
75
|
+
* {@link ConnectorsRayfinClientConfig}) used to route Cat A vs Cat B
|
|
76
|
+
* dispatch per connector name.
|
|
55
77
|
*
|
|
56
|
-
* @param config - Client configuration, including optional auth-token
|
|
78
|
+
* @param config - Client configuration, including optional auth-token
|
|
79
|
+
* storage and per-connector routing configs.
|
|
57
80
|
*/
|
|
58
|
-
constructor(config:
|
|
81
|
+
constructor(config: ConnectorsRayfinClientConfig<TConnectorsSchema>);
|
|
59
82
|
}
|
|
60
83
|
export default ConnectorsRayfinClient;
|
|
61
84
|
//# sourceMappingURL=ConnectorsRayfinClient.d.ts.map
|
|
@@ -49,13 +49,17 @@ export class ConnectorsRayfinClient extends RayfinClient {
|
|
|
49
49
|
connectors;
|
|
50
50
|
/**
|
|
51
51
|
* (Experimental) Creates a Rayfin client with the connectors runtime
|
|
52
|
-
* attached. Accepts the same configuration as {@link RayfinClient}
|
|
52
|
+
* attached. Accepts the same configuration as {@link RayfinClient},
|
|
53
|
+
* plus an optional `connectors` map (see
|
|
54
|
+
* {@link ConnectorsRayfinClientConfig}) used to route Cat A vs Cat B
|
|
55
|
+
* dispatch per connector name.
|
|
53
56
|
*
|
|
54
|
-
* @param config - Client configuration, including optional auth-token
|
|
57
|
+
* @param config - Client configuration, including optional auth-token
|
|
58
|
+
* storage and per-connector routing configs.
|
|
55
59
|
*/
|
|
56
60
|
constructor(config) {
|
|
57
61
|
super(config);
|
|
58
|
-
this.connectors = createConnectorsApi(this.apiClient);
|
|
62
|
+
this.connectors = createConnectorsApi(this.apiClient, config.connectors);
|
|
59
63
|
}
|
|
60
64
|
}
|
|
61
65
|
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.34.0-alpha.
|
|
3
|
+
"version": "1.34.0-alpha.1221",
|
|
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-auth": "1.34.0-alpha.
|
|
25
|
-
"@microsoft/rayfin-connectors": "1.34.0-alpha.
|
|
26
|
-
"@microsoft/rayfin-
|
|
27
|
-
"@microsoft/rayfin-
|
|
28
|
-
"@microsoft/rayfin-
|
|
24
|
+
"@microsoft/rayfin-auth": "1.34.0-alpha.1221",
|
|
25
|
+
"@microsoft/rayfin-connectors": "1.34.0-alpha.1221",
|
|
26
|
+
"@microsoft/rayfin-data": "1.34.0-alpha.1221",
|
|
27
|
+
"@microsoft/rayfin-functions": "1.34.0-alpha.1221",
|
|
28
|
+
"@microsoft/rayfin-lib": "1.34.0-alpha.1221"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"typescript": "^5.8.3",
|