@based/schema 2.3.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/languages.d.ts
CHANGED
package/dist/src/languages.js
CHANGED
|
@@ -72,6 +72,8 @@ const formatPatterns = {
|
|
|
72
72
|
json: () => true,
|
|
73
73
|
markdown: () => true,
|
|
74
74
|
clike: () => true,
|
|
75
|
+
// Can add some more checks for this...
|
|
76
|
+
basedId: (value) => typeof value === 'string' && value.length < 16,
|
|
75
77
|
};
|
|
76
78
|
const validateString = (args, value) => {
|
|
77
79
|
if (typeof value !== 'string') {
|
package/dist/src/types.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export type BasedSchemaStringShared = {
|
|
|
49
49
|
contentMediaEncoding?: string;
|
|
50
50
|
contentMediaType?: BasedSchemaContentMediaType;
|
|
51
51
|
pattern?: BasedSchemaPattern;
|
|
52
|
-
format?: 'email' | 'URL' | 'MACAddress' | 'IP' | 'IPRange' | 'FQDN' | 'IBAN' | 'BIC' | 'alpha' | 'alphaLocales' | 'alphanumeric' | 'alphanumericLocales' | 'passportNumber' | 'port' | 'lowercase' | 'uppercase' | 'ascii' | 'semVer' | 'surrogatePair' | 'IMEI' | 'hexadecimal' | 'octal' | 'hexColor' | 'rgbColor' | 'HSL' | 'ISRC' | 'MD5' | 'JWT' | 'UUID' | 'luhnNumber' | 'creditCard' | 'identityCard' | 'EAN' | 'ISIN' | 'ISBN' | 'ISSN' | 'mobilePhone' | 'mobilePhoneLocales' | 'postalCode' | 'postalCodeLocales' | 'ethereumAddress' | 'currency' | 'btcAddress' | 'ISO6391' | 'ISO8601' | 'RFC3339' | 'ISO31661Alpha2' | 'ISO31661Alpha3' | 'ISO4217' | 'base32' | 'base58' | 'base64' | 'dataURI' | 'magnetURI' | 'mimeType' | 'latLong' | 'slug' | 'strongPassword' | 'taxID' | 'licensePlate' | 'VAT' | 'code' | 'typescript' | 'javascript' | 'python' | 'rust' | 'css' | 'html' | 'json' | 'markdown' | 'clike';
|
|
52
|
+
format?: 'email' | 'URL' | 'MACAddress' | 'IP' | 'IPRange' | 'FQDN' | 'IBAN' | 'BIC' | 'alpha' | 'alphaLocales' | 'alphanumeric' | 'alphanumericLocales' | 'passportNumber' | 'port' | 'lowercase' | 'uppercase' | 'ascii' | 'semVer' | 'surrogatePair' | 'IMEI' | 'hexadecimal' | 'octal' | 'hexColor' | 'rgbColor' | 'HSL' | 'ISRC' | 'MD5' | 'JWT' | 'UUID' | 'luhnNumber' | 'creditCard' | 'identityCard' | 'EAN' | 'ISIN' | 'ISBN' | 'ISSN' | 'mobilePhone' | 'mobilePhoneLocales' | 'postalCode' | 'postalCodeLocales' | 'ethereumAddress' | 'currency' | 'btcAddress' | 'ISO6391' | 'ISO8601' | 'RFC3339' | 'ISO31661Alpha2' | 'ISO31661Alpha3' | 'ISO4217' | 'base32' | 'base58' | 'base64' | 'dataURI' | 'magnetURI' | 'mimeType' | 'latLong' | 'slug' | 'strongPassword' | 'taxID' | 'licensePlate' | 'VAT' | 'code' | 'typescript' | 'javascript' | 'python' | 'rust' | 'css' | 'html' | 'json' | 'markdown' | 'clike' | 'basedId';
|
|
53
53
|
display?: StringFormat;
|
|
54
54
|
multiline?: boolean;
|
|
55
55
|
};
|
|
@@ -154,6 +154,7 @@ export type BasedSchemaField = BasedSchemaFields[keyof BasedSchemaFields] | (Bas
|
|
|
154
154
|
$ref: string;
|
|
155
155
|
});
|
|
156
156
|
export type BasedSchemaType = {
|
|
157
|
+
directory?: string;
|
|
157
158
|
fields: {
|
|
158
159
|
[name: string]: BasedSchemaField;
|
|
159
160
|
};
|