@remit/api-http-client 0.0.67 → 0.0.68

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.
@@ -553,7 +553,7 @@ export const calendarEventOperationsListCalendarEventsOptions = (options: Option
553
553
  });
554
554
 
555
555
  /**
556
- * Create an event. The server builds the VEVENT and writes it through the single calendar write path — the same one an accepted invitation and a later CalDAV PUT go through — so the object, its expanded occurrences and the collection's sync sequence land together or not at all.
556
+ * Create an event. The server builds the VEVENT and writes it through the single calendar write path — the same one an accepted invitation and a later CalDAV PUT go through — so the object, its expanded occurrences and the collection's sync sequence land together or not at all. Refused with 400 `read_only_calendar` for a `Subscribed` collection, whose events belong to the feed.
557
557
  */
558
558
  export const calendarEventOperationsCreateCalendarEventMutation = (options?: Partial<Options<CalendarEventOperationsCreateCalendarEventData>>): UseMutationOptions<CalendarEventOperationsCreateCalendarEventResponse, CalendarEventOperationsCreateCalendarEventError, Options<CalendarEventOperationsCreateCalendarEventData>> => {
559
559
  const mutationOptions: UseMutationOptions<CalendarEventOperationsCreateCalendarEventResponse, CalendarEventOperationsCreateCalendarEventError, Options<CalendarEventOperationsCreateCalendarEventData>> = {
@@ -576,6 +576,8 @@ export const calendarEventOperationsCreateCalendarEventMutation = (options?: Par
576
576
  * it.
577
577
  *
578
578
  * Same refusals and the same `If-Match` precondition as the update.
579
+ * An event in a `Subscribed` collection is refused with 400
580
+ * `read_only_calendar`, here and on the update.
579
581
  */
580
582
  export const calendarEventDetailOperationsDeleteCalendarEventMutation = (options?: Partial<Options<CalendarEventDetailOperationsDeleteCalendarEventData>>): UseMutationOptions<CalendarEventDetailOperationsDeleteCalendarEventResponse, CalendarEventDetailOperationsDeleteCalendarEventError, Options<CalendarEventDetailOperationsDeleteCalendarEventData>> => {
581
583
  const mutationOptions: UseMutationOptions<CalendarEventDetailOperationsDeleteCalendarEventResponse, CalendarEventDetailOperationsDeleteCalendarEventError, Options<CalendarEventDetailOperationsDeleteCalendarEventData>> = {
@@ -759,7 +761,7 @@ export const calendarOperationsListCalendarsOptions = (options?: Options<Calenda
759
761
  });
760
762
 
761
763
  /**
762
- * Create a calendar collection. Refused with 400 when `urlSegment` is empty or already taken in this account config — the segment is the collection's identity, so a second create under the same one would otherwise silently return the collection that already exists.
764
+ * Create a calendar collection. Refused with 400 when `urlSegment` is empty or already taken in this account config — the segment is the collection's identity, so a second create under the same one would otherwise silently return the collection that already exists. With `subscriptionUrl` the feed is fetched first and a fetch that fails is refused with 400 `subscription_unreachable`, naming why and never the URL.
763
765
  */
764
766
  export const calendarOperationsCreateCalendarMutation = (options?: Partial<Options<CalendarOperationsCreateCalendarData>>): UseMutationOptions<CalendarOperationsCreateCalendarResponse, CalendarOperationsCreateCalendarError, Options<CalendarOperationsCreateCalendarData>> => {
765
767
  const mutationOptions: UseMutationOptions<CalendarOperationsCreateCalendarResponse, CalendarOperationsCreateCalendarError, Options<CalendarOperationsCreateCalendarData>> = {
@@ -807,6 +809,9 @@ export const calendarDetailOperationsGetCalendarOptions = (options: Options<Cale
807
809
  queryKey: calendarDetailOperationsGetCalendarQueryKey(options)
808
810
  });
809
811
 
812
+ /**
813
+ * Update a calendar collection. `subscriptionEnabled` is refused with 400 `not_subscribed` on a collection that is not `Subscribed`. Turning it off stops the refresh and removes nothing.
814
+ */
810
815
  export const calendarDetailOperationsUpdateCalendarMutation = (options?: Partial<Options<CalendarDetailOperationsUpdateCalendarData>>): UseMutationOptions<CalendarDetailOperationsUpdateCalendarResponse, CalendarDetailOperationsUpdateCalendarError, Options<CalendarDetailOperationsUpdateCalendarData>> => {
811
816
  const mutationOptions: UseMutationOptions<CalendarDetailOperationsUpdateCalendarResponse, CalendarDetailOperationsUpdateCalendarError, Options<CalendarDetailOperationsUpdateCalendarData>> = {
812
817
  mutationFn: async (fnOptions) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/api-http-client",
3
- "version": "0.0.67",
3
+ "version": "0.0.68",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.ts",
package/sdk.gen.ts CHANGED
@@ -325,7 +325,7 @@ export const calendarEventOperationsListCalendarEvents = <ThrowOnError extends b
325
325
  });
326
326
 
327
327
  /**
328
- * Create an event. The server builds the VEVENT and writes it through the single calendar write path — the same one an accepted invitation and a later CalDAV PUT go through — so the object, its expanded occurrences and the collection's sync sequence land together or not at all.
328
+ * Create an event. The server builds the VEVENT and writes it through the single calendar write path — the same one an accepted invitation and a later CalDAV PUT go through — so the object, its expanded occurrences and the collection's sync sequence land together or not at all. Refused with 400 `read_only_calendar` for a `Subscribed` collection, whose events belong to the feed.
329
329
  */
330
330
  export const calendarEventOperationsCreateCalendarEvent = <ThrowOnError extends boolean = false>(options: Options<CalendarEventOperationsCreateCalendarEventData, ThrowOnError>): RequestResult<CalendarEventOperationsCreateCalendarEventResponses, CalendarEventOperationsCreateCalendarEventErrors, ThrowOnError> => (options.client ?? client).post<CalendarEventOperationsCreateCalendarEventResponses, CalendarEventOperationsCreateCalendarEventErrors, ThrowOnError>({
331
331
  security: [{ name: 'Authorization', type: 'apiKey' }],
@@ -344,6 +344,8 @@ export const calendarEventOperationsCreateCalendarEvent = <ThrowOnError extends
344
344
  * it.
345
345
  *
346
346
  * Same refusals and the same `If-Match` precondition as the update.
347
+ * An event in a `Subscribed` collection is refused with 400
348
+ * `read_only_calendar`, here and on the update.
347
349
  */
348
350
  export const calendarEventDetailOperationsDeleteCalendarEvent = <ThrowOnError extends boolean = false>(options: Options<CalendarEventDetailOperationsDeleteCalendarEventData, ThrowOnError>): RequestResult<CalendarEventDetailOperationsDeleteCalendarEventResponses, CalendarEventDetailOperationsDeleteCalendarEventErrors, ThrowOnError> => (options.client ?? client).delete<CalendarEventDetailOperationsDeleteCalendarEventResponses, CalendarEventDetailOperationsDeleteCalendarEventErrors, ThrowOnError>({
349
351
  security: [{ name: 'Authorization', type: 'apiKey' }],
@@ -463,7 +465,7 @@ export const calendarOperationsListCalendars = <ThrowOnError extends boolean = f
463
465
  });
464
466
 
465
467
  /**
466
- * Create a calendar collection. Refused with 400 when `urlSegment` is empty or already taken in this account config — the segment is the collection's identity, so a second create under the same one would otherwise silently return the collection that already exists.
468
+ * Create a calendar collection. Refused with 400 when `urlSegment` is empty or already taken in this account config — the segment is the collection's identity, so a second create under the same one would otherwise silently return the collection that already exists. With `subscriptionUrl` the feed is fetched first and a fetch that fails is refused with 400 `subscription_unreachable`, naming why and never the URL.
467
469
  */
468
470
  export const calendarOperationsCreateCalendar = <ThrowOnError extends boolean = false>(options: Options<CalendarOperationsCreateCalendarData, ThrowOnError>): RequestResult<CalendarOperationsCreateCalendarResponses, CalendarOperationsCreateCalendarErrors, ThrowOnError> => (options.client ?? client).post<CalendarOperationsCreateCalendarResponses, CalendarOperationsCreateCalendarErrors, ThrowOnError>({
469
471
  security: [{ name: 'Authorization', type: 'apiKey' }],
@@ -490,6 +492,9 @@ export const calendarDetailOperationsGetCalendar = <ThrowOnError extends boolean
490
492
  ...options
491
493
  });
492
494
 
495
+ /**
496
+ * Update a calendar collection. `subscriptionEnabled` is refused with 400 `not_subscribed` on a collection that is not `Subscribed`. Turning it off stops the refresh and removes nothing.
497
+ */
493
498
  export const calendarDetailOperationsUpdateCalendar = <ThrowOnError extends boolean = false>(options: Options<CalendarDetailOperationsUpdateCalendarData, ThrowOnError>): RequestResult<CalendarDetailOperationsUpdateCalendarResponses, CalendarDetailOperationsUpdateCalendarErrors, ThrowOnError> => (options.client ?? client).patch<CalendarDetailOperationsUpdateCalendarResponses, CalendarDetailOperationsUpdateCalendarErrors, ThrowOnError>({
494
499
  security: [{ name: 'Authorization', type: 'apiKey' }],
495
500
  url: '/calendars/{calendarId}',
package/types.gen.ts CHANGED
@@ -885,14 +885,34 @@ export type RemitImapCalendarResponse = {
885
885
  * Monotonic change counter for this collection. Bumped by every write to one of its objects; the value stamped on `CalendarObject.syncSequence` is the value this counter held after that write.
886
886
  */
887
887
  readonly syncSequence: number;
888
+ /**
889
+ * The read-only iCalendar URL a `Subscribed` collection is filled from, such as a Google Calendar secret address. For some providers the URL is the whole credential, so it never reaches a log line. `""` for every other source.
890
+ */
891
+ subscriptionUrl: String2048;
892
+ /**
893
+ * Whether the scheduled refresh re-reads `subscriptionUrl`. Turning it off stops the refresh and keeps every stored event. Always `false` on a collection that is not `Subscribed`.
894
+ */
895
+ subscriptionEnabled: boolean;
896
+ /**
897
+ * When the subscription was last fetched, whatever the outcome. `0` when it never was.
898
+ */
899
+ readonly subscriptionCheckedAt: number;
900
+ /**
901
+ * When the subscription was last fetched and written. `0` when it never was.
902
+ */
903
+ readonly subscriptionFetchedAt: number;
904
+ /**
905
+ * Why the last fetch failed, or which events in it could not be stored. `""` when the last fetch landed whole.
906
+ */
907
+ subscriptionError: String512;
888
908
  readonly createdAt: number;
889
909
  readonly updatedAt: number;
890
910
  };
891
911
 
892
912
  /**
893
- * Where a calendar collection came from. `Default` is the one provisioned per account config on first use and is never deleted; `UserCreated` is one a person made; `MailDerived` is one populated from mail rather than by a person.
913
+ * Where a calendar collection came from. `Default` is the one provisioned per account config on first use and is never deleted; `UserCreated` is one a person made; `MailDerived` is one populated from mail rather than by a person; `Subscribed` is filled from a read-only iCalendar URL and refuses every write except its own refresh.
894
914
  */
895
- export type RemitImapCalendarSource = 'Default' | 'UserCreated' | 'MailDerived';
915
+ export type RemitImapCalendarSource = 'Default' | 'UserCreated' | 'MailDerived' | 'Subscribed';
896
916
 
897
917
  /**
898
918
  * A suggestion as the API returns it. The raw `icalData` is not surfaced: a client renders the projected fields, and the bytes exist so that accepting can write them into a calendar unchanged.
@@ -1296,6 +1316,10 @@ export type RemitImapCreateCalendarInput = {
1296
1316
  * IANA time zone this collection's floating times are read in. Absent reads them as UTC.
1297
1317
  */
1298
1318
  timezone?: String64;
1319
+ /**
1320
+ * A read-only iCalendar URL to subscribe the collection to. `http`, `https` and `webcal` are accepted. The server fetches it once before creating anything and refuses with 400 when the fetch fails, so a mistyped address leaves no empty calendar behind. The collection is then `Subscribed`: it refuses event writes, and the scheduled refresh keeps it in step with the feed.
1321
+ */
1322
+ subscriptionUrl?: String2048;
1299
1323
  };
1300
1324
 
1301
1325
  /**
@@ -3392,7 +3416,7 @@ export type RemitImapUpdateCalendarEventInput = {
3392
3416
  };
3393
3417
 
3394
3418
  /**
3395
- * Input for updating a calendar collection. The name, colour and timezone are the mutable overlay; `urlSegment` is not among them, because it is the collection's identity and the path a client has bookmarked.
3419
+ * Input for updating a calendar collection. The name, colour and timezone are the mutable overlay, and `subscriptionEnabled` turns a subscribed collection's refresh off and on. `urlSegment` is not among them, because it is the collection's identity and the path a client has bookmarked.
3396
3420
  */
3397
3421
  export type RemitImapUpdateCalendarInput = {
3398
3422
  /**
@@ -3407,6 +3431,10 @@ export type RemitImapUpdateCalendarInput = {
3407
3431
  * IANA time zone this collection's floating times are read in, e.g. "Europe/Amsterdam". `""` when none is set, which reads as UTC.
3408
3432
  */
3409
3433
  timezone?: String64;
3434
+ /**
3435
+ * Whether the scheduled refresh re-reads `subscriptionUrl`. Turning it off stops the refresh and keeps every stored event. Always `false` on a collection that is not `Subscribed`.
3436
+ */
3437
+ subscriptionEnabled?: boolean;
3410
3438
  };
3411
3439
 
3412
3440
  /**
@@ -3774,6 +3802,10 @@ export type RemitImapCalendarResponseWritable = {
3774
3802
  * IANA time zone this collection's floating times are read in, e.g. "Europe/Amsterdam". `""` when none is set, which reads as UTC.
3775
3803
  */
3776
3804
  timezone: String64;
3805
+ /**
3806
+ * Whether the scheduled refresh re-reads `subscriptionUrl`. Turning it off stops the refresh and keeps every stored event. Always `false` on a collection that is not `Subscribed`.
3807
+ */
3808
+ subscriptionEnabled: boolean;
3777
3809
  };
3778
3810
 
3779
3811
  /**