Socket
Socket
Sign inDemoInstall

@flatfile/hooks

Package Overview
Dependencies
Maintainers
19
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flatfile/hooks - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

README.md

30

dist/index.d.ts

@@ -10,2 +10,3 @@ declare type TPrimitive = string | boolean | number | null;

declare type TRecordInfoLevel = 'error' | 'warn' | 'info';
declare type TRecordStageLevel = 'onCast' | 'onEmpty' | 'onValue' | 'onValidate' | 'apply' | 'other';
interface IRecordInfo<M extends TRecordData = TRecordData, K = keyof M> {

@@ -15,2 +16,3 @@ level: TRecordInfoLevel;

message: string;
stage: TRecordStageLevel;
}

@@ -22,2 +24,14 @@ interface IRawRecordWithInfo<M extends TRecordData = TRecordData> {

interface IPayload {
workspaceId: string;
workbookId: string;
schemaId: number;
schemaSlug: string;
uploads: string[];
endUser?: any;
env?: Record<string, string | boolean | number>;
envSignature?: string;
rows: IRawRecord[];
}
declare class FlatfileRecord<M extends TRecordData = TRecordData> {

@@ -42,3 +56,3 @@ private readonly data;

addWarning(fields: string | string[], message: string): this;
pushInfoMessage(fields: string | string[], message: string, level: IRecordInfo['level']): this;
pushInfoMessage(fields: string | string[], message: string, level: IRecordInfo['level'], stage: TRecordStageLevel): this;
toJSON(): IRawRecordWithInfo<M>;

@@ -54,14 +68,2 @@ }

interface IPayload {
workspaceId: string;
workbookId: string;
schemaId: number;
schemaSlug: string;
uploads: string[];
endUser?: any;
env?: Record<string, string | boolean | number>;
envSignature?: string;
rows: IRawRecord[];
}
declare class FlatfileSession {

@@ -81,2 +83,2 @@ private payload;

export { FlatfileRecord, FlatfileRecords, FlatfileSession };
export { FlatfileRecord, FlatfileRecords, FlatfileSession, IPayload, IRawRecord, IRawRecordWithInfo, IRecordInfo, TPrimitive, TRecordData, TRecordInfoLevel };

@@ -20,5 +20,5 @@ "use strict";

// index.ts
var hooks_exports = {};
__export(hooks_exports, {
// src/index.ts
var src_exports = {};
__export(src_exports, {
FlatfileRecord: () => FlatfileRecord,

@@ -28,3 +28,3 @@ FlatfileRecords: () => FlatfileRecords,

});
module.exports = __toCommonJS(hooks_exports);
module.exports = __toCommonJS(src_exports);

@@ -49,3 +49,3 @@ // src/classes/FlatfileRecord.ts

verifyField(field) {
if (!this.data.hasOwnProperty(field)) {
if (!Object.prototype.hasOwnProperty.call(this.data, field)) {
console.error(`Record does not have field "${field}".`);

@@ -72,3 +72,3 @@ return false;

addInfo(fields, message) {
return this.pushInfoMessage(fields, message, "info");
return this.pushInfoMessage(fields, message, "info", "other");
}

@@ -79,8 +79,8 @@ addComment(fields, message) {

addError(fields, message) {
return this.pushInfoMessage(fields, message, "error");
return this.pushInfoMessage(fields, message, "error", "other");
}
addWarning(fields, message) {
return this.pushInfoMessage(fields, message, "warn");
return this.pushInfoMessage(fields, message, "warn", "other");
}
pushInfoMessage(fields, message, level) {
pushInfoMessage(fields, message, level, stage) {
fields = Array.isArray(fields) ? fields : [fields];

@@ -92,3 +92,4 @@ fields.forEach((field) => {

message,
level
level,
stage
});

@@ -95,0 +96,0 @@ }

{
"name": "@flatfile/hooks",
"version": "1.1.0",
"version": "1.2.0",
"description": "",
"main": "index.js",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"private": false,
"repository": {

@@ -16,3 +19,2 @@ "type": "git",

"homepage": "https://github.com/FlatFilers/platform-sdk-mono#readme",
"files": [

@@ -22,9 +24,11 @@ "dist/**"

"scripts": {
"build": "tsup index.ts --format esm,cjs --dts --external react",
"dev": "tsup index.ts --format esm,cjs --watch --dts --external react",
"build": "tsup src/index.ts --format esm,cjs --dts",
"dev": "tsup src/index.ts --format esm,cjs --watch --dts",
"lint": "TIMING=1 eslint \"src/**/*.{ts,tsx,js,jsx}\" --fix",
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
"test": "jest --runInBand --detectOpenHandles --forceExit"
"test": "jest --runInBand --detectOpenHandles --forceExit --passWithNoTests"
},
"devDependencies": {
"@flatfile/eslint-config-platform-sdk": "*",
"@flatfile/jest-preset-platform-sdk": "*",
"@flatfile/ts-config-platform-sdk": "*",

@@ -37,30 +41,5 @@ "@types/jest": "^28.1.4",

},
"jest": {
"roots": [
"<rootDir>/src"
],
"collectCoverage": false,
"moduleNameMapper": {
"src/(.*)": "<rootDir>/src/$1"
},
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
"testMatch": [
"**/__tests__/**/*.+(ts|tsx|js)",
"**/?(*.)+(spec|test).+(ts|tsx|js)"
],
"testPathIgnorePatterns": [
"<rootdir>/node_modules/"
],
"moduleFileExtensions": [
"js",
"ts",
"tsx",
"json"
]
},
"ts-jest": {
"isolatedModules": false
"publishConfig": {
"access": "public"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc