@microsoft/rayfin-guide 1.1.0
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/LICENSE +21 -0
- package/README.md +34 -0
- package/assets/docs/index.md +52 -0
- package/assets/docs/quickstart.md +81 -0
- package/package.json +27 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Copyright (c) Microsoft Corporation.
|
|
2
|
+
|
|
3
|
+
MIT License
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# @microsoft/rayfin-guide
|
|
2
|
+
|
|
3
|
+
Cross-cutting Builder guides for the Rayfin platform.
|
|
4
|
+
|
|
5
|
+
This package ships markdown only — no code.
|
|
6
|
+
The `@microsoft/rayfin-docs` indexing library discovers it via the `rayfinDocs` field in this package's `package.json` and exposes its content through the same `rayfin docs` CLI commands and MCP tools that surface SDK package docs.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
Builders can query these guides from a Rayfin project:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npx -y @microsoft/rayfin-cli docs list --module guide
|
|
14
|
+
npx -y @microsoft/rayfin-cli docs search 'quickstart' --module guide
|
|
15
|
+
npx -y @microsoft/rayfin-cli docs get --id rayfin-guide:index.md
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Contents
|
|
19
|
+
|
|
20
|
+
- `assets/docs/index.md` — top-level introduction to the Rayfin platform
|
|
21
|
+
- `assets/docs/quickstart.md` — the canonical Builder quickstart
|
|
22
|
+
|
|
23
|
+
Additional guide pages can be added under `assets/docs/`.
|
|
24
|
+
|
|
25
|
+
## Discovery
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import { DocsService } from '@microsoft/rayfin-docs';
|
|
29
|
+
|
|
30
|
+
const docs = new DocsService({
|
|
31
|
+
discover: { from: process.cwd() },
|
|
32
|
+
});
|
|
33
|
+
const guides = docs.listDocs('guide');
|
|
34
|
+
```
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
symbols: []
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Rayfin platform overview
|
|
6
|
+
|
|
7
|
+
Rayfin is Microsoft's platform for building data-driven applications
|
|
8
|
+
on Microsoft Fabric. It combines:
|
|
9
|
+
|
|
10
|
+
- **Code-first data modeling** via TypeScript decorators (the
|
|
11
|
+
`@microsoft/rayfin-core` package's `@entity()`, `@text()`, `@uuid()`,
|
|
12
|
+
`@one()`, `@many()`, `@anonymous()`, `@authenticated()`).
|
|
13
|
+
- **DAB-compliant data access** via `@microsoft/rayfin-data` exposing
|
|
14
|
+
GraphQL clients generated from your decorated entity classes.
|
|
15
|
+
- **Authentication** via `@microsoft/rayfin-auth` with magic-link and
|
|
16
|
+
Fabric-token flows.
|
|
17
|
+
- **A high-level client entrypoint** (`@microsoft/rayfin-client`) that
|
|
18
|
+
composes auth + data behind a single configured client.
|
|
19
|
+
- **A scaffolding CLI** (`@microsoft/rayfin-cli`) that generates DAB
|
|
20
|
+
configuration from your entity classes and bootstraps new projects.
|
|
21
|
+
- **An MCP server** (`@microsoft/rayfin-mcp`) that exposes the docs
|
|
22
|
+
corpus as `list_docs`, `search_docs`, and `get_doc` tools for AI
|
|
23
|
+
agents working in Builder projects.
|
|
24
|
+
|
|
25
|
+
## Where to start
|
|
26
|
+
|
|
27
|
+
For Builders new to Rayfin, follow the [quickstart](./quickstart.md).
|
|
28
|
+
The quickstart walks through:
|
|
29
|
+
|
|
30
|
+
1. Scaffolding a new Rayfin project with `npm create rayfin@latest`.
|
|
31
|
+
2. Defining your first entity with the core decorators.
|
|
32
|
+
3. Running the project locally with `rayfin up`.
|
|
33
|
+
4. Querying via the generated GraphQL endpoint.
|
|
34
|
+
|
|
35
|
+
## Per-package reference
|
|
36
|
+
|
|
37
|
+
Each Rayfin SDK package ships its own docs at
|
|
38
|
+
`<package>/assets/docs/`. Discoverable via:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
rayfin docs list --module ts-sdk
|
|
42
|
+
rayfin docs search 'magic link'
|
|
43
|
+
rayfin docs get --id rayfin-auth:index.md
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Or, in MCP-host environments, via the `list_docs`, `search_docs`, and
|
|
47
|
+
`get_doc` tools.
|
|
48
|
+
|
|
49
|
+
## Package discovery
|
|
50
|
+
|
|
51
|
+
If a package is not installed yet, use `rayfin docs discover '<topic>'`
|
|
52
|
+
to find matching Rayfin packages and install commands.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
symbols: []
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Quickstart
|
|
6
|
+
|
|
7
|
+
This quickstart walks you through scaffolding a new Rayfin project,
|
|
8
|
+
defining your first entity, running the project locally, and querying
|
|
9
|
+
via GraphQL.
|
|
10
|
+
|
|
11
|
+
## Prerequisites
|
|
12
|
+
|
|
13
|
+
- Node.js 20+
|
|
14
|
+
- A modern terminal (PowerShell, bash, zsh)
|
|
15
|
+
|
|
16
|
+
## 1. Scaffold a new project
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm create rayfin@latest my-app
|
|
20
|
+
cd my-app
|
|
21
|
+
npm install
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The scaffold creates a Rayfin project with:
|
|
25
|
+
|
|
26
|
+
- `rayfin/data/` — your entity classes
|
|
27
|
+
- `rayfin.config.json` — project configuration
|
|
28
|
+
- `package.json` with `rayfin-cli`, `rayfin-core`, `rayfin-data`, and
|
|
29
|
+
`rayfin-auth` already wired
|
|
30
|
+
|
|
31
|
+
## 2. Define your first entity
|
|
32
|
+
|
|
33
|
+
Edit `rayfin/data/Todo.ts`:
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
import { entity, uuid, text, int, anonymous, authenticated } from '@microsoft/rayfin-core';
|
|
37
|
+
|
|
38
|
+
@entity()
|
|
39
|
+
@anonymous('read')
|
|
40
|
+
@authenticated('*')
|
|
41
|
+
export class Todo {
|
|
42
|
+
@uuid() id!: string;
|
|
43
|
+
@text() title!: string;
|
|
44
|
+
@int() priority!: number;
|
|
45
|
+
@text({ optional: true }) notes?: string;
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## 3. Run locally
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
rayfin up
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
This generates a DAB-compliant configuration from your entity classes
|
|
56
|
+
and starts the Data API Builder server on
|
|
57
|
+
[http://localhost:5000](http://localhost:5000).
|
|
58
|
+
|
|
59
|
+
## 4. Query via GraphQL
|
|
60
|
+
|
|
61
|
+
Open [http://localhost:5000/graphql](http://localhost:5000/graphql) and try:
|
|
62
|
+
|
|
63
|
+
```graphql
|
|
64
|
+
query {
|
|
65
|
+
todos {
|
|
66
|
+
items {
|
|
67
|
+
id
|
|
68
|
+
title
|
|
69
|
+
priority
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Next steps
|
|
76
|
+
|
|
77
|
+
- [Auth overview](./index.md) — for sign-in flows beyond the
|
|
78
|
+
built-in `anonymous` role.
|
|
79
|
+
- Per-package reference via `rayfin docs list --module ts-sdk`.
|
|
80
|
+
- Deploy to Fabric: see the `rayfin up staticapp deploy` subcommand
|
|
81
|
+
(interactive scaffolding through Fabric workspace selection).
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@microsoft/rayfin-guide",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Cross-cutting Builder guides for the Rayfin platform — discovered by `@microsoft/rayfin-docs` via the `rayfinDocs` package.json field convention.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"assets/docs",
|
|
8
|
+
"LICENSE",
|
|
9
|
+
"README.md"
|
|
10
|
+
],
|
|
11
|
+
"rayfinDocs": {
|
|
12
|
+
"version": 1,
|
|
13
|
+
"dir": "assets/docs",
|
|
14
|
+
"module": "rayfin-guide",
|
|
15
|
+
"kind": "guide"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"registry": "https://npm.pkg.github.com",
|
|
19
|
+
"access": "restricted"
|
|
20
|
+
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/microsoft/project-rayfin.git",
|
|
24
|
+
"directory": "packages/guide"
|
|
25
|
+
},
|
|
26
|
+
"license": "MIT"
|
|
27
|
+
}
|