@proofchain/sdk 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +72 -2
- package/dist/index.d.ts +72 -2
- package/dist/index.js +9 -3
- package/dist/index.mjs +7 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,39 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* HTTP Client for ProofChain API
|
|
3
3
|
*/
|
|
4
|
+
/**
|
|
5
|
+
* Returns the per-tenant Cloudflare edge API URL for `slug`.
|
|
6
|
+
*
|
|
7
|
+
* Cloudflare can cache responses from per-tenant hosts
|
|
8
|
+
* (`https://{slug}.proofchain.co.za/api`) because the full URL is the cache
|
|
9
|
+
* key. The shared `api.proofchain.co.za` host is keyed on the `X-Tenant-ID`
|
|
10
|
+
* header and cannot be cached safely at the CDN layer.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* import { tenantApiUrl, ProofChain } from '@proofchain/sdk';
|
|
15
|
+
*
|
|
16
|
+
* const client = new ProofChain({
|
|
17
|
+
* apiKey: 'atst_…',
|
|
18
|
+
* baseUrl: tenantApiUrl('acme'), // https://acme.proofchain.co.za/api
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
declare function tenantApiUrl(slug: string): string;
|
|
4
23
|
interface HttpClientOptions {
|
|
5
24
|
apiKey?: string;
|
|
6
25
|
userToken?: string;
|
|
7
26
|
tenantId?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Explicit base URL — highest precedence.
|
|
29
|
+
* Covers custom domains (e.g. `https://fanpass.onefootball.com/api`).
|
|
30
|
+
*/
|
|
8
31
|
baseUrl?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Tenant slug used to derive the per-tenant edge URL when no explicit
|
|
34
|
+
* `baseUrl` is provided. Precedence: baseUrl > tenant > default.
|
|
35
|
+
*/
|
|
36
|
+
tenant?: string;
|
|
9
37
|
timeout?: number;
|
|
10
38
|
maxRetries?: number;
|
|
11
39
|
}
|
|
@@ -385,9 +413,51 @@ interface ProofChainOptions {
|
|
|
385
413
|
apiKey?: string;
|
|
386
414
|
/** End-user JWT for JWKS auth (alternative to apiKey). For PWA clients. */
|
|
387
415
|
userToken?: string;
|
|
388
|
-
/**
|
|
416
|
+
/**
|
|
417
|
+
* Tenant slug or client_id. Required when using userToken.
|
|
418
|
+
*
|
|
419
|
+
* When used as the sole host hint (no explicit `baseUrl`), the SDK also
|
|
420
|
+
* derives the base URL as `https://{tenantId}.proofchain.co.za/api` so
|
|
421
|
+
* requests hit the per-tenant Cloudflare edge host — enabling response
|
|
422
|
+
* caching that the shared `api.proofchain.co.za` origin cannot provide
|
|
423
|
+
* (the shared host is keyed on headers, not URL, and is therefore
|
|
424
|
+
* uncacheable at the CDN layer).
|
|
425
|
+
*/
|
|
389
426
|
tenantId?: string;
|
|
427
|
+
/**
|
|
428
|
+
* Override the API base URL (highest precedence).
|
|
429
|
+
*
|
|
430
|
+
* Use this for custom domains (e.g. `https://fanpass-portal.onefootball.com/api`)
|
|
431
|
+
* or self-hosted deployments. When omitted and `tenantId` is set, the SDK
|
|
432
|
+
* automatically uses `https://{tenantId}.proofchain.co.za/api`.
|
|
433
|
+
*
|
|
434
|
+
* Precedence: `baseUrl` > `tenantId`-derived URL > shared default.
|
|
435
|
+
*/
|
|
390
436
|
baseUrl?: string;
|
|
437
|
+
/**
|
|
438
|
+
* Tenant slug used to derive the per-tenant Cloudflare edge URL
|
|
439
|
+
* (`https://{tenant}.proofchain.co.za/api`) when no explicit `baseUrl` is
|
|
440
|
+
* supplied.
|
|
441
|
+
*
|
|
442
|
+
* Edge caching requires the per-tenant host: the shared `api.proofchain.co.za`
|
|
443
|
+
* host is keyed on the `X-Tenant-ID` header and cannot be safely cached by
|
|
444
|
+
* Cloudflare. Providing this option is the easiest way for integrators to opt
|
|
445
|
+
* into cached responses without managing a custom domain.
|
|
446
|
+
*
|
|
447
|
+
* @example
|
|
448
|
+
* ```typescript
|
|
449
|
+
* // Requests go to https://acme.proofchain.co.za/api — edge cached.
|
|
450
|
+
* const client = new ProofChain({ apiKey: 'atst_…', tenant: 'acme' });
|
|
451
|
+
*
|
|
452
|
+
* // Custom domain takes precedence; tenant is ignored for URL derivation.
|
|
453
|
+
* const client = new ProofChain({
|
|
454
|
+
* apiKey: 'atst_…',
|
|
455
|
+
* tenant: 'acme',
|
|
456
|
+
* baseUrl: 'https://fanpass.onefootball.com/api',
|
|
457
|
+
* });
|
|
458
|
+
* ```
|
|
459
|
+
*/
|
|
460
|
+
tenant?: string;
|
|
391
461
|
timeout?: number;
|
|
392
462
|
maxRetries?: number;
|
|
393
463
|
}
|
|
@@ -4206,4 +4276,4 @@ declare class TimeoutError extends ProofChainError {
|
|
|
4206
4276
|
constructor(message?: string);
|
|
4207
4277
|
}
|
|
4208
4278
|
|
|
4209
|
-
export { type Achievement, type ActivitySummaryView, type AddNFTRequest, type AnchorResult, type ApiKey, type AttestRequest, type AttestationConfig, type AttestationMode, type Attestation as AttestationRecord, type AttestationResult, type AttestationSchema, AttestationsClient, AuthenticationError, AuthorizationError, type AvailableView, type Badge, type BatchIngestRequest, type BatchIngestResponse, type BatchVerifyResult, type BlockchainProof, type BlockchainStats, type Certificate, type CertificateVerifyResult, CertificatesResource, type Channel, type ChannelState, type ChannelStatus, ChannelsResource, type ClaimNFTResult, type ClaimRewardResult, type CohortDefinition, type CohortGroupStats, CohortLeaderboardClient, type CohortLeaderboardEntry, type CohortLeaderboardOptions, type CohortLeaderboardResponse, type ComprehensiveWalletInfo, type CreateAchievementRequest, type CreateApiKeyRequest, type CreateAttestationRequest, type CreateBadgeRequest, type CreateChannelRequest, type CreateCredentialTypeRequest, type CreateDataViewRequest, type CreateDualWalletsRequest, type CreateEndUserRequest, type CreateEventRequest, type CreatePassportDefinitionRequest, type CreatePassportRequest, type CreateQuestRequest, type CreateQuestStepRequest, type CreateRewardDefinitionRequest, type CreateSchemaRequest, type CreateTemplateFieldRequest, type CreateTemplateRequest, type CreateWalletRequest as CreateUserWalletRequest, type CreateWalletRequest$1 as CreateWalletRequest, type CreateWebhookRequest, type CredentialType, type CredentialVerifyResult, CredentialsClient, type DataViewColumn, type DataViewComputation, type DataViewDetail, type DataViewExecuteResult, type DataViewInfo, type DataViewListResponse, type DataViewPreviewRequest, type DataViewPreviewResult, type DataViewSummary, DataViewsClient, type DistributeResult, DocumentsResource, type DualWallets, type EarnedReward, type EndUser, EndUserIngestionClient, type EndUserIngestionClientOptions, type EndUserListResponse, EndUsersClient, type Event, type EventBatchProof, type EventMetadata, type EventStatus, EventsResource, type ExecuteSwapRequest, type Facet, type FacetsResponse, type FanProfileView, type FanpassGroupStats, FanpassLeaderboardClient, type FanpassLeaderboardEntry, type FanpassLeaderboardOptions, type FanpassLeaderboardResponse, type FanpassUserComparisonResponse, type FieldValue, type GDPRDeletionRequest, type GDPRDeletionResponse, type GDPRPreviewResponse, type IngestEventRequest, type IngestEventResponse, IngestionClient, type IngestionClientOptions, type IssueCertificateRequest, type IssueCredentialRequest, type IssuedCredential, type LeaderboardUserProfile$1 as LeaderboardUserProfile, type LinkWalletRequest, type ListAttestationsOptions, type ListCertificatesRequest, type ListCohortsOptions, type ListEndUsersOptions, type ListEventsRequest, type ListIssuedCredentialsOptions, type ListMintsOptions, type ListMintsResponse, type ListQuestsOptions, type ListRewardsOptions, type ListSchemasOptions, type ListWalletCredentialsOptions, type ManualRewardRequest, type MergeUsersRequest, type Milestone, type MintNFTRequest, type NFT, type NFTMint, NetworkError, NftClient, NotFoundError, type NotificationCallback, type NotificationEvent, type NotificationEventType, NotificationsClient, type OTTConfigResponse, type OTTConfigUpdate, type OTTGenerateRequest, type OTTGenerateResponse, type OTTRedeemResponse, type OTTRequestResponse, PartnerKeysClient, type Passport, PassportClient, type PassportDefinition, type PassportFieldValue, type PassportHistory, type PassportTemplate, type PassportV2Data, type PassportWithFields, ProofChain, ProofChainError, type ProofChainOptions, type ProofVerifyResult, type PushSubscriptionJSON, type Quest, type QuestStep, type QuestWithProgress, QuestsClient, RateLimitError, type RegisterWalletRequest, type RevokeResult, type RewardAsset, type RewardAttestationResult, type RewardDefinition, type RewardEarned, type VerifyResult as RewardVerifyResult, RewardsClient, type Schema, type SchemaDetail, type SchemaField, type SchemaListResponse, type ValidationError$1 as SchemaValidationError, SchemasClient, type SearchFilters, type SearchQueryRequest, type SearchRequest, SearchResource, type SearchResponse, type SearchResult, type SearchStats, ServerError, type SetProfileRequest, type Settlement, type StepCompletionResult, type StepProgress, type StepStartResult, type StreamAck, type StreamEventRequest, type SubscribeOptions, type SwapQuote, type SwapQuoteRequest, type SwapResult, type TemplateField, type TenantInfo, TenantResource, type TierDefinition, TimeoutError, type TokenBalance, type TransferRequest, type TransferResult, type Unsubscribe, type UpdateConfigRequest as UpdateAttestationConfigRequest, type UpdateDataViewRequest, type UpdateEndUserRequest, type UpdatePassportRequest, type UpdateWebhookRequest, type UsageStats, type UserAchievement, type UserActivity, type UserActivityResponse, type UserBadge, type UserBreakdownResponse, type UserCohortBreakdownEntry, type UserCredentialsSummary, type UserQuestProgress, type UserReward$1 as UserReward, type UserRewardsResponse, type UserWalletSummary, type UserWithWallets, type UsersWithWalletsResponse, type ValidateDataRequest, ValidationError, type ValidationErrorDetail, type ValidationResult, type VaultFile, type VaultFolder, type VaultListResponse, VaultResource, type VaultStats, type VaultUploadRequest, type VerificationResult, VerifyResource, type ViewColumn, type ViewTemplate, type Wallet, type WalletBalance, WalletClient, type WalletCreationResult, type WalletCredential, type WalletCredentialVerifySummary, type WalletStats, type Webhook, WebhooksResource };
|
|
4279
|
+
export { type Achievement, type ActivitySummaryView, type AddNFTRequest, type AnchorResult, type ApiKey, type AttestRequest, type AttestationConfig, type AttestationMode, type Attestation as AttestationRecord, type AttestationResult, type AttestationSchema, AttestationsClient, AuthenticationError, AuthorizationError, type AvailableView, type Badge, type BatchIngestRequest, type BatchIngestResponse, type BatchVerifyResult, type BlockchainProof, type BlockchainStats, type Certificate, type CertificateVerifyResult, CertificatesResource, type Channel, type ChannelState, type ChannelStatus, ChannelsResource, type ClaimNFTResult, type ClaimRewardResult, type CohortDefinition, type CohortGroupStats, CohortLeaderboardClient, type CohortLeaderboardEntry, type CohortLeaderboardOptions, type CohortLeaderboardResponse, type ComprehensiveWalletInfo, type CreateAchievementRequest, type CreateApiKeyRequest, type CreateAttestationRequest, type CreateBadgeRequest, type CreateChannelRequest, type CreateCredentialTypeRequest, type CreateDataViewRequest, type CreateDualWalletsRequest, type CreateEndUserRequest, type CreateEventRequest, type CreatePassportDefinitionRequest, type CreatePassportRequest, type CreateQuestRequest, type CreateQuestStepRequest, type CreateRewardDefinitionRequest, type CreateSchemaRequest, type CreateTemplateFieldRequest, type CreateTemplateRequest, type CreateWalletRequest as CreateUserWalletRequest, type CreateWalletRequest$1 as CreateWalletRequest, type CreateWebhookRequest, type CredentialType, type CredentialVerifyResult, CredentialsClient, type DataViewColumn, type DataViewComputation, type DataViewDetail, type DataViewExecuteResult, type DataViewInfo, type DataViewListResponse, type DataViewPreviewRequest, type DataViewPreviewResult, type DataViewSummary, DataViewsClient, type DistributeResult, DocumentsResource, type DualWallets, type EarnedReward, type EndUser, EndUserIngestionClient, type EndUserIngestionClientOptions, type EndUserListResponse, EndUsersClient, type Event, type EventBatchProof, type EventMetadata, type EventStatus, EventsResource, type ExecuteSwapRequest, type Facet, type FacetsResponse, type FanProfileView, type FanpassGroupStats, FanpassLeaderboardClient, type FanpassLeaderboardEntry, type FanpassLeaderboardOptions, type FanpassLeaderboardResponse, type FanpassUserComparisonResponse, type FieldValue, type GDPRDeletionRequest, type GDPRDeletionResponse, type GDPRPreviewResponse, type IngestEventRequest, type IngestEventResponse, IngestionClient, type IngestionClientOptions, type IssueCertificateRequest, type IssueCredentialRequest, type IssuedCredential, type LeaderboardUserProfile$1 as LeaderboardUserProfile, type LinkWalletRequest, type ListAttestationsOptions, type ListCertificatesRequest, type ListCohortsOptions, type ListEndUsersOptions, type ListEventsRequest, type ListIssuedCredentialsOptions, type ListMintsOptions, type ListMintsResponse, type ListQuestsOptions, type ListRewardsOptions, type ListSchemasOptions, type ListWalletCredentialsOptions, type ManualRewardRequest, type MergeUsersRequest, type Milestone, type MintNFTRequest, type NFT, type NFTMint, NetworkError, NftClient, NotFoundError, type NotificationCallback, type NotificationEvent, type NotificationEventType, NotificationsClient, type OTTConfigResponse, type OTTConfigUpdate, type OTTGenerateRequest, type OTTGenerateResponse, type OTTRedeemResponse, type OTTRequestResponse, PartnerKeysClient, type Passport, PassportClient, type PassportDefinition, type PassportFieldValue, type PassportHistory, type PassportTemplate, type PassportV2Data, type PassportWithFields, ProofChain, ProofChainError, type ProofChainOptions, type ProofVerifyResult, type PushSubscriptionJSON, type Quest, type QuestStep, type QuestWithProgress, QuestsClient, RateLimitError, type RegisterWalletRequest, type RevokeResult, type RewardAsset, type RewardAttestationResult, type RewardDefinition, type RewardEarned, type VerifyResult as RewardVerifyResult, RewardsClient, type Schema, type SchemaDetail, type SchemaField, type SchemaListResponse, type ValidationError$1 as SchemaValidationError, SchemasClient, type SearchFilters, type SearchQueryRequest, type SearchRequest, SearchResource, type SearchResponse, type SearchResult, type SearchStats, ServerError, type SetProfileRequest, type Settlement, type StepCompletionResult, type StepProgress, type StepStartResult, type StreamAck, type StreamEventRequest, type SubscribeOptions, type SwapQuote, type SwapQuoteRequest, type SwapResult, type TemplateField, type TenantInfo, TenantResource, type TierDefinition, TimeoutError, type TokenBalance, type TransferRequest, type TransferResult, type Unsubscribe, type UpdateConfigRequest as UpdateAttestationConfigRequest, type UpdateDataViewRequest, type UpdateEndUserRequest, type UpdatePassportRequest, type UpdateWebhookRequest, type UsageStats, type UserAchievement, type UserActivity, type UserActivityResponse, type UserBadge, type UserBreakdownResponse, type UserCohortBreakdownEntry, type UserCredentialsSummary, type UserQuestProgress, type UserReward$1 as UserReward, type UserRewardsResponse, type UserWalletSummary, type UserWithWallets, type UsersWithWalletsResponse, type ValidateDataRequest, ValidationError, type ValidationErrorDetail, type ValidationResult, type VaultFile, type VaultFolder, type VaultListResponse, VaultResource, type VaultStats, type VaultUploadRequest, type VerificationResult, VerifyResource, type ViewColumn, type ViewTemplate, type Wallet, type WalletBalance, WalletClient, type WalletCreationResult, type WalletCredential, type WalletCredentialVerifySummary, type WalletStats, type Webhook, WebhooksResource, tenantApiUrl };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,39 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* HTTP Client for ProofChain API
|
|
3
3
|
*/
|
|
4
|
+
/**
|
|
5
|
+
* Returns the per-tenant Cloudflare edge API URL for `slug`.
|
|
6
|
+
*
|
|
7
|
+
* Cloudflare can cache responses from per-tenant hosts
|
|
8
|
+
* (`https://{slug}.proofchain.co.za/api`) because the full URL is the cache
|
|
9
|
+
* key. The shared `api.proofchain.co.za` host is keyed on the `X-Tenant-ID`
|
|
10
|
+
* header and cannot be cached safely at the CDN layer.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* import { tenantApiUrl, ProofChain } from '@proofchain/sdk';
|
|
15
|
+
*
|
|
16
|
+
* const client = new ProofChain({
|
|
17
|
+
* apiKey: 'atst_…',
|
|
18
|
+
* baseUrl: tenantApiUrl('acme'), // https://acme.proofchain.co.za/api
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
declare function tenantApiUrl(slug: string): string;
|
|
4
23
|
interface HttpClientOptions {
|
|
5
24
|
apiKey?: string;
|
|
6
25
|
userToken?: string;
|
|
7
26
|
tenantId?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Explicit base URL — highest precedence.
|
|
29
|
+
* Covers custom domains (e.g. `https://fanpass.onefootball.com/api`).
|
|
30
|
+
*/
|
|
8
31
|
baseUrl?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Tenant slug used to derive the per-tenant edge URL when no explicit
|
|
34
|
+
* `baseUrl` is provided. Precedence: baseUrl > tenant > default.
|
|
35
|
+
*/
|
|
36
|
+
tenant?: string;
|
|
9
37
|
timeout?: number;
|
|
10
38
|
maxRetries?: number;
|
|
11
39
|
}
|
|
@@ -385,9 +413,51 @@ interface ProofChainOptions {
|
|
|
385
413
|
apiKey?: string;
|
|
386
414
|
/** End-user JWT for JWKS auth (alternative to apiKey). For PWA clients. */
|
|
387
415
|
userToken?: string;
|
|
388
|
-
/**
|
|
416
|
+
/**
|
|
417
|
+
* Tenant slug or client_id. Required when using userToken.
|
|
418
|
+
*
|
|
419
|
+
* When used as the sole host hint (no explicit `baseUrl`), the SDK also
|
|
420
|
+
* derives the base URL as `https://{tenantId}.proofchain.co.za/api` so
|
|
421
|
+
* requests hit the per-tenant Cloudflare edge host — enabling response
|
|
422
|
+
* caching that the shared `api.proofchain.co.za` origin cannot provide
|
|
423
|
+
* (the shared host is keyed on headers, not URL, and is therefore
|
|
424
|
+
* uncacheable at the CDN layer).
|
|
425
|
+
*/
|
|
389
426
|
tenantId?: string;
|
|
427
|
+
/**
|
|
428
|
+
* Override the API base URL (highest precedence).
|
|
429
|
+
*
|
|
430
|
+
* Use this for custom domains (e.g. `https://fanpass-portal.onefootball.com/api`)
|
|
431
|
+
* or self-hosted deployments. When omitted and `tenantId` is set, the SDK
|
|
432
|
+
* automatically uses `https://{tenantId}.proofchain.co.za/api`.
|
|
433
|
+
*
|
|
434
|
+
* Precedence: `baseUrl` > `tenantId`-derived URL > shared default.
|
|
435
|
+
*/
|
|
390
436
|
baseUrl?: string;
|
|
437
|
+
/**
|
|
438
|
+
* Tenant slug used to derive the per-tenant Cloudflare edge URL
|
|
439
|
+
* (`https://{tenant}.proofchain.co.za/api`) when no explicit `baseUrl` is
|
|
440
|
+
* supplied.
|
|
441
|
+
*
|
|
442
|
+
* Edge caching requires the per-tenant host: the shared `api.proofchain.co.za`
|
|
443
|
+
* host is keyed on the `X-Tenant-ID` header and cannot be safely cached by
|
|
444
|
+
* Cloudflare. Providing this option is the easiest way for integrators to opt
|
|
445
|
+
* into cached responses without managing a custom domain.
|
|
446
|
+
*
|
|
447
|
+
* @example
|
|
448
|
+
* ```typescript
|
|
449
|
+
* // Requests go to https://acme.proofchain.co.za/api — edge cached.
|
|
450
|
+
* const client = new ProofChain({ apiKey: 'atst_…', tenant: 'acme' });
|
|
451
|
+
*
|
|
452
|
+
* // Custom domain takes precedence; tenant is ignored for URL derivation.
|
|
453
|
+
* const client = new ProofChain({
|
|
454
|
+
* apiKey: 'atst_…',
|
|
455
|
+
* tenant: 'acme',
|
|
456
|
+
* baseUrl: 'https://fanpass.onefootball.com/api',
|
|
457
|
+
* });
|
|
458
|
+
* ```
|
|
459
|
+
*/
|
|
460
|
+
tenant?: string;
|
|
391
461
|
timeout?: number;
|
|
392
462
|
maxRetries?: number;
|
|
393
463
|
}
|
|
@@ -4206,4 +4276,4 @@ declare class TimeoutError extends ProofChainError {
|
|
|
4206
4276
|
constructor(message?: string);
|
|
4207
4277
|
}
|
|
4208
4278
|
|
|
4209
|
-
export { type Achievement, type ActivitySummaryView, type AddNFTRequest, type AnchorResult, type ApiKey, type AttestRequest, type AttestationConfig, type AttestationMode, type Attestation as AttestationRecord, type AttestationResult, type AttestationSchema, AttestationsClient, AuthenticationError, AuthorizationError, type AvailableView, type Badge, type BatchIngestRequest, type BatchIngestResponse, type BatchVerifyResult, type BlockchainProof, type BlockchainStats, type Certificate, type CertificateVerifyResult, CertificatesResource, type Channel, type ChannelState, type ChannelStatus, ChannelsResource, type ClaimNFTResult, type ClaimRewardResult, type CohortDefinition, type CohortGroupStats, CohortLeaderboardClient, type CohortLeaderboardEntry, type CohortLeaderboardOptions, type CohortLeaderboardResponse, type ComprehensiveWalletInfo, type CreateAchievementRequest, type CreateApiKeyRequest, type CreateAttestationRequest, type CreateBadgeRequest, type CreateChannelRequest, type CreateCredentialTypeRequest, type CreateDataViewRequest, type CreateDualWalletsRequest, type CreateEndUserRequest, type CreateEventRequest, type CreatePassportDefinitionRequest, type CreatePassportRequest, type CreateQuestRequest, type CreateQuestStepRequest, type CreateRewardDefinitionRequest, type CreateSchemaRequest, type CreateTemplateFieldRequest, type CreateTemplateRequest, type CreateWalletRequest as CreateUserWalletRequest, type CreateWalletRequest$1 as CreateWalletRequest, type CreateWebhookRequest, type CredentialType, type CredentialVerifyResult, CredentialsClient, type DataViewColumn, type DataViewComputation, type DataViewDetail, type DataViewExecuteResult, type DataViewInfo, type DataViewListResponse, type DataViewPreviewRequest, type DataViewPreviewResult, type DataViewSummary, DataViewsClient, type DistributeResult, DocumentsResource, type DualWallets, type EarnedReward, type EndUser, EndUserIngestionClient, type EndUserIngestionClientOptions, type EndUserListResponse, EndUsersClient, type Event, type EventBatchProof, type EventMetadata, type EventStatus, EventsResource, type ExecuteSwapRequest, type Facet, type FacetsResponse, type FanProfileView, type FanpassGroupStats, FanpassLeaderboardClient, type FanpassLeaderboardEntry, type FanpassLeaderboardOptions, type FanpassLeaderboardResponse, type FanpassUserComparisonResponse, type FieldValue, type GDPRDeletionRequest, type GDPRDeletionResponse, type GDPRPreviewResponse, type IngestEventRequest, type IngestEventResponse, IngestionClient, type IngestionClientOptions, type IssueCertificateRequest, type IssueCredentialRequest, type IssuedCredential, type LeaderboardUserProfile$1 as LeaderboardUserProfile, type LinkWalletRequest, type ListAttestationsOptions, type ListCertificatesRequest, type ListCohortsOptions, type ListEndUsersOptions, type ListEventsRequest, type ListIssuedCredentialsOptions, type ListMintsOptions, type ListMintsResponse, type ListQuestsOptions, type ListRewardsOptions, type ListSchemasOptions, type ListWalletCredentialsOptions, type ManualRewardRequest, type MergeUsersRequest, type Milestone, type MintNFTRequest, type NFT, type NFTMint, NetworkError, NftClient, NotFoundError, type NotificationCallback, type NotificationEvent, type NotificationEventType, NotificationsClient, type OTTConfigResponse, type OTTConfigUpdate, type OTTGenerateRequest, type OTTGenerateResponse, type OTTRedeemResponse, type OTTRequestResponse, PartnerKeysClient, type Passport, PassportClient, type PassportDefinition, type PassportFieldValue, type PassportHistory, type PassportTemplate, type PassportV2Data, type PassportWithFields, ProofChain, ProofChainError, type ProofChainOptions, type ProofVerifyResult, type PushSubscriptionJSON, type Quest, type QuestStep, type QuestWithProgress, QuestsClient, RateLimitError, type RegisterWalletRequest, type RevokeResult, type RewardAsset, type RewardAttestationResult, type RewardDefinition, type RewardEarned, type VerifyResult as RewardVerifyResult, RewardsClient, type Schema, type SchemaDetail, type SchemaField, type SchemaListResponse, type ValidationError$1 as SchemaValidationError, SchemasClient, type SearchFilters, type SearchQueryRequest, type SearchRequest, SearchResource, type SearchResponse, type SearchResult, type SearchStats, ServerError, type SetProfileRequest, type Settlement, type StepCompletionResult, type StepProgress, type StepStartResult, type StreamAck, type StreamEventRequest, type SubscribeOptions, type SwapQuote, type SwapQuoteRequest, type SwapResult, type TemplateField, type TenantInfo, TenantResource, type TierDefinition, TimeoutError, type TokenBalance, type TransferRequest, type TransferResult, type Unsubscribe, type UpdateConfigRequest as UpdateAttestationConfigRequest, type UpdateDataViewRequest, type UpdateEndUserRequest, type UpdatePassportRequest, type UpdateWebhookRequest, type UsageStats, type UserAchievement, type UserActivity, type UserActivityResponse, type UserBadge, type UserBreakdownResponse, type UserCohortBreakdownEntry, type UserCredentialsSummary, type UserQuestProgress, type UserReward$1 as UserReward, type UserRewardsResponse, type UserWalletSummary, type UserWithWallets, type UsersWithWalletsResponse, type ValidateDataRequest, ValidationError, type ValidationErrorDetail, type ValidationResult, type VaultFile, type VaultFolder, type VaultListResponse, VaultResource, type VaultStats, type VaultUploadRequest, type VerificationResult, VerifyResource, type ViewColumn, type ViewTemplate, type Wallet, type WalletBalance, WalletClient, type WalletCreationResult, type WalletCredential, type WalletCredentialVerifySummary, type WalletStats, type Webhook, WebhooksResource };
|
|
4279
|
+
export { type Achievement, type ActivitySummaryView, type AddNFTRequest, type AnchorResult, type ApiKey, type AttestRequest, type AttestationConfig, type AttestationMode, type Attestation as AttestationRecord, type AttestationResult, type AttestationSchema, AttestationsClient, AuthenticationError, AuthorizationError, type AvailableView, type Badge, type BatchIngestRequest, type BatchIngestResponse, type BatchVerifyResult, type BlockchainProof, type BlockchainStats, type Certificate, type CertificateVerifyResult, CertificatesResource, type Channel, type ChannelState, type ChannelStatus, ChannelsResource, type ClaimNFTResult, type ClaimRewardResult, type CohortDefinition, type CohortGroupStats, CohortLeaderboardClient, type CohortLeaderboardEntry, type CohortLeaderboardOptions, type CohortLeaderboardResponse, type ComprehensiveWalletInfo, type CreateAchievementRequest, type CreateApiKeyRequest, type CreateAttestationRequest, type CreateBadgeRequest, type CreateChannelRequest, type CreateCredentialTypeRequest, type CreateDataViewRequest, type CreateDualWalletsRequest, type CreateEndUserRequest, type CreateEventRequest, type CreatePassportDefinitionRequest, type CreatePassportRequest, type CreateQuestRequest, type CreateQuestStepRequest, type CreateRewardDefinitionRequest, type CreateSchemaRequest, type CreateTemplateFieldRequest, type CreateTemplateRequest, type CreateWalletRequest as CreateUserWalletRequest, type CreateWalletRequest$1 as CreateWalletRequest, type CreateWebhookRequest, type CredentialType, type CredentialVerifyResult, CredentialsClient, type DataViewColumn, type DataViewComputation, type DataViewDetail, type DataViewExecuteResult, type DataViewInfo, type DataViewListResponse, type DataViewPreviewRequest, type DataViewPreviewResult, type DataViewSummary, DataViewsClient, type DistributeResult, DocumentsResource, type DualWallets, type EarnedReward, type EndUser, EndUserIngestionClient, type EndUserIngestionClientOptions, type EndUserListResponse, EndUsersClient, type Event, type EventBatchProof, type EventMetadata, type EventStatus, EventsResource, type ExecuteSwapRequest, type Facet, type FacetsResponse, type FanProfileView, type FanpassGroupStats, FanpassLeaderboardClient, type FanpassLeaderboardEntry, type FanpassLeaderboardOptions, type FanpassLeaderboardResponse, type FanpassUserComparisonResponse, type FieldValue, type GDPRDeletionRequest, type GDPRDeletionResponse, type GDPRPreviewResponse, type IngestEventRequest, type IngestEventResponse, IngestionClient, type IngestionClientOptions, type IssueCertificateRequest, type IssueCredentialRequest, type IssuedCredential, type LeaderboardUserProfile$1 as LeaderboardUserProfile, type LinkWalletRequest, type ListAttestationsOptions, type ListCertificatesRequest, type ListCohortsOptions, type ListEndUsersOptions, type ListEventsRequest, type ListIssuedCredentialsOptions, type ListMintsOptions, type ListMintsResponse, type ListQuestsOptions, type ListRewardsOptions, type ListSchemasOptions, type ListWalletCredentialsOptions, type ManualRewardRequest, type MergeUsersRequest, type Milestone, type MintNFTRequest, type NFT, type NFTMint, NetworkError, NftClient, NotFoundError, type NotificationCallback, type NotificationEvent, type NotificationEventType, NotificationsClient, type OTTConfigResponse, type OTTConfigUpdate, type OTTGenerateRequest, type OTTGenerateResponse, type OTTRedeemResponse, type OTTRequestResponse, PartnerKeysClient, type Passport, PassportClient, type PassportDefinition, type PassportFieldValue, type PassportHistory, type PassportTemplate, type PassportV2Data, type PassportWithFields, ProofChain, ProofChainError, type ProofChainOptions, type ProofVerifyResult, type PushSubscriptionJSON, type Quest, type QuestStep, type QuestWithProgress, QuestsClient, RateLimitError, type RegisterWalletRequest, type RevokeResult, type RewardAsset, type RewardAttestationResult, type RewardDefinition, type RewardEarned, type VerifyResult as RewardVerifyResult, RewardsClient, type Schema, type SchemaDetail, type SchemaField, type SchemaListResponse, type ValidationError$1 as SchemaValidationError, SchemasClient, type SearchFilters, type SearchQueryRequest, type SearchRequest, SearchResource, type SearchResponse, type SearchResult, type SearchStats, ServerError, type SetProfileRequest, type Settlement, type StepCompletionResult, type StepProgress, type StepStartResult, type StreamAck, type StreamEventRequest, type SubscribeOptions, type SwapQuote, type SwapQuoteRequest, type SwapResult, type TemplateField, type TenantInfo, TenantResource, type TierDefinition, TimeoutError, type TokenBalance, type TransferRequest, type TransferResult, type Unsubscribe, type UpdateConfigRequest as UpdateAttestationConfigRequest, type UpdateDataViewRequest, type UpdateEndUserRequest, type UpdatePassportRequest, type UpdateWebhookRequest, type UsageStats, type UserAchievement, type UserActivity, type UserActivityResponse, type UserBadge, type UserBreakdownResponse, type UserCohortBreakdownEntry, type UserCredentialsSummary, type UserQuestProgress, type UserReward$1 as UserReward, type UserRewardsResponse, type UserWalletSummary, type UserWithWallets, type UsersWithWalletsResponse, type ValidateDataRequest, ValidationError, type ValidationErrorDetail, type ValidationResult, type VaultFile, type VaultFolder, type VaultListResponse, VaultResource, type VaultStats, type VaultUploadRequest, type VerificationResult, VerifyResource, type ViewColumn, type ViewTemplate, type Wallet, type WalletBalance, WalletClient, type WalletCreationResult, type WalletCredential, type WalletCredentialVerifySummary, type WalletStats, type Webhook, WebhooksResource, tenantApiUrl };
|
package/dist/index.js
CHANGED
|
@@ -54,7 +54,8 @@ __export(index_exports, {
|
|
|
54
54
|
VaultResource: () => VaultResource,
|
|
55
55
|
VerifyResource: () => VerifyResource,
|
|
56
56
|
WalletClient: () => WalletClient,
|
|
57
|
-
WebhooksResource: () => WebhooksResource
|
|
57
|
+
WebhooksResource: () => WebhooksResource,
|
|
58
|
+
tenantApiUrl: () => tenantApiUrl
|
|
58
59
|
});
|
|
59
60
|
module.exports = __toCommonJS(index_exports);
|
|
60
61
|
|
|
@@ -123,6 +124,9 @@ var TimeoutError = class extends ProofChainError {
|
|
|
123
124
|
var DEFAULT_BASE_URL = "https://api.proofchain.co.za";
|
|
124
125
|
var DEFAULT_TIMEOUT = 3e4;
|
|
125
126
|
var USER_AGENT = "proofchain-js/0.1.0";
|
|
127
|
+
function tenantApiUrl(slug) {
|
|
128
|
+
return `https://${slug}.proofchain.co.za/api`;
|
|
129
|
+
}
|
|
126
130
|
var HttpClient = class {
|
|
127
131
|
constructor(options) {
|
|
128
132
|
// In-flight GET de-duplication: concurrent identical GETs share one network
|
|
@@ -131,7 +135,8 @@ var HttpClient = class {
|
|
|
131
135
|
this.apiKey = options.apiKey || "";
|
|
132
136
|
this.userToken = options.userToken || "";
|
|
133
137
|
this.tenantId = options.tenantId || "";
|
|
134
|
-
|
|
138
|
+
const resolvedBase = options.baseUrl || (options.tenant ? tenantApiUrl(options.tenant) : DEFAULT_BASE_URL);
|
|
139
|
+
this.baseUrl = resolvedBase.replace(/\/$/, "");
|
|
135
140
|
this.timeout = options.timeout || DEFAULT_TIMEOUT;
|
|
136
141
|
this.maxRetries = options.maxRetries ?? 3;
|
|
137
142
|
}
|
|
@@ -3693,5 +3698,6 @@ var EndUserIngestionClient = class {
|
|
|
3693
3698
|
VaultResource,
|
|
3694
3699
|
VerifyResource,
|
|
3695
3700
|
WalletClient,
|
|
3696
|
-
WebhooksResource
|
|
3701
|
+
WebhooksResource,
|
|
3702
|
+
tenantApiUrl
|
|
3697
3703
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -63,6 +63,9 @@ var TimeoutError = class extends ProofChainError {
|
|
|
63
63
|
var DEFAULT_BASE_URL = "https://api.proofchain.co.za";
|
|
64
64
|
var DEFAULT_TIMEOUT = 3e4;
|
|
65
65
|
var USER_AGENT = "proofchain-js/0.1.0";
|
|
66
|
+
function tenantApiUrl(slug) {
|
|
67
|
+
return `https://${slug}.proofchain.co.za/api`;
|
|
68
|
+
}
|
|
66
69
|
var HttpClient = class {
|
|
67
70
|
constructor(options) {
|
|
68
71
|
// In-flight GET de-duplication: concurrent identical GETs share one network
|
|
@@ -71,7 +74,8 @@ var HttpClient = class {
|
|
|
71
74
|
this.apiKey = options.apiKey || "";
|
|
72
75
|
this.userToken = options.userToken || "";
|
|
73
76
|
this.tenantId = options.tenantId || "";
|
|
74
|
-
|
|
77
|
+
const resolvedBase = options.baseUrl || (options.tenant ? tenantApiUrl(options.tenant) : DEFAULT_BASE_URL);
|
|
78
|
+
this.baseUrl = resolvedBase.replace(/\/$/, "");
|
|
75
79
|
this.timeout = options.timeout || DEFAULT_TIMEOUT;
|
|
76
80
|
this.maxRetries = options.maxRetries ?? 3;
|
|
77
81
|
}
|
|
@@ -3632,5 +3636,6 @@ export {
|
|
|
3632
3636
|
VaultResource,
|
|
3633
3637
|
VerifyResource,
|
|
3634
3638
|
WalletClient,
|
|
3635
|
-
WebhooksResource
|
|
3639
|
+
WebhooksResource,
|
|
3640
|
+
tenantApiUrl
|
|
3636
3641
|
};
|
package/package.json
CHANGED