@microsoft/rayfin-guide 1.36.0-alpha.1601 → 1.36.0-alpha.1620
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/assets/docs/{experimental/cli → cli}/connectors/add.md +2 -0
- package/assets/docs/{experimental/cli → cli}/connectors/category-a-entities.md +1 -1
- package/assets/docs/{experimental/cli → cli}/connectors/category-b-function-bridge.md +38 -12
- package/assets/docs/cli/connectors/eventhouse.md +21 -0
- package/assets/docs/{experimental/cli → cli}/connectors/index.md +7 -22
- package/assets/docs/{experimental/cli → cli}/connectors/invoke.md +4 -0
- package/assets/docs/{experimental/cli → cli}/connectors/search.md +4 -2
- package/assets/docs/cli/environment-variables.md +2 -2
- package/assets/docs/cli/index.md +14 -0
- package/assets/docs/cli/templates.md +7 -0
- package/assets/docs/getting-started/project-structure.md +91 -2
- package/package.json +1 -1
- /package/assets/docs/{experimental/cli → cli}/connectors/inspect.md +0 -0
|
@@ -8,6 +8,8 @@ sidebar_position: 2
|
|
|
8
8
|
npx rayfin connector add --type <type> --workspace-id <ws-id> --item-id <item-id> [--name <name>] [--operations <ops>]
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
> **`kusto` authoring is held in this release**, so `connector add --type kusto` refuses before writing anything. Kusto examples below describe the authoring path for when it ships. See [Connectors](./index.md) for what a project that already declares Kusto can still do.
|
|
12
|
+
|
|
11
13
|
`connector add` declares a connector in `rayfin/rayfin.yml` and scaffolds its supporting files.
|
|
12
14
|
|
|
13
15
|
The CLI verifies the Fabric item, derives a connector `name` from the item's display name (override with `--name`), writes the entry to `rayfin.yml`, and scaffolds `rayfin/connectors/<name>/schema.ts`. For Category A connectors it also runs schema discovery and writes `rayfin/connectors/<name>/metadata.json` so a subset of entities can be generated later.
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
-
sidebar_position:
|
|
2
|
+
sidebar_position: 6
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Category B — function-bridge connectors
|
|
6
6
|
|
|
7
|
-
Reference for `
|
|
7
|
+
Reference for `fabric-semanticmodel` (Power BI semantic model) and the experimental `kusto` (the **Eventhouse** connector — a Fabric Eventhouse KQL Database).
|
|
8
|
+
Eventhouse is the Fabric product name; `kusto` is the type id you pass to `--type`, and KQL is its query language.
|
|
9
|
+
|
|
10
|
+
> **`kusto` authoring is held in this release**, so `connector add --type kusto` refuses and search omits KQL databases. Everything below about `kusto` stays accurate for a project that **already declares** one — which still validates, deploys and invokes — and describes the authoring path for when it ships. Only `fabric-semanticmodel` can be added today. See [Connectors](./index.md).
|
|
11
|
+
|
|
8
12
|
A Category B connector is a named-operation surface backed by a small, platform-owned function (UDF).
|
|
9
13
|
The Builder never writes or sees the function code.
|
|
10
14
|
|
|
@@ -17,8 +21,8 @@ For the entity-generating types (`fabric-sqlanalytics`, `fabric-warehouse`, `fab
|
|
|
17
21
|
|
|
18
22
|
| Type | Operations | Query language | Auth |
|
|
19
23
|
| --- | --- | --- | --- |
|
|
20
|
-
| `kusto` | `executeQuery`, `executeCommand` | KQL | `delegated` only |
|
|
21
24
|
| `fabric-semanticmodel` | `executeQuery` | DAX | `delegated` only |
|
|
25
|
+
| `kusto` (**experimental**) | `executeQuery`, `executeCommand` | KQL | `delegated` only |
|
|
22
26
|
|
|
23
27
|
Both are pinned to an adapter version (`version: '1'` today).
|
|
24
28
|
Delegated authentication runs every call as the signed-in user through the on-behalf-of flow.
|
|
@@ -78,7 +82,7 @@ export const connectorConfig = {
|
|
|
78
82
|
} as const satisfies ConnectorConfig;
|
|
79
83
|
```
|
|
80
84
|
|
|
81
|
-
###
|
|
85
|
+
### The Eventhouse scaffold bakes cluster routing into the generated file
|
|
82
86
|
|
|
83
87
|
`connector add --type kusto` resolves the KQL Database's cluster query endpoint and database name from `(workspaceId, itemId)` at add time and writes both into the generated `connectorConfig`:
|
|
84
88
|
|
|
@@ -100,11 +104,11 @@ Three names appear here and nowhere else:
|
|
|
100
104
|
- `databaseName` — the resolved KQL database name.
|
|
101
105
|
- `KustoConnectorConfig` — the Kusto-specific config type these two keys satisfy, exported from `@microsoft/rayfin-connector-kusto` rather than `@microsoft/rayfin-connectors`.
|
|
102
106
|
|
|
103
|
-
These keys live only in the file the
|
|
107
|
+
These keys live only in the file the Eventhouse scaffold writes.
|
|
104
108
|
They are **not** part of the shared `rayfin.yml` schema — never write a cluster URI or database name into `rayfin.yml`, and never send either value from app code.
|
|
105
109
|
If the resolved values look wrong, re-add the connector rather than editing the generated file; the values come from Fabric, not from anything you can fix by hand.
|
|
106
110
|
|
|
107
|
-
The
|
|
111
|
+
The Eventhouse scaffold imports both its marker and `KustoConnectorConfig` from `@microsoft/rayfin-connector-kusto`, so it does not import `@microsoft/rayfin-connectors` at all.
|
|
108
112
|
|
|
109
113
|
## Install the packages the generated file imports
|
|
110
114
|
|
|
@@ -113,7 +117,7 @@ The Kusto scaffold imports both its marker and `KustoConnectorConfig` from `@mic
|
|
|
113
117
|
```bash
|
|
114
118
|
# Shape only. Use the version connector add printed, not this one.
|
|
115
119
|
|
|
116
|
-
# kusto — marker and config type both come from this one package
|
|
120
|
+
# kusto (experimental) — marker and config type both come from this one package
|
|
117
121
|
npm install @microsoft/rayfin-connector-kusto@1.35.0-alpha
|
|
118
122
|
|
|
119
123
|
# fabric-semanticmodel
|
|
@@ -136,7 +140,7 @@ This is not optional: the runtime is what injects the generated routing and deco
|
|
|
136
140
|
Key the runtime map by the same connector name, and call the factory once per connector:
|
|
137
141
|
|
|
138
142
|
```ts
|
|
139
|
-
import { ConnectorsRayfinClient } from '@microsoft/rayfin-client
|
|
143
|
+
import { ConnectorsRayfinClient } from '@microsoft/rayfin-client';
|
|
140
144
|
import { kusto } from '@microsoft/rayfin-connector-kusto';
|
|
141
145
|
import { fabricSemanticModel } from '@microsoft/rayfin-connector-fabric-semanticmodel';
|
|
142
146
|
import {
|
|
@@ -174,11 +178,11 @@ const client = new ConnectorsRayfinClient<
|
|
|
174
178
|
);
|
|
175
179
|
```
|
|
176
180
|
|
|
177
|
-
`ConnectorsRayfinClient` is
|
|
181
|
+
`ConnectorsRayfinClient` is stable — import it from the main `@microsoft/rayfin-client` entry.
|
|
178
182
|
|
|
179
183
|
The connector key must be identical in four places: the `name` in `rayfin.yml`, the property in `AppConnectorsSchema`, the property in the `connectors` option, and the property in the runtime map.
|
|
180
184
|
|
|
181
|
-
## Calling
|
|
185
|
+
## Calling an Eventhouse connector
|
|
182
186
|
|
|
183
187
|
Correlation ids are not part of the response body — the connector function relays the Kusto bytes untouched — so generate the `clientRequestId` yourself and pass the same value to both `executeQuery` and `toQueryResult`:
|
|
184
188
|
|
|
@@ -208,6 +212,28 @@ Successful results contain `tables` plus the `clientRequestId` you passed in (em
|
|
|
208
212
|
Each table contains named typed `columns` and row-major `rows`.
|
|
209
213
|
Error results contain `error.message` and an optional `error.code`.
|
|
210
214
|
|
|
215
|
+
### Building queries safely
|
|
216
|
+
|
|
217
|
+
`executeQuery` takes its KQL in `query` and `executeCommand` takes its command in `command`; neither operation binds parameters — `ExecuteQueryInput` exposes only `query` and `clientRequestId`, and `ExecuteCommandInput` only `command` and `clientRequestId`. Every user value you place in that text runs as KQL, so treat all user input as unsafe and never interpolate it raw.
|
|
218
|
+
|
|
219
|
+
- **Identifiers** (table, column, function names): map the user's choice through a fixed allow-list to a known-good constant. Never build an identifier from user text.
|
|
220
|
+
- **Values**: serialize each as a typed KQL literal. Validate numbers (for example with `Number.isFinite`), parse datetimes to ISO 8601 and wrap them in `todatetime(...)`, and for strings escape `\` and `"` and reject control characters. This repo ships no KQL encoder; generic SQL or JSON escaping does not make KQL safe.
|
|
221
|
+
|
|
222
|
+
```ts
|
|
223
|
+
const TABLES = { events: 'Events', logs: 'Logs' } as const;
|
|
224
|
+
const table = TABLES[userTable];
|
|
225
|
+
if (!table) throw new Error('unknown table');
|
|
226
|
+
|
|
227
|
+
// Typed KQL string literal: escape backslash and double-quote, reject control chars.
|
|
228
|
+
function kqlString(value: string): string {
|
|
229
|
+
if (/[\u0000-\u001F]/.test(value)) throw new Error('control character in value');
|
|
230
|
+
return '"' + value.replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '"';
|
|
231
|
+
}
|
|
232
|
+
// kqlString('contoso "42"') -> "contoso \"42\""
|
|
233
|
+
|
|
234
|
+
const query = `${table} | where DeviceId == ${kqlString(userDeviceId)} | take 200`;
|
|
235
|
+
```
|
|
236
|
+
|
|
211
237
|
### Management commands
|
|
212
238
|
|
|
213
239
|
`executeCommand` runs a Kusto management (control) command — the command text starts with a leading dot.
|
|
@@ -240,10 +266,10 @@ Run `rayfin docs search "resultSetRowCountLimit"` for version-locked details, si
|
|
|
240
266
|
`rayfin connector invoke <name> <operation>` is the loop for Category B.
|
|
241
267
|
See [`connector invoke`](./invoke.md) for payload input, transports, token handling, and the output contract.
|
|
242
268
|
|
|
243
|
-
- `connector inspect` supports `fabric-semanticmodel` but **not** `kusto` — a `kusto` connector errors with `Unsupported connector type: kusto`.
|
|
269
|
+
- `connector inspect` supports `fabric-semanticmodel` but **not** experimental `kusto` — a `kusto` connector errors with `Unsupported connector type: kusto`.
|
|
244
270
|
There is no ad-hoc query path for Kusto connectors today.
|
|
245
271
|
- `connector invoke` on `fabric-semanticmodel` calls Fabric/Power BI directly under the developer's identity, so it works with or without `rayfin up`.
|
|
246
|
-
Every other type, `kusto
|
|
272
|
+
Every other type, including experimental `kusto`, POSTs to the deployed item and requires a prior `rayfin up`.
|
|
247
273
|
- `connector invoke` on `fabric-semanticmodel` returns an already-normalized result, because that connector normalizes inside its `invoke` middleware.
|
|
248
274
|
Do not apply `toQueryResult` to it again.
|
|
249
275
|
- A resolved `connector invoke` call is not automatically a success.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 9
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Eventhouse (`kusto`) usage guide
|
|
6
|
+
|
|
7
|
+
> **Moved.** This usage guide now ships **inside the connector package**,
|
|
8
|
+
> version-locked to the `kusto` connector the Builder actually installed — so the
|
|
9
|
+
> streaming model, KQL shaping, safe query construction, and result handling can
|
|
10
|
+
> never drift from the CLI. It is fetched on demand with `packageVersion`
|
|
11
|
+
> provenance.
|
|
12
|
+
>
|
|
13
|
+
> Read it from `@microsoft/rayfin-connector-kusto`:
|
|
14
|
+
>
|
|
15
|
+
> - MCP: `search_docs` / `discover_packages`
|
|
16
|
+
> - CLI: `rayfin docs search "<term>"` (module `rayfin-connector-kusto`)
|
|
17
|
+
> - Source: `@microsoft/rayfin-connector-kusto/assets/docs/`
|
|
18
|
+
>
|
|
19
|
+
> The shared function-bridge mechanics — `connector add`, the generated
|
|
20
|
+
> `rayfin.yml` and `schema.ts`, and the `client.connectors.<name>` call — stay in
|
|
21
|
+
> the [Category B guide](./category-b-function-bridge.md).
|
|
@@ -6,25 +6,9 @@ sidebar_position: 6
|
|
|
6
6
|
|
|
7
7
|
Connectors let a Rayfin app read from — and, for some types, write to — Microsoft Fabric data sources: warehouses, SQL databases, Lakehouse SQL analytics endpoints, semantic models, and KQL databases.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
The `connector` command group is always available.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
```yaml
|
|
14
|
-
services:
|
|
15
|
-
connectors:
|
|
16
|
-
enabled: true
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
With that setting present the command group is available from the very first `connector add`, with nothing to configure in the shell — the path generated apps and agents should use.
|
|
20
|
-
|
|
21
|
-
The flag also activates automatically once `rayfin.yml` has a `connectors:` block (written by `connector add`), and it can still be turned on for a single command with the environment variable:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
RAYFIN_FEATURE_FLAGS=connectors npx rayfin connector search --help
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Without any of the three the commands do not exist and the CLI reports an unknown command.
|
|
11
|
+
> **`kusto` authoring is held in this release.** `connector types` and `connector search` omit it, and `connector add --type kusto` refuses it. A project that **already declares** a Kusto connector is unaffected: it still validates, deploys through `rayfin up`, and answers `connector invoke`. Kusto material in these docs describes that preserved runtime contract and the authoring path for when it ships.
|
|
28
12
|
|
|
29
13
|
Each command has its own reference page:
|
|
30
14
|
|
|
@@ -36,7 +20,8 @@ Each command has its own reference page:
|
|
|
36
20
|
Each category has its own contract page — read the one that matches your connector type, not both:
|
|
37
21
|
|
|
38
22
|
- [Category A — GraphQL entity connectors](./category-a-entities.md) — now **package-owned**; the full reference (entity generation, `@role` policies, the aggregate schema, and the per-dialect read/write matrix) ships in `@microsoft/rayfin-connector-fabric-graphql` (`rayfin docs search` / `search_docs`).
|
|
39
|
-
- [Category B — function-bridge connectors](./category-b-function-bridge.md) — the `
|
|
23
|
+
- [Category B — function-bridge connectors](./category-b-function-bridge.md) — the `fabric-semanticmodel` and experimental `kusto` contract, including the Kusto cluster routing baked into the generated `schema.ts`.
|
|
24
|
+
- [Eventhouse (`kusto`) usage guide](./eventhouse.md) — the experimental `kusto` supplement, now **package-owned**; when to reach for the type, its streaming model, shaping KQL, safe query construction, and reading results all ship in `@microsoft/rayfin-connector-kusto` (`rayfin docs search` / `search_docs`).
|
|
40
25
|
|
|
41
26
|
A typical loop is search → add → inspect (Category A) or search → add → invoke (Category B).
|
|
42
27
|
|
|
@@ -46,13 +31,13 @@ The commands available to a connector, and the code you write against it, depend
|
|
|
46
31
|
|
|
47
32
|
| | Category A — GraphQL entity connectors | Category B — function-bridge connectors |
|
|
48
33
|
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
|
|
49
|
-
| **Types** | `fabric-sqlanalytics`, `fabric-warehouse`, `fabric-sqldatabase`
|
|
50
|
-
| **App surface** | Generated entity files with typed CRUD through the data client |
|
|
34
|
+
| **Types** | `fabric-sqlanalytics`, `fabric-warehouse`, `fabric-sqldatabase`, `fabric-graphql` | `fabric-semanticmodel`; `kusto` (**experimental**) |
|
|
35
|
+
| **App surface** | Generated entity files with typed CRUD through the data client | Named operations carrying raw queries |
|
|
51
36
|
| **Operations** | `read` only for `fabric-sqlanalytics` (Lakehouse SQL endpoints are read-only); `read`, `create`, `update`, `delete` for `fabric-warehouse` and `fabric-sqldatabase` (narrowable) | `executeQuery` only |
|
|
52
37
|
| **Auth** | `delegated` or configured per project | Must be `delegated` |
|
|
53
38
|
| **Entity files and `@role` policies** | Yes | No |
|
|
54
39
|
| **`metadata.json` entities** | Yes | No |
|
|
55
|
-
| **`connector inspect`** | Supported | `fabric-semanticmodel` only — `kusto` is not supported |
|
|
40
|
+
| **`connector inspect`** | Supported | `fabric-semanticmodel` only — experimental `kusto` is not supported |
|
|
56
41
|
| **`connector invoke`** | Rarely needed | The main way to exercise the connector |
|
|
57
42
|
|
|
58
43
|
Category B connectors are pinned to an adapter version and expose no GraphQL entities, so there is nothing to generate and no row-level security to author.
|
|
@@ -32,6 +32,10 @@ Two transports, chosen by connector type:
|
|
|
32
32
|
- **`fabric-semanticmodel`** — the CLI calls Fabric/Power BI **directly under the developer's own identity**, so this works whether or not `npx rayfin up` has been run. It requires `workspaceId` **and** `itemId` under the connector's `config:` block; without both, it fails up front rather than falling through to the deployed transport. The Power BI scope and audience are derived from the configured Fabric API base URL, so an INT ring mints an INT-audience token.
|
|
33
33
|
- **Every other type, including `kusto`** — POSTs to the deployed item at `<remote-endpoint>/__private/connectors/<name>/invoke`, so it requires a prior `npx rayfin up`.
|
|
34
34
|
|
|
35
|
+
> `kusto` authoring is held in this release, but invocation is deliberately preserved: a project that already declares a Kusto connector can still invoke it. Only `connector add`, `types` and `search` withdraw the type. See [Connectors](./index.md).
|
|
36
|
+
|
|
37
|
+
`--transport deployed` overrides the type-based choice and forces the deployed route. That route authenticates the **app**, not the developer, so it needs an app-session token in `RAYFIN_TOKEN`; `npx rayfin login` cannot mint one.
|
|
38
|
+
|
|
35
39
|
## Token handling (semantic model path)
|
|
36
40
|
|
|
37
41
|
`npx rayfin login` only consents to the Fabric scope, not the Power BI scope this path needs. Consequences:
|
|
@@ -8,7 +8,9 @@ sidebar_position: 1
|
|
|
8
8
|
npx rayfin connector search [query] [--workspace-id <id> --type <types> | --all-workspaces --type <types>] [--limit <n>] [--json]
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
> **`kusto` authoring is held in this release**, so search does not return KQL databases and `--type kusto` is not accepted. Search exists to feed `connector add`, which would refuse the type — surfacing a source the Builder could not then attach. See [Connectors](./index.md).
|
|
12
|
+
|
|
13
|
+
`connector search` finds Fabric data sources — warehouses, SQL databases, Lakehouses, and semantic models — that the signed-in identity can add as connectors, before you know exact workspace or item IDs.
|
|
12
14
|
|
|
13
15
|
Use it to find candidates for [`connector add`](./add.md). It never touches app data itself.
|
|
14
16
|
|
|
@@ -38,7 +40,7 @@ Only one of `--workspace-id` and `--all-workspaces` may be given. Outside a Rayf
|
|
|
38
40
|
|
|
39
41
|
Duplicate-looking entries — for example a SQL Database and its SQL-analytics-endpoint twin sharing a workspace and display name — are grouped visually next to each other in interactive and plain output only. They are never deduplicated, and `--json` always returns the canonical, ungrouped order.
|
|
40
42
|
|
|
41
|
-
The SQL-endpoint-permissions note ("Schema discovery for SQL-based connectors requires SQL endpoint permissions") only prints when at least one result is a SQL-dialect connector type — never for a semantic-model-only
|
|
43
|
+
The SQL-endpoint-permissions note ("Schema discovery for SQL-based connectors requires SQL endpoint permissions") only prints when at least one result is a SQL-dialect connector type — never for a semantic-model-only result set. (It would also not print for a Kusto-only set, once Kusto authoring ships.)
|
|
42
44
|
|
|
43
45
|
## Examples
|
|
44
46
|
|
|
@@ -189,7 +189,7 @@ These variables are read from the shell environment and are never written to fil
|
|
|
189
189
|
| `RAYFIN_WORKSPACE_ID` | Fabric workspace ID for non-interactive setup. Used with `RAYFIN_TOKEN`. |
|
|
190
190
|
| `RAYFIN_TENANT_ID` | Entra ID tenant used by `rayfin up` for portal URLs and the `ctid` query parameter. Equivalent to the `-t, --tenant <id>` flag (precedence: flag > env var > signed-in tenant). |
|
|
191
191
|
| `RAYFIN_ENCRYPTION_FALLBACK_ENABLED` | Set to `true` to allow plaintext token cache on systems without OS credential storage. Development only. |
|
|
192
|
-
| `RAYFIN_FEATURE_FLAGS` | Comma-separated list of experimental feature names to enable (case-insensitive). Recognized values include `docker-local-dev`, `
|
|
192
|
+
| `RAYFIN_FEATURE_FLAGS` | Comma-separated list of experimental feature names to enable (case-insensitive). Recognized public values include `docker-local-dev`, `postgresql`, and `storage`. |
|
|
193
193
|
| `RAYFIN_WEBSERVICE_IMAGE_NAME` | **Experimental.** Override the webservice container image used by `rayfin dev --provider docker` and Docker Compose. Defaults to `ghcr.io/microsoft/project-rayfin/webservice:cli-<version>`. |
|
|
194
194
|
| `RAYFIN_APPINSIGHTS_CONNECTION_STRING` | Override the telemetry endpoint for the CLI and VS Code extension. |
|
|
195
195
|
| `RAYFIN_TELEMETRY_ENV` | Override the CLI and `create-rayfin` telemetry environment label. Values are trimmed and lowercased. Known labels include `github-actions`, `azure-pipelines`, `gitlab-ci`, `jenkins`, `codespaces`, `devcontainer`, `local`, and `other`; custom labels may contain 1–64 ASCII letters, digits, hyphens, or underscores. Invalid non-empty values map to `other`, while an empty value uses automatic detection. Do not include identifying or sensitive values. |
|
|
@@ -199,8 +199,8 @@ These variables are read from the shell environment and are never written to fil
|
|
|
199
199
|
| Flag | Effect |
|
|
200
200
|
| --- | --- |
|
|
201
201
|
| `docker-local-dev` | Allows `rayfin dev --provider docker` and the Docker maintenance commands. Bare `rayfin dev` remains available without this flag and defaults to Fabric. |
|
|
202
|
-
| `functions` | Exposes Functions service prompts during `rayfin init`. |
|
|
203
202
|
| `postgresql` | Adds PostgreSQL as a selectable dialect during `rayfin init` and `rayfin init` with bundled templates. |
|
|
203
|
+
| `storage` | Enables the preview Storage service when declared in `rayfin.yml` or opted in from the shell. |
|
|
204
204
|
|
|
205
205
|
## File locations
|
|
206
206
|
|
package/assets/docs/cli/index.md
CHANGED
|
@@ -73,6 +73,20 @@ Functions are server-side user-defined functions (UDFs) that run in the Fabric r
|
|
|
73
73
|
| `npx rayfin dev functions apply` | Run the local function host with a live typegen watcher and debugger support. See [dev functions apply](./functions/dev-apply.md). |
|
|
74
74
|
| `npx rayfin up functions deploy` | Build, package, and deploy functions to the remote Rayfin item. `rayfin up` runs this automatically. See [up functions deploy](./functions/deploy.md). |
|
|
75
75
|
|
|
76
|
+
### Connectors
|
|
77
|
+
|
|
78
|
+
Connectors let a Rayfin app read from — and, for some types, write to — Microsoft Fabric data sources. See [Connectors](./connectors/index.md) for the full guide.
|
|
79
|
+
|
|
80
|
+
| Command | Description |
|
|
81
|
+
| --- | --- |
|
|
82
|
+
| `npx rayfin connector search [query]` | Discover Fabric sources the signed-in identity can add before you know exact workspace or item IDs. See [connector search](./connectors/search.md). |
|
|
83
|
+
| `npx rayfin connector add --type <type> --workspace-id <ws-id> --item-id <item-id>` | Declare a connector in `rayfin.yml` and scaffold `rayfin/connectors/<name>/`. See [connector add](./connectors/add.md). |
|
|
84
|
+
| `npx rayfin connector inspect` | Explore a connector's underlying source in read-only mode by listing entity names, sampling one entity, or running a `.sql` / `.dax` query file. See [connector inspect](./connectors/inspect.md). |
|
|
85
|
+
| `npx rayfin connector invoke <connector-name> <operation>` | Run a single named operation against a configured connector. See [connector invoke](./connectors/invoke.md). |
|
|
86
|
+
| `npx rayfin connector list` | Print the configured connectors. See [Connectors](./connectors/index.md#where-connector-state-lives). |
|
|
87
|
+
| `npx rayfin connector remove <name>` | Delete both the `rayfin.yml` entry and the `rayfin/connectors/<name>/` directory. See [Connectors](./connectors/index.md#where-connector-state-lives). |
|
|
88
|
+
| `npx rayfin up connector apply [--name <name>]` | Re-apply DAB config only. See [Deploying connectors](./connectors/index.md#deploying-connectors). |
|
|
89
|
+
|
|
76
90
|
### Secrets
|
|
77
91
|
|
|
78
92
|
Secrets are encrypted values stored on your deployed Rayfin item and read at runtime — for example by [functions](./functions/index.md) via `ctx.getSecret`. See [Managing Secrets](./secrets.md) for the full guide.
|
|
@@ -20,6 +20,13 @@ Every `npm create @microsoft/rayfin@latest` or `npx rayfin init` invocation can
|
|
|
20
20
|
External and local template sources are discovered through `rayfin-template.yml` manifests inside the selected source directory.
|
|
21
21
|
Built-in templates are packaged with the CLI and appear in `--list-templates` automatically.
|
|
22
22
|
|
|
23
|
+
> **Universal App is distributed by the Rayfin Copilot plugin.**
|
|
24
|
+
> It is a hidden built-in template: it does not appear in `--list-templates`,
|
|
25
|
+
> but it can be selected explicitly with `--template universal-app`.
|
|
26
|
+
> The plugin selects that bundled template and distributes its committed workspace
|
|
27
|
+
> template directly.
|
|
28
|
+
> This does not change support for ordinary local directories, git repositories, or registered templates.
|
|
29
|
+
|
|
23
30
|
## List available templates
|
|
24
31
|
|
|
25
32
|
Use `--list-templates` to see every template the CLI can scaffold from in your current directory:
|
|
@@ -24,6 +24,92 @@ your-project/
|
|
|
24
24
|
└── README.md
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
+
## Universal App workspace
|
|
28
|
+
|
|
29
|
+
Universal Apps generated by the Rayfin Copilot plugin use an npm workspace while preserving the same root workflow:
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
your-universal-app/
|
|
33
|
+
├── package.json
|
|
34
|
+
├── tsconfig.base.json
|
|
35
|
+
├── tsconfig.json
|
|
36
|
+
├── rayfin/
|
|
37
|
+
│ └── rayfin.yml
|
|
38
|
+
└── packages/
|
|
39
|
+
├── frontend/
|
|
40
|
+
│ ├── src/
|
|
41
|
+
│ ├── package.json
|
|
42
|
+
│ └── vite.config.ts
|
|
43
|
+
├── data/
|
|
44
|
+
│ ├── src/index.ts
|
|
45
|
+
│ └── package.json
|
|
46
|
+
└── shared/
|
|
47
|
+
├── src/index.ts
|
|
48
|
+
└── package.json
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The workspace root owns the application identity, npm workspace declaration, orchestration scripts, applied capability-pack record, TypeScript project references, and `rayfin/rayfin.yml`.
|
|
52
|
+
It coordinates the packages but does not own application runtime code.
|
|
53
|
+
|
|
54
|
+
| Package | Stable name | Ownership |
|
|
55
|
+
| --- | --- | --- |
|
|
56
|
+
| `packages/frontend` | `@rayfin-app/frontend` | React, Vite, Fabric authentication, browser UI, and static output |
|
|
57
|
+
| `packages/data` | `@rayfin-app/data` | Rayfin entity registration and data schema exports |
|
|
58
|
+
| `packages/shared` | `@rayfin-app/shared` | Isomorphic contracts shared across runtime boundaries |
|
|
59
|
+
| `packages/functions` | `@rayfin-app/functions` | Opt-in trusted server workflows created by the functions capability pack |
|
|
60
|
+
|
|
61
|
+
Only the generated root package name is personalized.
|
|
62
|
+
The stable member names, cross-package dependency keys, and import specifiers are not renamed.
|
|
63
|
+
|
|
64
|
+
Use root commands for the complete app workflow:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npm run build
|
|
68
|
+
npm run typecheck
|
|
69
|
+
npm run lint
|
|
70
|
+
npm test
|
|
71
|
+
npm run preview
|
|
72
|
+
npm run pack:add -- <pack>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The root build orders shared, data, and frontend work.
|
|
76
|
+
Focused package commands use npm's workspace selector, such as `npm run -w @rayfin-app/frontend test`.
|
|
77
|
+
|
|
78
|
+
The base workspace does not contain `packages/functions`, and `services.functions.enabled` is `false`.
|
|
79
|
+
Running `npm run pack:add -- functions` creates the stable functions package, enables its service, composes its build into root orchestration, and installs dependencies from the workspace root.
|
|
80
|
+
Capability packs do not use a nested functions lockfile or nested install.
|
|
81
|
+
|
|
82
|
+
### Universal App service paths
|
|
83
|
+
|
|
84
|
+
Universal App service paths point to the package that owns each deployable surface:
|
|
85
|
+
|
|
86
|
+
```yaml
|
|
87
|
+
services:
|
|
88
|
+
data:
|
|
89
|
+
enabled: false
|
|
90
|
+
path: packages/data
|
|
91
|
+
buildCommand: npm run build
|
|
92
|
+
staticHosting:
|
|
93
|
+
enabled: true
|
|
94
|
+
path: packages/frontend
|
|
95
|
+
folder: dist
|
|
96
|
+
buildCommand: npm run build:fabric
|
|
97
|
+
assetAccess: protected
|
|
98
|
+
functions:
|
|
99
|
+
enabled: false
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Rayfin resolves each `path` from the application root, then runs that service's `buildCommand` with the service directory as its working directory.
|
|
103
|
+
The static-hosting folder is therefore `packages/frontend/dist`, not a root `dist` directory.
|
|
104
|
+
After the functions pack is applied, functions uses `path: packages/functions` with its package-local `npm run build`.
|
|
105
|
+
|
|
106
|
+
The Project Rayfin repository keeps this Builder-facing workspace under `samples/universal-app/template`.
|
|
107
|
+
Its parent `samples/universal-app` is only a Rush validation harness that generates an ephemeral target and links that target to repository-local SDK packages.
|
|
108
|
+
The Copilot plugin bundles the inner template only; the harness and generated target are not distributed.
|
|
109
|
+
|
|
110
|
+
Existing flat Universal Apps remain supported by plugin validation and do not need to adopt this layout.
|
|
111
|
+
This workspace template does not add automatic workspace discovery, a migration command, support for package managers other than npm, or functions by default.
|
|
112
|
+
|
|
27
113
|
## Key files
|
|
28
114
|
|
|
29
115
|
### rayfin/rayfin.yml
|
|
@@ -103,6 +189,8 @@ services:
|
|
|
103
189
|
| --- | --- | --- | --- |
|
|
104
190
|
| `enabled` | `boolean` | `false` | Enable the data service. |
|
|
105
191
|
| `dialect` | `"mssql"` \| `"postgresql"` | `"mssql"` | Database dialect. Fabric deployments support MSSQL only. |
|
|
192
|
+
| `path` | `string` | Project root | Data project directory relative to the application root. |
|
|
193
|
+
| `buildCommand` | `string` | — | Command run from the resolved data service path before packaging. |
|
|
106
194
|
|
|
107
195
|
#### `services.auth`
|
|
108
196
|
|
|
@@ -171,9 +259,10 @@ Configure an email provider for magic links, password resets, and email verifica
|
|
|
171
259
|
| Field | Type | Default | Description |
|
|
172
260
|
| --- | --- | --- | --- |
|
|
173
261
|
| `enabled` | `boolean` | `false` | Enable static content hosting. |
|
|
262
|
+
| `path` | `string` | — | Frontend project directory relative to the application root. |
|
|
174
263
|
| `root` | `string` | — | Root directory of the frontend project (relative to the project root). |
|
|
175
|
-
| `folder` | `string` | `"dist"` | Directory containing built static assets
|
|
176
|
-
| `buildCommand` | `string` | — | Shell command
|
|
264
|
+
| `folder` | `string` | `"dist"` | Directory containing built static assets, relative to `path` or legacy `root`. |
|
|
265
|
+
| `buildCommand` | `string` | — | Shell command run from the resolved static-hosting path before packaging (for example, `npm run build`). |
|
|
177
266
|
| `indexDocument` | `string` | — | Default document served for the root path (e.g. `index.html`). |
|
|
178
267
|
|
|
179
268
|
> **Tip:** All string values support environment variable interpolation with `${VAR}` and `${VAR:-default}` syntax.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/rayfin-guide",
|
|
3
|
-
"version": "1.36.0-alpha.
|
|
3
|
+
"version": "1.36.0-alpha.1620",
|
|
4
4
|
"description": "Cross-cutting Builder guides for the Rayfin platform — discovered by `@microsoft/rayfin-docs` via the `rayfinDocs` package.json field convention.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
File without changes
|