@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.
@@ -55,6 +55,7 @@ export declare const languages: {
55
55
  lg: string;
56
56
  ka: string;
57
57
  de: string;
58
+ gsw: string;
58
59
  ki: string;
59
60
  el: string;
60
61
  kl: string;
@@ -55,6 +55,7 @@ export const languages = {
55
55
  lg: 'Ganda',
56
56
  ka: 'Georgian',
57
57
  de: 'German',
58
+ gsw: 'Swiss German',
58
59
  ki: 'Gikuyu, Kikuyu',
59
60
  el: 'Greek (Modern)',
60
61
  kl: 'Greenlandic, Kalaallisut',
@@ -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') {
@@ -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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@based/schema",
3
- "version": "2.3.0",
3
+ "version": "2.5.0",
4
4
  "license": "MIT",
5
5
  "main": "dist/src/index.js",
6
6
  "files": [