Your music, beautifully tracked. All yours. (coming soon) teal.fm
teal-fm atproto

update play lexicon + typegen

Natalie B 2350756f 3f8f2bdb

Changed files
+95 -59
packages
lexicons
real
fm
teal
alpha
src
types
fm
teal
alpha
+22 -14
packages/lexicons/real/fm/teal/alpha/feed/defs.json
··· 5 5 "defs": { 6 6 "playView": { 7 7 "type": "object", 8 - "required": ["trackName", "artistNames"], 8 + "required": ["trackName", "artists"], 9 9 "properties": { 10 10 "trackName": { 11 11 "type": "string", ··· 26 26 "type": "integer", 27 27 "description": "The length of the track in seconds" 28 28 }, 29 - "artistNames": { 30 - "type": "array", 31 - "items": { 32 - "type": "string", 33 - "minLength": 1, 34 - "maxLength": 256, 35 - "maxGraphemes": 2560 36 - }, 37 - "description": "Array of artist names in order of original appearance." 38 - }, 39 - "artistMbIds": { 29 + "artists": { 40 30 "type": "array", 41 31 "items": { 42 - "type": "string" 32 + "type": "ref", 33 + "ref": "#artist" 43 34 }, 44 - "description": "Array of Musicbrainz artist IDs" 35 + "description": "Array of artists in order of original appearance." 45 36 }, 46 37 "releaseName": { 47 38 "type": "string", ··· 75 66 "type": "string", 76 67 "format": "datetime", 77 68 "description": "The unix timestamp of when the track was played" 69 + } 70 + } 71 + }, 72 + "artist": { 73 + "type": "object", 74 + "required": ["artistName"], 75 + "properties": { 76 + "artistName": { 77 + "type": "string", 78 + "minLength": 1, 79 + "maxLength": 256, 80 + "maxGraphemes": 2560, 81 + "description": "The name of the artist" 82 + }, 83 + "artistMbId": { 84 + "type": "string", 85 + "description": "The Musicbrainz ID of the artist" 78 86 } 79 87 } 80 88 }
+3 -20
packages/lexicons/real/fm/teal/alpha/feed/play.json
··· 8 8 "key": "tid", 9 9 "record": { 10 10 "type": "object", 11 - "required": ["trackName", "artistNames"], 11 + "required": ["trackName"], 12 12 "properties": { 13 13 "trackName": { 14 14 "type": "string", ··· 38 38 "maxLength": 256, 39 39 "maxGraphemes": 2560 40 40 }, 41 - "description": "Array of artist names in order of original appearance." 41 + "description": "Array of artist names in order of original appearance. Prefer using 'artists'." 42 42 }, 43 43 "artistMbIds": { 44 44 "type": "array", 45 45 "items": { 46 46 "type": "string" 47 47 }, 48 - "description": "Array of Musicbrainz artist IDs" 48 + "description": "Array of Musicbrainz artist IDs. Prefer using 'artists'." 49 49 }, 50 50 "artists": { 51 51 "type": "array", ··· 88 88 "format": "datetime", 89 89 "description": "The unix timestamp of when the track was played" 90 90 } 91 - } 92 - } 93 - }, 94 - "artist": { 95 - "type": "object", 96 - "required": ["artistName"], 97 - "properties": { 98 - "artistName": { 99 - "type": "string", 100 - "minLength": 1, 101 - "maxLength": 256, 102 - "maxGraphemes": 2560, 103 - "description": "The name of the artist" 104 - }, 105 - "artistMbId": { 106 - "type": "string", 107 - "description": "The Musicbrainz ID of the artist" 108 91 } 109 92 } 110 93 }
+40 -18
packages/lexicons/src/lexicons.ts
··· 431 431 format: 'datetime', 432 432 description: 'The unix timestamp of when the item was recorded', 433 433 }, 434 + expiry: { 435 + type: 'string', 436 + format: 'datetime', 437 + description: 438 + 'The unix timestamp of the expiry time of the item. If unavailable, default to 10 minutes past the start time.', 439 + }, 434 440 item: { 435 441 type: 'ref', 436 442 ref: 'lex:fm.teal.alpha.feed.defs#playView', ··· 448 454 defs: { 449 455 playView: { 450 456 type: 'object', 451 - required: ['trackName', 'artistNames'], 457 + required: ['trackName', 'artists'], 452 458 properties: { 453 459 trackName: { 454 460 type: 'string', ··· 469 475 type: 'integer', 470 476 description: 'The length of the track in seconds', 471 477 }, 472 - artistNames: { 478 + artists: { 473 479 type: 'array', 474 480 items: { 475 - type: 'string', 476 - minLength: 1, 477 - maxLength: 256, 478 - maxGraphemes: 2560, 481 + type: 'ref', 482 + ref: 'lex:fm.teal.alpha.feed.defs#artist', 479 483 }, 480 - description: 481 - 'Array of artist names in order of original appearance.', 482 - }, 483 - artistMbIds: { 484 - type: 'array', 485 - items: { 486 - type: 'string', 487 - }, 488 - description: 'Array of Musicbrainz artist IDs', 484 + description: 'Array of artists in order of original appearance.', 489 485 }, 490 486 releaseName: { 491 487 type: 'string', ··· 524 520 }, 525 521 }, 526 522 }, 523 + artist: { 524 + type: 'object', 525 + required: ['artistName'], 526 + properties: { 527 + artistName: { 528 + type: 'string', 529 + minLength: 1, 530 + maxLength: 256, 531 + maxGraphemes: 2560, 532 + description: 'The name of the artist', 533 + }, 534 + artistMbId: { 535 + type: 'string', 536 + description: 'The Musicbrainz ID of the artist', 537 + }, 538 + }, 539 + }, 527 540 }, 528 541 }, 529 542 FmTealAlphaFeedGetActorFeed: { ··· 623 636 key: 'tid', 624 637 record: { 625 638 type: 'object', 626 - required: ['trackName', 'artistNames'], 639 + required: ['trackName'], 627 640 properties: { 628 641 trackName: { 629 642 type: 'string', ··· 653 666 maxGraphemes: 2560, 654 667 }, 655 668 description: 656 - 'Array of artist names in order of original appearance.', 669 + "Array of artist names in order of original appearance. Prefer using 'artists'.", 657 670 }, 658 671 artistMbIds: { 659 672 type: 'array', 660 673 items: { 661 674 type: 'string', 662 675 }, 663 - description: 'Array of Musicbrainz artist IDs', 676 + description: 677 + "Array of Musicbrainz artist IDs. Prefer using 'artists'.", 678 + }, 679 + artists: { 680 + type: 'array', 681 + items: { 682 + type: 'ref', 683 + ref: 'lex:fm.teal.alpha.feed.defs#artist', 684 + }, 685 + description: 'Array of artists in order of original appearance.', 664 686 }, 665 687 releaseName: { 666 688 type: 'string',
+2
packages/lexicons/src/types/fm/teal/alpha/actor/status.ts
··· 10 10 export interface Record { 11 11 /** The unix timestamp of when the item was recorded */ 12 12 time: string 13 + /** The unix timestamp of the expiry time of the item. If unavailable, default to 10 minutes past the start time. */ 14 + expiry?: string 13 15 item: FmTealAlphaFeedDefs.PlayView 14 16 [k: string]: unknown 15 17 }
+22 -4
packages/lexicons/src/types/fm/teal/alpha/feed/defs.ts
··· 15 15 recordingMbId?: string 16 16 /** The length of the track in seconds */ 17 17 duration?: number 18 - /** Array of artist names in order of original appearance. */ 19 - artistNames: string[] 20 - /** Array of Musicbrainz artist IDs */ 21 - artistMbIds?: string[] 18 + /** Array of artists in order of original appearance. */ 19 + artists: Artist[] 22 20 /** The name of the release/album */ 23 21 releaseName?: string 24 22 /** The Musicbrainz release ID */ ··· 47 45 export function validatePlayView(v: unknown): ValidationResult { 48 46 return lexicons.validate('fm.teal.alpha.feed.defs#playView', v) 49 47 } 48 + 49 + export interface Artist { 50 + /** The name of the artist */ 51 + artistName: string 52 + /** The Musicbrainz ID of the artist */ 53 + artistMbId?: string 54 + [k: string]: unknown 55 + } 56 + 57 + export function isArtist(v: unknown): v is Artist { 58 + return ( 59 + isObj(v) && 60 + hasProp(v, '$type') && 61 + v.$type === 'fm.teal.alpha.feed.defs#artist' 62 + ) 63 + } 64 + 65 + export function validateArtist(v: unknown): ValidationResult { 66 + return lexicons.validate('fm.teal.alpha.feed.defs#artist', v) 67 + }
+6 -3
packages/lexicons/src/types/fm/teal/alpha/feed/play.ts
··· 5 5 import { lexicons } from '../../../../../lexicons' 6 6 import { isObj, hasProp } from '../../../../../util' 7 7 import { CID } from 'multiformats/cid' 8 + import * as FmTealAlphaFeedDefs from './defs' 8 9 9 10 export interface Record { 10 11 /** The name of the track */ ··· 15 16 recordingMbId?: string 16 17 /** The length of the track in seconds */ 17 18 duration?: number 18 - /** Array of artist names in order of original appearance. */ 19 - artistNames: string[] 20 - /** Array of Musicbrainz artist IDs */ 19 + /** Array of artist names in order of original appearance. Prefer using 'artists'. */ 20 + artistNames?: string[] 21 + /** Array of Musicbrainz artist IDs. Prefer using 'artists'. */ 21 22 artistMbIds?: string[] 23 + /** Array of artists in order of original appearance. */ 24 + artists?: FmTealAlphaFeedDefs.Artist[] 22 25 /** The name of the release/album */ 23 26 releaseName?: string 24 27 /** The Musicbrainz release ID */