vde-open 0.1.15 → 0.1.16

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.
@@ -3514,6 +3514,15 @@ function _number(Class, params) {
3514
3514
  }));
3515
3515
  }
3516
3516
  // @__NO_SIDE_EFFECTS__
3517
+ function _coercedNumber(Class, params) {
3518
+ return new Class(snapshotChecks({
3519
+ type: "number",
3520
+ coerce: true,
3521
+ checks: [],
3522
+ ...normalizeParams(params)
3523
+ }));
3524
+ }
3525
+ // @__NO_SIDE_EFFECTS__
3517
3526
  function _int(Class, params) {
3518
3527
  return new Class({
3519
3528
  type: "number",
@@ -5828,6 +5837,19 @@ strictObject({
5828
5837
  closed: array(documentIdSchema),
5829
5838
  alreadyClosed: array(documentIdSchema)
5830
5839
  });
5840
+ const mobileStatusSchema = discriminatedUnion("state", [
5841
+ strictObject({ state: literal("disabled") }),
5842
+ strictObject({
5843
+ state: literal("ready"),
5844
+ uiUrl: string()
5845
+ }),
5846
+ strictObject({
5847
+ state: literal("error"),
5848
+ listener: _enum(["ui", "preview"]).nullable(),
5849
+ port: number().int().nullable(),
5850
+ reason: string()
5851
+ })
5852
+ ]);
5831
5853
  strictObject({
5832
5854
  state: _enum(["running", "stopped"]),
5833
5855
  daemonId: string().nullable(),
@@ -5838,7 +5860,8 @@ strictObject({
5838
5860
  stateRoot: string(),
5839
5861
  openDocuments: number().int().nonnegative().nullable(),
5840
5862
  catalogVersion: number().int().nonnegative().nullable(),
5841
- uiUrl: string().nullable()
5863
+ uiUrl: string().nullable(),
5864
+ mobile: mobileStatusSchema.nullable()
5842
5865
  });
5843
5866
  const reorderParamsSchema = strictObject({
5844
5867
  order: array(documentIdSchema),
@@ -6121,6 +6144,10 @@ const ERROR_SPECS = {
6121
6144
  exit: ExitCode.notFound,
6122
6145
  retryable: false
6123
6146
  },
6147
+ E_TAILSCALE_UNAVAILABLE: {
6148
+ exit: ExitCode.notFound,
6149
+ retryable: false
6150
+ },
6124
6151
  E_KEY_CONFLICT: {
6125
6152
  exit: ExitCode.conflict,
6126
6153
  retryable: false
@@ -6137,6 +6164,10 @@ const ERROR_SPECS = {
6137
6164
  exit: ExitCode.conflict,
6138
6165
  retryable: false
6139
6166
  },
6167
+ E_VIEW_STALE: {
6168
+ exit: ExitCode.conflict,
6169
+ retryable: false
6170
+ },
6140
6171
  E_CATALOG_CONFLICT: {
6141
6172
  exit: ExitCode.conflict,
6142
6173
  retryable: true
@@ -6149,6 +6180,10 @@ const ERROR_SPECS = {
6149
6180
  exit: ExitCode.conflict,
6150
6181
  retryable: false
6151
6182
  },
6183
+ E_SERVE_CONFLICT: {
6184
+ exit: ExitCode.conflict,
6185
+ retryable: false
6186
+ },
6152
6187
  E_DRAFT_CONFLICT: {
6153
6188
  exit: ExitCode.conflict,
6154
6189
  retryable: false
@@ -6245,6 +6280,10 @@ const ERROR_SPECS = {
6245
6280
  exit: ExitCode.internal,
6246
6281
  retryable: false
6247
6282
  },
6283
+ E_TAILSCALE_FAILED: {
6284
+ exit: ExitCode.internal,
6285
+ retryable: false
6286
+ },
6248
6287
  E_STORAGE_WRITE_FAILED: {
6249
6288
  exit: ExitCode.internal,
6250
6289
  retryable: true
@@ -6586,6 +6625,76 @@ const feedbackSubmitParamsSchema = strictObject({
6586
6625
  });
6587
6626
  const feedbackCancelParamsSchema = strictObject({ confirmed: literal(true) });
6588
6627
  //#endregion
6628
+ //#region ../../packages/shared/src/mobile.ts
6629
+ const viewEpochSchema = string().regex(/^\d+\.\d+$/);
6630
+ const mobileDocumentSchema = strictObject({
6631
+ documentId: documentIdSchema,
6632
+ title: string(),
6633
+ format: documentFormatSchema,
6634
+ openedAt: string(),
6635
+ revision: revisionSchema.nullable(),
6636
+ sourceState: sourceStateSchema,
6637
+ effectiveMode: htmlModeSchema.nullable(),
6638
+ viewEpoch: viewEpochSchema
6639
+ });
6640
+ strictObject({
6641
+ daemonId: string(),
6642
+ catalogVersion: number().int().nonnegative(),
6643
+ documents: array(mobileDocumentSchema),
6644
+ nextCursor: string().nullable()
6645
+ });
6646
+ strictObject({
6647
+ documentId: documentIdSchema,
6648
+ revision: revisionSchema,
6649
+ content: string(),
6650
+ nextCursor: string().nullable()
6651
+ });
6652
+ const mobileGrantParamsSchema = strictObject({
6653
+ revision: revisionSchema,
6654
+ viewEpoch: viewEpochSchema
6655
+ });
6656
+ strictObject({
6657
+ grant: string(),
6658
+ documentId: documentIdSchema,
6659
+ revision: revisionSchema,
6660
+ viewEpoch: viewEpochSchema,
6661
+ format: documentFormatSchema,
6662
+ mode: htmlModeSchema,
6663
+ documentUrl: string().nullable(),
6664
+ filesBaseUrl: string(),
6665
+ documentLogicalPath: string(),
6666
+ assets: array(strictObject({
6667
+ logicalPath: string(),
6668
+ role: assetRoleSchema
6669
+ })),
6670
+ links: array(renderLinkSchema),
6671
+ headingTargets: array(strictObject({
6672
+ sectionId: string().regex(/^sec_\d{4,}$/),
6673
+ anchor: string()
6674
+ }))
6675
+ });
6676
+ string().regex(/^[A-Za-z0-9_-]{43}$/);
6677
+ const mobileReleaseParamsSchema = strictObject({ grants: array(string().min(1).max(128)).max(256) });
6678
+ const mobileCheckParamsSchema = strictObject({ grant: string().min(1).max(128) });
6679
+ const mobileLinkParamsSchema = strictObject({
6680
+ grant: string().min(1).max(128),
6681
+ linkId: string().regex(/^lnk_\d{4,}$/)
6682
+ });
6683
+ discriminatedUnion("status", [strictObject({
6684
+ status: literal("open"),
6685
+ documentId: documentIdSchema
6686
+ }), strictObject({ status: literal("not-open") })]);
6687
+ strictObject({
6688
+ type: _enum([
6689
+ "hello",
6690
+ "changed",
6691
+ "resync-required",
6692
+ "daemon-stopping"
6693
+ ]),
6694
+ daemonId: string(),
6695
+ documentId: documentIdSchema.optional()
6696
+ });
6697
+ //#endregion
6589
6698
  //#region ../../node_modules/.pnpm/minisearch@7.2.0/node_modules/minisearch/dist/es/index.js
6590
6699
  /** @ignore */
6591
6700
  const ENTRIES = "ENTRIES";
@@ -8873,4 +8982,4 @@ var SearchIndex = class {
8873
8982
  }
8874
8983
  };
8875
8984
  //#endregion
8876
- export { boolean as $, successEnvelope as A, openParamsSchema as B, VdeError as C, ExitCode as D, isVdeError as E, htmlModeChangeParamsSchema as F, searchParamsSchema as G, renderGrantParamsSchema as H, htmlModeSchema as I, sourceStateSchema as J, sha256Schema as K, lastOpenedDocument as L, closeParamsSchema as M, documentFormatSchema as N, envelopeSchema as O, documentIdSchema as P, array as Q, linkOpenParamsSchema as R, validateAnswers as S, isErrorCode as T, reorderParamsSchema as U, readParamsSchema as V, revisionSchema as W, LIMITS as X, watchRuleSchema as Y, _enum as Z, feedbackWaitParamsSchema as _, uniqueTokens as a, ZodError as at, submissionSchema as b, feedbackAckParamsSchema as c, feedbackDraftParamsSchema as d, literal as et, feedbackForgetParamsSchema as f, feedbackSubmitParamsSchema as g, feedbackStatusSchema as h, codePointLength as i, string as it, assetRecordSchema as j, errorEnvelope as k, feedbackCancelParamsSchema as l, feedbackListParamsSchema as m, batchesOf as n, record as nt, answersSchema as o, canonicalJson as ot, feedbackIdParamsSchema as p, sourceKindSchema as q, partsOf as r, strictObject as rt, cancellationSchema as s, SearchIndex as t, number as tt, feedbackCreateParamsSchema as u, questionnaireSchema as v, exitCodeForError as w, utf8Length as x, requestIdSchema as y, listParamsSchema as z };
8985
+ export { sourceStateSchema as $, isErrorCode as A, htmlModeChangeParamsSchema as B, questionnaireSchema as C, validateAnswers as D, utf8Length as E, successEnvelope as F, openParamsSchema as G, lastOpenedDocument as H, assetRecordSchema as I, reorderParamsSchema as J, readParamsSchema as K, closeParamsSchema as L, ExitCode as M, envelopeSchema as N, VdeError as O, errorEnvelope as P, sourceKindSchema as Q, documentFormatSchema as R, feedbackWaitParamsSchema as S, submissionSchema as T, linkOpenParamsSchema as U, htmlModeSchema as V, listParamsSchema as W, searchParamsSchema as X, revisionSchema as Y, sha256Schema as Z, feedbackForgetParamsSchema as _, uniqueTokens as a, boolean as at, feedbackStatusSchema as b, mobileLinkParamsSchema as c, record as ct, answersSchema as d, unknown as dt, watchRuleSchema as et, cancellationSchema as f, ZodError as ft, feedbackDraftParamsSchema as g, feedbackCreateParamsSchema as h, codePointLength as i, array as it, isVdeError as j, exitCodeForError as k, mobileReleaseParamsSchema as l, strictObject as lt, feedbackCancelParamsSchema as m, canonicalJson as mt, batchesOf as n, ZodNumber as nt, mobileCheckParamsSchema as o, literal as ot, feedbackAckParamsSchema as p, _coercedNumber as pt, renderGrantParamsSchema as q, partsOf as r, _enum as rt, mobileGrantParamsSchema as s, number as st, SearchIndex as t, LIMITS as tt, viewEpochSchema as u, string as ut, feedbackIdParamsSchema as v, requestIdSchema as w, feedbackSubmitParamsSchema as x, feedbackListParamsSchema as y, documentIdSchema as z };