@proofchain/sdk 2.22.0 → 2.23.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 +42 -6
- package/dist/index.d.ts +42 -6
- package/dist/index.js +32 -9
- package/dist/index.mjs +32 -9
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -3520,12 +3520,29 @@ declare class NftClient {
|
|
|
3520
3520
|
|
|
3521
3521
|
/**
|
|
3522
3522
|
* Partner Keys Resource - OTT (One-Time Token) auth for partner integrations
|
|
3523
|
+
*
|
|
3524
|
+
* Flow:
|
|
3525
|
+
* 1. Mobile app generates OTT: POST /partner-keys/generate (tenant API key + user JWT)
|
|
3526
|
+
* 2. OTT is passed to partner webview via URL param
|
|
3527
|
+
* 3. Partner backend redeems OTT: POST /partner-keys/redeem (integrator API key)
|
|
3523
3528
|
*/
|
|
3524
3529
|
|
|
3525
|
-
interface
|
|
3530
|
+
interface OTTGenerateRequest {
|
|
3531
|
+
ttl?: number;
|
|
3532
|
+
session_data_keys?: string[];
|
|
3533
|
+
}
|
|
3534
|
+
interface OTTGenerateResponse {
|
|
3526
3535
|
ott: string;
|
|
3527
3536
|
expires_in: number;
|
|
3528
3537
|
}
|
|
3538
|
+
interface OTTRedeemResponse {
|
|
3539
|
+
user_id: string;
|
|
3540
|
+
tenant_id: string;
|
|
3541
|
+
tenant_name: string | null;
|
|
3542
|
+
session_data: Record<string, unknown>;
|
|
3543
|
+
issued_at: string;
|
|
3544
|
+
expires_at: string;
|
|
3545
|
+
}
|
|
3529
3546
|
interface OTTConfigUpdate {
|
|
3530
3547
|
ott_enabled?: boolean;
|
|
3531
3548
|
ott_ttl_seconds?: number;
|
|
@@ -3542,21 +3559,40 @@ interface OTTConfigResponse {
|
|
|
3542
3559
|
ott_jwt_ttl_seconds: number;
|
|
3543
3560
|
ott_session_data_keys?: string[];
|
|
3544
3561
|
}
|
|
3562
|
+
/** @deprecated Use OTTGenerateResponse */
|
|
3563
|
+
type OTTRequestResponse = OTTGenerateResponse;
|
|
3545
3564
|
declare class PartnerKeysClient {
|
|
3546
3565
|
private http;
|
|
3547
3566
|
constructor(http: HttpClient);
|
|
3548
3567
|
/**
|
|
3549
|
-
*
|
|
3568
|
+
* Generate a one-time token for the authenticated end-user.
|
|
3569
|
+
*
|
|
3570
|
+
* Requires: tenant API key (X-API-Key) + end-user JWT (Authorization: Bearer).
|
|
3571
|
+
* The SDK must be initialised with both `apiKey` and `userToken`.
|
|
3572
|
+
*
|
|
3573
|
+
* @param options.ttl - Token lifetime in seconds (30–3600, default 300)
|
|
3574
|
+
* @param options.session_data_keys - Whitelist of JWT claims to include
|
|
3575
|
+
*/
|
|
3576
|
+
generate(options?: OTTGenerateRequest): Promise<OTTGenerateResponse>;
|
|
3577
|
+
/**
|
|
3578
|
+
* Redeem a one-time token to get the user's identity.
|
|
3579
|
+
*
|
|
3580
|
+
* Requires: integrator API key (X-API-Key). The token is single-use
|
|
3581
|
+
* and deleted on successful redemption.
|
|
3582
|
+
*
|
|
3583
|
+
* @param ott - The opaque one-time token
|
|
3550
3584
|
*/
|
|
3551
|
-
|
|
3585
|
+
redeem(ott: string): Promise<OTTRedeemResponse>;
|
|
3552
3586
|
/**
|
|
3553
|
-
* Update OTT configuration for a partner key.
|
|
3587
|
+
* Update OTT configuration for a partner key (tenant admin).
|
|
3554
3588
|
*/
|
|
3555
3589
|
updateOTTConfig(keyId: string, config: OTTConfigUpdate): Promise<OTTConfigResponse>;
|
|
3556
3590
|
/**
|
|
3557
|
-
* Get OTT configuration for a partner key.
|
|
3591
|
+
* Get OTT configuration for a partner key (tenant admin).
|
|
3558
3592
|
*/
|
|
3559
3593
|
getOTTConfig(keyId: string): Promise<OTTConfigResponse>;
|
|
3594
|
+
/** @deprecated Use generate() */
|
|
3595
|
+
requestOTT(_keyId: string): Promise<OTTGenerateResponse>;
|
|
3560
3596
|
}
|
|
3561
3597
|
|
|
3562
3598
|
/**
|
|
@@ -4150,4 +4186,4 @@ declare class TimeoutError extends ProofChainError {
|
|
|
4150
4186
|
constructor(message?: string);
|
|
4151
4187
|
}
|
|
4152
4188
|
|
|
4153
|
-
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 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 };
|
|
4189
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -3520,12 +3520,29 @@ declare class NftClient {
|
|
|
3520
3520
|
|
|
3521
3521
|
/**
|
|
3522
3522
|
* Partner Keys Resource - OTT (One-Time Token) auth for partner integrations
|
|
3523
|
+
*
|
|
3524
|
+
* Flow:
|
|
3525
|
+
* 1. Mobile app generates OTT: POST /partner-keys/generate (tenant API key + user JWT)
|
|
3526
|
+
* 2. OTT is passed to partner webview via URL param
|
|
3527
|
+
* 3. Partner backend redeems OTT: POST /partner-keys/redeem (integrator API key)
|
|
3523
3528
|
*/
|
|
3524
3529
|
|
|
3525
|
-
interface
|
|
3530
|
+
interface OTTGenerateRequest {
|
|
3531
|
+
ttl?: number;
|
|
3532
|
+
session_data_keys?: string[];
|
|
3533
|
+
}
|
|
3534
|
+
interface OTTGenerateResponse {
|
|
3526
3535
|
ott: string;
|
|
3527
3536
|
expires_in: number;
|
|
3528
3537
|
}
|
|
3538
|
+
interface OTTRedeemResponse {
|
|
3539
|
+
user_id: string;
|
|
3540
|
+
tenant_id: string;
|
|
3541
|
+
tenant_name: string | null;
|
|
3542
|
+
session_data: Record<string, unknown>;
|
|
3543
|
+
issued_at: string;
|
|
3544
|
+
expires_at: string;
|
|
3545
|
+
}
|
|
3529
3546
|
interface OTTConfigUpdate {
|
|
3530
3547
|
ott_enabled?: boolean;
|
|
3531
3548
|
ott_ttl_seconds?: number;
|
|
@@ -3542,21 +3559,40 @@ interface OTTConfigResponse {
|
|
|
3542
3559
|
ott_jwt_ttl_seconds: number;
|
|
3543
3560
|
ott_session_data_keys?: string[];
|
|
3544
3561
|
}
|
|
3562
|
+
/** @deprecated Use OTTGenerateResponse */
|
|
3563
|
+
type OTTRequestResponse = OTTGenerateResponse;
|
|
3545
3564
|
declare class PartnerKeysClient {
|
|
3546
3565
|
private http;
|
|
3547
3566
|
constructor(http: HttpClient);
|
|
3548
3567
|
/**
|
|
3549
|
-
*
|
|
3568
|
+
* Generate a one-time token for the authenticated end-user.
|
|
3569
|
+
*
|
|
3570
|
+
* Requires: tenant API key (X-API-Key) + end-user JWT (Authorization: Bearer).
|
|
3571
|
+
* The SDK must be initialised with both `apiKey` and `userToken`.
|
|
3572
|
+
*
|
|
3573
|
+
* @param options.ttl - Token lifetime in seconds (30–3600, default 300)
|
|
3574
|
+
* @param options.session_data_keys - Whitelist of JWT claims to include
|
|
3575
|
+
*/
|
|
3576
|
+
generate(options?: OTTGenerateRequest): Promise<OTTGenerateResponse>;
|
|
3577
|
+
/**
|
|
3578
|
+
* Redeem a one-time token to get the user's identity.
|
|
3579
|
+
*
|
|
3580
|
+
* Requires: integrator API key (X-API-Key). The token is single-use
|
|
3581
|
+
* and deleted on successful redemption.
|
|
3582
|
+
*
|
|
3583
|
+
* @param ott - The opaque one-time token
|
|
3550
3584
|
*/
|
|
3551
|
-
|
|
3585
|
+
redeem(ott: string): Promise<OTTRedeemResponse>;
|
|
3552
3586
|
/**
|
|
3553
|
-
* Update OTT configuration for a partner key.
|
|
3587
|
+
* Update OTT configuration for a partner key (tenant admin).
|
|
3554
3588
|
*/
|
|
3555
3589
|
updateOTTConfig(keyId: string, config: OTTConfigUpdate): Promise<OTTConfigResponse>;
|
|
3556
3590
|
/**
|
|
3557
|
-
* Get OTT configuration for a partner key.
|
|
3591
|
+
* Get OTT configuration for a partner key (tenant admin).
|
|
3558
3592
|
*/
|
|
3559
3593
|
getOTTConfig(keyId: string): Promise<OTTConfigResponse>;
|
|
3594
|
+
/** @deprecated Use generate() */
|
|
3595
|
+
requestOTT(_keyId: string): Promise<OTTGenerateResponse>;
|
|
3560
3596
|
}
|
|
3561
3597
|
|
|
3562
3598
|
/**
|
|
@@ -4150,4 +4186,4 @@ declare class TimeoutError extends ProofChainError {
|
|
|
4150
4186
|
constructor(message?: string);
|
|
4151
4187
|
}
|
|
4152
4188
|
|
|
4153
|
-
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 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 };
|
|
4189
|
+
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 };
|
package/dist/index.js
CHANGED
|
@@ -137,13 +137,14 @@ var HttpClient = class {
|
|
|
137
137
|
"Content-Type": "application/json",
|
|
138
138
|
"User-Agent": USER_AGENT
|
|
139
139
|
};
|
|
140
|
+
if (this.apiKey) {
|
|
141
|
+
headers["X-API-Key"] = this.apiKey;
|
|
142
|
+
}
|
|
140
143
|
if (this.userToken) {
|
|
141
144
|
headers["Authorization"] = `Bearer ${this.userToken}`;
|
|
142
145
|
if (this.tenantId) {
|
|
143
146
|
headers["X-Tenant-ID"] = this.tenantId;
|
|
144
147
|
}
|
|
145
|
-
} else if (this.apiKey) {
|
|
146
|
-
headers["X-API-Key"] = this.apiKey;
|
|
147
148
|
}
|
|
148
149
|
return headers;
|
|
149
150
|
}
|
|
@@ -239,13 +240,14 @@ var HttpClient = class {
|
|
|
239
240
|
const headers = {
|
|
240
241
|
"User-Agent": USER_AGENT
|
|
241
242
|
};
|
|
243
|
+
if (this.apiKey) {
|
|
244
|
+
headers["X-API-Key"] = this.apiKey;
|
|
245
|
+
}
|
|
242
246
|
if (this.userToken) {
|
|
243
247
|
headers["Authorization"] = `Bearer ${this.userToken}`;
|
|
244
248
|
if (this.tenantId) {
|
|
245
249
|
headers["X-Tenant-ID"] = this.tenantId;
|
|
246
250
|
}
|
|
247
|
-
} else if (this.apiKey) {
|
|
248
|
-
headers["X-API-Key"] = this.apiKey;
|
|
249
251
|
}
|
|
250
252
|
return this.fetchWithRetry(url, {
|
|
251
253
|
method: "POST",
|
|
@@ -2711,23 +2713,44 @@ var PartnerKeysClient = class {
|
|
|
2711
2713
|
this.http = http;
|
|
2712
2714
|
}
|
|
2713
2715
|
/**
|
|
2714
|
-
*
|
|
2716
|
+
* Generate a one-time token for the authenticated end-user.
|
|
2717
|
+
*
|
|
2718
|
+
* Requires: tenant API key (X-API-Key) + end-user JWT (Authorization: Bearer).
|
|
2719
|
+
* The SDK must be initialised with both `apiKey` and `userToken`.
|
|
2720
|
+
*
|
|
2721
|
+
* @param options.ttl - Token lifetime in seconds (30–3600, default 300)
|
|
2722
|
+
* @param options.session_data_keys - Whitelist of JWT claims to include
|
|
2723
|
+
*/
|
|
2724
|
+
async generate(options) {
|
|
2725
|
+
return this.http.post("/partner-keys/generate", options ?? {});
|
|
2726
|
+
}
|
|
2727
|
+
/**
|
|
2728
|
+
* Redeem a one-time token to get the user's identity.
|
|
2729
|
+
*
|
|
2730
|
+
* Requires: integrator API key (X-API-Key). The token is single-use
|
|
2731
|
+
* and deleted on successful redemption.
|
|
2732
|
+
*
|
|
2733
|
+
* @param ott - The opaque one-time token
|
|
2715
2734
|
*/
|
|
2716
|
-
async
|
|
2717
|
-
return this.http.post(
|
|
2735
|
+
async redeem(ott) {
|
|
2736
|
+
return this.http.post("/partner-keys/redeem", { ott });
|
|
2718
2737
|
}
|
|
2719
2738
|
/**
|
|
2720
|
-
* Update OTT configuration for a partner key.
|
|
2739
|
+
* Update OTT configuration for a partner key (tenant admin).
|
|
2721
2740
|
*/
|
|
2722
2741
|
async updateOTTConfig(keyId, config) {
|
|
2723
2742
|
return this.http.patch(`/partner-keys/${keyId}/ott-config`, config);
|
|
2724
2743
|
}
|
|
2725
2744
|
/**
|
|
2726
|
-
* Get OTT configuration for a partner key.
|
|
2745
|
+
* Get OTT configuration for a partner key (tenant admin).
|
|
2727
2746
|
*/
|
|
2728
2747
|
async getOTTConfig(keyId) {
|
|
2729
2748
|
return this.http.get(`/partner-keys/${keyId}/ott-config`);
|
|
2730
2749
|
}
|
|
2750
|
+
/** @deprecated Use generate() */
|
|
2751
|
+
async requestOTT(_keyId) {
|
|
2752
|
+
return this.generate();
|
|
2753
|
+
}
|
|
2731
2754
|
};
|
|
2732
2755
|
|
|
2733
2756
|
// src/attestations.ts
|
package/dist/index.mjs
CHANGED
|
@@ -77,13 +77,14 @@ var HttpClient = class {
|
|
|
77
77
|
"Content-Type": "application/json",
|
|
78
78
|
"User-Agent": USER_AGENT
|
|
79
79
|
};
|
|
80
|
+
if (this.apiKey) {
|
|
81
|
+
headers["X-API-Key"] = this.apiKey;
|
|
82
|
+
}
|
|
80
83
|
if (this.userToken) {
|
|
81
84
|
headers["Authorization"] = `Bearer ${this.userToken}`;
|
|
82
85
|
if (this.tenantId) {
|
|
83
86
|
headers["X-Tenant-ID"] = this.tenantId;
|
|
84
87
|
}
|
|
85
|
-
} else if (this.apiKey) {
|
|
86
|
-
headers["X-API-Key"] = this.apiKey;
|
|
87
88
|
}
|
|
88
89
|
return headers;
|
|
89
90
|
}
|
|
@@ -179,13 +180,14 @@ var HttpClient = class {
|
|
|
179
180
|
const headers = {
|
|
180
181
|
"User-Agent": USER_AGENT
|
|
181
182
|
};
|
|
183
|
+
if (this.apiKey) {
|
|
184
|
+
headers["X-API-Key"] = this.apiKey;
|
|
185
|
+
}
|
|
182
186
|
if (this.userToken) {
|
|
183
187
|
headers["Authorization"] = `Bearer ${this.userToken}`;
|
|
184
188
|
if (this.tenantId) {
|
|
185
189
|
headers["X-Tenant-ID"] = this.tenantId;
|
|
186
190
|
}
|
|
187
|
-
} else if (this.apiKey) {
|
|
188
|
-
headers["X-API-Key"] = this.apiKey;
|
|
189
191
|
}
|
|
190
192
|
return this.fetchWithRetry(url, {
|
|
191
193
|
method: "POST",
|
|
@@ -2651,23 +2653,44 @@ var PartnerKeysClient = class {
|
|
|
2651
2653
|
this.http = http;
|
|
2652
2654
|
}
|
|
2653
2655
|
/**
|
|
2654
|
-
*
|
|
2656
|
+
* Generate a one-time token for the authenticated end-user.
|
|
2657
|
+
*
|
|
2658
|
+
* Requires: tenant API key (X-API-Key) + end-user JWT (Authorization: Bearer).
|
|
2659
|
+
* The SDK must be initialised with both `apiKey` and `userToken`.
|
|
2660
|
+
*
|
|
2661
|
+
* @param options.ttl - Token lifetime in seconds (30–3600, default 300)
|
|
2662
|
+
* @param options.session_data_keys - Whitelist of JWT claims to include
|
|
2663
|
+
*/
|
|
2664
|
+
async generate(options) {
|
|
2665
|
+
return this.http.post("/partner-keys/generate", options ?? {});
|
|
2666
|
+
}
|
|
2667
|
+
/**
|
|
2668
|
+
* Redeem a one-time token to get the user's identity.
|
|
2669
|
+
*
|
|
2670
|
+
* Requires: integrator API key (X-API-Key). The token is single-use
|
|
2671
|
+
* and deleted on successful redemption.
|
|
2672
|
+
*
|
|
2673
|
+
* @param ott - The opaque one-time token
|
|
2655
2674
|
*/
|
|
2656
|
-
async
|
|
2657
|
-
return this.http.post(
|
|
2675
|
+
async redeem(ott) {
|
|
2676
|
+
return this.http.post("/partner-keys/redeem", { ott });
|
|
2658
2677
|
}
|
|
2659
2678
|
/**
|
|
2660
|
-
* Update OTT configuration for a partner key.
|
|
2679
|
+
* Update OTT configuration for a partner key (tenant admin).
|
|
2661
2680
|
*/
|
|
2662
2681
|
async updateOTTConfig(keyId, config) {
|
|
2663
2682
|
return this.http.patch(`/partner-keys/${keyId}/ott-config`, config);
|
|
2664
2683
|
}
|
|
2665
2684
|
/**
|
|
2666
|
-
* Get OTT configuration for a partner key.
|
|
2685
|
+
* Get OTT configuration for a partner key (tenant admin).
|
|
2667
2686
|
*/
|
|
2668
2687
|
async getOTTConfig(keyId) {
|
|
2669
2688
|
return this.http.get(`/partner-keys/${keyId}/ott-config`);
|
|
2670
2689
|
}
|
|
2690
|
+
/** @deprecated Use generate() */
|
|
2691
|
+
async requestOTT(_keyId) {
|
|
2692
|
+
return this.generate();
|
|
2693
|
+
}
|
|
2671
2694
|
};
|
|
2672
2695
|
|
|
2673
2696
|
// src/attestations.ts
|
package/package.json
CHANGED