@microsoft/rayfin-client 1.33.2 → 1.34.0-alpha.1160
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/dist/client.d.ts +6 -0
- package/dist/client.js +20 -4
- package/dist/experimental/ConnectorsRayfinClient.d.ts +61 -0
- package/dist/experimental/ConnectorsRayfinClient.js +62 -0
- package/dist/experimental/index.d.ts +2 -0
- package/dist/experimental/index.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/package.json +6 -5
package/dist/client.d.ts
CHANGED
|
@@ -30,6 +30,12 @@ export interface RayfinClientConfig extends ApiClientConfig {
|
|
|
30
30
|
* You may also provide your own storage or use browser's built-in Session Storage
|
|
31
31
|
*/
|
|
32
32
|
authStorage?: AuthStorage | boolean;
|
|
33
|
+
/** When false, all storage I/O is skipped — pure in-memory session. Default: true */
|
|
34
|
+
persistSession?: boolean;
|
|
35
|
+
/** When false, session expiration timers are not scheduled and automatic refresh on 401 is disabled. Default: true */
|
|
36
|
+
autoRefreshToken?: boolean;
|
|
37
|
+
/** When false, StorageEvent listener is not registered. Default: auto-detected (true in browser with localStorage). */
|
|
38
|
+
multiTabSync?: boolean;
|
|
33
39
|
}
|
|
34
40
|
/**
|
|
35
41
|
* Configuration for the server/worker-oriented {@link RayfinServerClient}.
|
package/dist/client.js
CHANGED
|
@@ -26,14 +26,25 @@ export class RayfinClientBase {
|
|
|
26
26
|
data;
|
|
27
27
|
apiClient;
|
|
28
28
|
constructor(config) {
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
// Legacy compatibility: before `useProxy` was deprecated, passing
|
|
30
|
+
// `useProxy: true` without a `baseUrl` meant "route same-origin through the
|
|
31
|
+
// dev-server proxy". Preserve that as `baseUrl: ''` during the deprecation
|
|
32
|
+
// window so existing consumers are not broken. The ApiClient emits the
|
|
33
|
+
// one-time `useProxy` deprecation warning.
|
|
34
|
+
const baseUrl = (config.baseUrl === undefined || config.baseUrl === null) &&
|
|
35
|
+
config.useProxy
|
|
36
|
+
? ''
|
|
37
|
+
: config.baseUrl;
|
|
38
|
+
if (baseUrl === undefined || baseUrl === null) {
|
|
39
|
+
throw new SdkError('SDK configuration requires a baseUrl. Pass an absolute URL to call a ' +
|
|
40
|
+
"backend directly, or an empty string ('') to keep requests " +
|
|
41
|
+
'same-origin so a development proxy can forward them.', 'MISSING_BASE_URL');
|
|
31
42
|
}
|
|
32
43
|
if (!config.publishableKey || config.publishableKey.trim() === '') {
|
|
33
44
|
throw new SdkError('SDK configuration requires a publishableKey for service-level authentication.', 'MISSING_PUBLISHABLE_KEY');
|
|
34
45
|
}
|
|
35
46
|
this.apiClient = new ApiClient({
|
|
36
|
-
baseUrl:
|
|
47
|
+
baseUrl: baseUrl,
|
|
37
48
|
publishableKey: config.publishableKey,
|
|
38
49
|
functionsBaseUrl: config.functionsBaseUrl,
|
|
39
50
|
useProxy: config.useProxy,
|
|
@@ -89,7 +100,12 @@ export class RayfinClient extends RayfinClientBase {
|
|
|
89
100
|
*/
|
|
90
101
|
constructor(config) {
|
|
91
102
|
super(config);
|
|
92
|
-
this.auth = new Auth(this.apiClient, {
|
|
103
|
+
this.auth = new Auth(this.apiClient, {
|
|
104
|
+
storage: config.authStorage,
|
|
105
|
+
persistSession: config.persistSession,
|
|
106
|
+
autoRefreshToken: config.autoRefreshToken,
|
|
107
|
+
multiTabSync: config.multiTabSync,
|
|
108
|
+
});
|
|
93
109
|
this.auth.attachToClient(this.apiClient);
|
|
94
110
|
this.functions = createFunctionsApi(this.apiClient);
|
|
95
111
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { createConnectorsApi, type ConnectorsSchema } from '@microsoft/rayfin-connectors';
|
|
2
|
+
import { type EntitySchema } from '@microsoft/rayfin-data';
|
|
3
|
+
import { type FunctionsSchema } from '@microsoft/rayfin-functions';
|
|
4
|
+
import RayfinClient, { RayfinClientConfig } from '../client.js';
|
|
5
|
+
/**
|
|
6
|
+
* (Experimental) Rayfin client that surfaces the typed connectors runtime as
|
|
7
|
+
* `client.connectors.<name>.<operation>(input, options?)`.
|
|
8
|
+
*
|
|
9
|
+
* The connector layer is being incubated under the experimental subpath while
|
|
10
|
+
* the API and configuration model stabilize. Public consumers should import
|
|
11
|
+
* from `@microsoft/rayfin-client/experimental` rather than the stable entry.
|
|
12
|
+
*
|
|
13
|
+
* @typeParam TSchema - Data entity schema (same shape as {@link RayfinClient}).
|
|
14
|
+
* @typeParam TFunctionsSchema - Functions schema (same shape as {@link RayfinClient}).
|
|
15
|
+
* @typeParam TConnectorsSchema - Connector schema mapping connector names
|
|
16
|
+
* (as declared in `rayfin.yml`) to typed connector markers such as
|
|
17
|
+
* `FabricSemanticModel<'executeQuery'>`.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { ConnectorsRayfinClient } from '@microsoft/rayfin-client/experimental';
|
|
22
|
+
* import type { FabricSemanticModel } from '@microsoft/rayfin-connector-fabric-semanticmodel';
|
|
23
|
+
*
|
|
24
|
+
* type AppConnectorsSchema = {
|
|
25
|
+
* salesModel: FabricSemanticModel<'executeQuery'>;
|
|
26
|
+
* };
|
|
27
|
+
*
|
|
28
|
+
* const client = new ConnectorsRayfinClient<
|
|
29
|
+
* DataSchema,
|
|
30
|
+
* FunctionsSchema,
|
|
31
|
+
* AppConnectorsSchema
|
|
32
|
+
* >({
|
|
33
|
+
* baseUrl: import.meta.env.VITE_RAYFIN_BASE_URL,
|
|
34
|
+
* publishableKey: import.meta.env.VITE_RAYFIN_PUBLISHABLE_KEY,
|
|
35
|
+
* });
|
|
36
|
+
*
|
|
37
|
+
* const result = await client.connectors.salesModel.executeQuery({
|
|
38
|
+
* query: 'EVALUATE TOPN(10, Sales)',
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @alpha
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export declare class ConnectorsRayfinClient<TSchema extends EntitySchema = Record<string, any>, TFunctionsSchema extends FunctionsSchema = FunctionsSchema, TConnectorsSchema extends ConnectorsSchema = ConnectorsSchema> extends RayfinClient<TSchema, TFunctionsSchema> {
|
|
46
|
+
/**
|
|
47
|
+
* (Experimental) Typed accessors for connectors declared in `rayfin.yml`.
|
|
48
|
+
* Each property resolves lazily on first access; the underlying transport
|
|
49
|
+
* (`POST /connector-invoke`) is shared with the rest of the SDK.
|
|
50
|
+
*/
|
|
51
|
+
readonly connectors: ReturnType<typeof createConnectorsApi<TConnectorsSchema>>;
|
|
52
|
+
/**
|
|
53
|
+
* (Experimental) Creates a Rayfin client with the connectors runtime
|
|
54
|
+
* attached. Accepts the same configuration as {@link RayfinClient}.
|
|
55
|
+
*
|
|
56
|
+
* @param config - Client configuration, including optional auth-token storage.
|
|
57
|
+
*/
|
|
58
|
+
constructor(config: RayfinClientConfig);
|
|
59
|
+
}
|
|
60
|
+
export default ConnectorsRayfinClient;
|
|
61
|
+
//# sourceMappingURL=ConnectorsRayfinClient.d.ts.map
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createConnectorsApi, } from '@microsoft/rayfin-connectors';
|
|
2
|
+
import RayfinClient from '../client.js';
|
|
3
|
+
/**
|
|
4
|
+
* (Experimental) Rayfin client that surfaces the typed connectors runtime as
|
|
5
|
+
* `client.connectors.<name>.<operation>(input, options?)`.
|
|
6
|
+
*
|
|
7
|
+
* The connector layer is being incubated under the experimental subpath while
|
|
8
|
+
* the API and configuration model stabilize. Public consumers should import
|
|
9
|
+
* from `@microsoft/rayfin-client/experimental` rather than the stable entry.
|
|
10
|
+
*
|
|
11
|
+
* @typeParam TSchema - Data entity schema (same shape as {@link RayfinClient}).
|
|
12
|
+
* @typeParam TFunctionsSchema - Functions schema (same shape as {@link RayfinClient}).
|
|
13
|
+
* @typeParam TConnectorsSchema - Connector schema mapping connector names
|
|
14
|
+
* (as declared in `rayfin.yml`) to typed connector markers such as
|
|
15
|
+
* `FabricSemanticModel<'executeQuery'>`.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { ConnectorsRayfinClient } from '@microsoft/rayfin-client/experimental';
|
|
20
|
+
* import type { FabricSemanticModel } from '@microsoft/rayfin-connector-fabric-semanticmodel';
|
|
21
|
+
*
|
|
22
|
+
* type AppConnectorsSchema = {
|
|
23
|
+
* salesModel: FabricSemanticModel<'executeQuery'>;
|
|
24
|
+
* };
|
|
25
|
+
*
|
|
26
|
+
* const client = new ConnectorsRayfinClient<
|
|
27
|
+
* DataSchema,
|
|
28
|
+
* FunctionsSchema,
|
|
29
|
+
* AppConnectorsSchema
|
|
30
|
+
* >({
|
|
31
|
+
* baseUrl: import.meta.env.VITE_RAYFIN_BASE_URL,
|
|
32
|
+
* publishableKey: import.meta.env.VITE_RAYFIN_PUBLISHABLE_KEY,
|
|
33
|
+
* });
|
|
34
|
+
*
|
|
35
|
+
* const result = await client.connectors.salesModel.executeQuery({
|
|
36
|
+
* query: 'EVALUATE TOPN(10, Sales)',
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @alpha
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
export class ConnectorsRayfinClient extends RayfinClient {
|
|
44
|
+
/**
|
|
45
|
+
* (Experimental) Typed accessors for connectors declared in `rayfin.yml`.
|
|
46
|
+
* Each property resolves lazily on first access; the underlying transport
|
|
47
|
+
* (`POST /connector-invoke`) is shared with the rest of the SDK.
|
|
48
|
+
*/
|
|
49
|
+
connectors;
|
|
50
|
+
/**
|
|
51
|
+
* (Experimental) Creates a Rayfin client with the connectors runtime
|
|
52
|
+
* attached. Accepts the same configuration as {@link RayfinClient}.
|
|
53
|
+
*
|
|
54
|
+
* @param config - Client configuration, including optional auth-token storage.
|
|
55
|
+
*/
|
|
56
|
+
constructor(config) {
|
|
57
|
+
super(config);
|
|
58
|
+
this.connectors = createConnectorsApi(this.apiClient);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
export default ConnectorsRayfinClient;
|
|
62
|
+
//# sourceMappingURL=ConnectorsRayfinClient.js.map
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { ExtendableRayfinClient, ServicePlugin, } from './ExtendableRayfinClient.js';
|
|
2
2
|
export type { TServiceClasses, ServicePluginClass, } from './ExtendableRayfinClient.js';
|
|
3
|
+
export { ConnectorsRayfinClient } from './ConnectorsRayfinClient.js';
|
|
4
|
+
export type { ConnectorsSchema, ConnectorMarker, OperationCatalog, OperationDef, TypedConnectorsApi, TypedConnectorClient, } from '@microsoft/rayfin-connectors';
|
|
3
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './client.js';
|
|
2
2
|
export { default } from './client.js';
|
|
3
3
|
export type { TypedDataClients, EntitySchema } from '@microsoft/rayfin-data';
|
|
4
|
+
export type { FunctionsSchema } from '@microsoft/rayfin-functions';
|
|
4
5
|
export type { ApiClientConfig } from '@microsoft/rayfin-lib';
|
|
6
|
+
export { setDeprecationsSilenced, isDeprecationSilenced, } from '@microsoft/rayfin-lib';
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// Export all from client.ts
|
|
2
2
|
export * from './client.js';
|
|
3
3
|
export { default } from './client.js';
|
|
4
|
+
// Re-export deprecation silencing controls from rayfin-lib so consumers have a
|
|
5
|
+
// stable public import path here; emitter helpers stay internal to the SDK.
|
|
6
|
+
export { setDeprecationsSilenced, isDeprecationSilenced, } from '@microsoft/rayfin-lib';
|
|
4
7
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/rayfin-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.34.0-alpha.1160",
|
|
4
4
|
"description": "Main client SDK for Rayfin services",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -21,10 +21,11 @@
|
|
|
21
21
|
"assets/docs"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@microsoft/rayfin-auth": "1.
|
|
25
|
-
"@microsoft/rayfin-
|
|
26
|
-
"@microsoft/rayfin-lib": "1.
|
|
27
|
-
"@microsoft/rayfin-
|
|
24
|
+
"@microsoft/rayfin-auth": "1.34.0-alpha.1160",
|
|
25
|
+
"@microsoft/rayfin-connectors": "1.34.0-alpha.1160",
|
|
26
|
+
"@microsoft/rayfin-lib": "1.34.0-alpha.1160",
|
|
27
|
+
"@microsoft/rayfin-data": "1.34.0-alpha.1160",
|
|
28
|
+
"@microsoft/rayfin-functions": "1.34.0-alpha.1160"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"typescript": "^5.8.3",
|