crisp-api 9.13.0 → 10.0.3

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 (116) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +2 -2
  3. package/dist/crisp.d.ts +179 -0
  4. package/dist/crisp.js +773 -0
  5. package/dist/resources/BaseResource.d.ts +21 -0
  6. package/dist/resources/BaseResource.js +26 -0
  7. package/dist/resources/BucketURL.d.ts +37 -0
  8. package/dist/resources/BucketURL.js +35 -0
  9. package/dist/resources/MediaAnimation.d.ts +20 -0
  10. package/dist/resources/MediaAnimation.js +40 -0
  11. package/dist/resources/PluginConnect.d.ts +59 -0
  12. package/dist/resources/PluginConnect.js +79 -0
  13. package/dist/resources/PluginSubscription.d.ts +112 -0
  14. package/dist/resources/PluginSubscription.js +130 -0
  15. package/dist/resources/WebsiteAnalytics.d.ts +20 -0
  16. package/dist/resources/WebsiteAnalytics.js +37 -0
  17. package/dist/resources/WebsiteAvailability.d.ts +40 -0
  18. package/dist/resources/WebsiteAvailability.js +46 -0
  19. package/dist/resources/WebsiteBase.d.ts +69 -0
  20. package/dist/resources/WebsiteBase.js +77 -0
  21. package/dist/resources/WebsiteBatch.d.ts +61 -0
  22. package/dist/resources/WebsiteBatch.js +76 -0
  23. package/dist/resources/WebsiteCampaign.d.ts +208 -0
  24. package/dist/resources/WebsiteCampaign.js +201 -0
  25. package/dist/resources/WebsiteConversation.d.ts +710 -0
  26. package/dist/resources/WebsiteConversation.js +607 -0
  27. package/dist/resources/WebsiteHelpdesk.d.ts +356 -0
  28. package/dist/resources/WebsiteHelpdesk.js +593 -0
  29. package/dist/resources/WebsiteOperator.d.ts +88 -0
  30. package/dist/resources/WebsiteOperator.js +99 -0
  31. package/dist/resources/WebsitePeople.d.ts +257 -0
  32. package/dist/resources/WebsitePeople.js +282 -0
  33. package/dist/resources/WebsiteSettings.d.ts +168 -0
  34. package/dist/resources/WebsiteSettings.js +42 -0
  35. package/dist/resources/WebsiteVerify.d.ts +47 -0
  36. package/dist/resources/WebsiteVerify.js +56 -0
  37. package/dist/resources/WebsiteVisitors.d.ts +122 -0
  38. package/dist/resources/WebsiteVisitors.js +98 -0
  39. package/dist/resources/index.d.ts +20 -0
  40. package/dist/resources/index.js +42 -0
  41. package/dist/services/bucket.d.ts +19 -0
  42. package/dist/services/bucket.js +31 -0
  43. package/dist/services/media.d.ts +19 -0
  44. package/dist/services/media.js +31 -0
  45. package/dist/services/plugin.d.ts +20 -0
  46. package/dist/services/plugin.js +33 -0
  47. package/dist/services/website.d.ts +30 -0
  48. package/dist/services/website.js +53 -0
  49. package/eslint.config.mjs +208 -0
  50. package/lib/crisp.ts +1006 -0
  51. package/lib/resources/BaseResource.ts +37 -0
  52. package/lib/resources/BucketURL.ts +58 -0
  53. package/lib/resources/MediaAnimation.ts +44 -0
  54. package/lib/resources/PluginConnect.ts +135 -0
  55. package/lib/resources/PluginSubscription.ts +236 -0
  56. package/lib/resources/WebsiteAnalytics.ts +41 -0
  57. package/lib/resources/WebsiteAvailability.ts +74 -0
  58. package/lib/resources/WebsiteBase.ts +119 -0
  59. package/lib/resources/WebsiteBatch.ts +116 -0
  60. package/lib/resources/WebsiteCampaign.ts +432 -0
  61. package/lib/resources/WebsiteConversation.ts +1507 -0
  62. package/lib/resources/WebsiteHelpdesk.ts +1024 -0
  63. package/lib/resources/WebsiteOperator.ts +183 -0
  64. package/lib/resources/WebsitePeople.ts +568 -0
  65. package/lib/resources/WebsiteSettings.ts +207 -0
  66. package/lib/resources/WebsiteVerify.ts +90 -0
  67. package/lib/resources/WebsiteVisitors.ts +219 -0
  68. package/lib/resources/index.ts +28 -0
  69. package/lib/services/bucket.ts +36 -0
  70. package/lib/services/media.ts +36 -0
  71. package/lib/services/plugin.ts +40 -0
  72. package/lib/services/website.ts +70 -0
  73. package/package.json +16 -11
  74. package/tsconfig.json +12 -5
  75. package/lib/crisp.js +0 -1171
  76. package/lib/resources/BucketURL.js +0 -34
  77. package/lib/resources/MediaAnimation.js +0 -41
  78. package/lib/resources/PluginConnect.js +0 -119
  79. package/lib/resources/PluginSubscription.js +0 -234
  80. package/lib/resources/WebsiteAnalytics.js +0 -37
  81. package/lib/resources/WebsiteAvailability.js +0 -48
  82. package/lib/resources/WebsiteBase.js +0 -100
  83. package/lib/resources/WebsiteBatch.js +0 -92
  84. package/lib/resources/WebsiteCampaign.js +0 -396
  85. package/lib/resources/WebsiteConversation.js +0 -1261
  86. package/lib/resources/WebsiteHelpdesk.js +0 -1198
  87. package/lib/resources/WebsiteOperator.js +0 -167
  88. package/lib/resources/WebsitePeople.js +0 -516
  89. package/lib/resources/WebsiteSettings.js +0 -50
  90. package/lib/resources/WebsiteVerify.js +0 -79
  91. package/lib/resources/WebsiteVisitors.js +0 -148
  92. package/lib/services/Bucket.js +0 -28
  93. package/lib/services/Media.js +0 -28
  94. package/lib/services/Plugin.js +0 -29
  95. package/lib/services/Website.js +0 -39
  96. package/types/crisp.d.ts +0 -151
  97. package/types/resources/BucketURL.d.ts +0 -15
  98. package/types/resources/MediaAnimation.d.ts +0 -15
  99. package/types/resources/PluginConnect.d.ts +0 -15
  100. package/types/resources/PluginSubscription.d.ts +0 -15
  101. package/types/resources/WebsiteAnalytics.d.ts +0 -15
  102. package/types/resources/WebsiteAvailability.d.ts +0 -15
  103. package/types/resources/WebsiteBase.d.ts +0 -15
  104. package/types/resources/WebsiteBatch.d.ts +0 -15
  105. package/types/resources/WebsiteCampaign.d.ts +0 -15
  106. package/types/resources/WebsiteConversation.d.ts +0 -15
  107. package/types/resources/WebsiteHelpdesk.d.ts +0 -15
  108. package/types/resources/WebsiteOperator.d.ts +0 -15
  109. package/types/resources/WebsitePeople.d.ts +0 -15
  110. package/types/resources/WebsiteSettings.d.ts +0 -15
  111. package/types/resources/WebsiteVerify.d.ts +0 -15
  112. package/types/resources/WebsiteVisitors.d.ts +0 -15
  113. package/types/services/Bucket.d.ts +0 -14
  114. package/types/services/Media.d.ts +0 -14
  115. package/types/services/Plugin.d.ts +0 -14
  116. package/types/services/Website.d.ts +0 -14
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ /*
3
+ * node-crisp-api
4
+ *
5
+ * Copyright 2022, Crisp IM SAS
6
+ * Author: Baptiste Jamin <baptiste@crisp.chat>
7
+ */
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ /**************************************************************************
13
+ * IMPORTS
14
+ ***************************************************************************/
15
+ // PROJECT: RESOURCES
16
+ const MediaAnimation_1 = __importDefault(require("../resources/MediaAnimation"));
17
+ /**************************************************************************
18
+ * CLASSES
19
+ ***************************************************************************/
20
+ /**
21
+ * Crisp Media Service
22
+ */
23
+ class MediaService {
24
+ constructor() {
25
+ /* eslint-disable @typescript-eslint/no-explicit-any */
26
+ this.__resources = [
27
+ MediaAnimation_1.default
28
+ ];
29
+ }
30
+ }
31
+ exports.default = MediaService;
@@ -0,0 +1,20 @@
1
+ /**************************************************************************
2
+ * IMPORTS
3
+ ***************************************************************************/
4
+ import PluginConnect from "../resources/PluginConnect";
5
+ import PluginSubscription from "../resources/PluginSubscription";
6
+ /**************************************************************************
7
+ * CLASSES
8
+ ***************************************************************************/
9
+ /**
10
+ * Crisp Plugin Service
11
+ */
12
+ declare class PluginService {
13
+ __resources: any[];
14
+ }
15
+ /**************************************************************************
16
+ * EXPORTS
17
+ ***************************************************************************/
18
+ export interface PluginServiceInterface extends PluginConnect, PluginSubscription {
19
+ }
20
+ export default PluginService;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ /*
3
+ * node-crisp-api
4
+ *
5
+ * Copyright 2022, Crisp IM SAS
6
+ * Author: Baptiste Jamin <baptiste@crisp.chat>
7
+ */
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ /**************************************************************************
13
+ * IMPORTS
14
+ ***************************************************************************/
15
+ // PROJECT: RESOURCES
16
+ const PluginConnect_1 = __importDefault(require("../resources/PluginConnect"));
17
+ const PluginSubscription_1 = __importDefault(require("../resources/PluginSubscription"));
18
+ /**************************************************************************
19
+ * CLASSES
20
+ ***************************************************************************/
21
+ /**
22
+ * Crisp Plugin Service
23
+ */
24
+ class PluginService {
25
+ constructor() {
26
+ /* eslint-disable @typescript-eslint/no-explicit-any */
27
+ this.__resources = [
28
+ PluginConnect_1.default,
29
+ PluginSubscription_1.default
30
+ ];
31
+ }
32
+ }
33
+ exports.default = PluginService;
@@ -0,0 +1,30 @@
1
+ /**************************************************************************
2
+ * IMPORTS
3
+ ***************************************************************************/
4
+ import WebsiteBase from "../resources/WebsiteBase";
5
+ import WebsiteAnalytics from "../resources/WebsiteAnalytics";
6
+ import WebsiteAvailability from "../resources/WebsiteAvailability";
7
+ import WebsiteBatch from "../resources/WebsiteBatch";
8
+ import WebsiteCampaign from "../resources/WebsiteCampaign";
9
+ import WebsiteConversation from "../resources/WebsiteConversation";
10
+ import WebsiteOperator from "../resources/WebsiteOperator";
11
+ import WebsitePeople from "../resources/WebsitePeople";
12
+ import WebsiteHelpdesk from "../resources/WebsiteHelpdesk";
13
+ import WebsiteSettings from "../resources/WebsiteSettings";
14
+ import WebsiteVerify from "../resources/WebsiteVerify";
15
+ import WebsiteVisitors from "../resources/WebsiteVisitors";
16
+ /**************************************************************************
17
+ * CLASSES
18
+ ***************************************************************************/
19
+ /**
20
+ * Website Service
21
+ */
22
+ declare class WebsiteService {
23
+ __resources: any[];
24
+ }
25
+ /**************************************************************************
26
+ * EXPORTS
27
+ ***************************************************************************/
28
+ export interface WebsiteServiceInterface extends WebsiteBase, WebsiteAnalytics, WebsiteAvailability, WebsiteBatch, WebsiteCampaign, WebsiteConversation, WebsiteOperator, WebsitePeople, WebsiteHelpdesk, WebsiteSettings, WebsiteVerify, WebsiteVisitors {
29
+ }
30
+ export default WebsiteService;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ /*
3
+ * node-crisp-api
4
+ *
5
+ * Copyright 2022, Crisp IM SAS
6
+ * Author: Baptiste Jamin <baptiste@crisp.chat>
7
+ */
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ /**************************************************************************
13
+ * IMPORTS
14
+ ***************************************************************************/
15
+ // PROJECT: RESOURCES
16
+ const WebsiteBase_1 = __importDefault(require("../resources/WebsiteBase"));
17
+ const WebsiteAnalytics_1 = __importDefault(require("../resources/WebsiteAnalytics"));
18
+ const WebsiteAvailability_1 = __importDefault(require("../resources/WebsiteAvailability"));
19
+ const WebsiteBatch_1 = __importDefault(require("../resources/WebsiteBatch"));
20
+ const WebsiteCampaign_1 = __importDefault(require("../resources/WebsiteCampaign"));
21
+ const WebsiteConversation_1 = __importDefault(require("../resources/WebsiteConversation"));
22
+ const WebsiteOperator_1 = __importDefault(require("../resources/WebsiteOperator"));
23
+ const WebsitePeople_1 = __importDefault(require("../resources/WebsitePeople"));
24
+ const WebsiteHelpdesk_1 = __importDefault(require("../resources/WebsiteHelpdesk"));
25
+ const WebsiteSettings_1 = __importDefault(require("../resources/WebsiteSettings"));
26
+ const WebsiteVerify_1 = __importDefault(require("../resources/WebsiteVerify"));
27
+ const WebsiteVisitors_1 = __importDefault(require("../resources/WebsiteVisitors"));
28
+ /**************************************************************************
29
+ * CLASSES
30
+ ***************************************************************************/
31
+ /**
32
+ * Website Service
33
+ */
34
+ class WebsiteService {
35
+ constructor() {
36
+ /* eslint-disable @typescript-eslint/no-explicit-any */
37
+ this.__resources = [
38
+ WebsiteBase_1.default,
39
+ WebsiteAnalytics_1.default,
40
+ WebsiteAvailability_1.default,
41
+ WebsiteBatch_1.default,
42
+ WebsiteCampaign_1.default,
43
+ WebsiteConversation_1.default,
44
+ WebsiteOperator_1.default,
45
+ WebsitePeople_1.default,
46
+ WebsiteHelpdesk_1.default,
47
+ WebsiteSettings_1.default,
48
+ WebsiteVerify_1.default,
49
+ WebsiteVisitors_1.default
50
+ ];
51
+ }
52
+ }
53
+ exports.default = WebsiteService;
@@ -0,0 +1,208 @@
1
+ /*
2
+ * This file is part of node-crisp-api
3
+ *
4
+ * Copyright (c) 2025 Crisp IM SAS
5
+ * All rights belong to Crisp IM SAS
6
+ */
7
+
8
+ /**************************************************************************
9
+ * IMPORTS
10
+ ***************************************************************************/
11
+
12
+ // NPM
13
+ import globals from "globals";
14
+ import { defineConfig, globalIgnores } from "eslint/config";
15
+ import crisp from "eslint-plugin-crisp";
16
+ import tseslint from "@typescript-eslint/eslint-plugin";
17
+ import tsparser from "@typescript-eslint/parser";
18
+ import jsdoc from "eslint-plugin-jsdoc";
19
+
20
+ /**************************************************************************
21
+ * CONFIGURATION
22
+ ***************************************************************************/
23
+
24
+ export default defineConfig([
25
+ // Additional TypeScript configuration
26
+ {
27
+ files: ["lib/*.ts", "lib/**/*.ts"],
28
+ languageOptions: {
29
+ parser: tsparser,
30
+ sourceType: "module",
31
+ ecmaVersion: 2020,
32
+
33
+ globals: {
34
+ ...globals.browser,
35
+ ...globals.node
36
+ }
37
+ },
38
+ plugins: {
39
+ crisp: crisp,
40
+ "@typescript-eslint": tseslint,
41
+ jsdoc: jsdoc
42
+ },
43
+ rules: {
44
+ "@typescript-eslint/no-explicit-any": "error",
45
+
46
+ // General JS rules
47
+ "arrow-parens": ["error", "always"],
48
+ "brace-style": [
49
+ "error",
50
+ "1tbs",
51
+ {
52
+ "allowSingleLine": true
53
+ }
54
+ ],
55
+ "comma-dangle": ["error", "never"],
56
+ "comma-spacing": ["error", { "before": false, "after": true }],
57
+ "comma-style": ["error", "last"],
58
+ "curly": "error",
59
+ "computed-property-spacing": ["error", "never"],
60
+ "default-param-last": "error",
61
+ "default-case-last": "error",
62
+ "dot-notation": "error",
63
+ "eqeqeq": "error",
64
+ "eol-last": "error",
65
+ "for-direction": "error",
66
+ "indent": [
67
+ "error",
68
+ 2,
69
+ {
70
+ "SwitchCase": 1,
71
+ "FunctionDeclaration": {
72
+ "parameters": "off"
73
+ },
74
+ "FunctionExpression": {
75
+ "parameters": "off"
76
+ },
77
+ "CallExpression": {
78
+ "arguments": "off"
79
+ },
80
+ "VariableDeclarator": 1,
81
+ "outerIIFEBody": 0,
82
+ "ArrayExpression": 1,
83
+ "ObjectExpression": 1,
84
+ "ImportDeclaration": 1,
85
+ "flatTernaryExpressions": false,
86
+ "offsetTernaryExpressions": true
87
+ }
88
+ ],
89
+ "key-spacing": ["error", { "beforeColon": false, "afterColon": true }],
90
+ "keyword-spacing": "error",
91
+ "linebreak-style": ["error", "unix"],
92
+ "newline-per-chained-call": "error",
93
+ "no-console": "warn",
94
+ "no-debugger": "warn",
95
+ "no-eval": "error",
96
+ "no-implicit-coercion": "error",
97
+ "no-multi-str": "error",
98
+ "no-multiple-empty-lines": ["error", { max: 1 }],
99
+ "no-mixed-spaces-and-tabs": "error",
100
+ "no-restricted-syntax": [
101
+ "error",
102
+ {
103
+ "selector": "SwitchCase > *.consequent[type!='BlockStatement']",
104
+ "message": "Switch cases without braces are disallowed."
105
+ }
106
+ ],
107
+ "no-tabs": "error",
108
+ "no-trailing-spaces": "error",
109
+ "no-undef": "error",
110
+ "no-unused-vars": "warn",
111
+ "no-unsafe-optional-chaining": "error",
112
+ "object-curly-newline": [
113
+ "error",
114
+ {
115
+ "multiline": true, "consistent": true
116
+ }
117
+ ],
118
+ "object-curly-spacing": ["error", "always"],
119
+ "padded-blocks": ["error", "never"],
120
+ "padding-line-between-statements": [
121
+ "error",
122
+ { "blankLine": "always", "prev": "let", "next": "*" },
123
+ { "blankLine": "any", "prev": "let", "next": "let" },
124
+ { "blankLine": "always", "prev": "const", "next": "*" },
125
+ { "blankLine": "any", "prev": "const", "next": "const" },
126
+ { "blankLine": "always", "prev": "block-like", "next": "*" },
127
+ { "blankLine": "always", "prev": "*", "next": "break" },
128
+ { "blankLine": "any", "prev": "empty", "next": "break" },
129
+ { "blankLine": "always", "prev": "*", "next": "block-like" },
130
+ { "blankLine": "any", "prev": "case", "next": "case" },
131
+ { "blankLine": "always", "prev": "continue", "next": "*" },
132
+ { "blankLine": "always", "prev": "break", "next": "*" }
133
+ ],
134
+ "prefer-arrow-callback": "error",
135
+ "quotes": [
136
+ "error",
137
+ "double",
138
+ {
139
+ "avoidEscape": true, "allowTemplateLiterals": true
140
+ }
141
+ ],
142
+ "quote-props": ["error", "as-needed"],
143
+ "semi": ["error", "always"],
144
+ "semi-style": ["error", "last"],
145
+ "semi-spacing": ["error", { "before": false, "after": true }],
146
+ "space-before-blocks": "error",
147
+ "space-in-parens": ["error", "never"],
148
+ "space-infix-ops": "error",
149
+
150
+ // Crisp JS rules
151
+ "crisp/align-comments": "error",
152
+ "crisp/enforce-optional": "error",
153
+ "crisp/header-check": "error",
154
+ "crisp/header-comments-check": "error",
155
+ "crisp/import-group-comment": "error",
156
+ "crisp/import-group-order": "error",
157
+ "crisp/methods-naming": "error",
158
+ "crisp/methods-ordering": "error",
159
+ "crisp/multiline-comment-end-backslash": "error",
160
+ "crisp/newline-after-switch-case": "error",
161
+ "crisp/no-async": "off",
162
+ "crisp/no-extra-line-within-function": "error",
163
+ "crisp/no-short-parameters": [
164
+ "error",
165
+ {
166
+ "exceptions": ["_", "$", "x", "y"]
167
+ }
168
+ ],
169
+ "crisp/no-snake-case": "error",
170
+ "crisp/no-useless-template-literals": "error",
171
+ "crisp/no-var-in-blocks": "error",
172
+ "crisp/one-space-after-operator": [
173
+ "error",
174
+ {
175
+ "checkColon": false
176
+ }
177
+ ],
178
+ "crisp/regex-in-constructor": "error",
179
+ "crisp/ternary-parenthesis": "error",
180
+
181
+ // General JSDoc rules
182
+ "jsdoc/require-description": "error",
183
+ "jsdoc/require-param-description": "off",
184
+ "jsdoc/require-property-description": "off",
185
+ "jsdoc/require-jsdoc": [
186
+ "error",
187
+ {
188
+ "require": {
189
+ "FunctionDeclaration": true,
190
+ "MethodDefinition": true,
191
+ "ClassDeclaration": true,
192
+ "ArrowFunctionExpression": false,
193
+ "FunctionExpression": false
194
+ },
195
+ "contexts": [
196
+ "Property[key.name=\"getters\"] > ObjectExpression > Property",
197
+ "Property[key.name=\"methods\"] > ObjectExpression > Property"
198
+ ]
199
+ }
200
+ ]
201
+ }
202
+ },
203
+
204
+ globalIgnores([
205
+ "dist/*",
206
+ "node_modules/*"
207
+ ])
208
+ ]);