@compilacion/colleciones-clientos 2.0.6 → 2.0.7

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.
@@ -306,11 +306,11 @@
306
306
  if (typeof name !== 'string') {
307
307
  throw new Error('Actor Identifier name must be a string');
308
308
  }
309
+ this.setRefence(entity, origin);
309
310
  entity = formatToCamelCase(entity);
310
311
  if (origin !== null) {
311
312
  entity = `${origin}.${entity}`;
312
313
  }
313
- this.setRefence(entity, origin);
314
314
  this.references[entity].identifiers[name] = identifier;
315
315
  }
316
316
 
@@ -1 +1 @@
1
- {"version":3,"file":"collecionesClientos.iife.js","sources":["../src/utils/utils.js","../src/CollecionesEvent.js","../src/CollecionesEmitter.js","../src/CollecionesTracker.js","../src/CollecionesWebTracker.js","../src/collecionesDsl.js","../src/collecionesClientos.js"],"sourcesContent":["// helper 'private' functions\n\n\n/**\n * Encodes a string to Base64.\n * Uses browser or Node.js method depending on environment.\n * @param {string} str\n * @returns {string}\n */\nconst toBase64 = function (str) {\n if (typeof window !== 'undefined' && typeof window.btoa === 'function') {\n return window.btoa(unescape(encodeURIComponent(str)));\n } else {\n return Buffer.from(str, 'utf-8').toString('base64');\n }\n}\n\n/**\n * Decodes a Base64 string to UTF-8.\n * Uses browser or Node.js method depending on environment.\n * @param {string} b64\n * @returns {string}\n */\nconst fromBase64 = function (b64) {\n if (typeof window !== 'undefined' && typeof window.atob === 'function') {\n return decodeURIComponent(escape(window.atob(b64)));\n } else {\n return Buffer.from(b64, 'base64').toString('utf-8');\n }\n}\n\n/**\n * Collects browser-related context values like screen size, language, etc.\n * Returns an empty object if not in browser environment.\n * @returns {Object}\n */\nconst getBrowserContext = function() {\n if (typeof window === 'undefined' || typeof navigator === 'undefined') {\n return {};\n }\n return {\n hasFocus: document.hasFocus(),\n language: navigator.language,\n platform: navigator.platform,\n referrer: document.referrer,\n screenHeight: window.screen.height,\n screenWidth: window.screen.width,\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n url: window.location.href,\n userAgent: navigator.userAgent,\n viewportHeight: window.innerHeight,\n viewportWidth: window.innerWidth,\n };\n}\n\nconst formatToCamelCase = function(input) {\n return input\n .replace(/[^a-zA-Z0-9]+/g, ' ')\n .trim()\n .split(/\\s+/)\n .map((word, index) => {\n if (index === 0) return word;\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n })\n .join('');\n}\n\nexport {\n fromBase64,\n formatToCamelCase,\n getBrowserContext,\n toBase64,\n};","/**\n * CollecionesEvent\n * -----------------\n * Base class representing a semantically structured event object.\n * Each event models a specific interaction with an entity, optionally performed by an actor,\n * and may reference related entities or include contextual metadata.\n *\n * Key features:\n * - Captures structured semantics: entity, action, actor, context, references\n * - Supports multiple identifiers for both the main entity and the actor\n * - Allows origin tagging for cross-context or cross-application references\n * - Supports referencing collections of entities or grouped data\n * - Includes timestamps and tracker/app metadata for auditability\n * - Fully serializable and deserializable via toJSON/fromJSON\n */\n\nimport {formatToCamelCase } from './utils/utils.js';\n\nclass CollecionesEvent {\n\n /**\n * Constructs a new CollecionesEvent with default structure and timestamps.\n * Initializes empty containers for semantic attributes such as:\n * - entity: the subject of the event\n * - adjectives: descriptors of the entity\n * - identifiers: identifiers of the entity\n * - action: what happened to the entity\n * - actor: who or what triggered the event (with identifiers in actorIdentifiers)\n * - context: environmental data related to the event\n * - references: external entities involved, optionally scoped by origin\n * - collections: groups of related entities\n * - meta: tracking metadata and timestamps\n */\n constructor() {\n // initialize event properties\n this.entity = '';\n this.adjevtives = [];\n this.identifiers = {};\n this.action = '';\n this.actor = {};\n this.actorIdentifiers = {};\n this.context = {};\n this.references = {};\n this.collections = {};\n // set default values\n this.meta = {\n eventFormat: 'CollecionesEvent',\n eventFormatVersion: '1'\n };\n this.meta.tracker = '';\n this.meta.app = '';\n this.meta.timestamps = {};\n this.meta.timestamps.clientDatetimeUtc = new Date().toISOString();\n if (typeof window !== 'undefined' && typeof navigator !== 'undefined' && navigator.language) {\n this.meta.timestamps.clientDatetimeLocal = new Date(Date.now() - new Date().getTimezoneOffset() * 60000).toISOString();\n this.meta.timestamps.timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n this.meta.timestamps.timeZoneOffset = new Date().getTimezoneOffset()\n } else {\n this.meta.timestamps.clientDatetimeLocal = new Date().toISOString();\n this.meta.timestamps.timeZone = 'UTC';\n }\n }\n\n /**\n * Returns the declared event format.\n * @returns {string} The format name (e.g. 'CollecionesEvent').\n */\n getEventFormat() {\n let v = this.meta?.eventFormat;\n return (typeof v !== 'undefined') ? v : '1';\n }\n\n /**\n * Returns the version of the event format.\n * @returns {string} The format version string.\n */\n getEventFormatVersion() {\n let v = this?.meta?.eventFormatVersion;\n return (typeof v !== 'undefined') ? v : 'CollecionesEvent';\n }\n\n /**\n * Overrides or supplements the event's timestamp fields with custom values.\n * @param {object} dateTimeObject - Key-value pairs to merge into the existing timestamp object.\n */\n overrideDatetime(dateTimeObject = {}) {\n for (const [key, value] of Object.entries(dateTimeObject)) {\n this.meta.timestamps[key] = value;\n }\n }\n\n /**\n * Sets the name of the tracker responsible for generating this event.\n * @param {string} name - Tracker name.\n */\n setTracker(name) {\n this.meta.tracker = name;\n }\n\n /**\n * Sets the name of the application that generated the event.\n * @param {string} name - Application name.\n */\n setAppName(name) {\n this.meta.appName = name;\n }\n\n /**\n * Sets the expected schema name for this event.\n * @param {string} schema - The name of the schema.\n */\n setSchema(schema) {\n if (typeof schema !== 'string') {\n throw new Error('Schema must be a string');\n }\n this.meta.schema = schema;\n }\n\n /**\n * Sets the entity (subject) of the event.\n * @param {string} entity - The entity name.\n */\n setEntity = function(entity) {\n this.entity = formatToCamelCase(entity);\n }\n \n /**\n * Defines the main action of the event (e.g., 'clicked').\n * @param {string} action - The action string.\n */\n setAction = function(action) {\n this.action = formatToCamelCase(action);\n }\n\n /**\n * Adds an adjective that describes the entity in more detail.\n * @param {string} adjective - An adjective string.\n */\n addAdjective = function(adjective) {\n if (typeof adjective !== 'string') {\n throw new Error('Adjective must be a string');\n }\n this.adjevtives.push(formatToCamelCase(adjective));\n }\n\n /**\n * Adds or updates an identifier for the primary entity.\n * Identifiers allow multiple keys to uniquely identify the entity.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n */\n setIdentifier = function(name, identifier) {\n if (typeof name !== 'string') {\n throw new Error('Identifier name must be a string');\n }\n this.identifiers[name] = identifier;\n }\n\n /**\n * Defines the name of the actor (who or what performed the action).\n * @param {string} name - Actor name (e.g., 'user', 'system').\n */\n setActor = function(name) {\n if (typeof name !== 'string') {\n throw new Error('Actor name must be a string');\n }\n this.actor.name = name;\n }\n\n /**\n * Adds or updates an identifier for the actor.\n * Supports multiple identifiers to uniquely identify the actor.\n * @param {string} name - Identifier key.\n * @param {*} identifier - Identifier value.\n */\n setActorIdentifier = function(name, identifier) {\n if (typeof name !== 'string') {\n throw new Error('Actor Identifier name must be a string');\n }\n this.actorIdentifiers[name] = identifier;\n }\n\n /**\n * Adds contextual information to the event.\n * Context can include any additional environmental or situational data.\n * @param {string} context - The key of the context field.\n * @param {*} value - The value of the context field.\n */\n setContext = function(context, value) {\n if (typeof context !== 'string') {\n throw new Error('Context must be a string');\n }\n this.context[context] = value;\n }\n\n /**\n * Alias for `setReference` for compatibility.\n * Declares an external entity referenced by this event.\n * @param {string} entity - The referenced entity name.\n * @param {string|null} origin - The origin application or context (optional).\n */\n setRefence = function(entity, origin=null) {\n return this.setReference(entity, origin);\n }\n\n /**\n * Declares an entity referenced by this event.\n * References may include multiple identifiers and an optional origin to scope the reference.\n * @param {string} entity - The referenced entity name.\n * @param {string|null} origin - The origin application or context (optional).\n */\n setReference = function(entity, origin=null) {\n if (typeof entity !== 'string') {\n throw new Error('Referenced entity must be a string');\n }\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.references[entity] === undefined) {\n this.references[entity] = {\n identifiers: {},\n origin\n };\n }\n }\n\n /**\n * Adds or updates an identifier for a referenced entity.\n * Ensures the reference is declared and sets the identifier under that reference.\n * @param {string} entity - The referenced entity name.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @param {string|null} origin - Optional origin context.\n */\n setRefenceIdentifier = function(entity, name, identifier, origin=null) {\n return this.setReferenceIdentifier(entity, name, identifier, origin);\n }\n\n /**\n * Adds or updates an identifier for a referenced entity.\n * @param {string} entity - The referenced entity name.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @param {string|null} origin - Optional origin context.\n */\n setReferenceIdentifier = function(entity, name, identifier, origin=null) {\n if (typeof entity !== 'string') {\n throw new Error('Referenced entity name must be a string');\n }\n if (typeof name !== 'string') {\n throw new Error('Actor Identifier name must be a string');\n }\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.setRefence(entity, origin);\n this.references[entity].identifiers[name] = identifier;\n }\n\n /**\n * Declares a collection of related entities for this event.\n * Collections group multiple related items and may include identifiers and origin metadata.\n * @param {string} entity - The collection name.\n * @param {string|null} origin - Optional origin identifier (e.g. system name).\n */\n setCollection = function(entity, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.collections[entity] == undefined) {\n this.collections[entity] = {\n items: [],\n identifiers: {},\n origin\n };\n }\n }\n\n /**\n * Adds a new item to a collection and returns its index key.\n * Items represent individual elements within the collection.\n * @param {string} entity - The name of the collection.\n * @returns {number} Index of the newly added item in the collection.\n */\n setCollectionItem = function(entity, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.setCollection(entity);\n this.collections[entity].items.push({});\n let itemKey = this.collections[entity].items.length - 1;\n return itemKey;\n }\n\n /**\n * Assigns a reference (identifier) to a specific item in a collection.\n * Useful for tagging individual collection elements with identifiers.\n * @param {string} entity - Collection name.\n * @param {number} itemKey - The index of the item in the collection.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @throws {Error} If the item does not exist at the given index.\n */\n setCollectionItemReference = function(entity, itemKey, name, identifier, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.setCollection(entity);\n if(typeof this.collections[entity].items[itemKey] !== 'object') {\n throw new Error('bad bad man, the collection key does not exists');\n }\n this.collections[entity].items[itemKey][name] = identifier;\n }\n \n /**\n * Sets a static identifier that applies to the entire collection.\n * These identifiers describe the collection as a whole.\n * @param {string} entity - Collection name.\n * @param {string} name - Identifier key.\n * @param {*} identifier - Identifier value.\n */\n setCollectionIdentifier = function(entity, name, identifier, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.collections[entity] == undefined) {\n this.collections[entity] = {};\n }\n this.collections[entity].identifiers[name] = identifier;\n }\n\n /**\n * Serializes the event instance to a plain object suitable for transport or storage.\n * The output includes all semantic fields and metadata.\n * @returns {object} A plain JavaScript object representing the event.\n */\n toJSON() {\n return {\n class: 'CollecionesEvent',\n entity: this.entity,\n adjectives: this.adjevtives,\n identifiers: this.identifiers,\n action: this.action,\n actor: this.actor,\n actorIdentifiers: this.actorIdentifiers,\n actorIds: this.actorIds,\n context: this.context,\n references: this.references,\n meta: this.meta,\n collections: this.collections\n };\n }\n\n /**\n * Recreates a CollecionesEvent instance from a plain object.\n * Used when deserializing events from storage or network transport.\n * @param {object} obj - The input object containing event data.\n * @returns {CollecionesEvent} A rehydrated event instance.\n * @throws {Error} If the class type is not 'CollecionesEvent'.\n */\n static fromJSON(obj) { \n if (!obj || obj.class !== 'CollecionesEvent') {\n throw new Error('Invalid or missing event class type'); \n } \n const instance = new CollecionesEvent();\n instance.entity = obj.entity;\n instance.adjevtives = obj.adjectives || [];\n instance.identifiers = obj.identifiers || {};\n instance.action = obj.action;\n instance.actor = obj.actor;\n instance.actorIdentifiers = obj.actorIdentifiers;\n instance.actorIds = obj.actorIds;\n instance.context = obj.context || {};\n instance.references = obj.references || {};\n instance.meta = obj.meta || {};\n instance.collections = obj.collections || {};\n return instance;\n }\n \n}\n\nexport default CollecionesEvent;","import { fromBase64, toBase64 } from './utils/utils.js';\nimport CollecionesEvent from './CollecionesEvent.js';\n\n/**\n * CollecionesEmitter\n * -------------------\n * This class collects and sends event objects to a remote endpoint (e.g., an event collector API).\n * It is used in both client- and server-side tracking scenarios, typically in combination with\n * CollecionesEvent or subclasses like CollecionesBaseEvent.\n *\n * Behavior:\n * - Events are buffered via `.track()` or `.trackAsync()`.\n * - If the number of buffered events reaches `flushSize`, the buffer is automatically flushed.\n * - If `flushInterval` is provided, the buffer is flushed at a fixed interval.\n * - Flushing serializes each event using `.toJSON()`, encodes it with base64, and posts\n * the resulting array to the configured endpoint.\n *\n * Example usage:\n * const emitter = new CollecionesEmitter('/track', 5, 10000);\n * emitter.track(new CollecionesEvent());\n *\n * Note:\n * This class is stateful. To stop periodic flushing, call `.stopTimer()` when the emitter is no longer in use.\n */\nclass CollecionesEmitter {\n\n /**\n * Initializes the emitter with buffering settings.\n * @param {string} [endpoint='/collect'] - The URL to send events to.\n * @param {number} [flushSize=10] - Number of events to buffer before flushing.\n * @param {number|boolean} [flushInterval=false] - Time in ms to flush events periodically.\n */\n constructor(endpoint = '/collect', flushSize = 10, flushInterval = false) {\n this.endpoint = endpoint;\n this.flushInterval = flushInterval;\n this.flushSize = flushSize;\n this.buffer = [];\n this.timer = null;\n this.lastPayload = null;\n }\n\n /**\n * Starts the flush timer if a valid interval is set.\n * @returns {void}\n */\n startTimer() {\n this.stopTimer();\n if (typeof this.flushInterval == 'number' && this.flushInterval > 0) {\n this.timer = setInterval(() => this.flush(), this.flushInterval);\n }\n }\n\n /**\n * Starts the flush timer only if not already running.\n * @returns {void}\n */\n startTimerIfStopped() {\n if (!this.timer) {\n this.startTimer();\n }\n }\n\n /**\n * Stops the active flush timer.\n * @returns {void}\n */\n stopTimer() {\n if (this.timer) {\n clearInterval(this.timer);\n }\n this.timer = null;\n }\n\n /**\n * Adds an event to the buffer and flushes if threshold is reached.\n * Validates that the event is an instance of CollecionesEvent to ensure correct event type.\n * @param {CollecionesEvent} event - Event instance to be tracked.\n * @throws {Error} Throws if event is not a CollecionesEvent instance.\n * @returns {void}\n */\n track(event) {\n if (!(event instanceof CollecionesEvent)) {\n throw new Error('Event must be an instance of CollecionesEvent');\n }\n this.trackAsync(event);\n }\n\n /**\n * Asynchronously adds an event and flushes if the buffer size is exceeded.\n * Validates that the event is an instance of CollecionesEvent to ensure correct event type.\n * @param {CollecionesEvent} event - Event instance to be tracked asynchronously.\n * @throws {Error} Throws if event is not a CollecionesEvent instance.\n * @returns {Promise<void>} Resolves when event is added and flush triggered if needed.\n */\n async trackAsync(event) {\n if (!(event instanceof CollecionesEvent)) {\n throw new Error('Event must be an instance of CollecionesEvent');\n }\n this.startTimerIfStopped();\n this.buffer.push(event);\n return (this.buffer.length >= this.flushSize) ? this.flush() : Promise.resolve();\n }\n\n /**\n * Sends all buffered events in a single POST request to the server.\n * Each event is serialized via `.toJSON()` and encoded as a base64 string.\n * Response status is checked for HTTP success; errors are logged but not thrown.\n *\n * @returns {Promise<boolean|undefined>} Resolves true if flush was triggered, or undefined if buffer was empty.\n */\n async flush() {\n if (this.buffer.length === 0) return;\n this.stopTimer();\n const body = this.buildBody();\n this.lastPayload = body;\n this.buffer = [];\n try {\n const response = await fetch(this.endpoint, {\n method: 'POST',\n credentials: 'include',\n headers: {\n 'Content-Type': 'application/json'\n },\n body\n });\n if (!response.ok) {\n console.log(`Failed to send events: ${response.statusText}`);\n }\n return true;\n } catch (error) { \n console.log(`Network error sending events: ${error.message}`);\n } \n }\n\n /**\n * Builds a POST-ready payload from the current buffer, without clearing it.\n * @returns {string} JSON string of base64-encoded serialized events.\n */\n buildBody() {\n return JSON.stringify(this.buffer.map(e => toBase64(JSON.stringify(e.toJSON()))));\n }\n\n}\n\nexport default CollecionesEmitter;","import CollecionesEvent from './CollecionesEvent.js';\n\n/**\n * Tracks events by enriching them with shared identifiers and routing through configured emitters.\n */\nclass CollecionesTracker {\n\n /**\n * Constructs a new tracker instance.\n * @param {Array} emitters - Array of emitter instances responsible for sending events.\n * @param {string} trackerName - Name identifying this tracker.\n * @param {string} appName - Name of the application generating events.\n */\n constructor(emitters, trackerName, appName) {\n this.emitters = emitters;\n this.trackerName = trackerName;\n this.appName = appName;\n }\n\n /**\n * Sends an event to all emitters after enriching it with identifiers and metadata.\n * @param {CollecionesEvent} collecionesEvent - The event to be sent.\n * @throws {Error} If the input is not an instance of CollecionesEvent.\n */\n track(collecionesEvent) {\n if (!(collecionesEvent instanceof CollecionesEvent)) {\n throw new Error('Event must be of type CollecionesEvent');\n }\n collecionesEvent.setTracker(this.trackerName);\n collecionesEvent.setAppName(this.appName); \n this.emitters.forEach(element => {\n element.track(collecionesEvent, this.trackerName, this.appName);\n });\n }\n}\n\nexport default CollecionesTracker;","import CollecionesEvent from './CollecionesEvent.js';\nimport CollecionesTracker from './CollecionesTracker.js';\nimport { getBrowserContext } from './utils/utils.js';\n\n/**\n * Web-specific tracker that enriches events with browser context before sending them.\n * Extends the base CollecionesTracker.\n */\nclass CollecionesWebTracker extends CollecionesTracker {\n /**\n * Creates a new instance of CollecionesWebTracker.\n * @param {Array} emitters - A list of emitter instances used to send the event.\n * @param {string} trackerName - The name of the tracker.\n * @param {string} appName - The name of the application generating events.\n */\n constructor(emitters, trackerName, appName) {\n super(emitters, trackerName, appName);\n }\n\n /**\n * Tracks an event, enriching it with browser context information.\n * @param {CollecionesEvent} collecionesEvent - The event object to track.\n * @throws {Error} If the event is not an instance of CollecionesEvent.\n */\n track(collecionesEvent) {\n if (!(collecionesEvent instanceof CollecionesEvent)) {\n throw new Error('Event must be of type CollecionesEvent');\n }\n collecionesEvent.setContext('browserContext', getBrowserContext());\n super.track(collecionesEvent); \n }\n}\n\nexport default CollecionesWebTracker;","/**\n * Colleciones DSL\n * ---------------\n * This module provides a fluent, human-readable DSL (domain-specific language) for constructing\n * structured tracking events based on CollecionesBaseEvent. Each step in the chain represents\n * a semantically meaningful piece of the event: the entity, the action, the actor, references, etc.\n *\n * Entry Point:\n * collecionesDsl.the('dark')\n *\n * Chaining:\n * - .and('...') : add additional adjectives\n * - ._('entity') : specify the entity being acted on\n * - .identified.by('field') : declare primary identifier for the subject\n * - .has.been('action') : declare what happened\n * - .by('actor') : describe the actor performing the action\n * - .identified.by('id') : add identifiers for the actor\n * - .with('key').set.to('val') : add contextual data fields\n * - .referring.to('entity') : describe referenced/related entities\n * - .identified.by('refId') : add identifiers for the reference\n * - .conform.to('SchemaName') : attach schema metadata\n * - .then.track.with(emitter) : finalize and emit the event\n *\n * Each function in the chain passes forward a scoped version of the CollecionesBaseEvent instance,\n * and enforces semantic constraints (e.g. `.as()` is required after `.by()`).\n *\n * Internal:\n * - Uses setRefence / setRefenceIdentifier for references\n * - Uses helpers.getEvent() for test access\n * - Uses instanceof CollecionesEmitter for validation\n *\n * This file is designed for internal use by developers building with the Colleciones tracking model.\n */\n\nimport CollecionesEvent from './CollecionesEvent.js';\nimport CollecionesTracker from './CollecionesTracker.js';\n\nlet init = (entity) => {\n return ((entity)=>{\n let eventInstance = new CollecionesEvent(); // Core event object\n eventInstance.setEntity(entity);\n\n let helpers = {\n getEvent: () => {\n return eventInstance;\n },\n };\n\n // DSL function groups\n let andEntity = () => {}; // .and(...) chaining after the()\n let setEntityAfterAnd = () => {}; // ._('entity') after .and\n let setEntityIdentifiers = () => {}; // .identified.by(...) for main subject\n let setAction = () => {}; // .has.been(...) for action\n let setActor = () => {}; // .by('actor')\n let setActorIdentifier = () => {}; // .identified.by(...) inside .by(...)\n let addContext = () => {}; // .with(...).set.to(...)\n let addReference = () => {}; // .referring.to(...)\n let getAddReference = () => {}; // .identified.by().as() inside .referring\n let conformingTo = () => {}; // .conform.to('SchemaName')\n let track = () => {}; // .then.track.with(emitter)\n let addCollection = () => {};\n\n // Adjective chaining: .and(...)._('entity')\n setEntityAfterAnd = (entity) => {\n eventInstance.addAdjective(eventInstance.entity);\n eventInstance.setEntity(entity);\n return {\n as: () => {\n return { helpers }\n },\n identified: {\n by: setEntityIdentifiers\n },\n has: { been: setAction },\n helpers\n };\n };\n\n // Identifier setup: .identified.by().as()\n setEntityIdentifiers = (name) => {\n eventInstance.setIdentifier(name, null);\n return {\n as: (value) => {\n eventInstance.setIdentifier(name, value);\n return {\n helpers,\n and: {\n by: setEntityIdentifiers\n },\n has: { been: setAction },\n }\n },\n helpers\n };\n };\n\n // Additional adjectives: .and('...')._()\n andEntity = (entity) => {\n eventInstance.addAdjective(eventInstance.entity);\n eventInstance.setEntity(entity);\n return {\n and: andEntity,\n _ : setEntityAfterAnd,\n helpers\n }\n };\n\n // Action: .has.been('...')\n setAction = (action) => {\n eventInstance.setAction(action);\n return {\n by: setActor,\n referring: { to: addReference },\n with: addContext,\n conform: {to: conformingTo},\n then: {track: {with: track}},\n including: {\n a: addCollection,\n },\n helpers\n }\n };\n\n // Actor: .by('user')\n setActor = (name) => {\n eventInstance.setActor(name);\n return { \n identified: {\n by: setActorIdentifier\n },\n with: addContext,\n including: {\n a: addCollection,\n },\n helpers\n }\n };\n\n // Actor identifier: .identified.by().as()\n setActorIdentifier = (name) => {\n return {\n as: (value) => {\n eventInstance.setActorIdentifier(name, value);\n return {\n helpers,\n and: setActorIdentifier,\n with: addContext,\n referring: { to: addReference },\n including: {\n a: addCollection,\n },\n }\n },\n helpers\n }\n };\n\n // Contextual field: .with('key').set.to('value')\n addContext = (context) => {\n return {\n helpers,\n set: {\n to: (value) => {\n eventInstance.setContext(context, value);\n return {\n helpers,\n and: addContext,\n referring: { to: addReference },\n including: {\n a: addCollection,\n },\n }\n }\n }\n }\n };\n\n // Reference: .referring.to('...')\n addReference = (entity) => {\n eventInstance.setRefence(entity);\n return {\n identified: {\n by: getAddReference(entity)\n },\n conform: {to: conformingTo},\n then: {track: {with: track}},\n including: {\n a: addCollection,\n },\n helpers\n }\n };\n\n // Reference identifier setup: .identified.by().as()\n getAddReference = (entity) => {\n return (name) => {\n return {\n as: (value) => {\n eventInstance.setRefenceIdentifier(entity, name, value);\n return {\n helpers,\n and: {by: getAddReference(entity) },\n conform: {to: conformingTo},\n then: {track: {with: track}},\n including: {\n a: addCollection,\n },\n }\n },\n helpers,\n };\n };\n };\n\n // Schema declaration: .conform.to('...')\n conformingTo = (name) => {\n eventInstance.setSchema(name);\n return { \n then: {track: {with: track}},\n helpers\n }\n };\n\n addCollection = (entity) => {\n const collection = () => {\n eventInstance.setCollection(entity);\n \n const addItem = (referenceName) => {\n const itemKey = eventInstance.setCollectionItem(entity);\n const addIdentifier = (referenceNameNewIdentifier) => {\n referenceName = referenceNameNewIdentifier;\n return {\n as: addItemReferenceValue,\n }\n }\n const addItemReferenceValue = (value) => {\n eventInstance.setCollectionItemReference(entity, itemKey, referenceName, value);\n return {\n and: {\n helpers, \n by: addIdentifier,\n item: { \n identified: { \n by: addItem\n }\n },\n a: addCollection\n },\n conform: {\n to: conformingTo,\n }, \n then: {track: {with: track}},\n helpers\n }\n }\n return {\n as: addItemReferenceValue\n }\n\n };\n\n return {\n helpers,\n with: {\n item: {\n identified: {\n by: addItem\n }\n }\n },\n and: { a: addCollection }\n }\n };\n return {\n collection\n }\n }\n\n // Final dispatch: .then.track.with(tracker)\n track = (tracker) => {\n if(!(tracker instanceof CollecionesTracker)){\n throw new Error('can only be a CollecionesTracker')\n }\n tracker.track(eventInstance);\n return {\n and: track,\n helpers,\n }\n };\n\n return {\n and: andEntity,\n _: setEntityAfterAnd,\n identified: {\n by: setEntityIdentifiers\n },\n has: { been: setAction},\n node: '_base',\n helpers\n }\n\n })(entity);\n}\n\nlet collecionesDsl = {\n the: init\n};\n\n\nexport default collecionesDsl;","import CollecionesEmitter from './CollecionesEmitter.js';\nimport CollecionesTracker from './CollecionesTracker.js';\nimport CollecionesWebTracker from './CollecionesWebTracker.js';\nimport CollecionesEvent from './CollecionesEvent.js';\nimport collecionesDsl from './collecionesDsl.js';\n\n(function(global) {\n global.CollecionesEmitter = CollecionesEmitter;\n global.CollecionesTracker = CollecionesTracker;\n global.CollecionesWebTracker = CollecionesWebTracker;\n global.CollecionesEvent = CollecionesEvent;\n global.collecionesDsl = collecionesDsl;\n})(typeof window !== 'undefined' ? window : globalThis);"],"names":[],"mappings":";;;EAAA;;;EAGA;EACA;EACA;EACA;EACA;EACA;EACA,MAAM,QAAQ,GAAG,UAAU,GAAG,EAAE;EAChC,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE;EAC5E,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;EAC7D,KAAK,MAAM;EACX,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;EAC3D;EACA;;EAgBA;EACA;EACA;EACA;EACA;EACA,MAAM,iBAAiB,GAAG,WAAW;EACrC,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE;EAC3E,QAAQ,OAAO,EAAE;EACjB;EACA,IAAI,OAAO;EACX,QAAQ,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE;EACrC,QAAQ,QAAQ,EAAE,SAAS,CAAC,QAAQ;EACpC,QAAQ,QAAQ,EAAE,SAAS,CAAC,QAAQ;EACpC,QAAQ,QAAQ,EAAE,QAAQ,CAAC,QAAQ;EACnC,QAAQ,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM;EAC1C,QAAQ,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK;EACxC,QAAQ,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,QAAQ;EAClE,QAAQ,GAAG,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI;EACjC,QAAQ,SAAS,EAAE,SAAS,CAAC,SAAS;EACtC,QAAQ,c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MAAM,CAAC,gBAAgB,GAAG,gBAAgB;EAC5C,EAAE,MAAM,CAAC,cAAc,GAAG,cAAc;EACxC,CAAC,EAAE,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,GAAG,UAAU,CAAC;;;;;;"}
1
+ {"version":3,"file":"collecionesClientos.iife.js","sources":["../src/utils/utils.js","../src/CollecionesEvent.js","../src/CollecionesEmitter.js","../src/CollecionesTracker.js","../src/CollecionesWebTracker.js","../src/collecionesDsl.js","../src/collecionesClientos.js"],"sourcesContent":["// helper 'private' functions\n\n\n/**\n * Encodes a string to Base64.\n * Uses browser or Node.js method depending on environment.\n * @param {string} str\n * @returns {string}\n */\nconst toBase64 = function (str) {\n if (typeof window !== 'undefined' && typeof window.btoa === 'function') {\n return window.btoa(unescape(encodeURIComponent(str)));\n } else {\n return Buffer.from(str, 'utf-8').toString('base64');\n }\n}\n\n/**\n * Decodes a Base64 string to UTF-8.\n * Uses browser or Node.js method depending on environment.\n * @param {string} b64\n * @returns {string}\n */\nconst fromBase64 = function (b64) {\n if (typeof window !== 'undefined' && typeof window.atob === 'function') {\n return decodeURIComponent(escape(window.atob(b64)));\n } else {\n return Buffer.from(b64, 'base64').toString('utf-8');\n }\n}\n\n/**\n * Collects browser-related context values like screen size, language, etc.\n * Returns an empty object if not in browser environment.\n * @returns {Object}\n */\nconst getBrowserContext = function() {\n if (typeof window === 'undefined' || typeof navigator === 'undefined') {\n return {};\n }\n return {\n hasFocus: document.hasFocus(),\n language: navigator.language,\n platform: navigator.platform,\n referrer: document.referrer,\n screenHeight: window.screen.height,\n screenWidth: window.screen.width,\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n url: window.location.href,\n userAgent: navigator.userAgent,\n viewportHeight: window.innerHeight,\n viewportWidth: window.innerWidth,\n };\n}\n\nconst formatToCamelCase = function(input) {\n return input\n .replace(/[^a-zA-Z0-9]+/g, ' ')\n .trim()\n .split(/\\s+/)\n .map((word, index) => {\n if (index === 0) return word;\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n })\n .join('');\n}\n\nexport {\n fromBase64,\n formatToCamelCase,\n getBrowserContext,\n toBase64,\n};","/**\n * CollecionesEvent\n * -----------------\n * Base class representing a semantically structured event object.\n * Each event models a specific interaction with an entity, optionally performed by an actor,\n * and may reference related entities or include contextual metadata.\n *\n * Key features:\n * - Captures structured semantics: entity, action, actor, context, references\n * - Supports multiple identifiers for both the main entity and the actor\n * - Allows origin tagging for cross-context or cross-application references\n * - Supports referencing collections of entities or grouped data\n * - Includes timestamps and tracker/app metadata for auditability\n * - Fully serializable and deserializable via toJSON/fromJSON\n */\n\nimport {formatToCamelCase } from './utils/utils.js';\n\nclass CollecionesEvent {\n\n /**\n * Constructs a new CollecionesEvent with default structure and timestamps.\n * Initializes empty containers for semantic attributes such as:\n * - entity: the subject of the event\n * - adjectives: descriptors of the entity\n * - identifiers: identifiers of the entity\n * - action: what happened to the entity\n * - actor: who or what triggered the event (with identifiers in actorIdentifiers)\n * - context: environmental data related to the event\n * - references: external entities involved, optionally scoped by origin\n * - collections: groups of related entities\n * - meta: tracking metadata and timestamps\n */\n constructor() {\n // initialize event properties\n this.entity = '';\n this.adjevtives = [];\n this.identifiers = {};\n this.action = '';\n this.actor = {};\n this.actorIdentifiers = {};\n this.context = {};\n this.references = {};\n this.collections = {};\n // set default values\n this.meta = {\n eventFormat: 'CollecionesEvent',\n eventFormatVersion: '1'\n };\n this.meta.tracker = '';\n this.meta.app = '';\n this.meta.timestamps = {};\n this.meta.timestamps.clientDatetimeUtc = new Date().toISOString();\n if (typeof window !== 'undefined' && typeof navigator !== 'undefined' && navigator.language) {\n this.meta.timestamps.clientDatetimeLocal = new Date(Date.now() - new Date().getTimezoneOffset() * 60000).toISOString();\n this.meta.timestamps.timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n this.meta.timestamps.timeZoneOffset = new Date().getTimezoneOffset()\n } else {\n this.meta.timestamps.clientDatetimeLocal = new Date().toISOString();\n this.meta.timestamps.timeZone = 'UTC';\n }\n }\n\n /**\n * Returns the declared event format.\n * @returns {string} The format name (e.g. 'CollecionesEvent').\n */\n getEventFormat() {\n let v = this.meta?.eventFormat;\n return (typeof v !== 'undefined') ? v : '1';\n }\n\n /**\n * Returns the version of the event format.\n * @returns {string} The format version string.\n */\n getEventFormatVersion() {\n let v = this?.meta?.eventFormatVersion;\n return (typeof v !== 'undefined') ? v : 'CollecionesEvent';\n }\n\n /**\n * Overrides or supplements the event's timestamp fields with custom values.\n * @param {object} dateTimeObject - Key-value pairs to merge into the existing timestamp object.\n */\n overrideDatetime(dateTimeObject = {}) {\n for (const [key, value] of Object.entries(dateTimeObject)) {\n this.meta.timestamps[key] = value;\n }\n }\n\n /**\n * Sets the name of the tracker responsible for generating this event.\n * @param {string} name - Tracker name.\n */\n setTracker(name) {\n this.meta.tracker = name;\n }\n\n /**\n * Sets the name of the application that generated the event.\n * @param {string} name - Application name.\n */\n setAppName(name) {\n this.meta.appName = name;\n }\n\n /**\n * Sets the expected schema name for this event.\n * @param {string} schema - The name of the schema.\n */\n setSchema(schema) {\n if (typeof schema !== 'string') {\n throw new Error('Schema must be a string');\n }\n this.meta.schema = schema;\n }\n\n /**\n * Sets the entity (subject) of the event.\n * @param {string} entity - The entity name.\n */\n setEntity = function(entity) {\n this.entity = formatToCamelCase(entity);\n }\n \n /**\n * Defines the main action of the event (e.g., 'clicked').\n * @param {string} action - The action string.\n */\n setAction = function(action) {\n this.action = formatToCamelCase(action);\n }\n\n /**\n * Adds an adjective that describes the entity in more detail.\n * @param {string} adjective - An adjective string.\n */\n addAdjective = function(adjective) {\n if (typeof adjective !== 'string') {\n throw new Error('Adjective must be a string');\n }\n this.adjevtives.push(formatToCamelCase(adjective));\n }\n\n /**\n * Adds or updates an identifier for the primary entity.\n * Identifiers allow multiple keys to uniquely identify the entity.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n */\n setIdentifier = function(name, identifier) {\n if (typeof name !== 'string') {\n throw new Error('Identifier name must be a string');\n }\n this.identifiers[name] = identifier;\n }\n\n /**\n * Defines the name of the actor (who or what performed the action).\n * @param {string} name - Actor name (e.g., 'user', 'system').\n */\n setActor = function(name) {\n if (typeof name !== 'string') {\n throw new Error('Actor name must be a string');\n }\n this.actor.name = name;\n }\n\n /**\n * Adds or updates an identifier for the actor.\n * Supports multiple identifiers to uniquely identify the actor.\n * @param {string} name - Identifier key.\n * @param {*} identifier - Identifier value.\n */\n setActorIdentifier = function(name, identifier) {\n if (typeof name !== 'string') {\n throw new Error('Actor Identifier name must be a string');\n }\n this.actorIdentifiers[name] = identifier;\n }\n\n /**\n * Adds contextual information to the event.\n * Context can include any additional environmental or situational data.\n * @param {string} context - The key of the context field.\n * @param {*} value - The value of the context field.\n */\n setContext = function(context, value) {\n if (typeof context !== 'string') {\n throw new Error('Context must be a string');\n }\n this.context[context] = value;\n }\n\n /**\n * Alias for `setReference` for compatibility.\n * Declares an external entity referenced by this event.\n * @param {string} entity - The referenced entity name.\n * @param {string|null} origin - The origin application or context (optional).\n */\n setRefence = function(entity, origin=null) {\n return this.setReference(entity, origin);\n }\n\n /**\n * Declares an entity referenced by this event.\n * References may include multiple identifiers and an optional origin to scope the reference.\n * @param {string} entity - The referenced entity name.\n * @param {string|null} origin - The origin application or context (optional).\n */\n setReference = function(entity, origin=null) {\n if (typeof entity !== 'string') {\n throw new Error('Referenced entity must be a string');\n }\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.references[entity] === undefined) {\n this.references[entity] = {\n identifiers: {},\n origin\n };\n }\n }\n\n /**\n * Adds or updates an identifier for a referenced entity.\n * Ensures the reference is declared and sets the identifier under that reference.\n * @param {string} entity - The referenced entity name.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @param {string|null} origin - Optional origin context.\n */\n setRefenceIdentifier = function(entity, name, identifier, origin=null) {\n return this.setReferenceIdentifier(entity, name, identifier, origin);\n }\n\n /**\n * Adds or updates an identifier for a referenced entity.\n * @param {string} entity - The referenced entity name.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @param {string|null} origin - Optional origin context.\n */\n setReferenceIdentifier = function(entity, name, identifier, origin=null) {\n if (typeof entity !== 'string') {\n throw new Error('Referenced entity name must be a string');\n }\n if (typeof name !== 'string') {\n throw new Error('Actor Identifier name must be a string');\n }\n this.setRefence(entity, origin);\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.references[entity].identifiers[name] = identifier;\n }\n\n /**\n * Declares a collection of related entities for this event.\n * Collections group multiple related items and may include identifiers and origin metadata.\n * @param {string} entity - The collection name.\n * @param {string|null} origin - Optional origin identifier (e.g. system name).\n */\n setCollection = function(entity, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.collections[entity] == undefined) {\n this.collections[entity] = {\n items: [],\n identifiers: {},\n origin\n };\n }\n }\n\n /**\n * Adds a new item to a collection and returns its index key.\n * Items represent individual elements within the collection.\n * @param {string} entity - The name of the collection.\n * @returns {number} Index of the newly added item in the collection.\n */\n setCollectionItem = function(entity, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.setCollection(entity);\n this.collections[entity].items.push({});\n let itemKey = this.collections[entity].items.length - 1;\n return itemKey;\n }\n\n /**\n * Assigns a reference (identifier) to a specific item in a collection.\n * Useful for tagging individual collection elements with identifiers.\n * @param {string} entity - Collection name.\n * @param {number} itemKey - The index of the item in the collection.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @throws {Error} If the item does not exist at the given index.\n */\n setCollectionItemReference = function(entity, itemKey, name, identifier, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.setCollection(entity);\n if(typeof this.collections[entity].items[itemKey] !== 'object') {\n throw new Error('bad bad man, the collection key does not exists');\n }\n this.collections[entity].items[itemKey][name] = identifier;\n }\n \n /**\n * Sets a static identifier that applies to the entire collection.\n * These identifiers describe the collection as a whole.\n * @param {string} entity - Collection name.\n * @param {string} name - Identifier key.\n * @param {*} identifier - Identifier value.\n */\n setCollectionIdentifier = function(entity, name, identifier, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.collections[entity] == undefined) {\n this.collections[entity] = {};\n }\n this.collections[entity].identifiers[name] = identifier;\n }\n\n /**\n * Serializes the event instance to a plain object suitable for transport or storage.\n * The output includes all semantic fields and metadata.\n * @returns {object} A plain JavaScript object representing the event.\n */\n toJSON() {\n return {\n class: 'CollecionesEvent',\n entity: this.entity,\n adjectives: this.adjevtives,\n identifiers: this.identifiers,\n action: this.action,\n actor: this.actor,\n actorIdentifiers: this.actorIdentifiers,\n actorIds: this.actorIds,\n context: this.context,\n references: this.references,\n meta: this.meta,\n collections: this.collections\n };\n }\n\n /**\n * Recreates a CollecionesEvent instance from a plain object.\n * Used when deserializing events from storage or network transport.\n * @param {object} obj - The input object containing event data.\n * @returns {CollecionesEvent} A rehydrated event instance.\n * @throws {Error} If the class type is not 'CollecionesEvent'.\n */\n static fromJSON(obj) { \n if (!obj || obj.class !== 'CollecionesEvent') {\n throw new Error('Invalid or missing event class type'); \n } \n const instance = new CollecionesEvent();\n instance.entity = obj.entity;\n instance.adjevtives = obj.adjectives || [];\n instance.identifiers = obj.identifiers || {};\n instance.action = obj.action;\n instance.actor = obj.actor;\n instance.actorIdentifiers = obj.actorIdentifiers;\n instance.actorIds = obj.actorIds;\n instance.context = obj.context || {};\n instance.references = obj.references || {};\n instance.meta = obj.meta || {};\n instance.collections = obj.collections || {};\n return instance;\n }\n \n}\n\nexport default CollecionesEvent;","import { fromBase64, toBase64 } from './utils/utils.js';\nimport CollecionesEvent from './CollecionesEvent.js';\n\n/**\n * CollecionesEmitter\n * -------------------\n * This class collects and sends event objects to a remote endpoint (e.g., an event collector API).\n * It is used in both client- and server-side tracking scenarios, typically in combination with\n * CollecionesEvent or subclasses like CollecionesBaseEvent.\n *\n * Behavior:\n * - Events are buffered via `.track()` or `.trackAsync()`.\n * - If the number of buffered events reaches `flushSize`, the buffer is automatically flushed.\n * - If `flushInterval` is provided, the buffer is flushed at a fixed interval.\n * - Flushing serializes each event using `.toJSON()`, encodes it with base64, and posts\n * the resulting array to the configured endpoint.\n *\n * Example usage:\n * const emitter = new CollecionesEmitter('/track', 5, 10000);\n * emitter.track(new CollecionesEvent());\n *\n * Note:\n * This class is stateful. To stop periodic flushing, call `.stopTimer()` when the emitter is no longer in use.\n */\nclass CollecionesEmitter {\n\n /**\n * Initializes the emitter with buffering settings.\n * @param {string} [endpoint='/collect'] - The URL to send events to.\n * @param {number} [flushSize=10] - Number of events to buffer before flushing.\n * @param {number|boolean} [flushInterval=false] - Time in ms to flush events periodically.\n */\n constructor(endpoint = '/collect', flushSize = 10, flushInterval = false) {\n this.endpoint = endpoint;\n this.flushInterval = flushInterval;\n this.flushSize = flushSize;\n this.buffer = [];\n this.timer = null;\n this.lastPayload = null;\n }\n\n /**\n * Starts the flush timer if a valid interval is set.\n * @returns {void}\n */\n startTimer() {\n this.stopTimer();\n if (typeof this.flushInterval == 'number' && this.flushInterval > 0) {\n this.timer = setInterval(() => this.flush(), this.flushInterval);\n }\n }\n\n /**\n * Starts the flush timer only if not already running.\n * @returns {void}\n */\n startTimerIfStopped() {\n if (!this.timer) {\n this.startTimer();\n }\n }\n\n /**\n * Stops the active flush timer.\n * @returns {void}\n */\n stopTimer() {\n if (this.timer) {\n clearInterval(this.timer);\n }\n this.timer = null;\n }\n\n /**\n * Adds an event to the buffer and flushes if threshold is reached.\n * Validates that the event is an instance of CollecionesEvent to ensure correct event type.\n * @param {CollecionesEvent} event - Event instance to be tracked.\n * @throws {Error} Throws if event is not a CollecionesEvent instance.\n * @returns {void}\n */\n track(event) {\n if (!(event instanceof CollecionesEvent)) {\n throw new Error('Event must be an instance of CollecionesEvent');\n }\n this.trackAsync(event);\n }\n\n /**\n * Asynchronously adds an event and flushes if the buffer size is exceeded.\n * Validates that the event is an instance of CollecionesEvent to ensure correct event type.\n * @param {CollecionesEvent} event - Event instance to be tracked asynchronously.\n * @throws {Error} Throws if event is not a CollecionesEvent instance.\n * @returns {Promise<void>} Resolves when event is added and flush triggered if needed.\n */\n async trackAsync(event) {\n if (!(event instanceof CollecionesEvent)) {\n throw new Error('Event must be an instance of CollecionesEvent');\n }\n this.startTimerIfStopped();\n this.buffer.push(event);\n return (this.buffer.length >= this.flushSize) ? this.flush() : Promise.resolve();\n }\n\n /**\n * Sends all buffered events in a single POST request to the server.\n * Each event is serialized via `.toJSON()` and encoded as a base64 string.\n * Response status is checked for HTTP success; errors are logged but not thrown.\n *\n * @returns {Promise<boolean|undefined>} Resolves true if flush was triggered, or undefined if buffer was empty.\n */\n async flush() {\n if (this.buffer.length === 0) return;\n this.stopTimer();\n const body = this.buildBody();\n this.lastPayload = body;\n this.buffer = [];\n try {\n const response = await fetch(this.endpoint, {\n method: 'POST',\n credentials: 'include',\n headers: {\n 'Content-Type': 'application/json'\n },\n body\n });\n if (!response.ok) {\n console.log(`Failed to send events: ${response.statusText}`);\n }\n return true;\n } catch (error) { \n console.log(`Network error sending events: ${error.message}`);\n } \n }\n\n /**\n * Builds a POST-ready payload from the current buffer, without clearing it.\n * @returns {string} JSON string of base64-encoded serialized events.\n */\n buildBody() {\n return JSON.stringify(this.buffer.map(e => toBase64(JSON.stringify(e.toJSON()))));\n }\n\n}\n\nexport default CollecionesEmitter;","import CollecionesEvent from './CollecionesEvent.js';\n\n/**\n * Tracks events by enriching them with shared identifiers and routing through configured emitters.\n */\nclass CollecionesTracker {\n\n /**\n * Constructs a new tracker instance.\n * @param {Array} emitters - Array of emitter instances responsible for sending events.\n * @param {string} trackerName - Name identifying this tracker.\n * @param {string} appName - Name of the application generating events.\n */\n constructor(emitters, trackerName, appName) {\n this.emitters = emitters;\n this.trackerName = trackerName;\n this.appName = appName;\n }\n\n /**\n * Sends an event to all emitters after enriching it with identifiers and metadata.\n * @param {CollecionesEvent} collecionesEvent - The event to be sent.\n * @throws {Error} If the input is not an instance of CollecionesEvent.\n */\n track(collecionesEvent) {\n if (!(collecionesEvent instanceof CollecionesEvent)) {\n throw new Error('Event must be of type CollecionesEvent');\n }\n collecionesEvent.setTracker(this.trackerName);\n collecionesEvent.setAppName(this.appName); \n this.emitters.forEach(element => {\n element.track(collecionesEvent, this.trackerName, this.appName);\n });\n }\n}\n\nexport default CollecionesTracker;","import CollecionesEvent from './CollecionesEvent.js';\nimport CollecionesTracker from './CollecionesTracker.js';\nimport { getBrowserContext } from './utils/utils.js';\n\n/**\n * Web-specific tracker that enriches events with browser context before sending them.\n * Extends the base CollecionesTracker.\n */\nclass CollecionesWebTracker extends CollecionesTracker {\n /**\n * Creates a new instance of CollecionesWebTracker.\n * @param {Array} emitters - A list of emitter instances used to send the event.\n * @param {string} trackerName - The name of the tracker.\n * @param {string} appName - The name of the application generating events.\n */\n constructor(emitters, trackerName, appName) {\n super(emitters, trackerName, appName);\n }\n\n /**\n * Tracks an event, enriching it with browser context information.\n * @param {CollecionesEvent} collecionesEvent - The event object to track.\n * @throws {Error} If the event is not an instance of CollecionesEvent.\n */\n track(collecionesEvent) {\n if (!(collecionesEvent instanceof CollecionesEvent)) {\n throw new Error('Event must be of type CollecionesEvent');\n }\n collecionesEvent.setContext('browserContext', getBrowserContext());\n super.track(collecionesEvent); \n }\n}\n\nexport default CollecionesWebTracker;","/**\n * Colleciones DSL\n * ---------------\n * This module provides a fluent, human-readable DSL (domain-specific language) for constructing\n * structured tracking events based on CollecionesBaseEvent. Each step in the chain represents\n * a semantically meaningful piece of the event: the entity, the action, the actor, references, etc.\n *\n * Entry Point:\n * collecionesDsl.the('dark')\n *\n * Chaining:\n * - .and('...') : add additional adjectives\n * - ._('entity') : specify the entity being acted on\n * - .identified.by('field') : declare primary identifier for the subject\n * - .has.been('action') : declare what happened\n * - .by('actor') : describe the actor performing the action\n * - .identified.by('id') : add identifiers for the actor\n * - .with('key').set.to('val') : add contextual data fields\n * - .referring.to('entity') : describe referenced/related entities\n * - .identified.by('refId') : add identifiers for the reference\n * - .conform.to('SchemaName') : attach schema metadata\n * - .then.track.with(emitter) : finalize and emit the event\n *\n * Each function in the chain passes forward a scoped version of the CollecionesBaseEvent instance,\n * and enforces semantic constraints (e.g. `.as()` is required after `.by()`).\n *\n * Internal:\n * - Uses setRefence / setRefenceIdentifier for references\n * - Uses helpers.getEvent() for test access\n * - Uses instanceof CollecionesEmitter for validation\n *\n * This file is designed for internal use by developers building with the Colleciones tracking model.\n */\n\nimport CollecionesEvent from './CollecionesEvent.js';\nimport CollecionesTracker from './CollecionesTracker.js';\n\nlet init = (entity) => {\n return ((entity)=>{\n let eventInstance = new CollecionesEvent(); // Core event object\n eventInstance.setEntity(entity);\n\n let helpers = {\n getEvent: () => {\n return eventInstance;\n },\n };\n\n // DSL function groups\n let andEntity = () => {}; // .and(...) chaining after the()\n let setEntityAfterAnd = () => {}; // ._('entity') after .and\n let setEntityIdentifiers = () => {}; // .identified.by(...) for main subject\n let setAction = () => {}; // .has.been(...) for action\n let setActor = () => {}; // .by('actor')\n let setActorIdentifier = () => {}; // .identified.by(...) inside .by(...)\n let addContext = () => {}; // .with(...).set.to(...)\n let addReference = () => {}; // .referring.to(...)\n let getAddReference = () => {}; // .identified.by().as() inside .referring\n let conformingTo = () => {}; // .conform.to('SchemaName')\n let track = () => {}; // .then.track.with(emitter)\n let addCollection = () => {};\n\n // Adjective chaining: .and(...)._('entity')\n setEntityAfterAnd = (entity) => {\n eventInstance.addAdjective(eventInstance.entity);\n eventInstance.setEntity(entity);\n return {\n as: () => {\n return { helpers }\n },\n identified: {\n by: setEntityIdentifiers\n },\n has: { been: setAction },\n helpers\n };\n };\n\n // Identifier setup: .identified.by().as()\n setEntityIdentifiers = (name) => {\n eventInstance.setIdentifier(name, null);\n return {\n as: (value) => {\n eventInstance.setIdentifier(name, value);\n return {\n helpers,\n and: {\n by: setEntityIdentifiers\n },\n has: { been: setAction },\n }\n },\n helpers\n };\n };\n\n // Additional adjectives: .and('...')._()\n andEntity = (entity) => {\n eventInstance.addAdjective(eventInstance.entity);\n eventInstance.setEntity(entity);\n return {\n and: andEntity,\n _ : setEntityAfterAnd,\n helpers\n }\n };\n\n // Action: .has.been('...')\n setAction = (action) => {\n eventInstance.setAction(action);\n return {\n by: setActor,\n referring: { to: addReference },\n with: addContext,\n conform: {to: conformingTo},\n then: {track: {with: track}},\n including: {\n a: addCollection,\n },\n helpers\n }\n };\n\n // Actor: .by('user')\n setActor = (name) => {\n eventInstance.setActor(name);\n return { \n identified: {\n by: setActorIdentifier\n },\n with: addContext,\n including: {\n a: addCollection,\n },\n helpers\n }\n };\n\n // Actor identifier: .identified.by().as()\n setActorIdentifier = (name) => {\n return {\n as: (value) => {\n eventInstance.setActorIdentifier(name, value);\n return {\n helpers,\n and: setActorIdentifier,\n with: addContext,\n referring: { to: addReference },\n including: {\n a: addCollection,\n },\n }\n },\n helpers\n }\n };\n\n // Contextual field: .with('key').set.to('value')\n addContext = (context) => {\n return {\n helpers,\n set: {\n to: (value) => {\n eventInstance.setContext(context, value);\n return {\n helpers,\n and: addContext,\n referring: { to: addReference },\n including: {\n a: addCollection,\n },\n }\n }\n }\n }\n };\n\n // Reference: .referring.to('...')\n addReference = (entity) => {\n eventInstance.setRefence(entity);\n return {\n identified: {\n by: getAddReference(entity)\n },\n conform: {to: conformingTo},\n then: {track: {with: track}},\n including: {\n a: addCollection,\n },\n helpers\n }\n };\n\n // Reference identifier setup: .identified.by().as()\n getAddReference = (entity) => {\n return (name) => {\n return {\n as: (value) => {\n eventInstance.setRefenceIdentifier(entity, name, value);\n return {\n helpers,\n and: {by: getAddReference(entity) },\n conform: {to: conformingTo},\n then: {track: {with: track}},\n including: {\n a: addCollection,\n },\n }\n },\n helpers,\n };\n };\n };\n\n // Schema declaration: .conform.to('...')\n conformingTo = (name) => {\n eventInstance.setSchema(name);\n return { \n then: {track: {with: track}},\n helpers\n }\n };\n\n addCollection = (entity) => {\n const collection = () => {\n eventInstance.setCollection(entity);\n \n const addItem = (referenceName) => {\n const itemKey = eventInstance.setCollectionItem(entity);\n const addIdentifier = (referenceNameNewIdentifier) => {\n referenceName = referenceNameNewIdentifier;\n return {\n as: addItemReferenceValue,\n }\n }\n const addItemReferenceValue = (value) => {\n eventInstance.setCollectionItemReference(entity, itemKey, referenceName, value);\n return {\n and: {\n helpers, \n by: addIdentifier,\n item: { \n identified: { \n by: addItem\n }\n },\n a: addCollection\n },\n conform: {\n to: conformingTo,\n }, \n then: {track: {with: track}},\n helpers\n }\n }\n return {\n as: addItemReferenceValue\n }\n\n };\n\n return {\n helpers,\n with: {\n item: {\n identified: {\n by: addItem\n }\n }\n },\n and: { a: addCollection }\n }\n };\n return {\n collection\n }\n }\n\n // Final dispatch: .then.track.with(tracker)\n track = (tracker) => {\n if(!(tracker instanceof CollecionesTracker)){\n throw new Error('can only be a CollecionesTracker')\n }\n tracker.track(eventInstance);\n return {\n and: track,\n helpers,\n }\n };\n\n return {\n and: andEntity,\n _: setEntityAfterAnd,\n identified: {\n by: setEntityIdentifiers\n },\n has: { been: setAction},\n node: '_base',\n helpers\n }\n\n })(entity);\n}\n\nlet collecionesDsl = {\n the: init\n};\n\n\nexport default collecionesDsl;","import CollecionesEmitter from './CollecionesEmitter.js';\nimport CollecionesTracker from './CollecionesTracker.js';\nimport CollecionesWebTracker from './CollecionesWebTracker.js';\nimport CollecionesEvent from './CollecionesEvent.js';\nimport collecionesDsl from './collecionesDsl.js';\n\n(function(global) {\n global.CollecionesEmitter = CollecionesEmitter;\n global.CollecionesTracker = CollecionesTracker;\n global.CollecionesWebTracker = CollecionesWebTracker;\n global.CollecionesEvent = CollecionesEvent;\n global.collecionesDsl = collecionesDsl;\n})(typeof window !== 'undefined' ? window : globalThis);"],"names":[],"mappings":";;;EAAA;;;EAGA;EACA;EACA;EACA;EACA;EACA;EACA,MAAM,QAAQ,GAAG,UAA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  if (typeof name !== 'string') {
306
306
  throw new Error('Actor Identifier name must be a string');
307
307
  }
308
+ this.setRefence(entity, origin);
308
309
  entity = formatToCamelCase(entity);
309
310
  if (origin !== null) {
310
311
  entity = `${origin}.${entity}`;
311
312
  }
312
- this.setRefence(entity, origin);
313
313
  this.references[entity].identifiers[name] = identifier;
314
314
  }
315
315
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/utils/utils.js","../src/CollecionesEvent.js","../src/CollecionesEmitter.js","../src/CollecionesTracker.js","../src/CollecionesWebTracker.js","../src/collecionesDsl.js"],"sourcesContent":["// helper 'private' functions\n\n\n/**\n * Encodes a string to Base64.\n * Uses browser or Node.js method depending on environment.\n * @param {string} str\n * @returns {string}\n */\nconst toBase64 = function (str) {\n if (typeof window !== 'undefined' && typeof window.btoa === 'function') {\n return window.btoa(unescape(encodeURIComponent(str)));\n } else {\n return Buffer.from(str, 'utf-8').toString('base64');\n }\n}\n\n/**\n * Decodes a Base64 string to UTF-8.\n * Uses browser or Node.js method depending on environment.\n * @param {string} b64\n * @returns {string}\n */\nconst fromBase64 = function (b64) {\n if (typeof window !== 'undefined' && typeof window.atob === 'function') {\n return decodeURIComponent(escape(window.atob(b64)));\n } else {\n return Buffer.from(b64, 'base64').toString('utf-8');\n }\n}\n\n/**\n * Collects browser-related context values like screen size, language, etc.\n * Returns an empty object if not in browser environment.\n * @returns {Object}\n */\nconst getBrowserContext = function() {\n if (typeof window === 'undefined' || typeof navigator === 'undefined') {\n return {};\n }\n return {\n hasFocus: document.hasFocus(),\n language: navigator.language,\n platform: navigator.platform,\n referrer: document.referrer,\n screenHeight: window.screen.height,\n screenWidth: window.screen.width,\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n url: window.location.href,\n userAgent: navigator.userAgent,\n viewportHeight: window.innerHeight,\n viewportWidth: window.innerWidth,\n };\n}\n\nconst formatToCamelCase = function(input) {\n return input\n .replace(/[^a-zA-Z0-9]+/g, ' ')\n .trim()\n .split(/\\s+/)\n .map((word, index) => {\n if (index === 0) return word;\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n })\n .join('');\n}\n\nexport {\n fromBase64,\n formatToCamelCase,\n getBrowserContext,\n toBase64,\n};","/**\n * CollecionesEvent\n * -----------------\n * Base class representing a semantically structured event object.\n * Each event models a specific interaction with an entity, optionally performed by an actor,\n * and may reference related entities or include contextual metadata.\n *\n * Key features:\n * - Captures structured semantics: entity, action, actor, context, references\n * - Supports multiple identifiers for both the main entity and the actor\n * - Allows origin tagging for cross-context or cross-application references\n * - Supports referencing collections of entities or grouped data\n * - Includes timestamps and tracker/app metadata for auditability\n * - Fully serializable and deserializable via toJSON/fromJSON\n */\n\nimport {formatToCamelCase } from './utils/utils.js';\n\nclass CollecionesEvent {\n\n /**\n * Constructs a new CollecionesEvent with default structure and timestamps.\n * Initializes empty containers for semantic attributes such as:\n * - entity: the subject of the event\n * - adjectives: descriptors of the entity\n * - identifiers: identifiers of the entity\n * - action: what happened to the entity\n * - actor: who or what triggered the event (with identifiers in actorIdentifiers)\n * - context: environmental data related to the event\n * - references: external entities involved, optionally scoped by origin\n * - collections: groups of related entities\n * - meta: tracking metadata and timestamps\n */\n constructor() {\n // initialize event properties\n this.entity = '';\n this.adjevtives = [];\n this.identifiers = {};\n this.action = '';\n this.actor = {};\n this.actorIdentifiers = {};\n this.context = {};\n this.references = {};\n this.collections = {};\n // set default values\n this.meta = {\n eventFormat: 'CollecionesEvent',\n eventFormatVersion: '1'\n };\n this.meta.tracker = '';\n this.meta.app = '';\n this.meta.timestamps = {};\n this.meta.timestamps.clientDatetimeUtc = new Date().toISOString();\n if (typeof window !== 'undefined' && typeof navigator !== 'undefined' && navigator.language) {\n this.meta.timestamps.clientDatetimeLocal = new Date(Date.now() - new Date().getTimezoneOffset() * 60000).toISOString();\n this.meta.timestamps.timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n this.meta.timestamps.timeZoneOffset = new Date().getTimezoneOffset()\n } else {\n this.meta.timestamps.clientDatetimeLocal = new Date().toISOString();\n this.meta.timestamps.timeZone = 'UTC';\n }\n }\n\n /**\n * Returns the declared event format.\n * @returns {string} The format name (e.g. 'CollecionesEvent').\n */\n getEventFormat() {\n let v = this.meta?.eventFormat;\n return (typeof v !== 'undefined') ? v : '1';\n }\n\n /**\n * Returns the version of the event format.\n * @returns {string} The format version string.\n */\n getEventFormatVersion() {\n let v = this?.meta?.eventFormatVersion;\n return (typeof v !== 'undefined') ? v : 'CollecionesEvent';\n }\n\n /**\n * Overrides or supplements the event's timestamp fields with custom values.\n * @param {object} dateTimeObject - Key-value pairs to merge into the existing timestamp object.\n */\n overrideDatetime(dateTimeObject = {}) {\n for (const [key, value] of Object.entries(dateTimeObject)) {\n this.meta.timestamps[key] = value;\n }\n }\n\n /**\n * Sets the name of the tracker responsible for generating this event.\n * @param {string} name - Tracker name.\n */\n setTracker(name) {\n this.meta.tracker = name;\n }\n\n /**\n * Sets the name of the application that generated the event.\n * @param {string} name - Application name.\n */\n setAppName(name) {\n this.meta.appName = name;\n }\n\n /**\n * Sets the expected schema name for this event.\n * @param {string} schema - The name of the schema.\n */\n setSchema(schema) {\n if (typeof schema !== 'string') {\n throw new Error('Schema must be a string');\n }\n this.meta.schema = schema;\n }\n\n /**\n * Sets the entity (subject) of the event.\n * @param {string} entity - The entity name.\n */\n setEntity = function(entity) {\n this.entity = formatToCamelCase(entity);\n }\n \n /**\n * Defines the main action of the event (e.g., 'clicked').\n * @param {string} action - The action string.\n */\n setAction = function(action) {\n this.action = formatToCamelCase(action);\n }\n\n /**\n * Adds an adjective that describes the entity in more detail.\n * @param {string} adjective - An adjective string.\n */\n addAdjective = function(adjective) {\n if (typeof adjective !== 'string') {\n throw new Error('Adjective must be a string');\n }\n this.adjevtives.push(formatToCamelCase(adjective));\n }\n\n /**\n * Adds or updates an identifier for the primary entity.\n * Identifiers allow multiple keys to uniquely identify the entity.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n */\n setIdentifier = function(name, identifier) {\n if (typeof name !== 'string') {\n throw new Error('Identifier name must be a string');\n }\n this.identifiers[name] = identifier;\n }\n\n /**\n * Defines the name of the actor (who or what performed the action).\n * @param {string} name - Actor name (e.g., 'user', 'system').\n */\n setActor = function(name) {\n if (typeof name !== 'string') {\n throw new Error('Actor name must be a string');\n }\n this.actor.name = name;\n }\n\n /**\n * Adds or updates an identifier for the actor.\n * Supports multiple identifiers to uniquely identify the actor.\n * @param {string} name - Identifier key.\n * @param {*} identifier - Identifier value.\n */\n setActorIdentifier = function(name, identifier) {\n if (typeof name !== 'string') {\n throw new Error('Actor Identifier name must be a string');\n }\n this.actorIdentifiers[name] = identifier;\n }\n\n /**\n * Adds contextual information to the event.\n * Context can include any additional environmental or situational data.\n * @param {string} context - The key of the context field.\n * @param {*} value - The value of the context field.\n */\n setContext = function(context, value) {\n if (typeof context !== 'string') {\n throw new Error('Context must be a string');\n }\n this.context[context] = value;\n }\n\n /**\n * Alias for `setReference` for compatibility.\n * Declares an external entity referenced by this event.\n * @param {string} entity - The referenced entity name.\n * @param {string|null} origin - The origin application or context (optional).\n */\n setRefence = function(entity, origin=null) {\n return this.setReference(entity, origin);\n }\n\n /**\n * Declares an entity referenced by this event.\n * References may include multiple identifiers and an optional origin to scope the reference.\n * @param {string} entity - The referenced entity name.\n * @param {string|null} origin - The origin application or context (optional).\n */\n setReference = function(entity, origin=null) {\n if (typeof entity !== 'string') {\n throw new Error('Referenced entity must be a string');\n }\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.references[entity] === undefined) {\n this.references[entity] = {\n identifiers: {},\n origin\n };\n }\n }\n\n /**\n * Adds or updates an identifier for a referenced entity.\n * Ensures the reference is declared and sets the identifier under that reference.\n * @param {string} entity - The referenced entity name.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @param {string|null} origin - Optional origin context.\n */\n setRefenceIdentifier = function(entity, name, identifier, origin=null) {\n return this.setReferenceIdentifier(entity, name, identifier, origin);\n }\n\n /**\n * Adds or updates an identifier for a referenced entity.\n * @param {string} entity - The referenced entity name.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @param {string|null} origin - Optional origin context.\n */\n setReferenceIdentifier = function(entity, name, identifier, origin=null) {\n if (typeof entity !== 'string') {\n throw new Error('Referenced entity name must be a string');\n }\n if (typeof name !== 'string') {\n throw new Error('Actor Identifier name must be a string');\n }\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.setRefence(entity, origin);\n this.references[entity].identifiers[name] = identifier;\n }\n\n /**\n * Declares a collection of related entities for this event.\n * Collections group multiple related items and may include identifiers and origin metadata.\n * @param {string} entity - The collection name.\n * @param {string|null} origin - Optional origin identifier (e.g. system name).\n */\n setCollection = function(entity, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.collections[entity] == undefined) {\n this.collections[entity] = {\n items: [],\n identifiers: {},\n origin\n };\n }\n }\n\n /**\n * Adds a new item to a collection and returns its index key.\n * Items represent individual elements within the collection.\n * @param {string} entity - The name of the collection.\n * @returns {number} Index of the newly added item in the collection.\n */\n setCollectionItem = function(entity, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.setCollection(entity);\n this.collections[entity].items.push({});\n let itemKey = this.collections[entity].items.length - 1;\n return itemKey;\n }\n\n /**\n * Assigns a reference (identifier) to a specific item in a collection.\n * Useful for tagging individual collection elements with identifiers.\n * @param {string} entity - Collection name.\n * @param {number} itemKey - The index of the item in the collection.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @throws {Error} If the item does not exist at the given index.\n */\n setCollectionItemReference = function(entity, itemKey, name, identifier, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.setCollection(entity);\n if(typeof this.collections[entity].items[itemKey] !== 'object') {\n throw new Error('bad bad man, the collection key does not exists');\n }\n this.collections[entity].items[itemKey][name] = identifier;\n }\n \n /**\n * Sets a static identifier that applies to the entire collection.\n * These identifiers describe the collection as a whole.\n * @param {string} entity - Collection name.\n * @param {string} name - Identifier key.\n * @param {*} identifier - Identifier value.\n */\n setCollectionIdentifier = function(entity, name, identifier, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.collections[entity] == undefined) {\n this.collections[entity] = {};\n }\n this.collections[entity].identifiers[name] = identifier;\n }\n\n /**\n * Serializes the event instance to a plain object suitable for transport or storage.\n * The output includes all semantic fields and metadata.\n * @returns {object} A plain JavaScript object representing the event.\n */\n toJSON() {\n return {\n class: 'CollecionesEvent',\n entity: this.entity,\n adjectives: this.adjevtives,\n identifiers: this.identifiers,\n action: this.action,\n actor: this.actor,\n actorIdentifiers: this.actorIdentifiers,\n actorIds: this.actorIds,\n context: this.context,\n references: this.references,\n meta: this.meta,\n collections: this.collections\n };\n }\n\n /**\n * Recreates a CollecionesEvent instance from a plain object.\n * Used when deserializing events from storage or network transport.\n * @param {object} obj - The input object containing event data.\n * @returns {CollecionesEvent} A rehydrated event instance.\n * @throws {Error} If the class type is not 'CollecionesEvent'.\n */\n static fromJSON(obj) { \n if (!obj || obj.class !== 'CollecionesEvent') {\n throw new Error('Invalid or missing event class type'); \n } \n const instance = new CollecionesEvent();\n instance.entity = obj.entity;\n instance.adjevtives = obj.adjectives || [];\n instance.identifiers = obj.identifiers || {};\n instance.action = obj.action;\n instance.actor = obj.actor;\n instance.actorIdentifiers = obj.actorIdentifiers;\n instance.actorIds = obj.actorIds;\n instance.context = obj.context || {};\n instance.references = obj.references || {};\n instance.meta = obj.meta || {};\n instance.collections = obj.collections || {};\n return instance;\n }\n \n}\n\nexport default CollecionesEvent;","import { fromBase64, toBase64 } from './utils/utils.js';\nimport CollecionesEvent from './CollecionesEvent.js';\n\n/**\n * CollecionesEmitter\n * -------------------\n * This class collects and sends event objects to a remote endpoint (e.g., an event collector API).\n * It is used in both client- and server-side tracking scenarios, typically in combination with\n * CollecionesEvent or subclasses like CollecionesBaseEvent.\n *\n * Behavior:\n * - Events are buffered via `.track()` or `.trackAsync()`.\n * - If the number of buffered events reaches `flushSize`, the buffer is automatically flushed.\n * - If `flushInterval` is provided, the buffer is flushed at a fixed interval.\n * - Flushing serializes each event using `.toJSON()`, encodes it with base64, and posts\n * the resulting array to the configured endpoint.\n *\n * Example usage:\n * const emitter = new CollecionesEmitter('/track', 5, 10000);\n * emitter.track(new CollecionesEvent());\n *\n * Note:\n * This class is stateful. To stop periodic flushing, call `.stopTimer()` when the emitter is no longer in use.\n */\nclass CollecionesEmitter {\n\n /**\n * Initializes the emitter with buffering settings.\n * @param {string} [endpoint='/collect'] - The URL to send events to.\n * @param {number} [flushSize=10] - Number of events to buffer before flushing.\n * @param {number|boolean} [flushInterval=false] - Time in ms to flush events periodically.\n */\n constructor(endpoint = '/collect', flushSize = 10, flushInterval = false) {\n this.endpoint = endpoint;\n this.flushInterval = flushInterval;\n this.flushSize = flushSize;\n this.buffer = [];\n this.timer = null;\n this.lastPayload = null;\n }\n\n /**\n * Starts the flush timer if a valid interval is set.\n * @returns {void}\n */\n startTimer() {\n this.stopTimer();\n if (typeof this.flushInterval == 'number' && this.flushInterval > 0) {\n this.timer = setInterval(() => this.flush(), this.flushInterval);\n }\n }\n\n /**\n * Starts the flush timer only if not already running.\n * @returns {void}\n */\n startTimerIfStopped() {\n if (!this.timer) {\n this.startTimer();\n }\n }\n\n /**\n * Stops the active flush timer.\n * @returns {void}\n */\n stopTimer() {\n if (this.timer) {\n clearInterval(this.timer);\n }\n this.timer = null;\n }\n\n /**\n * Adds an event to the buffer and flushes if threshold is reached.\n * Validates that the event is an instance of CollecionesEvent to ensure correct event type.\n * @param {CollecionesEvent} event - Event instance to be tracked.\n * @throws {Error} Throws if event is not a CollecionesEvent instance.\n * @returns {void}\n */\n track(event) {\n if (!(event instanceof CollecionesEvent)) {\n throw new Error('Event must be an instance of CollecionesEvent');\n }\n this.trackAsync(event);\n }\n\n /**\n * Asynchronously adds an event and flushes if the buffer size is exceeded.\n * Validates that the event is an instance of CollecionesEvent to ensure correct event type.\n * @param {CollecionesEvent} event - Event instance to be tracked asynchronously.\n * @throws {Error} Throws if event is not a CollecionesEvent instance.\n * @returns {Promise<void>} Resolves when event is added and flush triggered if needed.\n */\n async trackAsync(event) {\n if (!(event instanceof CollecionesEvent)) {\n throw new Error('Event must be an instance of CollecionesEvent');\n }\n this.startTimerIfStopped();\n this.buffer.push(event);\n return (this.buffer.length >= this.flushSize) ? this.flush() : Promise.resolve();\n }\n\n /**\n * Sends all buffered events in a single POST request to the server.\n * Each event is serialized via `.toJSON()` and encoded as a base64 string.\n * Response status is checked for HTTP success; errors are logged but not thrown.\n *\n * @returns {Promise<boolean|undefined>} Resolves true if flush was triggered, or undefined if buffer was empty.\n */\n async flush() {\n if (this.buffer.length === 0) return;\n this.stopTimer();\n const body = this.buildBody();\n this.lastPayload = body;\n this.buffer = [];\n try {\n const response = await fetch(this.endpoint, {\n method: 'POST',\n credentials: 'include',\n headers: {\n 'Content-Type': 'application/json'\n },\n body\n });\n if (!response.ok) {\n console.log(`Failed to send events: ${response.statusText}`);\n }\n return true;\n } catch (error) { \n console.log(`Network error sending events: ${error.message}`);\n } \n }\n\n /**\n * Builds a POST-ready payload from the current buffer, without clearing it.\n * @returns {string} JSON string of base64-encoded serialized events.\n */\n buildBody() {\n return JSON.stringify(this.buffer.map(e => toBase64(JSON.stringify(e.toJSON()))));\n }\n\n}\n\nexport default CollecionesEmitter;","import CollecionesEvent from './CollecionesEvent.js';\n\n/**\n * Tracks events by enriching them with shared identifiers and routing through configured emitters.\n */\nclass CollecionesTracker {\n\n /**\n * Constructs a new tracker instance.\n * @param {Array} emitters - Array of emitter instances responsible for sending events.\n * @param {string} trackerName - Name identifying this tracker.\n * @param {string} appName - Name of the application generating events.\n */\n constructor(emitters, trackerName, appName) {\n this.emitters = emitters;\n this.trackerName = trackerName;\n this.appName = appName;\n }\n\n /**\n * Sends an event to all emitters after enriching it with identifiers and metadata.\n * @param {CollecionesEvent} collecionesEvent - The event to be sent.\n * @throws {Error} If the input is not an instance of CollecionesEvent.\n */\n track(collecionesEvent) {\n if (!(collecionesEvent instanceof CollecionesEvent)) {\n throw new Error('Event must be of type CollecionesEvent');\n }\n collecionesEvent.setTracker(this.trackerName);\n collecionesEvent.setAppName(this.appName); \n this.emitters.forEach(element => {\n element.track(collecionesEvent, this.trackerName, this.appName);\n });\n }\n}\n\nexport default CollecionesTracker;","import CollecionesEvent from './CollecionesEvent.js';\nimport CollecionesTracker from './CollecionesTracker.js';\nimport { getBrowserContext } from './utils/utils.js';\n\n/**\n * Web-specific tracker that enriches events with browser context before sending them.\n * Extends the base CollecionesTracker.\n */\nclass CollecionesWebTracker extends CollecionesTracker {\n /**\n * Creates a new instance of CollecionesWebTracker.\n * @param {Array} emitters - A list of emitter instances used to send the event.\n * @param {string} trackerName - The name of the tracker.\n * @param {string} appName - The name of the application generating events.\n */\n constructor(emitters, trackerName, appName) {\n super(emitters, trackerName, appName);\n }\n\n /**\n * Tracks an event, enriching it with browser context information.\n * @param {CollecionesEvent} collecionesEvent - The event object to track.\n * @throws {Error} If the event is not an instance of CollecionesEvent.\n */\n track(collecionesEvent) {\n if (!(collecionesEvent instanceof CollecionesEvent)) {\n throw new Error('Event must be of type CollecionesEvent');\n }\n collecionesEvent.setContext('browserContext', getBrowserContext());\n super.track(collecionesEvent); \n }\n}\n\nexport default CollecionesWebTracker;","/**\n * Colleciones DSL\n * ---------------\n * This module provides a fluent, human-readable DSL (domain-specific language) for constructing\n * structured tracking events based on CollecionesBaseEvent. Each step in the chain represents\n * a semantically meaningful piece of the event: the entity, the action, the actor, references, etc.\n *\n * Entry Point:\n * collecionesDsl.the('dark')\n *\n * Chaining:\n * - .and('...') : add additional adjectives\n * - ._('entity') : specify the entity being acted on\n * - .identified.by('field') : declare primary identifier for the subject\n * - .has.been('action') : declare what happened\n * - .by('actor') : describe the actor performing the action\n * - .identified.by('id') : add identifiers for the actor\n * - .with('key').set.to('val') : add contextual data fields\n * - .referring.to('entity') : describe referenced/related entities\n * - .identified.by('refId') : add identifiers for the reference\n * - .conform.to('SchemaName') : attach schema metadata\n * - .then.track.with(emitter) : finalize and emit the event\n *\n * Each function in the chain passes forward a scoped version of the CollecionesBaseEvent instance,\n * and enforces semantic constraints (e.g. `.as()` is required after `.by()`).\n *\n * Internal:\n * - Uses setRefence / setRefenceIdentifier for references\n * - Uses helpers.getEvent() for test access\n * - Uses instanceof CollecionesEmitter for validation\n *\n * This file is designed for internal use by developers building with the Colleciones tracking model.\n */\n\nimport CollecionesEvent from './CollecionesEvent.js';\nimport CollecionesTracker from './CollecionesTracker.js';\n\nlet init = (entity) => {\n return ((entity)=>{\n let eventInstance = new CollecionesEvent(); // Core event object\n eventInstance.setEntity(entity);\n\n let helpers = {\n getEvent: () => {\n return eventInstance;\n },\n };\n\n // DSL function groups\n let andEntity = () => {}; // .and(...) chaining after the()\n let setEntityAfterAnd = () => {}; // ._('entity') after .and\n let setEntityIdentifiers = () => {}; // .identified.by(...) for main subject\n let setAction = () => {}; // .has.been(...) for action\n let setActor = () => {}; // .by('actor')\n let setActorIdentifier = () => {}; // .identified.by(...) inside .by(...)\n let addContext = () => {}; // .with(...).set.to(...)\n let addReference = () => {}; // .referring.to(...)\n let getAddReference = () => {}; // .identified.by().as() inside .referring\n let conformingTo = () => {}; // .conform.to('SchemaName')\n let track = () => {}; // .then.track.with(emitter)\n let addCollection = () => {};\n\n // Adjective chaining: .and(...)._('entity')\n setEntityAfterAnd = (entity) => {\n eventInstance.addAdjective(eventInstance.entity);\n eventInstance.setEntity(entity);\n return {\n as: () => {\n return { helpers }\n },\n identified: {\n by: setEntityIdentifiers\n },\n has: { been: setAction },\n helpers\n };\n };\n\n // Identifier setup: .identified.by().as()\n setEntityIdentifiers = (name) => {\n eventInstance.setIdentifier(name, null);\n return {\n as: (value) => {\n eventInstance.setIdentifier(name, value);\n return {\n helpers,\n and: {\n by: setEntityIdentifiers\n },\n has: { been: setAction },\n }\n },\n helpers\n };\n };\n\n // Additional adjectives: .and('...')._()\n andEntity = (entity) => {\n eventInstance.addAdjective(eventInstance.entity);\n eventInstance.setEntity(entity);\n return {\n and: andEntity,\n _ : setEntityAfterAnd,\n helpers\n }\n };\n\n // Action: .has.been('...')\n setAction = (action) => {\n eventInstance.setAction(action);\n return {\n by: setActor,\n referring: { to: addReference },\n with: addContext,\n conform: {to: conformingTo},\n then: {track: {with: track}},\n including: {\n a: addCollection,\n },\n helpers\n }\n };\n\n // Actor: .by('user')\n setActor = (name) => {\n eventInstance.setActor(name);\n return { \n identified: {\n by: setActorIdentifier\n },\n with: addContext,\n including: {\n a: addCollection,\n },\n helpers\n }\n };\n\n // Actor identifier: .identified.by().as()\n setActorIdentifier = (name) => {\n return {\n as: (value) => {\n eventInstance.setActorIdentifier(name, value);\n return {\n helpers,\n and: setActorIdentifier,\n with: addContext,\n referring: { to: addReference },\n including: {\n a: addCollection,\n },\n }\n },\n helpers\n }\n };\n\n // Contextual field: .with('key').set.to('value')\n addContext = (context) => {\n return {\n helpers,\n set: {\n to: (value) => {\n eventInstance.setContext(context, value);\n return {\n helpers,\n and: addContext,\n referring: { to: addReference },\n including: {\n a: addCollection,\n },\n }\n }\n }\n }\n };\n\n // Reference: .referring.to('...')\n addReference = (entity) => {\n eventInstance.setRefence(entity);\n return {\n identified: {\n by: getAddReference(entity)\n },\n conform: {to: conformingTo},\n then: {track: {with: track}},\n including: {\n a: addCollection,\n },\n helpers\n }\n };\n\n // Reference identifier setup: .identified.by().as()\n getAddReference = (entity) => {\n return (name) => {\n return {\n as: (value) => {\n eventInstance.setRefenceIdentifier(entity, name, value);\n return {\n helpers,\n and: {by: getAddReference(entity) },\n conform: {to: conformingTo},\n then: {track: {with: track}},\n including: {\n a: addCollection,\n },\n }\n },\n helpers,\n };\n };\n };\n\n // Schema declaration: .conform.to('...')\n conformingTo = (name) => {\n eventInstance.setSchema(name);\n return { \n then: {track: {with: track}},\n helpers\n }\n };\n\n addCollection = (entity) => {\n const collection = () => {\n eventInstance.setCollection(entity);\n \n const addItem = (referenceName) => {\n const itemKey = eventInstance.setCollectionItem(entity);\n const addIdentifier = (referenceNameNewIdentifier) => {\n referenceName = referenceNameNewIdentifier;\n return {\n as: addItemReferenceValue,\n }\n }\n const addItemReferenceValue = (value) => {\n eventInstance.setCollectionItemReference(entity, itemKey, referenceName, value);\n return {\n and: {\n helpers, \n by: addIdentifier,\n item: { \n identified: { \n by: addItem\n }\n },\n a: addCollection\n },\n conform: {\n to: conformingTo,\n }, \n then: {track: {with: track}},\n helpers\n }\n }\n return {\n as: addItemReferenceValue\n }\n\n };\n\n return {\n helpers,\n with: {\n item: {\n identified: {\n by: addItem\n }\n }\n },\n and: { a: addCollection }\n }\n };\n return {\n collection\n }\n }\n\n // Final dispatch: .then.track.with(tracker)\n track = (tracker) => {\n if(!(tracker instanceof CollecionesTracker)){\n throw new Error('can only be a CollecionesTracker')\n }\n tracker.track(eventInstance);\n return {\n and: track,\n helpers,\n }\n };\n\n return {\n and: andEntity,\n _: setEntityAfterAnd,\n identified: {\n by: setEntityIdentifiers\n },\n has: { been: setAction},\n node: '_base',\n helpers\n }\n\n })(entity);\n}\n\nlet collecionesDsl = {\n the: init\n};\n\n\nexport default collecionesDsl;"],"names":[],"mappings":";;AAAA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,UAAU,GAAG,EAAE;AAChC,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE;AAC5E,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7D,KAAK,MAAM;AACX,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CA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AkB,CAAC,CAAC;AACxD,gBAAgB,MAAM,IAAI,KAAK,CAAC,kCAAkC;AAClE;AACA,YAAY,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC;AACxC,YAAY,OAAO;AACnB,gBAAgB,GAAG,EAAE,KAAK;AAC1B,gBAAgB,OAAO;AACvB;AACA,SAAS;;AAET,QAAQ,OAAO;AACf,YAAY,GAAG,EAAE,SAAS;AAC1B,YAAY,CAAC,EAAE,iBAAiB;AAChC,YAAY,UAAU,EAAE;AACxB,gBAAgB,EAAE,EAAE;AACpB,aAAa;AACb,YAAY,GAAG,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC;AACnC,YAAY,IAAI,EAAE,OAAO;AACzB,YAAY;AACZ;;AAEA,KAAK,EAAE,MAAM,CAAC;AACd;;AAEG,IAAC,cAAc,GAAG;AACrB,IAAI,GAAG,EAAE;AACT;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/utils/utils.js","../src/CollecionesEvent.js","../src/CollecionesEmitter.js","../src/CollecionesTracker.js","../src/CollecionesWebTracker.js","../src/collecionesDsl.js"],"sourcesContent":["// helper 'private' functions\n\n\n/**\n * Encodes a string to Base64.\n * Uses browser or Node.js method depending on environment.\n * @param {string} str\n * @returns {string}\n */\nconst toBase64 = function (str) {\n if (typeof window !== 'undefined' && typeof window.btoa === 'function') {\n return window.btoa(unescape(encodeURIComponent(str)));\n } else {\n return Buffer.from(str, 'utf-8').toString('base64');\n }\n}\n\n/**\n * Decodes a Base64 string to UTF-8.\n * Uses browser or Node.js method depending on environment.\n * @param {string} b64\n * @returns {string}\n */\nconst fromBase64 = function (b64) {\n if (typeof window !== 'undefined' && typeof window.atob === 'function') {\n return decodeURIComponent(escape(window.atob(b64)));\n } else {\n return Buffer.from(b64, 'base64').toString('utf-8');\n }\n}\n\n/**\n * Collects browser-related context values like screen size, language, etc.\n * Returns an empty object if not in browser environment.\n * @returns {Object}\n */\nconst getBrowserContext = function() {\n if (typeof window === 'undefined' || typeof navigator === 'undefined') {\n return {};\n }\n return {\n hasFocus: document.hasFocus(),\n language: navigator.language,\n platform: navigator.platform,\n referrer: document.referrer,\n screenHeight: window.screen.height,\n screenWidth: window.screen.width,\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n url: window.location.href,\n userAgent: navigator.userAgent,\n viewportHeight: window.innerHeight,\n viewportWidth: window.innerWidth,\n };\n}\n\nconst formatToCamelCase = function(input) {\n return input\n .replace(/[^a-zA-Z0-9]+/g, ' ')\n .trim()\n .split(/\\s+/)\n .map((word, index) => {\n if (index === 0) return word;\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n })\n .join('');\n}\n\nexport {\n fromBase64,\n formatToCamelCase,\n getBrowserContext,\n toBase64,\n};","/**\n * CollecionesEvent\n * -----------------\n * Base class representing a semantically structured event object.\n * Each event models a specific interaction with an entity, optionally performed by an actor,\n * and may reference related entities or include contextual metadata.\n *\n * Key features:\n * - Captures structured semantics: entity, action, actor, context, references\n * - Supports multiple identifiers for both the main entity and the actor\n * - Allows origin tagging for cross-context or cross-application references\n * - Supports referencing collections of entities or grouped data\n * - Includes timestamps and tracker/app metadata for auditability\n * - Fully serializable and deserializable via toJSON/fromJSON\n */\n\nimport {formatToCamelCase } from './utils/utils.js';\n\nclass CollecionesEvent {\n\n /**\n * Constructs a new CollecionesEvent with default structure and timestamps.\n * Initializes empty containers for semantic attributes such as:\n * - entity: the subject of the event\n * - adjectives: descriptors of the entity\n * - identifiers: identifiers of the entity\n * - action: what happened to the entity\n * - actor: who or what triggered the event (with identifiers in actorIdentifiers)\n * - context: environmental data related to the event\n * - references: external entities involved, optionally scoped by origin\n * - collections: groups of related entities\n * - meta: tracking metadata and timestamps\n */\n constructor() {\n // initialize event properties\n this.entity = '';\n this.adjevtives = [];\n this.identifiers = {};\n this.action = '';\n this.actor = {};\n this.actorIdentifiers = {};\n this.context = {};\n this.references = {};\n this.collections = {};\n // set default values\n this.meta = {\n eventFormat: 'CollecionesEvent',\n eventFormatVersion: '1'\n };\n this.meta.tracker = '';\n this.meta.app = '';\n this.meta.timestamps = {};\n this.meta.timestamps.clientDatetimeUtc = new Date().toISOString();\n if (typeof window !== 'undefined' && typeof navigator !== 'undefined' && navigator.language) {\n this.meta.timestamps.clientDatetimeLocal = new Date(Date.now() - new Date().getTimezoneOffset() * 60000).toISOString();\n this.meta.timestamps.timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n this.meta.timestamps.timeZoneOffset = new Date().getTimezoneOffset()\n } else {\n this.meta.timestamps.clientDatetimeLocal = new Date().toISOString();\n this.meta.timestamps.timeZone = 'UTC';\n }\n }\n\n /**\n * Returns the declared event format.\n * @returns {string} The format name (e.g. 'CollecionesEvent').\n */\n getEventFormat() {\n let v = this.meta?.eventFormat;\n return (typeof v !== 'undefined') ? v : '1';\n }\n\n /**\n * Returns the version of the event format.\n * @returns {string} The format version string.\n */\n getEventFormatVersion() {\n let v = this?.meta?.eventFormatVersion;\n return (typeof v !== 'undefined') ? v : 'CollecionesEvent';\n }\n\n /**\n * Overrides or supplements the event's timestamp fields with custom values.\n * @param {object} dateTimeObject - Key-value pairs to merge into the existing timestamp object.\n */\n overrideDatetime(dateTimeObject = {}) {\n for (const [key, value] of Object.entries(dateTimeObject)) {\n this.meta.timestamps[key] = value;\n }\n }\n\n /**\n * Sets the name of the tracker responsible for generating this event.\n * @param {string} name - Tracker name.\n */\n setTracker(name) {\n this.meta.tracker = name;\n }\n\n /**\n * Sets the name of the application that generated the event.\n * @param {string} name - Application name.\n */\n setAppName(name) {\n this.meta.appName = name;\n }\n\n /**\n * Sets the expected schema name for this event.\n * @param {string} schema - The name of the schema.\n */\n setSchema(schema) {\n if (typeof schema !== 'string') {\n throw new Error('Schema must be a string');\n }\n this.meta.schema = schema;\n }\n\n /**\n * Sets the entity (subject) of the event.\n * @param {string} entity - The entity name.\n */\n setEntity = function(entity) {\n this.entity = formatToCamelCase(entity);\n }\n \n /**\n * Defines the main action of the event (e.g., 'clicked').\n * @param {string} action - The action string.\n */\n setAction = function(action) {\n this.action = formatToCamelCase(action);\n }\n\n /**\n * Adds an adjective that describes the entity in more detail.\n * @param {string} adjective - An adjective string.\n */\n addAdjective = function(adjective) {\n if (typeof adjective !== 'string') {\n throw new Error('Adjective must be a string');\n }\n this.adjevtives.push(formatToCamelCase(adjective));\n }\n\n /**\n * Adds or updates an identifier for the primary entity.\n * Identifiers allow multiple keys to uniquely identify the entity.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n */\n setIdentifier = function(name, identifier) {\n if (typeof name !== 'string') {\n throw new Error('Identifier name must be a string');\n }\n this.identifiers[name] = identifier;\n }\n\n /**\n * Defines the name of the actor (who or what performed the action).\n * @param {string} name - Actor name (e.g., 'user', 'system').\n */\n setActor = function(name) {\n if (typeof name !== 'string') {\n throw new Error('Actor name must be a string');\n }\n this.actor.name = name;\n }\n\n /**\n * Adds or updates an identifier for the actor.\n * Supports multiple identifiers to uniquely identify the actor.\n * @param {string} name - Identifier key.\n * @param {*} identifier - Identifier value.\n */\n setActorIdentifier = function(name, identifier) {\n if (typeof name !== 'string') {\n throw new Error('Actor Identifier name must be a string');\n }\n this.actorIdentifiers[name] = identifier;\n }\n\n /**\n * Adds contextual information to the event.\n * Context can include any additional environmental or situational data.\n * @param {string} context - The key of the context field.\n * @param {*} value - The value of the context field.\n */\n setContext = function(context, value) {\n if (typeof context !== 'string') {\n throw new Error('Context must be a string');\n }\n this.context[context] = value;\n }\n\n /**\n * Alias for `setReference` for compatibility.\n * Declares an external entity referenced by this event.\n * @param {string} entity - The referenced entity name.\n * @param {string|null} origin - The origin application or context (optional).\n */\n setRefence = function(entity, origin=null) {\n return this.setReference(entity, origin);\n }\n\n /**\n * Declares an entity referenced by this event.\n * References may include multiple identifiers and an optional origin to scope the reference.\n * @param {string} entity - The referenced entity name.\n * @param {string|null} origin - The origin application or context (optional).\n */\n setReference = function(entity, origin=null) {\n if (typeof entity !== 'string') {\n throw new Error('Referenced entity must be a string');\n }\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.references[entity] === undefined) {\n this.references[entity] = {\n identifiers: {},\n origin\n };\n }\n }\n\n /**\n * Adds or updates an identifier for a referenced entity.\n * Ensures the reference is declared and sets the identifier under that reference.\n * @param {string} entity - The referenced entity name.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @param {string|null} origin - Optional origin context.\n */\n setRefenceIdentifier = function(entity, name, identifier, origin=null) {\n return this.setReferenceIdentifier(entity, name, identifier, origin);\n }\n\n /**\n * Adds or updates an identifier for a referenced entity.\n * @param {string} entity - The referenced entity name.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @param {string|null} origin - Optional origin context.\n */\n setReferenceIdentifier = function(entity, name, identifier, origin=null) {\n if (typeof entity !== 'string') {\n throw new Error('Referenced entity name must be a string');\n }\n if (typeof name !== 'string') {\n throw new Error('Actor Identifier name must be a string');\n }\n this.setRefence(entity, origin);\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.references[entity].identifiers[name] = identifier;\n }\n\n /**\n * Declares a collection of related entities for this event.\n * Collections group multiple related items and may include identifiers and origin metadata.\n * @param {string} entity - The collection name.\n * @param {string|null} origin - Optional origin identifier (e.g. system name).\n */\n setCollection = function(entity, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.collections[entity] == undefined) {\n this.collections[entity] = {\n items: [],\n identifiers: {},\n origin\n };\n }\n }\n\n /**\n * Adds a new item to a collection and returns its index key.\n * Items represent individual elements within the collection.\n * @param {string} entity - The name of the collection.\n * @returns {number} Index of the newly added item in the collection.\n */\n setCollectionItem = function(entity, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.setCollection(entity);\n this.collections[entity].items.push({});\n let itemKey = this.collections[entity].items.length - 1;\n return itemKey;\n }\n\n /**\n * Assigns a reference (identifier) to a specific item in a collection.\n * Useful for tagging individual collection elements with identifiers.\n * @param {string} entity - Collection name.\n * @param {number} itemKey - The index of the item in the collection.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @throws {Error} If the item does not exist at the given index.\n */\n setCollectionItemReference = function(entity, itemKey, name, identifier, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.setCollection(entity);\n if(typeof this.collections[entity].items[itemKey] !== 'object') {\n throw new Error('bad bad man, the collection key does not exists');\n }\n this.collections[entity].items[itemKey][name] = identifier;\n }\n \n /**\n * Sets a static identifier that applies to the entire collection.\n * These identifiers describe the collection as a whole.\n * @param {string} entity - Collection name.\n * @param {string} name - Identifier key.\n * @param {*} identifier - Identifier value.\n */\n setCollectionIdentifier = function(entity, name, identifier, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.collections[entity] == undefined) {\n this.collections[entity] = {};\n }\n this.collections[entity].identifiers[name] = identifier;\n }\n\n /**\n * Serializes the event instance to a plain object suitable for transport or storage.\n * The output includes all semantic fields and metadata.\n * @returns {object} A plain JavaScript object representing the event.\n */\n toJSON() {\n return {\n class: 'CollecionesEvent',\n entity: this.entity,\n adjectives: this.adjevtives,\n identifiers: this.identifiers,\n action: this.action,\n actor: this.actor,\n actorIdentifiers: this.actorIdentifiers,\n actorIds: this.actorIds,\n context: this.context,\n references: this.references,\n meta: this.meta,\n collections: this.collections\n };\n }\n\n /**\n * Recreates a CollecionesEvent instance from a plain object.\n * Used when deserializing events from storage or network transport.\n * @param {object} obj - The input object containing event data.\n * @returns {CollecionesEvent} A rehydrated event instance.\n * @throws {Error} If the class type is not 'CollecionesEvent'.\n */\n static fromJSON(obj) { \n if (!obj || obj.class !== 'CollecionesEvent') {\n throw new Error('Invalid or missing event class type'); \n } \n const instance = new CollecionesEvent();\n instance.entity = obj.entity;\n instance.adjevtives = obj.adjectives || [];\n instance.identifiers = obj.identifiers || {};\n instance.action = obj.action;\n instance.actor = obj.actor;\n instance.actorIdentifiers = obj.actorIdentifiers;\n instance.actorIds = obj.actorIds;\n instance.context = obj.context || {};\n instance.references = obj.references || {};\n instance.meta = obj.meta || {};\n instance.collections = obj.collections || {};\n return instance;\n }\n \n}\n\nexport default CollecionesEvent;","import { fromBase64, toBase64 } from './utils/utils.js';\nimport CollecionesEvent from './CollecionesEvent.js';\n\n/**\n * CollecionesEmitter\n * -------------------\n * This class collects and sends event objects to a remote endpoint (e.g., an event collector API).\n * It is used in both client- and server-side tracking scenarios, typically in combination with\n * CollecionesEvent or subclasses like CollecionesBaseEvent.\n *\n * Behavior:\n * - Events are buffered via `.track()` or `.trackAsync()`.\n * - If the number of buffered events reaches `flushSize`, the buffer is automatically flushed.\n * - If `flushInterval` is provided, the buffer is flushed at a fixed interval.\n * - Flushing serializes each event using `.toJSON()`, encodes it with base64, and posts\n * the resulting array to the configured endpoint.\n *\n * Example usage:\n * const emitter = new CollecionesEmitter('/track', 5, 10000);\n * emitter.track(new CollecionesEvent());\n *\n * Note:\n * This class is stateful. To stop periodic flushing, call `.stopTimer()` when the emitter is no longer in use.\n */\nclass CollecionesEmitter {\n\n /**\n * Initializes the emitter with buffering settings.\n * @param {string} [endpoint='/collect'] - The URL to send events to.\n * @param {number} [flushSize=10] - Number of events to buffer before flushing.\n * @param {number|boolean} [flushInterval=false] - Time in ms to flush events periodically.\n */\n constructor(endpoint = '/collect', flushSize = 10, flushInterval = false) {\n this.endpoint = endpoint;\n this.flushInterval = flushInterval;\n this.flushSize = flushSize;\n this.buffer = [];\n this.timer = null;\n this.lastPayload = null;\n }\n\n /**\n * Starts the flush timer if a valid interval is set.\n * @returns {void}\n */\n startTimer() {\n this.stopTimer();\n if (typeof this.flushInterval == 'number' && this.flushInterval > 0) {\n this.timer = setInterval(() => this.flush(), this.flushInterval);\n }\n }\n\n /**\n * Starts the flush timer only if not already running.\n * @returns {void}\n */\n startTimerIfStopped() {\n if (!this.timer) {\n this.startTimer();\n }\n }\n\n /**\n * Stops the active flush timer.\n * @returns {void}\n */\n stopTimer() {\n if (this.timer) {\n clearInterval(this.timer);\n }\n this.timer = null;\n }\n\n /**\n * Adds an event to the buffer and flushes if threshold is reached.\n * Validates that the event is an instance of CollecionesEvent to ensure correct event type.\n * @param {CollecionesEvent} event - Event instance to be tracked.\n * @throws {Error} Throws if event is not a CollecionesEvent instance.\n * @returns {void}\n */\n track(event) {\n if (!(event instanceof CollecionesEvent)) {\n throw new Error('Event must be an instance of CollecionesEvent');\n }\n this.trackAsync(event);\n }\n\n /**\n * Asynchronously adds an event and flushes if the buffer size is exceeded.\n * Validates that the event is an instance of CollecionesEvent to ensure correct event type.\n * @param {CollecionesEvent} event - Event instance to be tracked asynchronously.\n * @throws {Error} Throws if event is not a CollecionesEvent instance.\n * @returns {Promise<void>} Resolves when event is added and flush triggered if needed.\n */\n async trackAsync(event) {\n if (!(event instanceof CollecionesEvent)) {\n throw new Error('Event must be an instance of CollecionesEvent');\n }\n this.startTimerIfStopped();\n this.buffer.push(event);\n return (this.buffer.length >= this.flushSize) ? this.flush() : Promise.resolve();\n }\n\n /**\n * Sends all buffered events in a single POST request to the server.\n * Each event is serialized via `.toJSON()` and encoded as a base64 string.\n * Response status is checked for HTTP success; errors are logged but not thrown.\n *\n * @returns {Promise<boolean|undefined>} Resolves true if flush was triggered, or undefined if buffer was empty.\n */\n async flush() {\n if (this.buffer.length === 0) return;\n this.stopTimer();\n const body = this.buildBody();\n this.lastPayload = body;\n this.buffer = [];\n try {\n const response = await fetch(this.endpoint, {\n method: 'POST',\n credentials: 'include',\n headers: {\n 'Content-Type': 'application/json'\n },\n body\n });\n if (!response.ok) {\n console.log(`Failed to send events: ${response.statusText}`);\n }\n return true;\n } catch (error) { \n console.log(`Network error sending events: ${error.message}`);\n } \n }\n\n /**\n * Builds a POST-ready payload from the current buffer, without clearing it.\n * @returns {string} JSON string of base64-encoded serialized events.\n */\n buildBody() {\n return JSON.stringify(this.buffer.map(e => toBase64(JSON.stringify(e.toJSON()))));\n }\n\n}\n\nexport default CollecionesEmitter;","import CollecionesEvent from './CollecionesEvent.js';\n\n/**\n * Tracks events by enriching them with shared identifiers and routing through configured emitters.\n */\nclass CollecionesTracker {\n\n /**\n * Constructs a new tracker instance.\n * @param {Array} emitters - Array of emitter instances responsible for sending events.\n * @param {string} trackerName - Name identifying this tracker.\n * @param {string} appName - Name of the application generating events.\n */\n constructor(emitters, trackerName, appName) {\n this.emitters = emitters;\n this.trackerName = trackerName;\n this.appName = appName;\n }\n\n /**\n * Sends an event to all emitters after enriching it with identifiers and metadata.\n * @param {CollecionesEvent} collecionesEvent - The event to be sent.\n * @throws {Error} If the input is not an instance of CollecionesEvent.\n */\n track(collecionesEvent) {\n if (!(collecionesEvent instanceof CollecionesEvent)) {\n throw new Error('Event must be of type CollecionesEvent');\n }\n collecionesEvent.setTracker(this.trackerName);\n collecionesEvent.setAppName(this.appName); \n this.emitters.forEach(element => {\n element.track(collecionesEvent, this.trackerName, this.appName);\n });\n }\n}\n\nexport default CollecionesTracker;","import CollecionesEvent from './CollecionesEvent.js';\nimport CollecionesTracker from './CollecionesTracker.js';\nimport { getBrowserContext } from './utils/utils.js';\n\n/**\n * Web-specific tracker that enriches events with browser context before sending them.\n * Extends the base CollecionesTracker.\n */\nclass CollecionesWebTracker extends CollecionesTracker {\n /**\n * Creates a new instance of CollecionesWebTracker.\n * @param {Array} emitters - A list of emitter instances used to send the event.\n * @param {string} trackerName - The name of the tracker.\n * @param {string} appName - The name of the application generating events.\n */\n constructor(emitters, trackerName, appName) {\n super(emitters, trackerName, appName);\n }\n\n /**\n * Tracks an event, enriching it with browser context information.\n * @param {CollecionesEvent} collecionesEvent - The event object to track.\n * @throws {Error} If the event is not an instance of CollecionesEvent.\n */\n track(collecionesEvent) {\n if (!(collecionesEvent instanceof CollecionesEvent)) {\n throw new Error('Event must be of type CollecionesEvent');\n }\n collecionesEvent.setContext('browserContext', getBrowserContext());\n super.track(collecionesEvent); \n }\n}\n\nexport default CollecionesWebTracker;","/**\n * Colleciones DSL\n * ---------------\n * This module provides a fluent, human-readable DSL (domain-specific language) for constructing\n * structured tracking events based on CollecionesBaseEvent. Each step in the chain represents\n * a semantically meaningful piece of the event: the entity, the action, the actor, references, etc.\n *\n * Entry Point:\n * collecionesDsl.the('dark')\n *\n * Chaining:\n * - .and('...') : add additional adjectives\n * - ._('entity') : specify the entity being acted on\n * - .identified.by('field') : declare primary identifier for the subject\n * - .has.been('action') : declare what happened\n * - .by('actor') : describe the actor performing the action\n * - .identified.by('id') : add identifiers for the actor\n * - .with('key').set.to('val') : add contextual data fields\n * - .referring.to('entity') : describe referenced/related entities\n * - .identified.by('refId') : add identifiers for the reference\n * - .conform.to('SchemaName') : attach schema metadata\n * - .then.track.with(emitter) : finalize and emit the event\n *\n * Each function in the chain passes forward a scoped version of the CollecionesBaseEvent instance,\n * and enforces semantic constraints (e.g. `.as()` is required after `.by()`).\n *\n * Internal:\n * - Uses setRefence / setRefenceIdentifier for references\n * - Uses helpers.getEvent() for test access\n * - Uses instanceof CollecionesEmitter for validation\n *\n * This file is designed for internal use by developers building with the Colleciones tracking model.\n */\n\nimport CollecionesEvent from './CollecionesEvent.js';\nimport CollecionesTracker from './CollecionesTracker.js';\n\nlet init = (entity) => {\n return ((entity)=>{\n let eventInstance = new CollecionesEvent(); // Core event object\n eventInstance.setEntity(entity);\n\n let helpers = {\n getEvent: () => {\n return eventInstance;\n },\n };\n\n // DSL function groups\n let andEntity = () => {}; // .and(...) chaining after the()\n let setEntityAfterAnd = () => {}; // ._('entity') after .and\n let setEntityIdentifiers = () => {}; // .identified.by(...) for main subject\n let setAction = () => {}; // .has.been(...) for action\n let setActor = () => {}; // .by('actor')\n let setActorIdentifier = () => {}; // .identified.by(...) inside .by(...)\n let addContext = () => {}; // .with(...).set.to(...)\n let addReference = () => {}; // .referring.to(...)\n let getAddReference = () => {}; // .identified.by().as() inside .referring\n let conformingTo = () => {}; // .conform.to('SchemaName')\n let track = () => {}; // .then.track.with(emitter)\n let addCollection = () => {};\n\n // Adjective chaining: .and(...)._('entity')\n setEntityAfterAnd = (entity) => {\n eventInstance.addAdjective(eventInstance.entity);\n eventInstance.setEntity(entity);\n return {\n as: () => {\n return { helpers }\n },\n identified: {\n by: setEntityIdentifiers\n },\n has: { been: setAction },\n helpers\n };\n };\n\n // Identifier setup: .identified.by().as()\n setEntityIdentifiers = (name) => {\n eventInstance.setIdentifier(name, null);\n return {\n as: (value) => {\n eventInstance.setIdentifier(name, value);\n return {\n helpers,\n and: {\n by: setEntityIdentifiers\n },\n has: { been: setAction },\n }\n },\n helpers\n };\n };\n\n // Additional adjectives: .and('...')._()\n andEntity = (entity) => {\n eventInstance.addAdjective(eventInstance.entity);\n eventInstance.setEntity(entity);\n return {\n and: andEntity,\n _ : setEntityAfterAnd,\n helpers\n }\n };\n\n // Action: .has.been('...')\n setAction = (action) => {\n eventInstance.setAction(action);\n return {\n by: setActor,\n referring: { to: addReference },\n with: addContext,\n conform: {to: conformingTo},\n then: {track: {with: track}},\n including: {\n a: addCollection,\n },\n helpers\n }\n };\n\n // Actor: .by('user')\n setActor = (name) => {\n eventInstance.setActor(name);\n return { \n identified: {\n by: setActorIdentifier\n },\n with: addContext,\n including: {\n a: addCollection,\n },\n helpers\n }\n };\n\n // Actor identifier: .identified.by().as()\n setActorIdentifier = (name) => {\n return {\n as: (value) => {\n eventInstance.setActorIdentifier(name, value);\n return {\n helpers,\n and: setActorIdentifier,\n with: addContext,\n referring: { to: addReference },\n including: {\n a: addCollection,\n },\n }\n },\n helpers\n }\n };\n\n // Contextual field: .with('key').set.to('value')\n addContext = (context) => {\n return {\n helpers,\n set: {\n to: (value) => {\n eventInstance.setContext(context, value);\n return {\n helpers,\n and: addContext,\n referring: { to: addReference },\n including: {\n a: addCollection,\n },\n }\n }\n }\n }\n };\n\n // Reference: .referring.to('...')\n addReference = (entity) => {\n eventInstance.setRefence(entity);\n return {\n identified: {\n by: getAddReference(entity)\n },\n conform: {to: conformingTo},\n then: {track: {with: track}},\n including: {\n a: addCollection,\n },\n helpers\n }\n };\n\n // Reference identifier setup: .identified.by().as()\n getAddReference = (entity) => {\n return (name) => {\n return {\n as: (value) => {\n eventInstance.setRefenceIdentifier(entity, name, value);\n return {\n helpers,\n and: {by: getAddReference(entity) },\n conform: {to: conformingTo},\n then: {track: {with: track}},\n including: {\n a: addCollection,\n },\n }\n },\n helpers,\n };\n };\n };\n\n // Schema declaration: .conform.to('...')\n conformingTo = (name) => {\n eventInstance.setSchema(name);\n return { \n then: {track: {with: track}},\n helpers\n }\n };\n\n addCollection = (entity) => {\n const collection = () => {\n eventInstance.setCollection(entity);\n \n const addItem = (referenceName) => {\n const itemKey = eventInstance.setCollectionItem(entity);\n const addIdentifier = (referenceNameNewIdentifier) => {\n referenceName = referenceNameNewIdentifier;\n return {\n as: addItemReferenceValue,\n }\n }\n const addItemReferenceValue = (value) => {\n eventInstance.setCollectionItemReference(entity, itemKey, referenceName, value);\n return {\n and: {\n helpers, \n by: addIdentifier,\n item: { \n identified: { \n by: addItem\n }\n },\n a: addCollection\n },\n conform: {\n to: conformingTo,\n }, \n then: {track: {with: track}},\n helpers\n }\n }\n return {\n as: addItemReferenceValue\n }\n\n };\n\n return {\n helpers,\n with: {\n item: {\n identified: {\n by: addItem\n }\n }\n },\n and: { a: addCollection }\n }\n };\n return {\n collection\n }\n }\n\n // Final dispatch: .then.track.with(tracker)\n track = (tracker) => {\n if(!(tracker instanceof CollecionesTracker)){\n throw new Error('can only be a CollecionesTracker')\n }\n tracker.track(eventInstance);\n return {\n and: track,\n helpers,\n }\n };\n\n return {\n and: andEntity,\n _: setEntityAfterAnd,\n identified: {\n by: setEntityIdentifiers\n },\n has: { been: setAction},\n node: '_base',\n helpers\n }\n\n })(entity);\n}\n\nlet collecionesDsl = {\n the: init\n};\n\n\nexport default collecionesDsl;"],"names":[],"mappings":";;AAAA;;;AAGA;AACA;AACA;AACA;A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IAAI,EAAE;AAC1B,wBAAwB,IAAI,EAAE;AAC9B,4BAA4B,UAAU,EAAE;AACxC,gCAAgC,EAAE,EAAE;AACpC;AACA;AACA,qBAAqB;AACrB,oBAAoB,GAAG,EAAE,EAAE,CAAC,EAAE,aAAa;AAC3C;AACA,aAAa;AACb,YAAY,OAAO;AACnB,gBAAgB;AAChB;AACA;;AAEA;AACA,QAAQ,KAAK,GAAG,CAAC,OAAO,KAAK;AAC7B,YAAY,GAAG,EAAE,OAAO,YAAY,kBAAkB,CAAC,CAAC;AACxD,gBAAgB,MAAM,IAAI,KAAK,CAAC,kCAAkC;AAClE;AACA,YAAY,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC;AACxC,YAAY,OAAO;AACnB,gBAAgB,GAAG,EAAE,KAAK;AAC1B,gBAAgB,OAAO;AACvB;AACA,SAAS;;AAET,QAAQ,OAAO;AACf,YAAY,GAAG,EAAE,SAAS;AAC1B,YAAY,CAAC,EAAE,iBAAiB;AAChC,YAAY,UAAU,EAAE;AACxB,gBAAgB,EAAE,EAAE;AACpB,aAAa;AACb,YAAY,GAAG,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC;AACnC,YAAY,IAAI,EAAE,OAAO;AACzB,YAAY;AACZ;;AAEA,KAAK,EAAE,MAAM,CAAC;AACd;;AAEG,IAAC,cAAc,GAAG;AACrB,IAAI,GAAG,EAAE;AACT;;;;;;;;"}
package/dist/index.mjs CHANGED
@@ -303,11 +303,11 @@ class CollecionesEvent {
303
303
  if (typeof name !== 'string') {
304
304
  throw new Error('Actor Identifier name must be a string');
305
305
  }
306
+ this.setRefence(entity, origin);
306
307
  entity = formatToCamelCase(entity);
307
308
  if (origin !== null) {
308
309
  entity = `${origin}.${entity}`;
309
310
  }
310
- this.setRefence(entity, origin);
311
311
  this.references[entity].identifiers[name] = identifier;
312
312
  }
313
313
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../src/utils/utils.js","../src/CollecionesEvent.js","../src/CollecionesEmitter.js","../src/CollecionesTracker.js","../src/CollecionesWebTracker.js","../src/collecionesDsl.js"],"sourcesContent":["// helper 'private' functions\n\n\n/**\n * Encodes a string to Base64.\n * Uses browser or Node.js method depending on environment.\n * @param {string} str\n * @returns {string}\n */\nconst toBase64 = function (str) {\n if (typeof window !== 'undefined' && typeof window.btoa === 'function') {\n return window.btoa(unescape(encodeURIComponent(str)));\n } else {\n return Buffer.from(str, 'utf-8').toString('base64');\n }\n}\n\n/**\n * Decodes a Base64 string to UTF-8.\n * Uses browser or Node.js method depending on environment.\n * @param {string} b64\n * @returns {string}\n */\nconst fromBase64 = function (b64) {\n if (typeof window !== 'undefined' && typeof window.atob === 'function') {\n return decodeURIComponent(escape(window.atob(b64)));\n } else {\n return Buffer.from(b64, 'base64').toString('utf-8');\n }\n}\n\n/**\n * Collects browser-related context values like screen size, language, etc.\n * Returns an empty object if not in browser environment.\n * @returns {Object}\n */\nconst getBrowserContext = function() {\n if (typeof window === 'undefined' || typeof navigator === 'undefined') {\n return {};\n }\n return {\n hasFocus: document.hasFocus(),\n language: navigator.language,\n platform: navigator.platform,\n referrer: document.referrer,\n screenHeight: window.screen.height,\n screenWidth: window.screen.width,\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n url: window.location.href,\n userAgent: navigator.userAgent,\n viewportHeight: window.innerHeight,\n viewportWidth: window.innerWidth,\n };\n}\n\nconst formatToCamelCase = function(input) {\n return input\n .replace(/[^a-zA-Z0-9]+/g, ' ')\n .trim()\n .split(/\\s+/)\n .map((word, index) => {\n if (index === 0) return word;\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n })\n .join('');\n}\n\nexport {\n fromBase64,\n formatToCamelCase,\n getBrowserContext,\n toBase64,\n};","/**\n * CollecionesEvent\n * -----------------\n * Base class representing a semantically structured event object.\n * Each event models a specific interaction with an entity, optionally performed by an actor,\n * and may reference related entities or include contextual metadata.\n *\n * Key features:\n * - Captures structured semantics: entity, action, actor, context, references\n * - Supports multiple identifiers for both the main entity and the actor\n * - Allows origin tagging for cross-context or cross-application references\n * - Supports referencing collections of entities or grouped data\n * - Includes timestamps and tracker/app metadata for auditability\n * - Fully serializable and deserializable via toJSON/fromJSON\n */\n\nimport {formatToCamelCase } from './utils/utils.js';\n\nclass CollecionesEvent {\n\n /**\n * Constructs a new CollecionesEvent with default structure and timestamps.\n * Initializes empty containers for semantic attributes such as:\n * - entity: the subject of the event\n * - adjectives: descriptors of the entity\n * - identifiers: identifiers of the entity\n * - action: what happened to the entity\n * - actor: who or what triggered the event (with identifiers in actorIdentifiers)\n * - context: environmental data related to the event\n * - references: external entities involved, optionally scoped by origin\n * - collections: groups of related entities\n * - meta: tracking metadata and timestamps\n */\n constructor() {\n // initialize event properties\n this.entity = '';\n this.adjevtives = [];\n this.identifiers = {};\n this.action = '';\n this.actor = {};\n this.actorIdentifiers = {};\n this.context = {};\n this.references = {};\n this.collections = {};\n // set default values\n this.meta = {\n eventFormat: 'CollecionesEvent',\n eventFormatVersion: '1'\n };\n this.meta.tracker = '';\n this.meta.app = '';\n this.meta.timestamps = {};\n this.meta.timestamps.clientDatetimeUtc = new Date().toISOString();\n if (typeof window !== 'undefined' && typeof navigator !== 'undefined' && navigator.language) {\n this.meta.timestamps.clientDatetimeLocal = new Date(Date.now() - new Date().getTimezoneOffset() * 60000).toISOString();\n this.meta.timestamps.timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n this.meta.timestamps.timeZoneOffset = new Date().getTimezoneOffset()\n } else {\n this.meta.timestamps.clientDatetimeLocal = new Date().toISOString();\n this.meta.timestamps.timeZone = 'UTC';\n }\n }\n\n /**\n * Returns the declared event format.\n * @returns {string} The format name (e.g. 'CollecionesEvent').\n */\n getEventFormat() {\n let v = this.meta?.eventFormat;\n return (typeof v !== 'undefined') ? v : '1';\n }\n\n /**\n * Returns the version of the event format.\n * @returns {string} The format version string.\n */\n getEventFormatVersion() {\n let v = this?.meta?.eventFormatVersion;\n return (typeof v !== 'undefined') ? v : 'CollecionesEvent';\n }\n\n /**\n * Overrides or supplements the event's timestamp fields with custom values.\n * @param {object} dateTimeObject - Key-value pairs to merge into the existing timestamp object.\n */\n overrideDatetime(dateTimeObject = {}) {\n for (const [key, value] of Object.entries(dateTimeObject)) {\n this.meta.timestamps[key] = value;\n }\n }\n\n /**\n * Sets the name of the tracker responsible for generating this event.\n * @param {string} name - Tracker name.\n */\n setTracker(name) {\n this.meta.tracker = name;\n }\n\n /**\n * Sets the name of the application that generated the event.\n * @param {string} name - Application name.\n */\n setAppName(name) {\n this.meta.appName = name;\n }\n\n /**\n * Sets the expected schema name for this event.\n * @param {string} schema - The name of the schema.\n */\n setSchema(schema) {\n if (typeof schema !== 'string') {\n throw new Error('Schema must be a string');\n }\n this.meta.schema = schema;\n }\n\n /**\n * Sets the entity (subject) of the event.\n * @param {string} entity - The entity name.\n */\n setEntity = function(entity) {\n this.entity = formatToCamelCase(entity);\n }\n \n /**\n * Defines the main action of the event (e.g., 'clicked').\n * @param {string} action - The action string.\n */\n setAction = function(action) {\n this.action = formatToCamelCase(action);\n }\n\n /**\n * Adds an adjective that describes the entity in more detail.\n * @param {string} adjective - An adjective string.\n */\n addAdjective = function(adjective) {\n if (typeof adjective !== 'string') {\n throw new Error('Adjective must be a string');\n }\n this.adjevtives.push(formatToCamelCase(adjective));\n }\n\n /**\n * Adds or updates an identifier for the primary entity.\n * Identifiers allow multiple keys to uniquely identify the entity.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n */\n setIdentifier = function(name, identifier) {\n if (typeof name !== 'string') {\n throw new Error('Identifier name must be a string');\n }\n this.identifiers[name] = identifier;\n }\n\n /**\n * Defines the name of the actor (who or what performed the action).\n * @param {string} name - Actor name (e.g., 'user', 'system').\n */\n setActor = function(name) {\n if (typeof name !== 'string') {\n throw new Error('Actor name must be a string');\n }\n this.actor.name = name;\n }\n\n /**\n * Adds or updates an identifier for the actor.\n * Supports multiple identifiers to uniquely identify the actor.\n * @param {string} name - Identifier key.\n * @param {*} identifier - Identifier value.\n */\n setActorIdentifier = function(name, identifier) {\n if (typeof name !== 'string') {\n throw new Error('Actor Identifier name must be a string');\n }\n this.actorIdentifiers[name] = identifier;\n }\n\n /**\n * Adds contextual information to the event.\n * Context can include any additional environmental or situational data.\n * @param {string} context - The key of the context field.\n * @param {*} value - The value of the context field.\n */\n setContext = function(context, value) {\n if (typeof context !== 'string') {\n throw new Error('Context must be a string');\n }\n this.context[context] = value;\n }\n\n /**\n * Alias for `setReference` for compatibility.\n * Declares an external entity referenced by this event.\n * @param {string} entity - The referenced entity name.\n * @param {string|null} origin - The origin application or context (optional).\n */\n setRefence = function(entity, origin=null) {\n return this.setReference(entity, origin);\n }\n\n /**\n * Declares an entity referenced by this event.\n * References may include multiple identifiers and an optional origin to scope the reference.\n * @param {string} entity - The referenced entity name.\n * @param {string|null} origin - The origin application or context (optional).\n */\n setReference = function(entity, origin=null) {\n if (typeof entity !== 'string') {\n throw new Error('Referenced entity must be a string');\n }\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.references[entity] === undefined) {\n this.references[entity] = {\n identifiers: {},\n origin\n };\n }\n }\n\n /**\n * Adds or updates an identifier for a referenced entity.\n * Ensures the reference is declared and sets the identifier under that reference.\n * @param {string} entity - The referenced entity name.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @param {string|null} origin - Optional origin context.\n */\n setRefenceIdentifier = function(entity, name, identifier, origin=null) {\n return this.setReferenceIdentifier(entity, name, identifier, origin);\n }\n\n /**\n * Adds or updates an identifier for a referenced entity.\n * @param {string} entity - The referenced entity name.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @param {string|null} origin - Optional origin context.\n */\n setReferenceIdentifier = function(entity, name, identifier, origin=null) {\n if (typeof entity !== 'string') {\n throw new Error('Referenced entity name must be a string');\n }\n if (typeof name !== 'string') {\n throw new Error('Actor Identifier name must be a string');\n }\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.setRefence(entity, origin);\n this.references[entity].identifiers[name] = identifier;\n }\n\n /**\n * Declares a collection of related entities for this event.\n * Collections group multiple related items and may include identifiers and origin metadata.\n * @param {string} entity - The collection name.\n * @param {string|null} origin - Optional origin identifier (e.g. system name).\n */\n setCollection = function(entity, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.collections[entity] == undefined) {\n this.collections[entity] = {\n items: [],\n identifiers: {},\n origin\n };\n }\n }\n\n /**\n * Adds a new item to a collection and returns its index key.\n * Items represent individual elements within the collection.\n * @param {string} entity - The name of the collection.\n * @returns {number} Index of the newly added item in the collection.\n */\n setCollectionItem = function(entity, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.setCollection(entity);\n this.collections[entity].items.push({});\n let itemKey = this.collections[entity].items.length - 1;\n return itemKey;\n }\n\n /**\n * Assigns a reference (identifier) to a specific item in a collection.\n * Useful for tagging individual collection elements with identifiers.\n * @param {string} entity - Collection name.\n * @param {number} itemKey - The index of the item in the collection.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @throws {Error} If the item does not exist at the given index.\n */\n setCollectionItemReference = function(entity, itemKey, name, identifier, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.setCollection(entity);\n if(typeof this.collections[entity].items[itemKey] !== 'object') {\n throw new Error('bad bad man, the collection key does not exists');\n }\n this.collections[entity].items[itemKey][name] = identifier;\n }\n \n /**\n * Sets a static identifier that applies to the entire collection.\n * These identifiers describe the collection as a whole.\n * @param {string} entity - Collection name.\n * @param {string} name - Identifier key.\n * @param {*} identifier - Identifier value.\n */\n setCollectionIdentifier = function(entity, name, identifier, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.collections[entity] == undefined) {\n this.collections[entity] = {};\n }\n this.collections[entity].identifiers[name] = identifier;\n }\n\n /**\n * Serializes the event instance to a plain object suitable for transport or storage.\n * The output includes all semantic fields and metadata.\n * @returns {object} A plain JavaScript object representing the event.\n */\n toJSON() {\n return {\n class: 'CollecionesEvent',\n entity: this.entity,\n adjectives: this.adjevtives,\n identifiers: this.identifiers,\n action: this.action,\n actor: this.actor,\n actorIdentifiers: this.actorIdentifiers,\n actorIds: this.actorIds,\n context: this.context,\n references: this.references,\n meta: this.meta,\n collections: this.collections\n };\n }\n\n /**\n * Recreates a CollecionesEvent instance from a plain object.\n * Used when deserializing events from storage or network transport.\n * @param {object} obj - The input object containing event data.\n * @returns {CollecionesEvent} A rehydrated event instance.\n * @throws {Error} If the class type is not 'CollecionesEvent'.\n */\n static fromJSON(obj) { \n if (!obj || obj.class !== 'CollecionesEvent') {\n throw new Error('Invalid or missing event class type'); \n } \n const instance = new CollecionesEvent();\n instance.entity = obj.entity;\n instance.adjevtives = obj.adjectives || [];\n instance.identifiers = obj.identifiers || {};\n instance.action = obj.action;\n instance.actor = obj.actor;\n instance.actorIdentifiers = obj.actorIdentifiers;\n instance.actorIds = obj.actorIds;\n instance.context = obj.context || {};\n instance.references = obj.references || {};\n instance.meta = obj.meta || {};\n instance.collections = obj.collections || {};\n return instance;\n }\n \n}\n\nexport default CollecionesEvent;","import { fromBase64, toBase64 } from './utils/utils.js';\nimport CollecionesEvent from './CollecionesEvent.js';\n\n/**\n * CollecionesEmitter\n * -------------------\n * This class collects and sends event objects to a remote endpoint (e.g., an event collector API).\n * It is used in both client- and server-side tracking scenarios, typically in combination with\n * CollecionesEvent or subclasses like CollecionesBaseEvent.\n *\n * Behavior:\n * - Events are buffered via `.track()` or `.trackAsync()`.\n * - If the number of buffered events reaches `flushSize`, the buffer is automatically flushed.\n * - If `flushInterval` is provided, the buffer is flushed at a fixed interval.\n * - Flushing serializes each event using `.toJSON()`, encodes it with base64, and posts\n * the resulting array to the configured endpoint.\n *\n * Example usage:\n * const emitter = new CollecionesEmitter('/track', 5, 10000);\n * emitter.track(new CollecionesEvent());\n *\n * Note:\n * This class is stateful. To stop periodic flushing, call `.stopTimer()` when the emitter is no longer in use.\n */\nclass CollecionesEmitter {\n\n /**\n * Initializes the emitter with buffering settings.\n * @param {string} [endpoint='/collect'] - The URL to send events to.\n * @param {number} [flushSize=10] - Number of events to buffer before flushing.\n * @param {number|boolean} [flushInterval=false] - Time in ms to flush events periodically.\n */\n constructor(endpoint = '/collect', flushSize = 10, flushInterval = false) {\n this.endpoint = endpoint;\n this.flushInterval = flushInterval;\n this.flushSize = flushSize;\n this.buffer = [];\n this.timer = null;\n this.lastPayload = null;\n }\n\n /**\n * Starts the flush timer if a valid interval is set.\n * @returns {void}\n */\n startTimer() {\n this.stopTimer();\n if (typeof this.flushInterval == 'number' && this.flushInterval > 0) {\n this.timer = setInterval(() => this.flush(), this.flushInterval);\n }\n }\n\n /**\n * Starts the flush timer only if not already running.\n * @returns {void}\n */\n startTimerIfStopped() {\n if (!this.timer) {\n this.startTimer();\n }\n }\n\n /**\n * Stops the active flush timer.\n * @returns {void}\n */\n stopTimer() {\n if (this.timer) {\n clearInterval(this.timer);\n }\n this.timer = null;\n }\n\n /**\n * Adds an event to the buffer and flushes if threshold is reached.\n * Validates that the event is an instance of CollecionesEvent to ensure correct event type.\n * @param {CollecionesEvent} event - Event instance to be tracked.\n * @throws {Error} Throws if event is not a CollecionesEvent instance.\n * @returns {void}\n */\n track(event) {\n if (!(event instanceof CollecionesEvent)) {\n throw new Error('Event must be an instance of CollecionesEvent');\n }\n this.trackAsync(event);\n }\n\n /**\n * Asynchronously adds an event and flushes if the buffer size is exceeded.\n * Validates that the event is an instance of CollecionesEvent to ensure correct event type.\n * @param {CollecionesEvent} event - Event instance to be tracked asynchronously.\n * @throws {Error} Throws if event is not a CollecionesEvent instance.\n * @returns {Promise<void>} Resolves when event is added and flush triggered if needed.\n */\n async trackAsync(event) {\n if (!(event instanceof CollecionesEvent)) {\n throw new Error('Event must be an instance of CollecionesEvent');\n }\n this.startTimerIfStopped();\n this.buffer.push(event);\n return (this.buffer.length >= this.flushSize) ? this.flush() : Promise.resolve();\n }\n\n /**\n * Sends all buffered events in a single POST request to the server.\n * Each event is serialized via `.toJSON()` and encoded as a base64 string.\n * Response status is checked for HTTP success; errors are logged but not thrown.\n *\n * @returns {Promise<boolean|undefined>} Resolves true if flush was triggered, or undefined if buffer was empty.\n */\n async flush() {\n if (this.buffer.length === 0) return;\n this.stopTimer();\n const body = this.buildBody();\n this.lastPayload = body;\n this.buffer = [];\n try {\n const response = await fetch(this.endpoint, {\n method: 'POST',\n credentials: 'include',\n headers: {\n 'Content-Type': 'application/json'\n },\n body\n });\n if (!response.ok) {\n console.log(`Failed to send events: ${response.statusText}`);\n }\n return true;\n } catch (error) { \n console.log(`Network error sending events: ${error.message}`);\n } \n }\n\n /**\n * Builds a POST-ready payload from the current buffer, without clearing it.\n * @returns {string} JSON string of base64-encoded serialized events.\n */\n buildBody() {\n return JSON.stringify(this.buffer.map(e => toBase64(JSON.stringify(e.toJSON()))));\n }\n\n}\n\nexport default CollecionesEmitter;","import CollecionesEvent from './CollecionesEvent.js';\n\n/**\n * Tracks events by enriching them with shared identifiers and routing through configured emitters.\n */\nclass CollecionesTracker {\n\n /**\n * Constructs a new tracker instance.\n * @param {Array} emitters - Array of emitter instances responsible for sending events.\n * @param {string} trackerName - Name identifying this tracker.\n * @param {string} appName - Name of the application generating events.\n */\n constructor(emitters, trackerName, appName) {\n this.emitters = emitters;\n this.trackerName = trackerName;\n this.appName = appName;\n }\n\n /**\n * Sends an event to all emitters after enriching it with identifiers and metadata.\n * @param {CollecionesEvent} collecionesEvent - The event to be sent.\n * @throws {Error} If the input is not an instance of CollecionesEvent.\n */\n track(collecionesEvent) {\n if (!(collecionesEvent instanceof CollecionesEvent)) {\n throw new Error('Event must be of type CollecionesEvent');\n }\n collecionesEvent.setTracker(this.trackerName);\n collecionesEvent.setAppName(this.appName); \n this.emitters.forEach(element => {\n element.track(collecionesEvent, this.trackerName, this.appName);\n });\n }\n}\n\nexport default CollecionesTracker;","import CollecionesEvent from './CollecionesEvent.js';\nimport CollecionesTracker from './CollecionesTracker.js';\nimport { getBrowserContext } from './utils/utils.js';\n\n/**\n * Web-specific tracker that enriches events with browser context before sending them.\n * Extends the base CollecionesTracker.\n */\nclass CollecionesWebTracker extends CollecionesTracker {\n /**\n * Creates a new instance of CollecionesWebTracker.\n * @param {Array} emitters - A list of emitter instances used to send the event.\n * @param {string} trackerName - The name of the tracker.\n * @param {string} appName - The name of the application generating events.\n */\n constructor(emitters, trackerName, appName) {\n super(emitters, trackerName, appName);\n }\n\n /**\n * Tracks an event, enriching it with browser context information.\n * @param {CollecionesEvent} collecionesEvent - The event object to track.\n * @throws {Error} If the event is not an instance of CollecionesEvent.\n */\n track(collecionesEvent) {\n if (!(collecionesEvent instanceof CollecionesEvent)) {\n throw new Error('Event must be of type CollecionesEvent');\n }\n collecionesEvent.setContext('browserContext', getBrowserContext());\n super.track(collecionesEvent); \n }\n}\n\nexport default CollecionesWebTracker;","/**\n * Colleciones DSL\n * ---------------\n * This module provides a fluent, human-readable DSL (domain-specific language) for constructing\n * structured tracking events based on CollecionesBaseEvent. Each step in the chain represents\n * a semantically meaningful piece of the event: the entity, the action, the actor, references, etc.\n *\n * Entry Point:\n * collecionesDsl.the('dark')\n *\n * Chaining:\n * - .and('...') : add additional adjectives\n * - ._('entity') : specify the entity being acted on\n * - .identified.by('field') : declare primary identifier for the subject\n * - .has.been('action') : declare what happened\n * - .by('actor') : describe the actor performing the action\n * - .identified.by('id') : add identifiers for the actor\n * - .with('key').set.to('val') : add contextual data fields\n * - .referring.to('entity') : describe referenced/related entities\n * - .identified.by('refId') : add identifiers for the reference\n * - .conform.to('SchemaName') : attach schema metadata\n * - .then.track.with(emitter) : finalize and emit the event\n *\n * Each function in the chain passes forward a scoped version of the CollecionesBaseEvent instance,\n * and enforces semantic constraints (e.g. `.as()` is required after `.by()`).\n *\n * Internal:\n * - Uses setRefence / setRefenceIdentifier for references\n * - Uses helpers.getEvent() for test access\n * - Uses instanceof CollecionesEmitter for validation\n *\n * This file is designed for internal use by developers building with the Colleciones tracking model.\n */\n\nimport CollecionesEvent from './CollecionesEvent.js';\nimport CollecionesTracker from './CollecionesTracker.js';\n\nlet init = (entity) => {\n return ((entity)=>{\n let eventInstance = new CollecionesEvent(); // Core event object\n eventInstance.setEntity(entity);\n\n let helpers = {\n getEvent: () => {\n return eventInstance;\n },\n };\n\n // DSL function groups\n let andEntity = () => {}; // .and(...) chaining after the()\n let setEntityAfterAnd = () => {}; // ._('entity') after .and\n let setEntityIdentifiers = () => {}; // .identified.by(...) for main subject\n let setAction = () => {}; // .has.been(...) for action\n let setActor = () => {}; // .by('actor')\n let setActorIdentifier = () => {}; // .identified.by(...) inside .by(...)\n let addContext = () => {}; // .with(...).set.to(...)\n let addReference = () => {}; // .referring.to(...)\n let getAddReference = () => {}; // .identified.by().as() inside .referring\n let conformingTo = () => {}; // .conform.to('SchemaName')\n let track = () => {}; // .then.track.with(emitter)\n let addCollection = () => {};\n\n // Adjective chaining: .and(...)._('entity')\n setEntityAfterAnd = (entity) => {\n eventInstance.addAdjective(eventInstance.entity);\n eventInstance.setEntity(entity);\n return {\n as: () => {\n return { helpers }\n },\n identified: {\n by: setEntityIdentifiers\n },\n has: { been: setAction },\n helpers\n };\n };\n\n // Identifier setup: .identified.by().as()\n setEntityIdentifiers = (name) => {\n eventInstance.setIdentifier(name, null);\n return {\n as: (value) => {\n eventInstance.setIdentifier(name, value);\n return {\n helpers,\n and: {\n by: setEntityIdentifiers\n },\n has: { been: setAction },\n }\n },\n helpers\n };\n };\n\n // Additional adjectives: .and('...')._()\n andEntity = (entity) => {\n eventInstance.addAdjective(eventInstance.entity);\n eventInstance.setEntity(entity);\n return {\n and: andEntity,\n _ : setEntityAfterAnd,\n helpers\n }\n };\n\n // Action: .has.been('...')\n setAction = (action) => {\n eventInstance.setAction(action);\n return {\n by: setActor,\n referring: { to: addReference },\n with: addContext,\n conform: {to: conformingTo},\n then: {track: {with: track}},\n including: {\n a: addCollection,\n },\n helpers\n }\n };\n\n // Actor: .by('user')\n setActor = (name) => {\n eventInstance.setActor(name);\n return { \n identified: {\n by: setActorIdentifier\n },\n with: addContext,\n including: {\n a: addCollection,\n },\n helpers\n }\n };\n\n // Actor identifier: .identified.by().as()\n setActorIdentifier = (name) => {\n return {\n as: (value) => {\n eventInstance.setActorIdentifier(name, value);\n return {\n helpers,\n and: setActorIdentifier,\n with: addContext,\n referring: { to: addReference },\n including: {\n a: addCollection,\n },\n }\n },\n helpers\n }\n };\n\n // Contextual field: .with('key').set.to('value')\n addContext = (context) => {\n return {\n helpers,\n set: {\n to: (value) => {\n eventInstance.setContext(context, value);\n return {\n helpers,\n and: addContext,\n referring: { to: addReference },\n including: {\n a: addCollection,\n },\n }\n }\n }\n }\n };\n\n // Reference: .referring.to('...')\n addReference = (entity) => {\n eventInstance.setRefence(entity);\n return {\n identified: {\n by: getAddReference(entity)\n },\n conform: {to: conformingTo},\n then: {track: {with: track}},\n including: {\n a: addCollection,\n },\n helpers\n }\n };\n\n // Reference identifier setup: .identified.by().as()\n getAddReference = (entity) => {\n return (name) => {\n return {\n as: (value) => {\n eventInstance.setRefenceIdentifier(entity, name, value);\n return {\n helpers,\n and: {by: getAddReference(entity) },\n conform: {to: conformingTo},\n then: {track: {with: track}},\n including: {\n a: addCollection,\n },\n }\n },\n helpers,\n };\n };\n };\n\n // Schema declaration: .conform.to('...')\n conformingTo = (name) => {\n eventInstance.setSchema(name);\n return { \n then: {track: {with: track}},\n helpers\n }\n };\n\n addCollection = (entity) => {\n const collection = () => {\n eventInstance.setCollection(entity);\n \n const addItem = (referenceName) => {\n const itemKey = eventInstance.setCollectionItem(entity);\n const addIdentifier = (referenceNameNewIdentifier) => {\n referenceName = referenceNameNewIdentifier;\n return {\n as: addItemReferenceValue,\n }\n }\n const addItemReferenceValue = (value) => {\n eventInstance.setCollectionItemReference(entity, itemKey, referenceName, value);\n return {\n and: {\n helpers, \n by: addIdentifier,\n item: { \n identified: { \n by: addItem\n }\n },\n a: addCollection\n },\n conform: {\n to: conformingTo,\n }, \n then: {track: {with: track}},\n helpers\n }\n }\n return {\n as: addItemReferenceValue\n }\n\n };\n\n return {\n helpers,\n with: {\n item: {\n identified: {\n by: addItem\n }\n }\n },\n and: { a: addCollection }\n }\n };\n return {\n collection\n }\n }\n\n // Final dispatch: .then.track.with(tracker)\n track = (tracker) => {\n if(!(tracker instanceof CollecionesTracker)){\n throw new Error('can only be a CollecionesTracker')\n }\n tracker.track(eventInstance);\n return {\n and: track,\n helpers,\n }\n };\n\n return {\n and: andEntity,\n _: setEntityAfterAnd,\n identified: {\n by: setEntityIdentifiers\n },\n has: { been: setAction},\n node: '_base',\n helpers\n }\n\n })(entity);\n}\n\nlet collecionesDsl = {\n the: init\n};\n\n\nexport default collecionesDsl;"],"names":[],"mappings":"AAAA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,UAAU,GAAG,EAAE;AAChC,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE;AAC5E,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7D,KAAK,MAAM;AACX,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;AAC3D;AACA;;AAgBA;AACA;AACA;AACA;AACA;AACA,MAAM,iBAAiB,GAAG,WAAW;AACrC,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE;AAC3E,QAAQ,OAAO,EAAE;AACjB;AACA,IAAI,OAAO;AACX,QAAQ,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE;AACrC,QAAQ,QAAQ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,EAAE;AACxB,gBAAgB,EAAE,EAAE;AACpB,aAAa;AACb,YAAY,GAAG,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC;AACnC,YAAY,IAAI,EAAE,OAAO;AACzB,YAAY;AACZ;;AAEA,KAAK,EAAE,MAAM,CAAC;AACd;;AAEG,IAAC,cAAc,GAAG;AACrB,IAAI,GAAG,EAAE;AACT;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../src/utils/utils.js","../src/CollecionesEvent.js","../src/CollecionesEmitter.js","../src/CollecionesTracker.js","../src/CollecionesWebTracker.js","../src/collecionesDsl.js"],"sourcesContent":["// helper 'private' functions\n\n\n/**\n * Encodes a string to Base64.\n * Uses browser or Node.js method depending on environment.\n * @param {string} str\n * @returns {string}\n */\nconst toBase64 = function (str) {\n if (typeof window !== 'undefined' && typeof window.btoa === 'function') {\n return window.btoa(unescape(encodeURIComponent(str)));\n } else {\n return Buffer.from(str, 'utf-8').toString('base64');\n }\n}\n\n/**\n * Decodes a Base64 string to UTF-8.\n * Uses browser or Node.js method depending on environment.\n * @param {string} b64\n * @returns {string}\n */\nconst fromBase64 = function (b64) {\n if (typeof window !== 'undefined' && typeof window.atob === 'function') {\n return decodeURIComponent(escape(window.atob(b64)));\n } else {\n return Buffer.from(b64, 'base64').toString('utf-8');\n }\n}\n\n/**\n * Collects browser-related context values like screen size, language, etc.\n * Returns an empty object if not in browser environment.\n * @returns {Object}\n */\nconst getBrowserContext = function() {\n if (typeof window === 'undefined' || typeof navigator === 'undefined') {\n return {};\n }\n return {\n hasFocus: document.hasFocus(),\n language: navigator.language,\n platform: navigator.platform,\n referrer: document.referrer,\n screenHeight: window.screen.height,\n screenWidth: window.screen.width,\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n url: window.location.href,\n userAgent: navigator.userAgent,\n viewportHeight: window.innerHeight,\n viewportWidth: window.innerWidth,\n };\n}\n\nconst formatToCamelCase = function(input) {\n return input\n .replace(/[^a-zA-Z0-9]+/g, ' ')\n .trim()\n .split(/\\s+/)\n .map((word, index) => {\n if (index === 0) return word;\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n })\n .join('');\n}\n\nexport {\n fromBase64,\n formatToCamelCase,\n getBrowserContext,\n toBase64,\n};","/**\n * CollecionesEvent\n * -----------------\n * Base class representing a semantically structured event object.\n * Each event models a specific interaction with an entity, optionally performed by an actor,\n * and may reference related entities or include contextual metadata.\n *\n * Key features:\n * - Captures structured semantics: entity, action, actor, context, references\n * - Supports multiple identifiers for both the main entity and the actor\n * - Allows origin tagging for cross-context or cross-application references\n * - Supports referencing collections of entities or grouped data\n * - Includes timestamps and tracker/app metadata for auditability\n * - Fully serializable and deserializable via toJSON/fromJSON\n */\n\nimport {formatToCamelCase } from './utils/utils.js';\n\nclass CollecionesEvent {\n\n /**\n * Constructs a new CollecionesEvent with default structure and timestamps.\n * Initializes empty containers for semantic attributes such as:\n * - entity: the subject of the event\n * - adjectives: descriptors of the entity\n * - identifiers: identifiers of the entity\n * - action: what happened to the entity\n * - actor: who or what triggered the event (with identifiers in actorIdentifiers)\n * - context: environmental data related to the event\n * - references: external entities involved, optionally scoped by origin\n * - collections: groups of related entities\n * - meta: tracking metadata and timestamps\n */\n constructor() {\n // initialize event properties\n this.entity = '';\n this.adjevtives = [];\n this.identifiers = {};\n this.action = '';\n this.actor = {};\n this.actorIdentifiers = {};\n this.context = {};\n this.references = {};\n this.collections = {};\n // set default values\n this.meta = {\n eventFormat: 'CollecionesEvent',\n eventFormatVersion: '1'\n };\n this.meta.tracker = '';\n this.meta.app = '';\n this.meta.timestamps = {};\n this.meta.timestamps.clientDatetimeUtc = new Date().toISOString();\n if (typeof window !== 'undefined' && typeof navigator !== 'undefined' && navigator.language) {\n this.meta.timestamps.clientDatetimeLocal = new Date(Date.now() - new Date().getTimezoneOffset() * 60000).toISOString();\n this.meta.timestamps.timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n this.meta.timestamps.timeZoneOffset = new Date().getTimezoneOffset()\n } else {\n this.meta.timestamps.clientDatetimeLocal = new Date().toISOString();\n this.meta.timestamps.timeZone = 'UTC';\n }\n }\n\n /**\n * Returns the declared event format.\n * @returns {string} The format name (e.g. 'CollecionesEvent').\n */\n getEventFormat() {\n let v = this.meta?.eventFormat;\n return (typeof v !== 'undefined') ? v : '1';\n }\n\n /**\n * Returns the version of the event format.\n * @returns {string} The format version string.\n */\n getEventFormatVersion() {\n let v = this?.meta?.eventFormatVersion;\n return (typeof v !== 'undefined') ? v : 'CollecionesEvent';\n }\n\n /**\n * Overrides or supplements the event's timestamp fields with custom values.\n * @param {object} dateTimeObject - Key-value pairs to merge into the existing timestamp object.\n */\n overrideDatetime(dateTimeObject = {}) {\n for (const [key, value] of Object.entries(dateTimeObject)) {\n this.meta.timestamps[key] = value;\n }\n }\n\n /**\n * Sets the name of the tracker responsible for generating this event.\n * @param {string} name - Tracker name.\n */\n setTracker(name) {\n this.meta.tracker = name;\n }\n\n /**\n * Sets the name of the application that generated the event.\n * @param {string} name - Application name.\n */\n setAppName(name) {\n this.meta.appName = name;\n }\n\n /**\n * Sets the expected schema name for this event.\n * @param {string} schema - The name of the schema.\n */\n setSchema(schema) {\n if (typeof schema !== 'string') {\n throw new Error('Schema must be a string');\n }\n this.meta.schema = schema;\n }\n\n /**\n * Sets the entity (subject) of the event.\n * @param {string} entity - The entity name.\n */\n setEntity = function(entity) {\n this.entity = formatToCamelCase(entity);\n }\n \n /**\n * Defines the main action of the event (e.g., 'clicked').\n * @param {string} action - The action string.\n */\n setAction = function(action) {\n this.action = formatToCamelCase(action);\n }\n\n /**\n * Adds an adjective that describes the entity in more detail.\n * @param {string} adjective - An adjective string.\n */\n addAdjective = function(adjective) {\n if (typeof adjective !== 'string') {\n throw new Error('Adjective must be a string');\n }\n this.adjevtives.push(formatToCamelCase(adjective));\n }\n\n /**\n * Adds or updates an identifier for the primary entity.\n * Identifiers allow multiple keys to uniquely identify the entity.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n */\n setIdentifier = function(name, identifier) {\n if (typeof name !== 'string') {\n throw new Error('Identifier name must be a string');\n }\n this.identifiers[name] = identifier;\n }\n\n /**\n * Defines the name of the actor (who or what performed the action).\n * @param {string} name - Actor name (e.g., 'user', 'system').\n */\n setActor = function(name) {\n if (typeof name !== 'string') {\n throw new Error('Actor name must be a string');\n }\n this.actor.name = name;\n }\n\n /**\n * Adds or updates an identifier for the actor.\n * Supports multiple identifiers to uniquely identify the actor.\n * @param {string} name - Identifier key.\n * @param {*} identifier - Identifier value.\n */\n setActorIdentifier = function(name, identifier) {\n if (typeof name !== 'string') {\n throw new Error('Actor Identifier name must be a string');\n }\n this.actorIdentifiers[name] = identifier;\n }\n\n /**\n * Adds contextual information to the event.\n * Context can include any additional environmental or situational data.\n * @param {string} context - The key of the context field.\n * @param {*} value - The value of the context field.\n */\n setContext = function(context, value) {\n if (typeof context !== 'string') {\n throw new Error('Context must be a string');\n }\n this.context[context] = value;\n }\n\n /**\n * Alias for `setReference` for compatibility.\n * Declares an external entity referenced by this event.\n * @param {string} entity - The referenced entity name.\n * @param {string|null} origin - The origin application or context (optional).\n */\n setRefence = function(entity, origin=null) {\n return this.setReference(entity, origin);\n }\n\n /**\n * Declares an entity referenced by this event.\n * References may include multiple identifiers and an optional origin to scope the reference.\n * @param {string} entity - The referenced entity name.\n * @param {string|null} origin - The origin application or context (optional).\n */\n setReference = function(entity, origin=null) {\n if (typeof entity !== 'string') {\n throw new Error('Referenced entity must be a string');\n }\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.references[entity] === undefined) {\n this.references[entity] = {\n identifiers: {},\n origin\n };\n }\n }\n\n /**\n * Adds or updates an identifier for a referenced entity.\n * Ensures the reference is declared and sets the identifier under that reference.\n * @param {string} entity - The referenced entity name.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @param {string|null} origin - Optional origin context.\n */\n setRefenceIdentifier = function(entity, name, identifier, origin=null) {\n return this.setReferenceIdentifier(entity, name, identifier, origin);\n }\n\n /**\n * Adds or updates an identifier for a referenced entity.\n * @param {string} entity - The referenced entity name.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @param {string|null} origin - Optional origin context.\n */\n setReferenceIdentifier = function(entity, name, identifier, origin=null) {\n if (typeof entity !== 'string') {\n throw new Error('Referenced entity name must be a string');\n }\n if (typeof name !== 'string') {\n throw new Error('Actor Identifier name must be a string');\n }\n this.setRefence(entity, origin);\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.references[entity].identifiers[name] = identifier;\n }\n\n /**\n * Declares a collection of related entities for this event.\n * Collections group multiple related items and may include identifiers and origin metadata.\n * @param {string} entity - The collection name.\n * @param {string|null} origin - Optional origin identifier (e.g. system name).\n */\n setCollection = function(entity, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.collections[entity] == undefined) {\n this.collections[entity] = {\n items: [],\n identifiers: {},\n origin\n };\n }\n }\n\n /**\n * Adds a new item to a collection and returns its index key.\n * Items represent individual elements within the collection.\n * @param {string} entity - The name of the collection.\n * @returns {number} Index of the newly added item in the collection.\n */\n setCollectionItem = function(entity, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.setCollection(entity);\n this.collections[entity].items.push({});\n let itemKey = this.collections[entity].items.length - 1;\n return itemKey;\n }\n\n /**\n * Assigns a reference (identifier) to a specific item in a collection.\n * Useful for tagging individual collection elements with identifiers.\n * @param {string} entity - Collection name.\n * @param {number} itemKey - The index of the item in the collection.\n * @param {string} name - The identifier key.\n * @param {*} identifier - The identifier value.\n * @throws {Error} If the item does not exist at the given index.\n */\n setCollectionItemReference = function(entity, itemKey, name, identifier, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n this.setCollection(entity);\n if(typeof this.collections[entity].items[itemKey] !== 'object') {\n throw new Error('bad bad man, the collection key does not exists');\n }\n this.collections[entity].items[itemKey][name] = identifier;\n }\n \n /**\n * Sets a static identifier that applies to the entire collection.\n * These identifiers describe the collection as a whole.\n * @param {string} entity - Collection name.\n * @param {string} name - Identifier key.\n * @param {*} identifier - Identifier value.\n */\n setCollectionIdentifier = function(entity, name, identifier, origin=null) {\n entity = formatToCamelCase(entity);\n if (origin !== null) {\n entity = `${origin}.${entity}`;\n }\n if(this.collections[entity] == undefined) {\n this.collections[entity] = {};\n }\n this.collections[entity].identifiers[name] = identifier;\n }\n\n /**\n * Serializes the event instance to a plain object suitable for transport or storage.\n * The output includes all semantic fields and metadata.\n * @returns {object} A plain JavaScript object representing the event.\n */\n toJSON() {\n return {\n class: 'CollecionesEvent',\n entity: this.entity,\n adjectives: this.adjevtives,\n identifiers: this.identifiers,\n action: this.action,\n actor: this.actor,\n actorIdentifiers: this.actorIdentifiers,\n actorIds: this.actorIds,\n context: this.context,\n references: this.references,\n meta: this.meta,\n collections: this.collections\n };\n }\n\n /**\n * Recreates a CollecionesEvent instance from a plain object.\n * Used when deserializing events from storage or network transport.\n * @param {object} obj - The input object containing event data.\n * @returns {CollecionesEvent} A rehydrated event instance.\n * @throws {Error} If the class type is not 'CollecionesEvent'.\n */\n static fromJSON(obj) { \n if (!obj || obj.class !== 'CollecionesEvent') {\n throw new Error('Invalid or missing event class type'); \n } \n const instance = new CollecionesEvent();\n instance.entity = obj.entity;\n instance.adjevtives = obj.adjectives || [];\n instance.identifiers = obj.identifiers || {};\n instance.action = obj.action;\n instance.actor = obj.actor;\n instance.actorIdentifiers = obj.actorIdentifiers;\n instance.actorIds = obj.actorIds;\n instance.context = obj.context || {};\n instance.references = obj.references || {};\n instance.meta = obj.meta || {};\n instance.collections = obj.collections || {};\n return instance;\n }\n \n}\n\nexport default CollecionesEvent;","import { fromBase64, toBase64 } from './utils/utils.js';\nimport CollecionesEvent from './CollecionesEvent.js';\n\n/**\n * CollecionesEmitter\n * -------------------\n * This class collects and sends event objects to a remote endpoint (e.g., an event collector API).\n * It is used in both client- and server-side tracking scenarios, typically in combination with\n * CollecionesEvent or subclasses like CollecionesBaseEvent.\n *\n * Behavior:\n * - Events are buffered via `.track()` or `.trackAsync()`.\n * - If the number of buffered events reaches `flushSize`, the buffer is automatically flushed.\n * - If `flushInterval` is provided, the buffer is flushed at a fixed interval.\n * - Flushing serializes each event using `.toJSON()`, encodes it with base64, and posts\n * the resulting array to the configured endpoint.\n *\n * Example usage:\n * const emitter = new CollecionesEmitter('/track', 5, 10000);\n * emitter.track(new CollecionesEvent());\n *\n * Note:\n * This class is stateful. To stop periodic flushing, call `.stopTimer()` when the emitter is no longer in use.\n */\nclass CollecionesEmitter {\n\n /**\n * Initializes the emitter with buffering settings.\n * @param {string} [endpoint='/collect'] - The URL to send events to.\n * @param {number} [flushSize=10] - Number of events to buffer before flushing.\n * @param {number|boolean} [flushInterval=false] - Time in ms to flush events periodically.\n */\n constructor(endpoint = '/collect', flushSize = 10, flushInterval = false) {\n this.endpoint = endpoint;\n this.flushInterval = flushInterval;\n this.flushSize = flushSize;\n this.buffer = [];\n this.timer = null;\n this.lastPayload = null;\n }\n\n /**\n * Starts the flush timer if a valid interval is set.\n * @returns {void}\n */\n startTimer() {\n this.stopTimer();\n if (typeof this.flushInterval == 'number' && this.flushInterval > 0) {\n this.timer = setInterval(() => this.flush(), this.flushInterval);\n }\n }\n\n /**\n * Starts the flush timer only if not already running.\n * @returns {void}\n */\n startTimerIfStopped() {\n if (!this.timer) {\n this.startTimer();\n }\n }\n\n /**\n * Stops the active flush timer.\n * @returns {void}\n */\n stopTimer() {\n if (this.timer) {\n clearInterval(this.timer);\n }\n this.timer = null;\n }\n\n /**\n * Adds an event to the buffer and flushes if threshold is reached.\n * Validates that the event is an instance of CollecionesEvent to ensure correct event type.\n * @param {CollecionesEvent} event - Event instance to be tracked.\n * @throws {Error} Throws if event is not a CollecionesEvent instance.\n * @returns {void}\n */\n track(event) {\n if (!(event instanceof CollecionesEvent)) {\n throw new Error('Event must be an instance of CollecionesEvent');\n }\n this.trackAsync(event);\n }\n\n /**\n * Asynchronously adds an event and flushes if the buffer size is exceeded.\n * Validates that the event is an instance of CollecionesEvent to ensure correct event type.\n * @param {CollecionesEvent} event - Event instance to be tracked asynchronously.\n * @throws {Error} Throws if event is not a CollecionesEvent instance.\n * @returns {Promise<void>} Resolves when event is added and flush triggered if needed.\n */\n async trackAsync(event) {\n if (!(event instanceof CollecionesEvent)) {\n throw new Error('Event must be an instance of CollecionesEvent');\n }\n this.startTimerIfStopped();\n this.buffer.push(event);\n return (this.buffer.length >= this.flushSize) ? this.flush() : Promise.resolve();\n }\n\n /**\n * Sends all buffered events in a single POST request to the server.\n * Each event is serialized via `.toJSON()` and encoded as a base64 string.\n * Response status is checked for HTTP success; errors are logged but not thrown.\n *\n * @returns {Promise<boolean|undefined>} Resolves true if flush was triggered, or undefined if buffer was empty.\n */\n async flush() {\n if (this.buffer.length === 0) return;\n this.stopTimer();\n const body = this.buildBody();\n this.lastPayload = body;\n this.buffer = [];\n try {\n const response = await fetch(this.endpoint, {\n method: 'POST',\n credentials: 'include',\n headers: {\n 'Content-Type': 'application/json'\n },\n body\n });\n if (!response.ok) {\n console.log(`Failed to send events: ${response.statusText}`);\n }\n return true;\n } catch (error) { \n console.log(`Network error sending events: ${error.message}`);\n } \n }\n\n /**\n * Builds a POST-ready payload from the current buffer, without clearing it.\n * @returns {string} JSON string of base64-encoded serialized events.\n */\n buildBody() {\n return JSON.stringify(this.buffer.map(e => toBase64(JSON.stringify(e.toJSON()))));\n }\n\n}\n\nexport default CollecionesEmitter;","import CollecionesEvent from './CollecionesEvent.js';\n\n/**\n * Tracks events by enriching them with shared identifiers and routing through configured emitters.\n */\nclass CollecionesTracker {\n\n /**\n * Constructs a new tracker instance.\n * @param {Array} emitters - Array of emitter instances responsible for sending events.\n * @param {string} trackerName - Name identifying this tracker.\n * @param {string} appName - Name of the application generating events.\n */\n constructor(emitters, trackerName, appName) {\n this.emitters = emitters;\n this.trackerName = trackerName;\n this.appName = appName;\n }\n\n /**\n * Sends an event to all emitters after enriching it with identifiers and metadata.\n * @param {CollecionesEvent} collecionesEvent - The event to be sent.\n * @throws {Error} If the input is not an instance of CollecionesEvent.\n */\n track(collecionesEvent) {\n if (!(collecionesEvent instanceof CollecionesEvent)) {\n throw new Error('Event must be of type CollecionesEvent');\n }\n collecionesEvent.setTracker(this.trackerName);\n collecionesEvent.setAppName(this.appName); \n this.emitters.forEach(element => {\n element.track(collecionesEvent, this.trackerName, this.appName);\n });\n }\n}\n\nexport default CollecionesTracker;","import CollecionesEvent from './CollecionesEvent.js';\nimport CollecionesTracker from './CollecionesTracker.js';\nimport { getBrowserContext } from './utils/utils.js';\n\n/**\n * Web-specific tracker that enriches events with browser context before sending them.\n * Extends the base CollecionesTracker.\n */\nclass CollecionesWebTracker extends CollecionesTracker {\n /**\n * Creates a new instance of CollecionesWebTracker.\n * @param {Array} emitters - A list of emitter instances used to send the event.\n * @param {string} trackerName - The name of the tracker.\n * @param {string} appName - The name of the application generating events.\n */\n constructor(emitters, trackerName, appName) {\n super(emitters, trackerName, appName);\n }\n\n /**\n * Tracks an event, enriching it with browser context information.\n * @param {CollecionesEvent} collecionesEvent - The event object to track.\n * @throws {Error} If the event is not an instance of CollecionesEvent.\n */\n track(collecionesEvent) {\n if (!(collecionesEvent instanceof CollecionesEvent)) {\n throw new Error('Event must be of type CollecionesEvent');\n }\n collecionesEvent.setContext('browserContext', getBrowserContext());\n super.track(collecionesEvent); \n }\n}\n\nexport default CollecionesWebTracker;","/**\n * Colleciones DSL\n * ---------------\n * This module provides a fluent, human-readable DSL (domain-specific language) for constructing\n * structured tracking events based on CollecionesBaseEvent. Each step in the chain represents\n * a semantically meaningful piece of the event: the entity, the action, the actor, references, etc.\n *\n * Entry Point:\n * collecionesDsl.the('dark')\n *\n * Chaining:\n * - .and('...') : add additional adjectives\n * - ._('entity') : specify the entity being acted on\n * - .identified.by('field') : declare primary identifier for the subject\n * - .has.been('action') : declare what happened\n * - .by('actor') : describe the actor performing the action\n * - .identified.by('id') : add identifiers for the actor\n * - .with('key').set.to('val') : add contextual data fields\n * - .referring.to('entity') : describe referenced/related entities\n * - .identified.by('refId') : add identifiers for the reference\n * - .conform.to('SchemaName') : attach schema metadata\n * - .then.track.with(emitter) : finalize and emit the event\n *\n * Each function in the chain passes forward a scoped version of the CollecionesBaseEvent instance,\n * and enforces semantic constraints (e.g. `.as()` is required after `.by()`).\n *\n * Internal:\n * - Uses setRefence / setRefenceIdentifier for references\n * - Uses helpers.getEvent() for test access\n * - Uses instanceof CollecionesEmitter for validation\n *\n * This file is designed for internal use by developers building with the Colleciones tracking model.\n */\n\nimport CollecionesEvent from './CollecionesEvent.js';\nimport CollecionesTracker from './CollecionesTracker.js';\n\nlet init = (entity) => {\n return ((entity)=>{\n let eventInstance = new CollecionesEvent(); // Core event object\n eventInstance.setEntity(entity);\n\n let helpers = {\n getEvent: () => {\n return eventInstance;\n },\n };\n\n // DSL function groups\n let andEntity = () => {}; // .and(...) chaining after the()\n let setEntityAfterAnd = () => {}; // ._('entity') after .and\n let setEntityIdentifiers = () => {}; // .identified.by(...) for main subject\n let setAction = () => {}; // .has.been(...) for action\n let setActor = () => {}; // .by('actor')\n let setActorIdentifier = () => {}; // .identified.by(...) inside .by(...)\n let addContext = () => {}; // .with(...).set.to(...)\n let addReference = () => {}; // .referring.to(...)\n let getAddReference = () => {}; // .identified.by().as() inside .referring\n let conformingTo = () => {}; // .conform.to('SchemaName')\n let track = () => {}; // .then.track.with(emitter)\n let addCollection = () => {};\n\n // Adjective chaining: .and(...)._('entity')\n setEntityAfterAnd = (entity) => {\n eventInstance.addAdjective(eventInstance.entity);\n eventInstance.setEntity(entity);\n return {\n as: () => {\n return { helpers }\n },\n identified: {\n by: setEntityIdentifiers\n },\n has: { been: setAction },\n helpers\n };\n };\n\n // Identifier setup: .identified.by().as()\n setEntityIdentifiers = (name) => {\n eventInstance.setIdentifier(name, null);\n return {\n as: (value) => {\n eventInstance.setIdentifier(name, value);\n return {\n helpers,\n and: {\n by: setEntityIdentifiers\n },\n has: { been: setAction },\n }\n },\n helpers\n };\n };\n\n // Additional adjectives: .and('...')._()\n andEntity = (entity) => {\n eventInstance.addAdjective(eventInstance.entity);\n eventInstance.setEntity(entity);\n return {\n and: andEntity,\n _ : setEntityAfterAnd,\n helpers\n }\n };\n\n // Action: .has.been('...')\n setAction = (action) => {\n eventInstance.setAction(action);\n return {\n by: setActor,\n referring: { to: addReference },\n with: addContext,\n conform: {to: conformingTo},\n then: {track: {with: track}},\n including: {\n a: addCollection,\n },\n helpers\n }\n };\n\n // Actor: .by('user')\n setActor = (name) => {\n eventInstance.setActor(name);\n return { \n identified: {\n by: setActorIdentifier\n },\n with: addContext,\n including: {\n a: addCollection,\n },\n helpers\n }\n };\n\n // Actor identifier: .identified.by().as()\n setActorIdentifier = (name) => {\n return {\n as: (value) => {\n eventInstance.setActorIdentifier(name, value);\n return {\n helpers,\n and: setActorIdentifier,\n with: addContext,\n referring: { to: addReference },\n including: {\n a: addCollection,\n },\n }\n },\n helpers\n }\n };\n\n // Contextual field: .with('key').set.to('value')\n addContext = (context) => {\n return {\n helpers,\n set: {\n to: (value) => {\n eventInstance.setContext(context, value);\n return {\n helpers,\n and: addContext,\n referring: { to: addReference },\n including: {\n a: addCollection,\n },\n }\n }\n }\n }\n };\n\n // Reference: .referring.to('...')\n addReference = (entity) => {\n eventInstance.setRefence(entity);\n return {\n identified: {\n by: getAddReference(entity)\n },\n conform: {to: conformingTo},\n then: {track: {with: track}},\n including: {\n a: addCollection,\n },\n helpers\n }\n };\n\n // Reference identifier setup: .identified.by().as()\n getAddReference = (entity) => {\n return (name) => {\n return {\n as: (value) => {\n eventInstance.setRefenceIdentifier(entity, name, value);\n return {\n helpers,\n and: {by: getAddReference(entity) },\n conform: {to: conformingTo},\n then: {track: {with: track}},\n including: {\n a: addCollection,\n },\n }\n },\n helpers,\n };\n };\n };\n\n // Schema declaration: .conform.to('...')\n conformingTo = (name) => {\n eventInstance.setSchema(name);\n return { \n then: {track: {with: track}},\n helpers\n }\n };\n\n addCollection = (entity) => {\n const collection = () => {\n eventInstance.setCollection(entity);\n \n const addItem = (referenceName) => {\n const itemKey = eventInstance.setCollectionItem(entity);\n const addIdentifier = (referenceNameNewIdentifier) => {\n referenceName = referenceNameNewIdentifier;\n return {\n as: addItemReferenceValue,\n }\n }\n const addItemReferenceValue = (value) => {\n eventInstance.setCollectionItemReference(entity, itemKey, referenceName, value);\n return {\n and: {\n helpers, \n by: addIdentifier,\n item: { \n identified: { \n by: addItem\n }\n },\n a: addCollection\n },\n conform: {\n to: conformingTo,\n }, \n then: {track: {with: track}},\n helpers\n }\n }\n return {\n as: addItemReferenceValue\n }\n\n };\n\n return {\n helpers,\n with: {\n item: {\n identified: {\n by: addItem\n }\n }\n },\n and: { a: addCollection }\n }\n };\n return {\n collection\n }\n }\n\n // Final dispatch: .then.track.with(tracker)\n track = (tracker) => {\n if(!(tracker instanceof CollecionesTracker)){\n throw new Error('can only be a CollecionesTracker')\n }\n tracker.track(eventInstance);\n return {\n and: track,\n helpers,\n }\n };\n\n return {\n and: andEntity,\n _: setEntityAfterAnd,\n identified: {\n by: setEntityIdentifiers\n },\n has: { been: setAction},\n node: '_base',\n helpers\n }\n\n })(entity);\n}\n\nlet collecionesDsl = {\n the: init\n};\n\n\nexport default collecionesDsl;"],"names":[],"mappings":"AAAA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,UAAU,GAAG,EAAE;AAChC,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE;AAC5E,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7D,KAAK,MAAM;AACX,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,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AAY,kBAAkB,CAAC,CAAC;AACxD,gBAAgB,MAAM,IAAI,KAAK,CAAC,kCAAkC;AAClE;AACA,YAAY,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC;AACxC,YAAY,OAAO;AACnB,gBAAgB,GAAG,EAAE,KAAK;AAC1B,gBAAgB,OAAO;AACvB;AACA,SAAS;;AAET,QAAQ,OAAO;AACf,YAAY,GAAG,EAAE,SAAS;AAC1B,YAAY,CAAC,EAAE,iBAAiB;AAChC,YAAY,UAAU,EAAE;AACxB,gBAAgB,EAAE,EAAE;AACpB,aAAa;AACb,YAAY,GAAG,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC;AACnC,YAAY,IAAI,EAAE,OAAO;AACzB,YAAY;AACZ;;AAEA,KAAK,EAAE,MAAM,CAAC;AACd;;AAEG,IAAC,cAAc,GAAG;AACrB,IAAI,GAAG,EAAE;AACT;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compilacion/colleciones-clientos",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "main": "dist/index.cjs",
5
5
  "module": "dist/index.mjs",
6
6
  "exports": {