@remit/api-openapi-types 0.0.44 → 0.0.45

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 (2) hide show
  1. package/package.json +1 -1
  2. package/types.d.ts +282 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/api-openapi-types",
3
- "version": "0.0.44",
3
+ "version": "0.0.45",
4
4
  "type": "module",
5
5
  "main": "types.d.ts",
6
6
  "types": "types.d.ts",
package/types.d.ts CHANGED
@@ -2434,6 +2434,93 @@ mutable overlay; this is the address.
2434
2434
  export interface CalendarNoContent {
2435
2435
  statusCode: 204;
2436
2436
  }
2437
+ /**
2438
+ * Whether a calendar has a feed address, and how old it is. The token is deliberately absent — it exists in the clear once, in the answer to the write that minted it.
2439
+ */
2440
+ export interface CalendarFeedStateResponse {
2441
+ /**
2442
+ * Collection this address serves
2443
+ */
2444
+ calendarId: UUID;
2445
+ /**
2446
+ * When this calendar first got a feed address
2447
+ */
2448
+ createdAt: number;
2449
+ /**
2450
+ * When the token was last replaced. `0` means it is still the first one.
2451
+ */
2452
+ rotatedAt: number;
2453
+ }
2454
+ /**
2455
+ * A calendar's secret subscription address, with the token in the clear.
2456
+
2457
+ Returned by the write that mints it and nowhere else. Only the hash is
2458
+ stored, so a client that loses this value rotates the feed rather than
2459
+ reading it back — which is also what makes the read side safe to leave
2460
+ tokenless.
2461
+ */
2462
+ export interface CalendarFeedResponse {
2463
+ /**
2464
+ * Collection this address serves
2465
+ */
2466
+ calendarId: UUID;
2467
+ /**
2468
+ * The token itself, base64url over 32 random bytes. It is the whole credential: the path `/feeds/calendar/{feedToken}.ics` needs nothing else, which is what lets a client that cannot sign in subscribe.
2469
+ */
2470
+ feedToken: String512;
2471
+ /**
2472
+ * When this calendar first got a feed address
2473
+ */
2474
+ createdAt: number;
2475
+ /**
2476
+ * When the token was last replaced. `0` means it is still the first one.
2477
+ */
2478
+ rotatedAt: number;
2479
+ }
2480
+ /**
2481
+ * A whole calendar as iCalendar text, for a client that subscribed to the
2482
+ secret address.
2483
+
2484
+ Recurring events are the stored masters with their RRULE, not an expansion:
2485
+ a subscriber renders its own occurrences and expects to keep doing so
2486
+ indefinitely, and an expansion would silently end at whatever horizon this
2487
+ server chose.
2488
+
2489
+ The calendar's name travels as the `X-WR-CALNAME` property inside the
2490
+ VCALENDAR, which is where Apple Calendar, Google Calendar and Thunderbird
2491
+ read it from.
2492
+ */
2493
+ export interface CalendarFeedIcalResponse {
2494
+ contentType: "text/calendar; charset=utf-8";
2495
+ /**
2496
+ * Strong entity tag over the bytes being served. A subscriber polls often and sends it back as `If-None-Match`.
2497
+ */
2498
+ etag: string;
2499
+ /**
2500
+ * HTTP-date the collection was last written, which is stamped by every event write and every event delete. The collection's own timestamp rather than its newest event: deleting the newest event leaves every survivor older than the change, and a validator that moved backwards would tell a subscriber its stale copy is current.
2501
+ */
2502
+ lastModified: string;
2503
+ icalData: string;
2504
+ }
2505
+ /**
2506
+ * The subscriber already holds these bytes. Answered when `If-None-Match` carries the tag the feed would serve, or when `If-Modified-Since` is not older than the calendar's last change.
2507
+ */
2508
+ export interface CalendarFeedNotModified {
2509
+ statusCode: 304;
2510
+ etag: string;
2511
+ /**
2512
+ * The same validator a 200 would have carried, so a subscriber that polls by date can keep doing so
2513
+ */
2514
+ lastModified: string;
2515
+ }
2516
+ /**
2517
+ * No feed answers to this address. Unknown, revoked and malformed tokens are one answer with one body, so a caller learns nothing about which of the three it sent.
2518
+ */
2519
+ export interface CalendarFeedNotFound {
2520
+ statusCode: 404;
2521
+ contentType: "text/plain; charset=utf-8";
2522
+ message: string;
2523
+ }
2437
2524
  /**
2438
2525
  * Expanded occurrences in the requested window, in start order.
2439
2526
 
@@ -5732,6 +5819,52 @@ occurrences from every zone but its own.
5732
5819
  createdAt: number;
5733
5820
  updatedAt: number;
5734
5821
  }
5822
+ /**
5823
+ * The secret address a calendar is subscribed to from outside (issue #1067).
5824
+
5825
+ A subscriber never signs in: Apple Calendar, Google Calendar and Thunderbird
5826
+ poll a URL and send no credential, so the URL is the credential. Only the
5827
+ SHA-256 hash of the token is stored — the plaintext is handed out once, at the
5828
+ write that mints it, and a caller that loses it rotates rather than reads it
5829
+ back.
5830
+
5831
+ `feedTokenId` is derived from `calendarId`, so one calendar holds one active
5832
+ token by construction: rotating rewrites the row it already has, and the
5833
+ previous address stops resolving the moment the new hash lands. A second
5834
+ active address per calendar would be a credential nobody could see to revoke.
5835
+
5836
+ The hash is a plain digest and deliberately not a slow one. The token carries
5837
+ 32 random bytes, so there is nothing to brute-force and no password-equivalent
5838
+ to stretch; a KDF here would only make every poll from every subscribed client
5839
+ expensive.
5840
+ */
5841
+ export interface CalendarFeedToken {
5842
+ /**
5843
+ * Primary identifier, derived from calendarId
5844
+ */
5845
+ feedTokenId: UUID;
5846
+ /**
5847
+ * Owning account configuration
5848
+ */
5849
+ accountConfigId: UUID;
5850
+ /**
5851
+ * Collection this address serves
5852
+ */
5853
+ calendarId: UUID;
5854
+ /**
5855
+ * SHA-256 of the token, lower-case hex. The plaintext is never stored: a leaked database gives a reader no working subscription URL.
5856
+ */
5857
+ tokenHash: String64;
5858
+ /**
5859
+ * When this calendar first got a feed address. Survives a rotation — the feed is the same feed, under a new secret.
5860
+ */
5861
+ createdAt: number;
5862
+ /**
5863
+ * When the token was last replaced. `0` means it is still the one this calendar started with.
5864
+ */
5865
+ rotatedAt: number;
5866
+ updatedAt: number;
5867
+ }
5735
5868
  /**
5736
5869
  * Junction whose existence *is* a label assignment (RFC 030). Holds only ids
5737
5870
  and is hydrated with `batchGet`. Keyed by a deterministic UUID v5 derived
@@ -6107,6 +6240,47 @@ declare namespace Paths {
6107
6240
  export type $404 = void;
6108
6241
  }
6109
6242
  }
6243
+ namespace GetCalendarFeed {
6244
+ export interface PathParameters {
6245
+ calendarId: Components.Schemas.UUID;
6246
+ }
6247
+ namespace Responses {
6248
+ export type $200 = void;
6249
+ export type $404 = void;
6250
+ }
6251
+ }
6252
+ namespace PutCalendarFeed {
6253
+ export interface PathParameters {
6254
+ calendarId: Components.Schemas.UUID;
6255
+ }
6256
+ namespace Responses {
6257
+ export type $200 = void;
6258
+ export type $404 = void;
6259
+ }
6260
+ }
6261
+ namespace RevokeCalendarFeed {
6262
+ export interface PathParameters {
6263
+ calendarId: Components.Schemas.UUID;
6264
+ }
6265
+ namespace Responses {
6266
+ export type $204 = void;
6267
+ export type $404 = void;
6268
+ }
6269
+ }
6270
+ namespace GetCalendarFeedIcal {
6271
+ export interface PathParameters {
6272
+ feedToken: string;
6273
+ }
6274
+ export interface HeaderParameters {
6275
+ ifNoneMatch?: string;
6276
+ ifModifiedSince?: string;
6277
+ }
6278
+ namespace Responses {
6279
+ export type $200 = void;
6280
+ export type $304 = void;
6281
+ export type $404 = void;
6282
+ }
6283
+ }
6110
6284
  namespace ListCalendarEvents {
6111
6285
  export interface QueryParameters {
6112
6286
  from: string;
@@ -6810,6 +6984,55 @@ export interface OperationMethods {
6810
6984
  data?: any,
6811
6985
  config?: AxiosRequestConfig
6812
6986
  ): OperationResponse<Paths.DeleteCalendar.Responses.$204>;
6987
+ /**
6988
+ * getCalendarFeed - Read whether this calendar has a feed address. Absent (404) until one is
6989
+ minted. The token is not here: it is stored as a hash, so the only
6990
+ moment it exists in the clear is the answer to the write below.
6991
+ */
6992
+ 'getCalendarFeed'(
6993
+ parameters?: Parameters<Paths.GetCalendarFeed.PathParameters> | null,
6994
+ data?: any,
6995
+ config?: AxiosRequestConfig
6996
+ ): OperationResponse<Paths.GetCalendarFeed.Responses.$200>;
6997
+ /**
6998
+ * putCalendarFeed - Mint the calendar's feed address, or replace the one it has, and answer
6999
+ with the token in the clear. Idempotent in address rather than in value:
7000
+ one calendar holds one token, so a second call rotates — the previous
7001
+ URL stops resolving, which is how a subscription handed to the wrong
7002
+ person is taken back.
7003
+
7004
+ This is the only response that ever carries the plaintext. A client that
7005
+ does not keep it rotates again.
7006
+ */
7007
+ 'putCalendarFeed'(
7008
+ parameters?: Parameters<Paths.PutCalendarFeed.PathParameters> | null,
7009
+ data?: any,
7010
+ config?: AxiosRequestConfig
7011
+ ): OperationResponse<Paths.PutCalendarFeed.Responses.$200>;
7012
+ /**
7013
+ * revokeCalendarFeed - Revoke the calendar's feed address. Every subscribed client starts getting 404 on its next poll. Answered 404 when the calendar has no feed, so a revoke is never reported as having taken something away that was not there.
7014
+ */
7015
+ 'revokeCalendarFeed'(
7016
+ parameters?: Parameters<Paths.RevokeCalendarFeed.PathParameters> | null,
7017
+ data?: any,
7018
+ config?: AxiosRequestConfig
7019
+ ): OperationResponse<Paths.RevokeCalendarFeed.Responses.$204>;
7020
+ /**
7021
+ * getCalendarFeedIcal - Serve a calendar as iCalendar text to whoever holds its secret address
7022
+ (issue #1067).
7023
+
7024
+ Outside the session-auth surface on purpose: Apple Calendar, Google
7025
+ Calendar, Outlook and Thunderbird subscribe to a URL and never sign in,
7026
+ so the token in the path is the credential and the only one. It is
7027
+ compared against the stored hash rather than looked up in the clear, and
7028
+ an unknown, revoked or malformed token is the same 404 with the same body
7029
+ — a subscriber learns whether it still has access, and nothing else.
7030
+ */
7031
+ 'getCalendarFeedIcal'(
7032
+ parameters?: Parameters<Paths.GetCalendarFeedIcal.PathParameters & Paths.GetCalendarFeedIcal.HeaderParameters> | null,
7033
+ data?: any,
7034
+ config?: AxiosRequestConfig
7035
+ ): OperationResponse<Paths.GetCalendarFeedIcal.Responses.$200>;
6813
7036
  /**
6814
7037
  * listCalendarEvents - Expanded event occurrences in a window. The server does the recurrence
6815
7038
  expansion and the client renders instances — no RRULE is ever evaluated
@@ -7554,6 +7777,59 @@ export interface PathsDictionary {
7554
7777
  config?: AxiosRequestConfig
7555
7778
  ): OperationResponse<Paths.DeleteCalendar.Responses.$204>;
7556
7779
  };
7780
+ ['/calendars/{calendarId}/feed']: {
7781
+ /**
7782
+ * getCalendarFeed - Read whether this calendar has a feed address. Absent (404) until one is
7783
+ minted. The token is not here: it is stored as a hash, so the only
7784
+ moment it exists in the clear is the answer to the write below.
7785
+ */
7786
+ 'get'(
7787
+ parameters?: Parameters<Paths.GetCalendarFeed.PathParameters> | null,
7788
+ data?: any,
7789
+ config?: AxiosRequestConfig
7790
+ ): OperationResponse<Paths.GetCalendarFeed.Responses.$200>;
7791
+ /**
7792
+ * putCalendarFeed - Mint the calendar's feed address, or replace the one it has, and answer
7793
+ with the token in the clear. Idempotent in address rather than in value:
7794
+ one calendar holds one token, so a second call rotates — the previous
7795
+ URL stops resolving, which is how a subscription handed to the wrong
7796
+ person is taken back.
7797
+
7798
+ This is the only response that ever carries the plaintext. A client that
7799
+ does not keep it rotates again.
7800
+ */
7801
+ 'put'(
7802
+ parameters?: Parameters<Paths.PutCalendarFeed.PathParameters> | null,
7803
+ data?: any,
7804
+ config?: AxiosRequestConfig
7805
+ ): OperationResponse<Paths.PutCalendarFeed.Responses.$200>;
7806
+ /**
7807
+ * revokeCalendarFeed - Revoke the calendar's feed address. Every subscribed client starts getting 404 on its next poll. Answered 404 when the calendar has no feed, so a revoke is never reported as having taken something away that was not there.
7808
+ */
7809
+ 'delete'(
7810
+ parameters?: Parameters<Paths.RevokeCalendarFeed.PathParameters> | null,
7811
+ data?: any,
7812
+ config?: AxiosRequestConfig
7813
+ ): OperationResponse<Paths.RevokeCalendarFeed.Responses.$204>;
7814
+ };
7815
+ ['/feeds/calendar/{feedToken}.ics']: {
7816
+ /**
7817
+ * getCalendarFeedIcal - Serve a calendar as iCalendar text to whoever holds its secret address
7818
+ (issue #1067).
7819
+
7820
+ Outside the session-auth surface on purpose: Apple Calendar, Google
7821
+ Calendar, Outlook and Thunderbird subscribe to a URL and never sign in,
7822
+ so the token in the path is the credential and the only one. It is
7823
+ compared against the stored hash rather than looked up in the clear, and
7824
+ an unknown, revoked or malformed token is the same 404 with the same body
7825
+ — a subscriber learns whether it still has access, and nothing else.
7826
+ */
7827
+ 'get'(
7828
+ parameters?: Parameters<Paths.GetCalendarFeedIcal.PathParameters> | null,
7829
+ data?: any,
7830
+ config?: AxiosRequestConfig
7831
+ ): OperationResponse<Paths.GetCalendarFeedIcal.Responses.$200>;
7832
+ };
7557
7833
  ['/calendar-events']: {
7558
7834
  /**
7559
7835
  * listCalendarEvents - Expanded event occurrences in a window. The server does the recurrence
@@ -8130,6 +8406,11 @@ export type CalendarResponse = Components.Schemas.CalendarResponse;
8130
8406
  export type CreateCalendarInput = Components.Schemas.CreateCalendarInput;
8131
8407
  export type UpdateCalendarInput = Components.Schemas.UpdateCalendarInput;
8132
8408
  export type CalendarNoContent = Components.Schemas.CalendarNoContent;
8409
+ export type CalendarFeedStateResponse = Components.Schemas.CalendarFeedStateResponse;
8410
+ export type CalendarFeedResponse = Components.Schemas.CalendarFeedResponse;
8411
+ export type CalendarFeedIcalResponse = Components.Schemas.CalendarFeedIcalResponse;
8412
+ export type CalendarFeedNotModified = Components.Schemas.CalendarFeedNotModified;
8413
+ export type CalendarFeedNotFound = Components.Schemas.CalendarFeedNotFound;
8133
8414
  export type CalendarEventListResponse = Components.Schemas.CalendarEventListResponse;
8134
8415
  export type CalendarEventInstance = Components.Schemas.CalendarEventInstance;
8135
8416
  export type CreateCalendarEventInput = Components.Schemas.CreateCalendarEventInput;
@@ -8231,6 +8512,7 @@ export type RawMessageStorage = Components.Schemas.RawMessageStorage;
8231
8512
  export type BodyPartStorage = Components.Schemas.BodyPartStorage;
8232
8513
  export type BodyPartContent = Components.Schemas.BodyPartContent;
8233
8514
  export type CalendarEventIndex = Components.Schemas.CalendarEventIndex;
8515
+ export type CalendarFeedToken = Components.Schemas.CalendarFeedToken;
8234
8516
  export type MessageLabel = Components.Schemas.MessageLabel;
8235
8517
  export type FilterAnchor = Components.Schemas.FilterAnchor;
8236
8518
  export type MicrosoftOAuthStartRequest = Components.Schemas.MicrosoftOAuthStartRequest;