@graphcms/validation
Advanced tools
Comparing version 1.3.21 to 1.4.0
# @graphcms/validation | ||
## 1.4.0 | ||
### Minor Changes | ||
- [#34](https://github.com/GraphCMS/validation/pull/34) [`1aa3190`](https://github.com/GraphCMS/validation/commit/1aa31909444af32142b4290c4aef3a81fb10a38f) Thanks [@StarpTech](https://github.com/StarpTech)! - Support localhost and port in webhook url, update dependencies | ||
## 1.3.20 | ||
@@ -4,0 +10,0 @@ |
@@ -33,2 +33,2 @@ import * as yup from 'yup'; | ||
export declare const modelId: yup.StringSchema; | ||
export declare const previewURLs: yup.ArraySchema<{}>; | ||
export declare const previewURLs: yup.ArraySchema<unknown>; |
var yup = require('yup'); | ||
var name = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1).ensure().trim('The name of an authentication token may not start or end with white space characters.'); | ||
var description = yup.string().nullable(true); | ||
var scope = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).oneOf(['READ', | ||
'WRITE','OPEN'], "An authentication token can only be set to one of 'READ', 'WRITE' or 'OPEN'"); | ||
function _interopNamespace(e) { | ||
if (e && e.__esModule) return e; | ||
var n = Object.create(null); | ||
if (e) { | ||
Object.keys(e).forEach(function (k) { | ||
if (k !== 'default') { | ||
var d = Object.getOwnPropertyDescriptor(e, k); | ||
Object.defineProperty(n, k, d.get ? d : { | ||
enumerable: true, | ||
get: function () { return e[k]; } | ||
}); | ||
} | ||
}); | ||
} | ||
n["default"] = e; | ||
return n; | ||
} | ||
var yup__namespace = /*#__PURE__*/_interopNamespace(yup); | ||
var name$5 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1).ensure().trim('The name of an authentication token may not start or end with white space characters.'); | ||
var description$4 = yup__namespace.string().nullable(true); | ||
var scope = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).oneOf(['READ', 'WRITE', 'OPEN'], "An authentication token can only be set to one of 'READ', 'WRITE' or 'OPEN'"); | ||
var authtoken = { | ||
__proto__: null, | ||
name: name$5, | ||
description: description$4, | ||
scope: scope | ||
}; | ||
var authtoken = ({ | ||
name: name, | ||
description: description, | ||
scope: scope | ||
}); | ||
var graphQlTypeNames = ['int','float','string','boolean','enum','interface', | ||
'union','fragment','datetime','json','mutation','subscription','scalar','query', | ||
'input','node']; | ||
var reservedNonSystemTypeNames = ['Id','User','Search','Status','Locale','RichText', | ||
'RichTextAST','Location','LocationInput','Color','ColorInput','RGBATransparency', | ||
'RGBAHue','HEX','RGBA','ScheduledRelease','ScheduledOperation']; | ||
var reservedNonSystemFieldNames = ['id','createdat','updatedat','versions','createdby', | ||
'status','publishedat','localizations','documentInStages','publish','locale', | ||
'updatedby','publishedby']; | ||
var graphQlTypeNames = ['int', 'float', 'string', 'boolean', 'enum', 'interface', 'union', 'fragment', 'datetime', 'json', 'mutation', 'subscription', 'scalar', 'query', 'input', 'node']; | ||
var reservedNonSystemTypeNames = ['Id', 'User', 'Search', 'Status', 'Locale', 'RichText', 'RichTextAST', 'Location', 'LocationInput', 'Color', 'ColorInput', 'RGBATransparency', 'RGBAHue', 'HEX', 'RGBA', 'ScheduledRelease', 'ScheduledOperation']; | ||
var reservedNonSystemFieldNames = ['id', 'createdat', 'updatedat', 'versions', 'createdby', 'status', 'publishedat', 'localizations', 'documentInStages', 'publish', 'locale', 'updatedby', 'publishedby']; | ||
var reservedModelApiIds = ['Type'].concat(reservedNonSystemTypeNames); | ||
@@ -31,266 +41,519 @@ var reservedEnumerationApiIds = ['Type'].concat(reservedNonSystemTypeNames); | ||
var apiId = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter an Api Id.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
name: 'no-graphql-type', | ||
test: function (value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
/** | ||
* Matcher for enumeration api IDs: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .min() -> Sets minimum required length of string to 1 character | ||
* .max() -> Sets maximum required length of string to 64 characters | ||
* .matches(:RegExpr) -> Matches the input value against a regular expression | ||
*/ | ||
var apiId$3 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter an Api Id.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
name: 'no-graphql-type', | ||
test: function test(value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).test({ | ||
name: 'no-reserved-word', | ||
test: function (value) { | ||
var options = this.options; | ||
if (options.context && options.context.isSystem) { | ||
return true; | ||
} | ||
var reservedApiIds = reservedEnumerationApiIds; | ||
if (options.context && options.context.isLocalized) { | ||
reservedApiIds = reservedEnumerationApiIds.filter(function (word) { | ||
return word !== 'Locale'; | ||
}); | ||
} | ||
return !reservedApiIds.some(function (reservedWord) { | ||
return value ? reservedWord.toLowerCase() === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).matches(/^[A-Z][a-zA-Z0-9_]*$/, 'Start with a capital letter and use only alphanumeric characters and underscores.'); | ||
var displayName = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter a Display Name.').trim('The display name may not have leading or trailing whitespaces.'); | ||
var description$1 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
var valueItemApiId = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter a value.').max(191, 'Use a value that is shorter than 191 characters.').matches(/^[a-zA-Z][a-zA-Z0-9_]*$/, 'Start with a letter, and use only alphanumeric characters or underscores.'); | ||
var valueItemDisplayName = displayName; | ||
var enumerationId = yup.string().strict(true); | ||
name: 'no-reserved-word', | ||
test: function test(value) { | ||
var options = this.options; | ||
if (options.context && options.context.isSystem) { | ||
return true; | ||
} | ||
var reservedApiIds = reservedEnumerationApiIds; | ||
if (options.context && options.context.isLocalized) { | ||
reservedApiIds = reservedEnumerationApiIds.filter(function (word) { | ||
return word !== 'Locale'; | ||
}); | ||
} | ||
return !reservedApiIds.some(function (reservedWord) { | ||
return value ? reservedWord.toLowerCase() === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).matches(/^[A-Z][a-zA-Z0-9_]*$/, 'Start with a capital letter and use only alphanumeric characters and underscores.'); // <-- RegEx from Prisma | ||
var enumeration = ({ | ||
apiId: apiId, | ||
displayName: displayName, | ||
description: description$1, | ||
valueItemApiId: valueItemApiId, | ||
valueItemDisplayName: valueItemDisplayName, | ||
enumerationId: enumerationId | ||
}); | ||
/** | ||
* Matcher for enumeration api IDs: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .trim() -> Since strict is true, this only validates that the input value is trimmed | ||
* This means that it checks that the value does not have any leading or trailing whitespaces. | ||
*/ | ||
var apiId$1 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter an Api Id.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
name: 'no-graphql-type', | ||
test: function (value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
var displayName$4 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter a Display Name.').trim('The display name may not have leading or trailing whitespaces.'); | ||
/** | ||
* Matcher for model descriptions: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .ensure() -> Transforms the values "undefined" and "null" into empty strings | ||
*/ | ||
var description$3 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
/** | ||
* Matcher for enumeration api IDs: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .strict(:boolean) -> Prevents manipulation of the string during validation | ||
* .min() -> Sets minimum required length of string to 1 character | ||
* .max() -> Sets maximum required length of string to 64 characters | ||
* .test() -> Executes an arbitrary test on the input value | ||
* .matches(:RegExpr) -> Matches the input value against a regular expression | ||
*/ | ||
var valueItemApiId = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter a value.').max(191, 'Use a value that is shorter than 191 characters.').matches(/^[a-zA-Z][a-zA-Z0-9_]*$/, 'Start with a letter, and use only alphanumeric characters or underscores.'); | ||
var valueItemDisplayName = displayName$4; | ||
var enumerationId = yup__namespace.string().strict(true); | ||
var enumeration = { | ||
__proto__: null, | ||
apiId: apiId$3, | ||
displayName: displayName$4, | ||
description: description$3, | ||
valueItemApiId: valueItemApiId, | ||
valueItemDisplayName: valueItemDisplayName, | ||
enumerationId: enumerationId | ||
}; | ||
/** | ||
* Matcher for field api IDs: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .strict(:boolean) -> Prevents manipulation of the string during validation | ||
* .min() -> Sets minimum required length of string to 1 character | ||
* .max() -> Sets maximum required length of string to 64 characters | ||
* .test() -> Executes an arbitrary test on the input value | ||
* .matches(:RegExpr) -> Matches the input value against a regular expression | ||
*/ | ||
var apiId$2 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter an Api Id.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
name: 'no-graphql-type', | ||
test: function test(value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).test({ | ||
name: 'no-reserved-word', | ||
test: function (value) { | ||
var options = this.options; | ||
if (options.context && options.context.isSystem) { | ||
return true; | ||
} | ||
return !reservedFieldApiIds.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).matches(/^[a-z][a-zA-Z0-9_]*$/, 'Start with a lowercase letter and use only alphanumeric characters and underscores.'); | ||
var reverseRelationFieldApiId = apiId$1.concat(yup.string().max(64, 'The API ID of a field may not exceed 64 characters.')); | ||
var displayName$1 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter a Display Name.').max(64, 'The Display Name of a field may not exceed 64characters.').test('no-letter', 'Enter a Display Name.', function (value) { | ||
if (!value) { | ||
return true; | ||
name: 'no-reserved-word', | ||
test: function test(value) { | ||
var options = this.options; | ||
if (options.context && options.context.isSystem) { | ||
return true; | ||
} | ||
if (value && typeof value === 'string') { | ||
return value.replace(/\s/g, '').length > 0; | ||
} | ||
return false; | ||
}); | ||
var description$2 = yup.string().nullable(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').ensure(); | ||
var isList = yup.boolean().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
var isHidden = yup.boolean().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
var isApiOnly = yup.boolean().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
var isReadOnly = yup.boolean().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
return !reservedFieldApiIds.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).matches(/^[a-z][a-zA-Z0-9_]*$/, 'Start with a lowercase letter and use only alphanumeric characters and underscores.'); // <-- Those are validations enforced by prisma: https://github.com/graphcool/prisma/blob/master/server/servers/deploy/src/main/scala/com/prisma/deploy/validation/NameConstraints.scala | ||
/** | ||
* Matcher for field api IDs for the reverse relation side: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .strict(:boolean) -> Prevents manipulation of the string during validation | ||
* .min() -> Sets minimum required length of string to 1 character | ||
* .max() -> Sets maximum required length of string to 64 characters | ||
* .test() -> Executes an arbitrary test on the input value | ||
* .matches(:RegExpr) -> Matches the input value against a regular expression | ||
*/ | ||
var reverseRelationFieldApiId = apiId$2.concat(yup__namespace.string().max(64, 'The API ID of a field may not exceed 64 characters.')); | ||
/** | ||
* Matcher for field display names: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .strict(:boolean) -> Prevents manipulation of the string during validation | ||
* .min() -> Sets minimum required length of string to 1 character | ||
* .max() -> Sets maximum required length of string to 64 characters | ||
* .test() -> Executes an arbitrary test on the input value | ||
*/ | ||
var displayName$3 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter a Display Name.').max(64, 'The Display Name of a field may not exceed 64characters.').test('no-letter', 'Enter a Display Name.', function (value) { | ||
if (!value) { | ||
return true; | ||
} | ||
var field = ({ | ||
apiId: apiId$1, | ||
reverseRelationFieldApiId: reverseRelationFieldApiId, | ||
displayName: displayName$1, | ||
description: description$2, | ||
isList: isList, | ||
isHidden: isHidden, | ||
isApiOnly: isApiOnly, | ||
isReadOnly: isReadOnly | ||
if (value && typeof value === 'string') { | ||
return value.replace(/\s/g, '').length > 0; | ||
} | ||
return false; | ||
}); | ||
/** | ||
* Matcher for field descriptions: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .ensure() -> Transforms the values "undefined" and "null" into empty strings | ||
*/ | ||
var email = yup.string().nullable(false).min(1).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').email('Only valid E-Mail addresses are allowed.'); | ||
var description$2 = yup__namespace.string().nullable(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').ensure(); | ||
var isList = yup__namespace["boolean"]().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
var isHidden = yup__namespace["boolean"]().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
var isApiOnly = yup__namespace["boolean"]().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
var isReadOnly = yup__namespace["boolean"]().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
var field = { | ||
__proto__: null, | ||
apiId: apiId$2, | ||
reverseRelationFieldApiId: reverseRelationFieldApiId, | ||
displayName: displayName$3, | ||
description: description$2, | ||
isList: isList, | ||
isHidden: isHidden, | ||
isApiOnly: isApiOnly, | ||
isReadOnly: isReadOnly | ||
}; | ||
var email = yup__namespace.string().nullable(false).min(1).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').email('Only valid E-Mail addresses are allowed.'); | ||
var invite = { | ||
__proto__: null, | ||
email: email | ||
}; | ||
/** | ||
* Matcher for model api IDs: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .strict(:boolean) -> Prevents manipulation of the string during validation | ||
* .min() -> Sets minimum required length of string to 1 character | ||
* .max() -> Sets maximum required length of string to 64 characters | ||
* .required() -> Ensures that empty strings are treated as invalid value | ||
* .test() -> Executes an arbitrary test on the input value | ||
* .matches(:RegExpr) -> Matches the input value against a regular expression | ||
*/ | ||
var invite = ({ | ||
email: email | ||
}); | ||
var apiId$2 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter an Api ID.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
name: 'no-graphql-type', | ||
test: function (value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
var apiId$1 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter an Api ID.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
name: 'no-graphql-type', | ||
test: function test(value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).test({ | ||
name: 'no-reserved-word', | ||
test: function (value) { | ||
var options = this.options; | ||
if (options.context && options.context.isSystem) { | ||
return true; | ||
} | ||
return !reservedModelApiIds.some(function (reservedWord) { | ||
return value ? reservedWord.toLowerCase() === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).matches(/^[A-Z][a-zA-Z0-9_]*$/, 'Start with a capital letter and use only alphanumeric characters and underscores.'); | ||
var displayName$2 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter a Display Name').trim('Display names may not have leading or trailing whitespaces.'); | ||
var description$3 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').ensure(); | ||
var modelId = yup.string().strict(true); | ||
var previewURLs = yup.array().of(yup.object().shape({ | ||
name: yup.string().required(), | ||
template: yup.string().required() | ||
}).required()); | ||
name: 'no-reserved-word', | ||
test: function test(value) { | ||
var options = this.options; | ||
if (options.context && options.context.isSystem) { | ||
return true; | ||
} | ||
return !reservedModelApiIds.some(function (reservedWord) { | ||
return value ? reservedWord.toLowerCase() === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).matches(/^[A-Z][a-zA-Z0-9_]*$/, 'Start with a capital letter and use only alphanumeric characters and underscores.'); // <-- Those are validations enforced by prisma: https://github.com/graphcool/prisma/blob/master/server/servers/deploy/src/main/scala/com/prisma/deploy/validation/NameConstraints.scala | ||
/** | ||
* Matcher for model display names: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .strict(:boolean) -> Prevents manipulation of the string during validation | ||
* .required() -> Ensures that empty strings are treated as invalid value | ||
*/ | ||
var displayName$2 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter a Display Name').trim('Display names may not have leading or trailing whitespaces.'); | ||
/** | ||
* Matcher for model descriptions: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .ensure() -> Transforms the values "undefined" and "null" into empty strings | ||
*/ | ||
var model = ({ | ||
apiId: apiId$2, | ||
displayName: displayName$2, | ||
description: description$3, | ||
modelId: modelId, | ||
previewURLs: previewURLs | ||
}); | ||
var description$1 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').ensure(); | ||
var modelId = yup__namespace.string().strict(true); | ||
var previewURLs = yup__namespace.array().of(yup__namespace.object().shape({ | ||
name: yup__namespace.string().required(), | ||
template: yup__namespace.string().required() | ||
}).required()); | ||
var API_REGIONS = ['EU_WEST_1','EU_WEST_3','US_EAST_1','US_WEST_1','AP_NORTHEAST_1']; | ||
var name$1 = yup.string().min(1, 'Enter a Name').typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).strict(true); | ||
var region = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).strict(true).min(1).oneOf(API_REGIONS, 'The region can only be one of these values: ${values}'); | ||
var description$4 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
var url = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1).url('The custom prisma endpoint must be a valid url!').test('no-end-with-management', 'The custom prisma endpoint may not end with "/management"', function (value) { | ||
if (!value) | ||
return false; | ||
return !value.endsWith('/management'); | ||
var model = { | ||
__proto__: null, | ||
apiId: apiId$1, | ||
displayName: displayName$2, | ||
description: description$1, | ||
modelId: modelId, | ||
previewURLs: previewURLs | ||
}; | ||
var API_REGIONS = ['EU_WEST_1', 'EU_WEST_3', 'US_EAST_1', 'US_WEST_1', 'AP_NORTHEAST_1']; // Use this for identifiers: "^[a-zA-Z][a-zA-Z0-9\\-_~]*$" | ||
var name$4 = yup__namespace.string().min(1, 'Enter a Name').typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).strict(true); | ||
var region = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).strict(true).min(1).oneOf(API_REGIONS, 'The region can only be one of these values: ${values}'); | ||
var description = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
var url$1 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1).url('The custom prisma endpoint must be a valid url!').test('no-end-with-management', 'The custom prisma endpoint may not end with "/management"', function (value) { | ||
if (!value) return false; | ||
return !value.endsWith('/management'); | ||
}); | ||
var token = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).required('A token can not be empty!'); | ||
var token = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).required('A token can not be empty!'); | ||
var customPrisma = { | ||
url: url, | ||
token: token | ||
url: url$1, | ||
token: token | ||
}; | ||
var project = { | ||
__proto__: null, | ||
API_REGIONS: API_REGIONS, | ||
name: name$4, | ||
region: region, | ||
description: description, | ||
customPrisma: customPrisma | ||
}; | ||
var name$3 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).trim('The role name may not start or end with whitespace characters.').min(1, 'Choose a name for this role.').max(32, 'Choose an name that is shorter than 32 characters.'); | ||
var role = { | ||
__proto__: null, | ||
name: name$3 | ||
}; | ||
var name$2 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).trim('The name of a stage may not start or end with whitespace characters!').min(1, 'Enter a Name.').max(32, 'Choose a name that is shorter than 32 letters.').matches(new RegExp('^[a-zA-Z][a-zA-Z0-9_]*$'), 'Start with a letter, and use only alphanumeric characters and "_".'); | ||
var displayName$1 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Choose a Display Name.').trim('Display names may not have leading or trailing whitespaces.'); | ||
var project = ({ | ||
API_REGIONS: API_REGIONS, | ||
name: name$1, | ||
region: region, | ||
description: description$4, | ||
customPrisma: customPrisma | ||
}); | ||
var stage = { | ||
__proto__: null, | ||
name: name$2, | ||
displayName: displayName$1 | ||
}; | ||
var name$2 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).trim('The role name may not start or end with whitespace characters.').min(1, 'Choose a name for this role.').max(32, 'Choose an name that is shorter than 32 characters.'); | ||
function createCommonjsModule(fn) { | ||
var module = { exports: {} }; | ||
return fn(module, module.exports), module.exports; | ||
} | ||
var validUrl = createCommonjsModule(function (module) { | ||
(function(module) { | ||
module.exports.is_uri = is_iri; | ||
module.exports.is_http_uri = is_http_iri; | ||
module.exports.is_https_uri = is_https_iri; | ||
module.exports.is_web_uri = is_web_iri; | ||
// Create aliases | ||
module.exports.isUri = is_iri; | ||
module.exports.isHttpUri = is_http_iri; | ||
module.exports.isHttpsUri = is_https_iri; | ||
module.exports.isWebUri = is_web_iri; | ||
// private function | ||
// internal URI spitter method - direct from RFC 3986 | ||
var splitUri = function(uri) { | ||
var splitted = uri.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/); | ||
return splitted; | ||
}; | ||
var role = ({ | ||
name: name$2 | ||
}); | ||
function is_iri(value) { | ||
if (!value) { | ||
return; | ||
} | ||
var name$3 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).trim('The name of a stage may not start or end with whitespace characters!').min(1, 'Enter a Name.').max(32, 'Choose a name that is shorter than 32 letters.').matches(new RegExp('^[a-zA-Z][a-zA-Z0-9_]*$'), 'Start with a letter, and use only alphanumeric characters and "_".'); | ||
var displayName$3 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Choose a Display Name.').trim('Display names may not have leading or trailing whitespaces.'); | ||
// check for illegal characters | ||
if (/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(value)) return; | ||
// check for hex escapes that aren't complete | ||
if (/%[^0-9a-f]/i.test(value)) return; | ||
if (/%[0-9a-f](:?[^0-9a-f]|$)/i.test(value)) return; | ||
var splitted = []; | ||
var scheme = ''; | ||
var authority = ''; | ||
var path = ''; | ||
var query = ''; | ||
var fragment = ''; | ||
var out = ''; | ||
// from RFC 3986 | ||
splitted = splitUri(value); | ||
scheme = splitted[1]; | ||
authority = splitted[2]; | ||
path = splitted[3]; | ||
query = splitted[4]; | ||
fragment = splitted[5]; | ||
// scheme and path are required, though the path can be empty | ||
if (!(scheme && scheme.length && path.length >= 0)) return; | ||
var stage = ({ | ||
name: name$3, | ||
displayName: displayName$3 | ||
}); | ||
// if authority is present, the path must be empty or begin with a / | ||
if (authority && authority.length) { | ||
if (!(path.length === 0 || /^\//.test(path))) return; | ||
} else { | ||
// if authority is not present, the path must not start with // | ||
if (/^\/\//.test(path)) return; | ||
} | ||
var name$4 = yup.string().min(1).nullable(false).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
var url$1 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).url('Only valid URLs are supported!').test('is-https-url', 'Only HTTPS URLs are supported!', function (value) { | ||
if (!value) | ||
return false; | ||
return value.startsWith('https://'); | ||
}); | ||
var headerKey = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).matches(/^[A-Z][A-Za-z0-9-]*$/, 'The key may only start with a capital letter and contain only alphanumeric characters.'); | ||
var headerValue = yup.string().nullable(false).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
var secretKey = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(true).min(32, 'Choose a secret key that is min. 32 characters long.').max(64, 'The secret key may not exceed 64 characters.').test({ | ||
name: 'no-whitespace', | ||
test: function (value) { | ||
return !/\s/g.test(value); | ||
}, | ||
message: 'Whitespace is not allowed. Secret key could be alphanumeric with special characters', | ||
exclusive: false | ||
}); | ||
// scheme must begin with a letter, then consist of letters, digits, +, ., or - | ||
if (!/^[a-z][a-z0-9\+\-\.]*$/.test(scheme.toLowerCase())) return; | ||
// re-assemble the URL per section 5.3 in RFC 3986 | ||
out += scheme + ':'; | ||
if (authority && authority.length) { | ||
out += '//' + authority; | ||
} | ||
out += path; | ||
if (query && query.length) { | ||
out += '?' + query; | ||
} | ||
if (fragment && fragment.length) { | ||
out += '#' + fragment; | ||
} | ||
var webhook = ({ | ||
name: name$4, | ||
url: url$1, | ||
headerKey: headerKey, | ||
headerValue: headerValue, | ||
secretKey: secretKey | ||
}); | ||
return out; | ||
} | ||
var apiId$3 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter an Api Id.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
name: 'no-graphql-type', | ||
test: function (value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).matches(/^[a-zA-Z][a-zA-Z0-9_]*$/, 'Start with a letter, and use only alphanumeric characters or underscores.'); | ||
var displayName$4 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter a Display Name.').trim('The display name may not have leading or trailing whitespaces.'); | ||
function is_http_iri(value, allowHttps) { | ||
if (!is_iri(value)) { | ||
return; | ||
} | ||
var splitted = []; | ||
var scheme = ''; | ||
var authority = ''; | ||
var path = ''; | ||
var port = ''; | ||
var query = ''; | ||
var fragment = ''; | ||
var out = ''; | ||
// from RFC 3986 | ||
splitted = splitUri(value); | ||
scheme = splitted[1]; | ||
authority = splitted[2]; | ||
path = splitted[3]; | ||
query = splitted[4]; | ||
fragment = splitted[5]; | ||
if (!scheme) return; | ||
if(allowHttps) { | ||
if (scheme.toLowerCase() != 'https') return; | ||
} else { | ||
if (scheme.toLowerCase() != 'http') return; | ||
} | ||
var locale = ({ | ||
apiId: apiId$3, | ||
displayName: displayName$4 | ||
}); | ||
// fully-qualified URIs must have an authority section that is | ||
// a valid host | ||
if (!authority) { | ||
return; | ||
} | ||
var name$5 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).trim('The view group name may not start or end with whitespace characters.').min(1, 'Choose a name for this view group.').max(32, 'Choose an name that is shorter than 32 characters.'); | ||
// enable port component | ||
if (/:(\d+)$/.test(authority)) { | ||
port = authority.match(/:(\d+)$/)[0]; | ||
authority = authority.replace(/:\d+$/, ''); | ||
} | ||
out += scheme + ':'; | ||
out += '//' + authority; | ||
if (port) { | ||
out += port; | ||
} | ||
out += path; | ||
if(query && query.length){ | ||
out += '?' + query; | ||
} | ||
if(fragment && fragment.length){ | ||
out += '#' + fragment; | ||
} | ||
return out; | ||
} | ||
function is_https_iri(value) { | ||
return is_http_iri(value, true); | ||
} | ||
function is_web_iri(value) { | ||
return (is_http_iri(value) || is_https_iri(value)); | ||
} | ||
var viewGroup = ({ | ||
name: name$5 | ||
})(module); | ||
}); | ||
var name$1 = yup__namespace.string().min(1).nullable(false).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
var url = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).test('is-https-url', 'Only HTTPS URLs are supported!', function (value) { | ||
return !!validUrl.isHttpsUri(value); | ||
}).required(); | ||
var headerKey = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).matches(/^[A-Z][A-Za-z0-9-]*$/, 'The key may only start with a capital letter and contain only alphanumeric characters.'); | ||
var headerValue = yup__namespace.string().nullable(false).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
var secretKey = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(true).min(32, 'Choose a secret key that is min. 32 characters long.').max(64, 'The secret key may not exceed 64 characters.').test({ | ||
name: 'no-whitespace', | ||
test: function test(value) { | ||
return !/\s/g.test(value); | ||
}, | ||
message: 'Whitespace is not allowed. Secret key could be alphanumeric with special characters', | ||
exclusive: false | ||
}); | ||
var webhook = { | ||
__proto__: null, | ||
name: name$1, | ||
url: url, | ||
headerKey: headerKey, | ||
headerValue: headerValue, | ||
secretKey: secretKey | ||
}; | ||
var apiId = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter an Api Id.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
name: 'no-graphql-type', | ||
test: function test(value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).matches(/^[a-zA-Z][a-zA-Z0-9_]*$/, 'Start with a letter, and use only alphanumeric characters or underscores.'); | ||
var displayName = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter a Display Name.').trim('The display name may not have leading or trailing whitespaces.'); | ||
var locale = { | ||
__proto__: null, | ||
apiId: apiId, | ||
displayName: displayName | ||
}; | ||
var name = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).trim('The view group name may not start or end with whitespace characters.').min(1, 'Choose a name for this view group.').max(32, 'Choose an name that is shorter than 32 characters.'); | ||
var viewGroup = { | ||
__proto__: null, | ||
name: name | ||
}; | ||
exports.authtoken = authtoken; | ||
@@ -300,2 +563,3 @@ exports.enumeration = enumeration; | ||
exports.invite = invite; | ||
exports.locale = locale; | ||
exports.model = model; | ||
@@ -305,5 +569,4 @@ exports.project = project; | ||
exports.stage = stage; | ||
exports.viewGroup = viewGroup; | ||
exports.webhook = webhook; | ||
exports.locale = locale; | ||
exports.viewGroup = viewGroup; | ||
//# sourceMappingURL=validation.js.map |
@@ -1,27 +0,17 @@ | ||
import { string, boolean, array, object } from 'yup'; | ||
import * as yup from 'yup'; | ||
var name = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1).ensure().trim('The name of an authentication token may not start or end with white space characters.'); | ||
var description = string().nullable(true); | ||
var scope = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).oneOf(['READ', | ||
'WRITE','OPEN'], "An authentication token can only be set to one of 'READ', 'WRITE' or 'OPEN'"); | ||
var name$5 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1).ensure().trim('The name of an authentication token may not start or end with white space characters.'); | ||
var description$4 = yup.string().nullable(true); | ||
var scope = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).oneOf(['READ', 'WRITE', 'OPEN'], "An authentication token can only be set to one of 'READ', 'WRITE' or 'OPEN'"); | ||
var authtoken = { | ||
__proto__: null, | ||
name: name$5, | ||
description: description$4, | ||
scope: scope | ||
}; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;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oYXJhY3RlcnMuJyk7XHJcbmV4cG9ydCB2YXIgZGVzY3JpcHRpb24gPSB5dXAuc3RyaW5nKCkubnVsbGFibGUodHJ1ZSk7XHJcbmV4cG9ydCB2YXIgc2NvcGUgPSB5dXBcclxuICAgIC5zdHJpbmcoKVxyXG4gICAgLnR5cGVFcnJvcignVGhlIHN1cHBsaWVkIHZhbHVlIFwiJHt2YWx1ZX1cIiBvZiB0eXBlIFwiJHt0eXBlfVwiIGlzIG5vdCBjb21wYXRpYmxlIHdpdGggdHlwZSBcInN0cmluZ1wiIScpXHJcbiAgICAuc3RyaWN0KHRydWUpXHJcbiAgICAub25lT2YoWydSRUFEJywgJ1dSSVRFJywgJ09QRU4nXSwgXCJBbiBhdXRoZW50aWNhdGlvbiB0b2tlbiBjYW4gb25seSBiZSBzZXQgdG8gb25lIG9mICdSRUFEJywgJ1dSSVRFJyBvciAnT1BFTidcIik7XHJcbiJdfQ== | ||
var authtoken = ({ | ||
name: name, | ||
description: description, | ||
scope: scope | ||
}); | ||
var graphQlTypeNames = ['int','float','string','boolean','enum','interface', | ||
'union','fragment','datetime','json','mutation','subscription','scalar','query', | ||
'input','node']; | ||
var reservedNonSystemTypeNames = ['Id','User','Search','Status','Locale','RichText', | ||
'RichTextAST','Location','LocationInput','Color','ColorInput','RGBATransparency', | ||
'RGBAHue','HEX','RGBA','ScheduledRelease','ScheduledOperation']; | ||
var reservedNonSystemFieldNames = ['id','createdat','updatedat','versions','createdby', | ||
'status','publishedat','localizations','documentInStages','publish','locale', | ||
'updatedby','publishedby']; | ||
var graphQlTypeNames = ['int', 'float', 'string', 'boolean', 'enum', 'interface', 'union', 'fragment', 'datetime', 'json', 'mutation', 'subscription', 'scalar', 'query', 'input', 'node']; | ||
var reservedNonSystemTypeNames = ['Id', 'User', 'Search', 'Status', 'Locale', 'RichText', 'RichTextAST', 'Location', 'LocationInput', 'Color', 'ColorInput', 'RGBATransparency', 'RGBAHue', 'HEX', 'RGBA', 'ScheduledRelease', 'ScheduledOperation']; | ||
var reservedNonSystemFieldNames = ['id', 'createdat', 'updatedat', 'versions', 'createdby', 'status', 'publishedat', 'localizations', 'documentInStages', 'publish', 'locale', 'updatedby', 'publishedby']; | ||
var reservedModelApiIds = ['Type'].concat(reservedNonSystemTypeNames); | ||
@@ -31,272 +21,520 @@ var reservedEnumerationApiIds = ['Type'].concat(reservedNonSystemTypeNames); | ||
/** | ||
* Matcher for enumeration api IDs: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .min() -> Sets minimum required length of string to 1 character | ||
* .max() -> Sets maximum required length of string to 64 characters | ||
* .matches(:RegExpr) -> Matches the input value against a regular expression | ||
*/ | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJlc2VydmVkV29yZHMudHMob3JpZ2luYWwpIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sR0FBQSxDQUFJLG1CQUFtQixDQUMxQixNQUNBLFFBQ0EsU0FDQSxVQUNBLE9BQ0E7SUFDQSxRQUNBLFdBQ0EsV0FDQSxPQUNBLFdBQ0EsZUFDQSxTQUNBO0lBQ0EsUUFDQTtBQUVKLEdBQUEsQ0FBSSw2QkFBNkIsQ0FDN0IsS0FDQSxPQUNBLFNBQ0EsU0FDQSxTQUNBO0lBQ0EsY0FDQSxXQUNBLGdCQUNBLFFBQ0EsYUFDQTtJQUNBLFVBQ0EsTUFDQSxPQUNBLG1CQUNBO0FBRUosR0FBQSxDQUFJLDhCQUE4QixDQUM5QixLQUNBLFlBQ0EsWUFDQSxXQUNBO0lBQ0EsU0FDQSxjQUNBLGdCQUNBLG1CQUNBLFVBQ0E7SUFDQSxZQUNBO0FBRUosT0FBTyxHQUFBLENBQUksc0JBQXNCLENBQUMsT0FBRCxDQUFTLE1BQVQsQ0FBZ0I7QUFDakQsT0FBTyxHQUFBLENBQUksNEJBQTRCLENBQ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ZE5vblN5c3RlbUZpZWxkTmFtZXMgPSBbXHJcbiAgICAnaWQnLFxyXG4gICAgJ2NyZWF0ZWRhdCcsXHJcbiAgICAndXBkYXRlZGF0JyxcclxuICAgICd2ZXJzaW9ucycsXHJcbiAgICAnY3JlYXRlZGJ5JyxcclxuICAgICdzdGF0dXMnLFxyXG4gICAgJ3B1Ymxpc2hlZGF0JyxcclxuICAgICdsb2NhbGl6YXRpb25zJyxcclxuICAgICdkb2N1bWVudEluU3RhZ2VzJyxcclxuICAgICdwdWJsaXNoJyxcclxuICAgICdsb2NhbGUnLFxyXG4gICAgJ3VwZGF0ZWRieScsXHJcbiAgICAncHVibGlzaGVkYnknLFxyXG5dO1xyXG5leHBvcnQgdmFyIHJlc2VydmVkTW9kZWxBcGlJZHMgPSBbJ1R5cGUnXS5jb25jYXQocmVzZXJ2ZWROb25TeXN0ZW1UeXBlTmFtZXMpO1xyXG5leHBvcnQgdmFyIHJlc2VydmVkRW51bWVyYXRpb25BcGlJZHMgPSBbJ1R5cGUnXS5jb25jYXQocmVzZXJ2ZWROb25TeXN0ZW1UeXBlTmFtZXMpO1xyXG5leHBvcnQgdmFyIHJlc2VydmVkRmllbGRBcGlJZHMgPSByZXNlcnZlZE5vblN5c3RlbUZpZWxkTmFtZXM7XHJcbiJdfQ== | ||
var apiId = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter an Api Id.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
name: 'no-graphql-type', | ||
test: function (value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
var apiId$3 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter an Api Id.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
name: 'no-graphql-type', | ||
test: function test(value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).test({ | ||
name: 'no-reserved-word', | ||
test: function (value) { | ||
var options = this.options; | ||
if (options.context && options.context.isSystem) { | ||
return true; | ||
} | ||
var reservedApiIds = reservedEnumerationApiIds; | ||
if (options.context && options.context.isLocalized) { | ||
reservedApiIds = reservedEnumerationApiIds.filter(function (word) { | ||
return word !== 'Locale'; | ||
}); | ||
} | ||
return !reservedApiIds.some(function (reservedWord) { | ||
return value ? reservedWord.toLowerCase() === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).matches(/^[A-Z][a-zA-Z0-9_]*$/, 'Start with a capital letter and use only alphanumeric characters and underscores.'); | ||
var displayName = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter a Display Name.').trim('The display name may not have leading or trailing whitespaces.'); | ||
var description$1 = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
var valueItemApiId = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter a value.').max(191, 'Use a value that is shorter than 191 characters.').matches(/^[a-zA-Z][a-zA-Z0-9_]*$/, 'Start with a letter, and use only alphanumeric characters or underscores.'); | ||
var valueItemDisplayName = displayName; | ||
var enumerationId = string().strict(true); | ||
name: 'no-reserved-word', | ||
test: function test(value) { | ||
var options = this.options; | ||
if (options.context && options.context.isSystem) { | ||
return true; | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVudW1lcmF0aW9uLnRzKG9yaWdpbmFsKSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxZQUFZLFNBQVM7QUFDckIsUUFBUyxrQkFBa0IsZ0NBQWlDO0FBVTVELE9BQU8sR0FBQS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nVtZXJpYyBjaGFyYWN0ZXJzIG9yIHVuZGVyc2NvcmVzLicpO1xyXG5leHBvcnQgdmFyIHZhbHVlSXRlbURpc3BsYXlOYW1lID0gZGlzcGxheU5hbWU7XHJcbmV4cG9ydCB2YXIgZW51bWVyYXRpb25JZCA9IHl1cC5zdHJpbmcoKS5zdHJpY3QodHJ1ZSk7XHJcbiJdfQ== | ||
var reservedApiIds = reservedEnumerationApiIds; | ||
if (options.context && options.context.isLocalized) { | ||
reservedApiIds = reservedEnumerationApiIds.filter(function (word) { | ||
return word !== 'Locale'; | ||
}); | ||
} | ||
var enumeration = ({ | ||
apiId: apiId, | ||
displayName: displayName, | ||
description: description$1, | ||
valueItemApiId: valueItemApiId, | ||
valueItemDisplayName: valueItemDisplayName, | ||
enumerationId: enumerationId | ||
}); | ||
return !reservedApiIds.some(function (reservedWord) { | ||
return value ? reservedWord.toLowerCase() === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).matches(/^[A-Z][a-zA-Z0-9_]*$/, 'Start with a capital letter and use only alphanumeric characters and underscores.'); // <-- RegEx from Prisma | ||
var apiId$1 = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter an Api Id.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
name: 'no-graphql-type', | ||
test: function (value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
/** | ||
* Matcher for enumeration api IDs: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .trim() -> Since strict is true, this only validates that the input value is trimmed | ||
* This means that it checks that the value does not have any leading or trailing whitespaces. | ||
*/ | ||
var displayName$4 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter a Display Name.').trim('The display name may not have leading or trailing whitespaces.'); | ||
/** | ||
* Matcher for model descriptions: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .ensure() -> Transforms the values "undefined" and "null" into empty strings | ||
*/ | ||
var description$3 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
/** | ||
* Matcher for enumeration api IDs: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .strict(:boolean) -> Prevents manipulation of the string during validation | ||
* .min() -> Sets minimum required length of string to 1 character | ||
* .max() -> Sets maximum required length of string to 64 characters | ||
* .test() -> Executes an arbitrary test on the input value | ||
* .matches(:RegExpr) -> Matches the input value against a regular expression | ||
*/ | ||
var valueItemApiId = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter a value.').max(191, 'Use a value that is shorter than 191 characters.').matches(/^[a-zA-Z][a-zA-Z0-9_]*$/, 'Start with a letter, and use only alphanumeric characters or underscores.'); | ||
var valueItemDisplayName = displayName$4; | ||
var enumerationId = yup.string().strict(true); | ||
var enumeration = { | ||
__proto__: null, | ||
apiId: apiId$3, | ||
displayName: displayName$4, | ||
description: description$3, | ||
valueItemApiId: valueItemApiId, | ||
valueItemDisplayName: valueItemDisplayName, | ||
enumerationId: enumerationId | ||
}; | ||
/** | ||
* Matcher for field api IDs: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .strict(:boolean) -> Prevents manipulation of the string during validation | ||
* .min() -> Sets minimum required length of string to 1 character | ||
* .max() -> Sets maximum required length of string to 64 characters | ||
* .test() -> Executes an arbitrary test on the input value | ||
* .matches(:RegExpr) -> Matches the input value against a regular expression | ||
*/ | ||
var apiId$2 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter an Api Id.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
name: 'no-graphql-type', | ||
test: function test(value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).test({ | ||
name: 'no-reserved-word', | ||
test: function (value) { | ||
var options = this.options; | ||
if (options.context && options.context.isSystem) { | ||
return true; | ||
} | ||
return !reservedFieldApiIds.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).matches(/^[a-z][a-zA-Z0-9_]*$/, 'Start with a lowercase letter and use only alphanumeric characters and underscores.'); | ||
var reverseRelationFieldApiId = apiId$1.concat(string().max(64, 'The API ID of a field may not exceed 64 characters.')); | ||
var displayName$1 = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter a Display Name.').max(64, 'The Display Name of a field may not exceed 64characters.').test('no-letter', 'Enter a Display Name.', function (value) { | ||
if (!value) { | ||
return true; | ||
name: 'no-reserved-word', | ||
test: function test(value) { | ||
var options = this.options; | ||
if (options.context && options.context.isSystem) { | ||
return true; | ||
} | ||
if (value && typeof value === 'string') { | ||
return value.replace(/\s/g, '').length > 0; | ||
} | ||
return false; | ||
}); | ||
var description$2 = string().nullable(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').ensure(); | ||
var isList = boolean().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
var isHidden = boolean().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
var isApiOnly = boolean().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
var isReadOnly = boolean().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
return !reservedFieldApiIds.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).matches(/^[a-z][a-zA-Z0-9_]*$/, 'Start with a lowercase letter and use only alphanumeric characters and underscores.'); // <-- Those are validations enforced by prisma: https://github.com/graphcool/prisma/blob/master/server/servers/deploy/src/main/scala/com/prisma/deploy/validation/NameConstraints.scala | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZpZWxkLnRzKG9yaWdpbmFsKSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxZQUFZLFNBQVM7QUFDckIsUUFBUyxrQkFBa0IsMEJBQTJCO0FBWXRELE9BQU8sR0FBQSxDQUFJLFFBQVEsR0FBQSxDQUNkLE1BRGMsRUFBQSxDQUVkLFNBRmMsQ0FFSix3RkFGSSxDQUdkLE1BSGMsQ0FHUCxLQUhPLENBSWQsR0FKYyxDQUlWLEdBQUcsbUJBSk8sQ0FLZCxHQUxjLENBS1YsSUFBSSxvREFMTSxDQU1kLElBTmMsQ0FNVDtJQUNOLE1BQU0saUJBREEsQ0FBQTtJQUVOLE1BQU0sVUFBVSxPQUFPO1FBQ25CLE9BQU8sQ0FBQyxnQkFBQSxDQUFpQixJQUFqQixDQUFzQixVQUFVLGNBQWM7WUFBRSxPQUFRLEtBQUEsR0FBUSxZQUFBLENBQUEsR0FBQSxDQUFpQixLQUFBLENBQU0sV0FBTixLQUFzQjtRQUF2SDtJQUNBLENBSlUsQ0FBQTtJQUtOLFNBQVMsMERBTEgsQ0FBQTtJQU1OLFdBQVc7RUFaSSxDQWNkLElBZGMsQ0FjVDtJQUNOLE1BQU0sa0JBREEsQ0FBQTtJQUVOLE1BQU0sVUFBVSxPQUFPO1FBQ25CLEdBQUEsQ0FBSSxVQUFVLElBQUEsQ0FBSztRQUNuQixJQUFJLE9BQUEsQ0FBUSxPQUFSLENBQUE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JsZSB3aXRoIHR5cGUgXCJib29sZWFuXCIhJyk7XHJcbiJdfQ== | ||
/** | ||
* Matcher for field api IDs for the reverse relation side: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .strict(:boolean) -> Prevents manipulation of the string during validation | ||
* .min() -> Sets minimum required length of string to 1 character | ||
* .max() -> Sets maximum required length of string to 64 characters | ||
* .test() -> Executes an arbitrary test on the input value | ||
* .matches(:RegExpr) -> Matches the input value against a regular expression | ||
*/ | ||
var reverseRelationFieldApiId = apiId$2.concat(yup.string().max(64, 'The API ID of a field may not exceed 64 characters.')); | ||
/** | ||
* Matcher for field display names: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .strict(:boolean) -> Prevents manipulation of the string during validation | ||
* .min() -> Sets minimum required length of string to 1 character | ||
* .max() -> Sets maximum required length of string to 64 characters | ||
* .test() -> Executes an arbitrary test on the input value | ||
*/ | ||
var field = ({ | ||
apiId: apiId$1, | ||
reverseRelationFieldApiId: reverseRelationFieldApiId, | ||
displayName: displayName$1, | ||
description: description$2, | ||
isList: isList, | ||
isHidden: isHidden, | ||
isApiOnly: isApiOnly, | ||
isReadOnly: isReadOnly | ||
var displayName$3 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter a Display Name.').max(64, 'The Display Name of a field may not exceed 64characters.').test('no-letter', 'Enter a Display Name.', function (value) { | ||
if (!value) { | ||
return true; | ||
} | ||
if (value && typeof value === 'string') { | ||
return value.replace(/\s/g, '').length > 0; | ||
} | ||
return false; | ||
}); | ||
/** | ||
* Matcher for field descriptions: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .ensure() -> Transforms the values "undefined" and "null" into empty strings | ||
*/ | ||
var email = string().nullable(false).min(1).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').email('Only valid E-Mail addresses are allowed.'); | ||
var description$2 = yup.string().nullable(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').ensure(); | ||
var isList = yup["boolean"]().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
var isHidden = yup["boolean"]().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
var isApiOnly = yup["boolean"]().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
var isReadOnly = yup["boolean"]().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
var field = { | ||
__proto__: null, | ||
apiId: apiId$2, | ||
reverseRelationFieldApiId: reverseRelationFieldApiId, | ||
displayName: displayName$3, | ||
description: description$2, | ||
isList: isList, | ||
isHidden: isHidden, | ||
isApiOnly: isApiOnly, | ||
isReadOnly: isReadOnly | ||
}; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImludml0ZS50cyhvcmlnaW5hbCkiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsWUFBWSxTQUFTO0FBQ3JCLE9BQU8sR0FBQSxDQUFJLFFBQVEsR0FBQSxDQUNkLE1BRGMsRUFBQSxDQUVkLFFBRmMsQ0FFTCxNQUZLLENBR2QsR0FIYyxDQUdWLEVBSFUsQ0FJZCxTQUpjLENBSUosd0ZBSkksQ0FLZCxLQUxjLENBS1I7QUFOWCIsImZpbGUiOiJpbnZpdGUudHMob3JpZ2luYWwpIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0ICogYXMgeXVwIGZyb20gJ3l1cCc7XHJcbmV4cG9ydCB2YXIgZW1haWwgPSB5dXBcclxuICAgIC5zdHJpbmcoKVxyXG4gICAgLm51bGxhYmxlKGZhbHNlKVxyXG4gICAgLm1pbigxKVxyXG4gICAgLnR5cGVFcnJvcignVGhlIHN1cHBsaWVkIHZhbHVlIFwiJHt2YWx1ZX1cIiBvZiB0eXBlIFwiJHt0eXBlfVwiIGlzIG5vdCBjb21wYXRpYmxlIHdpdGggdHlwZSBcInN0cmluZ1wiIScpXHJcbiAgICAuZW1haWwoJ09ubHkgdmFsaWQgRS1NYWlsIGFkZHJlc3NlcyBhcmUgYWxsb3dlZC4nKTtcclxuIl19 | ||
var email = yup.string().nullable(false).min(1).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').email('Only valid E-Mail addresses are allowed.'); | ||
var invite = { | ||
__proto__: null, | ||
email: email | ||
}; | ||
var invite = ({ | ||
email: email | ||
}); | ||
/** | ||
* Matcher for model api IDs: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .strict(:boolean) -> Prevents manipulation of the string during validation | ||
* .min() -> Sets minimum required length of string to 1 character | ||
* .max() -> Sets maximum required length of string to 64 characters | ||
* .required() -> Ensures that empty strings are treated as invalid value | ||
* .test() -> Executes an arbitrary test on the input value | ||
* .matches(:RegExpr) -> Matches the input value against a regular expression | ||
*/ | ||
var apiId$2 = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter an Api ID.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
name: 'no-graphql-type', | ||
test: function (value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
var apiId$1 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter an Api ID.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
name: 'no-graphql-type', | ||
test: function test(value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).test({ | ||
name: 'no-reserved-word', | ||
test: function (value) { | ||
var options = this.options; | ||
if (options.context && options.context.isSystem) { | ||
return true; | ||
} | ||
return !reservedModelApiIds.some(function (reservedWord) { | ||
return value ? reservedWord.toLowerCase() === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).matches(/^[A-Z][a-zA-Z0-9_]*$/, 'Start with a capital letter and use only alphanumeric characters and underscores.'); | ||
var displayName$2 = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter a Display Name').trim('Display names may not have leading or trailing whitespaces.'); | ||
var description$3 = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').ensure(); | ||
var modelId = string().strict(true); | ||
var previewURLs = array().of(object().shape({ | ||
name: string().required(), | ||
template: string().required() | ||
}).required()); | ||
name: 'no-reserved-word', | ||
test: function test(value) { | ||
var options = this.options; | ||
if (options.context && options.context.isSystem) { | ||
return true; | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1vZGVsLnRzKG9yaWdpbmFsKSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxZQUFZLFNBQVM7QUFDckIsUUFBUyxrQkFBa0IsMEJBQTJCO0FBYXRELE9BQU8sR0FBQSxDQUFJLFFBQVEsR0FBQSxDQUNkLE1BRGMsRUFBQSxDQUVkLFNBRmMsQ0FFSix3RkFGSSxDQUdkLE1BSGMsQ0FHUCxLQUhPLENBSWQsR0FKYyxDQUlWLEdBQUcsbUJBSk8sQ0FLZCxHQUxjLENBS1YsSUFBSSxvREFMTSxDQU1kLElBTmMsQ0FNVDtJQUNOLE1BQU0saUJBREEsQ0FBQTtJQUVOLE1BQU0sVUFBVSxPQUFPO1FBQ25CLE9BQU8sQ0FBQyxnQkFBQSxDQUFpQixJQUFqQixDQUFzQixVQUFVLGNBQWM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0Y2hlciBmb3IgbW9kZWwgZGVzY3JpcHRpb25zOlxyXG4gKlxyXG4gKiAuc3RyaW5nKCkgICAgICAgICAgLT4gRW5zdXJlcyB0aGF0IG9ubHkgc3RyaW5ncyBjYW4gYmUgdmFsaWRhdGVkIHdpdGggc3VjY2Vzc1xyXG4gKiAudHlwZUVycm9yKDpzdHJpbmcpLT4gRW5zdXJlcyB0aGF0IHR5cGVzIG90aGVyIHRoYW4gc3RyaW5nIHJldHVybiBmYWxzZVxyXG4gKiAuZW5zdXJlKCkgICAgICAgICAgLT4gVHJhbnNmb3JtcyB0aGUgdmFsdWVzIFwidW5kZWZpbmVkXCIgYW5kIFwibnVsbFwiIGludG8gZW1wdHkgc3RyaW5nc1xyXG4gKi9cclxuZXhwb3J0IHZhciBkZXNjcmlwdGlvbiA9IHl1cFxyXG4gICAgLnN0cmluZygpXHJcbiAgICAudHlwZUVycm9yKCdUaGUgc3VwcGxpZWQgdmFsdWUgXCIke3ZhbHVlfVwiIG9mIHR5cGUgXCIke3R5cGV9XCIgaXMgbm90IGNvbXBhdGlibGUgd2l0aCB0eXBlIFwic3RyaW5nXCIhJylcclxuICAgIC5lbnN1cmUoKTtcclxuZXhwb3J0IHZhciBtb2RlbElkID0geXVwLnN0cmluZygpLnN0cmljdCh0cnVlKTtcclxuZXhwb3J0IHZhciBwcmV2aWV3VVJMcyA9IHl1cC5hcnJheSgpLm9mKHl1cFxyXG4gICAgLm9iamVjdCgpXHJcbiAgICAuc2hhcGUoe1xyXG4gICAgbmFtZTogeXVwLnN0cmluZygpLnJlcXVpcmVkKCksXHJcbiAgICB0ZW1wbGF0ZTogeXVwLnN0cmluZygpLnJlcXVpcmVkKCksXHJcbn0pXHJcbiAgICAucmVxdWlyZWQoKSk7XHJcbiJdfQ== | ||
return !reservedModelApiIds.some(function (reservedWord) { | ||
return value ? reservedWord.toLowerCase() === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).matches(/^[A-Z][a-zA-Z0-9_]*$/, 'Start with a capital letter and use only alphanumeric characters and underscores.'); // <-- Those are validations enforced by prisma: https://github.com/graphcool/prisma/blob/master/server/servers/deploy/src/main/scala/com/prisma/deploy/validation/NameConstraints.scala | ||
/** | ||
* Matcher for model display names: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .strict(:boolean) -> Prevents manipulation of the string during validation | ||
* .required() -> Ensures that empty strings are treated as invalid value | ||
*/ | ||
var model = ({ | ||
apiId: apiId$2, | ||
displayName: displayName$2, | ||
description: description$3, | ||
modelId: modelId, | ||
previewURLs: previewURLs | ||
}); | ||
var displayName$2 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter a Display Name').trim('Display names may not have leading or trailing whitespaces.'); | ||
/** | ||
* Matcher for model descriptions: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .ensure() -> Transforms the values "undefined" and "null" into empty strings | ||
*/ | ||
var API_REGIONS = ['EU_WEST_1','EU_WEST_3','US_EAST_1','US_WEST_1','AP_NORTHEAST_1']; | ||
var name$1 = string().min(1, 'Enter a Name').typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).strict(true); | ||
var region = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).strict(true).min(1).oneOf(API_REGIONS, 'The region can only be one of these values: ${values}'); | ||
var description$4 = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
var url = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1).url('The custom prisma endpoint must be a valid url!').test('no-end-with-management', 'The custom prisma endpoint may not end with "/management"', function (value) { | ||
if (!value) | ||
return false; | ||
return !value.endsWith('/management'); | ||
var description$1 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').ensure(); | ||
var modelId = yup.string().strict(true); | ||
var previewURLs = yup.array().of(yup.object().shape({ | ||
name: yup.string().required(), | ||
template: yup.string().required() | ||
}).required()); | ||
var model = { | ||
__proto__: null, | ||
apiId: apiId$1, | ||
displayName: displayName$2, | ||
description: description$1, | ||
modelId: modelId, | ||
previewURLs: previewURLs | ||
}; | ||
var API_REGIONS = ['EU_WEST_1', 'EU_WEST_3', 'US_EAST_1', 'US_WEST_1', 'AP_NORTHEAST_1']; // Use this for identifiers: "^[a-zA-Z][a-zA-Z0-9\\-_~]*$" | ||
var name$4 = yup.string().min(1, 'Enter a Name').typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).strict(true); | ||
var region = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).strict(true).min(1).oneOf(API_REGIONS, 'The region can only be one of these values: ${values}'); | ||
var description = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
var url$1 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1).url('The custom prisma endpoint must be a valid url!').test('no-end-with-management', 'The custom prisma endpoint may not end with "/management"', function (value) { | ||
if (!value) return false; | ||
return !value.endsWith('/management'); | ||
}); | ||
var token = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).required('A token can not be empty!'); | ||
var token = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).required('A token can not be empty!'); | ||
var customPrisma = { | ||
url: url, | ||
token: token | ||
url: url$1, | ||
token: token | ||
}; | ||
var project = { | ||
__proto__: null, | ||
API_REGIONS: API_REGIONS, | ||
name: name$4, | ||
region: region, | ||
description: description, | ||
customPrisma: customPrisma | ||
}; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInByb2plY3QudHMob3JpZ2luYWwpIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFB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hwb3J0IHZhciBjdXN0b21QcmlzbWEgPSB7IHVybDogdXJsLCB0b2tlbjogdG9rZW4gfTtcclxuIl19 | ||
var name$3 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).trim('The role name may not start or end with whitespace characters.').min(1, 'Choose a name for this role.').max(32, 'Choose an name that is shorter than 32 characters.'); | ||
var role = { | ||
__proto__: null, | ||
name: name$3 | ||
}; | ||
var project = ({ | ||
API_REGIONS: API_REGIONS, | ||
name: name$1, | ||
region: region, | ||
description: description$4, | ||
customPrisma: customPrisma | ||
}); | ||
var name$2 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).trim('The name of a stage may not start or end with whitespace characters!').min(1, 'Enter a Name.').max(32, 'Choose a name that is shorter than 32 letters.').matches(new RegExp('^[a-zA-Z][a-zA-Z0-9_]*$'), 'Start with a letter, and use only alphanumeric characters and "_".'); | ||
var displayName$1 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Choose a Display Name.').trim('Display names may not have leading or trailing whitespaces.'); | ||
var name$2 = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).trim('The role name may not start or end with whitespace characters.').min(1, 'Choose a name for this role.').max(32, 'Choose an name that is shorter than 32 characters.'); | ||
var stage = { | ||
__proto__: null, | ||
name: name$2, | ||
displayName: displayName$1 | ||
}; | ||
function createCommonjsModule(fn) { | ||
var module = { exports: {} }; | ||
return fn(module, module.exports), module.exports; | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJvbGUudHMob3JpZ2luYWwpIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFlBQVksU0FBUztBQUNyQixPQUFPLEdBQUEsQ0FBSSxPQUFPLEdBQUEsQ0FDYixNQURhLEVBQUEsQ0FFYixTQUZhLENBRUgsd0ZBRkcsQ0FHYixNQUhhLENBR04sS0FITSxDQUliLElBSmEsQ0FJUixpRUFKUSxDQUtiLEdBTGEsQ0FLVCxHQUFHLCtCQUxNLENBTWIsR0FOYSxDQU1ULElBQUk7QUFQYiIsImZpbGUiOiJyb2xlLnRzKG9yaWdpbmFsKSIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCAqIGFzIHl1cCBmcm9tICd5dXAnO1xyXG5leHBvcnQgdmFyIG5hbWUgPSB5dXBcclxuICAgIC5zdHJpbmcoKVxyXG4gICAgLnR5cGVFcnJvcignVGhlIHN1cHBsaWVkIHZhbHVlIFwiJHt2YWx1ZX1cIiBvZiB0eXBlIFwiJHt0eXBlfVwiIGlzIG5vdCBjb21wYXRpYmxlIHdpdGggdHlwZSBcInN0cmluZ1wiIScpXHJcbiAgICAuc3RyaWN0KHRydWUpXHJcbiAgICAudHJpbSgnVGhlIHJvbGUgbmFtZSBtYXkgbm90IHN0YXJ0IG9yIGVuZCB3aXRoIHdoaXRlc3BhY2UgY2hhcmFjdGVycy4nKVxyXG4gICAgLm1pbigxLCAnQ2hvb3NlIGEgbmFtZSBmb3IgdGhpcyByb2xlLicpXHJcbiAgICAubWF4KDMyLCAnQ2hvb3NlIGFuIG5hbWUgdGhhdCBpcyBzaG9ydGVyIHRoYW4gMzIgY2hhcmFjdGVycy4nKTtcclxuIl19 | ||
var validUrl = createCommonjsModule(function (module) { | ||
(function(module) { | ||
module.exports.is_uri = is_iri; | ||
module.exports.is_http_uri = is_http_iri; | ||
module.exports.is_https_uri = is_https_iri; | ||
module.exports.is_web_uri = is_web_iri; | ||
// Create aliases | ||
module.exports.isUri = is_iri; | ||
module.exports.isHttpUri = is_http_iri; | ||
module.exports.isHttpsUri = is_https_iri; | ||
module.exports.isWebUri = is_web_iri; | ||
var role = ({ | ||
name: name$2 | ||
}); | ||
var name$3 = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).trim('The name of a stage may not start or end with whitespace characters!').min(1, 'Enter a Name.').max(32, 'Choose a name that is shorter than 32 letters.').matches(new RegExp('^[a-zA-Z][a-zA-Z0-9_]*$'), 'Start with a letter, and use only alphanumeric characters and "_".'); | ||
var displayName$3 = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Choose a Display Name.').trim('Display names may not have leading or trailing whitespaces.'); | ||
// private function | ||
// internal URI spitter method - direct from RFC 3986 | ||
var splitUri = function(uri) { | ||
var splitted = uri.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/); | ||
return splitted; | ||
}; | ||
function is_iri(value) { | ||
if (!value) { | ||
return; | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0YWdlLnRzKG9yaWdpbmFsKSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxZQUFZLFNBQVM7QUFDckIsT0FBTyxHQUFBLENBQUksT0FBTyxHQUFBLENBQ2IsTUFEYSxFQUFBLENBRWIsU0FGYSxDQUVILHdGQUZHLENBR2IsTUFIYSxDQUdOLEtBSE0sQ0FJYixJQUphLENBSVIsdUVBSlEsQ0FLYixHQUxhLENBS1QsR0FBRyxnQkFMTSxDQU1iLEdBTmEsQ0FNVCxJQUFJLGlEQU5LLENBT2IsT0FQYSxDQU9MLElBQUksTUFBSixDQUFXLDRCQUE0QjtBQUNwRCxPQUFPLEdBQUEsQ0FBSSxjQUFjLEdBQUEsQ0FDcEIsTUFEb0IsRUFBQSxDQUVwQixTQUZvQixDQUVWLHdGQUZVLENBR3BCLE1BSG9CLENBR2IsS0FIYSxDQUlwQixHQUpvQixDQUloQixHQUFHLHlCQUphLENBS3BCLElBTG9CLENBS2Y7QUFkViIsImZpbGUiOiJzdGFnZS50cyhvcmlnaW5hbCkiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgKiBhcyB5dXAgZnJvbSAneXVwJztcclxuZXhwb3J0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^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(value)) return; | ||
// check for hex escapes that aren't complete | ||
if (/%[^0-9a-f]/i.test(value)) return; | ||
if (/%[0-9a-f](:?[^0-9a-f]|$)/i.test(value)) return; | ||
var stage = ({ | ||
name: name$3, | ||
displayName: displayName$3 | ||
}); | ||
var splitted = []; | ||
var scheme = ''; | ||
var authority = ''; | ||
var path = ''; | ||
var query = ''; | ||
var fragment = ''; | ||
var out = ''; | ||
var name$4 = string().min(1).nullable(false).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
var url$1 = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).url('Only valid URLs are supported!').test('is-https-url', 'Only HTTPS URLs are supported!', function (value) { | ||
if (!value) | ||
return false; | ||
return value.startsWith('https://'); | ||
}); | ||
var headerKey = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).matches(/^[A-Z][A-Za-z0-9-]*$/, 'The key may only start with a capital letter and contain only alphanumeric characters.'); | ||
var headerValue = string().nullable(false).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
var secretKey = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(true).min(32, 'Choose a secret key that is min. 32 characters long.').max(64, 'The secret key may not exceed 64 characters.').test({ | ||
name: 'no-whitespace', | ||
test: function (value) { | ||
return !/\s/g.test(value); | ||
}, | ||
message: 'Whitespace is not allowed. Secret key could be alphanumeric with special characters', | ||
exclusive: false | ||
}); | ||
// from RFC 3986 | ||
splitted = splitUri(value); | ||
scheme = splitted[1]; | ||
authority = splitted[2]; | ||
path = splitted[3]; | ||
query = splitted[4]; | ||
fragment = splitted[5]; | ||
// scheme and path are required, though the path can be empty | ||
if (!(scheme && scheme.length && path.length >= 0)) return; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjp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3Q6IGZ1bmN0aW9uICh2YWx1ZSkgeyByZXR1cm4gIS9cXHMvZy50ZXN0KHZhbHVlKTsgfSxcclxuICAgIG1lc3NhZ2U6ICdXaGl0ZXNwYWNlIGlzIG5vdCBhbGxvd2VkLiBTZWNyZXQga2V5IGNvdWxkIGJlIGFscGhhbnVtZXJpYyB3aXRoIHNwZWNpYWwgY2hhcmFjdGVycycsXHJcbiAgICBleGNsdXNpdmU6IGZhbHNlLFxyXG59KTtcclxuIl19 | ||
// if authority is present, the path must be empty or begin with a / | ||
if (authority && authority.length) { | ||
if (!(path.length === 0 || /^\//.test(path))) return; | ||
} else { | ||
// if authority is not present, the path must not start with // | ||
if (/^\/\//.test(path)) return; | ||
} | ||
// scheme must begin with a letter, then consist of letters, digits, +, ., or - | ||
if (!/^[a-z][a-z0-9\+\-\.]*$/.test(scheme.toLowerCase())) return; | ||
var webhook = ({ | ||
name: name$4, | ||
url: url$1, | ||
headerKey: headerKey, | ||
headerValue: headerValue, | ||
secretKey: secretKey | ||
}); | ||
// re-assemble the URL per section 5.3 in RFC 3986 | ||
out += scheme + ':'; | ||
if (authority && authority.length) { | ||
out += '//' + authority; | ||
} | ||
var apiId$3 = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter an Api Id.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
name: 'no-graphql-type', | ||
test: function (value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).matches(/^[a-zA-Z][a-zA-Z0-9_]*$/, 'Start with a letter, and use only alphanumeric characters or underscores.'); | ||
var displayName$4 = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter a Display Name.').trim('The display name may not have leading or trailing whitespaces.'); | ||
out += path; | ||
if (query && query.length) { | ||
out += '?' + query; | ||
} | ||
//# sourceMappingURL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lIFwic3RyaW5nXCIhJylcclxuICAgIC5taW4oMSwgJ0VudGVyIGEgRGlzcGxheSBOYW1lLicpXHJcbiAgICAudHJpbSgnVGhlIGRpc3BsYXkgbmFtZSBtYXkgbm90IGhhdmUgbGVhZGluZyBvciB0cmFpbGluZyB3aGl0ZXNwYWNlcy4nKTtcclxuIl19 | ||
if (fragment && fragment.length) { | ||
out += '#' + fragment; | ||
} | ||
return out; | ||
} | ||
var locale = ({ | ||
apiId: apiId$3, | ||
displayName: displayName$4 | ||
}); | ||
function is_http_iri(value, allowHttps) { | ||
if (!is_iri(value)) { | ||
return; | ||
} | ||
var name$5 = string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).trim('The view group name may not start or end with whitespace characters.').min(1, 'Choose a name for this view group.').max(32, 'Choose an name that is shorter than 32 characters.'); | ||
var splitted = []; | ||
var scheme = ''; | ||
var authority = ''; | ||
var path = ''; | ||
var port = ''; | ||
var query = ''; | ||
var fragment = ''; | ||
var out = ''; | ||
// from RFC 3986 | ||
splitted = splitUri(value); | ||
scheme = splitted[1]; | ||
authority = splitted[2]; | ||
path = splitted[3]; | ||
query = splitted[4]; | ||
fragment = splitted[5]; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInZpZXdHcm91cC50cyhvcmlnaW5hbCkiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsWUFBWSxTQUFTO0FBQ3JCLE9BQU8sR0FBQSxDQUFJLE9BQU8sR0FBQSxDQUNiLE1BRGEsRUFBQSxDQUViLFNBRmEsQ0FFSCx3RkFGRyxDQUdiLE1BSGEsQ0FHTixLQUhNLENBSWIsSUFKYSxDQUlSLHVFQUpRLENBS2IsR0FMYSxDQUtULEdBQUcscUNBTE0sQ0FNYixHQU5hLENBTVQsSUFBSTtBQVBiIiwiZmlsZSI6InZpZXdHcm91cC50cyhvcmlnaW5hbCkiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgKiBhcyB5dXAgZnJvbSAneXVwJztcclxuZXhwb3J0IHZhciBuYW1lID0geXVwXHJcbiAgICAuc3RyaW5nKClcclxuICAgIC50eXBlRXJyb3IoJ1RoZSBzdXBwbGllZCB2YWx1ZSBcIiR7dmFsdWV9XCIgb2YgdHlwZSBcIiR7dHlwZX1cIiBpcyBub3QgY29tcGF0aWJsZSB3aXRoIHR5cGUgXCJzdHJpbmdcIiEnKVxyXG4gICAgLnN0cmljdCh0cnVlKVxyXG4gICAgLnRyaW0oJ1RoZSB2aWV3IGdyb3VwIG5hbWUgbWF5IG5vdCBzdGFydCBvciBlbmQgd2l0aCB3aGl0ZXNwYWNlIGNoYXJhY3RlcnMuJylcclxuICAgIC5taW4oMSwgJ0Nob29zZSBhIG5hbWUgZm9yIHRoaXMgdmlldyBncm91cC4nKVxyXG4gICAgLm1heCgzMiwgJ0Nob29zZSBhbiBuYW1lIHRoYXQgaXMgc2hvcnRlciB0aGFuIDMyIGNoYXJhY3RlcnMuJyk7XHJcbiJdfQ== | ||
if (!scheme) return; | ||
if(allowHttps) { | ||
if (scheme.toLowerCase() != 'https') return; | ||
} else { | ||
if (scheme.toLowerCase() != 'http') return; | ||
} | ||
var viewGroup = ({ | ||
name: name$5 | ||
// fully-qualified URIs must have an authority section that is | ||
// a valid host | ||
if (!authority) { | ||
return; | ||
} | ||
// enable port component | ||
if (/:(\d+)$/.test(authority)) { | ||
port = authority.match(/:(\d+)$/)[0]; | ||
authority = authority.replace(/:\d+$/, ''); | ||
} | ||
out += scheme + ':'; | ||
out += '//' + authority; | ||
if (port) { | ||
out += port; | ||
} | ||
out += path; | ||
if(query && query.length){ | ||
out += '?' + query; | ||
} | ||
if(fragment && fragment.length){ | ||
out += '#' + fragment; | ||
} | ||
return out; | ||
} | ||
function is_https_iri(value) { | ||
return is_http_iri(value, true); | ||
} | ||
function is_web_iri(value) { | ||
return (is_http_iri(value) || is_https_iri(value)); | ||
} | ||
})(module); | ||
});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qIGFzIHZpZXdHcm91cCBmcm9tICcuL3ZpZXdHcm91cCc7XHJcbmV4cG9ydCB7IGF1dGh0b2tlbiwgZW51bWVyYXRpb24sIGZpZWxkLCBpbnZpdGUsIG1vZGVsLCBwcm9qZWN0LCByb2xlLCBzdGFnZSwgd2ViaG9vaywgbG9jYWxlLCB2aWV3R3JvdXAsIH07XHJcbiJdfQ== | ||
var name$1 = yup.string().min(1).nullable(false).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
var url = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).test('is-https-url', 'Only HTTPS URLs are supported!', function (value) { | ||
return !!validUrl.isHttpsUri(value); | ||
}).required(); | ||
var headerKey = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).matches(/^[A-Z][A-Za-z0-9-]*$/, 'The key may only start with a capital letter and contain only alphanumeric characters.'); | ||
var headerValue = yup.string().nullable(false).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
var secretKey = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(true).min(32, 'Choose a secret key that is min. 32 characters long.').max(64, 'The secret key may not exceed 64 characters.').test({ | ||
name: 'no-whitespace', | ||
test: function test(value) { | ||
return !/\s/g.test(value); | ||
}, | ||
message: 'Whitespace is not allowed. Secret key could be alphanumeric with special characters', | ||
exclusive: false | ||
}); | ||
export { authtoken, enumeration, field, invite, model, project, role, stage, webhook, locale, viewGroup }; | ||
var webhook = { | ||
__proto__: null, | ||
name: name$1, | ||
url: url, | ||
headerKey: headerKey, | ||
headerValue: headerValue, | ||
secretKey: secretKey | ||
}; | ||
var apiId = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter an Api Id.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
name: 'no-graphql-type', | ||
test: function test(value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).matches(/^[a-zA-Z][a-zA-Z0-9_]*$/, 'Start with a letter, and use only alphanumeric characters or underscores.'); | ||
var displayName = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter a Display Name.').trim('The display name may not have leading or trailing whitespaces.'); | ||
var locale = { | ||
__proto__: null, | ||
apiId: apiId, | ||
displayName: displayName | ||
}; | ||
var name = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).trim('The view group name may not start or end with whitespace characters.').min(1, 'Choose a name for this view group.').max(32, 'Choose an name that is shorter than 32 characters.'); | ||
var viewGroup = { | ||
__proto__: null, | ||
name: name | ||
}; | ||
export { authtoken, enumeration, field, invite, locale, model, project, role, stage, viewGroup, webhook }; | ||
//# sourceMappingURL=validation.m.js.map |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('yup')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'yup'], factory) : | ||
(factory((global.validation = {}),global.yup)); | ||
}(this, (function (exports,yup) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('yup')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'yup'], factory) : | ||
(global = global || self, factory(global.validation = {}, global.yup)); | ||
})(this, (function (exports, yup) { | ||
function _interopNamespace(e) { | ||
if (e && e.__esModule) return e; | ||
var n = Object.create(null); | ||
if (e) { | ||
Object.keys(e).forEach(function (k) { | ||
if (k !== 'default') { | ||
var d = Object.getOwnPropertyDescriptor(e, k); | ||
Object.defineProperty(n, k, d.get ? d : { | ||
enumerable: true, | ||
get: function () { return e[k]; } | ||
}); | ||
} | ||
}); | ||
} | ||
n["default"] = e; | ||
return n; | ||
} | ||
var name = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1).ensure().trim('The name of an authentication token may not start or end with white space characters.'); | ||
var description = yup.string().nullable(true); | ||
var scope = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).oneOf(['READ', | ||
'WRITE','OPEN'], "An authentication token can only be set to one of 'READ', 'WRITE' or 'OPEN'"); | ||
var yup__namespace = /*#__PURE__*/_interopNamespace(yup); | ||
var name$5 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1).ensure().trim('The name of an authentication token may not start or end with white space characters.'); | ||
var description$4 = yup__namespace.string().nullable(true); | ||
var scope = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).oneOf(['READ', 'WRITE', 'OPEN'], "An authentication token can only be set to one of 'READ', 'WRITE' or 'OPEN'"); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImF1dGh0b2tlbi50cyhvcmlnaW5hbCkiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsWUFBWSxTQUFTO0FBQ3JCLE9BQU8sR0FBQSxDQUFJLE9BQU8sR0FBQSxDQUNiLE1BRGEsRUFBQSxDQUViLFNBRmEsQ0FFSCx3RkFGRyxDQUdiLE1BSGEsQ0FHTixLQUhNLENBSWIsR0FKYSxDQUlULEVBSlMsQ0FLYixNQUxhLEVBQUEsQ0FNYixJQU5hLENBTVI7QUFDVixPQUFPLEdBQUEsQ0FBSSxjQUFjLEdBQUEsQ0FBSSxNQUFKLEVBQUEsQ0FBYSxRQUFiLENBQXNCO0FBQy9DLE9BQU8sR0FBQSxDQUFJLFFBQVEsR0FBQSxDQUNkLE1BRGMsRUFBQSxDQUVkLFNBRmMsQ0FFSix3RkFGSSxDQUdkLE1BSGMsQ0FHUCxLQUhPLENBSWQsS0FKYyxDQUlSLENBQUM7SUFBUSxRQUFTLFNBQVM7QUFidEMiLCJmaWxlIjoiYXV0aHRva2VuLnRzKG9yaWdpbmFsKSIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCAqIGFzIHl1cCBmcm9tICd5dXAnO1xyXG5leHBvcnQgdmFyIG5hbWUgPSB5dXBcclxuICAgIC5zdHJpbmcoKVxyXG4gICAgLnR5cGVFcnJvcignVGhlIHN1cHBsaWVkIHZhbHVlIFwiJHt2YWx1ZX1cIiBvZiB0eXBlIFwiJHt0eXBlfVwiIGlzIG5vdCBjb21wYXRpYmxlIHdpdGggdHlwZSBcInN0cmluZ1wiIScpXHJcbiAgICAuc3RyaWN0KHRydWUpXHJcbiAgICAubWluKDEpXHJcbiAgICAuZW5zdXJlKClcclxuICAgIC50cmltKCdUaGUgbmFtZSBvZiBhbiBhdXRoZW50aWNhdGlvbiB0b2tlbiBtYXkgbm90IHN0YXJ0IG9yIGVuZCB3aXRoIHdoaXRlIHNwYWNlIGNoYXJhY3RlcnMuJyk7XHJcbmV4cG9ydCB2YXIgZGVzY3JpcHRpb24gPSB5dXAuc3RyaW5nKCkubnVsbGFibGUodHJ1ZSk7XHJcbmV4cG9ydCB2YXIgc2NvcGUgPSB5dXBcclxuICAgIC5zdHJpbmcoKVxyXG4gICAgLnR5cGVFcnJvcignVGhlIHN1cHBsaWVkIHZhbHVlIFwiJHt2YWx1ZX1cIiBvZiB0eXBlIFwiJHt0eXBlfVwiIGlzIG5vdCBjb21wYXRpYmxlIHdpdGggdHlwZSBcInN0cmluZ1wiIScpXHJcbiAgICAuc3RyaWN0KHRydWUpXHJcbiAgICAub25lT2YoWydSRUFEJywgJ1dSSVRFJywgJ09QRU4nXSwgXCJBbiBhdXRoZW50aWNhdGlvbiB0b2tlbiBjYW4gb25seSBiZSBzZXQgdG8gb25lIG9mICdSRUFEJywgJ1dSSVRFJyBvciAnT1BFTidcIik7XHJcbiJdfQ== | ||
var authtoken = { | ||
__proto__: null, | ||
name: name$5, | ||
description: description$4, | ||
scope: scope | ||
}; | ||
var graphQlTypeNames = ['int', 'float', 'string', 'boolean', 'enum', 'interface', 'union', 'fragment', 'datetime', 'json', 'mutation', 'subscription', 'scalar', 'query', 'input', 'node']; | ||
var reservedNonSystemTypeNames = ['Id', 'User', 'Search', 'Status', 'Locale', 'RichText', 'RichTextAST', 'Location', 'LocationInput', 'Color', 'ColorInput', 'RGBATransparency', 'RGBAHue', 'HEX', 'RGBA', 'ScheduledRelease', 'ScheduledOperation']; | ||
var reservedNonSystemFieldNames = ['id', 'createdat', 'updatedat', 'versions', 'createdby', 'status', 'publishedat', 'localizations', 'documentInStages', 'publish', 'locale', 'updatedby', 'publishedby']; | ||
var reservedModelApiIds = ['Type'].concat(reservedNonSystemTypeNames); | ||
var reservedEnumerationApiIds = ['Type'].concat(reservedNonSystemTypeNames); | ||
var reservedFieldApiIds = reservedNonSystemFieldNames; | ||
var authtoken = ({ | ||
name: name, | ||
description: description, | ||
scope: scope | ||
}); | ||
/** | ||
* Matcher for enumeration api IDs: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .min() -> Sets minimum required length of string to 1 character | ||
* .max() -> Sets maximum required length of string to 64 characters | ||
* .matches(:RegExpr) -> Matches the input value against a regular expression | ||
*/ | ||
var graphQlTypeNames = ['int','float','string','boolean','enum','interface', | ||
'union','fragment','datetime','json','mutation','subscription','scalar','query', | ||
'input','node']; | ||
var reservedNonSystemTypeNames = ['Id','User','Search','Status','Locale','RichText', | ||
'RichTextAST','Location','LocationInput','Color','ColorInput','RGBATransparency', | ||
'RGBAHue','HEX','RGBA','ScheduledRelease','ScheduledOperation']; | ||
var reservedNonSystemFieldNames = ['id','createdat','updatedat','versions','createdby', | ||
'status','publishedat','localizations','documentInStages','publish','locale', | ||
'updatedby','publishedby']; | ||
var reservedModelApiIds = ['Type'].concat(reservedNonSystemTypeNames); | ||
var reservedEnumerationApiIds = ['Type'].concat(reservedNonSystemTypeNames); | ||
var reservedFieldApiIds = reservedNonSystemFieldNames; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIj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S5jb25jYXQocmVzZXJ2ZWROb25TeXN0ZW1UeXBlTmFtZXMpO1xyXG5leHBvcnQgdmFyIHJlc2VydmVkRW51bWVyYXRpb25BcGlJZHMgPSBbJ1R5cGUnXS5jb25jYXQocmVzZXJ2ZWROb25TeXN0ZW1UeXBlTmFtZXMpO1xyXG5leHBvcnQgdmFyIHJlc2VydmVkRmllbGRBcGlJZHMgPSByZXNlcnZlZE5vblN5c3RlbUZpZWxkTmFtZXM7XHJcbiJdfQ== | ||
var apiId = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter an Api Id.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
var apiId$3 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter an Api Id.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
name: 'no-graphql-type', | ||
test: function (value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
test: function test(value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).test({ | ||
}).test({ | ||
name: 'no-reserved-word', | ||
test: function (value) { | ||
var options = this.options; | ||
if (options.context && options.context.isSystem) { | ||
return true; | ||
} | ||
var reservedApiIds = reservedEnumerationApiIds; | ||
if (options.context && options.context.isLocalized) { | ||
reservedApiIds = reservedEnumerationApiIds.filter(function (word) { | ||
return word !== 'Locale'; | ||
}); | ||
} | ||
return !reservedApiIds.some(function (reservedWord) { | ||
return value ? reservedWord.toLowerCase() === value.toLowerCase() : false; | ||
test: function test(value) { | ||
var options = this.options; | ||
if (options.context && options.context.isSystem) { | ||
return true; | ||
} | ||
var reservedApiIds = reservedEnumerationApiIds; | ||
if (options.context && options.context.isLocalized) { | ||
reservedApiIds = reservedEnumerationApiIds.filter(function (word) { | ||
return word !== 'Locale'; | ||
}); | ||
} | ||
return !reservedApiIds.some(function (reservedWord) { | ||
return value ? reservedWord.toLowerCase() === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).matches(/^[A-Z][a-zA-Z0-9_]*$/, 'Start with a capital letter and use only alphanumeric characters and underscores.'); | ||
var displayName = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter a Display Name.').trim('The display name may not have leading or trailing whitespaces.'); | ||
var description$1 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
var valueItemApiId = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter a value.').max(191, 'Use a value that is shorter than 191 characters.').matches(/^[a-zA-Z][a-zA-Z0-9_]*$/, 'Start with a letter, and use only alphanumeric characters or underscores.'); | ||
var valueItemDisplayName = displayName; | ||
var enumerationId = yup.string().strict(true); | ||
}).matches(/^[A-Z][a-zA-Z0-9_]*$/, 'Start with a capital letter and use only alphanumeric characters and underscores.'); // <-- RegEx from Prisma | ||
/** | ||
* Matcher for enumeration api IDs: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .trim() -> Since strict is true, this only validates that the input value is trimmed | ||
* This means that it checks that the value does not have any leading or trailing whitespaces. | ||
*/ | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVudW1lcmF0aW9uLnRzKG9yaWdpbmFsKSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxZQUFZLFNBQVM7QUFDckIsUUFBUyxrQkFBa0IsZ0NBQWlDO0FBVTVELE9BQU8sR0FBQSxDQUFJLFFBQVEsR0FBQSxDQUNkLE1BRGMsRUFBQSxDQUVkLFNBRmMsQ0FFSix3RkFGSSxDQUdkLEd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lbURpc3BsYXlOYW1lID0gZGlzcGxheU5hbWU7XHJcbmV4cG9ydCB2YXIgZW51bWVyYXRpb25JZCA9IHl1cC5zdHJpbmcoKS5zdHJpY3QodHJ1ZSk7XHJcbiJdfQ== | ||
var displayName$4 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter a Display Name.').trim('The display name may not have leading or trailing whitespaces.'); | ||
/** | ||
* Matcher for model descriptions: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .ensure() -> Transforms the values "undefined" and "null" into empty strings | ||
*/ | ||
var description$3 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
/** | ||
* Matcher for enumeration api IDs: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .strict(:boolean) -> Prevents manipulation of the string during validation | ||
* .min() -> Sets minimum required length of string to 1 character | ||
* .max() -> Sets maximum required length of string to 64 characters | ||
* .test() -> Executes an arbitrary test on the input value | ||
* .matches(:RegExpr) -> Matches the input value against a regular expression | ||
*/ | ||
var enumeration = ({ | ||
apiId: apiId, | ||
displayName: displayName, | ||
description: description$1, | ||
valueItemApiId: valueItemApiId, | ||
valueItemDisplayName: valueItemDisplayName, | ||
enumerationId: enumerationId | ||
}); | ||
var valueItemApiId = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter a value.').max(191, 'Use a value that is shorter than 191 characters.').matches(/^[a-zA-Z][a-zA-Z0-9_]*$/, 'Start with a letter, and use only alphanumeric characters or underscores.'); | ||
var valueItemDisplayName = displayName$4; | ||
var enumerationId = yup__namespace.string().strict(true); | ||
var apiId$1 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter an Api Id.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
var enumeration = { | ||
__proto__: null, | ||
apiId: apiId$3, | ||
displayName: displayName$4, | ||
description: description$3, | ||
valueItemApiId: valueItemApiId, | ||
valueItemDisplayName: valueItemDisplayName, | ||
enumerationId: enumerationId | ||
}; | ||
/** | ||
* Matcher for field api IDs: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .strict(:boolean) -> Prevents manipulation of the string during validation | ||
* .min() -> Sets minimum required length of string to 1 character | ||
* .max() -> Sets maximum required length of string to 64 characters | ||
* .test() -> Executes an arbitrary test on the input value | ||
* .matches(:RegExpr) -> Matches the input value against a regular expression | ||
*/ | ||
var apiId$2 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter an Api Id.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
name: 'no-graphql-type', | ||
test: function (value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
test: function test(value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).test({ | ||
}).test({ | ||
name: 'no-reserved-word', | ||
test: function (value) { | ||
var options = this.options; | ||
if (options.context && options.context.isSystem) { | ||
return true; | ||
} | ||
return !reservedFieldApiIds.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
test: function test(value) { | ||
var options = this.options; | ||
if (options.context && options.context.isSystem) { | ||
return true; | ||
} | ||
return !reservedFieldApiIds.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).matches(/^[a-z][a-zA-Z0-9_]*$/, 'Start with a lowercase letter and use only alphanumeric characters and underscores.'); | ||
var reverseRelationFieldApiId = apiId$1.concat(yup.string().max(64, 'The API ID of a field may not exceed 64 characters.')); | ||
var displayName$1 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter a Display Name.').max(64, 'The Display Name of a field may not exceed 64characters.').test('no-letter', 'Enter a Display Name.', function (value) { | ||
}).matches(/^[a-z][a-zA-Z0-9_]*$/, 'Start with a lowercase letter and use only alphanumeric characters and underscores.'); // <-- Those are validations enforced by prisma: https://github.com/graphcool/prisma/blob/master/server/servers/deploy/src/main/scala/com/prisma/deploy/validation/NameConstraints.scala | ||
/** | ||
* Matcher for field api IDs for the reverse relation side: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .strict(:boolean) -> Prevents manipulation of the string during validation | ||
* .min() -> Sets minimum required length of string to 1 character | ||
* .max() -> Sets maximum required length of string to 64 characters | ||
* .test() -> Executes an arbitrary test on the input value | ||
* .matches(:RegExpr) -> Matches the input value against a regular expression | ||
*/ | ||
var reverseRelationFieldApiId = apiId$2.concat(yup__namespace.string().max(64, 'The API ID of a field may not exceed 64 characters.')); | ||
/** | ||
* Matcher for field display names: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .strict(:boolean) -> Prevents manipulation of the string during validation | ||
* .min() -> Sets minimum required length of string to 1 character | ||
* .max() -> Sets maximum required length of string to 64 characters | ||
* .test() -> Executes an arbitrary test on the input value | ||
*/ | ||
var displayName$3 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter a Display Name.').max(64, 'The Display Name of a field may not exceed 64characters.').test('no-letter', 'Enter a Display Name.', function (value) { | ||
if (!value) { | ||
return true; | ||
return true; | ||
} | ||
if (value && typeof value === 'string') { | ||
return value.replace(/\s/g, '').length > 0; | ||
return value.replace(/\s/g, '').length > 0; | ||
} | ||
return false; | ||
}); | ||
var description$2 = yup.string().nullable(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').ensure(); | ||
var isList = yup.boolean().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
var isHidden = yup.boolean().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
var isApiOnly = yup.boolean().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
var isReadOnly = yup.boolean().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
}); | ||
/** | ||
* Matcher for field descriptions: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .ensure() -> Transforms the values "undefined" and "null" into empty strings | ||
*/ | ||
var description$2 = yup__namespace.string().nullable(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').ensure(); | ||
var isList = yup__namespace["boolean"]().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
var isHidden = yup__namespace["boolean"]().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
var isApiOnly = yup__namespace["boolean"]().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
var isReadOnly = yup__namespace["boolean"]().strict(true).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "boolean"!'); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZpZWxkLnRzKG9yaWdpbmFsKSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxZQUFZLFNBQVM7QUFDckIsUUFBUyxrQkFBa0IsMEJBQTJCO0FBWXRELE9BQU8sR0FBQSxDQUFJLFFBQVEsR0FBQSxDQUNkLE1BRGMsRUFBQSxDQUVkLFNBRmMsQ0FFSix3RkFGSSxDQUdkLE1BSGMsQ0FHUCxLQUhPLENBSWQsR0FKYyxDQU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cIiR7dHlwZX1cIiBpcyBub3QgY29tcGF0aWJsZSB3aXRoIHR5cGUgXCJib29sZWFuXCIhJyk7XHJcbmV4cG9ydCB2YXIgaXNBcGlPbmx5ID0geXVwXHJcbiAgICAuYm9vbGVhbigpXHJcbiAgICAuc3RyaWN0KHRydWUpXHJcbiAgICAudHlwZUVycm9yKCdUaGUgc3VwcGxpZWQgdmFsdWUgXCIke3ZhbHVlfVwiIG9mIHR5cGUgXCIke3R5cGV9XCIgaXMgbm90IGNvbXBhdGlibGUgd2l0aCB0eXBlIFwiYm9vbGVhblwiIScpO1xyXG5leHBvcnQgdmFyIGlzUmVhZE9ubHkgPSB5dXBcclxuICAgIC5ib29sZWFuKClcclxuICAgIC5zdHJpY3QodHJ1ZSlcclxuICAgIC50eXBlRXJyb3IoJ1RoZSBzdXBwbGllZCB2YWx1ZSBcIiR7dmFsdWV9XCIgb2YgdHlwZSBcIiR7dHlwZX1cIiBpcyBub3QgY29tcGF0aWJsZSB3aXRoIHR5cGUgXCJib29sZWFuXCIhJyk7XHJcbiJdfQ== | ||
var field = { | ||
__proto__: null, | ||
apiId: apiId$2, | ||
reverseRelationFieldApiId: reverseRelationFieldApiId, | ||
displayName: displayName$3, | ||
description: description$2, | ||
isList: isList, | ||
isHidden: isHidden, | ||
isApiOnly: isApiOnly, | ||
isReadOnly: isReadOnly | ||
}; | ||
var email = yup__namespace.string().nullable(false).min(1).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').email('Only valid E-Mail addresses are allowed.'); | ||
var field = ({ | ||
apiId: apiId$1, | ||
reverseRelationFieldApiId: reverseRelationFieldApiId, | ||
displayName: displayName$1, | ||
description: description$2, | ||
isList: isList, | ||
isHidden: isHidden, | ||
isApiOnly: isApiOnly, | ||
isReadOnly: isReadOnly | ||
}); | ||
var invite = { | ||
__proto__: null, | ||
email: email | ||
}; | ||
var email = yup.string().nullable(false).min(1).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').email('Only valid E-Mail addresses are allowed.'); | ||
/** | ||
* Matcher for model api IDs: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .strict(:boolean) -> Prevents manipulation of the string during validation | ||
* .min() -> Sets minimum required length of string to 1 character | ||
* .max() -> Sets maximum required length of string to 64 characters | ||
* .required() -> Ensures that empty strings are treated as invalid value | ||
* .test() -> Executes an arbitrary test on the input value | ||
* .matches(:RegExpr) -> Matches the input value against a regular expression | ||
*/ | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImludml0ZS50cyhvcmlnaW5hbCkiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsWUFBWSxTQUFTO0FBQ3JCLE9BQU8sR0FBQSxDQUFJLFFBQVEsR0FBQSxDQUNkLE1BRGMsRUFBQSxDQUVkLFFBRmMsQ0FFTCxNQUZLLENBR2QsR0FIYyxDQUdWLEVBSFUsQ0FJZCxTQUpjLENBSUosd0ZBSkksQ0FLZCxLQUxjLENBS1I7QUFOWCIsImZpbGUiOiJpbnZpdGUudHMob3JpZ2luYWwpIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0ICogYXMgeXVwIGZyb20gJ3l1cCc7XHJcbmV4cG9ydCB2YXIgZW1haWwgPSB5dXBcclxuICAgIC5zdHJpbmcoKVxyXG4gICAgLm51bGxhYmxlKGZhbHNlKVxyXG4gICAgLm1pbigxKVxyXG4gICAgLnR5cGVFcnJvcignVGhlIHN1cHBsaWVkIHZhbHVlIFwiJHt2YWx1ZX1cIiBvZiB0eXBlIFwiJHt0eXBlfVwiIGlzIG5vdCBjb21wYXRpYmxlIHdpdGggdHlwZSBcInN0cmluZ1wiIScpXHJcbiAgICAuZW1haWwoJ09ubHkgdmFsaWQgRS1NYWlsIGFkZHJlc3NlcyBhcmUgYWxsb3dlZC4nKTtcclxuIl19 | ||
var invite = ({ | ||
email: email | ||
}); | ||
var apiId$2 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter an Api ID.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
var apiId$1 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter an Api ID.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
name: 'no-graphql-type', | ||
test: function (value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
test: function test(value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).test({ | ||
}).test({ | ||
name: 'no-reserved-word', | ||
test: function (value) { | ||
var options = this.options; | ||
if (options.context && options.context.isSystem) { | ||
return true; | ||
} | ||
return !reservedModelApiIds.some(function (reservedWord) { | ||
return value ? reservedWord.toLowerCase() === value.toLowerCase() : false; | ||
}); | ||
test: function test(value) { | ||
var options = this.options; | ||
if (options.context && options.context.isSystem) { | ||
return true; | ||
} | ||
return !reservedModelApiIds.some(function (reservedWord) { | ||
return value ? reservedWord.toLowerCase() === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).matches(/^[A-Z][a-zA-Z0-9_]*$/, 'Start with a capital letter and use only alphanumeric characters and underscores.'); | ||
var displayName$2 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter a Display Name').trim('Display names may not have leading or trailing whitespaces.'); | ||
var description$3 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').ensure(); | ||
var modelId = yup.string().strict(true); | ||
var previewURLs = yup.array().of(yup.object().shape({ | ||
name: yup.string().required(), | ||
template: yup.string().required() | ||
}).required()); | ||
}).matches(/^[A-Z][a-zA-Z0-9_]*$/, 'Start with a capital letter and use only alphanumeric characters and underscores.'); // <-- Those are validations enforced by prisma: https://github.com/graphcool/prisma/blob/master/server/servers/deploy/src/main/scala/com/prisma/deploy/validation/NameConstraints.scala | ||
/** | ||
* Matcher for model display names: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .strict(:boolean) -> Prevents manipulation of the string during validation | ||
* .required() -> Ensures that empty strings are treated as invalid value | ||
*/ | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1vZGVsLnRzKG9yaWdpbmFsKSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxZQUFZLFNBQVM7QUFDckIsUUFBUyxrQkFBa0IsMEJBQTJCO0FBYXRELE9BQU8sR0FBQSxDQUFJLFFBQVEsR0FBQSxDQUNkLE1BRGMsRUFBQSxDQUVkLFNBRmMsQ0FFSix3RkFGSSxDQUdkLE1BSGMsQ0FHUCxLQUhPLENBSWQsR0FKYyxDQUlWLEdBQUcsbUJBSk8sQ0FLZCxHQUxjLENBS1YsSUFBSSxvREFMTSxDQU1kLElBTmMsQ0FNVDtJQUNOLE1BQU0saUJBREEsQ0FBQTtJQUVOLE1BQU0sVUFBVSxPQUFPO1FBQ25CLE9BQU8sQ0FBQyxnQkFBQSxDQUFpQixJQUFqQixDQUFzQixVQUFVLGNBQWM7WUFBRSxPQUFRLEtBQUEsR0FBUSxZQUFBLENBQUEsR0FBQSxDQUFpQixLQUFBLENBQU0sV0FBTixLQUFzQjtRQUF2SDtJQUNBLENBSlUsQ0FBQTtJQUtOLFNBQVMsMERBTEgsQ0FBQTtJQU1OLFdBQVc7RUFaSSxDQWNkLElBZGMsQ0FjVDtJQUNOLE1BQU0sa0JBREEsQ0FBQTtJQUVOLE1BQU0sVUFBVSxPQUFPO1FBQ25CLEdBQUEsQ0FBSSxVQUFVLElBQUEsQ0FBSztR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CkgICAgICAgICAgLT4gVHJhbnNmb3JtcyB0aGUgdmFsdWVzIFwidW5kZWZpbmVkXCIgYW5kIFwibnVsbFwiIGludG8gZW1wdHkgc3RyaW5nc1xyXG4gKi9cclxuZXhwb3J0IHZhciBkZXNjcmlwdGlvbiA9IHl1cFxyXG4gICAgLnN0cmluZygpXHJcbiAgICAudHlwZUVycm9yKCdUaGUgc3VwcGxpZWQgdmFsdWUgXCIke3ZhbHVlfVwiIG9mIHR5cGUgXCIke3R5cGV9XCIgaXMgbm90IGNvbXBhdGlibGUgd2l0aCB0eXBlIFwic3RyaW5nXCIhJylcclxuICAgIC5lbnN1cmUoKTtcclxuZXhwb3J0IHZhciBtb2RlbElkID0geXVwLnN0cmluZygpLnN0cmljdCh0cnVlKTtcclxuZXhwb3J0IHZhciBwcmV2aWV3VVJMcyA9IHl1cC5hcnJheSgpLm9mKHl1cFxyXG4gICAgLm9iamVjdCgpXHJcbiAgICAuc2hhcGUoe1xyXG4gICAgbmFtZTogeXVwLnN0cmluZygpLnJlcXVpcmVkKCksXHJcbiAgICB0ZW1wbGF0ZTogeXVwLnN0cmluZygpLnJlcXVpcmVkKCksXHJcbn0pXHJcbiAgICAucmVxdWlyZWQoKSk7XHJcbiJdfQ== | ||
var displayName$2 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Enter a Display Name').trim('Display names may not have leading or trailing whitespaces.'); | ||
/** | ||
* Matcher for model descriptions: | ||
* | ||
* .string() -> Ensures that only strings can be validated with success | ||
* .typeError(:string)-> Ensures that types other than string return false | ||
* .ensure() -> Transforms the values "undefined" and "null" into empty strings | ||
*/ | ||
var description$1 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').ensure(); | ||
var modelId = yup__namespace.string().strict(true); | ||
var previewURLs = yup__namespace.array().of(yup__namespace.object().shape({ | ||
name: yup__namespace.string().required(), | ||
template: yup__namespace.string().required() | ||
}).required()); | ||
var model = ({ | ||
apiId: apiId$2, | ||
displayName: displayName$2, | ||
description: description$3, | ||
modelId: modelId, | ||
previewURLs: previewURLs | ||
}); | ||
var model = { | ||
__proto__: null, | ||
apiId: apiId$1, | ||
displayName: displayName$2, | ||
description: description$1, | ||
modelId: modelId, | ||
previewURLs: previewURLs | ||
}; | ||
var API_REGIONS = ['EU_WEST_1','EU_WEST_3','US_EAST_1','US_WEST_1','AP_NORTHEAST_1']; | ||
var name$1 = yup.string().min(1, 'Enter a Name').typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).strict(true); | ||
var region = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).strict(true).min(1).oneOf(API_REGIONS, 'The region can only be one of these values: ${values}'); | ||
var description$4 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
var url = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1).url('The custom prisma endpoint must be a valid url!').test('no-end-with-management', 'The custom prisma endpoint may not end with "/management"', function (value) { | ||
if (!value) | ||
return false; | ||
var API_REGIONS = ['EU_WEST_1', 'EU_WEST_3', 'US_EAST_1', 'US_WEST_1', 'AP_NORTHEAST_1']; // Use this for identifiers: "^[a-zA-Z][a-zA-Z0-9\\-_~]*$" | ||
var name$4 = yup__namespace.string().min(1, 'Enter a Name').typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).strict(true); | ||
var region = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).strict(true).min(1).oneOf(API_REGIONS, 'The region can only be one of these values: ${values}'); | ||
var description = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
var url$1 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1).url('The custom prisma endpoint must be a valid url!').test('no-end-with-management', 'The custom prisma endpoint may not end with "/management"', function (value) { | ||
if (!value) return false; | ||
return !value.endsWith('/management'); | ||
}); | ||
var token = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).required('A token can not be empty!'); | ||
var customPrisma = { | ||
url: url, | ||
}); | ||
var token = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).required('A token can not be empty!'); | ||
var customPrisma = { | ||
url: url$1, | ||
token: token | ||
}; | ||
}; | ||
var project = { | ||
__proto__: null, | ||
API_REGIONS: API_REGIONS, | ||
name: name$4, | ||
region: region, | ||
description: description, | ||
customPrisma: customPrisma | ||
}; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInByb2plY3QudHMob3JpZ2luYWwpIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFlBQVksU0FBUztBQUNyQixPQUFPLEdBQUEsQ0FBSSxjQUFjLENBQUMsWUFBYSxZQUFhLFlBQWEsWUFBYTtBQUU5RSxPQUFPLEdBQUEsQ0FBSSxPQUFPLEdBQUEsQ0FDYixNQURhLEVBQUEsQ0FFYixHQUZhLENBRVQsR0FBRyxlQUZNLENBR2IsU0FIYSxDQUdILHdGQUhHLENBSWIsUUFKYSxDQUlKLE1BSkksQ0FLYixNQUxhLENBS047QUFDWixPQUFPLEdBQUEsQ0FBSSxTQUFTLEdBQUEsQ0FDZixNQURlLEVBQUEsQ0FFZixTQUZlLENBRUwsd0ZBRkssQ0FHZixRQUhlLENBR04sTUFITSxDQUlmLE1BSmUsQ0FJUixLQUpRLENBS2YsR0FMZSxDQUtYLEVBTFcsQ0FNZixLQU5lLENBTVQsYUFBYTtBQUN4QixPQUFPLEdBQUEsQ0FBSSxjQUFjLEdBQUEsQ0FDcEIsTUFEb0IsRUFBQSxDQUVwQixTQUZvQixDQUVWO0FBQ2YsR0FBQSxDQUFJLE1BQU0sR0FBQSxDQUNMLE1BREssRUFBQSxDQUVMLFNBRkssQ0FFSyx3RkFGTCx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ZnVuY3Rpb24gKHZhbHVlKSB7XHJcbiAgICBpZiAoIXZhbHVlKVxyXG4gICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgIHJldHVybiAhdmFsdWUuZW5kc1dpdGgoJy9tYW5hZ2VtZW50Jyk7XHJcbn0pO1xyXG52YXIgdG9rZW4gPSB5dXBcclxuICAgIC5zdHJpbmcoKVxyXG4gICAgLnR5cGVFcnJvcignVGhlIHN1cHBsaWVkIHZhbHVlIFwiJHt2YWx1ZX1cIiBvZiB0eXBlIFwiJHt0eXBlfVwiIGlzIG5vdCBjb21wYXRpYmxlIHdpdGggdHlwZSBcInN0cmluZ1wiIScpXHJcbiAgICAuc3RyaWN0KHRydWUpXHJcbiAgICAucmVxdWlyZWQoJ0EgdG9rZW4gY2FuIG5vdCBiZSBlbXB0eSEnKTtcclxuZXhwb3J0IHZhciBjdXN0b21QcmlzbWEgPSB7IHVybDogdXJsLCB0b2tlbjogdG9rZW4gfTtcclxuIl19 | ||
var name$3 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).trim('The role name may not start or end with whitespace characters.').min(1, 'Choose a name for this role.').max(32, 'Choose an name that is shorter than 32 characters.'); | ||
var role = { | ||
__proto__: null, | ||
name: name$3 | ||
}; | ||
var project = ({ | ||
API_REGIONS: API_REGIONS, | ||
name: name$1, | ||
region: region, | ||
description: description$4, | ||
customPrisma: customPrisma | ||
}); | ||
var name$2 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).trim('The name of a stage may not start or end with whitespace characters!').min(1, 'Enter a Name.').max(32, 'Choose a name that is shorter than 32 letters.').matches(new RegExp('^[a-zA-Z][a-zA-Z0-9_]*$'), 'Start with a letter, and use only alphanumeric characters and "_".'); | ||
var displayName$1 = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Choose a Display Name.').trim('Display names may not have leading or trailing whitespaces.'); | ||
var name$2 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).trim('The role name may not start or end with whitespace characters.').min(1, 'Choose a name for this role.').max(32, 'Choose an name that is shorter than 32 characters.'); | ||
var stage = { | ||
__proto__: null, | ||
name: name$2, | ||
displayName: displayName$1 | ||
}; | ||
function createCommonjsModule(fn) { | ||
var module = { exports: {} }; | ||
return fn(module, module.exports), module.exports; | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJvbGUudHMob3JpZ2luYWwpIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFlBQVksU0FBUztBQUNyQixPQUFPLEdBQUEsQ0FBSSxPQUFPLEdBQUEsQ0FDYixNQURhLEVBQUEsQ0FFYixTQUZhLENBRUgsd0ZBRkcsQ0FHYixNQUhhLENBR04sS0FITSxDQUliLElBSmEsQ0FJUixpRUFKUSxDQUtiLEdBTGEsQ0FLVCxHQUFHLCtCQUxNLENBTWIsR0FOYSxDQU1ULElBQUk7QUFQYiIsImZpbGUiOiJyb2xlLnRzKG9yaWdpbmFsKSIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCAqIGFzIHl1cCBmcm9tICd5dXAnO1xyXG5leHBvcnQgdmFyIG5hbWUgPSB5dXBcclxuICAgIC5zdHJpbmcoKVxyXG4gICAgLnR5cGVFcnJvcignVGhlIHN1cHBsaWVkIHZhbHVlIFwiJHt2YWx1ZX1cIiBvZiB0eXBlIFwiJHt0eXBlfVwiIGlzIG5vdCBjb21wYXRpYmxlIHdpdGggdHlwZSBcInN0cmluZ1wiIScpXHJcbiAgICAuc3RyaWN0KHRydWUpXHJcbiAgICAudHJpbSgnVGhlIHJvbGUgbmFtZSBtYXkgbm90IHN0YXJ0IG9yIGVuZCB3aXRoIHdoaXRlc3BhY2UgY2hhcmFjdGVycy4nKVxyXG4gICAgLm1pbigxLCAnQ2hvb3NlIGEgbmFtZSBmb3IgdGhpcyByb2xlLicpXHJcbiAgICAubWF4KDMyLCAnQ2hvb3NlIGFuIG5hbWUgdGhhdCBpcyBzaG9ydGVyIHRoYW4gMzIgY2hhcmFjdGVycy4nKTtcclxuIl19 | ||
var validUrl = createCommonjsModule(function (module) { | ||
(function(module) { | ||
module.exports.is_uri = is_iri; | ||
module.exports.is_http_uri = is_http_iri; | ||
module.exports.is_https_uri = is_https_iri; | ||
module.exports.is_web_uri = is_web_iri; | ||
// Create aliases | ||
module.exports.isUri = is_iri; | ||
module.exports.isHttpUri = is_http_iri; | ||
module.exports.isHttpsUri = is_https_iri; | ||
module.exports.isWebUri = is_web_iri; | ||
var role = ({ | ||
name: name$2 | ||
}); | ||
var name$3 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).trim('The name of a stage may not start or end with whitespace characters!').min(1, 'Enter a Name.').max(32, 'Choose a name that is shorter than 32 letters.').matches(new RegExp('^[a-zA-Z][a-zA-Z0-9_]*$'), 'Start with a letter, and use only alphanumeric characters and "_".'); | ||
var displayName$3 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).min(1, 'Choose a Display Name.').trim('Display names may not have leading or trailing whitespaces.'); | ||
// private function | ||
// internal URI spitter method - direct from RFC 3986 | ||
var splitUri = function(uri) { | ||
var splitted = uri.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/); | ||
return splitted; | ||
}; | ||
function is_iri(value) { | ||
if (!value) { | ||
return; | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0YWdlLnRzKG9yaWdpbmFsKSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxZQUFZLFNBQVM7QUFDckIsT0FBTyxHQUFBLENBQUksT0FBTyxHQUFBLENBQ2IsTUFEYSxFQUFBLENBRWIsU0FGYSxDQUVILHdGQUZHLENBR2I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51bWVyaWMgY2hhcmFjdGVycyBhbmQgXCJfXCIuJyk7XHJcbmV4cG9ydCB2YXIgZGlzcGxheU5hbWUgPSB5dXBcclxuICAgIC5zdHJpbmcoKVxyXG4gICAgLnR5cGVFcnJvcignVGhlIHN1cHBsaWVkIHZhbHVlIFwiJHt2YWx1ZX1cIiBvZiB0eXBlIFwiJHt0eXBlfVwiIGlzIG5vdCBjb21wYXRpYmxlIHdpdGggdHlwZSBcInN0cmluZ1wiIScpXHJcbiAgICAuc3RyaWN0KHRydWUpXHJcbiAgICAubWluKDEsICdDaG9vc2UgYSBEaXNwbGF5IE5hbWUuJylcclxuICAgIC50cmltKCdEaXNwbGF5IG5hbWVzIG1heSBub3QgaGF2ZSBsZWFkaW5nIG9yIHRyYWlsaW5nIHdoaXRlc3BhY2VzLicpO1xyXG4iXX0= | ||
// check for illegal characters | ||
if (/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(value)) return; | ||
// check for hex escapes that aren't complete | ||
if (/%[^0-9a-f]/i.test(value)) return; | ||
if (/%[0-9a-f](:?[^0-9a-f]|$)/i.test(value)) return; | ||
var stage = ({ | ||
name: name$3, | ||
displayName: displayName$3 | ||
}); | ||
var splitted = []; | ||
var scheme = ''; | ||
var authority = ''; | ||
var path = ''; | ||
var query = ''; | ||
var fragment = ''; | ||
var out = ''; | ||
var name$4 = yup.string().min(1).nullable(false).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
var url$1 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).url('Only valid URLs are supported!').test('is-https-url', 'Only HTTPS URLs are supported!', function (value) { | ||
if (!value) | ||
return false; | ||
return value.startsWith('https://'); | ||
}); | ||
var headerKey = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).matches(/^[A-Z][A-Za-z0-9-]*$/, 'The key may only start with a capital letter and contain only alphanumeric characters.'); | ||
var headerValue = yup.string().nullable(false).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
var secretKey = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(true).min(32, 'Choose a secret key that is min. 32 characters long.').max(64, 'The secret key may not exceed 64 characters.').test({ | ||
name: 'no-whitespace', | ||
test: function (value) { | ||
return !/\s/g.test(value); | ||
}, | ||
message: 'Whitespace is not allowed. Secret key could be alphanumeric with special characters', | ||
exclusive: false | ||
}); | ||
// from RFC 3986 | ||
splitted = splitUri(value); | ||
scheme = splitted[1]; | ||
authority = splitted[2]; | ||
path = splitted[3]; | ||
query = splitted[4]; | ||
fragment = splitted[5]; | ||
// scheme and path are required, though the path can be empty | ||
if (!(scheme && scheme.length && path.length >= 0)) return; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYmhvb2sudHMob3JpZ2luYWwpIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFlBQVksU0FBUztBQUNyQixPQUFPLEdBQUEsQ0FBSSxPQUFPLEdBQUEsQ0FDYixNQURhLEVBQUEsQ0FFYixHQUZhLENBRVQsRUFGUyxDQUdiLFFBSGEsQ0FHSixNQUhJLENBSWIsU0FKYSxDQUlIO0FBQ2YsT0FBTyxHQUFBLENBQUksTUFBTSxHQUFBLENBQ1osTUFEWSxFQUFBLENBRVosU0FGWSxDQUVGLHdGQUZFLENBR1osUUFIWSxDQUdILE1BSEcsQ0FJWixHQUpZLENBSVIsaUNBSlEsQ0FLWixJQUxZLENBS1AsZ0JBQWdCLGtDQUFrQyxVQUFVLE9BQU87SUFDekUsSUFBSSxDQUFDO1FBQ0QsT0FBTztJQUNYLE9BQU8sS0FBQSxDQUFNLFVBQU4sQ0FBaUI7QUFDNUI7QUFDQSxPQUFPLEdBQUEsQ0FBSSxZQUFZLEdBQUEsQ0FDbEIsTUFEa0IsRUFBQSxDQUVsQixTQUZrQixD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yXG5leHBvcnQgdmFyIHNlY3JldEtleSA9IHl1cFxyXG4gICAgLnN0cmluZygpXHJcbiAgICAudHlwZUVycm9yKCdUaGUgc3VwcGxpZWQgdmFsdWUgXCIke3ZhbHVlfVwiIG9mIHR5cGUgXCIke3R5cGV9XCIgaXMgbm90IGNvbXBhdGlibGUgd2l0aCB0eXBlIFwic3RyaW5nXCIhJylcclxuICAgIC5udWxsYWJsZSh0cnVlKVxyXG4gICAgLm1pbigzMiwgJ0Nob29zZSBhIHNlY3JldCBrZXkgdGhhdCBpcyBtaW4uIDMyIGNoYXJhY3RlcnMgbG9uZy4nKVxyXG4gICAgLm1heCg2NCwgJ1RoZSBzZWNyZXQga2V5IG1heSBub3QgZXhjZWVkIDY0IGNoYXJhY3RlcnMuJylcclxuICAgIC50ZXN0KHtcclxuICAgIG5hbWU6ICduby13aGl0ZXNwYWNlJyxcclxuICAgIHRlc3Q6IGZ1bmN0aW9uICh2YWx1ZSkgeyByZXR1cm4gIS9cXHMvZy50ZXN0KHZhbHVlKTsgfSxcclxuICAgIG1lc3NhZ2U6ICdXaGl0ZXNwYWNlIGlzIG5vdCBhbGxvd2VkLiBTZWNyZXQga2V5IGNvdWxkIGJlIGFscGhhbnVtZXJpYyB3aXRoIHNwZWNpYWwgY2hhcmFjdGVycycsXHJcbiAgICBleGNsdXNpdmU6IGZhbHNlLFxyXG59KTtcclxuIl19 | ||
// if authority is present, the path must be empty or begin with a / | ||
if (authority && authority.length) { | ||
if (!(path.length === 0 || /^\//.test(path))) return; | ||
} else { | ||
// if authority is not present, the path must not start with // | ||
if (/^\/\//.test(path)) return; | ||
} | ||
// scheme must begin with a letter, then consist of letters, digits, +, ., or - | ||
if (!/^[a-z][a-z0-9\+\-\.]*$/.test(scheme.toLowerCase())) return; | ||
var webhook = ({ | ||
name: name$4, | ||
url: url$1, | ||
headerKey: headerKey, | ||
headerValue: headerValue, | ||
secretKey: secretKey | ||
}); | ||
// re-assemble the URL per section 5.3 in RFC 3986 | ||
out += scheme + ':'; | ||
if (authority && authority.length) { | ||
out += '//' + authority; | ||
} | ||
var apiId$3 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter an Api Id.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
name: 'no-graphql-type', | ||
test: function (value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).matches(/^[a-zA-Z][a-zA-Z0-9_]*$/, 'Start with a letter, and use only alphanumeric characters or underscores.'); | ||
var displayName$4 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter a Display Name.').trim('The display name may not have leading or trailing whitespaces.'); | ||
out += path; | ||
if (query && query.length) { | ||
out += '?' + query; | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxvY2FsZS50cyhvcmlnaW5hbCkiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsWUFBWSxTQUFTO0FBQ3JCLFFBQVMsdUJBQXdCO0FBQ2pDLE9BQU8sR0FBQSxDQUFJLFFBQVEsR0FBQSxDQUNkLE1BRGMsRUFBQSxDQUVkLFNBRmMsQ0FFSix3RkFGSSxDQUdkLEdBSGMsQ0FHVixHQUFHLG1CQUhPLENBSWQsR0FKYyxDQUlWLElBQUksb0RBSk0sQ0FLZCxJQUxjLENBS1Q7SUFDTixNQUFNLGlCQURBLENBQUE7SUFFTixNQUFNLFVBQVUsT0FBTztRQUNuQixPQUFPLENBQUMsZ0JBQUEsQ0FBaUIsSUFBakIsQ0FBc0IsVUFBVSxjQUFjO1lBQUUsT0FBUSxLQUFBLEdBQVEsWUFBQSxDQUFBLEdBQUEsQ0FBaUIsS0FBQSxDQUFNLFdBQU4sS0FBc0I7UUFBdkg7SUFDQSxDQUpVLEN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ICBtZXNzYWdlOiAnXCIke3ZhbHVlfVwiIGlzIGEgcmVzdHJpY3RlZCB3b3JkIGFuZCBjYW5ub3QgYmUgdXNlZCBoZXJlLicsXHJcbiAgICBleGNsdXNpdmU6IGZhbHNlLFxyXG59KVxyXG4gICAgLm1hdGNoZXMoL15bYS16QS1aXVthLXpBLVowLTlfXSokLywgJ1N0YXJ0IHdpdGggYSBsZXR0ZXIsIGFuZCB1c2Ugb25seSBhbHBoYW51bWVyaWMgY2hhcmFjdGVycyBvciB1bmRlcnNjb3Jlcy4nKTtcclxuZXhwb3J0IHZhciBkaXNwbGF5TmFtZSA9IHl1cFxyXG4gICAgLnN0cmluZygpXHJcbiAgICAudHlwZUVycm9yKCdUaGUgc3VwcGxpZWQgdmFsdWUgXCIke3ZhbHVlfVwiIG9mIHR5cGUgXCIke3R5cGV9XCIgaXMgbm90IGNvbXBhdGlibGUgd2l0aCB0eXBlIFwic3RyaW5nXCIhJylcclxuICAgIC5taW4oMSwgJ0VudGVyIGEgRGlzcGxheSBOYW1lLicpXHJcbiAgICAudHJpbSgnVGhlIGRpc3BsYXkgbmFtZSBtYXkgbm90IGhhdmUgbGVhZGluZyBvciB0cmFpbGluZyB3aGl0ZXNwYWNlcy4nKTtcclxuIl19 | ||
if (fragment && fragment.length) { | ||
out += '#' + fragment; | ||
} | ||
return out; | ||
} | ||
var locale = ({ | ||
apiId: apiId$3, | ||
displayName: displayName$4 | ||
}); | ||
function is_http_iri(value, allowHttps) { | ||
if (!is_iri(value)) { | ||
return; | ||
} | ||
var name$5 = yup.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).trim('The view group name may not start or end with whitespace characters.').min(1, 'Choose a name for this view group.').max(32, 'Choose an name that is shorter than 32 characters.'); | ||
var splitted = []; | ||
var scheme = ''; | ||
var authority = ''; | ||
var path = ''; | ||
var port = ''; | ||
var query = ''; | ||
var fragment = ''; | ||
var out = ''; | ||
// from RFC 3986 | ||
splitted = splitUri(value); | ||
scheme = splitted[1]; | ||
authority = splitted[2]; | ||
path = splitted[3]; | ||
query = splitted[4]; | ||
fragment = splitted[5]; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInZpZXdHcm91cC50cyhvcmlnaW5hbCkiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsWUFBWSxTQUFTO0FBQ3JCLE9BQU8sR0FBQSxDQUFJLE9BQU8sR0FBQSxDQUNiLE1BRGEsRUFBQSxDQUViLFNBRmEsQ0FFSCx3RkFGRyxDQUdiLE1BSGEsQ0FHTixLQUhNLENBSWIsSUFKYSxDQUlSLHVFQUpRLENBS2IsR0FMYSxDQUtULEdBQUcscUNBTE0sQ0FNYixHQU5hLENBTVQsSUFBSTtBQVBiIiwiZmlsZSI6InZpZXdHcm91cC50cyhvcmlnaW5hbCkiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgKiBhcyB5dXAgZnJvbSAneXVwJztcclxuZXhwb3J0IHZhciBuYW1lID0geXVwXHJcbiAgICAuc3RyaW5nKClcclxuICAgIC50eXBlRXJyb3IoJ1RoZSBzdXBwbGllZCB2YWx1ZSBcIiR7dmFsdWV9XCIgb2YgdHlwZSBcIiR7dHlwZX1cIiBpcyBub3QgY29tcGF0aWJsZSB3aXRoIHR5cGUgXCJzdHJpbmdcIiEnKVxyXG4gICAgLnN0cmljdCh0cnVlKVxyXG4gICAgLnRyaW0oJ1RoZSB2aWV3IGdyb3VwIG5hbWUgbWF5IG5vdCBzdGFydCBvciBlbmQgd2l0aCB3aGl0ZXNwYWNlIGNoYXJhY3RlcnMuJylcclxuICAgIC5taW4oMSwgJ0Nob29zZSBhIG5hbWUgZm9yIHRoaXMgdmlldyBncm91cC4nKVxyXG4gICAgLm1heCgzMiwgJ0Nob29zZSBhbiBuYW1lIHRoYXQgaXMgc2hvcnRlciB0aGFuIDMyIGNoYXJhY3RlcnMuJyk7XHJcbiJdfQ== | ||
if (!scheme) return; | ||
if(allowHttps) { | ||
if (scheme.toLowerCase() != 'https') return; | ||
} else { | ||
if (scheme.toLowerCase() != 'http') return; | ||
} | ||
var viewGroup = ({ | ||
name: name$5 | ||
}); | ||
// fully-qualified URIs must have an authority section that is | ||
// a valid host | ||
if (!authority) { | ||
return; | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzKG9yaWdpbmFsKSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxZQUFZLGVBQWU7QUFDM0IsWUFBWSxpQkFBaUI7QUFDN0IsWUFBWSxXQUFXO0FBQ3ZCLFlBQVksWUFBWTtBQUN4QixZQUFZLFdBQVc7QUFDdkIsWUFBWSxhQUFhO0FBQ3pCLFlBQVksVUFBVTtBQUN0QixZQUFZLFdBQVc7QUFDdkIsWUFBWSxhQUFhO0FBQ3pCLFlBQVksWUFBWTtBQUN4QixZQUFZLGVBQWU7QUFDM0IsT0FBQSxDQUFTLFdBQVcsYUFBYSxPQUFPLFFBQVEsT0FBTyxTQUFTLE1BQU0sT0FBTyxTQUFTLFFBQVE7QUFYOUYiLCJmaWxlIjoiaW5kZXgudHMob3JpZ2luYWwpIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0ICogYXMgYXV0aHRva2VuIGZyb20gJy4vYXV0aHRva2VuJztcclxuaW1wb3J0ICogYXMgZW51bWVyYXRpb24gZnJvbSAnLi9lbnVtZXJhdGlvbic7XHJcbmltcG9ydCAqIGFzIGZpZWxkIGZyb20gJy4vZmllbGQnO1xyXG5pbXBvcnQgKiBhcyBpbnZpdGUgZnJvbSAnLi9pbnZpdGUnO1xyXG5pbXBvcnQgKiBhcyBtb2RlbCBmcm9tICcuL21vZGVsJztcclxuaW1wb3J0ICogYXMgcHJvamVjdCBmcm9tICcuL3Byb2plY3QnO1xyXG5pbXBvcnQgKiBhcyByb2xlIGZyb20gJy4vcm9sZSc7XHJcbmltcG9ydCAqIGFzIHN0YWdlIGZyb20gJy4vc3RhZ2UnO1xyXG5pbXBvcnQgKiBhcyB3ZWJob29rIGZyb20gJy4vd2ViaG9vayc7XHJcbmltcG9ydCAqIGFzIGxvY2FsZSBmcm9tICcuL2xvY2FsZSc7XHJcbmltcG9ydCAqIGFzIHZpZXdHcm91cCBmcm9tICcuL3ZpZXdHcm91cCc7XHJcbmV4cG9ydCB7IGF1dGh0b2tlbiwgZW51bWVyYXRpb24sIGZpZWxkLCBpbnZpdGUsIG1vZGVsLCBwcm9qZWN0LCByb2xlLCBzdGFnZSwgd2ViaG9vaywgbG9jYWxlLCB2aWV3R3JvdXAsIH07XHJcbiJdfQ== | ||
// enable port component | ||
if (/:(\d+)$/.test(authority)) { | ||
port = authority.match(/:(\d+)$/)[0]; | ||
authority = authority.replace(/:\d+$/, ''); | ||
} | ||
exports.authtoken = authtoken; | ||
exports.enumeration = enumeration; | ||
exports.field = field; | ||
exports.invite = invite; | ||
exports.model = model; | ||
exports.project = project; | ||
exports.role = role; | ||
exports.stage = stage; | ||
exports.webhook = webhook; | ||
exports.locale = locale; | ||
exports.viewGroup = viewGroup; | ||
out += scheme + ':'; | ||
out += '//' + authority; | ||
if (port) { | ||
out += port; | ||
} | ||
out += path; | ||
if(query && query.length){ | ||
out += '?' + query; | ||
} | ||
}))); | ||
if(fragment && fragment.length){ | ||
out += '#' + fragment; | ||
} | ||
return out; | ||
} | ||
function is_https_iri(value) { | ||
return is_http_iri(value, true); | ||
} | ||
function is_web_iri(value) { | ||
return (is_http_iri(value) || is_https_iri(value)); | ||
} | ||
})(module); | ||
}); | ||
var name$1 = yup__namespace.string().min(1).nullable(false).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
var url = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).test('is-https-url', 'Only HTTPS URLs are supported!', function (value) { | ||
return !!validUrl.isHttpsUri(value); | ||
}).required(); | ||
var headerKey = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(false).matches(/^[A-Z][A-Za-z0-9-]*$/, 'The key may only start with a capital letter and contain only alphanumeric characters.'); | ||
var headerValue = yup__namespace.string().nullable(false).typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!'); | ||
var secretKey = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').nullable(true).min(32, 'Choose a secret key that is min. 32 characters long.').max(64, 'The secret key may not exceed 64 characters.').test({ | ||
name: 'no-whitespace', | ||
test: function test(value) { | ||
return !/\s/g.test(value); | ||
}, | ||
message: 'Whitespace is not allowed. Secret key could be alphanumeric with special characters', | ||
exclusive: false | ||
}); | ||
var webhook = { | ||
__proto__: null, | ||
name: name$1, | ||
url: url, | ||
headerKey: headerKey, | ||
headerValue: headerValue, | ||
secretKey: secretKey | ||
}; | ||
var apiId = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter an Api Id.').max(64, 'Use an Api Id that is shorter than 64 characters.').test({ | ||
name: 'no-graphql-type', | ||
test: function test(value) { | ||
return !graphQlTypeNames.some(function (reservedWord) { | ||
return value ? reservedWord === value.toLowerCase() : false; | ||
}); | ||
}, | ||
message: '"${value}" is a restricted word and cannot be used here.', | ||
exclusive: false | ||
}).matches(/^[a-zA-Z][a-zA-Z0-9_]*$/, 'Start with a letter, and use only alphanumeric characters or underscores.'); | ||
var displayName = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').min(1, 'Enter a Display Name.').trim('The display name may not have leading or trailing whitespaces.'); | ||
var locale = { | ||
__proto__: null, | ||
apiId: apiId, | ||
displayName: displayName | ||
}; | ||
var name = yup__namespace.string().typeError('The supplied value "${value}" of type "${type}" is not compatible with type "string"!').strict(true).trim('The view group name may not start or end with whitespace characters.').min(1, 'Choose a name for this view group.').max(32, 'Choose an name that is shorter than 32 characters.'); | ||
var viewGroup = { | ||
__proto__: null, | ||
name: name | ||
}; | ||
exports.authtoken = authtoken; | ||
exports.enumeration = enumeration; | ||
exports.field = field; | ||
exports.invite = invite; | ||
exports.locale = locale; | ||
exports.model = model; | ||
exports.project = project; | ||
exports.role = role; | ||
exports.stage = stage; | ||
exports.viewGroup = viewGroup; | ||
exports.webhook = webhook; | ||
})); | ||
//# sourceMappingURL=validation.umd.js.map |
{ | ||
"name": "@graphcms/validation", | ||
"version": "1.3.21", | ||
"version": "1.4.0", | ||
"main": "dist/validation.js", | ||
@@ -42,12 +42,14 @@ "types": "dist/index.d.ts", | ||
"@changesets/changelog-github": "^0.4.1", | ||
"@changesets/cli": "^2.17.0", | ||
"@types/jest": "^23.3.8", | ||
"@changesets/cli": "^2.18.0", | ||
"@types/jest": "^27.0.2", | ||
"@types/valid-url": "^1.0.3", | ||
"@types/yup": "^0.26.0", | ||
"jest": "^23.6.0", | ||
"microbundle": "^0.4.4", | ||
"prettier": "^1.14.3", | ||
"ts-jest": "^23.10.4", | ||
"tslint": "^5.11.0", | ||
"tslint-config-prettier": "^1.15.0", | ||
"typescript": "^3.1.4", | ||
"jest": "^27.3.1", | ||
"microbundle": "^0.14.1", | ||
"prettier": "^2.4.1", | ||
"ts-jest": "^27.0.7", | ||
"tslint": "^6.1.3", | ||
"tslint-config-prettier": "^1.18.0", | ||
"typescript": "^4.4.4", | ||
"valid-url": "^1.0.9", | ||
"yup": "^0.26.6" | ||
@@ -54,0 +56,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
280877
2131
14
30
1