@milesroxas/design-hub 0.10.0 → 0.11.1
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/README.md +13 -11
- package/core/files.test.ts +76 -0
- package/core/files.ts +131 -0
- package/core/prototype.test.ts +124 -7
- package/core/prototype.ts +133 -24
- package/core/review/model.ts +119 -2
- package/core/review/policy.test.ts +79 -22
- package/core/review/policy.ts +36 -8
- package/core/review/service.test.ts +1464 -340
- package/core/review/service.ts +777 -191
- package/core/review/store.test.ts +91 -0
- package/core/review/store.ts +143 -33
- package/dist/core/files.d.ts +39 -0
- package/dist/core/files.js +107 -0
- package/dist/core/prototype.d.ts +61 -12
- package/dist/core/prototype.js +105 -26
- package/dist/core/review/model.d.ts +76 -2
- package/dist/core/review/model.js +76 -1
- package/dist/core/review/policy.d.ts +11 -4
- package/dist/core/review/policy.js +14 -2
- package/dist/core/review/service.d.ts +197 -45
- package/dist/core/review/service.js +702 -192
- package/dist/core/review/store.d.ts +84 -31
- package/dist/core/review/store.js +66 -33
- package/dist/scripts/bootstrap.d.ts +4 -34
- package/dist/scripts/bootstrap.js +9 -244
- package/dist/scripts/cli.js +6 -0
- package/dist/scripts/client.d.ts +45 -0
- package/dist/scripts/client.js +320 -0
- package/dist/scripts/commands.js +6 -0
- package/dist/scripts/comments.d.ts +8 -26
- package/dist/scripts/comments.js +27 -14
- package/dist/scripts/lib/builds.d.ts +40 -0
- package/dist/scripts/lib/builds.js +198 -0
- package/dist/scripts/lib/cli.js +3 -1
- package/dist/scripts/lib/deploy.d.ts +6 -90
- package/dist/scripts/lib/deploy.js +24 -137
- package/dist/scripts/lib/dns.d.ts +49 -0
- package/dist/scripts/lib/dns.js +141 -0
- package/dist/scripts/lib/fake-host.d.ts +168 -0
- package/dist/scripts/lib/fake-host.js +244 -0
- package/dist/scripts/lib/host.d.ts +87 -0
- package/dist/scripts/lib/host.js +362 -0
- package/dist/scripts/lib/linked.d.ts +51 -0
- package/dist/scripts/lib/linked.js +124 -0
- package/dist/scripts/lib/names.d.ts +35 -0
- package/dist/scripts/lib/names.js +77 -0
- package/dist/scripts/lib/review.d.ts +23 -2
- package/dist/scripts/lib/review.js +32 -15
- package/dist/scripts/lib/studio-deps.d.ts +35 -0
- package/dist/scripts/lib/studio-deps.js +79 -0
- package/dist/scripts/lib/studios.d.ts +70 -0
- package/dist/scripts/lib/studios.js +187 -0
- package/dist/scripts/lib/update.d.ts +33 -0
- package/dist/scripts/lib/update.js +40 -0
- package/dist/scripts/lib/vercel.d.ts +1 -23
- package/dist/scripts/lib/vercel.js +6 -81
- package/dist/scripts/people.d.ts +7 -11
- package/dist/scripts/people.js +51 -46
- package/dist/scripts/preflight.d.ts +8 -1
- package/dist/scripts/preflight.js +36 -19
- package/dist/scripts/project.d.ts +86 -0
- package/dist/scripts/project.js +141 -0
- package/dist/scripts/share.d.ts +105 -30
- package/dist/scripts/share.js +82 -154
- package/dist/scripts/skills.d.ts +18 -2
- package/dist/scripts/skills.js +22 -3
- package/dist/scripts/studio.d.ts +75 -0
- package/dist/scripts/studio.js +401 -0
- package/dist/scripts/upgrade.d.ts +10 -2
- package/dist/scripts/upgrade.js +44 -14
- package/dist/server/api.d.ts +22 -11
- package/dist/server/api.js +116 -47
- package/dist/server/blob.d.ts +10 -0
- package/dist/server/blob.js +53 -0
- package/dist/server/checks.js +2 -2
- package/dist/server/dev.js +4 -4
- package/dist/server/env.d.ts +2 -0
- package/dist/server/env.js +9 -0
- package/dist/server/fake-upstash.js +52 -3
- package/dist/server/hosts.d.ts +11 -0
- package/dist/server/hosts.js +31 -0
- package/dist/server/local.d.ts +7 -1
- package/dist/server/local.js +10 -1
- package/dist/server/mark.d.ts +41 -0
- package/dist/server/mark.js +111 -0
- package/dist/server/session.d.ts +17 -9
- package/dist/server/session.js +22 -45
- package/dist/server/upstash.js +20 -0
- package/dist/vercel/files.d.ts +11 -0
- package/dist/vercel/files.js +68 -0
- package/dist/vercel/index.d.ts +4 -3
- package/dist/vercel/index.js +12 -8
- package/dist/vercel/proxy.d.ts +69 -4
- package/dist/vercel/proxy.js +171 -107
- package/dist/vite/plugin.d.ts +24 -1
- package/dist/vite/plugin.js +46 -2
- package/kit/dials.tsx +2 -2
- package/package.json +2 -1
- package/shell/Guide.tsx +11 -5
- package/shell/Index.tsx +32 -10
- package/shell/Notice.tsx +1 -1
- package/shell/controls.ts +1 -1
- package/shell/hub.ts +5 -1
- package/shell/main.tsx +18 -3
- package/shell/review/Review.tsx +6 -4
- package/shell/review/ThreadCard.tsx +20 -7
- package/shell/review/client.ts +42 -14
- package/shell/review/view.test.ts +19 -0
- package/shell/review/view.ts +25 -0
- package/shell/shell.css +4 -0
- package/shell/studio/ClientHub.tsx +98 -0
- package/shell/studio/hub.css +48 -0
- package/shell/studio/index.html +14 -0
- package/shell/studio/main.tsx +17 -0
- package/skills/miles-deploy/SKILL.md +120 -65
- package/skills/miles-design-hub/SKILL.md +11 -9
- package/skills/miles-review/SKILL.md +5 -7
- package/skills/miles-worktrees/SKILL.md +3 -3
- package/templates/conductor/settings.toml +1 -1
- package/templates/studio/.env.example +9 -0
- package/templates/studio/.vercelignore +5 -0
- package/templates/studio/README.md +84 -0
- package/templates/studio/_gitignore +7 -0
- package/templates/studio/api/files.ts +4 -0
- package/templates/studio/api/review.ts +4 -0
- package/templates/studio/build.mjs +4 -0
- package/templates/studio/package.json +16 -0
- package/templates/studio/proxy.ts +4 -0
- package/templates/studio/studio.json +9 -0
- package/templates/studio/vercel.json +27 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ControlKind, type Marks } from '../controls.ts';
|
|
2
|
-
import { type Access, type Audience, type Comment, type Person, type PersonKind, type Triage } from './model.ts';
|
|
2
|
+
import { type Access, type Audience, type Client, type Comment, type Person, type PersonKind, type Project, type Scope, type Triage } from './model.ts';
|
|
3
3
|
import { type KV } from './store.ts';
|
|
4
4
|
export type ErrorCode = 'unauthorized' | 'forbidden' | 'not_found' | 'invalid';
|
|
5
5
|
export declare class ReviewError extends Error {
|
|
@@ -20,80 +20,227 @@ export type Deps = {
|
|
|
20
20
|
random: (bytes: number) => Uint8Array;
|
|
21
21
|
triage: Triager | null;
|
|
22
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* How long a slug or host stays out of reach after its client is archived:
|
|
25
|
+
* twice the time a studio site's instance keeps a host's answer. An instance
|
|
26
|
+
* that cached the archived client's record keeps accepting that client's
|
|
27
|
+
* fresh tokens until its answer runs out; if the slug came back sooner, it
|
|
28
|
+
* would show them the new client's projects.
|
|
29
|
+
*/
|
|
30
|
+
export declare const REUSE_SECONDS: number;
|
|
31
|
+
/** A started build of a project: the order it was started in, and whether the project ever pointed at it. */
|
|
32
|
+
type BuildEntry = {
|
|
33
|
+
n: number;
|
|
34
|
+
live: boolean;
|
|
35
|
+
};
|
|
36
|
+
export type Build = BuildEntry & {
|
|
37
|
+
build: string;
|
|
38
|
+
};
|
|
39
|
+
/** What an archive answers: the archived record, and whether its host is the client's own to take off the site. */
|
|
40
|
+
export type Archived = {
|
|
41
|
+
client: Client;
|
|
42
|
+
ownHost: boolean;
|
|
43
|
+
};
|
|
44
|
+
export declare const NO_PROJECT = "No such project.";
|
|
45
|
+
/** A person and a new one-time link's token for them. */
|
|
46
|
+
type Issued = {
|
|
47
|
+
person: Person;
|
|
48
|
+
token: string;
|
|
49
|
+
};
|
|
23
50
|
export declare function createReview(kv: KV, overrides?: Partial<Deps>): {
|
|
24
|
-
person: (id: string) => Promise<Person | null>;
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
51
|
+
person: (scope: Scope, id: string) => Promise<Person | null>;
|
|
52
|
+
/**
|
|
53
|
+
* The client a host serves, asked by the gate and the studio's functions
|
|
54
|
+
* with no actor: null for a host no client has, an archived client, or
|
|
55
|
+
* records that disagree, so an unknown host is never a scope.
|
|
56
|
+
*/
|
|
57
|
+
clientOfHost(host: string): Promise<Client | null>;
|
|
58
|
+
/** One project of the scope's client, asked with no actor: null when the client has none by that name. */
|
|
59
|
+
projectOf: ({ client, project }: Scope) => Promise<Project | null>;
|
|
60
|
+
/** Every project of the scope's client that has a build to open, by name. */
|
|
61
|
+
listProjects(scope: Scope, actor: Person | null): Promise<Project[]>;
|
|
62
|
+
/**
|
|
63
|
+
* A new client and its host. Studio only. The slug and the host are each
|
|
64
|
+
* claimed (`claims` in store.ts), so of two adds at once only one gets
|
|
65
|
+
* either, and a slug or a host already taken is refused. The record goes
|
|
66
|
+
* in between the two claims, so a host's claim is only ever held while a
|
|
67
|
+
* record names the host: an add that stops part way leaves a record that
|
|
68
|
+
* `archiveClient` and `forgetClient` find, and so free. A slug or host
|
|
69
|
+
* archived less than REUSE_SECONDS ago is refused, with how long to wait.
|
|
70
|
+
* Once the slug is claimed, everything stored under the slug's prefix is
|
|
71
|
+
* removed before the record goes in, so the client starts clean whatever
|
|
72
|
+
* was written under the slug before, and whether or not a record named it.
|
|
73
|
+
*/
|
|
74
|
+
addClient(actor: Person | null, input: unknown): Promise<Client>;
|
|
75
|
+
/**
|
|
76
|
+
* How many seconds until this slug and host may be added again: 0 when
|
|
77
|
+
* neither was archived in the last REUSE_SECONDS. `client add` asks
|
|
78
|
+
* before it changes any DNS or domain. Studio only.
|
|
79
|
+
*/
|
|
80
|
+
clientWait(actor: Person | null, input: {
|
|
81
|
+
slug: string;
|
|
82
|
+
host: string;
|
|
83
|
+
}): Promise<number>;
|
|
84
|
+
/**
|
|
85
|
+
* A new host proof for the scope's client, in place of any before it:
|
|
86
|
+
* `ask` goes to the client's host and `answer` must come back, which only
|
|
87
|
+
* the gate with this store can give (PROOF_PATH). The store keeps the ask
|
|
88
|
+
* as its hash, so a leaked store answers nothing. Studio only.
|
|
89
|
+
*/
|
|
90
|
+
startProof(scope: Scope, actor: Person | null): Promise<{
|
|
91
|
+
ask: string;
|
|
92
|
+
answer: string;
|
|
32
93
|
}>;
|
|
33
|
-
/**
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Ends the scope's client's host proof, once its host has answered it,
|
|
96
|
+
* and marks the client proven: it has finished being added (isAdded).
|
|
97
|
+
* The mark goes on first, so a run stopped between the two leaves a
|
|
98
|
+
* proven client with a stale proof, which answers nothing anyone holds.
|
|
99
|
+
* Studio only.
|
|
100
|
+
*/
|
|
101
|
+
endProof(scope: Scope, actor: Person | null): Promise<Client>;
|
|
102
|
+
/** The answer to a host proof's ask in the scope's client, asked by the gate with no actor: null for any other ask. */
|
|
103
|
+
proofAnswer(scope: Scope, ask: string): Promise<string | null>;
|
|
104
|
+
/** The scope's client record. Studio only. */
|
|
105
|
+
clientRecord(scope: Scope, actor: Person | null): Promise<Client>;
|
|
106
|
+
/** Sets how long the scope's client's new people keep access by default; null leaves it to the studio's. Studio only. */
|
|
107
|
+
setClientAccess(scope: Scope, actor: Person | null, access: unknown): Promise<Client>;
|
|
108
|
+
/**
|
|
109
|
+
* Archives the scope's client, the first of two steps: its record is
|
|
110
|
+
* marked archived, so its host stops serving at once (clientOfHost), then
|
|
111
|
+
* its host entry, then everything under its prefix (people, links,
|
|
112
|
+
* projects, each project's records, and any key no record names). The record stays, naming the host, until
|
|
113
|
+
* forgetClient, so `client archive` stopped part way and run again still
|
|
114
|
+
* knows the host to take off the site. Answers the record, and whether
|
|
115
|
+
* the host is the client's own to take off: not when another client
|
|
116
|
+
* serves it or a live client's record names it. null when there is no
|
|
117
|
+
* record. Safe to run again. The client's files are the caller's to
|
|
118
|
+
* remove (the files port). Studio only.
|
|
119
|
+
*/
|
|
120
|
+
archiveClient(scope: Scope, actor: Person | null): Promise<Archived | null>;
|
|
121
|
+
/**
|
|
122
|
+
* The second step, once the caller has removed the client's files, DNS
|
|
123
|
+
* record and domain: its keys once more (anything written meanwhile),
|
|
124
|
+
* then the time on its slug and host (`held`), then the host's claim
|
|
125
|
+
* unless another client holds it, then its record, then the slug's claim.
|
|
126
|
+
* With no record, it frees the slug alone: an add that stopped before its
|
|
127
|
+
* record held no host. Refused while the client is not archived. Studio only.
|
|
128
|
+
*/
|
|
129
|
+
forgetClient(scope: Scope, actor: Person | null): Promise<void>;
|
|
130
|
+
/** A new project of the scope's client, with no build yet. Studio only. */
|
|
131
|
+
addProject(scope: Scope, actor: Person | null, input: unknown): Promise<Project>;
|
|
132
|
+
/**
|
|
133
|
+
* Starts a build of the scope's project, before any of its files go up:
|
|
134
|
+
* it takes the next number in the project's own order of builds, from
|
|
135
|
+
* the store, never a clock. Only a started build can go live, and setBuild
|
|
136
|
+
* refuses one while a build started after it is live. A build started for
|
|
137
|
+
* a project that was archived and made again was started for none of
|
|
138
|
+
* the new one's. Studio only.
|
|
139
|
+
*/
|
|
140
|
+
startBuild(scope: Scope, actor: Person | null, build: unknown): Promise<void>;
|
|
141
|
+
/**
|
|
142
|
+
* Points the scope's project at a build. The caller has checked that
|
|
143
|
+
* every file of it is in the file store. Refused for a build never
|
|
144
|
+
* started for this project, or one started before the build the pointer
|
|
145
|
+
* names when this call reads it: a share overtaken by a newer one does
|
|
146
|
+
* not take the project back, which is what lets pruning remove the
|
|
147
|
+
* builds before the live one. The check reads and then writes, with no
|
|
148
|
+
* lock, so of two calls for one project within the same few store calls
|
|
149
|
+
* both can pass and the older build's write can land last; and a build
|
|
150
|
+
* pruned meanwhile, not yet marked live, is still pointed at, with no
|
|
151
|
+
* files. The next share's call puts either right. The build is marked
|
|
152
|
+
* live before the pointer moves. Studio only.
|
|
153
|
+
*/
|
|
154
|
+
setBuild(scope: Scope, actor: Person | null, build: unknown): Promise<Project>;
|
|
155
|
+
/** The scope's project's live build and every build started for it, in the order they were started. Studio only. */
|
|
156
|
+
buildsOf(scope: Scope, actor: Person | null): Promise<{
|
|
157
|
+
live: string | null;
|
|
158
|
+
builds: Build[];
|
|
37
159
|
}>;
|
|
160
|
+
/** Forgets builds of the scope's project, once their files are gone; never the live one. Studio only. */
|
|
161
|
+
forgetBuilds(scope: Scope, actor: Person | null, builds: string[]): Promise<void>;
|
|
162
|
+
/** The person a signed session names, if they still may sign in with it, here. */
|
|
163
|
+
sessionPerson(scope: Scope, id: string, epoch: number): Promise<Person | null>;
|
|
164
|
+
/** The scope's Clients and every Studio person. */
|
|
165
|
+
listPeople(scope: Scope, actor: Person | null): Promise<Person[]>;
|
|
166
|
+
/**
|
|
167
|
+
* A new person and their first link: a Client of the scope's client, or a
|
|
168
|
+
* Studio person. Without an access length, a Client gets the default and
|
|
169
|
+
* Studio is open-ended.
|
|
170
|
+
*/
|
|
171
|
+
addPerson(scope: Scope, actor: Person | null, input: unknown): Promise<Issued>;
|
|
172
|
+
/** Another one-time link, for another device. Their sessions and other unused links stay. */
|
|
173
|
+
newLink(scope: Scope, actor: Person | null, id: string): Promise<Issued>;
|
|
38
174
|
/** Ends every session they hold and every unused link, and gives one new link. */
|
|
39
|
-
signOutEverywhere(actor: Person | null, id: string): Promise<
|
|
40
|
-
|
|
41
|
-
token: string;
|
|
42
|
-
}>;
|
|
43
|
-
revoke(actor: Person | null, id: string): Promise<Person>;
|
|
175
|
+
signOutEverywhere(scope: Scope, actor: Person | null, id: string): Promise<Issued>;
|
|
176
|
+
revoke(scope: Scope, actor: Person | null, id: string): Promise<Person>;
|
|
44
177
|
/** Sets one person's access length, counted from now. Their sessions follow at the gate's next check, within five minutes. */
|
|
45
|
-
setAccess(actor: Person | null, id: string, access: unknown): Promise<Person>;
|
|
46
|
-
/** How long a new Client keeps access unless Studio says otherwise. */
|
|
47
|
-
defaultAccess(actor: Person | null): Promise<Access>;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
178
|
+
setAccess(scope: Scope, actor: Person | null, id: string, access: unknown): Promise<Person>;
|
|
179
|
+
/** How long a new Client of the scope's client keeps access unless Studio says otherwise: the client's default, else the studio's. */
|
|
180
|
+
defaultAccess(scope: Scope, actor: Person | null): Promise<Access>;
|
|
181
|
+
/**
|
|
182
|
+
* Sets what defaultAccess reads for the scope: the client's own default
|
|
183
|
+
* on a studio site's client host, the studio's in the local store, whose
|
|
184
|
+
* client has no record. Never the studio's for a client whose record is
|
|
185
|
+
* gone. Studio only.
|
|
186
|
+
*/
|
|
187
|
+
setDefaultAccess(scope: Scope, actor: Person | null, access: unknown): Promise<Access>;
|
|
188
|
+
/** A new Studio person, who works in every client. No link: each comes from newStudioLink, for one host. Studio only. */
|
|
189
|
+
addStudioPerson(actor: Person | null, input: unknown): Promise<Person>;
|
|
190
|
+
/** Another one-time link for a Studio person: it signs in one device, on whichever client host it is opened. Studio only. */
|
|
191
|
+
newStudioLink(actor: Person | null, id: string): Promise<Issued>;
|
|
192
|
+
/** The studio's default access length, what a client without its own gives. Studio only. */
|
|
193
|
+
studioAccess(actor: Person | null): Promise<Access>;
|
|
194
|
+
setStudioAccess(actor: Person | null, access: unknown): Promise<Access>;
|
|
195
|
+
/** Who a link signs in here, without using it: mail and chat previews open links too. */
|
|
196
|
+
peekLink(scope: Scope, token: string): Promise<Person | null>;
|
|
51
197
|
/**
|
|
52
198
|
* Uses a link up and returns who it signs in. The delete is the claim: of
|
|
53
199
|
* two requests with one token, only the one whose delete removed the link
|
|
54
200
|
* gets a person, so a link signs in one device at most. Who it signs in is
|
|
55
|
-
* read and checked first, so the delete is the last store call.
|
|
201
|
+
* read and checked first, so the delete is the last store call. Only a
|
|
202
|
+
* link of the scope's client, or a Studio person's, is found at all.
|
|
56
203
|
*/
|
|
57
|
-
useLink(token: string): Promise<Person | null>;
|
|
204
|
+
useLink(scope: Scope, token: string): Promise<Person | null>;
|
|
58
205
|
/**
|
|
59
206
|
* A prototype's comments as the actor's view sees them. `viewAs: 'client'`
|
|
60
207
|
* is Studio's Client view; it never widens a Client's.
|
|
61
208
|
*/
|
|
62
|
-
listComments(actor: Person | null, prototype: string, viewAs?: unknown): Promise<Comment[]>;
|
|
63
|
-
/** Every comment on every prototype the actor may see, for the CLI (which acts as Studio). */
|
|
64
|
-
allComments(actor: Person | null): Promise<Comment[]>;
|
|
209
|
+
listComments(scope: Scope, actor: Person | null, prototype: string, viewAs?: unknown): Promise<Comment[]>;
|
|
210
|
+
/** Every comment on every prototype of the scope's project the actor may see, for the CLI (which acts as Studio). */
|
|
211
|
+
allComments(scope: Scope, actor: Person | null): Promise<Comment[]>;
|
|
65
212
|
/**
|
|
66
213
|
* A new thread. A Client's is client-facing whatever the input says;
|
|
67
214
|
* Studio's is internal unless `audience` is 'client'. Its number is the
|
|
68
215
|
* next of its audience on the prototype, never one used before.
|
|
69
216
|
*/
|
|
70
|
-
add(actor: Person | null, input: {
|
|
217
|
+
add(scope: Scope, actor: Person | null, input: {
|
|
71
218
|
body?: unknown;
|
|
72
219
|
anchor?: unknown;
|
|
73
220
|
states?: unknown;
|
|
74
221
|
audience?: unknown;
|
|
75
222
|
}): Promise<Comment>;
|
|
76
|
-
reply(actor: Person | null, input: {
|
|
223
|
+
reply(scope: Scope, actor: Person | null, input: {
|
|
77
224
|
prototype: string;
|
|
78
225
|
thread: string;
|
|
79
226
|
body?: unknown;
|
|
80
227
|
}): Promise<Comment>;
|
|
81
|
-
edit(actor: Person | null, input: {
|
|
228
|
+
edit(scope: Scope, actor: Person | null, input: {
|
|
82
229
|
prototype: string;
|
|
83
230
|
id: string;
|
|
84
231
|
body?: unknown;
|
|
85
232
|
}): Promise<Comment>;
|
|
86
233
|
/** Deletes a comment; deleting a thread's root deletes its replies with it. */
|
|
87
|
-
remove(actor: Person | null, input: {
|
|
234
|
+
remove(scope: Scope, actor: Person | null, input: {
|
|
88
235
|
prototype: string;
|
|
89
236
|
id: string;
|
|
90
237
|
}): Promise<string[]>;
|
|
91
|
-
resolve(actor: Person | null, input: {
|
|
238
|
+
resolve(scope: Scope, actor: Person | null, input: {
|
|
92
239
|
prototype: string;
|
|
93
240
|
id: string;
|
|
94
241
|
resolved: boolean;
|
|
95
242
|
}): Promise<Comment>;
|
|
96
|
-
retriage(actor: Person | null, input: {
|
|
243
|
+
retriage(scope: Scope, actor: Person | null, input: {
|
|
97
244
|
prototype: string;
|
|
98
245
|
id: string;
|
|
99
246
|
triage?: unknown;
|
|
@@ -104,7 +251,7 @@ export declare function createReview(kv: KV, overrides?: Partial<Deps>): {
|
|
|
104
251
|
* stored, so internal deletes the field and a prototype nobody marked is
|
|
105
252
|
* internal. Studio only.
|
|
106
253
|
*/
|
|
107
|
-
setAudience(actor: Person | null, prototype: unknown, audience: unknown): Promise<Audience>;
|
|
254
|
+
setAudience(scope: Scope, actor: Person | null, prototype: unknown, audience: unknown): Promise<Audience>;
|
|
108
255
|
/**
|
|
109
256
|
* What Studio marked on a prototype's dials and variants, with the view
|
|
110
257
|
* the actor gets. A Client reads the marks too: their page needs a dial
|
|
@@ -112,7 +259,7 @@ export declare function createReview(kv: KV, overrides?: Partial<Deps>): {
|
|
|
112
259
|
* names are in the prototype's own code already. An internal prototype
|
|
113
260
|
* has none for a Client, as it has no comments.
|
|
114
261
|
*/
|
|
115
|
-
controlsOf(actor: Person | null, prototype: unknown): Promise<{
|
|
262
|
+
controlsOf(scope: Scope, actor: Person | null, prototype: unknown): Promise<{
|
|
116
263
|
view: PersonKind;
|
|
117
264
|
} & Marks>;
|
|
118
265
|
/**
|
|
@@ -121,7 +268,7 @@ export declare function createReview(kv: KV, overrides?: Partial<Deps>): {
|
|
|
121
268
|
* variant's internal is the field's absence. Studio only. The server
|
|
122
269
|
* keeps no list of a prototype's controls, so any well-formed id is taken.
|
|
123
270
|
*/
|
|
124
|
-
setControl(actor: Person | null, input: {
|
|
271
|
+
setControl(scope: Scope, actor: Person | null, input: {
|
|
125
272
|
prototype: unknown;
|
|
126
273
|
kind: unknown;
|
|
127
274
|
id: unknown;
|
|
@@ -132,25 +279,30 @@ export declare function createReview(kv: KV, overrides?: Partial<Deps>): {
|
|
|
132
279
|
audience: Audience;
|
|
133
280
|
}>;
|
|
134
281
|
/**
|
|
135
|
-
* Who a prototype is for, asked by the gate with no
|
|
136
|
-
* value but `client`, is internal; a name that
|
|
137
|
-
* internal without asking the store.
|
|
282
|
+
* Who a prototype of the scope's project is for, asked by the gate with no
|
|
283
|
+
* actor. Absent, or any value but `client`, is internal; a name that
|
|
284
|
+
* cannot be a prototype is internal without asking the store.
|
|
138
285
|
*/
|
|
139
|
-
audienceOf(prototype: string): Promise<Audience>;
|
|
286
|
+
audienceOf(scope: Scope, prototype: string): Promise<Audience>;
|
|
140
287
|
/**
|
|
141
288
|
* What the index is built from: the view the actor gets (Client view for
|
|
142
289
|
* Studio with `viewAs: 'client'`) and every client-facing slug. The
|
|
143
290
|
* server keeps no list of internal ones: Studio's view reads the build's
|
|
144
291
|
* own list, which the gate refuses to a Client.
|
|
145
292
|
*/
|
|
146
|
-
visiblePrototypes(actor: Person | null, viewAs?: unknown): Promise<{
|
|
293
|
+
visiblePrototypes(scope: Scope, actor: Person | null, viewAs?: unknown): Promise<{
|
|
147
294
|
view: PersonKind;
|
|
148
295
|
clientFacing: string[];
|
|
149
296
|
}>;
|
|
150
|
-
/**
|
|
151
|
-
|
|
297
|
+
/**
|
|
298
|
+
* Where a comment lives, for the CLI, which has an id and no prototype;
|
|
299
|
+
* null when the actor may not see it, and outside the actor's scope or in
|
|
300
|
+
* a client that is not live, as for an id that is not there.
|
|
301
|
+
*/
|
|
302
|
+
locate(scope: Scope, actor: Person | null, id: string): Promise<{
|
|
152
303
|
prototype: string;
|
|
153
304
|
comment: Comment;
|
|
154
305
|
} | null>;
|
|
155
306
|
};
|
|
156
307
|
export type Review = ReturnType<typeof createReview>;
|
|
308
|
+
export {};
|