@fedify/vocab-tools 2.4.0-dev.1618 → 2.4.0-dev.1634

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.
package/deno.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/vocab-tools",
3
- "version": "2.4.0-dev.1618+58858243",
3
+ "version": "2.4.0-dev.1634+3b4bfbb6",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": "./src/mod.ts"
package/dist/mod.cjs CHANGED
@@ -8,15 +8,17 @@ let yaml = require("yaml");
8
8
  let es_toolkit = require("es-toolkit");
9
9
  //#region deno.json
10
10
  var name = "@fedify/vocab-tools";
11
- var version = "2.4.0-dev.1618+58858243";
11
+ var version = "2.4.0-dev.1634+3b4bfbb6";
12
12
  //#endregion
13
13
  //#region src/type.ts
14
14
  const HEURISTICS_CONTEXTS = [
15
15
  "https://www.w3.org/ns/activitystreams",
16
16
  "https://w3id.org/security/v1",
17
17
  "https://w3id.org/security/data-integrity/v1",
18
+ "https://w3id.org/security/data-integrity/v2",
18
19
  "https://www.w3.org/ns/did/v1",
19
- "https://w3id.org/security/multikey/v1"
20
+ "https://w3id.org/security/multikey/v1",
21
+ "https://w3id.org/fep/ef61"
20
22
  ];
21
23
  const scalarTypes = {
22
24
  "http://www.w3.org/2001/XMLSchema#boolean": {
@@ -323,6 +325,28 @@ const scalarTypes = {
323
325
  return `parseIri(${v}["@value"])`;
324
326
  }
325
327
  },
328
+ "fedify:gatewayUrl": {
329
+ name: "URL",
330
+ typeGuard(v) {
331
+ return `${v} instanceof URL && isGatewayUrl(${v})`;
332
+ },
333
+ encoder(v) {
334
+ return `{ "@id": formatIri(${v}) }`;
335
+ },
336
+ compactEncoder(v) {
337
+ return `formatIri(${v})`;
338
+ },
339
+ dataCheck(v) {
340
+ return `${v} != null && typeof ${v} === "object" &&
341
+ (("@id" in ${v} && typeof ${v}["@id"] === "string" &&
342
+ ${v}["@id"] !== "" && ${v}["@id"] !== "/") ||
343
+ ("@value" in ${v} && typeof ${v}["@value"] === "string" &&
344
+ ${v}["@value"] !== "" && ${v}["@value"] !== "/"))`;
345
+ },
346
+ decoder(v) {
347
+ return `parseGatewayUrl(typeof ${v}["@id"] === "string" ? ${v}["@id"] : ${v}["@value"])`;
348
+ }
349
+ },
326
350
  "fedify:publicKey": {
327
351
  name: "CryptoKey",
328
352
  typeGuard(v) {
@@ -1944,8 +1968,10 @@ const RUNTIME_IMPORTS = [
1944
1968
  "importMultibaseKey",
1945
1969
  "importPem",
1946
1970
  "isDecimal",
1971
+ "isGatewayUrl",
1947
1972
  "LanguageString",
1948
1973
  "parseDecimal",
1974
+ "parseGatewayUrl",
1949
1975
  "parseIri",
1950
1976
  "parseJsonLdId",
1951
1977
  "type RemoteDocument"
package/dist/mod.js CHANGED
@@ -7,15 +7,17 @@ import { parse } from "yaml";
7
7
  import { pascalCase } from "es-toolkit";
8
8
  //#region deno.json
9
9
  var name = "@fedify/vocab-tools";
10
- var version = "2.4.0-dev.1618+58858243";
10
+ var version = "2.4.0-dev.1634+3b4bfbb6";
11
11
  //#endregion
12
12
  //#region src/type.ts
13
13
  const HEURISTICS_CONTEXTS = [
14
14
  "https://www.w3.org/ns/activitystreams",
15
15
  "https://w3id.org/security/v1",
16
16
  "https://w3id.org/security/data-integrity/v1",
17
+ "https://w3id.org/security/data-integrity/v2",
17
18
  "https://www.w3.org/ns/did/v1",
18
- "https://w3id.org/security/multikey/v1"
19
+ "https://w3id.org/security/multikey/v1",
20
+ "https://w3id.org/fep/ef61"
19
21
  ];
20
22
  const scalarTypes = {
21
23
  "http://www.w3.org/2001/XMLSchema#boolean": {
@@ -322,6 +324,28 @@ const scalarTypes = {
322
324
  return `parseIri(${v}["@value"])`;
323
325
  }
324
326
  },
327
+ "fedify:gatewayUrl": {
328
+ name: "URL",
329
+ typeGuard(v) {
330
+ return `${v} instanceof URL && isGatewayUrl(${v})`;
331
+ },
332
+ encoder(v) {
333
+ return `{ "@id": formatIri(${v}) }`;
334
+ },
335
+ compactEncoder(v) {
336
+ return `formatIri(${v})`;
337
+ },
338
+ dataCheck(v) {
339
+ return `${v} != null && typeof ${v} === "object" &&
340
+ (("@id" in ${v} && typeof ${v}["@id"] === "string" &&
341
+ ${v}["@id"] !== "" && ${v}["@id"] !== "/") ||
342
+ ("@value" in ${v} && typeof ${v}["@value"] === "string" &&
343
+ ${v}["@value"] !== "" && ${v}["@value"] !== "/"))`;
344
+ },
345
+ decoder(v) {
346
+ return `parseGatewayUrl(typeof ${v}["@id"] === "string" ? ${v}["@id"] : ${v}["@value"])`;
347
+ }
348
+ },
325
349
  "fedify:publicKey": {
326
350
  name: "CryptoKey",
327
351
  typeGuard(v) {
@@ -1943,8 +1967,10 @@ const RUNTIME_IMPORTS = [
1943
1967
  "importMultibaseKey",
1944
1968
  "importPem",
1945
1969
  "isDecimal",
1970
+ "isGatewayUrl",
1946
1971
  "LanguageString",
1947
1972
  "parseDecimal",
1973
+ "parseGatewayUrl",
1948
1974
  "parseIri",
1949
1975
  "parseJsonLdId",
1950
1976
  "type RemoteDocument"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/vocab-tools",
3
- "version": "2.4.0-dev.1618+58858243",
3
+ "version": "2.4.0-dev.1634+3b4bfbb6",
4
4
  "description": "Code generator for Activity Vocabulary APIs",
5
5
  "homepage": "https://fedify.dev/",
6
6
  "repository": {