intercom-client 3.2.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -20
- package/dist/admin/admin.types.d.ts +15 -0
- package/dist/admin/admin.types.d.ts.map +1 -0
- package/dist/admin/admin.types.js +3 -0
- package/dist/admin/admin.types.js.map +1 -0
- package/dist/admin.d.ts +48 -0
- package/dist/admin.d.ts.map +1 -0
- package/dist/admin.js +42 -0
- package/dist/admin.js.map +1 -0
- package/dist/article/article.types.d.ts +87 -0
- package/dist/article/article.types.d.ts.map +1 -0
- package/dist/article/article.types.js +45 -0
- package/dist/article/article.types.js.map +1 -0
- package/dist/article.d.ts +34 -0
- package/dist/article.d.ts.map +1 -0
- package/dist/article.js +69 -0
- package/dist/article.js.map +1 -0
- package/dist/client.d.ts +82 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +325 -0
- package/dist/client.js.map +1 -0
- package/dist/common/common.types.d.ts +69 -0
- package/dist/common/common.types.d.ts.map +1 -0
- package/dist/common/common.types.js +29 -0
- package/dist/common/common.types.js.map +1 -0
- package/dist/company/company.types.d.ts +37 -0
- package/dist/company/company.types.d.ts.map +1 -0
- package/dist/company/company.types.js +3 -0
- package/dist/company/company.types.js.map +1 -0
- package/dist/company.d.ts +63 -0
- package/dist/company.d.ts.map +1 -0
- package/dist/company.js +114 -0
- package/dist/company.js.map +1 -0
- package/dist/contact/contact.types.d.ts +82 -0
- package/dist/contact/contact.types.d.ts.map +1 -0
- package/dist/contact/contact.types.js +3 -0
- package/dist/contact/contact.types.js.map +1 -0
- package/dist/contact.d.ts +121 -0
- package/dist/contact.d.ts.map +1 -0
- package/dist/contact.js +160 -0
- package/dist/contact.js.map +1 -0
- package/dist/conversation/conversation.types.d.ts +144 -0
- package/dist/conversation/conversation.types.d.ts.map +1 -0
- package/dist/conversation/conversation.types.js +50 -0
- package/dist/conversation/conversation.types.js.map +1 -0
- package/dist/conversation.d.ts +176 -0
- package/dist/conversation.d.ts.map +1 -0
- package/dist/conversation.js +289 -0
- package/dist/conversation.js.map +1 -0
- package/dist/count/count.types.d.ts +89 -0
- package/dist/count/count.types.d.ts.map +1 -0
- package/dist/count/count.types.js +17 -0
- package/dist/count/count.types.js.map +1 -0
- package/dist/count.d.ts +18 -0
- package/dist/count.d.ts.map +1 -0
- package/dist/count.js +72 -0
- package/dist/count.js.map +1 -0
- package/dist/dataAttribute/dataAttribute.types.d.ts +32 -0
- package/dist/dataAttribute/dataAttribute.types.d.ts.map +1 -0
- package/dist/dataAttribute/dataAttribute.types.js +18 -0
- package/dist/dataAttribute/dataAttribute.types.js.map +1 -0
- package/dist/dataAttribute.d.ts +33 -0
- package/dist/dataAttribute.d.ts.map +1 -0
- package/dist/dataAttribute.js +49 -0
- package/dist/dataAttribute.js.map +1 -0
- package/dist/dataExport/dataExport.types.d.ts +7 -0
- package/dist/dataExport/dataExport.types.d.ts.map +1 -0
- package/dist/dataExport/dataExport.types.js +3 -0
- package/dist/dataExport/dataExport.types.js.map +1 -0
- package/dist/dataExport.d.ts +18 -0
- package/dist/dataExport.d.ts.map +1 -0
- package/dist/dataExport.js +36 -0
- package/dist/dataExport.js.map +1 -0
- package/dist/errors/badResponse.error.d.ts +9 -0
- package/dist/errors/badResponse.error.d.ts.map +1 -0
- package/dist/errors/badResponse.error.js +35 -0
- package/dist/errors/badResponse.error.js.map +1 -0
- package/dist/event/event.types.d.ts +29 -0
- package/dist/event/event.types.d.ts.map +1 -0
- package/dist/event/event.types.js +3 -0
- package/dist/event/event.types.js.map +1 -0
- package/dist/event.d.ts +41 -0
- package/dist/event.d.ts.map +1 -0
- package/dist/event.js +44 -0
- package/dist/event.js.map +1 -0
- package/dist/helpCenter/helpCenter.types.d.ts +23 -0
- package/dist/helpCenter/helpCenter.types.d.ts.map +1 -0
- package/dist/helpCenter/helpCenter.types.js +3 -0
- package/dist/helpCenter/helpCenter.types.js.map +1 -0
- package/dist/helpCenter.d.ts +58 -0
- package/dist/helpCenter.d.ts.map +1 -0
- package/dist/helpCenter.js +121 -0
- package/dist/helpCenter.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +74 -0
- package/dist/index.js.map +1 -0
- package/dist/message/message.types.d.ts +17 -0
- package/dist/message/message.types.d.ts.map +1 -0
- package/dist/message/message.types.js +11 -0
- package/dist/message/message.types.js.map +1 -0
- package/dist/message.d.ts +32 -0
- package/dist/message.d.ts.map +1 -0
- package/dist/message.js +35 -0
- package/dist/message.js.map +1 -0
- package/dist/note/note.types.d.ts +13 -0
- package/dist/note/note.types.d.ts.map +1 -0
- package/dist/note/note.types.js +3 -0
- package/dist/note/note.types.js.map +1 -0
- package/dist/note.d.ts +24 -0
- package/dist/note.d.ts.map +1 -0
- package/dist/note.js +40 -0
- package/dist/note.js.map +1 -0
- package/dist/package.json +1 -1
- package/dist/phoneCallRedirect/phoneCallRedirect.types.d.ts +5 -0
- package/dist/phoneCallRedirect/phoneCallRedirect.types.d.ts.map +1 -0
- package/dist/phoneCallRedirect/phoneCallRedirect.types.js +3 -0
- package/dist/phoneCallRedirect/phoneCallRedirect.types.js.map +1 -0
- package/dist/phoneCallRedirect.d.ts +15 -0
- package/dist/phoneCallRedirect.d.ts.map +1 -0
- package/dist/phoneCallRedirect.js +23 -0
- package/dist/phoneCallRedirect.js.map +1 -0
- package/dist/scroll.d.ts +24 -0
- package/dist/scroll.d.ts.map +1 -0
- package/dist/scroll.js +131 -0
- package/dist/scroll.js.map +1 -0
- package/dist/segment/segment.types.d.ts +11 -0
- package/dist/segment/segment.types.d.ts.map +1 -0
- package/dist/segment/segment.types.js +3 -0
- package/dist/segment/segment.types.js.map +1 -0
- package/dist/segment.d.ts +22 -0
- package/dist/segment.d.ts.map +1 -0
- package/dist/segment.js +28 -0
- package/dist/segment.js.map +1 -0
- package/dist/subscription/subscription.types.d.ts +19 -0
- package/dist/subscription/subscription.types.d.ts.map +1 -0
- package/dist/subscription/subscription.types.js +10 -0
- package/dist/subscription/subscription.types.js.map +1 -0
- package/dist/subscription.d.ts +14 -0
- package/dist/subscription.d.ts.map +1 -0
- package/dist/subscription.js +17 -0
- package/dist/subscription.js.map +1 -0
- package/dist/tag/tag.types.d.ts +6 -0
- package/dist/tag/tag.types.d.ts.map +1 -0
- package/dist/tag/tag.types.js +3 -0
- package/dist/tag/tag.types.js.map +1 -0
- package/dist/tag.d.ts +52 -0
- package/dist/tag.d.ts.map +1 -0
- package/dist/tag.js +95 -0
- package/dist/tag.js.map +1 -0
- package/dist/team/team.types.d.ts +7 -0
- package/dist/team/team.types.d.ts.map +1 -0
- package/dist/team/team.types.js +3 -0
- package/dist/team/team.types.js.map +1 -0
- package/dist/team.d.ts +18 -0
- package/dist/team.d.ts.map +1 -0
- package/dist/team.js +23 -0
- package/dist/team.js.map +1 -0
- package/dist/util/time.d.ts +3 -0
- package/dist/util/time.d.ts.map +1 -0
- package/dist/util/time.js +6 -0
- package/dist/util/time.js.map +1 -0
- package/dist/util/url.d.ts +3 -0
- package/dist/util/url.d.ts.map +1 -0
- package/dist/util/url.js +9 -0
- package/dist/util/url.js.map +1 -0
- package/dist/visitor/visitor.types.d.ts +20 -0
- package/dist/visitor/visitor.types.d.ts.map +1 -0
- package/dist/visitor/visitor.types.js +3 -0
- package/dist/visitor/visitor.types.js.map +1 -0
- package/dist/visitor.d.ts +50 -0
- package/dist/visitor.d.ts.map +1 -0
- package/dist/visitor.js +60 -0
- package/dist/visitor.js.map +1 -0
- package/package.json +1 -1
package/dist/scroll.js
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
39
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
40
|
+
if (!m) return o;
|
|
41
|
+
var i = m.call(o), r, ar = [], e;
|
|
42
|
+
try {
|
|
43
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
44
|
+
}
|
|
45
|
+
catch (error) { e = { error: error }; }
|
|
46
|
+
finally {
|
|
47
|
+
try {
|
|
48
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
49
|
+
}
|
|
50
|
+
finally { if (e) throw e.error; }
|
|
51
|
+
}
|
|
52
|
+
return ar;
|
|
53
|
+
};
|
|
54
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
55
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
56
|
+
if (ar || !(i in from)) {
|
|
57
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
58
|
+
ar[i] = from[i];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
62
|
+
};
|
|
63
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
64
|
+
var Scroll = /** @class */ (function () {
|
|
65
|
+
function Scroll(client, scrollUrlDataType, scrollParam) {
|
|
66
|
+
this.client = client;
|
|
67
|
+
this.scrollUrlDataType = scrollUrlDataType;
|
|
68
|
+
this.scrollParam = scrollParam;
|
|
69
|
+
this.client = client;
|
|
70
|
+
this.scrollParam = scrollParam;
|
|
71
|
+
}
|
|
72
|
+
// eslint-disable-next-line require-await
|
|
73
|
+
Scroll.prototype.each = function (params) {
|
|
74
|
+
var _a;
|
|
75
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
76
|
+
return __generator(this, function (_b) {
|
|
77
|
+
this.scrollParam = (_a = params.scrollParam) !== null && _a !== void 0 ? _a : undefined;
|
|
78
|
+
return [2 /*return*/, this.eachInternal()];
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
Scroll.prototype.eachInternal = function (storedData) {
|
|
83
|
+
if (storedData === void 0) { storedData = []; }
|
|
84
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
85
|
+
var response, dataFromResponse, combinedData;
|
|
86
|
+
return __generator(this, function (_a) {
|
|
87
|
+
switch (_a.label) {
|
|
88
|
+
case 0: return [4 /*yield*/, this.client.get({
|
|
89
|
+
url: this.scrollUrl(),
|
|
90
|
+
})];
|
|
91
|
+
case 1:
|
|
92
|
+
response = _a.sent();
|
|
93
|
+
dataFromResponse = response.data;
|
|
94
|
+
combinedData = __spreadArray(__spreadArray([], __read(dataFromResponse), false), __read(storedData), false);
|
|
95
|
+
if (dataFromResponse.length > 0) {
|
|
96
|
+
this.scrollParam = response.scroll_param;
|
|
97
|
+
return [2 /*return*/, this.eachInternal(combinedData)];
|
|
98
|
+
}
|
|
99
|
+
return [2 /*return*/, combinedData];
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
Scroll.prototype.next = function (_a) {
|
|
105
|
+
var scrollParam = _a.scrollParam;
|
|
106
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
107
|
+
var response;
|
|
108
|
+
return __generator(this, function (_b) {
|
|
109
|
+
switch (_b.label) {
|
|
110
|
+
case 0:
|
|
111
|
+
this.scrollParam = scrollParam;
|
|
112
|
+
return [4 /*yield*/, this.client.get({
|
|
113
|
+
url: this.scrollUrl(),
|
|
114
|
+
})];
|
|
115
|
+
case 1:
|
|
116
|
+
response = _b.sent();
|
|
117
|
+
return [2 /*return*/, response];
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
Scroll.prototype.scrollUrl = function () {
|
|
123
|
+
var baseScrollUrl = "/".concat(this.scrollUrlDataType, "/scroll");
|
|
124
|
+
return this.scrollParam && this.scrollParam.length > 0
|
|
125
|
+
? "".concat(baseScrollUrl, "?scroll_param=").concat(this.scrollParam)
|
|
126
|
+
: baseScrollUrl;
|
|
127
|
+
};
|
|
128
|
+
return Scroll;
|
|
129
|
+
}());
|
|
130
|
+
exports.default = Scroll;
|
|
131
|
+
//# sourceMappingURL=scroll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll.js","sourceRoot":"","sources":["../../lib/scroll.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;IACI,gBACqB,MAAc,EACd,iBAAyB,EAClC,WAAoB;QAFX,WAAM,GAAN,MAAM,CAAQ;QACd,sBAAiB,GAAjB,iBAAiB,CAAQ;QAClC,gBAAW,GAAX,WAAW,CAAS;QAE5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACnC,CAAC;IAED,yCAAyC;IACnC,qBAAI,GAAV,UAAW,MAAgB;;;;gBACvB,IAAI,CAAC,WAAW,GAAG,MAAA,MAAM,CAAC,WAAW,mCAAI,SAAS,CAAC;gBAEnD,sBAAO,IAAI,CAAC,YAAY,EAAE,EAAC;;;KAC9B;IAEK,6BAAY,GAAlB,UAAmB,UAA6B;QAA7B,2BAAA,EAAA,eAA6B;;;;;4BAC3B,qBAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAiC;4BACnE,GAAG,EAAE,IAAI,CAAC,SAAS,EAAE;yBACxB,CAAC,EAAA;;wBAFI,QAAQ,GAAG,SAEf;wBACI,gBAAgB,GAAG,QAAQ,CAAC,IAAI,CAAC;wBACjC,YAAY,0CAAO,gBAAgB,kBAAK,UAAU,SAAC,CAAC;wBAE1D,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;4BAC7B,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,YAAY,CAAC;4BACzC,sBAAO,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,EAAC;yBAC1C;wBAED,sBAAO,YAAY,EAAC;;;;KACvB;IAEK,qBAAI,GAAV,UAAW,EAEA;YADP,WAAW,iBAAA;;;;;;wBAEX,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;wBAEd,qBAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAiC;gCACnE,GAAG,EAAE,IAAI,CAAC,SAAS,EAAE;6BACxB,CAAC,EAAA;;wBAFI,QAAQ,GAAG,SAEf;wBAEF,sBAAO,QAAQ,EAAC;;;;KACnB;IAED,0BAAS,GAAT;QACI,IAAM,aAAa,GAAG,WAAI,IAAI,CAAC,iBAAiB,YAAS,CAAC;QAE1D,OAAO,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC;YAClD,CAAC,CAAC,UAAG,aAAa,2BAAiB,IAAI,CAAC,WAAW,CAAE;YACrD,CAAC,CAAC,aAAa,CAAC;IACxB,CAAC;IACL,aAAC;AAAD,CAAC,AAnDD,IAmDC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Role, Timestamp } from '../common/common.types';
|
|
2
|
+
export declare type SegmentObject = {
|
|
3
|
+
type: 'segment';
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
created_at: Timestamp;
|
|
7
|
+
updated_at: Timestamp;
|
|
8
|
+
person_type: Role;
|
|
9
|
+
count?: number;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=segment.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segment.types.d.ts","sourceRoot":"","sources":["../../../lib/segment/segment.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEzD,oBAAY,aAAa,GAAG;IACxB,IAAI,EAAE,SAAS,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,SAAS,CAAC;IACtB,UAAU,EAAE,SAAS,CAAC;IACtB,WAAW,EAAE,IAAI,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segment.types.js","sourceRoot":"","sources":["../../../lib/segment/segment.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Client } from '.';
|
|
2
|
+
import { SegmentObject } from './segment/segment.types';
|
|
3
|
+
export default class Segment {
|
|
4
|
+
private readonly client;
|
|
5
|
+
readonly baseUrl = "segments";
|
|
6
|
+
constructor(client: Client);
|
|
7
|
+
list({ includeCount: include_count }: ListData): Promise<ListResponse>;
|
|
8
|
+
find({ id, includeCount: include_count }: FindSegmentData): Promise<SegmentObject>;
|
|
9
|
+
}
|
|
10
|
+
interface ListData {
|
|
11
|
+
includeCount?: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface ListResponse {
|
|
14
|
+
type: 'segment.list';
|
|
15
|
+
segments: SegmentObject[];
|
|
16
|
+
}
|
|
17
|
+
interface FindSegmentData {
|
|
18
|
+
id: string;
|
|
19
|
+
includeCount?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=segment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segment.d.ts","sourceRoot":"","sources":["../../lib/segment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,CAAC,OAAO,OAAO,OAAO;IAGZ,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,SAAgB,OAAO,cAAc;gBAER,MAAM,EAAE,MAAM;IAG3C,IAAI,CAAC,EAAE,YAAY,EAAE,aAAa,EAAE,EAAE,QAAQ;IAQ9C,IAAI,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,aAAa,EAAE,EAAE,eAAe;CAQ5D;AAED,UAAU,QAAQ;IACd,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AACD,UAAU,YAAY;IAClB,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC7B;AAED,UAAU,eAAe;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B"}
|
package/dist/segment.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var Segment = /** @class */ (function () {
|
|
4
|
+
function Segment(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
this.baseUrl = 'segments';
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
Segment.prototype.list = function (_a) {
|
|
10
|
+
var include_count = _a.includeCount;
|
|
11
|
+
var params = { include_count: include_count };
|
|
12
|
+
return this.client.get({
|
|
13
|
+
url: "/".concat(this.baseUrl),
|
|
14
|
+
params: params,
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
Segment.prototype.find = function (_a) {
|
|
18
|
+
var id = _a.id, include_count = _a.includeCount;
|
|
19
|
+
var params = { include_count: include_count };
|
|
20
|
+
return this.client.get({
|
|
21
|
+
url: "/".concat(this.baseUrl, "/").concat(id),
|
|
22
|
+
params: params,
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
return Segment;
|
|
26
|
+
}());
|
|
27
|
+
exports.default = Segment;
|
|
28
|
+
//# sourceMappingURL=segment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segment.js","sourceRoot":"","sources":["../../lib/segment.ts"],"names":[],"mappings":";;AAGA;IAGI,iBAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAF3B,YAAO,GAAG,UAAU,CAAC;QAGjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IACD,sBAAI,GAAJ,UAAK,EAAyC;YAAzB,aAAa,kBAAA;QAC9B,IAAM,MAAM,GAAG,EAAE,aAAa,eAAA,EAAE,CAAC;QAEjC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAe;YACjC,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,CAAE;YACvB,MAAM,QAAA;SACT,CAAC,CAAC;IACP,CAAC;IACD,sBAAI,GAAJ,UAAK,EAAoD;YAAlD,EAAE,QAAA,EAAgB,aAAa,kBAAA;QAClC,IAAM,MAAM,GAAG,EAAE,aAAa,eAAA,EAAE,CAAC;QAEjC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAgB;YAClC,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,cAAI,EAAE,CAAE;YAC7B,MAAM,QAAA;SACT,CAAC,CAAC;IACP,CAAC;IACL,cAAC;AAAD,CAAC,AAtBD,IAsBC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare type SubscriptionObject = {
|
|
2
|
+
type: 'subscription';
|
|
3
|
+
id: string;
|
|
4
|
+
state: SubscriptionState;
|
|
5
|
+
default_translation: TranslationObject;
|
|
6
|
+
translations: TranslationObject[];
|
|
7
|
+
consent_type: 'opt_out';
|
|
8
|
+
};
|
|
9
|
+
export declare enum SubscriptionState {
|
|
10
|
+
ARCHIVED = "archived",
|
|
11
|
+
DRAFT = "draft",
|
|
12
|
+
LIVE = "live"
|
|
13
|
+
}
|
|
14
|
+
export declare type TranslationObject = {
|
|
15
|
+
name: string;
|
|
16
|
+
description: string;
|
|
17
|
+
locale: string;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=subscription.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.types.d.ts","sourceRoot":"","sources":["../../../lib/subscription/subscription.types.ts"],"names":[],"mappings":"AAAA,oBAAY,kBAAkB,GAAG;IAC7B,IAAI,EAAE,cAAc,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,iBAAiB,CAAC;IACzB,mBAAmB,EAAE,iBAAiB,CAAC;IACvC,YAAY,EAAE,iBAAiB,EAAE,CAAC;IAClC,YAAY,EAAE,SAAS,CAAC;CAC3B,CAAC;AAEF,oBAAY,iBAAiB;IACzB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,IAAI,SAAS;CAChB;AAED,oBAAY,iBAAiB,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubscriptionState = void 0;
|
|
4
|
+
var SubscriptionState;
|
|
5
|
+
(function (SubscriptionState) {
|
|
6
|
+
SubscriptionState["ARCHIVED"] = "archived";
|
|
7
|
+
SubscriptionState["DRAFT"] = "draft";
|
|
8
|
+
SubscriptionState["LIVE"] = "live";
|
|
9
|
+
})(SubscriptionState = exports.SubscriptionState || (exports.SubscriptionState = {}));
|
|
10
|
+
//# sourceMappingURL=subscription.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.types.js","sourceRoot":"","sources":["../../../lib/subscription/subscription.types.ts"],"names":[],"mappings":";;;AASA,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IACzB,0CAAqB,CAAA;IACrB,oCAAe,CAAA;IACf,kCAAa,CAAA;AACjB,CAAC,EAJW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAI5B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Client } from '.';
|
|
2
|
+
import { SubscriptionObject } from './subscription/subscription.types';
|
|
3
|
+
export default class Subscription {
|
|
4
|
+
private readonly client;
|
|
5
|
+
readonly baseUrl = "subscription_types";
|
|
6
|
+
constructor(client: Client);
|
|
7
|
+
listTypes(): Promise<ListResponse>;
|
|
8
|
+
}
|
|
9
|
+
interface ListResponse {
|
|
10
|
+
type: 'list';
|
|
11
|
+
data: SubscriptionObject[];
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=subscription.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../lib/subscription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,MAAM,CAAC,OAAO,OAAO,YAAY;IAGjB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,SAAgB,OAAO,wBAAwB;gBAElB,MAAM,EAAE,MAAM;IAG3C,SAAS;CAKZ;AAED,UAAU,YAAY;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,kBAAkB,EAAE,CAAC;CAC9B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var Subscription = /** @class */ (function () {
|
|
4
|
+
function Subscription(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
this.baseUrl = 'subscription_types';
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
Subscription.prototype.listTypes = function () {
|
|
10
|
+
return this.client.get({
|
|
11
|
+
url: "/".concat(this.baseUrl),
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
return Subscription;
|
|
15
|
+
}());
|
|
16
|
+
exports.default = Subscription;
|
|
17
|
+
//# sourceMappingURL=subscription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.js","sourceRoot":"","sources":["../../lib/subscription.ts"],"names":[],"mappings":";;AAGA;IAGI,sBAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAF3B,YAAO,GAAG,oBAAoB,CAAC;QAG3C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IACD,gCAAS,GAAT;QACI,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAe;YACjC,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,CAAE;SAC1B,CAAC,CAAC;IACP,CAAC;IACL,mBAAC;AAAD,CAAC,AAXD,IAWC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.types.d.ts","sourceRoot":"","sources":["../../../lib/tag/tag.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,KAAK,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.types.js","sourceRoot":"","sources":["../../../lib/tag/tag.types.ts"],"names":[],"mappings":""}
|
package/dist/tag.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Client } from '.';
|
|
2
|
+
import { TagObject } from './tag/tag.types';
|
|
3
|
+
export default class Tag {
|
|
4
|
+
private readonly client;
|
|
5
|
+
private tagsBaseUrl;
|
|
6
|
+
constructor(client: Client);
|
|
7
|
+
create(data: CreateTagData): Promise<TagObject>;
|
|
8
|
+
update(data: UpdateTagData): Promise<TagObject>;
|
|
9
|
+
delete({ id }: DeleteTagData): Promise<TagObject>;
|
|
10
|
+
tagContact({ contactId, tagId }: TagContactData): Promise<TagObject>;
|
|
11
|
+
tagConversation({ conversationId, tagId, adminId: admin_id, }: TagConversationData): Promise<TagObject>;
|
|
12
|
+
tagCompanies({ tagName: name, companiesIds }: TagCompaniesData): Promise<TagObject>;
|
|
13
|
+
untagContact({ contactId, tagId }: UntagContactData): Promise<TagObject>;
|
|
14
|
+
untagConversation({ conversationId, tagId, adminId: admin_id, }: UntagConversationData): Promise<TagObject>;
|
|
15
|
+
untagCompanies({ tagName: name, companiesIds }: UntagCompaniesData): Promise<TagObject>;
|
|
16
|
+
list(): Promise<ListAllTagsResponse>;
|
|
17
|
+
}
|
|
18
|
+
interface CreateTagData {
|
|
19
|
+
name: string;
|
|
20
|
+
}
|
|
21
|
+
interface UpdateTagData extends CreateTagData {
|
|
22
|
+
id: string;
|
|
23
|
+
}
|
|
24
|
+
interface DeleteTagData {
|
|
25
|
+
id: string;
|
|
26
|
+
}
|
|
27
|
+
interface TagContactData {
|
|
28
|
+
contactId: string;
|
|
29
|
+
tagId: string;
|
|
30
|
+
}
|
|
31
|
+
interface TagConversationData {
|
|
32
|
+
conversationId: string;
|
|
33
|
+
tagId: string;
|
|
34
|
+
adminId: string;
|
|
35
|
+
}
|
|
36
|
+
interface TagCompaniesData {
|
|
37
|
+
tagName: string;
|
|
38
|
+
companiesIds: string[];
|
|
39
|
+
}
|
|
40
|
+
declare type UntagContactData = TagContactData;
|
|
41
|
+
interface UntagConversationData {
|
|
42
|
+
tagId: string;
|
|
43
|
+
conversationId: string;
|
|
44
|
+
adminId: string;
|
|
45
|
+
}
|
|
46
|
+
declare type UntagCompaniesData = TagCompaniesData;
|
|
47
|
+
interface ListAllTagsResponse {
|
|
48
|
+
type: 'list';
|
|
49
|
+
data: Array<TagObject>;
|
|
50
|
+
}
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../lib/tag.ts"],"names":[],"mappings":"AAAA,OAAO,EA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,YAAY,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,aAAK,gBAAgB,GAAG,cAAc,CAAC;AAEvC,UAAU,qBAAqB;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,aAAK,kBAAkB,GAAG,gBAAgB,CAAC;AAE3C,UAAU,mBAAmB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;CAC1B"}
|
package/dist/tag.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var Tag = /** @class */ (function () {
|
|
4
|
+
function Tag(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
this.tagsBaseUrl = 'tags';
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
Tag.prototype.create = function (data) {
|
|
10
|
+
return this.client.post({
|
|
11
|
+
url: "/".concat(this.tagsBaseUrl),
|
|
12
|
+
data: data,
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
Tag.prototype.update = function (data) {
|
|
16
|
+
return this.client.post({
|
|
17
|
+
url: "/".concat(this.tagsBaseUrl),
|
|
18
|
+
data: data,
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
Tag.prototype.delete = function (_a) {
|
|
22
|
+
var id = _a.id;
|
|
23
|
+
return this.client.delete({
|
|
24
|
+
url: "/".concat(this.tagsBaseUrl, "/").concat(id),
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
Tag.prototype.tagContact = function (_a) {
|
|
28
|
+
var contactId = _a.contactId, tagId = _a.tagId;
|
|
29
|
+
var data = {
|
|
30
|
+
id: tagId,
|
|
31
|
+
};
|
|
32
|
+
return this.client.post({
|
|
33
|
+
url: "/".concat(this.client.contacts.baseUrl, "/").concat(contactId, "/").concat(this.tagsBaseUrl),
|
|
34
|
+
data: data,
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
Tag.prototype.tagConversation = function (_a) {
|
|
38
|
+
var conversationId = _a.conversationId, tagId = _a.tagId, admin_id = _a.adminId;
|
|
39
|
+
var data = {
|
|
40
|
+
id: tagId,
|
|
41
|
+
admin_id: admin_id,
|
|
42
|
+
};
|
|
43
|
+
return this.client.post({
|
|
44
|
+
url: "/".concat(this.client.conversations.baseUrl, "/").concat(conversationId, "/").concat(this.tagsBaseUrl),
|
|
45
|
+
data: data,
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
Tag.prototype.tagCompanies = function (_a) {
|
|
49
|
+
var name = _a.tagName, companiesIds = _a.companiesIds;
|
|
50
|
+
var data = {
|
|
51
|
+
name: name,
|
|
52
|
+
companies: companiesIds.map(function (id) { return ({ id: id }); }),
|
|
53
|
+
};
|
|
54
|
+
return this.client.post({
|
|
55
|
+
url: "/".concat(this.tagsBaseUrl),
|
|
56
|
+
data: data,
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
Tag.prototype.untagContact = function (_a) {
|
|
60
|
+
var contactId = _a.contactId, tagId = _a.tagId;
|
|
61
|
+
return this.client.delete({
|
|
62
|
+
url: "/".concat(this.client.contacts.baseUrl, "/").concat(contactId, "/").concat(this.tagsBaseUrl, "/").concat(tagId),
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
Tag.prototype.untagConversation = function (_a) {
|
|
66
|
+
var conversationId = _a.conversationId, tagId = _a.tagId, admin_id = _a.adminId;
|
|
67
|
+
var data = {
|
|
68
|
+
id: tagId,
|
|
69
|
+
admin_id: admin_id,
|
|
70
|
+
};
|
|
71
|
+
return this.client.delete({
|
|
72
|
+
url: "/".concat(this.client.conversations.baseUrl, "/").concat(conversationId, "/").concat(this.tagsBaseUrl, "/").concat(tagId),
|
|
73
|
+
data: data,
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
Tag.prototype.untagCompanies = function (_a) {
|
|
77
|
+
var name = _a.tagName, companiesIds = _a.companiesIds;
|
|
78
|
+
var data = {
|
|
79
|
+
name: name,
|
|
80
|
+
companies: companiesIds.map(function (id) { return ({ id: id, untag: true }); }),
|
|
81
|
+
};
|
|
82
|
+
return this.client.post({
|
|
83
|
+
url: "/".concat(this.tagsBaseUrl),
|
|
84
|
+
data: data,
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
Tag.prototype.list = function () {
|
|
88
|
+
return this.client.get({
|
|
89
|
+
url: "/".concat(this.tagsBaseUrl),
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
return Tag;
|
|
93
|
+
}());
|
|
94
|
+
exports.default = Tag;
|
|
95
|
+
//# sourceMappingURL=tag.js.map
|
package/dist/tag.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.js","sourceRoot":"","sources":["../../lib/tag.ts"],"names":[],"mappings":";;AAGA;IAGI,aAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAFnC,gBAAW,GAAG,MAAM,CAAC;QAGzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,oBAAM,GAAN,UAAO,IAAmB;QACtB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAY;YAC/B,GAAG,EAAE,WAAI,IAAI,CAAC,WAAW,CAAE;YAC3B,IAAI,MAAA;SACP,CAAC,CAAC;IACP,CAAC;IACD,oBAAM,GAAN,UAAO,IAAmB;QACtB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAY;YAC/B,GAAG,EAAE,WAAI,IAAI,CAAC,WAAW,CAAE;YAC3B,IAAI,MAAA;SACP,CAAC,CAAC;IACP,CAAC;IACD,oBAAM,GAAN,UAAO,EAAqB;YAAnB,EAAE,QAAA;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAY;YACjC,GAAG,EAAE,WAAI,IAAI,CAAC,WAAW,cAAI,E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.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.types.js","sourceRoot":"","sources":["../../../lib/team/team.types.ts"],"names":[],"mappings":""}
|
package/dist/team.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Client } from '.';
|
|
2
|
+
import { TeamObject } from './team/team.types';
|
|
3
|
+
export default class Team {
|
|
4
|
+
private readonly client;
|
|
5
|
+
private readonly baseUrl;
|
|
6
|
+
constructor(client: Client);
|
|
7
|
+
find({ id }: FindTeamData): Promise<TeamObject>;
|
|
8
|
+
list(): Promise<ListTeamsResponse>;
|
|
9
|
+
}
|
|
10
|
+
interface FindTeamData {
|
|
11
|
+
id: string;
|
|
12
|
+
}
|
|
13
|
+
interface ListTeamsResponse {
|
|
14
|
+
type: 'team.list';
|
|
15
|
+
teams: TeamObject[];
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=team.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.d.ts","sourceRoot":"","sources":["../../lib/team.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,CAAC,OAAO,OAAO,IAAI;IAGT,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAW;gBAEN,MAAM,EAAE,MAAM;IAI3C,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,YAAY;IAMzB,IAAI;CAKP;AAED,UAAU,YAAY;IAClB,EAAE,EAAE,MAAM,CAAC;CACd;AAED,UAAU,iBAAiB;IACvB,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,UAAU,EAAE,CAAC;CACvB"}
|
package/dist/team.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var Team = /** @class */ (function () {
|
|
4
|
+
function Team(client) {
|
|
5
|
+
this.client = client;
|
|
6
|
+
this.baseUrl = 'teams';
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
Team.prototype.find = function (_a) {
|
|
10
|
+
var id = _a.id;
|
|
11
|
+
return this.client.get({
|
|
12
|
+
url: "/".concat(this.baseUrl, "/").concat(id),
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
Team.prototype.list = function () {
|
|
16
|
+
return this.client.get({
|
|
17
|
+
url: "/".concat(this.baseUrl),
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
return Team;
|
|
21
|
+
}());
|
|
22
|
+
exports.default = Team;
|
|
23
|
+
//# sourceMappingURL=team.js.map
|
package/dist/team.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.js","sourceRoot":"","sources":["../../lib/team.ts"],"names":[],"mappings":";;AAGA;IAGI,cAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAF1B,YAAO,GAAG,OAAO,CAAC;QAG/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,mBAAI,GAAJ,UAAK,EAAoB;YAAlB,EAAE,QAAA;QACL,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAa;YAC/B,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,cAAI,EAAE,CAAE;SAChC,CAAC,CAAC;IACP,CAAC;IAED,mBAAI,GAAJ;QACI,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAoB;YACtC,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,CAAE;SAC1B,CAAC,CAAC;IACP,CAAC;IACL,WAAC;AAAD,CAAC,AAlBD,IAkBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../../lib/util/time.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,eAAO,MAAM,mBAAmB,SAAU,IAAI,KAAG,SAA8C,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dateToUnixTimestamp = void 0;
|
|
4
|
+
var dateToUnixTimestamp = function (date) { return Math.floor(date.getTime() / 1000); };
|
|
5
|
+
exports.dateToUnixTimestamp = dateToUnixTimestamp;
|
|
6
|
+
//# sourceMappingURL=time.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.js","sourceRoot":"","sources":["../../../lib/util/time.ts"],"names":[],"mappings":";;;AAEO,IAAM,mBAAmB,GAAG,UAAC,IAAU,IAAgB,OAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,EAAjC,CAAiC,CAAC;AAAnF,QAAA,mBAAmB,uBAAgE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../lib/util/url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AAGtC,eAAO,MAAM,kBAAkB,WACnB,OAAO,MAAM,EAAE,MAAM,GAAG,cAAc,MAAM,CAAC,CAAC,KACvD,eAAmE,CAAC"}
|
package/dist/util/url.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.encodeParamsForURL = void 0;
|
|
4
|
+
var url_1 = require("url");
|
|
5
|
+
var lodash_1 = require("lodash");
|
|
6
|
+
var encodeParamsForURL = function (params) { return new url_1.URLSearchParams(purifyFromEmptiness(params)); };
|
|
7
|
+
exports.encodeParamsForURL = encodeParamsForURL;
|
|
8
|
+
var purifyFromEmptiness = function (object) { return (0, lodash_1.omitBy)(object, lodash_1.isEmpty); };
|
|
9
|
+
//# sourceMappingURL=url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../../lib/util/url.ts"],"names":[],"mappings":";;;AAAA,2BAAsC;AACtC,iCAAyC;AAElC,IAAM,kBAAkB,GAAG,UAC9B,MAAsD,IACpC,OAAA,IAAI,qBAAe,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,EAAhD,CAAgD,CAAC;AAF1D,QAAA,kBAAkB,sBAEwC;AAEvE,IAAM,mBAAmB,GAAG,UACxB,MAAsD,IACL,OAAA,IAAA,eAAM,EAAC,MAAM,EAAE,gBAAO,CAAC,EAAvB,CAAuB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { JavascriptObject, SegmentObject, TagObject, Timestamp } from '..';
|
|
2
|
+
export declare type VisitorObject = {
|
|
3
|
+
type: 'visitor';
|
|
4
|
+
id: string;
|
|
5
|
+
created_at: Timestamp;
|
|
6
|
+
updated_at: Timestamp;
|
|
7
|
+
user_id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
custom_attributes: JavascriptObject;
|
|
10
|
+
last_request_at: Timestamp;
|
|
11
|
+
avatar: string | {
|
|
12
|
+
url: string;
|
|
13
|
+
};
|
|
14
|
+
unsubscribed_from_emails: boolean;
|
|
15
|
+
location_data: JavascriptObject;
|
|
16
|
+
social_profiles: JavascriptObject[];
|
|
17
|
+
segments: SegmentObject[];
|
|
18
|
+
tags: TagObject[];
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=visitor.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visitor.types.d.ts","sourceRoot":"","sources":["../../../lib/visitor/visitor.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAE3E,oBAAY,aAAa,GAAG;IACxB,IAAI,EAAE,SAAS,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,SAAS,CAAC;IACtB,UAAU,EAAE,SAAS,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,gBAAgB,CAAC;IACpC,eAAe,EAAE,SAAS,CAAC;IAC3B,MAAM,EAAE,MAAM,GAAG;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACjC,wBAAwB,EAAE,OAAO,CAAC;IAClC,aAAa,EAAE,gBAAgB,CAAC;IAChC,eAAe,EAAE,gBAAgB,EAAE,CAAC;IACpC,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,IAAI,EAAE,SAAS,EAAE,CAAC;CACrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visitor.types.js","sourceRoot":"","sources":["../../../lib/visitor/visitor.types.ts"],"names":[],"mappings":""}
|