@pylonsync/create-pylon 0.4.6 → 0.4.8
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/package.json +1 -1
- package/templates/agency/app.ts +8 -2
- package/templates/ai-chat/app.ts +8 -2
- package/templates/ai-studio/app.ts +8 -2
- package/templates/barebones/app.ts +8 -2
- package/templates/chat/app.ts +8 -2
- package/templates/consumer/app.ts +8 -2
- package/templates/creator/app.ts +8 -2
- package/templates/crm/app.ts +8 -2
- package/templates/directory/app.ts +8 -2
- package/templates/helpdesk/app.ts +8 -2
- package/templates/inventory/app.ts +8 -2
- package/templates/invoices/app.ts +8 -2
- package/templates/local-service/app.ts +8 -2
- package/templates/marketplace/app.ts +8 -2
- package/templates/projects/app.ts +8 -2
- package/templates/restaurant/app.ts +8 -2
- package/templates/saas/app.ts +8 -2
- package/templates/shop/app.ts +8 -2
- package/templates/todo/app.ts +8 -2
- package/templates/waitlist/app.ts +8 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pylonsync/create-pylon",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"description": "Scaffold a new Pylon app — realtime backend + web/mobile/expo frontends in one command. Run via `npm create @pylonsync/pylon@latest`.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
package/templates/agency/app.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
auth,
|
|
6
6
|
buildManifest,
|
|
7
7
|
discoverAppRoutes,
|
|
8
|
+
discoverFunctions,
|
|
8
9
|
font,
|
|
9
10
|
} from "@pylonsync/sdk";
|
|
10
11
|
|
|
@@ -253,6 +254,11 @@ const userPolicy = policy({
|
|
|
253
254
|
allowDelete: "false",
|
|
254
255
|
});
|
|
255
256
|
|
|
257
|
+
// Every non-internal function in functions/ becomes a manifest entry —
|
|
258
|
+
// this is what makes them show up in /api/manifest, the OpenAPI spec,
|
|
259
|
+
// and `pylon codegen`.
|
|
260
|
+
const fns = await discoverFunctions();
|
|
261
|
+
|
|
256
262
|
const manifest = buildManifest({
|
|
257
263
|
name: "__APP_NAME__",
|
|
258
264
|
version: "0.1.0",
|
|
@@ -264,8 +270,8 @@ const manifest = buildManifest({
|
|
|
264
270
|
// clientsForOwner, upsertClient, deleteClient,
|
|
265
271
|
// invoicesForOwner, upsertInvoice, setInvoiceStatus, deleteInvoice,
|
|
266
272
|
// seedStudioBackoffice
|
|
267
|
-
queries:
|
|
268
|
-
actions:
|
|
273
|
+
queries: fns.queries,
|
|
274
|
+
actions: fns.actions,
|
|
269
275
|
policies: [
|
|
270
276
|
inquiryPolicy,
|
|
271
277
|
capacityPolicy,
|
package/templates/ai-chat/app.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
auth,
|
|
6
6
|
buildManifest,
|
|
7
7
|
discoverAppRoutes,
|
|
8
|
+
discoverFunctions,
|
|
8
9
|
font,
|
|
9
10
|
} from "@pylonsync/sdk";
|
|
10
11
|
|
|
@@ -102,14 +103,19 @@ const userPolicy = policy({
|
|
|
102
103
|
allowDelete: "false",
|
|
103
104
|
});
|
|
104
105
|
|
|
106
|
+
// Every non-internal function in functions/ becomes a manifest entry —
|
|
107
|
+
// this is what makes them show up in /api/manifest, the OpenAPI spec,
|
|
108
|
+
// and `pylon codegen`.
|
|
109
|
+
const fns = await discoverFunctions();
|
|
110
|
+
|
|
105
111
|
const manifest = buildManifest({
|
|
106
112
|
name: "__APP_NAME__",
|
|
107
113
|
version: "0.1.0",
|
|
108
114
|
entities: [Conversation, Message, User],
|
|
109
115
|
// No custom functions needed: messages are written with optimistic db.insert
|
|
110
116
|
// (owner-stamped), and streaming uses the built-in POST /api/ai/stream.
|
|
111
|
-
queries:
|
|
112
|
-
actions:
|
|
117
|
+
queries: fns.queries,
|
|
118
|
+
actions: fns.actions,
|
|
113
119
|
policies: [conversationPolicy, messagePolicy, userPolicy],
|
|
114
120
|
auth: auth(),
|
|
115
121
|
// Self-hosted Inter (next/font parity): the build fetches the woff2, serves it
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
auth,
|
|
6
6
|
buildManifest,
|
|
7
7
|
discoverAppRoutes,
|
|
8
|
+
discoverFunctions,
|
|
8
9
|
font,
|
|
9
10
|
} from "@pylonsync/sdk";
|
|
10
11
|
|
|
@@ -89,14 +90,19 @@ const userPolicy = policy({
|
|
|
89
90
|
allowDelete: "false",
|
|
90
91
|
});
|
|
91
92
|
|
|
93
|
+
// Every non-internal function in functions/ becomes a manifest entry —
|
|
94
|
+
// this is what makes them show up in /api/manifest, the OpenAPI spec,
|
|
95
|
+
// and `pylon codegen`.
|
|
96
|
+
const fns = await discoverFunctions();
|
|
97
|
+
|
|
92
98
|
const manifest = buildManifest({
|
|
93
99
|
name: "__APP_NAME__",
|
|
94
100
|
version: "0.1.0",
|
|
95
101
|
entities: [Generation, User],
|
|
96
102
|
// generate (mutation) + pollGeneration (job) + the internal _getGeneration /
|
|
97
103
|
// _updateGeneration live in functions/ and are discovered automatically.
|
|
98
|
-
queries:
|
|
99
|
-
actions:
|
|
104
|
+
queries: fns.queries,
|
|
105
|
+
actions: fns.actions,
|
|
100
106
|
policies: [generationPolicy, userPolicy],
|
|
101
107
|
auth: auth(),
|
|
102
108
|
// Self-hosted Inter (next/font parity): the build fetches the woff2, serves it
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
auth,
|
|
6
6
|
buildManifest,
|
|
7
7
|
discoverAppRoutes,
|
|
8
|
+
discoverFunctions,
|
|
8
9
|
} from "@pylonsync/sdk";
|
|
9
10
|
|
|
10
11
|
// The smallest useful Pylon app: one entity, owned by its creator, with a
|
|
@@ -38,12 +39,17 @@ const itemPolicy = policy({
|
|
|
38
39
|
// under `app/`. `pylon dev` serves the SSR frontend and the API from one
|
|
39
40
|
// port. Add fields to `Item`, or a second `entity()`, and the typed client +
|
|
40
41
|
// REST/realtime API follow.
|
|
42
|
+
// Every non-internal function in functions/ becomes a manifest entry —
|
|
43
|
+
// this is what makes them show up in /api/manifest, the OpenAPI spec,
|
|
44
|
+
// and `pylon codegen`.
|
|
45
|
+
const fns = await discoverFunctions();
|
|
46
|
+
|
|
41
47
|
const manifest = buildManifest({
|
|
42
48
|
name: "__APP_NAME__",
|
|
43
49
|
version: "0.1.0",
|
|
44
50
|
entities: [Item],
|
|
45
|
-
queries:
|
|
46
|
-
actions:
|
|
51
|
+
queries: fns.queries,
|
|
52
|
+
actions: fns.actions,
|
|
47
53
|
policies: [itemPolicy],
|
|
48
54
|
auth: auth(),
|
|
49
55
|
routes: await discoverAppRoutes(),
|
package/templates/chat/app.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
auth,
|
|
6
6
|
buildManifest,
|
|
7
7
|
discoverAppRoutes,
|
|
8
|
+
discoverFunctions,
|
|
8
9
|
} from "@pylonsync/sdk";
|
|
9
10
|
|
|
10
11
|
// A chat message in the shared room. `authorId: field.owner()` stamps the
|
|
@@ -37,12 +38,17 @@ const messagePolicy = policy({
|
|
|
37
38
|
|
|
38
39
|
// buildManifest assembles the entities, policies, auth, and routes into the
|
|
39
40
|
// single manifest `pylon dev` serves — SSR room + realtime API on one port.
|
|
41
|
+
// Every non-internal function in functions/ becomes a manifest entry —
|
|
42
|
+
// this is what makes them show up in /api/manifest, the OpenAPI spec,
|
|
43
|
+
// and `pylon codegen`.
|
|
44
|
+
const fns = await discoverFunctions();
|
|
45
|
+
|
|
40
46
|
const manifest = buildManifest({
|
|
41
47
|
name: "__APP_NAME__",
|
|
42
48
|
version: "0.1.0",
|
|
43
49
|
entities: [Message],
|
|
44
|
-
queries:
|
|
45
|
-
actions:
|
|
50
|
+
queries: fns.queries,
|
|
51
|
+
actions: fns.actions,
|
|
46
52
|
policies: [messagePolicy],
|
|
47
53
|
auth: auth(),
|
|
48
54
|
routes: await discoverAppRoutes(),
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
auth,
|
|
6
6
|
buildManifest,
|
|
7
7
|
discoverAppRoutes,
|
|
8
|
+
discoverFunctions,
|
|
8
9
|
} from "@pylonsync/sdk";
|
|
9
10
|
|
|
10
11
|
// A post in the public feed. `authorId: field.owner()` stamps the signed-in
|
|
@@ -72,12 +73,17 @@ const likePolicy = policy({
|
|
|
72
73
|
// login. Natural next steps: a `Profile` entity (displayName/avatar keyed by
|
|
73
74
|
// userId) to show names instead of ids, and a `Follow` join entity
|
|
74
75
|
// (followerId/followedId) to scope the feed to people you follow.
|
|
76
|
+
// Every non-internal function in functions/ becomes a manifest entry —
|
|
77
|
+
// this is what makes them show up in /api/manifest, the OpenAPI spec,
|
|
78
|
+
// and `pylon codegen`.
|
|
79
|
+
const fns = await discoverFunctions();
|
|
80
|
+
|
|
75
81
|
const manifest = buildManifest({
|
|
76
82
|
name: "__APP_NAME__",
|
|
77
83
|
version: "0.1.0",
|
|
78
84
|
entities: [Post, Like],
|
|
79
|
-
queries:
|
|
80
|
-
actions:
|
|
85
|
+
queries: fns.queries,
|
|
86
|
+
actions: fns.actions,
|
|
81
87
|
policies: [postPolicy, likePolicy],
|
|
82
88
|
auth: auth(),
|
|
83
89
|
routes: await discoverAppRoutes(),
|
package/templates/creator/app.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
auth,
|
|
6
6
|
buildManifest,
|
|
7
7
|
discoverAppRoutes,
|
|
8
|
+
discoverFunctions,
|
|
8
9
|
font,
|
|
9
10
|
} from "@pylonsync/sdk";
|
|
10
11
|
|
|
@@ -112,14 +113,19 @@ const userPolicy = policy({
|
|
|
112
113
|
allowDelete: "false",
|
|
113
114
|
});
|
|
114
115
|
|
|
116
|
+
// Every non-internal function in functions/ becomes a manifest entry —
|
|
117
|
+
// this is what makes them show up in /api/manifest, the OpenAPI spec,
|
|
118
|
+
// and `pylon codegen`.
|
|
119
|
+
const fns = await discoverFunctions();
|
|
120
|
+
|
|
115
121
|
const manifest = buildManifest({
|
|
116
122
|
name: "__APP_NAME__",
|
|
117
123
|
version: "0.1.0",
|
|
118
124
|
entities: [Subscriber, SubscriberCount, User],
|
|
119
125
|
// subscribe (public mutation) + subscriberStats (owner-gated query) live in
|
|
120
126
|
// functions/ and are discovered automatically — they don't need listing here.
|
|
121
|
-
queries:
|
|
122
|
-
actions:
|
|
127
|
+
queries: fns.queries,
|
|
128
|
+
actions: fns.actions,
|
|
123
129
|
policies: [subscriberPolicy, subscriberCountPolicy, userPolicy],
|
|
124
130
|
// Email/password is on by default against the User entity above. No orgs,
|
|
125
131
|
// no billing — a newsletter is single-tenant (one business, one owner).
|
package/templates/crm/app.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
auth,
|
|
6
6
|
buildManifest,
|
|
7
7
|
discoverAppRoutes,
|
|
8
|
+
discoverFunctions,
|
|
8
9
|
font,
|
|
9
10
|
} from "@pylonsync/sdk";
|
|
10
11
|
|
|
@@ -136,12 +137,17 @@ const userPolicy = policy({
|
|
|
136
137
|
allowDelete: "false",
|
|
137
138
|
});
|
|
138
139
|
|
|
140
|
+
// Every non-internal function in functions/ becomes a manifest entry —
|
|
141
|
+
// this is what makes them show up in /api/manifest, the OpenAPI spec,
|
|
142
|
+
// and `pylon codegen`.
|
|
143
|
+
const fns = await discoverFunctions();
|
|
144
|
+
|
|
139
145
|
const manifest = buildManifest({
|
|
140
146
|
name: "__APP_NAME__",
|
|
141
147
|
version: "0.1.0",
|
|
142
148
|
entities: [Company, Contact, Deal, Activity, User],
|
|
143
|
-
queries:
|
|
144
|
-
actions:
|
|
149
|
+
queries: fns.queries,
|
|
150
|
+
actions: fns.actions,
|
|
145
151
|
policies: [
|
|
146
152
|
teamPolicy("company_team", "Company"),
|
|
147
153
|
teamPolicy("contact_team", "Contact"),
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
auth,
|
|
6
6
|
buildManifest,
|
|
7
7
|
discoverAppRoutes,
|
|
8
|
+
discoverFunctions,
|
|
8
9
|
font,
|
|
9
10
|
} from "@pylonsync/sdk";
|
|
10
11
|
|
|
@@ -128,6 +129,11 @@ const userPolicy = policy({
|
|
|
128
129
|
allowDelete: "false",
|
|
129
130
|
});
|
|
130
131
|
|
|
132
|
+
// Every non-internal function in functions/ becomes a manifest entry —
|
|
133
|
+
// this is what makes them show up in /api/manifest, the OpenAPI spec,
|
|
134
|
+
// and `pylon codegen`.
|
|
135
|
+
const fns = await discoverFunctions();
|
|
136
|
+
|
|
131
137
|
const manifest = buildManifest({
|
|
132
138
|
name: "__APP_NAME__",
|
|
133
139
|
version: "0.1.0",
|
|
@@ -135,8 +141,8 @@ const manifest = buildManifest({
|
|
|
135
141
|
// seedListings / submitListing / upvote (public) + submissionsForOwner /
|
|
136
142
|
// approveSubmission / rejectSubmission (owner-gated) live in functions/ and
|
|
137
143
|
// are discovered automatically.
|
|
138
|
-
queries:
|
|
139
|
-
actions:
|
|
144
|
+
queries: fns.queries,
|
|
145
|
+
actions: fns.actions,
|
|
140
146
|
policies: [listingPolicy, submissionPolicy, userPolicy],
|
|
141
147
|
auth: auth(),
|
|
142
148
|
// Self-hosted Inter (next/font parity): the build fetches the woff2, serves it
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
auth,
|
|
6
6
|
buildManifest,
|
|
7
7
|
discoverAppRoutes,
|
|
8
|
+
discoverFunctions,
|
|
8
9
|
font,
|
|
9
10
|
} from "@pylonsync/sdk";
|
|
10
11
|
|
|
@@ -111,12 +112,17 @@ const userPolicy = policy({
|
|
|
111
112
|
allowDelete: "false",
|
|
112
113
|
});
|
|
113
114
|
|
|
115
|
+
// Every non-internal function in functions/ becomes a manifest entry —
|
|
116
|
+
// this is what makes them show up in /api/manifest, the OpenAPI spec,
|
|
117
|
+
// and `pylon codegen`.
|
|
118
|
+
const fns = await discoverFunctions();
|
|
119
|
+
|
|
114
120
|
const manifest = buildManifest({
|
|
115
121
|
name: "__APP_NAME__",
|
|
116
122
|
version: "0.1.0",
|
|
117
123
|
entities: [Customer, Ticket, Message, User],
|
|
118
|
-
queries:
|
|
119
|
-
actions:
|
|
124
|
+
queries: fns.queries,
|
|
125
|
+
actions: fns.actions,
|
|
120
126
|
policies: [
|
|
121
127
|
teamPolicy("customer_team", "Customer"),
|
|
122
128
|
teamPolicy("ticket_team", "Ticket"),
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
auth,
|
|
6
6
|
buildManifest,
|
|
7
7
|
discoverAppRoutes,
|
|
8
|
+
discoverFunctions,
|
|
8
9
|
font,
|
|
9
10
|
} from "@pylonsync/sdk";
|
|
10
11
|
|
|
@@ -128,12 +129,17 @@ const userPolicy = policy({
|
|
|
128
129
|
allowDelete: "false",
|
|
129
130
|
});
|
|
130
131
|
|
|
132
|
+
// Every non-internal function in functions/ becomes a manifest entry —
|
|
133
|
+
// this is what makes them show up in /api/manifest, the OpenAPI spec,
|
|
134
|
+
// and `pylon codegen`.
|
|
135
|
+
const fns = await discoverFunctions();
|
|
136
|
+
|
|
131
137
|
const manifest = buildManifest({
|
|
132
138
|
name: "__APP_NAME__",
|
|
133
139
|
version: "0.1.0",
|
|
134
140
|
entities: [Product, Movement, User],
|
|
135
|
-
queries:
|
|
136
|
-
actions:
|
|
141
|
+
queries: fns.queries,
|
|
142
|
+
actions: fns.actions,
|
|
137
143
|
policies: [productPolicy, movementPolicy, userPolicy],
|
|
138
144
|
auth: auth(),
|
|
139
145
|
fonts: [
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
auth,
|
|
6
6
|
buildManifest,
|
|
7
7
|
discoverAppRoutes,
|
|
8
|
+
discoverFunctions,
|
|
8
9
|
font,
|
|
9
10
|
} from "@pylonsync/sdk";
|
|
10
11
|
|
|
@@ -137,12 +138,17 @@ const userPolicy = policy({
|
|
|
137
138
|
allowDelete: "false",
|
|
138
139
|
});
|
|
139
140
|
|
|
141
|
+
// Every non-internal function in functions/ becomes a manifest entry —
|
|
142
|
+
// this is what makes them show up in /api/manifest, the OpenAPI spec,
|
|
143
|
+
// and `pylon codegen`.
|
|
144
|
+
const fns = await discoverFunctions();
|
|
145
|
+
|
|
140
146
|
const manifest = buildManifest({
|
|
141
147
|
name: "__APP_NAME__",
|
|
142
148
|
version: "0.1.0",
|
|
143
149
|
entities: [Client, Invoice, LineItem, Payment, User],
|
|
144
|
-
queries:
|
|
145
|
-
actions:
|
|
150
|
+
queries: fns.queries,
|
|
151
|
+
actions: fns.actions,
|
|
146
152
|
policies: [
|
|
147
153
|
teamPolicy("client_team", "Client"),
|
|
148
154
|
teamPolicy("invoice_team", "Invoice"),
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
auth,
|
|
6
6
|
buildManifest,
|
|
7
7
|
discoverAppRoutes,
|
|
8
|
+
discoverFunctions,
|
|
8
9
|
font,
|
|
9
10
|
} from "@pylonsync/sdk";
|
|
10
11
|
|
|
@@ -113,6 +114,11 @@ const userPolicy = policy({
|
|
|
113
114
|
allowDelete: "false",
|
|
114
115
|
});
|
|
115
116
|
|
|
117
|
+
// Every non-internal function in functions/ becomes a manifest entry —
|
|
118
|
+
// this is what makes them show up in /api/manifest, the OpenAPI spec,
|
|
119
|
+
// and `pylon codegen`.
|
|
120
|
+
const fns = await discoverFunctions();
|
|
121
|
+
|
|
116
122
|
const manifest = buildManifest({
|
|
117
123
|
name: "__APP_NAME__",
|
|
118
124
|
version: "0.1.0",
|
|
@@ -120,8 +126,8 @@ const manifest = buildManifest({
|
|
|
120
126
|
// createBooking (public mutation), bookingsForOwner (owner query),
|
|
121
127
|
// confirmBooking / cancelBooking (owner mutations) live in functions/ and are
|
|
122
128
|
// discovered automatically.
|
|
123
|
-
queries:
|
|
124
|
-
actions:
|
|
129
|
+
queries: fns.queries,
|
|
130
|
+
actions: fns.actions,
|
|
125
131
|
policies: [bookingPolicy, bookedSlotPolicy, userPolicy],
|
|
126
132
|
auth: auth(),
|
|
127
133
|
// Self-hosted Inter (next/font parity): the build fetches the woff2, serves it
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
policy,
|
|
21
21
|
buildManifest,
|
|
22
22
|
discoverAppRoutes,
|
|
23
|
+
discoverFunctions,
|
|
23
24
|
} from "@pylonsync/sdk";
|
|
24
25
|
|
|
25
26
|
// Accounts. Email/password auth is built in: registering through
|
|
@@ -174,12 +175,17 @@ const offerPolicy = policy({
|
|
|
174
175
|
allowDelete: "auth.userId == data.buyerId",
|
|
175
176
|
});
|
|
176
177
|
|
|
178
|
+
// Every non-internal function in functions/ becomes a manifest entry —
|
|
179
|
+
// this is what makes them show up in /api/manifest, the OpenAPI spec,
|
|
180
|
+
// and `pylon codegen`.
|
|
181
|
+
const fns = await discoverFunctions();
|
|
182
|
+
|
|
177
183
|
const manifest = buildManifest({
|
|
178
184
|
name: "__APP_NAME__",
|
|
179
185
|
version: "0.1.0",
|
|
180
186
|
entities: [User, Listing, Offer, Watch],
|
|
181
|
-
queries:
|
|
182
|
-
actions:
|
|
187
|
+
queries: fns.queries,
|
|
188
|
+
actions: fns.actions,
|
|
183
189
|
policies: [userPolicy, listingPolicy, offerPolicy, watchPolicy],
|
|
184
190
|
// File-based SSR routing: app/**/page.tsx. One binary serves the frontend
|
|
185
191
|
// and the API on one port.
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
auth,
|
|
6
6
|
buildManifest,
|
|
7
7
|
discoverAppRoutes,
|
|
8
|
+
discoverFunctions,
|
|
8
9
|
font,
|
|
9
10
|
} from "@pylonsync/sdk";
|
|
10
11
|
|
|
@@ -154,12 +155,17 @@ const userPolicy = policy({
|
|
|
154
155
|
allowDelete: "false",
|
|
155
156
|
});
|
|
156
157
|
|
|
158
|
+
// Every non-internal function in functions/ becomes a manifest entry —
|
|
159
|
+
// this is what makes them show up in /api/manifest, the OpenAPI spec,
|
|
160
|
+
// and `pylon codegen`.
|
|
161
|
+
const fns = await discoverFunctions();
|
|
162
|
+
|
|
157
163
|
const manifest = buildManifest({
|
|
158
164
|
name: "__APP_NAME__",
|
|
159
165
|
version: "0.1.0",
|
|
160
166
|
entities: [Client, Project, Task, TimeEntry, User],
|
|
161
|
-
queries:
|
|
162
|
-
actions:
|
|
167
|
+
queries: fns.queries,
|
|
168
|
+
actions: fns.actions,
|
|
163
169
|
policies: [
|
|
164
170
|
teamPolicy("client_team", "Client"),
|
|
165
171
|
teamPolicy("project_team", "Project"),
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
auth,
|
|
6
6
|
buildManifest,
|
|
7
7
|
discoverAppRoutes,
|
|
8
|
+
discoverFunctions,
|
|
8
9
|
font,
|
|
9
10
|
} from "@pylonsync/sdk";
|
|
10
11
|
|
|
@@ -100,12 +101,17 @@ const userPolicy = policy({
|
|
|
100
101
|
allowDelete: "false",
|
|
101
102
|
});
|
|
102
103
|
|
|
104
|
+
// Every non-internal function in functions/ becomes a manifest entry —
|
|
105
|
+
// this is what makes them show up in /api/manifest, the OpenAPI spec,
|
|
106
|
+
// and `pylon codegen`.
|
|
107
|
+
const fns = await discoverFunctions();
|
|
108
|
+
|
|
103
109
|
const manifest = buildManifest({
|
|
104
110
|
name: "__APP_NAME__",
|
|
105
111
|
version: "0.1.0",
|
|
106
112
|
entities: [Reservation, ReservationSlot, User],
|
|
107
|
-
queries:
|
|
108
|
-
actions:
|
|
113
|
+
queries: fns.queries,
|
|
114
|
+
actions: fns.actions,
|
|
109
115
|
policies: [reservationPolicy, reservationSlotPolicy, userPolicy],
|
|
110
116
|
auth: auth(),
|
|
111
117
|
// Self-hosted Inter (next/font parity): the build fetches the woff2, serves it
|
package/templates/saas/app.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
auth,
|
|
6
6
|
buildManifest,
|
|
7
7
|
discoverAppRoutes,
|
|
8
|
+
discoverFunctions,
|
|
8
9
|
font,
|
|
9
10
|
} from "@pylonsync/sdk";
|
|
10
11
|
// Per-workspace Stripe billing — see lib/billing.ts. `billing.manifest` brings
|
|
@@ -168,17 +169,22 @@ const projectPolicy = policy({
|
|
|
168
169
|
allowDelete: "auth.tenantId == data.orgId",
|
|
169
170
|
});
|
|
170
171
|
|
|
172
|
+
// Every non-internal function in functions/ becomes a manifest entry —
|
|
173
|
+
// this is what makes them show up in /api/manifest, the OpenAPI spec,
|
|
174
|
+
// and `pylon codegen`.
|
|
175
|
+
const fns = await discoverFunctions();
|
|
176
|
+
|
|
171
177
|
const manifest = buildManifest({
|
|
172
178
|
name: "__APP_NAME__",
|
|
173
179
|
version: "0.1.0",
|
|
174
180
|
entities: [User, Org, OrgMember, OrgInvite, Project, ...billing.manifest.entities],
|
|
175
|
-
queries:
|
|
181
|
+
queries: fns.queries,
|
|
176
182
|
// Billing actions (createCheckoutSession / createBillingPortalSession /
|
|
177
183
|
// cancelSubscription / restoreSubscription / stripeWebhook). The plugin also
|
|
178
184
|
// declares getSubscription/listSubscriptions queries, but the dashboard reads
|
|
179
185
|
// the StripeSubscription entity directly (it's client-readable via the
|
|
180
186
|
// plugin's policy), so we don't wire those.
|
|
181
|
-
actions: [...billing.manifest.actions],
|
|
187
|
+
actions: [...fns.actions, ...billing.manifest.actions],
|
|
182
188
|
policies: [
|
|
183
189
|
userPolicy,
|
|
184
190
|
orgPolicy,
|
package/templates/shop/app.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
auth,
|
|
6
6
|
buildManifest,
|
|
7
7
|
discoverAppRoutes,
|
|
8
|
+
discoverFunctions,
|
|
8
9
|
font,
|
|
9
10
|
} from "@pylonsync/sdk";
|
|
10
11
|
|
|
@@ -119,12 +120,17 @@ const userPolicy = policy({
|
|
|
119
120
|
allowDelete: "false",
|
|
120
121
|
});
|
|
121
122
|
|
|
123
|
+
// Every non-internal function in functions/ becomes a manifest entry —
|
|
124
|
+
// this is what makes them show up in /api/manifest, the OpenAPI spec,
|
|
125
|
+
// and `pylon codegen`.
|
|
126
|
+
const fns = await discoverFunctions();
|
|
127
|
+
|
|
122
128
|
const manifest = buildManifest({
|
|
123
129
|
name: "__APP_NAME__",
|
|
124
130
|
version: "0.1.0",
|
|
125
131
|
entities: [Product, Order, User],
|
|
126
|
-
queries:
|
|
127
|
-
actions:
|
|
132
|
+
queries: fns.queries,
|
|
133
|
+
actions: fns.actions,
|
|
128
134
|
policies: [productPolicy, orderPolicy, userPolicy],
|
|
129
135
|
auth: auth(),
|
|
130
136
|
// Self-hosted Inter (next/font parity): the build fetches the woff2, serves it
|
package/templates/todo/app.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
auth,
|
|
6
6
|
buildManifest,
|
|
7
7
|
discoverAppRoutes,
|
|
8
|
+
discoverFunctions,
|
|
8
9
|
} from "@pylonsync/sdk";
|
|
9
10
|
|
|
10
11
|
// A todo that belongs to one person. `userId: field.owner()` stamps the
|
|
@@ -52,12 +53,17 @@ const todoPolicy = policy({
|
|
|
52
53
|
// To require real accounts instead, enable email/password (it's built in
|
|
53
54
|
// against a `User` entity) and swap `<EnsureGuest>` for `<SignedIn>` /
|
|
54
55
|
// `<SignedOut>` from `@pylonsync/client`.
|
|
56
|
+
// Every non-internal function in functions/ becomes a manifest entry —
|
|
57
|
+
// this is what makes them show up in /api/manifest, the OpenAPI spec,
|
|
58
|
+
// and `pylon codegen`.
|
|
59
|
+
const fns = await discoverFunctions();
|
|
60
|
+
|
|
55
61
|
const manifest = buildManifest({
|
|
56
62
|
name: "__APP_NAME__",
|
|
57
63
|
version: "0.1.0",
|
|
58
64
|
entities: [Todo],
|
|
59
|
-
queries:
|
|
60
|
-
actions:
|
|
65
|
+
queries: fns.queries,
|
|
66
|
+
actions: fns.actions,
|
|
61
67
|
policies: [todoPolicy],
|
|
62
68
|
auth: auth(),
|
|
63
69
|
// File-based routing: `discoverAppRoutes()` walks `app/**/page.tsx` and
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
auth,
|
|
6
6
|
buildManifest,
|
|
7
7
|
discoverAppRoutes,
|
|
8
|
+
discoverFunctions,
|
|
8
9
|
font,
|
|
9
10
|
} from "@pylonsync/sdk";
|
|
10
11
|
|
|
@@ -116,14 +117,19 @@ const userPolicy = policy({
|
|
|
116
117
|
allowDelete: "false",
|
|
117
118
|
});
|
|
118
119
|
|
|
120
|
+
// Every non-internal function in functions/ becomes a manifest entry —
|
|
121
|
+
// this is what makes them show up in /api/manifest, the OpenAPI spec,
|
|
122
|
+
// and `pylon codegen`.
|
|
123
|
+
const fns = await discoverFunctions();
|
|
124
|
+
|
|
119
125
|
const manifest = buildManifest({
|
|
120
126
|
name: "__APP_NAME__",
|
|
121
127
|
version: "0.1.0",
|
|
122
128
|
entities: [Signup, WaitlistStat, User],
|
|
123
129
|
// joinWaitlist (public mutation) + waitlistStats (owner-gated query) live in
|
|
124
130
|
// functions/ and are discovered automatically — they don't need listing here.
|
|
125
|
-
queries:
|
|
126
|
-
actions:
|
|
131
|
+
queries: fns.queries,
|
|
132
|
+
actions: fns.actions,
|
|
127
133
|
policies: [signupPolicy, waitlistStatPolicy, userPolicy],
|
|
128
134
|
// Email/password is on by default against the User entity above. No orgs,
|
|
129
135
|
// no billing — a waitlist is single-tenant (one business, one owner).
|