@microsoft/rayfin-guide 1.35.0-alpha.1374 → 1.35.0-alpha.1541
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/app-backend/deep-linking.md +188 -0
- package/assets/docs/app-backend/deploy.md +1 -1
- package/assets/docs/app-backend/deployment-pipelines.md +101 -0
- package/assets/docs/app-backend/index.md +1 -1
- package/assets/docs/cli/connectors/add.md +27 -3
- package/assets/docs/cli/connectors/category-a-entities.md +675 -0
- package/assets/docs/cli/connectors/category-b-function-bridge.md +269 -0
- package/assets/docs/cli/connectors/index.md +19 -2
- package/assets/docs/cli/env-interpolation.md +0 -5
- package/assets/docs/cli/environment-variables.md +1 -3
- package/assets/docs/data/overview.md +4 -0
- package/assets/docs/data/permissions.md +0 -17
- package/assets/docs/getting-started/project-structure.md +0 -8
- package/assets/docs/hosting/index.md +1 -2
- package/assets/docs/preview/local-dev-docker.md +3 -17
- package/package.json +1 -1
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 7
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Category B — function-bridge connectors
|
|
6
|
+
|
|
7
|
+
Reference for `kusto` (Fabric KQL Database) and `fabric-semanticmodel` (Power BI semantic model).
|
|
8
|
+
A Category B connector is a named-operation surface backed by a small, platform-owned function (UDF).
|
|
9
|
+
The Builder never writes or sees the function code.
|
|
10
|
+
|
|
11
|
+
The Builder declares the connector and calls a typed method; the Fabric app backend injects connector configuration and delegated authentication before forwarding to the function.
|
|
12
|
+
There are no GraphQL entities, so do **not** generate entity files, `@role` policies, or `metadata.json` entities for these connector types.
|
|
13
|
+
|
|
14
|
+
For the entity-generating types (`fabric-sqlanalytics`, `fabric-warehouse`, `fabric-sqldatabase`), read [Category A](./category-a-entities.md) instead.
|
|
15
|
+
|
|
16
|
+
## What each type exposes
|
|
17
|
+
|
|
18
|
+
| Type | Operations | Query language | Auth |
|
|
19
|
+
| --- | --- | --- | --- |
|
|
20
|
+
| `kusto` | `executeQuery`, `executeCommand` | KQL | `delegated` only |
|
|
21
|
+
| `fabric-semanticmodel` | `executeQuery` | DAX | `delegated` only |
|
|
22
|
+
|
|
23
|
+
Both are pinned to an adapter version (`version: '1'` today).
|
|
24
|
+
Delegated authentication runs every call as the signed-in user through the on-behalf-of flow.
|
|
25
|
+
|
|
26
|
+
## Add the connector
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
rayfin connector add \
|
|
30
|
+
--type kusto \
|
|
31
|
+
--workspace-id <ws-id> \
|
|
32
|
+
--item-id <kql-database-item-id> \
|
|
33
|
+
--name telemetry
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`--item-id` identifies the Fabric item to query: a KQL Database for `kusto`, a semantic model for `fabric-semanticmodel`.
|
|
37
|
+
Omit `--name` to derive the connector name from the Fabric item's display name.
|
|
38
|
+
|
|
39
|
+
The CLI verifies the item, writes the `rayfin.yml` entry, and scaffolds `rayfin/connectors/<name>/schema.ts`.
|
|
40
|
+
|
|
41
|
+
## Resulting rayfin.yml
|
|
42
|
+
|
|
43
|
+
```yaml
|
|
44
|
+
connectors:
|
|
45
|
+
- name: telemetry
|
|
46
|
+
type: kusto
|
|
47
|
+
version: '1'
|
|
48
|
+
config:
|
|
49
|
+
workspaceId: <ws-id>
|
|
50
|
+
itemId: <kql-database-item-id>
|
|
51
|
+
auth:
|
|
52
|
+
type: delegated
|
|
53
|
+
operations:
|
|
54
|
+
- name: executeQuery
|
|
55
|
+
- name: executeCommand
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The `config` block is the single source of truth for what to query and is not sent on the client wire.
|
|
59
|
+
`kusto` allows `executeQuery` and `executeCommand`; `fabric-semanticmodel` allows `executeQuery`.
|
|
60
|
+
In every case `auth.type` must be `delegated`.
|
|
61
|
+
|
|
62
|
+
## The generated schema.ts
|
|
63
|
+
|
|
64
|
+
`connector add` writes `rayfin/connectors/<name>/schema.ts` with a `// @generated — do not edit.` banner.
|
|
65
|
+
Do not hand-edit it.
|
|
66
|
+
Regenerate it by removing and re-adding the connector (`rayfin connector remove <name>`, then `rayfin connector add ...`).
|
|
67
|
+
|
|
68
|
+
For `fabric-semanticmodel` the file exports the typed marker plus a generic runtime config:
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
import type { ConnectorConfig } from '@microsoft/rayfin-connectors';
|
|
72
|
+
import type { FabricSemanticModel } from '@microsoft/rayfin-connector-fabric-semanticmodel';
|
|
73
|
+
|
|
74
|
+
export type SalesModelSchema = FabricSemanticModel<'executeQuery'>;
|
|
75
|
+
|
|
76
|
+
export const connectorConfig = {
|
|
77
|
+
connector: 'fabric-semanticmodel',
|
|
78
|
+
} as const satisfies ConnectorConfig;
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Kusto bakes cluster routing into the generated file
|
|
82
|
+
|
|
83
|
+
`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
|
+
|
|
85
|
+
```ts
|
|
86
|
+
import type { Kusto, KustoConnectorConfig } from '@microsoft/rayfin-connector-kusto';
|
|
87
|
+
|
|
88
|
+
export type TelemetrySchema = Kusto<'executeQuery' | 'executeCommand'>;
|
|
89
|
+
|
|
90
|
+
export const connectorConfig = {
|
|
91
|
+
connector: 'kusto',
|
|
92
|
+
queryServiceUri: 'https://<cluster>.kusto.fabric.microsoft.com',
|
|
93
|
+
databaseName: '<database>',
|
|
94
|
+
} as const satisfies KustoConnectorConfig;
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Three names appear here and nowhere else:
|
|
98
|
+
|
|
99
|
+
- `queryServiceUri` — the resolved Kusto cluster query endpoint.
|
|
100
|
+
- `databaseName` — the resolved KQL database name.
|
|
101
|
+
- `KustoConnectorConfig` — the Kusto-specific config type these two keys satisfy, exported from `@microsoft/rayfin-connector-kusto` rather than `@microsoft/rayfin-connectors`.
|
|
102
|
+
|
|
103
|
+
These keys live only in the file the Kusto scaffold writes.
|
|
104
|
+
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
|
+
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
|
+
|
|
107
|
+
The Kusto scaffold imports both its marker and `KustoConnectorConfig` from `@microsoft/rayfin-connector-kusto`, so it does not import `@microsoft/rayfin-connectors` at all.
|
|
108
|
+
|
|
109
|
+
## Install the packages the generated file imports
|
|
110
|
+
|
|
111
|
+
`connector add` scaffolds files but installs nothing. It prints the exact pinned command — copy it from that output, or rebuild it from the `packages` array in `rayfin connector types --json`, which carries both the package names and the version:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# Shape only. Use the version connector add printed, not this one.
|
|
115
|
+
|
|
116
|
+
# kusto — marker and config type both come from this one package
|
|
117
|
+
npm install @microsoft/rayfin-connector-kusto@1.35.0-alpha
|
|
118
|
+
|
|
119
|
+
# fabric-semanticmodel
|
|
120
|
+
npm install @microsoft/rayfin-connector-fabric-semanticmodel@1.35.0-alpha @microsoft/rayfin-connectors@1.35.0-alpha
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Always pin the version.** Connector packages ship in lockstep with the CLI, but their npm `latest` and `preview` tags lag behind, so an unversioned install pulls an older release and its own mismatched `@microsoft/rayfin-data`.
|
|
124
|
+
|
|
125
|
+
## Wire into the app client
|
|
126
|
+
|
|
127
|
+
Use the same `ConnectorsRayfinClient` wiring as Category A, but with no entity re-exports and no `GraphQLBackedConnector`.
|
|
128
|
+
Import the generated `<Name>Schema` type and `connectorConfig` value, key both maps by the exact `rayfin.yml` connector name, and pass the config through the client's `connectors` option.
|
|
129
|
+
|
|
130
|
+
Category B additionally needs a **connector runtime map** as the client's second constructor argument.
|
|
131
|
+
This is not optional: the runtime is what injects the generated routing and decodes the response.
|
|
132
|
+
|
|
133
|
+
- `kusto()` merges the generated `queryServiceUri` and `databaseName` into the outbound payload. Without it, `executeQuery` and `executeCommand` cannot route to the cluster.
|
|
134
|
+
- `fabricSemanticModel()` decodes the Arrow response. Without it, `executeQuery` results cannot be read.
|
|
135
|
+
|
|
136
|
+
Key the runtime map by the same connector name, and call the factory once per connector:
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
import { ConnectorsRayfinClient } from '@microsoft/rayfin-client/experimental';
|
|
140
|
+
import { kusto } from '@microsoft/rayfin-connector-kusto';
|
|
141
|
+
import { fabricSemanticModel } from '@microsoft/rayfin-connector-fabric-semanticmodel';
|
|
142
|
+
import {
|
|
143
|
+
type TelemetrySchema,
|
|
144
|
+
connectorConfig as telemetryConfig,
|
|
145
|
+
} from '../../rayfin/connectors/telemetry/schema';
|
|
146
|
+
import {
|
|
147
|
+
type SalesModelSchema,
|
|
148
|
+
connectorConfig as salesModelConfig,
|
|
149
|
+
} from '../../rayfin/connectors/salesModel/schema';
|
|
150
|
+
|
|
151
|
+
type AppConnectorsSchema = {
|
|
152
|
+
telemetry: TelemetrySchema;
|
|
153
|
+
salesModel: SalesModelSchema;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
const client = new ConnectorsRayfinClient<
|
|
157
|
+
Record<string, never>,
|
|
158
|
+
Record<string, never>,
|
|
159
|
+
AppConnectorsSchema
|
|
160
|
+
>(
|
|
161
|
+
{
|
|
162
|
+
baseUrl: import.meta.env.VITE_RAYFIN_API_URL,
|
|
163
|
+
publishableKey: import.meta.env.VITE_RAYFIN_PUBLISHABLE_KEY,
|
|
164
|
+
connectors: {
|
|
165
|
+
telemetry: telemetryConfig,
|
|
166
|
+
salesModel: salesModelConfig,
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
// Second argument: per-connector runtime hooks, keyed by connector name.
|
|
170
|
+
{
|
|
171
|
+
telemetry: kusto(),
|
|
172
|
+
salesModel: fabricSemanticModel(),
|
|
173
|
+
}
|
|
174
|
+
);
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
`ConnectorsRayfinClient` is experimental — import it only from the `@microsoft/rayfin-client/experimental` subpath, never the stable `@microsoft/rayfin-client` entry.
|
|
178
|
+
|
|
179
|
+
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
|
+
|
|
181
|
+
## Calling a Kusto connector
|
|
182
|
+
|
|
183
|
+
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
|
+
|
|
185
|
+
```ts
|
|
186
|
+
const clientRequestId = `KPC.rayfin_kusto_v1;${crypto.randomUUID()}`;
|
|
187
|
+
|
|
188
|
+
const response = await client.connectors.telemetry.executeQuery({
|
|
189
|
+
query: 'StormEvents | summarize count() by State | top 10 by count_',
|
|
190
|
+
clientRequestId,
|
|
191
|
+
});
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Optionally normalize the raw Kusto v1 `{ Tables }` document into a discriminated result that preserves every returned Kusto table:
|
|
195
|
+
|
|
196
|
+
```ts
|
|
197
|
+
import { toQueryResult } from '@microsoft/rayfin-connector-kusto';
|
|
198
|
+
|
|
199
|
+
const result = toQueryResult(response, { clientRequestId });
|
|
200
|
+
if (result.status === 'success') {
|
|
201
|
+
renderTables(result.tables);
|
|
202
|
+
} else {
|
|
203
|
+
showError(result.error.code, result.error.message);
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Successful results contain `tables` plus the `clientRequestId` you passed in (empty when you pass none) and an optional `activityId`; correlation is never on the wire.
|
|
208
|
+
Each table contains named typed `columns` and row-major `rows`.
|
|
209
|
+
Error results contain `error.message` and an optional `error.code`.
|
|
210
|
+
|
|
211
|
+
### Management commands
|
|
212
|
+
|
|
213
|
+
`executeCommand` runs a Kusto management (control) command — the command text starts with a leading dot.
|
|
214
|
+
It returns the same native Kusto v1 `{ Tables }` document as `executeQuery`, so normalize it with `toQueryResult` the same way, and pass a matching `clientRequestId` to correlate end to end:
|
|
215
|
+
|
|
216
|
+
```ts
|
|
217
|
+
const clientRequestId = `KPC.rayfin_kusto_v1;${crypto.randomUUID()}`;
|
|
218
|
+
|
|
219
|
+
const databases = await client.connectors.telemetry.executeCommand({
|
|
220
|
+
command: '.show databases',
|
|
221
|
+
clientRequestId,
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
const result = toQueryResult(databases, { clientRequestId });
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## Calling a semantic model connector
|
|
228
|
+
|
|
229
|
+
`executeQuery` on `fabric-semanticmodel` runs DAX and accepts an optional `resultSetRowCountLimit`.
|
|
230
|
+
There is no default.
|
|
231
|
+
Omit it and every row comes back, so ask the user for a bound rather than inventing one.
|
|
232
|
+
|
|
233
|
+
Prefer it over wrapping the DAX in `TOPN` when the user wants a guard rather than a deliberately ranked subset.
|
|
234
|
+
Exceeding it fails the query with an `'overflow'` error, so a truncated result announces itself, where a `TOPN` returns a complete-looking partial answer.
|
|
235
|
+
|
|
236
|
+
Run `rayfin docs search "resultSetRowCountLimit"` for version-locked details, since this behavior is owned by the connector package rather than the CLI.
|
|
237
|
+
|
|
238
|
+
## Exercising a Category B connector from the CLI
|
|
239
|
+
|
|
240
|
+
`rayfin connector invoke <name> <operation>` is the loop for Category B.
|
|
241
|
+
See [`connector invoke`](./invoke.md) for payload input, transports, token handling, and the output contract.
|
|
242
|
+
|
|
243
|
+
- `connector inspect` supports `fabric-semanticmodel` but **not** `kusto` — a `kusto` connector errors with `Unsupported connector type: kusto`.
|
|
244
|
+
There is no ad-hoc query path for Kusto connectors today.
|
|
245
|
+
- `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` included, POSTs to the deployed item and requires a prior `rayfin up`.
|
|
247
|
+
- `connector invoke` on `fabric-semanticmodel` returns an already-normalized result, because that connector normalizes inside its `invoke` middleware.
|
|
248
|
+
Do not apply `toQueryResult` to it again.
|
|
249
|
+
- A resolved `connector invoke` call is not automatically a success.
|
|
250
|
+
A connector that normalizes reports failure as `status: 'error'`; one that returns the raw service envelope reports it as `status: 'Failed'`.
|
|
251
|
+
The CLI converts either into a non-zero exit.
|
|
252
|
+
|
|
253
|
+
## Verify
|
|
254
|
+
|
|
255
|
+
`rayfin dev` parses the `connectors:` block but does not wire Category B calls.
|
|
256
|
+
A real `executeQuery` requires `rayfin up`.
|
|
257
|
+
|
|
258
|
+
## Troubleshooting
|
|
259
|
+
|
|
260
|
+
| Symptom | Likely cause | Fix |
|
|
261
|
+
| --- | --- | --- |
|
|
262
|
+
| `connector inspect` errors with `Unsupported connector type: kusto` | `connector inspect` has no Kusto path | Use `rayfin connector invoke <name> executeQuery` instead. |
|
|
263
|
+
| `Cannot find module '@microsoft/rayfin-connector-kusto'` | `connector add` scaffolds but does not install | Run the pinned `npm install` command `connector add` printed; never install unversioned. |
|
|
264
|
+
| The generated `schema.ts` has `queryServiceUri` / `databaseName` you did not expect | Expected — Kusto cluster routing is resolved at add time and baked in | Do not edit the file. Re-add the connector to re-resolve. |
|
|
265
|
+
| `rayfin up` rejects `auth.type: application` | Category B connectors are delegated-only | Set `auth.type: delegated`. |
|
|
266
|
+
| A Kusto query fails to reach the cluster, or the request carries no `queryServiceUri` | The runtime map was omitted, so nothing injected the generated routing | Pass `{ <name>: kusto() }` as the client's second constructor argument. |
|
|
267
|
+
| A semantic-model `executeQuery` result cannot be read or decoded | `fabricSemanticModel()` was not registered, so the Arrow response is never decoded | Pass `{ <name>: fabricSemanticModel() }` as the client's second constructor argument. |
|
|
268
|
+
| `client.connectors.<name>` is not typed | Connector key differs between `rayfin.yml`, `AppConnectorsSchema`, and the `connectors` option | Use the `rayfin.yml` `name` in all three. |
|
|
269
|
+
| A Category B call works locally under `rayfin dev` | It does not — `rayfin dev` only parses the block | Deploy with `rayfin up` and retest. |
|
|
@@ -6,14 +6,26 @@ 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
|
-
## Prerequisite — the `connector` command group
|
|
9
|
+
## Prerequisite — enabling the `connector` command group
|
|
10
10
|
|
|
11
|
-
`rayfin connector ...` is only registered when the
|
|
11
|
+
Connectors are behind a feature flag, so `rayfin connector ...` is only registered when the project opts in. Prefer the declarative setting in `rayfin/rayfin.yml`:
|
|
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:
|
|
12
22
|
|
|
13
23
|
```bash
|
|
14
24
|
RAYFIN_FEATURE_FLAGS=connectors npx rayfin connector search --help
|
|
15
25
|
```
|
|
16
26
|
|
|
27
|
+
Without any of the three the commands do not exist and the CLI reports an unknown command.
|
|
28
|
+
|
|
17
29
|
Each command has its own reference page:
|
|
18
30
|
|
|
19
31
|
- [`connector search`](./search.md) — discover Fabric sources the signed-in identity can add.
|
|
@@ -21,6 +33,11 @@ Each command has its own reference page:
|
|
|
21
33
|
- [`connector inspect`](./inspect.md) — run a single read-only sample query against a source.
|
|
22
34
|
- [`connector invoke`](./invoke.md) — run one named operation against a configured connector.
|
|
23
35
|
|
|
36
|
+
Each category has its own contract page — read the one that matches your connector type, not both:
|
|
37
|
+
|
|
38
|
+
- [Category A — GraphQL entity connectors](./category-a-entities.md) — entity generation, `@role` policies, the aggregate schema, and the per-dialect read/write matrix.
|
|
39
|
+
- [Category B — function-bridge connectors](./category-b-function-bridge.md) — the `kusto` and `fabric-semanticmodel` contract, including the Kusto cluster routing baked into the generated `schema.ts`.
|
|
40
|
+
|
|
24
41
|
A typical loop is search → add → inspect (Category A) or search → add → invoke (Category B).
|
|
25
42
|
|
|
26
43
|
## Two categories of connector
|
|
@@ -145,10 +145,6 @@ services:
|
|
|
145
145
|
enabled: ${AUTH_ENABLED:-false}
|
|
146
146
|
issuer: ${AUTH_ISSUER}
|
|
147
147
|
audience: ${AUTH_AUDIENCE:-https://api.example.com}
|
|
148
|
-
|
|
149
|
-
storage:
|
|
150
|
-
enabled: ${STORAGE_ENABLED:-true}
|
|
151
|
-
accountName: ${STORAGE_ACCOUNT:-devstoreaccount1}
|
|
152
148
|
```
|
|
153
149
|
|
|
154
150
|
```bash
|
|
@@ -159,7 +155,6 @@ DB_PORT=5432
|
|
|
159
155
|
DB_NAME=todos_prod
|
|
160
156
|
AUTH_ENABLED=true
|
|
161
157
|
AUTH_ISSUER=https://auth.example.com
|
|
162
|
-
STORAGE_ACCOUNT=prodstorageaccount
|
|
163
158
|
```
|
|
164
159
|
|
|
165
160
|
## Security Best Practices
|
|
@@ -171,7 +171,6 @@ Read by the Rayfin WebService container via the ASP.NET Core configuration syste
|
|
|
171
171
|
| --- | --- | --- |
|
|
172
172
|
| `Auth__Enabled` | `services.auth.enabled` | `true` / `false` |
|
|
173
173
|
| `Data__Enabled` | `services.data.enabled` | `true` / `false` |
|
|
174
|
-
| `Storage__Enabled` | `services.storage.enabled` | `true` / `false` |
|
|
175
174
|
|
|
176
175
|
The following signing-key variables are set to dev-mode defaults by `rayfin up` and are not typically edited:
|
|
177
176
|
|
|
@@ -190,7 +189,7 @@ These variables are read from the shell environment and are never written to fil
|
|
|
190
189
|
| `RAYFIN_WORKSPACE_ID` | Fabric workspace ID for non-interactive setup. Used with `RAYFIN_TOKEN`. |
|
|
191
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). |
|
|
192
191
|
| `RAYFIN_ENCRYPTION_FALLBACK_ENABLED` | Set to `true` to allow plaintext token cache on systems without OS credential storage. Development only. |
|
|
193
|
-
| `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 values include `docker-local-dev`, `functions`, and `postgresql`. |
|
|
194
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>`. |
|
|
195
194
|
| `RAYFIN_APPINSIGHTS_CONNECTION_STRING` | Override the telemetry endpoint for the CLI and VS Code extension. |
|
|
196
195
|
|
|
@@ -199,7 +198,6 @@ These variables are read from the shell environment and are never written to fil
|
|
|
199
198
|
| Flag | Effect |
|
|
200
199
|
| --- | --- |
|
|
201
200
|
| `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
|
-
| `storage` | Exposes storage commands (`rayfin dev storage *`) and storage prompts during `rayfin init`. |
|
|
203
201
|
| `functions` | Exposes Functions service prompts during `rayfin init`. |
|
|
204
202
|
| `postgresql` | Adds PostgreSQL as a selectable dialect during `rayfin init` and `rayfin init` with bundled templates. |
|
|
205
203
|
|
|
@@ -53,6 +53,10 @@ If you omit it, the server generates a UUID automatically.
|
|
|
53
53
|
- You may supply your own UUID at creation time if you prefer client-generated identifiers.
|
|
54
54
|
- Composite or non-`id` primary keys are not supported.
|
|
55
55
|
|
|
56
|
+
**Scope:** the rules above apply to entities you own under `rayfin/data/`.
|
|
57
|
+
Connector entities under `rayfin/connectors/` model an existing, external Fabric SQL source and follow different rules — the primary key is whatever the source actually declares, of any name and any datatype, including composite keys or no key at all.
|
|
58
|
+
See [Entity generation contract](../cli/connectors/category-a-entities.md#entity-generation-contract) for the connector-path key rules.
|
|
59
|
+
|
|
56
60
|
```typescript
|
|
57
61
|
@entity()
|
|
58
62
|
export class Todo {
|
|
@@ -145,23 +145,6 @@ export class SecureDocument {
|
|
|
145
145
|
}
|
|
146
146
|
```
|
|
147
147
|
|
|
148
|
-
## Storage permissions
|
|
149
|
-
|
|
150
|
-
The same `@role` decorator works with storage entities.
|
|
151
|
-
When applied to a `@blob()` class, Rayfin generates a storage policy instead of a database policy:
|
|
152
|
-
|
|
153
|
-
```typescript
|
|
154
|
-
import { blob, role } from '@microsoft/rayfin-core';
|
|
155
|
-
|
|
156
|
-
@blob()
|
|
157
|
-
@role('authenticated', '*', {
|
|
158
|
-
policy: (claims, item) => claims.sub.eq(item.owner_id),
|
|
159
|
-
})
|
|
160
|
-
export class ProfileImage {
|
|
161
|
-
owner_id!: string;
|
|
162
|
-
}
|
|
163
|
-
```
|
|
164
|
-
|
|
165
148
|
## How it works
|
|
166
149
|
|
|
167
150
|
- The `@role` decorator collects permission metadata at class definition time.
|
|
@@ -78,8 +78,6 @@ services:
|
|
|
78
78
|
data:
|
|
79
79
|
enabled: true
|
|
80
80
|
dialect: mssql
|
|
81
|
-
storage:
|
|
82
|
-
enabled: false
|
|
83
81
|
staticHosting:
|
|
84
82
|
enabled: true
|
|
85
83
|
root: .
|
|
@@ -160,12 +158,6 @@ Configure an email provider for magic links, password resets, and email verifica
|
|
|
160
158
|
| `useStartTls` | `boolean` | `false` | Use STARTTLS for the SMTP connection. |
|
|
161
159
|
| `webPort` | `number` | `1080` | MailDev web UI port (local development only). |
|
|
162
160
|
|
|
163
|
-
#### `services.storage`
|
|
164
|
-
|
|
165
|
-
| Field | Type | Default | Description |
|
|
166
|
-
| --- | --- | --- | --- |
|
|
167
|
-
| `enabled` | `boolean` | `false` | Enable the storage service. |
|
|
168
|
-
|
|
169
161
|
#### `services.staticHosting`
|
|
170
162
|
|
|
171
163
|
| Field | Type | Default | Description |
|
|
@@ -133,7 +133,7 @@ The deploy tool updates the configuration and pushes it to the backend during de
|
|
|
133
133
|
|
|
134
134
|
- The compressed ZIP archive must not exceed **100 MB**.
|
|
135
135
|
- The CLI uses maximum compression to minimize upload size.
|
|
136
|
-
- If your build output exceeds the limit, consider excluding large assets
|
|
136
|
+
- If your build output exceeds the limit, consider excluding large assets from the deployed bundle.
|
|
137
137
|
|
|
138
138
|
## Complete example
|
|
139
139
|
|
|
@@ -182,7 +182,6 @@ If the ZIP exceeds 100 MB:
|
|
|
182
182
|
|
|
183
183
|
- Review your build output for unnecessary files (source maps, unoptimized images).
|
|
184
184
|
- Configure your bundler to exclude development artifacts from the production build.
|
|
185
|
-
- Move large binary assets to Rayfin storage instead of bundling them as static content.
|
|
186
185
|
|
|
187
186
|
### No remote endpoint configured
|
|
188
187
|
|
|
@@ -24,9 +24,9 @@ This command:
|
|
|
24
24
|
- Validates that Docker and Docker Compose are available.
|
|
25
25
|
- Generates `rayfin/.temp/docker-compose.yml` from your project configuration.
|
|
26
26
|
- Allocates ports for each service.
|
|
27
|
-
- Starts containers for enabled services (WebService
|
|
27
|
+
- Starts containers for enabled services (WebService and database).
|
|
28
28
|
- Runs health checks and waits for all services to be healthy.
|
|
29
|
-
- Applies the project's declared data
|
|
29
|
+
- Applies the project's declared data configuration to the local backend.
|
|
30
30
|
- Starts the frontend with `npm run dev:frontend` when that script exists, falling back to `npm run dev` for existing projects.
|
|
31
31
|
- Resolves that script from `services.staticHosting.path` when the frontend lives in a nested package, otherwise from the project root.
|
|
32
32
|
- Builds and starts the configured local Functions host when `services.functions.enabled` is `true`.
|
|
@@ -100,14 +100,6 @@ npx rayfin dev db apply --force
|
|
|
100
100
|
Run this after making changes to entities in `rayfin/data/`.
|
|
101
101
|
Use `--force` to regenerate configuration even if no changes are detected.
|
|
102
102
|
|
|
103
|
-
### `rayfin dev storage apply`
|
|
104
|
-
|
|
105
|
-
Generate and apply storage configuration to the local development server.
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
npx rayfin dev storage apply
|
|
109
|
-
```
|
|
110
|
-
|
|
111
103
|
### `rayfin dev status`
|
|
112
104
|
|
|
113
105
|
Display the status of the local development environment.
|
|
@@ -120,7 +112,7 @@ Shows container health, port assignments, and service readiness.
|
|
|
120
112
|
|
|
121
113
|
### `rayfin dev watch`
|
|
122
114
|
|
|
123
|
-
Watch `./rayfin/data`
|
|
115
|
+
Watch `./rayfin/data` and auto-apply configuration changes.
|
|
124
116
|
|
|
125
117
|
```bash
|
|
126
118
|
npx rayfin dev watch
|
|
@@ -153,11 +145,5 @@ Set the feature flag in your environment:
|
|
|
153
145
|
export RAYFIN_FEATURE_FLAGS=docker-local-dev
|
|
154
146
|
```
|
|
155
147
|
|
|
156
|
-
Or combine with other flags:
|
|
157
|
-
|
|
158
|
-
```bash
|
|
159
|
-
export RAYFIN_FEATURE_FLAGS=docker-local-dev,storage
|
|
160
|
-
```
|
|
161
|
-
|
|
162
148
|
This feature flag gates only Docker provider selection and Docker maintenance commands.
|
|
163
149
|
Bare `rayfin dev` is available without preview flags and uses Fabric.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/rayfin-guide",
|
|
3
|
-
"version": "1.35.0-alpha.
|
|
3
|
+
"version": "1.35.0-alpha.1541",
|
|
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": [
|