@microsoft/rayfin-connector-fabric-semanticmodel 1.36.0-alpha.1601 → 1.36.0-alpha.1663
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/README.md +1 -1
- package/assets/docs/index.md +2 -6
- package/dist/arrow.js +23 -2
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ npm install @microsoft/rayfin-connector-fabric-semanticmodel
|
|
|
16
16
|
Pass it as the third type parameter of `ConnectorsRayfinClient`:
|
|
17
17
|
|
|
18
18
|
```ts
|
|
19
|
-
import { ConnectorsRayfinClient } from '@microsoft/rayfin-client
|
|
19
|
+
import { ConnectorsRayfinClient } from '@microsoft/rayfin-client';
|
|
20
20
|
import type { AppConnectorsSchema } from '../rayfin/connectors/schema';
|
|
21
21
|
import type { AppSchema } from '../rayfin/data/schema';
|
|
22
22
|
import type { AppFunctionsSchema } from '../rayfin/functions/schema';
|
package/assets/docs/index.md
CHANGED
|
@@ -7,10 +7,6 @@ symbols: []
|
|
|
7
7
|
Typed connector for Fabric semantic models (Power BI datasets). Exposes one
|
|
8
8
|
operation, `executeQuery`, which runs DAX.
|
|
9
9
|
|
|
10
|
-
> **PREVIEW.** Connectors are in private preview. The CLI hides the `connector`
|
|
11
|
-
> command until the project opts in with `services.connectors.enabled: true` in
|
|
12
|
-
> `rayfin/rayfin.yml` (or `RAYFIN_FEATURE_FLAGS=connectors` in the environment).
|
|
13
|
-
|
|
14
10
|
## Installation
|
|
15
11
|
|
|
16
12
|
```bash
|
|
@@ -28,7 +24,7 @@ Declare the connector in the app's schema:
|
|
|
28
24
|
|
|
29
25
|
```ts
|
|
30
26
|
// rayfin/connectors/schema.ts
|
|
31
|
-
import type { ConnectorsSchema } from "@microsoft/rayfin-client
|
|
27
|
+
import type { ConnectorsSchema } from "@microsoft/rayfin-client";
|
|
32
28
|
import type { FabricSemanticModel } from "@microsoft/rayfin-connector-fabric-semanticmodel";
|
|
33
29
|
|
|
34
30
|
export type AppConnectorsSchema = {
|
|
@@ -40,7 +36,7 @@ Pass it as the third type parameter, supply the generated config, and register
|
|
|
40
36
|
the runtime under the same name:
|
|
41
37
|
|
|
42
38
|
```ts
|
|
43
|
-
import { ConnectorsRayfinClient } from "@microsoft/rayfin-client
|
|
39
|
+
import { ConnectorsRayfinClient } from "@microsoft/rayfin-client";
|
|
44
40
|
import { fabricSemanticModel } from "@microsoft/rayfin-connector-fabric-semanticmodel";
|
|
45
41
|
import type { AppConnectorsSchema } from "../rayfin/connectors/schema";
|
|
46
42
|
import { connectorConfig as salesModelConfig } from "../rayfin/connectors/salesModel/schema";
|
package/dist/arrow.js
CHANGED
|
@@ -154,6 +154,18 @@ function isArrowErrorTable(columnNames) {
|
|
|
154
154
|
const nameSet = new Set(columnNames);
|
|
155
155
|
return REQUIRED_ERROR_COLUMNS.every((col) => nameSet.has(col));
|
|
156
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* Coerce a raw Arrow diagnostic cell to a string, returning `undefined` when it
|
|
159
|
+
* is null/undefined or coerces to the empty string. Used for the optional
|
|
160
|
+
* `code`/`details` fields so a blank `ErrorCode`/`ErrorDescription` is omitted
|
|
161
|
+
* rather than surfaced as an empty diagnostic.
|
|
162
|
+
*/
|
|
163
|
+
function nonEmptyDiagnostic(raw) {
|
|
164
|
+
if (raw == null)
|
|
165
|
+
return undefined;
|
|
166
|
+
const value = String(raw);
|
|
167
|
+
return value.length > 0 ? value : undefined;
|
|
168
|
+
}
|
|
157
169
|
/**
|
|
158
170
|
* Decode an Apache Arrow IPC stream into a
|
|
159
171
|
* {@link FabricSemanticModelTabularResponse}.
|
|
@@ -186,13 +198,22 @@ export function parseArrowStream(bytes, requestId = '') {
|
|
|
186
198
|
if (isArrowErrorTable(columnNames)) {
|
|
187
199
|
const firstRow = arrowTable.get(0);
|
|
188
200
|
const rowJson = (firstRow?.toJSON?.() ?? {});
|
|
189
|
-
|
|
201
|
+
// `||` (not `??`) so an empty `ErrorMessage` also falls back to the generic
|
|
202
|
+
// message. `code`/`details` are coerced and dropped when empty so a blank
|
|
203
|
+
// diagnostic is omitted rather than rendered as `code: ''`/`details: ''`.
|
|
204
|
+
const message = String(rowJson['ErrorMessage'] || 'Unknown DAX error');
|
|
205
|
+
const code = nonEmptyDiagnostic(rowJson['ErrorCode']);
|
|
206
|
+
const details = nonEmptyDiagnostic(rowJson['ErrorDescription']);
|
|
190
207
|
return {
|
|
191
208
|
status: 'Succeeded',
|
|
192
209
|
output: {
|
|
193
210
|
tables: [],
|
|
194
211
|
requestId,
|
|
195
|
-
queryError: {
|
|
212
|
+
queryError: {
|
|
213
|
+
message,
|
|
214
|
+
...(code !== undefined ? { code } : {}),
|
|
215
|
+
...(details !== undefined ? { details } : {}),
|
|
216
|
+
},
|
|
196
217
|
},
|
|
197
218
|
errors: [],
|
|
198
219
|
};
|
package/dist/runtime.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export type FabricSemanticModelOptions = FabricSemanticModelRuntimeOptions;
|
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* ```ts
|
|
43
|
-
* import { ConnectorsRayfinClient } from '@microsoft/rayfin-client
|
|
43
|
+
* import { ConnectorsRayfinClient } from '@microsoft/rayfin-client';
|
|
44
44
|
* import {
|
|
45
45
|
* fabricSemanticModel,
|
|
46
46
|
* parseSemanticModelUrl,
|
package/dist/runtime.js
CHANGED
|
@@ -165,7 +165,7 @@ async function routeExecuteQuery(rawCtx, next, options) {
|
|
|
165
165
|
*
|
|
166
166
|
* @example
|
|
167
167
|
* ```ts
|
|
168
|
-
* import { ConnectorsRayfinClient } from '@microsoft/rayfin-client
|
|
168
|
+
* import { ConnectorsRayfinClient } from '@microsoft/rayfin-client';
|
|
169
169
|
* import {
|
|
170
170
|
* fabricSemanticModel,
|
|
171
171
|
* parseSemanticModelUrl,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/rayfin-connector-fabric-semanticmodel",
|
|
3
|
-
"version": "1.36.0-alpha.
|
|
3
|
+
"version": "1.36.0-alpha.1663",
|
|
4
4
|
"description": "Typed connector marker for the Fabric semantic-model (Power BI dataset) connector category. Pair with @microsoft/rayfin-client to type `client.connectors.<name>.executeQuery(...)`.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"apache-arrow": "^21.1.0",
|
|
30
30
|
"lz4js": "^0.2.0",
|
|
31
|
-
"@microsoft/rayfin-connectors": "1.36.0-alpha.
|
|
31
|
+
"@microsoft/rayfin-connectors": "1.36.0-alpha.1663"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"registry": "https://npm.pkg.github.com",
|