pyrus-api 1.0.1 → 1.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/{LICENSE.txt → LICENSE} +1 -1
- package/README.md +2 -0
- package/build/cjs/index.cjs +59 -41
- package/build/esm/index.js +59 -41
- package/build/types/index.d.ts +1 -1
- package/package.json +42 -30
package/{LICENSE.txt → LICENSE}
RENAMED
|
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
package/build/cjs/index.cjs
CHANGED
|
@@ -29,10 +29,17 @@ exports.FormFieldType = void 0;
|
|
|
29
29
|
FormFieldType["DueDateTime"] = "due_date_time";
|
|
30
30
|
})(exports.FormFieldType || (exports.FormFieldType = {}));
|
|
31
31
|
|
|
32
|
-
const dateTimeFieldTypes = [
|
|
32
|
+
const dateTimeFieldTypes = [
|
|
33
|
+
exports.FormFieldType.DueDateTime,
|
|
34
|
+
exports.FormFieldType.CreationDate,
|
|
35
|
+
];
|
|
33
36
|
const dateFieldTypes = [exports.FormFieldType.Date, exports.FormFieldType.DueDate];
|
|
34
37
|
const timeFieldTypes = [exports.FormFieldType.Time];
|
|
35
|
-
const allDateAndTimeFieldTypes = [
|
|
38
|
+
const allDateAndTimeFieldTypes = [
|
|
39
|
+
...dateFieldTypes,
|
|
40
|
+
...dateTimeFieldTypes,
|
|
41
|
+
...timeFieldTypes,
|
|
42
|
+
];
|
|
36
43
|
const allDateAndTimeResponseKeys = [
|
|
37
44
|
"create_date",
|
|
38
45
|
"last_modified_date",
|
|
@@ -42,10 +49,7 @@ const allDateAndTimeResponseKeys = [
|
|
|
42
49
|
"scheduled_datetime_utc",
|
|
43
50
|
"close_date",
|
|
44
51
|
];
|
|
45
|
-
const dateRequestKeys = [
|
|
46
|
-
"due_date",
|
|
47
|
-
"scheduled_date",
|
|
48
|
-
];
|
|
52
|
+
const dateRequestKeys = ["due_date", "scheduled_date"];
|
|
49
53
|
const dateTimeRequestKeys = [
|
|
50
54
|
"start_date_utc",
|
|
51
55
|
"end_date_utc",
|
|
@@ -58,7 +62,7 @@ const dateTimeRequestKeys = [
|
|
|
58
62
|
"due",
|
|
59
63
|
"scheduled_datetime_utc",
|
|
60
64
|
"start_time",
|
|
61
|
-
"end_time"
|
|
65
|
+
"end_time",
|
|
62
66
|
];
|
|
63
67
|
|
|
64
68
|
exports.OperatorId = void 0;
|
|
@@ -73,22 +77,19 @@ exports.OperatorId = void 0;
|
|
|
73
77
|
})(exports.OperatorId || (exports.OperatorId = {}));
|
|
74
78
|
|
|
75
79
|
function toSearchParams(request) {
|
|
76
|
-
return "?" +
|
|
77
|
-
.map(([key, value]) => {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
.toString();
|
|
80
|
+
return ("?" +
|
|
81
|
+
new URLSearchParams(Object.entries(request).map(([key, value]) => {
|
|
82
|
+
if (value instanceof Date) {
|
|
83
|
+
if (dateTimeRequestKeys.includes(key))
|
|
84
|
+
return [key, toDateTimeString(value)];
|
|
85
|
+
if (dateRequestKeys.includes(key))
|
|
86
|
+
return [key, toDateString(value)];
|
|
87
|
+
}
|
|
88
|
+
return [key, value];
|
|
89
|
+
})).toString());
|
|
87
90
|
}
|
|
88
91
|
function extractDates(key, value) {
|
|
89
|
-
if (value instanceof Object
|
|
90
|
-
&& value.type
|
|
91
|
-
&& value.value) {
|
|
92
|
+
if (value instanceof Object && value.type && value.value) {
|
|
92
93
|
if (allDateAndTimeFieldTypes.includes(value.type)) {
|
|
93
94
|
value.value = new Date(value.value);
|
|
94
95
|
}
|
|
@@ -106,9 +107,7 @@ function packDates(key, value) {
|
|
|
106
107
|
if (dateTimeRequestKeys.includes(key)) {
|
|
107
108
|
return value && toDateTimeString(value);
|
|
108
109
|
}
|
|
109
|
-
if (value instanceof Object
|
|
110
|
-
&& value.type
|
|
111
|
-
&& value.value) {
|
|
110
|
+
if (value instanceof Object && value.type && value.value) {
|
|
112
111
|
if (dateTimeFieldTypes.includes(value.type)) {
|
|
113
112
|
value.value = toDateTimeString(value.value);
|
|
114
113
|
return value;
|
|
@@ -125,9 +124,7 @@ function packDates(key, value) {
|
|
|
125
124
|
return value;
|
|
126
125
|
}
|
|
127
126
|
function trimTailingSlash(url) {
|
|
128
|
-
return url.endsWith(
|
|
129
|
-
? url.slice(0, -1)
|
|
130
|
-
: url;
|
|
127
|
+
return url.endsWith("/") ? url.slice(0, -1) : url;
|
|
131
128
|
}
|
|
132
129
|
function toDateTimeString(date) {
|
|
133
130
|
if (typeof date !== "string")
|
|
@@ -147,8 +144,7 @@ function toTimeString(date) {
|
|
|
147
144
|
function processFilters(filters) {
|
|
148
145
|
if (!filters)
|
|
149
146
|
return {};
|
|
150
|
-
return filters
|
|
151
|
-
.reduce((prev, { operator_id, values, field_id }) => {
|
|
147
|
+
return filters.reduce((prev, { operator_id, values, field_id }) => {
|
|
152
148
|
switch (operator_id) {
|
|
153
149
|
case exports.OperatorId.Equals:
|
|
154
150
|
case exports.OperatorId.MatchPrefix:
|
|
@@ -445,7 +441,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
445
441
|
class BaseApi {
|
|
446
442
|
constructor({ token, authRequest, settings }) {
|
|
447
443
|
this._authRequest = null;
|
|
448
|
-
this._moduleSubPath =
|
|
444
|
+
this._moduleSubPath = "";
|
|
449
445
|
if (token)
|
|
450
446
|
this._token = token;
|
|
451
447
|
if (authRequest)
|
|
@@ -456,13 +452,24 @@ class BaseApi {
|
|
|
456
452
|
}
|
|
457
453
|
loginDone() {
|
|
458
454
|
return __awaiter(this, void 0, void 0, function* () {
|
|
455
|
+
var _a;
|
|
459
456
|
if (!this._authRequest) {
|
|
460
457
|
return;
|
|
461
458
|
}
|
|
462
459
|
const { access_token, api_url, files_url } = yield this._authRequest;
|
|
463
460
|
this._token = access_token;
|
|
464
|
-
|
|
465
|
-
|
|
461
|
+
if (api_url && files_url) {
|
|
462
|
+
this._settings.apiUrl = trimTailingSlash(api_url);
|
|
463
|
+
this._settings.filesUrl = trimTailingSlash(files_url);
|
|
464
|
+
}
|
|
465
|
+
else {
|
|
466
|
+
this._settings.apiUrl =
|
|
467
|
+
(_a = this._settings.apiUrl) !== null && _a !== void 0 ? _a : this._settings.authUrl;
|
|
468
|
+
if (!this._settings.filesUrl) {
|
|
469
|
+
const authUrl = new URL(this._settings.authUrl);
|
|
470
|
+
this._settings.filesUrl = authUrl.origin;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
466
473
|
this._authRequest = null;
|
|
467
474
|
});
|
|
468
475
|
}
|
|
@@ -474,7 +481,7 @@ class BaseApi {
|
|
|
474
481
|
headers: headersOverride || (yield this.defaultHeaders()),
|
|
475
482
|
body: body,
|
|
476
483
|
});
|
|
477
|
-
return yield this._checkResponse(resp);
|
|
484
|
+
return (yield this._checkResponse(resp));
|
|
478
485
|
});
|
|
479
486
|
}
|
|
480
487
|
_checkResponse(resp) {
|
|
@@ -487,7 +494,7 @@ class BaseApi {
|
|
|
487
494
|
return yield resp.blob();
|
|
488
495
|
}
|
|
489
496
|
else {
|
|
490
|
-
return Promise.reject(yield resp.json());
|
|
497
|
+
return Promise.reject((yield resp.json()));
|
|
491
498
|
}
|
|
492
499
|
});
|
|
493
500
|
}
|
|
@@ -501,7 +508,7 @@ class BaseApi {
|
|
|
501
508
|
return __awaiter(this, void 0, void 0, function* () {
|
|
502
509
|
yield this.loginDone();
|
|
503
510
|
return {
|
|
504
|
-
|
|
511
|
+
Authorization: `Bearer ${this._token}`,
|
|
505
512
|
};
|
|
506
513
|
});
|
|
507
514
|
}
|
|
@@ -577,7 +584,7 @@ class RoleApi extends BaseApi {
|
|
|
577
584
|
const defaults = {
|
|
578
585
|
authUrl: "https://accounts.pyrus.com/api/v4",
|
|
579
586
|
apiUrl: "https://api.pyrus.com/v4",
|
|
580
|
-
filesUrl: "https://files.pyrus.com"
|
|
587
|
+
filesUrl: "https://files.pyrus.com",
|
|
581
588
|
};
|
|
582
589
|
|
|
583
590
|
class ProfileApi extends BaseApi {
|
|
@@ -642,7 +649,10 @@ class ListsApi extends BaseApi {
|
|
|
642
649
|
getTasksInList(listId, request) {
|
|
643
650
|
return __awaiter(this, void 0, void 0, function* () {
|
|
644
651
|
const searchParams = request ? toSearchParams(request) : "";
|
|
645
|
-
return yield this.fetchApi((yield this.getModulePath()) +
|
|
652
|
+
return yield this.fetchApi((yield this.getModulePath()) +
|
|
653
|
+
`/${listId}` +
|
|
654
|
+
Endpoints.ListTasks +
|
|
655
|
+
searchParams, "GET");
|
|
646
656
|
});
|
|
647
657
|
}
|
|
648
658
|
getInbox(request) {
|
|
@@ -703,7 +713,9 @@ class AnnouncementsApi extends BaseApi {
|
|
|
703
713
|
}
|
|
704
714
|
addComment(id, request) {
|
|
705
715
|
return __awaiter(this, void 0, void 0, function* () {
|
|
706
|
-
return yield this.fetchApi((yield this.getModulePath()) +
|
|
716
|
+
return yield this.fetchApi((yield this.getModulePath()) +
|
|
717
|
+
`/${id}` +
|
|
718
|
+
Endpoints.AnnouncementComments, "POST", JSON.stringify(request));
|
|
707
719
|
});
|
|
708
720
|
}
|
|
709
721
|
}
|
|
@@ -815,12 +827,16 @@ class FormsApi extends BaseApi {
|
|
|
815
827
|
}
|
|
816
828
|
getPermissions(_a) {
|
|
817
829
|
return __awaiter(this, arguments, void 0, function* ({ id }) {
|
|
818
|
-
return yield this.fetchApi((yield this.getModulePath()) +
|
|
830
|
+
return yield this.fetchApi((yield this.getModulePath()) +
|
|
831
|
+
`/${id}` +
|
|
832
|
+
Endpoints.FormsPermissions, "GET");
|
|
819
833
|
});
|
|
820
834
|
}
|
|
821
835
|
setPermissions(id, request) {
|
|
822
836
|
return __awaiter(this, void 0, void 0, function* () {
|
|
823
|
-
return yield this.fetchApi((yield this.getModulePath()) +
|
|
837
|
+
return yield this.fetchApi((yield this.getModulePath()) +
|
|
838
|
+
`/${id}` +
|
|
839
|
+
Endpoints.FormsPermissions, "POST", JSON.stringify(request));
|
|
824
840
|
});
|
|
825
841
|
}
|
|
826
842
|
}
|
|
@@ -858,7 +874,9 @@ class LogsApi extends BaseApi {
|
|
|
858
874
|
return __awaiter(this, void 0, void 0, function* () {
|
|
859
875
|
yield this.loginDone();
|
|
860
876
|
const searchParams = request ? toSearchParams(request) : "";
|
|
861
|
-
return yield this.fetchApi(this._settings.apiUrl +
|
|
877
|
+
return yield this.fetchApi(this._settings.apiUrl +
|
|
878
|
+
Endpoints.RegistryDownloadHistory +
|
|
879
|
+
searchParams, "GET");
|
|
862
880
|
});
|
|
863
881
|
}
|
|
864
882
|
}
|
package/build/esm/index.js
CHANGED
|
@@ -27,10 +27,17 @@ var FormFieldType;
|
|
|
27
27
|
FormFieldType["DueDateTime"] = "due_date_time";
|
|
28
28
|
})(FormFieldType || (FormFieldType = {}));
|
|
29
29
|
|
|
30
|
-
const dateTimeFieldTypes = [
|
|
30
|
+
const dateTimeFieldTypes = [
|
|
31
|
+
FormFieldType.DueDateTime,
|
|
32
|
+
FormFieldType.CreationDate,
|
|
33
|
+
];
|
|
31
34
|
const dateFieldTypes = [FormFieldType.Date, FormFieldType.DueDate];
|
|
32
35
|
const timeFieldTypes = [FormFieldType.Time];
|
|
33
|
-
const allDateAndTimeFieldTypes = [
|
|
36
|
+
const allDateAndTimeFieldTypes = [
|
|
37
|
+
...dateFieldTypes,
|
|
38
|
+
...dateTimeFieldTypes,
|
|
39
|
+
...timeFieldTypes,
|
|
40
|
+
];
|
|
34
41
|
const allDateAndTimeResponseKeys = [
|
|
35
42
|
"create_date",
|
|
36
43
|
"last_modified_date",
|
|
@@ -40,10 +47,7 @@ const allDateAndTimeResponseKeys = [
|
|
|
40
47
|
"scheduled_datetime_utc",
|
|
41
48
|
"close_date",
|
|
42
49
|
];
|
|
43
|
-
const dateRequestKeys = [
|
|
44
|
-
"due_date",
|
|
45
|
-
"scheduled_date",
|
|
46
|
-
];
|
|
50
|
+
const dateRequestKeys = ["due_date", "scheduled_date"];
|
|
47
51
|
const dateTimeRequestKeys = [
|
|
48
52
|
"start_date_utc",
|
|
49
53
|
"end_date_utc",
|
|
@@ -56,7 +60,7 @@ const dateTimeRequestKeys = [
|
|
|
56
60
|
"due",
|
|
57
61
|
"scheduled_datetime_utc",
|
|
58
62
|
"start_time",
|
|
59
|
-
"end_time"
|
|
63
|
+
"end_time",
|
|
60
64
|
];
|
|
61
65
|
|
|
62
66
|
var OperatorId;
|
|
@@ -71,22 +75,19 @@ var OperatorId;
|
|
|
71
75
|
})(OperatorId || (OperatorId = {}));
|
|
72
76
|
|
|
73
77
|
function toSearchParams(request) {
|
|
74
|
-
return "?" +
|
|
75
|
-
.map(([key, value]) => {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
.toString();
|
|
78
|
+
return ("?" +
|
|
79
|
+
new URLSearchParams(Object.entries(request).map(([key, value]) => {
|
|
80
|
+
if (value instanceof Date) {
|
|
81
|
+
if (dateTimeRequestKeys.includes(key))
|
|
82
|
+
return [key, toDateTimeString(value)];
|
|
83
|
+
if (dateRequestKeys.includes(key))
|
|
84
|
+
return [key, toDateString(value)];
|
|
85
|
+
}
|
|
86
|
+
return [key, value];
|
|
87
|
+
})).toString());
|
|
85
88
|
}
|
|
86
89
|
function extractDates(key, value) {
|
|
87
|
-
if (value instanceof Object
|
|
88
|
-
&& value.type
|
|
89
|
-
&& value.value) {
|
|
90
|
+
if (value instanceof Object && value.type && value.value) {
|
|
90
91
|
if (allDateAndTimeFieldTypes.includes(value.type)) {
|
|
91
92
|
value.value = new Date(value.value);
|
|
92
93
|
}
|
|
@@ -104,9 +105,7 @@ function packDates(key, value) {
|
|
|
104
105
|
if (dateTimeRequestKeys.includes(key)) {
|
|
105
106
|
return value && toDateTimeString(value);
|
|
106
107
|
}
|
|
107
|
-
if (value instanceof Object
|
|
108
|
-
&& value.type
|
|
109
|
-
&& value.value) {
|
|
108
|
+
if (value instanceof Object && value.type && value.value) {
|
|
110
109
|
if (dateTimeFieldTypes.includes(value.type)) {
|
|
111
110
|
value.value = toDateTimeString(value.value);
|
|
112
111
|
return value;
|
|
@@ -123,9 +122,7 @@ function packDates(key, value) {
|
|
|
123
122
|
return value;
|
|
124
123
|
}
|
|
125
124
|
function trimTailingSlash(url) {
|
|
126
|
-
return url.endsWith(
|
|
127
|
-
? url.slice(0, -1)
|
|
128
|
-
: url;
|
|
125
|
+
return url.endsWith("/") ? url.slice(0, -1) : url;
|
|
129
126
|
}
|
|
130
127
|
function toDateTimeString(date) {
|
|
131
128
|
if (typeof date !== "string")
|
|
@@ -145,8 +142,7 @@ function toTimeString(date) {
|
|
|
145
142
|
function processFilters(filters) {
|
|
146
143
|
if (!filters)
|
|
147
144
|
return {};
|
|
148
|
-
return filters
|
|
149
|
-
.reduce((prev, { operator_id, values, field_id }) => {
|
|
145
|
+
return filters.reduce((prev, { operator_id, values, field_id }) => {
|
|
150
146
|
switch (operator_id) {
|
|
151
147
|
case OperatorId.Equals:
|
|
152
148
|
case OperatorId.MatchPrefix:
|
|
@@ -443,7 +439,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
443
439
|
class BaseApi {
|
|
444
440
|
constructor({ token, authRequest, settings }) {
|
|
445
441
|
this._authRequest = null;
|
|
446
|
-
this._moduleSubPath =
|
|
442
|
+
this._moduleSubPath = "";
|
|
447
443
|
if (token)
|
|
448
444
|
this._token = token;
|
|
449
445
|
if (authRequest)
|
|
@@ -454,13 +450,24 @@ class BaseApi {
|
|
|
454
450
|
}
|
|
455
451
|
loginDone() {
|
|
456
452
|
return __awaiter(this, void 0, void 0, function* () {
|
|
453
|
+
var _a;
|
|
457
454
|
if (!this._authRequest) {
|
|
458
455
|
return;
|
|
459
456
|
}
|
|
460
457
|
const { access_token, api_url, files_url } = yield this._authRequest;
|
|
461
458
|
this._token = access_token;
|
|
462
|
-
|
|
463
|
-
|
|
459
|
+
if (api_url && files_url) {
|
|
460
|
+
this._settings.apiUrl = trimTailingSlash(api_url);
|
|
461
|
+
this._settings.filesUrl = trimTailingSlash(files_url);
|
|
462
|
+
}
|
|
463
|
+
else {
|
|
464
|
+
this._settings.apiUrl =
|
|
465
|
+
(_a = this._settings.apiUrl) !== null && _a !== void 0 ? _a : this._settings.authUrl;
|
|
466
|
+
if (!this._settings.filesUrl) {
|
|
467
|
+
const authUrl = new URL(this._settings.authUrl);
|
|
468
|
+
this._settings.filesUrl = authUrl.origin;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
464
471
|
this._authRequest = null;
|
|
465
472
|
});
|
|
466
473
|
}
|
|
@@ -472,7 +479,7 @@ class BaseApi {
|
|
|
472
479
|
headers: headersOverride || (yield this.defaultHeaders()),
|
|
473
480
|
body: body,
|
|
474
481
|
});
|
|
475
|
-
return yield this._checkResponse(resp);
|
|
482
|
+
return (yield this._checkResponse(resp));
|
|
476
483
|
});
|
|
477
484
|
}
|
|
478
485
|
_checkResponse(resp) {
|
|
@@ -485,7 +492,7 @@ class BaseApi {
|
|
|
485
492
|
return yield resp.blob();
|
|
486
493
|
}
|
|
487
494
|
else {
|
|
488
|
-
return Promise.reject(yield resp.json());
|
|
495
|
+
return Promise.reject((yield resp.json()));
|
|
489
496
|
}
|
|
490
497
|
});
|
|
491
498
|
}
|
|
@@ -499,7 +506,7 @@ class BaseApi {
|
|
|
499
506
|
return __awaiter(this, void 0, void 0, function* () {
|
|
500
507
|
yield this.loginDone();
|
|
501
508
|
return {
|
|
502
|
-
|
|
509
|
+
Authorization: `Bearer ${this._token}`,
|
|
503
510
|
};
|
|
504
511
|
});
|
|
505
512
|
}
|
|
@@ -575,7 +582,7 @@ class RoleApi extends BaseApi {
|
|
|
575
582
|
const defaults = {
|
|
576
583
|
authUrl: "https://accounts.pyrus.com/api/v4",
|
|
577
584
|
apiUrl: "https://api.pyrus.com/v4",
|
|
578
|
-
filesUrl: "https://files.pyrus.com"
|
|
585
|
+
filesUrl: "https://files.pyrus.com",
|
|
579
586
|
};
|
|
580
587
|
|
|
581
588
|
class ProfileApi extends BaseApi {
|
|
@@ -640,7 +647,10 @@ class ListsApi extends BaseApi {
|
|
|
640
647
|
getTasksInList(listId, request) {
|
|
641
648
|
return __awaiter(this, void 0, void 0, function* () {
|
|
642
649
|
const searchParams = request ? toSearchParams(request) : "";
|
|
643
|
-
return yield this.fetchApi((yield this.getModulePath()) +
|
|
650
|
+
return yield this.fetchApi((yield this.getModulePath()) +
|
|
651
|
+
`/${listId}` +
|
|
652
|
+
Endpoints.ListTasks +
|
|
653
|
+
searchParams, "GET");
|
|
644
654
|
});
|
|
645
655
|
}
|
|
646
656
|
getInbox(request) {
|
|
@@ -701,7 +711,9 @@ class AnnouncementsApi extends BaseApi {
|
|
|
701
711
|
}
|
|
702
712
|
addComment(id, request) {
|
|
703
713
|
return __awaiter(this, void 0, void 0, function* () {
|
|
704
|
-
return yield this.fetchApi((yield this.getModulePath()) +
|
|
714
|
+
return yield this.fetchApi((yield this.getModulePath()) +
|
|
715
|
+
`/${id}` +
|
|
716
|
+
Endpoints.AnnouncementComments, "POST", JSON.stringify(request));
|
|
705
717
|
});
|
|
706
718
|
}
|
|
707
719
|
}
|
|
@@ -813,12 +825,16 @@ class FormsApi extends BaseApi {
|
|
|
813
825
|
}
|
|
814
826
|
getPermissions(_a) {
|
|
815
827
|
return __awaiter(this, arguments, void 0, function* ({ id }) {
|
|
816
|
-
return yield this.fetchApi((yield this.getModulePath()) +
|
|
828
|
+
return yield this.fetchApi((yield this.getModulePath()) +
|
|
829
|
+
`/${id}` +
|
|
830
|
+
Endpoints.FormsPermissions, "GET");
|
|
817
831
|
});
|
|
818
832
|
}
|
|
819
833
|
setPermissions(id, request) {
|
|
820
834
|
return __awaiter(this, void 0, void 0, function* () {
|
|
821
|
-
return yield this.fetchApi((yield this.getModulePath()) +
|
|
835
|
+
return yield this.fetchApi((yield this.getModulePath()) +
|
|
836
|
+
`/${id}` +
|
|
837
|
+
Endpoints.FormsPermissions, "POST", JSON.stringify(request));
|
|
822
838
|
});
|
|
823
839
|
}
|
|
824
840
|
}
|
|
@@ -856,7 +872,9 @@ class LogsApi extends BaseApi {
|
|
|
856
872
|
return __awaiter(this, void 0, void 0, function* () {
|
|
857
873
|
yield this.loginDone();
|
|
858
874
|
const searchParams = request ? toSearchParams(request) : "";
|
|
859
|
-
return yield this.fetchApi(this._settings.apiUrl +
|
|
875
|
+
return yield this.fetchApi(this._settings.apiUrl +
|
|
876
|
+
Endpoints.RegistryDownloadHistory +
|
|
877
|
+
searchParams, "GET");
|
|
860
878
|
});
|
|
861
879
|
}
|
|
862
880
|
}
|
package/build/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { toDateString, toDateTimeString, toTimeString } from "./src/helpers/functions";
|
|
1
|
+
export { toDateString, toDateTimeString, toTimeString, } from "./src/helpers/functions";
|
|
2
2
|
export { FilterMask } from "./src/enums/filterMask";
|
|
3
3
|
export { CallEventType } from "./src/enums/callEventType";
|
|
4
4
|
export { SourceType } from "./src/enums/sourceType";
|
package/package.json
CHANGED
|
@@ -1,35 +1,47 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"types": "./build/types/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
"require": {
|
|
11
|
-
"default": "./build/cjs/index.cjs"
|
|
2
|
+
"name": "pyrus-api",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "Pyrus API client for TypeScript",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/simplygoodsoftware/pyrusapi-typescript.git"
|
|
12
8
|
},
|
|
13
|
-
"
|
|
14
|
-
|
|
9
|
+
"type": "module",
|
|
10
|
+
"main": "./build/cjs/index.js",
|
|
11
|
+
"module": "./build/esm/index.js",
|
|
12
|
+
"types": "./build/types/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
"require": {
|
|
15
|
+
"default": "./build/cjs/index.cjs"
|
|
16
|
+
},
|
|
17
|
+
"import": {
|
|
18
|
+
"default": "./build/esm/index.js"
|
|
19
|
+
},
|
|
20
|
+
"types": {
|
|
21
|
+
"default": "./build/types/index.d.ts"
|
|
22
|
+
}
|
|
15
23
|
},
|
|
16
|
-
"
|
|
17
|
-
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript && tsc --declaration --emitDeclarationOnly ",
|
|
26
|
+
"prepare": "husky"
|
|
27
|
+
},
|
|
28
|
+
"author": {
|
|
29
|
+
"name": "Pyrus",
|
|
30
|
+
"email": "contact@pyrus.com"
|
|
31
|
+
},
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
35
|
+
"@types/node": "^22.5.4",
|
|
36
|
+
"@types/rollup": "^0.54.0",
|
|
37
|
+
"husky": "^9.1.6",
|
|
38
|
+
"lint-staged": "^15.2.10",
|
|
39
|
+
"prettier": "2.5.1",
|
|
40
|
+
"rollup": "^4.21.2",
|
|
41
|
+
"rollup-plugin-cleandir": "^3.0.0",
|
|
42
|
+
"rollup-plugin-typescript2": "^0.36.0"
|
|
43
|
+
},
|
|
44
|
+
"lint-staged": {
|
|
45
|
+
"**/*": "prettier --write --ignore-unknown"
|
|
18
46
|
}
|
|
19
|
-
},
|
|
20
|
-
"scripts": {
|
|
21
|
-
"build": "rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript && tsc --declaration --emitDeclarationOnly "
|
|
22
|
-
},
|
|
23
|
-
"author": {
|
|
24
|
-
"name": "Pyrus",
|
|
25
|
-
"email": "contact@pyrus.com"
|
|
26
|
-
},
|
|
27
|
-
"license": "MIT",
|
|
28
|
-
"devDependencies": {
|
|
29
|
-
"@rollup/plugin-typescript": "^11.1.6",
|
|
30
|
-
"@types/node": "^22.5.4",
|
|
31
|
-
"@types/rollup": "^0.54.0",
|
|
32
|
-
"rollup": "^4.21.2",
|
|
33
|
-
"rollup-plugin-typescript2": "^0.36.0"
|
|
34
|
-
}
|
|
35
47
|
}
|