@protobase/schema 0.45.20 → 0.45.21
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/dist/history-path.d.ts +14 -0
- package/dist/history-path.js +19 -0
- package/dist/internal.d.ts +2 -1
- package/dist/internal.js +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/history-path.d.ts
|
|
2
|
+
/** What an entry id looks like in every history store: it goes into a path, so no `/`, `.`, `?`, `#` or `%`. */
|
|
3
|
+
export declare const historyIdPattern: RegExp;
|
|
4
|
+
/** The name of the entry id in the path that marks one entry of the history read. */
|
|
5
|
+
export declare const historyIdParam = "id";
|
|
6
|
+
/**
|
|
7
|
+
* The path of the caller's notification history under the API's system path (`/api`): the list itself, `unread` its
|
|
8
|
+
* unread count, `read` marking all read, or `{ read: id }` marking one entry read. An id that could leave the history's
|
|
9
|
+
* path, any but letters, digits, `_` and `-`, is refused.
|
|
10
|
+
*/
|
|
11
|
+
export declare const historyPath: (systemPath: string, part?: "unread" | "read" | {
|
|
12
|
+
read: string;
|
|
13
|
+
}) => string;
|
|
14
|
+
//#endregion
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/history-path.ts
|
|
2
|
+
/** What an entry id looks like in every history store: it goes into a path, so no `/`, `.`, `?`, `#` or `%`. */
|
|
3
|
+
const historyIdPattern = /^[A-Za-z0-9_-]{1,64}$/;
|
|
4
|
+
/** The name of the entry id in the path that marks one entry of the history read. */
|
|
5
|
+
const historyIdParam = "id";
|
|
6
|
+
/**
|
|
7
|
+
* The path of the caller's notification history under the API's system path (`/api`): the list itself, `unread` its
|
|
8
|
+
* unread count, `read` marking all read, or `{ read: id }` marking one entry read. An id that could leave the history's
|
|
9
|
+
* path, any but letters, digits, `_` and `-`, is refused.
|
|
10
|
+
*/
|
|
11
|
+
const historyPath = (systemPath, part) => {
|
|
12
|
+
const base = `${systemPath}/notifications/history`;
|
|
13
|
+
if (part === void 0) return base;
|
|
14
|
+
if (typeof part === "string") return `${base}/${part}`;
|
|
15
|
+
if (!historyIdPattern.test(part.read)) throw new Error("A history entry id is letters, digits, \"_\" and \"-\" only");
|
|
16
|
+
return `${base}/${part.read}/read`;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { historyIdParam, historyIdPattern, historyPath };
|
package/dist/internal.d.ts
CHANGED
|
@@ -31,4 +31,5 @@ import { authBasePath } from "./auth-base-path.js";
|
|
|
31
31
|
import { capacitorOrigin } from "./capacitor-origins.js";
|
|
32
32
|
import { pushRecord, serviceWorkerFile } from "./push-record.js";
|
|
33
33
|
import { deviceIdParam, devicesPath } from "./devices-path.js";
|
|
34
|
-
|
|
34
|
+
import { historyIdParam, historyIdPattern, historyPath } from "./history-path.js";
|
|
35
|
+
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, inRange, isFieldRef, isGroupChart, isLocale, layoutItems, leavesApp, linkActionError, locales, markFieldRefs, matchedSearchField, matchesSearch, mobileReleaseBasePath, mobileReleaseParams, mobileReleasePath, mobileReleaseQuery, mobileReleasesPath, navRecentErrors, parseCapability, parseFormula, parseSize, parseTable, pickLocale, pluginProblem, promptError, promptFields, pruneByShape, pushRecord, readEventStream, redactSecrets, releaseManifestFile, renderPrompt, searchTerms, serviceWorkerFile, shapes, shownInputs, statusTones, tableDisplay, termMatches, unmarkFieldRefs, updateSetErrors, updateValues, viewOfList, webhookResources };
|
package/dist/internal.js
CHANGED
|
@@ -31,4 +31,5 @@ import { authBasePath } from "./auth-base-path.js";
|
|
|
31
31
|
import { capacitorOrigin } from "./capacitor-origins.js";
|
|
32
32
|
import { pushRecord, serviceWorkerFile } from "./push-record.js";
|
|
33
33
|
import { deviceIdParam, devicesPath } from "./devices-path.js";
|
|
34
|
-
|
|
34
|
+
import { historyIdParam, historyIdPattern, historyPath } from "./history-path.js";
|
|
35
|
+
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, inRange, isFieldRef, isGroupChart, isLocale, layoutItems, leavesApp, linkActionError, locales, markFieldRefs, matchedSearchField, matchesSearch, mobileReleaseBasePath, mobileReleaseParams, mobileReleasePath, mobileReleaseQuery, mobileReleasesPath, navRecentErrors, parseCapability, parseFormula, parseSize, parseTable, pickLocale, pluginProblem, promptError, promptFields, pruneByShape, pushRecord, readEventStream, redactSecrets, releaseManifestFile, renderPrompt, searchTerms, serviceWorkerFile, shapes, shownInputs, statusTones, tableDisplay, termMatches, unmarkFieldRefs, updateSetErrors, updateValues, viewOfList, webhookResources };
|