Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 12 additions & 25 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,19 @@
/* eslint-env node */

module.exports = {
env: {
browser: false,
commonjs: true,
es2021: true,
node: true
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier'
],
parserOptions: {
ecmaVersion: 'latest'
},
plugins: ['@typescript-eslint'],
rules: {
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/ban-types': 0,
'@typescript-eslint/explicit-module-boundary-types': ['off'],
'@typescript-eslint/no-explicit-any': ['off']
},
overrides: [
{
files: ['*.js'],
files: ['*.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
project: `${__dirname}/tsconfig.json`
},
rules: {
'@typescript-eslint/no-var-requires': 'off'
'max-lines-per-function': ['error', { max: 80, skipBlankLines: true }],
'max-depth': ['error', 6],
complexity: ['error', 20]
}
}
],
ignorePatterns: ['**/build/*']
]
};
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build
run: yarn build
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyperproof/hypersync-models",
"version": "5.2.0",
"version": "6.0.0-beta",
"description": "Hypersync Models",
"license": "MIT",
"repository": {
Expand All @@ -14,7 +14,7 @@
"lint": "./node_modules/eslint/bin/eslint.js 'src/**/*.{js,ts}' --max-warnings 0"
},
"engines": {
"node": "^16.19.1 || ^18.17.1"
"node": "^22.0.0"
},
"dependencies": {},
"devDependencies": {
Expand Down
12 changes: 0 additions & 12 deletions src/credentials.ts

This file was deleted.

6 changes: 6 additions & 0 deletions src/criteria.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export interface ICriteriaFieldConfig {
schemaCategory?: SchemaCategory;
isMulti?: boolean;
validation?: IValidation;
savedCriteriaSettings?: DataValueMap;
}

/**
Expand All @@ -89,6 +90,11 @@ export interface IProofCriterionRef {
name: string;
page: number;
}

export interface ICriteriaSearchInput {
[criterion: string]: { value: string; offset: string };
}

export enum ValidationTypes {
alphaNumeric = 'alphaNumeric',
email = 'email',
Expand Down
1 change: 1 addition & 0 deletions src/dataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export interface IDataSetLookup {
dataSet: string;
dataSetParams?: DataValueMap;
delaySeconds?: number;
continueOnError?: boolean;
}

export enum PagingType {
Expand Down
30 changes: 30 additions & 0 deletions src/proofTypes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { IProofCriterionRef } from './criteria';
import { DataValueMap } from './data';
import { SortClause } from './dataSource';

export enum HypersyncDataFormat {
Stacked = 'stacked',
Expand Down Expand Up @@ -72,6 +73,33 @@ export interface IHypersyncField {
format?: HypersyncFieldFormat;
}

export enum IteratorSource {
DataSet = 'dataSet',
Criteria = 'criteria'
}

export interface BaseIteratorDefinition {
layer: number;
iterandKey: string;
subArraySize?: number;
}

export interface DataSetSourcedIterator extends BaseIteratorDefinition {
source: IteratorSource.DataSet;
dataSet: string;
dataSetParams?: DataValueMap;
}

export interface CriteriaSourcedIterator extends BaseIteratorDefinition {
source: IteratorSource.Criteria;
criteriaProperty: string;
criteriaTransformer: string;
}

export type DataSetIteratorDefinition =
| DataSetSourcedIterator
| CriteriaSourcedIterator;

export interface IProofSpec {
period: HypersyncPeriod;
useVersioning: boolean;
Expand All @@ -82,11 +110,13 @@ export interface IProofSpec {
subtitle: string;
dataSet: string;
dataSetParams?: DataValueMap;
dataSetIterator?: DataSetIteratorDefinition[];
noResultsMessage?: string;
lookups?: IProofSpecLookup[];
fields: IHypersyncField[];
webPageUrl?: string;
autoLayout?: boolean;
sort?: SortClause[];
}

export interface IProofSpecOverride {
Expand Down