@tdacorp/hyle-sdk 0.17.0 → 0.22.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 (92) hide show
  1. package/README.md +261 -42
  2. package/dist/check-routes-bin.js +190 -53
  3. package/dist/{chunk-6VOHFFA5.js → chunk-7T5EEJHK.js} +2 -2
  4. package/dist/chunk-DUPT6XLB.js +57 -0
  5. package/dist/chunk-IW3TUD4G.js +841 -0
  6. package/dist/{chunk-MGSUQBDW.js → chunk-KU7LWK4E.js} +249 -24
  7. package/dist/{chunk-BUJFMR3M.js → chunk-QVYQM5R2.js} +15 -6
  8. package/dist/chunk-SFFBZFEN.js +178 -0
  9. package/dist/chunk-U74B7AUG.js +398 -0
  10. package/dist/chunk-ZIW6FDU2.js +1126 -0
  11. package/dist/client-BGjmEWhN.d.cts +207 -0
  12. package/dist/client-D0LTpr3Y.d.ts +207 -0
  13. package/dist/code-copy.cjs +74 -0
  14. package/dist/code-copy.d.cts +18 -0
  15. package/dist/code-copy.d.ts +18 -0
  16. package/dist/code-copy.js +50 -0
  17. package/dist/comments.cjs +738 -280
  18. package/dist/comments.d.cts +66 -3
  19. package/dist/comments.d.ts +66 -3
  20. package/dist/comments.js +419 -331
  21. package/dist/{diagram-viewer-FJPED4SN.js → diagram-viewer-XY3CG75U.js} +62 -21
  22. package/dist/docs-enhance.cjs +7 -4
  23. package/dist/docs-enhance.d.cts +5 -3
  24. package/dist/docs-enhance.d.ts +5 -3
  25. package/dist/docs-enhance.js +8 -5
  26. package/dist/{embed-DNTZ2UXv.d.ts → embed-CbtsbZs3.d.cts} +5 -3
  27. package/dist/{embed-BmdwA2G9.d.cts → embed-Cf_2ZR5x.d.ts} +5 -3
  28. package/dist/fragment-alias.cjs +51 -0
  29. package/dist/fragment-alias.d.cts +7 -0
  30. package/dist/fragment-alias.d.ts +7 -0
  31. package/dist/fragment-alias.js +27 -0
  32. package/dist/html.cjs +886 -0
  33. package/dist/html.d.cts +20 -0
  34. package/dist/html.d.ts +20 -0
  35. package/dist/html.js +45 -0
  36. package/dist/index.cjs +244 -24
  37. package/dist/index.d.cts +22 -68
  38. package/dist/index.d.ts +22 -68
  39. package/dist/index.js +12 -2
  40. package/dist/{labels-nmukKYgL.d.cts → labels-CrA-iqTN.d.cts} +9 -0
  41. package/dist/{labels-nmukKYgL.d.ts → labels-CrA-iqTN.d.ts} +9 -0
  42. package/dist/mermaid-diagram.cjs +441 -125
  43. package/dist/mermaid-diagram.d.cts +23 -7
  44. package/dist/mermaid-diagram.d.ts +23 -7
  45. package/dist/mermaid-diagram.js +213 -51
  46. package/dist/mermaid-image.cjs +137 -60
  47. package/dist/mermaid-image.d.cts +4 -3
  48. package/dist/mermaid-image.d.ts +4 -3
  49. package/dist/mermaid-image.js +27 -28
  50. package/dist/next.cjs +836 -304
  51. package/dist/next.d.cts +45 -20
  52. package/dist/next.d.ts +45 -20
  53. package/dist/next.js +151 -40
  54. package/dist/print-coordinator.cjs +157 -0
  55. package/dist/print-coordinator.d.cts +27 -0
  56. package/dist/print-coordinator.d.ts +27 -0
  57. package/dist/print-coordinator.js +83 -0
  58. package/dist/react.cjs +603 -240
  59. package/dist/react.d.cts +148 -30
  60. package/dist/react.d.ts +148 -30
  61. package/dist/react.js +26 -4
  62. package/dist/reactions.cjs +653 -0
  63. package/dist/reactions.d.cts +27 -0
  64. package/dist/reactions.d.ts +27 -0
  65. package/dist/reactions.js +364 -0
  66. package/dist/{resolve-euZ4-aC9.d.cts → resolve-BnIv7aB7.d.cts} +2 -2
  67. package/dist/{resolve-Ae7UFjsQ.d.ts → resolve-BysHtZ_i.d.ts} +2 -2
  68. package/dist/revalidation-callback-BQl77tQR.d.cts +75 -0
  69. package/dist/revalidation-callback-BQl77tQR.d.ts +75 -0
  70. package/dist/sanitize-BpY_AdZh.d.cts +23 -0
  71. package/dist/sanitize-BpY_AdZh.d.ts +23 -0
  72. package/dist/styles.css +100 -29
  73. package/dist/toc-spy.cjs +60 -0
  74. package/dist/toc-spy.d.cts +15 -0
  75. package/dist/toc-spy.d.ts +15 -0
  76. package/dist/toc-spy.js +36 -0
  77. package/dist/{types-Czt887Iv.d.cts → types-D09Z072G.d.cts} +57 -2
  78. package/dist/{types-Czt887Iv.d.ts → types-D09Z072G.d.ts} +57 -2
  79. package/dist/use-cache.cjs +89 -13
  80. package/dist/use-cache.d.cts +12 -5
  81. package/dist/use-cache.d.ts +12 -5
  82. package/dist/use-cache.js +8 -8
  83. package/dist/youtube-facade.cjs +50 -0
  84. package/dist/youtube-facade.d.cts +17 -0
  85. package/dist/youtube-facade.d.ts +17 -0
  86. package/dist/youtube-facade.js +26 -0
  87. package/package.json +16 -3
  88. package/dist/chunk-67IOIAVW.js +0 -35
  89. package/dist/chunk-DMK4XQLU.js +0 -1556
  90. package/dist/chunk-PJMJMP66.js +0 -63
  91. package/dist/revalidation-callback-D7Ms_Puz.d.cts +0 -42
  92. package/dist/revalidation-callback-D7Ms_Puz.d.ts +0 -42
package/dist/index.d.ts CHANGED
@@ -1,60 +1,7 @@
1
- import { R as Resolved, M as MountsResult } from './types-Czt887Iv.js';
2
- export { A as Alternate, a as ArticleContent, B as Breadcrumb, C as CacheInfo, D as DocumentMetaFields, E as EngageComment, b as EngageHeldComment, c as EngageListing, F as Fallback, L as ListItem, d as Mount, e as Mounts, N as NavItem, f as NavNode, g as NavTree, h as ResolvedArticle, i as ResolvedDisabled, j as ResolvedList, k as ResolvedNotFound, l as ResolvedRedirect, T as TocEntry } from './types-Czt887Iv.js';
3
- export { R as RevalidationCallbackOptions, a as RevalidationCallbackRoute, b as RevalidationPayload, c as createRevalidationCallbackRoute } from './revalidation-callback-D7Ms_Puz.js';
4
-
5
- /** `next` is a Next.js fetch extension with no lib.dom type; typed structurally so this module needs no Next import. */
6
- type HyleRequestInit = Omit<RequestInit, "method" | "body"> & {
7
- readonly next?: {
8
- readonly revalidate?: number | false;
9
- readonly tags?: readonly string[];
10
- };
11
- };
12
- interface HyleClientOptions {
13
- /** hyle's origin, for example https://hyle.tdacorp.in. */
14
- readonly baseUrl: string;
15
- /** A target credential (hyle_tr_...). Server-side only: it is sent as a header and never put in a URL. */
16
- readonly token: string;
17
- /** Injectable for tests; defaults to the global fetch. */
18
- readonly fetch?: typeof fetch;
19
- /** Abort a request after this many milliseconds. Default 10000. */
20
- readonly timeoutMs?: number;
21
- /** Refuse a response body larger than this many bytes. Default 5 MiB. */
22
- readonly maxResponseBytes?: number;
23
- /** Allow a plain http baseUrl on a non-loopback host (tests, private networks). Default false: the token would travel unencrypted. */
24
- readonly allowInsecureHttp?: boolean;
25
- }
26
- interface ResolveOptions {
27
- /** The site path as a visitor sees it, including the workspace's path prefix. Sent as a query parameter, so it is encoded once. */
28
- readonly path: string;
29
- readonly locale?: string;
30
- readonly format?: "hast" | "html" | "md";
31
- /** "tree" adds the whole section's navigation (`article.nav`); the docs layout asks for it. An older hyle ignores it. */
32
- readonly nav?: "tree";
33
- readonly cursor?: string;
34
- readonly limit?: number;
35
- /** Extra fetch options (for example Next's `next: { tags, revalidate }`). Method, body and the auth header cannot be overridden. */
36
- readonly init?: HyleRequestInit;
37
- }
38
- interface MountsOptions {
39
- /** Extra fetch options (for example Next's `next: { tags, revalidate }`). Method, body and the auth header cannot be overridden. */
40
- readonly init?: HyleRequestInit;
41
- }
42
- interface AssetOptions {
43
- /** Only these request headers are sent upstream: a browser's own cache validators and byte range. Everything else is dropped. */
44
- readonly headers?: {
45
- readonly range?: string | null;
46
- readonly "if-range"?: string | null;
47
- readonly "if-none-match"?: string | null;
48
- };
49
- /** Abort after this many milliseconds, body included. Default: the client's `timeoutMs`. */
50
- readonly timeoutMs?: number;
51
- }
52
- declare function createHyleClient(options: HyleClientOptions): {
53
- resolve: (opts: ResolveOptions) => Promise<Resolved>;
54
- mounts: (opts?: MountsOptions) => Promise<MountsResult>;
55
- asset: (file: string, opts?: AssetOptions) => Promise<Response>;
56
- };
57
- type HyleClient = ReturnType<typeof createHyleClient>;
1
+ import { H as HyleAuth, a as HyleClient } from './client-D0LTpr3Y.js';
2
+ export { A as AssetOptions, b as HyleClientOptions, c as HyleCredential, d as HyleRequestInit, M as MAX_PUSH_BODY_BYTES, e as MountsOptions, P as PushEvent, f as PushEventType, g as PushPage, h as PushPost, i as PushRoute, j as PushRouteOptions, k as PushStore, R as ResolveOptions, l as ResyncOptions, m as ResyncResult, n as createHyleClient, o as createPushRoute, r as resyncPath, s as staleAfterResync } from './client-D0LTpr3Y.js';
3
+ export { A as Alternate, a as ArticleContent, B as Breadcrumb, C as CacheInfo, D as DocumentMetaFields, E as EngageComment, b as EngageHeldComment, c as EngageListing, F as Fallback, H as HylePreview, L as ListItem, M as Mount, d as Mounts, e as MountsResult, N as NavItem, f as NavNode, g as NavTree, R as ReactionCounts, h as ReactionKind, i as Resolved, j as ResolvedArticle, k as ResolvedDisabled, l as ResolvedList, m as ResolvedNotFound, n as ResolvedRedirect, T as ThemeRef, o as TocEntry, V as VoteValue } from './types-D09Z072G.js';
4
+ export { C as CommentEvent, a as CommentEventType, R as RevalidationCallbackOptions, b as RevalidationCallbackRoute, c as RevalidationPayload, d as createRevalidationCallbackRoute, p as parseCommentEvent } from './revalidation-callback-BQl77tQR.js';
58
5
 
59
6
  declare class Cp1ClientError extends Error {
60
7
  readonly code: string;
@@ -64,21 +11,29 @@ declare class Cp1ClientError extends Error {
64
11
  constructor(code: string, message: string, status: number, requestId: string, details?: Record<string, unknown>);
65
12
  }
66
13
 
67
- interface HostSyncInput {
14
+ /** Where a build writes to hyle's control surface, and as whom. */
15
+ type ControlTarget = {
68
16
  /** hyle's origin. */
69
17
  readonly baseUrl: string;
70
- /** A CONTROL credential (hyle_tc_...) holding hyle.workspace.manage on the workspace. Never a target (read) token. */
71
- readonly token: string;
72
18
  /** The workspace to write, from `client.mounts()`; the credential must be granted on it. */
73
19
  readonly workspaceId: string;
74
- /** The host's complete list of reserved paths (a replace). */
75
- readonly paths: readonly string[];
76
20
  readonly host: string;
77
21
  readonly buildId: string;
78
22
  readonly fetch?: typeof fetch;
79
23
  readonly timeoutMs?: number;
80
24
  readonly allowInsecureHttp?: boolean;
81
- }
25
+ } & ({
26
+ /** A CONTROL credential (hyle_tc_...) holding the route's permission on the workspace. Never a target (read) token. */
27
+ readonly token: string;
28
+ readonly auth?: never;
29
+ } | {
30
+ readonly auth: HyleAuth;
31
+ readonly token?: never;
32
+ });
33
+ type HostSyncInput = ControlTarget & {
34
+ /** The host's complete list of reserved paths (a replace). */
35
+ readonly paths: readonly string[];
36
+ };
82
37
  interface HostSyncResult {
83
38
  /** What hyle stored: sorted, de-duplicated. */
84
39
  readonly paths: readonly string[];
@@ -92,10 +47,9 @@ interface HostSyncResult {
92
47
  };
93
48
  }
94
49
  /**
95
- * Reports the host's reserved paths to hyle (ADR 0016): `PUT /cp1/control/workspace/host-reserved-paths`. Idempotent (resending the
96
- * same list changes nothing), so a retry or a repeated deploy is safe; the random Idempotency-Key only satisfies the control
97
- * surface's mutation rule. Throws `TypeError` before any request for a wrong token kind or an insecure URL, and `Cp1ClientError`
98
- * for anything hyle answers or the network does.
50
+ * Reports the host's reserved paths to hyle (ADR 0016): `PUT /cp1/control/workspace/host-reserved-paths`, with
51
+ * hyle.workspace.sync_host. Idempotent (resending the same list changes nothing), so a retry or a
52
+ * repeated deploy is safe. Throws as `put` describes.
99
53
  */
100
54
  declare function syncHostReserved(input: HostSyncInput): Promise<HostSyncResult>;
101
55
 
@@ -289,4 +243,4 @@ declare function generateEngagementKeyPair(): {
289
243
  /** The public half to register in hyle, from the private seed. */
290
244
  declare function engagementPublicKey(seed: string): string;
291
245
 
292
- export { type AssetOptions, CACHE_TAG_PATTERN, Cp1ClientError, DeliveryDedupe, type DynamicOverlap, type HostSyncInput, type HostSyncResult, type HyleClient, type HyleClientOptions, type HyleRequestInit, type ListPublicationPathsOptions, type LocaleOptions, type LocalePrefix, type MountsOptions, MountsResult, type NextManifests, type ParsedSignatureHeader, type PublicationPath, type PublicationPaths, type ResolveOptions, Resolved, type RouteCheckInput, type RouteCheckReport, SDK_OWN_RESERVED, type VerifySignatureParams, checkRoutes, createHyleClient, engagementPublicKey, formatReport, generateEngagementKeyPair, hostRoutesFromManifests, isValidCacheTag, listPublicationPaths, normalizeRoute, parseSignatureHeader, reservedFor, routeMatches, syncHostReserved, verifyHyleSignature };
246
+ export { CACHE_TAG_PATTERN, Cp1ClientError, DeliveryDedupe, type DynamicOverlap, type HostSyncInput, type HostSyncResult, HyleAuth, HyleClient, type ListPublicationPathsOptions, type LocaleOptions, type LocalePrefix, type NextManifests, type ParsedSignatureHeader, type PublicationPath, type PublicationPaths, type RouteCheckInput, type RouteCheckReport, SDK_OWN_RESERVED, type VerifySignatureParams, checkRoutes, engagementPublicKey, formatReport, generateEngagementKeyPair, hostRoutesFromManifests, isValidCacheTag, listPublicationPaths, normalizeRoute, parseSignatureHeader, reservedFor, routeMatches, syncHostReserved, verifyHyleSignature };
package/dist/index.js CHANGED
@@ -2,9 +2,11 @@ import {
2
2
  CACHE_TAG_PATTERN,
3
3
  Cp1ClientError,
4
4
  DeliveryDedupe,
5
+ MAX_PUSH_BODY_BYTES,
5
6
  SDK_OWN_RESERVED,
6
7
  checkRoutes,
7
8
  createHyleClient,
9
+ createPushRoute,
8
10
  createRevalidationCallbackRoute,
9
11
  engagementPublicKey,
10
12
  formatReport,
@@ -13,20 +15,25 @@ import {
13
15
  isValidCacheTag,
14
16
  listPublicationPaths,
15
17
  normalizeRoute,
18
+ parseCommentEvent,
16
19
  parseSignatureHeader,
17
20
  reservedFor,
21
+ resyncPath,
18
22
  routeMatches,
23
+ staleAfterResync,
19
24
  syncHostReserved,
20
25
  verifyHyleSignature
21
- } from "./chunk-MGSUQBDW.js";
22
- import "./chunk-67IOIAVW.js";
26
+ } from "./chunk-KU7LWK4E.js";
27
+ import "./chunk-DUPT6XLB.js";
23
28
  export {
24
29
  CACHE_TAG_PATTERN,
25
30
  Cp1ClientError,
26
31
  DeliveryDedupe,
32
+ MAX_PUSH_BODY_BYTES,
27
33
  SDK_OWN_RESERVED,
28
34
  checkRoutes,
29
35
  createHyleClient,
36
+ createPushRoute,
30
37
  createRevalidationCallbackRoute,
31
38
  engagementPublicKey,
32
39
  formatReport,
@@ -35,9 +42,12 @@ export {
35
42
  isValidCacheTag,
36
43
  listPublicationPaths,
37
44
  normalizeRoute,
45
+ parseCommentEvent,
38
46
  parseSignatureHeader,
39
47
  reservedFor,
48
+ resyncPath,
40
49
  routeMatches,
50
+ staleAfterResync,
41
51
  syncHostReserved,
42
52
  verifyHyleSignature
43
53
  };
@@ -32,6 +32,15 @@ interface ViewerLabels {
32
32
  outgoing: string;
33
33
  tracing: string;
34
34
  map: string;
35
+ largeTitle: string;
36
+ largeBody: string;
37
+ drawLarge: string;
38
+ drawing: string;
39
+ drawingBody: string;
40
+ drawAgain: string;
41
+ showSource: string;
42
+ hideSource: string;
43
+ printPreparing: string;
35
44
  }
36
45
 
37
46
  export type { ViewerLabels as V };
@@ -32,6 +32,15 @@ interface ViewerLabels {
32
32
  outgoing: string;
33
33
  tracing: string;
34
34
  map: string;
35
+ largeTitle: string;
36
+ largeBody: string;
37
+ drawLarge: string;
38
+ drawing: string;
39
+ drawingBody: string;
40
+ drawAgain: string;
41
+ showSource: string;
42
+ hideSource: string;
43
+ printPreparing: string;
35
44
  }
36
45
 
37
46
  export type { ViewerLabels as V };