@getcommunity/gc-validators 0.0.75 → 0.0.77
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/index.cjs +28 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -4
- package/dist/index.d.ts +12 -4
- package/dist/index.js +26 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -901,6 +901,10 @@ var SUpdateClientProjectDocumentRequest = v5__namespace.object({
|
|
|
901
901
|
documentId: IsValidReferenceDocumentId,
|
|
902
902
|
data: SUpdateClientProjectDocument
|
|
903
903
|
});
|
|
904
|
+
var SAssociateClientToClientProjectDocument = v5__namespace.object({
|
|
905
|
+
client: IsValidReferenceDocumentId,
|
|
906
|
+
clientProject: IsValidReferenceDocumentId
|
|
907
|
+
});
|
|
904
908
|
var QueryStrapiSearchClientReports = v5__namespace.object({
|
|
905
909
|
page: v5__namespace.fallback(v5__namespace.optional(v5__namespace.pipe(v5__namespace.number(), v5__namespace.minValue(1)), 1), 1),
|
|
906
910
|
size: v5__namespace.fallback(
|
|
@@ -1643,6 +1647,27 @@ var SUpdateUtmTrackingLinkDocumentRequest = v5__namespace.object({
|
|
|
1643
1647
|
documentId: IsValidReferenceDocumentId,
|
|
1644
1648
|
data: SUpdateUtmTrackingLinkDocument
|
|
1645
1649
|
});
|
|
1650
|
+
|
|
1651
|
+
// src/utilities/datetime.ts
|
|
1652
|
+
function dateToday() {
|
|
1653
|
+
const date2 = /* @__PURE__ */ new Date();
|
|
1654
|
+
date2.setHours(0, 0, 0, 0);
|
|
1655
|
+
return date2;
|
|
1656
|
+
}
|
|
1657
|
+
function datePlusDays(today, days = 30) {
|
|
1658
|
+
const date2 = new Date(today);
|
|
1659
|
+
date2.setDate(date2.getDate() + days);
|
|
1660
|
+
date2.setHours(23, 59, 59, 999);
|
|
1661
|
+
return date2;
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
// src/utilities/strapi-responses.ts
|
|
1665
|
+
function isStrapiAttributeError(result) {
|
|
1666
|
+
return result.error.details.errors.length > 0;
|
|
1667
|
+
}
|
|
1668
|
+
function isStrapiStandardError(result) {
|
|
1669
|
+
return "error" in result && "details" in result.error && typeof result.error.details === "object" && result.error.details !== null && "errors" in result.error.details && result.error.details.errors !== void 0;
|
|
1670
|
+
}
|
|
1646
1671
|
function validateAndClean(schema, input) {
|
|
1647
1672
|
var _a, _b;
|
|
1648
1673
|
try {
|
|
@@ -1682,19 +1707,6 @@ function omitUndefined(obj) {
|
|
|
1682
1707
|
return result;
|
|
1683
1708
|
}
|
|
1684
1709
|
|
|
1685
|
-
// src/utilities/utilities-datetime.ts
|
|
1686
|
-
function dateToday() {
|
|
1687
|
-
const date2 = /* @__PURE__ */ new Date();
|
|
1688
|
-
date2.setHours(0, 0, 0, 0);
|
|
1689
|
-
return date2;
|
|
1690
|
-
}
|
|
1691
|
-
function datePlusDays(today, days = 30) {
|
|
1692
|
-
const date2 = new Date(today);
|
|
1693
|
-
date2.setDate(date2.getDate() + days);
|
|
1694
|
-
date2.setHours(23, 59, 59, 999);
|
|
1695
|
-
return date2;
|
|
1696
|
-
}
|
|
1697
|
-
|
|
1698
1710
|
exports.CLIENT_ENTITY_KEYS = CLIENT_ENTITY_KEYS;
|
|
1699
1711
|
exports.CLIENT_ENTITY_PERMISSIONS = CLIENT_ENTITY_PERMISSIONS;
|
|
1700
1712
|
exports.CLIENT_ENTITY_SCOPES = CLIENT_ENTITY_SCOPES;
|
|
@@ -1935,6 +1947,7 @@ exports.REGEX_DOMAIN = REGEX_DOMAIN;
|
|
|
1935
1947
|
exports.REGEX_NANP_PHONE = REGEX_NANP_PHONE;
|
|
1936
1948
|
exports.REGEX_URL_SLUG = REGEX_URL_SLUG;
|
|
1937
1949
|
exports.REGEX_UTM_VALUE = REGEX_UTM_VALUE;
|
|
1950
|
+
exports.SAssociateClientToClientProjectDocument = SAssociateClientToClientProjectDocument;
|
|
1938
1951
|
exports.SAuthConnectProviderConfirmation = SAuthConnectProviderConfirmation;
|
|
1939
1952
|
exports.SAuthConnectProviderRedirectSearch = SAuthConnectProviderRedirectSearch;
|
|
1940
1953
|
exports.SAuthRawAccessToken = SAuthRawAccessToken;
|
|
@@ -2014,6 +2027,8 @@ exports.ValidNumberOfEmployeeOptions = ValidNumberOfEmployeeOptions;
|
|
|
2014
2027
|
exports.ValidRatingRange5 = ValidRatingRange5;
|
|
2015
2028
|
exports.datePlusDays = datePlusDays;
|
|
2016
2029
|
exports.dateToday = dateToday;
|
|
2030
|
+
exports.isStrapiAttributeError = isStrapiAttributeError;
|
|
2031
|
+
exports.isStrapiStandardError = isStrapiStandardError;
|
|
2017
2032
|
exports.isValidationFailure = isValidationFailure;
|
|
2018
2033
|
exports.isValidationSuccess = isValidationSuccess;
|
|
2019
2034
|
exports.omitUndefined = omitUndefined;
|