AppView in a box as a Vite plugin thing hatk.dev

refactor: extract dev.hatk lexicons from cli.ts to JSON files

Move all 14 inlined dev.hatk.* lexicon definitions from cli.ts into
src/lexicons/dev/hatk/*.json. The hatk new command now copies them
with cpSync instead of writing each one inline. Build step copies
lexicons to dist/ alongside templates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+458 -565
+1 -1
packages/hatk/package.json
··· 28 28 "./renderer": "./dist/renderer.js" 29 29 }, 30 30 "scripts": { 31 - "build": "tsc -p tsconfig.build.json && cp -r src/templates dist/templates", 31 + "build": "tsc -p tsconfig.build.json && cp -r src/templates dist/templates && cp -r src/lexicons dist/lexicons", 32 32 "prepublishOnly": "npm run build" 33 33 }, 34 34 "dependencies": {
+4 -564
packages/hatk/src/cli.ts
··· 1 1 #!/usr/bin/env node 2 - import { mkdirSync, writeFileSync, existsSync, unlinkSync, readdirSync, readFileSync } from 'node:fs' 2 + import { mkdirSync, writeFileSync, existsSync, unlinkSync, readdirSync, readFileSync, cpSync } from 'node:fs' 3 3 import { resolve, join, dirname } from 'node:path' 4 4 import { execSync, spawn } from 'node:child_process' 5 5 import { loadLexicons, discoverCollections, buildSchemas } from './database/schema.ts' ··· 292 292 `, 293 293 ) 294 294 295 - // Scaffold core framework lexicons under dev.hatk namespace 295 + // Copy core framework lexicons under dev.hatk namespace 296 296 const coreLexDir = join(dir, 'lexicons', 'dev', 'hatk') 297 297 mkdirSync(coreLexDir, { recursive: true }) 298 - 299 - writeFileSync( 300 - join(coreLexDir, 'describeCollections.json'), 301 - JSON.stringify( 302 - { 303 - lexicon: 1, 304 - id: 'dev.hatk.describeCollections', 305 - defs: { 306 - main: { 307 - type: 'query', 308 - description: 'List indexed collections and their schemas.', 309 - output: { 310 - encoding: 'application/json', 311 - schema: { 312 - type: 'object', 313 - properties: { 314 - collections: { 315 - type: 'array', 316 - items: { 317 - type: 'object', 318 - required: ['collection'], 319 - properties: { 320 - collection: { type: 'string' }, 321 - columns: { 322 - type: 'array', 323 - items: { 324 - type: 'object', 325 - required: ['name', 'originalName', 'type', 'required'], 326 - properties: { 327 - name: { type: 'string' }, 328 - originalName: { type: 'string' }, 329 - type: { type: 'string' }, 330 - required: { type: 'boolean' }, 331 - }, 332 - }, 333 - }, 334 - }, 335 - }, 336 - }, 337 - }, 338 - }, 339 - }, 340 - }, 341 - }, 342 - }, 343 - null, 344 - 2, 345 - ) + '\n', 346 - ) 347 - 348 - writeFileSync( 349 - join(coreLexDir, 'describeFeeds.json'), 350 - JSON.stringify( 351 - { 352 - lexicon: 1, 353 - id: 'dev.hatk.describeFeeds', 354 - defs: { 355 - main: { 356 - type: 'query', 357 - description: 'List available feeds.', 358 - output: { 359 - encoding: 'application/json', 360 - schema: { 361 - type: 'object', 362 - properties: { 363 - feeds: { 364 - type: 'array', 365 - items: { 366 - type: 'object', 367 - required: ['name', 'label'], 368 - properties: { 369 - name: { type: 'string' }, 370 - label: { type: 'string' }, 371 - }, 372 - }, 373 - }, 374 - }, 375 - }, 376 - }, 377 - }, 378 - }, 379 - }, 380 - null, 381 - 2, 382 - ) + '\n', 383 - ) 384 - 385 - writeFileSync( 386 - join(coreLexDir, 'describeLabels.json'), 387 - JSON.stringify( 388 - { 389 - lexicon: 1, 390 - id: 'dev.hatk.describeLabels', 391 - defs: { 392 - main: { 393 - type: 'query', 394 - description: 'List available label definitions.', 395 - output: { 396 - encoding: 'application/json', 397 - schema: { 398 - type: 'object', 399 - properties: { 400 - definitions: { 401 - type: 'array', 402 - items: { 403 - type: 'object', 404 - required: ['identifier', 'severity', 'blurs', 'defaultSetting'], 405 - properties: { 406 - identifier: { type: 'string' }, 407 - severity: { type: 'string' }, 408 - blurs: { type: 'string' }, 409 - defaultSetting: { type: 'string' }, 410 - }, 411 - }, 412 - }, 413 - }, 414 - }, 415 - }, 416 - }, 417 - }, 418 - }, 419 - null, 420 - 2, 421 - ) + '\n', 422 - ) 423 - 424 - writeFileSync( 425 - join(coreLexDir, 'createRecord.json'), 426 - JSON.stringify( 427 - { 428 - lexicon: 1, 429 - id: 'dev.hatk.createRecord', 430 - defs: { 431 - main: { 432 - type: 'procedure', 433 - description: "Create a record via the user's PDS.", 434 - input: { 435 - encoding: 'application/json', 436 - schema: { 437 - type: 'object', 438 - required: ['collection', 'repo', 'record'], 439 - properties: { 440 - collection: { type: 'string' }, 441 - repo: { type: 'string', format: 'did' }, 442 - record: { type: 'unknown' }, 443 - }, 444 - }, 445 - }, 446 - output: { 447 - encoding: 'application/json', 448 - schema: { 449 - type: 'object', 450 - properties: { 451 - uri: { type: 'string', format: 'at-uri' }, 452 - cid: { type: 'string', format: 'cid' }, 453 - commit: { 454 - type: 'object', 455 - properties: { 456 - cid: { type: 'string', format: 'cid' }, 457 - rev: { type: 'string' }, 458 - }, 459 - }, 460 - validationStatus: { type: 'string' }, 461 - }, 462 - }, 463 - }, 464 - }, 465 - }, 466 - }, 467 - null, 468 - 2, 469 - ) + '\n', 470 - ) 471 - 472 - writeFileSync( 473 - join(coreLexDir, 'deleteRecord.json'), 474 - JSON.stringify( 475 - { 476 - lexicon: 1, 477 - id: 'dev.hatk.deleteRecord', 478 - defs: { 479 - main: { 480 - type: 'procedure', 481 - description: "Delete a record via the user's PDS.", 482 - input: { 483 - encoding: 'application/json', 484 - schema: { 485 - type: 'object', 486 - required: ['collection', 'rkey'], 487 - properties: { 488 - collection: { type: 'string' }, 489 - rkey: { type: 'string' }, 490 - }, 491 - }, 492 - }, 493 - output: { encoding: 'application/json', schema: { type: 'object', properties: {} } }, 494 - }, 495 - }, 496 - }, 497 - null, 498 - 2, 499 - ) + '\n', 500 - ) 501 - 502 - writeFileSync( 503 - join(coreLexDir, 'putRecord.json'), 504 - JSON.stringify( 505 - { 506 - lexicon: 1, 507 - id: 'dev.hatk.putRecord', 508 - defs: { 509 - main: { 510 - type: 'procedure', 511 - description: "Create or update a record via the user's PDS.", 512 - input: { 513 - encoding: 'application/json', 514 - schema: { 515 - type: 'object', 516 - required: ['collection', 'rkey', 'record'], 517 - properties: { 518 - collection: { type: 'string' }, 519 - rkey: { type: 'string' }, 520 - record: { type: 'unknown' }, 521 - repo: { type: 'string', format: 'did' }, 522 - }, 523 - }, 524 - }, 525 - output: { 526 - encoding: 'application/json', 527 - schema: { 528 - type: 'object', 529 - properties: { 530 - uri: { type: 'string', format: 'at-uri' }, 531 - cid: { type: 'string', format: 'cid' }, 532 - commit: { 533 - type: 'object', 534 - properties: { 535 - cid: { type: 'string', format: 'cid' }, 536 - rev: { type: 'string' }, 537 - }, 538 - }, 539 - validationStatus: { type: 'string' }, 540 - }, 541 - }, 542 - }, 543 - }, 544 - }, 545 - }, 546 - null, 547 - 2, 548 - ) + '\n', 549 - ) 550 - 551 - writeFileSync( 552 - join(coreLexDir, 'uploadBlob.json'), 553 - JSON.stringify( 554 - { 555 - lexicon: 1, 556 - id: 'dev.hatk.uploadBlob', 557 - defs: { 558 - main: { 559 - type: 'procedure', 560 - description: "Upload a blob via the user's PDS.", 561 - input: { 562 - encoding: '*/*', 563 - }, 564 - output: { 565 - encoding: 'application/json', 566 - schema: { 567 - type: 'object', 568 - required: ['blob'], 569 - properties: { 570 - blob: { type: 'blob' }, 571 - }, 572 - }, 573 - }, 574 - }, 575 - }, 576 - }, 577 - null, 578 - 2, 579 - ) + '\n', 580 - ) 581 - 582 - writeFileSync( 583 - join(coreLexDir, 'getPreferences.json'), 584 - JSON.stringify( 585 - { 586 - lexicon: 1, 587 - id: 'dev.hatk.getPreferences', 588 - defs: { 589 - main: { 590 - type: 'query', 591 - description: 'Get all preferences for the authenticated user.', 592 - output: { 593 - encoding: 'application/json', 594 - schema: { 595 - type: 'object', 596 - properties: { 597 - preferences: { type: 'unknown' }, 598 - }, 599 - }, 600 - }, 601 - }, 602 - }, 603 - }, 604 - null, 605 - 2, 606 - ) + '\n', 607 - ) 608 - 609 - writeFileSync( 610 - join(coreLexDir, 'putPreference.json'), 611 - JSON.stringify( 612 - { 613 - lexicon: 1, 614 - id: 'dev.hatk.putPreference', 615 - defs: { 616 - main: { 617 - type: 'procedure', 618 - description: 'Set a single preference by key.', 619 - input: { 620 - encoding: 'application/json', 621 - schema: { 622 - type: 'object', 623 - required: ['key', 'value'], 624 - properties: { 625 - key: { type: 'string' }, 626 - value: { type: 'unknown' }, 627 - }, 628 - }, 629 - }, 630 - output: { 631 - encoding: 'application/json', 632 - schema: { 633 - type: 'object', 634 - properties: {}, 635 - }, 636 - }, 637 - }, 638 - }, 639 - }, 640 - null, 641 - 2, 642 - ) + '\n', 643 - ) 644 - 645 - writeFileSync( 646 - join(coreLexDir, 'getFeed.json'), 647 - JSON.stringify( 648 - { 649 - lexicon: 1, 650 - id: 'dev.hatk.getFeed', 651 - defs: { 652 - main: { 653 - type: 'query', 654 - description: 'Retrieve a named feed of items.', 655 - parameters: { 656 - type: 'params', 657 - required: ['feed'], 658 - properties: { 659 - feed: { type: 'string', description: 'Feed name' }, 660 - limit: { type: 'integer', minimum: 1, maximum: 100, default: 30 }, 661 - cursor: { type: 'string' }, 662 - }, 663 - }, 664 - output: { 665 - encoding: 'application/json', 666 - schema: { 667 - type: 'object', 668 - required: ['items'], 669 - properties: { 670 - items: { type: 'array', items: { type: 'unknown' } }, 671 - cursor: { type: 'string' }, 672 - }, 673 - }, 674 - }, 675 - }, 676 - }, 677 - }, 678 - null, 679 - 2, 680 - ) + '\n', 681 - ) 682 - 683 - writeFileSync( 684 - join(coreLexDir, 'getRecord.json'), 685 - JSON.stringify( 686 - { 687 - lexicon: 1, 688 - id: 'dev.hatk.getRecord', 689 - defs: { 690 - main: { 691 - type: 'query', 692 - description: 'Fetch a single record by AT URI.', 693 - parameters: { 694 - type: 'params', 695 - required: ['uri'], 696 - properties: { 697 - uri: { type: 'string', format: 'at-uri' }, 698 - }, 699 - }, 700 - output: { 701 - encoding: 'application/json', 702 - schema: { 703 - type: 'object', 704 - properties: { 705 - record: { type: 'unknown' }, 706 - }, 707 - }, 708 - }, 709 - }, 710 - }, 711 - }, 712 - null, 713 - 2, 714 - ) + '\n', 715 - ) 716 - 717 - writeFileSync( 718 - join(coreLexDir, 'getRecords.json'), 719 - JSON.stringify( 720 - { 721 - lexicon: 1, 722 - id: 'dev.hatk.getRecords', 723 - defs: { 724 - main: { 725 - type: 'query', 726 - description: 'List records from a collection with optional filters.', 727 - parameters: { 728 - type: 'params', 729 - required: ['collection'], 730 - properties: { 731 - collection: { type: 'string' }, 732 - limit: { type: 'integer', minimum: 1, maximum: 100, default: 20 }, 733 - cursor: { type: 'string' }, 734 - sort: { type: 'string' }, 735 - order: { type: 'string' }, 736 - }, 737 - }, 738 - output: { 739 - encoding: 'application/json', 740 - schema: { 741 - type: 'object', 742 - required: ['items'], 743 - properties: { 744 - items: { type: 'array', items: { type: 'unknown' } }, 745 - cursor: { type: 'string' }, 746 - }, 747 - }, 748 - }, 749 - }, 750 - }, 751 - }, 752 - null, 753 - 2, 754 - ) + '\n', 755 - ) 756 - 757 - writeFileSync( 758 - join(coreLexDir, 'searchRecords.json'), 759 - JSON.stringify( 760 - { 761 - lexicon: 1, 762 - id: 'dev.hatk.searchRecords', 763 - defs: { 764 - main: { 765 - type: 'query', 766 - description: 'Full-text search across a collection.', 767 - parameters: { 768 - type: 'params', 769 - required: ['collection', 'q'], 770 - properties: { 771 - collection: { type: 'string' }, 772 - q: { type: 'string', description: 'Search query' }, 773 - limit: { type: 'integer', minimum: 1, maximum: 100, default: 20 }, 774 - cursor: { type: 'string' }, 775 - fuzzy: { type: 'boolean', default: true }, 776 - }, 777 - }, 778 - output: { 779 - encoding: 'application/json', 780 - schema: { 781 - type: 'object', 782 - required: ['items'], 783 - properties: { 784 - items: { type: 'array', items: { type: 'unknown' } }, 785 - cursor: { type: 'string' }, 786 - }, 787 - }, 788 - }, 789 - }, 790 - }, 791 - }, 792 - null, 793 - 2, 794 - ) + '\n', 795 - ) 796 - 797 - writeFileSync( 798 - join(coreLexDir, 'createReport.json'), 799 - JSON.stringify( 800 - { 801 - lexicon: 1, 802 - id: 'dev.hatk.createReport', 803 - defs: { 804 - main: { 805 - type: 'procedure', 806 - description: 'Report an account or record for moderation review.', 807 - input: { 808 - encoding: 'application/json', 809 - schema: { 810 - type: 'object', 811 - required: ['subject', 'label'], 812 - properties: { 813 - subject: { 814 - type: 'union', 815 - description: 'The account or record being reported.', 816 - refs: ['#repoRef', '#strongRef'], 817 - }, 818 - label: { type: 'string', description: 'Label identifier for the report reason.' }, 819 - reason: { type: 'string', maxLength: 2000, description: 'Optional free-text explanation.' }, 820 - }, 821 - }, 822 - }, 823 - output: { 824 - encoding: 'application/json', 825 - schema: { 826 - type: 'object', 827 - required: ['id', 'subject', 'label', 'reportedBy', 'createdAt'], 828 - properties: { 829 - id: { type: 'integer' }, 830 - subject: { type: 'unknown' }, 831 - label: { type: 'string' }, 832 - reason: { type: 'string' }, 833 - reportedBy: { type: 'string', format: 'did' }, 834 - createdAt: { type: 'string', format: 'datetime' }, 835 - }, 836 - }, 837 - }, 838 - }, 839 - repoRef: { 840 - type: 'object', 841 - required: ['did'], 842 - properties: { 843 - did: { type: 'string', format: 'did' }, 844 - }, 845 - }, 846 - strongRef: { 847 - type: 'object', 848 - required: ['uri', 'cid'], 849 - properties: { 850 - uri: { type: 'string', format: 'at-uri' }, 851 - cid: { type: 'string', format: 'cid' }, 852 - }, 853 - }, 854 - }, 855 - }, 856 - null, 857 - 2, 858 - ) + '\n', 859 - ) 298 + const builtinLexDir = join(import.meta.dirname!, 'lexicons', 'dev', 'hatk') 299 + cpSync(builtinLexDir, coreLexDir, { recursive: true }) 860 300 861 301 writeFileSync( 862 302 join(dir, 'seeds', 'seed.ts'),
+40
packages/hatk/src/lexicons/dev/hatk/createRecord.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "dev.hatk.createRecord", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Create a record via the user's PDS.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["collection", "repo", "record"], 13 + "properties": { 14 + "collection": { "type": "string" }, 15 + "repo": { "type": "string", "format": "did" }, 16 + "record": { "type": "unknown" } 17 + } 18 + } 19 + }, 20 + "output": { 21 + "encoding": "application/json", 22 + "schema": { 23 + "type": "object", 24 + "properties": { 25 + "uri": { "type": "string", "format": "at-uri" }, 26 + "cid": { "type": "string", "format": "cid" }, 27 + "commit": { 28 + "type": "object", 29 + "properties": { 30 + "cid": { "type": "string", "format": "cid" }, 31 + "rev": { "type": "string" } 32 + } 33 + }, 34 + "validationStatus": { "type": "string" } 35 + } 36 + } 37 + } 38 + } 39 + } 40 + }
+56
packages/hatk/src/lexicons/dev/hatk/createReport.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "dev.hatk.createReport", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Report an account or record for moderation review.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["subject", "label"], 13 + "properties": { 14 + "subject": { 15 + "type": "union", 16 + "description": "The account or record being reported.", 17 + "refs": ["#repoRef", "#strongRef"] 18 + }, 19 + "label": { "type": "string", "description": "Label identifier for the report reason." }, 20 + "reason": { "type": "string", "maxLength": 2000, "description": "Optional free-text explanation." } 21 + } 22 + } 23 + }, 24 + "output": { 25 + "encoding": "application/json", 26 + "schema": { 27 + "type": "object", 28 + "required": ["id", "subject", "label", "reportedBy", "createdAt"], 29 + "properties": { 30 + "id": { "type": "integer" }, 31 + "subject": { "type": "unknown" }, 32 + "label": { "type": "string" }, 33 + "reason": { "type": "string" }, 34 + "reportedBy": { "type": "string", "format": "did" }, 35 + "createdAt": { "type": "string", "format": "datetime" } 36 + } 37 + } 38 + } 39 + }, 40 + "repoRef": { 41 + "type": "object", 42 + "required": ["did"], 43 + "properties": { 44 + "did": { "type": "string", "format": "did" } 45 + } 46 + }, 47 + "strongRef": { 48 + "type": "object", 49 + "required": ["uri", "cid"], 50 + "properties": { 51 + "uri": { "type": "string", "format": "at-uri" }, 52 + "cid": { "type": "string", "format": "cid" } 53 + } 54 + } 55 + } 56 + }
+25
packages/hatk/src/lexicons/dev/hatk/deleteRecord.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "dev.hatk.deleteRecord", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Delete a record via the user's PDS.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["collection", "rkey"], 13 + "properties": { 14 + "collection": { "type": "string" }, 15 + "rkey": { "type": "string" } 16 + } 17 + } 18 + }, 19 + "output": { 20 + "encoding": "application/json", 21 + "schema": { "type": "object", "properties": {} } 22 + } 23 + } 24 + } 25 + }
+41
packages/hatk/src/lexicons/dev/hatk/describeCollections.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "dev.hatk.describeCollections", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "List indexed collections and their schemas.", 8 + "output": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "properties": { 13 + "collections": { 14 + "type": "array", 15 + "items": { 16 + "type": "object", 17 + "required": ["collection"], 18 + "properties": { 19 + "collection": { "type": "string" }, 20 + "columns": { 21 + "type": "array", 22 + "items": { 23 + "type": "object", 24 + "required": ["name", "originalName", "type", "required"], 25 + "properties": { 26 + "name": { "type": "string" }, 27 + "originalName": { "type": "string" }, 28 + "type": { "type": "string" }, 29 + "required": { "type": "boolean" } 30 + } 31 + } 32 + } 33 + } 34 + } 35 + } 36 + } 37 + } 38 + } 39 + } 40 + } 41 + }
+29
packages/hatk/src/lexicons/dev/hatk/describeFeeds.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "dev.hatk.describeFeeds", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "List available feeds.", 8 + "output": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "properties": { 13 + "feeds": { 14 + "type": "array", 15 + "items": { 16 + "type": "object", 17 + "required": ["name", "label"], 18 + "properties": { 19 + "name": { "type": "string" }, 20 + "label": { "type": "string" } 21 + } 22 + } 23 + } 24 + } 25 + } 26 + } 27 + } 28 + } 29 + }
+31
packages/hatk/src/lexicons/dev/hatk/describeLabels.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "dev.hatk.describeLabels", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "List available label definitions.", 8 + "output": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "properties": { 13 + "definitions": { 14 + "type": "array", 15 + "items": { 16 + "type": "object", 17 + "required": ["identifier", "severity", "blurs", "defaultSetting"], 18 + "properties": { 19 + "identifier": { "type": "string" }, 20 + "severity": { "type": "string" }, 21 + "blurs": { "type": "string" }, 22 + "defaultSetting": { "type": "string" } 23 + } 24 + } 25 + } 26 + } 27 + } 28 + } 29 + } 30 + } 31 + }
+30
packages/hatk/src/lexicons/dev/hatk/getFeed.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "dev.hatk.getFeed", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Retrieve a named feed of items.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["feed"], 11 + "properties": { 12 + "feed": { "type": "string", "description": "Feed name" }, 13 + "limit": { "type": "integer", "minimum": 1, "maximum": 100, "default": 30 }, 14 + "cursor": { "type": "string" } 15 + } 16 + }, 17 + "output": { 18 + "encoding": "application/json", 19 + "schema": { 20 + "type": "object", 21 + "required": ["items"], 22 + "properties": { 23 + "items": { "type": "array", "items": { "type": "unknown" } }, 24 + "cursor": { "type": "string" } 25 + } 26 + } 27 + } 28 + } 29 + } 30 + }
+19
packages/hatk/src/lexicons/dev/hatk/getPreferences.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "dev.hatk.getPreferences", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Get all preferences for the authenticated user.", 8 + "output": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "properties": { 13 + "preferences": { "type": "unknown" } 14 + } 15 + } 16 + } 17 + } 18 + } 19 + }
+26
packages/hatk/src/lexicons/dev/hatk/getRecord.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "dev.hatk.getRecord", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Fetch a single record by AT URI.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["uri"], 11 + "properties": { 12 + "uri": { "type": "string", "format": "at-uri" } 13 + } 14 + }, 15 + "output": { 16 + "encoding": "application/json", 17 + "schema": { 18 + "type": "object", 19 + "properties": { 20 + "record": { "type": "unknown" } 21 + } 22 + } 23 + } 24 + } 25 + } 26 + }
+32
packages/hatk/src/lexicons/dev/hatk/getRecords.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "dev.hatk.getRecords", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "List records from a collection with optional filters.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["collection"], 11 + "properties": { 12 + "collection": { "type": "string" }, 13 + "limit": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 }, 14 + "cursor": { "type": "string" }, 15 + "sort": { "type": "string" }, 16 + "order": { "type": "string" } 17 + } 18 + }, 19 + "output": { 20 + "encoding": "application/json", 21 + "schema": { 22 + "type": "object", 23 + "required": ["items"], 24 + "properties": { 25 + "items": { "type": "array", "items": { "type": "unknown" } }, 26 + "cursor": { "type": "string" } 27 + } 28 + } 29 + } 30 + } 31 + } 32 + }
+28
packages/hatk/src/lexicons/dev/hatk/putPreference.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "dev.hatk.putPreference", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Set a single preference by key.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["key", "value"], 13 + "properties": { 14 + "key": { "type": "string" }, 15 + "value": { "type": "unknown" } 16 + } 17 + } 18 + }, 19 + "output": { 20 + "encoding": "application/json", 21 + "schema": { 22 + "type": "object", 23 + "properties": {} 24 + } 25 + } 26 + } 27 + } 28 + }
+41
packages/hatk/src/lexicons/dev/hatk/putRecord.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "dev.hatk.putRecord", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Create or update a record via the user's PDS.", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": ["collection", "rkey", "record"], 13 + "properties": { 14 + "collection": { "type": "string" }, 15 + "rkey": { "type": "string" }, 16 + "record": { "type": "unknown" }, 17 + "repo": { "type": "string", "format": "did" } 18 + } 19 + } 20 + }, 21 + "output": { 22 + "encoding": "application/json", 23 + "schema": { 24 + "type": "object", 25 + "properties": { 26 + "uri": { "type": "string", "format": "at-uri" }, 27 + "cid": { "type": "string", "format": "cid" }, 28 + "commit": { 29 + "type": "object", 30 + "properties": { 31 + "cid": { "type": "string", "format": "cid" }, 32 + "rev": { "type": "string" } 33 + } 34 + }, 35 + "validationStatus": { "type": "string" } 36 + } 37 + } 38 + } 39 + } 40 + } 41 + }
+32
packages/hatk/src/lexicons/dev/hatk/searchRecords.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "dev.hatk.searchRecords", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Full-text search across a collection.", 8 + "parameters": { 9 + "type": "params", 10 + "required": ["collection", "q"], 11 + "properties": { 12 + "collection": { "type": "string" }, 13 + "q": { "type": "string", "description": "Search query" }, 14 + "limit": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 }, 15 + "cursor": { "type": "string" }, 16 + "fuzzy": { "type": "boolean", "default": true } 17 + } 18 + }, 19 + "output": { 20 + "encoding": "application/json", 21 + "schema": { 22 + "type": "object", 23 + "required": ["items"], 24 + "properties": { 25 + "items": { "type": "array", "items": { "type": "unknown" } }, 26 + "cursor": { "type": "string" } 27 + } 28 + } 29 + } 30 + } 31 + } 32 + }
+23
packages/hatk/src/lexicons/dev/hatk/uploadBlob.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "dev.hatk.uploadBlob", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Upload a blob via the user's PDS.", 8 + "input": { 9 + "encoding": "*/*" 10 + }, 11 + "output": { 12 + "encoding": "application/json", 13 + "schema": { 14 + "type": "object", 15 + "required": ["blob"], 16 + "properties": { 17 + "blob": { "type": "blob" } 18 + } 19 + } 20 + } 21 + } 22 + } 23 + }