intercom-client 3.2.0 → 3.2.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.
Files changed (173) hide show
  1. package/dist/admin/admin.types.d.ts +15 -0
  2. package/dist/admin/admin.types.d.ts.map +1 -0
  3. package/dist/admin/admin.types.js +3 -0
  4. package/dist/admin/admin.types.js.map +1 -0
  5. package/dist/admin.d.ts +48 -0
  6. package/dist/admin.d.ts.map +1 -0
  7. package/dist/admin.js +42 -0
  8. package/dist/admin.js.map +1 -0
  9. package/dist/article/article.types.d.ts +87 -0
  10. package/dist/article/article.types.d.ts.map +1 -0
  11. package/dist/article/article.types.js +45 -0
  12. package/dist/article/article.types.js.map +1 -0
  13. package/dist/article.d.ts +34 -0
  14. package/dist/article.d.ts.map +1 -0
  15. package/dist/article.js +69 -0
  16. package/dist/article.js.map +1 -0
  17. package/dist/client.d.ts +82 -0
  18. package/dist/client.d.ts.map +1 -0
  19. package/dist/client.js +325 -0
  20. package/dist/client.js.map +1 -0
  21. package/dist/common/common.types.d.ts +69 -0
  22. package/dist/common/common.types.d.ts.map +1 -0
  23. package/dist/common/common.types.js +29 -0
  24. package/dist/common/common.types.js.map +1 -0
  25. package/dist/company/company.types.d.ts +37 -0
  26. package/dist/company/company.types.d.ts.map +1 -0
  27. package/dist/company/company.types.js +3 -0
  28. package/dist/company/company.types.js.map +1 -0
  29. package/dist/company.d.ts +63 -0
  30. package/dist/company.d.ts.map +1 -0
  31. package/dist/company.js +114 -0
  32. package/dist/company.js.map +1 -0
  33. package/dist/contact/contact.types.d.ts +80 -0
  34. package/dist/contact/contact.types.d.ts.map +1 -0
  35. package/dist/contact/contact.types.js +3 -0
  36. package/dist/contact/contact.types.js.map +1 -0
  37. package/dist/contact.d.ts +121 -0
  38. package/dist/contact.d.ts.map +1 -0
  39. package/dist/contact.js +160 -0
  40. package/dist/contact.js.map +1 -0
  41. package/dist/conversation/conversation.types.d.ts +144 -0
  42. package/dist/conversation/conversation.types.d.ts.map +1 -0
  43. package/dist/conversation/conversation.types.js +50 -0
  44. package/dist/conversation/conversation.types.js.map +1 -0
  45. package/dist/conversation.d.ts +178 -0
  46. package/dist/conversation.d.ts.map +1 -0
  47. package/dist/conversation.js +289 -0
  48. package/dist/conversation.js.map +1 -0
  49. package/dist/count/count.types.d.ts +89 -0
  50. package/dist/count/count.types.d.ts.map +1 -0
  51. package/dist/count/count.types.js +17 -0
  52. package/dist/count/count.types.js.map +1 -0
  53. package/dist/count.d.ts +18 -0
  54. package/dist/count.d.ts.map +1 -0
  55. package/dist/count.js +72 -0
  56. package/dist/count.js.map +1 -0
  57. package/dist/dataAttribute/dataAttribute.types.d.ts +32 -0
  58. package/dist/dataAttribute/dataAttribute.types.d.ts.map +1 -0
  59. package/dist/dataAttribute/dataAttribute.types.js +18 -0
  60. package/dist/dataAttribute/dataAttribute.types.js.map +1 -0
  61. package/dist/dataAttribute.d.ts +33 -0
  62. package/dist/dataAttribute.d.ts.map +1 -0
  63. package/dist/dataAttribute.js +49 -0
  64. package/dist/dataAttribute.js.map +1 -0
  65. package/dist/dataExport/dataExport.types.d.ts +7 -0
  66. package/dist/dataExport/dataExport.types.d.ts.map +1 -0
  67. package/dist/dataExport/dataExport.types.js +3 -0
  68. package/dist/dataExport/dataExport.types.js.map +1 -0
  69. package/dist/dataExport.d.ts +18 -0
  70. package/dist/dataExport.d.ts.map +1 -0
  71. package/dist/dataExport.js +36 -0
  72. package/dist/dataExport.js.map +1 -0
  73. package/dist/errors/badResponse.error.d.ts +9 -0
  74. package/dist/errors/badResponse.error.d.ts.map +1 -0
  75. package/dist/errors/badResponse.error.js +35 -0
  76. package/dist/errors/badResponse.error.js.map +1 -0
  77. package/dist/event/event.types.d.ts +29 -0
  78. package/dist/event/event.types.d.ts.map +1 -0
  79. package/dist/event/event.types.js +3 -0
  80. package/dist/event/event.types.js.map +1 -0
  81. package/dist/event.d.ts +41 -0
  82. package/dist/event.d.ts.map +1 -0
  83. package/dist/event.js +44 -0
  84. package/dist/event.js.map +1 -0
  85. package/dist/helpCenter/helpCenter.types.d.ts +23 -0
  86. package/dist/helpCenter/helpCenter.types.d.ts.map +1 -0
  87. package/dist/helpCenter/helpCenter.types.js +3 -0
  88. package/dist/helpCenter/helpCenter.types.js.map +1 -0
  89. package/dist/helpCenter.d.ts +58 -0
  90. package/dist/helpCenter.d.ts.map +1 -0
  91. package/dist/helpCenter.js +121 -0
  92. package/dist/helpCenter.js.map +1 -0
  93. package/dist/index.d.ts +29 -0
  94. package/dist/index.d.ts.map +1 -0
  95. package/dist/index.js +74 -0
  96. package/dist/index.js.map +1 -0
  97. package/dist/message/message.types.d.ts +17 -0
  98. package/dist/message/message.types.d.ts.map +1 -0
  99. package/dist/message/message.types.js +11 -0
  100. package/dist/message/message.types.js.map +1 -0
  101. package/dist/message.d.ts +32 -0
  102. package/dist/message.d.ts.map +1 -0
  103. package/dist/message.js +35 -0
  104. package/dist/message.js.map +1 -0
  105. package/dist/note/note.types.d.ts +13 -0
  106. package/dist/note/note.types.d.ts.map +1 -0
  107. package/dist/note/note.types.js +3 -0
  108. package/dist/note/note.types.js.map +1 -0
  109. package/dist/note.d.ts +24 -0
  110. package/dist/note.d.ts.map +1 -0
  111. package/dist/note.js +40 -0
  112. package/dist/note.js.map +1 -0
  113. package/dist/phoneCallRedirect/phoneCallRedirect.types.d.ts +5 -0
  114. package/dist/phoneCallRedirect/phoneCallRedirect.types.d.ts.map +1 -0
  115. package/dist/phoneCallRedirect/phoneCallRedirect.types.js +3 -0
  116. package/dist/phoneCallRedirect/phoneCallRedirect.types.js.map +1 -0
  117. package/dist/phoneCallRedirect.d.ts +15 -0
  118. package/dist/phoneCallRedirect.d.ts.map +1 -0
  119. package/dist/phoneCallRedirect.js +23 -0
  120. package/dist/phoneCallRedirect.js.map +1 -0
  121. package/dist/scroll.d.ts +24 -0
  122. package/dist/scroll.d.ts.map +1 -0
  123. package/dist/scroll.js +131 -0
  124. package/dist/scroll.js.map +1 -0
  125. package/dist/segment/segment.types.d.ts +11 -0
  126. package/dist/segment/segment.types.d.ts.map +1 -0
  127. package/dist/segment/segment.types.js +3 -0
  128. package/dist/segment/segment.types.js.map +1 -0
  129. package/dist/segment.d.ts +22 -0
  130. package/dist/segment.d.ts.map +1 -0
  131. package/dist/segment.js +28 -0
  132. package/dist/segment.js.map +1 -0
  133. package/dist/subscription/subscription.types.d.ts +19 -0
  134. package/dist/subscription/subscription.types.d.ts.map +1 -0
  135. package/dist/subscription/subscription.types.js +10 -0
  136. package/dist/subscription/subscription.types.js.map +1 -0
  137. package/dist/subscription.d.ts +14 -0
  138. package/dist/subscription.d.ts.map +1 -0
  139. package/dist/subscription.js +17 -0
  140. package/dist/subscription.js.map +1 -0
  141. package/dist/tag/tag.types.d.ts +6 -0
  142. package/dist/tag/tag.types.d.ts.map +1 -0
  143. package/dist/tag/tag.types.js +3 -0
  144. package/dist/tag/tag.types.js.map +1 -0
  145. package/dist/tag.d.ts +52 -0
  146. package/dist/tag.d.ts.map +1 -0
  147. package/dist/tag.js +95 -0
  148. package/dist/tag.js.map +1 -0
  149. package/dist/team/team.types.d.ts +7 -0
  150. package/dist/team/team.types.d.ts.map +1 -0
  151. package/dist/team/team.types.js +3 -0
  152. package/dist/team/team.types.js.map +1 -0
  153. package/dist/team.d.ts +18 -0
  154. package/dist/team.d.ts.map +1 -0
  155. package/dist/team.js +23 -0
  156. package/dist/team.js.map +1 -0
  157. package/dist/util/time.d.ts +3 -0
  158. package/dist/util/time.d.ts.map +1 -0
  159. package/dist/util/time.js +6 -0
  160. package/dist/util/time.js.map +1 -0
  161. package/dist/util/url.d.ts +3 -0
  162. package/dist/util/url.d.ts.map +1 -0
  163. package/dist/util/url.js +9 -0
  164. package/dist/util/url.js.map +1 -0
  165. package/dist/visitor/visitor.types.d.ts +20 -0
  166. package/dist/visitor/visitor.types.d.ts.map +1 -0
  167. package/dist/visitor/visitor.types.js +3 -0
  168. package/dist/visitor/visitor.types.js.map +1 -0
  169. package/dist/visitor.d.ts +50 -0
  170. package/dist/visitor.d.ts.map +1 -0
  171. package/dist/visitor.js +60 -0
  172. package/dist/visitor.js.map +1 -0
  173. package/package.json +1 -1
@@ -0,0 +1,18 @@
1
+ import { Client, CompanySegmentCountResponse, CompanyTagCountResponse, CompanyUserCountResponse, UserCountResponse, UserSegmentCountResponse, UserTagCountResponse } from '.';
2
+ import { AdminConversationCountResponse, AppTotalCountResponse, CompanyCountResponse, ConversationCountResponse } from './count/count.types';
3
+ export default class Count {
4
+ private readonly client;
5
+ readonly baseUrl = "counts";
6
+ constructor(client: Client);
7
+ forApp(): Promise<AppTotalCountResponse>;
8
+ countCompany(): Promise<CompanyCountResponse>;
9
+ countCompanySegment(): Promise<CompanySegmentCountResponse>;
10
+ countCompanyTag(): Promise<CompanyTagCountResponse>;
11
+ countCompanyUser(): Promise<CompanyUserCountResponse>;
12
+ countConversation(): Promise<ConversationCountResponse>;
13
+ countAdminConversation(): Promise<AdminConversationCountResponse>;
14
+ countUser(): Promise<UserCountResponse>;
15
+ countUserSegment(): Promise<UserSegmentCountResponse>;
16
+ countUserTag(): Promise<UserTagCountResponse>;
17
+ }
18
+ //# sourceMappingURL=count.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"count.d.ts","sourceRoot":"","sources":["../../lib/count.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,MAAM,EACN,2BAA2B,EAC3B,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACvB,MAAM,GAAG,CAAC;AACX,OAAO,EACH,8BAA8B,EAC9B,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EAG5B,MAAM,qBAAqB,CAAC;AAE7B,MAAM,CAAC,OAAO,OAAO,KAAK;IAGV,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,SAAgB,OAAO,YAAY;gBAEN,MAAM,EAAE,MAAM;IAI3C,MAAM;IAMN,YAAY;IAMZ,mBAAmB;IAMnB,eAAe;IAMf,gBAAgB;IAMhB,iBAAiB;IAMjB,sBAAsB;IAMtB,SAAS;IAMT,gBAAgB;IAMhB,YAAY;CAMf"}
package/dist/count.js ADDED
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var count_types_1 = require("./count/count.types");
4
+ var Count = /** @class */ (function () {
5
+ function Count(client) {
6
+ this.client = client;
7
+ this.baseUrl = 'counts';
8
+ this.client = client;
9
+ }
10
+ Count.prototype.forApp = function () {
11
+ return this.client.get({
12
+ url: "/".concat(this.baseUrl),
13
+ });
14
+ };
15
+ Count.prototype.countCompany = function () {
16
+ return this.client.get({
17
+ url: "/".concat(this.baseUrl),
18
+ params: { type: count_types_1.CountType.COMPANY },
19
+ });
20
+ };
21
+ Count.prototype.countCompanySegment = function () {
22
+ return this.client.get({
23
+ url: "/".concat(this.baseUrl),
24
+ params: { type: count_types_1.CountType.COMPANY, count: count_types_1.CountEntity.SEGMENT },
25
+ });
26
+ };
27
+ Count.prototype.countCompanyTag = function () {
28
+ return this.client.get({
29
+ url: "/".concat(this.baseUrl),
30
+ params: { type: count_types_1.CountType.COMPANY, count: count_types_1.CountEntity.TAG },
31
+ });
32
+ };
33
+ Count.prototype.countCompanyUser = function () {
34
+ return this.client.get({
35
+ url: "/".concat(this.baseUrl),
36
+ params: { type: count_types_1.CountType.COMPANY, count: count_types_1.CountEntity.USER },
37
+ });
38
+ };
39
+ Count.prototype.countConversation = function () {
40
+ return this.client.get({
41
+ url: "/".concat(this.baseUrl),
42
+ params: { type: count_types_1.CountType.CONVERSATION },
43
+ });
44
+ };
45
+ Count.prototype.countAdminConversation = function () {
46
+ return this.client.get({
47
+ url: "/".concat(this.baseUrl),
48
+ params: { type: count_types_1.CountType.CONVERSATION, count: count_types_1.CountEntity.ADMIN },
49
+ });
50
+ };
51
+ Count.prototype.countUser = function () {
52
+ return this.client.get({
53
+ url: "/".concat(this.baseUrl),
54
+ params: { type: count_types_1.CountType.USER },
55
+ });
56
+ };
57
+ Count.prototype.countUserSegment = function () {
58
+ return this.client.get({
59
+ url: "/".concat(this.baseUrl),
60
+ params: { type: count_types_1.CountType.USER, count: count_types_1.CountEntity.SEGMENT },
61
+ });
62
+ };
63
+ Count.prototype.countUserTag = function () {
64
+ return this.client.get({
65
+ url: "/".concat(this.baseUrl),
66
+ params: { type: count_types_1.CountType.USER, count: count_types_1.CountEntity.TAG },
67
+ });
68
+ };
69
+ return Count;
70
+ }());
71
+ exports.default = Count;
72
+ //# sourceMappingURL=count.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"count.js","sourceRoot":"","sources":["../../lib/count.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,32 @@
1
+ import { Timestamp } from '../common/common.types';
2
+ export interface DataAttributeObject {
3
+ id: string;
4
+ name: string;
5
+ full_name: string;
6
+ label: string;
7
+ description: string;
8
+ data_type: DataType;
9
+ api_writable: boolean;
10
+ ui_writable: boolean;
11
+ custom: boolean;
12
+ archived: boolean;
13
+ model: ModelType;
14
+ options: Record<'value', string>[];
15
+ type?: 'data_attribute';
16
+ created_at?: Timestamp;
17
+ updated_at?: Timestamp;
18
+ admin_id?: string;
19
+ }
20
+ export declare enum ModelType {
21
+ CONTACT = "contact",
22
+ COMPANY = "company",
23
+ CONVERSATION = "conversation"
24
+ }
25
+ export declare enum DataType {
26
+ STRING = "string",
27
+ INTEGER = "integer",
28
+ FLOAT = "float",
29
+ BOOLEAN = "boolean",
30
+ DATE = "date"
31
+ }
32
+ //# sourceMappingURL=dataAttribute.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataAttribute.types.d.ts","sourceRoot":"","sources":["../../../lib/dataAttribute/dataAttribute.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,WAAW,mBAAmB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,QAAQ,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC;IACnC,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,oBAAY,SAAS;IACjB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,YAAY,iBAAiB;CAChC;AAED,oBAAY,QAAQ;IAChB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,IAAI,SAAS;CAChB"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DataType = exports.ModelType = void 0;
4
+ var ModelType;
5
+ (function (ModelType) {
6
+ ModelType["CONTACT"] = "contact";
7
+ ModelType["COMPANY"] = "company";
8
+ ModelType["CONVERSATION"] = "conversation";
9
+ })(ModelType = exports.ModelType || (exports.ModelType = {}));
10
+ var DataType;
11
+ (function (DataType) {
12
+ DataType["STRING"] = "string";
13
+ DataType["INTEGER"] = "integer";
14
+ DataType["FLOAT"] = "float";
15
+ DataType["BOOLEAN"] = "boolean";
16
+ DataType["DATE"] = "date";
17
+ })(DataType = exports.DataType || (exports.DataType = {}));
18
+ //# sourceMappingURL=dataAttribute.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataAttribute.types.js","sourceRoot":"","sources":["../../../lib/dataAttribute/dataAttribute.types.ts"],"names":[],"mappings":";;;AAqBA,IAAY,SAIX;AAJD,WAAY,SAAS;IACjB,gCAAmB,CAAA;IACnB,gCAAmB,CAAA;IACnB,0CAA6B,CAAA;AACjC,CAAC,EAJW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAIpB;AAED,IAAY,QAMX;AAND,WAAY,QAAQ;IAChB,6BAAiB,CAAA;IACjB,+BAAmB,CAAA;IACnB,2BAAe,CAAA;IACf,+BAAmB,CAAA;IACnB,yBAAa,CAAA;AACjB,CAAC,EANW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAMnB"}
@@ -0,0 +1,33 @@
1
+ import { Client } from '.';
2
+ import { DataAttributeObject, ModelType } from './dataAttribute/dataAttribute.types';
3
+ export default class DataAttribute {
4
+ private readonly client;
5
+ readonly baseUrl = "data_attributes";
6
+ constructor(client: Client);
7
+ create({ name, model, dataType: data_type, description, options, }: CreateDataAttributeData): Promise<DataAttributeObject>;
8
+ update({ archived, description, id, options }: UpdateDataAttributeData): Promise<DataAttributeObject>;
9
+ list({ model, includeArchived: include_archived }: ListDataAttributeData): Promise<ListAllResponse>;
10
+ }
11
+ interface CreateDataAttributeData {
12
+ name: DataAttributeObject['name'];
13
+ model: DataAttributeObject['model'];
14
+ dataType: DataAttributeObject['data_type'];
15
+ description?: DataAttributeObject['description'];
16
+ options?: DataAttributeObject['options'];
17
+ }
18
+ interface UpdateDataAttributeData {
19
+ id: string;
20
+ archived?: DataAttributeObject['archived'];
21
+ description?: DataAttributeObject['description'];
22
+ options?: DataAttributeObject['options'];
23
+ }
24
+ interface ListDataAttributeData {
25
+ model?: ModelType;
26
+ includeArchived?: boolean;
27
+ }
28
+ interface ListAllResponse {
29
+ type: 'list';
30
+ data: DataAttributeObject[];
31
+ }
32
+ export {};
33
+ //# sourceMappingURL=dataAttribute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataAttribute.d.ts","sourceRoot":"","sources":["../../lib/dataAttribute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAC3B,OAAO,EACH,mBAAmB,EACnB,SAAS,EACZ,MAAM,qCAAqC,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,aAAa;IAGlB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,SAAgB,OAAO,qBAAqB;gBAEf,MAAM,EAAE,MAAM;IAI3C,MAAM,CAAC,EACH,IAAI,EACJ,KAAK,EACL,QAAQ,EAAE,SAAS,EACnB,WAAW,EACX,OAAO,GACV,EAAE,uBAAuB;IAc1B,MAAM,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,uBAAuB;IAYtE,IAAI,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,EAAE,qBAAqB;CAW3E;AAED,UAAU,uBAAuB;IAC7B,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAClC,KAAK,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACpC,QAAQ,EAAE,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAC3C,WAAW,CAAC,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;IACjD,OAAO,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;CAC5C;AAED,UAAU,uBAAuB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAC3C,WAAW,CAAC,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;IACjD,OAAO,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;CAC5C;AAED,UAAU,qBAAqB;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,UAAU,eAAe;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,mBAAmB,EAAE,CAAC;CAC/B"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var DataAttribute = /** @class */ (function () {
4
+ function DataAttribute(client) {
5
+ this.client = client;
6
+ this.baseUrl = 'data_attributes';
7
+ this.client = client;
8
+ }
9
+ DataAttribute.prototype.create = function (_a) {
10
+ var name = _a.name, model = _a.model, data_type = _a.dataType, description = _a.description, options = _a.options;
11
+ var data = {
12
+ name: name,
13
+ model: model,
14
+ data_type: data_type,
15
+ description: description,
16
+ options: options,
17
+ };
18
+ return this.client.post({
19
+ url: "/".concat(this.baseUrl),
20
+ data: data,
21
+ });
22
+ };
23
+ DataAttribute.prototype.update = function (_a) {
24
+ var archived = _a.archived, description = _a.description, id = _a.id, options = _a.options;
25
+ var data = {
26
+ archived: archived,
27
+ description: description,
28
+ options: options,
29
+ };
30
+ return this.client.put({
31
+ url: "/".concat(this.baseUrl, "/").concat(id),
32
+ data: data,
33
+ });
34
+ };
35
+ DataAttribute.prototype.list = function (_a) {
36
+ var model = _a.model, include_archived = _a.includeArchived;
37
+ var queryParams = {
38
+ model: model,
39
+ include_archived: include_archived,
40
+ };
41
+ return this.client.get({
42
+ url: "/".concat(this.baseUrl),
43
+ params: queryParams,
44
+ });
45
+ };
46
+ return DataAttribute;
47
+ }());
48
+ exports.default = DataAttribute;
49
+ //# sourceMappingURL=dataAttribute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataAttribute.js","sourceRoot":"","sources":["../../lib/dataAttribute.ts"],"names":[],"mappings":";;AAMA;IAGI,uBAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAF3B,YAAO,GAAG,iBAAiB,CAAC;QAGxC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,8BAAM,GAAN,UAAO,EAMmB;YALtB,IAAI,UAAA,EACJ,KAAK,WAAA,EACK,SAAS,cAAA,EACnB,WAAW,iBAAA,EACX,OAAO,aAAA;QAEP,IAAM,IAAI,GAAG;YACT,IAAI,MAAA;YACJ,KAAK,OAAA;YACL,SAAS,WAAA;YACT,WAAW,aAAA;YACX,OAAO,SAAA;SACV,CAAC;QAEF,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAsB;YACzC,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,CAAE;YACvB,IAAI,MAAA;SACP,CAAC,CAAC;IACP,CAAC;IACD,8BAAM,GAAN,UAAO,EAA+D;YAA7D,QAAQ,cAAA,EAAE,WAAW,iBAAA,EAAE,EAAE,QAAA,EAAE,OAAO,aAAA;QACvC,IAAM,IAAI,GAAG;YACT,QAAQ,UAAA;YACR,WAAW,aAAA;YACX,OAAO,SAAA;SACV,CAAC;QAEF,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAsB;YACxC,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,cAAI,EAAE,CAAE;YAC7B,IAAI,MAAA;SACP,CAAC,CAAC;IACP,CAAC;IACD,4BAAI,GAAJ,UAAK,EAAmE;YAAjE,KAAK,WAAA,EAAmB,gBAAgB,qBAAA;QAC3C,IAAM,WAAW,GAAG;YAChB,KAAK,OAAA;YACL,gBAAgB,kBAAA;SACnB,CAAC;QAEF,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAkB;YACpC,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,CAAE;YACvB,MAAM,EAAE,WAAW;SACtB,CAAC,CAAC;IACP,CAAC;IACL,oBAAC;AAAD,CAAC,AAlDD,IAkDC"}
@@ -0,0 +1,7 @@
1
+ export declare type DataExportObject = {
2
+ job_identifier: string;
3
+ status: string;
4
+ download_url: string;
5
+ download_expires_at: string;
6
+ };
7
+ //# sourceMappingURL=dataExport.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataExport.types.d.ts","sourceRoot":"","sources":["../../../lib/dataExport/dataExport.types.ts"],"names":[],"mappings":"AAAA,oBAAY,gBAAgB,GAAG;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,CAAC;CAC/B,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=dataExport.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataExport.types.js","sourceRoot":"","sources":["../../../lib/dataExport/dataExport.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import { Client } from '.';
2
+ import { DataExportObject } from './dataExport/dataExport.types';
3
+ import { OperationById } from './common/common.types';
4
+ export default class DataExport {
5
+ private readonly client;
6
+ readonly baseUrl = "export";
7
+ constructor(client: Client);
8
+ find({ id }: DataExportByIdData): Promise<DataExportObject>;
9
+ create({ createdAtBefore, createdAtAfter }: CreateDataExportData): Promise<DataExportObject>;
10
+ cancel({ id }: DataExportByIdData): Promise<DataExportObject>;
11
+ }
12
+ interface CreateDataExportData {
13
+ createdAtBefore: number;
14
+ createdAtAfter: number;
15
+ }
16
+ declare type DataExportByIdData = OperationById;
17
+ export {};
18
+ //# sourceMappingURL=dataExport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataExport.d.ts","sourceRoot":"","sources":["../../lib/dataExport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,CAAC,OAAO,OAAO,UAAU;IAGf,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,SAAgB,OAAO,YAAY;gBAEN,MAAM,EAAE,MAAM;IAI3C,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,kBAAkB;IAM/B,MAAM,CAAC,EAAE,eAAe,EAAE,cAAc,EAAE,EAAE,oBAAoB;IAYhE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,kBAAkB;CAMpC;AAED,UAAU,oBAAoB;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,aAAK,kBAAkB,GAAG,aAAa,CAAC"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var DataExport = /** @class */ (function () {
4
+ function DataExport(client) {
5
+ this.client = client;
6
+ this.baseUrl = 'export';
7
+ this.client = client;
8
+ }
9
+ DataExport.prototype.find = function (_a) {
10
+ var id = _a.id;
11
+ return this.client.get({
12
+ url: "/".concat(this.baseUrl, "/content/data/").concat(id),
13
+ });
14
+ };
15
+ DataExport.prototype.create = function (_a) {
16
+ var createdAtBefore = _a.createdAtBefore, createdAtAfter = _a.createdAtAfter;
17
+ var data = {
18
+ created_at_before: createdAtBefore,
19
+ created_at_after: createdAtAfter,
20
+ };
21
+ return this.client.post({
22
+ url: "/".concat(this.client.dataExport.baseUrl, "/content/data/"),
23
+ data: data,
24
+ });
25
+ };
26
+ DataExport.prototype.cancel = function (_a) {
27
+ var id = _a.id;
28
+ return this.client.post({
29
+ url: "/".concat(this.baseUrl, "/cancel/").concat(id),
30
+ data: {},
31
+ });
32
+ };
33
+ return DataExport;
34
+ }());
35
+ exports.default = DataExport;
36
+ //# sourceMappingURL=dataExport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataExport.js","sourceRoot":"","sources":["../../lib/dataExport.ts"],"names":[],"mappings":";;AAIA;IAGI,oBAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAF3B,YAAO,GAAG,QAAQ,CAAC;QAG/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,yBAAI,GAAJ,UAAK,EAA0B;YAAxB,EAAE,QAAA;QACL,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAmB;YACrC,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,2BAAiB,EAAE,CAAE;SAC7C,CAAC,CAAC;IACP,CAAC;IAED,2BAAM,GAAN,UAAO,EAAyD;YAAvD,eAAe,qBAAA,EAAE,cAAc,oBAAA;QACpC,IAAM,IAAI,GAAG;YACT,iBAAiB,EAAE,eAAe;YAClC,gBAAgB,EAAE,cAAc;SACnC,CAAC;QAEF,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAmB;YACtC,GAAG,EAAE,WAAI,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,mBAAgB;YACvD,IAAI,MAAA;SACP,CAAC,CAAC;IACP,CAAC;IAED,2BAAM,GAAN,UAAO,EAA0B;YAAxB,EAAE,QAAA;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAmB;YACtC,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,qBAAW,EAAE,CAAE;YACpC,IAAI,EAAE,EAAE;SACX,CAAC,CAAC;IACP,CAAC;IACL,iBAAC;AAAD,CAAC,AA/BD,IA+BC"}
@@ -0,0 +1,9 @@
1
+ import { AxiosResponse } from 'axios';
2
+ export declare class BadResponseError extends Error {
3
+ readonly message: string;
4
+ readonly body: AxiosResponse['data'];
5
+ readonly headers: AxiosResponse['headers'];
6
+ readonly statusCode: AxiosResponse['status'];
7
+ constructor(message: string, body: AxiosResponse['data'], headers: AxiosResponse['headers'], statusCode: AxiosResponse['status']);
8
+ }
9
+ //# sourceMappingURL=badResponse.error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badResponse.error.d.ts","sourceRoot":"","sources":["../../../lib/errors/badResponse.error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,qBAAa,gBAAiB,SAAQ,KAAK;IAEnC,QAAQ,CAAC,OAAO,EAAE,MAAM;IACxB,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC;IAC1C,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,QAAQ,CAAC;gBAHnC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,EAC3B,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,EACjC,UAAU,EAAE,aAAa,CAAC,QAAQ,CAAC;CAOnD"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.BadResponseError = void 0;
19
+ var BadResponseError = /** @class */ (function (_super) {
20
+ __extends(BadResponseError, _super);
21
+ function BadResponseError(message, body, headers, statusCode) {
22
+ var _this = _super.call(this, message) || this;
23
+ _this.message = message;
24
+ _this.body = body;
25
+ _this.headers = headers;
26
+ _this.statusCode = statusCode;
27
+ _this.body = body;
28
+ _this.headers = headers;
29
+ _this.statusCode = statusCode;
30
+ return _this;
31
+ }
32
+ return BadResponseError;
33
+ }(Error));
34
+ exports.BadResponseError = BadResponseError;
35
+ //# sourceMappingURL=badResponse.error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badResponse.error.js","sourceRoot":"","sources":["../../../lib/errors/badResponse.error.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAEA;IAAsC,oCAAK;IACvC,0BACa,OAAe,EACf,IAA2B,EAC3B,OAAiC,EACjC,UAAmC;QAJhD,YAMI,kBAAM,OAAO,CAAC,SAIjB;QATY,aAAO,GAAP,OAAO,CAAQ;QACf,UAAI,GAAJ,IAAI,CAAuB;QAC3B,aAAO,GAAP,OAAO,CAA0B;QACjC,gBAAU,GAAV,UAAU,CAAyB;QAG5C,KAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,KAAI,CAAC,UAAU,GAAG,UAAU,CAAC;;IACjC,CAAC;IACL,uBAAC;AAAD,CAAC,AAZD,CAAsC,KAAK,GAY1C;AAZY,4CAAgB"}
@@ -0,0 +1,29 @@
1
+ import { Timestamp } from '../common/common.types';
2
+ export interface SummaryEventObject {
3
+ name: string;
4
+ first: Date | string;
5
+ last: Date | string;
6
+ count: number;
7
+ description: string | null;
8
+ }
9
+ export interface EventObject {
10
+ event_name: string;
11
+ created_at: Timestamp;
12
+ user_id?: string;
13
+ id?: string;
14
+ email?: string;
15
+ metadata?: Metadata;
16
+ }
17
+ export interface Metadata {
18
+ [x: string]: string | number | RichLink | MonetaryAmount;
19
+ }
20
+ declare type RichLink = {
21
+ url: string;
22
+ value: string;
23
+ };
24
+ declare type MonetaryAmount = {
25
+ amount: number;
26
+ currency: string;
27
+ };
28
+ export {};
29
+ //# sourceMappingURL=event.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event.types.d.ts","sourceRoot":"","sources":["../../../lib/event/event.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,IAAI,GAAG,MAAM,CAAC;IACrB,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,WAAW;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACvB;AAED,MAAM,WAAW,QAAQ;IACrB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,cAAc,CAAC;CAC5D;AAED,aAAK,QAAQ,GAAG;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,aAAK,cAAc,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=event.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event.types.js","sourceRoot":"","sources":["../../../lib/event/event.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,41 @@
1
+ import { Client } from '.';
2
+ import { EventObject, SummaryEventObject } from './event/event.types';
3
+ export default class Event {
4
+ private readonly client;
5
+ readonly baseUrl = "events";
6
+ constructor(client: Client);
7
+ create({ eventName: event_name, createdAt: created_at, userId: user_id, id, email, metadata, }: CreateEventData): Promise<void>;
8
+ listBy({ userId: user_id, email, intercomUserId: intercom_user_id, perPage: per_page, summary, }: ListParams): Promise<ListParamsWithSummaryResponse> | Promise<ListParamsResponse>;
9
+ }
10
+ interface CreateEventData {
11
+ eventName: EventObject['event_name'];
12
+ createdAt: EventObject['created_at'];
13
+ userId?: EventObject['user_id'];
14
+ id?: EventObject['id'];
15
+ email?: EventObject['email'];
16
+ metadata?: EventObject['metadata'];
17
+ }
18
+ interface ListParams {
19
+ userId?: EventObject['user_id'];
20
+ email?: EventObject['email'];
21
+ intercomUserId?: string;
22
+ perPage?: number;
23
+ summary?: boolean;
24
+ }
25
+ interface ListParamsResponse {
26
+ type: 'event.list';
27
+ events: EventObject[];
28
+ pages: {
29
+ next?: string;
30
+ since?: string;
31
+ };
32
+ }
33
+ interface ListParamsWithSummaryResponse {
34
+ type: 'event.summary';
35
+ email: string;
36
+ intercom_user_id: string;
37
+ user_id: string;
38
+ events: SummaryEventObject[];
39
+ }
40
+ export {};
41
+ //# sourceMappingURL=event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../lib/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEtE,MAAM,CAAC,OAAO,OAAO,KAAK;IAGV,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,SAAgB,OAAO,YAAY;gBAEN,MAAM,EAAE,MAAM;IAG3C,MAAM,CAAC,EACH,SAAS,EAAE,UAAU,EACrB,SAAS,EAAE,UAAU,EACrB,MAAM,EAAE,OAAO,EACf,EAAE,EACF,KAAK,EACL,QAAQ,GACX,EAAE,eAAe;IAYlB,MAAM,CAAC,EACH,MAAM,EAAE,OAAO,EACf,KAAK,EACL,cAAc,EAAE,gBAAgB,EAChC,OAAO,EAAE,QAAQ,EACjB,OAAO,GACV,EAAE,UAAU;CAoBhB;AAED,UAAU,eAAe;IACrB,SAAS,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IACrC,SAAS,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IACrC,MAAM,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,EAAE,CAAC,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IACvB,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;CACtC;AAED,UAAU,UAAU;IAChB,MAAM,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AACD,UAAU,kBAAkB;IACxB,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,KAAK,EAAE;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACL;AACD,UAAU,6BAA6B;IACnC,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,kBAAkB,EAAE,CAAC;CAChC"}
package/dist/event.js ADDED
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var Event = /** @class */ (function () {
4
+ function Event(client) {
5
+ this.client = client;
6
+ this.baseUrl = 'events';
7
+ this.client = client;
8
+ }
9
+ Event.prototype.create = function (_a) {
10
+ var event_name = _a.eventName, created_at = _a.createdAt, user_id = _a.userId, id = _a.id, email = _a.email, metadata = _a.metadata;
11
+ var data = {
12
+ event_name: event_name,
13
+ created_at: created_at,
14
+ user_id: user_id,
15
+ id: id,
16
+ email: email,
17
+ metadata: metadata,
18
+ };
19
+ return this.client.post({ url: "/".concat(this.baseUrl), data: data });
20
+ };
21
+ Event.prototype.listBy = function (_a) {
22
+ var user_id = _a.userId, email = _a.email, intercom_user_id = _a.intercomUserId, per_page = _a.perPage, summary = _a.summary;
23
+ var params = {
24
+ type: 'user',
25
+ user_id: user_id,
26
+ email: email,
27
+ intercom_user_id: intercom_user_id,
28
+ per_page: per_page,
29
+ summary: summary,
30
+ };
31
+ return summary
32
+ ? this.client.get({
33
+ url: "/".concat(this.baseUrl),
34
+ params: params,
35
+ })
36
+ : this.client.get({
37
+ url: "/".concat(this.baseUrl),
38
+ params: params,
39
+ });
40
+ };
41
+ return Event;
42
+ }());
43
+ exports.default = Event;
44
+ //# sourceMappingURL=event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event.js","sourceRoot":"","sources":["../../lib/event.ts"],"names":[],"mappings":";;AAGA;IAGI,eAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAF3B,YAAO,GAAG,QAAQ,CAAC;QAG/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IACD,sBAAM,GAAN,UAAO,EAOW;YANH,UAAU,eAAA,EACV,UAAU,eAAA,EACb,OAAO,YAAA,EACf,EAAE,QAAA,EACF,KAAK,WAAA,EACL,QAAQ,cAAA;QAER,IAAM,IAAI,GAAgB;YACtB,UAAU,YAAA;YACV,UAAU,YAAA;YACV,OAAO,SAAA;YACP,EAAE,IAAA;YACF,KAAK,OAAA;YACL,QAAQ,UAAA;SACX,CAAC;QAEF,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAO,EAAE,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,CAAE,EAAE,IAAI,MAAA,EAAE,CAAC,CAAC;IACrE,CAAC;IACD,sBAAM,GAAN,UAAO,EAMM;YALD,OAAO,YAAA,EACf,KAAK,WAAA,EACW,gBAAgB,oBAAA,EACvB,QAAQ,aAAA,EACjB,OAAO,aAAA;QAEP,IAAM,MAAM,GAAG;YACX,IAAI,EAAE,MAAM;YACZ,OAAO,SAAA;YACP,KAAK,OAAA;YACL,gBAAgB,kBAAA;YAChB,QAAQ,UAAA;YACR,OAAO,SAAA;SACV,CAAC;QAEF,OAAO,OAAO;YACV,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAgC;gBAC3C,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,CAAE;gBACvB,MAAM,QAAA;aACT,CAAC;YACJ,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAqB;gBAChC,GAAG,EAAE,WAAI,IAAI,CAAC,OAAO,CAAE;gBACvB,MAAM,QAAA;aACT,CAAC,CAAC;IACb,CAAC;IACL,YAAC;AAAD,CAAC,AAnDD,IAmDC"}
@@ -0,0 +1,23 @@
1
+ import { ArticleObject, Locales } from '../index';
2
+ export declare type CollectionObject = {
3
+ type: 'collection';
4
+ name: string;
5
+ icon: string;
6
+ order: number;
7
+ } & Pick<ArticleObject, 'id' | 'workspace_id' | 'description' | 'created_at' | 'updated_at' | 'url' | 'default_locale' | 'translated_content'>;
8
+ export declare type SectionObject = {
9
+ type: 'section';
10
+ parent_id: number;
11
+ } & Omit<CollectionObject, 'type'>;
12
+ export declare type GroupTranslatedContentObject = {
13
+ type: 'group_translated_content';
14
+ } & Partial<HelpCenterLocalesMapping>;
15
+ export declare type HelpCenterLocalesMapping = {
16
+ [key in Locales]: GroupContentObject;
17
+ };
18
+ export declare type GroupContentObject = {
19
+ name: string;
20
+ description: string;
21
+ type?: 'group_content';
22
+ };
23
+ //# sourceMappingURL=helpCenter.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpCenter.types.d.ts","sourceRoot":"","sources":["../../../lib/helpCenter/helpCenter.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAElD,oBAAY,gBAAgB,GAAG;IAC3B,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACjB,GAAG,IAAI,CACJ,aAAa,EACX,IAAI,GACJ,cAAc,GACd,aAAa,GACb,YAAY,GACZ,YAAY,GACZ,KAAK,GACL,gBAAgB,GAChB,oBAAoB,CACzB,CAAC;AAEF,oBAAY,aAAa,GAAG;IACxB,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACrB,GAAG,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AAEnC,oBAAY,4BAA4B,GAAG;IACvC,IAAI,EAAE,0BAA0B,CAAC;CACpC,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAEtC,oBAAY,wBAAwB,GAAG;KAClC,GAAG,IAAI,OAAO,GAAG,kBAAkB;CACvC,CAAC;AAEF,oBAAY,kBAAkB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,eAAe,CAAC;CAC1B,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=helpCenter.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpCenter.types.js","sourceRoot":"","sources":["../../../lib/helpCenter/helpCenter.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,58 @@
1
+ import { Client } from '.';
2
+ import { GenericDeletedResponse, OperationById, Paginated } from './common/common.types';
3
+ import { CollectionObject, GroupTranslatedContentObject, SectionObject } from './helpCenter/helpCenter.types';
4
+ export default class HelpCenter {
5
+ readonly collections: Collection;
6
+ readonly sections: Section;
7
+ constructor(client: Client);
8
+ }
9
+ declare class Collection {
10
+ private readonly client;
11
+ readonly baseUrl = "help_center/collections";
12
+ constructor(client: Client);
13
+ create({ name, description, translatedContent }: CreateCollectionData): Promise<CollectionObject>;
14
+ find({ id }: CollectionFindByIdData): Promise<CollectionObject>;
15
+ update({ id, name, description, translatedContent }: UpdateCollectionData): Promise<CollectionObject>;
16
+ delete({ id }: CollectionDeleteByIdData): Promise<CollectionDeleteByIdResponse>;
17
+ list({ page, perPage: per_page }: CollectionListData): Promise<CollectionListResponse>;
18
+ }
19
+ interface CreateCollectionData {
20
+ name: string;
21
+ description?: string;
22
+ translatedContent?: Omit<GroupTranslatedContentObject, 'type'>;
23
+ }
24
+ declare type CollectionFindByIdData = OperationById;
25
+ declare type UpdateCollectionData = Partial<CreateCollectionData> & OperationById;
26
+ declare type CollectionDeleteByIdData = OperationById;
27
+ declare type CollectionDeleteByIdResponse = GenericDeletedResponse<'collection'>;
28
+ declare type CollectionListData = {
29
+ page?: number;
30
+ perPage?: number;
31
+ };
32
+ declare type CollectionListResponse = Paginated<CollectionObject>;
33
+ declare class Section {
34
+ private readonly client;
35
+ readonly baseUrl = "help_center/sections";
36
+ constructor(client: Client);
37
+ create({ name, parentId, translatedContent }: CreateSectionData): Promise<SectionObject>;
38
+ find({ id }: SectionFindByIdData): Promise<SectionObject>;
39
+ update({ id, name, parentId, translatedContent }: UpdateSectionData): Promise<SectionObject>;
40
+ delete({ id }: SectionDeleteByIdData): Promise<SectionDeleteByIdResponse>;
41
+ list({ page, perPage: per_page }: SectionListData): Promise<SectionListResponse>;
42
+ }
43
+ interface CreateSectionData {
44
+ name: string;
45
+ parentId: string;
46
+ translatedContent?: Omit<GroupTranslatedContentObject, 'type'>;
47
+ }
48
+ declare type SectionFindByIdData = OperationById;
49
+ declare type UpdateSectionData = Partial<CreateSectionData> & OperationById;
50
+ declare type SectionDeleteByIdData = OperationById;
51
+ declare type SectionDeleteByIdResponse = GenericDeletedResponse<'section'>;
52
+ declare type SectionListData = {
53
+ page?: number;
54
+ perPage?: number;
55
+ };
56
+ declare type SectionListResponse = Paginated<SectionObject>;
57
+ export {};
58
+ //# sourceMappingURL=helpCenter.d.ts.map