@protobase/schema 0.132.2 → 0.133.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.
@@ -4,6 +4,7 @@ import { actionInputErrors, shownInputs } from "./action-inputs.js";
4
4
  import { actionConditionError } from "./view-actions.js";
5
5
  import { chartFields, isGroupChart } from "./view-chart.js";
6
6
  import { boardErrors, cardPhotoLimit, datesErrors, displayFields, tableDisplay } from "./view-displays.js";
7
+ import { recordText } from "./record-page.js";
7
8
  import { fieldRefsIn, isFieldRef, markFieldRefs, unmarkFieldRefs } from "./field-ref.js";
8
9
  import { bottomBarFor } from "./bottom-bar.js";
9
10
  import { decodeKey, encodeKey } from "./keys.js";
@@ -69,4 +70,4 @@ import { CallRing, callsChannelEvent, declineWord, ringNotice, ringsPath } from
69
70
  import { ReorderSpan, reorderSpan } from "./reorder-span.js";
70
71
  import { MovePlan, Ranked, movePlan } from "./move-plan.js";
71
72
  import { keptMeasure, measureFieldName } from "./buckets/buckets-of.js";
72
- export { type AddressCheck, type Availability, type CallCandidate, type CallClientMessage, type CallDescription, type CallGuestLink, type CallGuestRefusal, type CallGuestState, type CallLeftReason, type CallLobbyGuest, type CallMode, type CallRemoteTrack, type CallResume, type CallRing, type CallRosterMember, type CallServerMessage, type CallTrackRequest, type CallTrackSource, type CallVideoLayer, type FormulaNode, type KeyType, type Locale, type MobileReleaseAnswer, type MovePlan, type PathLookup, type PersonStatus, type PluginCapabilities, type PluginHost, type PluginRequirement, type PropShapes, type Ranked, type RecordUse, type RefShape, type ReleaseBinding, type ReorderSpan, type RunnerRegistration, type SearchTerm, type StatusInput, type TemplatePath, type WorkflowCacheAdvice, type WorkflowRunTrace, type WorkflowStatus, type WorkflowTraceHeld, type WorkflowTraceStep, type WorkflowTypeEntry, type WorkflowTypeList, actionConditionError, actionInputErrors, addressErrors, addressPlaceholders, apiOriginMeta, appHrefError, appReadMaxBytes, appReadParam, appReadUrl, applyAssistantEvent, authBasePath, availabilities, bareFilterFields, boardErrors, bottomBarFor, bridgeSocketPath, bridgeTokenParam, builtInFieldTypes, callsChannelEvent, capacitorOrigin, cardPhotoLimit, chartFields, checkEventFilter, checkedAccept, checkedProvider, confirmationMinutes, datesErrors, declineWord, decodeKey, defaultRecentLimit, deviceIdParam, devicesPath, displayFields, emailCodeMinutes, embeddedFilterFields, emptyAssistantState, encodeKey, fieldRefsIn, filePath, filesPath, fillAddress, fillAddressFrom, fillFilter, fillText, filterField, findField, firstPartyCodeKey, followableRowButton, grantsOf, guestCallsPath, heldCapabilities, heldStatus, historyIdParam, historyIdPattern, historyPath, hostPlaceholder, hrefField, hrefPlaceholders, humanize, inRange, isAppRead, isFieldRef, isGroupChart, isLocale, isUserTableName, keptMeasure, keyTypes, labelFieldOf, layoutItems, leavesApp, linkActionError, listColumnNames, locales, lookupLink, markFieldRefs, matchedSearchField, matchesSearch, maxLabelLength, maxNameBytes, maxOrganizationNameBytes, maxRelatedDepth, maxRelatedTerms, maxStatusText, measureFieldName, missingCapabilities, mobileReleaseBasePath, mobileReleaseParams, mobileReleasePath, mobileReleaseQuery, mobileReleasesPath, movePlan, navRecentErrors, navStartErrors, organizationColumn, parseCapability, parseFormula, parseSize, parseTable, parseTemplatePath, pickLocale, pluginProblem, promptError, promptFields, pruneByShape, pushRecord, readEventStream, recordJsonSchema, recordTitle, recordTitleField, recordValueAt, redactSecrets, relatedErrors, relatedTarget, releaseManifestFile, releaseStatementContext, releaseStatementFile, renderPrompt, reorderSpan, reservedFieldNames, reservedWords, resolvableStatuses, resourceField, ringNotice, ringsPath, rowButtonChoiceFields, rowButtonChoices, rowButtonErrors, rowButtonFields, rowButtonTarget, runnerRegistrationParam, runnerRegistrationPath, runnerRegistrationRoute, searchTerms, secondStepParam, serviceWorkerFile, shapes, shownInputs, splitRelated, statusPath, statusRuns, statusTextProblem, statusTones, storageNamePattern, storedFileRef, tableDisplay, tapUrl, templatePlaceholders, termMatches, textPlaceholders, unmarkFieldRefs, updateSetErrors, updateValues, userTableName, valueText, viewOfList, webhookResources, wholePlaceholder, withLookups, workflowResources, workflowRunParam, workflowRunTracePath, workflowRunTraceRoute, workflowRunsPath, workflowStatusTones, workflowStatuses, workflowTraceAfterParam, workflowTraceRevision, workflowTraceRevisionParam, workflowTypesPath };
73
+ export { type AddressCheck, type Availability, type CallCandidate, type CallClientMessage, type CallDescription, type CallGuestLink, type CallGuestRefusal, type CallGuestState, type CallLeftReason, type CallLobbyGuest, type CallMode, type CallRemoteTrack, type CallResume, type CallRing, type CallRosterMember, type CallServerMessage, type CallTrackRequest, type CallTrackSource, type CallVideoLayer, type FormulaNode, type KeyType, type Locale, type MobileReleaseAnswer, type MovePlan, type PathLookup, type PersonStatus, type PluginCapabilities, type PluginHost, type PluginRequirement, type PropShapes, type Ranked, type RecordUse, type RefShape, type ReleaseBinding, type ReorderSpan, type RunnerRegistration, type SearchTerm, type StatusInput, type TemplatePath, type WorkflowCacheAdvice, type WorkflowRunTrace, type WorkflowStatus, type WorkflowTraceHeld, type WorkflowTraceStep, type WorkflowTypeEntry, type WorkflowTypeList, actionConditionError, actionInputErrors, addressErrors, addressPlaceholders, apiOriginMeta, appHrefError, appReadMaxBytes, appReadParam, appReadUrl, applyAssistantEvent, authBasePath, availabilities, bareFilterFields, boardErrors, bottomBarFor, bridgeSocketPath, bridgeTokenParam, builtInFieldTypes, callsChannelEvent, capacitorOrigin, cardPhotoLimit, chartFields, checkEventFilter, checkedAccept, checkedProvider, confirmationMinutes, datesErrors, declineWord, decodeKey, defaultRecentLimit, deviceIdParam, devicesPath, displayFields, emailCodeMinutes, embeddedFilterFields, emptyAssistantState, encodeKey, fieldRefsIn, filePath, filesPath, fillAddress, fillAddressFrom, fillFilter, fillText, filterField, findField, firstPartyCodeKey, followableRowButton, grantsOf, guestCallsPath, heldCapabilities, heldStatus, historyIdParam, historyIdPattern, historyPath, hostPlaceholder, hrefField, hrefPlaceholders, humanize, inRange, isAppRead, isFieldRef, isGroupChart, isLocale, isUserTableName, keptMeasure, keyTypes, labelFieldOf, layoutItems, leavesApp, linkActionError, listColumnNames, locales, lookupLink, markFieldRefs, matchedSearchField, matchesSearch, maxLabelLength, maxNameBytes, maxOrganizationNameBytes, maxRelatedDepth, maxRelatedTerms, maxStatusText, measureFieldName, missingCapabilities, mobileReleaseBasePath, mobileReleaseParams, mobileReleasePath, mobileReleaseQuery, mobileReleasesPath, movePlan, navRecentErrors, navStartErrors, organizationColumn, parseCapability, parseFormula, parseSize, parseTable, parseTemplatePath, pickLocale, pluginProblem, promptError, promptFields, pruneByShape, pushRecord, readEventStream, recordJsonSchema, recordText, recordTitle, recordTitleField, recordValueAt, redactSecrets, relatedErrors, relatedTarget, releaseManifestFile, releaseStatementContext, releaseStatementFile, renderPrompt, reorderSpan, reservedFieldNames, reservedWords, resolvableStatuses, resourceField, ringNotice, ringsPath, rowButtonChoiceFields, rowButtonChoices, rowButtonErrors, rowButtonFields, rowButtonTarget, runnerRegistrationParam, runnerRegistrationPath, runnerRegistrationRoute, searchTerms, secondStepParam, serviceWorkerFile, shapes, shownInputs, splitRelated, statusPath, statusRuns, statusTextProblem, statusTones, storageNamePattern, storedFileRef, tableDisplay, tapUrl, templatePlaceholders, termMatches, textPlaceholders, unmarkFieldRefs, updateSetErrors, updateValues, userTableName, valueText, viewOfList, webhookResources, wholePlaceholder, withLookups, workflowResources, workflowRunParam, workflowRunTracePath, workflowRunTraceRoute, workflowRunsPath, workflowStatusTones, workflowStatuses, workflowTraceAfterParam, workflowTraceRevision, workflowTraceRevisionParam, workflowTypesPath };
package/dist/internal.js CHANGED
@@ -14,6 +14,7 @@ import { parseTable } from "./resource-model.js";
14
14
  import { layoutItems } from "./layout-items.js";
15
15
  import { viewOfList } from "./named-list.js";
16
16
  import { defaultRecentLimit, navRecentErrors, statusTones } from "./nav-recent.js";
17
+ import { recordText } from "./record-page.js";
17
18
  import { navStartErrors } from "./nav-start.js";
18
19
  import { actionInputErrors, shownInputs } from "./action-inputs.js";
19
20
  import { updateSetErrors, updateValues } from "./update-set.js";
@@ -68,4 +69,4 @@ import { guestCallsPath } from "./calls/call-guests.js";
68
69
  import { callsChannelEvent, declineWord, ringNotice, ringsPath } from "./calls/call-rings.js";
69
70
  import { reorderSpan } from "./reorder-span.js";
70
71
  import { movePlan } from "./move-plan.js";
71
- export { actionConditionError, actionInputErrors, addressErrors, addressPlaceholders, apiOriginMeta, appHrefError, appReadMaxBytes, appReadParam, appReadUrl, applyAssistantEvent, authBasePath, availabilities, bareFilterFields, boardErrors, bottomBarFor, bridgeSocketPath, bridgeTokenParam, builtInFieldTypes, callsChannelEvent, capacitorOrigin, cardPhotoLimit, chartFields, checkEventFilter, checkedAccept, checkedProvider, confirmationMinutes, datesErrors, declineWord, decodeKey, defaultRecentLimit, deviceIdParam, devicesPath, displayFields, emailCodeMinutes, embeddedFilterFields, emptyAssistantState, encodeKey, fieldRefsIn, filePath, filesPath, fillAddress, fillAddressFrom, fillFilter, fillText, filterField, findField, firstPartyCodeKey, followableRowButton, grantsOf, guestCallsPath, heldCapabilities, heldStatus, historyIdParam, historyIdPattern, historyPath, hostPlaceholder, hrefField, hrefPlaceholders, humanize, inRange, isAppRead, isFieldRef, isGroupChart, isLocale, isUserTableName, keptMeasure, keyTypes, labelFieldOf, layoutItems, leavesApp, linkActionError, listColumnNames, locales, lookupLink, markFieldRefs, matchedSearchField, matchesSearch, maxLabelLength, maxNameBytes, maxOrganizationNameBytes, maxRelatedDepth, maxRelatedTerms, maxStatusText, measureFieldName, missingCapabilities, mobileReleaseBasePath, mobileReleaseParams, mobileReleasePath, mobileReleaseQuery, mobileReleasesPath, movePlan, navRecentErrors, navStartErrors, organizationColumn, parseCapability, parseFormula, parseSize, parseTable, parseTemplatePath, pickLocale, pluginProblem, promptError, promptFields, pruneByShape, pushRecord, readEventStream, recordJsonSchema, recordTitle, recordTitleField, recordValueAt, redactSecrets, relatedErrors, relatedTarget, releaseManifestFile, releaseStatementContext, releaseStatementFile, renderPrompt, reorderSpan, reservedFieldNames, reservedWords, resolvableStatuses, resourceField, ringNotice, ringsPath, rowButtonChoiceFields, rowButtonChoices, rowButtonErrors, rowButtonFields, rowButtonTarget, runnerRegistrationParam, runnerRegistrationPath, runnerRegistrationRoute, searchTerms, secondStepParam, serviceWorkerFile, shapes, shownInputs, splitRelated, statusPath, statusRuns, statusTextProblem, statusTones, storageNamePattern, storedFileRef, tableDisplay, tapUrl, templatePlaceholders, termMatches, textPlaceholders, unmarkFieldRefs, updateSetErrors, updateValues, userTableName, valueText, viewOfList, webhookResources, wholePlaceholder, withLookups, workflowResources, workflowRunParam, workflowRunTracePath, workflowRunTraceRoute, workflowRunsPath, workflowStatusTones, workflowStatuses, workflowTraceAfterParam, workflowTraceRevision, workflowTraceRevisionParam, workflowTypesPath };
72
+ export { actionConditionError, actionInputErrors, addressErrors, addressPlaceholders, apiOriginMeta, appHrefError, appReadMaxBytes, appReadParam, appReadUrl, applyAssistantEvent, authBasePath, availabilities, bareFilterFields, boardErrors, bottomBarFor, bridgeSocketPath, bridgeTokenParam, builtInFieldTypes, callsChannelEvent, capacitorOrigin, cardPhotoLimit, chartFields, checkEventFilter, checkedAccept, checkedProvider, confirmationMinutes, datesErrors, declineWord, decodeKey, defaultRecentLimit, deviceIdParam, devicesPath, displayFields, emailCodeMinutes, embeddedFilterFields, emptyAssistantState, encodeKey, fieldRefsIn, filePath, filesPath, fillAddress, fillAddressFrom, fillFilter, fillText, filterField, findField, firstPartyCodeKey, followableRowButton, grantsOf, guestCallsPath, heldCapabilities, heldStatus, historyIdParam, historyIdPattern, historyPath, hostPlaceholder, hrefField, hrefPlaceholders, humanize, inRange, isAppRead, isFieldRef, isGroupChart, isLocale, isUserTableName, keptMeasure, keyTypes, labelFieldOf, layoutItems, leavesApp, linkActionError, listColumnNames, locales, lookupLink, markFieldRefs, matchedSearchField, matchesSearch, maxLabelLength, maxNameBytes, maxOrganizationNameBytes, maxRelatedDepth, maxRelatedTerms, maxStatusText, measureFieldName, missingCapabilities, mobileReleaseBasePath, mobileReleaseParams, mobileReleasePath, mobileReleaseQuery, mobileReleasesPath, movePlan, navRecentErrors, navStartErrors, organizationColumn, parseCapability, parseFormula, parseSize, parseTable, parseTemplatePath, pickLocale, pluginProblem, promptError, promptFields, pruneByShape, pushRecord, readEventStream, recordJsonSchema, recordText, recordTitle, recordTitleField, recordValueAt, redactSecrets, relatedErrors, relatedTarget, releaseManifestFile, releaseStatementContext, releaseStatementFile, renderPrompt, reorderSpan, reservedFieldNames, reservedWords, resolvableStatuses, resourceField, ringNotice, ringsPath, rowButtonChoiceFields, rowButtonChoices, rowButtonErrors, rowButtonFields, rowButtonTarget, runnerRegistrationParam, runnerRegistrationPath, runnerRegistrationRoute, searchTerms, secondStepParam, serviceWorkerFile, shapes, shownInputs, splitRelated, statusPath, statusRuns, statusTextProblem, statusTones, storageNamePattern, storedFileRef, tableDisplay, tapUrl, templatePlaceholders, termMatches, textPlaceholders, unmarkFieldRefs, updateSetErrors, updateValues, userTableName, valueText, viewOfList, webhookResources, wholePlaceholder, withLookups, workflowResources, workflowRunParam, workflowRunTracePath, workflowRunTraceRoute, workflowRunsPath, workflowStatusTones, workflowStatuses, workflowTraceAfterParam, workflowTraceRevision, workflowTraceRevisionParam, workflowTypesPath };
package/dist/model.d.ts CHANGED
@@ -1789,9 +1789,9 @@ export type ConversationPageModel = {
1789
1789
  * messages. The page opens the function's socket with the record's key as `key`, `/api/functions/<call>?key=<key>`.
1790
1790
  */
1791
1791
  call?: string;
1792
- /** The hint in the empty box. */
1792
+ /** The hint in the empty box; each `{{field}}` fills from the record, such as `'Message #{{name}}'`. */
1793
1793
  placeholder?: string;
1794
- /** What the conversation says while it has no messages. */
1794
+ /** What the conversation says while it has no messages; each `{{field}}` fills from the record. */
1795
1795
  empty?: string;
1796
1796
  /**
1797
1797
  * Says who else types, above the box, and tells the others while the reader types: `typing` events on the record's
@@ -1,4 +1,6 @@
1
1
  //#region src/record-page.d.ts
2
2
  /** The title rule that names a record after the people in a field of user ids other than the reader. */
3
3
  export declare const membersRule = "members";
4
+ /** A conversation page's text, its `placeholder` or `empty`, with each `{{field}}` filled from the record: an empty value fills as an empty string. */
5
+ export declare const recordText: (text: string, record: Record<string, unknown>) => string;
4
6
  //#endregion
@@ -1,11 +1,19 @@
1
+ import { recordValueAt } from "./template-path.js";
2
+ import { fillText, textPlaceholders, valueText } from "./address-template.js";
1
3
  //#region src/record-page.ts
2
4
  /** The title rule that names a record after the people in a field of user ids other than the reader. */
3
5
  const membersRule = "members";
4
6
  /** What is wrong with the record page's own fields, those a conversation's header reads of the record; empty when nothing is. */
5
7
  const recordPageErrors = (page, resource) => {
6
8
  if (!page || !("conversation" in page)) return [];
7
- const { subtitle, members } = page.conversation;
8
- return [...subtitle === void 0 || Object.hasOwn(resource.fields, subtitle) ? [] : [`conversation subtitle names field "${subtitle}", which the resource does not have`], ...members === void 0 || Object.hasOwn(resource.fields, members) ? [] : [`conversation members names field "${members}", which the resource does not have`]];
9
+ const { subtitle, members, placeholder, empty } = page.conversation;
10
+ const unknown = (prop, text) => textPlaceholders(text ?? "").filter((name) => !Object.hasOwn(resource.fields, name)).map((name) => `conversation ${prop} names field "${name}", which the resource does not have`);
11
+ return [
12
+ ...unknown("placeholder", placeholder),
13
+ ...unknown("empty", empty),
14
+ ...subtitle === void 0 || Object.hasOwn(resource.fields, subtitle) ? [] : [`conversation subtitle names field "${subtitle}", which the resource does not have`],
15
+ ...members === void 0 || Object.hasOwn(resource.fields, members) ? [] : [`conversation members names field "${members}", which the resource does not have`]
16
+ ];
9
17
  };
10
18
  /** The title a conversation page with `members` gives its record, after the people in it other than the reader. */
11
19
  const membersTitle = (page) => {
@@ -15,5 +23,7 @@ const membersTitle = (page) => {
15
23
  fields: [page.conversation.members]
16
24
  } };
17
25
  };
26
+ /** A conversation page's text, its `placeholder` or `empty`, with each `{{field}}` filled from the record: an empty value fills as an empty string. */
27
+ const recordText = (text, record) => fillText(text, (path) => valueText(recordValueAt(record, path)));
18
28
  //#endregion
19
- export { membersRule, membersTitle, recordPageErrors };
29
+ export { membersRule, membersTitle, recordPageErrors, recordText };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/schema",
3
- "version": "0.132.2",
3
+ "version": "0.133.0",
4
4
  "description": "Resource, field, view and access definitions for Protobase configs.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {