@dxos/echo-protocol 0.5.2 → 0.5.3-main.088a2c8
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/reference.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nimport { type ItemID } from '@dxos/protocols';\nimport { type Reference as ReferenceValue } from '@dxos/protocols/proto/dxos/echo/model/document';\n\n// TODO(burdon): Comment.\nexport class Reference {\n static fromValue(value: ReferenceValue): Reference {\n return new Reference(value.itemId, value.protocol, value.host);\n }\n\n /**\n * @deprecated\n */\n // TODO(burdon): Document/remove?\n static fromLegacyTypename(type: string): Reference {\n return new Reference(type, 'protobuf', 'dxos.org');\n }\n\n // prettier-ignore\n constructor(\n public readonly itemId: ItemID,\n public readonly protocol?: string,\n public readonly host?: string\n ) {}\n\n encode(): ReferenceValue {\n return { itemId: this.itemId, host: this.host, protocol: this.protocol };\n }\n}\n\nexport const REFERENCE_TYPE_TAG = 'dxos.echo.model.document.Reference';\n\n/**\n * Reference as it is stored in Automerge document.\n */\nexport type EncodedReferenceObject = {\n '@type': typeof REFERENCE_TYPE_TAG;\n itemId: string | null;\n protocol: string | null;\n host: string | null;\n};\n\nexport const encodeReference = (reference: Reference): EncodedReferenceObject => ({\n '@type': REFERENCE_TYPE_TAG,\n // NOTE: Automerge do not support undefined values, so we need to use null instead.\n itemId: reference.itemId ?? null,\n protocol: reference.protocol ?? null,\n host: reference.host ?? null,\n});\n\nexport const decodeReference = (value: any) =>\n new Reference(value.itemId, value.protocol ?? undefined, value.host ?? undefined);\n\nexport const isEncodedReferenceObject = (value: any): value is EncodedReferenceObject =>\n typeof value === 'object' && value !== null && value['@type'] === REFERENCE_TYPE_TAG;\n"],
|
|
5
|
-
"mappings": ";AAQO,IAAMA,YAAN,MAAMA,WAAAA;EACX,OAAOC,UAAUC,OAAkC;AACjD,WAAO,IAAIF,WAAUE,MAAMC,QAAQD,MAAME,UAAUF,MAAMG,IAAI;EAC/D;;;;;EAMA,OAAOC,mBAAmBC,MAAyB;AACjD,WAAO,IAAIP,WAAUO,MAAM,YAAY,UAAA;EACzC;;EAGAC,
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nimport { type ItemID } from '@dxos/protocols';\nimport { type Reference as ReferenceValue } from '@dxos/protocols/proto/dxos/echo/model/document';\n\n// TODO(burdon): Comment.\nexport class Reference {\n static fromValue(value: ReferenceValue): Reference {\n return new Reference(value.itemId, value.protocol, value.host);\n }\n\n /**\n * @deprecated\n */\n // TODO(burdon): Document/remove?\n static fromLegacyTypename(type: string): Reference {\n return new Reference(type, 'protobuf', 'dxos.org');\n }\n\n // prettier-ignore\n constructor(\n // TODO(burdon): Change to objectId (and typename).\n public readonly itemId: ItemID,\n public readonly protocol?: string,\n public readonly host?: string\n ) {}\n\n encode(): ReferenceValue {\n return { itemId: this.itemId, host: this.host, protocol: this.protocol };\n }\n}\n\nexport const REFERENCE_TYPE_TAG = 'dxos.echo.model.document.Reference';\n\n/**\n * Reference as it is stored in Automerge document.\n */\nexport type EncodedReferenceObject = {\n '@type': typeof REFERENCE_TYPE_TAG;\n itemId: string | null;\n protocol: string | null;\n host: string | null;\n};\n\nexport const encodeReference = (reference: Reference): EncodedReferenceObject => ({\n '@type': REFERENCE_TYPE_TAG,\n // NOTE: Automerge do not support undefined values, so we need to use null instead.\n itemId: reference.itemId ?? null,\n protocol: reference.protocol ?? null,\n host: reference.host ?? null,\n});\n\nexport const decodeReference = (value: any) =>\n new Reference(value.itemId, value.protocol ?? undefined, value.host ?? undefined);\n\nexport const isEncodedReferenceObject = (value: any): value is EncodedReferenceObject =>\n typeof value === 'object' && value !== null && value['@type'] === REFERENCE_TYPE_TAG;\n"],
|
|
5
|
+
"mappings": ";AAQO,IAAMA,YAAN,MAAMA,WAAAA;EACX,OAAOC,UAAUC,OAAkC;AACjD,WAAO,IAAIF,WAAUE,MAAMC,QAAQD,MAAME,UAAUF,MAAMG,IAAI;EAC/D;;;;;EAMA,OAAOC,mBAAmBC,MAAyB;AACjD,WAAO,IAAIP,WAAUO,MAAM,YAAY,UAAA;EACzC;;EAGAC,YAEkBL,QACAC,UACAC,MAChB;SAHgBF,SAAAA;SACAC,WAAAA;SACAC,OAAAA;EACf;EAEHI,SAAyB;AACvB,WAAO;MAAEN,QAAQ,KAAKA;MAAQE,MAAM,KAAKA;MAAMD,UAAU,KAAKA;IAAS;EACzE;AACF;AAEO,IAAMM,qBAAqB;AAY3B,IAAMC,kBAAkB,CAACC,eAAkD;EAChF,SAASF;;EAETP,QAAQS,UAAUT,UAAU;EAC5BC,UAAUQ,UAAUR,YAAY;EAChCC,MAAMO,UAAUP,QAAQ;AAC1B;AAEO,IAAMQ,kBAAkB,CAACX,UAC9B,IAAIF,UAAUE,MAAMC,QAAQD,MAAME,YAAYU,QAAWZ,MAAMG,QAAQS,MAAAA;AAElE,IAAMC,2BAA2B,CAACb,UACvC,OAAOA,UAAU,YAAYA,UAAU,QAAQA,MAAM,OAAA,MAAaQ;",
|
|
6
6
|
"names": ["Reference", "fromValue", "value", "itemId", "protocol", "host", "fromLegacyTypename", "type", "constructor", "encode", "REFERENCE_TYPE_TAG", "encodeReference", "reference", "decodeReference", "undefined", "isEncodedReferenceObject"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/core/echo/echo-protocol/src/document-structure.ts":{"bytes":2324,"imports":[],"format":"esm"},"packages/core/echo/echo-protocol/src/reference.ts":{"bytes":
|
|
1
|
+
{"inputs":{"packages/core/echo/echo-protocol/src/document-structure.ts":{"bytes":2324,"imports":[],"format":"esm"},"packages/core/echo/echo-protocol/src/reference.ts":{"bytes":5616,"imports":[],"format":"esm"},"packages/core/echo/echo-protocol/src/index.ts":{"bytes":591,"imports":[{"path":"packages/core/echo/echo-protocol/src/document-structure.ts","kind":"import-statement","original":"./document-structure"},{"path":"packages/core/echo/echo-protocol/src/reference.ts","kind":"import-statement","original":"./reference"}],"format":"esm"}},"outputs":{"packages/core/echo/echo-protocol/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2847},"packages/core/echo/echo-protocol/dist/lib/browser/index.mjs":{"imports":[],"exports":["REFERENCE_TYPE_TAG","Reference","decodeReference","encodeReference","isEncodedReferenceObject"],"entryPoint":"packages/core/echo/echo-protocol/src/index.ts","inputs":{"packages/core/echo/echo-protocol/src/index.ts":{"bytesInOutput":0},"packages/core/echo/echo-protocol/src/reference.ts":{"bytesInOutput":1128}},"bytes":1328}}}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/reference.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nimport { type ItemID } from '@dxos/protocols';\nimport { type Reference as ReferenceValue } from '@dxos/protocols/proto/dxos/echo/model/document';\n\n// TODO(burdon): Comment.\nexport class Reference {\n static fromValue(value: ReferenceValue): Reference {\n return new Reference(value.itemId, value.protocol, value.host);\n }\n\n /**\n * @deprecated\n */\n // TODO(burdon): Document/remove?\n static fromLegacyTypename(type: string): Reference {\n return new Reference(type, 'protobuf', 'dxos.org');\n }\n\n // prettier-ignore\n constructor(\n public readonly itemId: ItemID,\n public readonly protocol?: string,\n public readonly host?: string\n ) {}\n\n encode(): ReferenceValue {\n return { itemId: this.itemId, host: this.host, protocol: this.protocol };\n }\n}\n\nexport const REFERENCE_TYPE_TAG = 'dxos.echo.model.document.Reference';\n\n/**\n * Reference as it is stored in Automerge document.\n */\nexport type EncodedReferenceObject = {\n '@type': typeof REFERENCE_TYPE_TAG;\n itemId: string | null;\n protocol: string | null;\n host: string | null;\n};\n\nexport const encodeReference = (reference: Reference): EncodedReferenceObject => ({\n '@type': REFERENCE_TYPE_TAG,\n // NOTE: Automerge do not support undefined values, so we need to use null instead.\n itemId: reference.itemId ?? null,\n protocol: reference.protocol ?? null,\n host: reference.host ?? null,\n});\n\nexport const decodeReference = (value: any) =>\n new Reference(value.itemId, value.protocol ?? undefined, value.host ?? undefined);\n\nexport const isEncodedReferenceObject = (value: any): value is EncodedReferenceObject =>\n typeof value === 'object' && value !== null && value['@type'] === REFERENCE_TYPE_TAG;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAQO,IAAMA,YAAN,MAAMA,WAAAA;EACX,OAAOC,UAAUC,OAAkC;AACjD,WAAO,IAAIF,WAAUE,MAAMC,QAAQD,MAAME,UAAUF,MAAMG,IAAI;EAC/D;;;;;EAMA,OAAOC,mBAAmBC,MAAyB;AACjD,WAAO,IAAIP,WAAUO,MAAM,YAAY,UAAA;EACzC;;EAGAC,
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nimport { type ItemID } from '@dxos/protocols';\nimport { type Reference as ReferenceValue } from '@dxos/protocols/proto/dxos/echo/model/document';\n\n// TODO(burdon): Comment.\nexport class Reference {\n static fromValue(value: ReferenceValue): Reference {\n return new Reference(value.itemId, value.protocol, value.host);\n }\n\n /**\n * @deprecated\n */\n // TODO(burdon): Document/remove?\n static fromLegacyTypename(type: string): Reference {\n return new Reference(type, 'protobuf', 'dxos.org');\n }\n\n // prettier-ignore\n constructor(\n // TODO(burdon): Change to objectId (and typename).\n public readonly itemId: ItemID,\n public readonly protocol?: string,\n public readonly host?: string\n ) {}\n\n encode(): ReferenceValue {\n return { itemId: this.itemId, host: this.host, protocol: this.protocol };\n }\n}\n\nexport const REFERENCE_TYPE_TAG = 'dxos.echo.model.document.Reference';\n\n/**\n * Reference as it is stored in Automerge document.\n */\nexport type EncodedReferenceObject = {\n '@type': typeof REFERENCE_TYPE_TAG;\n itemId: string | null;\n protocol: string | null;\n host: string | null;\n};\n\nexport const encodeReference = (reference: Reference): EncodedReferenceObject => ({\n '@type': REFERENCE_TYPE_TAG,\n // NOTE: Automerge do not support undefined values, so we need to use null instead.\n itemId: reference.itemId ?? null,\n protocol: reference.protocol ?? null,\n host: reference.host ?? null,\n});\n\nexport const decodeReference = (value: any) =>\n new Reference(value.itemId, value.protocol ?? undefined, value.host ?? undefined);\n\nexport const isEncodedReferenceObject = (value: any): value is EncodedReferenceObject =>\n typeof value === 'object' && value !== null && value['@type'] === REFERENCE_TYPE_TAG;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAQO,IAAMA,YAAN,MAAMA,WAAAA;EACX,OAAOC,UAAUC,OAAkC;AACjD,WAAO,IAAIF,WAAUE,MAAMC,QAAQD,MAAME,UAAUF,MAAMG,IAAI;EAC/D;;;;;EAMA,OAAOC,mBAAmBC,MAAyB;AACjD,WAAO,IAAIP,WAAUO,MAAM,YAAY,UAAA;EACzC;;EAGAC,YAEkBL,QACAC,UACAC,MAChB;SAHgBF,SAAAA;SACAC,WAAAA;SACAC,OAAAA;EACf;EAEHI,SAAyB;AACvB,WAAO;MAAEN,QAAQ,KAAKA;MAAQE,MAAM,KAAKA;MAAMD,UAAU,KAAKA;IAAS;EACzE;AACF;AAEO,IAAMM,qBAAqB;AAY3B,IAAMC,kBAAkB,CAACC,eAAkD;EAChF,SAASF;;EAETP,QAAQS,UAAUT,UAAU;EAC5BC,UAAUQ,UAAUR,YAAY;EAChCC,MAAMO,UAAUP,QAAQ;AAC1B;AAEO,IAAMQ,kBAAkB,CAACX,UAC9B,IAAIF,UAAUE,MAAMC,QAAQD,MAAME,YAAYU,QAAWZ,MAAMG,QAAQS,MAAAA;AAElE,IAAMC,2BAA2B,CAACb,UACvC,OAAOA,UAAU,YAAYA,UAAU,QAAQA,MAAM,OAAA,MAAaQ;",
|
|
6
6
|
"names": ["Reference", "fromValue", "value", "itemId", "protocol", "host", "fromLegacyTypename", "type", "constructor", "encode", "REFERENCE_TYPE_TAG", "encodeReference", "reference", "decodeReference", "undefined", "isEncodedReferenceObject"]
|
|
7
7
|
}
|
package/dist/lib/node/meta.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/core/echo/echo-protocol/src/document-structure.ts":{"bytes":2324,"imports":[],"format":"esm"},"packages/core/echo/echo-protocol/src/reference.ts":{"bytes":
|
|
1
|
+
{"inputs":{"packages/core/echo/echo-protocol/src/document-structure.ts":{"bytes":2324,"imports":[],"format":"esm"},"packages/core/echo/echo-protocol/src/reference.ts":{"bytes":5616,"imports":[],"format":"esm"},"packages/core/echo/echo-protocol/src/index.ts":{"bytes":591,"imports":[{"path":"packages/core/echo/echo-protocol/src/document-structure.ts","kind":"import-statement","original":"./document-structure"},{"path":"packages/core/echo/echo-protocol/src/reference.ts","kind":"import-statement","original":"./reference"}],"format":"esm"}},"outputs":{"packages/core/echo/echo-protocol/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2847},"packages/core/echo/echo-protocol/dist/lib/node/index.cjs":{"imports":[],"exports":["REFERENCE_TYPE_TAG","Reference","decodeReference","encodeReference","isEncodedReferenceObject"],"entryPoint":"packages/core/echo/echo-protocol/src/index.ts","inputs":{"packages/core/echo/echo-protocol/src/index.ts":{"bytesInOutput":0},"packages/core/echo/echo-protocol/src/reference.ts":{"bytesInOutput":1128}},"bytes":1328}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../../../src/reference.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,KAAK,SAAS,IAAI,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAGlG,qBAAa,SAAS;
|
|
1
|
+
{"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../../../src/reference.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,KAAK,SAAS,IAAI,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAGlG,qBAAa,SAAS;aAgBF,MAAM,EAAE,MAAM;aACd,QAAQ,CAAC;aACT,IAAI,CAAC;IAjBvB,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS;IAIlD;;OAEG;IAEH,MAAM,CAAC,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS;gBAOhC,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,oBAAQ,EACjB,IAAI,CAAC,oBAAQ;IAG/B,MAAM,IAAI,cAAc;CAGzB;AAED,eAAO,MAAM,kBAAkB,uCAAuC,CAAC;AAEvE;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,OAAO,kBAAkB,CAAC;IACnC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,eAAe,cAAe,SAAS,KAAG,sBAMrD,CAAC;AAEH,eAAO,MAAM,eAAe,UAAW,GAAG,cACyC,CAAC;AAEpF,eAAO,MAAM,wBAAwB,UAAW,GAAG,oCACmC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/echo-protocol",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3-main.088a2c8",
|
|
4
4
|
"description": "Core ECHO APIs.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"src"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@dxos/protocols": "0.5.
|
|
25
|
+
"@dxos/protocols": "0.5.3-main.088a2c8"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|