@coveo/relay 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/relay.cjs CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  var crypto = require('crypto');
4
4
 
5
- async function callEventApi({ event, options, environment, validate, }) {
5
+ async function callEventApi({ event, options, environment, }) {
6
6
  const { token, host, organizationId } = options;
7
7
  const headers = {
8
8
  "Content-Type": "application/json",
9
9
  Authorization: `Bearer ${token}`,
10
10
  };
11
- const response = await environment.fetch(`${host}/rest/organizations/${organizationId}/events/v1${validate ? "/validate" : ""}`, {
11
+ const response = await environment.fetch(`${host}/rest/organizations/${organizationId}/events/v1${options.mode == "validate" ? "/validate" : ""}`, {
12
12
  method: "POST",
13
13
  body: JSON.stringify([event]),
14
14
  headers,
@@ -134,7 +134,7 @@ function isBrowser() {
134
134
  }
135
135
  }
136
136
 
137
- const version = "0.2.0" ;
137
+ const version = "0.3.1" ;
138
138
 
139
139
  function getConfig(options) {
140
140
  const { trackingId } = options;
@@ -147,7 +147,7 @@ function createMeta(type, options, environment, clientIdManager) {
147
147
  const { getReferrerUrl, getUrl, getUserAgent } = environment;
148
148
  const config = getConfig(options);
149
149
  const { clientId } = clientIdManager;
150
- return {
150
+ return Object.freeze({
151
151
  type,
152
152
  config,
153
153
  ts: Date.now(),
@@ -156,7 +156,7 @@ function createMeta(type, options, environment, clientIdManager) {
156
156
  userAgent: getUserAgent(),
157
157
  referrerUrl: getReferrerUrl(),
158
158
  url: getUrl(),
159
- };
159
+ });
160
160
  }
161
161
 
162
162
  function createRelayEvent(type, payload, options, environment, clientIdManager) {
@@ -167,27 +167,92 @@ function createRelayEvent(type, payload, options, environment, clientIdManager)
167
167
  }
168
168
 
169
169
  async function validate(params) {
170
- params.validate = true;
171
170
  const data = await callEventApi(params);
172
171
  const { valid, errors } = data[0];
173
172
  return { valid, errors: errors ?? [], responseType: "validation" };
174
173
  }
175
174
 
175
+ const ANY_EVENT_TYPE = "*";
176
+ function createListenerManager() {
177
+ const listeners = [];
178
+ function getListenerIndex({ type, callback }) {
179
+ return listeners.findIndex((listener) => listener.type === type && listener.callback === callback);
180
+ }
181
+ function isMatchesType(listener, type) {
182
+ return listener.type === "*" || type === listener.type;
183
+ }
184
+ function add(listener) {
185
+ if (getListenerIndex(listener) < 0) {
186
+ listeners.push(listener);
187
+ }
188
+ return () => remove(listener.type, listener.callback);
189
+ }
190
+ function call(event) {
191
+ listeners.forEach((listener) => {
192
+ if (isMatchesType(listener, event.meta.type)) {
193
+ try {
194
+ listener.callback(event);
195
+ }
196
+ catch (e) {
197
+ console.error(e);
198
+ }
199
+ }
200
+ });
201
+ }
202
+ function removeMultiple(type) {
203
+ if (type === ANY_EVENT_TYPE) {
204
+ listeners.length = 0;
205
+ }
206
+ else {
207
+ for (let i = listeners.length - 1; i >= 0; i--) {
208
+ if (listeners[i].type === type) {
209
+ listeners.splice(i, 1);
210
+ }
211
+ }
212
+ }
213
+ }
214
+ function removeOne(listener) {
215
+ const index = getListenerIndex(listener);
216
+ if (index >= 0) {
217
+ listeners.splice(index, 1);
218
+ }
219
+ }
220
+ function remove(type, callback) {
221
+ !!callback ? removeOne({ type, callback }) : removeMultiple(type);
222
+ }
223
+ return {
224
+ add,
225
+ call,
226
+ remove,
227
+ };
228
+ }
229
+
176
230
  function createRelay(options) {
177
231
  const environment = currentEnvironment();
178
232
  const clientIdManager = createClientIdManager(environment);
233
+ const { add, call, remove } = createListenerManager();
179
234
  return {
180
- validate: (type, payload) => validate({
181
- options,
182
- environment,
183
- event: createRelayEvent(type, payload, options, environment, clientIdManager),
184
- }),
185
- emit: (type, payload) => emit({
186
- options,
187
- environment,
188
- event: createRelayEvent(type, payload, options, environment, clientIdManager),
189
- }),
235
+ validate: (type, payload) => {
236
+ const event = createRelayEvent(type, payload, options, environment, clientIdManager);
237
+ call(event);
238
+ return validate({
239
+ options,
240
+ environment,
241
+ event: createRelayEvent(type, payload, options, environment, clientIdManager),
242
+ });
243
+ },
244
+ emit: (type, payload) => {
245
+ const event = createRelayEvent(type, payload, options, environment, clientIdManager);
246
+ call(event);
247
+ return emit({
248
+ options,
249
+ environment,
250
+ event,
251
+ });
252
+ },
190
253
  getMeta: (type) => createMeta(type, options, environment, clientIdManager),
254
+ on: (type, callback) => add({ type, callback }),
255
+ off: (type, callback) => remove(type, callback),
191
256
  version,
192
257
  };
193
258
  }
package/lib/relay.js CHANGED
@@ -1,10 +1,10 @@
1
- async function callEventApi({ event, options, environment, validate, }) {
1
+ async function callEventApi({ event, options, environment, }) {
2
2
  const { token, host, organizationId } = options;
3
3
  const headers = {
4
4
  "Content-Type": "application/json",
5
5
  Authorization: `Bearer ${token}`,
6
6
  };
7
- const response = await environment.fetch(`${host}/rest/organizations/${organizationId}/events/v1${validate ? "/validate" : ""}`, {
7
+ const response = await environment.fetch(`${host}/rest/organizations/${organizationId}/events/v1${options.mode == "validate" ? "/validate" : ""}`, {
8
8
  method: "POST",
9
9
  body: JSON.stringify([event]),
10
10
  headers,
@@ -138,7 +138,7 @@ function isBrowser() {
138
138
  }
139
139
  }
140
140
 
141
- const version = "0.2.0" ;
141
+ const version = "0.3.1" ;
142
142
 
143
143
  function getConfig(options) {
144
144
  const { trackingId } = options;
@@ -151,7 +151,7 @@ function createMeta(type, options, environment, clientIdManager) {
151
151
  const { getReferrerUrl, getUrl, getUserAgent } = environment;
152
152
  const config = getConfig(options);
153
153
  const { clientId } = clientIdManager;
154
- return {
154
+ return Object.freeze({
155
155
  type,
156
156
  config,
157
157
  ts: Date.now(),
@@ -160,7 +160,7 @@ function createMeta(type, options, environment, clientIdManager) {
160
160
  userAgent: getUserAgent(),
161
161
  referrerUrl: getReferrerUrl(),
162
162
  url: getUrl(),
163
- };
163
+ });
164
164
  }
165
165
 
166
166
  function createRelayEvent(type, payload, options, environment, clientIdManager) {
@@ -171,27 +171,92 @@ function createRelayEvent(type, payload, options, environment, clientIdManager)
171
171
  }
172
172
 
173
173
  async function validate(params) {
174
- params.validate = true;
175
174
  const data = await callEventApi(params);
176
175
  const { valid, errors } = data[0];
177
176
  return { valid, errors: errors ?? [], responseType: "validation" };
178
177
  }
179
178
 
179
+ const ANY_EVENT_TYPE = "*";
180
+ function createListenerManager() {
181
+ const listeners = [];
182
+ function getListenerIndex({ type, callback }) {
183
+ return listeners.findIndex((listener) => listener.type === type && listener.callback === callback);
184
+ }
185
+ function isMatchesType(listener, type) {
186
+ return listener.type === "*" || type === listener.type;
187
+ }
188
+ function add(listener) {
189
+ if (getListenerIndex(listener) < 0) {
190
+ listeners.push(listener);
191
+ }
192
+ return () => remove(listener.type, listener.callback);
193
+ }
194
+ function call(event) {
195
+ listeners.forEach((listener) => {
196
+ if (isMatchesType(listener, event.meta.type)) {
197
+ try {
198
+ listener.callback(event);
199
+ }
200
+ catch (e) {
201
+ console.error(e);
202
+ }
203
+ }
204
+ });
205
+ }
206
+ function removeMultiple(type) {
207
+ if (type === ANY_EVENT_TYPE) {
208
+ listeners.length = 0;
209
+ }
210
+ else {
211
+ for (let i = listeners.length - 1; i >= 0; i--) {
212
+ if (listeners[i].type === type) {
213
+ listeners.splice(i, 1);
214
+ }
215
+ }
216
+ }
217
+ }
218
+ function removeOne(listener) {
219
+ const index = getListenerIndex(listener);
220
+ if (index >= 0) {
221
+ listeners.splice(index, 1);
222
+ }
223
+ }
224
+ function remove(type, callback) {
225
+ !!callback ? removeOne({ type, callback }) : removeMultiple(type);
226
+ }
227
+ return {
228
+ add,
229
+ call,
230
+ remove,
231
+ };
232
+ }
233
+
180
234
  function createRelay(options) {
181
235
  const environment = currentEnvironment();
182
236
  const clientIdManager = createClientIdManager(environment);
237
+ const { add, call, remove } = createListenerManager();
183
238
  return {
184
- validate: (type, payload) => validate({
185
- options,
186
- environment,
187
- event: createRelayEvent(type, payload, options, environment, clientIdManager),
188
- }),
189
- emit: (type, payload) => emit({
190
- options,
191
- environment,
192
- event: createRelayEvent(type, payload, options, environment, clientIdManager),
193
- }),
239
+ validate: (type, payload) => {
240
+ const event = createRelayEvent(type, payload, options, environment, clientIdManager);
241
+ call(event);
242
+ return validate({
243
+ options,
244
+ environment,
245
+ event: createRelayEvent(type, payload, options, environment, clientIdManager),
246
+ });
247
+ },
248
+ emit: (type, payload) => {
249
+ const event = createRelayEvent(type, payload, options, environment, clientIdManager);
250
+ call(event);
251
+ return emit({
252
+ options,
253
+ environment,
254
+ event,
255
+ });
256
+ },
194
257
  getMeta: (type) => createMeta(type, options, environment, clientIdManager),
258
+ on: (type, callback) => add({ type, callback }),
259
+ off: (type, callback) => remove(type, callback),
195
260
  version,
196
261
  };
197
262
  }
package/lib/relay.mjs CHANGED
@@ -1,12 +1,12 @@
1
1
  import crypto from 'crypto';
2
2
 
3
- async function callEventApi({ event, options, environment, validate, }) {
3
+ async function callEventApi({ event, options, environment, }) {
4
4
  const { token, host, organizationId } = options;
5
5
  const headers = {
6
6
  "Content-Type": "application/json",
7
7
  Authorization: `Bearer ${token}`,
8
8
  };
9
- const response = await environment.fetch(`${host}/rest/organizations/${organizationId}/events/v1${validate ? "/validate" : ""}`, {
9
+ const response = await environment.fetch(`${host}/rest/organizations/${organizationId}/events/v1${options.mode == "validate" ? "/validate" : ""}`, {
10
10
  method: "POST",
11
11
  body: JSON.stringify([event]),
12
12
  headers,
@@ -132,7 +132,7 @@ function isBrowser() {
132
132
  }
133
133
  }
134
134
 
135
- const version = "0.2.0" ;
135
+ const version = "0.3.1" ;
136
136
 
137
137
  function getConfig(options) {
138
138
  const { trackingId } = options;
@@ -145,7 +145,7 @@ function createMeta(type, options, environment, clientIdManager) {
145
145
  const { getReferrerUrl, getUrl, getUserAgent } = environment;
146
146
  const config = getConfig(options);
147
147
  const { clientId } = clientIdManager;
148
- return {
148
+ return Object.freeze({
149
149
  type,
150
150
  config,
151
151
  ts: Date.now(),
@@ -154,7 +154,7 @@ function createMeta(type, options, environment, clientIdManager) {
154
154
  userAgent: getUserAgent(),
155
155
  referrerUrl: getReferrerUrl(),
156
156
  url: getUrl(),
157
- };
157
+ });
158
158
  }
159
159
 
160
160
  function createRelayEvent(type, payload, options, environment, clientIdManager) {
@@ -165,27 +165,92 @@ function createRelayEvent(type, payload, options, environment, clientIdManager)
165
165
  }
166
166
 
167
167
  async function validate(params) {
168
- params.validate = true;
169
168
  const data = await callEventApi(params);
170
169
  const { valid, errors } = data[0];
171
170
  return { valid, errors: errors ?? [], responseType: "validation" };
172
171
  }
173
172
 
173
+ const ANY_EVENT_TYPE = "*";
174
+ function createListenerManager() {
175
+ const listeners = [];
176
+ function getListenerIndex({ type, callback }) {
177
+ return listeners.findIndex((listener) => listener.type === type && listener.callback === callback);
178
+ }
179
+ function isMatchesType(listener, type) {
180
+ return listener.type === "*" || type === listener.type;
181
+ }
182
+ function add(listener) {
183
+ if (getListenerIndex(listener) < 0) {
184
+ listeners.push(listener);
185
+ }
186
+ return () => remove(listener.type, listener.callback);
187
+ }
188
+ function call(event) {
189
+ listeners.forEach((listener) => {
190
+ if (isMatchesType(listener, event.meta.type)) {
191
+ try {
192
+ listener.callback(event);
193
+ }
194
+ catch (e) {
195
+ console.error(e);
196
+ }
197
+ }
198
+ });
199
+ }
200
+ function removeMultiple(type) {
201
+ if (type === ANY_EVENT_TYPE) {
202
+ listeners.length = 0;
203
+ }
204
+ else {
205
+ for (let i = listeners.length - 1; i >= 0; i--) {
206
+ if (listeners[i].type === type) {
207
+ listeners.splice(i, 1);
208
+ }
209
+ }
210
+ }
211
+ }
212
+ function removeOne(listener) {
213
+ const index = getListenerIndex(listener);
214
+ if (index >= 0) {
215
+ listeners.splice(index, 1);
216
+ }
217
+ }
218
+ function remove(type, callback) {
219
+ !!callback ? removeOne({ type, callback }) : removeMultiple(type);
220
+ }
221
+ return {
222
+ add,
223
+ call,
224
+ remove,
225
+ };
226
+ }
227
+
174
228
  function createRelay(options) {
175
229
  const environment = currentEnvironment();
176
230
  const clientIdManager = createClientIdManager(environment);
231
+ const { add, call, remove } = createListenerManager();
177
232
  return {
178
- validate: (type, payload) => validate({
179
- options,
180
- environment,
181
- event: createRelayEvent(type, payload, options, environment, clientIdManager),
182
- }),
183
- emit: (type, payload) => emit({
184
- options,
185
- environment,
186
- event: createRelayEvent(type, payload, options, environment, clientIdManager),
187
- }),
233
+ validate: (type, payload) => {
234
+ const event = createRelayEvent(type, payload, options, environment, clientIdManager);
235
+ call(event);
236
+ return validate({
237
+ options,
238
+ environment,
239
+ event: createRelayEvent(type, payload, options, environment, clientIdManager),
240
+ });
241
+ },
242
+ emit: (type, payload) => {
243
+ const event = createRelayEvent(type, payload, options, environment, clientIdManager);
244
+ call(event);
245
+ return emit({
246
+ options,
247
+ environment,
248
+ event,
249
+ });
250
+ },
188
251
  getMeta: (type) => createMeta(type, options, environment, clientIdManager),
252
+ on: (type, callback) => add({ type, callback }),
253
+ off: (type, callback) => remove(type, callback),
189
254
  version,
190
255
  };
191
256
  }
@@ -3,7 +3,7 @@ import { Environment } from "../environment/environment";
3
3
  import { RelayOptions, RelayPayload } from "../relay";
4
4
  import { Meta } from "./meta/meta";
5
5
  export interface RelayEvent extends RelayPayload {
6
- meta: Meta;
6
+ meta: Readonly<Meta>;
7
7
  }
8
8
  export declare function createRelayEvent(type: string, payload: RelayPayload, options: RelayOptions, environment: Environment, clientIdManager: ClientIdManager): Readonly<RelayEvent>;
9
9
  //# sourceMappingURL=relay-event.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"relay-event.d.ts","sourceRoot":"","sources":["../../../src/event/relay-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAc,IAAI,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,WAAW,UAAW,SAAQ,YAAY;IAC9C,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,YAAY,EACrB,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,eAAe,GAC/B,QAAQ,CAAC,UAAU,CAAC,CAKtB"}
1
+ {"version":3,"file":"relay-event.d.ts","sourceRoot":"","sources":["../../../src/event/relay-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAc,IAAI,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,WAAW,UAAW,SAAQ,YAAY;IAC9C,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;CACtB;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,YAAY,EACrB,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,eAAe,GAC/B,QAAQ,CAAC,UAAU,CAAC,CAKtB"}
@@ -2,10 +2,10 @@ import { Environment } from "../environment/environment";
2
2
  import { RelayOptions } from "../relay";
3
3
  import { RelayEvent } from "../event/relay-event";
4
4
  export interface EventApiCallParams {
5
- event: Readonly<RelayEvent>;
6
5
  options: RelayOptions;
7
6
  environment: Environment;
8
- validate?: boolean;
7
+ event: Readonly<RelayEvent>;
9
8
  }
10
- export declare function callEventApi({ event, options, environment, validate, }: EventApiCallParams): Promise<any>;
9
+ export type RelayMode = "emit" | "validate";
10
+ export declare function callEventApi({ event, options, environment, }: EventApiCallParams): Promise<any>;
11
11
  //# sourceMappingURL=event-api-caller.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"event-api-caller.d.ts","sourceRoot":"","sources":["../../../src/event-api-call/event-api-caller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC5B,OAAO,EAAE,YAAY,CAAC;IACtB,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAsB,YAAY,CAAC,EACjC,KAAK,EACL,OAAO,EACP,WAAW,EACX,QAAQ,GACT,EAAE,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC,CA2BnC"}
1
+ {"version":3,"file":"event-api-caller.d.ts","sourceRoot":"","sources":["../../../src/event-api-call/event-api-caller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,YAAY,CAAC;IACtB,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;CAC7B;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,UAAU,CAAC;AAE5C,wBAAsB,YAAY,CAAC,EACjC,KAAK,EACL,OAAO,EACP,WAAW,GACZ,EAAE,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC,CA2BnC"}
@@ -0,0 +1,14 @@
1
+ import { RelayEvent } from "../event/relay-event";
2
+ export type EventCallback = (event: RelayEvent) => void;
3
+ interface Listener {
4
+ type: string;
5
+ callback: EventCallback;
6
+ }
7
+ interface ListenerManager {
8
+ add: (listener: Listener) => () => void;
9
+ call: (event: RelayEvent) => void;
10
+ remove: (type: string, callback?: EventCallback) => void;
11
+ }
12
+ export declare function createListenerManager(): ListenerManager;
13
+ export {};
14
+ //# sourceMappingURL=listener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listener.d.ts","sourceRoot":"","sources":["../../../src/listener/listener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIlD,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;AAExD,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,aAAa,CAAC;CACzB;AAED,UAAU,eAAe;IACvB,GAAG,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,MAAM,IAAI,CAAC;IACxC,IAAI,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAClC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,aAAa,KAAK,IAAI,CAAC;CAC1D;AAED,wBAAgB,qBAAqB,IAAI,eAAe,CA4DvD"}
@@ -1,16 +1,22 @@
1
1
  import { ValidationError, ValidationResponse } from "./validate/validate";
2
+ import { RelayMode } from "./event-api-call/event-api-caller";
2
3
  import { Meta } from "./event/meta/meta";
4
+ import { EventCallback } from "./listener/listener";
3
5
  type RelayPayload = Record<string, unknown>;
6
+ type Off = () => void;
4
7
  interface RelayOptions {
5
8
  host: string;
6
9
  organizationId: string;
7
10
  token: string;
8
11
  trackingId: string;
12
+ mode?: RelayMode;
9
13
  }
10
14
  interface Relay {
11
15
  validate: (type: string, payload: RelayPayload) => Promise<ValidationResponse>;
12
16
  emit: (type: string, payload: RelayPayload) => Promise<void>;
13
17
  getMeta: (type: string) => Meta;
18
+ on: (type: string, callback: EventCallback) => Off;
19
+ off: (type: string, callback?: EventCallback) => void;
14
20
  version: string;
15
21
  }
16
22
  export declare function createRelay(options: RelayOptions): Relay;
@@ -1 +1 @@
1
- {"version":3,"file":"relay.d.ts","sourceRoot":"","sources":["../../src/relay.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,eAAe,EACf,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAc,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAErD,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5C,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,KAAK;IACb,QAAQ,EAAE,CACR,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,YAAY,KAClB,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACjC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,KAAK,CAiCxD;AAED,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC"}
1
+ {"version":3,"file":"relay.d.ts","sourceRoot":"","sources":["../../src/relay.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,eAAe,EACf,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAc,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAyB,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE3E,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC5C,KAAK,GAAG,GAAG,MAAM,IAAI,CAAC;AAEtB,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,UAAU,KAAK;IACb,QAAQ,EAAE,CACR,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,YAAY,KAClB,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACjC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,KAAK,GAAG,CAAC;IACnD,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,aAAa,KAAK,IAAI,CAAC;IACtD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,KAAK,CAoDxD;AAED,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/validate/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EACnB,MAAM,oCAAoC,CAAC;AAE5C,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,EAAE,eAAe,EAAE,CAAC;CAC3B;AAED,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAOvC"}
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/validate/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAEnB,MAAM,oCAAoC,CAAC;AAE5C,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,EAAE,eAAe,EAAE,CAAC;CAC3B;AAED,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAMvC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coveo/relay",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "A library for sending analytics events using Coveo's Event protocol.",
5
5
  "files": [
6
6
  "lib/**/*"
@@ -48,8 +48,8 @@
48
48
  "rollup": "^3.28.0",
49
49
  "ts-jest": "^29.1.1",
50
50
  "typescript": "^5.1.6",
51
- "tsconfig": "0.0.0",
52
- "eslint-config-custom": "0.0.0"
51
+ "eslint-config-custom": "0.0.0",
52
+ "tsconfig": "0.0.0"
53
53
  },
54
54
  "dependencies": {
55
55
  "uuid": "^9.0.0"