@defra/forms-model 3.0.390 → 3.0.392
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.
- package/dist/module/common/schema.js +3 -1
- package/dist/module/common/schema.js.map +1 -1
- package/dist/module/common/search/index.js +13 -0
- package/dist/module/common/search/index.js.map +1 -0
- package/dist/module/common/search/types.js +2 -0
- package/dist/module/common/search/types.js.map +1 -0
- package/dist/module/common/types.js.map +1 -1
- package/dist/module/index.js +1 -1
- package/dist/module/index.js.map +1 -1
- package/dist/types/common/schema.d.ts.map +1 -1
- package/dist/types/common/search/index.d.ts +13 -0
- package/dist/types/common/search/index.d.ts.map +1 -0
- package/dist/types/common/search/types.d.ts +10 -0
- package/dist/types/common/search/types.d.ts.map +1 -0
- package/dist/types/common/types.d.ts +8 -3
- package/dist/types/common/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/common/schema.ts +3 -1
- package/src/common/search/index.ts +16 -0
- package/src/common/search/types.ts +9 -0
- package/src/common/types.ts +9 -3
- package/src/index.ts +2 -1
@@ -1,5 +1,6 @@
|
|
1
1
|
import Joi from 'joi';
|
2
2
|
import { paginationOptionFields } from "./pagination/index.js";
|
3
|
+
import { searchOptionFields } from "./search/index.js";
|
3
4
|
import { sortingOptionFields } from "./sorting/index.js";
|
4
5
|
/**
|
5
6
|
* Joi schema for `QueryOptions` interface
|
@@ -7,6 +8,7 @@ import { sortingOptionFields } from "./sorting/index.js";
|
|
7
8
|
*/
|
8
9
|
export const queryOptionsSchema = Joi.object({
|
9
10
|
...paginationOptionFields,
|
10
|
-
...sortingOptionFields
|
11
|
+
...sortingOptionFields,
|
12
|
+
...searchOptionFields
|
11
13
|
});
|
12
14
|
//# sourceMappingURL=schema.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"schema.js","names":["Joi","paginationOptionFields","sortingOptionFields","queryOptionsSchema","object"],"sources":["../../../src/common/schema.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport { paginationOptionFields } from '~/src/common/pagination/index.js'\nimport { sortingOptionFields } from '~/src/common/sorting/index.js'\nimport { type QueryOptions } from '~/src/common/types.js'\n\n/**\n * Joi schema for `QueryOptions` interface\n * @see {@link QueryOptions}\n */\nexport const queryOptionsSchema: Joi.ObjectSchema<QueryOptions> = Joi.object({\n ...paginationOptionFields,\n ...sortingOptionFields\n})\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAErB,SAASC,sBAAsB;AAC/B,SAASC,mBAAmB;AAG5B;AACA;AACA;AACA;AACA,OAAO,MAAMC,kBAAkD,
|
1
|
+
{"version":3,"file":"schema.js","names":["Joi","paginationOptionFields","searchOptionFields","sortingOptionFields","queryOptionsSchema","object"],"sources":["../../../src/common/schema.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport { paginationOptionFields } from '~/src/common/pagination/index.js'\nimport { searchOptionFields } from '~/src/common/search/index.js'\nimport { sortingOptionFields } from '~/src/common/sorting/index.js'\nimport { type QueryOptions } from '~/src/common/types.js'\n\n/**\n * Joi schema for `QueryOptions` interface\n * @see {@link QueryOptions}\n */\nexport const queryOptionsSchema: Joi.ObjectSchema<QueryOptions> = Joi.object({\n ...paginationOptionFields,\n ...sortingOptionFields,\n ...searchOptionFields\n})\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAErB,SAASC,sBAAsB;AAC/B,SAASC,kBAAkB;AAC3B,SAASC,mBAAmB;AAG5B;AACA;AACA;AACA;AACA,OAAO,MAAMC,kBAAkD,GAAGJ,GAAG,CAACK,MAAM,CAAC;EAC3E,GAAGJ,sBAAsB;EACzB,GAAGE,mBAAmB;EACtB,GAAGD;AACL,CAAC,CAAC","ignoreList":[]}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import Joi from 'joi';
|
2
|
+
/**
|
3
|
+
* Field definitions for search options.
|
4
|
+
*/
|
5
|
+
export const searchOptionFields = {
|
6
|
+
title: Joi.string().trim().allow('').max(255).optional()
|
7
|
+
};
|
8
|
+
|
9
|
+
/**
|
10
|
+
* Joi schema for {@link SearchOptions} interface
|
11
|
+
*/
|
12
|
+
export const searchOptionsSchema = Joi.object(searchOptionFields);
|
13
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","names":["Joi","searchOptionFields","title","string","trim","allow","max","optional","searchOptionsSchema","object"],"sources":["../../../../src/common/search/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport { type SearchOptions } from '~/src/common/search/types.js'\n\n/**\n * Field definitions for search options.\n */\nexport const searchOptionFields = {\n title: Joi.string().trim().allow('').max(255).optional()\n}\n\n/**\n * Joi schema for {@link SearchOptions} interface\n */\nexport const searchOptionsSchema: Joi.ObjectSchema<SearchOptions> =\n Joi.object(searchOptionFields)\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAIrB;AACA;AACA;AACA,OAAO,MAAMC,kBAAkB,GAAG;EAChCC,KAAK,EAAEF,GAAG,CAACG,MAAM,CAAC,CAAC,CAACC,IAAI,CAAC,CAAC,CAACC,KAAK,CAAC,EAAE,CAAC,CAACC,GAAG,CAAC,GAAG,CAAC,CAACC,QAAQ,CAAC;AACzD,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMC,mBAAoD,GAC/DR,GAAG,CAACS,MAAM,CAACR,kBAAkB,CAAC","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/common/search/types.ts"],"sourcesContent":["/**\n * Search options for querying forms\n */\nexport interface SearchOptions {\n /**\n * Search term to filter the results by title\n */\n title?: string\n}\n"],"mappings":"","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../src/common/types.ts"],"sourcesContent":["import {\n type PaginationOptions,\n type PaginationResult\n} from '~/src/common/pagination/types.js'\nimport { type SortingOptions } from '~/src/common/sorting/types.js'\n\n/**\n * Options for querying results, including pagination and
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/common/types.ts"],"sourcesContent":["import {\n type PaginationOptions,\n type PaginationResult\n} from '~/src/common/pagination/types.js'\nimport { type SearchOptions } from '~/src/common/search/types.js'\nimport { type SortingOptions } from '~/src/common/sorting/types.js'\n\n/**\n * Options for querying results, including pagination, sorting, and searching\n */\nexport type QueryOptions = PaginationOptions & SortingOptions & SearchOptions\n\n/**\n * Metadata containing the optional pagination, sorting, and searching information\n */\nexport interface Meta {\n /**\n * The pagination details\n */\n pagination?: PaginationResult\n\n /**\n * The sorting details\n */\n sorting?: SortingOptions\n\n /**\n * The search details\n */\n search?: SearchOptions\n}\n\n/**\n * Standard response wrapper for query results with metadata\n */\nexport interface QueryResult<Model> {\n /**\n * The array of data items\n */\n data: Model[]\n\n /**\n * The metadata about the result\n */\n meta: Meta\n}\n"],"mappings":"","ignoreList":[]}
|
package/dist/module/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export * from "./common/schema.js";
|
2
2
|
export * from "./common/pagination/index.js";
|
3
|
-
export * from "./common/
|
3
|
+
export * from "./common/search/index.js";
|
4
4
|
export * from "./common/sorting/index.js";
|
5
5
|
export * from "./components/index.js";
|
6
6
|
export * from "./conditions/index.js";
|
package/dist/module/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export * from '~/src/common/schema.js'\nexport * from '~/src/common/pagination/index.js'\nexport * from '~/src/common/
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export * from '~/src/common/schema.js'\nexport * from '~/src/common/pagination/index.js'\nexport * from '~/src/common/search/index.js'\nexport * from '~/src/common/sorting/index.js'\nexport * from '~/src/components/index.js'\nexport * from '~/src/conditions/index.js'\nexport * from '~/src/form/form-definition/index.js'\nexport * from '~/src/form/form-metadata/index.js'\nexport * from '~/src/form/form-submission/index.js'\nexport * from '~/src/form/utils/index.js'\nexport * from '~/src/pages/index.js'\nexport * from '~/src/utils/helpers.js'\nexport * from '~/src/utils/markdown.js'\n\nexport type * from '~/src/common/types.js'\nexport type * from '~/src/common/pagination/types.js'\nexport type * from '~/src/common/search/types.js'\nexport type * from '~/src/common/sorting/types.js'\nexport type * from '~/src/components/types.js'\nexport type * from '~/src/conditions/types.js'\nexport type * from '~/src/form/form-definition/types.js'\nexport type * from '~/src/form/form-metadata/types.js'\nexport type * from '~/src/form/form-submission/types.js'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/common/schema.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/common/schema.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAKrB,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,GAAG,CAAC,YAAY,CAAC,YAAY,CAI5D,CAAA"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import Joi from 'joi';
|
2
|
+
import { type SearchOptions } from '../../common/search/types.js';
|
3
|
+
/**
|
4
|
+
* Field definitions for search options.
|
5
|
+
*/
|
6
|
+
export declare const searchOptionFields: {
|
7
|
+
title: Joi.StringSchema<string>;
|
8
|
+
};
|
9
|
+
/**
|
10
|
+
* Joi schema for {@link SearchOptions} interface
|
11
|
+
*/
|
12
|
+
export declare const searchOptionsSchema: Joi.ObjectSchema<SearchOptions>;
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/search/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAEjE;;GAEG;AACH,eAAO,MAAM,kBAAkB;;CAE9B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAChC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/common/search/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf"}
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import { type PaginationOptions, type PaginationResult } from '../common/pagination/types.js';
|
2
|
+
import { type SearchOptions } from '../common/search/types.js';
|
2
3
|
import { type SortingOptions } from '../common/sorting/types.js';
|
3
4
|
/**
|
4
|
-
* Options for querying results, including pagination and
|
5
|
+
* Options for querying results, including pagination, sorting, and searching
|
5
6
|
*/
|
6
|
-
export type QueryOptions = PaginationOptions & SortingOptions;
|
7
|
+
export type QueryOptions = PaginationOptions & SortingOptions & SearchOptions;
|
7
8
|
/**
|
8
|
-
* Metadata containing the optional pagination and
|
9
|
+
* Metadata containing the optional pagination, sorting, and searching information
|
9
10
|
*/
|
10
11
|
export interface Meta {
|
11
12
|
/**
|
@@ -16,6 +17,10 @@ export interface Meta {
|
|
16
17
|
* The sorting details
|
17
18
|
*/
|
18
19
|
sorting?: SortingOptions;
|
20
|
+
/**
|
21
|
+
* The search details
|
22
|
+
*/
|
23
|
+
search?: SearchOptions;
|
19
24
|
}
|
20
25
|
/**
|
21
26
|
* Standard response wrapper for query results with metadata
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACtB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAEnE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,iBAAiB,GAAG,cAAc,CAAA;
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACtB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAEnE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,iBAAiB,GAAG,cAAc,GAAG,aAAa,CAAA;AAE7E;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAE7B;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IAExB;;OAEG;IACH,MAAM,CAAC,EAAE,aAAa,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW,CAAC,KAAK;IAChC;;OAEG;IACH,IAAI,EAAE,KAAK,EAAE,CAAA;IAEb;;OAEG;IACH,IAAI,EAAE,IAAI,CAAA;CACX"}
|
package/dist/types/index.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export * from './common/schema.js';
|
2
2
|
export * from './common/pagination/index.js';
|
3
|
-
export * from './common/
|
3
|
+
export * from './common/search/index.js';
|
4
4
|
export * from './common/sorting/index.js';
|
5
5
|
export * from './components/index.js';
|
6
6
|
export * from './conditions/index.js';
|
@@ -13,6 +13,7 @@ export * from './utils/helpers.js';
|
|
13
13
|
export * from './utils/markdown.js';
|
14
14
|
export type * from './common/types.js';
|
15
15
|
export type * from './common/pagination/types.js';
|
16
|
+
export type * from './common/search/types.js';
|
16
17
|
export type * from './common/sorting/types.js';
|
17
18
|
export type * from './components/types.js';
|
18
19
|
export type * from './conditions/types.js';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,kCAAkC,CAAA;AAChD,cAAc,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,kCAAkC,CAAA;AAChD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,qCAAqC,CAAA;AACnD,cAAc,mCAAmC,CAAA;AACjD,cAAc,qCAAqC,CAAA;AACnD,cAAc,2BAA2B,CAAA;AACzC,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AAEvC,mBAAmB,uBAAuB,CAAA;AAC1C,mBAAmB,kCAAkC,CAAA;AACrD,mBAAmB,8BAA8B,CAAA;AACjD,mBAAmB,+BAA+B,CAAA;AAClD,mBAAmB,2BAA2B,CAAA;AAC9C,mBAAmB,2BAA2B,CAAA;AAC9C,mBAAmB,qCAAqC,CAAA;AACxD,mBAAmB,mCAAmC,CAAA;AACtD,mBAAmB,qCAAqC,CAAA"}
|
package/package.json
CHANGED
package/src/common/schema.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import Joi from 'joi'
|
2
2
|
|
3
3
|
import { paginationOptionFields } from '~/src/common/pagination/index.js'
|
4
|
+
import { searchOptionFields } from '~/src/common/search/index.js'
|
4
5
|
import { sortingOptionFields } from '~/src/common/sorting/index.js'
|
5
6
|
import { type QueryOptions } from '~/src/common/types.js'
|
6
7
|
|
@@ -10,5 +11,6 @@ import { type QueryOptions } from '~/src/common/types.js'
|
|
10
11
|
*/
|
11
12
|
export const queryOptionsSchema: Joi.ObjectSchema<QueryOptions> = Joi.object({
|
12
13
|
...paginationOptionFields,
|
13
|
-
...sortingOptionFields
|
14
|
+
...sortingOptionFields,
|
15
|
+
...searchOptionFields
|
14
16
|
})
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import Joi from 'joi'
|
2
|
+
|
3
|
+
import { type SearchOptions } from '~/src/common/search/types.js'
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Field definitions for search options.
|
7
|
+
*/
|
8
|
+
export const searchOptionFields = {
|
9
|
+
title: Joi.string().trim().allow('').max(255).optional()
|
10
|
+
}
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Joi schema for {@link SearchOptions} interface
|
14
|
+
*/
|
15
|
+
export const searchOptionsSchema: Joi.ObjectSchema<SearchOptions> =
|
16
|
+
Joi.object(searchOptionFields)
|
package/src/common/types.ts
CHANGED
@@ -2,15 +2,16 @@ import {
|
|
2
2
|
type PaginationOptions,
|
3
3
|
type PaginationResult
|
4
4
|
} from '~/src/common/pagination/types.js'
|
5
|
+
import { type SearchOptions } from '~/src/common/search/types.js'
|
5
6
|
import { type SortingOptions } from '~/src/common/sorting/types.js'
|
6
7
|
|
7
8
|
/**
|
8
|
-
* Options for querying results, including pagination and
|
9
|
+
* Options for querying results, including pagination, sorting, and searching
|
9
10
|
*/
|
10
|
-
export type QueryOptions = PaginationOptions & SortingOptions
|
11
|
+
export type QueryOptions = PaginationOptions & SortingOptions & SearchOptions
|
11
12
|
|
12
13
|
/**
|
13
|
-
* Metadata containing the optional pagination and
|
14
|
+
* Metadata containing the optional pagination, sorting, and searching information
|
14
15
|
*/
|
15
16
|
export interface Meta {
|
16
17
|
/**
|
@@ -22,6 +23,11 @@ export interface Meta {
|
|
22
23
|
* The sorting details
|
23
24
|
*/
|
24
25
|
sorting?: SortingOptions
|
26
|
+
|
27
|
+
/**
|
28
|
+
* The search details
|
29
|
+
*/
|
30
|
+
search?: SearchOptions
|
25
31
|
}
|
26
32
|
|
27
33
|
/**
|
package/src/index.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export * from '~/src/common/schema.js'
|
2
2
|
export * from '~/src/common/pagination/index.js'
|
3
|
-
export * from '~/src/common/
|
3
|
+
export * from '~/src/common/search/index.js'
|
4
4
|
export * from '~/src/common/sorting/index.js'
|
5
5
|
export * from '~/src/components/index.js'
|
6
6
|
export * from '~/src/conditions/index.js'
|
@@ -14,6 +14,7 @@ export * from '~/src/utils/markdown.js'
|
|
14
14
|
|
15
15
|
export type * from '~/src/common/types.js'
|
16
16
|
export type * from '~/src/common/pagination/types.js'
|
17
|
+
export type * from '~/src/common/search/types.js'
|
17
18
|
export type * from '~/src/common/sorting/types.js'
|
18
19
|
export type * from '~/src/components/types.js'
|
19
20
|
export type * from '~/src/conditions/types.js'
|