@fedify/vocab-runtime 2.3.0-dev.994 → 2.3.0-pr.809.37

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 (56) hide show
  1. package/deno.json +4 -3
  2. package/dist/{chunk-CKQMccvm.cjs → chunk-M78iaK0I.cjs} +1 -0
  3. package/dist/jsonld.cjs +3 -2
  4. package/dist/jsonld.d.cts +1 -0
  5. package/dist/jsonld.d.ts +1 -0
  6. package/dist/jsonld.js +1 -0
  7. package/dist/mod.cjs +4456 -4373
  8. package/dist/mod.d.cts +36 -1
  9. package/dist/mod.d.ts +36 -1
  10. package/dist/mod.js +4453 -4370
  11. package/dist/temporal.cjs +60 -0
  12. package/dist/temporal.d.cts +54 -0
  13. package/dist/temporal.d.ts +54 -0
  14. package/dist/temporal.js +58 -0
  15. package/dist/tests/{chunk-Do9eywBl.cjs → chunk-C2EiDwsr.cjs} +1 -1
  16. package/dist/tests/decimal.test.cjs +5 -4
  17. package/dist/tests/decimal.test.mjs +4 -3
  18. package/dist/tests/docloader-C62K53Wr.mjs +4531 -0
  19. package/dist/tests/docloader-JOG8gHH1.cjs +4543 -0
  20. package/dist/tests/docloader.test.cjs +4 -4
  21. package/dist/tests/docloader.test.mjs +4 -4
  22. package/dist/tests/internal/multicodec.test.cjs +1 -1
  23. package/dist/tests/{key-BeTHFQJK.mjs → key-CrrK9mYh.mjs} +1 -1
  24. package/dist/tests/{key-DTTIntwb.cjs → key-pMmqUKuo.cjs} +2 -2
  25. package/dist/tests/key.test.cjs +3 -3
  26. package/dist/tests/key.test.mjs +2 -2
  27. package/dist/tests/langstr.test.cjs +2 -2
  28. package/dist/tests/link.test.cjs +1 -1
  29. package/dist/tests/multibase/multibase.test.cjs +2 -2
  30. package/dist/tests/multibase/multibase.test.mjs +1 -1
  31. package/dist/tests/{multibase-BgU9XRf7.mjs → multibase-B4bvakyA.mjs} +3 -0
  32. package/dist/tests/{multibase-F7LtMMsK.cjs → multibase-Bz_UUDtL.cjs} +5 -2
  33. package/dist/tests/{request-JMzY0HsO.mjs → request-CDRuq9_x.mjs} +1 -1
  34. package/dist/tests/{request-OgmNfphs.cjs → request-CraUL1ra.cjs} +3 -3
  35. package/dist/tests/request.test.cjs +3 -3
  36. package/dist/tests/request.test.mjs +1 -1
  37. package/dist/tests/temporal.test.cjs +134 -0
  38. package/dist/tests/temporal.test.d.cts +1 -0
  39. package/dist/tests/temporal.test.d.mts +1 -0
  40. package/dist/tests/temporal.test.mjs +134 -0
  41. package/dist/tests/url-C20FhC7p.cjs +206 -0
  42. package/dist/tests/url-m9Qzxy-Y.mjs +176 -0
  43. package/dist/tests/url.test.cjs +56 -2
  44. package/dist/tests/url.test.mjs +55 -1
  45. package/package.json +17 -6
  46. package/src/mod.ts +5 -0
  47. package/src/preprocessor.ts +43 -0
  48. package/src/temporal.test.ts +121 -0
  49. package/src/temporal.ts +74 -0
  50. package/src/url.test.ts +82 -0
  51. package/src/url.ts +199 -24
  52. package/tsdown.config.ts +6 -3
  53. package/dist/tests/docloader-CQYpRois.cjs +0 -4581
  54. package/dist/tests/docloader-xNl5RAkG.mjs +0 -4569
  55. package/dist/tests/url-BQ_kgmCk.mjs +0 -59
  56. package/dist/tests/url-pFuSds44.cjs +0 -89
package/dist/mod.d.cts CHANGED
@@ -1,4 +1,6 @@
1
+ /// <reference lib="esnext.temporal" />
1
2
  import { Logger } from "@logtape/logtape";
3
+ import { TracerProvider } from "@opentelemetry/api";
2
4
 
3
5
  //#region src/contexts.d.ts
4
6
  declare const preloadedContexts: Record<string, unknown>;
@@ -421,6 +423,39 @@ declare function decodeMultibase(data: Uint8Array | string): Uint8Array;
421
423
  */
422
424
  declare function encodingFromBaseData(data: string | Uint8Array): Base;
423
425
  //#endregion
426
+ //#region src/preprocessor.d.ts
427
+ /**
428
+ * JSON value shape passed to property preprocessors.
429
+ * @since 2.3.0
430
+ */
431
+ type Json = string | number | boolean | null | readonly Json[] | {
432
+ readonly [key: string]: Json;
433
+ };
434
+ /**
435
+ * Runtime context provided to property preprocessors.
436
+ * @since 2.3.0
437
+ */
438
+ interface PropertyPreprocessorContext {
439
+ /** Loader for remote JSON-LD documents. */
440
+ documentLoader?: DocumentLoader;
441
+ /** Loader for remote JSON-LD contexts. */
442
+ contextLoader?: DocumentLoader;
443
+ /** OpenTelemetry tracer provider for instrumentation. */
444
+ tracerProvider?: TracerProvider;
445
+ /** Base URL for resolving relative references. */
446
+ baseUrl?: URL;
447
+ }
448
+ /**
449
+ * Function signature for schema-configured property preprocessors.
450
+ *
451
+ * Receives an expanded JSON-LD property value and returns a vocabulary
452
+ * object when the value is handled, `undefined` when the value should
453
+ * fall through to the normal range decoder, or an `Error` when the value
454
+ * is recognized but cannot be converted.
455
+ * @since 2.3.0
456
+ */
457
+ type PropertyPreprocessor<T = unknown> = (value: Json, context: PropertyPreprocessorContext) => T | undefined | Error | Promise<T | undefined | Error>;
458
+ //#endregion
424
459
  //#region src/url.d.ts
425
460
  declare class UrlError extends Error {
426
461
  constructor(message: string);
@@ -433,4 +468,4 @@ declare function isValidPublicIPv4Address(address: string): boolean;
433
468
  declare function isValidPublicIPv6Address(address: string): boolean;
434
469
  declare function expandIPv6Address(address: string): string;
435
470
  //#endregion
436
- export { type AuthenticatedDocumentLoaderFactory, type CreateRequestOptions, type Decimal, type DocumentLoader, type DocumentLoaderFactory, type DocumentLoaderFactoryOptions, type DocumentLoaderOptions, FetchError, type GetDocumentLoaderOptions, type GetUserAgentOptions, LanguageString, type RemoteDocument, UrlError, canParseDecimal, createActivityPubRequest, decodeMultibase, encodeMultibase, encodingFromBaseData, expandIPv6Address, exportMultibaseKey, exportSpki, getDocumentLoader, getRemoteDocument, getUserAgent, importMultibaseKey, importPem, importPkcs1, importSpki, isDecimal, isValidPublicIPv4Address, isValidPublicIPv6Address, logRequest, parseDecimal, preloadedContexts, validatePublicUrl };
471
+ export { type AuthenticatedDocumentLoaderFactory, type CreateRequestOptions, type Decimal, type DocumentLoader, type DocumentLoaderFactory, type DocumentLoaderFactoryOptions, type DocumentLoaderOptions, FetchError, type GetDocumentLoaderOptions, type GetUserAgentOptions, type Json, LanguageString, type PropertyPreprocessor, type PropertyPreprocessorContext, type RemoteDocument, UrlError, canParseDecimal, createActivityPubRequest, decodeMultibase, encodeMultibase, encodingFromBaseData, expandIPv6Address, exportMultibaseKey, exportSpki, getDocumentLoader, getRemoteDocument, getUserAgent, importMultibaseKey, importPem, importPkcs1, importSpki, isDecimal, isValidPublicIPv4Address, isValidPublicIPv6Address, logRequest, parseDecimal, preloadedContexts, validatePublicUrl };
package/dist/mod.d.ts CHANGED
@@ -1,4 +1,6 @@
1
+ /// <reference lib="esnext.temporal" />
1
2
  import { Logger } from "@logtape/logtape";
3
+ import { TracerProvider } from "@opentelemetry/api";
2
4
 
3
5
  //#region src/contexts.d.ts
4
6
  declare const preloadedContexts: Record<string, unknown>;
@@ -421,6 +423,39 @@ declare function decodeMultibase(data: Uint8Array | string): Uint8Array;
421
423
  */
422
424
  declare function encodingFromBaseData(data: string | Uint8Array): Base;
423
425
  //#endregion
426
+ //#region src/preprocessor.d.ts
427
+ /**
428
+ * JSON value shape passed to property preprocessors.
429
+ * @since 2.3.0
430
+ */
431
+ type Json = string | number | boolean | null | readonly Json[] | {
432
+ readonly [key: string]: Json;
433
+ };
434
+ /**
435
+ * Runtime context provided to property preprocessors.
436
+ * @since 2.3.0
437
+ */
438
+ interface PropertyPreprocessorContext {
439
+ /** Loader for remote JSON-LD documents. */
440
+ documentLoader?: DocumentLoader;
441
+ /** Loader for remote JSON-LD contexts. */
442
+ contextLoader?: DocumentLoader;
443
+ /** OpenTelemetry tracer provider for instrumentation. */
444
+ tracerProvider?: TracerProvider;
445
+ /** Base URL for resolving relative references. */
446
+ baseUrl?: URL;
447
+ }
448
+ /**
449
+ * Function signature for schema-configured property preprocessors.
450
+ *
451
+ * Receives an expanded JSON-LD property value and returns a vocabulary
452
+ * object when the value is handled, `undefined` when the value should
453
+ * fall through to the normal range decoder, or an `Error` when the value
454
+ * is recognized but cannot be converted.
455
+ * @since 2.3.0
456
+ */
457
+ type PropertyPreprocessor<T = unknown> = (value: Json, context: PropertyPreprocessorContext) => T | undefined | Error | Promise<T | undefined | Error>;
458
+ //#endregion
424
459
  //#region src/url.d.ts
425
460
  declare class UrlError extends Error {
426
461
  constructor(message: string);
@@ -433,4 +468,4 @@ declare function isValidPublicIPv4Address(address: string): boolean;
433
468
  declare function isValidPublicIPv6Address(address: string): boolean;
434
469
  declare function expandIPv6Address(address: string): string;
435
470
  //#endregion
436
- export { type AuthenticatedDocumentLoaderFactory, type CreateRequestOptions, type Decimal, type DocumentLoader, type DocumentLoaderFactory, type DocumentLoaderFactoryOptions, type DocumentLoaderOptions, FetchError, type GetDocumentLoaderOptions, type GetUserAgentOptions, LanguageString, type RemoteDocument, UrlError, canParseDecimal, createActivityPubRequest, decodeMultibase, encodeMultibase, encodingFromBaseData, expandIPv6Address, exportMultibaseKey, exportSpki, getDocumentLoader, getRemoteDocument, getUserAgent, importMultibaseKey, importPem, importPkcs1, importSpki, isDecimal, isValidPublicIPv4Address, isValidPublicIPv6Address, logRequest, parseDecimal, preloadedContexts, validatePublicUrl };
471
+ export { type AuthenticatedDocumentLoaderFactory, type CreateRequestOptions, type Decimal, type DocumentLoader, type DocumentLoaderFactory, type DocumentLoaderFactoryOptions, type DocumentLoaderOptions, FetchError, type GetDocumentLoaderOptions, type GetUserAgentOptions, type Json, LanguageString, type PropertyPreprocessor, type PropertyPreprocessorContext, type RemoteDocument, UrlError, canParseDecimal, createActivityPubRequest, decodeMultibase, encodeMultibase, encodingFromBaseData, expandIPv6Address, exportMultibaseKey, exportSpki, getDocumentLoader, getRemoteDocument, getUserAgent, importMultibaseKey, importPem, importPkcs1, importSpki, isDecimal, isValidPublicIPv4Address, isValidPublicIPv6Address, logRequest, parseDecimal, preloadedContexts, validatePublicUrl };