vairified 0.2.0 → 0.3.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/README.md +91 -21
- package/dist/index.cjs +213 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +215 -7
- package/dist/index.d.ts +215 -7
- package/dist/index.js +209 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -339,6 +339,50 @@ interface PlayerRankOptions {
|
|
|
339
339
|
/** Number of players on either side of the target. Default 5. */
|
|
340
340
|
readonly contextSize?: number;
|
|
341
341
|
}
|
|
342
|
+
/**
|
|
343
|
+
* Wire shape for tournament import response.
|
|
344
|
+
*
|
|
345
|
+
* @category Matches
|
|
346
|
+
*/
|
|
347
|
+
interface TournamentImportResultWire {
|
|
348
|
+
readonly success: boolean;
|
|
349
|
+
readonly matchesImported: number;
|
|
350
|
+
readonly gamesRecorded: number;
|
|
351
|
+
readonly ghostPlayersCreated: number;
|
|
352
|
+
readonly existingPlayersMatched: number;
|
|
353
|
+
readonly dryRun?: boolean;
|
|
354
|
+
readonly message?: string;
|
|
355
|
+
readonly errors?: readonly string[];
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Wire shape for a single webhook delivery attempt.
|
|
359
|
+
*
|
|
360
|
+
* @category Webhooks
|
|
361
|
+
*/
|
|
362
|
+
interface WebhookDeliveryWire {
|
|
363
|
+
readonly id: string;
|
|
364
|
+
readonly event: string;
|
|
365
|
+
readonly url: string;
|
|
366
|
+
readonly statusCode: number | null;
|
|
367
|
+
readonly responseBody: string | null;
|
|
368
|
+
readonly errorMessage: string | null;
|
|
369
|
+
readonly attempts: number;
|
|
370
|
+
readonly maxAttempts: number;
|
|
371
|
+
readonly lastAttemptAt: string;
|
|
372
|
+
readonly nextRetryAt: string | null;
|
|
373
|
+
readonly completedAt: string | null;
|
|
374
|
+
readonly createdAt: string;
|
|
375
|
+
readonly payload: Record<string, unknown>;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Wire shape for paginated webhook delivery results.
|
|
379
|
+
*
|
|
380
|
+
* @category Webhooks
|
|
381
|
+
*/
|
|
382
|
+
interface WebhookDeliveriesResultWire {
|
|
383
|
+
readonly deliveries: readonly WebhookDeliveryWire[];
|
|
384
|
+
readonly total: number;
|
|
385
|
+
}
|
|
342
386
|
/**
|
|
343
387
|
* Error envelope commonly returned by the Partner API on non-2xx status.
|
|
344
388
|
*
|
|
@@ -402,6 +446,32 @@ declare class MatchBatchResult {
|
|
|
402
446
|
toString(): string;
|
|
403
447
|
}
|
|
404
448
|
|
|
449
|
+
/**
|
|
450
|
+
* {@link TournamentImportResult} — result of a tournament import submission.
|
|
451
|
+
*
|
|
452
|
+
* @module
|
|
453
|
+
*/
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Result of a tournament import submission.
|
|
457
|
+
*
|
|
458
|
+
* @category Matches
|
|
459
|
+
*/
|
|
460
|
+
declare class TournamentImportResult {
|
|
461
|
+
readonly success: boolean;
|
|
462
|
+
readonly matchesImported: number;
|
|
463
|
+
readonly gamesRecorded: number;
|
|
464
|
+
readonly ghostPlayersCreated: number;
|
|
465
|
+
readonly existingPlayersMatched: number;
|
|
466
|
+
readonly dryRun: boolean;
|
|
467
|
+
readonly message: string | undefined;
|
|
468
|
+
readonly errors: readonly string[];
|
|
469
|
+
/** @internal */
|
|
470
|
+
constructor(wire: TournamentImportResultWire);
|
|
471
|
+
/** True when the import succeeded without errors. */
|
|
472
|
+
get ok(): boolean;
|
|
473
|
+
}
|
|
474
|
+
|
|
405
475
|
/**
|
|
406
476
|
* {@link MatchesResource} — bulk match submission.
|
|
407
477
|
*
|
|
@@ -420,9 +490,9 @@ declare class MatchesResource {
|
|
|
420
490
|
/**
|
|
421
491
|
* Submit a {@link MatchBatch} for rating calculation.
|
|
422
492
|
*
|
|
423
|
-
* All players in every match must have granted the `match:submit`
|
|
493
|
+
* All players in every match must have granted the `user:match:submit`
|
|
424
494
|
* scope via OAuth (unless your API key has the
|
|
425
|
-
* `match:submit:trusted` scope, which skips per-player consent).
|
|
495
|
+
* `user:match:submit:trusted` scope, which skips per-player consent).
|
|
426
496
|
*
|
|
427
497
|
* Set `batch.dryRun = true` to validate without persisting.
|
|
428
498
|
*
|
|
@@ -449,6 +519,30 @@ declare class MatchesResource {
|
|
|
449
519
|
* ```
|
|
450
520
|
*/
|
|
451
521
|
submit(batch: MatchBatch): Promise<MatchBatchResult>;
|
|
522
|
+
/**
|
|
523
|
+
* Import tournament results.
|
|
524
|
+
*
|
|
525
|
+
* The request body is a free-form JSON object whose structure is
|
|
526
|
+
* defined by the Vairified tournament import schema. Set
|
|
527
|
+
* `body.dryRun = true` to validate without persisting.
|
|
528
|
+
*
|
|
529
|
+
* @param body - Tournament import payload.
|
|
530
|
+
* @returns {@link TournamentImportResult} with match/game counts.
|
|
531
|
+
* @category Matches
|
|
532
|
+
*
|
|
533
|
+
* @example
|
|
534
|
+
* ```ts
|
|
535
|
+
* const result = await client.matches.tournamentImport({
|
|
536
|
+
* sport: 'pickleball',
|
|
537
|
+
* tournamentName: 'Spring Classic',
|
|
538
|
+
* matches: [...],
|
|
539
|
+
* });
|
|
540
|
+
* if (result.ok) {
|
|
541
|
+
* console.log(`Imported ${result.matchesImported} matches`);
|
|
542
|
+
* }
|
|
543
|
+
* ```
|
|
544
|
+
*/
|
|
545
|
+
tournamentImport(body: Record<string, unknown>): Promise<TournamentImportResult>;
|
|
452
546
|
/** Send a test payload to a webhook URL. */
|
|
453
547
|
testWebhook(webhookUrl: string): Promise<Record<string, unknown>>;
|
|
454
548
|
}
|
|
@@ -711,13 +805,38 @@ declare class MembersResource {
|
|
|
711
805
|
* ```
|
|
712
806
|
*/
|
|
713
807
|
find(name: string): Promise<Member | null>;
|
|
808
|
+
/**
|
|
809
|
+
* Fetch up to 100 members by their member IDs in one call.
|
|
810
|
+
*
|
|
811
|
+
* Unknown IDs are silently omitted — the returned array may be
|
|
812
|
+
* shorter than the input. Results are returned in the same order
|
|
813
|
+
* as the input IDs.
|
|
814
|
+
*
|
|
815
|
+
* @param ids - Array of integer member IDs (max 100).
|
|
816
|
+
* @param options - Optional filters.
|
|
817
|
+
* @param options.sport - Sport code to scope ratings (e.g. `'pickleball'`).
|
|
818
|
+
* @returns Array of {@link Member} instances.
|
|
819
|
+
* @throws {@link ValidationError} If more than 100 IDs are provided.
|
|
820
|
+
* @category Members
|
|
821
|
+
*
|
|
822
|
+
* @example
|
|
823
|
+
* ```ts
|
|
824
|
+
* const members = await client.members.getBulk([4873327, 4873328]);
|
|
825
|
+
* for (const m of members) {
|
|
826
|
+
* console.log(m.name, m.ratingFor('pickleball'));
|
|
827
|
+
* }
|
|
828
|
+
* ```
|
|
829
|
+
*/
|
|
830
|
+
getBulk(ids: number[], options?: {
|
|
831
|
+
sport?: string;
|
|
832
|
+
}): Promise<Member[]>;
|
|
714
833
|
/**
|
|
715
834
|
* Poll for rating change notifications.
|
|
716
835
|
*
|
|
717
836
|
* Returns a list of {@link RatingUpdate} objects for every player
|
|
718
837
|
* whose rating has changed since the last poll. Members are
|
|
719
838
|
* considered subscribed when they have an active OAuth connection
|
|
720
|
-
* with the `webhook:subscribe` scope.
|
|
839
|
+
* with the `user:webhook:subscribe` scope.
|
|
721
840
|
*/
|
|
722
841
|
ratingUpdates(): Promise<readonly RatingUpdate[]>;
|
|
723
842
|
}
|
|
@@ -739,13 +858,13 @@ declare class MembersResource {
|
|
|
739
858
|
* lets TypeScript catch typos at authoring time:
|
|
740
859
|
*
|
|
741
860
|
* ```ts
|
|
742
|
-
* const scopes: OAuthScope[] = ['profile:read', 'rating:read']; // ok
|
|
743
|
-
* const bad: OAuthScope[] = ['profile:read', 'rating']; // type error
|
|
861
|
+
* const scopes: OAuthScope[] = ['user:profile:read', 'user:rating:read']; // ok
|
|
862
|
+
* const bad: OAuthScope[] = ['user:profile:read', 'rating']; // type error
|
|
744
863
|
* ```
|
|
745
864
|
*
|
|
746
865
|
* @category OAuth
|
|
747
866
|
*/
|
|
748
|
-
type OAuthScope = 'profile:read' | 'profile:email' | 'rating:read' | 'rating:history' | 'match:submit' | 'webhook:subscribe';
|
|
867
|
+
type OAuthScope = 'user:profile:read' | 'user:profile:email' | 'user:rating:read' | 'user:rating:history' | 'user:match:submit' | 'user:webhook:subscribe';
|
|
749
868
|
/**
|
|
750
869
|
* Human-readable description for every OAuth scope.
|
|
751
870
|
*
|
|
@@ -892,6 +1011,93 @@ declare class OAuthResource {
|
|
|
892
1011
|
}[]>;
|
|
893
1012
|
}
|
|
894
1013
|
|
|
1014
|
+
/**
|
|
1015
|
+
* {@link WebhookDelivery} and {@link WebhookDeliveriesResult} — webhook
|
|
1016
|
+
* delivery inspection models.
|
|
1017
|
+
*
|
|
1018
|
+
* @module
|
|
1019
|
+
*/
|
|
1020
|
+
|
|
1021
|
+
/**
|
|
1022
|
+
* A single webhook delivery attempt.
|
|
1023
|
+
*
|
|
1024
|
+
* @category Webhooks
|
|
1025
|
+
*/
|
|
1026
|
+
declare class WebhookDelivery {
|
|
1027
|
+
readonly id: string;
|
|
1028
|
+
readonly event: string;
|
|
1029
|
+
readonly url: string;
|
|
1030
|
+
readonly statusCode: number | null;
|
|
1031
|
+
readonly responseBody: string | null;
|
|
1032
|
+
readonly errorMessage: string | null;
|
|
1033
|
+
readonly attempts: number;
|
|
1034
|
+
readonly maxAttempts: number;
|
|
1035
|
+
readonly lastAttemptAt: string;
|
|
1036
|
+
readonly nextRetryAt: string | null;
|
|
1037
|
+
readonly completedAt: string | null;
|
|
1038
|
+
readonly createdAt: string;
|
|
1039
|
+
readonly payload: Readonly<Record<string, unknown>>;
|
|
1040
|
+
/** @internal */
|
|
1041
|
+
constructor(wire: WebhookDeliveryWire);
|
|
1042
|
+
/** Whether delivery completed successfully (2xx status). */
|
|
1043
|
+
get succeeded(): boolean;
|
|
1044
|
+
/** Whether delivery failed definitively (completed with non-2xx). */
|
|
1045
|
+
get failed(): boolean;
|
|
1046
|
+
}
|
|
1047
|
+
/**
|
|
1048
|
+
* Paginated list of webhook delivery attempts.
|
|
1049
|
+
*
|
|
1050
|
+
* @category Webhooks
|
|
1051
|
+
*/
|
|
1052
|
+
declare class WebhookDeliveriesResult {
|
|
1053
|
+
readonly deliveries: readonly WebhookDelivery[];
|
|
1054
|
+
readonly total: number;
|
|
1055
|
+
/** @internal */
|
|
1056
|
+
constructor(wire: WebhookDeliveriesResultWire);
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
/**
|
|
1060
|
+
* {@link WebhooksResource} — webhook delivery inspection.
|
|
1061
|
+
*
|
|
1062
|
+
* @module
|
|
1063
|
+
*/
|
|
1064
|
+
|
|
1065
|
+
/**
|
|
1066
|
+
* Webhook delivery inspection.
|
|
1067
|
+
*
|
|
1068
|
+
* @category Resources
|
|
1069
|
+
*/
|
|
1070
|
+
declare class WebhooksResource {
|
|
1071
|
+
#private;
|
|
1072
|
+
/** @internal */
|
|
1073
|
+
constructor(http: HttpTransport);
|
|
1074
|
+
/**
|
|
1075
|
+
* List recent webhook delivery attempts.
|
|
1076
|
+
*
|
|
1077
|
+
* @param options - Optional filters and pagination.
|
|
1078
|
+
* @param options.event - Filter by event type (e.g. `'rating.updated'`).
|
|
1079
|
+
* @param options.status - Filter: `'all'`, `'pending'`, `'success'`, or `'failed'`.
|
|
1080
|
+
* @param options.limit - Results per page (1-100, default 20).
|
|
1081
|
+
* @param options.offset - Pagination offset.
|
|
1082
|
+
* @returns {@link WebhookDeliveriesResult} with entries and total.
|
|
1083
|
+
* @category Webhooks
|
|
1084
|
+
*
|
|
1085
|
+
* @example
|
|
1086
|
+
* ```ts
|
|
1087
|
+
* const result = await client.webhooks.deliveries({ status: 'failed' });
|
|
1088
|
+
* for (const d of result.deliveries) {
|
|
1089
|
+
* console.log(d.event, d.statusCode, d.errorMessage);
|
|
1090
|
+
* }
|
|
1091
|
+
* ```
|
|
1092
|
+
*/
|
|
1093
|
+
deliveries(options?: {
|
|
1094
|
+
event?: string;
|
|
1095
|
+
status?: 'all' | 'pending' | 'success' | 'failed';
|
|
1096
|
+
limit?: number;
|
|
1097
|
+
offset?: number;
|
|
1098
|
+
}): Promise<WebhookDeliveriesResult>;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
895
1101
|
/**
|
|
896
1102
|
* {@link Vairified} — the main entry point of the SDK.
|
|
897
1103
|
*
|
|
@@ -955,6 +1161,8 @@ declare class Vairified {
|
|
|
955
1161
|
readonly oauth: OAuthResource;
|
|
956
1162
|
/** Leaderboard queries — list, rank, categories. */
|
|
957
1163
|
readonly leaderboard: LeaderboardResource;
|
|
1164
|
+
/** Webhook delivery inspection — deliveries. */
|
|
1165
|
+
readonly webhooks: WebhooksResource;
|
|
958
1166
|
constructor(options?: VairifiedOptions);
|
|
959
1167
|
/**
|
|
960
1168
|
* API usage statistics for the current API key.
|
|
@@ -1053,4 +1261,4 @@ declare class OAuthError extends VairifiedError {
|
|
|
1053
1261
|
constructor(message?: string, errorCode?: string, response?: unknown);
|
|
1054
1262
|
}
|
|
1055
1263
|
|
|
1056
|
-
export { type ApiErrorResponse, AuthenticationError, type AuthorizationResponse, DEFAULT_SCOPES, ENVIRONMENTS, type GameInput, type Gender, type LeaderboardOptions, LeaderboardResource, type MatchBatch, MatchBatchResult, type MatchBatchResultWire, type MatchInput, MatchesResource, Member, MemberSportMap, type MemberStatusWire, MembersResource, NotFoundError, type OAuthConfig, OAuthError, OAuthResource, type OAuthScope, type PartnerMemberWire, type PartnerRatingUpdateWire, type PlayerRankOptions, RateLimitError, type RatingSplitWire, RatingUpdate, SCOPES, type SearchFilters, SportRating, type SportRatingWire, type TokenResponse, Vairified, type VairifiedEnvironment, VairifiedError, type VairifiedOptions, ValidationError, describeScope, describeScopes, generateState, getAuthorizationUrl, validateScope };
|
|
1264
|
+
export { type ApiErrorResponse, AuthenticationError, type AuthorizationResponse, DEFAULT_SCOPES, ENVIRONMENTS, type GameInput, type Gender, type LeaderboardOptions, LeaderboardResource, type MatchBatch, MatchBatchResult, type MatchBatchResultWire, type MatchInput, MatchesResource, Member, MemberSportMap, type MemberStatusWire, MembersResource, NotFoundError, type OAuthConfig, OAuthError, OAuthResource, type OAuthScope, type PartnerMemberWire, type PartnerRatingUpdateWire, type PlayerRankOptions, RateLimitError, type RatingSplitWire, RatingUpdate, SCOPES, type SearchFilters, SportRating, type SportRatingWire, type TokenResponse, TournamentImportResult, type TournamentImportResultWire, Vairified, type VairifiedEnvironment, VairifiedError, type VairifiedOptions, ValidationError, WebhookDeliveriesResult, type WebhookDeliveriesResultWire, WebhookDelivery, type WebhookDeliveryWire, WebhooksResource, describeScope, describeScopes, generateState, getAuthorizationUrl, validateScope };
|
package/dist/index.d.ts
CHANGED
|
@@ -339,6 +339,50 @@ interface PlayerRankOptions {
|
|
|
339
339
|
/** Number of players on either side of the target. Default 5. */
|
|
340
340
|
readonly contextSize?: number;
|
|
341
341
|
}
|
|
342
|
+
/**
|
|
343
|
+
* Wire shape for tournament import response.
|
|
344
|
+
*
|
|
345
|
+
* @category Matches
|
|
346
|
+
*/
|
|
347
|
+
interface TournamentImportResultWire {
|
|
348
|
+
readonly success: boolean;
|
|
349
|
+
readonly matchesImported: number;
|
|
350
|
+
readonly gamesRecorded: number;
|
|
351
|
+
readonly ghostPlayersCreated: number;
|
|
352
|
+
readonly existingPlayersMatched: number;
|
|
353
|
+
readonly dryRun?: boolean;
|
|
354
|
+
readonly message?: string;
|
|
355
|
+
readonly errors?: readonly string[];
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Wire shape for a single webhook delivery attempt.
|
|
359
|
+
*
|
|
360
|
+
* @category Webhooks
|
|
361
|
+
*/
|
|
362
|
+
interface WebhookDeliveryWire {
|
|
363
|
+
readonly id: string;
|
|
364
|
+
readonly event: string;
|
|
365
|
+
readonly url: string;
|
|
366
|
+
readonly statusCode: number | null;
|
|
367
|
+
readonly responseBody: string | null;
|
|
368
|
+
readonly errorMessage: string | null;
|
|
369
|
+
readonly attempts: number;
|
|
370
|
+
readonly maxAttempts: number;
|
|
371
|
+
readonly lastAttemptAt: string;
|
|
372
|
+
readonly nextRetryAt: string | null;
|
|
373
|
+
readonly completedAt: string | null;
|
|
374
|
+
readonly createdAt: string;
|
|
375
|
+
readonly payload: Record<string, unknown>;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Wire shape for paginated webhook delivery results.
|
|
379
|
+
*
|
|
380
|
+
* @category Webhooks
|
|
381
|
+
*/
|
|
382
|
+
interface WebhookDeliveriesResultWire {
|
|
383
|
+
readonly deliveries: readonly WebhookDeliveryWire[];
|
|
384
|
+
readonly total: number;
|
|
385
|
+
}
|
|
342
386
|
/**
|
|
343
387
|
* Error envelope commonly returned by the Partner API on non-2xx status.
|
|
344
388
|
*
|
|
@@ -402,6 +446,32 @@ declare class MatchBatchResult {
|
|
|
402
446
|
toString(): string;
|
|
403
447
|
}
|
|
404
448
|
|
|
449
|
+
/**
|
|
450
|
+
* {@link TournamentImportResult} — result of a tournament import submission.
|
|
451
|
+
*
|
|
452
|
+
* @module
|
|
453
|
+
*/
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Result of a tournament import submission.
|
|
457
|
+
*
|
|
458
|
+
* @category Matches
|
|
459
|
+
*/
|
|
460
|
+
declare class TournamentImportResult {
|
|
461
|
+
readonly success: boolean;
|
|
462
|
+
readonly matchesImported: number;
|
|
463
|
+
readonly gamesRecorded: number;
|
|
464
|
+
readonly ghostPlayersCreated: number;
|
|
465
|
+
readonly existingPlayersMatched: number;
|
|
466
|
+
readonly dryRun: boolean;
|
|
467
|
+
readonly message: string | undefined;
|
|
468
|
+
readonly errors: readonly string[];
|
|
469
|
+
/** @internal */
|
|
470
|
+
constructor(wire: TournamentImportResultWire);
|
|
471
|
+
/** True when the import succeeded without errors. */
|
|
472
|
+
get ok(): boolean;
|
|
473
|
+
}
|
|
474
|
+
|
|
405
475
|
/**
|
|
406
476
|
* {@link MatchesResource} — bulk match submission.
|
|
407
477
|
*
|
|
@@ -420,9 +490,9 @@ declare class MatchesResource {
|
|
|
420
490
|
/**
|
|
421
491
|
* Submit a {@link MatchBatch} for rating calculation.
|
|
422
492
|
*
|
|
423
|
-
* All players in every match must have granted the `match:submit`
|
|
493
|
+
* All players in every match must have granted the `user:match:submit`
|
|
424
494
|
* scope via OAuth (unless your API key has the
|
|
425
|
-
* `match:submit:trusted` scope, which skips per-player consent).
|
|
495
|
+
* `user:match:submit:trusted` scope, which skips per-player consent).
|
|
426
496
|
*
|
|
427
497
|
* Set `batch.dryRun = true` to validate without persisting.
|
|
428
498
|
*
|
|
@@ -449,6 +519,30 @@ declare class MatchesResource {
|
|
|
449
519
|
* ```
|
|
450
520
|
*/
|
|
451
521
|
submit(batch: MatchBatch): Promise<MatchBatchResult>;
|
|
522
|
+
/**
|
|
523
|
+
* Import tournament results.
|
|
524
|
+
*
|
|
525
|
+
* The request body is a free-form JSON object whose structure is
|
|
526
|
+
* defined by the Vairified tournament import schema. Set
|
|
527
|
+
* `body.dryRun = true` to validate without persisting.
|
|
528
|
+
*
|
|
529
|
+
* @param body - Tournament import payload.
|
|
530
|
+
* @returns {@link TournamentImportResult} with match/game counts.
|
|
531
|
+
* @category Matches
|
|
532
|
+
*
|
|
533
|
+
* @example
|
|
534
|
+
* ```ts
|
|
535
|
+
* const result = await client.matches.tournamentImport({
|
|
536
|
+
* sport: 'pickleball',
|
|
537
|
+
* tournamentName: 'Spring Classic',
|
|
538
|
+
* matches: [...],
|
|
539
|
+
* });
|
|
540
|
+
* if (result.ok) {
|
|
541
|
+
* console.log(`Imported ${result.matchesImported} matches`);
|
|
542
|
+
* }
|
|
543
|
+
* ```
|
|
544
|
+
*/
|
|
545
|
+
tournamentImport(body: Record<string, unknown>): Promise<TournamentImportResult>;
|
|
452
546
|
/** Send a test payload to a webhook URL. */
|
|
453
547
|
testWebhook(webhookUrl: string): Promise<Record<string, unknown>>;
|
|
454
548
|
}
|
|
@@ -711,13 +805,38 @@ declare class MembersResource {
|
|
|
711
805
|
* ```
|
|
712
806
|
*/
|
|
713
807
|
find(name: string): Promise<Member | null>;
|
|
808
|
+
/**
|
|
809
|
+
* Fetch up to 100 members by their member IDs in one call.
|
|
810
|
+
*
|
|
811
|
+
* Unknown IDs are silently omitted — the returned array may be
|
|
812
|
+
* shorter than the input. Results are returned in the same order
|
|
813
|
+
* as the input IDs.
|
|
814
|
+
*
|
|
815
|
+
* @param ids - Array of integer member IDs (max 100).
|
|
816
|
+
* @param options - Optional filters.
|
|
817
|
+
* @param options.sport - Sport code to scope ratings (e.g. `'pickleball'`).
|
|
818
|
+
* @returns Array of {@link Member} instances.
|
|
819
|
+
* @throws {@link ValidationError} If more than 100 IDs are provided.
|
|
820
|
+
* @category Members
|
|
821
|
+
*
|
|
822
|
+
* @example
|
|
823
|
+
* ```ts
|
|
824
|
+
* const members = await client.members.getBulk([4873327, 4873328]);
|
|
825
|
+
* for (const m of members) {
|
|
826
|
+
* console.log(m.name, m.ratingFor('pickleball'));
|
|
827
|
+
* }
|
|
828
|
+
* ```
|
|
829
|
+
*/
|
|
830
|
+
getBulk(ids: number[], options?: {
|
|
831
|
+
sport?: string;
|
|
832
|
+
}): Promise<Member[]>;
|
|
714
833
|
/**
|
|
715
834
|
* Poll for rating change notifications.
|
|
716
835
|
*
|
|
717
836
|
* Returns a list of {@link RatingUpdate} objects for every player
|
|
718
837
|
* whose rating has changed since the last poll. Members are
|
|
719
838
|
* considered subscribed when they have an active OAuth connection
|
|
720
|
-
* with the `webhook:subscribe` scope.
|
|
839
|
+
* with the `user:webhook:subscribe` scope.
|
|
721
840
|
*/
|
|
722
841
|
ratingUpdates(): Promise<readonly RatingUpdate[]>;
|
|
723
842
|
}
|
|
@@ -739,13 +858,13 @@ declare class MembersResource {
|
|
|
739
858
|
* lets TypeScript catch typos at authoring time:
|
|
740
859
|
*
|
|
741
860
|
* ```ts
|
|
742
|
-
* const scopes: OAuthScope[] = ['profile:read', 'rating:read']; // ok
|
|
743
|
-
* const bad: OAuthScope[] = ['profile:read', 'rating']; // type error
|
|
861
|
+
* const scopes: OAuthScope[] = ['user:profile:read', 'user:rating:read']; // ok
|
|
862
|
+
* const bad: OAuthScope[] = ['user:profile:read', 'rating']; // type error
|
|
744
863
|
* ```
|
|
745
864
|
*
|
|
746
865
|
* @category OAuth
|
|
747
866
|
*/
|
|
748
|
-
type OAuthScope = 'profile:read' | 'profile:email' | 'rating:read' | 'rating:history' | 'match:submit' | 'webhook:subscribe';
|
|
867
|
+
type OAuthScope = 'user:profile:read' | 'user:profile:email' | 'user:rating:read' | 'user:rating:history' | 'user:match:submit' | 'user:webhook:subscribe';
|
|
749
868
|
/**
|
|
750
869
|
* Human-readable description for every OAuth scope.
|
|
751
870
|
*
|
|
@@ -892,6 +1011,93 @@ declare class OAuthResource {
|
|
|
892
1011
|
}[]>;
|
|
893
1012
|
}
|
|
894
1013
|
|
|
1014
|
+
/**
|
|
1015
|
+
* {@link WebhookDelivery} and {@link WebhookDeliveriesResult} — webhook
|
|
1016
|
+
* delivery inspection models.
|
|
1017
|
+
*
|
|
1018
|
+
* @module
|
|
1019
|
+
*/
|
|
1020
|
+
|
|
1021
|
+
/**
|
|
1022
|
+
* A single webhook delivery attempt.
|
|
1023
|
+
*
|
|
1024
|
+
* @category Webhooks
|
|
1025
|
+
*/
|
|
1026
|
+
declare class WebhookDelivery {
|
|
1027
|
+
readonly id: string;
|
|
1028
|
+
readonly event: string;
|
|
1029
|
+
readonly url: string;
|
|
1030
|
+
readonly statusCode: number | null;
|
|
1031
|
+
readonly responseBody: string | null;
|
|
1032
|
+
readonly errorMessage: string | null;
|
|
1033
|
+
readonly attempts: number;
|
|
1034
|
+
readonly maxAttempts: number;
|
|
1035
|
+
readonly lastAttemptAt: string;
|
|
1036
|
+
readonly nextRetryAt: string | null;
|
|
1037
|
+
readonly completedAt: string | null;
|
|
1038
|
+
readonly createdAt: string;
|
|
1039
|
+
readonly payload: Readonly<Record<string, unknown>>;
|
|
1040
|
+
/** @internal */
|
|
1041
|
+
constructor(wire: WebhookDeliveryWire);
|
|
1042
|
+
/** Whether delivery completed successfully (2xx status). */
|
|
1043
|
+
get succeeded(): boolean;
|
|
1044
|
+
/** Whether delivery failed definitively (completed with non-2xx). */
|
|
1045
|
+
get failed(): boolean;
|
|
1046
|
+
}
|
|
1047
|
+
/**
|
|
1048
|
+
* Paginated list of webhook delivery attempts.
|
|
1049
|
+
*
|
|
1050
|
+
* @category Webhooks
|
|
1051
|
+
*/
|
|
1052
|
+
declare class WebhookDeliveriesResult {
|
|
1053
|
+
readonly deliveries: readonly WebhookDelivery[];
|
|
1054
|
+
readonly total: number;
|
|
1055
|
+
/** @internal */
|
|
1056
|
+
constructor(wire: WebhookDeliveriesResultWire);
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
/**
|
|
1060
|
+
* {@link WebhooksResource} — webhook delivery inspection.
|
|
1061
|
+
*
|
|
1062
|
+
* @module
|
|
1063
|
+
*/
|
|
1064
|
+
|
|
1065
|
+
/**
|
|
1066
|
+
* Webhook delivery inspection.
|
|
1067
|
+
*
|
|
1068
|
+
* @category Resources
|
|
1069
|
+
*/
|
|
1070
|
+
declare class WebhooksResource {
|
|
1071
|
+
#private;
|
|
1072
|
+
/** @internal */
|
|
1073
|
+
constructor(http: HttpTransport);
|
|
1074
|
+
/**
|
|
1075
|
+
* List recent webhook delivery attempts.
|
|
1076
|
+
*
|
|
1077
|
+
* @param options - Optional filters and pagination.
|
|
1078
|
+
* @param options.event - Filter by event type (e.g. `'rating.updated'`).
|
|
1079
|
+
* @param options.status - Filter: `'all'`, `'pending'`, `'success'`, or `'failed'`.
|
|
1080
|
+
* @param options.limit - Results per page (1-100, default 20).
|
|
1081
|
+
* @param options.offset - Pagination offset.
|
|
1082
|
+
* @returns {@link WebhookDeliveriesResult} with entries and total.
|
|
1083
|
+
* @category Webhooks
|
|
1084
|
+
*
|
|
1085
|
+
* @example
|
|
1086
|
+
* ```ts
|
|
1087
|
+
* const result = await client.webhooks.deliveries({ status: 'failed' });
|
|
1088
|
+
* for (const d of result.deliveries) {
|
|
1089
|
+
* console.log(d.event, d.statusCode, d.errorMessage);
|
|
1090
|
+
* }
|
|
1091
|
+
* ```
|
|
1092
|
+
*/
|
|
1093
|
+
deliveries(options?: {
|
|
1094
|
+
event?: string;
|
|
1095
|
+
status?: 'all' | 'pending' | 'success' | 'failed';
|
|
1096
|
+
limit?: number;
|
|
1097
|
+
offset?: number;
|
|
1098
|
+
}): Promise<WebhookDeliveriesResult>;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
895
1101
|
/**
|
|
896
1102
|
* {@link Vairified} — the main entry point of the SDK.
|
|
897
1103
|
*
|
|
@@ -955,6 +1161,8 @@ declare class Vairified {
|
|
|
955
1161
|
readonly oauth: OAuthResource;
|
|
956
1162
|
/** Leaderboard queries — list, rank, categories. */
|
|
957
1163
|
readonly leaderboard: LeaderboardResource;
|
|
1164
|
+
/** Webhook delivery inspection — deliveries. */
|
|
1165
|
+
readonly webhooks: WebhooksResource;
|
|
958
1166
|
constructor(options?: VairifiedOptions);
|
|
959
1167
|
/**
|
|
960
1168
|
* API usage statistics for the current API key.
|
|
@@ -1053,4 +1261,4 @@ declare class OAuthError extends VairifiedError {
|
|
|
1053
1261
|
constructor(message?: string, errorCode?: string, response?: unknown);
|
|
1054
1262
|
}
|
|
1055
1263
|
|
|
1056
|
-
export { type ApiErrorResponse, AuthenticationError, type AuthorizationResponse, DEFAULT_SCOPES, ENVIRONMENTS, type GameInput, type Gender, type LeaderboardOptions, LeaderboardResource, type MatchBatch, MatchBatchResult, type MatchBatchResultWire, type MatchInput, MatchesResource, Member, MemberSportMap, type MemberStatusWire, MembersResource, NotFoundError, type OAuthConfig, OAuthError, OAuthResource, type OAuthScope, type PartnerMemberWire, type PartnerRatingUpdateWire, type PlayerRankOptions, RateLimitError, type RatingSplitWire, RatingUpdate, SCOPES, type SearchFilters, SportRating, type SportRatingWire, type TokenResponse, Vairified, type VairifiedEnvironment, VairifiedError, type VairifiedOptions, ValidationError, describeScope, describeScopes, generateState, getAuthorizationUrl, validateScope };
|
|
1264
|
+
export { type ApiErrorResponse, AuthenticationError, type AuthorizationResponse, DEFAULT_SCOPES, ENVIRONMENTS, type GameInput, type Gender, type LeaderboardOptions, LeaderboardResource, type MatchBatch, MatchBatchResult, type MatchBatchResultWire, type MatchInput, MatchesResource, Member, MemberSportMap, type MemberStatusWire, MembersResource, NotFoundError, type OAuthConfig, OAuthError, OAuthResource, type OAuthScope, type PartnerMemberWire, type PartnerRatingUpdateWire, type PlayerRankOptions, RateLimitError, type RatingSplitWire, RatingUpdate, SCOPES, type SearchFilters, SportRating, type SportRatingWire, type TokenResponse, TournamentImportResult, type TournamentImportResultWire, Vairified, type VairifiedEnvironment, VairifiedError, type VairifiedOptions, ValidationError, WebhookDeliveriesResult, type WebhookDeliveriesResultWire, WebhookDelivery, type WebhookDeliveryWire, WebhooksResource, describeScope, describeScopes, generateState, getAuthorizationUrl, validateScope };
|