@hailer/app-sdk 2.0.0-beta-2 → 2.0.0-beta-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.
- package/lib/app-sdk.js +2 -2
- package/lib/app-sdk.js.map +2 -2
- package/lib/tools/publish.cjs +219 -183
- package/lib/tools/publish.cjs.map +7 -0
- package/package.json +2 -2
- package/lib/constants.js +0 -3
- package/lib/hailer-api.js +0 -147
- package/lib/index.js +0 -3
- package/lib/modules/activity/kanban.js +0 -88
- package/lib/modules/activity.js +0 -170
- package/lib/modules/insight.js +0 -73
- package/lib/modules/network.d.ts +0 -14
- package/lib/modules/network.js +0 -74
- package/lib/modules/process.d.ts +0 -38
- package/lib/modules/process.js +0 -104
- package/lib/modules/public/form.js +0 -117
- package/lib/modules/public/insight.js +0 -114
- package/lib/modules/team.d.ts +0 -17
- package/lib/modules/ui/activity.js +0 -72
- package/lib/modules/ui.js +0 -10
- package/lib/modules/user.js +0 -133
- package/lib/public-api.d.ts +0 -16
- package/lib/public-api.js +0 -13
- package/lib/tools/minimal-password-prompt.d.ts +0 -1
- package/lib/tools/minimal-password-prompt.js +0 -50
- package/lib/tools/publish.d.ts +0 -1
- package/lib/tools/replace-private.d.ts +0 -1
- package/lib/tools/replace-private.js +0 -33
- package/lib/types.js +0 -28
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
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;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
var Kanban = /** @class */ (function () {
|
|
38
|
-
function Kanban(client, apiVersion) {
|
|
39
|
-
this.client = client;
|
|
40
|
-
this.apiVersion = apiVersion;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Lists all activities in a kanban grouped by phases
|
|
44
|
-
*
|
|
45
|
-
* @param processId the id of the process the kanban relates to
|
|
46
|
-
* @param options object containing apiVersion option and requestOptions to be passed to the backend endpoint
|
|
47
|
-
*
|
|
48
|
-
* @returns activities in kanban list format
|
|
49
|
-
*/
|
|
50
|
-
Kanban.prototype.list = function (processId, options) {
|
|
51
|
-
var _a;
|
|
52
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
53
|
-
var res;
|
|
54
|
-
return __generator(this, function (_b) {
|
|
55
|
-
switch (_b.label) {
|
|
56
|
-
case 0: return [4 /*yield*/, this.client.requestAsync("v".concat((_a = options === null || options === void 0 ? void 0 : options.apiVersion) !== null && _a !== void 0 ? _a : this.apiVersion, ".activity.kanban.list"), [processId, options === null || options === void 0 ? void 0 : options.requestOptions])];
|
|
57
|
-
case 1:
|
|
58
|
-
res = _b.sent();
|
|
59
|
-
return [2 /*return*/, res];
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* Loads a single activity in kanban format
|
|
66
|
-
*
|
|
67
|
-
* @param activityId activityId of the wanted activity
|
|
68
|
-
* @param options object containing apiVersion option
|
|
69
|
-
*
|
|
70
|
-
* @returns activity in kanban format
|
|
71
|
-
*/
|
|
72
|
-
Kanban.prototype.load = function (activityId, options) {
|
|
73
|
-
var _a;
|
|
74
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
75
|
-
var res;
|
|
76
|
-
return __generator(this, function (_b) {
|
|
77
|
-
switch (_b.label) {
|
|
78
|
-
case 0: return [4 /*yield*/, this.client.requestAsync("v".concat((_a = options.apiVersion) !== null && _a !== void 0 ? _a : this.apiVersion, ".activity.kanban.load"), [activityId])];
|
|
79
|
-
case 1:
|
|
80
|
-
res = _b.sent();
|
|
81
|
-
return [2 /*return*/, res];
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
return Kanban;
|
|
87
|
-
}());
|
|
88
|
-
export { Kanban };
|
package/lib/modules/activity.js
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
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;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
import { HailerError } from '../types';
|
|
38
|
-
var Activity = /** @class */ (function () {
|
|
39
|
-
function Activity(client, apiVersion) {
|
|
40
|
-
this.client = client;
|
|
41
|
-
this.apiVersion = apiVersion;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Lists all activities from the specified process and phase
|
|
45
|
-
*
|
|
46
|
-
* @param processId process from current network
|
|
47
|
-
* @param phaseId phase in the process specified in processId
|
|
48
|
-
* @param options options with apiVersion and requestOptions, default values can be found in api.hailer.com/docs v3.activity.list
|
|
49
|
-
*
|
|
50
|
-
* @returns List of Hailer activities from process and phase filtered with supplied options
|
|
51
|
-
*
|
|
52
|
-
* @throws {HailerError} if request is incorrect
|
|
53
|
-
*/
|
|
54
|
-
Activity.prototype.list = function (processId, phaseId, options) {
|
|
55
|
-
var _a;
|
|
56
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
57
|
-
var res, error_1;
|
|
58
|
-
return __generator(this, function (_b) {
|
|
59
|
-
switch (_b.label) {
|
|
60
|
-
case 0:
|
|
61
|
-
_b.trys.push([0, 2, , 3]);
|
|
62
|
-
return [4 /*yield*/, this.client.requestAsync("v".concat((_a = options === null || options === void 0 ? void 0 : options.apiVersion) !== null && _a !== void 0 ? _a : this.apiVersion, ".activity.list"), [processId, phaseId, options === null || options === void 0 ? void 0 : options.requestOptions])];
|
|
63
|
-
case 1:
|
|
64
|
-
res = _b.sent();
|
|
65
|
-
return [2 /*return*/, res.activities];
|
|
66
|
-
case 2:
|
|
67
|
-
error_1 = _b.sent();
|
|
68
|
-
throw new HailerError(error_1);
|
|
69
|
-
case 3: return [2 /*return*/];
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* Gets single activity
|
|
76
|
-
*
|
|
77
|
-
* @param activityId activity Id of the process specified in processId
|
|
78
|
-
* @param processId Process where the activityId is
|
|
79
|
-
* @param phaseId Phase where the activityId is in process specified by processId
|
|
80
|
-
* @param options options containing apiVersion
|
|
81
|
-
*
|
|
82
|
-
* @returns Hailer activity information
|
|
83
|
-
*
|
|
84
|
-
* @throws {HailerError} if request is incorrect
|
|
85
|
-
*/
|
|
86
|
-
Activity.prototype.get = function (activityId, processId, phaseId, options) {
|
|
87
|
-
var _a;
|
|
88
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
89
|
-
var res, error_2;
|
|
90
|
-
return __generator(this, function (_b) {
|
|
91
|
-
switch (_b.label) {
|
|
92
|
-
case 0:
|
|
93
|
-
_b.trys.push([0, 2, , 3]);
|
|
94
|
-
return [4 /*yield*/, this.client.requestAsync("v".concat((_a = options === null || options === void 0 ? void 0 : options.apiVersion) !== null && _a !== void 0 ? _a : this.apiVersion, ".activity.list"), [processId, phaseId])];
|
|
95
|
-
case 1:
|
|
96
|
-
res = _b.sent();
|
|
97
|
-
return [2 /*return*/, res.activities.find(function (activity) { return activity._id === activityId; })];
|
|
98
|
-
case 2:
|
|
99
|
-
error_2 = _b.sent();
|
|
100
|
-
throw new HailerError(error_2);
|
|
101
|
-
case 3: return [2 /*return*/];
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
|
-
/**
|
|
107
|
-
* Creates an activity
|
|
108
|
-
*
|
|
109
|
-
* @param processId The process where the activity is created
|
|
110
|
-
* @param activity Attributes of the new activity
|
|
111
|
-
* @param options optional options with apiVersion and requestOptions to be passed to the backend endpoint
|
|
112
|
-
*
|
|
113
|
-
* @throws {HailerError} if request is incorrect
|
|
114
|
-
*/
|
|
115
|
-
Activity.prototype.create = function (processId, activities, options) {
|
|
116
|
-
var _a;
|
|
117
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
118
|
-
var res, error_3;
|
|
119
|
-
return __generator(this, function (_b) {
|
|
120
|
-
switch (_b.label) {
|
|
121
|
-
case 0:
|
|
122
|
-
_b.trys.push([0, 2, , 3]);
|
|
123
|
-
return [4 /*yield*/, this.client.requestAsync("v".concat((_a = options === null || options === void 0 ? void 0 : options.apiVersion) !== null && _a !== void 0 ? _a : this.apiVersion, ".activity.create"), [processId, activities])];
|
|
124
|
-
case 1:
|
|
125
|
-
res = _b.sent();
|
|
126
|
-
return [2 /*return*/, res];
|
|
127
|
-
case 2:
|
|
128
|
-
error_3 = _b.sent();
|
|
129
|
-
throw new HailerError(error_3);
|
|
130
|
-
case 3: return [2 /*return*/];
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
});
|
|
134
|
-
};
|
|
135
|
-
/**
|
|
136
|
-
* Updates an activity
|
|
137
|
-
*
|
|
138
|
-
* @param _id Id of an activity to edit
|
|
139
|
-
* @param name New name of the activity
|
|
140
|
-
* @param fields change values of fields, null removes current value
|
|
141
|
-
* @param phaseId New phase of the activity
|
|
142
|
-
* @param options options containing apiVersion
|
|
143
|
-
*
|
|
144
|
-
* @returns The number of updated activities
|
|
145
|
-
*
|
|
146
|
-
* @throws {HailerError} if request is incorrect
|
|
147
|
-
*/
|
|
148
|
-
Activity.prototype.update = function (activity, options) {
|
|
149
|
-
var _a;
|
|
150
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
151
|
-
var res, error_4;
|
|
152
|
-
return __generator(this, function (_b) {
|
|
153
|
-
switch (_b.label) {
|
|
154
|
-
case 0:
|
|
155
|
-
_b.trys.push([0, 2, , 3]);
|
|
156
|
-
return [4 /*yield*/, this.client.requestAsync("v".concat((_a = options === null || options === void 0 ? void 0 : options.apiVersion) !== null && _a !== void 0 ? _a : this.apiVersion, ".activity.update"), [activity])];
|
|
157
|
-
case 1:
|
|
158
|
-
res = _b.sent();
|
|
159
|
-
return [2 /*return*/, res];
|
|
160
|
-
case 2:
|
|
161
|
-
error_4 = _b.sent();
|
|
162
|
-
throw new HailerError(error_4);
|
|
163
|
-
case 3: return [2 /*return*/];
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
});
|
|
167
|
-
};
|
|
168
|
-
return Activity;
|
|
169
|
-
}());
|
|
170
|
-
export { Activity };
|
package/lib/modules/insight.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
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;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
import { HailerError } from '../types';
|
|
38
|
-
var Insight = /** @class */ (function () {
|
|
39
|
-
function Insight(client, apiVersion) {
|
|
40
|
-
this.client = client;
|
|
41
|
-
this.apiVersion = apiVersion;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Get Insight data
|
|
45
|
-
*
|
|
46
|
-
* @param insightId the id of the Insight the data is fetched from
|
|
47
|
-
* @param options object containing apiVersion option
|
|
48
|
-
*
|
|
49
|
-
* @returns data from the Insight
|
|
50
|
-
*
|
|
51
|
-
* @throws {HailerError} if request is incorrect
|
|
52
|
-
*/
|
|
53
|
-
Insight.prototype.data = function (insightId, options) {
|
|
54
|
-
var _a;
|
|
55
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
56
|
-
var error_1;
|
|
57
|
-
return __generator(this, function (_b) {
|
|
58
|
-
switch (_b.label) {
|
|
59
|
-
case 0:
|
|
60
|
-
_b.trys.push([0, 2, , 3]);
|
|
61
|
-
return [4 /*yield*/, this.client.requestAsync("v".concat((_a = options === null || options === void 0 ? void 0 : options.apiVersion) !== null && _a !== void 0 ? _a : this.apiVersion, ".insight.data"), [insightId])];
|
|
62
|
-
case 1: return [2 /*return*/, _b.sent()];
|
|
63
|
-
case 2:
|
|
64
|
-
error_1 = _b.sent();
|
|
65
|
-
throw new HailerError(error_1);
|
|
66
|
-
case 3: return [2 /*return*/];
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
};
|
|
71
|
-
return Insight;
|
|
72
|
-
}());
|
|
73
|
-
export { Insight };
|
package/lib/modules/network.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Client } from '@wishcore/wish-rpc';
|
|
2
|
-
import { Workspace } from '../types';
|
|
3
|
-
export declare class WorkspaceApi {
|
|
4
|
-
private client;
|
|
5
|
-
constructor(client: Client);
|
|
6
|
-
/**
|
|
7
|
-
* Returns the current network
|
|
8
|
-
*
|
|
9
|
-
* @returns the Hailer Workspace information the user is currently in
|
|
10
|
-
*
|
|
11
|
-
* @throws {HailerError} if request is incorrect
|
|
12
|
-
*/
|
|
13
|
-
current(): Promise<Workspace>;
|
|
14
|
-
}
|
package/lib/modules/network.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
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;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
import { HailerError } from '../types';
|
|
38
|
-
var Network = /** @class */ (function () {
|
|
39
|
-
function Network(client, apiVersion) {
|
|
40
|
-
this.client = client;
|
|
41
|
-
this.apiVersion = apiVersion;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Returns the current network
|
|
45
|
-
*
|
|
46
|
-
* @param options object containing apiVersion option
|
|
47
|
-
*
|
|
48
|
-
* @returns the Hailer Workspace information the user is currently in
|
|
49
|
-
*
|
|
50
|
-
* @throws {HailerError} if request is incorrect
|
|
51
|
-
*/
|
|
52
|
-
Network.prototype.current = function (options) {
|
|
53
|
-
var _a;
|
|
54
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
55
|
-
var res, error_1;
|
|
56
|
-
return __generator(this, function (_b) {
|
|
57
|
-
switch (_b.label) {
|
|
58
|
-
case 0:
|
|
59
|
-
_b.trys.push([0, 2, , 3]);
|
|
60
|
-
return [4 /*yield*/, this.client.requestAsync("v".concat((_a = options === null || options === void 0 ? void 0 : options.apiVersion) !== null && _a !== void 0 ? _a : this.apiVersion, ".network.current"), [])];
|
|
61
|
-
case 1:
|
|
62
|
-
res = _b.sent();
|
|
63
|
-
return [2 /*return*/, res];
|
|
64
|
-
case 2:
|
|
65
|
-
error_1 = _b.sent();
|
|
66
|
-
throw new HailerError(error_1);
|
|
67
|
-
case 3: return [2 /*return*/];
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
return Network;
|
|
73
|
-
}());
|
|
74
|
-
export { Network };
|
package/lib/modules/process.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Client } from '@wishcore/wish-rpc';
|
|
2
|
-
import { HailerProcess } from '../types';
|
|
3
|
-
/** @deprecated Use Workflow instead */
|
|
4
|
-
export declare class Process {
|
|
5
|
-
private client;
|
|
6
|
-
constructor(client: Client);
|
|
7
|
-
/**
|
|
8
|
-
* Lists all processes from a workspace
|
|
9
|
-
*
|
|
10
|
-
* @returns all Hailer processes in the workspace the app user is currently in
|
|
11
|
-
*
|
|
12
|
-
* @throws {HailerError} if request is incorrect
|
|
13
|
-
*/
|
|
14
|
-
list(): Promise<{
|
|
15
|
-
[key: string]: HailerProcess;
|
|
16
|
-
}>;
|
|
17
|
-
/**
|
|
18
|
-
* Gets a single process from a workspace
|
|
19
|
-
*
|
|
20
|
-
* @param processId the id of the process in question
|
|
21
|
-
*
|
|
22
|
-
* @returns the specified Hailer process
|
|
23
|
-
*
|
|
24
|
-
* @throws {HailerError} if request is incorrect
|
|
25
|
-
*/
|
|
26
|
-
get(processId: string): Promise<HailerProcess>;
|
|
27
|
-
/**
|
|
28
|
-
* Gets an id of a field in a process by its name
|
|
29
|
-
*
|
|
30
|
-
* @param processId the id of the process in question
|
|
31
|
-
* @param fieldName name of the field
|
|
32
|
-
*
|
|
33
|
-
* @returns the field id as string
|
|
34
|
-
*
|
|
35
|
-
* @throws {HailerError} if request is incorrect
|
|
36
|
-
*/
|
|
37
|
-
getFieldIdByName(processId: string, fieldName: string): Promise<string>;
|
|
38
|
-
}
|
package/lib/modules/process.js
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
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;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
import { HailerError } from '../types';
|
|
38
|
-
var Process = /** @class */ (function () {
|
|
39
|
-
function Process(client, apiVersion) {
|
|
40
|
-
this.client = client;
|
|
41
|
-
this.apiVersion = apiVersion;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Lists all processes from a workspace
|
|
45
|
-
*
|
|
46
|
-
* @param options object containing apiVersion option
|
|
47
|
-
*
|
|
48
|
-
* @returns all Hailer processes in the workspace the app user is currently in
|
|
49
|
-
*
|
|
50
|
-
* @throws {HailerError} if request is incorrect
|
|
51
|
-
*/
|
|
52
|
-
Process.prototype.list = function (options) {
|
|
53
|
-
var _a;
|
|
54
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
55
|
-
var processes, error_1;
|
|
56
|
-
return __generator(this, function (_b) {
|
|
57
|
-
switch (_b.label) {
|
|
58
|
-
case 0:
|
|
59
|
-
_b.trys.push([0, 2, , 3]);
|
|
60
|
-
return [4 /*yield*/, this.client.requestAsync("v".concat((_a = options === null || options === void 0 ? void 0 : options.apiVersion) !== null && _a !== void 0 ? _a : this.apiVersion, ".process.list"), [])];
|
|
61
|
-
case 1:
|
|
62
|
-
processes = _b.sent();
|
|
63
|
-
return [2 /*return*/, processes];
|
|
64
|
-
case 2:
|
|
65
|
-
error_1 = _b.sent();
|
|
66
|
-
throw new HailerError(error_1);
|
|
67
|
-
case 3: return [2 /*return*/];
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
/**
|
|
73
|
-
* Gets a single process from a workspace
|
|
74
|
-
*
|
|
75
|
-
* @param processId the id of the process in question
|
|
76
|
-
* @param options object containing apiVersion option
|
|
77
|
-
*
|
|
78
|
-
* @returns the specified Hailer process
|
|
79
|
-
*
|
|
80
|
-
* @throws {HailerError} if request is incorrect
|
|
81
|
-
*/
|
|
82
|
-
Process.prototype.get = function (processId, options) {
|
|
83
|
-
var _a;
|
|
84
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
85
|
-
var process_1, error_2;
|
|
86
|
-
return __generator(this, function (_b) {
|
|
87
|
-
switch (_b.label) {
|
|
88
|
-
case 0:
|
|
89
|
-
_b.trys.push([0, 2, , 3]);
|
|
90
|
-
return [4 /*yield*/, this.client.requestAsync("v".concat((_a = options === null || options === void 0 ? void 0 : options.apiVersion) !== null && _a !== void 0 ? _a : this.apiVersion, ".process.get"), [processId])];
|
|
91
|
-
case 1:
|
|
92
|
-
process_1 = _b.sent();
|
|
93
|
-
return [2 /*return*/, process_1];
|
|
94
|
-
case 2:
|
|
95
|
-
error_2 = _b.sent();
|
|
96
|
-
throw new HailerError(error_2);
|
|
97
|
-
case 3: return [2 /*return*/];
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
};
|
|
102
|
-
return Process;
|
|
103
|
-
}());
|
|
104
|
-
export { Process };
|