@dvelop-sdk/task 2.0.12 → 3.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 (57) hide show
  1. package/lib/index.d.ts +33 -6
  2. package/lib/index.d.ts.map +1 -1
  3. package/lib/index.js +35 -18
  4. package/lib/index.js.map +1 -1
  5. package/lib/internal.d.ts +7 -0
  6. package/lib/internal.d.ts.map +1 -0
  7. package/lib/internal.js +19 -0
  8. package/lib/internal.js.map +1 -0
  9. package/lib/tasks/complete-task/complete-task.d.ts +35 -0
  10. package/lib/tasks/complete-task/complete-task.d.ts.map +1 -0
  11. package/lib/tasks/complete-task/complete-task.js +90 -0
  12. package/lib/tasks/complete-task/complete-task.js.map +1 -0
  13. package/lib/tasks/create-task/create-task.d.ts +117 -0
  14. package/lib/tasks/create-task/create-task.d.ts.map +1 -0
  15. package/lib/{create-task → tasks/create-task}/create-task.js +67 -65
  16. package/lib/tasks/create-task/create-task.js.map +1 -0
  17. package/lib/tasks/delete-task/delete-task.d.ts +35 -0
  18. package/lib/tasks/delete-task/delete-task.d.ts.map +1 -0
  19. package/lib/tasks/delete-task/delete-task.js +86 -0
  20. package/lib/tasks/delete-task/delete-task.js.map +1 -0
  21. package/lib/tasks/get-task-count/get-task-count.d.ts +31 -0
  22. package/lib/tasks/get-task-count/get-task-count.d.ts.map +1 -0
  23. package/lib/tasks/get-task-count/get-task-count.js +93 -0
  24. package/lib/tasks/get-task-count/get-task-count.js.map +1 -0
  25. package/lib/tasks/update-task/update-task.d.ts +112 -0
  26. package/lib/tasks/update-task/update-task.d.ts.map +1 -0
  27. package/lib/tasks/update-task/update-task.js +114 -0
  28. package/lib/tasks/update-task/update-task.js.map +1 -0
  29. package/lib/utils/http.d.ts +57 -0
  30. package/lib/utils/http.d.ts.map +1 -0
  31. package/lib/utils/http.js +151 -0
  32. package/lib/utils/http.js.map +1 -0
  33. package/package.json +3 -9
  34. package/LICENSE +0 -201
  35. package/lib/complete-task/complete-task.d.ts +0 -29
  36. package/lib/complete-task/complete-task.d.ts.map +0 -1
  37. package/lib/complete-task/complete-task.js +0 -122
  38. package/lib/complete-task/complete-task.js.map +0 -1
  39. package/lib/create-task/create-task.d.ts +0 -27
  40. package/lib/create-task/create-task.d.ts.map +0 -1
  41. package/lib/create-task/create-task.js.map +0 -1
  42. package/lib/delete-task/delete-task.d.ts +0 -29
  43. package/lib/delete-task/delete-task.d.ts.map +0 -1
  44. package/lib/delete-task/delete-task.js +0 -122
  45. package/lib/delete-task/delete-task.js.map +0 -1
  46. package/lib/errors.d.ts +0 -55
  47. package/lib/errors.d.ts.map +0 -1
  48. package/lib/errors.js +0 -119
  49. package/lib/errors.js.map +0 -1
  50. package/lib/task.d.ts +0 -150
  51. package/lib/task.d.ts.map +0 -1
  52. package/lib/task.js +0 -3
  53. package/lib/task.js.map +0 -1
  54. package/lib/update-task/update-task.d.ts +0 -28
  55. package/lib/update-task/update-task.d.ts.map +0 -1
  56. package/lib/update-task/update-task.js +0 -120
  57. package/lib/update-task/update-task.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-task.d.ts","sourceRoot":"","sources":["../../../src/tasks/delete-task/delete-task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,YAAY,EAA+B,MAAM,kBAAkB,CAAC;AAEzF;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,EAC1F,iBAAiB,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,gBAAgB,KAAK,CAAC,GACjG,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,gBAAgB,KAAK,OAAO,CAAC,CAAC,CAAC,CASlE;AAED;;;;;;;;;;;;;;;GAeG;AAEH,wBAAgB,UAAU,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAE1F"}
@@ -0,0 +1,86 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.deleteTask = exports._deleteTaskFactory = void 0;
40
+ var http_1 = require("../../utils/http");
41
+ /**
42
+ * Factory for the {@link deleteTask}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
43
+ * @typeparam T Return type of the {@link deleteTask}-function. A corresponding transformFuntion has to be supplied.
44
+ * @internal
45
+ * @category Task
46
+ */
47
+ function _deleteTaskFactory(httpRequestFunction, transformFunction) {
48
+ var _this = this;
49
+ return function (context, params) { return __awaiter(_this, void 0, void 0, function () {
50
+ var response;
51
+ return __generator(this, function (_a) {
52
+ switch (_a.label) {
53
+ case 0: return [4 /*yield*/, httpRequestFunction(context, {
54
+ method: "DELETE",
55
+ url: params.location
56
+ })];
57
+ case 1:
58
+ response = _a.sent();
59
+ return [2 /*return*/, transformFunction(response, context, params)];
60
+ }
61
+ });
62
+ }); };
63
+ }
64
+ exports._deleteTaskFactory = _deleteTaskFactory;
65
+ /**
66
+ * Mark task as completed.
67
+ *
68
+ * ```typescript
69
+ * import { deleteTask } from "@dvelop-sdk/task";
70
+ *
71
+ * await deleteTask({
72
+ * systemBaseUri: "https://umbrella-corp.d-velop.cloud",
73
+ * authSessionId: "dQw4w9WgXcQ"
74
+ * }, {
75
+ * location: "some/task/location"
76
+ * });
77
+ * ```
78
+ *
79
+ * @category Task
80
+ */
81
+ /* istanbul ignore next */
82
+ function deleteTask(context, params) {
83
+ return _deleteTaskFactory(http_1._defaultHttpRequestFunction, function () { })(context, params);
84
+ }
85
+ exports.deleteTask = deleteTask;
86
+ //# sourceMappingURL=delete-task.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-task.js","sourceRoot":"","sources":["../../../src/tasks/delete-task/delete-task.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAyF;AAWzF;;;;;GAKG;AACH,SAAgB,kBAAkB,CAChC,mBAA0F,EAC1F,iBAAkG;IAFpG,iBAYC;IARC,OAAO,UAAO,OAAsB,EAAE,MAAwB;;;;wBAE7B,qBAAM,mBAAmB,CAAC,OAAO,EAAE;wBAChE,MAAM,EAAE,QAAQ;wBAChB,GAAG,EAAE,MAAM,CAAC,QAAQ;qBACrB,CAAC,EAAA;;oBAHI,QAAQ,GAAiB,SAG7B;oBACF,sBAAO,iBAAiB,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAC;;;SACrD,CAAC;AACJ,CAAC;AAZD,gDAYC;AAED;;;;;;;;;;;;;;;GAeG;AACH,0BAA0B;AAC1B,SAAgB,UAAU,CAAC,OAAsB,EAAE,MAAwB;IACzE,OAAO,kBAAkB,CAAC,kCAA2B,EAAE,cAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AACrF,CAAC;AAFD,gCAEC"}
@@ -0,0 +1,31 @@
1
+ import { DvelopContext } from "@dvelop-sdk/core";
2
+ import { HttpConfig, HttpResponse } from "../../utils/http";
3
+ /**
4
+ * Default transform-function provided to the {@link getTaskCount}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
5
+ * @internal
6
+ * @category Task
7
+ */
8
+ export declare function _getTaskCountDefaultTransformFunction(response: HttpResponse, _: DvelopContext): number;
9
+ /**
10
+ * Factory for the {@link getTaskCount}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
11
+ * @typeparam T Return type of the {@link getTaskCount}-function. A corresponding transformFuntion has to be supplied.
12
+ * @internal
13
+ * @category Task
14
+ */
15
+ export declare function _getTaskCountFactory<T>(httpRequestFunction: (context: DvelopContext, config: HttpConfig) => Promise<HttpResponse>, transformFunction: (response: HttpResponse, context: DvelopContext) => T): (context: DvelopContext) => Promise<T>;
16
+ /**
17
+ * Create a task.
18
+ *
19
+ * ```typescript
20
+ * import { getTaskCount } from "@dvelop-sdk/task";
21
+ *
22
+ * await getTaskCount({
23
+ * systemBaseUri: "https://umbrella-corp.d-velop.cloud",
24
+ * authSessionId: "dQw4w9WgXcQ"
25
+ * });
26
+ * ```
27
+ *
28
+ * @category Task
29
+ */
30
+ export declare function getTaskCount(context: DvelopContext): Promise<number>;
31
+ //# sourceMappingURL=get-task-count.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-task-count.d.ts","sourceRoot":"","sources":["../../../src/tasks/get-task-count/get-task-count.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,YAAY,EAA+B,MAAM,kBAAkB,CAAC;AAEzF;;;;GAIG;AACH,wBAAgB,qCAAqC,CAAC,QAAQ,EAAE,YAAY,EAAE,CAAC,EAAE,aAAa,GAAG,MAAM,CAEtG;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,EAC1F,iBAAiB,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,KAAK,CAAC,GACvE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,CAAC,CAAC,CASxC;AAED;;;;;;;;;;;;;GAaG;AAEH,wBAAgB,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAEpE"}
@@ -0,0 +1,93 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.getTaskCount = exports._getTaskCountFactory = exports._getTaskCountDefaultTransformFunction = void 0;
40
+ var http_1 = require("../../utils/http");
41
+ /**
42
+ * Default transform-function provided to the {@link getTaskCount}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
43
+ * @internal
44
+ * @category Task
45
+ */
46
+ function _getTaskCountDefaultTransformFunction(response, _) {
47
+ return response.data.count;
48
+ }
49
+ exports._getTaskCountDefaultTransformFunction = _getTaskCountDefaultTransformFunction;
50
+ /**
51
+ * Factory for the {@link getTaskCount}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
52
+ * @typeparam T Return type of the {@link getTaskCount}-function. A corresponding transformFuntion has to be supplied.
53
+ * @internal
54
+ * @category Task
55
+ */
56
+ function _getTaskCountFactory(httpRequestFunction, transformFunction) {
57
+ var _this = this;
58
+ return function (context) { return __awaiter(_this, void 0, void 0, function () {
59
+ var response;
60
+ return __generator(this, function (_a) {
61
+ switch (_a.label) {
62
+ case 0: return [4 /*yield*/, httpRequestFunction(context, {
63
+ method: "GET",
64
+ follows: ["count", "all"]
65
+ })];
66
+ case 1:
67
+ response = _a.sent();
68
+ return [2 /*return*/, transformFunction(response, context)];
69
+ }
70
+ });
71
+ }); };
72
+ }
73
+ exports._getTaskCountFactory = _getTaskCountFactory;
74
+ /**
75
+ * Create a task.
76
+ *
77
+ * ```typescript
78
+ * import { getTaskCount } from "@dvelop-sdk/task";
79
+ *
80
+ * await getTaskCount({
81
+ * systemBaseUri: "https://umbrella-corp.d-velop.cloud",
82
+ * authSessionId: "dQw4w9WgXcQ"
83
+ * });
84
+ * ```
85
+ *
86
+ * @category Task
87
+ */
88
+ /* istanbul ignore next */
89
+ function getTaskCount(context) {
90
+ return _getTaskCountFactory(http_1._defaultHttpRequestFunction, _getTaskCountDefaultTransformFunction)(context);
91
+ }
92
+ exports.getTaskCount = getTaskCount;
93
+ //# sourceMappingURL=get-task-count.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-task-count.js","sourceRoot":"","sources":["../../../src/tasks/get-task-count/get-task-count.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAyF;AAEzF;;;;GAIG;AACH,SAAgB,qCAAqC,CAAC,QAAsB,EAAE,CAAgB;IAC5F,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;AAC7B,CAAC;AAFD,sFAEC;AAED;;;;;GAKG;AACH,SAAgB,oBAAoB,CAClC,mBAA0F,EAC1F,iBAAwE;IAF1E,iBAYC;IARC,OAAO,UAAO,OAAsB;;;;wBAEH,qBAAM,mBAAmB,CAAC,OAAO,EAAE;wBAChE,MAAM,EAAE,KAAK;wBACb,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC;qBAC1B,CAAC,EAAA;;oBAHI,QAAQ,GAAiB,SAG7B;oBACF,sBAAO,iBAAiB,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAC;;;SAC7C,CAAC;AACJ,CAAC;AAZD,oDAYC;AAED;;;;;;;;;;;;;GAaG;AACH,0BAA0B;AAC1B,SAAgB,YAAY,CAAC,OAAsB;IACjD,OAAO,oBAAoB,CAAC,kCAA2B,EAAE,qCAAqC,CAAC,CAAC,OAAO,CAAC,CAAC;AAC3G,CAAC;AAFD,oCAEC"}
@@ -0,0 +1,112 @@
1
+ import { DvelopContext } from "@dvelop-sdk/core";
2
+ import { HttpConfig, HttpResponse } from "../../utils/http";
3
+ /**
4
+ * Parameters for the {@link updateTask}-function.
5
+ * @category Task
6
+ */
7
+ export interface UpdateTaskParams {
8
+ /** Location-URI of the task */
9
+ location: string;
10
+ /** The subject of the task */
11
+ subject?: string;
12
+ /** The recipients of the task. You can specify individual users as well as groups using IDs of the Identityprovider-App */
13
+ assignees?: string[];
14
+ /** The correlation key ensures that only one task is created for this unique key. If a task already exists with the passed key, a new task will not be created. */
15
+ correlationKey?: string;
16
+ /** A descriptive text of the task */
17
+ description?: string;
18
+ /** Priority between 0 (low) and 100 (high) */
19
+ priority?: number;
20
+ /** Reminder date. If you transfer a date without a timestamp, the reminder date is the transferred date at 00:00:00. */
21
+ reminderDate?: Date;
22
+ /** Due date of the task. If you transfer a date without a timestamp, the due date is the transferred date at 00:00:00. */
23
+ dueDate?: Date;
24
+ /**
25
+ * Specify how long the task details should be kept after completing the task. Valid values are between 0 and 365 days. After this time has passed, the task details will be deleted automatically.
26
+ * The information is specified as a time span in days according to ISO-8601, e.g. P30D for 30 days. Specify the time span P0D if the task details should be deleted immediately after the task is completed. If you make no specification, 30 days are automatically assumed.
27
+ */
28
+ retentionTime?: string;
29
+ /** The context of a task */
30
+ context?: {
31
+ /** A technical identifier for the context */
32
+ key?: string;
33
+ /** Type of the context */
34
+ type?: string;
35
+ /** Display name of the context */
36
+ name?: string;
37
+ };
38
+ /** Metadata for the task. See [the documentation](https://developer.d-velop.de/documentation/taskapi/en#creating-a-task) for further information */
39
+ metadata?: {
40
+ /** A technical identifier for the metadata-field */
41
+ key?: string;
42
+ /** Label of the metadata-field */
43
+ caption?: string;
44
+ /** Type of the metadata-field */
45
+ type?: "String" | "Number" | "Money" | "Date";
46
+ /** Value of the metadata field. Currently, only one value is allowed per metadata-field. */
47
+ values?: string;
48
+ }[];
49
+ /** DmsObject that references the task */
50
+ dmsObject?: {
51
+ /** ID of the repository */
52
+ repositoryId: string;
53
+ /** ID of the DmsObject */
54
+ dmsObjectId: string;
55
+ };
56
+ /** Specifies if a notification should be sent to the task creator when the task is created. Default is true. */
57
+ sendCreationNotification?: boolean;
58
+ /** Specifies if a notification should be sent to the task creator when the task is completed. Default is false. */
59
+ sendCompletionNotification?: boolean;
60
+ /** Specifies if a notification should be sent to the task creator when the due date is exceeded. This option is only available if a dueDate is specified. Default is false. */
61
+ sendDueDateNotification?: boolean;
62
+ /** Links to the task */
63
+ _links?: {
64
+ /** This URI provides an editing dialog for the task. You can find further details in the section [Adding editing dialogs](https://developer.d-velop.de/documentation/taskapi/en#adding-editing-dialogs). */
65
+ form?: {
66
+ href: string;
67
+ };
68
+ /** This URI is called on completion of a task via the method POST. */
69
+ callback?: {
70
+ href: string;
71
+ };
72
+ /** This URI is displayed as an action in the user interface to display additional information for the user. */
73
+ attachment?: {
74
+ href: string;
75
+ };
76
+ /** 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. To display completed tasks, the resource has to implement a HEAD request, if the resource is behind the same base address. */
77
+ process?: {
78
+ href: string;
79
+ };
80
+ /** This URI is called in case of updates to the task via the method POST. */
81
+ changeCallback?: {
82
+ href: string;
83
+ };
84
+ };
85
+ }
86
+ /**
87
+ * Factory for the {@link updateTask}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
88
+ * @typeparam T Return type of the {@link updateTask}-function. A corresponding transformFuntion has to be supplied.
89
+ * @internal
90
+ * @category Task
91
+ */
92
+ export declare function _updateTaskFactory<T>(httpRequestFunction: (context: DvelopContext, config: HttpConfig) => Promise<HttpResponse>, transformFunction: (response: HttpResponse, context: DvelopContext, params: UpdateTaskParams) => T): (context: DvelopContext, params: UpdateTaskParams) => Promise<T>;
93
+ /**
94
+ * Update a task.
95
+ *
96
+ * ```typescript
97
+ * import { updateTask } from "@dvelop-sdk/task";
98
+ *
99
+ * await updateTask({
100
+ * systemBaseUri: "https://umbrella-corp.d-velop.cloud",
101
+ * authSessionId: "dQw4w9WgXcQ"
102
+ * }, {
103
+ * location: "some/task/location",
104
+ * description: "Try harder! Bribe some people if you must.",
105
+ * dueDate: new Date(new Date().getTime() + (1000 * 60 * 60 * 24 * 5)) // due in 5 days
106
+ * });
107
+ * ```
108
+ *
109
+ * @category Task
110
+ */
111
+ export declare function updateTask(context: DvelopContext, params: UpdateTaskParams): Promise<void>;
112
+ //# sourceMappingURL=update-task.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-task.d.ts","sourceRoot":"","sources":["../../../src/tasks/update-task/update-task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,YAAY,EAA+B,MAAM,kBAAkB,CAAC;AAEzF;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2HAA2H;IAC3H,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,mKAAmK;IACnK,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wHAAwH;IACxH,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,0HAA0H;IAC1H,OAAO,CAAC,EAAE,IAAI,CAAC;IACf;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4BAA4B;IAC5B,OAAO,CAAC,EAAE;QACR,8CAA8C;QAC9C,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,0BAA0B;QAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,kCAAkC;QAClC,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IAEF,oJAAoJ;IACpJ,QAAQ,CAAC,EAAE;QACT,oDAAoD;QACpD,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,kCAAkC;QAClC,OAAO,CAAC,EAAE,MAA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,EAAE,gBAAgB,KAAK,OAAO,CAAC,CAAC,CAAC,CA4BlE;AAED;;;;;;;;;;;;;;;;;GAiBG;AAEH,wBAAgB,UAAU,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAE1F"}
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ return new (P || (P = Promise))(function (resolve, reject) {
16
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20
+ });
21
+ };
22
+ var __generator = (this && this.__generator) || function (thisArg, body) {
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
+ function verb(n) { return function (v) { return step([n, v]); }; }
26
+ function step(op) {
27
+ if (f) throw new TypeError("Generator is already executing.");
28
+ while (_) try {
29
+ 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;
30
+ if (y = 0, t) op = [op[0] & 2, t.value];
31
+ switch (op[0]) {
32
+ case 0: case 1: t = op; break;
33
+ case 4: _.label++; return { value: op[1], done: false };
34
+ case 5: _.label++; y = op[1]; op = [0]; continue;
35
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
+ default:
37
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
+ if (t[2]) _.ops.pop();
42
+ _.trys.pop(); continue;
43
+ }
44
+ op = body.call(thisArg, _);
45
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
+ }
48
+ };
49
+ Object.defineProperty(exports, "__esModule", { value: true });
50
+ exports.updateTask = exports._updateTaskFactory = void 0;
51
+ var http_1 = require("../../utils/http");
52
+ /**
53
+ * Factory for the {@link updateTask}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
54
+ * @typeparam T Return type of the {@link updateTask}-function. A corresponding transformFuntion has to be supplied.
55
+ * @internal
56
+ * @category Task
57
+ */
58
+ function _updateTaskFactory(httpRequestFunction, transformFunction) {
59
+ var _this = this;
60
+ return function (context, params) { return __awaiter(_this, void 0, void 0, function () {
61
+ var task, response;
62
+ return __generator(this, function (_a) {
63
+ switch (_a.label) {
64
+ case 0:
65
+ task = __assign(__assign({}, params), { location: null });
66
+ if (params.dueDate) {
67
+ task.dueDate = params.dueDate.toISOString();
68
+ }
69
+ if (params.reminderDate) {
70
+ task.reminderDate = params.reminderDate.toISOString();
71
+ }
72
+ if (params.dmsObject) {
73
+ task.dmsReferences = [{
74
+ repoId: params.dmsObject.repositoryId,
75
+ objectId: params.dmsObject.dmsObjectId
76
+ }];
77
+ }
78
+ return [4 /*yield*/, httpRequestFunction(context, {
79
+ method: "PATCH",
80
+ url: params.location,
81
+ data: task
82
+ })];
83
+ case 1:
84
+ response = _a.sent();
85
+ return [2 /*return*/, transformFunction(response, context, params)];
86
+ }
87
+ });
88
+ }); };
89
+ }
90
+ exports._updateTaskFactory = _updateTaskFactory;
91
+ /**
92
+ * Update a task.
93
+ *
94
+ * ```typescript
95
+ * import { updateTask } from "@dvelop-sdk/task";
96
+ *
97
+ * await updateTask({
98
+ * systemBaseUri: "https://umbrella-corp.d-velop.cloud",
99
+ * authSessionId: "dQw4w9WgXcQ"
100
+ * }, {
101
+ * location: "some/task/location",
102
+ * description: "Try harder! Bribe some people if you must.",
103
+ * dueDate: new Date(new Date().getTime() + (1000 * 60 * 60 * 24 * 5)) // due in 5 days
104
+ * });
105
+ * ```
106
+ *
107
+ * @category Task
108
+ */
109
+ /* istanbul ignore next */
110
+ function updateTask(context, params) {
111
+ return _updateTaskFactory(http_1._defaultHttpRequestFunction, function () { })(context, params);
112
+ }
113
+ exports.updateTask = updateTask;
114
+ //# sourceMappingURL=update-task.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-task.js","sourceRoot":"","sources":["../../../src/tasks/update-task/update-task.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAyF;AA6EzF;;;;;GAKG;AACH,SAAgB,kBAAkB,CAChC,mBAA0F,EAC1F,iBAAkG;IAFpG,iBA+BC;IA1BC,OAAO,UAAO,OAAsB,EAAE,MAAwB;;;;;oBAEtD,IAAI,yBAAa,MAAM,GAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAE,CAAC;oBAEvD,IAAI,MAAM,CAAC,OAAO,EAAE;wBAClB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;qBAC7C;oBAED,IAAI,MAAM,CAAC,YAAY,EAAE;wBACvB,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;qBACvD;oBAED,IAAI,MAAM,CAAC,SAAS,EAAE;wBACpB,IAAI,CAAC,aAAa,GAAG,CAAC;gCACpB,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC,YAAY;gCACrC,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,WAAW;6BACvC,CAAC,CAAC;qBACJ;oBAE8B,qBAAM,mBAAmB,CAAC,OAAO,EAAE;4BAChE,MAAM,EAAE,OAAO;4BACf,GAAG,EAAE,MAAM,CAAC,QAAQ;4BACpB,IAAI,EAAE,IAAI;yBACX,CAAC,EAAA;;oBAJI,QAAQ,GAAiB,SAI7B;oBACF,sBAAO,iBAAiB,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAC;;;SACrD,CAAC;AACJ,CAAC;AA/BD,gDA+BC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,0BAA0B;AAC1B,SAAgB,UAAU,CAAC,OAAsB,EAAE,MAAwB;IACzE,OAAO,kBAAkB,CAAC,kCAA2B,EAAE,cAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AACrF,CAAC;AAFD,gCAEC"}
@@ -0,0 +1,57 @@
1
+ import { DvelopContext, DvelopHttpRequestConfig, DvelopHttpResponse, DvelopHttpClient, BadInputError, DvelopSdkError } from "@dvelop-sdk/core";
2
+ export { DvelopHttpRequestConfig as HttpConfig, DvelopHttpResponse as HttpResponse } from "@dvelop-sdk/core";
3
+ /**
4
+ * Generic Error for task-package.
5
+ * @category Error
6
+ */
7
+ export declare class TaskError extends DvelopSdkError {
8
+ message: string;
9
+ originalError?: Error | undefined;
10
+ constructor(message: string, originalError?: Error | undefined);
11
+ }
12
+ /**
13
+ * Validation for task
14
+ * @category Error
15
+ */
16
+ export interface TaskValidation {
17
+ invalidTaskDefinition: boolean;
18
+ missingSubject: boolean;
19
+ invalidSubject: boolean;
20
+ invalidDescription: boolean;
21
+ missingAssignees: boolean;
22
+ invalidSender: boolean;
23
+ invalidAssigneeIDs: string[];
24
+ invalidDueDate: boolean;
25
+ invalidPriority: boolean;
26
+ invalidReminderDate: boolean;
27
+ invalidRetentionTime: boolean;
28
+ invalidHrefs: string[];
29
+ invalidCorrelationKey: boolean;
30
+ missingCorrelationKey: boolean;
31
+ invalidContext: boolean;
32
+ invalidMetadata: boolean;
33
+ invalidOptions: string[];
34
+ invalidDmsReferences: boolean;
35
+ }
36
+ /**
37
+ * Indicates an invalid task-definition. See ```validation```-property for more information.
38
+ * @category Error
39
+ */
40
+ export declare class InvalidTaskDefinitionError extends BadInputError {
41
+ validation: TaskValidation;
42
+ originalError?: Error | undefined;
43
+ constructor(validation: TaskValidation, originalError?: Error | undefined);
44
+ }
45
+ /**
46
+ * Factory used to create the default httpRequestFunction. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
47
+ * @internal
48
+ * @category Http
49
+ */
50
+ export declare function _defaultHttpRequestFunctionFactory(httpClient: DvelopHttpClient): (context: DvelopContext, config: DvelopHttpRequestConfig) => Promise<DvelopHttpResponse>;
51
+ /**
52
+ * Default httpRequestFunction used in task-package.
53
+ * @internal
54
+ * @category Http
55
+ */
56
+ export declare function _defaultHttpRequestFunction(context: DvelopContext, config: DvelopHttpRequestConfig): Promise<DvelopHttpResponse>;
57
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/utils/http.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,gBAAgB,EAAkC,aAAa,EAAoD,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjO,OAAO,EAAE,uBAAuB,IAAI,UAAU,EAAE,kBAAkB,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAG7G;;;EAGE;AAEF,qBAAa,SAAU,S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