@realiizlabs/admin 0.13.0 → 0.13.2

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.
Files changed (43) hide show
  1. package/dist/events/index.cjs +1 -1
  2. package/dist/events/index.cjs.map +1 -1
  3. package/dist/events/index.d.cts +2 -0
  4. package/dist/events/index.d.ts +2 -0
  5. package/dist/events/index.js +1 -1
  6. package/dist/events/index.js.map +1 -1
  7. package/dist/forms/index.cjs +1 -1
  8. package/dist/forms/index.cjs.map +1 -1
  9. package/dist/forms/index.d.cts +2 -2
  10. package/dist/forms/index.d.ts +2 -2
  11. package/dist/forms/index.js +1 -1
  12. package/dist/forms/index.js.map +1 -1
  13. package/dist/forms-ui/index.d.cts +1 -1
  14. package/dist/forms-ui/index.d.ts +1 -1
  15. package/dist/media/index.cjs +33 -0
  16. package/dist/media/index.cjs.map +1 -1
  17. package/dist/media/index.d.cts +2 -0
  18. package/dist/media/index.d.ts +2 -0
  19. package/dist/media/index.js +30 -1
  20. package/dist/media/index.js.map +1 -1
  21. package/dist/shell/index.cjs +7 -1
  22. package/dist/shell/index.cjs.map +1 -1
  23. package/dist/shell/index.d.cts +2 -2
  24. package/dist/shell/index.d.ts +2 -2
  25. package/dist/shell/index.js +7 -1
  26. package/dist/shell/index.js.map +1 -1
  27. package/dist/studio/index.cjs +1 -1
  28. package/dist/studio/index.cjs.map +1 -1
  29. package/dist/studio/index.d.cts +4 -42
  30. package/dist/studio/index.d.ts +4 -42
  31. package/dist/studio/index.js +1 -1
  32. package/dist/studio/index.js.map +1 -1
  33. package/dist/studio-ui/index.cjs +7 -1
  34. package/dist/studio-ui/index.cjs.map +1 -1
  35. package/dist/studio-ui/index.d.cts +1 -1
  36. package/dist/studio-ui/index.d.ts +1 -1
  37. package/dist/studio-ui/index.js +7 -1
  38. package/dist/studio-ui/index.js.map +1 -1
  39. package/dist/{types-D46UjOfv.d.cts → types-DeHdasdP.d.cts} +2 -0
  40. package/dist/{types-D46UjOfv.d.ts → types-DeHdasdP.d.ts} +2 -0
  41. package/dist/validate-C84Ll1cD.d.cts +41 -0
  42. package/dist/validate-C84Ll1cD.d.ts +41 -0
  43. package/package.json +1 -1
@@ -1,51 +1,13 @@
1
+ import { c as ImagePayload } from '../validate-C84Ll1cD.cjs';
2
+ export { I as IMAGE_ERRORS, a as IMAGE_LIMITS, b as ImageLimits, V as ValidatedImages, d as decodedSize, v as validateImages } from '../validate-C84Ll1cD.cjs';
1
3
  import { a as IdentityUser, f as SiteRole, C as CookieStore, d as SiteMember, I as IdentityClient, c as SiteBranding } from '../members-nhbRSYyr.cjs';
2
4
  import { a as PullRequestStatus } from '../types-BP5G1myE.cjs';
3
- import { C as ContentTypeEntry } from '../types-D46UjOfv.cjs';
5
+ import { C as ContentTypeEntry } from '../types-DeHdasdP.cjs';
4
6
  import * as zod from 'zod';
5
7
  import * as zod_v4_core from 'zod/v4/core';
6
8
  import { R as RequireOptions } from '../roles-BjWuj2_v.cjs';
7
9
  import '@supabase/supabase-js';
8
10
 
9
- /**
10
- * Server-side checks on the pictures a save carries. Pure.
11
- *
12
- * The browser already shrank them, but anyone can POST to a server action, so
13
- * the path, type and size are re-checked before anything is committed: only
14
- * WebP under the type's public folder, ≤ 800 KB each, ≤ 3.5 MB per save.
15
- * Frontmatter paths are URL paths (/blog/x.webp); the repo file lives under public/.
16
- */
17
- interface ImagePayload {
18
- /** URL path as written in the frontmatter or body, e.g. /blog/my-post.webp. */
19
- path: string;
20
- /** Base64 of the WebP bytes. */
21
- base64: string;
22
- }
23
- interface ImageLimits {
24
- maxEach: number;
25
- maxTotal: number;
26
- /** URL prefix pictures must live under. */
27
- prefix: string;
28
- }
29
- declare const IMAGE_LIMITS: ImageLimits;
30
- declare const IMAGE_ERRORS: {
31
- readonly path: "That image path isn’t allowed.";
32
- readonly size: "That picture is too large to send — try a smaller one.";
33
- };
34
- type ValidatedImages = {
35
- ok: true;
36
- files: {
37
- path: string;
38
- content: string;
39
- encoding: "base64";
40
- }[];
41
- } | {
42
- ok: false;
43
- error: string;
44
- };
45
- /** Bytes a base64 string decodes to, without decoding it. */
46
- declare function decodedSize(b64: string): number;
47
- declare function validateImages(images: ImagePayload[], limits?: ImageLimits): ValidatedImages;
48
-
49
11
  /**
50
12
  * The contract between a site and its Studio. Everything a site knows and the
51
13
  * package cannot — env values, cookies, the request's origin, its registry —
@@ -322,4 +284,4 @@ type Studio = ReturnType<typeof createStudio>;
322
284
  type StudioActions = Studio["actions"];
323
285
  type StudioReaders = Studio["readers"];
324
286
 
325
- export { type ActionResult, type DiscardOutcome, IMAGE_ERRORS, IMAGE_LIMITS, type IdentityConfig, type ImageLimits, type ImagePayload, type ListItem, type Located, type MergeOutcome, NotHere, type PendingChange, type PendingState, type PrSummary, type PublishInput, type PublishResult, type RepoConfig, type ServiceConfig, type Session, type Studio, type StudioActions, type StudioConfig, type StudioEnv, type StudioReaders, type TeamState, type ValidatedImages, createStudio, decodedSize, pendingLabel, pendingText, validateImages };
287
+ export { type ActionResult, type DiscardOutcome, type IdentityConfig, ImagePayload, type ListItem, type Located, type MergeOutcome, NotHere, type PendingChange, type PendingState, type PrSummary, type PublishInput, type PublishResult, type RepoConfig, type ServiceConfig, type Session, type Studio, type StudioActions, type StudioConfig, type StudioEnv, type StudioReaders, type TeamState, createStudio, pendingLabel, pendingText };
@@ -1,51 +1,13 @@
1
+ import { c as ImagePayload } from '../validate-C84Ll1cD.js';
2
+ export { I as IMAGE_ERRORS, a as IMAGE_LIMITS, b as ImageLimits, V as ValidatedImages, d as decodedSize, v as validateImages } from '../validate-C84Ll1cD.js';
1
3
  import { a as IdentityUser, f as SiteRole, C as CookieStore, d as SiteMember, I as IdentityClient, c as SiteBranding } from '../members-nhbRSYyr.js';
2
4
  import { a as PullRequestStatus } from '../types-BP5G1myE.js';
3
- import { C as ContentTypeEntry } from '../types-D46UjOfv.js';
5
+ import { C as ContentTypeEntry } from '../types-DeHdasdP.js';
4
6
  import * as zod from 'zod';
5
7
  import * as zod_v4_core from 'zod/v4/core';
6
8
  import { R as RequireOptions } from '../roles-Dnwj-DAm.js';
7
9
  import '@supabase/supabase-js';
8
10
 
9
- /**
10
- * Server-side checks on the pictures a save carries. Pure.
11
- *
12
- * The browser already shrank them, but anyone can POST to a server action, so
13
- * the path, type and size are re-checked before anything is committed: only
14
- * WebP under the type's public folder, ≤ 800 KB each, ≤ 3.5 MB per save.
15
- * Frontmatter paths are URL paths (/blog/x.webp); the repo file lives under public/.
16
- */
17
- interface ImagePayload {
18
- /** URL path as written in the frontmatter or body, e.g. /blog/my-post.webp. */
19
- path: string;
20
- /** Base64 of the WebP bytes. */
21
- base64: string;
22
- }
23
- interface ImageLimits {
24
- maxEach: number;
25
- maxTotal: number;
26
- /** URL prefix pictures must live under. */
27
- prefix: string;
28
- }
29
- declare const IMAGE_LIMITS: ImageLimits;
30
- declare const IMAGE_ERRORS: {
31
- readonly path: "That image path isn’t allowed.";
32
- readonly size: "That picture is too large to send — try a smaller one.";
33
- };
34
- type ValidatedImages = {
35
- ok: true;
36
- files: {
37
- path: string;
38
- content: string;
39
- encoding: "base64";
40
- }[];
41
- } | {
42
- ok: false;
43
- error: string;
44
- };
45
- /** Bytes a base64 string decodes to, without decoding it. */
46
- declare function decodedSize(b64: string): number;
47
- declare function validateImages(images: ImagePayload[], limits?: ImageLimits): ValidatedImages;
48
-
49
11
  /**
50
12
  * The contract between a site and its Studio. Everything a site knows and the
51
13
  * package cannot — env values, cookies, the request's origin, its registry —
@@ -322,4 +284,4 @@ type Studio = ReturnType<typeof createStudio>;
322
284
  type StudioActions = Studio["actions"];
323
285
  type StudioReaders = Studio["readers"];
324
286
 
325
- export { type ActionResult, type DiscardOutcome, IMAGE_ERRORS, IMAGE_LIMITS, type IdentityConfig, type ImageLimits, type ImagePayload, type ListItem, type Located, type MergeOutcome, NotHere, type PendingChange, type PendingState, type PrSummary, type PublishInput, type PublishResult, type RepoConfig, type ServiceConfig, type Session, type Studio, type StudioActions, type StudioConfig, type StudioEnv, type StudioReaders, type TeamState, type ValidatedImages, createStudio, decodedSize, pendingLabel, pendingText, validateImages };
287
+ export { type ActionResult, type DiscardOutcome, type IdentityConfig, ImagePayload, type ListItem, type Located, type MergeOutcome, NotHere, type PendingChange, type PendingState, type PrSummary, type PublishInput, type PublishResult, type RepoConfig, type ServiceConfig, type Session, type Studio, type StudioActions, type StudioConfig, type StudioEnv, type StudioReaders, type TeamState, createStudio, pendingLabel, pendingText };
@@ -544,7 +544,7 @@ async function writeFiles(ctx, branch, files, message, opts = {}) {
544
544
  return { branch, commitSha: commit.sha, treeSha: newTree.sha, fileCount: files.length + remove.length };
545
545
  }
546
546
 
547
- // src/studio/images.ts
547
+ // src/media/validate.ts
548
548
  var IMAGE_LIMITS = { maxEach: 800 * 1024, maxTotal: 3.5 * 1024 * 1024, prefix: "/blog/" };
549
549
  var IMAGE_ERRORS = {
550
550
  path: "That image path isn\u2019t allowed.",