@dvelop-sdk/task 2.0.11 → 3.0.2
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/lib/index.d.ts +33 -6
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +35 -18
- package/lib/index.js.map +1 -1
- package/lib/internal.d.ts +7 -0
- package/lib/internal.d.ts.map +1 -0
- package/lib/internal.js +19 -0
- package/lib/internal.js.map +1 -0
- package/lib/tasks/complete-task/complete-task.d.ts +27 -0
- package/lib/tasks/complete-task/complete-task.d.ts.map +1 -0
- package/lib/tasks/complete-task/complete-task.js +90 -0
- package/lib/tasks/complete-task/complete-task.js.map +1 -0
- package/lib/tasks/create-task/create-task.d.ts +103 -0
- package/lib/tasks/create-task/create-task.d.ts.map +1 -0
- package/lib/{create-task → tasks/create-task}/create-task.js +67 -65
- package/lib/tasks/create-task/create-task.js.map +1 -0
- package/lib/tasks/delete-task/delete-task.d.ts +27 -0
- package/lib/tasks/delete-task/delete-task.d.ts.map +1 -0
- package/lib/tasks/delete-task/delete-task.js +86 -0
- package/lib/tasks/delete-task/delete-task.js.map +1 -0
- package/lib/tasks/get-task-count/get-task-count.d.ts +17 -0
- package/lib/tasks/get-task-count/get-task-count.d.ts.map +1 -0
- package/lib/tasks/get-task-count/get-task-count.js +93 -0
- package/lib/tasks/get-task-count/get-task-count.js.map +1 -0
- package/lib/tasks/update-task/update-task.d.ts +104 -0
- package/lib/tasks/update-task/update-task.d.ts.map +1 -0
- package/lib/tasks/update-task/update-task.js +114 -0
- package/lib/tasks/update-task/update-task.js.map +1 -0
- package/lib/utils/http.d.ts +45 -0
- package/lib/utils/http.d.ts.map +1 -0
- package/lib/utils/http.js +151 -0
- package/lib/utils/http.js.map +1 -0
- package/package.json +3 -9
- package/LICENSE +0 -201
- package/lib/complete-task/complete-task.d.ts +0 -29
- package/lib/complete-task/complete-task.d.ts.map +0 -1
- package/lib/complete-task/complete-task.js +0 -122
- package/lib/complete-task/complete-task.js.map +0 -1
- package/lib/create-task/create-task.d.ts +0 -27
- package/lib/create-task/create-task.d.ts.map +0 -1
- package/lib/create-task/create-task.js.map +0 -1
- package/lib/delete-task/delete-task.d.ts +0 -29
- package/lib/delete-task/delete-task.d.ts.map +0 -1
- package/lib/delete-task/delete-task.js +0 -122
- package/lib/delete-task/delete-task.js.map +0 -1
- package/lib/errors.d.ts +0 -55
- package/lib/errors.d.ts.map +0 -1
- package/lib/errors.js +0 -119
- package/lib/errors.js.map +0 -1
- package/lib/task.d.ts +0 -150
- package/lib/task.d.ts.map +0 -1
- package/lib/task.js +0 -3
- package/lib/task.js.map +0 -1
- package/lib/update-task/update-task.d.ts +0 -28
- package/lib/update-task/update-task.d.ts.map +0 -1
- package/lib/update-task/update-task.js +0 -120
- package/lib/update-task/update-task.js.map +0 -1
package/lib/errors.js
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
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.TaskAlreadyCompletedError = exports.TaskNotFoundError = exports.NoTaskLocationError = exports.UnauthorizedError = exports.UnauthenticatedError = exports.InvalidTaskError = void 0;
|
|
19
|
-
/**
|
|
20
|
-
* A given task was invalid. See ```validation```-propery.
|
|
21
|
-
* @category Error
|
|
22
|
-
*/
|
|
23
|
-
var InvalidTaskError = /** @class */ (function (_super) {
|
|
24
|
-
__extends(InvalidTaskError, _super);
|
|
25
|
-
// eslint-disable-next-line no-unused-vars
|
|
26
|
-
function InvalidTaskError(context, task, validation, response) {
|
|
27
|
-
var _this = _super.call(this, context + ": Task was invalid. Validation: " + JSON.stringify(validation) + " ") || this;
|
|
28
|
-
_this.task = task;
|
|
29
|
-
_this.validation = validation;
|
|
30
|
-
_this.response = response;
|
|
31
|
-
Object.setPrototypeOf(_this, InvalidTaskError.prototype);
|
|
32
|
-
return _this;
|
|
33
|
-
}
|
|
34
|
-
return InvalidTaskError;
|
|
35
|
-
}(Error));
|
|
36
|
-
exports.InvalidTaskError = InvalidTaskError;
|
|
37
|
-
/**
|
|
38
|
-
* An authSessionId was invalid or expired.
|
|
39
|
-
* @category Error
|
|
40
|
-
*/
|
|
41
|
-
var UnauthenticatedError = /** @class */ (function (_super) {
|
|
42
|
-
__extends(UnauthenticatedError, _super);
|
|
43
|
-
// eslint-disable-next-line no-unused-vars
|
|
44
|
-
function UnauthenticatedError(context, response) {
|
|
45
|
-
var _this = _super.call(this, context + ": Unauthenticated User.") || this;
|
|
46
|
-
_this.response = response;
|
|
47
|
-
Object.setPrototypeOf(_this, UnauthenticatedError.prototype);
|
|
48
|
-
return _this;
|
|
49
|
-
}
|
|
50
|
-
return UnauthenticatedError;
|
|
51
|
-
}(Error));
|
|
52
|
-
exports.UnauthenticatedError = UnauthenticatedError;
|
|
53
|
-
/**
|
|
54
|
-
* AuthSessionId is associated with a user who is not eligible.
|
|
55
|
-
* @category Error
|
|
56
|
-
*/
|
|
57
|
-
var UnauthorizedError = /** @class */ (function (_super) {
|
|
58
|
-
__extends(UnauthorizedError, _super);
|
|
59
|
-
// eslint-disable-next-line no-unused-vars
|
|
60
|
-
function UnauthorizedError(context, response) {
|
|
61
|
-
var _this = _super.call(this, context + ": User is not eligible.") || this;
|
|
62
|
-
_this.response = response;
|
|
63
|
-
Object.setPrototypeOf(_this, UnauthorizedError.prototype);
|
|
64
|
-
return _this;
|
|
65
|
-
}
|
|
66
|
-
return UnauthorizedError;
|
|
67
|
-
}(Error));
|
|
68
|
-
exports.UnauthorizedError = UnauthorizedError;
|
|
69
|
-
/**
|
|
70
|
-
* No location was given.
|
|
71
|
-
* @category Error
|
|
72
|
-
*/
|
|
73
|
-
var NoTaskLocationError = /** @class */ (function (_super) {
|
|
74
|
-
__extends(NoTaskLocationError, _super);
|
|
75
|
-
// eslint-disable-next-line no-unused-vars
|
|
76
|
-
function NoTaskLocationError(context, task) {
|
|
77
|
-
var _this = _super.call(this, context + ": No location given for task.") || this;
|
|
78
|
-
_this.task = task;
|
|
79
|
-
Object.setPrototypeOf(_this, NoTaskLocationError.prototype);
|
|
80
|
-
return _this;
|
|
81
|
-
}
|
|
82
|
-
return NoTaskLocationError;
|
|
83
|
-
}(Error));
|
|
84
|
-
exports.NoTaskLocationError = NoTaskLocationError;
|
|
85
|
-
/**
|
|
86
|
-
* Task does not exist at given location.
|
|
87
|
-
* @category Error
|
|
88
|
-
*/
|
|
89
|
-
var TaskNotFoundError = /** @class */ (function (_super) {
|
|
90
|
-
__extends(TaskNotFoundError, _super);
|
|
91
|
-
// eslint-disable-next-line no-unused-vars
|
|
92
|
-
function TaskNotFoundError(context, location, response) {
|
|
93
|
-
var _this = _super.call(this, context + ": Task does not exist at location: '" + location + "'.") || this;
|
|
94
|
-
_this.location = location;
|
|
95
|
-
_this.response = response;
|
|
96
|
-
Object.setPrototypeOf(_this, TaskNotFoundError.prototype);
|
|
97
|
-
return _this;
|
|
98
|
-
}
|
|
99
|
-
return TaskNotFoundError;
|
|
100
|
-
}(Error));
|
|
101
|
-
exports.TaskNotFoundError = TaskNotFoundError;
|
|
102
|
-
/**
|
|
103
|
-
* Tried to complete a Task which was already completed.
|
|
104
|
-
* @category Error
|
|
105
|
-
*/
|
|
106
|
-
var TaskAlreadyCompletedError = /** @class */ (function (_super) {
|
|
107
|
-
__extends(TaskAlreadyCompletedError, _super);
|
|
108
|
-
// eslint-disable-next-line no-unused-vars
|
|
109
|
-
function TaskAlreadyCompletedError(context, location, response) {
|
|
110
|
-
var _this = _super.call(this, context + ": Task was already completed at location: " + location + " ") || this;
|
|
111
|
-
_this.location = location;
|
|
112
|
-
_this.response = response;
|
|
113
|
-
Object.setPrototypeOf(_this, TaskAlreadyCompletedError.prototype);
|
|
114
|
-
return _this;
|
|
115
|
-
}
|
|
116
|
-
return TaskAlreadyCompletedError;
|
|
117
|
-
}(Error));
|
|
118
|
-
exports.TaskAlreadyCompletedError = TaskAlreadyCompletedError;
|
|
119
|
-
//# sourceMappingURL=errors.js.map
|
package/lib/errors.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAIA;;;GAGG;AACH;IAAsC,oCAAK;IACzC,0CAA0C;IAC1C,0BAAY,OAAe,EAAS,IAAU,EAAS,UAAe,EAAS,QAAuB;QAAtG,YACE,kBAAS,OAAO,wCAAmC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,MAAG,CAAC,SAElF;QAHmC,UAAI,GAAJ,IAAI,CAAM;QAAS,gBAAU,GAAV,UAAU,CAAK;QAAS,cAAQ,GAAR,QAAQ,CAAe;QAEpG,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;;IAC1D,CAAC;IACH,uBAAC;AAAD,CAAC,AAND,CAAsC,KAAK,GAM1C;AANY,4CAAgB;AAQ7B;;;GAGG;AACH;IAA0C,wCAAK;IAC7C,0CAA0C;IAC1C,8BAAY,OAAe,EAAS,QAAuB;QAA3D,YACE,kBAAS,OAAO,4BAAyB,CAAC,SAE3C;QAHmC,cAAQ,GAAR,Q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CAAY,OAAe,EAAS,QAAgB,EAAS,QAAuB;QAApF,YACE,kBAAS,OAAO,kDAA6C,QAAQ,MAAG,CAAC,SAE1E;QAHmC,cAAQ,GAAR,QAAQ,CAAQ;QAAS,cAAQ,GAAR,QAAQ,CAAe;QAElF,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,yBAAyB,CAAC,SAAS,CAAC,CAAC;;IACnE,CAAC;IACH,gCAAC;AAAD,CAAC,AAND,CAA+C,KAAK,GAMnD;AANY,8DAAyB"}
|
package/lib/task.d.ts
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The context of a task.
|
|
3
|
-
*
|
|
4
|
-
* @example ```typescript
|
|
5
|
-
* {
|
|
6
|
-
* ...
|
|
7
|
-
* "context" : {
|
|
8
|
-
* "key" : "myContextKey",
|
|
9
|
-
* "type" : "bpm",
|
|
10
|
-
* "name" : "my context name"
|
|
11
|
-
* }
|
|
12
|
-
* }
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
export interface TaskContext {
|
|
16
|
-
/** Technical identifier for this context. */
|
|
17
|
-
key?: string;
|
|
18
|
-
/** Technical identifier for the type of this context. */
|
|
19
|
-
type?: string;
|
|
20
|
-
/** Display name for this context. */
|
|
21
|
-
name?: string;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Metadata for the task.
|
|
25
|
-
*
|
|
26
|
-
* @example ```typescript
|
|
27
|
-
* {
|
|
28
|
-
* ...
|
|
29
|
-
* "metadata" : [
|
|
30
|
-
* {
|
|
31
|
-
* "key" : "invoiceNumber",
|
|
32
|
-
* "caption" : "Invoice Number",
|
|
33
|
-
* "values" : ["INV123489"],
|
|
34
|
-
* "i18n" : {
|
|
35
|
-
* "caption" : {
|
|
36
|
-
* "de" : "Rechnungsnummer",
|
|
37
|
-
* "it" : "Numero di fattura"
|
|
38
|
-
* }
|
|
39
|
-
* }
|
|
40
|
-
* }
|
|
41
|
-
* ]
|
|
42
|
-
* }
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
export interface TaskMetaData {
|
|
46
|
-
/** Unique key within these metadata consisting of only alphanumeric characters (1-255 character). Please make sure to use a distinct key for your tasks so that they do not collide with metadata of other task sources. */
|
|
47
|
-
key?: string;
|
|
48
|
-
/** Label of the metadata field. */
|
|
49
|
-
caption?: string;
|
|
50
|
-
/** Value of the metadata field. Currently, only one value is allowed per metadata field. If you use these values for delegation or responsibility rules, note the leading or trailing spaces. The spaces will be considered for the rules. */
|
|
51
|
-
values?: string[];
|
|
52
|
-
/** You can optionally add localized metadata to captions. */
|
|
53
|
-
i18n?: {
|
|
54
|
-
caption: {
|
|
55
|
-
[key: string]: string;
|
|
56
|
-
}[];
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Links for the task. With these you can interact with the Task-App in an asynchronous way. [Explore the documentation]{@link https://developer.d-velop.de/documentation/taskapp/en#creating-a-task}.
|
|
61
|
-
*
|
|
62
|
-
* @example ```typescript
|
|
63
|
-
* {
|
|
64
|
-
* ...
|
|
65
|
-
* "_links" : {
|
|
66
|
-
* "form" : {
|
|
67
|
-
* "href" : "https://example.com/form"
|
|
68
|
-
* }
|
|
69
|
-
* }
|
|
70
|
-
* }
|
|
71
|
-
* ```
|
|
72
|
-
*/
|
|
73
|
-
export interface TaskLinks {
|
|
74
|
-
/** This URI provides an editing dialog for the task. You can find further details in the section [Adding editing dialogs]{@link https://developer.d-velop.de/documentation/taskapp/en#adding-editing-dialogs}. */
|
|
75
|
-
form?: {
|
|
76
|
-
href: string;
|
|
77
|
-
};
|
|
78
|
-
/** This URI is displayed as a context action in the user interface to display additional information for the user. */
|
|
79
|
-
attachment?: {
|
|
80
|
-
href: string;
|
|
81
|
-
};
|
|
82
|
-
/** This URI is called on completion of a task. */
|
|
83
|
-
callback?: {
|
|
84
|
-
href: string;
|
|
85
|
-
};
|
|
86
|
-
/** This URI represents the process by which the task was initiated. The process is displayed in the user interface as a separate perspective for the task. */
|
|
87
|
-
process?: {
|
|
88
|
-
href: string;
|
|
89
|
-
};
|
|
90
|
-
/** This URI is called in case of updates to the task. */
|
|
91
|
-
changeCallback?: {
|
|
92
|
-
href: string;
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
export interface Task {
|
|
96
|
-
/** Location of the task. This should be treated like an ID. */
|
|
97
|
-
location?: string;
|
|
98
|
-
/** Subject of the task */
|
|
99
|
-
subject?: string;
|
|
100
|
-
/** A textual description of the task. */
|
|
101
|
-
description?: string;
|
|
102
|
-
/** The recipients of the task. IDs for users and groups are provided by the [Identityprovider]{@link identityprovider}. */
|
|
103
|
-
assignees?: string[];
|
|
104
|
-
/** Unique key for the task. Required for creating a task. */
|
|
105
|
-
correlationKey?: string;
|
|
106
|
-
/** Priority between 0 (low) and 100 (high) */
|
|
107
|
-
priority?: number;
|
|
108
|
-
/**
|
|
109
|
-
* Reminder date in [RFC3339]{@link https://tools.ietf.org/html/rfc3339} format
|
|
110
|
-
*
|
|
111
|
-
* @example ```typescript
|
|
112
|
-
* {
|
|
113
|
-
* ...
|
|
114
|
-
* "reminderDate" : "2018-07-31T20:16:17.000+02:00"
|
|
115
|
-
* }
|
|
116
|
-
* ```
|
|
117
|
-
*/
|
|
118
|
-
reminderDate?: string;
|
|
119
|
-
/**
|
|
120
|
-
* Reminder date in [RFC3339]{@link https://tools.ietf.org/html/rfc3339} format
|
|
121
|
-
*
|
|
122
|
-
* @example ```typescript
|
|
123
|
-
* {
|
|
124
|
-
* ...
|
|
125
|
-
* "dueDate" : "2018-08-15T20:16:17.000+02:00"
|
|
126
|
-
* }
|
|
127
|
-
* ```
|
|
128
|
-
*/
|
|
129
|
-
dueDate?: string;
|
|
130
|
-
/**
|
|
131
|
-
* Time until finished task is deleted from task database in [ISO-8601](https://www.w3.org/TR/NOTE-datetime#:~:text=by%20Markus%20Kuhn.-,ISO%208601%20describes%20a%20large%20number%20of%20date%2Ftime%20formats,ISO%208601%20dates%20and%20times.) format.
|
|
132
|
-
*
|
|
133
|
-
* @default 30 days
|
|
134
|
-
*
|
|
135
|
-
* @example ```typescript
|
|
136
|
-
* {
|
|
137
|
-
* ...
|
|
138
|
-
* "retentionTime" : "P30D" // 30 days
|
|
139
|
-
* }
|
|
140
|
-
* ```
|
|
141
|
-
*/
|
|
142
|
-
retentionTime?: string;
|
|
143
|
-
/** Context for the Task (See {@link TaskContext}) */
|
|
144
|
-
context?: TaskContext;
|
|
145
|
-
/** Metadata of the Task (See {@link TaskMetaData}) */
|
|
146
|
-
metaData?: TaskMetaData[];
|
|
147
|
-
/** Links for the task (See {@link TaskLinks}) */
|
|
148
|
-
_links?: TaskLinks;
|
|
149
|
-
}
|
|
150
|
-
//# sourceMappingURL=task.d.ts.map
|
package/lib/task.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../src/task.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,WAAW;IAE1B,6CAA6C;IAC7C,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,YAAY;IAE3B,4NAA4N;IAC5N,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,mCAAmC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,8OAA8O;IAC9O,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB,6DAA6D;IAC7D,IAAI,CAAC,EAAE;QACL,OAAO,EAAE;YACP,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;SACvB,EAAE,CAAA;KACJ,CAAA;CACF;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,SAAS;IAExB,kNAAkN;IAClN,IA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
|
|
|
1
|
-
import { Task } from "../index";
|
|
2
|
-
/**
|
|
3
|
-
* Update an existing {@link Task}.
|
|
4
|
-
*
|
|
5
|
-
* @param {string} systemBaseUri SystemBaseUri for the tenant
|
|
6
|
-
* @param {string} authSessionId Vaild AuthSessionId
|
|
7
|
-
* @param {Task} task {@link Task} with updated values
|
|
8
|
-
* @returns {Task} Updated {@link Task}
|
|
9
|
-
*
|
|
10
|
-
* @throws {@link NoTaskLocationError} indicates that no location was given.
|
|
11
|
-
* @throws {@link InvalidTaskError} indicates that the given task was not accepted because it is invalid. You can check the ```error.validation```-property.
|
|
12
|
-
* @throws {@link UnauthenticatedError} indicates that the authSessionId was invalid or expired.
|
|
13
|
-
* @throws {@link UnauthorizedError} indicates that the user associated with the authSessionId does miss permissions.
|
|
14
|
-
* @throws {@link TaskNotFoundError} indicates that for the given location no task was found.
|
|
15
|
-
* @throws {@link TaskAlreadyCompletedError} indicates that a task is already marked as completed.
|
|
16
|
-
*
|
|
17
|
-
* @example ```typescript
|
|
18
|
-
*
|
|
19
|
-
* const task: Task = {
|
|
20
|
-
* ...
|
|
21
|
-
* description: "Try harder! Bribe some people if you must."
|
|
22
|
-
* }
|
|
23
|
-
*
|
|
24
|
-
* await updateTask("https://umbrella-corp.d-velop.cloud", "AUTH_SESSION_ID", task);
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export declare function updateTask(systemBaseUri: string, authSessionId: string, task: Task): Promise<Task>;
|
|
28
|
-
//# sourceMappingURL=update-task.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-task.d.ts","sourceRoot":"","sources":["../../src/update-task/update-task.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAgI,MAAM,UAAU,CAAC;AAE9J;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,wBAAsB,UAAU,CAAC,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAI,OAAO,CAAC,IAAI,CAAC,CAsCzG"}
|
|
@@ -1,120 +0,0 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
-
};
|
|
41
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.updateTask = void 0;
|
|
43
|
-
var axios_1 = __importDefault(require("axios"));
|
|
44
|
-
var index_1 = require("../index");
|
|
45
|
-
/**
|
|
46
|
-
* Update an existing {@link Task}.
|
|
47
|
-
*
|
|
48
|
-
* @param {string} systemBaseUri SystemBaseUri for the tenant
|
|
49
|
-
* @param {string} authSessionId Vaild AuthSessionId
|
|
50
|
-
* @param {Task} task {@link Task} with updated values
|
|
51
|
-
* @returns {Task} Updated {@link Task}
|
|
52
|
-
*
|
|
53
|
-
* @throws {@link NoTaskLocationError} indicates that no location was given.
|
|
54
|
-
* @throws {@link InvalidTaskError} indicates that the given task was not accepted because it is invalid. You can check the ```error.validation```-property.
|
|
55
|
-
* @throws {@link UnauthenticatedError} indicates that the authSessionId was invalid or expired.
|
|
56
|
-
* @throws {@link UnauthorizedError} indicates that the user associated with the authSessionId does miss permissions.
|
|
57
|
-
* @throws {@link TaskNotFoundError} indicates that for the given location no task was found.
|
|
58
|
-
* @throws {@link TaskAlreadyCompletedError} indicates that a task is already marked as completed.
|
|
59
|
-
*
|
|
60
|
-
* @example ```typescript
|
|
61
|
-
*
|
|
62
|
-
* const task: Task = {
|
|
63
|
-
* ...
|
|
64
|
-
* description: "Try harder! Bribe some people if you must."
|
|
65
|
-
* }
|
|
66
|
-
*
|
|
67
|
-
* await updateTask("https://umbrella-corp.d-velop.cloud", "AUTH_SESSION_ID", task);
|
|
68
|
-
* ```
|
|
69
|
-
*/
|
|
70
|
-
function updateTask(systemBaseUri, authSessionId, task) {
|
|
71
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
72
|
-
var errorContext, location, e_1;
|
|
73
|
-
return __generator(this, function (_a) {
|
|
74
|
-
switch (_a.label) {
|
|
75
|
-
case 0:
|
|
76
|
-
errorContext = "Failed to update task";
|
|
77
|
-
if (task.location) {
|
|
78
|
-
location = task.location;
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
throw new index_1.NoTaskLocationError(errorContext, task);
|
|
82
|
-
}
|
|
83
|
-
_a.label = 1;
|
|
84
|
-
case 1:
|
|
85
|
-
_a.trys.push([1, 3, , 4]);
|
|
86
|
-
return [4 /*yield*/, axios_1.default.patch(location, task, {
|
|
87
|
-
baseURL: systemBaseUri,
|
|
88
|
-
headers: {
|
|
89
|
-
"Authorization": "Bearer " + authSessionId,
|
|
90
|
-
"Origin": systemBaseUri
|
|
91
|
-
},
|
|
92
|
-
})];
|
|
93
|
-
case 2:
|
|
94
|
-
_a.sent();
|
|
95
|
-
return [2 /*return*/, task];
|
|
96
|
-
case 3:
|
|
97
|
-
e_1 = _a.sent();
|
|
98
|
-
if (e_1.response) {
|
|
99
|
-
switch (e_1.response.status) {
|
|
100
|
-
case 400:
|
|
101
|
-
throw new index_1.InvalidTaskError(errorContext, task, e_1.response.data, e_1.response);
|
|
102
|
-
case 401:
|
|
103
|
-
throw new index_1.UnauthenticatedError(errorContext, e_1.response);
|
|
104
|
-
case 403:
|
|
105
|
-
throw new index_1.UnauthorizedError(errorContext, e_1.response);
|
|
106
|
-
case 404:
|
|
107
|
-
throw new index_1.TaskNotFoundError(errorContext, location, e_1.response);
|
|
108
|
-
case 410:
|
|
109
|
-
throw new index_1.TaskAlreadyCompletedError(errorContext, location, e_1.response);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
e_1.message = errorContext + ": " + e_1.message;
|
|
113
|
-
throw e_1;
|
|
114
|
-
case 4: return [2 /*return*/];
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
exports.updateTask = updateTask;
|
|
120
|
-
//# sourceMappingURL=update-task.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-task.js","sourceRoot":"","sources":["../../src/update-task/update-task.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,kCAA8J;AAE9J;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,SAAsB,UAAU,CAAC,aAAqB,EAAE,aAAqB,EAAE,IAAU;;;;;;oBAEjF,YAAY,GAAW,uBAAuB,CAAC;oBAGrD,IAAI,IAAI,CAAC,QAAQ,EAAE;wBACjB,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;qBAC1B;yBAAM;wBACL,MAAM,IAAI,2BAAmB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;qBACnD;;;;oBAGC,qBAAM,eAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE;4BAChC,OAAO,EAAE,aAAa;4BACtB,OAAO,EAAE;gCACP,eAAe,EAAE,YAAU,aAAe;gCAC1C,QAAQ,EAAE,aAAa;6BACxB;yBACF,CAAC,EAAA;;oBANF,SAME,CAAC;oBACH,sBAAO,IAAI,EAAC;;;oBAEZ,IAAI,GAAC,CAAC,QAAQ,EAAE;wBACd,QAAQ,GAAC,CAAC,QAAQ,CAAC,MAAM,EAAE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