@plitzi/plitzi-builder 0.38.20 → 0.38.22
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/CHANGELOG.md +163 -0
- package/dist/index.html +1 -1
- package/dist/modules/App/AppContainer/containers/ContainerSettings.d.ts +1 -1
- package/dist/modules/Channels/Channels.d.ts +10 -0
- package/dist/modules/Channels/components/ChannelCard/ChannelCard.d.ts +11 -0
- package/dist/modules/Channels/components/ChannelCard/index.d.ts +2 -0
- package/dist/modules/Channels/helpers.d.ts +33 -0
- package/dist/modules/Channels/index.d.ts +1 -0
- package/dist/modules/Functions/Functions.d.ts +1 -1
- package/dist/modules/Functions/components/FunctionsSidebar/FunctionsSidebar.d.ts +9 -4
- package/dist/modules/Functions/components/FunctionsSidebar/components/JobItem/JobItem.d.ts +12 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/JobItem/index.d.ts +3 -0
- package/dist/modules/Functions/components/FunctionsSidebar/components/NewTask/NewTask.d.ts +1 -1
- package/dist/modules/Functions/components/JobInspector/JobInspector.d.ts +10 -0
- package/dist/modules/Functions/components/JobInspector/components/JobRun/JobRun.d.ts +12 -0
- package/dist/modules/Functions/components/JobInspector/components/JobRun/index.d.ts +3 -0
- package/dist/modules/Functions/components/JobInspector/index.d.ts +3 -0
- package/dist/modules/Functions/editor/source.d.ts +8 -1
- package/dist/modules/Functions/helpers.d.ts +29 -6
- package/dist/modules/Functions/useJobs.d.ts +13 -0
- package/dist/modules/Space/helpers/hasServerRendering.d.ts +17 -0
- package/dist/package.json.d.ts +2 -2
- package/dist/plitzi-builder.css +1 -1
- package/dist/plitzi-builder.css.gz +0 -0
- package/dist/plitzi-builder.js +1629 -1599
- package/dist/plitzi-builder.js.gz +0 -0
- package/dist/plitzi-functions-worker.js +1 -1
- package/package.json +16 -16
- package/dist/modules/App/components/AppHeader/RuntimeIdleNotice/timeLeftOf.test.d.ts +0 -1
- package/dist/modules/App/components/SitemapDiagram/helpers/schemaToSitemap.test.d.ts +0 -1
- package/dist/modules/App/components/VersionContents/helpers.test.d.ts +0 -1
- package/dist/modules/Builder/components/BuilderArea/canvasMotionCss.test.d.ts +0 -1
- package/dist/modules/Builder/components/BuilderArea/liveCanvas.test.d.ts +0 -1
- package/dist/modules/Builder/components/BuilderOverlay/BuilderOverlayHelper.test.d.ts +0 -1
- package/dist/modules/Builder/helpers/canvasIcons.test.d.ts +0 -1
- package/dist/modules/Builder/helpers/elementChain.test.d.ts +0 -1
- package/dist/modules/Builder/helpers/searchElements.test.d.ts +0 -1
- package/dist/modules/Collaboration/CollaborationHelper.test.d.ts +0 -1
- package/dist/modules/Components/helpers.test.d.ts +0 -1
- package/dist/modules/DataSource/helpers/getBindingWarnings.test.d.ts +0 -1
- package/dist/modules/Export/helpers/exportFiles.test.d.ts +0 -1
- package/dist/modules/Export/helpers/repairs.test.d.ts +0 -1
- package/dist/modules/Flags/components/FlagForm/ruleGroup.test.d.ts +0 -1
- package/dist/modules/Functions/editor/functionsEnvironment.test.d.ts +0 -1
- package/dist/modules/Functions/editor/source.test.d.ts +0 -1
- package/dist/modules/History/helpers.test.d.ts +0 -1
- package/dist/modules/Interactions/components/Workflow/helpers/elementOptions.test.d.ts +0 -1
- package/dist/modules/Interactions/components/Workflow/helpers/nodeOptions.test.d.ts +0 -1
- package/dist/modules/Interactions/components/Workflow/helpers/nodeWarnings.test.d.ts +0 -1
- package/dist/modules/Interactions/components/Workflow/helpers/whileRunning.test.d.ts +0 -1
- package/dist/modules/Queue/hooks/useQueueManager.test.d.ts +0 -1
- package/dist/modules/Resources/components/Resource/subTypes/ResourceServerCode/serverCodeKindOf.test.d.ts +0 -1
- package/dist/modules/Resources/components/ResourceManager/helpers/isSnippetFile.test.d.ts +0 -1
- package/dist/modules/Resources/components/ResourcesList/ListHelper.test.d.ts +0 -1
- package/dist/modules/Resources/helpers.test.d.ts +0 -1
- package/dist/modules/Runtime/helpers/idleDurationOf.test.d.ts +0 -1
- package/dist/modules/Schema/helpers/templateProblem.test.d.ts +0 -1
- package/dist/modules/Space/helpers/spaceIssues.test.d.ts +0 -1
- package/dist/modules/Space/hooks/useSpaceQuota.test.d.ts +0 -1
- package/dist/modules/Usages/helpers/grouping.test.d.ts +0 -1
- package/dist/modules/Usages/helpers/unusedParity.test.d.ts +0 -1
- package/dist/modules/Usages/helpers/usageIndex.test.d.ts +0 -1
- /package/dist/modules/Functions/components/{FunctionInspector/components/InspectorSection → InspectorSection}/InspectorSection.d.ts +0 -0
- /package/dist/modules/Functions/components/{FunctionInspector/components/InspectorSection → InspectorSection}/index.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,168 @@
|
|
|
1
1
|
# @plitzi/plitzi-builder
|
|
2
2
|
|
|
3
|
+
## 0.38.22
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 19fbc45: ## Server
|
|
8
|
+
|
|
9
|
+
- **`ctx.oauth`, after a project moved onto it** (`@plitzi/sdk-server`, `@plitzi/sdk-shared`) — PZ-155..158.
|
|
10
|
+
`functions.oauth.callbackOrigin` fixes the one address providers send a visitor back to, on a server of one space
|
|
11
|
+
reached on several: `serveProject` sets it to the address people reach it on, or its loopback `127.0.0.1` when that is
|
|
12
|
+
plain HTTP (providers refuse `http` past loopback, and `localhost`), and prints it as it starts; the callback then sends
|
|
13
|
+
the visitor on to `returnTo` on the address they started from — its `location` is absolute now. `connect(name,
|
|
14
|
+
{ returnTo, authorizeParams })` adds to the connection's parameters for one consent (`prompt: 'select_account'`), and
|
|
15
|
+
refuses one the platform writes. `ctx.fetch` and `ctx.oauth.fetch` take `init.signal`: in the sandbox and a runtime the
|
|
16
|
+
request is numbered and the code's `abort` cuts it on the platform. `ActionRefusal` takes `{ code }`; `ctx.oauth`
|
|
17
|
+
refuses with `oauth-not-connected` and `oauth-no-owner`.
|
|
18
|
+
- **A refusal of the platform's stays one across the sandbox** (`@plitzi/sdk-server`). A call answered with an
|
|
19
|
+
`ActionRefusal` crossed the isolate, the runner service and a runtime as a plain error: caught, the code could not tell
|
|
20
|
+
it apart; uncaught, a route answered 500 `This route failed` instead of 400 and the reason. The answer carries
|
|
21
|
+
`refused` and `code` now, and the code catches the refusal it was thrown.
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [19fbc45]
|
|
24
|
+
- @plitzi/plitzi-sdk@0.38.22
|
|
25
|
+
- @plitzi/sdk-auth@0.38.22
|
|
26
|
+
- @plitzi/sdk-authoring@0.38.22
|
|
27
|
+
- @plitzi/sdk-dev-tools@0.38.22
|
|
28
|
+
- @plitzi/sdk-elements@0.38.22
|
|
29
|
+
- @plitzi/sdk-event-bridge@0.38.22
|
|
30
|
+
- @plitzi/sdk-interactions@0.38.22
|
|
31
|
+
- @plitzi/sdk-navigation@0.38.22
|
|
32
|
+
- @plitzi/sdk-plugins@0.38.22
|
|
33
|
+
- @plitzi/sdk-schema@0.38.22
|
|
34
|
+
- @plitzi/sdk-shared@0.38.22
|
|
35
|
+
- @plitzi/sdk-style@0.38.22
|
|
36
|
+
- @plitzi/sdk-variables@0.38.22
|
|
37
|
+
|
|
38
|
+
## 0.38.21
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- 19fbc45: ## Server
|
|
43
|
+
|
|
44
|
+
- **Jobs: work longer than a request** (`@plitzi/sdk-server`, `@plitzi/sdk-shared`, `@plitzi/sdk-elements`,
|
|
45
|
+
`@plitzi/plitzi-sdk`, `@plitzi/sdk-authoring`) — PZ-136. A space's code declares them in
|
|
46
|
+
`defineFunctions({ jobs: { train: { watch, maxSeconds, run(input, job, ctx) } } })` and starts them with
|
|
47
|
+
`ctx.jobs.start(name, input, { key })` (`get`, `pause`, `resume`, `cancel` beside it). They run in the actions' durable
|
|
48
|
+
queue — leased, taken over when a server dies, retried with backoff — slice by slice, in the sandbox, in a space's
|
|
49
|
+
runtime and natively alike: `job.save(state)` is the one checkpoint and the next slice starts with `job.state`;
|
|
50
|
+
`job.report(fraction, step)` says how far it is; on `job.signal` (`job.stopping`: `pause`, `cancel`, `limit`,
|
|
51
|
+
`shutdown`) the code has 5 s to save and return. A sandbox slice runs at most `sliceMs` and goes on in the next if it
|
|
52
|
+
saved since it began — one that saved nothing fails, so a job cannot loop forever; a runtime's runs until the job's
|
|
53
|
+
time is up. A real pause: `paused` keeps what it saved until resumed. Who may watch it is RBAC: whoever started it, and
|
|
54
|
+
whoever its `watch` (a channel's access) lets in, on `$job:<id>` — the platform's topic, retained — read with
|
|
55
|
+
`useJob(id)` or a `channel` element on `$job:{{ id }}`; the view never carries its input, its state, or an error other
|
|
56
|
+
than the code's own refusal. Limits per space (its plan) through `functions.jobs.limitsFor` —
|
|
57
|
+
`DEFAULT_FUNCTION_JOB_LIMITS` otherwise: 10 running across the account's spaces (`pool`, the oldest first), 1,000
|
|
58
|
+
waiting, 6 h, slices of 5 min / 30 s CPU / 10,000 calls, 1 MB of state.
|
|
59
|
+
- **The queue's types are the queue's** (`@plitzi/sdk-shared`, `@plitzi/sdk-server`): `ActionJobQueue`, `ActionJob`,
|
|
60
|
+
`ActionJobInput`, `ActionJobStatus`, `ActionJobAttempt`, `ActionJobSettlement`, `ActionJobQuery` are `JobQueue`, `Job`,
|
|
61
|
+
`JobInput`, `JobStatus`, `JobAttempt`, `JobSettlement`, `JobQuery` (`ACTION_JOB_STATUSES` → `JOB_STATUSES`,
|
|
62
|
+
`isJobStatus`, `TERMINAL_JOB_STATUSES`) — the queue holds a schedule's fires, the runs set for later and the jobs of
|
|
63
|
+
the spaces' functions. **What a job runs is its `target`**: `{ kind: 'action', name, trigger }` or
|
|
64
|
+
`{ kind: 'function', name, user, watch, at }`, in place of `actionId`, `trigger` and `function`; `listJobs` filters
|
|
65
|
+
by `kind` and `name`. Also on the queue: `paused` with `pause`/`resume`, `write` for what a running job saves and
|
|
66
|
+
reports, `state`/`progress`/`result`/`activeMs`, `heartbeat` answering `{ jobId, stop: 'cancel' | 'pause' }[]`, a
|
|
67
|
+
settlement's explicit `refund`, `requeue(…, { input, fresh })`. The helpers bring a store a release before left up
|
|
68
|
+
to it by themselves: MySQL's `ensureJobTables` gives each job its target from `action_id`/`trigger_type` and drops
|
|
69
|
+
them (`mysqlJobSchemaUpgrades` lists the statements for a deployment's own migrations); Mongo's queue does the same
|
|
70
|
+
to the documents on first use and drops the `spaceId_1_actionId_1_updatedAt_-1` index. A deployment with a queue of
|
|
71
|
+
its own: the contract tests (`describeJobQueue`) say what it must now do.
|
|
72
|
+
- **A runtime's routes stream** (`@plitzi/sdk-server`): a route under `/fn/` answered by a space's runtime is passed on
|
|
73
|
+
as it is written — its head at once, its body as the code writes it, with the platform's `ctx` — over the functions
|
|
74
|
+
protocol's new `head`/`chunk` messages, with no time limit once it answered; the deployment's own routes stream too.
|
|
75
|
+
A runtime's `endpoints` are for addresses outside `/fn/` (an MCP server at `/mcp`); anything that can live under
|
|
76
|
+
`/fn/` is a route. A sandbox's routes are answered whole, as before.
|
|
77
|
+
- **`createJobControl({ queue, realtime: { pubsub, kv } })`** (`@plitzi/sdk-server/actions`): an operator's
|
|
78
|
+
`pause`/`resume`/`cancel`/`requeue` from a process that serves no pages — a Queue panel's API — each said on
|
|
79
|
+
`$job:<id>` through the page server's own pub/sub and retained store, so a watcher hears what an operator did.
|
|
80
|
+
- **A run's user carries no session** (`RunUser`): what a step, a function and a job see of who asked.
|
|
81
|
+
- **The builder shows the jobs** (`@plitzi/plitzi-builder`, `@plitzi/sdk-shared`): **Server → Functions** lists the
|
|
82
|
+
jobs the code declares as it is typed (how long each may run; one spread in or built by a call is counted, not
|
|
83
|
+
guessed), and the inspector of one says how it is started and who may watch it, with the space's runs of it — live
|
|
84
|
+
while one moves, progress and step as its code reported them — and **Pause**, **Resume**, **Cancel** and **Run
|
|
85
|
+
again**. Through two new builder operations, `SpaceJobs(kind, name, status, page, pageSize)` — a `SpaceJob` each:
|
|
86
|
+
what it runs, where it is and how far, never its input, state or result — and `SpaceControlJob(jobId, control)`
|
|
87
|
+
(`JobControlAction`). Beside them in `@plitzi/sdk-shared/actions`: `JOB_KINDS`/`isJobKind`, and `actionAccessOf`, the
|
|
88
|
+
one reading of a channel's access, which the functions' manifest now reads a job's `watch` with too.
|
|
89
|
+
|
|
90
|
+
- **`ctx.oauth.token` for an SDK in the page** (`@plitzi/sdk-server`, `@plitzi/sdk-shared`): Spotify's Web Playback,
|
|
91
|
+
Google's Picker and their kind ask the page for the access token themselves, and `ctx.oauth` kept every token on the
|
|
92
|
+
server. A connection that declares `exposeToken: true` now answers `ctx.oauth.token(name, { owner })` —
|
|
93
|
+
`{ token, type, expiresAt, scopes }`, renewed first when about to lapse — for a route of the code to hand to the
|
|
94
|
+
connection's owner. The refresh token never leaves; a connection without `exposeToken` refuses `token`, naming the
|
|
95
|
+
field. Through the sandbox's protocol and natively alike.
|
|
96
|
+
|
|
97
|
+
- **A page for some permissions, kept by the server** (`@plitzi/sdk-shared`, `@plitzi/sdk-server`,
|
|
98
|
+
`@plitzi/sdk-authoring`, `@plitzi/sdk-elements`, `@plitzi/plitzi-builder`): a page says
|
|
99
|
+
`access: { permissions: [...] }`, and a visitor without every one is answered 401 (or the page's sign-in redirect) or
|
|
100
|
+
403 with a refusal drawn in the page's layout. Its content is withheld from everything that visitor is sent — the
|
|
101
|
+
render, the hydration payload, the space document (and a document built for somebody with access is not handed to
|
|
102
|
+
somebody without it by its name) and the page's server data. The builder's page settings take the permissions;
|
|
103
|
+
authoring refuses an `access` the server could not keep (`page-access`). A space read back as code — `plitzi create
|
|
104
|
+
--from`, the Export — keeps each page's `access`, so a protected page is never exported open. A page's handle carries
|
|
105
|
+
its `access` too, and a project's `visual/home.spec.ts` leaves such a page to a test that signs in, as it does a page
|
|
106
|
+
behind a session (`plitzi upgrade` rewrites an untouched one).
|
|
107
|
+
- **A project's first plugin is picked up while it runs** (`@plitzi/sdk-server`): `start:dev` registers a plugin folder
|
|
108
|
+
added under `src/plugins/` and reloads the open pages — but only watched that folder when it existed at boot, so a
|
|
109
|
+
project with no plugin yet (one taken out of a space that had none) showed nothing of its first `plitzi plugin add`
|
|
110
|
+
until a restart. With no folder, the server waits for it to appear and takes what it holds then.
|
|
111
|
+
|
|
112
|
+
## Packaging
|
|
113
|
+
- **No package ships the declarations of its tests** (`@plitzi/sdk-server`, `@plitzi/sdk-mcp`, `@plitzi/plitzi-sdk`,
|
|
114
|
+
`@plitzi/plitzi-builder`, `@plitzi/sdk-elements`, `@plitzi/sdk-shared`): each app wrote its declarations with its own
|
|
115
|
+
`dts({ exclude })`, and the ones that left the tests out of it shipped a `.test.d.ts` beside their modules — 148 in
|
|
116
|
+
sdk-server alone — and the base config let a `.bench.d.ts` through. Every `dts()` now excludes
|
|
117
|
+
`'**/*.(test|bench).(ts|tsx)'`, and `yarn check:dist-exports` (CI, after `build:prod`) fails a build of any published
|
|
118
|
+
package that holds one.
|
|
119
|
+
- **`@plitzi/plitzi-builder` depends on `graphql` ^16** (was ^17): Apollo Server — the builder's API — supports only
|
|
120
|
+
16, so a host installing the builder beside it got two copies. The builder uses nothing of 17's.
|
|
121
|
+
|
|
122
|
+
## Elements
|
|
123
|
+
- **A dropdown closes when a link in it is chosen** (`@plitzi/sdk-elements`): a link stops its click from bubbling,
|
|
124
|
+
and the popup listened for clicks on the way up — so no menu of links ever closed, and a click that did reach it was
|
|
125
|
+
cancelled, which would have kept an external link from going anywhere. The popup now hears the click as it goes down
|
|
126
|
+
and lets it through.
|
|
127
|
+
|
|
128
|
+
## CLI
|
|
129
|
+
- **A refused push says why** (`@plitzi/cli`): `space push functions` and the data push read any 409 as "changed since
|
|
130
|
+
your pull" — and the platform also answers 409 when the space has no private bucket to keep its code or data in, so
|
|
131
|
+
a first push to a space with no storage sent its author to pull, which changed nothing. The CLI now names a conflict
|
|
132
|
+
only when the refusal says `version`, and prints the platform's own words otherwise (where to add the bucket).
|
|
133
|
+
- **`create` points at the Academy** (`@plitzi/cli`): its last lines name the docs' Academy,
|
|
134
|
+
`https://docs.plitzi.com/academy`, for whoever is new to Plitzi — and the README the docs themselves.
|
|
135
|
+
|
|
136
|
+
## Builder
|
|
137
|
+
- **A space served by Plitzi has a server, and the builder says so** (`@plitzi/plitzi-builder`, `@plitzi/sdk-shared`):
|
|
138
|
+
whether a space can run its actions and resolve its connectors was read off an SSR _credential_, which only a space
|
|
139
|
+
deployed to a page server of its own has — so every space served at `<space>.plitzi.app` showed "No server-rendered
|
|
140
|
+
deployment" over Server and counted its actions unavailable, while they ran. The deployments now carry what serves
|
|
141
|
+
them (`provider`), and a deployment served by SSR — Plitzi's or the space's — counts.
|
|
142
|
+
- **New Layout saves the layout** (`@plitzi/sdk-schema`): a layout is a root of the pages' tree, added with no anchor,
|
|
143
|
+
and `flatMapOf` found no tree for an empty anchor — so the server refused every new layout, saying it was "already
|
|
144
|
+
added". A root now goes into the pages' tree, and the refusal says which of the two it is.
|
|
145
|
+
- **Settings → Realtime: a space's channels, declared by hand** (`@plitzi/plitzi-builder`): `settings.channels` was
|
|
146
|
+
written only in code or by an agent over MCP, so a space made in the builder could not open a channel. The section
|
|
147
|
+
lists the channels with who may join (anyone, signed-in visitors, visitors with permissions), who may speak (pages, or
|
|
148
|
+
only the server's `Publish On Channel`), presence, a grant, keeping the last message and the two limits — saved only
|
|
149
|
+
when `channelProblems` passes, with what is wrong said under the channel otherwise.
|
|
150
|
+
|
|
151
|
+
- Updated dependencies [19fbc45]
|
|
152
|
+
- @plitzi/plitzi-sdk@0.38.21
|
|
153
|
+
- @plitzi/sdk-auth@0.38.21
|
|
154
|
+
- @plitzi/sdk-authoring@0.38.21
|
|
155
|
+
- @plitzi/sdk-dev-tools@0.38.21
|
|
156
|
+
- @plitzi/sdk-elements@0.38.21
|
|
157
|
+
- @plitzi/sdk-event-bridge@0.38.21
|
|
158
|
+
- @plitzi/sdk-interactions@0.38.21
|
|
159
|
+
- @plitzi/sdk-navigation@0.38.21
|
|
160
|
+
- @plitzi/sdk-plugins@0.38.21
|
|
161
|
+
- @plitzi/sdk-schema@0.38.21
|
|
162
|
+
- @plitzi/sdk-shared@0.38.21
|
|
163
|
+
- @plitzi/sdk-style@0.38.21
|
|
164
|
+
- @plitzi/sdk-variables@0.38.21
|
|
165
|
+
|
|
3
166
|
## 0.38.20
|
|
4
167
|
|
|
5
168
|
### Patch Changes
|
package/dist/index.html
CHANGED
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
webKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxIiwib3JpZ2lucyI6WyJodHRwczovL3dlYnNpdGUucGxpdHppLmFwcCIsImh0dHBzOi8vcGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsOjMwMDAiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWw6MzAwMSIsImh0dHBzOi8vc3NyLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vc2VydmVyLnBsaXR6aS5sb2NhbCIsImh0dHA6Ly9sb2NhbGhvc3Q6MzAwMCIsImh0dHA6Ly9sb2NhbGhvc3Q6ODA4MCIsImh0dHA6Ly8xMjcuMC4wLjE6ODA4MCIsImh0dHBzOi8vZGV2LnBsaXR6aS5jb20iLCJodHRwczovL3BsaXR6aS5jb20iLCJodHRwczovL3N0Zy5wbGl0emkuY29tIl0sImlzcyI6Imh0dHBzOi8vc2VydmVyLnBsaXR6aS5sb2NhbCIsImF1ZCI6WyJodHRwczovL3BsaXR6aS5sb2NhbCIsImh0dHBzOi8vYXBwLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vYXBwLnBsaXR6aS5sb2NhbDozMDAwIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsOjMwMDEiLCJodHRwczovL2FwaS5wbGl0emkubG9jYWwiLCJodHRwczovL3Nzci5wbGl0emkubG9jYWwiLCJodHRwczovL3NlcnZlci5wbGl0emkubG9jYWwiLCJodHRwczovL21jcC5wbGl0emkubG9jYWwiLCJodHRwczovL2F1dGgucGxpdHppLmxvY2FsIiwiaHR0cDovLzEyNy4wLjAuMTo1MzAwIiwiaHR0cDovL2xvY2FsaG9zdDo1MTgwIl0sInNjb3BlIjoic3BhY2U6cmVuZGVyIiwiaWF0IjoxNzkwMjEzMjg5LCJqdGkiOiJhZDgyN2EyMjliZjhlMzk3IiwibmJmIjoxNzkwMjEzMjg5fQ.dedpVVA5Nv3Xr7nEOZ8UmEJcIamF9AHGnLgqQyDV8-k',
|
|
54
54
|
// The actor. Without it the builder loads and every write is refused, since authorization is
|
|
55
55
|
// can(actor, space, permission). Both halves come from `yarn token 1 --user admin` in plitzi-sdk-server.
|
|
56
|
-
userKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
|
|
56
|
+
userKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxIiwiaXNzIjoiaHR0cHM6Ly9zZXJ2ZXIucGxpdHppLmxvY2FsIiwiYXVkIjpbImh0dHBzOi8vcGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsIiwiaHR0cHM6Ly9hcHAucGxpdHppLmxvY2FsOjMwMDAiLCJodHRwczovL2FwcC5wbGl0emkubG9jYWw6MzAwMSIsImh0dHBzOi8vYXBpLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vc3NyLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vc2VydmVyLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vbWNwLnBsaXR6aS5sb2NhbCIsImh0dHBzOi8vYXV0aC5wbGl0emkubG9jYWwiLCJodHRwOi8vMTI3LjAuMC4xOjUzMDAiLCJodHRwOi8vbG9jYWxob3N0OjUxODAiXSwic2NvcGUiOiJ1c2VyIiwiZXhwIjoxNzkyNDMxMTA1LCJpYXQiOjE3OTIzNDQ3MDUsImp0aSI6IjUwNjFmMmM3NDlhZTJlZTIiLCJuYmYiOjE3OTIzNDQ3MDV9.k_Ju7vY8JFIIZIQdU_H8CdeQ9kAp_Pb4yGhlNI2Ld_U',
|
|
57
57
|
environment: 'main',
|
|
58
58
|
functionsWorkerUrl: '/plitzi-functions-worker.js',
|
|
59
59
|
sdkIconsStylePath: '',
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/** The space's settings,
|
|
1
|
+
/** The space's settings, who may visit it — the roles it declares and who holds them — and its realtime channels. */
|
|
2
2
|
declare const ContainerSettings: () => import('react').JSX.Element;
|
|
3
3
|
export default ContainerSettings;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The space's realtime channels (`settings.channels`): the patterns its pages may open a channel on, who may join and
|
|
3
|
+
* speak on each, and what the server keeps of it.
|
|
4
|
+
*
|
|
5
|
+
* Saved as they are edited, and only when every channel is one the server accepts — `channelProblems`, the check
|
|
6
|
+
* authoring and the server make — so the document never holds a channel that would be refused: what is wrong is said
|
|
7
|
+
* under the channel until it is fixed.
|
|
8
|
+
*/
|
|
9
|
+
declare const Channels: () => import('react').JSX.Element;
|
|
10
|
+
export default Channels;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ChannelDraft } from '../../helpers';
|
|
2
|
+
export type ChannelCardProps = {
|
|
3
|
+
pattern: string;
|
|
4
|
+
draft: ChannelDraft;
|
|
5
|
+
problems?: string[];
|
|
6
|
+
onChange: (pattern: string, draft: ChannelDraft) => void;
|
|
7
|
+
onRemove: (pattern: string) => void;
|
|
8
|
+
};
|
|
9
|
+
/** One channel of the space: who may join it, who may speak on it, and what the server keeps of it. */
|
|
10
|
+
declare const ChannelCard: ({ pattern, draft, problems, onChange, onRemove }: ChannelCardProps) => import('react').JSX.Element;
|
|
11
|
+
export default ChannelCard;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ChannelDeclaration, ChannelDeclarations } from '@plitzi/sdk-shared';
|
|
2
|
+
export type ChannelAccessMode = ChannelDeclaration['access']['mode'];
|
|
3
|
+
/**
|
|
4
|
+
* One channel as its fields hold it while it is edited: the permissions and the limits as the text typed, so a comma or
|
|
5
|
+
* a digit being typed is never normalised away under the cursor.
|
|
6
|
+
*/
|
|
7
|
+
export type ChannelDraft = {
|
|
8
|
+
mode: ChannelAccessMode;
|
|
9
|
+
permissions: string;
|
|
10
|
+
publish: 'clients' | 'server';
|
|
11
|
+
presence: boolean;
|
|
12
|
+
grant: boolean;
|
|
13
|
+
retain: boolean;
|
|
14
|
+
maxMessageBytes: string;
|
|
15
|
+
messagesPerSecond: string;
|
|
16
|
+
};
|
|
17
|
+
/** What a channel added in the builder starts as: anybody joins, and pages speak directly. */
|
|
18
|
+
export declare const NEW_CHANNEL: ChannelDraft;
|
|
19
|
+
export declare const draftOf: (declaration: ChannelDeclaration) => ChannelDraft;
|
|
20
|
+
/** The channel a draft declares: only what differs from the defaults is written, as authoring writes it. */
|
|
21
|
+
export declare const declarationOf: (draft: ChannelDraft) => ChannelDeclaration;
|
|
22
|
+
export type CheckedChannels = {
|
|
23
|
+
ok: true;
|
|
24
|
+
channels: ChannelDeclarations;
|
|
25
|
+
} | {
|
|
26
|
+
ok: false;
|
|
27
|
+
problems: Record<string, string[]>;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The space's channels as the drafts declare them — or, when one would be refused, every problem of every channel, by
|
|
31
|
+
* its pattern: the server's and authoring's own check (`channelProblems`), so the builder never saves one they refuse.
|
|
32
|
+
*/
|
|
33
|
+
export declare const checkChannels: (drafts: Record<string, ChannelDraft>) => CheckedChannels;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Channels';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The space's own server code: its tasks and
|
|
2
|
+
* The space's own server code: its tasks, routes and jobs as the code declares them — listed as it is typed — its files,
|
|
3
3
|
* edited with TypeScript that knows the contract, and the selected task's time limit and test run beside them. Saved as
|
|
4
4
|
* the draft, built and checked on the platform; the live site runs what the space was last published with. A
|
|
5
5
|
* project's `plitzi functions pull` edits the same files.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NewTask as NewTaskSpec } from '../../editor/source';
|
|
2
|
-
import { ListedRoute, ListedTask } from '../../helpers';
|
|
2
|
+
import { ListedJob, ListedRoute, ListedTask } from '../../helpers';
|
|
3
3
|
import { FunctionTimeLimits } from '@plitzi/sdk-shared';
|
|
4
4
|
export type FunctionsSidebarProps = {
|
|
5
5
|
tasks: ListedTask[];
|
|
@@ -7,10 +7,14 @@ export type FunctionsSidebarProps = {
|
|
|
7
7
|
sharedLimits?: FunctionTimeLimits;
|
|
8
8
|
selectedTask: string;
|
|
9
9
|
/** Tasks the code builds by calling something: there, but only a save can say what they are. */
|
|
10
|
-
|
|
10
|
+
unreadableTasks: number;
|
|
11
11
|
/** Whether a new task can be written for you: the code has been read, and it calls `defineFunctions`. */
|
|
12
12
|
canCreateTask: boolean;
|
|
13
13
|
routes: ListedRoute[];
|
|
14
|
+
jobs: ListedJob[];
|
|
15
|
+
selectedJob: string;
|
|
16
|
+
/** Jobs the code builds by calling something, or spreads in: listed once saved. */
|
|
17
|
+
unreadableJobs: number;
|
|
14
18
|
files: string[];
|
|
15
19
|
selectedFile: string;
|
|
16
20
|
/** The files whose text differs from what was last saved. */
|
|
@@ -18,13 +22,14 @@ export type FunctionsSidebarProps = {
|
|
|
18
22
|
onSelectTask: (task: string) => void;
|
|
19
23
|
onCreateTask: (task: NewTaskSpec) => void;
|
|
20
24
|
onSelectRoute: (route: string) => void;
|
|
25
|
+
onSelectJob: (job: string) => void;
|
|
21
26
|
onSelectFile: (file: string) => void;
|
|
22
27
|
onAddFile: (file: string) => void;
|
|
23
28
|
onRemoveFile: (file: string) => void;
|
|
24
29
|
};
|
|
25
30
|
/**
|
|
26
31
|
* What the functions are, as the code declares them right now: the tasks a step can run — a click from the code and
|
|
27
|
-
* the inspector — the routes they answer at, and the files they are written in.
|
|
32
|
+
* the inspector — the routes they answer at, the jobs they start, and the files they are written in.
|
|
28
33
|
*/
|
|
29
|
-
declare const FunctionsSidebar: ({ tasks, sharedLimits, selectedTask,
|
|
34
|
+
declare const FunctionsSidebar: ({ tasks, sharedLimits, selectedTask, unreadableTasks, canCreateTask, routes, jobs, selectedJob, unreadableJobs, files, selectedFile, modified, onSelectTask, onCreateTask, onSelectRoute, onSelectJob, onSelectFile, onAddFile, onRemoveFile }: FunctionsSidebarProps) => import('react').JSX.Element;
|
|
30
35
|
export default FunctionsSidebar;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type JobItemProps = {
|
|
2
|
+
name: string;
|
|
3
|
+
/** How long it may run, every slice together — none when it runs as long as the plan allows. */
|
|
4
|
+
maxSeconds?: number;
|
|
5
|
+
selected: boolean;
|
|
6
|
+
/** Written, but not in the saved draft yet: nothing can start it until it is saved. */
|
|
7
|
+
unsaved: boolean;
|
|
8
|
+
onSelect: (job: string) => void;
|
|
9
|
+
};
|
|
10
|
+
/** One job in the list: its name, how long it may run, and whether a save has it yet. */
|
|
11
|
+
declare const JobItem: ({ name, maxSeconds, selected, unsaved, onSelect }: JobItemProps) => import('react').JSX.Element;
|
|
12
|
+
export default JobItem;
|
|
@@ -6,7 +6,7 @@ export type NewTaskProps = {
|
|
|
6
6
|
onCancel: () => void;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
|
-
* A new task, named where the list is: its namespace and action — what a step calls it, `
|
|
9
|
+
* A new task, named where the list is: its namespace and action — what a step calls it, `orders.sync` — and its title.
|
|
10
10
|
* Written into `defineFunctions` for you, with a `run` to start from.
|
|
11
11
|
*/
|
|
12
12
|
declare const NewTask: ({ namespace: usual, onCreate, onCancel }: NewTaskProps) => import('react').JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ListedJob } from '../../helpers';
|
|
2
|
+
export type JobInspectorProps = {
|
|
3
|
+
job: ListedJob;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* The selected job: how long it may run and who may watch it, as its code declares, and the space's runs of it — live
|
|
7
|
+
* while one moves, with the Queue's controls on each.
|
|
8
|
+
*/
|
|
9
|
+
declare const JobInspector: ({ job }: JobInspectorProps) => import('react').JSX.Element;
|
|
10
|
+
export default JobInspector;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JobControlAction, SpaceJob } from '@plitzi/sdk-shared';
|
|
2
|
+
export type JobRunProps = {
|
|
3
|
+
job: SpaceJob;
|
|
4
|
+
/** Answers why nothing changed, or nothing when it did. */
|
|
5
|
+
onControl: (jobId: string, action: JobControlAction) => Promise<string | undefined>;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* One run of a job: where it is, how far its code says it got, who started it, and the controls it takes now — each
|
|
9
|
+
* answered by the queue, and what changed nothing says why under it.
|
|
10
|
+
*/
|
|
11
|
+
declare const JobRun: ({ job, onControl }: JobRunProps) => import('react').JSX.Element;
|
|
12
|
+
export default JobRun;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FunctionTaskManifest, FunctionTimeLimits } from '@plitzi/sdk-shared';
|
|
1
|
+
import { FunctionJobManifest, FunctionTaskManifest, FunctionTimeLimits } from '@plitzi/sdk-shared';
|
|
2
2
|
import { VirtualTypeScriptEnvironment } from '@typescript/vfs';
|
|
3
3
|
/**
|
|
4
4
|
* The space's functions as their SOURCE declares them, read while they are written — what the panel lists and edits
|
|
@@ -22,17 +22,24 @@ export type SourceRoute = {
|
|
|
22
22
|
key: string;
|
|
23
23
|
at: SourcePlace;
|
|
24
24
|
};
|
|
25
|
+
/** A job as it is written: its name, how long it may run and who may watch it, when those are written as literals. */
|
|
26
|
+
export type SourceJob = FunctionJobManifest & {
|
|
27
|
+
name: string;
|
|
28
|
+
at: SourcePlace;
|
|
29
|
+
};
|
|
25
30
|
export type SourceFunctions = {
|
|
26
31
|
/** `index.ts` exports `defineFunctions(…)` — without it there is nothing declared to read. */
|
|
27
32
|
defined: boolean;
|
|
28
33
|
tasks: SourceTask[];
|
|
29
34
|
routes: SourceRoute[];
|
|
35
|
+
jobs: SourceJob[];
|
|
30
36
|
hosts: string[];
|
|
31
37
|
/** What every task and route asks for, unless one asks for its own. */
|
|
32
38
|
limits?: FunctionTimeLimits;
|
|
33
39
|
/** Entries that are there but cannot be read without running the code: what to look at, and where. */
|
|
34
40
|
unreadable: {
|
|
35
41
|
what: string;
|
|
42
|
+
of: 'tasks' | 'jobs';
|
|
36
43
|
at: SourcePlace;
|
|
37
44
|
}[];
|
|
38
45
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SourceFunctions, SourcePlace, SourceRoute } from './editor/source';
|
|
1
|
+
import { SourceFunctions, SourceJob, SourcePlace, SourceRoute } from './editor/source';
|
|
2
2
|
import { Text } from '@codemirror/state';
|
|
3
|
-
import { FunctionsManifest, FunctionsProblem, FunctionTaskManifest, FunctionTimeLimits } from '@plitzi/sdk-shared';
|
|
3
|
+
import { ActionAccess, FunctionsManifest, FunctionsProblem, FunctionTaskManifest, FunctionTimeLimits, JobControlAction, SpaceJob } from '@plitzi/sdk-shared';
|
|
4
4
|
/** What a space's functions start as: one file and one task already written, to change rather than to learn from blank. */
|
|
5
5
|
export declare const STARTER_FILES: Record<string, string>;
|
|
6
6
|
/** Where a problem is, as a person reads it: `lib/feed.ts:12:4`. */
|
|
@@ -11,7 +11,7 @@ export declare const readParams: (text: string) => {
|
|
|
11
11
|
} | {
|
|
12
12
|
error: string;
|
|
13
13
|
};
|
|
14
|
-
/** A task's name, as a step addresses it: `
|
|
14
|
+
/** A task's name, as a step addresses it: `orders.sync`. */
|
|
15
15
|
export declare const taskNameOf: (task: Pick<FunctionTaskManifest, "namespace" | "action">) => string;
|
|
16
16
|
/** What a Try starts from: each param at the value the task declared for it — what a new step would start from. */
|
|
17
17
|
export declare const paramDefaults: (task: FunctionTaskManifest | undefined) => Record<string, unknown>;
|
|
@@ -49,7 +49,7 @@ export type ListedTask = FunctionTaskManifest & {
|
|
|
49
49
|
export declare const listedTasks: (source: SourceFunctions | undefined, manifest: FunctionsManifest | null) => ListedTask[];
|
|
50
50
|
/** A time as the panel says it: milliseconds under a second, seconds from one. */
|
|
51
51
|
export declare const timeLabel: (ms: number) => string;
|
|
52
|
-
/** What a new task is called as a step: lowercase words joined by dashes — `
|
|
52
|
+
/** What a new task is called as a step: lowercase words joined by dashes — `orders`, `sync-week`. */
|
|
53
53
|
export declare const isTaskWord: (value: string) => boolean;
|
|
54
54
|
/** A step's title from its action, until somebody writes one: `feed-week` reads `Feed week`. */
|
|
55
55
|
export declare const titleFromAction: (action: string) => string;
|
|
@@ -90,5 +90,28 @@ export declare const lineRange: (doc: Text, line: number) => {
|
|
|
90
90
|
export declare const withCpu: (limits: FunctionTimeLimits | undefined, cpuMs: number | undefined) => FunctionTimeLimits;
|
|
91
91
|
/** Why the panel cannot write a task's limits for you right now, or nothing when it can. */
|
|
92
92
|
export declare const limitsBlockedBy: (ready: boolean, task: ListedTask) => string;
|
|
93
|
-
/** The task written around an offset of a file — the one the cursor is in — or none. */
|
|
94
|
-
export declare const
|
|
93
|
+
/** The task or job written around an offset of a file — the one the cursor is in — or none. */
|
|
94
|
+
export declare const writtenAt: <T extends {
|
|
95
|
+
at?: SourcePlace;
|
|
96
|
+
}>(entries: readonly T[], file: string, offset: number) => T | undefined;
|
|
97
|
+
/** A job as the panel lists it: what the source declares right now, where, and whether a save has it yet. */
|
|
98
|
+
export type ListedJob = Omit<SourceJob, 'at'> & {
|
|
99
|
+
at?: SourcePlace;
|
|
100
|
+
/** In the saved draft too: what the code can start. One only written so far is started once it is saved. */
|
|
101
|
+
saved: boolean;
|
|
102
|
+
};
|
|
103
|
+
/** The jobs to list: the source's as written — so the list follows the code — or, until it has been read, the last save's. */
|
|
104
|
+
export declare const listedJobs: (source: SourceFunctions | undefined, manifest: FunctionsManifest | null) => ListedJob[];
|
|
105
|
+
/** How many entries of the source cannot be listed without running it, in one of the sidebar's sections. */
|
|
106
|
+
export declare const unreadableIn: (source: SourceFunctions | undefined, of: "tasks" | "jobs") => number;
|
|
107
|
+
/** A length of time as the panel says it: `45 s`, `20 min`, `1 h 30 min`. */
|
|
108
|
+
export declare const durationLabel: (seconds: number) => string;
|
|
109
|
+
/** Who may watch a job besides whoever started it, as a sentence. */
|
|
110
|
+
export declare const watchLabel: (watch: ActionAccess | undefined) => string;
|
|
111
|
+
/**
|
|
112
|
+
* What can be done to a job as it is now — the Queue's own rules: set aside a job of the functions waiting or running,
|
|
113
|
+
* put back one set aside, stop one not finished, run a finished one again.
|
|
114
|
+
*/
|
|
115
|
+
export declare const jobControlsOf: (job: SpaceJob) => JobControlAction[];
|
|
116
|
+
/** Whether a job may still move by itself: what the panel keeps reading while it shows one. */
|
|
117
|
+
export declare const isJobMoving: (job: SpaceJob) => boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { JobControlAction, SpaceJob } from '@plitzi/sdk-shared';
|
|
2
|
+
/**
|
|
3
|
+
* The space's runs of one of its functions' jobs, newest first — read again every few seconds while one may still move —
|
|
4
|
+
* and the Queue's controls over each, through the same operations the dashboard's Queue reaches over REST.
|
|
5
|
+
*/
|
|
6
|
+
declare const useJobs: (name: string) => {
|
|
7
|
+
jobs: SpaceJob[];
|
|
8
|
+
total: number;
|
|
9
|
+
error: string;
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
control: (jobId: string, action: JobControlAction) => Promise<string | undefined>;
|
|
12
|
+
};
|
|
13
|
+
export default useJobs;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SpaceDeployment } from '@plitzi/sdk-shared';
|
|
2
|
+
/**
|
|
3
|
+
* Whether the space has a page server to run its actions and resolve its connectors: a deployment served by SSR — the
|
|
4
|
+
* platform's own (`provider: 'ssr'`, no credential: every `<space>.plitzi.app`) or the space's (an SSR credential).
|
|
5
|
+
*
|
|
6
|
+
* Unknown counts as yes: the deployments arrive a moment after the panels do, and a space that is correctly set up should
|
|
7
|
+
* not flash a warning telling its owner it is broken. A late warning beats a wrong one.
|
|
8
|
+
*/
|
|
9
|
+
/** What it reads of a deployment: what serves it, and the provider of its credential when it has one. */
|
|
10
|
+
type Served = {
|
|
11
|
+
provider: SpaceDeployment['provider'];
|
|
12
|
+
credential: {
|
|
13
|
+
provider: string;
|
|
14
|
+
} | null;
|
|
15
|
+
};
|
|
16
|
+
declare const hasServerRendering: (deployments: readonly Served[] | undefined) => boolean;
|
|
17
|
+
export default hasServerRendering;
|
package/dist/package.json.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
"name": "@plitzi/plitzi-builder",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.22",
|
|
4
4
|
"homepage": "./",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"files": [
|
|
@@ -52,7 +52,7 @@ declare const _default: {
|
|
|
52
52
|
"apollo-upload-client": "^20.0.0",
|
|
53
53
|
"clsx": "^2.1.1",
|
|
54
54
|
"comlink": "^4.4.2",
|
|
55
|
-
"graphql": "^
|
|
55
|
+
"graphql": "^16.14.2",
|
|
56
56
|
"graphql-ws": "^6.4.1",
|
|
57
57
|
"immer": "^11.1.21",
|
|
58
58
|
"jszip": "^3.10.2",
|