@aspan-corporation/ac-shared 1.2.37 → 1.2.38

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.
@@ -15,8 +15,21 @@ export declare const TAG_DIARY_TITLE = "ac:diary:title";
15
15
  export declare const TAG_DIARY_PREVIEW = "ac:diary:preview";
16
16
  /** One per embedded photo: value is the referenced media key. */
17
17
  export declare const TAG_DIARY_PHOTO = "ac:diary:photo";
18
+ /** One per embedded audio recording: value is the referenced diary key. */
19
+ export declare const TAG_DIARY_AUDIO = "ac:diary:audio";
18
20
  /** Namespace for body word tokens: `ac:text:<word>`. */
19
21
  export declare const TEXT_TOKEN_PREFIX = "ac:text:";
22
+ /**
23
+ * Audio formats a browser MediaRecorder can produce: Safari records
24
+ * audio/mp4 (.m4a), Chromium/Firefox audio/webm or audio/ogg (opus).
25
+ * Deliberately kept SEPARATE from the image-only `isAllowedExtension`
26
+ * (thumbsKey.ts) — that allowlist is what keeps diary audio out of the
27
+ * meta-extractor/resizer dispatch on save, so recordings stay entry-only
28
+ * (no meta item, never in browse/search).
29
+ */
30
+ export declare const AUDIO_EXTENSIONS: string[];
31
+ /** True when a key's extension is a supported diary audio format. */
32
+ export declare const isAllowedAudioExtension: (key: string) => boolean;
20
33
  /** Max body characters surfaced in the preview tag. */
21
34
  export declare const DIARY_PREVIEW_LENGTH = 160;
22
35
  /** Upper bound on distinct word tokens written per entry (bounds item size). */
@@ -5,6 +5,7 @@
5
5
  * searchable by tokenising it into `ac:text:<word>` tags that ride the existing
6
6
  * inverted-index search table.
7
7
  */
8
+ import { getKeyExtension } from "./thumbsKey.js";
8
9
  /** Key prefix for every diary object (and the `folder`/id namespace). */
9
10
  export const DIARY_PREFIX = "diary/";
10
11
  /** Marks a meta item as a diary entry (value "true"). */
@@ -15,8 +16,21 @@ export const TAG_DIARY_TITLE = "ac:diary:title";
15
16
  export const TAG_DIARY_PREVIEW = "ac:diary:preview";
16
17
  /** One per embedded photo: value is the referenced media key. */
17
18
  export const TAG_DIARY_PHOTO = "ac:diary:photo";
19
+ /** One per embedded audio recording: value is the referenced diary key. */
20
+ export const TAG_DIARY_AUDIO = "ac:diary:audio";
18
21
  /** Namespace for body word tokens: `ac:text:<word>`. */
19
22
  export const TEXT_TOKEN_PREFIX = "ac:text:";
23
+ /**
24
+ * Audio formats a browser MediaRecorder can produce: Safari records
25
+ * audio/mp4 (.m4a), Chromium/Firefox audio/webm or audio/ogg (opus).
26
+ * Deliberately kept SEPARATE from the image-only `isAllowedExtension`
27
+ * (thumbsKey.ts) — that allowlist is what keeps diary audio out of the
28
+ * meta-extractor/resizer dispatch on save, so recordings stay entry-only
29
+ * (no meta item, never in browse/search).
30
+ */
31
+ export const AUDIO_EXTENSIONS = ["m4a", "webm", "ogg"];
32
+ /** True when a key's extension is a supported diary audio format. */
33
+ export const isAllowedAudioExtension = (key) => AUDIO_EXTENSIONS.includes(getKeyExtension(key));
20
34
  /** Max body characters surfaced in the preview tag. */
21
35
  export const DIARY_PREVIEW_LENGTH = 160;
22
36
  /** Upper bound on distinct word tokens written per entry (bounds item size). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aspan-corporation/ac-shared",
3
- "version": "1.2.37",
3
+ "version": "1.2.38",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "exports": {