@bunizao/contracts 0.27.0 → 0.29.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/desk.d.ts CHANGED
@@ -71,15 +71,24 @@ export interface DeskNow {
71
71
  weather: DeskWeather | null;
72
72
  /** Null when tokens.ci is unavailable. */
73
73
  tokens: DeskTokens | null;
74
+ /** Pages holding the live socket right now; a page that only polls is not among them. */
75
+ visitors: number;
74
76
  }
75
77
  /** Close code the live socket uses when it is full; poll instead. */
76
78
  export declare const DESK_LIVE_FULL_CLOSE_CODE = 1013;
77
79
  /**
78
80
  * Message the live socket at DESK_LIVE_PATH sends on connect and whenever
79
- * presence or place changes. Weather is not pushed; read it from DESK_PATH.
80
- * The socket answers the text `ping` with `pong`. Fields are only ever added.
81
+ * presence, place or the visitor count changes. Weather is not pushed; read
82
+ * it from DESK_PATH. The socket answers the text `ping` with `pong`. Fields
83
+ * are only ever added.
81
84
  */
82
85
  export interface DeskLive {
83
86
  presence: DeskPresence;
84
87
  place: DeskPlace;
88
+ /**
89
+ * Pages holding this socket open right now, the reader's own among them:
90
+ * only sockets that completed the handshake and still ping. A number only,
91
+ * never who.
92
+ */
93
+ visitors: number;
85
94
  }
package/dist/index.d.ts CHANGED
@@ -10,3 +10,4 @@ export * from './mood';
10
10
  export * from './notify';
11
11
  export * from './routes';
12
12
  export * from './telegram-ops';
13
+ export * from './year';
package/dist/index.js CHANGED
@@ -223,6 +223,10 @@ var MOOD_ARCHIVE_FEED_PATH = "/v2/mood";
223
223
  var MOOD_LIVE_COUNTS_PATH = "/v2/moods/live-counts";
224
224
  var MOOD_ARCHIVE_STATS_PATH = "/v2/mood/stats";
225
225
  var MOOD_SEARCH_PATH = "/v2/mood/search";
226
+ var YEAR_REVIEW_PATH = "/v2/year";
227
+ var MOOD_ON_THIS_DAY_PATH = "/v2/mood/on-this-day";
228
+ var MOOD_DAYS_PATH = "/v2/mood/days";
229
+ var MOOD_DATE_PATH = "/v2/mood/date";
226
230
  var MOOD_IMAGE_PROXY_BASE_PATH = "/v2/images";
227
231
  var MOOD_MEDIA_PROXY_BASE_PATH = "/v2/media";
228
232
  var LISTENING_PATH = "/v2/listening";
@@ -378,11 +382,14 @@ export {
378
382
  MOOD_ARCHIVE_FEED_PATH,
379
383
  MOOD_ARCHIVE_STATS_PATH,
380
384
  MOOD_COMMENT_ORIGINS,
385
+ MOOD_DATE_PATH,
386
+ MOOD_DAYS_PATH,
381
387
  MOOD_IMAGE_PROXY_BASE_PATH,
382
388
  MOOD_LIVE_COUNTS_PATH,
383
389
  MOOD_LIVE_FEED_PATH,
384
390
  MOOD_LIVE_META_PATH,
385
391
  MOOD_MEDIA_PROXY_BASE_PATH,
392
+ MOOD_ON_THIS_DAY_PATH,
386
393
  MOOD_PUBLIC_COMMENTS_PATH,
387
394
  MOOD_PUBLIC_FEED_PATH,
388
395
  MOOD_SEARCH_PATH,
@@ -449,6 +456,7 @@ export {
449
456
  TELEGRAM_OPS_SUBSCRIBER_STATUSES,
450
457
  TELEGRAM_OPS_WEBHOOK_PATH,
451
458
  TELEGRAM_WEBHOOK_PATH,
459
+ YEAR_REVIEW_PATH,
452
460
  acceptsComments,
453
461
  avatarClass,
454
462
  commentAnchorToken,
package/dist/mood.d.ts CHANGED
@@ -264,6 +264,49 @@ export interface MoodSearchResult {
264
264
  export interface MoodSearchResponse {
265
265
  results: MoodSearchResult[];
266
266
  }
267
+ /** One of the owner's own posts on an earlier year's same local day. */
268
+ export interface MoodOnThisDayPost {
269
+ /** The post's feed id: its `/mood/{id}` slug. */
270
+ id: string;
271
+ datetime: string;
272
+ /** Plain text, whitespace collapsed, at most 160 characters. */
273
+ text: string;
274
+ }
275
+ export interface MoodOnThisDayYear {
276
+ year: number;
277
+ /** Posts that day. */
278
+ count: number;
279
+ /** The day's first posts in posting order, at most ten. */
280
+ posts: MoodOnThisDayPost[];
281
+ }
282
+ /** The owner's own posts (no forwards, no caption-less media) on the asked
283
+ month and day of every earlier year, on the asker's clock. */
284
+ export interface MoodOnThisDay {
285
+ /** The asked local day, YYYY-MM-DD. */
286
+ date: string;
287
+ /** Canonical IANA name the day was read in. */
288
+ timeZone: string;
289
+ /** Earlier years with at least one post, newest first. */
290
+ years: MoodOnThisDayYear[];
291
+ }
292
+ /** Local days with at least one visible feed post, for a date picker. */
293
+ export interface MoodDays {
294
+ year: number;
295
+ timeZone: string;
296
+ /** YYYY-MM-DD, ascending. */
297
+ days: string[];
298
+ /** Local day of the archive's oldest post, YYYY-MM-DD; null when empty. */
299
+ first: string | null;
300
+ }
301
+ /** Where the feed starts for a local day: the newest post at or before its
302
+ end, or the oldest post when the day predates the archive. */
303
+ export interface MoodDateAnchor {
304
+ date: string;
305
+ timeZone: string;
306
+ /** Feed id to anchor on; null only when the archive is empty. */
307
+ id: string | null;
308
+ datetime: string | null;
309
+ }
267
310
  export interface MoodFeedQuery {
268
311
  before?: string;
269
312
  after?: string;
package/dist/routes.d.ts CHANGED
@@ -9,6 +9,10 @@ export declare const MOOD_ARCHIVE_FEED_PATH: '/v2/mood';
9
9
  export declare const MOOD_LIVE_COUNTS_PATH: '/v2/moods/live-counts';
10
10
  export declare const MOOD_ARCHIVE_STATS_PATH: '/v2/mood/stats';
11
11
  export declare const MOOD_SEARCH_PATH: '/v2/mood/search';
12
+ export declare const YEAR_REVIEW_PATH: '/v2/year';
13
+ export declare const MOOD_ON_THIS_DAY_PATH: '/v2/mood/on-this-day';
14
+ export declare const MOOD_DAYS_PATH: '/v2/mood/days';
15
+ export declare const MOOD_DATE_PATH: '/v2/mood/date';
12
16
  export declare const MOOD_IMAGE_PROXY_BASE_PATH: '/v2/images';
13
17
  export declare const MOOD_MEDIA_PROXY_BASE_PATH: '/v2/media';
14
18
  export declare const LISTENING_PATH: '/v2/listening';
package/dist/routes.js CHANGED
@@ -10,6 +10,10 @@ var MOOD_ARCHIVE_FEED_PATH = "/v2/mood";
10
10
  var MOOD_LIVE_COUNTS_PATH = "/v2/moods/live-counts";
11
11
  var MOOD_ARCHIVE_STATS_PATH = "/v2/mood/stats";
12
12
  var MOOD_SEARCH_PATH = "/v2/mood/search";
13
+ var YEAR_REVIEW_PATH = "/v2/year";
14
+ var MOOD_ON_THIS_DAY_PATH = "/v2/mood/on-this-day";
15
+ var MOOD_DAYS_PATH = "/v2/mood/days";
16
+ var MOOD_DATE_PATH = "/v2/mood/date";
13
17
  var MOOD_IMAGE_PROXY_BASE_PATH = "/v2/images";
14
18
  var MOOD_MEDIA_PROXY_BASE_PATH = "/v2/media";
15
19
  var LISTENING_PATH = "/v2/listening";
@@ -68,11 +72,14 @@ export {
68
72
  LISTENING_PATH,
69
73
  MOOD_ARCHIVE_FEED_PATH,
70
74
  MOOD_ARCHIVE_STATS_PATH,
75
+ MOOD_DATE_PATH,
76
+ MOOD_DAYS_PATH,
71
77
  MOOD_IMAGE_PROXY_BASE_PATH,
72
78
  MOOD_LIVE_COUNTS_PATH,
73
79
  MOOD_LIVE_FEED_PATH,
74
80
  MOOD_LIVE_META_PATH,
75
81
  MOOD_MEDIA_PROXY_BASE_PATH,
82
+ MOOD_ON_THIS_DAY_PATH,
76
83
  MOOD_PUBLIC_COMMENTS_PATH,
77
84
  MOOD_PUBLIC_FEED_PATH,
78
85
  MOOD_SEARCH_PATH,
@@ -93,5 +100,6 @@ export {
93
100
  READER_RESEND_PATH,
94
101
  READER_VERIFY_PATH,
95
102
  TELEGRAM_WEBHOOK_PATH,
103
+ YEAR_REVIEW_PATH,
96
104
  deskIconPath
97
105
  };
package/dist/year.d.ts ADDED
@@ -0,0 +1,169 @@
1
+ import type { MoodYear } from './mood';
2
+ /** A ranked artist in the year's listening. */
3
+ export interface YearListeningArtist {
4
+ name: string;
5
+ plays: number;
6
+ /** The artist's Last.fm page. */
7
+ url: string;
8
+ }
9
+ /** A ranked track in the year's listening. */
10
+ export interface YearListeningTrack {
11
+ title: string;
12
+ artist: string;
13
+ plays: number;
14
+ /** The track's Last.fm page. */
15
+ url: string;
16
+ }
17
+ /** A ranked album in the year's listening. */
18
+ export interface YearListeningAlbum {
19
+ title: string;
20
+ artist: string;
21
+ plays: number;
22
+ /** The album's Last.fm page. */
23
+ url: string;
24
+ /** Last.fm's square cover, about 300px; null when it has none. */
25
+ image: string | null;
26
+ }
27
+ /** One calendar month of the year's listening. */
28
+ export interface YearListeningMonth {
29
+ /** 1-12. */
30
+ month: number;
31
+ plays: number;
32
+ /** The month's most played track; null when Last.fm would not chart the
33
+ month's own range or nothing was played. */
34
+ track: YearListeningTrack | null;
35
+ }
36
+ /** The owner's Last.fm scrobbles in the calendar year, up to the snapshot. */
37
+ export interface YearListening {
38
+ plays: number;
39
+ /** At most ten, most played first. Empty when Last.fm would not chart the
40
+ year's own range: a list for some other span is never shown as this one. */
41
+ artists: YearListeningArtist[];
42
+ /** At most ten, most played first; empty on the same terms. */
43
+ tracks: YearListeningTrack[];
44
+ /** At most six, most played first; empty on the same terms. */
45
+ albums: YearListeningAlbum[];
46
+ /** Every month the snapshot has reached, January first. */
47
+ months: YearListeningMonth[];
48
+ }
49
+ export interface YearGitHubDay {
50
+ /** YYYY-MM-DD. */
51
+ date: string;
52
+ count: number;
53
+ /** GitHub's own quartile, 0 (none) to 4. */
54
+ level: number;
55
+ }
56
+ /** The year's contributions by kind, as GitHub counts them. */
57
+ export interface YearGitHubKinds {
58
+ commits: number;
59
+ pullRequests: number;
60
+ reviews: number;
61
+ issues: number;
62
+ /** Repositories with at least one of the owner's commits. */
63
+ repositories: number;
64
+ }
65
+ /** A public repository the owner worked in or created during the year. */
66
+ export interface YearGitHubRepository {
67
+ /** owner/name. */
68
+ name: string;
69
+ url: string;
70
+ description: string | null;
71
+ /** The primary language's name; null when GitHub has none. */
72
+ language: string | null;
73
+ stars: number;
74
+ /** The owner's commits to it in the year; 0 for a repository only created. */
75
+ commits: number;
76
+ /** When it was created, ISO 8601. */
77
+ createdAt: string;
78
+ }
79
+ /** The owner's public GitHub contributions in the calendar year. */
80
+ export interface YearGitHub {
81
+ total: number;
82
+ /** Every day of the year up to the snapshot, ascending. */
83
+ days: YearGitHubDay[];
84
+ /** Null when the snapshot was built without a GitHub token: the public
85
+ calendar mirror has no breakdown. */
86
+ kinds: YearGitHubKinds | null;
87
+ /** Public repositories by the owner's commits in the year, at most eight.
88
+ Private ones are never listed. */
89
+ repositories: YearGitHubRepository[];
90
+ /** Public repositories the owner created in the year, oldest first, at
91
+ most eight. */
92
+ created: YearGitHubRepository[];
93
+ }
94
+ /** One of the owner's own moods, as the review quotes it. */
95
+ export interface YearMoodMoment {
96
+ /** The mood's message id: /mood/<id>. */
97
+ id: number;
98
+ /** When it was posted, ISO 8601. */
99
+ at: string;
100
+ /** The opening of its text, plain, at most 160 characters; empty for a
101
+ photo without a caption. */
102
+ text: string;
103
+ /** Reactions when the review was generated. */
104
+ reactions: number;
105
+ comments: number;
106
+ /** Whether it carries a photo, served at /api/v2/images/mood/<id>/0. */
107
+ photo: boolean;
108
+ }
109
+ /** The year's own moods beyond the daily tallies in `mood`. Forwards are
110
+ left out, as there. */
111
+ export interface YearMoments {
112
+ /** Each own mood's minute of the year on the owner's Melbourne wall clock
113
+ (day of the year from 0, times 1440, plus the minute of that day),
114
+ ascending. */
115
+ minutes: number[];
116
+ /** The year's first and last own moods. */
117
+ first: YearMoodMoment | null;
118
+ last: YearMoodMoment | null;
119
+ /** The moods readers answered most (reactions plus comments), at most six,
120
+ most first. Only moods with at least one reaction or comment. */
121
+ loved: YearMoodMoment[];
122
+ /** At most one photo a month, the one readers answered most, January
123
+ first. */
124
+ photos: YearMoodMoment[];
125
+ }
126
+ /** Lifetime blog reads when the snapshot was built, only for a year the
127
+ counter was already running in. Never per post: those stay in the owner's
128
+ portal. */
129
+ export interface YearBlogReads {
130
+ reads: number;
131
+ /** When counting began, ISO 8601; null when the start is not known. */
132
+ since: string | null;
133
+ }
134
+ /** One calendar year across the site, generated when the owner asks for it
135
+ and kept until they ask again. A year generated before it ended on the
136
+ owner's Melbourne clock is the year so far, up to `through`. Each part is
137
+ null when that year has nothing from its source. */
138
+ export interface YearReview {
139
+ year: number;
140
+ /** The last Melbourne day the snapshot covers, YYYY-MM-DD. */
141
+ through: string;
142
+ mood: MoodYear | null;
143
+ /** Null when the year has no own moods. */
144
+ moments: YearMoments | null;
145
+ listening: YearListening | null;
146
+ github: YearGitHub | null;
147
+ blog: YearBlogReads | null;
148
+ generatedAt: string;
149
+ }
150
+ /** `GET /v2/year` without a year: every year that has a review, newest
151
+ first. */
152
+ export interface YearReviewIndex {
153
+ years: {
154
+ year: number;
155
+ generatedAt: string;
156
+ }[];
157
+ }
158
+ /** One year as the owner's generate list shows it. */
159
+ export interface YearReviewState {
160
+ year: number;
161
+ /** When the published review was generated; null when there is none. */
162
+ generatedAt: string | null;
163
+ /** The last attempt, when it failed after the published review (or with
164
+ none published). The published review, if any, stays up. */
165
+ failure: {
166
+ at: string;
167
+ reason: string;
168
+ } | null;
169
+ }
package/dist/year.js ADDED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunizao/contracts",
3
- "version": "0.27.0",
3
+ "version": "0.29.0",
4
4
  "description": "Shared TypeScript contracts for buxx.me services and clients.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -92,6 +92,11 @@
92
92
  "types": "./dist/telegram-ops.d.ts",
93
93
  "import": "./dist/telegram-ops.js",
94
94
  "default": "./dist/telegram-ops.js"
95
+ },
96
+ "./year": {
97
+ "types": "./dist/year.d.ts",
98
+ "import": "./dist/year.js",
99
+ "default": "./dist/year.js"
95
100
  }
96
101
  },
97
102
  "files": [