@cjavdev/believe 0.6.2 → 0.7.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/characters.d.mts +1 -1
  10. package/resources/characters.d.ts +1 -1
  11. package/resources/index.d.mts +1 -1
  12. package/resources/index.d.mts.map +1 -1
  13. package/resources/index.d.ts +1 -1
  14. package/resources/index.d.ts.map +1 -1
  15. package/resources/index.js.map +1 -1
  16. package/resources/index.mjs.map +1 -1
  17. package/resources/matches/matches.d.mts +2 -2
  18. package/resources/matches/matches.d.ts +2 -2
  19. package/resources/quotes.d.mts +3 -3
  20. package/resources/quotes.d.ts +3 -3
  21. package/resources/team-members.d.mts +3 -3
  22. package/resources/team-members.d.ts +3 -3
  23. package/resources/teams/teams.d.mts +1 -1
  24. package/resources/teams/teams.d.ts +1 -1
  25. package/resources/webhooks.d.mts +155 -1
  26. package/resources/webhooks.d.mts.map +1 -1
  27. package/resources/webhooks.d.ts +155 -1
  28. package/resources/webhooks.d.ts.map +1 -1
  29. package/resources/webhooks.js +3 -0
  30. package/resources/webhooks.js.map +1 -1
  31. package/resources/webhooks.mjs +3 -0
  32. package/resources/webhooks.mjs.map +1 -1
  33. package/src/client.ts +7 -1
  34. package/src/resources/characters.ts +1 -1
  35. package/src/resources/index.ts +3 -0
  36. package/src/resources/matches/matches.ts +2 -2
  37. package/src/resources/quotes.ts +3 -3
  38. package/src/resources/team-members.ts +3 -3
  39. package/src/resources/teams/teams.ts +1 -1
  40. package/src/resources/webhooks.ts +192 -0
  41. package/src/version.ts +1 -1
  42. package/version.d.mts +1 -1
  43. package/version.d.ts +1 -1
  44. package/version.js +1 -1
  45. package/version.mjs +1 -1
@@ -91,6 +91,10 @@ export class Webhooks extends APIResource {
91
91
  ): APIPromise<WebhookTriggerEventResponse> {
92
92
  return this._client.post('/webhooks/trigger', { body, ...options });
93
93
  }
94
+
95
+ unwrap(body: string): UnwrapWebhookEvent {
96
+ return JSON.parse(body) as UnwrapWebhookEvent;
97
+ }
94
98
  }
95
99
 
96
100
  /**
@@ -219,6 +223,191 @@ export namespace WebhookTriggerEventResponse {
219
223
  }
220
224
  }
221
225
 
226
+ /**
227
+ * Webhook event sent when a match completes.
228
+ */
229
+ export interface MatchCompletedWebhookEvent {
230
+ /**
231
+ * When the event was created
232
+ */
233
+ created_at: string;
234
+
235
+ /**
236
+ * Data payload for a match completed event.
237
+ */
238
+ data: MatchCompletedWebhookEvent.Data;
239
+
240
+ /**
241
+ * Unique identifier for this event
242
+ */
243
+ event_id: string;
244
+
245
+ /**
246
+ * The type of webhook event
247
+ */
248
+ event_type: 'match.completed';
249
+ }
250
+
251
+ export namespace MatchCompletedWebhookEvent {
252
+ /**
253
+ * Data payload for a match completed event.
254
+ */
255
+ export interface Data {
256
+ /**
257
+ * Final away team score
258
+ */
259
+ away_score: number;
260
+
261
+ /**
262
+ * Away team ID
263
+ */
264
+ away_team_id: string;
265
+
266
+ /**
267
+ * When the match completed
268
+ */
269
+ completed_at: string;
270
+
271
+ /**
272
+ * Final home team score
273
+ */
274
+ home_score: number;
275
+
276
+ /**
277
+ * Home team ID
278
+ */
279
+ home_team_id: string;
280
+
281
+ /**
282
+ * Unique match identifier
283
+ */
284
+ match_id: string;
285
+
286
+ /**
287
+ * Type of match
288
+ */
289
+ match_type: 'league' | 'cup' | 'friendly' | 'playoff' | 'final';
290
+
291
+ /**
292
+ * Match result from home team perspective
293
+ */
294
+ result: 'home_win' | 'away_win' | 'draw';
295
+
296
+ /**
297
+ * Ted's post-match wisdom
298
+ */
299
+ ted_post_match_quote: string;
300
+
301
+ /**
302
+ * Ted's lesson from the match
303
+ */
304
+ lesson_learned?: string | null;
305
+
306
+ /**
307
+ * Player of the match (if awarded)
308
+ */
309
+ man_of_the_match?: string | null;
310
+ }
311
+ }
312
+
313
+ /**
314
+ * Webhook event sent when a team member (player, coach, staff) transfers between
315
+ * teams.
316
+ */
317
+ export interface TeamMemberTransferredWebhookEvent {
318
+ /**
319
+ * When the event was created
320
+ */
321
+ created_at: string;
322
+
323
+ /**
324
+ * Data payload for a team member transfer event.
325
+ */
326
+ data: TeamMemberTransferredWebhookEvent.Data;
327
+
328
+ /**
329
+ * Unique identifier for this event
330
+ */
331
+ event_id: string;
332
+
333
+ /**
334
+ * The type of webhook event
335
+ */
336
+ event_type: 'team_member.transferred';
337
+ }
338
+
339
+ export namespace TeamMemberTransferredWebhookEvent {
340
+ /**
341
+ * Data payload for a team member transfer event.
342
+ */
343
+ export interface Data {
344
+ /**
345
+ * ID of the character (links to /characters)
346
+ */
347
+ character_id: string;
348
+
349
+ /**
350
+ * Name of the character
351
+ */
352
+ character_name: string;
353
+
354
+ /**
355
+ * Type of team member
356
+ */
357
+ member_type: 'player' | 'coach' | 'medical_staff' | 'equipment_manager';
358
+
359
+ /**
360
+ * ID of the team involved
361
+ */
362
+ team_id: string;
363
+
364
+ /**
365
+ * ID of the team member
366
+ */
367
+ team_member_id: string;
368
+
369
+ /**
370
+ * Name of the team involved
371
+ */
372
+ team_name: string;
373
+
374
+ /**
375
+ * Ted's reaction to the transfer
376
+ */
377
+ ted_reaction: string;
378
+
379
+ /**
380
+ * Whether the member joined or departed
381
+ */
382
+ transfer_type: 'joined' | 'departed';
383
+
384
+ /**
385
+ * Previous team ID (for joins from another team)
386
+ */
387
+ previous_team_id?: string | null;
388
+
389
+ /**
390
+ * Previous team name (for joins from another team)
391
+ */
392
+ previous_team_name?: string | null;
393
+
394
+ /**
395
+ * Transfer fee in GBP (for players)
396
+ */
397
+ transfer_fee_gbp?: string | null;
398
+
399
+ /**
400
+ * Years spent with previous team
401
+ */
402
+ years_with_previous_team?: number | null;
403
+ }
404
+ }
405
+
406
+ /**
407
+ * Webhook event sent when a match completes.
408
+ */
409
+ export type UnwrapWebhookEvent = MatchCompletedWebhookEvent | TeamMemberTransferredWebhookEvent;
410
+
222
411
  export interface WebhookCreateParams {
223
412
  /**
224
413
  * The URL to send webhook events to
@@ -419,6 +608,9 @@ export declare namespace Webhooks {
419
608
  type WebhookListResponse as WebhookListResponse,
420
609
  type WebhookDeleteResponse as WebhookDeleteResponse,
421
610
  type WebhookTriggerEventResponse as WebhookTriggerEventResponse,
611
+ type MatchCompletedWebhookEvent as MatchCompletedWebhookEvent,
612
+ type TeamMemberTransferredWebhookEvent as TeamMemberTransferredWebhookEvent,
613
+ type UnwrapWebhookEvent as UnwrapWebhookEvent,
422
614
  type WebhookCreateParams as WebhookCreateParams,
423
615
  type WebhookTriggerEventParams as WebhookTriggerEventParams,
424
616
  };
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.6.2'; // x-release-please-version
1
+ export const VERSION = '0.7.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.6.2";
1
+ export declare const VERSION = "0.7.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.6.2";
1
+ export declare const VERSION = "0.7.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.6.2'; // x-release-please-version
4
+ exports.VERSION = '0.7.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.6.2'; // x-release-please-version
1
+ export const VERSION = '0.7.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map