@emilgroup/task-sdk-node 1.0.3 → 1.2.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.
Files changed (135) hide show
  1. package/.openapi-generator/FILES +49 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +84 -1
  5. package/api/assignees-api.ts +166 -0
  6. package/api/categories-api.ts +695 -0
  7. package/api/default-api.ts +128 -0
  8. package/api/hub-spot-api.ts +169 -0
  9. package/api/statuses-api.ts +667 -0
  10. package/api/tasks-api.ts +695 -0
  11. package/api.ts +41 -0
  12. package/base.ts +327 -0
  13. package/common.ts +199 -0
  14. package/configuration.ts +118 -0
  15. package/dist/api/assignees-api.d.ts +96 -0
  16. package/dist/api/assignees-api.js +228 -0
  17. package/dist/api/categories-api.d.ts +393 -0
  18. package/dist/api/categories-api.js +646 -0
  19. package/dist/api/default-api.d.ts +70 -0
  20. package/dist/api/default-api.js +204 -0
  21. package/dist/api/hub-spot-api.d.ts +97 -0
  22. package/dist/api/hub-spot-api.js +228 -0
  23. package/dist/api/statuses-api.d.ts +375 -0
  24. package/dist/api/statuses-api.js +634 -0
  25. package/dist/api/tasks-api.d.ts +393 -0
  26. package/dist/api/tasks-api.js +646 -0
  27. package/dist/api.d.ts +17 -0
  28. package/dist/api.js +35 -0
  29. package/dist/base.d.ts +88 -0
  30. package/dist/base.js +434 -0
  31. package/dist/common.d.ts +92 -0
  32. package/dist/common.js +277 -0
  33. package/dist/configuration.d.ts +96 -0
  34. package/dist/configuration.js +52 -0
  35. package/dist/index.d.ts +15 -0
  36. package/dist/index.js +36 -0
  37. package/dist/models/assignee-class.d.ts +24 -0
  38. package/dist/models/assignee-class.js +15 -0
  39. package/dist/models/category-class.d.ts +66 -0
  40. package/dist/models/category-class.js +15 -0
  41. package/dist/models/create-category-request-dto.d.ts +30 -0
  42. package/dist/models/create-category-request-dto.js +15 -0
  43. package/dist/models/create-category-response-class.d.ts +25 -0
  44. package/dist/models/create-category-response-class.js +15 -0
  45. package/dist/models/create-hub-spot-ticket-request-dto.d.ts +31 -0
  46. package/dist/models/create-hub-spot-ticket-request-dto.js +15 -0
  47. package/dist/models/create-hub-spot-ticket-response-class.d.ts +25 -0
  48. package/dist/models/create-hub-spot-ticket-response-class.js +15 -0
  49. package/dist/models/create-status-request-dto.d.ts +36 -0
  50. package/dist/models/create-status-request-dto.js +15 -0
  51. package/dist/models/create-status-response-class.d.ts +25 -0
  52. package/dist/models/create-status-response-class.js +15 -0
  53. package/dist/models/create-task-request-dto.d.ts +91 -0
  54. package/dist/models/create-task-request-dto.js +27 -0
  55. package/dist/models/create-task-response-class.d.ts +25 -0
  56. package/dist/models/create-task-response-class.js +15 -0
  57. package/dist/models/get-category-response-class.d.ts +25 -0
  58. package/dist/models/get-category-response-class.js +15 -0
  59. package/dist/models/get-status-response-class.d.ts +25 -0
  60. package/dist/models/get-status-response-class.js +15 -0
  61. package/dist/models/get-task-response-class.d.ts +25 -0
  62. package/dist/models/get-task-response-class.js +15 -0
  63. package/dist/models/hub-spot-ticket-class.d.ts +49 -0
  64. package/dist/models/hub-spot-ticket-class.js +15 -0
  65. package/dist/models/hub-spot-ticket-error-class.d.ts +30 -0
  66. package/dist/models/hub-spot-ticket-error-class.js +15 -0
  67. package/dist/models/hub-spot-ticket-name-value-dto.d.ts +30 -0
  68. package/dist/models/hub-spot-ticket-name-value-dto.js +15 -0
  69. package/dist/models/index.d.ts +30 -0
  70. package/dist/models/index.js +46 -0
  71. package/dist/models/inline-response200.d.ts +54 -0
  72. package/dist/models/inline-response200.js +15 -0
  73. package/dist/models/inline-response503.d.ts +54 -0
  74. package/dist/models/inline-response503.js +15 -0
  75. package/dist/models/list-assignees-response-class.d.ts +43 -0
  76. package/dist/models/list-assignees-response-class.js +15 -0
  77. package/dist/models/list-categories-response-class.d.ts +43 -0
  78. package/dist/models/list-categories-response-class.js +15 -0
  79. package/dist/models/list-statuses-response-class.d.ts +43 -0
  80. package/dist/models/list-statuses-response-class.js +15 -0
  81. package/dist/models/list-tasks-response-class.d.ts +43 -0
  82. package/dist/models/list-tasks-response-class.js +15 -0
  83. package/dist/models/patch-category-request-dto.d.ts +36 -0
  84. package/dist/models/patch-category-request-dto.js +15 -0
  85. package/dist/models/patch-category-response-class.d.ts +25 -0
  86. package/dist/models/patch-category-response-class.js +15 -0
  87. package/dist/models/patch-status-request-dto.d.ts +42 -0
  88. package/dist/models/patch-status-request-dto.js +15 -0
  89. package/dist/models/patch-status-response-class.d.ts +25 -0
  90. package/dist/models/patch-status-response-class.js +15 -0
  91. package/dist/models/patch-task-request-dto.d.ts +139 -0
  92. package/dist/models/patch-task-request-dto.js +22 -0
  93. package/dist/models/patch-task-response-class.d.ts +25 -0
  94. package/dist/models/patch-task-response-class.js +15 -0
  95. package/dist/models/status-class.d.ts +72 -0
  96. package/dist/models/status-class.js +15 -0
  97. package/dist/models/task-class.d.ts +146 -0
  98. package/dist/models/task-class.js +21 -0
  99. package/git_push.sh +57 -0
  100. package/index.ts +19 -0
  101. package/models/assignee-class.ts +30 -0
  102. package/models/category-class.ts +72 -0
  103. package/models/create-category-request-dto.ts +36 -0
  104. package/models/create-category-response-class.ts +31 -0
  105. package/models/create-hub-spot-ticket-request-dto.ts +37 -0
  106. package/models/create-hub-spot-ticket-response-class.ts +31 -0
  107. package/models/create-status-request-dto.ts +42 -0
  108. package/models/create-status-response-class.ts +31 -0
  109. package/models/create-task-request-dto.ts +101 -0
  110. package/models/create-task-response-class.ts +31 -0
  111. package/models/get-category-response-class.ts +31 -0
  112. package/models/get-status-response-class.ts +31 -0
  113. package/models/get-task-response-class.ts +31 -0
  114. package/models/hub-spot-ticket-class.ts +55 -0
  115. package/models/hub-spot-ticket-error-class.ts +36 -0
  116. package/models/hub-spot-ticket-name-value-dto.ts +36 -0
  117. package/models/index.ts +30 -0
  118. package/models/inline-response200.ts +48 -0
  119. package/models/inline-response503.ts +48 -0
  120. package/models/list-assignees-response-class.ts +49 -0
  121. package/models/list-categories-response-class.ts +49 -0
  122. package/models/list-statuses-response-class.ts +49 -0
  123. package/models/list-tasks-response-class.ts +49 -0
  124. package/models/patch-category-request-dto.ts +42 -0
  125. package/models/patch-category-response-class.ts +31 -0
  126. package/models/patch-status-request-dto.ts +48 -0
  127. package/models/patch-status-response-class.ts +31 -0
  128. package/models/patch-task-request-dto.ts +148 -0
  129. package/models/patch-task-response-class.ts +31 -0
  130. package/models/status-class.ts +78 -0
  131. package/models/task-class.ts +155 -0
  132. package/package.json +24 -8
  133. package/tsconfig.json +23 -0
  134. package/index.js +0 -99
  135. package/scripts/deploy.js +0 -81
@@ -0,0 +1,49 @@
1
+ .gitignore
2
+ .npmignore
3
+ .openapi-generator-ignore
4
+ README.md
5
+ api.ts
6
+ api/assignees-api.ts
7
+ api/categories-api.ts
8
+ api/default-api.ts
9
+ api/hub-spot-api.ts
10
+ api/statuses-api.ts
11
+ api/tasks-api.ts
12
+ base.ts
13
+ common.ts
14
+ configuration.ts
15
+ git_push.sh
16
+ index.ts
17
+ models/assignee-class.ts
18
+ models/category-class.ts
19
+ models/create-category-request-dto.ts
20
+ models/create-category-response-class.ts
21
+ models/create-hub-spot-ticket-request-dto.ts
22
+ models/create-hub-spot-ticket-response-class.ts
23
+ models/create-status-request-dto.ts
24
+ models/create-status-response-class.ts
25
+ models/create-task-request-dto.ts
26
+ models/create-task-response-class.ts
27
+ models/get-category-response-class.ts
28
+ models/get-status-response-class.ts
29
+ models/get-task-response-class.ts
30
+ models/hub-spot-ticket-class.ts
31
+ models/hub-spot-ticket-error-class.ts
32
+ models/hub-spot-ticket-name-value-dto.ts
33
+ models/index.ts
34
+ models/inline-response200.ts
35
+ models/inline-response503.ts
36
+ models/list-assignees-response-class.ts
37
+ models/list-categories-response-class.ts
38
+ models/list-statuses-response-class.ts
39
+ models/list-tasks-response-class.ts
40
+ models/patch-category-request-dto.ts
41
+ models/patch-category-response-class.ts
42
+ models/patch-status-request-dto.ts
43
+ models/patch-status-response-class.ts
44
+ models/patch-task-request-dto.ts
45
+ models/patch-task-response-class.ts
46
+ models/status-class.ts
47
+ models/task-class.ts
48
+ package.json
49
+ tsconfig.json
@@ -0,0 +1 @@
1
+ 5.4.0
@@ -0,0 +1,23 @@
1
+ # OpenAPI Generator Ignore
2
+ # Generated by openapi-generator https://github.com/openapitools/openapi-generator
3
+
4
+ # Use this file to prevent files from being overwritten by the generator.
5
+ # The patterns follow closely to .gitignore or .dockerignore.
6
+
7
+ # As an example, the C# client generator defines ApiClient.cs.
8
+ # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9
+ #ApiClient.cs
10
+
11
+ # You can match any string of characters against a directory, file or extension with a single asterisk (*):
12
+ #foo/*/qux
13
+ # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14
+
15
+ # You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16
+ #foo/**/qux
17
+ # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18
+
19
+ # You can also negate patterns with an exclamation (!).
20
+ # For example, you can ignore all files in a docs folder with the file extension .md:
21
+ #docs/*.md
22
+ # Then explicitly reverse the ignore rule for a single file:
23
+ #!docs/README.md
package/README.md CHANGED
@@ -1 +1,84 @@
1
- # npm-kit
1
+ # Emil Task SDK for Nodejs
2
+
3
+ This TypeScript/JavaScript client utilizes [axios](https://github.com/axios/axios). The generated Node module can be used with Nodejs based applications.
4
+
5
+ Language level
6
+ * ES5 - you must have a Promises/A+ library installed
7
+ * ES6
8
+
9
+ Module system
10
+ * CommonJS
11
+ * ES6 module system
12
+
13
+ Although this package can be used in both TypeScript and JavaScript, it is intended to be used with TypeScript. The definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html)). For more information, you can go to [Emil Api documentation](https://emil.stoplight.io/docs/emil-api/).
14
+
15
+ ## Consuming
16
+
17
+ Navigate to the folder of your consuming project and run one of the following commands:
18
+
19
+ ```
20
+ npm install @emilgroup/task-sdk-node@1.2.0 --save
21
+ ```
22
+ or
23
+ ```
24
+ yarn add @emilgroup/task-sdk-node@1.2.0
25
+ ```
26
+
27
+ And then you can import `TasksApi`.
28
+
29
+ ```ts
30
+ import { TasksApi } from '@emilgroup/task-sdk-node'
31
+
32
+ const tasksApi = new TasksApi();
33
+ ```
34
+ ## Credentials
35
+
36
+ To use authentication protected endpoints, you have to first authorize. To do so, the easiest way is to provide a configuration file under `~/.emil/credentials` with the following content:
37
+
38
+ ```shell
39
+ emil_username=XXXXX@XXXX.XXX
40
+ emil_password=XXXXXXXXXXXXXX
41
+ ```
42
+
43
+ It is also possible to provide environment variables instead:
44
+
45
+ ```shell
46
+ export EMIL_USERNAME=XXXXX@XXXX.XXX
47
+ export EMIL_PASSWORD=XXXXXXXXXXXXXX
48
+ ```
49
+
50
+ ## Base path
51
+
52
+ To select the basic path for using the API, we can use two approaches. The first is to use one of the predefined environments, and the second is to specify the domain as a string.
53
+
54
+ ```ts
55
+ import { TasksApi, Environment } from '@emilgroup/task-sdk-node'
56
+
57
+ const tasksApi = new TasksApi();
58
+
59
+ // Allows you to simply choose environment. It will usually be Environment.Production.
60
+ tasksApi.selectEnvironment(Environment.Production);
61
+
62
+ // For advanced users, use the custom baseUrl of the website you need to connect to.
63
+ tasksApi.selectBasePath('https://my-custom-domain.com');
64
+ ```
65
+
66
+ ## Example
67
+
68
+ Here is a basic functionning example:
69
+
70
+ ```ts
71
+ async function listTasks(): Promise<Void> {
72
+ try {
73
+ const tasksApi = new TasksApi();
74
+
75
+ await tasksApi.initialize(); // should be called only once per Api.
76
+
77
+ const { data: { items } } = await tasksApi.listTasks();
78
+
79
+ console.log(items);
80
+ } catch(error) {
81
+ // process error
82
+ }
83
+ }
84
+ ```
@@ -0,0 +1,166 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * EMIL TaskService
5
+ * The EMIL Task API description
6
+ *
7
+ * The version of the OpenAPI document: 1.0
8
+ * Contact: kontakt@emil.de
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
17
+ import { Configuration } from '../configuration';
18
+ // Some imports not used depending on template conditions
19
+ // @ts-ignore
20
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
21
+ // @ts-ignore
22
+ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
23
+ // @ts-ignore
24
+ import { ListAssigneesResponseClass } from '../models';
25
+ // URLSearchParams not necessarily used
26
+ // @ts-ignore
27
+ import { URL, URLSearchParams } from 'url';
28
+ const FormData = require('form-data');
29
+ /**
30
+ * AssigneesApi - axios parameter creator
31
+ * @export
32
+ */
33
+ export const AssigneesApiAxiosParamCreator = function (configuration?: Configuration) {
34
+ return {
35
+ /**
36
+ * Retrieves a list of distinct assignees from tasks. **Required Permissions** \"task-management.tasks.view\"
37
+ * @summary List assignees
38
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
39
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt;
40
+ * @param {*} [options] Override http request option.
41
+ * @throws {RequiredError}
42
+ */
43
+ listAssignees: async (authorization?: string, expand?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
44
+ const localVarPath = `/taskservice/v1/assignees`;
45
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
46
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
47
+ let baseOptions;
48
+ let baseAccessToken;
49
+ if (configuration) {
50
+ baseOptions = configuration.baseOptions;
51
+ baseAccessToken = configuration.accessToken;
52
+ }
53
+
54
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
55
+ const localVarHeaderParameter = {} as any;
56
+ const localVarQueryParameter = {} as any;
57
+
58
+ // authentication bearer required
59
+ // http bearer authentication required
60
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
61
+
62
+ if (expand !== undefined) {
63
+ localVarQueryParameter['expand'] = expand;
64
+ }
65
+
66
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
67
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
68
+ }
69
+
70
+
71
+
72
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
73
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
74
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
75
+
76
+ return {
77
+ url: toPathString(localVarUrlObj),
78
+ options: localVarRequestOptions,
79
+ };
80
+ },
81
+ }
82
+ };
83
+
84
+ /**
85
+ * AssigneesApi - functional programming interface
86
+ * @export
87
+ */
88
+ export const AssigneesApiFp = function(configuration?: Configuration) {
89
+ const localVarAxiosParamCreator = AssigneesApiAxiosParamCreator(configuration)
90
+ return {
91
+ /**
92
+ * Retrieves a list of distinct assignees from tasks. **Required Permissions** \"task-management.tasks.view\"
93
+ * @summary List assignees
94
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
95
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt;
96
+ * @param {*} [options] Override http request option.
97
+ * @throws {RequiredError}
98
+ */
99
+ async listAssignees(authorization?: string, expand?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListAssigneesResponseClass>> {
100
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listAssignees(authorization, expand, options);
101
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
102
+ },
103
+ }
104
+ };
105
+
106
+ /**
107
+ * AssigneesApi - factory interface
108
+ * @export
109
+ */
110
+ export const AssigneesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
111
+ const localVarFp = AssigneesApiFp(configuration)
112
+ return {
113
+ /**
114
+ * Retrieves a list of distinct assignees from tasks. **Required Permissions** \"task-management.tasks.view\"
115
+ * @summary List assignees
116
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
117
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt;
118
+ * @param {*} [options] Override http request option.
119
+ * @throws {RequiredError}
120
+ */
121
+ listAssignees(authorization?: string, expand?: string, options?: any): AxiosPromise<ListAssigneesResponseClass> {
122
+ return localVarFp.listAssignees(authorization, expand, options).then((request) => request(axios, basePath));
123
+ },
124
+ };
125
+ };
126
+
127
+ /**
128
+ * Request parameters for listAssignees operation in AssigneesApi.
129
+ * @export
130
+ * @interface AssigneesApiListAssigneesRequest
131
+ */
132
+ export interface AssigneesApiListAssigneesRequest {
133
+ /**
134
+ * Bearer Token: provided by the login endpoint under the name accessToken.
135
+ * @type {string}
136
+ * @memberof AssigneesApiListAssignees
137
+ */
138
+ readonly authorization?: string
139
+
140
+ /**
141
+ * Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt;
142
+ * @type {string}
143
+ * @memberof AssigneesApiListAssignees
144
+ */
145
+ readonly expand?: string
146
+ }
147
+
148
+ /**
149
+ * AssigneesApi - object-oriented interface
150
+ * @export
151
+ * @class AssigneesApi
152
+ * @extends {BaseAPI}
153
+ */
154
+ export class AssigneesApi extends BaseAPI {
155
+ /**
156
+ * Retrieves a list of distinct assignees from tasks. **Required Permissions** \"task-management.tasks.view\"
157
+ * @summary List assignees
158
+ * @param {AssigneesApiListAssigneesRequest} requestParameters Request parameters.
159
+ * @param {*} [options] Override http request option.
160
+ * @throws {RequiredError}
161
+ * @memberof AssigneesApi
162
+ */
163
+ public listAssignees(requestParameters: AssigneesApiListAssigneesRequest = {}, options?: AxiosRequestConfig) {
164
+ return AssigneesApiFp(this.configuration).listAssignees(requestParameters.authorization, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
165
+ }
166
+ }