customerio-node
Advanced tools
Comparing version 3.0.2 to 3.0.3-beta.1
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const https_1 = require("https"); | ||
const url_1 = require("url"); | ||
const utils_1 = require("./utils"); | ||
@@ -32,4 +33,10 @@ const TIMEOUT = 10000; | ||
return new Promise((resolve, reject) => { | ||
let options = Object.assign({}, this.defaults, { method, headers }); | ||
let req = https_1.request(uri, options, (res) => { | ||
let url = new url_1.URL(uri); | ||
let options = Object.assign({}, this.defaults, { | ||
method, | ||
headers, | ||
hostname: url.hostname, | ||
path: url.pathname, | ||
}); | ||
let req = https_1.request(options, (res) => { | ||
let chunks = []; | ||
@@ -36,0 +43,0 @@ res.on('data', (data) => { |
import { request } from 'https'; | ||
import type { RequestOptions } from 'https'; | ||
import { URL } from 'url'; | ||
import { CustomerIORequestError } from './utils'; | ||
@@ -54,3 +55,3 @@ | ||
'Content-Type': 'application/json', | ||
'Content-Length': body ? Buffer.byteLength(body,'utf8') : 0, | ||
'Content-Length': body ? Buffer.byteLength(body, 'utf8') : 0, | ||
}; | ||
@@ -63,4 +64,10 @@ | ||
return new Promise((resolve, reject) => { | ||
let options = Object.assign({}, this.defaults, { method, headers }); | ||
let req = request(uri, options, (res) => { | ||
let url = new URL(uri); | ||
let options = Object.assign<{}, RequestOptions, RequestOptions>({}, this.defaults, { | ||
method, | ||
headers, | ||
hostname: url.hostname, | ||
path: url.pathname, | ||
}); | ||
let req = request(options, (res) => { | ||
let chunks: Buffer[] = []; | ||
@@ -67,0 +74,0 @@ |
{ | ||
"name": "customerio-node", | ||
"description": "A node client for the Customer.io event API. http://customer.io", | ||
"version": "3.0.2", | ||
"version": "3.0.3-beta.1", | ||
"author": "Customer.io (https://customer.io)", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -1,2 +0,2 @@ | ||
# Customerio [![test](https://github.com/customerio/customerio-node/actions/workflows/main.yml/badge.svg)](https://github.com/customerio/customerio-node/actions/workflows/main.yml) | ||
# Customer.io [![test](https://github.com/customerio/customerio-node/actions/workflows/main.yml/badge.svg)](https://github.com/customerio/customerio-node/actions/workflows/main.yml) | ||
@@ -58,2 +58,12 @@ A node client for the Customer.io [REST API](https://learn.customer.io/api/). | ||
#### Updating identifiers | ||
If you want to update an identifier for an existing profile, you must reference them using their `cio_id` in the format `cio_<cio_id_value>`. Using anything else will result in an attribute update failure in Customer.io. You can read more about [updating customers](https://customer.io/docs/api/#operation/identify) on our API documentation. | ||
``` | ||
cio.identify(`cio_${customer.cio_id}`, { | ||
email: 'new_email@example.com' | ||
}); | ||
``` | ||
--- | ||
@@ -60,0 +70,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51001
899
306
1