@protobase/schema 0.54.6 → 0.55.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.
@@ -0,0 +1,9 @@
1
+ //#region src/built-in-field-types.d.ts
2
+ /**
3
+ * The field types Protobase brings, which a view chooses with `.widget(name)` like a plugin's, by the storage types
4
+ * each shows: `members`, a JSON array of the user ids of an organization's members. A plugin's of the same name wins.
5
+ */
6
+ export declare const builtInFieldTypes: {
7
+ readonly members: readonly ["json"];
8
+ };
9
+ //#endregion
@@ -0,0 +1,8 @@
1
+ //#region src/built-in-field-types.ts
2
+ /**
3
+ * The field types Protobase brings, which a view chooses with `.widget(name)` like a plugin's, by the storage types
4
+ * each shows: `members`, a JSON array of the user ids of an organization's members. A plugin's of the same name wins.
5
+ */
6
+ const builtInFieldTypes = { members: ["json"] };
7
+ //#endregion
8
+ export { builtInFieldTypes };
@@ -35,4 +35,5 @@ import { pushRecord, serviceWorkerFile } from "./push-record.js";
35
35
  import { deviceIdParam, devicesPath } from "./devices-path.js";
36
36
  import { historyIdParam, historyIdPattern, historyPath } from "./history-path.js";
37
37
  import { listColumnNames } from "./list-columns.js";
38
- export { type AddressCheck, type FormulaNode, type Locale, type MobileReleaseAnswer, type PluginHost, type PluginRequirement, type PropShapes, type RefShape, type SearchTerm, actionConditionError, actionInputErrors, addressErrors, addressPlaceholders, apiOriginMeta, appHrefError, applyAssistantEvent, authBasePath, boardErrors, bottomBarFor, capacitorOrigin, cardPhotoLimit, chartFields, checkEventFilter, checkedAccept, checkedProvider, datesErrors, decodeKey, defaultRecentLimit, deviceIdParam, devicesPath, displayFields, emptyAssistantState, encodeKey, fieldRefsIn, fillAddress, historyIdParam, historyIdPattern, historyPath, hrefField, hrefPlaceholders, humanize, inRange, isFieldRef, isGroupChart, isLocale, labelFieldOf, layoutItems, leavesApp, linkActionError, listColumnNames, locales, markFieldRefs, matchedSearchField, matchesSearch, mobileReleaseBasePath, mobileReleaseParams, mobileReleasePath, mobileReleaseQuery, mobileReleasesPath, navRecentErrors, parseCapability, parseFormula, parseSize, parseTable, pickLocale, pluginProblem, promptError, promptFields, pruneByShape, pushRecord, readEventStream, recordTitle, recordTitleField, redactSecrets, releaseManifestFile, renderPrompt, searchTerms, serviceWorkerFile, shapes, shownInputs, statusTones, tableDisplay, termMatches, unmarkFieldRefs, updateSetErrors, updateValues, viewOfList, webhookResources };
38
+ import { builtInFieldTypes } from "./built-in-field-types.js";
39
+ export { type AddressCheck, type FormulaNode, type Locale, type MobileReleaseAnswer, type PluginHost, type PluginRequirement, type PropShapes, type RefShape, type SearchTerm, actionConditionError, actionInputErrors, addressErrors, addressPlaceholders, apiOriginMeta, appHrefError, applyAssistantEvent, authBasePath, boardErrors, bottomBarFor, builtInFieldTypes, capacitorOrigin, cardPhotoLimit, chartFields, checkEventFilter, checkedAccept, checkedProvider, datesErrors, decodeKey, defaultRecentLimit, deviceIdParam, devicesPath, displayFields, emptyAssistantState, encodeKey, fieldRefsIn, fillAddress, historyIdParam, historyIdPattern, historyPath, hrefField, hrefPlaceholders, humanize, inRange, isFieldRef, isGroupChart, isLocale, labelFieldOf, layoutItems, leavesApp, linkActionError, listColumnNames, locales, markFieldRefs, matchedSearchField, matchesSearch, mobileReleaseBasePath, mobileReleaseParams, mobileReleasePath, mobileReleaseQuery, mobileReleasesPath, navRecentErrors, parseCapability, parseFormula, parseSize, parseTable, pickLocale, pluginProblem, promptError, promptFields, pruneByShape, pushRecord, readEventStream, recordTitle, recordTitleField, redactSecrets, releaseManifestFile, renderPrompt, searchTerms, serviceWorkerFile, shapes, shownInputs, statusTones, tableDisplay, termMatches, unmarkFieldRefs, updateSetErrors, updateValues, viewOfList, webhookResources };
package/dist/internal.js CHANGED
@@ -35,4 +35,5 @@ import { pushRecord, serviceWorkerFile } from "./push-record.js";
35
35
  import { deviceIdParam, devicesPath } from "./devices-path.js";
36
36
  import { historyIdParam, historyIdPattern, historyPath } from "./history-path.js";
37
37
  import { listColumnNames } from "./list-columns.js";
38
- export { actionConditionError, actionInputErrors, addressErrors, addressPlaceholders, apiOriginMeta, appHrefError, applyAssistantEvent, authBasePath, boardErrors, bottomBarFor, capacitorOrigin, cardPhotoLimit, chartFields, checkEventFilter, checkedAccept, checkedProvider, datesErrors, decodeKey, defaultRecentLimit, deviceIdParam, devicesPath, displayFields, emptyAssistantState, encodeKey, fieldRefsIn, fillAddress, historyIdParam, historyIdPattern, historyPath, hrefField, hrefPlaceholders, humanize, inRange, isFieldRef, isGroupChart, isLocale, labelFieldOf, layoutItems, leavesApp, linkActionError, listColumnNames, locales, markFieldRefs, matchedSearchField, matchesSearch, mobileReleaseBasePath, mobileReleaseParams, mobileReleasePath, mobileReleaseQuery, mobileReleasesPath, navRecentErrors, parseCapability, parseFormula, parseSize, parseTable, pickLocale, pluginProblem, promptError, promptFields, pruneByShape, pushRecord, readEventStream, recordTitle, recordTitleField, redactSecrets, releaseManifestFile, renderPrompt, searchTerms, serviceWorkerFile, shapes, shownInputs, statusTones, tableDisplay, termMatches, unmarkFieldRefs, updateSetErrors, updateValues, viewOfList, webhookResources };
38
+ import { builtInFieldTypes } from "./built-in-field-types.js";
39
+ export { actionConditionError, actionInputErrors, addressErrors, addressPlaceholders, apiOriginMeta, appHrefError, applyAssistantEvent, authBasePath, boardErrors, bottomBarFor, builtInFieldTypes, capacitorOrigin, cardPhotoLimit, chartFields, checkEventFilter, checkedAccept, checkedProvider, datesErrors, decodeKey, defaultRecentLimit, deviceIdParam, devicesPath, displayFields, emptyAssistantState, encodeKey, fieldRefsIn, fillAddress, historyIdParam, historyIdPattern, historyPath, hrefField, hrefPlaceholders, humanize, inRange, isFieldRef, isGroupChart, isLocale, labelFieldOf, layoutItems, leavesApp, linkActionError, listColumnNames, locales, markFieldRefs, matchedSearchField, matchesSearch, mobileReleaseBasePath, mobileReleaseParams, mobileReleasePath, mobileReleaseQuery, mobileReleasesPath, navRecentErrors, parseCapability, parseFormula, parseSize, parseTable, pickLocale, pluginProblem, promptError, promptFields, pruneByShape, pushRecord, readEventStream, recordTitle, recordTitleField, redactSecrets, releaseManifestFile, renderPrompt, searchTerms, serviceWorkerFile, shapes, shownInputs, statusTones, tableDisplay, termMatches, unmarkFieldRefs, updateSetErrors, updateValues, viewOfList, webhookResources };
package/dist/model.d.ts CHANGED
@@ -327,8 +327,9 @@ export type FieldViewModel = {
327
327
  /** `arrow` draws the field's badges as arrows pointing right, as on a rating scale such as the EU energy label. */
328
328
  badgeShape?: BadgeShape;
329
329
  /**
330
- * The field type a plugin registers (`definePlugin({ fields })`) that shows and edits this field, with its props;
331
- * without that plugin, or for a storage type it does not show, the field shows as it would without it.
330
+ * The field type a plugin registers (`definePlugin({ fields })`), or a built-in one such as `members`, that shows and
331
+ * edits this field, with its props; without it, or for a storage type it does not show, the field shows as it would
332
+ * without it.
332
333
  */
333
334
  widget?: FieldWidgetModel;
334
335
  };
@@ -611,7 +612,7 @@ export type ParentAccess = 'read' | 'update';
611
612
  /**
612
613
  * A record that a resource's records belong to through a relation field, such as an operation's VM: creating, changing,
613
614
  * deleting or undeleting a record needs `access` on the record `field` points at, checked with the caller's own access
614
- * rules on that resource. See
615
+ * rules on that resource; with `read`, every read of its records keeps to those whose parent the caller reads. See
615
616
  * [Records that belong to another](website/src/content/docs/reference/access.mdx#records-that-belong-to-another).
616
617
  */
617
618
  export type ParentModel = {
@@ -114,8 +114,9 @@ export declare class ResourceBuilder<F extends FieldsInput = {}, K = never> {
114
114
  /**
115
115
  * A relation whose record each record belongs to, and the access on it writing them needs: creating a record, changing
116
116
  * it (the parent it leaves and the one it moves to), deleting and undeleting it all need `access` on the parent,
117
- * checked with the caller's own access rules on its resource and locked until the write commits. A null relation
118
- * checks nothing; each call adds a check. See
117
+ * checked with the caller's own access rules on its resource and locked until the write commits. With `read`, every
118
+ * read of its records (lists, counts, aggregates, gets and labels) also keeps to those whose parent the caller reads
119
+ * there. A null relation checks nothing; each call adds a check. See
119
120
  * [Records that belong to another](website/src/content/docs/reference/access.mdx#records-that-belong-to-another).
120
121
  *
121
122
  * @example
package/dist/resource.js CHANGED
@@ -121,8 +121,9 @@ var ResourceBuilder = class ResourceBuilder {
121
121
  /**
122
122
  * A relation whose record each record belongs to, and the access on it writing them needs: creating a record, changing
123
123
  * it (the parent it leaves and the one it moves to), deleting and undeleting it all need `access` on the parent,
124
- * checked with the caller's own access rules on its resource and locked until the write commits. A null relation
125
- * checks nothing; each call adds a check. See
124
+ * checked with the caller's own access rules on its resource and locked until the write commits. With `read`, every
125
+ * read of its records (lists, counts, aggregates, gets and labels) also keeps to those whose parent the caller reads
126
+ * there. A null relation checks nothing; each call adds a check. See
126
127
  * [Records that belong to another](website/src/content/docs/reference/access.mdx#records-that-belong-to-another).
127
128
  *
128
129
  * @example
@@ -67,7 +67,9 @@ export declare class FieldView<N extends string = string, V = unknown> {
67
67
  icon(icon: string): FieldView<N, V>;
68
68
  /**
69
69
  * Shows and edits the field with the field type a plugin registers under `name` (`definePlugin({ fields })`), given
70
- * `props`, such as `r.score.widget('rating', { max: 5 })`. Without that plugin, or when the field type does not show
70
+ * `props`, such as `r.score.widget('rating', { max: 5 })`, or with the built-in `members`, which picks an
71
+ * organization's members into a JSON array of user ids (see
72
+ * [Members](website/src/content/docs/reference/plugins.md#members)). Without that field type, or when it does not show
71
73
  * this field's storage type, the field shows as it would without it.
72
74
  */
73
75
  widget(name: string, props?: Record<string, JsonValue>): FieldView<N, V>;
@@ -103,7 +103,9 @@ var FieldView = class FieldView {
103
103
  }
104
104
  /**
105
105
  * Shows and edits the field with the field type a plugin registers under `name` (`definePlugin({ fields })`), given
106
- * `props`, such as `r.score.widget('rating', { max: 5 })`. Without that plugin, or when the field type does not show
106
+ * `props`, such as `r.score.widget('rating', { max: 5 })`, or with the built-in `members`, which picks an
107
+ * organization's members into a JSON array of user ids (see
108
+ * [Members](website/src/content/docs/reference/plugins.md#members)). Without that field type, or when it does not show
107
109
  * this field's storage type, the field shows as it would without it.
108
110
  */
109
111
  widget(name, props) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/schema",
3
- "version": "0.54.6",
3
+ "version": "0.55.1",
4
4
  "description": "Resource, field, view and access definitions for Protobase configs.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {