@proofchain/sdk 2.21.0 → 2.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +3 -13
- package/dist/index.d.ts +3 -13
- package/dist/index.js +36 -30
- package/dist/index.mjs +36 -30
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -3526,12 +3526,6 @@ interface OTTRequestResponse {
|
|
|
3526
3526
|
ott: string;
|
|
3527
3527
|
expires_in: number;
|
|
3528
3528
|
}
|
|
3529
|
-
interface OTTRedeemResponse {
|
|
3530
|
-
user_id: string;
|
|
3531
|
-
session_timeout: number;
|
|
3532
|
-
session_data: Record<string, unknown>;
|
|
3533
|
-
jwt?: string;
|
|
3534
|
-
}
|
|
3535
3529
|
interface OTTConfigUpdate {
|
|
3536
3530
|
ott_enabled?: boolean;
|
|
3537
3531
|
ott_ttl_seconds?: number;
|
|
@@ -3555,12 +3549,6 @@ declare class PartnerKeysClient {
|
|
|
3555
3549
|
* Request a one-time token for a partner key (end-user JWKS auth).
|
|
3556
3550
|
*/
|
|
3557
3551
|
requestOTT(keyId: string): Promise<OTTRequestResponse>;
|
|
3558
|
-
/**
|
|
3559
|
-
* Redeem a one-time token (partner key auth).
|
|
3560
|
-
*/
|
|
3561
|
-
redeemOTT(body: {
|
|
3562
|
-
ott: string;
|
|
3563
|
-
}): Promise<OTTRedeemResponse>;
|
|
3564
3552
|
/**
|
|
3565
3553
|
* Update OTT configuration for a partner key.
|
|
3566
3554
|
*/
|
|
@@ -3826,6 +3814,8 @@ interface IngestEventRequest {
|
|
|
3826
3814
|
data?: Record<string, unknown>;
|
|
3827
3815
|
eventSource?: string;
|
|
3828
3816
|
schemaIds?: string[];
|
|
3817
|
+
/** Hot attestation — immediate on-chain TX per event (higher cost, lower latency) */
|
|
3818
|
+
hot?: boolean;
|
|
3829
3819
|
}
|
|
3830
3820
|
interface IngestEventResponse {
|
|
3831
3821
|
eventId: string;
|
|
@@ -3988,4 +3978,4 @@ declare class TimeoutError extends ProofChainError {
|
|
|
3988
3978
|
constructor(message?: string);
|
|
3989
3979
|
}
|
|
3990
3980
|
|
|
3991
|
-
export { type Achievement, type ActivitySummaryView, type AddNFTRequest, type AnchorResult, type ApiKey, type AttestRequest, type AttestationMode, type AttestationResult, 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 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 ListCertificatesRequest, type ListCohortsOptions, type ListEndUsersOptions, type ListEventsRequest, type ListIssuedCredentialsOptions, type ListMintsOptions, type ListMintsResponse, type ListQuestsOptions, type ListRewardsOptions, type ListSchemasOptions, 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
|
|
3981
|
+
export { type Achievement, type ActivitySummaryView, type AddNFTRequest, type AnchorResult, type ApiKey, type AttestRequest, type AttestationMode, type AttestationResult, 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 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 ListCertificatesRequest, type ListCohortsOptions, type ListEndUsersOptions, type ListEventsRequest, type ListIssuedCredentialsOptions, type ListMintsOptions, type ListMintsResponse, type ListQuestsOptions, type ListRewardsOptions, type ListSchemasOptions, 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 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 WalletStats, type Webhook, WebhooksResource };
|
package/dist/index.d.ts
CHANGED
|
@@ -3526,12 +3526,6 @@ interface OTTRequestResponse {
|
|
|
3526
3526
|
ott: string;
|
|
3527
3527
|
expires_in: number;
|
|
3528
3528
|
}
|
|
3529
|
-
interface OTTRedeemResponse {
|
|
3530
|
-
user_id: string;
|
|
3531
|
-
session_timeout: number;
|
|
3532
|
-
session_data: Record<string, unknown>;
|
|
3533
|
-
jwt?: string;
|
|
3534
|
-
}
|
|
3535
3529
|
interface OTTConfigUpdate {
|
|
3536
3530
|
ott_enabled?: boolean;
|
|
3537
3531
|
ott_ttl_seconds?: number;
|
|
@@ -3555,12 +3549,6 @@ declare class PartnerKeysClient {
|
|
|
3555
3549
|
* Request a one-time token for a partner key (end-user JWKS auth).
|
|
3556
3550
|
*/
|
|
3557
3551
|
requestOTT(keyId: string): Promise<OTTRequestResponse>;
|
|
3558
|
-
/**
|
|
3559
|
-
* Redeem a one-time token (partner key auth).
|
|
3560
|
-
*/
|
|
3561
|
-
redeemOTT(body: {
|
|
3562
|
-
ott: string;
|
|
3563
|
-
}): Promise<OTTRedeemResponse>;
|
|
3564
3552
|
/**
|
|
3565
3553
|
* Update OTT configuration for a partner key.
|
|
3566
3554
|
*/
|
|
@@ -3826,6 +3814,8 @@ interface IngestEventRequest {
|
|
|
3826
3814
|
data?: Record<string, unknown>;
|
|
3827
3815
|
eventSource?: string;
|
|
3828
3816
|
schemaIds?: string[];
|
|
3817
|
+
/** Hot attestation — immediate on-chain TX per event (higher cost, lower latency) */
|
|
3818
|
+
hot?: boolean;
|
|
3829
3819
|
}
|
|
3830
3820
|
interface IngestEventResponse {
|
|
3831
3821
|
eventId: string;
|
|
@@ -3988,4 +3978,4 @@ declare class TimeoutError extends ProofChainError {
|
|
|
3988
3978
|
constructor(message?: string);
|
|
3989
3979
|
}
|
|
3990
3980
|
|
|
3991
|
-
export { type Achievement, type ActivitySummaryView, type AddNFTRequest, type AnchorResult, type ApiKey, type AttestRequest, type AttestationMode, type AttestationResult, 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 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 ListCertificatesRequest, type ListCohortsOptions, type ListEndUsersOptions, type ListEventsRequest, type ListIssuedCredentialsOptions, type ListMintsOptions, type ListMintsResponse, type ListQuestsOptions, type ListRewardsOptions, type ListSchemasOptions, 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
|
|
3981
|
+
export { type Achievement, type ActivitySummaryView, type AddNFTRequest, type AnchorResult, type ApiKey, type AttestRequest, type AttestationMode, type AttestationResult, 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 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 ListCertificatesRequest, type ListCohortsOptions, type ListEndUsersOptions, type ListEventsRequest, type ListIssuedCredentialsOptions, type ListMintsOptions, type ListMintsResponse, type ListQuestsOptions, type ListRewardsOptions, type ListSchemasOptions, 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 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 WalletStats, type Webhook, WebhooksResource };
|
package/dist/index.js
CHANGED
|
@@ -2715,12 +2715,6 @@ var PartnerKeysClient = class {
|
|
|
2715
2715
|
async requestOTT(keyId) {
|
|
2716
2716
|
return this.http.post(`/partner-keys/${keyId}/ott/request`);
|
|
2717
2717
|
}
|
|
2718
|
-
/**
|
|
2719
|
-
* Redeem a one-time token (partner key auth).
|
|
2720
|
-
*/
|
|
2721
|
-
async redeemOTT(body) {
|
|
2722
|
-
return this.http.post("/partner-keys/ott/redeem", body);
|
|
2723
|
-
}
|
|
2724
2718
|
/**
|
|
2725
2719
|
* Update OTT configuration for a partner key.
|
|
2726
2720
|
*/
|
|
@@ -3144,15 +3138,17 @@ var IngestionClient = class {
|
|
|
3144
3138
|
if (request.schemaIds?.length) {
|
|
3145
3139
|
headers["X-Schemas"] = request.schemaIds.join(",");
|
|
3146
3140
|
}
|
|
3141
|
+
const body = {
|
|
3142
|
+
user_id: request.userId,
|
|
3143
|
+
event_type: request.eventType,
|
|
3144
|
+
data: request.data || {},
|
|
3145
|
+
event_source: request.eventSource || "sdk"
|
|
3146
|
+
};
|
|
3147
|
+
if (request.hot) body.hot = true;
|
|
3147
3148
|
const response = await fetch(`${this.ingestUrl}/events/ingest`, {
|
|
3148
3149
|
method: "POST",
|
|
3149
3150
|
headers,
|
|
3150
|
-
body: JSON.stringify(
|
|
3151
|
-
user_id: request.userId,
|
|
3152
|
-
event_type: request.eventType,
|
|
3153
|
-
data: request.data || {},
|
|
3154
|
-
event_source: request.eventSource || "sdk"
|
|
3155
|
-
}),
|
|
3151
|
+
body: JSON.stringify(body),
|
|
3156
3152
|
signal: controller.signal
|
|
3157
3153
|
});
|
|
3158
3154
|
const result = await this.handleResponse(response);
|
|
@@ -3187,12 +3183,16 @@ var IngestionClient = class {
|
|
|
3187
3183
|
method: "POST",
|
|
3188
3184
|
headers: this.getHeaders(),
|
|
3189
3185
|
body: JSON.stringify(
|
|
3190
|
-
request.events.map((e) =>
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3186
|
+
request.events.map((e) => {
|
|
3187
|
+
const ev = {
|
|
3188
|
+
user_id: e.userId,
|
|
3189
|
+
event_type: e.eventType,
|
|
3190
|
+
data: e.data || {},
|
|
3191
|
+
event_source: e.eventSource || "sdk"
|
|
3192
|
+
};
|
|
3193
|
+
if (e.hot) ev.hot = true;
|
|
3194
|
+
return ev;
|
|
3195
|
+
})
|
|
3196
3196
|
),
|
|
3197
3197
|
signal: controller.signal
|
|
3198
3198
|
});
|
|
@@ -3290,15 +3290,17 @@ var EndUserIngestionClient = class {
|
|
|
3290
3290
|
const controller = new AbortController();
|
|
3291
3291
|
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
3292
3292
|
try {
|
|
3293
|
+
const endUserBody = {
|
|
3294
|
+
user_id: request.userId,
|
|
3295
|
+
event_type: request.eventType,
|
|
3296
|
+
data: request.data || {},
|
|
3297
|
+
event_source: request.eventSource || "end_user_sdk"
|
|
3298
|
+
};
|
|
3299
|
+
if (request.hot) endUserBody.hot = true;
|
|
3293
3300
|
const response = await fetch(`${this.apiUrl}/end-user/events/ingest`, {
|
|
3294
3301
|
method: "POST",
|
|
3295
3302
|
headers: this.getHeaders(),
|
|
3296
|
-
body: JSON.stringify(
|
|
3297
|
-
user_id: request.userId,
|
|
3298
|
-
event_type: request.eventType,
|
|
3299
|
-
data: request.data || {},
|
|
3300
|
-
event_source: request.eventSource || "end_user_sdk"
|
|
3301
|
-
}),
|
|
3303
|
+
body: JSON.stringify(endUserBody),
|
|
3302
3304
|
signal: controller.signal
|
|
3303
3305
|
});
|
|
3304
3306
|
const result = await this.handleResponse(response);
|
|
@@ -3333,12 +3335,16 @@ var EndUserIngestionClient = class {
|
|
|
3333
3335
|
method: "POST",
|
|
3334
3336
|
headers: this.getHeaders(),
|
|
3335
3337
|
body: JSON.stringify({
|
|
3336
|
-
events: request.events.map((e) =>
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3338
|
+
events: request.events.map((e) => {
|
|
3339
|
+
const ev = {
|
|
3340
|
+
user_id: e.userId,
|
|
3341
|
+
event_type: e.eventType,
|
|
3342
|
+
data: e.data || {},
|
|
3343
|
+
event_source: e.eventSource || "end_user_sdk"
|
|
3344
|
+
};
|
|
3345
|
+
if (e.hot) ev.hot = true;
|
|
3346
|
+
return ev;
|
|
3347
|
+
})
|
|
3342
3348
|
}),
|
|
3343
3349
|
signal: controller.signal
|
|
3344
3350
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -2656,12 +2656,6 @@ var PartnerKeysClient = class {
|
|
|
2656
2656
|
async requestOTT(keyId) {
|
|
2657
2657
|
return this.http.post(`/partner-keys/${keyId}/ott/request`);
|
|
2658
2658
|
}
|
|
2659
|
-
/**
|
|
2660
|
-
* Redeem a one-time token (partner key auth).
|
|
2661
|
-
*/
|
|
2662
|
-
async redeemOTT(body) {
|
|
2663
|
-
return this.http.post("/partner-keys/ott/redeem", body);
|
|
2664
|
-
}
|
|
2665
2659
|
/**
|
|
2666
2660
|
* Update OTT configuration for a partner key.
|
|
2667
2661
|
*/
|
|
@@ -3085,15 +3079,17 @@ var IngestionClient = class {
|
|
|
3085
3079
|
if (request.schemaIds?.length) {
|
|
3086
3080
|
headers["X-Schemas"] = request.schemaIds.join(",");
|
|
3087
3081
|
}
|
|
3082
|
+
const body = {
|
|
3083
|
+
user_id: request.userId,
|
|
3084
|
+
event_type: request.eventType,
|
|
3085
|
+
data: request.data || {},
|
|
3086
|
+
event_source: request.eventSource || "sdk"
|
|
3087
|
+
};
|
|
3088
|
+
if (request.hot) body.hot = true;
|
|
3088
3089
|
const response = await fetch(`${this.ingestUrl}/events/ingest`, {
|
|
3089
3090
|
method: "POST",
|
|
3090
3091
|
headers,
|
|
3091
|
-
body: JSON.stringify(
|
|
3092
|
-
user_id: request.userId,
|
|
3093
|
-
event_type: request.eventType,
|
|
3094
|
-
data: request.data || {},
|
|
3095
|
-
event_source: request.eventSource || "sdk"
|
|
3096
|
-
}),
|
|
3092
|
+
body: JSON.stringify(body),
|
|
3097
3093
|
signal: controller.signal
|
|
3098
3094
|
});
|
|
3099
3095
|
const result = await this.handleResponse(response);
|
|
@@ -3128,12 +3124,16 @@ var IngestionClient = class {
|
|
|
3128
3124
|
method: "POST",
|
|
3129
3125
|
headers: this.getHeaders(),
|
|
3130
3126
|
body: JSON.stringify(
|
|
3131
|
-
request.events.map((e) =>
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3127
|
+
request.events.map((e) => {
|
|
3128
|
+
const ev = {
|
|
3129
|
+
user_id: e.userId,
|
|
3130
|
+
event_type: e.eventType,
|
|
3131
|
+
data: e.data || {},
|
|
3132
|
+
event_source: e.eventSource || "sdk"
|
|
3133
|
+
};
|
|
3134
|
+
if (e.hot) ev.hot = true;
|
|
3135
|
+
return ev;
|
|
3136
|
+
})
|
|
3137
3137
|
),
|
|
3138
3138
|
signal: controller.signal
|
|
3139
3139
|
});
|
|
@@ -3231,15 +3231,17 @@ var EndUserIngestionClient = class {
|
|
|
3231
3231
|
const controller = new AbortController();
|
|
3232
3232
|
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
3233
3233
|
try {
|
|
3234
|
+
const endUserBody = {
|
|
3235
|
+
user_id: request.userId,
|
|
3236
|
+
event_type: request.eventType,
|
|
3237
|
+
data: request.data || {},
|
|
3238
|
+
event_source: request.eventSource || "end_user_sdk"
|
|
3239
|
+
};
|
|
3240
|
+
if (request.hot) endUserBody.hot = true;
|
|
3234
3241
|
const response = await fetch(`${this.apiUrl}/end-user/events/ingest`, {
|
|
3235
3242
|
method: "POST",
|
|
3236
3243
|
headers: this.getHeaders(),
|
|
3237
|
-
body: JSON.stringify(
|
|
3238
|
-
user_id: request.userId,
|
|
3239
|
-
event_type: request.eventType,
|
|
3240
|
-
data: request.data || {},
|
|
3241
|
-
event_source: request.eventSource || "end_user_sdk"
|
|
3242
|
-
}),
|
|
3244
|
+
body: JSON.stringify(endUserBody),
|
|
3243
3245
|
signal: controller.signal
|
|
3244
3246
|
});
|
|
3245
3247
|
const result = await this.handleResponse(response);
|
|
@@ -3274,12 +3276,16 @@ var EndUserIngestionClient = class {
|
|
|
3274
3276
|
method: "POST",
|
|
3275
3277
|
headers: this.getHeaders(),
|
|
3276
3278
|
body: JSON.stringify({
|
|
3277
|
-
events: request.events.map((e) =>
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3279
|
+
events: request.events.map((e) => {
|
|
3280
|
+
const ev = {
|
|
3281
|
+
user_id: e.userId,
|
|
3282
|
+
event_type: e.eventType,
|
|
3283
|
+
data: e.data || {},
|
|
3284
|
+
event_source: e.eventSource || "end_user_sdk"
|
|
3285
|
+
};
|
|
3286
|
+
if (e.hot) ev.hot = true;
|
|
3287
|
+
return ev;
|
|
3288
|
+
})
|
|
3283
3289
|
}),
|
|
3284
3290
|
signal: controller.signal
|
|
3285
3291
|
});
|
package/package.json
CHANGED