@mulmoclaude/core 3.5.0 → 3.7.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/assets/helps/collection-skills.md +49 -1
- package/assets/helps/error-recovery.md +53 -0
- package/dist/calendarGrid-CQ8MVSRb.js.map +1 -1
- package/dist/calendarGrid-DGILaVxI.cjs.map +1 -1
- package/dist/collection/core/schema.d.ts +8 -1
- package/dist/collection/core/schemaZ.d.ts +36 -26
- package/dist/collection/firestore.cjs +51 -0
- package/dist/collection/firestore.cjs.map +1 -0
- package/dist/collection/firestore.d.ts +1 -0
- package/dist/collection/firestore.js +50 -0
- package/dist/collection/firestore.js.map +1 -0
- package/dist/collection/registry/server/index.cjs +19 -19
- package/dist/collection/registry/server/index.cjs.map +1 -1
- package/dist/collection/registry/server/index.js +2 -2
- package/dist/collection/server/appManifest.d.ts +53 -0
- package/dist/collection/server/delete.d.ts +10 -0
- package/dist/collection/server/discoveredCollection.d.ts +10 -0
- package/dist/collection/server/discovery.d.ts +1 -0
- package/dist/collection/server/firestoreDocs.d.ts +39 -0
- package/dist/collection/server/firestoreStore.d.ts +14 -0
- package/dist/collection/server/host.d.ts +52 -0
- package/dist/collection/server/index.cjs +72 -52
- package/dist/collection/server/index.d.ts +8 -1
- package/dist/collection/server/index.js +3 -3
- package/dist/collection/server/manageTool.d.ts +4 -0
- package/dist/collection/server/publish.d.ts +56 -0
- package/dist/collection/server/publishChecks.d.ts +29 -0
- package/dist/collection/server/publishManifest.d.ts +181 -0
- package/dist/collection/server/publishProject.d.ts +86 -0
- package/dist/collection/server/validate.d.ts +12 -0
- package/dist/collection-watchers/index.cjs +143 -52
- package/dist/collection-watchers/index.cjs.map +1 -1
- package/dist/collection-watchers/index.js +132 -41
- package/dist/collection-watchers/index.js.map +1 -1
- package/dist/collection-watchers/reconciler.d.ts +1 -1
- package/dist/feeds/server/index.cjs +10 -10
- package/dist/feeds/server/index.cjs.map +1 -1
- package/dist/feeds/server/index.js +2 -2
- package/dist/google/index.cjs +12 -12
- package/dist/google/index.cjs.map +1 -1
- package/dist/google/index.js +1 -1
- package/dist/{server-BiRLLMpW.js → server-B48Jyxcj.js} +1100 -230
- package/dist/server-B48Jyxcj.js.map +1 -0
- package/dist/{server-5EMj3naj.cjs → server-CWZyg8fn.cjs} +1333 -385
- package/dist/server-CWZyg8fn.cjs.map +1 -0
- package/dist/{discovery-Ck4AqikY.cjs → store-5_P_NsGa.cjs} +2108 -1755
- package/dist/store-5_P_NsGa.cjs.map +1 -0
- package/dist/{discovery-DH9wweuj.js → store-_61sO8K8.js} +2333 -2022
- package/dist/store-_61sO8K8.js.map +1 -0
- package/dist/whisper/index.cjs +1 -1
- package/dist/whisper/index.js +1 -1
- package/package.json +7 -1
- package/dist/discovery-Ck4AqikY.cjs.map +0 -1
- package/dist/discovery-DH9wweuj.js.map +0 -1
- package/dist/server-5EMj3naj.cjs.map +0 -1
- package/dist/server-BiRLLMpW.js.map +0 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SharedCollectionKey } from '../core/collectionKey';
|
|
2
|
+
import { LoadedCollection } from './discoveredCollection';
|
|
3
|
+
import { IoOptions } from './io';
|
|
4
|
+
import { CollectionStore } from './store';
|
|
5
|
+
/** The records subcollection of one shared collection.
|
|
6
|
+
*
|
|
7
|
+
* Takes a KEY, never loose strings, and the key is the only way to reach this
|
|
8
|
+
* function. `sharedCollectionKey` is where the name rule lives (the charset a
|
|
9
|
+
* Firestore document id, a pubsub channel segment and the completion-bell id
|
|
10
|
+
* must all survive), so building a path cannot be a way around it. */
|
|
11
|
+
export declare function sharedItemsPath(key: SharedCollectionKey): string;
|
|
12
|
+
/** The store factory registered for `storage.type === "firestore"`.
|
|
13
|
+
* Synchronous and connection-agnostic by contract — see the header. */
|
|
14
|
+
export declare function firestoreStoreFor(collection: LoadedCollection, opts: IoOptions): CollectionStore;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { canonicalRoot } from '../../files/root.js';
|
|
2
2
|
import { CollectionKey } from '../core/collectionKey.js';
|
|
3
3
|
import { StructuredLogger } from '../../host/hostSlot.js';
|
|
4
|
+
import { FirestoreDocs } from './firestoreDocs';
|
|
4
5
|
/** Public alias of the shared `StructuredLogger` — keeps the domain surface name-stable. */
|
|
5
6
|
export type CollectionLogger = StructuredLogger;
|
|
6
7
|
/** Re-exported so collection-engine callers (the watcher, the reconciler) keep
|
|
@@ -96,6 +97,42 @@ export interface CollectionHost {
|
|
|
96
97
|
/** True for a preset-skill slug (host-owned naming convention). */
|
|
97
98
|
isPresetSlug: (slug: string) => boolean;
|
|
98
99
|
}
|
|
100
|
+
/** The authenticated Firestore access a shared collection is served through.
|
|
101
|
+
*
|
|
102
|
+
* It carries NO uid, and that is a decision rather than an omission. Nothing
|
|
103
|
+
* about a shared collection is keyed by uid any more: the documents live at
|
|
104
|
+
* `apps/{aid}/collections/{cid}/items`, and the deployed rules authorize on
|
|
105
|
+
* `request.auth.token.email` against the app's member roster. A uid kept
|
|
106
|
+
* "just for identity" would be a value nothing checks, sitting next to a path
|
|
107
|
+
* it no longer determines — which is how a later reader ends up deriving a
|
|
108
|
+
* path from it again.
|
|
109
|
+
*
|
|
110
|
+
* `email` is what the rules actually evaluate, so it is what makes a refusal
|
|
111
|
+
* explainable: `permission-denied` is the most common failure a shared
|
|
112
|
+
* collection has and the least informative, and naming the principal turns it
|
|
113
|
+
* into "signed in as a@b — this app's roster may not list you". A session with
|
|
114
|
+
* no verified email is NOT a session here (the accessor answers null): public
|
|
115
|
+
* anonymous submission is a visitor's path through the published web app, not
|
|
116
|
+
* the host's.
|
|
117
|
+
*
|
|
118
|
+
* `docs` is the narrow document interface rather than a raw `Firestore` so the
|
|
119
|
+
* backend stays testable: core ships `createFirestoreDocs` over the real SDK
|
|
120
|
+
* (`firestoreDocs.ts`) and tests inject an in-memory fake. */
|
|
121
|
+
export interface FirestoreHandle {
|
|
122
|
+
docs: FirestoreDocs;
|
|
123
|
+
email: string;
|
|
124
|
+
/** The signed-in Firebase uid.
|
|
125
|
+
*
|
|
126
|
+
* The EMAIL is the principal the roster is keyed by, and it is what every
|
|
127
|
+
* record operation needs. The uid is needed by exactly one caller —
|
|
128
|
+
* `publish` — because the app document's `owner` is a uid: the rules
|
|
129
|
+
* require `owner == request.auth.uid` when the app is created and require
|
|
130
|
+
* it unchanged afterwards. Required rather than optional so a host cannot
|
|
131
|
+
* wire a session that can read and write records but silently cannot
|
|
132
|
+
* create an app; the failure would surface as a permission denial with
|
|
133
|
+
* nothing in it about identity. */
|
|
134
|
+
uid: string;
|
|
135
|
+
}
|
|
99
136
|
/** A collection's records changed on disk. Carries the `slug` so the host can
|
|
100
137
|
* publish on a per-collection channel; `ids` lists the affected record ids
|
|
101
138
|
* when known (a consumer may ignore them and refetch the whole collection),
|
|
@@ -173,6 +210,21 @@ export declare function setCollectionChangePublisher(publish: CollectionChangePu
|
|
|
173
210
|
* expected to be fire-and-forget (it wraps its own pubsub call in try/catch),
|
|
174
211
|
* so this stays a thin pass-through and never throws into the write. */
|
|
175
212
|
export declare function publishCollectionChange(payload: CollectionChangePayload): void;
|
|
213
|
+
/** Wire the accessor for the host's authenticated Firestore session.
|
|
214
|
+
*
|
|
215
|
+
* Separate from `configureCollectionHost` for the same reason
|
|
216
|
+
* `setCollectionChangePublisher` is: the host binding is set at the top of
|
|
217
|
+
* server startup, but this session doesn't exist until the user connects
|
|
218
|
+
* remote-host (and closes again on disconnect), so it cannot be part of a
|
|
219
|
+
* one-shot binding. Optional — left unwired, only shared collections are
|
|
220
|
+
* affected, and they report "not connected". Pass `null` to detach. */
|
|
221
|
+
export declare function setFirestoreAccessor(accessor: (() => FirestoreHandle | null) | null): void;
|
|
222
|
+
/** The host's live Firestore access, or null when there is no session (or the
|
|
223
|
+
* host never wired one — every non-shared backend leaves it unset).
|
|
224
|
+
* Callers MUST surface null as an actionable "connect remote-host first",
|
|
225
|
+
* never as an empty result: silence would be indistinguishable from a
|
|
226
|
+
* collection that genuinely has no records. */
|
|
227
|
+
export declare function firestoreHandle(): FirestoreHandle | null;
|
|
176
228
|
/** The configured workspace root. Throws if the host never configured one —
|
|
177
229
|
* and, under an explicit-root binding (`workspaceRoot: null`), throws rather
|
|
178
230
|
* than guessing, which is the whole point of that mode: on a multi-root host
|
|
@@ -1,95 +1,115 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_root = require("../../root-rPH6FGDT.cjs");
|
|
3
3
|
const require_calendarGrid = require("../../calendarGrid-DGILaVxI.cjs");
|
|
4
|
-
const
|
|
4
|
+
const require_store = require("../../store-5_P_NsGa.cjs");
|
|
5
|
+
const require_server = require("../../server-CWZyg8fn.cjs");
|
|
5
6
|
const require_templatePath = require("../../templatePath-27vUZowm.cjs");
|
|
6
|
-
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
7
|
+
exports.APPS_COLLECTION = require_server.APPS_COLLECTION;
|
|
8
|
+
exports.APP_MANIFEST_FILE = require_store.APP_MANIFEST_FILE;
|
|
9
|
+
exports.APP_ROLES = require_server.APP_ROLES;
|
|
10
|
+
exports.AuthoredAppZ = require_server.AuthoredAppZ;
|
|
11
|
+
exports.BackendUnavailableError = require_store.BackendUnavailableError;
|
|
12
|
+
exports.COLLECTION_ROOT_REQUIRED = require_store.COLLECTION_ROOT_REQUIRED;
|
|
9
13
|
exports.COMPUTED_TYPES = require_calendarGrid.COMPUTED_TYPES;
|
|
10
|
-
exports.CollectionQueryZ =
|
|
11
|
-
exports.CollectionSchemaZ =
|
|
12
|
-
exports.DEFAULT_QUERY_ROWS =
|
|
13
|
-
exports.MAX_CSV_ROWS =
|
|
14
|
-
exports.MAX_QUERY_ROWS =
|
|
14
|
+
exports.CollectionQueryZ = require_store.CollectionQueryZ;
|
|
15
|
+
exports.CollectionSchemaZ = require_store.CollectionSchemaZ;
|
|
16
|
+
exports.DEFAULT_QUERY_ROWS = require_store.DEFAULT_QUERY_ROWS;
|
|
17
|
+
exports.MAX_CSV_ROWS = require_store.MAX_CSV_ROWS;
|
|
18
|
+
exports.MAX_QUERY_ROWS = require_store.MAX_QUERY_ROWS;
|
|
19
|
+
exports.MAX_RECORD_ISSUES = require_server.MAX_RECORD_ISSUES;
|
|
15
20
|
exports.MAX_SCHEMA_ISSUES = require_server.MAX_SCHEMA_ISSUES;
|
|
16
21
|
exports.MAX_UNSELECTIVE_ITEMS = require_server.MAX_UNSELECTIVE_ITEMS;
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
22
|
+
exports.PUBLIC_CONFIG_DOC = require_server.PUBLIC_CONFIG_DOC;
|
|
23
|
+
exports.SCHEMA_FILE = require_store.SCHEMA_FILE;
|
|
24
|
+
exports.STORE_UNREADABLE = require_server.STORE_UNREADABLE;
|
|
25
|
+
exports.acceptParsedSchema = require_store.acceptParsedSchema;
|
|
19
26
|
exports.advanceTriggerDate = require_server.advanceTriggerDate;
|
|
27
|
+
exports.appConfigPath = require_server.appConfigPath;
|
|
28
|
+
exports.appManifestReason = require_store.appManifestReason;
|
|
29
|
+
exports.appSchemasPath = require_server.appSchemasPath;
|
|
20
30
|
exports.applyMutateAction = require_server.applyMutateAction;
|
|
31
|
+
exports.bindsSubmitterIdentity = require_server.bindsSubmitterIdentity;
|
|
21
32
|
exports.buildActionSeedPrompt = require_server.buildActionSeedPrompt;
|
|
22
33
|
exports.buildCollectionActionSeedPrompt = require_server.buildCollectionActionSeedPrompt;
|
|
23
34
|
exports.buildWorkspaceOntology = require_server.buildWorkspaceOntology;
|
|
24
35
|
exports.canonicalRoot = require_root.canonicalRoot;
|
|
25
|
-
exports.collectionChangeKey =
|
|
26
|
-
exports.collectionChangePayload =
|
|
27
|
-
exports.collectionWritable =
|
|
28
|
-
exports.compileCsvQuery =
|
|
29
|
-
exports.compileJsonlQuery =
|
|
36
|
+
exports.collectionChangeKey = require_store.collectionChangeKey;
|
|
37
|
+
exports.collectionChangePayload = require_store.collectionChangePayload;
|
|
38
|
+
exports.collectionWritable = require_store.collectionWritable;
|
|
39
|
+
exports.compileCsvQuery = require_store.compileCsvQuery;
|
|
40
|
+
exports.compileJsonlQuery = require_store.compileJsonlQuery;
|
|
30
41
|
exports.compileRecordZ = require_server.compileRecordZ;
|
|
31
42
|
exports.computeCollectionIcon = require_server.computeCollectionIcon;
|
|
32
43
|
exports.computeSuccessor = require_server.computeSuccessor;
|
|
33
|
-
exports.configureCollectionHost =
|
|
34
|
-
exports.csvRowToItem =
|
|
44
|
+
exports.configureCollectionHost = require_store.configureCollectionHost;
|
|
45
|
+
exports.csvRowToItem = require_store.csvRowToItem;
|
|
35
46
|
exports.daysInMonth = require_server.daysInMonth;
|
|
36
|
-
exports.decodeCsvRecordId =
|
|
37
|
-
exports.dedupeByRecordId =
|
|
47
|
+
exports.decodeCsvRecordId = require_store.decodeCsvRecordId;
|
|
48
|
+
exports.dedupeByRecordId = require_store.dedupeByRecordId;
|
|
38
49
|
exports.deleteCollection = require_server.deleteCollection;
|
|
39
50
|
exports.deleteCollectionRefusalMessage = require_server.deleteCollectionRefusalMessage;
|
|
40
51
|
exports.deleteCustomView = require_server.deleteCustomView;
|
|
41
|
-
exports.deleteItem =
|
|
42
|
-
exports.discoverCollections =
|
|
43
|
-
exports.encodeCsvRecordId =
|
|
52
|
+
exports.deleteItem = require_store.deleteItem;
|
|
53
|
+
exports.discoverCollections = require_store.discoverCollections;
|
|
54
|
+
exports.encodeCsvRecordId = require_store.encodeCsvRecordId;
|
|
44
55
|
exports.enrichItems = require_server.enrichItems;
|
|
56
|
+
exports.firestoreHandle = require_store.firestoreHandle;
|
|
45
57
|
exports.firstMutateParamProblem = require_server.firstMutateParamProblem;
|
|
46
58
|
exports.formatCivil = require_server.formatCivil;
|
|
47
|
-
exports.generateItemId =
|
|
48
|
-
exports.getWorkspaceRoot =
|
|
49
|
-
exports.isBackendUnavailable =
|
|
50
|
-
exports.isContainedInRoot =
|
|
51
|
-
exports.isRegularFile =
|
|
59
|
+
exports.generateItemId = require_store.generateItemId;
|
|
60
|
+
exports.getWorkspaceRoot = require_store.getWorkspaceRoot;
|
|
61
|
+
exports.isBackendUnavailable = require_store.isBackendUnavailable;
|
|
62
|
+
exports.isContainedInRoot = require_store.isContainedInRoot;
|
|
63
|
+
exports.isRegularFile = require_store.isRegularFile;
|
|
52
64
|
exports.isSafeActionTemplatePath = require_templatePath.isSafeActionTemplatePath;
|
|
53
65
|
exports.isSafeCustomViewI18nPath = require_templatePath.isSafeCustomViewI18nPath;
|
|
54
66
|
exports.isSafeCustomViewPath = require_templatePath.isSafeCustomViewPath;
|
|
55
67
|
exports.isSafeTemplatePath = require_templatePath.isSafeTemplatePath;
|
|
56
68
|
exports.isTriggerDue = require_server.isTriggerDue;
|
|
57
|
-
exports.itemFilePath =
|
|
58
|
-
exports.listItems =
|
|
59
|
-
exports.
|
|
60
|
-
exports.
|
|
61
|
-
exports.
|
|
69
|
+
exports.itemFilePath = require_store.itemFilePath;
|
|
70
|
+
exports.listItems = require_store.listItems;
|
|
71
|
+
exports.loadAppManifest = require_store.loadAppManifest;
|
|
72
|
+
exports.loadCollection = require_store.loadCollection;
|
|
73
|
+
exports.localCollectionKey = require_store.localCollectionKey;
|
|
74
|
+
exports.log = require_store.log;
|
|
62
75
|
exports.makeManageCollectionTool = require_server.makeManageCollectionTool;
|
|
63
76
|
exports.maybeSpawnSuccessor = require_server.maybeSpawnSuccessor;
|
|
64
|
-
exports.normalizeCsvValue =
|
|
65
|
-
exports.pageFromFullRead =
|
|
77
|
+
exports.normalizeCsvValue = require_store.normalizeCsvValue;
|
|
78
|
+
exports.pageFromFullRead = require_store.pageFromFullRead;
|
|
79
|
+
exports.parseAppManifest = require_store.parseAppManifest;
|
|
80
|
+
exports.parseAuthoredApp = require_server.parseAuthoredApp;
|
|
66
81
|
exports.parseCivil = require_server.parseCivil;
|
|
67
|
-
exports.peekWorkspaceRoot =
|
|
68
|
-
exports.
|
|
82
|
+
exports.peekWorkspaceRoot = require_store.peekWorkspaceRoot;
|
|
83
|
+
exports.projectApp = require_server.projectApp;
|
|
84
|
+
exports.projectItemFields = require_store.projectItemFields;
|
|
69
85
|
exports.promptPathsFor = require_server.promptPathsFor;
|
|
70
|
-
exports.
|
|
86
|
+
exports.publishApp = require_server.publishApp;
|
|
87
|
+
exports.publishCollectionChange = require_store.publishCollectionChange;
|
|
88
|
+
exports.publishProblems = require_server.publishProblems;
|
|
71
89
|
exports.readCustomViewHtml = require_server.readCustomViewHtml;
|
|
72
90
|
exports.readCustomViewI18n = require_server.readCustomViewI18n;
|
|
73
|
-
exports.readItem =
|
|
74
|
-
exports.readOnlyRefusal =
|
|
91
|
+
exports.readItem = require_store.readItem;
|
|
92
|
+
exports.readOnlyRefusal = require_store.readOnlyRefusal;
|
|
75
93
|
exports.readSkillTemplate = require_server.readSkillTemplate;
|
|
76
94
|
exports.recordFieldProblem = require_server.recordFieldProblem;
|
|
77
|
-
exports.resolveCreateItemId =
|
|
78
|
-
exports.resolveDataDir =
|
|
95
|
+
exports.resolveCreateItemId = require_store.resolveCreateItemId;
|
|
96
|
+
exports.resolveDataDir = require_store.resolveDataDir;
|
|
79
97
|
exports.resolveEvery = require_server.resolveEvery;
|
|
80
|
-
exports.resolvePrimaryField =
|
|
81
|
-
exports.resolveTemplatePath =
|
|
98
|
+
exports.resolvePrimaryField = require_store.resolvePrimaryField;
|
|
99
|
+
exports.resolveTemplatePath = require_store.resolveTemplatePath;
|
|
82
100
|
exports.runCollectionQuery = require_server.runCollectionQuery;
|
|
83
101
|
exports.runQueryOverRows = require_server.runQueryOverRows;
|
|
84
|
-
exports.safeRecordId =
|
|
85
|
-
exports.safeSlugName =
|
|
102
|
+
exports.safeRecordId = require_store.safeRecordId;
|
|
103
|
+
exports.safeSlugName = require_store.safeSlugName;
|
|
86
104
|
exports.schemaRelations = require_server.schemaRelations;
|
|
87
|
-
exports.setCollectionChangePublisher =
|
|
88
|
-
exports.
|
|
89
|
-
exports.
|
|
105
|
+
exports.setCollectionChangePublisher = require_store.setCollectionChangePublisher;
|
|
106
|
+
exports.setFirestoreAccessor = require_store.setFirestoreAccessor;
|
|
107
|
+
exports.sharedCollectionChangePayload = require_store.sharedCollectionChangePayload;
|
|
108
|
+
exports.sharedItemsPath = require_store.sharedItemsPath;
|
|
109
|
+
exports.storeFor = require_store.storeFor;
|
|
90
110
|
exports.successorId = require_server.successorId;
|
|
91
|
-
exports.toDetail =
|
|
92
|
-
exports.toSummary =
|
|
111
|
+
exports.toDetail = require_store.toDetail;
|
|
112
|
+
exports.toSummary = require_store.toSummary;
|
|
93
113
|
exports.validateCollectionRecords = require_server.validateCollectionRecords;
|
|
94
114
|
exports.validateRecordObject = require_server.validateRecordObject;
|
|
95
|
-
exports.writeItem =
|
|
115
|
+
exports.writeItem = require_store.writeItem;
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
export { configureCollectionHost, canonicalRoot, getWorkspaceRoot, peekWorkspaceRoot, COLLECTION_ROOT_REQUIRED, log, setCollectionChangePublisher, publishCollectionChange, collectionChangePayload, sharedCollectionChangePayload, collectionChangeKey, localCollectionKey, type CollectionHost, type CollectionLogger, type CollectionChangePayload, type LocalCollectionChange, type SharedCollectionChange, } from './host';
|
|
1
|
+
export { configureCollectionHost, canonicalRoot, getWorkspaceRoot, peekWorkspaceRoot, COLLECTION_ROOT_REQUIRED, log, setCollectionChangePublisher, publishCollectionChange, collectionChangePayload, sharedCollectionChangePayload, collectionChangeKey, localCollectionKey, type CollectionHost, type CollectionLogger, type CollectionChangePayload, firestoreHandle, setFirestoreAccessor, type FirestoreHandle, type LocalCollectionChange, type SharedCollectionChange, } from './host';
|
|
2
|
+
export type { FirestoreDoc, FirestoreDocs } from './firestoreDocs';
|
|
3
|
+
export { sharedItemsPath } from './firestoreStore';
|
|
4
|
+
export { loadAppManifest, parseAppManifest, appManifestReason, APP_MANIFEST_FILE, type AppManifest, type AppManifestResult } from './appManifest';
|
|
5
|
+
export { AuthoredAppZ, parseAuthoredApp, APP_ROLES, type AuthoredApp, type AuthoredCollectionConfig, type AuthoredMail, type AuthoredSubmit, } from './publishManifest';
|
|
6
|
+
export { projectApp, APPS_COLLECTION, PUBLIC_CONFIG_DOC, appConfigPath, appSchemasPath, type PublishStamp, type PublishedApp, type PublishedConfigDoc, type PublishedSchemaDoc, } from './publishProject';
|
|
7
|
+
export { publishProblems, bindsSubmitterIdentity, type PublishableCollection } from './publishChecks';
|
|
8
|
+
export { publishApp, type PublishOptions, type PublishResult } from './publish';
|
|
2
9
|
export type { LoadedCollection } from './discoveredCollection';
|
|
3
10
|
export * from './paths';
|
|
4
11
|
export * from './templatePath';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as canonicalRoot } from "../../root-BMroU_mB.js";
|
|
2
2
|
import { j as COMPUTED_TYPES } from "../../calendarGrid-CQ8MVSRb.js";
|
|
3
|
-
import {
|
|
3
|
+
import { A as toSummary, B as SCHEMA_FILE, C as resolveCreateItemId, D as loadCollection, E as discoverCollections, F as loadAppManifest, G as safeRecordId, H as itemFilePath, I as parseAppManifest, J as isBackendUnavailable, K as safeSlugName, L as sharedItemsPath, N as APP_MANIFEST_FILE, O as resolvePrimaryField, P as appManifestReason, Q as collectionChangePayload, R as pageFromFullRead, S as readItem, T as acceptParsedSchema, U as resolveDataDir, V as isContainedInRoot, W as resolveTemplatePath, Y as COLLECTION_ROOT_REQUIRED, Z as collectionChangeKey, _ as MAX_QUERY_ROWS, a as MAX_CSV_ROWS, at as log, b as isRegularFile, c as decodeCsvRecordId, ct as publishCollectionChange, d as normalizeCsvValue, dt as sharedCollectionChangePayload, et as configureCollectionHost, g as DEFAULT_QUERY_ROWS, h as CollectionQueryZ, it as localCollectionKey, j as CollectionSchemaZ, k as toDetail, l as dedupeByRecordId, lt as setCollectionChangePublisher, m as compileJsonlQuery, n as readOnlyRefusal, nt as getWorkspaceRoot, ot as peekWorkspaceRoot, p as compileCsvQuery, q as BackendUnavailableError, r as storeFor, s as csvRowToItem, t as collectionWritable, tt as firestoreHandle, u as encodeCsvRecordId, ut as setFirestoreAccessor, v as deleteItem, w as writeItem, x as listItems, y as generateItemId, z as projectItemFields } from "../../store-_61sO8K8.js";
|
|
4
|
+
import { A as readSkillTemplate, B as APPS_COLLECTION, C as enrichItems, D as promptPathsFor, E as buildCollectionActionSeedPrompt, F as validateRecordObject, G as APP_ROLES, H as appConfigPath, I as compileRecordZ, K as AuthoredAppZ, L as recordFieldProblem, M as MAX_RECORD_ISSUES, N as STORE_UNREADABLE, O as readCustomViewHtml, P as validateCollectionRecords, R as bindsSubmitterIdentity, S as runCollectionQuery, T as buildActionSeedPrompt, U as appSchemasPath, V as PUBLIC_CONFIG_DOC, W as projectApp, _ as computeCollectionIcon, a as deleteCollection, b as applyMutateAction, c as computeSuccessor, d as isTriggerDue, f as maybeSpawnSuccessor, h as successorId, i as deleteCustomView, j as publishApp, k as readCustomViewI18n, l as daysInMonth, m as resolveEvery, n as MAX_UNSELECTIVE_ITEMS, o as deleteCollectionRefusalMessage, p as parseCivil, q as parseAuthoredApp, r as makeManageCollectionTool, s as advanceTriggerDate, t as MAX_SCHEMA_ISSUES, u as formatCivil, v as buildWorkspaceOntology, w as runQueryOverRows, x as firstMutateParamProblem, y as schemaRelations, z as publishProblems } from "../../server-B48Jyxcj.js";
|
|
4
5
|
import { i as isSafeTemplatePath, n as isSafeCustomViewI18nPath, r as isSafeCustomViewPath, t as isSafeActionTemplatePath } from "../../templatePath-k_WNbL_Q.js";
|
|
5
|
-
|
|
6
|
-
export { BackendUnavailableError, COLLECTION_ROOT_REQUIRED, COMPUTED_TYPES, CollectionQueryZ, CollectionSchemaZ, DEFAULT_QUERY_ROWS, MAX_CSV_ROWS, MAX_QUERY_ROWS, MAX_SCHEMA_ISSUES, MAX_UNSELECTIVE_ITEMS, SCHEMA_FILE, acceptParsedSchema, advanceTriggerDate, applyMutateAction, buildActionSeedPrompt, buildCollectionActionSeedPrompt, buildWorkspaceOntology, canonicalRoot, collectionChangeKey, collectionChangePayload, collectionWritable, compileCsvQuery, compileJsonlQuery, compileRecordZ, computeCollectionIcon, computeSuccessor, configureCollectionHost, csvRowToItem, daysInMonth, decodeCsvRecordId, dedupeByRecordId, deleteCollection, deleteCollectionRefusalMessage, deleteCustomView, deleteItem, discoverCollections, encodeCsvRecordId, enrichItems, firstMutateParamProblem, formatCivil, generateItemId, getWorkspaceRoot, isBackendUnavailable, isContainedInRoot, isRegularFile, isSafeActionTemplatePath, isSafeCustomViewI18nPath, isSafeCustomViewPath, isSafeTemplatePath, isTriggerDue, itemFilePath, listItems, loadCollection, localCollectionKey, log, makeManageCollectionTool, maybeSpawnSuccessor, normalizeCsvValue, pageFromFullRead, parseCivil, peekWorkspaceRoot, projectItemFields, promptPathsFor, publishCollectionChange, readCustomViewHtml, readCustomViewI18n, readItem, readOnlyRefusal, readSkillTemplate, recordFieldProblem, resolveCreateItemId, resolveDataDir, resolveEvery, resolvePrimaryField, resolveTemplatePath, runCollectionQuery, runQueryOverRows, safeRecordId, safeSlugName, schemaRelations, setCollectionChangePublisher, sharedCollectionChangePayload, storeFor, successorId, toDetail, toSummary, validateCollectionRecords, validateRecordObject, writeItem };
|
|
6
|
+
export { APPS_COLLECTION, APP_MANIFEST_FILE, APP_ROLES, AuthoredAppZ, BackendUnavailableError, COLLECTION_ROOT_REQUIRED, COMPUTED_TYPES, CollectionQueryZ, CollectionSchemaZ, DEFAULT_QUERY_ROWS, MAX_CSV_ROWS, MAX_QUERY_ROWS, MAX_RECORD_ISSUES, MAX_SCHEMA_ISSUES, MAX_UNSELECTIVE_ITEMS, PUBLIC_CONFIG_DOC, SCHEMA_FILE, STORE_UNREADABLE, acceptParsedSchema, advanceTriggerDate, appConfigPath, appManifestReason, appSchemasPath, applyMutateAction, bindsSubmitterIdentity, buildActionSeedPrompt, buildCollectionActionSeedPrompt, buildWorkspaceOntology, canonicalRoot, collectionChangeKey, collectionChangePayload, collectionWritable, compileCsvQuery, compileJsonlQuery, compileRecordZ, computeCollectionIcon, computeSuccessor, configureCollectionHost, csvRowToItem, daysInMonth, decodeCsvRecordId, dedupeByRecordId, deleteCollection, deleteCollectionRefusalMessage, deleteCustomView, deleteItem, discoverCollections, encodeCsvRecordId, enrichItems, firestoreHandle, firstMutateParamProblem, formatCivil, generateItemId, getWorkspaceRoot, isBackendUnavailable, isContainedInRoot, isRegularFile, isSafeActionTemplatePath, isSafeCustomViewI18nPath, isSafeCustomViewPath, isSafeTemplatePath, isTriggerDue, itemFilePath, listItems, loadAppManifest, loadCollection, localCollectionKey, log, makeManageCollectionTool, maybeSpawnSuccessor, normalizeCsvValue, pageFromFullRead, parseAppManifest, parseAuthoredApp, parseCivil, peekWorkspaceRoot, projectApp, projectItemFields, promptPathsFor, publishApp, publishCollectionChange, publishProblems, readCustomViewHtml, readCustomViewI18n, readItem, readOnlyRefusal, readSkillTemplate, recordFieldProblem, resolveCreateItemId, resolveDataDir, resolveEvery, resolvePrimaryField, resolveTemplatePath, runCollectionQuery, runQueryOverRows, safeRecordId, safeSlugName, schemaRelations, setCollectionChangePublisher, setFirestoreAccessor, sharedCollectionChangePayload, sharedItemsPath, storeFor, successorId, toDetail, toSummary, validateCollectionRecords, validateRecordObject, writeItem };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { DiscoveryOptions } from './discovery';
|
|
2
|
+
import { PublishedApp } from './publishProject';
|
|
3
|
+
export interface PublishOptions extends DiscoveryOptions {
|
|
4
|
+
/** Proceed even though existing records fail the schemas about to be
|
|
5
|
+
* published. Never a default: the pre-check is the migration gate, and a
|
|
6
|
+
* gate that opens itself is a log line. */
|
|
7
|
+
confirm?: boolean | undefined;
|
|
8
|
+
/** Wall clock, injectable so a test can assert an exact document. */
|
|
9
|
+
now?: (() => number) | undefined;
|
|
10
|
+
/** Resolve the commit the declaration is being published from. Injectable
|
|
11
|
+
* for the same reason, and because a repository without git is a normal
|
|
12
|
+
* state rather than a failure. */
|
|
13
|
+
resolveCommit?: ((root: string) => Promise<{
|
|
14
|
+
commit?: string | undefined;
|
|
15
|
+
dirty?: boolean | undefined;
|
|
16
|
+
}>) | undefined;
|
|
17
|
+
}
|
|
18
|
+
export type PublishResult = {
|
|
19
|
+
ok: false;
|
|
20
|
+
problems: string[];
|
|
21
|
+
/** Did any document reach Firestore before this failed?
|
|
22
|
+
*
|
|
23
|
+
* Almost every refusal happens before the first write, and saying so is
|
|
24
|
+
* most of the value of refusing. But a write that fails part-way is a
|
|
25
|
+
* DIFFERENT state — the roster and configuration are live while the
|
|
26
|
+
* schemas are one publish behind — and it is the state a caller most
|
|
27
|
+
* needs to hear about. Carried as a field rather than left for the
|
|
28
|
+
* caller to infer from prose, because a caller that guesses will guess
|
|
29
|
+
* "nothing was written": that is what every other failure means. */
|
|
30
|
+
partial: boolean;
|
|
31
|
+
} | {
|
|
32
|
+
ok: true;
|
|
33
|
+
aid: string;
|
|
34
|
+
cids: string[];
|
|
35
|
+
created: boolean;
|
|
36
|
+
commit?: string | undefined;
|
|
37
|
+
dirty: boolean;
|
|
38
|
+
/** How many live records the pre-check found that the published schemas
|
|
39
|
+
* reject — and whether that number is a FLOOR.
|
|
40
|
+
*
|
|
41
|
+
* `validateCollectionRecords` stops at its own cap per collection, so a
|
|
42
|
+
* full batch means "at least this many". The count and the cap travel
|
|
43
|
+
* together because they are read together: a caller that reports the
|
|
44
|
+
* number without the flag understates how much repair is owed, on the
|
|
45
|
+
* one path (a confirmed publish) where the damage is already done. */
|
|
46
|
+
recordIssues: number;
|
|
47
|
+
recordIssuesCapped: boolean;
|
|
48
|
+
published: PublishedApp;
|
|
49
|
+
};
|
|
50
|
+
/** Publish this repository's declaration to its app.
|
|
51
|
+
*
|
|
52
|
+
* Everything variable is a parameter or comes from the host binding, so the
|
|
53
|
+
* whole path is exercisable against an in-memory `FirestoreDocs` with no
|
|
54
|
+
* network and no API key — which is the only way the conversion table gets
|
|
55
|
+
* tested as a table. */
|
|
56
|
+
export declare function publishApp(opts?: PublishOptions): Promise<PublishResult>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AuthoredApp, AuthoredSubmit } from './publishManifest';
|
|
2
|
+
/** What publish knows about a shared collection in this repository, as far as
|
|
3
|
+
* these checks are concerned: its cid and the schema key its records are
|
|
4
|
+
* identified by. The whole schema is deliberately not threaded in — these
|
|
5
|
+
* checks are about the DECLARATION, and the primary key is the one part of
|
|
6
|
+
* the schema the declaration can contradict. */
|
|
7
|
+
export interface PublishableCollection {
|
|
8
|
+
cid: string;
|
|
9
|
+
primaryKey: string;
|
|
10
|
+
}
|
|
11
|
+
/** Does this submit declaration bind a record to the submitter's identity?
|
|
12
|
+
*
|
|
13
|
+
* The condition for requiring `submitOnly`, and deliberately NOT "declares an
|
|
14
|
+
* `audience`": `audience` appears only in the rules' public-create branch, so
|
|
15
|
+
* an owner or editor never meets it and can add records freely. `immutable`
|
|
16
|
+
* is the wrong condition too — a survey's responses are not immutable and
|
|
17
|
+
* can be padded exactly the same way.
|
|
18
|
+
*
|
|
19
|
+
* What these four have in common is that each one makes the record MEAN "the
|
|
20
|
+
* person who submitted it said this": a per-uid id, a per-uid+field id, a
|
|
21
|
+
* row stamped with the submitter's verified address, or a submission
|
|
22
|
+
* restricted to a named participant. A record created through the writer
|
|
23
|
+
* branch carries the same shape and none of that meaning. */
|
|
24
|
+
export declare function bindsSubmitterIdentity(submit: AuthoredSubmit): boolean;
|
|
25
|
+
/** Everything publish refuses, as lines the author can act on.
|
|
26
|
+
*
|
|
27
|
+
* All of them, every time. Publish is a manual step with a human waiting on
|
|
28
|
+
* it; stopping at the first problem turns one review into five. */
|
|
29
|
+
export declare function publishProblems(app: AuthoredApp, collections: readonly PublishableCollection[], publisherEmail: string): string[];
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** The four roles the deployed rules understand. `participant` is the layer
|
|
3
|
+
* that is NAMED but reads only its own rows — see `readerOf` vs `listedIn`. */
|
|
4
|
+
export declare const APP_ROLES: readonly ["owner", "editor", "viewer", "participant"];
|
|
5
|
+
/** The declarative mail queue, as the rules re-derive it: a transition of the
|
|
6
|
+
* status field, a recipient read off the RECORD, and a fixed template. */
|
|
7
|
+
declare const MailZ: z.ZodObject<{
|
|
8
|
+
toField: z.ZodString;
|
|
9
|
+
on: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
10
|
+
from: z.ZodArray<z.ZodString>;
|
|
11
|
+
to: z.ZodString;
|
|
12
|
+
}, z.core.$strict>>;
|
|
13
|
+
dataFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14
|
+
}, z.core.$strict>;
|
|
15
|
+
/** What the rules read out of `collections[cid]`. NOT the schema — the schema
|
|
16
|
+
* is published beside it, untouched, for clients to render from. */
|
|
17
|
+
declare const CollectionConfigZ: z.ZodObject<{
|
|
18
|
+
statusField: z.ZodOptional<z.ZodString>;
|
|
19
|
+
transitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
20
|
+
immutable: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
submitOnly: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
peerVisibility: z.ZodOptional<z.ZodEnum<{
|
|
23
|
+
public: "public";
|
|
24
|
+
hidden: "hidden";
|
|
25
|
+
}>>;
|
|
26
|
+
revealGated: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
gatedFrom: z.ZodOptional<z.ZodString>;
|
|
28
|
+
revealBy: z.ZodOptional<z.ZodString>;
|
|
29
|
+
mail: z.ZodOptional<z.ZodObject<{
|
|
30
|
+
toField: z.ZodString;
|
|
31
|
+
on: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
32
|
+
from: z.ZodArray<z.ZodString>;
|
|
33
|
+
to: z.ZodString;
|
|
34
|
+
}, z.core.$strict>>;
|
|
35
|
+
dataFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
36
|
+
}, z.core.$strict>>;
|
|
37
|
+
aggregate: z.ZodOptional<z.ZodObject<{
|
|
38
|
+
by: z.ZodArray<z.ZodString>;
|
|
39
|
+
}, z.core.$strict>>;
|
|
40
|
+
}, z.core.$strict>;
|
|
41
|
+
declare const SubmitZ: z.ZodObject<{
|
|
42
|
+
auth: z.ZodEnum<{
|
|
43
|
+
none: "none";
|
|
44
|
+
anonymous: "anonymous";
|
|
45
|
+
verifiedEmail: "verifiedEmail";
|
|
46
|
+
}>;
|
|
47
|
+
emailField: z.ZodOptional<z.ZodString>;
|
|
48
|
+
createFields: z.ZodArray<z.ZodString>;
|
|
49
|
+
initialStatus: z.ZodOptional<z.ZodString>;
|
|
50
|
+
idFrom: z.ZodOptional<z.ZodEnum<{
|
|
51
|
+
auto: "auto";
|
|
52
|
+
"auth.uid": "auth.uid";
|
|
53
|
+
"auth.uid+field": "auth.uid+field";
|
|
54
|
+
}>>;
|
|
55
|
+
idField: z.ZodOptional<z.ZodString>;
|
|
56
|
+
validate: z.ZodOptional<z.ZodObject<{
|
|
57
|
+
required: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
58
|
+
keyFields: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
59
|
+
field: z.ZodString;
|
|
60
|
+
values: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
61
|
+
}, z.core.$strict>>>;
|
|
62
|
+
}, z.core.$strict>>;
|
|
63
|
+
window: z.ZodOptional<z.ZodObject<{
|
|
64
|
+
from: z.ZodOptional<z.ZodISODateTime>;
|
|
65
|
+
until: z.ZodOptional<z.ZodISODateTime>;
|
|
66
|
+
}, z.core.$strict>>;
|
|
67
|
+
selfUpdate: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
68
|
+
selfTransitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
69
|
+
finalize: z.ZodOptional<z.ZodBoolean>;
|
|
70
|
+
audience: z.ZodOptional<z.ZodLiteral<"participant">>;
|
|
71
|
+
gateOn: z.ZodOptional<z.ZodObject<{
|
|
72
|
+
phase: z.ZodString;
|
|
73
|
+
match: z.ZodString;
|
|
74
|
+
}, z.core.$strict>>;
|
|
75
|
+
}, z.core.$strict>;
|
|
76
|
+
/** The whole authored declaration.
|
|
77
|
+
*
|
|
78
|
+
* `owner` is accepted but is NOT the published value — publish stamps the
|
|
79
|
+
* publisher's uid (or carries the existing one forward, which is what the
|
|
80
|
+
* rules require on update) and refuses a declaration that disagrees. It is
|
|
81
|
+
* accepted rather than banned because the sample app.json in the design note
|
|
82
|
+
* shows it, and a hard refusal on a key the samples contain would be a worse
|
|
83
|
+
* first experience than a message naming the mismatch. */
|
|
84
|
+
export declare const AuthoredAppZ: z.ZodObject<{
|
|
85
|
+
aid: z.ZodString;
|
|
86
|
+
name: z.ZodOptional<z.ZodString>;
|
|
87
|
+
aidEnv: z.ZodOptional<z.ZodString>;
|
|
88
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
89
|
+
members: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodString]>, z.ZodEnum<{
|
|
90
|
+
owner: "owner";
|
|
91
|
+
editor: "editor";
|
|
92
|
+
viewer: "viewer";
|
|
93
|
+
participant: "participant";
|
|
94
|
+
}>>>;
|
|
95
|
+
collections: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
96
|
+
statusField: z.ZodOptional<z.ZodString>;
|
|
97
|
+
transitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
98
|
+
immutable: z.ZodOptional<z.ZodBoolean>;
|
|
99
|
+
submitOnly: z.ZodOptional<z.ZodBoolean>;
|
|
100
|
+
peerVisibility: z.ZodOptional<z.ZodEnum<{
|
|
101
|
+
public: "public";
|
|
102
|
+
hidden: "hidden";
|
|
103
|
+
}>>;
|
|
104
|
+
revealGated: z.ZodOptional<z.ZodBoolean>;
|
|
105
|
+
gatedFrom: z.ZodOptional<z.ZodString>;
|
|
106
|
+
revealBy: z.ZodOptional<z.ZodString>;
|
|
107
|
+
mail: z.ZodOptional<z.ZodObject<{
|
|
108
|
+
toField: z.ZodString;
|
|
109
|
+
on: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
110
|
+
from: z.ZodArray<z.ZodString>;
|
|
111
|
+
to: z.ZodString;
|
|
112
|
+
}, z.core.$strict>>;
|
|
113
|
+
dataFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
114
|
+
}, z.core.$strict>>;
|
|
115
|
+
aggregate: z.ZodOptional<z.ZodObject<{
|
|
116
|
+
by: z.ZodArray<z.ZodString>;
|
|
117
|
+
}, z.core.$strict>>;
|
|
118
|
+
}, z.core.$strict>>>;
|
|
119
|
+
participantRead: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
120
|
+
public: z.ZodOptional<z.ZodObject<{
|
|
121
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
122
|
+
read: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
123
|
+
submit: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
124
|
+
auth: z.ZodEnum<{
|
|
125
|
+
none: "none";
|
|
126
|
+
anonymous: "anonymous";
|
|
127
|
+
verifiedEmail: "verifiedEmail";
|
|
128
|
+
}>;
|
|
129
|
+
emailField: z.ZodOptional<z.ZodString>;
|
|
130
|
+
createFields: z.ZodArray<z.ZodString>;
|
|
131
|
+
initialStatus: z.ZodOptional<z.ZodString>;
|
|
132
|
+
idFrom: z.ZodOptional<z.ZodEnum<{
|
|
133
|
+
auto: "auto";
|
|
134
|
+
"auth.uid": "auth.uid";
|
|
135
|
+
"auth.uid+field": "auth.uid+field";
|
|
136
|
+
}>>;
|
|
137
|
+
idField: z.ZodOptional<z.ZodString>;
|
|
138
|
+
validate: z.ZodOptional<z.ZodObject<{
|
|
139
|
+
required: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
140
|
+
keyFields: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
141
|
+
field: z.ZodString;
|
|
142
|
+
values: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
143
|
+
}, z.core.$strict>>>;
|
|
144
|
+
}, z.core.$strict>>;
|
|
145
|
+
window: z.ZodOptional<z.ZodObject<{
|
|
146
|
+
from: z.ZodOptional<z.ZodISODateTime>;
|
|
147
|
+
until: z.ZodOptional<z.ZodISODateTime>;
|
|
148
|
+
}, z.core.$strict>>;
|
|
149
|
+
selfUpdate: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
150
|
+
selfTransitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
151
|
+
finalize: z.ZodOptional<z.ZodBoolean>;
|
|
152
|
+
audience: z.ZodOptional<z.ZodLiteral<"participant">>;
|
|
153
|
+
gateOn: z.ZodOptional<z.ZodObject<{
|
|
154
|
+
phase: z.ZodString;
|
|
155
|
+
match: z.ZodString;
|
|
156
|
+
}, z.core.$strict>>;
|
|
157
|
+
}, z.core.$strict>>>;
|
|
158
|
+
}, z.core.$strict>>;
|
|
159
|
+
}, z.core.$strict>;
|
|
160
|
+
export type AuthoredApp = z.infer<typeof AuthoredAppZ>;
|
|
161
|
+
export type AuthoredCollectionConfig = z.infer<typeof CollectionConfigZ>;
|
|
162
|
+
export type AuthoredSubmit = z.infer<typeof SubmitZ>;
|
|
163
|
+
export type AuthoredMail = z.infer<typeof MailZ>;
|
|
164
|
+
export type AuthoredAppResult = {
|
|
165
|
+
ok: true;
|
|
166
|
+
app: AuthoredApp;
|
|
167
|
+
} | {
|
|
168
|
+
ok: false;
|
|
169
|
+
problems: string[];
|
|
170
|
+
};
|
|
171
|
+
/** Parse the authored declaration out of `app.json`'s text.
|
|
172
|
+
*
|
|
173
|
+
* Returns a LIST of problems rather than throwing, for the same reason
|
|
174
|
+
* `loadAppManifest` returns a failure: the caller is a gate whose entire job
|
|
175
|
+
* is to hand the author something to act on. Every problem is reported at
|
|
176
|
+
* once — publish is a manual step, and a parser that stops at the first key
|
|
177
|
+
* makes it N round trips. */
|
|
178
|
+
export declare function parseAuthoredApp(raw: string): AuthoredAppResult;
|
|
179
|
+
/** zod issues as one actionable line each: `public.submit.responses.auth: …`. */
|
|
180
|
+
export declare function authoredProblems(error: z.ZodError): string[];
|
|
181
|
+
export {};
|