@protobase/schema 0.62.1 → 0.62.3

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.
@@ -33,6 +33,8 @@ export declare const addressWords: {
33
33
  readonly tab: "tab";
34
34
  /** A record's standard page, `standard=true`, on a view whose record page is a component of the app's own. */
35
35
  readonly standard: "standard";
36
+ /** A record page that joins the record's call, `call=join`, as a ring's Accept and a call mark's Join open it. */
37
+ readonly call: "call";
36
38
  };
37
39
  /** The path of `address` below `basePath` (such as `/admin`), every name and key encoded the one way the app reads them. */
38
40
  export declare const appPath: (address: AppAddress, basePath?: string) => string;
@@ -32,7 +32,9 @@ const addressWords = {
32
32
  /** A record page's shown tab, by title. */
33
33
  tab: "tab",
34
34
  /** A record's standard page, `standard=true`, on a view whose record page is a component of the app's own. */
35
- standard: "standard"
35
+ standard: "standard",
36
+ /** A record page that joins the record's call, `call=join`, as a ring's Accept and a call mark's Join open it. */
37
+ call: "call"
36
38
  };
37
39
  const listWords = [
38
40
  "list",
@@ -90,6 +92,7 @@ const recordQuery = (address) => {
90
92
  for (const title of address.open ?? []) query.append(addressWords.open, title);
91
93
  if (address.tab) query.set(addressWords.tab, address.tab);
92
94
  if (address.standard) query.set(addressWords.standard, "true");
95
+ if (address.call) query.set(addressWords.call, address.call);
93
96
  const text = query.toString();
94
97
  return text ? `?${text}` : "";
95
98
  };
@@ -143,6 +146,7 @@ const readAppPath = (pathAndQuery, pages) => {
143
146
  const open = [...new Set(url.searchParams.getAll(addressWords.open).filter((title) => title !== ""))];
144
147
  const tab = url.searchParams.get(addressWords.tab) || void 0;
145
148
  const standard = url.searchParams.get(addressWords.standard) === "true";
149
+ const call = url.searchParams.get(addressWords.call) === "join";
146
150
  return {
147
151
  kind: "record",
148
152
  resource: first,
@@ -150,7 +154,8 @@ const readAppPath = (pathAndQuery, pages) => {
150
154
  ...url.searchParams.get(addressWords.edit) === "true" && { edit: true },
151
155
  ...open.length > 0 && { open },
152
156
  ...tab && { tab },
153
- ...standard && { standard }
157
+ ...standard && { standard },
158
+ ...call && { call: "join" }
154
159
  };
155
160
  }
156
161
  const params = url.searchParams;
@@ -0,0 +1,32 @@
1
+ //#region src/calls/call-rings.d.ts
2
+ /**
3
+ * A call that rings the signed-in user now, as the open pages of the app show it: the call, its record, who started
4
+ * it, the ring's text, and how many milliseconds it still rings, by the server's clock.
5
+ */
6
+ export type CallRing = {
7
+ call: string;
8
+ resource: string;
9
+ /** The record's key as its URL has it. */
10
+ key: string;
11
+ started_by: string;
12
+ title: string;
13
+ body: string | null;
14
+ remaining_ms: number;
15
+ };
16
+ /**
17
+ * The resource name of the notices the live stream sends a user when the calls that ring them change, keyed by the
18
+ * user's id: no resource has a `$` in its name.
19
+ */
20
+ export declare const ringNotice = "$rings";
21
+ /** Decline, as a ring's path takes it. */
22
+ export declare const declineWord = "decline";
23
+ /**
24
+ * The path of the calls that ring the caller under the API's system path (`/api`), or of declining the ring of one
25
+ * call, `{ decline: call }`.
26
+ */
27
+ export declare const ringsPath: (systemPath: string, part?: {
28
+ decline: string;
29
+ }) => string;
30
+ /** The event a record's channel hears its calls on, from the server, with `{ items }` as `GET /{resource}/{key}:calls` answers. */
31
+ export declare const callsChannelEvent = "calls";
32
+ //#endregion
@@ -0,0 +1,21 @@
1
+ //#region src/calls/call-rings.ts
2
+ /**
3
+ * The resource name of the notices the live stream sends a user when the calls that ring them change, keyed by the
4
+ * user's id: no resource has a `$` in its name.
5
+ */
6
+ const ringNotice = "$rings";
7
+ /** Decline, as a ring's path takes it. */
8
+ const declineWord = "decline";
9
+ /**
10
+ * The path of the calls that ring the caller under the API's system path (`/api`), or of declining the ring of one
11
+ * call, `{ decline: call }`.
12
+ */
13
+ const ringsPath = (systemPath, part) => {
14
+ const base = `${systemPath}/calls/rings`;
15
+ if (part === void 0) return base;
16
+ return `${base}/${encodeURIComponent(part.decline)}/${declineWord}`;
17
+ };
18
+ /** The event a record's channel hears its calls on, from the server, with `{ items }` as `GET /{resource}/{key}:calls` answers. */
19
+ const callsChannelEvent = "calls";
20
+ //#endregion
21
+ export { callsChannelEvent, declineWord, ringNotice, ringsPath };
@@ -38,4 +38,5 @@ import { Availability, PersonStatus, StatusInput, availabilities, heldStatus, ma
38
38
  import { listColumnNames } from "./list-columns.js";
39
39
  import { builtInFieldTypes } from "./built-in-field-types.js";
40
40
  import { CallCandidate, CallClientMessage, CallDescription, CallLeftReason, CallMode, CallRemoteTrack, CallResume, CallRosterMember, CallServerMessage, CallTrackRequest, CallTrackSource, CallVideoLayer } from "./calls/call-protocol.js";
41
- export { type AddressCheck, type Availability, type CallCandidate, type CallClientMessage, type CallDescription, type CallLeftReason, type CallMode, type CallRemoteTrack, type CallResume, type CallRosterMember, type CallServerMessage, type CallTrackRequest, type CallTrackSource, type CallVideoLayer, type FormulaNode, type Locale, type MobileReleaseAnswer, type PersonStatus, type PluginHost, type PluginRequirement, type PropShapes, type RefShape, type ReleaseBinding, type SearchTerm, type StatusInput, actionConditionError, actionInputErrors, addressErrors, addressPlaceholders, apiOriginMeta, appHrefError, applyAssistantEvent, authBasePath, availabilities, boardErrors, bottomBarFor, builtInFieldTypes, capacitorOrigin, cardPhotoLimit, chartFields, checkEventFilter, checkedAccept, checkedProvider, datesErrors, decodeKey, defaultRecentLimit, deviceIdParam, devicesPath, displayFields, emptyAssistantState, encodeKey, fieldRefsIn, fillAddress, heldStatus, historyIdParam, historyIdPattern, historyPath, hrefField, hrefPlaceholders, humanize, inRange, isFieldRef, isGroupChart, isLocale, labelFieldOf, layoutItems, leavesApp, linkActionError, listColumnNames, locales, markFieldRefs, matchedSearchField, matchesSearch, maxStatusText, mobileReleaseBasePath, mobileReleaseParams, mobileReleasePath, mobileReleaseQuery, mobileReleasesPath, navRecentErrors, parseCapability, parseFormula, parseSize, parseTable, pickLocale, pluginProblem, promptError, promptFields, pruneByShape, pushRecord, readEventStream, recordTitle, recordTitleField, redactSecrets, releaseManifestFile, releaseStatementContext, releaseStatementFile, renderPrompt, searchTerms, serviceWorkerFile, shapes, shownInputs, statusPath, statusTextProblem, statusTones, tableDisplay, termMatches, unmarkFieldRefs, updateSetErrors, updateValues, viewOfList, webhookResources };
41
+ import { CallRing, callsChannelEvent, declineWord, ringNotice, ringsPath } from "./calls/call-rings.js";
42
+ export { type AddressCheck, type Availability, type CallCandidate, type CallClientMessage, type CallDescription, type CallLeftReason, type CallMode, type CallRemoteTrack, type CallResume, type CallRing, type CallRosterMember, type CallServerMessage, type CallTrackRequest, type CallTrackSource, type CallVideoLayer, type FormulaNode, type Locale, type MobileReleaseAnswer, type PersonStatus, type PluginHost, type PluginRequirement, type PropShapes, type RefShape, type ReleaseBinding, type SearchTerm, type StatusInput, actionConditionError, actionInputErrors, addressErrors, addressPlaceholders, apiOriginMeta, appHrefError, applyAssistantEvent, authBasePath, availabilities, boardErrors, bottomBarFor, builtInFieldTypes, callsChannelEvent, capacitorOrigin, cardPhotoLimit, chartFields, checkEventFilter, checkedAccept, checkedProvider, datesErrors, declineWord, decodeKey, defaultRecentLimit, deviceIdParam, devicesPath, displayFields, emptyAssistantState, encodeKey, fieldRefsIn, fillAddress, heldStatus, historyIdParam, historyIdPattern, historyPath, hrefField, hrefPlaceholders, humanize, inRange, isFieldRef, isGroupChart, isLocale, labelFieldOf, layoutItems, leavesApp, linkActionError, listColumnNames, locales, markFieldRefs, matchedSearchField, matchesSearch, maxStatusText, mobileReleaseBasePath, mobileReleaseParams, mobileReleasePath, mobileReleaseQuery, mobileReleasesPath, navRecentErrors, parseCapability, parseFormula, parseSize, parseTable, pickLocale, pluginProblem, promptError, promptFields, pruneByShape, pushRecord, readEventStream, recordTitle, recordTitleField, redactSecrets, releaseManifestFile, releaseStatementContext, releaseStatementFile, renderPrompt, ringNotice, ringsPath, searchTerms, serviceWorkerFile, shapes, shownInputs, statusPath, statusTextProblem, statusTones, tableDisplay, termMatches, unmarkFieldRefs, updateSetErrors, updateValues, viewOfList, webhookResources };
package/dist/internal.js CHANGED
@@ -37,4 +37,5 @@ import { historyIdParam, historyIdPattern, historyPath } from "./history-path.js
37
37
  import { availabilities, heldStatus, maxStatusText, statusPath, statusTextProblem } from "./status.js";
38
38
  import { listColumnNames } from "./list-columns.js";
39
39
  import { builtInFieldTypes } from "./built-in-field-types.js";
40
- export { actionConditionError, actionInputErrors, addressErrors, addressPlaceholders, apiOriginMeta, appHrefError, applyAssistantEvent, authBasePath, availabilities, boardErrors, bottomBarFor, builtInFieldTypes, capacitorOrigin, cardPhotoLimit, chartFields, checkEventFilter, checkedAccept, checkedProvider, datesErrors, decodeKey, defaultRecentLimit, deviceIdParam, devicesPath, displayFields, emptyAssistantState, encodeKey, fieldRefsIn, fillAddress, heldStatus, historyIdParam, historyIdPattern, historyPath, hrefField, hrefPlaceholders, humanize, inRange, isFieldRef, isGroupChart, isLocale, labelFieldOf, layoutItems, leavesApp, linkActionError, listColumnNames, locales, markFieldRefs, matchedSearchField, matchesSearch, maxStatusText, mobileReleaseBasePath, mobileReleaseParams, mobileReleasePath, mobileReleaseQuery, mobileReleasesPath, navRecentErrors, parseCapability, parseFormula, parseSize, parseTable, pickLocale, pluginProblem, promptError, promptFields, pruneByShape, pushRecord, readEventStream, recordTitle, recordTitleField, redactSecrets, releaseManifestFile, releaseStatementContext, releaseStatementFile, renderPrompt, searchTerms, serviceWorkerFile, shapes, shownInputs, statusPath, statusTextProblem, statusTones, tableDisplay, termMatches, unmarkFieldRefs, updateSetErrors, updateValues, viewOfList, webhookResources };
40
+ import { callsChannelEvent, declineWord, ringNotice, ringsPath } from "./calls/call-rings.js";
41
+ export { actionConditionError, actionInputErrors, addressErrors, addressPlaceholders, apiOriginMeta, appHrefError, applyAssistantEvent, authBasePath, availabilities, boardErrors, bottomBarFor, builtInFieldTypes, callsChannelEvent, capacitorOrigin, cardPhotoLimit, chartFields, checkEventFilter, checkedAccept, checkedProvider, datesErrors, declineWord, decodeKey, defaultRecentLimit, deviceIdParam, devicesPath, displayFields, emptyAssistantState, encodeKey, fieldRefsIn, fillAddress, heldStatus, historyIdParam, historyIdPattern, historyPath, hrefField, hrefPlaceholders, humanize, inRange, isFieldRef, isGroupChart, isLocale, labelFieldOf, layoutItems, leavesApp, linkActionError, listColumnNames, locales, markFieldRefs, matchedSearchField, matchesSearch, maxStatusText, mobileReleaseBasePath, mobileReleaseParams, mobileReleasePath, mobileReleaseQuery, mobileReleasesPath, navRecentErrors, parseCapability, parseFormula, parseSize, parseTable, pickLocale, pluginProblem, promptError, promptFields, pruneByShape, pushRecord, readEventStream, recordTitle, recordTitleField, redactSecrets, releaseManifestFile, releaseStatementContext, releaseStatementFile, renderPrompt, ringNotice, ringsPath, searchTerms, serviceWorkerFile, shapes, shownInputs, statusPath, statusTextProblem, statusTones, tableDisplay, termMatches, unmarkFieldRefs, updateSetErrors, updateValues, viewOfList, webhookResources };
package/dist/model.d.ts CHANGED
@@ -282,6 +282,8 @@ export type AppAddress = {
282
282
  * component of the app's own (`.record({ component })`). A view without one ignores it.
283
283
  */
284
284
  standard?: boolean;
285
+ /** `join` when the page joins the record's call, as a ring's Accept and a call mark's Join open it. */
286
+ call?: 'join';
285
287
  } | {
286
288
  /** The form for a new record. */
287
289
  kind: 'create';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/schema",
3
- "version": "0.62.1",
3
+ "version": "0.62.3",
4
4
  "description": "Resource, field, view and access definitions for Protobase configs.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {