@atproto/lex 0.0.27 → 0.1.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/CHANGELOG.md +22 -0
- package/bin/lex +4 -5
- package/dist/index.js +15 -19
- package/dist/index.js.map +1 -1
- package/package.json +11 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @atproto/lex
|
|
2
2
|
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#4929](https://github.com/bluesky-social/atproto/pull/4929) [`f01c59f`](https://github.com/bluesky-social/atproto/commit/f01c59f5bd3f75fb8b47a9eecd4858b84033fb7c) Thanks [@devinivy](https://github.com/devinivy)! - **BREAKING:** Drop support for Node.js 18 and 20. Node.js 22 is now the minimum supported version. Docker images now use Node.js 24.
|
|
8
|
+
|
|
9
|
+
- [#4943](https://github.com/bluesky-social/atproto/pull/4943) [`c459153`](https://github.com/bluesky-social/atproto/commit/c459153395a30ce89e050892c8fab7dc98e019b9) Thanks [@devinivy](https://github.com/devinivy)! - **BREAKING:** Convert to pure ESM. All packages now ship `"type": "module"` with ES module output and Node16 module resolution.
|
|
10
|
+
|
|
11
|
+
Node.js 22's `require()` compatibility layer can still load these packages in CommonJS code.
|
|
12
|
+
|
|
13
|
+
- [#4930](https://github.com/bluesky-social/atproto/pull/4930) [`908bece`](https://github.com/bluesky-social/atproto/commit/908bece169258bff5ad121e5eec157d6ded6f705) Thanks [@devinivy](https://github.com/devinivy)! - Build with TypeScript 6.0.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [[`f01c59f`](https://github.com/bluesky-social/atproto/commit/f01c59f5bd3f75fb8b47a9eecd4858b84033fb7c), [`c459153`](https://github.com/bluesky-social/atproto/commit/c459153395a30ce89e050892c8fab7dc98e019b9), [`affb50c`](https://github.com/bluesky-social/atproto/commit/affb50c040b497a12631df99a6310f8e78cab557), [`908bece`](https://github.com/bluesky-social/atproto/commit/908bece169258bff5ad121e5eec157d6ded6f705)]:
|
|
18
|
+
- @atproto/lex-builder@0.1.0
|
|
19
|
+
- @atproto/lex-client@0.1.0
|
|
20
|
+
- @atproto/lex-data@0.1.0
|
|
21
|
+
- @atproto/lex-installer@0.1.0
|
|
22
|
+
- @atproto/lex-json@0.1.0
|
|
23
|
+
- @atproto/lex-schema@0.1.0
|
|
24
|
+
|
|
3
25
|
## 0.0.27
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/bin/lex
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/* eslint-env node */
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
5
4
|
|
|
6
5
|
// This file is referenced by the "bin" field in package.json. Because of that,
|
|
7
6
|
// we need this file to exist on disk even before the project is built, so it is
|
|
8
7
|
// written in plain JS. This allows package managers to properly link the CLI
|
|
9
8
|
// command when the monorepo is being setup (during initial "pnpm install").
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
import yargs from 'yargs'
|
|
11
|
+
import { hideBin } from 'yargs/helpers'
|
|
12
|
+
import { build } from '@atproto/lex-builder'
|
|
13
|
+
import { install } from '@atproto/lex-installer'
|
|
15
14
|
|
|
16
15
|
yargs(hideBin(process.argv))
|
|
17
16
|
.strict()
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* The `@atproto/lex` package provides utilities for working with ATProtocol
|
|
4
3
|
* lexicons, including data types, JSON encoding/decoding, schema validation,
|
|
@@ -6,16 +5,13 @@
|
|
|
6
5
|
*
|
|
7
6
|
* @packageDocumentation
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
|
-
exports.lexToJson = exports.lexStringify = exports.lexParse = exports.jsonToLex = exports.l = exports.xrpcSafe = exports.xrpc = exports.Client = void 0;
|
|
11
|
-
const tslib_1 = require("tslib");
|
|
12
|
-
var lex_client_1 = require("@atproto/lex-client");
|
|
8
|
+
export {
|
|
13
9
|
/**
|
|
14
10
|
* The Client class is the primary interface for interacting with AT Protocol
|
|
15
11
|
* services though an authenticated session. It provides methods for making
|
|
16
12
|
* XRPC requests, handling records, and managing blobs.
|
|
17
13
|
*/
|
|
18
|
-
|
|
14
|
+
Client,
|
|
19
15
|
/**
|
|
20
16
|
* The `xrpc` function is a low-level utility for making XRPC requests towards
|
|
21
17
|
* a specific service. It allows for detailed control over the request,
|
|
@@ -23,7 +19,7 @@ Object.defineProperty(exports, "Client", { enumerable: true, get: function () {
|
|
|
23
19
|
* advanced use cases where the higher-level `Client` methods may not provide
|
|
24
20
|
* enough flexibility.
|
|
25
21
|
*/
|
|
26
|
-
|
|
22
|
+
xrpc,
|
|
27
23
|
/**
|
|
28
24
|
* The `xrpcSafe` function is a wrapper around `xrpc` that provides additional
|
|
29
25
|
* safety checks and error handling. It ensures that the request is properly
|
|
@@ -31,9 +27,9 @@ Object.defineProperty(exports, "xrpc", { enumerable: true, get: function () { re
|
|
|
31
27
|
* is recommended for most use cases, as it provides a safer interface for
|
|
32
28
|
* making XRPC requests.
|
|
33
29
|
*/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
xrpcSafe, } from '@atproto/lex-client';
|
|
31
|
+
export * from '@atproto/lex-client';
|
|
32
|
+
export {
|
|
37
33
|
/**
|
|
38
34
|
* The {@link l} namespace (from `@atproto/lex-schema`) provides an imperative API for building schemas:
|
|
39
35
|
*
|
|
@@ -67,33 +63,33 @@ var lex_schema_1 = require("@atproto/lex-schema");
|
|
|
67
63
|
* - {@link l.procedure | l.procedure()} - Define a Lexicon procedure method
|
|
68
64
|
* - {@link l.subscription | l.subscription()} - Define a Lexicon subscription method
|
|
69
65
|
*/
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
66
|
+
l, } from '@atproto/lex-schema';
|
|
67
|
+
export * from '@atproto/lex-schema';
|
|
68
|
+
export * from '@atproto/lex-data';
|
|
69
|
+
export {
|
|
74
70
|
/**
|
|
75
71
|
* The `jsonToLex` function takes a plain JavaScript object (typically parsed from
|
|
76
72
|
* JSON) and converts it back into a LexValue, reconstructing any complex types as needed. This is useful
|
|
77
73
|
* for processing data received from the network or loaded from JSON storage.
|
|
78
74
|
*/
|
|
79
|
-
|
|
75
|
+
jsonToLex,
|
|
80
76
|
/**
|
|
81
77
|
* The `lexParse` function takes a JSON string and parses it into a LexValue. It
|
|
82
78
|
* performs the necessary conversions to reconstruct complex LexValue types from
|
|
83
79
|
* their JSON representations.
|
|
84
80
|
*/
|
|
85
|
-
|
|
81
|
+
lexParse,
|
|
86
82
|
/**
|
|
87
83
|
* The `lexStringify` function takes a LexValue and serializes it to a JSON string.
|
|
88
84
|
* It handles the conversion of complex LexValue types (like BlobRef and Cid) into
|
|
89
85
|
* a JSON-friendly format.
|
|
90
86
|
*/
|
|
91
|
-
|
|
87
|
+
lexStringify,
|
|
92
88
|
/**
|
|
93
89
|
* The `lexToJson` function converts a LexValue into a plain JavaScript object
|
|
94
90
|
* that can be safely serialized to JSON. This is useful for preparing data to be
|
|
95
91
|
* sent over the network or stored in a JSON format.
|
|
96
92
|
*/
|
|
97
|
-
|
|
98
|
-
|
|
93
|
+
lexToJson, } from '@atproto/lex-json';
|
|
94
|
+
export * from '@atproto/lex-json';
|
|
99
95
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO;AACL;;;;GAIG;AACH,MAAM;AACN;;;;;;GAMG;AACH,IAAI;AACJ;;;;;;GAMG;AACH,QAAQ,GACT,MAAM,qBAAqB,CAAA;AAC5B,cAAc,qBAAqB,CAAA;AAEnC,OAAO;AACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,CAAC,GACF,MAAM,qBAAqB,CAAA;AAC5B,cAAc,qBAAqB,CAAA;AAmBnC,cAAc,mBAAmB,CAAA;AAEjC,OAAO;AACL;;;;GAIG;AACH,SAAS;AACT;;;;GAIG;AACH,QAAQ;AACR;;;;GAIG;AACH,YAAY;AACZ;;;;GAIG;AACH,SAAS,GACV,MAAM,mBAAmB,CAAA;AAC1B,cAAc,mBAAmB,CAAA","sourcesContent":["/**\n * The `@atproto/lex` package provides utilities for working with ATProtocol\n * lexicons, including data types, JSON encoding/decoding, schema validation,\n * and HTTP client functionality.\n *\n * @packageDocumentation\n */\n\nexport {\n /**\n * The Client class is the primary interface for interacting with AT Protocol\n * services though an authenticated session. It provides methods for making\n * XRPC requests, handling records, and managing blobs.\n */\n Client,\n /**\n * The `xrpc` function is a low-level utility for making XRPC requests towards\n * a specific service. It allows for detailed control over the request,\n * including custom parameters, body, and headers. This function is useful for\n * advanced use cases where the higher-level `Client` methods may not provide\n * enough flexibility.\n */\n xrpc,\n /**\n * The `xrpcSafe` function is a wrapper around `xrpc` that provides additional\n * safety checks and error handling. It ensures that the request is properly\n * formed and that any errors are caught and handled gracefully. This function\n * is recommended for most use cases, as it provides a safer interface for\n * making XRPC requests.\n */\n xrpcSafe,\n} from '@atproto/lex-client'\nexport * from '@atproto/lex-client'\n\nexport {\n /**\n * The {@link l} namespace (from `@atproto/lex-schema`) provides an imperative API for building schemas:\n *\n * ### Primitive Types\n * - {@link l.string | l.string()} - String values with optional format/length constraints\n * - {@link l.integer | l.integer()} - Integer values with optional min/max constraints\n * - {@link l.boolean | l.boolean()} - Boolean values\n * - {@link l.bytes | l.bytes()} - Binary data (Uint8Array)\n * - {@link l.cid | l.cid()} - Content Identifier values\n * - {@link l.blob | l.blob()} - Blob references with mime type and size\n *\n * ### Composite Types\n * - {@link l.object | l.object()} - Objects with defined property schemas\n * - {@link l.array | l.array()} - Arrays with element type validation\n * - {@link l.union | l.union()} - Union of multiple possible types\n * - {@link l.ref | l.ref()} - Reference to another schema definition\n * - {@link l.literal | l.literal()} - Literal constant values\n * - {@link l.enum | l.enum()} - Enum of allowed string values\n * - {@link l.typedRef | l.typedRef()} - Reference to a {@link l.typedObject | l.typedObject()}\n * - {@link l.typedUnion | l.typedUnion()} - Discriminated union between multiple {@link l.typedRef | l.typedRef()} or {@link l.typedObject | l.typedObject()} types\n *\n * ### Modifiers\n * - {@link l.optional | l.optional()} - Mark a property as optional\n * - {@link l.nullable | l.nullable()} - Allow null values\n * - {@link l.withDefault | l.withDefault()} - Provide a default value\n *\n * ### Lexicon Definitions\n * - {@link l.typedObject | l.typedObject()} - Define a typed object with a `$type` property\n * - {@link l.record | l.record()} - Define a Lexicon record type\n * - {@link l.query | l.query()} - Define a Lexicon query method\n * - {@link l.procedure | l.procedure()} - Define a Lexicon procedure method\n * - {@link l.subscription | l.subscription()} - Define a Lexicon subscription method\n */\n l,\n} from '@atproto/lex-schema'\nexport * from '@atproto/lex-schema'\n\nexport {\n /**\n * The `LexMap` type represents an object with string keys and `LexValue` values.\n * It is used to represent arbitrary objects in Lexicon schemas, where the\n * properties are not predefined. This type allows for flexible data structures\n * while still ensuring that all values conform to the `LexValue` type.\n */\n type LexMap,\n /**\n * The `LexValue` type represents any valid value that can be used in a\n * Lexicon schema. It is a union of all the primitive and composite types\n * defined in `@atproto/lex-data`, including strings, integers, booleans,\n * bytes, CIDs, blob references, objects, arrays, and maps. This type is used\n * throughout the library to represent data that conforms to Lexicon schemas.\n */\n type LexValue,\n} from '@atproto/lex-data'\nexport * from '@atproto/lex-data'\n\nexport {\n /**\n * The `jsonToLex` function takes a plain JavaScript object (typically parsed from\n * JSON) and converts it back into a LexValue, reconstructing any complex types as needed. This is useful\n * for processing data received from the network or loaded from JSON storage.\n */\n jsonToLex,\n /**\n * The `lexParse` function takes a JSON string and parses it into a LexValue. It\n * performs the necessary conversions to reconstruct complex LexValue types from\n * their JSON representations.\n */\n lexParse,\n /**\n * The `lexStringify` function takes a LexValue and serializes it to a JSON string.\n * It handles the conversion of complex LexValue types (like BlobRef and Cid) into\n * a JSON-friendly format.\n */\n lexStringify,\n /**\n * The `lexToJson` function converts a LexValue into a plain JavaScript object\n * that can be safely serialized to JSON. This is useful for preparing data to be\n * sent over the network or stored in a JSON format.\n */\n lexToJson,\n} from '@atproto/lex-json'\nexport * from '@atproto/lex-json'\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/lex",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"engines": {
|
|
5
|
+
"node": ">=22"
|
|
6
|
+
},
|
|
4
7
|
"license": "MIT",
|
|
5
8
|
"description": "Lexicon tooling for AT",
|
|
6
9
|
"keywords": [
|
|
@@ -24,26 +27,22 @@
|
|
|
24
27
|
"lex": "./bin/lex"
|
|
25
28
|
},
|
|
26
29
|
"sideEffects": false,
|
|
27
|
-
"type": "
|
|
28
|
-
"main": "./dist/index.js",
|
|
29
|
-
"types": "./dist/index.d.ts",
|
|
30
|
+
"type": "module",
|
|
30
31
|
"exports": {
|
|
31
32
|
".": {
|
|
32
33
|
"types": "./dist/index.d.ts",
|
|
33
|
-
"browser": "./dist/index.js",
|
|
34
|
-
"import": "./dist/index.js",
|
|
35
34
|
"default": "./dist/index.js"
|
|
36
35
|
}
|
|
37
36
|
},
|
|
38
37
|
"dependencies": {
|
|
39
38
|
"tslib": "^2.8.1",
|
|
40
39
|
"yargs": "^17.0.0",
|
|
41
|
-
"@atproto/lex-builder": "^0.0
|
|
42
|
-
"@atproto/lex-client": "^0.0
|
|
43
|
-
"@atproto/lex-
|
|
44
|
-
"@atproto/lex-
|
|
45
|
-
"@atproto/lex-installer": "^0.0
|
|
46
|
-
"@atproto/lex-schema": "^0.0
|
|
40
|
+
"@atproto/lex-builder": "^0.1.0",
|
|
41
|
+
"@atproto/lex-client": "^0.1.0",
|
|
42
|
+
"@atproto/lex-json": "^0.1.0",
|
|
43
|
+
"@atproto/lex-data": "^0.1.0",
|
|
44
|
+
"@atproto/lex-installer": "^0.1.0",
|
|
45
|
+
"@atproto/lex-schema": "^0.1.0"
|
|
47
46
|
},
|
|
48
47
|
"devDependencies": {
|
|
49
48
|
"@types/yargs": "^17.0.33",
|