@dxos/echo 0.16.0 → 0.17.0
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/dist/lib/Annotation.mjs +2 -2
- package/dist/lib/Database.mjs +1 -1
- package/dist/lib/Error.mjs +1 -1
- package/dist/lib/Feed.mjs +1 -1
- package/dist/lib/Format.mjs +2 -2
- package/dist/lib/Migration.mjs +1 -1
- package/dist/lib/chunk-Annotation.mjs +14 -11
- package/dist/lib/chunk-Annotation.mjs.map +1 -1
- package/dist/lib/chunk-Blob.mjs +1 -1
- package/dist/lib/chunk-Collection.mjs +1 -1
- package/dist/lib/chunk-Database.mjs +93 -7
- package/dist/lib/chunk-Database.mjs.map +1 -1
- package/dist/lib/chunk-Dataset.mjs +1 -1
- package/dist/lib/chunk-Entity.mjs +2 -2
- package/dist/lib/chunk-Entity.mjs.map +1 -1
- package/dist/lib/chunk-Error.mjs +13 -1
- package/dist/lib/chunk-Error.mjs.map +1 -1
- package/dist/lib/chunk-Feed.mjs +311 -17
- package/dist/lib/chunk-Feed.mjs.map +1 -1
- package/dist/lib/chunk-Filter.mjs +4 -3
- package/dist/lib/chunk-Filter.mjs.map +1 -1
- package/dist/lib/chunk-Format.mjs +2 -1
- package/dist/lib/chunk-Hypergraph.mjs +1 -1
- package/dist/lib/chunk-Hypergraph.mjs.map +1 -1
- package/dist/lib/chunk-Migration.mjs +155 -5
- package/dist/lib/chunk-Migration.mjs.map +1 -1
- package/dist/lib/chunk-Obj.mjs +12 -5
- package/dist/lib/chunk-Obj.mjs.map +1 -1
- package/dist/lib/chunk-Query.mjs +2 -2
- package/dist/lib/chunk-QueryResult.mjs.map +1 -1
- package/dist/lib/chunk-Ref2.mjs +2 -2
- package/dist/lib/chunk-Registry.mjs +1 -1
- package/dist/lib/chunk-Registry.mjs.map +1 -1
- package/dist/lib/chunk-Relation.mjs +5 -5
- package/dist/lib/chunk-Relation.mjs.map +1 -1
- package/dist/lib/chunk-Scope.mjs +16 -2
- package/dist/lib/chunk-Scope.mjs.map +1 -1
- package/dist/lib/chunk-Tag.mjs +4 -4
- package/dist/lib/chunk-Tag.mjs.map +1 -1
- package/dist/lib/chunk-Text.mjs +2 -2
- package/dist/lib/chunk-Type.mjs +26 -7
- package/dist/lib/chunk-Type.mjs.map +1 -1
- package/dist/lib/chunk-View.mjs +1 -1
- package/dist/lib/chunk-atom-snapshot.mjs +29 -1
- package/dist/lib/chunk-atom-snapshot.mjs.map +1 -1
- package/dist/lib/chunk-entity-dictionary.mjs +28 -19
- package/dist/lib/chunk-entity-dictionary.mjs.map +1 -1
- package/dist/lib/chunk-internal.mjs +231 -79
- package/dist/lib/chunk-internal.mjs.map +1 -1
- package/dist/lib/chunk-json-schema.mjs +1 -1
- package/dist/lib/chunk-ref.mjs +38 -34
- package/dist/lib/chunk-ref.mjs.map +1 -1
- package/dist/lib/chunk-select.mjs +7 -3
- package/dist/lib/chunk-select.mjs.map +1 -1
- package/dist/lib/index.mjs +2 -2
- package/dist/lib/internal.mjs +6 -6
- package/dist/lib/testing.mjs +2 -2
- package/dist/lib/testing.mjs.map +1 -1
- package/dist/types/src/Annotation.d.ts +1 -1
- package/dist/types/src/Annotation.d.ts.map +1 -1
- package/dist/types/src/Database.d.ts +30 -13
- package/dist/types/src/Database.d.ts.map +1 -1
- package/dist/types/src/Entity.d.ts +3 -4
- package/dist/types/src/Entity.d.ts.map +1 -1
- package/dist/types/src/Error.d.ts +36 -0
- package/dist/types/src/Error.d.ts.map +1 -1
- package/dist/types/src/Feed.d.ts +261 -18
- package/dist/types/src/Feed.d.ts.map +1 -1
- package/dist/types/src/Filter.d.ts +7 -1
- package/dist/types/src/Filter.d.ts.map +1 -1
- package/dist/types/src/Hypergraph.d.ts +1 -1
- package/dist/types/src/Migration.d.ts +213 -2
- package/dist/types/src/Migration.d.ts.map +1 -1
- package/dist/types/src/Migration.test.d.ts +2 -0
- package/dist/types/src/Migration.test.d.ts.map +1 -0
- package/dist/types/src/Obj.d.ts +4 -4
- package/dist/types/src/Obj.d.ts.map +1 -1
- package/dist/types/src/QueryResult.d.ts +16 -0
- package/dist/types/src/QueryResult.d.ts.map +1 -1
- package/dist/types/src/Relation.d.ts +3 -4
- package/dist/types/src/Relation.d.ts.map +1 -1
- package/dist/types/src/Scope.d.ts +32 -1
- package/dist/types/src/Scope.d.ts.map +1 -1
- package/dist/types/src/Tag.d.ts.map +1 -1
- package/dist/types/src/Type.d.ts +27 -2
- package/dist/types/src/Type.d.ts.map +1 -1
- package/dist/types/src/internal/Annotation/annotations.d.ts +35 -1
- package/dist/types/src/internal/Annotation/annotations.d.ts.map +1 -1
- package/dist/types/src/internal/Annotation/atoms.d.ts +2 -2
- package/dist/types/src/internal/Annotation/atoms.d.ts.map +1 -1
- package/dist/types/src/internal/Entity/api.d.ts +11 -0
- package/dist/types/src/internal/Entity/api.d.ts.map +1 -1
- package/dist/types/src/internal/Entity/model.d.ts +3 -2
- package/dist/types/src/internal/Entity/model.d.ts.map +1 -1
- package/dist/types/src/internal/Format/string.d.ts +5 -1
- package/dist/types/src/internal/Format/string.d.ts.map +1 -1
- package/dist/types/src/internal/Obj/atoms.d.ts +1 -1
- package/dist/types/src/internal/Obj/atoms.d.ts.map +1 -1
- package/dist/types/src/internal/Obj/json-serializer.d.ts.map +1 -1
- package/dist/types/src/internal/Query/pretty.d.ts.map +1 -1
- package/dist/types/src/internal/Ref/ref.d.ts +5 -1
- package/dist/types/src/internal/Ref/ref.d.ts.map +1 -1
- package/dist/types/src/internal/Ref/strong-deps.d.ts +3 -1
- package/dist/types/src/internal/Ref/strong-deps.d.ts.map +1 -1
- package/dist/types/src/internal/common/api/meta.d.ts +4 -5
- package/dist/types/src/internal/common/api/meta.d.ts.map +1 -1
- package/dist/types/src/internal/common/atom-snapshot.d.ts +10 -0
- package/dist/types/src/internal/common/atom-snapshot.d.ts.map +1 -1
- package/dist/types/src/internal/common/proxy/change-context.d.ts +4 -0
- package/dist/types/src/internal/common/proxy/change-context.d.ts.map +1 -1
- package/dist/types/src/internal/common/proxy/ownership.d.ts +5 -0
- package/dist/types/src/internal/common/proxy/ownership.d.ts.map +1 -1
- package/dist/types/src/internal/common/proxy/proxy-utils.d.ts.map +1 -1
- package/dist/types/src/internal/common/proxy/schema-validator.d.ts +17 -2
- package/dist/types/src/internal/common/proxy/schema-validator.d.ts.map +1 -1
- package/dist/types/src/internal/common/proxy/symbols.d.ts +10 -0
- package/dist/types/src/internal/common/proxy/symbols.d.ts.map +1 -1
- package/dist/types/src/internal/common/proxy/typed-handler.d.ts +0 -1
- package/dist/types/src/internal/common/proxy/typed-handler.d.ts.map +1 -1
- package/dist/types/src/internal/common/types/meta.d.ts +8 -4
- package/dist/types/src/internal/common/types/meta.d.ts.map +1 -1
- package/dist/types/src/internal/common/types/model-symbols.d.ts +6 -0
- package/dist/types/src/internal/common/types/model-symbols.d.ts.map +1 -1
- package/dist/types/src/internal/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +19 -15
- package/src/Annotation.test.ts +34 -0
- package/src/Annotation.ts +3 -0
- package/src/Database.ts +46 -15
- package/src/Entity.ts +3 -4
- package/src/Error.ts +9 -0
- package/src/Feed.test.ts +160 -0
- package/src/Feed.ts +412 -29
- package/src/Filter.ts +8 -1
- package/src/Hypergraph.ts +1 -1
- package/src/Migration.test.ts +137 -0
- package/src/Migration.ts +376 -4
- package/src/Obj.test.ts +44 -4
- package/src/Obj.ts +19 -5
- package/src/QueryResult.ts +14 -0
- package/src/Relation.ts +3 -4
- package/src/Scope.ts +43 -1
- package/src/Tag.md +5 -6
- package/src/Tag.ts +3 -2
- package/src/Type.test.ts +52 -0
- package/src/Type.ts +75 -22
- package/src/Type.tst.ts +155 -0
- package/src/internal/Annotation/annotations.test.ts +19 -0
- package/src/internal/Annotation/annotations.ts +67 -1
- package/src/internal/Annotation/atoms.ts +10 -9
- package/src/internal/Entity/api.ts +20 -1
- package/src/internal/Entity/model.ts +3 -0
- package/src/internal/Filter/match.ts +2 -2
- package/src/internal/Format/string.ts +7 -2
- package/src/internal/JsonSchema/json-schema.test.ts +2 -2
- package/src/internal/Obj/atoms.ts +9 -5
- package/src/internal/Obj/json-serializer.test.ts +34 -7
- package/src/internal/Obj/json-serializer.ts +18 -3
- package/src/internal/Query/pretty.ts +3 -2
- package/src/internal/Ref/ref.test.ts +27 -2
- package/src/internal/Ref/ref.ts +18 -2
- package/src/internal/Ref/strong-deps.ts +21 -2
- package/src/internal/common/api/meta.ts +7 -8
- package/src/internal/common/atom-snapshot.ts +61 -0
- package/src/internal/common/proxy/change-context.ts +5 -0
- package/src/internal/common/proxy/change.test.ts +62 -31
- package/src/internal/common/proxy/json-serializer.ts +3 -2
- package/src/internal/common/proxy/ownership.ts +14 -1
- package/src/internal/common/proxy/proxy-utils.ts +7 -1
- package/src/internal/common/proxy/schema-validator.ts +116 -27
- package/src/internal/common/proxy/symbols.ts +12 -0
- package/src/internal/common/proxy/typed-handler.test.ts +43 -0
- package/src/internal/common/proxy/typed-handler.ts +105 -33
- package/src/internal/common/types/meta.ts +25 -20
- package/src/internal/common/types/model-symbols.ts +7 -0
- package/src/internal/index.ts +1 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-select.mjs","names":["StringUtil.Email","StringUtil.Formula","StringUtil.Hostname","StringUtil.Regex","StringUtil.Text","StringUtil.URL","NumberUtil.Currency","NumberUtil.Integer","NumberUtil.Percent","NumberUtil.Timestamp","DateUtil.DateOnly","DateUtil.DateTime","DateUtil.Duration","DateUtil.TimeOnly","ObjectUtil.GeoPoint"],"sources":["../../src/internal/Format/date.ts","../../src/internal/Format/object.ts","../../src/internal/Format/string.ts","../../src/internal/Format/format.ts","../../src/internal/Format/select.ts"],"sourcesContent":["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\nimport * as Struct from 'effect/Struct';\n\nimport * as SchemaAST from '@dxos/effect/SchemaAST';\n\nimport { FormatAnnotation, TypeFormat } from './types.ts';\n\n/**\n * Datetime values should be stored as ISO strings or unix numbers (ms) in UTC.\n *\n * NOTE: HyperFormula uses Excel's time format (null date 1900/01/01)\n * It can be configured to use a different parser via `parseDateTime`.\n * https://hyperformula.handsontable.com/guide/date-and-time-handling.html#date-and-time-handling\n * https://github.com/handsontable/hyperformula/blob/master/src/DateTimeHelper.ts\n */\n\n// TODO(burdon): Annotations not present in JSON.\n// TODO(burdon): Timezone.\n// TODO(burdon): Format for timestamp (Unix UTC or ISO 8601)?\n// TODO(burdon): Refs\n// - https://www.npmjs.com/package/numfmt\n// - https://date-fns.org/docs/Getting-Started\n// - https://github.com/date-fns/tz\n\n/**\n * Simple date compatible with HF.\n */\nexport const SimpleDate = Schema.Struct({\n year: Schema.Number.pipe(Schema.check(Schema.isBetween({ minimum: 1900, maximum: 9999 }))),\n month: Schema.Number.pipe(Schema.check(Schema.isBetween({ minimum: 1, maximum: 12 }))),\n day: Schema.Number.pipe(Schema.check(Schema.isBetween({ minimum: 1, maximum: 31 }))),\n});\n\nexport type SimpleDate = Schema.Schema.Type<typeof SimpleDate>;\n\nexport const toSimpleDate = (date: Date): SimpleDate => ({\n year: date.getUTCFullYear(),\n month: date.getUTCMonth() + 1,\n day: date.getUTCDate(),\n});\n\n/**\n * Simple time compatible with HF.\n */\nexport const SimpleTime = Schema.Struct({\n hours: Schema.Number.pipe(Schema.check(Schema.isBetween({ minimum: 0, maximum: 23 }))),\n minutes: Schema.Number.pipe(Schema.check(Schema.isBetween({ minimum: 0, maximum: 59 }))),\n seconds: Schema.Number.pipe(Schema.check(Schema.isBetween({ minimum: 0, maximum: 59 }))),\n});\n\nexport type SimpleTime = Schema.Schema.Type<typeof SimpleTime>;\n\nexport const toSimpleTime = (date: Date): SimpleTime => ({\n hours: date.getUTCHours(),\n minutes: date.getUTCSeconds(),\n seconds: date.getUTCSeconds(),\n});\n\n/**\n * Simple date-time compatible with HF.\n */\nexport const SimpleDateTime = SimpleDate.mapFields(Struct.assign(SimpleTime.fields));\n\nexport type SimpleDateTime = Schema.Schema.Type<typeof SimpleDateTime>;\n\nexport const toSimpleDateTime = (date: Date): SimpleDateTime => ({\n ...toSimpleDate(date),\n ...toSimpleTime(date),\n});\n\n/**\n * https://effect.website/docs/guides/schema/transformations#date-transformations\n */\n\n// TODO(burdon): Consider if transformations should be supported with Automerge.\n\n/**\n * Format: 2018-11-13\n */\nexport const DateOnly = /* Schema.transformOrFail(Schema.String, SimpleDate, {\n strict: true,\n decode: (str, _, ast) => {\n if (!isValidDateFormat(str)) {\n return ParseResult.fail(new ParseResult.Type(ast, str, 'Expected YYYY-MM-DD format'));\n }\n if (!isValidDate(str)) {\n return ParseResult.fail(new ParseResult.Type(ast, str, 'Invalid date'));\n }\n\n const [year, month, day] = str.split('-').map(Number);\n return ParseResult.succeed({ year, month, day });\n },\n encode: (date) => {\n return ParseResult.succeed(\n [\n date.year.toString().padStart(4, '0'),\n date.month.toString().padStart(2, '0'),\n date.day.toString().padStart(2, '0'),\n ].join('-'),\n );\n },\n}) */ Schema.String.pipe(\n FormatAnnotation.set(TypeFormat.Date),\n Schema.annotate({\n description: 'Valid date in ISO format',\n }),\n);\n\n/**\n * Format: 20:20:39+00:00\n */\nexport const TimeOnly = /* Schema.transformOrFail(Schema.String, SimpleTime, {\n strict: true,\n decode: (str, _, ast) => {\n if (!isValidTimeFormat(str)) {\n return ParseResult.fail(new ParseResult.Type(ast, str, 'Expected HH:mm:ss format'));\n }\n\n const [hours, minutes, seconds] = str.split(':').map(Number);\n return ParseResult.succeed({ hours, minutes, seconds });\n },\n encode: (time) => {\n return ParseResult.succeed(\n [\n time.hours.toString().padStart(2, '0'),\n time.minutes.toString().padStart(2, '0'),\n time.seconds.toString().padStart(2, '0'),\n ].join(':'),\n );\n },\n}) */ Schema.String.pipe(\n FormatAnnotation.set(TypeFormat.Time),\n Schema.annotate({\n description: 'Valid time in ISO format',\n }),\n);\n\n/**\n * Format: 2018-11-13T20:20:39+00:00\n */\nexport const DateTime = /* Schema.transformOrFail(Schema.String, SimpleDateTime, {\n strict: false,\n decode: (str, _, ast) => {\n const [date, time] = str.split('T');\n if (!isValidDateFormat(date)) {\n return ParseResult.fail(new ParseResult.Type(ast, date, 'Expected YYYY-MM-DD format'));\n }\n if (!isValidDate(date)) {\n return ParseResult.fail(new ParseResult.Type(ast, date, 'Invalid date'));\n }\n if (!isValidTimeFormat(time)) {\n return ParseResult.fail(new ParseResult.Type(ast, str, 'Expected HH:mm:ss format'));\n }\n\n const [year, month, day] = date.split('-').map(Number);\n const [hours, minutes, seconds] = time.split(':').map(Number);\n return ParseResult.succeed({ year, month, day, hours, minutes, seconds });\n },\n encode: (datetime) => {\n return ParseResult.succeed(\n [\n [\n datetime.year.toString().padStart(4, '0'),\n datetime.month.toString().padStart(2, '0'),\n datetime.day.toString().padStart(2, '0'),\n ].join('-'),\n [\n datetime.hours.toString().padStart(2, '0'),\n datetime.minutes.toString().padStart(2, '0'),\n datetime.seconds.toString().padStart(2, '0'),\n ].join(':'),\n ].join('T'),\n );\n },\n}) */ Schema.String.pipe(\n FormatAnnotation.set(TypeFormat.DateTime),\n Schema.annotate({\n description: 'Valid date and time in ISO format',\n }),\n);\n\n/**\n * https://datatracker.ietf.org/doc/html/rfc3339#appendix-A\n */\n// TODO(burdon): Define duration type.\nexport const Duration = Schema.String.pipe(\n FormatAnnotation.set(TypeFormat.Duration),\n Schema.annotate({\n description: 'Duration in ISO 8601 format',\n [SchemaAST.ExamplesAnnotationId]: ['1h', '3D'],\n }),\n);\n\n//\n// Utils\n//\n\n// YYYY-MM-DD\nconst DATE_REGEX = /^\\d{4}-\\d{2}-\\d{2}$/;\n\nconst _isValidDateFormat = (str: string) => DATE_REGEX.test(str);\n\nconst _isValidDate = (str: string) => {\n const date = new Date(str);\n return !isNaN(date.getTime()) && date.toISOString().startsWith(str);\n};\n\n// HH:mm:ss\nconst TIME_REGEX = /^([01]\\d|2[0-3]):([0-5]\\d):([0-5]\\d)$/;\n\nconst _isValidTimeFormat = (str: string) => TIME_REGEX.test(str);\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\nimport * as SchemaTransformation from 'effect/SchemaTransformation';\n\nimport { clamp } from '@dxos/util';\n\nimport { FormatAnnotation, TypeFormat } from './types.ts';\n\n/**\n * GeoJSON Format\n * https://datatracker.ietf.org/doc/html/rfc7946\n * https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.1\n * https://en.wikipedia.org/wiki/Geographic_coordinate_system\n * https://geojson.org\n * {\n * \"type\": \"Point\",\n * \"coordinates\": [0, 51.47] // [longitude, latitude]\n * }\n * Note: optional third element for altitude.\n */\n/** Decimal places retained for stored coordinates (~1.1cm at the equator). */\nexport const GEO_PRECISION = 7;\n\nconst roundCoordinate = (value: number): number => {\n const factor = 10 ** GEO_PRECISION;\n return Math.round(value * factor) / factor;\n};\n\n/** Longitude/latitude clamped to range and rounded to {@link GEO_PRECISION} decimal places. */\nconst Coordinate = (min: number, max: number, title: string) =>\n Schema.Number.pipe(\n Schema.decodeTo(\n Schema.Number,\n // v4 removed `Schema.clamp`; the guide rebuilds it as an explicit reversible transformation,\n // which folds into the rounding step already happening here.\n SchemaTransformation.transform({\n decode: (value: number) => roundCoordinate(Math.min(Math.max(value, min), max)),\n encode: (value: number) => roundCoordinate(Math.min(Math.max(value, min), max)),\n }),\n ),\n ).annotate({ title });\n\nexport const GeoPoint = Schema.Tuple([\n Coordinate(-180, 180, 'Longitude'),\n Coordinate(-90, 90, 'Latitude'),\n Schema.optionalKey(Schema.Number).annotate({\n title: 'Height ASL (m)',\n }),\n]).pipe(\n FormatAnnotation.set(TypeFormat.GeoPoint),\n Schema.annotate({\n title: 'GeoPoint',\n description: 'GeoJSON Position',\n }),\n);\n\nexport type GeoPoint = Schema.Schema.Type<typeof GeoPoint>;\n\nexport type GeoLocation = {\n longitude: number;\n latitude: number;\n height?: number;\n};\n\n/**\n * Geolocation utilities for working with GeoPoint format.\n */\nexport namespace GeoLocation {\n /**\n * Convert latitude and longitude to GeoPoint (GeoJSON format [longitude, latitude, height?]).\n * Clamps values to valid ranges: latitude [-90, 90], longitude [-180, 180].\n */\n export const toGeoPoint = ({ longitude, latitude, height }: GeoLocation): GeoPoint => {\n // TODO(ZaymonFC): Use schema validation instead of doing this manually.\n // Clamp + round to match the `Format.GeoPoint` decode/encode path so both produce identical tuples.\n const clampedLongitude = roundCoordinate(clamp(longitude, -180, 180));\n const clampedLatitude = roundCoordinate(clamp(latitude, -90, 90));\n return height !== undefined ? [clampedLongitude, clampedLatitude, height] : [clampedLongitude, clampedLatitude];\n };\n\n /**\n * Extract latitude and longitude from GeoPoint (GeoJSON format [longitude, latitude, height?]).\n */\n export const fromGeoPoint = (geoPoint: GeoPoint | undefined): GeoLocation => {\n if (!geoPoint) {\n return { longitude: 0, latitude: 0 };\n }\n\n const result: GeoLocation = {\n longitude: geoPoint[0],\n latitude: geoPoint[1],\n };\n\n // Add height if defined.\n if (geoPoint[2] !== undefined) {\n result.height = geoPoint[2];\n }\n\n return result;\n };\n}\n","//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport * as SchemaAST from '@dxos/effect/SchemaAST';\n\nimport { FormatAnnotation, TypeFormat } from './types.ts';\n\n/**\n * Email address (RFC 5321)\n * https://datatracker.ietf.org/doc/html/rfc5321#section-4.1.2\n */\nexport const Email = Schema.String.pipe(\n Schema.check(Schema.isPattern(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/u)),\n FormatAnnotation.set(TypeFormat.Email),\n Schema.annotate({\n title: 'Email',\n description: 'Email address',\n }),\n);\n\n/**\n *\n */\n// TODO(burdon): Implement.\nexport const Formula = Schema.String.pipe(FormatAnnotation.set(TypeFormat.Formula));\n\n/**\n *\n */\n// TODO(burdon): Implement.\nexport const Hostname = Schema.String.pipe(FormatAnnotation.set(TypeFormat.Hostname));\n\n/**\n * Regex\n * https://json-schema.org/understanding-json-schema/reference/regular_expressions\n * https://ecma-international.org/publications-and-standards/standards/ecma-262\n */\n// TODO(burdon): Implement.\nexport const Regex = Schema.String.pipe(FormatAnnotation.set(TypeFormat.Regex));\n\n/**\n * Multi-line text.\n */\nexport const Text = Schema.String.pipe(FormatAnnotation.set(TypeFormat.Text));\n\nconst URL_PATTERN = /^(\\w+?:\\/\\/)?([\\da-z.-]+)\\.([a-z.]{2,6})([/\\w .-]*)*\\/?$/i;\n\n/**\n * https://datatracker.ietf.org/doc/html/rfc3986#section-1.1.3\n */\nexport const URL = Schema.String.pipe(\n // JSON Schema patterns take no flags, so the case-sensitive source is exported rather than dropped.\n Schema.check(\n Schema.isPattern(URL_PATTERN, {\n toJsonSchema: () => ({ pattern: URL_PATTERN.source }),\n }),\n ),\n FormatAnnotation.set(TypeFormat.URL),\n Schema.annotate({\n title: 'URL',\n description: 'URL',\n }),\n);\n\n/**\n * UUID (RFC 4122)\n * https://datatracker.ietf.org/doc/html/rfc4122\n */\nexport const UUID = Schema.String.check(Schema.isUUID()).pipe(\n FormatAnnotation.set(TypeFormat.UUID),\n Schema.annotate({\n [SchemaAST.ExamplesAnnotationId]: ['3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a'],\n }),\n);\n","//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport * as Keys from '@dxos/keys';\n\nimport * as DateUtil from './date.ts';\nimport * as NumberUtil from './number.ts';\nimport * as ObjectUtil from './object.ts';\nimport * as StringUtil from './string.ts';\nimport { TypeFormat as TypeFormat$ } from './types.ts';\n\n// TODO(burdon): Media encoding.\n// - https://json-schema.org/understanding-json-schema/reference/non_json_data\n\n/**\n * Formats.\n * https://json-schema.org/understanding-json-schema/reference/string#built-in-formats\n * NOTE: A JSON Schema validator will ignore any format type that it does not understand.\n */\n// TODO(burdon): Add fields for `examples`, `message`, etc.\nexport namespace Format {\n export import TypeFormat = TypeFormat$;\n\n // String\n export const DXN = Keys.DXN.Schema;\n export const Email = StringUtil.Email;\n export const Formula = StringUtil.Formula;\n export const Hostname = StringUtil.Hostname;\n export const Regex = StringUtil.Regex;\n export const Text = StringUtil.Text;\n export const URL = StringUtil.URL;\n export const UUID = Schema.String.check(Schema.isUUID());\n\n // Numbers\n // TODO(burdon): BigInt.\n export const Currency = NumberUtil.Currency;\n export const Integer = NumberUtil.Integer;\n export const Percent = NumberUtil.Percent;\n export const Timestamp = NumberUtil.Timestamp;\n\n // Dates and times\n export const Date = DateUtil.DateOnly;\n export const DateTime = DateUtil.DateTime;\n export const Duration = DateUtil.Duration;\n export const Time = DateUtil.TimeOnly;\n\n // Objects\n export const GeoPoint = ObjectUtil.GeoPoint;\n export type GeoPoint = ObjectUtil.GeoPoint; // TODO(burdon): Export types.\n}\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\n/**\n * Schema for a single select option. Used to define choices in a {single|multi}-select field.\n */\nexport const SelectOption = Schema.Struct({\n /** Stable identifier for the option. */\n id: Schema.NonEmptyString,\n title: Schema.String,\n /** Color palette used for visual styling. */\n color: Schema.String,\n});\n\nexport type SelectOption = Schema.Schema.Type<typeof SelectOption>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA+BA,IAAa,aAAa,OAAO,OAAO;CACtC,MAAM,OAAO,OAAO,KAAK,OAAO,MAAM,OAAO,UAAU;EAAE,SAAS;EAAM,SAAS;CAAK,CAAC,CAAC,CAAC;CACzF,OAAO,OAAO,OAAO,KAAK,OAAO,MAAM,OAAO,UAAU;EAAE,SAAS;EAAG,SAAS;CAAG,CAAC,CAAC,CAAC;CACrF,KAAK,OAAO,OAAO,KAAK,OAAO,MAAM,OAAO,UAAU;EAAE,SAAS;EAAG,SAAS;CAAG,CAAC,CAAC,CAAC;AACrF,CAAC;AAID,IAAa,gBAAgB,UAA4B;CACvD,MAAM,KAAK,eAAe;CAC1B,OAAO,KAAK,YAAY,IAAI;CAC5B,KAAK,KAAK,WAAW;AACvB;;;;AAKA,IAAa,aAAa,OAAO,OAAO;CAC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AAO;;CAEd,OAAO,OAAO;AAChB,CAAC"}
|
|
1
|
+
{"version":3,"file":"chunk-select.mjs","names":["StringUtil.Email","StringUtil.Formula","StringUtil.Hostname","StringUtil.Regex","StringUtil.Text","StringUtil.URL","NumberUtil.Currency","NumberUtil.Integer","NumberUtil.Percent","NumberUtil.Timestamp","DateUtil.DateOnly","DateUtil.DateTime","DateUtil.Duration","DateUtil.TimeOnly","ObjectUtil.GeoPoint"],"sources":["../../src/internal/Format/date.ts","../../src/internal/Format/object.ts","../../src/internal/Format/string.ts","../../src/internal/Format/format.ts","../../src/internal/Format/select.ts"],"sourcesContent":["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\nimport * as Struct from 'effect/Struct';\n\nimport * as SchemaAST from '@dxos/effect/SchemaAST';\n\nimport { FormatAnnotation, TypeFormat } from './types.ts';\n\n/**\n * Datetime values should be stored as ISO strings or unix numbers (ms) in UTC.\n *\n * NOTE: HyperFormula uses Excel's time format (null date 1900/01/01)\n * It can be configured to use a different parser via `parseDateTime`.\n * https://hyperformula.handsontable.com/guide/date-and-time-handling.html#date-and-time-handling\n * https://github.com/handsontable/hyperformula/blob/master/src/DateTimeHelper.ts\n */\n\n// TODO(burdon): Annotations not present in JSON.\n// TODO(burdon): Timezone.\n// TODO(burdon): Format for timestamp (Unix UTC or ISO 8601)?\n// TODO(burdon): Refs\n// - https://www.npmjs.com/package/numfmt\n// - https://date-fns.org/docs/Getting-Started\n// - https://github.com/date-fns/tz\n\n/**\n * Simple date compatible with HF.\n */\nexport const SimpleDate = Schema.Struct({\n year: Schema.Number.pipe(Schema.check(Schema.isBetween({ minimum: 1900, maximum: 9999 }))),\n month: Schema.Number.pipe(Schema.check(Schema.isBetween({ minimum: 1, maximum: 12 }))),\n day: Schema.Number.pipe(Schema.check(Schema.isBetween({ minimum: 1, maximum: 31 }))),\n});\n\nexport type SimpleDate = Schema.Schema.Type<typeof SimpleDate>;\n\nexport const toSimpleDate = (date: Date): SimpleDate => ({\n year: date.getUTCFullYear(),\n month: date.getUTCMonth() + 1,\n day: date.getUTCDate(),\n});\n\n/**\n * Simple time compatible with HF.\n */\nexport const SimpleTime = Schema.Struct({\n hours: Schema.Number.pipe(Schema.check(Schema.isBetween({ minimum: 0, maximum: 23 }))),\n minutes: Schema.Number.pipe(Schema.check(Schema.isBetween({ minimum: 0, maximum: 59 }))),\n seconds: Schema.Number.pipe(Schema.check(Schema.isBetween({ minimum: 0, maximum: 59 }))),\n});\n\nexport type SimpleTime = Schema.Schema.Type<typeof SimpleTime>;\n\nexport const toSimpleTime = (date: Date): SimpleTime => ({\n hours: date.getUTCHours(),\n minutes: date.getUTCSeconds(),\n seconds: date.getUTCSeconds(),\n});\n\n/**\n * Simple date-time compatible with HF.\n */\nexport const SimpleDateTime = SimpleDate.mapFields(Struct.assign(SimpleTime.fields));\n\nexport type SimpleDateTime = Schema.Schema.Type<typeof SimpleDateTime>;\n\nexport const toSimpleDateTime = (date: Date): SimpleDateTime => ({\n ...toSimpleDate(date),\n ...toSimpleTime(date),\n});\n\n/**\n * https://effect.website/docs/guides/schema/transformations#date-transformations\n */\n\n// TODO(burdon): Consider if transformations should be supported with Automerge.\n\n/**\n * Format: 2018-11-13\n */\nexport const DateOnly = /* Schema.transformOrFail(Schema.String, SimpleDate, {\n strict: true,\n decode: (str, _, ast) => {\n if (!isValidDateFormat(str)) {\n return ParseResult.fail(new ParseResult.Type(ast, str, 'Expected YYYY-MM-DD format'));\n }\n if (!isValidDate(str)) {\n return ParseResult.fail(new ParseResult.Type(ast, str, 'Invalid date'));\n }\n\n const [year, month, day] = str.split('-').map(Number);\n return ParseResult.succeed({ year, month, day });\n },\n encode: (date) => {\n return ParseResult.succeed(\n [\n date.year.toString().padStart(4, '0'),\n date.month.toString().padStart(2, '0'),\n date.day.toString().padStart(2, '0'),\n ].join('-'),\n );\n },\n}) */ Schema.String.pipe(\n FormatAnnotation.set(TypeFormat.Date),\n Schema.annotate({\n description: 'Valid date in ISO format',\n }),\n);\n\n/**\n * Format: 20:20:39+00:00\n */\nexport const TimeOnly = /* Schema.transformOrFail(Schema.String, SimpleTime, {\n strict: true,\n decode: (str, _, ast) => {\n if (!isValidTimeFormat(str)) {\n return ParseResult.fail(new ParseResult.Type(ast, str, 'Expected HH:mm:ss format'));\n }\n\n const [hours, minutes, seconds] = str.split(':').map(Number);\n return ParseResult.succeed({ hours, minutes, seconds });\n },\n encode: (time) => {\n return ParseResult.succeed(\n [\n time.hours.toString().padStart(2, '0'),\n time.minutes.toString().padStart(2, '0'),\n time.seconds.toString().padStart(2, '0'),\n ].join(':'),\n );\n },\n}) */ Schema.String.pipe(\n FormatAnnotation.set(TypeFormat.Time),\n Schema.annotate({\n description: 'Valid time in ISO format',\n }),\n);\n\n/**\n * Format: 2018-11-13T20:20:39+00:00\n */\nexport const DateTime = /* Schema.transformOrFail(Schema.String, SimpleDateTime, {\n strict: false,\n decode: (str, _, ast) => {\n const [date, time] = str.split('T');\n if (!isValidDateFormat(date)) {\n return ParseResult.fail(new ParseResult.Type(ast, date, 'Expected YYYY-MM-DD format'));\n }\n if (!isValidDate(date)) {\n return ParseResult.fail(new ParseResult.Type(ast, date, 'Invalid date'));\n }\n if (!isValidTimeFormat(time)) {\n return ParseResult.fail(new ParseResult.Type(ast, str, 'Expected HH:mm:ss format'));\n }\n\n const [year, month, day] = date.split('-').map(Number);\n const [hours, minutes, seconds] = time.split(':').map(Number);\n return ParseResult.succeed({ year, month, day, hours, minutes, seconds });\n },\n encode: (datetime) => {\n return ParseResult.succeed(\n [\n [\n datetime.year.toString().padStart(4, '0'),\n datetime.month.toString().padStart(2, '0'),\n datetime.day.toString().padStart(2, '0'),\n ].join('-'),\n [\n datetime.hours.toString().padStart(2, '0'),\n datetime.minutes.toString().padStart(2, '0'),\n datetime.seconds.toString().padStart(2, '0'),\n ].join(':'),\n ].join('T'),\n );\n },\n}) */ Schema.String.pipe(\n FormatAnnotation.set(TypeFormat.DateTime),\n Schema.annotate({\n description: 'Valid date and time in ISO format',\n }),\n);\n\n/**\n * https://datatracker.ietf.org/doc/html/rfc3339#appendix-A\n */\n// TODO(burdon): Define duration type.\nexport const Duration = Schema.String.pipe(\n FormatAnnotation.set(TypeFormat.Duration),\n Schema.annotate({\n description: 'Duration in ISO 8601 format',\n [SchemaAST.ExamplesAnnotationId]: ['1h', '3D'],\n }),\n);\n\n//\n// Utils\n//\n\n// YYYY-MM-DD\nconst DATE_REGEX = /^\\d{4}-\\d{2}-\\d{2}$/;\n\nconst _isValidDateFormat = (str: string) => DATE_REGEX.test(str);\n\nconst _isValidDate = (str: string) => {\n const date = new Date(str);\n return !isNaN(date.getTime()) && date.toISOString().startsWith(str);\n};\n\n// HH:mm:ss\nconst TIME_REGEX = /^([01]\\d|2[0-3]):([0-5]\\d):([0-5]\\d)$/;\n\nconst _isValidTimeFormat = (str: string) => TIME_REGEX.test(str);\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\nimport * as SchemaTransformation from 'effect/SchemaTransformation';\n\nimport { clamp } from '@dxos/util';\n\nimport { FormatAnnotation, TypeFormat } from './types.ts';\n\n/**\n * GeoJSON Format\n * https://datatracker.ietf.org/doc/html/rfc7946\n * https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.1\n * https://en.wikipedia.org/wiki/Geographic_coordinate_system\n * https://geojson.org\n * {\n * \"type\": \"Point\",\n * \"coordinates\": [0, 51.47] // [longitude, latitude]\n * }\n * Note: optional third element for altitude.\n */\n/** Decimal places retained for stored coordinates (~1.1cm at the equator). */\nexport const GEO_PRECISION = 7;\n\nconst roundCoordinate = (value: number): number => {\n const factor = 10 ** GEO_PRECISION;\n return Math.round(value * factor) / factor;\n};\n\n/** Longitude/latitude clamped to range and rounded to {@link GEO_PRECISION} decimal places. */\nconst Coordinate = (min: number, max: number, title: string) =>\n Schema.Number.pipe(\n Schema.decodeTo(\n Schema.Number,\n // v4 removed `Schema.clamp`; the guide rebuilds it as an explicit reversible transformation,\n // which folds into the rounding step already happening here.\n SchemaTransformation.transform({\n decode: (value: number) => roundCoordinate(Math.min(Math.max(value, min), max)),\n encode: (value: number) => roundCoordinate(Math.min(Math.max(value, min), max)),\n }),\n ),\n ).annotate({ title });\n\nexport const GeoPoint = Schema.Tuple([\n Coordinate(-180, 180, 'Longitude'),\n Coordinate(-90, 90, 'Latitude'),\n Schema.optionalKey(Schema.Number).annotate({\n title: 'Height ASL (m)',\n }),\n]).pipe(\n FormatAnnotation.set(TypeFormat.GeoPoint),\n Schema.annotate({\n title: 'GeoPoint',\n description: 'GeoJSON Position',\n }),\n);\n\nexport type GeoPoint = Schema.Schema.Type<typeof GeoPoint>;\n\nexport type GeoLocation = {\n longitude: number;\n latitude: number;\n height?: number;\n};\n\n/**\n * Geolocation utilities for working with GeoPoint format.\n */\nexport namespace GeoLocation {\n /**\n * Convert latitude and longitude to GeoPoint (GeoJSON format [longitude, latitude, height?]).\n * Clamps values to valid ranges: latitude [-90, 90], longitude [-180, 180].\n */\n export const toGeoPoint = ({ longitude, latitude, height }: GeoLocation): GeoPoint => {\n // TODO(ZaymonFC): Use schema validation instead of doing this manually.\n // Clamp + round to match the `Format.GeoPoint` decode/encode path so both produce identical tuples.\n const clampedLongitude = roundCoordinate(clamp(longitude, -180, 180));\n const clampedLatitude = roundCoordinate(clamp(latitude, -90, 90));\n return height !== undefined ? [clampedLongitude, clampedLatitude, height] : [clampedLongitude, clampedLatitude];\n };\n\n /**\n * Extract latitude and longitude from GeoPoint (GeoJSON format [longitude, latitude, height?]).\n */\n export const fromGeoPoint = (geoPoint: GeoPoint | undefined): GeoLocation => {\n if (!geoPoint) {\n return { longitude: 0, latitude: 0 };\n }\n\n const result: GeoLocation = {\n longitude: geoPoint[0],\n latitude: geoPoint[1],\n };\n\n // Add height if defined.\n if (geoPoint[2] !== undefined) {\n result.height = geoPoint[2];\n }\n\n return result;\n };\n}\n","//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport * as SchemaAST from '@dxos/effect/SchemaAST';\n\nimport { FormatAnnotation, TypeFormat } from './types.ts';\n\n/**\n * Email address (RFC 5321). The local part also allows an apostrophe, which real mail carries (`o'day@corp.com`).\n * https://datatracker.ietf.org/doc/html/rfc5321#section-4.1.2\n */\nexport const Email = Schema.String.pipe(\n Schema.check(Schema.isPattern(/^[a-zA-Z0-9._%+'-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/u)),\n FormatAnnotation.set(TypeFormat.Email),\n Schema.annotate({\n title: 'Email',\n description: 'Email address',\n }),\n);\n\n/**\n *\n */\n// TODO(burdon): Implement.\nexport const Formula = Schema.String.pipe(FormatAnnotation.set(TypeFormat.Formula));\n\n/**\n *\n */\n// TODO(burdon): Implement.\nexport const Hostname = Schema.String.pipe(FormatAnnotation.set(TypeFormat.Hostname));\n\n/**\n * Regex\n * https://json-schema.org/understanding-json-schema/reference/regular_expressions\n * https://ecma-international.org/publications-and-standards/standards/ecma-262\n */\n// TODO(burdon): Implement.\nexport const Regex = Schema.String.pipe(FormatAnnotation.set(TypeFormat.Regex));\n\n/**\n * Multi-line text.\n */\nexport const Text = Schema.String.pipe(FormatAnnotation.set(TypeFormat.Text));\n\n/**\n * Multi-line text written as Markdown; a form renders it in an editor with Markdown decorations.\n */\nexport const Markdown = Schema.String.pipe(FormatAnnotation.set(TypeFormat.Markdown));\n\nconst URL_PATTERN = /^(\\w+?:\\/\\/)?([\\da-z.-]+)\\.([a-z.]{2,6})([/\\w .-]*)*\\/?$/i;\n\n/**\n * https://datatracker.ietf.org/doc/html/rfc3986#section-1.1.3\n */\nexport const URL = Schema.String.pipe(\n // JSON Schema patterns take no flags, so the case-sensitive source is exported rather than dropped.\n Schema.check(\n Schema.isPattern(URL_PATTERN, {\n toJsonSchema: () => ({ pattern: URL_PATTERN.source }),\n }),\n ),\n FormatAnnotation.set(TypeFormat.URL),\n Schema.annotate({\n title: 'URL',\n description: 'URL',\n }),\n);\n\n/**\n * UUID (RFC 4122)\n * https://datatracker.ietf.org/doc/html/rfc4122\n */\nexport const UUID = Schema.String.check(Schema.isUUID()).pipe(\n FormatAnnotation.set(TypeFormat.UUID),\n Schema.annotate({\n [SchemaAST.ExamplesAnnotationId]: ['3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a'],\n }),\n);\n","//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport * as Keys from '@dxos/keys';\n\nimport * as DateUtil from './date.ts';\nimport * as NumberUtil from './number.ts';\nimport * as ObjectUtil from './object.ts';\nimport * as StringUtil from './string.ts';\nimport { TypeFormat as TypeFormat$ } from './types.ts';\n\n// TODO(burdon): Media encoding.\n// - https://json-schema.org/understanding-json-schema/reference/non_json_data\n\n/**\n * Formats.\n * https://json-schema.org/understanding-json-schema/reference/string#built-in-formats\n * NOTE: A JSON Schema validator will ignore any format type that it does not understand.\n */\n// TODO(burdon): Add fields for `examples`, `message`, etc.\nexport namespace Format {\n export import TypeFormat = TypeFormat$;\n\n // String\n export const DXN = Keys.DXN.Schema;\n export const Email = StringUtil.Email;\n export const Formula = StringUtil.Formula;\n export const Hostname = StringUtil.Hostname;\n export const Regex = StringUtil.Regex;\n export const Text = StringUtil.Text;\n export const URL = StringUtil.URL;\n export const UUID = Schema.String.check(Schema.isUUID());\n\n // Numbers\n // TODO(burdon): BigInt.\n export const Currency = NumberUtil.Currency;\n export const Integer = NumberUtil.Integer;\n export const Percent = NumberUtil.Percent;\n export const Timestamp = NumberUtil.Timestamp;\n\n // Dates and times\n export const Date = DateUtil.DateOnly;\n export const DateTime = DateUtil.DateTime;\n export const Duration = DateUtil.Duration;\n export const Time = DateUtil.TimeOnly;\n\n // Objects\n export const GeoPoint = ObjectUtil.GeoPoint;\n export type GeoPoint = ObjectUtil.GeoPoint; // TODO(burdon): Export types.\n}\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\n/**\n * Schema for a single select option. Used to define choices in a {single|multi}-select field.\n */\nexport const SelectOption = Schema.Struct({\n /** Stable identifier for the option. */\n id: Schema.NonEmptyString,\n title: Schema.String,\n /** Color palette used for visual styling. */\n color: Schema.String,\n});\n\nexport type SelectOption = Schema.Schema.Type<typeof SelectOption>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA+BA,IAAa,aAAa,OAAO,OAAO;CACtC,MAAM,OAAO,OAAO,KAAK,OAAO,MAAM,OAAO,UAAU;EAAE,SAAS;EAAM,SAAS;CAAK,CAAC,CAAC,CAAC;CACzF,OAAO,OAAO,OAAO,KAAK,OAAO,MAAM,OAAO,UAAU;EAAE,SAAS;EAAG,SAAS;CAAG,CAAC,CAAC,CAAC;CACrF,KAAK,OAAO,OAAO,KAAK,OAAO,MAAM,OAAO,UAAU;EAAE,SAAS;EAAG,SAAS;CAAG,CAAC,CAAC,CAAC;AACrF,CAAC;AAID,IAAa,gBAAgB,UAA4B;CACvD,MAAM,KAAK,eAAe;CAC1B,OAAO,KAAK,YAAY,IAAI;CAC5B,KAAK,KAAK,WAAW;AACvB;;;;AAKA,IAAa,aAAa,OAAO,OAAO;CACtC,OAAO,OAAO,OAAO,KAAK,OAAO,MAAM,OAAO,UAAU;EAAE,SAAS;EAAG,SAAS;CAAG,CAAC,CAAC,CAAC;CACrF,SAAS,OAAO,OAAO,KAAK,OAAO,MAAM,OAAO,UAAU;EAAE,SAAS;EAAG,SAAS;CAAG,CAAC,CAAC,CAAC;CACvF,SAAS,OAAO,OAAO,KAAK,OAAO,MAAM,OAAO,UAAU;EAAE,SAAS;EAAG,SAAS;CAAG,CAAC,CAAC,CAAC;AACzF,CAAC;AAID,IAAa,gBAAgB,UAA4B;CACvD,OAAO,KAAK,YAAY;CACxB,SAAS,KAAK,cAAc;CAC5B,SAAS,KAAK,cAAc;AAC9B;;;;AAKA,IAAa,iBAAiB,WAAW,UAAU,OAAO,OAAO,WAAW,MAAM,CAAC;AAInF,IAAa,oBAAoB,UAAgC;CAC/D,GAAG,aAAa,IAAI;CACpB,GAAG,aAAa,IA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,GAAG,GACnC,OAAO,SAAS;CACd,OAAO;CACP,aAAa;AACf,CAAC,CACH;;;;;AAMA,IAAa,OAAO,OAAO,OAAO,MAAM,OAAO,OAAO,CAAC,CAAC,CAAC,KACvD,iBAAiB,IAAI,WAAW,IAAI,GACpC,OAAO,SAAS,GACb,UAAU,uBAAuB,CAAC,sCAAsC,EAC3E,CAAC,CACH;;;AC1DO,IAAU;CAAV,SAAA,SAAA;;CAIQ,QAAA,MAAM,KAAK,IAAI;CACf,QAAA,QAAQA;CACR,QAAA,UAAUC;CACV,QAAA,WAAWC;CACX,QAAA,QAAQC;CACR,QAAA,OAAOC;CACP,QAAA,MAAMC;CACN,QAAA,OAAO,OAAO,OAAO,MAAM,OAAO,OAAO,CAAC;CAI1C,QAAA,WAAWC;CACX,QAAA,UAAUC;CACV,QAAA,UAAUC;CACV,QAAA,YAAYC;CAGZ,QAAA,OAAOC;CACP,QAAA,WAAWC;CACX,QAAA,WAAWC;CACX,QAAA,OAAOC;CAGP,QAAA,WAAWC;AAEzB,EAAA,CAAA,WAAA,SAAA,CAAA,EAAD;;;;;;AC3CA,IAAa,eAAe,OAAO,OAAO;;CAExC,IAAI,OAAO;CACX,OAAO,OAAO;;CAEd,OAAO,OAAO;AAChB,CAAC"}
|
package/dist/lib/index.mjs
CHANGED
|
@@ -9,16 +9,16 @@ import { r as Obj_exports } from "./chunk-Obj.mjs";
|
|
|
9
9
|
import { r as Blob_exports } from "./chunk-Blob.mjs";
|
|
10
10
|
import { n as Change_exports } from "./chunk-Change.mjs";
|
|
11
11
|
import { n as Filter_exports } from "./chunk-Filter.mjs";
|
|
12
|
+
import { n as Order_exports } from "./chunk-Order.mjs";
|
|
12
13
|
import { n as Query_exports } from "./chunk-Query.mjs";
|
|
13
14
|
import { t as Scope_exports } from "./chunk-Scope.mjs";
|
|
14
|
-
import {
|
|
15
|
+
import { c as Feed_exports } from "./chunk-Feed.mjs";
|
|
15
16
|
import { t as Format_exports } from "./chunk-Format.mjs";
|
|
16
17
|
import { t as Hypergraph_exports } from "./chunk-Hypergraph.mjs";
|
|
17
18
|
import { t as Json_exports } from "./chunk-Json.mjs";
|
|
18
19
|
import { n as JsonSchema_exports } from "./chunk-JsonSchema.mjs";
|
|
19
20
|
import { i as Key_exports } from "./chunk-Key.mjs";
|
|
20
21
|
import { t as Migration_exports } from "./chunk-Migration.mjs";
|
|
21
|
-
import { n as Order_exports } from "./chunk-Order.mjs";
|
|
22
22
|
import { t as QueryResult_exports } from "./chunk-QueryResult.mjs";
|
|
23
23
|
import { t as Registry_exports } from "./chunk-Registry.mjs";
|
|
24
24
|
import { n as Relation_exports } from "./chunk-Relation.mjs";
|
package/dist/lib/internal.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
import { $ as validateAndReactifyTarget, A as objectToJSON, At as
|
|
1
|
+
import { S as setDictionary, _ as isTagEntity, a as addTag, b as Key, c as getMetaChecked, d as EntityMetaSchema, f as SCALAR_META_FIELDS, g as getMeta, h as foreignKeyEquals, i as isEntity, l as removeTag, m as foreignKey, n as set, o as deleteKeys, p as compareForeignKeys, r as update, s as getKeys, t as get, u as ATTR_META, v as TagTypeDXN, x as getDictionary, y as Dictionary } from "./chunk-entity-dictionary.mjs";
|
|
2
|
+
import { $ as validateAndReactifyTarget, A as objectToJSON, At as sort, B as EchoRelationSchema, C as filterMatchValue, Ct as typedJsonSerializer, D as objectFromJSON, Dt as prettyQuery, E as matchesTag, Et as prettyFilter, F as encodeVersion, Ft as isProjection, G as normalizeSchema, H as makeRelationType, I as isVersion, It as makeProjection, J as makeDecodedEntityLive, K as TypeMetaSchemaDXN, L as version, Lt as RawObject, M as resolveMergeRedirect, Mt as sortByTypename, N as compareVersions, Nt as VersionTypeId, O as objectStructureFromJson, Ot as assertObjectModel, P as decodeVersion, Pt as ProjectionTypeId, Q as prepareTypedTarget, R as versionValid, S as filterMatchEntity, St as attachTypedJsonSerializer, T as matchMetaKey, Tt as getStrongDependencyUris, U as EchoObjectSchema, V as getDXNForRelationSchemaRef, W as makeObjectType, X as TypedReactiveHandler, Y as makeObject, Z as prepareDecodedTypedTarget, _ as propagateParentAnnotations, _t as batchEvents, a as updateFieldsInSchema, at as ReactiveArray, b as makeTypedEntityClass, bt as beginCommit, c as makeEntity, ct as assertMutable, d as makeProperty, dt as executeChange, et as SchemaValidator, f as makeRelation, ft as hasPendingNotifications, g as setValue, gt as queueOwnerNotification, h as getSnapshot, ht as queueNotification, i as updateFieldNameInSchema, it as isPlainRecord, j as setRefResolverOnData, jt as sortByLabel, k as objectStructureToJson, kt as compare, l as makeLabelAtom, lt as clearPendingNotifications, m as makeWithReactive, mt as isInChangeContext, n as addFieldsToSchema, nt as checkIdNotPresentOnSchema, o as clone, ot as getEchoRoot, p as makeTagsAtom, pt as isAnyChangeContextActive, q as makeEchoTypeSchema, r as removeFieldsFromSchema, rt as isEntityArrayAst, s as makeAtom, st as setMetaOwner, t as TypeSchema, tt as assertsWithDetail, u as makeParentAtom, ut as enterChangeContext, v as isDeleted, vt as emitEvent, w as makeFilterMatcher, wt as getStrongDependencies, x as compareTypenameStrings, xt as runInCommit, y as createObject, yt as afterCommit, z as EchoTypeKindSchema } from "./chunk-internal.mjs";
|
|
3
3
|
import { a as ANY_OBJECT_VERSION, c as InstancePhantomId, d as SnapshotKindId, f as StaticTypeSchemaSlot, g as getStaticTypeSchema, h as getSchemaKind, i as ANY_OBJECT_TYPENAME, l as KindId, m as getEntityKindBrand, n as makeTypeJsonSchemaAnnotation, o as EntityKind, p as UnknownTypeSchemaBrandId, r as unwrapOptional, s as EntityKindSchema, t as createAnnotationHelper, u as SchemaKindId } from "./chunk-util.mjs";
|
|
4
|
-
import { $ as
|
|
5
|
-
import { A as
|
|
4
|
+
import { $ as FormInputAnnotationId, $t as SchemaId, A as getTypeURIFromSpecifier, At as getIcon, B as ArrayPresentationAnnotationId, Bt as getTypeURI, Ct as UserTypeAnnotation, Dt as getDescriptionWithSchema, Et as getDescription, F as getUri, Ft as getSchemaTypename, G as FIELD_PATH_ANNOTATION, Gt as setDescriptionWithSchema, H as DEFAULT_LAYOUT_NAME, Ht as hasRawStringAnnotation, I as setFeedBlockKeys, It as getSchemaURI, J as FormCreateAnnotation, Jt as setTypename, K as FieldLookupAnnotationId, Kt as setLabel, L as getObjectEchoUri, Lt as getSchemaVersion, M as getBranch, Mt as getLabelProperty, N as getDatabase, Nt as getLabelWithSchema, Ot as getEntityKind, P as getFeedBlockKeys, Pt as getPropertyMetaAnnotation, Q as FormInputAnnotation, Qt as SchemaAstId, R as defineHiddenProperty, Rt as getTypeAnnotation, St as TypenameSchema, Tt as containsRawStringAnnotation, U as DescriptionAnnotation, Ut as makeUserAnnotation, V as ContentVersionAnnotation, Vt as getTypename, W as DescriptionAnnotationId, Wt as setDescription, X as FormInlineAnnotation, Xt as ATTR_TYPE, Y as FormCreateAnnotationId, Yt as ATTR_PARENT, Z as FormInlineAnnotationId, Zt as ParentId, _n as RelationSourceDXNId, _t as SetParentAnnotation, an as setType, at as GeneratorAnnotationId, bn as RelationTargetId, bt as TypeIdentifierAnnotationId, cn as ATTR_RELATION_TARGET, ct as LabelAnnotation, dn as FeedBlockKeysId, dt as PropertyMetaAnnotationId, en as TypeEntityId, et as FormLayoutAnnotation, fn as MetaId, ft as RawStringAnnotation, gn as ObjectVersionId, gt as SchemaMetaSymbol, hn as ObjectDeletedId, ht as ReferenceAnnotationId, in as setSchema, it as GeneratorAnnotation, j as isInstanceOf, jt as getLabel, kt as getFromAst, ln as ATTR_SELF_URI, lt as LabelAnnotationId, mn as ObjectDatabaseId, mt as ReferenceAnnotation, nn as getSchema, nt as FormOrderedAnnotation, on as ATTR_DELETED, ot as IconAnnotation, pn as ObjectBranchId, pt as RawStringAnnotationId, q as FieldPath, qt as setLabelWithSchema, rn as getType, rt as FormOrderedAnnotationId, sn as ATTR_RELATION_SOURCE, st as IconFromRefAnnotation, tn as TypeId, tt as FormLayoutAnnotationId, un as ATTR_SELF_URI_LEGACY, ut as PropertyMeta, vn as RelationSourceId, vt as TypeAnnotation, wt as VersionSchema, xn as SelfURIId, xt as TypeMeta, yn as RelationTargetDXNId, yt as TypeAnnotationId, z as ArrayPresentationAnnotation, zt as getTypeIdentifierAnnotation } from "./chunk-Database.mjs";
|
|
5
|
+
import { A as symbolReactivePrototype, B as EventId, C as getProxyHandler, D as isValidProxyTarget, E as isReactiveRecord, F as createTextMethodError, I as ChangeId, L as ChangeKeyId, M as createArrayMethodError, N as createPropertyDeleteError, O as normalizeSpliceRange, P as createPropertySetError, R as EntityElementsId, S as getMutableProxy, T as isProxy, a as StaticRefResolver, b as canonicalOf, c as getRefSavedTarget, d as getSchemaReferenceDXN, f as isRefIdentifier, h as setRefResolver, i as RefTypeId, j as MutationOutsideChangeContextError, k as setProxyHandler, l as getReferenceAst, m as refFromEncodedReference, n as Ref, o as createEchoReferenceSchema, p as makeSettledRequest, r as RefImpl, s as createSchemaReference, t as JSON_SCHEMA_ECHO_REF_ID, u as getSchemaReference, v as change, w as getProxyTarget, x as createProxy, y as subscribe, z as EntityValueAnnotationId } from "./chunk-ref.mjs";
|
|
6
6
|
import { n as loadAll, t as RefArray } from "./chunk-ref-array.mjs";
|
|
7
7
|
import { _ as getOptionsAnnotation, c as FormatAnnotationId, d as OptionsAnnotationId, f as PropertyKind, g as getFormatAnnotation, h as formatToType, l as FormatEnums, m as TypeFormat, n as CurrencyAnnotationId, p as TypeEnum, r as DecimalPrecision, s as FormatAnnotation, t as Currency, u as OptionsAnnotation, v as getTypeEnum, y as typeToFormat } from "./chunk-number.mjs";
|
|
8
|
-
import { _ as
|
|
8
|
+
import { S as toSimpleTime, _ as SimpleDateTime, a as Hostname, b as toSimpleDate, c as Text, d as GeoLocation, f as GeoPoint, g as SimpleDate, h as Duration, i as Formula, l as URL, m as DateTime, n as Format, o as Markdown, p as DateOnly, r as Email, s as Regex, t as SelectOption, u as UUID, v as SimpleTime, x as toSimpleDateTime, y as TimeOnly } from "./chunk-select.mjs";
|
|
9
9
|
import { a as toPropType, c as JsonSchemaEchoAnnotations, d as getNormalizedEchoAnnotations, f as getSchemaProperty, g as EchoAnnotations, h as DecodedAnnotations, i as toJsonSchema, l as JsonSchemaFields, m as CustomAnnotations, n as foldRestSignatures, o as ECHO_ANNOTATIONS_NS_DEPRECATED_KEY, p as setSchemaProperty, r as toEffectSchema, s as ECHO_ANNOTATIONS_NS_KEY, t as PropType, u as JsonSchemaType } from "./chunk-json-schema.mjs";
|
|
10
|
-
export { ANY_OBJECT_TYPENAME, ANY_OBJECT_VERSION, ATTR_DELETED, ATTR_META, ATTR_PARENT, ATTR_RELATION_SOURCE, ATTR_RELATION_TARGET, ATTR_SELF_URI, ATTR_SELF_URI_LEGACY, ATTR_TYPE, ArrayPresentationAnnotation, ArrayPresentationAnnotationId, ChangeId, ChangeKeyId, Currency, CurrencyAnnotationId, CustomAnnotations, DEFAULT_LAYOUT_NAME, DateOnly, DateTime, DecimalPrecision, DecodedAnnotations, DescriptionAnnotation, DescriptionAnnotationId, Dictionary, Duration, ECHO_ANNOTATIONS_NS_DEPRECATED_KEY, ECHO_ANNOTATIONS_NS_KEY, EchoAnnotations, EchoObjectSchema, EchoRelationSchema, EchoTypeKindSchema, Email, EntityKind, EntityKindSchema, EntityMetaSchema, EventId, FIELD_PATH_ANNOTATION, FieldLookupAnnotationId, FieldPath, FormCreateAnnotation, FormCreateAnnotationId, FormInlineAnnotation, FormInlineAnnotationId, FormInputAnnotation, FormInputAnnotationId, FormLayoutAnnotation, FormLayoutAnnotationId, FormOrderedAnnotation, FormOrderedAnnotationId, Format, FormatAnnotation, FormatAnnotationId, FormatEnums, Formula, GeneratorAnnotation, GeneratorAnnotationId, GeoLocation, GeoPoint, Hostname, IconAnnotation, IconFromRefAnnotation, InstancePhantomId, JSON_SCHEMA_ECHO_REF_ID, JsonSchemaEchoAnnotations, JsonSchemaFields, JsonSchemaType, Key, KindId, LabelAnnotation, LabelAnnotationId, MetaId, MutationOutsideChangeContextError, ObjectBranchId, ObjectDatabaseId, ObjectDeletedId, ObjectVersionId, OptionsAnnotation, OptionsAnnotationId, ParentId, ProjectionTypeId, PropType, PropertyKind, PropertyMeta, PropertyMetaAnnotationId, RawObject, ReactiveArray, Ref, RefArray, RefImpl, RefTypeId, ReferenceAnnotation, ReferenceAnnotationId, Regex, RelationSourceDXNId, RelationSourceId, RelationTargetDXNId, RelationTargetId, SCALAR_META_FIELDS, SchemaAstId, SchemaId, SchemaKindId, SchemaMetaSymbol, SchemaValidator, SelectOption, SelfURIId, SetParentAnnotation, SimpleDate, SimpleDateTime, SimpleTime, SnapshotKindId, StaticRefResolver, StaticTypeSchemaSlot, TagTypeDXN, Text, TimeOnly, TypeAnnotation, TypeAnnotationId, TypeEntityId, TypeEnum, TypeFormat, TypeId, TypeIdentifierAnnotationId, TypeMeta, TypeMetaSchemaDXN, TypeSchema, TypedReactiveHandler, TypenameSchema, URL, UUID, UnknownTypeSchemaBrandId, UserTypeAnnotation, VersionSchema, VersionTypeId, addFieldsToSchema, addTag, afterCommit, assertMutable, assertObjectModel, assertsWithDetail, attachTypedJsonSerializer, batchEvents, beginCommit, canonicalOf, change, checkIdNotPresentOnSchema, clearPendingNotifications, clone, compare, compareForeignKeys, compareTypenameStrings, compareVersions, createAnnotationHelper, createArrayMethodError, createEchoReferenceSchema, createObject, createPropertyDeleteError, createPropertySetError, createProxy, createSchemaReference, createTextMethodError, decodeVersion, defineHiddenProperty, deleteKeys, emitEvent, encodeVersion, enterChangeContext, executeChange, filterMatchEntity, filterMatchValue, foldRestSignatures, foreignKey, foreignKeyEquals, formatToType, get, getBranch, getDXNForRelationSchemaRef, getDatabase, getDescription, getDescriptionWithSchema, getDictionary, getEchoRoot, getEntityKind, getEntityKindBrand, getFormatAnnotation, getFromAst, getIcon, getKeys, getLabel, getLabelProperty, getLabelWithSchema, getMeta, getMetaChecked, getMutableProxy, getNormalizedEchoAnnotations, getObjectEchoUri, getOptionsAnnotation, getPropertyMetaAnnotation, getProxyHandler, getProxyTarget, getRefSavedTarget, getReferenceAst, getSchema, getSchemaKind, getSchemaProperty, getSchemaReference, getSchemaReferenceDXN, getSchemaTypename, getSchemaURI, getSchemaVersion, getSnapshot, getStaticTypeSchema, getStrongDependencies, getStrongDependencyUris, getType, getTypeAnnotation, getTypeEnum, getTypeIdentifierAnnotation, getTypeURI, getTypeURIFromSpecifier, getTypename, getUri, hasPendingNotifications, isDeleted, isEntity, isInChangeContext, isInstanceOf, isProjection, isProxy, isReactiveRecord, isRefIdentifier, isValidProxyTarget, isVersion, loadAll, makeAtom, makeDecodedEntityLive, makeEchoTypeSchema, makeEntity, makeFilterMatcher, makeLabelAtom, makeObject, makeObjectType, makeParentAtom, makeProjection, makeProperty, makeRelation, makeRelationType, makeSettledRequest, makeTagsAtom, makeTypeJsonSchemaAnnotation, makeTypedEntityClass, makeUserAnnotation, makeWithReactive, matchMetaKey, matchesTag, normalizeSchema, normalizeSpliceRange, objectFromJSON, objectStructureFromJson, objectStructureToJson, objectToJSON, prepareDecodedTypedTarget, prepareTypedTarget, prettyFilter, prettyQuery, propagateParentAnnotations, queueNotification, queueOwnerNotification, refFromEncodedReference, removeFieldsFromSchema, removeTag, resolveMergeRedirect, runInCommit, set, setDescription, setDescriptionWithSchema, setDictionary, setLabel, setLabelWithSchema, setMetaOwner, setProxyHandler, setRefResolver, setRefResolverOnData, setSchema, setSchemaProperty, setType, setTypename, setValue, sort, sortByLabel, sortByTypename, subscribe, symbolReactivePrototype, toEffectSchema, toJsonSchema, toPropType, toSimpleDate, toSimpleDateTime, toSimpleTime, typeToFormat, typedJsonSerializer, unwrapOptional, update, updateFieldNameInSchema, updateFieldsInSchema, validateAndReactifyTarget, version, versionValid };
|
|
10
|
+
export { ANY_OBJECT_TYPENAME, ANY_OBJECT_VERSION, ATTR_DELETED, ATTR_META, ATTR_PARENT, ATTR_RELATION_SOURCE, ATTR_RELATION_TARGET, ATTR_SELF_URI, ATTR_SELF_URI_LEGACY, ATTR_TYPE, ArrayPresentationAnnotation, ArrayPresentationAnnotationId, ChangeId, ChangeKeyId, ContentVersionAnnotation, Currency, CurrencyAnnotationId, CustomAnnotations, DEFAULT_LAYOUT_NAME, DateOnly, DateTime, DecimalPrecision, DecodedAnnotations, DescriptionAnnotation, DescriptionAnnotationId, Dictionary, Duration, ECHO_ANNOTATIONS_NS_DEPRECATED_KEY, ECHO_ANNOTATIONS_NS_KEY, EchoAnnotations, EchoObjectSchema, EchoRelationSchema, EchoTypeKindSchema, Email, EntityElementsId, EntityKind, EntityKindSchema, EntityMetaSchema, EntityValueAnnotationId, EventId, FIELD_PATH_ANNOTATION, FeedBlockKeysId, FieldLookupAnnotationId, FieldPath, FormCreateAnnotation, FormCreateAnnotationId, FormInlineAnnotation, FormInlineAnnotationId, FormInputAnnotation, FormInputAnnotationId, FormLayoutAnnotation, FormLayoutAnnotationId, FormOrderedAnnotation, FormOrderedAnnotationId, Format, FormatAnnotation, FormatAnnotationId, FormatEnums, Formula, GeneratorAnnotation, GeneratorAnnotationId, GeoLocation, GeoPoint, Hostname, IconAnnotation, IconFromRefAnnotation, InstancePhantomId, JSON_SCHEMA_ECHO_REF_ID, JsonSchemaEchoAnnotations, JsonSchemaFields, JsonSchemaType, Key, KindId, LabelAnnotation, LabelAnnotationId, Markdown, MetaId, MutationOutsideChangeContextError, ObjectBranchId, ObjectDatabaseId, ObjectDeletedId, ObjectVersionId, OptionsAnnotation, OptionsAnnotationId, ParentId, ProjectionTypeId, PropType, PropertyKind, PropertyMeta, PropertyMetaAnnotationId, RawObject, RawStringAnnotation, RawStringAnnotationId, ReactiveArray, Ref, RefArray, RefImpl, RefTypeId, ReferenceAnnotation, ReferenceAnnotationId, Regex, RelationSourceDXNId, RelationSourceId, RelationTargetDXNId, RelationTargetId, SCALAR_META_FIELDS, SchemaAstId, SchemaId, SchemaKindId, SchemaMetaSymbol, SchemaValidator, SelectOption, SelfURIId, SetParentAnnotation, SimpleDate, SimpleDateTime, SimpleTime, SnapshotKindId, StaticRefResolver, StaticTypeSchemaSlot, TagTypeDXN, Text, TimeOnly, TypeAnnotation, TypeAnnotationId, TypeEntityId, TypeEnum, TypeFormat, TypeId, TypeIdentifierAnnotationId, TypeMeta, TypeMetaSchemaDXN, TypeSchema, TypedReactiveHandler, TypenameSchema, URL, UUID, UnknownTypeSchemaBrandId, UserTypeAnnotation, VersionSchema, VersionTypeId, addFieldsToSchema, addTag, afterCommit, assertMutable, assertObjectModel, assertsWithDetail, attachTypedJsonSerializer, batchEvents, beginCommit, canonicalOf, change, checkIdNotPresentOnSchema, clearPendingNotifications, clone, compare, compareForeignKeys, compareTypenameStrings, compareVersions, containsRawStringAnnotation, createAnnotationHelper, createArrayMethodError, createEchoReferenceSchema, createObject, createPropertyDeleteError, createPropertySetError, createProxy, createSchemaReference, createTextMethodError, decodeVersion, defineHiddenProperty, deleteKeys, emitEvent, encodeVersion, enterChangeContext, executeChange, filterMatchEntity, filterMatchValue, foldRestSignatures, foreignKey, foreignKeyEquals, formatToType, get, getBranch, getDXNForRelationSchemaRef, getDatabase, getDescription, getDescriptionWithSchema, getDictionary, getEchoRoot, getEntityKind, getEntityKindBrand, getFeedBlockKeys, getFormatAnnotation, getFromAst, getIcon, getKeys, getLabel, getLabelProperty, getLabelWithSchema, getMeta, getMetaChecked, getMutableProxy, getNormalizedEchoAnnotations, getObjectEchoUri, getOptionsAnnotation, getPropertyMetaAnnotation, getProxyHandler, getProxyTarget, getRefSavedTarget, getReferenceAst, getSchema, getSchemaKind, getSchemaProperty, getSchemaReference, getSchemaReferenceDXN, getSchemaTypename, getSchemaURI, getSchemaVersion, getSnapshot, getStaticTypeSchema, getStrongDependencies, getStrongDependencyUris, getType, getTypeAnnotation, getTypeEnum, getTypeIdentifierAnnotation, getTypeURI, getTypeURIFromSpecifier, getTypename, getUri, hasPendingNotifications, hasRawStringAnnotation, isAnyChangeContextActive, isDeleted, isEntity, isEntityArrayAst, isInChangeContext, isInstanceOf, isPlainRecord, isProjection, isProxy, isReactiveRecord, isRefIdentifier, isTagEntity, isValidProxyTarget, isVersion, loadAll, makeAtom, makeDecodedEntityLive, makeEchoTypeSchema, makeEntity, makeFilterMatcher, makeLabelAtom, makeObject, makeObjectType, makeParentAtom, makeProjection, makeProperty, makeRelation, makeRelationType, makeSettledRequest, makeTagsAtom, makeTypeJsonSchemaAnnotation, makeTypedEntityClass, makeUserAnnotation, makeWithReactive, matchMetaKey, matchesTag, normalizeSchema, normalizeSpliceRange, objectFromJSON, objectStructureFromJson, objectStructureToJson, objectToJSON, prepareDecodedTypedTarget, prepareTypedTarget, prettyFilter, prettyQuery, propagateParentAnnotations, queueNotification, queueOwnerNotification, refFromEncodedReference, removeFieldsFromSchema, removeTag, resolveMergeRedirect, runInCommit, set, setDescription, setDescriptionWithSchema, setDictionary, setFeedBlockKeys, setLabel, setLabelWithSchema, setMetaOwner, setProxyHandler, setRefResolver, setRefResolverOnData, setSchema, setSchemaProperty, setType, setTypename, setValue, sort, sortByLabel, sortByTypename, subscribe, symbolReactivePrototype, toEffectSchema, toJsonSchema, toPropType, toSimpleDate, toSimpleDateTime, toSimpleTime, typeToFormat, typedJsonSerializer, unwrapOptional, update, updateFieldNameInSchema, updateFieldsInSchema, validateAndReactifyTarget, version, versionValid };
|
package/dist/lib/testing.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Y as makeObject, t as TypeSchema } from "./chunk-internal.mjs";
|
|
2
2
|
import { g as getStaticTypeSchema } from "./chunk-util.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { Ct as UserTypeAnnotation, Ft as getSchemaTypename } from "./chunk-Database.mjs";
|
|
4
4
|
import { y as subscribe } from "./chunk-ref.mjs";
|
|
5
5
|
import { i as toJsonSchema } from "./chunk-json-schema.mjs";
|
|
6
6
|
import { p as getURI, x as makeRelation, y as makeObject$1 } from "./chunk-Type.mjs";
|
|
@@ -13,10 +13,10 @@ import * as Schema from "effect/Schema";
|
|
|
13
13
|
import { assertArgument } from "@dxos/invariant";
|
|
14
14
|
import * as Struct from "effect/Struct";
|
|
15
15
|
import { deepMapValues } from "@dxos/util";
|
|
16
|
+
import * as Atom from "effect/reactivity/Atom";
|
|
16
17
|
import * as Effect from "effect/Effect";
|
|
17
18
|
import { Event } from "@dxos/async";
|
|
18
19
|
import * as Layer from "effect/Layer";
|
|
19
|
-
import * as Atom from "effect/reactivity/Atom";
|
|
20
20
|
//#region src/testing/registry.ts
|
|
21
21
|
/**
|
|
22
22
|
* Noop `Registry.Service` layer for testing — always returns empty query results.
|
package/dist/lib/testing.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.mjs","names":["Registry.Service","Registry.TypeId","Type.makeObject","Ref.Ref","Type.makeRelation","Obj.Unknown","Type.getURI"],"sources":["../../src/testing/registry.ts","../../src/testing/test-schema.ts","../../src/testing/test-data.ts","../../src/testing/util.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Layer from 'effect/Layer';\nimport * as Atom from 'effect/reactivity/Atom';\n\nimport { Event } from '@dxos/async';\n\nimport * as Registry from '../Registry.ts';\n\n/**\n * Noop `Registry.Service` layer for testing — always returns empty query results.\n * Use this in test layer stacks that require `Registry.Service` but don't need\n * actual registry contents.\n */\nexport const registryLayerNoop: Layer.Layer<Registry.Service> = Layer.succeed(Registry.Service, {\n [Registry.TypeId]: Registry.TypeId,\n id: 'noop-registry',\n changed: new Event<void>(),\n local: [],\n add: () => {},\n remove: () => false,\n clear: () => {},\n get: () => undefined,\n getByURI: () => undefined,\n list: () => [],\n // QueryFn is an overloaded interface — a single generic function cannot satisfy both overload\n // signatures without a cast. This is the intentional type-system boundary.\n query: ((_queryOrFilter: unknown) => ({\n results: [],\n entries: [],\n run: async () => [],\n runEntries: async () => [],\n runSync: () => [],\n runSyncEntries: () => [],\n first: async (): Promise<never> => {\n throw new Error('registryLayerNoop: registry is empty');\n },\n firstOrUndefined: async () => undefined,\n subscribe: () => () => {},\n atom: Atom.make((): never[] => []),\n completeness: 'complete' as const,\n sources: [],\n })) as Registry.Registry['query'],\n} satisfies Registry.Registry);\n","//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\nimport * as Struct from 'effect/Struct';\n\nimport { DXN } from '@dxos/keys';\n\nimport * as Annotation from '../Annotation.ts';\nimport * as Obj from '../Obj.ts';\nimport * as Ref from '../Ref.ts';\nimport * as Type from '../Type.ts';\n\nexport namespace TestSchema {\n //\n // Expando\n //\n\n /**\n * Expando object is an object with an arbitrary set of properties.\n * This is the test variant with example.com namespace.\n */\n export class Expando extends Type.makeObject<Expando>(DXN.make('com.example.type.expando', '0.1.0'))(\n Schema.StructWithRest(Schema.Struct({}), [Schema.Record(Schema.String, Schema.Any)]).pipe(\n Annotation.UserType.set(),\n ),\n ) {}\n\n //\n // Example\n //\n\n const Nested = Schema.Struct({\n field: Schema.String,\n });\n\n export class TestClass {\n field = 'value';\n toJSON() {\n return { field: this.field };\n }\n }\n\n /** @deprecated Use another test schema or create a specific local test schema. */\n export const ExampleSchema = Schema.Struct({\n string: Schema.String,\n number: Schema.Number,\n boolean: Schema.Boolean,\n null: Schema.Null,\n undefined: Schema.Undefined,\n stringArray: Schema.Array(Schema.String),\n twoDimNumberArray: Schema.Array(Schema.Array(Schema.Number)),\n nested: Nested,\n nestedArray: Schema.Array(Nested),\n nestedNullableArray: Schema.Array(Schema.Union([Nested, Schema.Null])),\n reference: Schema.suspend((): Ref.RefSchema<Example> => Ref.Ref(Example)),\n referenceArray: Schema.Array(Schema.suspend((): Ref.RefSchema<Example> => Ref.Ref(Example))),\n classInstance: Schema.instanceOf(TestClass),\n other: Schema.Any,\n }).mapFields(Struct.map(Schema.optional));\n\n /** @deprecated Use another test schema or create a specific local test schema. */\n export interface ExampleSchema extends Schema.Schema.Type<typeof ExampleSchema> {}\n\n /** @deprecated Use another test schema or create a specific local test schema. */\n export class Example extends Type.makeObject<Example>(DXN.make('com.example.type.example', '0.1.0'))(\n ExampleSchema.pipe(Annotation.UserType.set()),\n ) {}\n\n //\n // Message\n //\n\n // TODO(burdon): Support defaults directly on Type: `make` is erased by `pipe(Type.Obj)`.\n export const MessageStruct = Schema.Struct({\n // TODO(burdon): Support S.Date; Custom Timestamp (with defaults).\n // TODO(burdon): Support defaults (update create and create).\n timestamp: Schema.String.pipe(Schema.withConstructorDefault(Effect.sync(() => new Date().toISOString()))),\n });\n\n export class Message extends Type.makeObject<Message>(DXN.make('com.example.type.message', '0.1.0'))(\n MessageStruct.pipe(Annotation.UserType.set()),\n ) {}\n\n //\n // Organization\n //\n\n export class Organization extends Type.makeObject<Organization>(DXN.make('com.example.type.organization', '0.1.0'))(\n Schema.Struct({\n name: Schema.String,\n properties: Schema.optional(Schema.Record(Schema.String, Schema.String)),\n }).pipe(Annotation.UserType.set()),\n ) {}\n\n //\n // Person\n //\n\n export class Person extends Type.makeObject<Person>(DXN.make('com.example.type.person', '0.1.0'))(\n Schema.Struct({\n name: Schema.String,\n username: Schema.String,\n email: Schema.String,\n age: Schema.Number.pipe(Schema.optional),\n tasks: Schema.Array(Schema.suspend((): Ref.RefSchema<Task> => Ref.Ref(Task))),\n employer: Schema.optional(Ref.Ref(Organization)),\n address: Schema.Struct({\n city: Schema.optional(Schema.String),\n state: Schema.optional(Schema.String),\n zip: Schema.optional(Schema.String),\n coordinates: Schema.Struct({\n lat: Schema.optional(Schema.Number),\n lng: Schema.optional(Schema.Number),\n }),\n }),\n fields: Schema.Struct({\n label: Schema.String,\n value: Schema.String,\n }).pipe(Schema.Array, Schema.optional),\n })\n .mapFields(Struct.map(Schema.optional))\n .pipe(Annotation.UserType.set()),\n ) {}\n\n //\n // Task\n //\n\n export class Task extends Type.makeObject<Task>(DXN.make('com.example.type.task', '0.1.0'))(\n Schema.Struct({\n title: Schema.optional(Schema.String),\n deadline: Schema.optional(Schema.String),\n completed: Schema.optional(Schema.Boolean),\n assignee: Schema.optional(Ref.Ref(Person)),\n previous: Schema.optional(Schema.suspend((): Ref.RefSchema<Task> => Ref.Ref(Task))),\n subTasks: Schema.optional(Schema.Array(Schema.suspend((): Ref.RefSchema<Task> => Ref.Ref(Task)))),\n description: Schema.optional(Schema.String),\n })\n .mapFields(Struct.map(Schema.optional))\n .pipe(Annotation.UserType.set()),\n ) {}\n\n //\n // HasManager\n //\n\n export class HasManager extends Type.makeRelation<HasManager>(DXN.make('com.example.type.hasManager', '0.1.0'))({\n source: Person,\n target: Person,\n })(Schema.Struct({})) {}\n\n //\n // EmployedBy\n //\n\n export class EmployedBy extends Type.makeRelation<EmployedBy>(DXN.make('com.example.type.employedBy', '0.1.0'))({\n source: Person,\n target: Organization,\n })(\n Schema.Struct({\n role: Schema.String,\n since: Schema.optional(Schema.String),\n }),\n ) {}\n\n //\n // RecordType\n //\n\n export enum RecordType {\n UNDEFINED = 0,\n PERSONAL = 1,\n WORK = 2,\n }\n\n export class Container extends Type.makeObject<Container>(DXN.make('com.example.type.container', '0.1.0'))(\n Schema.Struct({\n objects: Schema.Array(Ref.Ref(Obj.Unknown)),\n records: Schema.Array(\n Schema.Struct({\n title: Schema.String,\n description: Schema.String,\n contacts: Schema.Array(Ref.Ref(Person)),\n type: Schema.Enum(RecordType),\n }).mapFields(Struct.map(Schema.optional)),\n ),\n })\n .mapFields(Struct.map(Schema.optional))\n .pipe(Annotation.UserType.set()),\n ) {}\n}\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport { DatabaseDirectory, EntityStructure } from '@dxos/echo-protocol';\nimport { EID, EntityId, SpaceId } from '@dxos/keys';\n\nimport { Type } from '../index.ts';\nimport { TestSchema } from './test-schema.ts';\n\n// Lazy init: Cloudflare workers disallow non-determinism at module scope (e.g. random keys).\nlet cachedSpaceId: SpaceId | undefined;\nconst getSpaceId = (): SpaceId => {\n if (cachedSpaceId === undefined) {\n cachedSpaceId = SpaceId.random();\n }\n return cachedSpaceId;\n};\n\nlet cachedPeopleAlice: DatabaseDirectory | undefined;\nlet cachedPeopleBob: DatabaseDirectory | undefined;\nlet cachedOrgsDxos: DatabaseDirectory | undefined;\nlet cachedOrgsCyberdyne: DatabaseDirectory | undefined;\nlet cachedWorksFredCyberdyne: DatabaseDirectory | undefined;\nlet cachedWorksAliceAperture: DatabaseDirectory | undefined;\nlet cachedTasksTask1: DatabaseDirectory | undefined;\nlet cachedTasksTask2: DatabaseDirectory | undefined;\n\n// TODO(burdon): Use Obj.make.\n\nexport const PEOPLE = {\n get alice(): DatabaseDirectory {\n if (cachedPeopleAlice === undefined) {\n cachedPeopleAlice = DatabaseDirectory.make({\n spaceId: getSpaceId(),\n objects: {\n [EntityId.random()]: EntityStructure.makeObject({\n type: Type.getURI(TestSchema.Person)!,\n data: {\n name: 'Alice',\n },\n }),\n },\n });\n }\n return cachedPeopleAlice;\n },\n\n get bob(): DatabaseDirectory {\n if (cachedPeopleBob === undefined) {\n cachedPeopleBob = DatabaseDirectory.make({\n spaceId: getSpaceId(),\n objects: {\n [EntityId.random()]: EntityStructure.makeObject({\n type: Type.getURI(TestSchema.Person)!,\n data: {\n name: 'Bob',\n },\n }),\n },\n });\n }\n return cachedPeopleBob;\n },\n};\n\nexport const ORGS = {\n get dxos(): DatabaseDirectory {\n if (cachedOrgsDxos === undefined) {\n cachedOrgsDxos = DatabaseDirectory.make({\n spaceId: getSpaceId(),\n objects: {\n [EntityId.random()]: EntityStructure.makeObject({\n type: Type.getURI(TestSchema.Organization)!,\n data: {\n name: 'DXOS',\n founded: '2023',\n },\n }),\n },\n });\n }\n return cachedOrgsDxos;\n },\n\n get cyberdyne(): DatabaseDirectory {\n if (cachedOrgsCyberdyne === undefined) {\n cachedOrgsCyberdyne = DatabaseDirectory.make({\n spaceId: getSpaceId(),\n objects: {\n [EntityId.random()]: EntityStructure.makeObject({\n type: Type.getURI(TestSchema.Organization)!,\n data: {\n name: 'Cyberdyne Systems',\n founded: '1984',\n },\n }),\n },\n });\n }\n return cachedOrgsCyberdyne;\n },\n};\n\nexport const WORKS_FOR = {\n get fredWorksForCyberdyne(): DatabaseDirectory {\n if (cachedWorksFredCyberdyne === undefined) {\n cachedWorksFredCyberdyne = DatabaseDirectory.make({\n spaceId: getSpaceId(),\n objects: {\n [EntityId.random()]: EntityStructure.makeRelation({\n type: Type.getURI(TestSchema.EmployedBy)!,\n source: { '/': EID.make({ entityId: Object.keys(PEOPLE.bob.objects!)[0] }) },\n target: { '/': EID.make({ entityId: Object.keys(ORGS.cyberdyne.objects!)[0] }) },\n data: {\n since: '2020',\n position: 'Engineer',\n },\n }),\n },\n });\n }\n return cachedWorksFredCyberdyne;\n },\n\n get aliceWorksForAperture(): DatabaseDirectory {\n if (cachedWorksAliceAperture === undefined) {\n cachedWorksAliceAperture = DatabaseDirectory.make({\n spaceId: getSpaceId(),\n objects: {\n [EntityId.random()]: EntityStructure.makeRelation({\n type: Type.getURI(TestSchema.EmployedBy)!,\n source: { '/': EID.make({ entityId: Object.keys(PEOPLE.alice.objects!)[0] }) },\n target: { '/': EID.make({ entityId: Object.keys(ORGS.dxos.objects!)[0] }) },\n data: {\n since: '2018',\n position: 'Research Scientist',\n },\n }),\n },\n });\n }\n return cachedWorksAliceAperture;\n },\n};\n\nexport const TASKS = {\n get task1(): DatabaseDirectory {\n if (cachedTasksTask1 === undefined) {\n cachedTasksTask1 = DatabaseDirectory.make({\n spaceId: getSpaceId(),\n objects: {\n [EntityId.random()]: EntityStructure.makeObject({\n type: Type.getURI(TestSchema.Task)!,\n data: {\n title: 'Complete project documentation',\n description: 'Write comprehensive documentation for the new system',\n status: 'in-progress',\n dueDate: '2023-12-31',\n assignee: { '/': EID.make({ entityId: Object.keys(PEOPLE.bob.objects!)[0] }) },\n },\n }),\n },\n });\n }\n return cachedTasksTask1;\n },\n\n get task2(): DatabaseDirectory {\n if (cachedTasksTask2 === undefined) {\n cachedTasksTask2 = DatabaseDirectory.make({\n spaceId: getSpaceId(),\n objects: {\n [EntityId.random()]: EntityStructure.makeObject({\n type: Type.getURI(TestSchema.Task)!,\n data: {\n title: 'Run experiments',\n description: 'Conduct series of experiments on the portal device',\n status: 'pending',\n dueDate: '2023-11-15',\n assignee: { '/': EID.make({ entityId: Object.keys(PEOPLE.alice.objects!)[0] }) },\n },\n }),\n },\n });\n }\n return cachedTasksTask2;\n },\n};\n","//\n// Copyright 2024 DXOS.org\n//\n\nimport type * as Schema from 'effect/Schema';\n\nimport * as SchemaAST from '@dxos/effect/SchemaAST';\nimport { assertArgument } from '@dxos/invariant';\nimport { deepMapValues } from '@dxos/util';\n\nimport {\n TypeSchema,\n getSchemaTypename,\n getStaticTypeSchema,\n makeObject,\n subscribe,\n toJsonSchema,\n} from '../internal/index.ts';\nimport type * as Type from '../Type.ts';\n\n/**\n * Create an in-memory `Type.Type` entity (a `TypeSchema` object) for tests.\n * Accepts a raw Effect Schema. Pass `Type.getSchema(entity)` to convert a\n * `Type.Type` entity to its underlying source schema first.\n */\n// TODO(dmaretskyi): Should be replaced by registration of typed object.\nexport const createEchoSchema = (schema: Schema.Schema<any>, version = '0.1.0'): Type.Type => {\n const jsonSchema = toJsonSchema(schema);\n const typename = getSchemaTypename(schema);\n assertArgument(typename, 'typename', 'Schema does not have a typename.');\n // typename/version are routed via EntityMeta (the canonical registry-provenance\n // pair); they're no longer data fields on `TypeSchema`.\n return makeObject(\n getStaticTypeSchema(TypeSchema) as any,\n { jsonSchema },\n { keys: [], key: typename, version },\n TypeSchema,\n ) as unknown as Type.Type;\n};\n\n/**\n * Drops the `| undefined` member Effect 4's `Schema.optional` adds to a property type.\n *\n * ECHO's wire form states an absent property as the bare type omitted from `required`, so a\n * serialize/deserialize cycle cannot tell `Schema.optional` from `Schema.optionalKey` and always\n * rebuilds the latter. Applied repeatedly because `optional` is not idempotent in v4.\n */\nconst collapseOptionalUnion = (value: any): any => {\n let node = value;\n while (\n node?._tag === 'Union' &&\n node.context?.isOptional &&\n node.types?.length === 2 &&\n node.types[1]?._tag === 'Undefined'\n ) {\n node = { ...node.types[0], context: node.context };\n }\n return node;\n};\n\n/**\n * Clears the optionality Effect 4 also records on the last link of an encoding chain.\n *\n * Whether the flag lands there depends on which spelling declared the property, and ECHO's wire form\n * carries optionality once, in `required` -- so it is compared on the node and ignored below it.\n */\nconst stripEncodingContext = (value: any): any =>\n Array.isArray(value?.encoding)\n ? {\n ...value,\n encoding: value.encoding.map((link: any) => ({ ...link, to: { ...link.to, context: undefined } })),\n }\n : value;\n\n/**\n * Converts AST to a format that can be compared with test matchers.\n */\nexport const prepareAstForCompare = (obj: SchemaAST.AST): any =>\n deepMapValues(obj, (value: any, recurse: any) => {\n if (typeof value === 'function') {\n return null;\n }\n\n if (value instanceof RegExp) {\n return value;\n }\n\n // Convert symbols to strings.\n if (typeof value === 'object') {\n const clone = { ...stripEncodingContext(collapseOptionalUnion(value)) };\n for (const sym of Object.getOwnPropertySymbols(clone as any)) {\n clone[sym.toString()] = clone[sym];\n delete clone[sym];\n }\n\n return recurse(clone);\n }\n\n return recurse(value);\n });\n\n/**\n * Creates an update counter that tracks changes to reactive objects.\n * @param objects - Reactive objects to subscribe to.\n * @returns An object with a count property and Symbol.dispose for cleanup.\n */\nexport const updateCounter = (...objects: object[]) => {\n let updateCount = 0;\n\n const unsubscribes = objects.map((obj) =>\n subscribe(obj, () => {\n updateCount++;\n }),\n );\n\n const unsubscribeAll = () => {\n for (const unsub of unsubscribes) {\n unsub();\n }\n };\n\n return {\n // https://github.com/tc39/proposal-explicit-resource-management\n [Symbol.dispose]: unsubscribeAll,\n get count() {\n return updateCount;\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,IAAa,oBAAmD,MAAM,QAAQA,SAAkB;EAC7FC,SAAkBA;CACnB,IAAI;CACJ,SAAS,IAAI,MAAY;CACzB,OAAO,CAAC;CACR,WAAW,CAAC;CACZ,cAAc;CACd,aAAa,CAAC;CACd,WAAW,KAAA;CACX,gBAAgB,KAAA;CAChB,YAAY,CAAC;CAGb,SAAS,oBAA6B;EACpC,SAAS,CAAC;EACV,SAAS,CAAC;EACV,KAAK,YAAY,CAAC;EA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B,MAAM;CAEV;CAEA,OAAO;GAEJ,OAAO,UAAU;EAClB,IAAI,QAAQ;GACV,OAAO;EACT;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"testing.mjs","names":["Registry.Service","Registry.TypeId","Type.makeObject","Ref.Ref","Type.makeRelation","Obj.Unknown","Type.getURI"],"sources":["../../src/testing/registry.ts","../../src/testing/test-schema.ts","../../src/testing/test-data.ts","../../src/testing/util.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Layer from 'effect/Layer';\nimport * as Atom from 'effect/reactivity/Atom';\n\nimport { Event } from '@dxos/async';\n\nimport * as Registry from '../Registry.ts';\n\n/**\n * Noop `Registry.Service` layer for testing — always returns empty query results.\n * Use this in test layer stacks that require `Registry.Service` but don't need\n * actual registry contents.\n */\nexport const registryLayerNoop: Layer.Layer<Registry.Service> = Layer.succeed(Registry.Service, {\n [Registry.TypeId]: Registry.TypeId,\n id: 'noop-registry',\n changed: new Event<void>(),\n local: [],\n add: () => {},\n remove: () => false,\n clear: () => {},\n get: () => undefined,\n getByURI: () => undefined,\n list: () => [],\n // QueryFn is an overloaded interface — a single generic function cannot satisfy both overload\n // signatures without a cast. This is the intentional type-system boundary.\n query: ((_queryOrFilter: unknown) => ({\n results: [],\n entries: [],\n run: async () => [],\n runEntries: async () => [],\n runSync: () => [],\n runSyncEntries: () => [],\n first: async (): Promise<never> => {\n throw new Error('registryLayerNoop: registry is empty');\n },\n firstOrUndefined: async () => undefined,\n subscribe: () => () => {},\n atom: Atom.make((): never[] => []),\n completeness: 'complete' as const,\n sources: [],\n })) as Registry.Registry['query'],\n} satisfies Registry.Registry);\n","//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\nimport * as Struct from 'effect/Struct';\n\nimport { DXN } from '@dxos/keys';\n\nimport * as Annotation from '../Annotation.ts';\nimport * as Obj from '../Obj.ts';\nimport * as Ref from '../Ref.ts';\nimport * as Type from '../Type.ts';\n\nexport namespace TestSchema {\n //\n // Expando\n //\n\n /**\n * Expando object is an object with an arbitrary set of properties.\n * This is the test variant with example.com namespace.\n */\n export class Expando extends Type.makeObject<Expando>(DXN.make('com.example.type.expando', '0.1.0'))(\n Schema.StructWithRest(Schema.Struct({}), [Schema.Record(Schema.String, Schema.Any)]).pipe(\n Annotation.UserType.set(),\n ),\n ) {}\n\n //\n // Example\n //\n\n const Nested = Schema.Struct({\n field: Schema.String,\n });\n\n export class TestClass {\n field = 'value';\n toJSON() {\n return { field: this.field };\n }\n }\n\n /** @deprecated Use another test schema or create a specific local test schema. */\n export const ExampleSchema = Schema.Struct({\n string: Schema.String,\n number: Schema.Number,\n boolean: Schema.Boolean,\n null: Schema.Null,\n undefined: Schema.Undefined,\n stringArray: Schema.Array(Schema.String),\n twoDimNumberArray: Schema.Array(Schema.Array(Schema.Number)),\n nested: Nested,\n nestedArray: Schema.Array(Nested),\n nestedNullableArray: Schema.Array(Schema.Union([Nested, Schema.Null])),\n reference: Schema.suspend((): Ref.RefSchema<Example> => Ref.Ref(Example)),\n referenceArray: Schema.Array(Schema.suspend((): Ref.RefSchema<Example> => Ref.Ref(Example))),\n classInstance: Schema.instanceOf(TestClass),\n other: Schema.Any,\n }).mapFields(Struct.map(Schema.optional));\n\n /** @deprecated Use another test schema or create a specific local test schema. */\n export interface ExampleSchema extends Schema.Schema.Type<typeof ExampleSchema> {}\n\n /** @deprecated Use another test schema or create a specific local test schema. */\n export class Example extends Type.makeObject<Example>(DXN.make('com.example.type.example', '0.1.0'))(\n ExampleSchema.pipe(Annotation.UserType.set()),\n ) {}\n\n //\n // Message\n //\n\n // TODO(burdon): Support defaults directly on Type: `make` is erased by `pipe(Type.Obj)`.\n export const MessageStruct = Schema.Struct({\n // TODO(burdon): Support S.Date; Custom Timestamp (with defaults).\n // TODO(burdon): Support defaults (update create and create).\n timestamp: Schema.String.pipe(Schema.withConstructorDefault(Effect.sync(() => new Date().toISOString()))),\n });\n\n export class Message extends Type.makeObject<Message>(DXN.make('com.example.type.message', '0.1.0'))(\n MessageStruct.pipe(Annotation.UserType.set()),\n ) {}\n\n //\n // Organization\n //\n\n export class Organization extends Type.makeObject<Organization>(DXN.make('com.example.type.organization', '0.1.0'))(\n Schema.Struct({\n name: Schema.String,\n properties: Schema.optional(Schema.Record(Schema.String, Schema.String)),\n }).pipe(Annotation.UserType.set()),\n ) {}\n\n //\n // Person\n //\n\n export class Person extends Type.makeObject<Person>(DXN.make('com.example.type.person', '0.1.0'))(\n Schema.Struct({\n name: Schema.String,\n username: Schema.String,\n email: Schema.String,\n age: Schema.Number.pipe(Schema.optional),\n tasks: Schema.Array(Schema.suspend((): Ref.RefSchema<Task> => Ref.Ref(Task))),\n employer: Schema.optional(Ref.Ref(Organization)),\n address: Schema.Struct({\n city: Schema.optional(Schema.String),\n state: Schema.optional(Schema.String),\n zip: Schema.optional(Schema.String),\n coordinates: Schema.Struct({\n lat: Schema.optional(Schema.Number),\n lng: Schema.optional(Schema.Number),\n }),\n }),\n fields: Schema.Struct({\n label: Schema.String,\n value: Schema.String,\n }).pipe(Schema.Array, Schema.optional),\n })\n .mapFields(Struct.map(Schema.optional))\n .pipe(Annotation.UserType.set()),\n ) {}\n\n //\n // Task\n //\n\n export class Task extends Type.makeObject<Task>(DXN.make('com.example.type.task', '0.1.0'))(\n Schema.Struct({\n title: Schema.optional(Schema.String),\n deadline: Schema.optional(Schema.String),\n completed: Schema.optional(Schema.Boolean),\n assignee: Schema.optional(Ref.Ref(Person)),\n previous: Schema.optional(Schema.suspend((): Ref.RefSchema<Task> => Ref.Ref(Task))),\n subTasks: Schema.optional(Schema.Array(Schema.suspend((): Ref.RefSchema<Task> => Ref.Ref(Task)))),\n description: Schema.optional(Schema.String),\n })\n .mapFields(Struct.map(Schema.optional))\n .pipe(Annotation.UserType.set()),\n ) {}\n\n //\n // HasManager\n //\n\n export class HasManager extends Type.makeRelation<HasManager>(DXN.make('com.example.type.hasManager', '0.1.0'))({\n source: Person,\n target: Person,\n })(Schema.Struct({})) {}\n\n //\n // EmployedBy\n //\n\n export class EmployedBy extends Type.makeRelation<EmployedBy>(DXN.make('com.example.type.employedBy', '0.1.0'))({\n source: Person,\n target: Organization,\n })(\n Schema.Struct({\n role: Schema.String,\n since: Schema.optional(Schema.String),\n }),\n ) {}\n\n //\n // RecordType\n //\n\n export enum RecordType {\n UNDEFINED = 0,\n PERSONAL = 1,\n WORK = 2,\n }\n\n export class Container extends Type.makeObject<Container>(DXN.make('com.example.type.container', '0.1.0'))(\n Schema.Struct({\n objects: Schema.Array(Ref.Ref(Obj.Unknown)),\n records: Schema.Array(\n Schema.Struct({\n title: Schema.String,\n description: Schema.String,\n contacts: Schema.Array(Ref.Ref(Person)),\n type: Schema.Enum(RecordType),\n }).mapFields(Struct.map(Schema.optional)),\n ),\n })\n .mapFields(Struct.map(Schema.optional))\n .pipe(Annotation.UserType.set()),\n ) {}\n}\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport { DatabaseDirectory, EntityStructure } from '@dxos/echo-protocol';\nimport { EID, EntityId, SpaceId } from '@dxos/keys';\n\nimport { Type } from '../index.ts';\nimport { TestSchema } from './test-schema.ts';\n\n// Lazy init: Cloudflare workers disallow non-determinism at module scope (e.g. random keys).\nlet cachedSpaceId: SpaceId | undefined;\nconst getSpaceId = (): SpaceId => {\n if (cachedSpaceId === undefined) {\n cachedSpaceId = SpaceId.random();\n }\n return cachedSpaceId;\n};\n\nlet cachedPeopleAlice: DatabaseDirectory | undefined;\nlet cachedPeopleBob: DatabaseDirectory | undefined;\nlet cachedOrgsDxos: DatabaseDirectory | undefined;\nlet cachedOrgsCyberdyne: DatabaseDirectory | undefined;\nlet cachedWorksFredCyberdyne: DatabaseDirectory | undefined;\nlet cachedWorksAliceAperture: DatabaseDirectory | undefined;\nlet cachedTasksTask1: DatabaseDirectory | undefined;\nlet cachedTasksTask2: DatabaseDirectory | undefined;\n\n// TODO(burdon): Use Obj.make.\n\nexport const PEOPLE = {\n get alice(): DatabaseDirectory {\n if (cachedPeopleAlice === undefined) {\n cachedPeopleAlice = DatabaseDirectory.make({\n spaceId: getSpaceId(),\n objects: {\n [EntityId.random()]: EntityStructure.makeObject({\n type: Type.getURI(TestSchema.Person)!,\n data: {\n name: 'Alice',\n },\n }),\n },\n });\n }\n return cachedPeopleAlice;\n },\n\n get bob(): DatabaseDirectory {\n if (cachedPeopleBob === undefined) {\n cachedPeopleBob = DatabaseDirectory.make({\n spaceId: getSpaceId(),\n objects: {\n [EntityId.random()]: EntityStructure.makeObject({\n type: Type.getURI(TestSchema.Person)!,\n data: {\n name: 'Bob',\n },\n }),\n },\n });\n }\n return cachedPeopleBob;\n },\n};\n\nexport const ORGS = {\n get dxos(): DatabaseDirectory {\n if (cachedOrgsDxos === undefined) {\n cachedOrgsDxos = DatabaseDirectory.make({\n spaceId: getSpaceId(),\n objects: {\n [EntityId.random()]: EntityStructure.makeObject({\n type: Type.getURI(TestSchema.Organization)!,\n data: {\n name: 'DXOS',\n founded: '2023',\n },\n }),\n },\n });\n }\n return cachedOrgsDxos;\n },\n\n get cyberdyne(): DatabaseDirectory {\n if (cachedOrgsCyberdyne === undefined) {\n cachedOrgsCyberdyne = DatabaseDirectory.make({\n spaceId: getSpaceId(),\n objects: {\n [EntityId.random()]: EntityStructure.makeObject({\n type: Type.getURI(TestSchema.Organization)!,\n data: {\n name: 'Cyberdyne Systems',\n founded: '1984',\n },\n }),\n },\n });\n }\n return cachedOrgsCyberdyne;\n },\n};\n\nexport const WORKS_FOR = {\n get fredWorksForCyberdyne(): DatabaseDirectory {\n if (cachedWorksFredCyberdyne === undefined) {\n cachedWorksFredCyberdyne = DatabaseDirectory.make({\n spaceId: getSpaceId(),\n objects: {\n [EntityId.random()]: EntityStructure.makeRelation({\n type: Type.getURI(TestSchema.EmployedBy)!,\n source: { '/': EID.make({ entityId: Object.keys(PEOPLE.bob.objects!)[0] }) },\n target: { '/': EID.make({ entityId: Object.keys(ORGS.cyberdyne.objects!)[0] }) },\n data: {\n since: '2020',\n position: 'Engineer',\n },\n }),\n },\n });\n }\n return cachedWorksFredCyberdyne;\n },\n\n get aliceWorksForAperture(): DatabaseDirectory {\n if (cachedWorksAliceAperture === undefined) {\n cachedWorksAliceAperture = DatabaseDirectory.make({\n spaceId: getSpaceId(),\n objects: {\n [EntityId.random()]: EntityStructure.makeRelation({\n type: Type.getURI(TestSchema.EmployedBy)!,\n source: { '/': EID.make({ entityId: Object.keys(PEOPLE.alice.objects!)[0] }) },\n target: { '/': EID.make({ entityId: Object.keys(ORGS.dxos.objects!)[0] }) },\n data: {\n since: '2018',\n position: 'Research Scientist',\n },\n }),\n },\n });\n }\n return cachedWorksAliceAperture;\n },\n};\n\nexport const TASKS = {\n get task1(): DatabaseDirectory {\n if (cachedTasksTask1 === undefined) {\n cachedTasksTask1 = DatabaseDirectory.make({\n spaceId: getSpaceId(),\n objects: {\n [EntityId.random()]: EntityStructure.makeObject({\n type: Type.getURI(TestSchema.Task)!,\n data: {\n title: 'Complete project documentation',\n description: 'Write comprehensive documentation for the new system',\n status: 'in-progress',\n dueDate: '2023-12-31',\n assignee: { '/': EID.make({ entityId: Object.keys(PEOPLE.bob.objects!)[0] }) },\n },\n }),\n },\n });\n }\n return cachedTasksTask1;\n },\n\n get task2(): DatabaseDirectory {\n if (cachedTasksTask2 === undefined) {\n cachedTasksTask2 = DatabaseDirectory.make({\n spaceId: getSpaceId(),\n objects: {\n [EntityId.random()]: EntityStructure.makeObject({\n type: Type.getURI(TestSchema.Task)!,\n data: {\n title: 'Run experiments',\n description: 'Conduct series of experiments on the portal device',\n status: 'pending',\n dueDate: '2023-11-15',\n assignee: { '/': EID.make({ entityId: Object.keys(PEOPLE.alice.objects!)[0] }) },\n },\n }),\n },\n });\n }\n return cachedTasksTask2;\n },\n};\n","//\n// Copyright 2024 DXOS.org\n//\n\nimport type * as Schema from 'effect/Schema';\n\nimport * as SchemaAST from '@dxos/effect/SchemaAST';\nimport { assertArgument } from '@dxos/invariant';\nimport { deepMapValues } from '@dxos/util';\n\nimport {\n TypeSchema,\n getSchemaTypename,\n getStaticTypeSchema,\n makeObject,\n subscribe,\n toJsonSchema,\n} from '../internal/index.ts';\nimport type * as Type from '../Type.ts';\n\n/**\n * Create an in-memory `Type.Type` entity (a `TypeSchema` object) for tests.\n * Accepts a raw Effect Schema. Pass `Type.getSchema(entity)` to convert a\n * `Type.Type` entity to its underlying source schema first.\n */\n// TODO(dmaretskyi): Should be replaced by registration of typed object.\nexport const createEchoSchema = (schema: Schema.Schema<any>, version = '0.1.0'): Type.Type => {\n const jsonSchema = toJsonSchema(schema);\n const typename = getSchemaTypename(schema);\n assertArgument(typename, 'typename', 'Schema does not have a typename.');\n // typename/version are routed via EntityMeta (the canonical registry-provenance\n // pair); they're no longer data fields on `TypeSchema`.\n return makeObject(\n getStaticTypeSchema(TypeSchema) as any,\n { jsonSchema },\n { keys: [], key: typename, version },\n TypeSchema,\n ) as unknown as Type.Type;\n};\n\n/**\n * Drops the `| undefined` member Effect 4's `Schema.optional` adds to a property type.\n *\n * ECHO's wire form states an absent property as the bare type omitted from `required`, so a\n * serialize/deserialize cycle cannot tell `Schema.optional` from `Schema.optionalKey` and always\n * rebuilds the latter. Applied repeatedly because `optional` is not idempotent in v4.\n */\nconst collapseOptionalUnion = (value: any): any => {\n let node = value;\n while (\n node?._tag === 'Union' &&\n node.context?.isOptional &&\n node.types?.length === 2 &&\n node.types[1]?._tag === 'Undefined'\n ) {\n node = { ...node.types[0], context: node.context };\n }\n return node;\n};\n\n/**\n * Clears the optionality Effect 4 also records on the last link of an encoding chain.\n *\n * Whether the flag lands there depends on which spelling declared the property, and ECHO's wire form\n * carries optionality once, in `required` -- so it is compared on the node and ignored below it.\n */\nconst stripEncodingContext = (value: any): any =>\n Array.isArray(value?.encoding)\n ? {\n ...value,\n encoding: value.encoding.map((link: any) => ({ ...link, to: { ...link.to, context: undefined } })),\n }\n : value;\n\n/**\n * Converts AST to a format that can be compared with test matchers.\n */\nexport const prepareAstForCompare = (obj: SchemaAST.AST): any =>\n deepMapValues(obj, (value: any, recurse: any) => {\n if (typeof value === 'function') {\n return null;\n }\n\n if (value instanceof RegExp) {\n return value;\n }\n\n // Convert symbols to strings.\n if (typeof value === 'object') {\n const clone = { ...stripEncodingContext(collapseOptionalUnion(value)) };\n for (const sym of Object.getOwnPropertySymbols(clone as any)) {\n clone[sym.toString()] = clone[sym];\n delete clone[sym];\n }\n\n return recurse(clone);\n }\n\n return recurse(value);\n });\n\n/**\n * Creates an update counter that tracks changes to reactive objects.\n * @param objects - Reactive objects to subscribe to.\n * @returns An object with a count property and Symbol.dispose for cleanup.\n */\nexport const updateCounter = (...objects: object[]) => {\n let updateCount = 0;\n\n const unsubscribes = objects.map((obj) =>\n subscribe(obj, () => {\n updateCount++;\n }),\n );\n\n const unsubscribeAll = () => {\n for (const unsub of unsubscribes) {\n unsub();\n }\n };\n\n return {\n // https://github.com/tc39/proposal-explicit-resource-management\n [Symbol.dispose]: unsubscribeAll,\n get count() {\n return updateCount;\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,IAAa,oBAAmD,MAAM,QAAQA,SAAkB;EAC7FC,SAAkBA;CACnB,IAAI;CACJ,SAAS,IAAI,MAAY;CACzB,OAAO,CAAC;CACR,WAAW,CAAC;CACZ,cAAc;CACd,aAAa,CAAC;CACd,WAAW,KAAA;CACX,gBAAgB,KAAA;CAChB,YAAY,CAAC;CAGb,SAAS,oBAA6B;EACpC,SAAS,CAAC;EACV,SAAS,CAAC;EACV,KAAK,YAAY,CAAC;EAClB,YAAY,YAAY,CAAC;EACzB,eAAe,CAAC;EAChB,sBAAsB,CAAC;EACvB,OAAO,YAA4B;GACjC,MAAM,IAAI,MAAM,sCAAsC;EACxD;EACA,kBAAkB,YAAY,KAAA;EAC9B,uBAAuB,CAAC;EACxB,MAAM,KAAK,WAAoB,CAAC,CAAC;EACjC,cAAc;EACd,SAAS,CAAC;CACZ;AACF,CAA6B;;;AC9BtB,I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IAAI,OAAO;CACX,OACE,MAAM,SAAS,WACf,KAAK,SAAS,cACd,KAAK,OAAO,WAAW,KACvB,KAAK,MAAM,EAAE,EAAE,SAAS,aAExB,OAAO;EAAE,GAAG,KAAK,MAAM;EAAI,SAAS,KAAK;CAAQ;CAEnD,OAAO;AACT;;;;;;;AAQA,IAAM,wBAAwB,UAC5B,MAAM,QAAQ,OAAO,QAAQ,IACzB;CACE,GAAG;CACH,UAAU,MAAM,SAAS,KAAK,UAAe;EAAE,GAAG;EAAM,IAAI;GAAE,GAAG,KAAK;GAAI,SAAS,KAAA;EAAU;CAAE,EAAE;AACnG,IACA;;;;AAKN,IAAa,wBAAwB,QACnC,cAAc,MAAM,OAAY,YAAiB;CAC/C,IAAI,OAAO,UAAU,YACnB,OAAO;CAGT,IAAI,iBAAiB,QACnB,OAAO;CAIT,IAAI,OAAO,UAAU,UAAU;EAC7B,MAAM,QAAQ,EAAE,GAAG,qBAAqB,sBAAsB,KAAK,CAAC,EAAE;EACtE,KAAK,MAAM,OAAO,OAAO,sBAAsB,KAAY,GAAG;GAC5D,MAAM,IAAI,SAAS,KAAK,MAAM;GAC9B,OAAO,MAAM;EACf;EAEA,OAAO,QAAQ,KAAK;CACtB;CAEA,OAAO,QAAQ,KAAK;AACtB,CAAC;;;;;;AAOH,IAAa,iBAAiB,GAAG,YAAsB;CACrD,IAAI,cAAc;CAElB,MAAM,eAAe,QAAQ,KAAK,QAChC,UAAU,WAAW;EACnB;CACF,CAAC,CACH;CAEA,MAAM,uBAAuB;EAC3B,KAAK,MAAM,SAAS,cAClB,MAAM;CAEV;CAEA,OAAO;GAEJ,OAAO,UAAU;EAClB,IAAI,QAAQ;GACV,OAAO;EACT;CACF;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { type ArrayPresentation, ArrayPresentationAnnotation, DEFAULT_LAYOUT_NAME, DescriptionAnnotation, FieldLookupAnnotationId, FormCreateAnnotation, FormCreateAnnotationId, FormInlineAnnotation, FormInputAnnotation, FormLayoutAnnotation, FormLayoutAnnotationId, type FormLayoutMap, FormOrderedAnnotation, GeneratorAnnotation, GeneratorAnnotationId, type GeneratorAnnotationValue, IconAnnotation, IconFromRefAnnotation, LabelAnnotation, ReferenceAnnotation, ReferenceAnnotationId, type ReferenceAnnotationValue, SetParentAnnotation as SetParent, type SetParentAnnotationValue as SetParentValue, TypeAnnotation, UserTypeAnnotation as UserType, type UserTypeAnnotationValue as UserTypeValue, getDescriptionWithSchema, getLabelWithSchema, getTypeAnnotation, getTypeIdentifierAnnotation, setDescriptionWithSchema, setLabelWithSchema, } from './internal/Annotation/index.ts';
|
|
1
|
+
export { type ArrayPresentation, ArrayPresentationAnnotation, ContentVersionAnnotation, type ContentVersionAnnotationValue, DEFAULT_LAYOUT_NAME, DescriptionAnnotation, FieldLookupAnnotationId, FormCreateAnnotation, FormCreateAnnotationId, FormInlineAnnotation, FormInputAnnotation, FormLayoutAnnotation, FormLayoutAnnotationId, type FormLayoutMap, FormOrderedAnnotation, GeneratorAnnotation, GeneratorAnnotationId, type GeneratorAnnotationValue, IconAnnotation, IconFromRefAnnotation, LabelAnnotation, RawStringAnnotation, ReferenceAnnotation, ReferenceAnnotationId, type ReferenceAnnotationValue, SetParentAnnotation as SetParent, type SetParentAnnotationValue as SetParentValue, TypeAnnotation, UserTypeAnnotation as UserType, type UserTypeAnnotationValue as UserTypeValue, getDescriptionWithSchema, getLabelWithSchema, getTypeAnnotation, getTypeIdentifierAnnotation, setDescriptionWithSchema, setLabelWithSchema, } from './internal/Annotation/index.ts';
|
|
2
2
|
import * as Option from 'effect/Option';
|
|
3
3
|
import * as Schema from 'effect/Schema';
|
|
4
4
|
import * as Types from 'effect/Types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Annotation.d.ts","sourceRoot":"","sources":["../../../src/Annotation.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,iBAAiB,EACtB,2BAA2B,EAC3B,mBAAmB,EACnB,qBAAqB,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AU,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;CAMrE,CAAC;AAEH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,EAAE;IAC1B,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACvE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;CAMlF,CAAC;AAEH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,UAAW,CAAC,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,IAAI,KAAG,UAIxF,CAAC"}
|
|
@@ -14,6 +14,7 @@ import type * as Filter from './Filter.ts';
|
|
|
14
14
|
import type * as Hypergraph from './Hypergraph.ts';
|
|
15
15
|
import { type AnyProperties, EntityKind, KindId } from './internal/common/types/index.ts';
|
|
16
16
|
import type { LoadOptions, Ref } from './internal/Ref/ref.ts';
|
|
17
|
+
import type * as Migration from './Migration.ts';
|
|
17
18
|
import type * as Obj from './Obj.ts';
|
|
18
19
|
import type * as Query from './Query.ts';
|
|
19
20
|
import type * as QueryResult from './QueryResult.ts';
|
|
@@ -35,7 +36,6 @@ export interface Queryable {
|
|
|
35
36
|
export type GetObjectByIdOptions = {
|
|
36
37
|
deleted?: boolean;
|
|
37
38
|
};
|
|
38
|
-
export type ObjectPlacement = 'root-doc' | 'linked-doc';
|
|
39
39
|
/**
|
|
40
40
|
* Whether a write was a person's own action, reported with ECHO's trace events. `system` is everything a person
|
|
41
41
|
* did not directly do: agents, syncs and imports, seeded content, migrations and automation. When no origin is
|
|
@@ -65,22 +65,13 @@ export type WriteOptions = {
|
|
|
65
65
|
origin?: Origin;
|
|
66
66
|
};
|
|
67
67
|
export type AddOptions = {
|
|
68
|
-
/**
|
|
69
|
-
* Where to place the object in the Automerge document tree.
|
|
70
|
-
* Root document is always loaded with the space.
|
|
71
|
-
* Linked documents are loaded lazily.
|
|
72
|
-
* Placing large number of objects in the root document may slow down the initial load.
|
|
73
|
-
*
|
|
74
|
-
* @default 'linked-doc'
|
|
75
|
-
*/
|
|
76
|
-
placeIn?: ObjectPlacement;
|
|
77
68
|
/** See {@link Origin}. */
|
|
78
69
|
origin?: Origin;
|
|
79
70
|
/**
|
|
80
71
|
* Append the object to this feed instead of the automerge-backed space database. The object is
|
|
81
72
|
* returned synchronously (a live feed object) and persisted in the background — confirm the write
|
|
82
73
|
* completed with {@link Database.flush}. Synchronous alternative to the async
|
|
83
|
-
* {@link Database.appendToFeed}
|
|
74
|
+
* {@link Database.appendToFeed}.
|
|
84
75
|
*/
|
|
85
76
|
to?: Feed.Feed;
|
|
86
77
|
};
|
|
@@ -218,6 +209,16 @@ export interface Database extends Queryable {
|
|
|
218
209
|
* @performance Async; O(n) in entities encoded and appended to the feed in one batch.
|
|
219
210
|
*/
|
|
220
211
|
appendToFeed(feed: Feed.Feed, entities: Entity.Unknown[], opts?: WriteOptions): Promise<void>;
|
|
212
|
+
/**
|
|
213
|
+
* Appends `base` as the base block of a new branch of the feed, with the fork point `at` (an item,
|
|
214
|
+
* at the block it was read from, or a block id) as its predecessor. Resolves to the id of the new
|
|
215
|
+
* branch, the block id of the base, once the base is written.
|
|
216
|
+
*
|
|
217
|
+
* @performance Async; one append of one entity.
|
|
218
|
+
*/
|
|
219
|
+
forkFeed(feed: Feed.Feed, base: Entity.Unknown, opts: {
|
|
220
|
+
at: Entity.Unknown | Entity.Snapshot | Feed.BlockId;
|
|
221
|
+
}): Promise<Feed.BranchId>;
|
|
221
222
|
/**
|
|
222
223
|
* Removes entities from a feed.
|
|
223
224
|
*
|
|
@@ -232,6 +233,13 @@ export interface Database extends Queryable {
|
|
|
232
233
|
* that `opts` selects, so it is as slow as that selected backlog.
|
|
233
234
|
*/
|
|
234
235
|
flush(opts?: FlushOptions): Promise<void>;
|
|
236
|
+
/**
|
|
237
|
+
* Starts staging structural changes that commit atomically; see {@link Migration.Transaction}.
|
|
238
|
+
*
|
|
239
|
+
* @throws When the database cannot commit with the chosen {@link Migration.TransactionOptions.root}.
|
|
240
|
+
* @performance Async; loads the transaction code on first use, then O(1).
|
|
241
|
+
*/
|
|
242
|
+
beginMigration(options?: Migration.TransactionOptions): Promise<Migration.Transaction>;
|
|
235
243
|
/**
|
|
236
244
|
* The device-global current branch for an object id (`'main'` by default).
|
|
237
245
|
* @deprecated Prefer `Obj.getBranch(obj)` — it takes the object and reports the branch of that
|
|
@@ -308,11 +316,14 @@ export interface Database extends Queryable {
|
|
|
308
316
|
*/
|
|
309
317
|
branch<T extends Obj.Unknown>(obj: T, name: string): Promise<BranchBinding<T>>;
|
|
310
318
|
/**
|
|
311
|
-
* Removes feed items by ID.
|
|
319
|
+
* Removes feed items by ID. `branches` names the branch of each item by index (`null` for the root),
|
|
320
|
+
* for an item this client holds no live copy of; without it such an item is removed from the root branch.
|
|
312
321
|
*
|
|
313
322
|
* @performance Async; O(n) in ids, deleted in one batch.
|
|
314
323
|
*/
|
|
315
|
-
removeFeedItemsByIds(feed: Feed.Feed, ids: string[]
|
|
324
|
+
removeFeedItemsByIds(feed: Feed.Feed, ids: string[], options?: {
|
|
325
|
+
branches?: ReadonlyArray<string | null>;
|
|
326
|
+
}): Promise<void>;
|
|
316
327
|
/**
|
|
317
328
|
* Syncs a feed with the server.
|
|
318
329
|
*
|
|
@@ -480,6 +491,12 @@ export declare const resolve: {
|
|
|
480
491
|
(ref: URI.URI | Ref<any>): Effect.Effect<Entity.Unknown, never, Service>;
|
|
481
492
|
<S extends Type.AnyEntity>(ref: URI.URI | Ref<any>, schema: S): Effect.Effect<Type.InstanceType<S>, Error.EntityNotFoundError, Service>;
|
|
482
493
|
};
|
|
494
|
+
/**
|
|
495
|
+
* Starts staging structural changes in the current database; see {@link Migration.Transaction}.
|
|
496
|
+
*
|
|
497
|
+
* @performance Async; loads the transaction code on first use, then O(1).
|
|
498
|
+
*/
|
|
499
|
+
export declare const beginMigration: (options?: Migration.TransactionOptions) => Effect.Effect<Migration.Transaction, Error.MigrationError, Service>;
|
|
483
500
|
/**
|
|
484
501
|
* Loads an object reference. A deleted target reads as absent unless `{ deleted: 'include' }` asks
|
|
485
502
|
* for it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Database.d.ts","sourceRoot":"","sources":["../../../src/Database.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,KAAK,MAAM,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,KAAK,UAAU,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,KAAK,aAAa,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAK1F,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KA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EAAgE;IAChE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,4EAA4E;IAC5E,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,0HAA0H;IAC1H,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,8DAA8D;IAC9D,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,+DAA+D;IAC/D,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,0BAA0B;IAC1B,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,0BAA0B;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,aAAc,mBAAmB,KAAG,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,CACV,CAAC;AAE3F;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,aAAc,mBAAmB,KAAG,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,CAOzG,CAAC"}
|
|
@@ -2,7 +2,6 @@ import * as Schema from 'effect/Schema';
|
|
|
2
2
|
import type { ForeignKey } from '@dxos/echo-protocol';
|
|
3
3
|
import type { EntityId, URI } from '@dxos/keys';
|
|
4
4
|
import * as internal from './internal/index.ts';
|
|
5
|
-
import type * as Ref from './Ref.ts';
|
|
6
5
|
import type * as Relation from './Relation.ts';
|
|
7
6
|
import type * as Tag from './Tag.ts';
|
|
8
7
|
import * as Type from './Type.ts';
|
|
@@ -279,16 +278,16 @@ export declare const update: <T extends Unknown>(entity: T, callback: internal.C
|
|
|
279
278
|
* Add a tag to an entity.
|
|
280
279
|
* Must be called within an `Entity.update`, `Obj.update`, or `Relation.update` callback.
|
|
281
280
|
*
|
|
282
|
-
* @performance O(t) in the tag count; dedupes by
|
|
281
|
+
* @performance O(t) in the tag count; dedupes by tag id before appending.
|
|
283
282
|
*/
|
|
284
|
-
export declare const addTag: (entity: Mutable<Unknown>, tag:
|
|
283
|
+
export declare const addTag: (entity: Mutable<Unknown>, tag: Tag.Tag) => void;
|
|
285
284
|
/**
|
|
286
285
|
* Remove a tag from an entity.
|
|
287
286
|
* Must be called within an `Entity.update`, `Obj.update`, or `Relation.update` callback.
|
|
288
287
|
*
|
|
289
288
|
* @performance O(t) in the tag count.
|
|
290
289
|
*/
|
|
291
|
-
export declare const removeTag: (entity: Mutable<Unknown>, tag:
|
|
290
|
+
export declare const removeTag: (entity: Mutable<Unknown>, tag: Tag.Tag) => void;
|
|
292
291
|
/**
|
|
293
292
|
* Create a reactive snapshot atom for an entity (object or relation).
|
|
294
293
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Entity.d.ts","sourceRoot":"","sources":["../../../src/Entity.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAEhD,OAAO,KAAK,KAAK,
|
|
1
|
+
{"version":3,"file":"Entity.d.ts","sourceRoot":"","sources":["../../../src/Entity.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EAAE,UAAU,EAA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