@veridia/node-sdk 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/client.js +6 -8
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/client.js +6 -8
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +1 -1
package/dist/cjs/client.js
CHANGED
|
@@ -103,10 +103,10 @@ class VeridiaClient {
|
|
|
103
103
|
async getUserSegments(identifierType, identifierId, noSegmentsOnError = true) {
|
|
104
104
|
try {
|
|
105
105
|
const path = `/segments/${identifierType}/${encodeURIComponent(identifierId)}`;
|
|
106
|
-
const url = `${this.baseUrl}${path}
|
|
106
|
+
const url = new URL(`${this.baseUrl}${path}`);
|
|
107
107
|
const req = {
|
|
108
|
-
host:
|
|
109
|
-
path,
|
|
108
|
+
host: url.host,
|
|
109
|
+
path: url.pathname,
|
|
110
110
|
method: 'GET',
|
|
111
111
|
service: 'segments',
|
|
112
112
|
region: this.region,
|
|
@@ -115,7 +115,7 @@ class VeridiaClient {
|
|
|
115
115
|
aws4.sign(req, this.options);
|
|
116
116
|
const controller = new AbortController();
|
|
117
117
|
const timeout = setTimeout(() => controller.abort(), this.timeoutMsGetUserSegments);
|
|
118
|
-
const res = await (0, http_js_1.httpFetch)(url, {
|
|
118
|
+
const res = await (0, http_js_1.httpFetch)(url.toString(), {
|
|
119
119
|
method: req.method,
|
|
120
120
|
headers: req.headers,
|
|
121
121
|
signal: controller.signal,
|
|
@@ -158,10 +158,8 @@ class VeridiaClient {
|
|
|
158
158
|
clearTimeout(this.flushTimer);
|
|
159
159
|
this.flushTimer = undefined;
|
|
160
160
|
}
|
|
161
|
-
await
|
|
162
|
-
|
|
163
|
-
this.flushBatch('events', this.trackBuffer),
|
|
164
|
-
]);
|
|
161
|
+
await this.flushBatch('profiles', this.identifyBuffer);
|
|
162
|
+
await this.flushBatch('events', this.trackBuffer);
|
|
165
163
|
}
|
|
166
164
|
/**
|
|
167
165
|
* Flushes all pending data and prepares the client for shutdown.
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0.
|
|
1
|
+
export declare const SDK_VERSION = "1.0.12";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/client.js
CHANGED
|
@@ -103,10 +103,10 @@ class VeridiaClient {
|
|
|
103
103
|
async getUserSegments(identifierType, identifierId, noSegmentsOnError = true) {
|
|
104
104
|
try {
|
|
105
105
|
const path = `/segments/${identifierType}/${encodeURIComponent(identifierId)}`;
|
|
106
|
-
const url = `${this.baseUrl}${path}
|
|
106
|
+
const url = new URL(`${this.baseUrl}${path}`);
|
|
107
107
|
const req = {
|
|
108
|
-
host:
|
|
109
|
-
path,
|
|
108
|
+
host: url.host,
|
|
109
|
+
path: url.pathname,
|
|
110
110
|
method: 'GET',
|
|
111
111
|
service: 'segments',
|
|
112
112
|
region: this.region,
|
|
@@ -115,7 +115,7 @@ class VeridiaClient {
|
|
|
115
115
|
aws4.sign(req, this.options);
|
|
116
116
|
const controller = new AbortController();
|
|
117
117
|
const timeout = setTimeout(() => controller.abort(), this.timeoutMsGetUserSegments);
|
|
118
|
-
const res = await (0, http_js_1.httpFetch)(url, {
|
|
118
|
+
const res = await (0, http_js_1.httpFetch)(url.toString(), {
|
|
119
119
|
method: req.method,
|
|
120
120
|
headers: req.headers,
|
|
121
121
|
signal: controller.signal,
|
|
@@ -158,10 +158,8 @@ class VeridiaClient {
|
|
|
158
158
|
clearTimeout(this.flushTimer);
|
|
159
159
|
this.flushTimer = undefined;
|
|
160
160
|
}
|
|
161
|
-
await
|
|
162
|
-
|
|
163
|
-
this.flushBatch('events', this.trackBuffer),
|
|
164
|
-
]);
|
|
161
|
+
await this.flushBatch('profiles', this.identifyBuffer);
|
|
162
|
+
await this.flushBatch('events', this.trackBuffer);
|
|
165
163
|
}
|
|
166
164
|
/**
|
|
167
165
|
* Flushes all pending data and prepares the client for shutdown.
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0.
|
|
1
|
+
export declare const SDK_VERSION = "1.0.12";
|
package/dist/esm/version.js
CHANGED