@fire-spark/analytics 0.23.0 → 0.25.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.ts +12 -2
- package/dist/index.js +20 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -681,7 +681,7 @@ declare const customAdapter: (options: CustomAdapterOptions) => CustomAnalyticsA
|
|
|
681
681
|
//#endregion
|
|
682
682
|
//#region src/version.d.ts
|
|
683
683
|
/** Kept equal to package.json by `pnpm sdk:release` (see version.test.ts). */
|
|
684
|
-
declare const SDK_VERSION = "0.
|
|
684
|
+
declare const SDK_VERSION = "0.25.0";
|
|
685
685
|
//#endregion
|
|
686
686
|
//#region src/compact.d.ts
|
|
687
687
|
/** Drops `undefined`, `null`, non-finite numbers and functions, deeply. */
|
|
@@ -812,6 +812,16 @@ declare const upgradeEnvelope: (envelope: Record<string, unknown>) => Record<str
|
|
|
812
812
|
*/
|
|
813
813
|
declare const validateEnvelope: (input: unknown, options?: ValidateEnvelopeOptions) => EnvelopeValidation;
|
|
814
814
|
//#endregion
|
|
815
|
+
//#region src/provider-name.d.ts
|
|
816
|
+
/**
|
|
817
|
+
* Event name a destination gets for a Fire Spark event on the web, from
|
|
818
|
+
* the same catalog transform the browser pixels use (`purchase` →
|
|
819
|
+
* Meta `Purchase`, TikTok `CompletePayment`). A server must send this
|
|
820
|
+
* exact name, or the platform cannot deduplicate it against the pixel.
|
|
821
|
+
* `null` when the catalog does not send the event to that provider.
|
|
822
|
+
*/
|
|
823
|
+
declare const providerEventName: (provider: Exclude<ServerProviderId, "google-ads">, name: string) => string | null;
|
|
824
|
+
//#endregion
|
|
815
825
|
//#region src/click-ids.d.ts
|
|
816
826
|
declare const CLICK_ID_STORAGE_PREFIX = "fs_ck_";
|
|
817
827
|
/** Click ids from a landing URL are kept for 90 days. */
|
|
@@ -892,4 +902,4 @@ declare const analytics: {
|
|
|
892
902
|
setConsent: typeof setConsent;
|
|
893
903
|
};
|
|
894
904
|
//#endregion
|
|
895
|
-
export { Analytics, type AnalyticsAdapter, type AnalyticsAppState, type AnalyticsConfig, AnalyticsConfigError, type AnalyticsConfigErrorCode, type AnalyticsConfigureOptions, type AnalyticsConsent, type AnalyticsConsentCategory, type AnalyticsContext, type AnalyticsCustomer, type AnalyticsDeliveryMode, type AnalyticsDestination, type AnalyticsHash, type AnalyticsIssue, type AnalyticsIssueSource, type AnalyticsPlatform, type AnalyticsRuntime, type AnalyticsSampleOptions, type AnalyticsScope, type AnalyticsServerSideOptions, type AnalyticsStorage, type AnalyticsUser, BUILTIN_DESTINATION_IDS, type BuildEnvelopeOptions, type BuiltinDestinationId, CLICK_ID_STORAGE_PREFIX, CLICK_ID_TTL_MS, CLICK_ID_WIRE_KEYS, CONTRACT_PII_KEYS, type ClickIdCaptureOptions, type ClickIds, type ClickIdsV1, type ConsentV1, type CustomAdapterOptions, type CustomAnalyticsAdapter, type CustomDestinationEvent, type CustomDestinationIdentity, type CustomDestinationInput, type CustomDestinationMap, type CustomRevenue, type DecimalString, type DestinationProviderId, type EnvelopeError, type EnvelopeValidation, FUNNEL_EVENTS, type FunnelEventName, HASHED_USER_WIRE_KEYS, type HashUserDataOptions, type HashedUserData, type HashedUserDataV1, INTERACTION_EVENTS, type InteractionEventName, MAX_ENVELOPE_EVENTS, type NormalizedEvent, type PhoneHashFormat, type RejectReason, type RejectedEvent, SDK_VERSION, SERVER_PROVIDER_IDS, SUPPORTED_CONTRACT_VERSIONS, type ServerProviderId, type Sha256Hex, TRACKING_CONTRACT_VERSION, TRACKING_SDK_NAME, type TrackOptions as TrackCallOptions, type TrackOptions, type TrackEvent, type TrackingConsent, type TrackingContext, type TrackingContextV1, type TrackingEnvelopeV1, type TrackingEventInput, type TrackingEventV1, type TrackingItemV1, type TrackingSdkV1, type UserDataInput, type ValidateEnvelopeOptions, analytics, buildTrackingEnvelope, buildTrackingEvent, captureClickIds, clearClickIds, compactPayload, configure, customAdapter, endSession, fbcFromFbclid, flush, gclidFromGclAw, hasScript, hashUserData, isDecimalString, isFunnelEventName, isInteractionEventName, isValidEventId, loadScript, normalizeCountryCode, normalizeEmail, normalizeEmailForGoogle, normalizeExternalId, normalizeName, normalizePhoneE164, parseClickIdParams, phoneDigits, purchaseEventId, readCookie, reset, resolveDeliveryMode, setConsent, setUser, sha256Hex, toDecimalString, track, upgradeEnvelope, validateEnvelope };
|
|
905
|
+
export { Analytics, type AnalyticsAdapter, type AnalyticsAppState, type AnalyticsConfig, AnalyticsConfigError, type AnalyticsConfigErrorCode, type AnalyticsConfigureOptions, type AnalyticsConsent, type AnalyticsConsentCategory, type AnalyticsContext, type AnalyticsCustomer, type AnalyticsDeliveryMode, type AnalyticsDestination, type AnalyticsHash, type AnalyticsIssue, type AnalyticsIssueSource, type AnalyticsPlatform, type AnalyticsRuntime, type AnalyticsSampleOptions, type AnalyticsScope, type AnalyticsServerSideOptions, type AnalyticsStorage, type AnalyticsUser, BUILTIN_DESTINATION_IDS, type BuildEnvelopeOptions, type BuiltinDestinationId, CLICK_ID_STORAGE_PREFIX, CLICK_ID_TTL_MS, CLICK_ID_WIRE_KEYS, CONTRACT_PII_KEYS, type ClickIdCaptureOptions, type ClickIds, type ClickIdsV1, type ConsentV1, type CustomAdapterOptions, type CustomAnalyticsAdapter, type CustomDestinationEvent, type CustomDestinationIdentity, type CustomDestinationInput, type CustomDestinationMap, type CustomRevenue, type DecimalString, type DestinationProviderId, type EnvelopeError, type EnvelopeValidation, FUNNEL_EVENTS, type FunnelEventName, HASHED_USER_WIRE_KEYS, type HashUserDataOptions, type HashedUserData, type HashedUserDataV1, INTERACTION_EVENTS, type InteractionEventName, MAX_ENVELOPE_EVENTS, type NormalizedEvent, type PhoneHashFormat, type RejectReason, type RejectedEvent, SDK_VERSION, SERVER_PROVIDER_IDS, SUPPORTED_CONTRACT_VERSIONS, type ServerProviderId, type Sha256Hex, TRACKING_CONTRACT_VERSION, TRACKING_SDK_NAME, type TrackOptions as TrackCallOptions, type TrackOptions, type TrackEvent, type TrackingConsent, type TrackingContext, type TrackingContextV1, type TrackingEnvelopeV1, type TrackingEventInput, type TrackingEventV1, type TrackingItemV1, type TrackingSdkV1, type UserDataInput, type ValidateEnvelopeOptions, analytics, buildTrackingEnvelope, buildTrackingEvent, captureClickIds, clearClickIds, compactPayload, configure, customAdapter, endSession, fbcFromFbclid, flush, gclidFromGclAw, hasScript, hashUserData, isDecimalString, isFunnelEventName, isInteractionEventName, isValidEventId, loadScript, normalizeCountryCode, normalizeEmail, normalizeEmailForGoogle, normalizeExternalId, normalizeName, normalizePhoneE164, parseClickIdParams, phoneDigits, providerEventName, purchaseEventId, readCookie, reset, resolveDeliveryMode, setConsent, setUser, sha256Hex, toDecimalString, track, upgradeEnvelope, validateEnvelope };
|
package/dist/index.js
CHANGED
|
@@ -1000,7 +1000,7 @@ const transformForProvider = (provider, input) => {
|
|
|
1000
1000
|
//#endregion
|
|
1001
1001
|
//#region src/version.ts
|
|
1002
1002
|
/** Kept equal to package.json by `pnpm sdk:release` (see version.test.ts). */
|
|
1003
|
-
const SDK_VERSION = "0.
|
|
1003
|
+
const SDK_VERSION = "0.25.0";
|
|
1004
1004
|
//#endregion
|
|
1005
1005
|
//#region src/contract.ts
|
|
1006
1006
|
const TRACKING_CONTRACT_VERSION = 1;
|
|
@@ -4466,6 +4466,24 @@ const validateEnvelope = (input, options = {}) => {
|
|
|
4466
4466
|
};
|
|
4467
4467
|
};
|
|
4468
4468
|
//#endregion
|
|
4469
|
+
//#region src/provider-name.ts
|
|
4470
|
+
/**
|
|
4471
|
+
* Event name a destination gets for a Fire Spark event on the web, from
|
|
4472
|
+
* the same catalog transform the browser pixels use (`purchase` →
|
|
4473
|
+
* Meta `Purchase`, TikTok `CompletePayment`). A server must send this
|
|
4474
|
+
* exact name, or the platform cannot deduplicate it against the pixel.
|
|
4475
|
+
* `null` when the catalog does not send the event to that provider.
|
|
4476
|
+
*/
|
|
4477
|
+
const providerEventName = (provider, name) => {
|
|
4478
|
+
return transformForProvider(provider, {
|
|
4479
|
+
name,
|
|
4480
|
+
params: {},
|
|
4481
|
+
runtime: "web",
|
|
4482
|
+
eventId: "name",
|
|
4483
|
+
eventTime: 0
|
|
4484
|
+
})?.name ?? null;
|
|
4485
|
+
};
|
|
4486
|
+
//#endregion
|
|
4469
4487
|
//#region src/index.ts
|
|
4470
4488
|
const configure = (options) => {
|
|
4471
4489
|
return configureWith(runtime, options);
|
|
@@ -4533,4 +4551,4 @@ const analytics = {
|
|
|
4533
4551
|
setConsent
|
|
4534
4552
|
};
|
|
4535
4553
|
//#endregion
|
|
4536
|
-
export { Analytics, AnalyticsConfigError, BUILTIN_DESTINATION_IDS, CLICK_ID_STORAGE_PREFIX, CLICK_ID_TTL_MS, CLICK_ID_WIRE_KEYS, CONTRACT_PII_KEYS, FUNNEL_EVENTS, HASHED_USER_WIRE_KEYS, INTERACTION_EVENTS, MAX_ENVELOPE_EVENTS, SDK_VERSION, SERVER_PROVIDER_IDS, SUPPORTED_CONTRACT_VERSIONS, TRACKING_CONTRACT_VERSION, TRACKING_SDK_NAME, analytics, buildTrackingEnvelope, buildTrackingEvent, captureClickIds, clearClickIds, compactPayload, configure, customAdapter, endSession, fbcFromFbclid, flush, gclidFromGclAw, hasScript, hashUserData, isDecimalString, isFunnelEventName, isInteractionEventName, isValidEventId, loadScript, normalizeCountryCode, normalizeEmail, normalizeEmailForGoogle, normalizeExternalId, normalizeName, normalizePhoneE164, parseClickIdParams, phoneDigits, purchaseEventId, readCookie, reset, resolveDeliveryMode, setConsent, setUser, sha256Hex, toDecimalString, track, upgradeEnvelope, validateEnvelope };
|
|
4554
|
+
export { Analytics, AnalyticsConfigError, BUILTIN_DESTINATION_IDS, CLICK_ID_STORAGE_PREFIX, CLICK_ID_TTL_MS, CLICK_ID_WIRE_KEYS, CONTRACT_PII_KEYS, FUNNEL_EVENTS, HASHED_USER_WIRE_KEYS, INTERACTION_EVENTS, MAX_ENVELOPE_EVENTS, SDK_VERSION, SERVER_PROVIDER_IDS, SUPPORTED_CONTRACT_VERSIONS, TRACKING_CONTRACT_VERSION, TRACKING_SDK_NAME, analytics, buildTrackingEnvelope, buildTrackingEvent, captureClickIds, clearClickIds, compactPayload, configure, customAdapter, endSession, fbcFromFbclid, flush, gclidFromGclAw, hasScript, hashUserData, isDecimalString, isFunnelEventName, isInteractionEventName, isValidEventId, loadScript, normalizeCountryCode, normalizeEmail, normalizeEmailForGoogle, normalizeExternalId, normalizeName, normalizePhoneE164, parseClickIdParams, phoneDigits, providerEventName, purchaseEventId, readCookie, reset, resolveDeliveryMode, setConsent, setUser, sha256Hex, toDecimalString, track, upgradeEnvelope, validateEnvelope };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fire-spark/analytics",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"description": "Fire Spark storefront analytics SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"big.js": "6.2.1",
|
|
21
21
|
"libphonenumber-js": "1.13.16",
|
|
22
|
-
"@fire-spark/core": "^0.
|
|
22
|
+
"@fire-spark/core": "^0.25.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"tsdown": "^0.22.14",
|