@deadair/sdk 0.89.5 → 0.90.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.js CHANGED
@@ -5219,6 +5219,106 @@ var ScheduleClient = class {
5219
5219
  constructor(fetch2) {
5220
5220
  this.fetch = fetch2;
5221
5221
  }
5222
+ /**
5223
+ * @name List occasions
5224
+ * @description Every occasion on this station, in the order a date is matched against them, each saying when it next falls
5225
+ */
5226
+ async listOccasions() {
5227
+ const result = await this.fetch(`/occasions`, {
5228
+ method: "GET"
5229
+ });
5230
+ return await parseJson(result);
5231
+ }
5232
+ /**
5233
+ * @name Add an occasion
5234
+ * @description Adds an occasion at the end of the list. Presenters hear of it from the next break written for its day
5235
+ */
5236
+ async addAnOccasion(body) {
5237
+ const result = await this.fetch(`/occasions`, {
5238
+ method: "POST",
5239
+ headers: {
5240
+ "Content-Type": "application/json"
5241
+ },
5242
+ body: JSON.stringify(body, bigIntReplacer)
5243
+ });
5244
+ return await parseJson(result);
5245
+ }
5246
+ /**
5247
+ * @name Reorder occasions
5248
+ * @description Puts the list in a new order, which decides who wins when two fall on one date
5249
+ */
5250
+ async reorderOccasions(body) {
5251
+ const result = await this.fetch(`/occasions/order`, {
5252
+ method: "PUT",
5253
+ headers: {
5254
+ "Content-Type": "application/json"
5255
+ },
5256
+ body: JSON.stringify(body, bigIntReplacer)
5257
+ });
5258
+ return await parseJson(result);
5259
+ }
5260
+ /**
5261
+ * @name Export occasions
5262
+ * @description Every occasion on this station as one file, to hand to another station
5263
+ */
5264
+ async exportOccasions() {
5265
+ const result = await this.fetch(`/occasions/export`, {
5266
+ method: "GET"
5267
+ });
5268
+ return await parseJson(result);
5269
+ }
5270
+ /**
5271
+ * @name Preview occasion import
5272
+ * @description Reads a file and reports what importing it would add, skip and leave out. Writes nothing
5273
+ */
5274
+ async previewOccasionImport(body) {
5275
+ const result = await this.fetch(`/occasions/import/preview`, {
5276
+ method: "POST",
5277
+ headers: {
5278
+ "Content-Type": "application/json"
5279
+ },
5280
+ body: JSON.stringify(body, bigIntReplacer)
5281
+ });
5282
+ return await parseJson(result);
5283
+ }
5284
+ /**
5285
+ * @name Import occasions
5286
+ * @description Adds what is new in a file to the end of the list, switched off. Changes nothing the station already has
5287
+ */
5288
+ async importOccasions(body) {
5289
+ const result = await this.fetch(`/occasions/import`, {
5290
+ method: "POST",
5291
+ headers: {
5292
+ "Content-Type": "application/json"
5293
+ },
5294
+ body: JSON.stringify(body, bigIntReplacer)
5295
+ });
5296
+ return await parseJson(result);
5297
+ }
5298
+ /**
5299
+ * @name Change an occasion
5300
+ * @description Replaces an occasion, keeping its place in the list
5301
+ */
5302
+ async changeAnOccasion(id, body) {
5303
+ const result = await this.fetch(`/occasions/${encodeURIComponent(id)}`, {
5304
+ method: "PUT",
5305
+ headers: {
5306
+ "Content-Type": "application/json"
5307
+ },
5308
+ body: JSON.stringify(body, bigIntReplacer)
5309
+ });
5310
+ return await parseJson(result);
5311
+ }
5312
+ /**
5313
+ * @name Remove an occasion
5314
+ * @description Removes an occasion
5315
+ */
5316
+ async removeAnOccasion(id) {
5317
+ const result = await this.fetch(`/occasions/${encodeURIComponent(id)}`, {
5318
+ method: "DELETE"
5319
+ });
5320
+ return await parseJson(result);
5321
+ }
5222
5322
  /**
5223
5323
  * @name List schedule
5224
5324
  * @description Every slot in this station's schedule, earliest in the day first