{"_id":"@servicenow/ui-types","_rev":"30-681ea8c20793c70ab9e2d9648b5eefea","name":"@servicenow/ui-types","dist-tags":{"paris":"18.2.5","quebec":"19.4.2","rome":"19.4.2","latest":"24.1.1","vancouver":"24.1.1"},"versions":{"18.2.5":{"name":"@servicenow/ui-types","version":"18.2.5","author":"","license":"MIT","_id":"@servicenow/ui-types@18.2.5","maintainers":[{"name":"cuong.tran","email":"cuong.tran@servicenow.com"},{"name":"now-build","email":"buildeng@servicenow.com"},{"name":"crystal.barnes","email":"crystal.barnes@servicenow.com"},{"name":"mdwragg","email":"mdwragg@gmail.com"}],"dist":{"shasum":"005134b8037982811f4573a042a4f57f9b4581b4","tarball":"https://registry.npmjs.org/@servicenow/ui-types/-/ui-types-18.2.5.tgz","fileCount":34,"integrity":"sha512-bnZbzzGbRj79nqsyoX9khhsTpK94p62txrmr5CkpxNSs7uNy6PCR5GQJaTX0vVXNg4w8JBnhIGvDpUXMkPoieg==","signatures":[{"sig":"MEYCIQD9hefHYT3elWzClWORovKTajgs+R9EKwg8NGoxUOki7wIhAKV4nzxKOb8HFA3eMyGankfEO/lTmIfyrUzx/O8/2UyQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":55761,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYRbzCRA9TVsSAnZWagAAD0gP/2ZCQ6HiOcs6XQkxLOG3\n0MSVuEwEj3JYMBFUbWZKdrR+kpgyShfqb3rGQ6XCDkqoYLJhBxqOrFVTqEiW\n5veLybnhahaPr2C6d9wiMsbHEO0hs+yVQMCtfby+CxaJTrIJbCPCIff7y5Og\nzJpxuDLA8Cd40Tt1ABH5CErN29LIl7PY3kFuD97I+tWF2QW4rsrlOzX8SNYb\nVA4d9EHKHTVCxdt0RygX4FokoQ/5Sn5p+KPC+bVn8eSBiXj/eFLxKRRC8cVL\nzfxag3HwEY0ZeGcIImAdEniu/sW5PkVS419mfRZK2D4TtB1H8B19cidIcCSG\n/lgsLau5gSM5Dxe2ThuiTp/C7ZPLt6OLX1LREmyw/0wHBk6/8eLvO1bM+LZb\nuNbvuIAVE7nJGfnBDyw/AH9hPmnC0TBwg0dhzDmUZAcd3vYBTdGAQmAhgeHZ\nyGQkCEYdjgp+BXDEtEvP5uq3mjva+uFxSjbRnS+f8zWpftA5xIpQ9yThCyQo\nDeJ4gihSKHUHMjfunfobAxqRnRbjZx6m5wyHes7aB2v/S7TRS0JEveLLSAzW\nK1ehYfjw0WhTSZh9FCyApqwVqxT7VrGl8jAsaNSiIxTiyJa2KA1SkcdAXA/i\nA2ohAJK2FU9zSLCyWtin4W50oqLDcP9R6FOl9PK+QmFMCV0hCxrGkaqS33x+\nTmie\r\n=9D/8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","_from":"file:ui-types-18.2.5.tgz","module":"module/index.js","gitHead":"02dbca17b53121fbaed6b2c31c4cafefd757c4cd","scripts":{"docs":"../../node_modules/.bin/jsdoc2md src/{,**/}*.js > api.md","size":"size-limit","test":"npm run test:unit -- --saucelabs","build":"npm run build:lib && npm run build:module","eslint":"../../node_modules/.bin/eslint --config ../../.eslintrc.js src","verify":"npm run lint && npm run test && npm run docs","document":"../../node_modules/.bin/jsdoc2md --partial ../../docs/header.hbs --files 'src/{,**/}*.js' > api.md","build:dev":"BABEL_ENV=development ../../node_modules/.bin/babel src --out-dir lib --root-mode upward --source-maps --ignore 'src/**/__tests__/**' --verbose","build:lib":"BABEL_ENV=production ../../node_modules/.bin/babel src --out-dir lib --source-maps --root-mode upward --ignore 'src/**/__tests__/**'","test:unit":"../../node_modules/.bin/karma start ../../karma.conf.js","build:watch":"BABEL_ENV=development ../../node_modules/.bin/babel src --out-dir lib --watch --root-mode upward --source-maps --ignore 'src/**/__tests__/**'  --verbose","build:module":"BABEL_ENV=production BABEL_MODULE=true ../../node_modules/.bin/babel src --out-dir module --source-maps --root-mode upward --ignore 'src/**/__tests__/**'","test:coverage":"npm run test:unit -- --coverage","prettier-eslint":"../../node_modules/.bin/prettier-eslint --list-different --eslint-config-path=../../.eslintrc.js 'src/**/*.js'"},"_npmUser":{"name":"crystal.barnes","email":"crystal.barnes@servicenow.com"},"_resolved":"","_integrity":"","_npmVersion":"6.14.6","directories":{},"sideEffects":false,"_nodeVersion":"12.18.3","dependencies":{"ajv":"6.10.2","@servicenow/ui-internal":"18.2.5"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ui-types_18.2.5_1600198387267_0.6022292407505747","host":"s3://npm-registry-packages"}},"19.4.2":{"name":"@servicenow/ui-types","version":"19.4.2","author":"","license":"MIT","_id":"@servicenow/ui-types@19.4.2","maintainers":[{"name":"mdwragg","email":"mdwragg@gmail.com"},{"name":"crystal.barnes","email":"crystal.barnes@servicenow.com"},{"name":"now-build","email":"buildeng@servicenow.com"},{"name":"cuong.tran","email":"cuong.tran@servicenow.com"}],"dist":{"shasum":"68df3860ebc2e5ec9e9a09d16315ebaa8ff0d7ef","tarball":"https://registry.npmjs.org/@servicenow/ui-types/-/ui-types-19.4.2.tgz","fileCount":19,"integrity":"sha512-kRVxUHAjMJxeoVke9bhdjnzCfUKrvb4dKsyaxScvLU9k2QC+edRWplaC+U/zaewQERcKzRZz2YZ/gZEI6+ExDw==","signatures":[{"sig":"MEYCIQDMruLwQmoVD+21LgWXzFfw2tBJlPLo9af5cPz9TJ8fYwIhAO+eKCXemi1CNX3+bHTrKzdjw/LPHjql+R/ZEpdjJi8C","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":29366,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCFlUCRA9TVsSAnZWagAA0XYQAJhpuIJJSbgNhtdAlibr\npPdBBDy9X290eqvFLrFRKSzPH+7vMgPW1Fm2t61qyatkughA4CdxJ5GPPOq6\nDFEMgvKxJoYqY56oooKqSSrrEtqVo82l9zAcfyYM9u9+YunzNd+y7D5SUQ+P\nzpczbUPKGT9l3Rz4D1l1yxE5pkdK3jZ8qp0whE+wdFsjyyq50zcrycqLts+H\ndv/G8xbpa5R1DULTQZxs2VNXZAhi1Ov+A5DIkyh5IxJ1KpQH6758jgbWsRM/\n/dKU3/EpB9wnTXY+FppaNcbv//CpujscG/BMxawuUVp/Dk4GG9Qkfpz1NyZA\nKbHHQp+2ibe3LNgQeG9T2cmoB7elfOhbjEiZRSvTey103VAzmuYv4DU2dV4d\n90puHbaXREGTIRdEUqtUX5+90mZak9UVdkzND4JAsoLSqisGsakXIu2tRPUJ\njVWqjgx47Q0hv5AfWDDQALrWgxJvtb5P/IoSI+N11p4mK7X/O8LiL6UqM5TL\nA/+05umVrjEsUa5pHYvg0w26kE/crOHnzTagtRIqCW3fKefNIcCyb2aa0jfw\nmUaHx5zrrwPmmftxsSRxhOHZmo7OtIirISgyDpP4FNDGUczfhCNTksCm8Vd9\ndBYjXBxH3nhN/pApm3H/k+MLnNc8zXXz0uyi+YRXrSlo8Xjf0UskW/CEeeb9\nhLIG\r\n=UyYx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","_from":"file:ui-types-19.4.2.tgz","module":"module/index.js","gitHead":"4910885479ca7c0d1ab77df9bd1065f75307ce9c","scripts":{"docs":"../../node_modules/.bin/jsdoc2md src/{,**/}*.js > api.md","test":"npm run test:unit -- --saucelabs","build":"npm run build:lib && npm run build:module","eslint":"../../node_modules/.bin/eslint --config ../../.eslintrc.js src","verify":"npm run lint && npm run test && npm run docs","document":"../../node_modules/.bin/jsdoc2md --partial ../../docs/header.hbs --files 'src/{,**/}*.js' > api.md","build:dev":"BABEL_ENV=development ../../node_modules/.bin/babel src --out-dir lib --root-mode upward --source-maps --ignore 'src/**/__tests__/**' --verbose","build:lib":"BABEL_ENV=production ../../node_modules/.bin/babel src --out-dir lib --source-maps --root-mode upward --ignore 'src/**/__tests__/**'","test:unit":"../../node_modules/.bin/karma start ../../karma.conf.js","build:watch":"BABEL_ENV=development ../../node_modules/.bin/babel src --out-dir lib --watch --root-mode upward --source-maps --ignore 'src/**/__tests__/**'  --verbose","build:module":"BABEL_ENV=production BABEL_MODULE=true ../../node_modules/.bin/babel src --out-dir module --source-maps --root-mode upward --ignore 'src/**/__tests__/**'","build:plugin":"node ./build-plugin.js","test:coverage":"npm run test:unit -- --coverage","prettier-eslint":"../../node_modules/.bin/prettier-eslint --list-different --eslint-config-path=../../.eslintrc.js 'src/**/*.js'"},"_npmUser":{"name":"crystal.barnes","email":"crystal.barnes@servicenow.com"},"_resolved":"","_integrity":"","_npmVersion":"6.14.8","description":"Collection of Now Experience UI Framework data types to provide UIB the ability to auto-wire components and to share common type schemas.","directories":{},"sideEffects":false,"_nodeVersion":"12.19.0","_hasShrinkwrap":false,"devDependencies":{"md5":"2.2.1","lodash":"4.17.4"},"_npmOperationalInternal":{"tmp":"tmp/ui-types_19.4.2_1611159892446_0.14529116349193472","host":"s3://npm-registry-packages"}},"24.1.1":{"name":"@servicenow/ui-types","version":"24.1.1","author":"","license":"MIT","_id":"@servicenow/ui-types@24.1.1","maintainers":[{"name":"mdwragg","email":"mdwragg@gmail.com"},{"name":"crystal.barnes","email":"crystal.barnes@servicenow.com"},{"name":"now-build","email":"buildeng@servicenow.com"},{"name":"cuong.tran","email":"cuong.tran@servicenow.com"},{"name":"sdivatia","email":"shaival.divatia@servicenow.com"},{"name":"huichuan","email":"huichuan.cheng@servicenow.com"}],"dist":{"shasum":"0096292bffada7bf7a55526035e8f2c4379ea78f","tarball":"https://registry.npmjs.org/@servicenow/ui-types/-/ui-types-24.1.1.tgz","fileCount":23,"integrity":"sha512-XVNCR6jyfQpW8x9YhfKyKQz1Zrjc61Pf+Hsd5J+vgY4OnvnDtnr2vWDpa35zzzMrlMULM7SGQwwfYX6DcErCKA==","signatures":[{"sig":"MEUCIQC2GOD/GN03RhJOiApF+UyICBcIhzWqw/90geJXuUuR9AIgf3FK/MHa/mpreqamLb6jSVUE85ZEWcq/eyeBg1tcJfM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":36151},"main":"lib/index.js","_from":"file:ui-types-24.1.1.tgz","module":"module/index.js","readme":"# @servicenow/ui-types\n\nCollection of UI Framework on Next Experience data types to provide UIB the ability to auto-wire components and to share common type schemas.\n\nIf you are unfamiliar with UI Framework on Next Experience's type schema or JSON Schema, please visit its [documentation](https://developer.servicenow.com/dev.do#!/guide/paris/now-experience/ui-framework/now-experience-ui-framework-101/type-schema).\n\nTo contribute to this repo, see [CONTRIBUTING.md](CONTRIBUTING.md).\n\n- [Usage](#usage)\n  - [Primitives](#primitives)\n  - [Sets](#sets)\n- [API](#api)\n  - [Primitives](#primitives-api)\n  - [Sets](#sets-api)\n\n## Usage\n\n`@servicenow/ui-types` has two categories of exports: primitives and sets.\n\n### Primitives\n\nPrimitives are the building blocks for your UI Framework on Next Experience schemas. They are a set of commonly used types for properties and action payloads for you to use. All primitives are JSON Schema objects.\n\nTo use primitives, you can import them from `@servicenow/ui-types`:\n\n```js\nimport {sysId} from '@servicenow/ui-types';\nimport {createCustomElement} from '@servicenow/ui-core';\n\ncreateCustomElement('my-component', {\n\tproperties: {\n\t\tsysId: {\n\t\t\tschema: sysId\n\t\t}\n\t}\n});\n```\n\n`sysId` is one of the primitives and has the JSON Schema rules to make sure users pass in a valid sysId to your component.\n\nIf you need to augment the type, you can combine the primitive with your own schema. Please see JSON Schema's documentation on [how to combine schemas](https://json-schema.org/understanding-json-schema/reference/combining.html). For example, let's say your property is a `table` primitive type but you want to refine it to only be one of a handful of tables. You can use `allOf` to acheive that:\n\n```js\nimport {table} from '@servicenow/ui-types';\n\ncreateCustomElement('my-component', {\n\tproperties: {\n\t\ttable: {\n\t\t\tschema: {\n\t\t\t\tallOf: [table, {enum: ['table_one', 'table_two', 'table_three']}]\n\t\t\t}\n\t\t}\n\t}\n});\n```\n\n### Sets\n\nSets are a grouping of primitives that are commonly used together. Using sets in your component definitions will help UIB auto-wire your component when it is dropped onto a page: if there is a data broker on the page that already uses the same set as your component, UIB can ask the user if they want to automatically wire that data broker to your properties!\n\n```js\nimport {record} from '@servicenow/ui-types';\nimport {createCustomElement} from '@servicenow/ui-core';\n\ncreateCustomElement('my-component', {\n  properties: {\n    table: {\n      schema: record.table\n    }\n    sysId: {\n      schema: record.sysId\n    }\n  }\n});\n```\n\n## API\n\n### Primitives API\n\n- `table`: string\n- `sysId`: string\n- `query`: string\n\n### Sets API\n\n- `record`\n  - `sysId`: required\n  - `table`: required\n  - `view`: optional\n- `list`\n  - `table`: required\n  - `query`: required\n  - `page`: optional\n  - `recordsPerPage`: optional\n","gitHead":"237b54012960572f6b7e84a8b817f54504de648b","scripts":{"docs":"../../node_modules/.bin/jsdoc2md src/{,**/}*.js > api.md","test":"npm run test:unit -- --saucelabs","build":"npm run build:lib && npm run build:module","eslint":"../../node_modules/.bin/eslint --config ../../.eslintrc.js src","verify":"npm run lint && npm run test && npm run docs","document":"../../node_modules/.bin/jsdoc2md --partial ../../docs/header.hbs --files 'src/{,**/}*.js' > api.md","build:dev":"BABEL_ENV=development ../../node_modules/.bin/babel src --out-dir lib --root-mode upward --source-maps --ignore 'src/**/__tests__/**' --verbose","build:lib":"BABEL_ENV=production ../../node_modules/.bin/babel src --out-dir lib --source-maps --root-mode upward --ignore 'src/**/__tests__/**'","test:unit":"../../node_modules/.bin/karma start ../../karma.conf.js","build:watch":"BABEL_ENV=development ../../node_modules/.bin/babel src --out-dir lib --watch --root-mode upward --source-maps --ignore 'src/**/__tests__/**'  --verbose","build:module":"BABEL_ENV=production BABEL_MODULE=true ../../node_modules/.bin/babel src --out-dir module --source-maps --root-mode upward --ignore 'src/**/__tests__/**'","build:plugin":"node ./build-plugin.js","test:coverage":"npm run test:unit -- --coverage"},"_npmUser":{"name":"crystal.barnes","email":"crystal.barnes@servicenow.com"},"_resolved":"","_integrity":"","_npmVersion":"6.14.18","description":"Collection of UI Framework on Next Experience data types to provide UIB the ability to auto-wire components and to share common type schemas.","directories":{},"sideEffects":false,"_nodeVersion":"14.20.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"md5":"2.2.1","lodash":"4.17.4"},"_npmOperationalInternal":{"tmp":"tmp/ui-types_24.1.1_1691174761393_0.07654149243805786","host":"s3://npm-registry-packages"}}},"time":{"created":"2020-09-15T19:33:07.267Z","modified":"2026-08-27T22:37:16.305Z","18.2.5":"2020-09-15T19:33:07.415Z","19.4.2":"2021-01-20T16:24:52.547Z","24.1.1":"2023-08-04T18:46:01.539Z"},"license":"MIT","description":"Collection of UI Framework on Next Experience data types to provide UIB the ability to auto-wire components and to share common type schemas.","maintainers":[{"email":"mdwragg@gmail.com","name":"mdwragg"},{"email":"buildeng@servicenow.com","name":"now-build"},{"email":"cuong.tran@servicenow.com","name":"cuong.tran"},{"email":"shaival.divatia@servicenow.com","name":"sdivatia"},{"email":"huichuan.cheng@servicenow.com","name":"huichuan"},{"email":"kayleigh.french@servicenow.com","name":"kayleigh.french"},{"email":"dannyh.wong@servicenow.com","name":"dwong-servicenow"},{"email":"pooja.chamarthi@servicenow.com","name":"pooja.chamarthi"},{"email":"victor.huerta@servicenow.com","name":"victor.huerta"},{"email":"koppula.phaniprakash@servicenow.com","name":"phaniprakash"},{"email":"rajavenkatesh.sundar@servicenow.com","name":"rajavenkatesh.servicenow"},{"email":"manishkumar.roy@servicenow.com","name":"manishroy-servicenow"},{"email":"savya.alla@servicenow.com","name":"savya.alla"},{"email":"krishna.kumar@servicenow.com","name":"krishnakr1989"},{"email":"richa.srivastava1@servicenow.com","name":"richa.srivastava"},{"email":"aprameya.v@servicenow.com","name":"aprameya.v"},{"email":"jyothsna.kilari@servicenow.com","name":"jyothsna.kilari"}],"readme":"# @servicenow/ui-types\n\nCollection of Now Experience UI Framework data types to provide UIB the ability to auto-wire components and to share common type schemas.\n\nIf you are unfamiliar with Now Experience UI Framework's type schema or JSON Schema, please visit its [documentation](https://developer.servicenow.com/dev.do#!/guide/paris/now-experience/ui-framework/now-experience-ui-framework-101/type-schema).\n\nTo contribute to this repo, see [CONTRIBUTING.md](CONTRIBUTING.md).\n\n- [Usage](#usage)\n  - [Primitives](#primitives)\n  - [Sets](#sets)\n- [API](#api)\n  - [Primitives](#primitives-api)\n  - [Sets](#sets-api)\n\n## Usage\n\n`@servicenow/ui-types` has two categories of exports: primitives and sets.\n\n### Primitives\n\nPrimitives are the building blocks for your Now Experience UI Framework schemas. They are a set of commonly used types for properties and action payloads for you to use. All primitives are JSON Schema objects.\n\nTo use primitives, you can import them from `@servicenow/ui-types`:\n\n```js\nimport {sysId} from '@servicenow/ui-types';\nimport {createCustomElement} from '@servicenow/ui-core';\n\ncreateCustomElement('my-component', {\n  properties: {\n    sysId: {\n      schema: sysId\n    }\n  }\n});\n```\n`sysId` is one of the primitives and has the JSON Schema rules to make sure users pass in a valid sysId to your component.\n\nIf you need to augment the type, you can combine the primitive with your own schema. Please see JSON Schema's documentation on [how to combine schemas](https://json-schema.org/understanding-json-schema/reference/combining.html). For example, let's say your property is a `table` primitive type but you want to refine it to only be one of a handful of tables. You can use `allOf` to acheive that:\n\n```js\nimport {table} from '@servicenow/ui-types';\n\ncreateCustomElement('my-component', {\n  properties: {\n    table: {\n      schema: {\n        allOf: [\n          table,\n          {enum: ['table_one', 'table_two', 'table_three']}\n        ]\n      }\n    }\n  }\n});\n```\n\n### Sets\n\nSets are a grouping of primitives that are commonly used together. Using sets in your component definitions will help UIB auto-wire your component when it is dropped onto a page: if there is a data broker on the page that already uses the same set as your component, UIB can ask the user if they want to automatically wire that data broker to your properties!\n\n```js\nimport {record} from '@servicenow/ui-types';\nimport {createCustomElement} from '@servicenow/ui-core';\n\ncreateCustomElement('my-component', {\n  properties: {\n    table: {\n      schema: record.table\n    }\n    sysId: {\n      schema: record.sysId\n    }\n  }\n});\n```\n\n## API\n\n### Primitives API\n\n- `table`: string\n- `sysId`: string\n- `query`: string\n\n### Sets API\n\n- `record`\n  - `sysId`: required\n  - `table`: required\n  - `view`: optional\n- `list`\n  - `table`: required\n  - `query`: required\n  - `page`: optional\n  - `recordsPerPage`: optional\n","readmeFilename":"README.md"}