@uniformdev/next-app-router 20.72.3-alpha.14 → 20.72.3-alpha.23
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/dist/cache.js +24 -49
- package/dist/cache.mjs +24 -49
- package/dist/component.js +24 -49
- package/dist/component.mjs +24 -49
- package/dist/handler.js +27 -50
- package/dist/handler.mjs +27 -50
- package/dist/index.esm.js +24 -49
- package/dist/index.js +24 -49
- package/dist/index.mjs +24 -49
- package/dist/middleware.js +24 -49
- package/dist/middleware.mjs +24 -49
- package/package.json +8 -8
package/dist/handler.js
CHANGED
|
@@ -417,6 +417,7 @@ var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cann
|
|
|
417
417
|
var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
418
418
|
var __privateAdd2 = (obj, member, value) => member.has(obj) ? __typeError2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
419
419
|
var defaultLimitPolicy = (0, import_p_limit.default)(6);
|
|
420
|
+
var UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE = "Bearer token not valid or expired";
|
|
420
421
|
var ApiClientError = class _ApiClientError extends Error {
|
|
421
422
|
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
422
423
|
super(
|
|
@@ -432,6 +433,12 @@ var ApiClientError = class _ApiClientError extends Error {
|
|
|
432
433
|
Object.setPrototypeOf(this, _ApiClientError.prototype);
|
|
433
434
|
}
|
|
434
435
|
};
|
|
436
|
+
var BearerTokenNotValidOrExpiredError = class _BearerTokenNotValidOrExpiredError extends ApiClientError {
|
|
437
|
+
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
438
|
+
super(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId);
|
|
439
|
+
Object.setPrototypeOf(this, _BearerTokenNotValidOrExpiredError.prototype);
|
|
440
|
+
}
|
|
441
|
+
};
|
|
435
442
|
var ApiClient = class _ApiClient {
|
|
436
443
|
constructor(options) {
|
|
437
444
|
__publicField2(this, "options");
|
|
@@ -465,7 +472,7 @@ var ApiClient = class _ApiClient {
|
|
|
465
472
|
}
|
|
466
473
|
async apiClientWithResponse(fetchUri, options) {
|
|
467
474
|
return this.options.limitPolicy(async () => {
|
|
468
|
-
var _a;
|
|
475
|
+
var _a, _b;
|
|
469
476
|
const coreHeaders = this.options.apiKey ? {
|
|
470
477
|
"x-api-key": this.options.apiKey
|
|
471
478
|
} : {
|
|
@@ -501,9 +508,19 @@ var ApiClient = class _ApiClient {
|
|
|
501
508
|
} catch (e) {
|
|
502
509
|
message = `General error`;
|
|
503
510
|
}
|
|
511
|
+
if (apiResponse.status === 401 && message === UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE) {
|
|
512
|
+
throw new BearerTokenNotValidOrExpiredError(
|
|
513
|
+
message,
|
|
514
|
+
(_a = options == null ? void 0 : options.method) != null ? _a : "GET",
|
|
515
|
+
fetchUri.toString(),
|
|
516
|
+
apiResponse.status,
|
|
517
|
+
apiResponse.statusText,
|
|
518
|
+
_ApiClient.getRequestId(apiResponse)
|
|
519
|
+
);
|
|
520
|
+
}
|
|
504
521
|
throw new ApiClientError(
|
|
505
522
|
message,
|
|
506
|
-
(
|
|
523
|
+
(_b = options == null ? void 0 : options.method) != null ? _b : "GET",
|
|
507
524
|
fetchUri.toString(),
|
|
508
525
|
apiResponse.status,
|
|
509
526
|
apiResponse.statusText,
|
|
@@ -1609,48 +1626,6 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1609
1626
|
_baseUrl = /* @__PURE__ */ new WeakMap();
|
|
1610
1627
|
__privateAdd3(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
|
|
1611
1628
|
var _url22;
|
|
1612
|
-
var _NotificationsClient = class _NotificationsClient2 extends ApiClient {
|
|
1613
|
-
constructor(options) {
|
|
1614
|
-
super(options);
|
|
1615
|
-
}
|
|
1616
|
-
/**
|
|
1617
|
-
* Lists notifications for the current user.
|
|
1618
|
-
*
|
|
1619
|
-
* @deprecated This API is experimental and may change without notice.
|
|
1620
|
-
*/
|
|
1621
|
-
async list(options) {
|
|
1622
|
-
const fetchUri = this.createUrl(__privateGet3(_NotificationsClient2, _url22), options);
|
|
1623
|
-
return await this.apiClient(fetchUri);
|
|
1624
|
-
}
|
|
1625
|
-
/**
|
|
1626
|
-
* Creates a notification for one or more recipients.
|
|
1627
|
-
*
|
|
1628
|
-
* @deprecated This API is experimental and may change without notice.
|
|
1629
|
-
*/
|
|
1630
|
-
async create(body) {
|
|
1631
|
-
const fetchUri = this.createUrl(__privateGet3(_NotificationsClient2, _url22));
|
|
1632
|
-
return await this.apiClient(fetchUri, {
|
|
1633
|
-
method: "POST",
|
|
1634
|
-
body: JSON.stringify(body)
|
|
1635
|
-
});
|
|
1636
|
-
}
|
|
1637
|
-
/**
|
|
1638
|
-
* Updates the read state of the current user's notifications.
|
|
1639
|
-
*
|
|
1640
|
-
* @deprecated This API is experimental and may change without notice.
|
|
1641
|
-
*/
|
|
1642
|
-
async setReadState(body) {
|
|
1643
|
-
const fetchUri = this.createUrl(__privateGet3(_NotificationsClient2, _url22));
|
|
1644
|
-
await this.apiClient(fetchUri, {
|
|
1645
|
-
method: "PATCH",
|
|
1646
|
-
body: JSON.stringify(body),
|
|
1647
|
-
expectNoContent: true
|
|
1648
|
-
});
|
|
1649
|
-
}
|
|
1650
|
-
};
|
|
1651
|
-
_url22 = /* @__PURE__ */ new WeakMap();
|
|
1652
|
-
__privateAdd3(_NotificationsClient, _url22, "/api/v1/notifications");
|
|
1653
|
-
var _url32;
|
|
1654
1629
|
var _projectsUrl;
|
|
1655
1630
|
var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
1656
1631
|
constructor(options) {
|
|
@@ -1658,7 +1633,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1658
1633
|
}
|
|
1659
1634
|
/** Fetches single Project */
|
|
1660
1635
|
async get(options) {
|
|
1661
|
-
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2,
|
|
1636
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22), { ...options });
|
|
1662
1637
|
return await this.apiClient(fetchUri);
|
|
1663
1638
|
}
|
|
1664
1639
|
/**
|
|
@@ -1676,7 +1651,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1676
1651
|
}
|
|
1677
1652
|
/** Updates or creates (based on id) a Project */
|
|
1678
1653
|
async save(body) {
|
|
1679
|
-
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2,
|
|
1654
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
|
|
1680
1655
|
return await this.apiClient(fetchUri, {
|
|
1681
1656
|
method: "PUT",
|
|
1682
1657
|
body: JSON.stringify({ ...body })
|
|
@@ -1688,7 +1663,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1688
1663
|
}
|
|
1689
1664
|
/** Deletes a Project */
|
|
1690
1665
|
async remove(body) {
|
|
1691
|
-
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2,
|
|
1666
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
|
|
1692
1667
|
await this.apiClient(fetchUri, {
|
|
1693
1668
|
method: "DELETE",
|
|
1694
1669
|
body: JSON.stringify({ ...body }),
|
|
@@ -1700,12 +1675,14 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1700
1675
|
return this.remove(body);
|
|
1701
1676
|
}
|
|
1702
1677
|
};
|
|
1703
|
-
|
|
1678
|
+
_url22 = /* @__PURE__ */ new WeakMap();
|
|
1704
1679
|
_projectsUrl = /* @__PURE__ */ new WeakMap();
|
|
1705
|
-
__privateAdd3(_ProjectClient,
|
|
1680
|
+
__privateAdd3(_ProjectClient, _url22, "/api/v1/project");
|
|
1706
1681
|
__privateAdd3(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
1707
1682
|
var isAllowedReferrer = (referrer) => {
|
|
1708
|
-
return Boolean(
|
|
1683
|
+
return Boolean(
|
|
1684
|
+
referrer == null ? void 0 : referrer.match(/(^https:\/\/|\.)(uniform.app|uniform.wtf|uniformcode.ai|localhost:\d{4})\//)
|
|
1685
|
+
);
|
|
1709
1686
|
};
|
|
1710
1687
|
|
|
1711
1688
|
// src/handler/createPreviewGETRouteHandler.ts
|
package/dist/handler.mjs
CHANGED
|
@@ -402,6 +402,7 @@ var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cann
|
|
|
402
402
|
var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
403
403
|
var __privateAdd2 = (obj, member, value) => member.has(obj) ? __typeError2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
404
404
|
var defaultLimitPolicy = (0, import_p_limit.default)(6);
|
|
405
|
+
var UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE = "Bearer token not valid or expired";
|
|
405
406
|
var ApiClientError = class _ApiClientError extends Error {
|
|
406
407
|
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
407
408
|
super(
|
|
@@ -417,6 +418,12 @@ var ApiClientError = class _ApiClientError extends Error {
|
|
|
417
418
|
Object.setPrototypeOf(this, _ApiClientError.prototype);
|
|
418
419
|
}
|
|
419
420
|
};
|
|
421
|
+
var BearerTokenNotValidOrExpiredError = class _BearerTokenNotValidOrExpiredError extends ApiClientError {
|
|
422
|
+
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
423
|
+
super(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId);
|
|
424
|
+
Object.setPrototypeOf(this, _BearerTokenNotValidOrExpiredError.prototype);
|
|
425
|
+
}
|
|
426
|
+
};
|
|
420
427
|
var ApiClient = class _ApiClient {
|
|
421
428
|
constructor(options) {
|
|
422
429
|
__publicField2(this, "options");
|
|
@@ -450,7 +457,7 @@ var ApiClient = class _ApiClient {
|
|
|
450
457
|
}
|
|
451
458
|
async apiClientWithResponse(fetchUri, options) {
|
|
452
459
|
return this.options.limitPolicy(async () => {
|
|
453
|
-
var _a;
|
|
460
|
+
var _a, _b;
|
|
454
461
|
const coreHeaders = this.options.apiKey ? {
|
|
455
462
|
"x-api-key": this.options.apiKey
|
|
456
463
|
} : {
|
|
@@ -486,9 +493,19 @@ var ApiClient = class _ApiClient {
|
|
|
486
493
|
} catch (e) {
|
|
487
494
|
message = `General error`;
|
|
488
495
|
}
|
|
496
|
+
if (apiResponse.status === 401 && message === UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE) {
|
|
497
|
+
throw new BearerTokenNotValidOrExpiredError(
|
|
498
|
+
message,
|
|
499
|
+
(_a = options == null ? void 0 : options.method) != null ? _a : "GET",
|
|
500
|
+
fetchUri.toString(),
|
|
501
|
+
apiResponse.status,
|
|
502
|
+
apiResponse.statusText,
|
|
503
|
+
_ApiClient.getRequestId(apiResponse)
|
|
504
|
+
);
|
|
505
|
+
}
|
|
489
506
|
throw new ApiClientError(
|
|
490
507
|
message,
|
|
491
|
-
(
|
|
508
|
+
(_b = options == null ? void 0 : options.method) != null ? _b : "GET",
|
|
492
509
|
fetchUri.toString(),
|
|
493
510
|
apiResponse.status,
|
|
494
511
|
apiResponse.statusText,
|
|
@@ -1594,48 +1611,6 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
1594
1611
|
_baseUrl = /* @__PURE__ */ new WeakMap();
|
|
1595
1612
|
__privateAdd3(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
|
|
1596
1613
|
var _url22;
|
|
1597
|
-
var _NotificationsClient = class _NotificationsClient2 extends ApiClient {
|
|
1598
|
-
constructor(options) {
|
|
1599
|
-
super(options);
|
|
1600
|
-
}
|
|
1601
|
-
/**
|
|
1602
|
-
* Lists notifications for the current user.
|
|
1603
|
-
*
|
|
1604
|
-
* @deprecated This API is experimental and may change without notice.
|
|
1605
|
-
*/
|
|
1606
|
-
async list(options) {
|
|
1607
|
-
const fetchUri = this.createUrl(__privateGet3(_NotificationsClient2, _url22), options);
|
|
1608
|
-
return await this.apiClient(fetchUri);
|
|
1609
|
-
}
|
|
1610
|
-
/**
|
|
1611
|
-
* Creates a notification for one or more recipients.
|
|
1612
|
-
*
|
|
1613
|
-
* @deprecated This API is experimental and may change without notice.
|
|
1614
|
-
*/
|
|
1615
|
-
async create(body) {
|
|
1616
|
-
const fetchUri = this.createUrl(__privateGet3(_NotificationsClient2, _url22));
|
|
1617
|
-
return await this.apiClient(fetchUri, {
|
|
1618
|
-
method: "POST",
|
|
1619
|
-
body: JSON.stringify(body)
|
|
1620
|
-
});
|
|
1621
|
-
}
|
|
1622
|
-
/**
|
|
1623
|
-
* Updates the read state of the current user's notifications.
|
|
1624
|
-
*
|
|
1625
|
-
* @deprecated This API is experimental and may change without notice.
|
|
1626
|
-
*/
|
|
1627
|
-
async setReadState(body) {
|
|
1628
|
-
const fetchUri = this.createUrl(__privateGet3(_NotificationsClient2, _url22));
|
|
1629
|
-
await this.apiClient(fetchUri, {
|
|
1630
|
-
method: "PATCH",
|
|
1631
|
-
body: JSON.stringify(body),
|
|
1632
|
-
expectNoContent: true
|
|
1633
|
-
});
|
|
1634
|
-
}
|
|
1635
|
-
};
|
|
1636
|
-
_url22 = /* @__PURE__ */ new WeakMap();
|
|
1637
|
-
__privateAdd3(_NotificationsClient, _url22, "/api/v1/notifications");
|
|
1638
|
-
var _url32;
|
|
1639
1614
|
var _projectsUrl;
|
|
1640
1615
|
var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
1641
1616
|
constructor(options) {
|
|
@@ -1643,7 +1618,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1643
1618
|
}
|
|
1644
1619
|
/** Fetches single Project */
|
|
1645
1620
|
async get(options) {
|
|
1646
|
-
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2,
|
|
1621
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22), { ...options });
|
|
1647
1622
|
return await this.apiClient(fetchUri);
|
|
1648
1623
|
}
|
|
1649
1624
|
/**
|
|
@@ -1661,7 +1636,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1661
1636
|
}
|
|
1662
1637
|
/** Updates or creates (based on id) a Project */
|
|
1663
1638
|
async save(body) {
|
|
1664
|
-
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2,
|
|
1639
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
|
|
1665
1640
|
return await this.apiClient(fetchUri, {
|
|
1666
1641
|
method: "PUT",
|
|
1667
1642
|
body: JSON.stringify({ ...body })
|
|
@@ -1673,7 +1648,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1673
1648
|
}
|
|
1674
1649
|
/** Deletes a Project */
|
|
1675
1650
|
async remove(body) {
|
|
1676
|
-
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2,
|
|
1651
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
|
|
1677
1652
|
await this.apiClient(fetchUri, {
|
|
1678
1653
|
method: "DELETE",
|
|
1679
1654
|
body: JSON.stringify({ ...body }),
|
|
@@ -1685,12 +1660,14 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
1685
1660
|
return this.remove(body);
|
|
1686
1661
|
}
|
|
1687
1662
|
};
|
|
1688
|
-
|
|
1663
|
+
_url22 = /* @__PURE__ */ new WeakMap();
|
|
1689
1664
|
_projectsUrl = /* @__PURE__ */ new WeakMap();
|
|
1690
|
-
__privateAdd3(_ProjectClient,
|
|
1665
|
+
__privateAdd3(_ProjectClient, _url22, "/api/v1/project");
|
|
1691
1666
|
__privateAdd3(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
1692
1667
|
var isAllowedReferrer = (referrer) => {
|
|
1693
|
-
return Boolean(
|
|
1668
|
+
return Boolean(
|
|
1669
|
+
referrer == null ? void 0 : referrer.match(/(^https:\/\/|\.)(uniform.app|uniform.wtf|uniformcode.ai|localhost:\d{4})\//)
|
|
1670
|
+
);
|
|
1694
1671
|
};
|
|
1695
1672
|
|
|
1696
1673
|
// src/handler/createPreviewGETRouteHandler.ts
|
package/dist/index.esm.js
CHANGED
|
@@ -408,6 +408,7 @@ var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cann
|
|
|
408
408
|
var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
409
409
|
var __privateAdd2 = (obj, member, value) => member.has(obj) ? __typeError2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
410
410
|
var defaultLimitPolicy = (0, import_p_limit.default)(6);
|
|
411
|
+
var UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE = "Bearer token not valid or expired";
|
|
411
412
|
var ApiClientError = class _ApiClientError extends Error {
|
|
412
413
|
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
413
414
|
super(
|
|
@@ -423,6 +424,12 @@ var ApiClientError = class _ApiClientError extends Error {
|
|
|
423
424
|
Object.setPrototypeOf(this, _ApiClientError.prototype);
|
|
424
425
|
}
|
|
425
426
|
};
|
|
427
|
+
var BearerTokenNotValidOrExpiredError = class _BearerTokenNotValidOrExpiredError extends ApiClientError {
|
|
428
|
+
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
429
|
+
super(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId);
|
|
430
|
+
Object.setPrototypeOf(this, _BearerTokenNotValidOrExpiredError.prototype);
|
|
431
|
+
}
|
|
432
|
+
};
|
|
426
433
|
var ApiClient = class _ApiClient {
|
|
427
434
|
constructor(options) {
|
|
428
435
|
__publicField2(this, "options");
|
|
@@ -456,7 +463,7 @@ var ApiClient = class _ApiClient {
|
|
|
456
463
|
}
|
|
457
464
|
async apiClientWithResponse(fetchUri, options) {
|
|
458
465
|
return this.options.limitPolicy(async () => {
|
|
459
|
-
var _a;
|
|
466
|
+
var _a, _b;
|
|
460
467
|
const coreHeaders = this.options.apiKey ? {
|
|
461
468
|
"x-api-key": this.options.apiKey
|
|
462
469
|
} : {
|
|
@@ -492,9 +499,19 @@ var ApiClient = class _ApiClient {
|
|
|
492
499
|
} catch (e) {
|
|
493
500
|
message = `General error`;
|
|
494
501
|
}
|
|
502
|
+
if (apiResponse.status === 401 && message === UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE) {
|
|
503
|
+
throw new BearerTokenNotValidOrExpiredError(
|
|
504
|
+
message,
|
|
505
|
+
(_a = options == null ? void 0 : options.method) != null ? _a : "GET",
|
|
506
|
+
fetchUri.toString(),
|
|
507
|
+
apiResponse.status,
|
|
508
|
+
apiResponse.statusText,
|
|
509
|
+
_ApiClient.getRequestId(apiResponse)
|
|
510
|
+
);
|
|
511
|
+
}
|
|
495
512
|
throw new ApiClientError(
|
|
496
513
|
message,
|
|
497
|
-
(
|
|
514
|
+
(_b = options == null ? void 0 : options.method) != null ? _b : "GET",
|
|
498
515
|
fetchUri.toString(),
|
|
499
516
|
apiResponse.status,
|
|
500
517
|
apiResponse.statusText,
|
|
@@ -2083,48 +2100,6 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
2083
2100
|
_baseUrl = /* @__PURE__ */ new WeakMap();
|
|
2084
2101
|
__privateAdd3(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
|
|
2085
2102
|
var _url22;
|
|
2086
|
-
var _NotificationsClient = class _NotificationsClient2 extends ApiClient {
|
|
2087
|
-
constructor(options) {
|
|
2088
|
-
super(options);
|
|
2089
|
-
}
|
|
2090
|
-
/**
|
|
2091
|
-
* Lists notifications for the current user.
|
|
2092
|
-
*
|
|
2093
|
-
* @deprecated This API is experimental and may change without notice.
|
|
2094
|
-
*/
|
|
2095
|
-
async list(options) {
|
|
2096
|
-
const fetchUri = this.createUrl(__privateGet3(_NotificationsClient2, _url22), options);
|
|
2097
|
-
return await this.apiClient(fetchUri);
|
|
2098
|
-
}
|
|
2099
|
-
/**
|
|
2100
|
-
* Creates a notification for one or more recipients.
|
|
2101
|
-
*
|
|
2102
|
-
* @deprecated This API is experimental and may change without notice.
|
|
2103
|
-
*/
|
|
2104
|
-
async create(body) {
|
|
2105
|
-
const fetchUri = this.createUrl(__privateGet3(_NotificationsClient2, _url22));
|
|
2106
|
-
return await this.apiClient(fetchUri, {
|
|
2107
|
-
method: "POST",
|
|
2108
|
-
body: JSON.stringify(body)
|
|
2109
|
-
});
|
|
2110
|
-
}
|
|
2111
|
-
/**
|
|
2112
|
-
* Updates the read state of the current user's notifications.
|
|
2113
|
-
*
|
|
2114
|
-
* @deprecated This API is experimental and may change without notice.
|
|
2115
|
-
*/
|
|
2116
|
-
async setReadState(body) {
|
|
2117
|
-
const fetchUri = this.createUrl(__privateGet3(_NotificationsClient2, _url22));
|
|
2118
|
-
await this.apiClient(fetchUri, {
|
|
2119
|
-
method: "PATCH",
|
|
2120
|
-
body: JSON.stringify(body),
|
|
2121
|
-
expectNoContent: true
|
|
2122
|
-
});
|
|
2123
|
-
}
|
|
2124
|
-
};
|
|
2125
|
-
_url22 = /* @__PURE__ */ new WeakMap();
|
|
2126
|
-
__privateAdd3(_NotificationsClient, _url22, "/api/v1/notifications");
|
|
2127
|
-
var _url32;
|
|
2128
2103
|
var _projectsUrl;
|
|
2129
2104
|
var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
2130
2105
|
constructor(options) {
|
|
@@ -2132,7 +2107,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
2132
2107
|
}
|
|
2133
2108
|
/** Fetches single Project */
|
|
2134
2109
|
async get(options) {
|
|
2135
|
-
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2,
|
|
2110
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22), { ...options });
|
|
2136
2111
|
return await this.apiClient(fetchUri);
|
|
2137
2112
|
}
|
|
2138
2113
|
/**
|
|
@@ -2150,7 +2125,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
2150
2125
|
}
|
|
2151
2126
|
/** Updates or creates (based on id) a Project */
|
|
2152
2127
|
async save(body) {
|
|
2153
|
-
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2,
|
|
2128
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
|
|
2154
2129
|
return await this.apiClient(fetchUri, {
|
|
2155
2130
|
method: "PUT",
|
|
2156
2131
|
body: JSON.stringify({ ...body })
|
|
@@ -2162,7 +2137,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
2162
2137
|
}
|
|
2163
2138
|
/** Deletes a Project */
|
|
2164
2139
|
async remove(body) {
|
|
2165
|
-
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2,
|
|
2140
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
|
|
2166
2141
|
await this.apiClient(fetchUri, {
|
|
2167
2142
|
method: "DELETE",
|
|
2168
2143
|
body: JSON.stringify({ ...body }),
|
|
@@ -2174,9 +2149,9 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
2174
2149
|
return this.remove(body);
|
|
2175
2150
|
}
|
|
2176
2151
|
};
|
|
2177
|
-
|
|
2152
|
+
_url22 = /* @__PURE__ */ new WeakMap();
|
|
2178
2153
|
_projectsUrl = /* @__PURE__ */ new WeakMap();
|
|
2179
|
-
__privateAdd3(_ProjectClient,
|
|
2154
|
+
__privateAdd3(_ProjectClient, _url22, "/api/v1/project");
|
|
2180
2155
|
__privateAdd3(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
2181
2156
|
var ROUTE_URL = "/api/v1/route";
|
|
2182
2157
|
var RouteClient = class extends ApiClient {
|
package/dist/index.js
CHANGED
|
@@ -436,6 +436,7 @@ var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cann
|
|
|
436
436
|
var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
437
437
|
var __privateAdd2 = (obj, member, value) => member.has(obj) ? __typeError2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
438
438
|
var defaultLimitPolicy = (0, import_p_limit.default)(6);
|
|
439
|
+
var UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE = "Bearer token not valid or expired";
|
|
439
440
|
var ApiClientError = class _ApiClientError extends Error {
|
|
440
441
|
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
441
442
|
super(
|
|
@@ -451,6 +452,12 @@ var ApiClientError = class _ApiClientError extends Error {
|
|
|
451
452
|
Object.setPrototypeOf(this, _ApiClientError.prototype);
|
|
452
453
|
}
|
|
453
454
|
};
|
|
455
|
+
var BearerTokenNotValidOrExpiredError = class _BearerTokenNotValidOrExpiredError extends ApiClientError {
|
|
456
|
+
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
457
|
+
super(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId);
|
|
458
|
+
Object.setPrototypeOf(this, _BearerTokenNotValidOrExpiredError.prototype);
|
|
459
|
+
}
|
|
460
|
+
};
|
|
454
461
|
var ApiClient = class _ApiClient {
|
|
455
462
|
constructor(options) {
|
|
456
463
|
__publicField2(this, "options");
|
|
@@ -484,7 +491,7 @@ var ApiClient = class _ApiClient {
|
|
|
484
491
|
}
|
|
485
492
|
async apiClientWithResponse(fetchUri, options) {
|
|
486
493
|
return this.options.limitPolicy(async () => {
|
|
487
|
-
var _a;
|
|
494
|
+
var _a, _b;
|
|
488
495
|
const coreHeaders = this.options.apiKey ? {
|
|
489
496
|
"x-api-key": this.options.apiKey
|
|
490
497
|
} : {
|
|
@@ -520,9 +527,19 @@ var ApiClient = class _ApiClient {
|
|
|
520
527
|
} catch (e) {
|
|
521
528
|
message = `General error`;
|
|
522
529
|
}
|
|
530
|
+
if (apiResponse.status === 401 && message === UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE) {
|
|
531
|
+
throw new BearerTokenNotValidOrExpiredError(
|
|
532
|
+
message,
|
|
533
|
+
(_a = options == null ? void 0 : options.method) != null ? _a : "GET",
|
|
534
|
+
fetchUri.toString(),
|
|
535
|
+
apiResponse.status,
|
|
536
|
+
apiResponse.statusText,
|
|
537
|
+
_ApiClient.getRequestId(apiResponse)
|
|
538
|
+
);
|
|
539
|
+
}
|
|
523
540
|
throw new ApiClientError(
|
|
524
541
|
message,
|
|
525
|
-
(
|
|
542
|
+
(_b = options == null ? void 0 : options.method) != null ? _b : "GET",
|
|
526
543
|
fetchUri.toString(),
|
|
527
544
|
apiResponse.status,
|
|
528
545
|
apiResponse.statusText,
|
|
@@ -2111,48 +2128,6 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
2111
2128
|
_baseUrl = /* @__PURE__ */ new WeakMap();
|
|
2112
2129
|
__privateAdd3(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
|
|
2113
2130
|
var _url22;
|
|
2114
|
-
var _NotificationsClient = class _NotificationsClient2 extends ApiClient {
|
|
2115
|
-
constructor(options) {
|
|
2116
|
-
super(options);
|
|
2117
|
-
}
|
|
2118
|
-
/**
|
|
2119
|
-
* Lists notifications for the current user.
|
|
2120
|
-
*
|
|
2121
|
-
* @deprecated This API is experimental and may change without notice.
|
|
2122
|
-
*/
|
|
2123
|
-
async list(options) {
|
|
2124
|
-
const fetchUri = this.createUrl(__privateGet3(_NotificationsClient2, _url22), options);
|
|
2125
|
-
return await this.apiClient(fetchUri);
|
|
2126
|
-
}
|
|
2127
|
-
/**
|
|
2128
|
-
* Creates a notification for one or more recipients.
|
|
2129
|
-
*
|
|
2130
|
-
* @deprecated This API is experimental and may change without notice.
|
|
2131
|
-
*/
|
|
2132
|
-
async create(body) {
|
|
2133
|
-
const fetchUri = this.createUrl(__privateGet3(_NotificationsClient2, _url22));
|
|
2134
|
-
return await this.apiClient(fetchUri, {
|
|
2135
|
-
method: "POST",
|
|
2136
|
-
body: JSON.stringify(body)
|
|
2137
|
-
});
|
|
2138
|
-
}
|
|
2139
|
-
/**
|
|
2140
|
-
* Updates the read state of the current user's notifications.
|
|
2141
|
-
*
|
|
2142
|
-
* @deprecated This API is experimental and may change without notice.
|
|
2143
|
-
*/
|
|
2144
|
-
async setReadState(body) {
|
|
2145
|
-
const fetchUri = this.createUrl(__privateGet3(_NotificationsClient2, _url22));
|
|
2146
|
-
await this.apiClient(fetchUri, {
|
|
2147
|
-
method: "PATCH",
|
|
2148
|
-
body: JSON.stringify(body),
|
|
2149
|
-
expectNoContent: true
|
|
2150
|
-
});
|
|
2151
|
-
}
|
|
2152
|
-
};
|
|
2153
|
-
_url22 = /* @__PURE__ */ new WeakMap();
|
|
2154
|
-
__privateAdd3(_NotificationsClient, _url22, "/api/v1/notifications");
|
|
2155
|
-
var _url32;
|
|
2156
2131
|
var _projectsUrl;
|
|
2157
2132
|
var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
2158
2133
|
constructor(options) {
|
|
@@ -2160,7 +2135,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
2160
2135
|
}
|
|
2161
2136
|
/** Fetches single Project */
|
|
2162
2137
|
async get(options) {
|
|
2163
|
-
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2,
|
|
2138
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22), { ...options });
|
|
2164
2139
|
return await this.apiClient(fetchUri);
|
|
2165
2140
|
}
|
|
2166
2141
|
/**
|
|
@@ -2178,7 +2153,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
2178
2153
|
}
|
|
2179
2154
|
/** Updates or creates (based on id) a Project */
|
|
2180
2155
|
async save(body) {
|
|
2181
|
-
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2,
|
|
2156
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
|
|
2182
2157
|
return await this.apiClient(fetchUri, {
|
|
2183
2158
|
method: "PUT",
|
|
2184
2159
|
body: JSON.stringify({ ...body })
|
|
@@ -2190,7 +2165,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
2190
2165
|
}
|
|
2191
2166
|
/** Deletes a Project */
|
|
2192
2167
|
async remove(body) {
|
|
2193
|
-
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2,
|
|
2168
|
+
const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
|
|
2194
2169
|
await this.apiClient(fetchUri, {
|
|
2195
2170
|
method: "DELETE",
|
|
2196
2171
|
body: JSON.stringify({ ...body }),
|
|
@@ -2202,9 +2177,9 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
2202
2177
|
return this.remove(body);
|
|
2203
2178
|
}
|
|
2204
2179
|
};
|
|
2205
|
-
|
|
2180
|
+
_url22 = /* @__PURE__ */ new WeakMap();
|
|
2206
2181
|
_projectsUrl = /* @__PURE__ */ new WeakMap();
|
|
2207
|
-
__privateAdd3(_ProjectClient,
|
|
2182
|
+
__privateAdd3(_ProjectClient, _url22, "/api/v1/project");
|
|
2208
2183
|
__privateAdd3(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
2209
2184
|
var ROUTE_URL = "/api/v1/route";
|
|
2210
2185
|
var RouteClient = class extends ApiClient {
|