dupr-js-client 2.6.0 → 2.6.1

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.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ export { CLUB_REGISTRATION_FORM_URL, ClubRegistrationFormParams, DUPR_DASHBOARD_BASE_URLS, US_STATE_FORM_IDS, buildClubRegistrationFormUrl, getDuprClubDashboardUrl } from './utils.js';
2
+
1
3
  type AuthMode = {
2
4
  type: "clientCredentials";
3
5
  clientKey: string;
@@ -634,64 +636,4 @@ declare class ServerError extends DuprApiError {
634
636
  constructor(message: string, statusCode: number, details?: unknown, duprRequestId?: string);
635
637
  }
636
638
 
637
- /**
638
- * DUPR dashboard base URLs for UAT and production environments.
639
- * Use these when constructing links to the DUPR member-facing dashboard.
640
- */
641
- declare const DUPR_DASHBOARD_BASE_URLS: {
642
- readonly uat: "https://uat.dupr.gg";
643
- readonly production: "https://dashboard.dupr.com";
644
- };
645
- /**
646
- * Build a deep link to a DUPR club's dashboard page.
647
- *
648
- * @param clubId - The DUPR club ID (string or numeric — both accepted).
649
- * @param baseUrl - DUPR dashboard base URL (use {@link DUPR_DASHBOARD_BASE_URLS}).
650
- */
651
- declare function getDuprClubDashboardUrl(clubId: string | number, baseUrl: string): string;
652
- /** The Monday.com form URL DUPR uses for club / association registration applications. */
653
- declare const CLUB_REGISTRATION_FORM_URL = "https://forms.monday.com/forms/8a84c380b2eb4f7552401ed59b199f5d";
654
- /**
655
- * Monday.com form option IDs for US states / territories.
656
- * The value `1` (used as the fallback) maps to INTERNATIONAL.
657
- */
658
- declare const US_STATE_FORM_IDS: Record<string, number>;
659
- /** Parameters for {@link buildClubRegistrationFormUrl}. */
660
- interface ClubRegistrationFormParams {
661
- /** Applicant's full display name. */
662
- userName: string;
663
- /** Applicant's DUPR ID. */
664
- duprId: string;
665
- /** Applicant's email address. */
666
- email: string;
667
- /** Name of the group or club being registered. */
668
- groupName: string;
669
- /** Current member count. */
670
- memberCount: number;
671
- streetAddress?: string | null;
672
- city?: string | null;
673
- /**
674
- * US state name (e.g. `"California"`). Mapped to the Monday.com form option ID via
675
- * {@link US_STATE_FORM_IDS}. Only used when `country === "United States"`.
676
- */
677
- state?: string | null;
678
- zip?: string | null;
679
- country?: string | null;
680
- /**
681
- * How the applicant heard about DUPR — pre-fills the "How did you hear about us?" field.
682
- * Defaults to `"DUPR Partner App"`.
683
- */
684
- referralSource?: string;
685
- /**
686
- * Additional context pre-filled in the form's long-text field.
687
- * Defaults to a generic "we want to submit matches to DUPR" message.
688
- */
689
- additionalInfo?: string;
690
- }
691
- /**
692
- * Build a pre-filled DUPR club registration form URL (Monday.com).
693
- * Opens the DUPR club application form with the provided details already filled in.
694
- */
695
- declare function buildClubRegistrationFormUrl(params: ClubRegistrationFormParams): string;
696
-
697
- export { type ApiStatus, type ApiWrapper, type AttributionRequest, type AuthCodeTokenResponse, type AuthMode, AuthModule, AuthenticationError, type AuthorizationUrlParams, CLUB_REGISTRATION_FORM_URL, type ClientHookRequest, type ClubMembership, type ClubMembershipResponse, type ClubRegistrationFormParams, ClubsModule, type CreateEventRequestV1, type CreateEventResponseV1, type CreateProvisionalRatingRequest, DUPR_DASHBOARD_BASE_URLS, type DeleteEventRequestV1, type DeleteEventResponseV1, type DeleteProvisionalRatingRequest, DuprApiError, DuprClient, type DuprClientOptions, EventsModule, type ExtendedUserInfo, type ExternalAgeRangeFilter, type ExternalBatchUserDetailRequest, type ExternalClubMatchSearchRequest, type ExternalClubMemberRequest, type ExternalDeleteMatchRequest, type ExternalFilterLocation, type ExternalInviteRequest, type ExternalMatchRequest, type ExternalMatchSearchRequest, type ExternalMatchTeam, type ExternalRatingFilter, type ExternalSearchFilter, type ExternalSearchRequest, type ExternalUpdateMatchRequest, type Gender, type GetEventRequestV1, type GetEventResponseV1, type GetProvisionalRatingRequest, type GrantExternalSubscriptionRequest, type MatchCompletionType, type MatchFormat, type MatchPlayType, type MatchResponse, type MatchSource, type MatchType, MatchesModule, NotFoundError, PlayerRatingModule, type PlayerRatingSubscribeRequest, PlayersModule, RateLimitError, type RatingCoach, type RatingType, type RequestInfo, type ResolvedConfig, type ResolvedRetryOptions, type ResponseInfo, type RetryOptions, ServerError, type SsoTokenResponse, type SubscriptionItemRequest, type TargetUserRequest, type TokenResponse, US_STATE_FORM_IDS, type UpdateEventRequestV1, type UpdateEventResponseV1, type UpdateProvisionalRatingRequest, type UserClubMembership, type UserClubMembershipResponse, type UserInfo, type UserWebhookRequest, UsersModule, ValidationError, type WebhookSchema, type WebhookTopic, WebhooksModule, buildClubRegistrationFormUrl, getDuprClubDashboardUrl };
639
+ export { type ApiStatus, type ApiWrapper, type AttributionRequest, type AuthCodeTokenResponse, type AuthMode, AuthModule, AuthenticationError, type AuthorizationUrlParams, type ClientHookRequest, type ClubMembership, type ClubMembershipResponse, ClubsModule, type CreateEventRequestV1, type CreateEventResponseV1, type CreateProvisionalRatingRequest, type DeleteEventRequestV1, type DeleteEventResponseV1, type DeleteProvisionalRatingRequest, DuprApiError, DuprClient, type DuprClientOptions, EventsModule, type ExtendedUserInfo, type ExternalAgeRangeFilter, type ExternalBatchUserDetailRequest, type ExternalClubMatchSearchRequest, type ExternalClubMemberRequest, type ExternalDeleteMatchRequest, type ExternalFilterLocation, type ExternalInviteRequest, type ExternalMatchRequest, type ExternalMatchSearchRequest, type ExternalMatchTeam, type ExternalRatingFilter, type ExternalSearchFilter, type ExternalSearchRequest, type ExternalUpdateMatchRequest, type Gender, type GetEventRequestV1, type GetEventResponseV1, type GetProvisionalRatingRequest, type GrantExternalSubscriptionRequest, type MatchCompletionType, type MatchFormat, type MatchPlayType, type MatchResponse, type MatchSource, type MatchType, MatchesModule, NotFoundError, PlayerRatingModule, type PlayerRatingSubscribeRequest, PlayersModule, RateLimitError, type RatingCoach, type RatingType, type RequestInfo, type ResolvedConfig, type ResolvedRetryOptions, type ResponseInfo, type RetryOptions, ServerError, type SsoTokenResponse, type SubscriptionItemRequest, type TargetUserRequest, type TokenResponse, type UpdateEventRequestV1, type UpdateEventResponseV1, type UpdateProvisionalRatingRequest, type UserClubMembership, type UserClubMembershipResponse, type UserInfo, type UserWebhookRequest, UsersModule, ValidationError, type WebhookSchema, type WebhookTopic, WebhooksModule };
@@ -0,0 +1,61 @@
1
+ /**
2
+ * DUPR dashboard base URLs for UAT and production environments.
3
+ * Use these when constructing links to the DUPR member-facing dashboard.
4
+ */
5
+ declare const DUPR_DASHBOARD_BASE_URLS: {
6
+ readonly uat: "https://uat.dupr.gg";
7
+ readonly production: "https://dashboard.dupr.com";
8
+ };
9
+ /**
10
+ * Build a deep link to a DUPR club's dashboard page.
11
+ *
12
+ * @param clubId - The DUPR club ID (string or numeric — both accepted).
13
+ * @param baseUrl - DUPR dashboard base URL (use {@link DUPR_DASHBOARD_BASE_URLS}).
14
+ */
15
+ declare function getDuprClubDashboardUrl(clubId: string | number, baseUrl: string): string;
16
+ /** The Monday.com form URL DUPR uses for club / association registration applications. */
17
+ declare const CLUB_REGISTRATION_FORM_URL = "https://forms.monday.com/forms/8a84c380b2eb4f7552401ed59b199f5d";
18
+ /**
19
+ * Monday.com form option IDs for US states / territories.
20
+ * The value `1` (used as the fallback) maps to INTERNATIONAL.
21
+ */
22
+ declare const US_STATE_FORM_IDS: Record<string, number>;
23
+ /** Parameters for {@link buildClubRegistrationFormUrl}. */
24
+ interface ClubRegistrationFormParams {
25
+ /** Applicant's full display name. */
26
+ userName: string;
27
+ /** Applicant's DUPR ID. */
28
+ duprId: string;
29
+ /** Applicant's email address. */
30
+ email: string;
31
+ /** Name of the group or club being registered. */
32
+ groupName: string;
33
+ /** Current member count. */
34
+ memberCount: number;
35
+ streetAddress?: string | null;
36
+ city?: string | null;
37
+ /**
38
+ * US state name (e.g. `"California"`). Mapped to the Monday.com form option ID via
39
+ * {@link US_STATE_FORM_IDS}. Only used when `country === "United States"`.
40
+ */
41
+ state?: string | null;
42
+ zip?: string | null;
43
+ country?: string | null;
44
+ /**
45
+ * How the applicant heard about DUPR — pre-fills the "How did you hear about us?" field.
46
+ * Defaults to `"DUPR Partner App"`.
47
+ */
48
+ referralSource?: string;
49
+ /**
50
+ * Additional context pre-filled in the form's long-text field.
51
+ * Defaults to a generic "we want to submit matches to DUPR" message.
52
+ */
53
+ additionalInfo?: string;
54
+ }
55
+ /**
56
+ * Build a pre-filled DUPR club registration form URL (Monday.com).
57
+ * Opens the DUPR club application form with the provided details already filled in.
58
+ */
59
+ declare function buildClubRegistrationFormUrl(params: ClubRegistrationFormParams): string;
60
+
61
+ export { CLUB_REGISTRATION_FORM_URL, type ClubRegistrationFormParams, DUPR_DASHBOARD_BASE_URLS, US_STATE_FORM_IDS, buildClubRegistrationFormUrl, getDuprClubDashboardUrl };
package/dist/utils.js ADDED
@@ -0,0 +1,96 @@
1
+ // src/utils.ts
2
+ var DUPR_DASHBOARD_BASE_URLS = {
3
+ uat: "https://uat.dupr.gg",
4
+ production: "https://dashboard.dupr.com"
5
+ };
6
+ function getDuprClubDashboardUrl(clubId, baseUrl) {
7
+ return `${baseUrl}/dashboard/browse/clubs/${clubId}`;
8
+ }
9
+ var CLUB_REGISTRATION_FORM_URL = "https://forms.monday.com/forms/8a84c380b2eb4f7552401ed59b199f5d";
10
+ var US_STATE_FORM_IDS = {
11
+ Alabama: 2,
12
+ Alaska: 3,
13
+ Arizona: 4,
14
+ Arkansas: 5,
15
+ California: 6,
16
+ Colorado: 7,
17
+ Connecticut: 8,
18
+ Delaware: 9,
19
+ "District of Columbia": 10,
20
+ Florida: 11,
21
+ Georgia: 12,
22
+ Hawaii: 13,
23
+ Idaho: 14,
24
+ Illinois: 15,
25
+ Indiana: 16,
26
+ Iowa: 17,
27
+ Kansas: 18,
28
+ Kentucky: 19,
29
+ Louisiana: 20,
30
+ Maine: 21,
31
+ Maryland: 22,
32
+ Massachusetts: 23,
33
+ Michigan: 24,
34
+ Minnesota: 25,
35
+ Mississippi: 26,
36
+ Missouri: 27,
37
+ Montana: 28,
38
+ Nebraska: 29,
39
+ Nevada: 30,
40
+ "New Hampshire": 31,
41
+ "New Jersey": 32,
42
+ "New Mexico": 33,
43
+ "New York": 34,
44
+ "North Carolina": 35,
45
+ "North Dakota": 36,
46
+ Ohio: 37,
47
+ Oklahoma: 38,
48
+ Oregon: 39,
49
+ Pennsylvania: 40,
50
+ "Rhode Island": 41,
51
+ "South Carolina": 42,
52
+ "South Dakota": 43,
53
+ Tennessee: 44,
54
+ Texas: 45,
55
+ Utah: 46,
56
+ Vermont: 47,
57
+ Virginia: 48,
58
+ Washington: 49,
59
+ "West Virginia": 50,
60
+ Wisconsin: 52,
61
+ Wyoming: 53
62
+ };
63
+ function resolveStateFormId(state, country) {
64
+ if (!country || country !== "United States") return "1";
65
+ return String(US_STATE_FORM_IDS[state ?? ""] ?? 1);
66
+ }
67
+ function buildClubRegistrationFormUrl(params) {
68
+ const url = new URL(CLUB_REGISTRATION_FORM_URL);
69
+ url.searchParams.set("r", "use1");
70
+ url.searchParams.set("short_text", params.userName);
71
+ url.searchParams.set("text49", params.duprId);
72
+ url.searchParams.set("short_text8", params.streetAddress ?? "");
73
+ url.searchParams.set("dup__of_location72", params.city ?? "");
74
+ url.searchParams.set("short_text98__1", params.zip ?? "");
75
+ url.searchParams.set("country", params.country ?? "");
76
+ url.searchParams.set("multi_select3", resolveStateFormId(params.state, params.country));
77
+ url.searchParams.set("dup__of_email2", params.email);
78
+ url.searchParams.set("name", params.groupName);
79
+ url.searchParams.set("numbers7", String(params.memberCount));
80
+ url.searchParams.set("dup__of_facility", "0");
81
+ url.searchParams.set("multi_select6", "1");
82
+ url.searchParams.set("multi_select", "19");
83
+ url.searchParams.set(
84
+ "text9",
85
+ params.referralSource ?? "DUPR Partner App"
86
+ );
87
+ url.searchParams.set(
88
+ "long_text2",
89
+ params.additionalInfo ?? "We want to submit our matches to DUPR. Let me know if any other information is needed."
90
+ );
91
+ return url.toString();
92
+ }
93
+
94
+ export { CLUB_REGISTRATION_FORM_URL, DUPR_DASHBOARD_BASE_URLS, US_STATE_FORM_IDS, buildClubRegistrationFormUrl, getDuprClubDashboardUrl };
95
+ //# sourceMappingURL=utils.js.map
96
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils.ts"],"names":[],"mappings":";AAIO,IAAM,wBAAA,GAA2B;AAAA,EACtC,GAAA,EAAK,qBAAA;AAAA,EACL,UAAA,EAAY;AACd;AAQO,SAAS,uBAAA,CAAwB,QAAyB,OAAA,EAAyB;AACxF,EAAA,OAAO,CAAA,EAAG,OAAO,CAAA,wBAAA,EAA2B,MAAM,CAAA,CAAA;AACpD;AAKO,IAAM,0BAAA,GACX;AAMK,IAAM,iBAAA,GAA4C;AAAA,EACvD,OAAA,EAAS,CAAA;AAAA,EACT,MAAA,EAAQ,CAAA;AAAA,EACR,OAAA,EAAS,CAAA;AAAA,EACT,QAAA,EAAU,CAAA;AAAA,EACV,UAAA,EAAY,CAAA;AAAA,EACZ,QAAA,EAAU,CAAA;AAAA,EACV,WAAA,EAAa,CAAA;AAAA,EACb,QAAA,EAAU,CAAA;AAAA,EACV,sBAAA,EAAwB,EAAA;AAAA,EACxB,OAAA,EAAS,EAAA;AAAA,EACT,OAAA,EAAS,EAAA;AAAA,EACT,MAAA,EAAQ,EAAA;AAAA,EACR,KAAA,EAAO,EAAA;AAAA,EACP,QAAA,EAAU,EAAA;AAAA,EACV,OAAA,EAAS,EAAA;AAAA,EACT,IAAA,EAAM,EAAA;AAAA,EACN,MAAA,EAAQ,EAAA;AAAA,EACR,QAAA,EAAU,EAAA;AAAA,EACV,SAAA,EAAW,EAAA;AAAA,EACX,KAAA,EAAO,EAAA;AAAA,EACP,QAAA,EAAU,EAAA;AAAA,EACV,aAAA,EAAe,EAAA;AAAA,EACf,QAAA,EAAU,EAAA;AAAA,EACV,SAAA,EAAW,EAAA;AAAA,EACX,WAAA,EAAa,EAAA;AAAA,EACb,QAAA,EAAU,EAAA;AAAA,EACV,OAAA,EAAS,EAAA;AAAA,EAC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S;AACtB","file":"utils.js","sourcesContent":["/**\n * DUPR dashboard base URLs for UAT and production environments.\n * Use these when constructing links to the DUPR member-facing dashboard.\n */\nexport const DUPR_DASHBOARD_BASE_URLS = {\n uat: 'https://uat.dupr.gg',\n production: 'https://dashboard.dupr.com',\n} as const;\n\n/**\n * Build a deep link to a DUPR club's dashboard page.\n *\n * @param clubId - The DUPR club ID (string or numeric — both accepted).\n * @param baseUrl - DUPR dashboard base URL (use {@link DUPR_DASHBOARD_BASE_URLS}).\n */\nexport function getDuprClubDashboardUrl(clubId: string | number, baseUrl: string): string {\n return `${baseUrl}/dashboard/browse/clubs/${clubId}`;\n}\n\n// ─── Club registration form ───────────────────────────────────────────────────\n\n/** The Monday.com form URL DUPR uses for club / association registration applications. */\nexport const CLUB_REGISTRATION_FORM_URL =\n 'https://forms.monday.com/forms/8a84c380b2eb4f7552401ed59b199f5d';\n\n/**\n * Monday.com form option IDs for US states / territories.\n * The value `1` (used as the fallback) maps to INTERNATIONAL.\n */\nexport const US_STATE_FORM_IDS: Record<string, number> = {\n Alabama: 2,\n Alaska: 3,\n Arizona: 4,\n Arkansas: 5,\n California: 6,\n Colorado: 7,\n Connecticut: 8,\n Delaware: 9,\n 'District of Columbia': 10,\n Florida: 11,\n Georgia: 12,\n Hawaii: 13,\n Idaho: 14,\n Illinois: 15,\n Indiana: 16,\n Iowa: 17,\n Kansas: 18,\n Kentucky: 19,\n Louisiana: 20,\n Maine: 21,\n Maryland: 22,\n Massachusetts: 23,\n Michigan: 24,\n Minnesota: 25,\n Mississippi: 26,\n Missouri: 27,\n Montana: 28,\n Nebraska: 29,\n Nevada: 30,\n 'New Hampshire': 31,\n 'New Jersey': 32,\n 'New Mexico': 33,\n 'New York': 34,\n 'North Carolina': 35,\n 'North Dakota': 36,\n Ohio: 37,\n Oklahoma: 38,\n Oregon: 39,\n Pennsylvania: 40,\n 'Rhode Island': 41,\n 'South Carolina': 42,\n 'South Dakota': 43,\n Tennessee: 44,\n Texas: 45,\n Utah: 46,\n Vermont: 47,\n Virginia: 48,\n Washington: 49,\n 'West Virginia': 50,\n Wisconsin: 52,\n Wyoming: 53,\n};\n\n/** Parameters for {@link buildClubRegistrationFormUrl}. */\nexport interface ClubRegistrationFormParams {\n /** Applicant's full display name. */\n userName: string;\n /** Applicant's DUPR ID. */\n duprId: string;\n /** Applicant's email address. */\n email: string;\n /** Name of the group or club being registered. */\n groupName: string;\n /** Current member count. */\n memberCount: number;\n streetAddress?: string | null;\n city?: string | null;\n /**\n * US state name (e.g. `\"California\"`). Mapped to the Monday.com form option ID via\n * {@link US_STATE_FORM_IDS}. Only used when `country === \"United States\"`.\n */\n state?: string | null;\n zip?: string | null;\n country?: string | null;\n /**\n * How the applicant heard about DUPR — pre-fills the \"How did you hear about us?\" field.\n * Defaults to `\"DUPR Partner App\"`.\n */\n referralSource?: string;\n /**\n * Additional context pre-filled in the form's long-text field.\n * Defaults to a generic \"we want to submit matches to DUPR\" message.\n */\n additionalInfo?: string;\n}\n\nfunction resolveStateFormId(\n state: string | null | undefined,\n country: string | null | undefined,\n): string {\n if (!country || country !== 'United States') return '1'; // INTERNATIONAL\n return String(US_STATE_FORM_IDS[state ?? ''] ?? 1);\n}\n\n/**\n * Build a pre-filled DUPR club registration form URL (Monday.com).\n * Opens the DUPR club application form with the provided details already filled in.\n */\nexport function buildClubRegistrationFormUrl(params: ClubRegistrationFormParams): string {\n const url = new URL(CLUB_REGISTRATION_FORM_URL);\n url.searchParams.set('r', 'use1');\n url.searchParams.set('short_text', params.userName);\n url.searchParams.set('text49', params.duprId);\n url.searchParams.set('short_text8', params.streetAddress ?? '');\n url.searchParams.set('dup__of_location72', params.city ?? '');\n url.searchParams.set('short_text98__1', params.zip ?? '');\n url.searchParams.set('country', params.country ?? '');\n url.searchParams.set('multi_select3', resolveStateFormId(params.state, params.country));\n url.searchParams.set('dup__of_email2', params.email);\n url.searchParams.set('name', params.groupName);\n url.searchParams.set('numbers7', String(params.memberCount));\n url.searchParams.set('dup__of_facility', '0'); // Club Type = Group / Association\n url.searchParams.set('multi_select6', '1'); // Communication = Email\n url.searchParams.set('multi_select', '19'); // Intent = Add matches\n url.searchParams.set(\n 'text9',\n params.referralSource ?? 'DUPR Partner App',\n );\n url.searchParams.set(\n 'long_text2',\n params.additionalInfo ??\n 'We want to submit our matches to DUPR. Let me know if any other information is needed.',\n );\n return url.toString();\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dupr-js-client",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "description": "A comprehensive TypeScript/JavaScript client for the DUPR (Dynamic Universal Pickleball Rating) API.",
5
5
  "license": "MIT",
6
6
  "author": "Sunny Tambi",
@@ -12,6 +12,10 @@
12
12
  ".": {
13
13
  "types": "./dist/index.d.ts",
14
14
  "default": "./dist/index.js"
15
+ },
16
+ "./utils": {
17
+ "types": "./dist/utils.d.ts",
18
+ "default": "./dist/utils.js"
15
19
  }
16
20
  },
17
21
  "files": [