@distilled.cloud/forgejo 0.0.0 → 1.0.0-rc.9

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.
Files changed (88) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +71 -0
  3. package/lib/credentials.d.ts +35 -0
  4. package/lib/credentials.d.ts.map +1 -0
  5. package/lib/credentials.js +57 -0
  6. package/lib/credentials.js.map +1 -0
  7. package/lib/errors.d.ts +56 -0
  8. package/lib/errors.d.ts.map +1 -0
  9. package/lib/errors.js +36 -0
  10. package/lib/errors.js.map +1 -0
  11. package/lib/index.d.ts +28 -0
  12. package/lib/index.d.ts.map +1 -0
  13. package/lib/index.js +28 -0
  14. package/lib/index.js.map +1 -0
  15. package/lib/protocol.d.ts +18 -0
  16. package/lib/protocol.d.ts.map +1 -0
  17. package/lib/protocol.js +61 -0
  18. package/lib/protocol.js.map +1 -0
  19. package/lib/retry.d.ts +50 -0
  20. package/lib/retry.d.ts.map +1 -0
  21. package/lib/retry.js +43 -0
  22. package/lib/retry.js.map +1 -0
  23. package/lib/services/activitypub.d.ts +121 -0
  24. package/lib/services/activitypub.d.ts.map +1 -0
  25. package/lib/services/activitypub.js +202 -0
  26. package/lib/services/activitypub.js.map +1 -0
  27. package/lib/services/admin.d.ts +1196 -0
  28. package/lib/services/admin.d.ts.map +1 -0
  29. package/lib/services/admin.js +1276 -0
  30. package/lib/services/admin.js.map +1 -0
  31. package/lib/services/index.d.ts +11 -0
  32. package/lib/services/index.d.ts.map +1 -0
  33. package/lib/services/index.js +12 -0
  34. package/lib/services/index.js.map +1 -0
  35. package/lib/services/issue.d.ts +1479 -0
  36. package/lib/services/issue.d.ts.map +1 -0
  37. package/lib/services/issue.js +1732 -0
  38. package/lib/services/issue.js.map +1 -0
  39. package/lib/services/miscellaneous.d.ts +494 -0
  40. package/lib/services/miscellaneous.d.ts.map +1 -0
  41. package/lib/services/miscellaneous.js +471 -0
  42. package/lib/services/miscellaneous.js.map +1 -0
  43. package/lib/services/notification.d.ts +390 -0
  44. package/lib/services/notification.d.ts.map +1 -0
  45. package/lib/services/notification.js +344 -0
  46. package/lib/services/notification.js.map +1 -0
  47. package/lib/services/organization.d.ts +1593 -0
  48. package/lib/services/organization.d.ts.map +1 -0
  49. package/lib/services/organization.js +1672 -0
  50. package/lib/services/organization.js.map +1 -0
  51. package/lib/services/package.d.ts +347 -0
  52. package/lib/services/package.d.ts.map +1 -0
  53. package/lib/services/package.js +320 -0
  54. package/lib/services/package.js.map +1 -0
  55. package/lib/services/repository.d.ts +4770 -0
  56. package/lib/services/repository.d.ts.map +1 -0
  57. package/lib/services/repository.js +5449 -0
  58. package/lib/services/repository.js.map +1 -0
  59. package/lib/services/settings.d.ts +67 -0
  60. package/lib/services/settings.d.ts.map +1 -0
  61. package/lib/services/settings.js +87 -0
  62. package/lib/services/settings.js.map +1 -0
  63. package/lib/services/user.d.ts +1764 -0
  64. package/lib/services/user.d.ts.map +1 -0
  65. package/lib/services/user.js +1921 -0
  66. package/lib/services/user.js.map +1 -0
  67. package/lib/traits.d.ts +10 -0
  68. package/lib/traits.d.ts.map +1 -0
  69. package/lib/traits.js +11 -0
  70. package/lib/traits.js.map +1 -0
  71. package/package.json +78 -6
  72. package/src/credentials.ts +89 -0
  73. package/src/errors.ts +72 -0
  74. package/src/index.ts +31 -0
  75. package/src/protocol.ts +86 -0
  76. package/src/retry.ts +74 -0
  77. package/src/services/activitypub.ts +415 -0
  78. package/src/services/admin.ts +3103 -0
  79. package/src/services/index.ts +11 -0
  80. package/src/services/issue.ts +3949 -0
  81. package/src/services/miscellaneous.ts +1118 -0
  82. package/src/services/notification.ts +847 -0
  83. package/src/services/organization.ts +4008 -0
  84. package/src/services/package.ts +767 -0
  85. package/src/services/repository.ts +12839 -0
  86. package/src/services/settings.ts +190 -0
  87. package/src/services/user.ts +4669 -0
  88. package/src/traits.ts +44 -0
@@ -0,0 +1,847 @@
1
+ // AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-forgejo). Do not edit.
2
+ import * as S from "@distilled.cloud/core/schema";
3
+ import * as API from "@distilled.cloud/core/api";
4
+ import * as C from "@distilled.cloud/core/category";
5
+ import * as T from "../traits.ts";
6
+ import {
7
+ ForgejoProtocol,
8
+ type ForgejoOpError,
9
+ type ForgejoOpContext,
10
+ } from "../protocol.ts";
11
+ import * as Retry from "../retry.ts";
12
+
13
+ export type { ForgejoOpError, ForgejoOpContext };
14
+
15
+ export class Forbidden
16
+ extends /*@__PURE__*/ T.applyErrorMatchers(
17
+ /*@__PURE__*/ S.TaggedError<Forbidden>()("Forbidden", {
18
+ code: S.Number,
19
+ message: S.String,
20
+ }).pipe(C.withAuthError),
21
+ [{ status: 403 }],
22
+ ) {}
23
+
24
+ export class NotFound
25
+ extends /*@__PURE__*/ T.applyErrorMatchers(
26
+ /*@__PURE__*/ S.TaggedError<NotFound>()("NotFound", {
27
+ code: S.Number,
28
+ message: S.String,
29
+ }).pipe(C.withBadRequestError),
30
+ [{ status: 404 }],
31
+ ) {}
32
+
33
+ export type NotifyGetListRequestStatusTypesList = Array<string>;
34
+ export const NotifyGetListRequestStatusTypesList = /*@__PURE__*/ S.Array(
35
+ S.String,
36
+ ) as any as S.Schema<NotifyGetListRequestStatusTypesList>;
37
+
38
+ export type NotifyGetListRequestSubjectTypeItem =
39
+ | "issue"
40
+ | "pull"
41
+ | "repository";
42
+ export const NotifyGetListRequestSubjectTypeItem = /*@__PURE__*/ S.String;
43
+
44
+ export type NotifyGetListRequestSubjectTypeList = Array<
45
+ NotifyGetListRequestSubjectTypeItem | (string & {})
46
+ >;
47
+ export const NotifyGetListRequestSubjectTypeList = /*@__PURE__*/ S.Array(
48
+ NotifyGetListRequestSubjectTypeItem,
49
+ ) as any as S.Schema<NotifyGetListRequestSubjectTypeList>;
50
+
51
+ export interface NotifyGetListRequest {
52
+ /** If true, show notifications marked as read. Default value is false */
53
+ all?: boolean;
54
+ /** Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned. */
55
+ status_types?: NotifyGetListRequestStatusTypesList;
56
+ /** filter notifications by subject type */
57
+ subject_type?: NotifyGetListRequestSubjectTypeList;
58
+ /** Only show notifications updated after the given time. This is a timestamp in RFC 3339 format */
59
+ since?: string;
60
+ /** Only show notifications updated before the given time. This is a timestamp in RFC 3339 format */
61
+ before?: string;
62
+ /** page number of results to return (1-based) */
63
+ page?: number;
64
+ /** page size of results */
65
+ limit?: number;
66
+ }
67
+ export const NotifyGetListRequest = /*@__PURE__*/ S.suspend(() =>
68
+ S.Struct({
69
+ all: S.optional(S.Boolean.pipe(T.Query())),
70
+ status_types: S.optional(
71
+ NotifyGetListRequestStatusTypesList.pipe(T.Query("status-types")),
72
+ ),
73
+ subject_type: S.optional(
74
+ NotifyGetListRequestSubjectTypeList.pipe(T.Query("subject-type")),
75
+ ),
76
+ since: S.optional(S.String.pipe(T.Query())),
77
+ before: S.optional(S.String.pipe(T.Query())),
78
+ page: S.optional(S.Number.pipe(T.Query())),
79
+ limit: S.optional(S.Number.pipe(T.Query())),
80
+ }).pipe(T.Http({ method: "GET", uri: "/notifications", code: 200 })),
81
+ ).annotate({
82
+ identifier: "NotifyGetListRequest",
83
+ }) as any as S.Schema<NotifyGetListRequest>;
84
+
85
+ /** ExternalTracker represents settings for external tracker */
86
+ export interface ExternalTracker {
87
+ /** External Issue Tracker URL Format. Use the placeholders {user}, {repo} and {index} for the username, repository name and issue index. */
88
+ external_tracker_format?: string;
89
+ /** External Issue Tracker issue regular expression */
90
+ external_tracker_regexp_pattern?: string;
91
+ /** External Issue Tracker Number Format, either `numeric`, `alphanumeric`, or `regexp` */
92
+ external_tracker_style?: string;
93
+ /** URL of external issue tracker. */
94
+ external_tracker_url?: string;
95
+ }
96
+ export const ExternalTracker = /*@__PURE__*/ S.suspend(() =>
97
+ S.Struct({
98
+ external_tracker_format: S.optional(S.String),
99
+ external_tracker_regexp_pattern: S.optional(S.String),
100
+ external_tracker_style: S.optional(S.String),
101
+ external_tracker_url: S.optional(S.String),
102
+ }),
103
+ ).annotate({
104
+ identifier: "ExternalTracker",
105
+ }) as any as S.Schema<ExternalTracker>;
106
+
107
+ /** ExternalWiki represents setting for external wiki */
108
+ export interface ExternalWiki {
109
+ /** URL of external wiki. */
110
+ external_wiki_url?: string;
111
+ }
112
+ export const ExternalWiki = /*@__PURE__*/ S.suspend(() =>
113
+ S.Struct({
114
+ external_wiki_url: S.optional(S.String),
115
+ }),
116
+ ).annotate({ identifier: "ExternalWiki" }) as any as S.Schema<ExternalWiki>;
117
+
118
+ /** InternalTracker represents settings for internal tracker */
119
+ export interface InternalTracker {
120
+ /** Let only contributors track time (Built-in issue tracker) */
121
+ allow_only_contributors_to_track_time?: boolean;
122
+ /** Enable dependencies for issues and pull requests (Built-in issue tracker) */
123
+ enable_issue_dependencies?: boolean;
124
+ /** Enable time tracking (Built-in issue tracker) */
125
+ enable_time_tracker?: boolean;
126
+ }
127
+ export const InternalTracker = /*@__PURE__*/ S.suspend(() =>
128
+ S.Struct({
129
+ allow_only_contributors_to_track_time: S.optional(S.Boolean),
130
+ enable_issue_dependencies: S.optional(S.Boolean),
131
+ enable_time_tracker: S.optional(S.Boolean),
132
+ }),
133
+ ).annotate({
134
+ identifier: "InternalTracker",
135
+ }) as any as S.Schema<InternalTracker>;
136
+
137
+ /** ObjectFormatName of the underlying git repository */
138
+ export type RepositoryObjectFormatName = "sha1" | "sha256";
139
+ export const RepositoryObjectFormatName = /*@__PURE__*/ S.String;
140
+
141
+ /** User represents a user */
142
+ export interface User {
143
+ /** Is user active */
144
+ active?: boolean;
145
+ /** URL to the user's avatar */
146
+ avatar_url?: string;
147
+ created?: string;
148
+ /** the user's description */
149
+ description?: string;
150
+ email?: string;
151
+ /** user counts */
152
+ followers_count?: number;
153
+ following_count?: number;
154
+ /** the user's full name */
155
+ full_name?: string;
156
+ /** URL to the user's profile page */
157
+ html_url?: string;
158
+ /** the user's id */
159
+ id: number;
160
+ /** Is the user an administrator */
161
+ is_admin?: boolean;
162
+ /** User locale */
163
+ language?: string;
164
+ last_login?: string;
165
+ /** the user's location */
166
+ location?: string;
167
+ /** the user's username */
168
+ login: string;
169
+ /** the user's authentication sign-in name. */
170
+ login_name?: string;
171
+ /** Is user login prohibited */
172
+ prohibit_login?: boolean;
173
+ /** the user's pronouns */
174
+ pronouns?: string;
175
+ /** Is user restricted */
176
+ restricted?: boolean;
177
+ /** The ID of the user's Authentication Source */
178
+ source_id?: number;
179
+ starred_repos_count?: number;
180
+ /** User visibility level option: public, limited, private */
181
+ visibility?: string;
182
+ /** the user's website */
183
+ website?: string;
184
+ }
185
+ export const User = /*@__PURE__*/ S.suspend(() =>
186
+ S.Struct({
187
+ active: S.optional(S.Boolean),
188
+ avatar_url: S.optional(S.String),
189
+ created: S.optional(S.String),
190
+ description: S.optional(S.String),
191
+ email: S.optional(S.String),
192
+ followers_count: S.optional(S.Number),
193
+ following_count: S.optional(S.Number),
194
+ full_name: S.optional(S.String),
195
+ html_url: S.optional(S.String),
196
+ id: S.Number,
197
+ is_admin: S.optional(S.Boolean),
198
+ language: S.optional(S.String),
199
+ last_login: S.optional(S.String),
200
+ location: S.optional(S.String),
201
+ login: S.String,
202
+ login_name: S.optional(S.String),
203
+ prohibit_login: S.optional(S.Boolean),
204
+ pronouns: S.optional(S.String),
205
+ restricted: S.optional(S.Boolean),
206
+ source_id: S.optional(S.Number),
207
+ starred_repos_count: S.optional(S.Number),
208
+ visibility: S.optional(S.String),
209
+ website: S.optional(S.String),
210
+ }),
211
+ ).annotate({ identifier: "User" }) as any as S.Schema<User>;
212
+
213
+ /** Permission represents a set of permissions */
214
+ export interface Permission {
215
+ admin?: boolean;
216
+ pull?: boolean;
217
+ push?: boolean;
218
+ }
219
+ export const Permission = /*@__PURE__*/ S.suspend(() =>
220
+ S.Struct({
221
+ admin: S.optional(S.Boolean),
222
+ pull: S.optional(S.Boolean),
223
+ push: S.optional(S.Boolean),
224
+ }),
225
+ ).annotate({ identifier: "Permission" }) as any as S.Schema<Permission>;
226
+
227
+ /** Organization represents an organization */
228
+ export interface Organization {
229
+ avatar_url?: string;
230
+ created?: string;
231
+ description?: string;
232
+ email?: string;
233
+ full_name?: string;
234
+ id: number;
235
+ location?: string;
236
+ name?: string;
237
+ repo_admin_change_team_access?: boolean;
238
+ /** deprecated */
239
+ username: string;
240
+ visibility?: string;
241
+ website?: string;
242
+ }
243
+ export const Organization = /*@__PURE__*/ S.suspend(() =>
244
+ S.Struct({
245
+ avatar_url: S.optional(S.String),
246
+ created: S.optional(S.String),
247
+ description: S.optional(S.String),
248
+ email: S.optional(S.String),
249
+ full_name: S.optional(S.String),
250
+ id: S.Number,
251
+ location: S.optional(S.String),
252
+ name: S.optional(S.String),
253
+ repo_admin_change_team_access: S.optional(S.Boolean),
254
+ username: S.String,
255
+ visibility: S.optional(S.String),
256
+ website: S.optional(S.String),
257
+ }),
258
+ ).annotate({ identifier: "Organization" }) as any as S.Schema<Organization>;
259
+
260
+ export type TeamPermission = "none" | "read" | "write" | "admin" | "owner";
261
+ export const TeamPermission = /*@__PURE__*/ S.String;
262
+
263
+ export type TeamUnitsList = Array<string>;
264
+ export const TeamUnitsList = /*@__PURE__*/ S.Array(
265
+ S.String,
266
+ ) as any as S.Schema<TeamUnitsList>;
267
+
268
+ export type TeamUnitsMapMap = { [key: string]: string | undefined };
269
+ export const TeamUnitsMapMap = /*@__PURE__*/ S.Record(
270
+ S.String,
271
+ S.String,
272
+ ) as any as S.Schema<TeamUnitsMapMap>;
273
+
274
+ /** Team represents a team in an organization */
275
+ export interface Team {
276
+ can_create_org_repo?: boolean;
277
+ description?: string;
278
+ id: number;
279
+ includes_all_repositories?: boolean;
280
+ name: string;
281
+ organization?: Organization;
282
+ permission?: TeamPermission;
283
+ units?: TeamUnitsList;
284
+ units_map?: TeamUnitsMapMap;
285
+ }
286
+ export const Team = /*@__PURE__*/ S.suspend(() =>
287
+ S.Struct({
288
+ can_create_org_repo: S.optional(S.Boolean),
289
+ description: S.optional(S.String),
290
+ id: S.Number,
291
+ includes_all_repositories: S.optional(S.Boolean),
292
+ name: S.String,
293
+ organization: S.optional(Organization),
294
+ permission: S.optional(TeamPermission),
295
+ units: S.optional(TeamUnitsList),
296
+ units_map: S.optional(TeamUnitsMapMap),
297
+ }),
298
+ ).annotate({ identifier: "Team" }) as any as S.Schema<Team>;
299
+
300
+ export type RepoTransferTeamsList = Array<Team>;
301
+ export const RepoTransferTeamsList = /*@__PURE__*/ S.Array(
302
+ Team,
303
+ ) as any as S.Schema<RepoTransferTeamsList>;
304
+
305
+ /** RepoTransfer represents a pending repo transfer */
306
+ export interface RepoTransfer {
307
+ doer?: User;
308
+ recipient?: User;
309
+ teams?: RepoTransferTeamsList;
310
+ }
311
+ export const RepoTransfer = /*@__PURE__*/ S.suspend(() =>
312
+ S.Struct({
313
+ doer: S.optional(User),
314
+ recipient: S.optional(User),
315
+ teams: S.optional(RepoTransferTeamsList),
316
+ }),
317
+ ).annotate({ identifier: "RepoTransfer" }) as any as S.Schema<RepoTransfer>;
318
+
319
+ export type RepositoryTopicsList = Array<string>;
320
+ export const RepositoryTopicsList = /*@__PURE__*/ S.Array(
321
+ S.String,
322
+ ) as any as S.Schema<RepositoryTopicsList>;
323
+
324
+ /** Repository represents a repository */
325
+ export interface Repository {
326
+ allow_fast_forward_only_merge?: boolean;
327
+ allow_merge_commits?: boolean;
328
+ allow_rebase?: boolean;
329
+ allow_rebase_explicit?: boolean;
330
+ allow_rebase_update?: boolean;
331
+ allow_squash_merge?: boolean;
332
+ archived?: boolean;
333
+ archived_at?: string;
334
+ avatar_url?: string;
335
+ clone_url: string;
336
+ created_at: string;
337
+ default_allow_maintainer_edit?: boolean;
338
+ default_branch: string;
339
+ default_delete_branch_after_merge?: boolean;
340
+ default_merge_style?: string;
341
+ default_update_style?: string;
342
+ description?: string;
343
+ empty?: boolean;
344
+ external_tracker?: ExternalTracker;
345
+ external_wiki?: ExternalWiki;
346
+ fork?: boolean;
347
+ forks_count?: number;
348
+ full_name: string;
349
+ globally_editable_wiki?: boolean;
350
+ has_actions?: boolean;
351
+ has_issues?: boolean;
352
+ has_packages?: boolean;
353
+ has_projects?: boolean;
354
+ has_pull_requests?: boolean;
355
+ has_releases?: boolean;
356
+ /** is the wiki enabled */
357
+ has_wiki?: boolean;
358
+ /** have wiki pages ever been created */
359
+ has_wiki_contents?: boolean;
360
+ html_url: string;
361
+ id: number;
362
+ ignore_whitespace_conflicts?: boolean;
363
+ internal?: boolean;
364
+ internal_tracker?: InternalTracker;
365
+ language?: string;
366
+ languages_url?: string;
367
+ link?: string;
368
+ mirror?: boolean;
369
+ mirror_interval?: string;
370
+ mirror_updated?: string;
371
+ name: string;
372
+ /** ObjectFormatName of the underlying git repository */
373
+ object_format_name?: RepositoryObjectFormatName;
374
+ open_issues_count?: number;
375
+ open_pr_counter?: number;
376
+ original_url?: string;
377
+ owner: User;
378
+ parent?: Repository;
379
+ permissions?: Permission;
380
+ private?: boolean;
381
+ release_counter?: number;
382
+ repo_transfer?: RepoTransfer;
383
+ size?: number;
384
+ ssh_url: string;
385
+ stars_count?: number;
386
+ template?: boolean;
387
+ topics?: RepositoryTopicsList;
388
+ updated_at: string;
389
+ url?: string;
390
+ watchers_count?: number;
391
+ website?: string;
392
+ wiki_branch?: string;
393
+ wiki_clone_url?: string;
394
+ wiki_ssh_url?: string;
395
+ }
396
+ export const Repository = /*@__PURE__*/ S.suspend(() =>
397
+ S.Struct({
398
+ allow_fast_forward_only_merge: S.optional(S.Boolean),
399
+ allow_merge_commits: S.optional(S.Boolean),
400
+ allow_rebase: S.optional(S.Boolean),
401
+ allow_rebase_explicit: S.optional(S.Boolean),
402
+ allow_rebase_update: S.optional(S.Boolean),
403
+ allow_squash_merge: S.optional(S.Boolean),
404
+ archived: S.optional(S.Boolean),
405
+ archived_at: S.optional(S.String),
406
+ avatar_url: S.optional(S.String),
407
+ clone_url: S.String,
408
+ created_at: S.String,
409
+ default_allow_maintainer_edit: S.optional(S.Boolean),
410
+ default_branch: S.String,
411
+ default_delete_branch_after_merge: S.optional(S.Boolean),
412
+ default_merge_style: S.optional(S.String),
413
+ default_update_style: S.optional(S.String),
414
+ description: S.optional(S.String),
415
+ empty: S.optional(S.Boolean),
416
+ external_tracker: S.optional(ExternalTracker),
417
+ external_wiki: S.optional(ExternalWiki),
418
+ fork: S.optional(S.Boolean),
419
+ forks_count: S.optional(S.Number),
420
+ full_name: S.String,
421
+ globally_editable_wiki: S.optional(S.Boolean),
422
+ has_actions: S.optional(S.Boolean),
423
+ has_issues: S.optional(S.Boolean),
424
+ has_packages: S.optional(S.Boolean),
425
+ has_projects: S.optional(S.Boolean),
426
+ has_pull_requests: S.optional(S.Boolean),
427
+ has_releases: S.optional(S.Boolean),
428
+ has_wiki: S.optional(S.Boolean),
429
+ has_wiki_contents: S.optional(S.Boolean),
430
+ html_url: S.String,
431
+ id: S.Number,
432
+ ignore_whitespace_conflicts: S.optional(S.Boolean),
433
+ internal: S.optional(S.Boolean),
434
+ internal_tracker: S.optional(InternalTracker),
435
+ language: S.optional(S.String),
436
+ languages_url: S.optional(S.String),
437
+ link: S.optional(S.String),
438
+ mirror: S.optional(S.Boolean),
439
+ mirror_interval: S.optional(S.String),
440
+ mirror_updated: S.optional(S.String),
441
+ name: S.String,
442
+ object_format_name: S.optional(RepositoryObjectFormatName),
443
+ open_issues_count: S.optional(S.Number),
444
+ open_pr_counter: S.optional(S.Number),
445
+ original_url: S.optional(S.String),
446
+ owner: User,
447
+ parent: S.optional(Repository),
448
+ permissions: S.optional(Permission),
449
+ private: S.optional(S.Boolean),
450
+ release_counter: S.optional(S.Number),
451
+ repo_transfer: S.optional(RepoTransfer),
452
+ size: S.optional(S.Number),
453
+ ssh_url: S.String,
454
+ stars_count: S.optional(S.Number),
455
+ template: S.optional(S.Boolean),
456
+ topics: S.optional(RepositoryTopicsList),
457
+ updated_at: S.String,
458
+ url: S.optional(S.String),
459
+ watchers_count: S.optional(S.Number),
460
+ website: S.optional(S.String),
461
+ wiki_branch: S.optional(S.String),
462
+ wiki_clone_url: S.optional(S.String),
463
+ wiki_ssh_url: S.optional(S.String),
464
+ }),
465
+ ).annotate({ identifier: "Repository" }) as any as S.Schema<Repository>;
466
+
467
+ /** NotificationSubject contains the notification subject (Issue/Pull/Commit) */
468
+ export interface NotificationSubject {
469
+ html_url?: string;
470
+ latest_comment_html_url?: string;
471
+ latest_comment_url?: string;
472
+ state?: string;
473
+ title?: string;
474
+ type?: string;
475
+ url?: string;
476
+ }
477
+ export const NotificationSubject = /*@__PURE__*/ S.suspend(() =>
478
+ S.Struct({
479
+ html_url: S.optional(S.String),
480
+ latest_comment_html_url: S.optional(S.String),
481
+ latest_comment_url: S.optional(S.String),
482
+ state: S.optional(S.String),
483
+ title: S.optional(S.String),
484
+ type: S.optional(S.String),
485
+ url: S.optional(S.String),
486
+ }),
487
+ ).annotate({
488
+ identifier: "NotificationSubject",
489
+ }) as any as S.Schema<NotificationSubject>;
490
+
491
+ /** NotificationThread expose Notification on API */
492
+ export interface NotificationThread {
493
+ id?: number;
494
+ pinned?: boolean;
495
+ repository?: Repository;
496
+ subject?: NotificationSubject;
497
+ unread?: boolean;
498
+ updated_at?: string;
499
+ url?: string;
500
+ }
501
+ export const NotificationThread = /*@__PURE__*/ S.suspend(() =>
502
+ S.Struct({
503
+ id: S.optional(S.Number),
504
+ pinned: S.optional(S.Boolean),
505
+ repository: S.optional(Repository),
506
+ subject: S.optional(NotificationSubject),
507
+ unread: S.optional(S.Boolean),
508
+ updated_at: S.optional(S.String),
509
+ url: S.optional(S.String),
510
+ }),
511
+ ).annotate({
512
+ identifier: "NotificationThread",
513
+ }) as any as S.Schema<NotificationThread>;
514
+
515
+ export type NotifyGetListResponseBodyList = Array<NotificationThread>;
516
+ export const NotifyGetListResponseBodyList = /*@__PURE__*/ S.Array(
517
+ NotificationThread,
518
+ ) as any as S.Schema<NotifyGetListResponseBodyList>;
519
+
520
+ export type NotifyGetListResponse = NotifyGetListResponseBodyList;
521
+ export const NotifyGetListResponse = /*@__PURE__*/ S.suspend(() =>
522
+ NotifyGetListResponseBodyList.pipe(T.RawResponseRoot()),
523
+ ).annotate({
524
+ identifier: "NotifyGetListResponse",
525
+ }) as any as S.Schema<NotifyGetListResponse>;
526
+
527
+ export type NotifyGetRepoListRequestStatusTypesList = Array<string>;
528
+ export const NotifyGetRepoListRequestStatusTypesList = /*@__PURE__*/ S.Array(
529
+ S.String,
530
+ ) as any as S.Schema<NotifyGetRepoListRequestStatusTypesList>;
531
+
532
+ export type NotifyGetRepoListRequestSubjectTypeItem =
533
+ | "issue"
534
+ | "pull"
535
+ | "repository";
536
+ export const NotifyGetRepoListRequestSubjectTypeItem = /*@__PURE__*/ S.String;
537
+
538
+ export type NotifyGetRepoListRequestSubjectTypeList = Array<
539
+ NotifyGetRepoListRequestSubjectTypeItem | (string & {})
540
+ >;
541
+ export const NotifyGetRepoListRequestSubjectTypeList = /*@__PURE__*/ S.Array(
542
+ NotifyGetRepoListRequestSubjectTypeItem,
543
+ ) as any as S.Schema<NotifyGetRepoListRequestSubjectTypeList>;
544
+
545
+ export interface NotifyGetRepoListRequest {
546
+ /** owner of the repo */
547
+ owner: string;
548
+ /** name of the repo */
549
+ repo: string;
550
+ /** If true, show notifications marked as read. Default value is false */
551
+ all?: boolean;
552
+ /** Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned */
553
+ status_types?: NotifyGetRepoListRequestStatusTypesList;
554
+ /** filter notifications by subject type */
555
+ subject_type?: NotifyGetRepoListRequestSubjectTypeList;
556
+ /** Only show notifications updated after the given time. This is a timestamp in RFC 3339 format */
557
+ since?: string;
558
+ /** Only show notifications updated before the given time. This is a timestamp in RFC 3339 format */
559
+ before?: string;
560
+ /** page number of results to return (1-based) */
561
+ page?: number;
562
+ /** page size of results */
563
+ limit?: number;
564
+ }
565
+ export const NotifyGetRepoListRequest = /*@__PURE__*/ S.suspend(() =>
566
+ S.Struct({
567
+ owner: S.String.pipe(T.Label()),
568
+ repo: S.String.pipe(T.Label()),
569
+ all: S.optional(S.Boolean.pipe(T.Query())),
570
+ status_types: S.optional(
571
+ NotifyGetRepoListRequestStatusTypesList.pipe(T.Query("status-types")),
572
+ ),
573
+ subject_type: S.optional(
574
+ NotifyGetRepoListRequestSubjectTypeList.pipe(T.Query("subject-type")),
575
+ ),
576
+ since: S.optional(S.String.pipe(T.Query())),
577
+ before: S.optional(S.String.pipe(T.Query())),
578
+ page: S.optional(S.Number.pipe(T.Query())),
579
+ limit: S.optional(S.Number.pipe(T.Query())),
580
+ }).pipe(
581
+ T.Http({
582
+ method: "GET",
583
+ uri: "/repos/{owner}/{repo}/notifications",
584
+ code: 200,
585
+ }),
586
+ ),
587
+ ).annotate({
588
+ identifier: "NotifyGetRepoListRequest",
589
+ }) as any as S.Schema<NotifyGetRepoListRequest>;
590
+
591
+ export type NotifyGetRepoListResponseBodyList = Array<NotificationThread>;
592
+ export const NotifyGetRepoListResponseBodyList = /*@__PURE__*/ S.Array(
593
+ NotificationThread,
594
+ ) as any as S.Schema<NotifyGetRepoListResponseBodyList>;
595
+
596
+ export type NotifyGetRepoListResponse = NotifyGetRepoListResponseBodyList;
597
+ export const NotifyGetRepoListResponse = /*@__PURE__*/ S.suspend(() =>
598
+ NotifyGetRepoListResponseBodyList.pipe(T.RawResponseRoot()),
599
+ ).annotate({
600
+ identifier: "NotifyGetRepoListResponse",
601
+ }) as any as S.Schema<NotifyGetRepoListResponse>;
602
+
603
+ export interface NotifyGetThreadRequest {
604
+ /** id of notification thread */
605
+ id: number;
606
+ }
607
+ export const NotifyGetThreadRequest = /*@__PURE__*/ S.suspend(() =>
608
+ S.Struct({
609
+ id: S.Number.pipe(T.Label()),
610
+ }).pipe(
611
+ T.Http({ method: "GET", uri: "/notifications/threads/{id}", code: 200 }),
612
+ ),
613
+ ).annotate({
614
+ identifier: "NotifyGetThreadRequest",
615
+ }) as any as S.Schema<NotifyGetThreadRequest>;
616
+
617
+ export interface NotifyNewAvailableRequest {}
618
+ export const NotifyNewAvailableRequest = /*@__PURE__*/ S.suspend(() =>
619
+ S.Struct({}).pipe(
620
+ T.Http({ method: "GET", uri: "/notifications/new", code: 200 }),
621
+ ),
622
+ ).annotate({
623
+ identifier: "NotifyNewAvailableRequest",
624
+ }) as any as S.Schema<NotifyNewAvailableRequest>;
625
+
626
+ /** NotificationCount number of unread notifications */
627
+ export interface NotificationCount {
628
+ new?: number;
629
+ }
630
+ export const NotificationCount = /*@__PURE__*/ S.suspend(() =>
631
+ S.Struct({
632
+ new: S.optional(S.Number),
633
+ }),
634
+ ).annotate({
635
+ identifier: "NotificationCount",
636
+ }) as any as S.Schema<NotificationCount>;
637
+
638
+ export type NotifyReadListRequestStatusTypesList = Array<string>;
639
+ export const NotifyReadListRequestStatusTypesList = /*@__PURE__*/ S.Array(
640
+ S.String,
641
+ ) as any as S.Schema<NotifyReadListRequestStatusTypesList>;
642
+
643
+ export interface NotifyReadListRequest {
644
+ /** Describes the last point that notifications were checked. Anything updated since this time will not be updated. */
645
+ last_read_at?: string;
646
+ /** If true, mark all notifications on this repo. Default value is false */
647
+ all?: boolean;
648
+ /** Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread. */
649
+ status_types?: NotifyReadListRequestStatusTypesList;
650
+ /** Status to mark notifications as, Defaults to read. */
651
+ to_status?: string;
652
+ }
653
+ export const NotifyReadListRequest = /*@__PURE__*/ S.suspend(() =>
654
+ S.Struct({
655
+ last_read_at: S.optional(S.String.pipe(T.Query())),
656
+ all: S.optional(S.Boolean.pipe(T.Query())),
657
+ status_types: S.optional(
658
+ NotifyReadListRequestStatusTypesList.pipe(T.Query("status-types")),
659
+ ),
660
+ to_status: S.optional(S.String.pipe(T.Query("to-status"))),
661
+ }).pipe(T.Http({ method: "PUT", uri: "/notifications", code: 200 })),
662
+ ).annotate({
663
+ identifier: "NotifyReadListRequest",
664
+ }) as any as S.Schema<NotifyReadListRequest>;
665
+
666
+ export interface NotifyReadListResponse {}
667
+ export const NotifyReadListResponse = /*@__PURE__*/ S.suspend(() =>
668
+ S.Struct({}),
669
+ ).annotate({
670
+ identifier: "NotifyReadListResponse",
671
+ }) as any as S.Schema<NotifyReadListResponse>;
672
+
673
+ export type NotifyReadRepoListRequestStatusTypesList = Array<string>;
674
+ export const NotifyReadRepoListRequestStatusTypesList = /*@__PURE__*/ S.Array(
675
+ S.String,
676
+ ) as any as S.Schema<NotifyReadRepoListRequestStatusTypesList>;
677
+
678
+ export interface NotifyReadRepoListRequest {
679
+ /** owner of the repo */
680
+ owner: string;
681
+ /** name of the repo */
682
+ repo: string;
683
+ /** If true, mark all notifications on this repo. Default value is false */
684
+ all?: boolean;
685
+ /** Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread. */
686
+ status_types?: NotifyReadRepoListRequestStatusTypesList;
687
+ /** Status to mark notifications as. Defaults to read. */
688
+ to_status?: string;
689
+ /** Describes the last point that notifications were checked. Anything updated since this time will not be updated. */
690
+ last_read_at?: string;
691
+ }
692
+ export const NotifyReadRepoListRequest = /*@__PURE__*/ S.suspend(() =>
693
+ S.Struct({
694
+ owner: S.String.pipe(T.Label()),
695
+ repo: S.String.pipe(T.Label()),
696
+ all: S.optional(S.Boolean.pipe(T.Query())),
697
+ status_types: S.optional(
698
+ NotifyReadRepoListRequestStatusTypesList.pipe(T.Query("status-types")),
699
+ ),
700
+ to_status: S.optional(S.String.pipe(T.Query("to-status"))),
701
+ last_read_at: S.optional(S.String.pipe(T.Query())),
702
+ }).pipe(
703
+ T.Http({
704
+ method: "PUT",
705
+ uri: "/repos/{owner}/{repo}/notifications",
706
+ code: 200,
707
+ }),
708
+ ),
709
+ ).annotate({
710
+ identifier: "NotifyReadRepoListRequest",
711
+ }) as any as S.Schema<NotifyReadRepoListRequest>;
712
+
713
+ export interface NotifyReadRepoListResponse {}
714
+ export const NotifyReadRepoListResponse = /*@__PURE__*/ S.suspend(() =>
715
+ S.Struct({}),
716
+ ).annotate({
717
+ identifier: "NotifyReadRepoListResponse",
718
+ }) as any as S.Schema<NotifyReadRepoListResponse>;
719
+
720
+ export interface NotifyReadThreadRequest {
721
+ /** id of notification thread */
722
+ id: number;
723
+ /** Status to mark notifications as */
724
+ to_status?: string;
725
+ }
726
+ export const NotifyReadThreadRequest = /*@__PURE__*/ S.suspend(() =>
727
+ S.Struct({
728
+ id: S.Number.pipe(T.Label()),
729
+ to_status: S.optional(S.String.pipe(T.Query("to-status"))),
730
+ }).pipe(
731
+ T.Http({ method: "PATCH", uri: "/notifications/threads/{id}", code: 200 }),
732
+ ),
733
+ ).annotate({
734
+ identifier: "NotifyReadThreadRequest",
735
+ }) as any as S.Schema<NotifyReadThreadRequest>;
736
+
737
+ export interface NotifyReadThreadResponse {}
738
+ export const NotifyReadThreadResponse = /*@__PURE__*/ S.suspend(() =>
739
+ S.Struct({}),
740
+ ).annotate({
741
+ identifier: "NotifyReadThreadResponse",
742
+ }) as any as S.Schema<NotifyReadThreadResponse>;
743
+
744
+ export type NotifyGetListError = ForgejoOpError;
745
+ /** List users's notification threads */
746
+ export const notifyGetList: API.OperationMethod<
747
+ NotifyGetListRequest,
748
+ NotifyGetListResponse,
749
+ NotifyGetListError,
750
+ ForgejoOpContext
751
+ > = /*@__PURE__*/ API.make(() => ({
752
+ input: NotifyGetListRequest,
753
+ output: NotifyGetListResponse,
754
+ errors: [],
755
+ protocol: ForgejoProtocol,
756
+ retry: Retry.Retry,
757
+ }));
758
+
759
+ export type NotifyGetRepoListError = ForgejoOpError;
760
+ /** List users's notification threads on a specific repo */
761
+ export const notifyGetRepoList: API.OperationMethod<
762
+ NotifyGetRepoListRequest,
763
+ NotifyGetRepoListResponse,
764
+ NotifyGetRepoListError,
765
+ ForgejoOpContext
766
+ > = /*@__PURE__*/ API.make(() => ({
767
+ input: NotifyGetRepoListRequest,
768
+ output: NotifyGetRepoListResponse,
769
+ errors: [],
770
+ protocol: ForgejoProtocol,
771
+ retry: Retry.Retry,
772
+ }));
773
+
774
+ export type NotifyGetThreadError = Forbidden | NotFound | ForgejoOpError;
775
+ /** Get notification thread by ID */
776
+ export const notifyGetThread: API.OperationMethod<
777
+ NotifyGetThreadRequest,
778
+ NotificationThread,
779
+ NotifyGetThreadError,
780
+ ForgejoOpContext
781
+ > = /*@__PURE__*/ API.make(() => ({
782
+ input: NotifyGetThreadRequest,
783
+ output: NotificationThread,
784
+ errors: [Forbidden, NotFound],
785
+ protocol: ForgejoProtocol,
786
+ retry: Retry.Retry,
787
+ }));
788
+
789
+ export type NotifyNewAvailableError = ForgejoOpError;
790
+ /** Check if unread notifications exist */
791
+ export const notifyNewAvailable: API.OperationMethod<
792
+ NotifyNewAvailableRequest,
793
+ NotificationCount,
794
+ NotifyNewAvailableError,
795
+ ForgejoOpContext
796
+ > = /*@__PURE__*/ API.make(() => ({
797
+ input: NotifyNewAvailableRequest,
798
+ output: NotificationCount,
799
+ errors: [],
800
+ protocol: ForgejoProtocol,
801
+ retry: Retry.Retry,
802
+ }));
803
+
804
+ export type NotifyReadListError = ForgejoOpError;
805
+ /** Mark notification threads as read, pinned or unread */
806
+ export const notifyReadList: API.OperationMethod<
807
+ NotifyReadListRequest,
808
+ NotifyReadListResponse,
809
+ NotifyReadListError,
810
+ ForgejoOpContext
811
+ > = /*@__PURE__*/ API.make(() => ({
812
+ input: NotifyReadListRequest,
813
+ output: NotifyReadListResponse,
814
+ errors: [],
815
+ protocol: ForgejoProtocol,
816
+ retry: Retry.Retry,
817
+ }));
818
+
819
+ export type NotifyReadRepoListError = ForgejoOpError;
820
+ /** Mark notification threads as read, pinned or unread on a specific repo */
821
+ export const notifyReadRepoList: API.OperationMethod<
822
+ NotifyReadRepoListRequest,
823
+ NotifyReadRepoListResponse,
824
+ NotifyReadRepoListError,
825
+ ForgejoOpContext
826
+ > = /*@__PURE__*/ API.make(() => ({
827
+ input: NotifyReadRepoListRequest,
828
+ output: NotifyReadRepoListResponse,
829
+ errors: [],
830
+ protocol: ForgejoProtocol,
831
+ retry: Retry.Retry,
832
+ }));
833
+
834
+ export type NotifyReadThreadError = Forbidden | NotFound | ForgejoOpError;
835
+ /** Mark notification thread as read by ID */
836
+ export const notifyReadThread: API.OperationMethod<
837
+ NotifyReadThreadRequest,
838
+ NotifyReadThreadResponse,
839
+ NotifyReadThreadError,
840
+ ForgejoOpContext
841
+ > = /*@__PURE__*/ API.make(() => ({
842
+ input: NotifyReadThreadRequest,
843
+ output: NotifyReadThreadResponse,
844
+ errors: [Forbidden, NotFound],
845
+ protocol: ForgejoProtocol,
846
+ retry: Retry.Retry,
847
+ }));