@bunizao/contracts 0.28.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/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/routes.d.ts +1 -0
- package/dist/routes.js +2 -0
- package/dist/year.d.ts +169 -0
- package/dist/year.js +0 -0
- package/package.json +6 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -223,6 +223,7 @@ 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";
|
|
226
227
|
var MOOD_ON_THIS_DAY_PATH = "/v2/mood/on-this-day";
|
|
227
228
|
var MOOD_DAYS_PATH = "/v2/mood/days";
|
|
228
229
|
var MOOD_DATE_PATH = "/v2/mood/date";
|
|
@@ -455,6 +456,7 @@ export {
|
|
|
455
456
|
TELEGRAM_OPS_SUBSCRIBER_STATUSES,
|
|
456
457
|
TELEGRAM_OPS_WEBHOOK_PATH,
|
|
457
458
|
TELEGRAM_WEBHOOK_PATH,
|
|
459
|
+
YEAR_REVIEW_PATH,
|
|
458
460
|
acceptsComments,
|
|
459
461
|
avatarClass,
|
|
460
462
|
commentAnchorToken,
|
package/dist/routes.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ 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';
|
|
12
13
|
export declare const MOOD_ON_THIS_DAY_PATH: '/v2/mood/on-this-day';
|
|
13
14
|
export declare const MOOD_DAYS_PATH: '/v2/mood/days';
|
|
14
15
|
export declare const MOOD_DATE_PATH: '/v2/mood/date';
|
package/dist/routes.js
CHANGED
|
@@ -10,6 +10,7 @@ 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";
|
|
13
14
|
var MOOD_ON_THIS_DAY_PATH = "/v2/mood/on-this-day";
|
|
14
15
|
var MOOD_DAYS_PATH = "/v2/mood/days";
|
|
15
16
|
var MOOD_DATE_PATH = "/v2/mood/date";
|
|
@@ -99,5 +100,6 @@ export {
|
|
|
99
100
|
READER_RESEND_PATH,
|
|
100
101
|
READER_VERIFY_PATH,
|
|
101
102
|
TELEGRAM_WEBHOOK_PATH,
|
|
103
|
+
YEAR_REVIEW_PATH,
|
|
102
104
|
deskIconPath
|
|
103
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.
|
|
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": [
|