@wefunder/sdk 0.1.0-beta.3 → 0.1.0-beta.5

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.cts CHANGED
@@ -1,6 +1,8 @@
1
- /** Host for the browser /authorize redirect. Stays on wefunder.com. */
1
+ /** Host for the LIVE browser /authorize redirect (pk_live_ / default). */
2
2
  declare const DEFAULT_AUTHORIZE_BASE_URL = "https://wefunder.com/oauth";
3
- declare const DEFAULT_TOKEN_BASE_URL = "https://wefunder.com/oauth";
3
+ /** Host for the SANDBOX browser /authorize redirect (pk_test_). Canonical, client_id-derivable. */
4
+ declare const SANDBOX_AUTHORIZE_BASE_URL = "https://oauth.wefunder-sandbox.com/oauth";
5
+ declare const DEFAULT_TOKEN_BASE_URL = "https://api.wefunder.com/oauth";
4
6
  /**
5
7
  * @deprecated Use `authorizeBaseUrl` / `tokenBaseUrl` instead. Kept as a convenience
6
8
  * alias that sets BOTH hosts at once. Equals the authorize default today.
@@ -4759,7 +4761,7 @@ declare namespace ops {
4759
4761
 
4760
4762
  /** Documented `sort` values for the offerings list, from the generated op. */
4761
4763
  type OfferingSort = NonNullable<ListOfferingsData["query"]>["sort"];
4762
- declare const DEFAULT_API_BASE_URL = "https://api.wefunder.com/api/v2";
4764
+ declare const DEFAULT_API_BASE_URL = "https://api.wefunder.com";
4763
4765
  declare const DEFAULT_API_VERSION = "2025-01-15";
4764
4766
  type Mode = "live" | "test" | "unknown";
4765
4767
  declare function modeForToken(token: string): Mode;
@@ -4934,4 +4936,4 @@ declare function constructEvent<T = unknown>(payload: string, headers: Headers |
4934
4936
  now?: () => number;
4935
4937
  }): ParsedWebhook<T>;
4936
4938
 
4937
- export { type AnonymizedAttribution, type ApproveSyndicateMemberData, type ApproveSyndicateMemberError, type ApproveSyndicateMemberErrors, type ApproveSyndicateMemberResponse, type ApproveSyndicateMemberResponses, type AttributedInvestmentListEnvelope, type AttributionCampaignAccess, type AttributionCampaignSummary, type AttributionCampaignSummaryListEnvelope, type AttributionMe, type AttributionMeEnvelope, type AttributionPartner, type AttributionStats, type AttributionStatsEnvelope, type AttributionUser, type AuditEvent, type AuditEventListEnvelope, type AuthorizationUrlOptions, type Campaign, type CampaignId, type CampaignListEnvelope, type ClientCredentialsOptions, type ClientOptions, type CloseSyndicateDealData, type CloseSyndicateDealError, type CloseSyndicateDealErrors, type ConnectedApp, type ConnectedAppListEnvelope, type ConnectedAppRevocation, type ConnectedAppRevocationEnvelope, type CreateIntentData, type CreateIntentError, type CreateIntentErrors, type CreateIntentResponse, type CreateIntentResponses, type CreatePartnerInviteData, type CreatePartnerInviteError, type CreatePartnerInviteErrors, type CreatePartnerInviteResponse, type CreatePartnerInviteResponses, type CreateWebhookSubscriptionData, type CreateWebhookSubscriptionError, type CreateWebhookSubscriptionErrors, type CreateWebhookSubscriptionResponse, type CreateWebhookSubscriptionResponses, type Cursor, DEFAULT_API_BASE_URL, DEFAULT_API_VERSION, DEFAULT_AUTHORIZE_BASE_URL, DEFAULT_OAUTH_BASE_URL, DEFAULT_TOKEN_BASE_URL, DELIVERY_ID_HEADER, type DealInvestor, type DealInvestorListEnvelope, type DeleteWebhookSubscriptionData, type DeleteWebhookSubscriptionError, type DeleteWebhookSubscriptionErrors, type DeleteWebhookSubscriptionResponse, type DeleteWebhookSubscriptionResponses, type DemoteSyndicateMemberData, type DemoteSyndicateMemberError, type DemoteSyndicateMemberErrors, type DemoteSyndicateMemberResponse, type DemoteSyndicateMemberResponses, EVENT_HEADER, type EndDate, type Error$1 as Error, type ExchangeCodeOptions, type Exemption, type ExportSyndicateMembersCsvData, type ExportSyndicateMembersCsvError, type ExportSyndicateMembersCsvErrors, type ExportSyndicateMembersCsvResponse, type ExportSyndicateMembersCsvResponses, type FinalizeSyndicateDealData, type FinalizeSyndicateDealError, type FinalizeSyndicateDealErrors, type FullAttribution, type FundraiseId, type GetAttributionMeData, type GetAttributionMeError, type GetAttributionMeErrors, type GetAttributionMeResponse, type GetAttributionMeResponses, type GetAttributionStatsData, type GetAttributionStatsError, type GetAttributionStatsErrors, type GetAttributionStatsResponse, type GetAttributionStatsResponses, type GetCurrentUserData, type GetCurrentUserError, type GetCurrentUserErrors, type GetCurrentUserResponse, type GetCurrentUserResponses, type GetIntentData, type GetIntentError, type GetIntentErrors, type GetIntentResponse, type GetIntentResponses, type GetOfferingData, type GetOfferingError, type GetOfferingErrors, type GetOfferingResponse, type GetOfferingResponses, type GetSyndicateData, type GetSyndicateDealData, type GetSyndicateDealError, type GetSyndicateDealErrors, type GetSyndicateDealResponse, type GetSyndicateDealResponses, type GetSyndicateError, type GetSyndicateErrors, type GetSyndicateResponse, type GetSyndicateResponses, type GetSyndicateStatisticsData, type GetSyndicateStatisticsError, type GetSyndicateStatisticsErrors, type GetSyndicateStatisticsResponse, type GetSyndicateStatisticsResponses, type GetWebhookSubscriptionData, type GetWebhookSubscriptionError, type GetWebhookSubscriptionErrors, type GetWebhookSubscriptionResponse, type GetWebhookSubscriptionResponses, type HideSyndicateMemberData, type HideSyndicateMemberError, type HideSyndicateMemberErrors, type HideSyndicateMemberResponse, type HideSyndicateMemberResponses, type IdempotencyKey, type Intent, type IntentEnvelope, type IntentListEnvelope, type Investment, type InvestmentLink, type InvestmentLinkCreateInput, type InvestmentLinkEnvelope, type InvestmentListEnvelope, type InvestmentSession, type InvestmentSessionCreateInput, type InvestmentSessionEnvelope, type InvestmentSessionId, type Investor, type InvestorEnvelope, type InvestorListEnvelope, type Invite, type InviteCreateInput, type InviteEnvelope, type InviteId, type InviteListEnvelope, type InviteSyndicateMemberData, type InviteSyndicateMemberError, type InviteSyndicateMemberErrors, type InviteSyndicateMemberResponse, type InviteSyndicateMemberResponses, type ListActivityData, type ListActivityError, type ListActivityErrors, type ListActivityResponse, type ListActivityResponses, type ListAttributedInvestmentsData, type ListAttributedInvestmentsError, type ListAttributedInvestmentsErrors, type ListAttributedInvestmentsResponse, type ListAttributedInvestmentsResponses, type ListAttributionCampaignsData, type ListAttributionCampaignsError, type ListAttributionCampaignsErrors, type ListAttributionCampaignsResponse, type ListAttributionCampaignsResponses, type ListCampaignsData, type ListCampaignsError, type ListCampaignsErrors, type ListCampaignsResponse, type ListCampaignsResponses, type ListConnectedAppsData, type ListConnectedAppsError, type ListConnectedAppsErrors, type ListConnectedAppsResponse, type ListConnectedAppsResponses, type ListIntentsData, type ListIntentsError, type ListIntentsErrors, type ListIntentsResponse, type ListIntentsResponses, type ListInvestmentsData, type ListInvestmentsError, type ListInvestmentsErrors, type ListInvestmentsResponse, type ListInvestmentsResponses, type ListOfferingsData, type ListOfferingsError, type ListOfferingsErrors, type ListOfferingsResponse, type ListOfferingsResponses, type ListPartnerInvitesData, type ListPartnerInvitesError, type ListPartnerInvitesErrors, type ListPartnerInvitesResponse, type ListPartnerInvitesResponses, type ListSyndicateDealInvestorsData, type ListSyndicateDealInvestorsError, type ListSyndicateDealInvestorsErrors, type ListSyndicateDealInvestorsResponse, type ListSyndicateDealInvestorsResponses, type ListSyndicateDealsData, type ListSyndicateDealsError, type ListSyndicateDealsErrors, type ListSyndicateDealsResponse, type ListSyndicateDealsResponses, type ListSyndicateMemberInvestmentsData, type ListSyndicateMemberInvestmentsError, type ListSyndicateMemberInvestmentsErrors, type ListSyndicateMemberInvestmentsResponse, type ListSyndicateMemberInvestmentsResponses, type ListSyndicateMembersData, type ListSyndicateMembersError, type ListSyndicateMembersErrors, type ListSyndicateMembersResponse, type ListSyndicateMembersResponses, type ListSyndicatesData, type ListSyndicatesError, type ListSyndicatesErrors, type ListSyndicatesResponse, type ListSyndicatesResponses, type ListWebhookSubscriptionsData, type ListWebhookSubscriptionsError, type ListWebhookSubscriptionsErrors, type ListWebhookSubscriptionsResponse, type ListWebhookSubscriptionsResponses, type MarketingPartner, type MarketingPartnerEnvelope, type MemberId, type MemberInvestment, type MemberInvestmentListEnvelope, type Mode, type OAuthHostOptions, type Offering, type OfferingEnvelope, type OfferingListEnvelope, type OfferingSort, type Page, type PageFetcher, type PaginationMeta, type ParsedWebhook, type PartnerInvestment, type PartnerInvestmentEnvelope, type PartnerInvestmentId, type PartnerInvestmentListEnvelope, type PartnerInvite, type PartnerInviteEnvelope, type PartnerInviteListEnvelope, type PartnerWebhookEvent, type PartnerWebhookEventEnvelope, type PartnerWebhookSubscription, type PartnerWebhookSubscriptionCreateInput, type PartnerWebhookSubscriptionEnvelope, type PartnerWebhookSubscriptionListEnvelope, type PartnerWebhookSubscriptionWithSecret, type PartnerWebhookSubscriptionWithSecretEnvelope, type Pkce, type PromoteSyndicateMemberData, type PromoteSyndicateMemberError, type PromoteSyndicateMemberErrors, type PromoteSyndicateMemberResponse, type PromoteSyndicateMemberResponses, REQUEST_ID_HEADER, type ReactivateWebhookSubscriptionData, type ReactivateWebhookSubscriptionError, type ReactivateWebhookSubscriptionErrors, type ReactivateWebhookSubscriptionResponse, type ReactivateWebhookSubscriptionResponses, type RefreshOptions, type RegenerateWebhookSecretData, type RegenerateWebhookSecretError, type RegenerateWebhookSecretErrors, type RegenerateWebhookSecretResponse, type RegenerateWebhookSecretResponses, type RegisterAsPartnerData, type RegisterAsPartnerError, type RegisterAsPartnerErrors, type RegisterAsPartnerResponse, type RegisterAsPartnerResponses, type RemoveSyndicateMemberData, type RemoveSyndicateMemberError, type RemoveSyndicateMemberErrors, type ReorderSyndicateMembersData, type ReorderSyndicateMembersError, type ReorderSyndicateMembersErrors, type ReorderSyndicateMembersResponses, type ResendSyndicateInviteData, type ResendSyndicateInviteError, type ResendSyndicateInviteErrors, type ResendSyndicateInviteResponses, type RestoreSyndicateMemberData, type RestoreSyndicateMemberError, type RestoreSyndicateMemberErrors, type RestoreSyndicateMemberResponse, type RestoreSyndicateMemberResponses, type RevokeConnectedAppData, type RevokeConnectedAppError, type RevokeConnectedAppErrors, type RevokeConnectedAppResponse, type RevokeConnectedAppResponses, type RevokePartnerInviteData, type RevokePartnerInviteError, type RevokePartnerInviteErrors, type RevokePartnerInviteResponse, type RevokePartnerInviteResponses, SIGNATURE_HEADER, type Spv, type SpvCloseStatus, type SpvCloseStatusEnvelope, type SpvCreateInput, type SpvEnvelope, type SpvId, type SpvListEnvelope, type SpvMetrics, type SpvSettings, type SpvTerms, type SpvWithMetaEnvelope, type StartDate, type Syndicate, type SyndicateDeal, type SyndicateDealDetail, type SyndicateDealDetailEnvelope, type SyndicateDealEnvelope, type SyndicateDealListEnvelope, type SyndicateDetail, type SyndicateDetailEnvelope, type SyndicateId, type SyndicateListEnvelope, type SyndicateMember, type SyndicateMemberEnvelope, type SyndicateMemberListEnvelope, type SyndicatePortfolio, type SyndicateStatistics, type SyndicateStatisticsEnvelope, TIMESTAMP_HEADER, type TargetCompanyInput, type TestWebhookSubscriptionData, type TestWebhookSubscriptionError, type TestWebhookSubscriptionErrors, type TestWebhookSubscriptionResponse, type TestWebhookSubscriptionResponses, type TokenManagerOptions, type TokenSet, type TokenStore, type UpdateSyndicateData, type UpdateSyndicateError, type UpdateSyndicateErrors, type UpdateSyndicateMemberData, type UpdateSyndicateMemberError, type UpdateSyndicateMemberErrors, type UpdateSyndicateMemberResponse, type UpdateSyndicateMemberResponses, type UpdateSyndicateResponse, type UpdateSyndicateResponses, type User, type UserEnvelope, type UtmCampaign, type UtmSource, type ValidationError, type VerifyWebhookOptions, type WebhookDelivery, type WebhookId, type WebhookSubscription, type WebhookSubscriptionEnvelope, type WebhookSubscriptionId, type WebhookSubscriptionListEnvelope, type WebhookSubscriptionWithRecentDeliveriesEnvelope, type WebhookSubscriptionWithSecret2Envelope, type WebhookSubscriptionWithSecretEnvelope, type WebhookTestResult, type WebhookTestResultEnvelope, Wefunder, WefunderAuthError, WefunderError, type WefunderOptions, clientCredentialsGrant, collect, constructEvent, createAuthorizationUrl, exchangeCode, generatePkce, modeForToken, paginate, refreshToken, verifyWebhook };
4939
+ export { type AnonymizedAttribution, type ApproveSyndicateMemberData, type ApproveSyndicateMemberError, type ApproveSyndicateMemberErrors, type ApproveSyndicateMemberResponse, type ApproveSyndicateMemberResponses, type AttributedInvestmentListEnvelope, type AttributionCampaignAccess, type AttributionCampaignSummary, type AttributionCampaignSummaryListEnvelope, type AttributionMe, type AttributionMeEnvelope, type AttributionPartner, type AttributionStats, type AttributionStatsEnvelope, type AttributionUser, type AuditEvent, type AuditEventListEnvelope, type AuthorizationUrlOptions, type Campaign, type CampaignId, type CampaignListEnvelope, type ClientCredentialsOptions, type ClientOptions, type CloseSyndicateDealData, type CloseSyndicateDealError, type CloseSyndicateDealErrors, type ConnectedApp, type ConnectedAppListEnvelope, type ConnectedAppRevocation, type ConnectedAppRevocationEnvelope, type CreateIntentData, type CreateIntentError, type CreateIntentErrors, type CreateIntentResponse, type CreateIntentResponses, type CreatePartnerInviteData, type CreatePartnerInviteError, type CreatePartnerInviteErrors, type CreatePartnerInviteResponse, type CreatePartnerInviteResponses, type CreateWebhookSubscriptionData, type CreateWebhookSubscriptionError, type CreateWebhookSubscriptionErrors, type CreateWebhookSubscriptionResponse, type CreateWebhookSubscriptionResponses, type Cursor, DEFAULT_API_BASE_URL, DEFAULT_API_VERSION, DEFAULT_AUTHORIZE_BASE_URL, DEFAULT_OAUTH_BASE_URL, DEFAULT_TOKEN_BASE_URL, DELIVERY_ID_HEADER, type DealInvestor, type DealInvestorListEnvelope, type DeleteWebhookSubscriptionData, type DeleteWebhookSubscriptionError, type DeleteWebhookSubscriptionErrors, type DeleteWebhookSubscriptionResponse, type DeleteWebhookSubscriptionResponses, type DemoteSyndicateMemberData, type DemoteSyndicateMemberError, type DemoteSyndicateMemberErrors, type DemoteSyndicateMemberResponse, type DemoteSyndicateMemberResponses, EVENT_HEADER, type EndDate, type Error$1 as Error, type ExchangeCodeOptions, type Exemption, type ExportSyndicateMembersCsvData, type ExportSyndicateMembersCsvError, type ExportSyndicateMembersCsvErrors, type ExportSyndicateMembersCsvResponse, type ExportSyndicateMembersCsvResponses, type FinalizeSyndicateDealData, type FinalizeSyndicateDealError, type FinalizeSyndicateDealErrors, type FullAttribution, type FundraiseId, type GetAttributionMeData, type GetAttributionMeError, type GetAttributionMeErrors, type GetAttributionMeResponse, type GetAttributionMeResponses, type GetAttributionStatsData, type GetAttributionStatsError, type GetAttributionStatsErrors, type GetAttributionStatsResponse, type GetAttributionStatsResponses, type GetCurrentUserData, type GetCurrentUserError, type GetCurrentUserErrors, type GetCurrentUserResponse, type GetCurrentUserResponses, type GetIntentData, type GetIntentError, type GetIntentErrors, type GetIntentResponse, type GetIntentResponses, type GetOfferingData, type GetOfferingError, type GetOfferingErrors, type GetOfferingResponse, type GetOfferingResponses, type GetSyndicateData, type GetSyndicateDealData, type GetSyndicateDealError, type GetSyndicateDealErrors, type GetSyndicateDealResponse, type GetSyndicateDealResponses, type GetSyndicateError, type GetSyndicateErrors, type GetSyndicateResponse, type GetSyndicateResponses, type GetSyndicateStatisticsData, type GetSyndicateStatisticsError, type GetSyndicateStatisticsErrors, type GetSyndicateStatisticsResponse, type GetSyndicateStatisticsResponses, type GetWebhookSubscriptionData, type GetWebhookSubscriptionError, type GetWebhookSubscriptionErrors, type GetWebhookSubscriptionResponse, type GetWebhookSubscriptionResponses, type HideSyndicateMemberData, type HideSyndicateMemberError, type HideSyndicateMemberErrors, type HideSyndicateMemberResponse, type HideSyndicateMemberResponses, type IdempotencyKey, type Intent, type IntentEnvelope, type IntentListEnvelope, type Investment, type InvestmentLink, type InvestmentLinkCreateInput, type InvestmentLinkEnvelope, type InvestmentListEnvelope, type InvestmentSession, type InvestmentSessionCreateInput, type InvestmentSessionEnvelope, type InvestmentSessionId, type Investor, type InvestorEnvelope, type InvestorListEnvelope, type Invite, type InviteCreateInput, type InviteEnvelope, type InviteId, type InviteListEnvelope, type InviteSyndicateMemberData, type InviteSyndicateMemberError, type InviteSyndicateMemberErrors, type InviteSyndicateMemberResponse, type InviteSyndicateMemberResponses, type ListActivityData, type ListActivityError, type ListActivityErrors, type ListActivityResponse, type ListActivityResponses, type ListAttributedInvestmentsData, type ListAttributedInvestmentsError, type ListAttributedInvestmentsErrors, type ListAttributedInvestmentsResponse, type ListAttributedInvestmentsResponses, type ListAttributionCampaignsData, type ListAttributionCampaignsError, type ListAttributionCampaignsErrors, type ListAttributionCampaignsResponse, type ListAttributionCampaignsResponses, type ListCampaignsData, type ListCampaignsError, type ListCampaignsErrors, type ListCampaignsResponse, type ListCampaignsResponses, type ListConnectedAppsData, type ListConnectedAppsError, type ListConnectedAppsErrors, type ListConnectedAppsResponse, type ListConnectedAppsResponses, type ListIntentsData, type ListIntentsError, type ListIntentsErrors, type ListIntentsResponse, type ListIntentsResponses, type ListInvestmentsData, type ListInvestmentsError, type ListInvestmentsErrors, type ListInvestmentsResponse, type ListInvestmentsResponses, type ListOfferingsData, type ListOfferingsError, type ListOfferingsErrors, type ListOfferingsResponse, type ListOfferingsResponses, type ListPartnerInvitesData, type ListPartnerInvitesError, type ListPartnerInvitesErrors, type ListPartnerInvitesResponse, type ListPartnerInvitesResponses, type ListSyndicateDealInvestorsData, type ListSyndicateDealInvestorsError, type ListSyndicateDealInvestorsErrors, type ListSyndicateDealInvestorsResponse, type ListSyndicateDealInvestorsResponses, type ListSyndicateDealsData, type ListSyndicateDealsError, type ListSyndicateDealsErrors, type ListSyndicateDealsResponse, type ListSyndicateDealsResponses, type ListSyndicateMemberInvestmentsData, type ListSyndicateMemberInvestmentsError, type ListSyndicateMemberInvestmentsErrors, type ListSyndicateMemberInvestmentsResponse, type ListSyndicateMemberInvestmentsResponses, type ListSyndicateMembersData, type ListSyndicateMembersError, type ListSyndicateMembersErrors, type ListSyndicateMembersResponse, type ListSyndicateMembersResponses, type ListSyndicatesData, type ListSyndicatesError, type ListSyndicatesErrors, type ListSyndicatesResponse, type ListSyndicatesResponses, type ListWebhookSubscriptionsData, type ListWebhookSubscriptionsError, type ListWebhookSubscriptionsErrors, type ListWebhookSubscriptionsResponse, type ListWebhookSubscriptionsResponses, type MarketingPartner, type MarketingPartnerEnvelope, type MemberId, type MemberInvestment, type MemberInvestmentListEnvelope, type Mode, type OAuthHostOptions, type Offering, type OfferingEnvelope, type OfferingListEnvelope, type OfferingSort, type Page, type PageFetcher, type PaginationMeta, type ParsedWebhook, type PartnerInvestment, type PartnerInvestmentEnvelope, type PartnerInvestmentId, type PartnerInvestmentListEnvelope, type PartnerInvite, type PartnerInviteEnvelope, type PartnerInviteListEnvelope, type PartnerWebhookEvent, type PartnerWebhookEventEnvelope, type PartnerWebhookSubscription, type PartnerWebhookSubscriptionCreateInput, type PartnerWebhookSubscriptionEnvelope, type PartnerWebhookSubscriptionListEnvelope, type PartnerWebhookSubscriptionWithSecret, type PartnerWebhookSubscriptionWithSecretEnvelope, type Pkce, type PromoteSyndicateMemberData, type PromoteSyndicateMemberError, type PromoteSyndicateMemberErrors, type PromoteSyndicateMemberResponse, type PromoteSyndicateMemberResponses, REQUEST_ID_HEADER, type ReactivateWebhookSubscriptionData, type ReactivateWebhookSubscriptionError, type ReactivateWebhookSubscriptionErrors, type ReactivateWebhookSubscriptionResponse, type ReactivateWebhookSubscriptionResponses, type RefreshOptions, type RegenerateWebhookSecretData, type RegenerateWebhookSecretError, type RegenerateWebhookSecretErrors, type RegenerateWebhookSecretResponse, type RegenerateWebhookSecretResponses, type RegisterAsPartnerData, type RegisterAsPartnerError, type RegisterAsPartnerErrors, type RegisterAsPartnerResponse, type RegisterAsPartnerResponses, type RemoveSyndicateMemberData, type RemoveSyndicateMemberError, type RemoveSyndicateMemberErrors, type ReorderSyndicateMembersData, type ReorderSyndicateMembersError, type ReorderSyndicateMembersErrors, type ReorderSyndicateMembersResponses, type ResendSyndicateInviteData, type ResendSyndicateInviteError, type ResendSyndicateInviteErrors, type ResendSyndicateInviteResponses, type RestoreSyndicateMemberData, type RestoreSyndicateMemberError, type RestoreSyndicateMemberErrors, type RestoreSyndicateMemberResponse, type RestoreSyndicateMemberResponses, type RevokeConnectedAppData, type RevokeConnectedAppError, type RevokeConnectedAppErrors, type RevokeConnectedAppResponse, type RevokeConnectedAppResponses, type RevokePartnerInviteData, type RevokePartnerInviteError, type RevokePartnerInviteErrors, type RevokePartnerInviteResponse, type RevokePartnerInviteResponses, SANDBOX_AUTHORIZE_BASE_URL, SIGNATURE_HEADER, type Spv, type SpvCloseStatus, type SpvCloseStatusEnvelope, type SpvCreateInput, type SpvEnvelope, type SpvId, type SpvListEnvelope, type SpvMetrics, type SpvSettings, type SpvTerms, type SpvWithMetaEnvelope, type StartDate, type Syndicate, type SyndicateDeal, type SyndicateDealDetail, type SyndicateDealDetailEnvelope, type SyndicateDealEnvelope, type SyndicateDealListEnvelope, type SyndicateDetail, type SyndicateDetailEnvelope, type SyndicateId, type SyndicateListEnvelope, type SyndicateMember, type SyndicateMemberEnvelope, type SyndicateMemberListEnvelope, type SyndicatePortfolio, type SyndicateStatistics, type SyndicateStatisticsEnvelope, TIMESTAMP_HEADER, type TargetCompanyInput, type TestWebhookSubscriptionData, type TestWebhookSubscriptionError, type TestWebhookSubscriptionErrors, type TestWebhookSubscriptionResponse, type TestWebhookSubscriptionResponses, type TokenManagerOptions, type TokenSet, type TokenStore, type UpdateSyndicateData, type UpdateSyndicateError, type UpdateSyndicateErrors, type UpdateSyndicateMemberData, type UpdateSyndicateMemberError, type UpdateSyndicateMemberErrors, type UpdateSyndicateMemberResponse, type UpdateSyndicateMemberResponses, type UpdateSyndicateResponse, type UpdateSyndicateResponses, type User, type UserEnvelope, type UtmCampaign, type UtmSource, type ValidationError, type VerifyWebhookOptions, type WebhookDelivery, type WebhookId, type WebhookSubscription, type WebhookSubscriptionEnvelope, type WebhookSubscriptionId, type WebhookSubscriptionListEnvelope, type WebhookSubscriptionWithRecentDeliveriesEnvelope, type WebhookSubscriptionWithSecret2Envelope, type WebhookSubscriptionWithSecretEnvelope, type WebhookTestResult, type WebhookTestResultEnvelope, Wefunder, WefunderAuthError, WefunderError, type WefunderOptions, clientCredentialsGrant, collect, constructEvent, createAuthorizationUrl, exchangeCode, generatePkce, modeForToken, paginate, refreshToken, verifyWebhook };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
- /** Host for the browser /authorize redirect. Stays on wefunder.com. */
1
+ /** Host for the LIVE browser /authorize redirect (pk_live_ / default). */
2
2
  declare const DEFAULT_AUTHORIZE_BASE_URL = "https://wefunder.com/oauth";
3
- declare const DEFAULT_TOKEN_BASE_URL = "https://wefunder.com/oauth";
3
+ /** Host for the SANDBOX browser /authorize redirect (pk_test_). Canonical, client_id-derivable. */
4
+ declare const SANDBOX_AUTHORIZE_BASE_URL = "https://oauth.wefunder-sandbox.com/oauth";
5
+ declare const DEFAULT_TOKEN_BASE_URL = "https://api.wefunder.com/oauth";
4
6
  /**
5
7
  * @deprecated Use `authorizeBaseUrl` / `tokenBaseUrl` instead. Kept as a convenience
6
8
  * alias that sets BOTH hosts at once. Equals the authorize default today.
@@ -4759,7 +4761,7 @@ declare namespace ops {
4759
4761
 
4760
4762
  /** Documented `sort` values for the offerings list, from the generated op. */
4761
4763
  type OfferingSort = NonNullable<ListOfferingsData["query"]>["sort"];
4762
- declare const DEFAULT_API_BASE_URL = "https://api.wefunder.com/api/v2";
4764
+ declare const DEFAULT_API_BASE_URL = "https://api.wefunder.com";
4763
4765
  declare const DEFAULT_API_VERSION = "2025-01-15";
4764
4766
  type Mode = "live" | "test" | "unknown";
4765
4767
  declare function modeForToken(token: string): Mode;
@@ -4934,4 +4936,4 @@ declare function constructEvent<T = unknown>(payload: string, headers: Headers |
4934
4936
  now?: () => number;
4935
4937
  }): ParsedWebhook<T>;
4936
4938
 
4937
- export { type AnonymizedAttribution, type ApproveSyndicateMemberData, type ApproveSyndicateMemberError, type ApproveSyndicateMemberErrors, type ApproveSyndicateMemberResponse, type ApproveSyndicateMemberResponses, type AttributedInvestmentListEnvelope, type AttributionCampaignAccess, type AttributionCampaignSummary, type AttributionCampaignSummaryListEnvelope, type AttributionMe, type AttributionMeEnvelope, type AttributionPartner, type AttributionStats, type AttributionStatsEnvelope, type AttributionUser, type AuditEvent, type AuditEventListEnvelope, type AuthorizationUrlOptions, type Campaign, type CampaignId, type CampaignListEnvelope, type ClientCredentialsOptions, type ClientOptions, type CloseSyndicateDealData, type CloseSyndicateDealError, type CloseSyndicateDealErrors, type ConnectedApp, type ConnectedAppListEnvelope, type ConnectedAppRevocation, type ConnectedAppRevocationEnvelope, type CreateIntentData, type CreateIntentError, type CreateIntentErrors, type CreateIntentResponse, type CreateIntentResponses, type CreatePartnerInviteData, type CreatePartnerInviteError, type CreatePartnerInviteErrors, type CreatePartnerInviteResponse, type CreatePartnerInviteResponses, type CreateWebhookSubscriptionData, type CreateWebhookSubscriptionError, type CreateWebhookSubscriptionErrors, type CreateWebhookSubscriptionResponse, type CreateWebhookSubscriptionResponses, type Cursor, DEFAULT_API_BASE_URL, DEFAULT_API_VERSION, DEFAULT_AUTHORIZE_BASE_URL, DEFAULT_OAUTH_BASE_URL, DEFAULT_TOKEN_BASE_URL, DELIVERY_ID_HEADER, type DealInvestor, type DealInvestorListEnvelope, type DeleteWebhookSubscriptionData, type DeleteWebhookSubscriptionError, type DeleteWebhookSubscriptionErrors, type DeleteWebhookSubscriptionResponse, type DeleteWebhookSubscriptionResponses, type DemoteSyndicateMemberData, type DemoteSyndicateMemberError, type DemoteSyndicateMemberErrors, type DemoteSyndicateMemberResponse, type DemoteSyndicateMemberResponses, EVENT_HEADER, type EndDate, type Error$1 as Error, type ExchangeCodeOptions, type Exemption, type ExportSyndicateMembersCsvData, type ExportSyndicateMembersCsvError, type ExportSyndicateMembersCsvErrors, type ExportSyndicateMembersCsvResponse, type ExportSyndicateMembersCsvResponses, type FinalizeSyndicateDealData, type FinalizeSyndicateDealError, type FinalizeSyndicateDealErrors, type FullAttribution, type FundraiseId, type GetAttributionMeData, type GetAttributionMeError, type GetAttributionMeErrors, type GetAttributionMeResponse, type GetAttributionMeResponses, type GetAttributionStatsData, type GetAttributionStatsError, type GetAttributionStatsErrors, type GetAttributionStatsResponse, type GetAttributionStatsResponses, type GetCurrentUserData, type GetCurrentUserError, type GetCurrentUserErrors, type GetCurrentUserResponse, type GetCurrentUserResponses, type GetIntentData, type GetIntentError, type GetIntentErrors, type GetIntentResponse, type GetIntentResponses, type GetOfferingData, type GetOfferingError, type GetOfferingErrors, type GetOfferingResponse, type GetOfferingResponses, type GetSyndicateData, type GetSyndicateDealData, type GetSyndicateDealError, type GetSyndicateDealErrors, type GetSyndicateDealResponse, type GetSyndicateDealResponses, type GetSyndicateError, type GetSyndicateErrors, type GetSyndicateResponse, type GetSyndicateResponses, type GetSyndicateStatisticsData, type GetSyndicateStatisticsError, type GetSyndicateStatisticsErrors, type GetSyndicateStatisticsResponse, type GetSyndicateStatisticsResponses, type GetWebhookSubscriptionData, type GetWebhookSubscriptionError, type GetWebhookSubscriptionErrors, type GetWebhookSubscriptionResponse, type GetWebhookSubscriptionResponses, type HideSyndicateMemberData, type HideSyndicateMemberError, type HideSyndicateMemberErrors, type HideSyndicateMemberResponse, type HideSyndicateMemberResponses, type IdempotencyKey, type Intent, type IntentEnvelope, type IntentListEnvelope, type Investment, type InvestmentLink, type InvestmentLinkCreateInput, type InvestmentLinkEnvelope, type InvestmentListEnvelope, type InvestmentSession, type InvestmentSessionCreateInput, type InvestmentSessionEnvelope, type InvestmentSessionId, type Investor, type InvestorEnvelope, type InvestorListEnvelope, type Invite, type InviteCreateInput, type InviteEnvelope, type InviteId, type InviteListEnvelope, type InviteSyndicateMemberData, type InviteSyndicateMemberError, type InviteSyndicateMemberErrors, type InviteSyndicateMemberResponse, type InviteSyndicateMemberResponses, type ListActivityData, type ListActivityError, type ListActivityErrors, type ListActivityResponse, type ListActivityResponses, type ListAttributedInvestmentsData, type ListAttributedInvestmentsError, type ListAttributedInvestmentsErrors, type ListAttributedInvestmentsResponse, type ListAttributedInvestmentsResponses, type ListAttributionCampaignsData, type ListAttributionCampaignsError, type ListAttributionCampaignsErrors, type ListAttributionCampaignsResponse, type ListAttributionCampaignsResponses, type ListCampaignsData, type ListCampaignsError, type ListCampaignsErrors, type ListCampaignsResponse, type ListCampaignsResponses, type ListConnectedAppsData, type ListConnectedAppsError, type ListConnectedAppsErrors, type ListConnectedAppsResponse, type ListConnectedAppsResponses, type ListIntentsData, type ListIntentsError, type ListIntentsErrors, type ListIntentsResponse, type ListIntentsResponses, type ListInvestmentsData, type ListInvestmentsError, type ListInvestmentsErrors, type ListInvestmentsResponse, type ListInvestmentsResponses, type ListOfferingsData, type ListOfferingsError, type ListOfferingsErrors, type ListOfferingsResponse, type ListOfferingsResponses, type ListPartnerInvitesData, type ListPartnerInvitesError, type ListPartnerInvitesErrors, type ListPartnerInvitesResponse, type ListPartnerInvitesResponses, type ListSyndicateDealInvestorsData, type ListSyndicateDealInvestorsError, type ListSyndicateDealInvestorsErrors, type ListSyndicateDealInvestorsResponse, type ListSyndicateDealInvestorsResponses, type ListSyndicateDealsData, type ListSyndicateDealsError, type ListSyndicateDealsErrors, type ListSyndicateDealsResponse, type ListSyndicateDealsResponses, type ListSyndicateMemberInvestmentsData, type ListSyndicateMemberInvestmentsError, type ListSyndicateMemberInvestmentsErrors, type ListSyndicateMemberInvestmentsResponse, type ListSyndicateMemberInvestmentsResponses, type ListSyndicateMembersData, type ListSyndicateMembersError, type ListSyndicateMembersErrors, type ListSyndicateMembersResponse, type ListSyndicateMembersResponses, type ListSyndicatesData, type ListSyndicatesError, type ListSyndicatesErrors, type ListSyndicatesResponse, type ListSyndicatesResponses, type ListWebhookSubscriptionsData, type ListWebhookSubscriptionsError, type ListWebhookSubscriptionsErrors, type ListWebhookSubscriptionsResponse, type ListWebhookSubscriptionsResponses, type MarketingPartner, type MarketingPartnerEnvelope, type MemberId, type MemberInvestment, type MemberInvestmentListEnvelope, type Mode, type OAuthHostOptions, type Offering, type OfferingEnvelope, type OfferingListEnvelope, type OfferingSort, type Page, type PageFetcher, type PaginationMeta, type ParsedWebhook, type PartnerInvestment, type PartnerInvestmentEnvelope, type PartnerInvestmentId, type PartnerInvestmentListEnvelope, type PartnerInvite, type PartnerInviteEnvelope, type PartnerInviteListEnvelope, type PartnerWebhookEvent, type PartnerWebhookEventEnvelope, type PartnerWebhookSubscription, type PartnerWebhookSubscriptionCreateInput, type PartnerWebhookSubscriptionEnvelope, type PartnerWebhookSubscriptionListEnvelope, type PartnerWebhookSubscriptionWithSecret, type PartnerWebhookSubscriptionWithSecretEnvelope, type Pkce, type PromoteSyndicateMemberData, type PromoteSyndicateMemberError, type PromoteSyndicateMemberErrors, type PromoteSyndicateMemberResponse, type PromoteSyndicateMemberResponses, REQUEST_ID_HEADER, type ReactivateWebhookSubscriptionData, type ReactivateWebhookSubscriptionError, type ReactivateWebhookSubscriptionErrors, type ReactivateWebhookSubscriptionResponse, type ReactivateWebhookSubscriptionResponses, type RefreshOptions, type RegenerateWebhookSecretData, type RegenerateWebhookSecretError, type RegenerateWebhookSecretErrors, type RegenerateWebhookSecretResponse, type RegenerateWebhookSecretResponses, type RegisterAsPartnerData, type RegisterAsPartnerError, type RegisterAsPartnerErrors, type RegisterAsPartnerResponse, type RegisterAsPartnerResponses, type RemoveSyndicateMemberData, type RemoveSyndicateMemberError, type RemoveSyndicateMemberErrors, type ReorderSyndicateMembersData, type ReorderSyndicateMembersError, type ReorderSyndicateMembersErrors, type ReorderSyndicateMembersResponses, type ResendSyndicateInviteData, type ResendSyndicateInviteError, type ResendSyndicateInviteErrors, type ResendSyndicateInviteResponses, type RestoreSyndicateMemberData, type RestoreSyndicateMemberError, type RestoreSyndicateMemberErrors, type RestoreSyndicateMemberResponse, type RestoreSyndicateMemberResponses, type RevokeConnectedAppData, type RevokeConnectedAppError, type RevokeConnectedAppErrors, type RevokeConnectedAppResponse, type RevokeConnectedAppResponses, type RevokePartnerInviteData, type RevokePartnerInviteError, type RevokePartnerInviteErrors, type RevokePartnerInviteResponse, type RevokePartnerInviteResponses, SIGNATURE_HEADER, type Spv, type SpvCloseStatus, type SpvCloseStatusEnvelope, type SpvCreateInput, type SpvEnvelope, type SpvId, type SpvListEnvelope, type SpvMetrics, type SpvSettings, type SpvTerms, type SpvWithMetaEnvelope, type StartDate, type Syndicate, type SyndicateDeal, type SyndicateDealDetail, type SyndicateDealDetailEnvelope, type SyndicateDealEnvelope, type SyndicateDealListEnvelope, type SyndicateDetail, type SyndicateDetailEnvelope, type SyndicateId, type SyndicateListEnvelope, type SyndicateMember, type SyndicateMemberEnvelope, type SyndicateMemberListEnvelope, type SyndicatePortfolio, type SyndicateStatistics, type SyndicateStatisticsEnvelope, TIMESTAMP_HEADER, type TargetCompanyInput, type TestWebhookSubscriptionData, type TestWebhookSubscriptionError, type TestWebhookSubscriptionErrors, type TestWebhookSubscriptionResponse, type TestWebhookSubscriptionResponses, type TokenManagerOptions, type TokenSet, type TokenStore, type UpdateSyndicateData, type UpdateSyndicateError, type UpdateSyndicateErrors, type UpdateSyndicateMemberData, type UpdateSyndicateMemberError, type UpdateSyndicateMemberErrors, type UpdateSyndicateMemberResponse, type UpdateSyndicateMemberResponses, type UpdateSyndicateResponse, type UpdateSyndicateResponses, type User, type UserEnvelope, type UtmCampaign, type UtmSource, type ValidationError, type VerifyWebhookOptions, type WebhookDelivery, type WebhookId, type WebhookSubscription, type WebhookSubscriptionEnvelope, type WebhookSubscriptionId, type WebhookSubscriptionListEnvelope, type WebhookSubscriptionWithRecentDeliveriesEnvelope, type WebhookSubscriptionWithSecret2Envelope, type WebhookSubscriptionWithSecretEnvelope, type WebhookTestResult, type WebhookTestResultEnvelope, Wefunder, WefunderAuthError, WefunderError, type WefunderOptions, clientCredentialsGrant, collect, constructEvent, createAuthorizationUrl, exchangeCode, generatePkce, modeForToken, paginate, refreshToken, verifyWebhook };
4939
+ export { type AnonymizedAttribution, type ApproveSyndicateMemberData, type ApproveSyndicateMemberError, type ApproveSyndicateMemberErrors, type ApproveSyndicateMemberResponse, type ApproveSyndicateMemberResponses, type AttributedInvestmentListEnvelope, type AttributionCampaignAccess, type AttributionCampaignSummary, type AttributionCampaignSummaryListEnvelope, type AttributionMe, type AttributionMeEnvelope, type AttributionPartner, type AttributionStats, type AttributionStatsEnvelope, type AttributionUser, type AuditEvent, type AuditEventListEnvelope, type AuthorizationUrlOptions, type Campaign, type CampaignId, type CampaignListEnvelope, type ClientCredentialsOptions, type ClientOptions, type CloseSyndicateDealData, type CloseSyndicateDealError, type CloseSyndicateDealErrors, type ConnectedApp, type ConnectedAppListEnvelope, type ConnectedAppRevocation, type ConnectedAppRevocationEnvelope, type CreateIntentData, type CreateIntentError, type CreateIntentErrors, type CreateIntentResponse, type CreateIntentResponses, type CreatePartnerInviteData, type CreatePartnerInviteError, type CreatePartnerInviteErrors, type CreatePartnerInviteResponse, type CreatePartnerInviteResponses, type CreateWebhookSubscriptionData, type CreateWebhookSubscriptionError, type CreateWebhookSubscriptionErrors, type CreateWebhookSubscriptionResponse, type CreateWebhookSubscriptionResponses, type Cursor, DEFAULT_API_BASE_URL, DEFAULT_API_VERSION, DEFAULT_AUTHORIZE_BASE_URL, DEFAULT_OAUTH_BASE_URL, DEFAULT_TOKEN_BASE_URL, DELIVERY_ID_HEADER, type DealInvestor, type DealInvestorListEnvelope, type DeleteWebhookSubscriptionData, type DeleteWebhookSubscriptionError, type DeleteWebhookSubscriptionErrors, type DeleteWebhookSubscriptionResponse, type DeleteWebhookSubscriptionResponses, type DemoteSyndicateMemberData, type DemoteSyndicateMemberError, type DemoteSyndicateMemberErrors, type DemoteSyndicateMemberResponse, type DemoteSyndicateMemberResponses, EVENT_HEADER, type EndDate, type Error$1 as Error, type ExchangeCodeOptions, type Exemption, type ExportSyndicateMembersCsvData, type ExportSyndicateMembersCsvError, type ExportSyndicateMembersCsvErrors, type ExportSyndicateMembersCsvResponse, type ExportSyndicateMembersCsvResponses, type FinalizeSyndicateDealData, type FinalizeSyndicateDealError, type FinalizeSyndicateDealErrors, type FullAttribution, type FundraiseId, type GetAttributionMeData, type GetAttributionMeError, type GetAttributionMeErrors, type GetAttributionMeResponse, type GetAttributionMeResponses, type GetAttributionStatsData, type GetAttributionStatsError, type GetAttributionStatsErrors, type GetAttributionStatsResponse, type GetAttributionStatsResponses, type GetCurrentUserData, type GetCurrentUserError, type GetCurrentUserErrors, type GetCurrentUserResponse, type GetCurrentUserResponses, type GetIntentData, type GetIntentError, type GetIntentErrors, type GetIntentResponse, type GetIntentResponses, type GetOfferingData, type GetOfferingError, type GetOfferingErrors, type GetOfferingResponse, type GetOfferingResponses, type GetSyndicateData, type GetSyndicateDealData, type GetSyndicateDealError, type GetSyndicateDealErrors, type GetSyndicateDealResponse, type GetSyndicateDealResponses, type GetSyndicateError, type GetSyndicateErrors, type GetSyndicateResponse, type GetSyndicateResponses, type GetSyndicateStatisticsData, type GetSyndicateStatisticsError, type GetSyndicateStatisticsErrors, type GetSyndicateStatisticsResponse, type GetSyndicateStatisticsResponses, type GetWebhookSubscriptionData, type GetWebhookSubscriptionError, type GetWebhookSubscriptionErrors, type GetWebhookSubscriptionResponse, type GetWebhookSubscriptionResponses, type HideSyndicateMemberData, type HideSyndicateMemberError, type HideSyndicateMemberErrors, type HideSyndicateMemberResponse, type HideSyndicateMemberResponses, type IdempotencyKey, type Intent, type IntentEnvelope, type IntentListEnvelope, type Investment, type InvestmentLink, type InvestmentLinkCreateInput, type InvestmentLinkEnvelope, type InvestmentListEnvelope, type InvestmentSession, type InvestmentSessionCreateInput, type InvestmentSessionEnvelope, type InvestmentSessionId, type Investor, type InvestorEnvelope, type InvestorListEnvelope, type Invite, type InviteCreateInput, type InviteEnvelope, type InviteId, type InviteListEnvelope, type InviteSyndicateMemberData, type InviteSyndicateMemberError, type InviteSyndicateMemberErrors, type InviteSyndicateMemberResponse, type InviteSyndicateMemberResponses, type ListActivityData, type ListActivityError, type ListActivityErrors, type ListActivityResponse, type ListActivityResponses, type ListAttributedInvestmentsData, type ListAttributedInvestmentsError, type ListAttributedInvestmentsErrors, type ListAttributedInvestmentsResponse, type ListAttributedInvestmentsResponses, type ListAttributionCampaignsData, type ListAttributionCampaignsError, type ListAttributionCampaignsErrors, type ListAttributionCampaignsResponse, type ListAttributionCampaignsResponses, type ListCampaignsData, type ListCampaignsError, type ListCampaignsErrors, type ListCampaignsResponse, type ListCampaignsResponses, type ListConnectedAppsData, type ListConnectedAppsError, type ListConnectedAppsErrors, type ListConnectedAppsResponse, type ListConnectedAppsResponses, type ListIntentsData, type ListIntentsError, type ListIntentsErrors, type ListIntentsResponse, type ListIntentsResponses, type ListInvestmentsData, type ListInvestmentsError, type ListInvestmentsErrors, type ListInvestmentsResponse, type ListInvestmentsResponses, type ListOfferingsData, type ListOfferingsError, type ListOfferingsErrors, type ListOfferingsResponse, type ListOfferingsResponses, type ListPartnerInvitesData, type ListPartnerInvitesError, type ListPartnerInvitesErrors, type ListPartnerInvitesResponse, type ListPartnerInvitesResponses, type ListSyndicateDealInvestorsData, type ListSyndicateDealInvestorsError, type ListSyndicateDealInvestorsErrors, type ListSyndicateDealInvestorsResponse, type ListSyndicateDealInvestorsResponses, type ListSyndicateDealsData, type ListSyndicateDealsError, type ListSyndicateDealsErrors, type ListSyndicateDealsResponse, type ListSyndicateDealsResponses, type ListSyndicateMemberInvestmentsData, type ListSyndicateMemberInvestmentsError, type ListSyndicateMemberInvestmentsErrors, type ListSyndicateMemberInvestmentsResponse, type ListSyndicateMemberInvestmentsResponses, type ListSyndicateMembersData, type ListSyndicateMembersError, type ListSyndicateMembersErrors, type ListSyndicateMembersResponse, type ListSyndicateMembersResponses, type ListSyndicatesData, type ListSyndicatesError, type ListSyndicatesErrors, type ListSyndicatesResponse, type ListSyndicatesResponses, type ListWebhookSubscriptionsData, type ListWebhookSubscriptionsError, type ListWebhookSubscriptionsErrors, type ListWebhookSubscriptionsResponse, type ListWebhookSubscriptionsResponses, type MarketingPartner, type MarketingPartnerEnvelope, type MemberId, type MemberInvestment, type MemberInvestmentListEnvelope, type Mode, type OAuthHostOptions, type Offering, type OfferingEnvelope, type OfferingListEnvelope, type OfferingSort, type Page, type PageFetcher, type PaginationMeta, type ParsedWebhook, type PartnerInvestment, type PartnerInvestmentEnvelope, type PartnerInvestmentId, type PartnerInvestmentListEnvelope, type PartnerInvite, type PartnerInviteEnvelope, type PartnerInviteListEnvelope, type PartnerWebhookEvent, type PartnerWebhookEventEnvelope, type PartnerWebhookSubscription, type PartnerWebhookSubscriptionCreateInput, type PartnerWebhookSubscriptionEnvelope, type PartnerWebhookSubscriptionListEnvelope, type PartnerWebhookSubscriptionWithSecret, type PartnerWebhookSubscriptionWithSecretEnvelope, type Pkce, type PromoteSyndicateMemberData, type PromoteSyndicateMemberError, type PromoteSyndicateMemberErrors, type PromoteSyndicateMemberResponse, type PromoteSyndicateMemberResponses, REQUEST_ID_HEADER, type ReactivateWebhookSubscriptionData, type ReactivateWebhookSubscriptionError, type ReactivateWebhookSubscriptionErrors, type ReactivateWebhookSubscriptionResponse, type ReactivateWebhookSubscriptionResponses, type RefreshOptions, type RegenerateWebhookSecretData, type RegenerateWebhookSecretError, type RegenerateWebhookSecretErrors, type RegenerateWebhookSecretResponse, type RegenerateWebhookSecretResponses, type RegisterAsPartnerData, type RegisterAsPartnerError, type RegisterAsPartnerErrors, type RegisterAsPartnerResponse, type RegisterAsPartnerResponses, type RemoveSyndicateMemberData, type RemoveSyndicateMemberError, type RemoveSyndicateMemberErrors, type ReorderSyndicateMembersData, type ReorderSyndicateMembersError, type ReorderSyndicateMembersErrors, type ReorderSyndicateMembersResponses, type ResendSyndicateInviteData, type ResendSyndicateInviteError, type ResendSyndicateInviteErrors, type ResendSyndicateInviteResponses, type RestoreSyndicateMemberData, type RestoreSyndicateMemberError, type RestoreSyndicateMemberErrors, type RestoreSyndicateMemberResponse, type RestoreSyndicateMemberResponses, type RevokeConnectedAppData, type RevokeConnectedAppError, type RevokeConnectedAppErrors, type RevokeConnectedAppResponse, type RevokeConnectedAppResponses, type RevokePartnerInviteData, type RevokePartnerInviteError, type RevokePartnerInviteErrors, type RevokePartnerInviteResponse, type RevokePartnerInviteResponses, SANDBOX_AUTHORIZE_BASE_URL, SIGNATURE_HEADER, type Spv, type SpvCloseStatus, type SpvCloseStatusEnvelope, type SpvCreateInput, type SpvEnvelope, type SpvId, type SpvListEnvelope, type SpvMetrics, type SpvSettings, type SpvTerms, type SpvWithMetaEnvelope, type StartDate, type Syndicate, type SyndicateDeal, type SyndicateDealDetail, type SyndicateDealDetailEnvelope, type SyndicateDealEnvelope, type SyndicateDealListEnvelope, type SyndicateDetail, type SyndicateDetailEnvelope, type SyndicateId, type SyndicateListEnvelope, type SyndicateMember, type SyndicateMemberEnvelope, type SyndicateMemberListEnvelope, type SyndicatePortfolio, type SyndicateStatistics, type SyndicateStatisticsEnvelope, TIMESTAMP_HEADER, type TargetCompanyInput, type TestWebhookSubscriptionData, type TestWebhookSubscriptionError, type TestWebhookSubscriptionErrors, type TestWebhookSubscriptionResponse, type TestWebhookSubscriptionResponses, type TokenManagerOptions, type TokenSet, type TokenStore, type UpdateSyndicateData, type UpdateSyndicateError, type UpdateSyndicateErrors, type UpdateSyndicateMemberData, type UpdateSyndicateMemberError, type UpdateSyndicateMemberErrors, type UpdateSyndicateMemberResponse, type UpdateSyndicateMemberResponses, type UpdateSyndicateResponse, type UpdateSyndicateResponses, type User, type UserEnvelope, type UtmCampaign, type UtmSource, type ValidationError, type VerifyWebhookOptions, type WebhookDelivery, type WebhookId, type WebhookSubscription, type WebhookSubscriptionEnvelope, type WebhookSubscriptionId, type WebhookSubscriptionListEnvelope, type WebhookSubscriptionWithRecentDeliveriesEnvelope, type WebhookSubscriptionWithSecret2Envelope, type WebhookSubscriptionWithSecretEnvelope, type WebhookTestResult, type WebhookTestResultEnvelope, Wefunder, WefunderAuthError, WefunderError, type WefunderOptions, clientCredentialsGrant, collect, constructEvent, createAuthorizationUrl, exchangeCode, generatePkce, modeForToken, paginate, refreshToken, verifyWebhook };
package/dist/index.js CHANGED
@@ -838,13 +838,6 @@ function backoffMs(attempt, opts, random) {
838
838
  const jitter = exp * 0.5 * random();
839
839
  return Math.min(exp + jitter, opts.maxDelayMs);
840
840
  }
841
- function withBearer(input, init, token) {
842
- const headers = new Headers(
843
- init?.headers ?? (input instanceof Request ? input.headers : void 0)
844
- );
845
- headers.set("Authorization", `Bearer ${token}`);
846
- return { ...init, headers };
847
- }
848
841
  function createFetch(deps) {
849
842
  const baseFetch = deps.fetch ?? fetch;
850
843
  const sleep = deps.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
@@ -858,21 +851,37 @@ function createFetch(deps) {
858
851
  return async function wrappedFetch(input, init) {
859
852
  const method = methodOf(input, init);
860
853
  const idempotent = IDEMPOTENT.has(method);
854
+ const isRequest = input instanceof Request;
861
855
  let refreshed = false;
862
856
  let attempt = 0;
857
+ let retryToken;
858
+ const dispatch = (authToken) => {
859
+ if (isRequest) {
860
+ const fresh = input.clone();
861
+ if (authToken === void 0) return baseFetch(fresh);
862
+ const headers = new Headers(fresh.headers);
863
+ headers.set("Authorization", `Bearer ${authToken}`);
864
+ return baseFetch(new Request(fresh, { headers }));
865
+ }
866
+ const nextInit = authToken === void 0 ? init : (() => {
867
+ const headers = new Headers(init?.headers);
868
+ headers.set("Authorization", `Bearer ${authToken}`);
869
+ return { ...init, headers };
870
+ })();
871
+ return baseFetch(input, nextInit);
872
+ };
863
873
  for (; ; ) {
864
874
  let response;
865
875
  let networkError;
866
876
  try {
867
- response = await baseFetch(input, init);
877
+ response = await dispatch(retryToken);
868
878
  } catch (err) {
869
879
  networkError = err;
870
880
  }
871
- const replayable = !(input instanceof Request && input.bodyUsed);
872
- if (response?.status === 401 && !refreshed && replayable && deps.tokenManager?.canRefresh) {
881
+ if (response?.status === 401 && !refreshed && deps.tokenManager?.canRefresh) {
873
882
  refreshed = true;
874
883
  const next = await deps.tokenManager.refresh();
875
- init = withBearer(input, init, next.accessToken);
884
+ retryToken = next.accessToken;
876
885
  continue;
877
886
  }
878
887
  if (response?.status === 429 && attempt < retry.maxRetries) {
@@ -895,10 +904,11 @@ function createFetch(deps) {
895
904
  // src/oauth.ts
896
905
  import { createHash, randomBytes } from "crypto";
897
906
  var DEFAULT_AUTHORIZE_BASE_URL = "https://wefunder.com/oauth";
898
- var DEFAULT_TOKEN_BASE_URL = "https://wefunder.com/oauth";
907
+ var SANDBOX_AUTHORIZE_BASE_URL = "https://oauth.wefunder-sandbox.com/oauth";
908
+ var DEFAULT_TOKEN_BASE_URL = "https://api.wefunder.com/oauth";
899
909
  var DEFAULT_OAUTH_BASE_URL = DEFAULT_AUTHORIZE_BASE_URL;
900
- function resolveAuthorizeBase(o) {
901
- return o.authorizeBaseUrl ?? o.oauthBaseUrl ?? DEFAULT_AUTHORIZE_BASE_URL;
910
+ function defaultAuthorizeBase(clientId) {
911
+ return clientId.startsWith("pk_test_") ? SANDBOX_AUTHORIZE_BASE_URL : DEFAULT_AUTHORIZE_BASE_URL;
902
912
  }
903
913
  function resolveTokenBase(o) {
904
914
  return o.tokenBaseUrl ?? o.oauthBaseUrl ?? DEFAULT_TOKEN_BASE_URL;
@@ -938,7 +948,7 @@ function generatePkce() {
938
948
  return { codeVerifier, codeChallenge, codeChallengeMethod: "S256" };
939
949
  }
940
950
  function createAuthorizationUrl(opts) {
941
- const base = resolveAuthorizeBase(opts);
951
+ const base = opts.authorizeBaseUrl ?? opts.oauthBaseUrl ?? defaultAuthorizeBase(opts.clientId);
942
952
  const q = new URLSearchParams({
943
953
  response_type: "code",
944
954
  client_id: opts.clientId,
@@ -1452,7 +1462,7 @@ var revokePartnerInvite = (options) => (options.client ?? client).delete({
1452
1462
  });
1453
1463
 
1454
1464
  // src/client.ts
1455
- var DEFAULT_API_BASE_URL = "https://api.wefunder.com/api/v2";
1465
+ var DEFAULT_API_BASE_URL = "https://api.wefunder.com";
1456
1466
  var DEFAULT_API_VERSION = "2025-01-15";
1457
1467
  function modeForToken(token) {
1458
1468
  if (token.startsWith("at_live_")) return "live";
@@ -1676,6 +1686,7 @@ export {
1676
1686
  DELIVERY_ID_HEADER,
1677
1687
  EVENT_HEADER,
1678
1688
  REQUEST_ID_HEADER,
1689
+ SANDBOX_AUTHORIZE_BASE_URL,
1679
1690
  SIGNATURE_HEADER,
1680
1691
  TIMESTAMP_HEADER,
1681
1692
  Wefunder,