@defra/forms-model 3.0.681 → 3.0.682

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.
@@ -3,6 +3,12 @@ export let FormStatus = /*#__PURE__*/function (FormStatus) {
3
3
  FormStatus["Live"] = "live";
4
4
  return FormStatus;
5
5
  }({});
6
+ export let FormFilterStatus = /*#__PURE__*/function (FormFilterStatus) {
7
+ FormFilterStatus["Draft"] = "draft";
8
+ FormFilterStatus["Live"] = "live";
9
+ FormFilterStatus["Offline"] = "offline";
10
+ return FormFilterStatus;
11
+ }({});
6
12
  export let ApiErrorCode = /*#__PURE__*/function (ApiErrorCode) {
7
13
  ApiErrorCode["General"] = "General";
8
14
  ApiErrorCode["DuplicatePagePathPage"] = "DuplicatePagePathPage";
@@ -1 +1 @@
1
- {"version":3,"file":"enums.js","names":["FormStatus","ApiErrorCode"],"sources":["../../../src/common/enums.ts"],"sourcesContent":["export enum FormStatus {\n Draft = 'draft',\n Live = 'live'\n}\n\nexport enum ApiErrorCode {\n General = 'General',\n DuplicatePagePathPage = 'DuplicatePagePathPage',\n DuplicatePagePathComponent = 'DuplicatePagePathComponent'\n}\n"],"mappings":"AAAA,WAAYA,UAAU,0BAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAKtB,WAAYC,YAAY,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"enums.js","names":["FormStatus","FormFilterStatus","ApiErrorCode"],"sources":["../../../src/common/enums.ts"],"sourcesContent":["export enum FormStatus {\n Draft = 'draft',\n Live = 'live'\n}\n\nexport enum FormFilterStatus {\n Draft = 'draft',\n Live = 'live',\n Offline = 'offline'\n}\n\nexport enum ApiErrorCode {\n General = 'General',\n DuplicatePagePathPage = 'DuplicatePagePathPage',\n DuplicatePagePathComponent = 'DuplicatePagePathComponent'\n}\n"],"mappings":"AAAA,WAAYA,UAAU,0BAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAKtB,WAAYC,gBAAgB,0BAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAA,OAAhBA,gBAAgB;AAAA;AAM5B,WAAYC,YAAY,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA","ignoreList":[]}
@@ -1,14 +1,24 @@
1
1
  import Joi from 'joi';
2
2
  import { paginationOptionFields } from "./pagination/index.js";
3
- import { searchOptionFields } from "./search/index.js";
3
+ import { searchOptionFieldsManager, searchOptionFieldsUI } from "./search/index.js";
4
4
  import { sortingOptionFields } from "./sorting/index.js";
5
5
  /**
6
- * Joi schema for `QueryOptions` interface
6
+ * Joi schema for `QueryOptions` interface - for UI
7
7
  * @see {@link QueryOptions}
8
8
  */
9
- export const queryOptionsSchema = Joi.object({
9
+ export const queryOptionsSchemaUI = Joi.object({
10
10
  ...paginationOptionFields,
11
11
  ...sortingOptionFields,
12
- ...searchOptionFields
12
+ ...searchOptionFieldsUI
13
+ });
14
+
15
+ /**
16
+ * Joi schema for `QueryOptions` interface - form forms-manager
17
+ * @see {@link QueryOptions}
18
+ */
19
+ export const queryOptionsSchemaManager = Joi.object({
20
+ ...paginationOptionFields,
21
+ ...sortingOptionFields,
22
+ ...searchOptionFieldsManager
13
23
  });
14
24
  //# sourceMappingURL=schema.js.map
@@ -1 +1 @@
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":[]}
1
+ {"version":3,"file":"schema.js","names":["Joi","paginationOptionFields","searchOptionFieldsManager","searchOptionFieldsUI","sortingOptionFields","queryOptionsSchemaUI","object","queryOptionsSchemaManager"],"sources":["../../../src/common/schema.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport { paginationOptionFields } from '~/src/common/pagination/index.js'\nimport {\n searchOptionFieldsManager,\n searchOptionFieldsUI\n} 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 - for UI\n * @see {@link QueryOptions}\n */\nexport const queryOptionsSchemaUI: Joi.ObjectSchema<QueryOptions> = Joi.object({\n ...paginationOptionFields,\n ...sortingOptionFields,\n ...searchOptionFieldsUI\n})\n\n/**\n * Joi schema for `QueryOptions` interface - form forms-manager\n * @see {@link QueryOptions}\n */\nexport const queryOptionsSchemaManager: Joi.ObjectSchema<QueryOptions> =\n Joi.object({\n ...paginationOptionFields,\n ...sortingOptionFields,\n ...searchOptionFieldsManager\n })\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAErB,SAASC,sBAAsB;AAC/B,SACEC,yBAAyB,EACzBC,oBAAoB;AAEtB,SAASC,mBAAmB;AAG5B;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAoD,GAAGL,GAAG,CAACM,MAAM,CAAC;EAC7E,GAAGL,sBAAsB;EACzB,GAAGG,mBAAmB;EACtB,GAAGD;AACL,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA,OAAO,MAAMI,yBAAyD,GACpEP,GAAG,CAACM,MAAM,CAAC;EACT,GAAGL,sBAAsB;EACzB,GAAGG,mBAAmB;EACtB,GAAGF;AACL,CAAC,CAAC","ignoreList":[]}
@@ -1,18 +1,32 @@
1
1
  import Joi from 'joi';
2
+ import { FormFilterStatus, FormStatus } from "../enums.js";
2
3
  import { organisations } from "../../form/form-metadata/index.js";
3
4
 
4
5
  /**
5
6
  * Field definitions for search options.
6
7
  */
7
- export const searchOptionFields = {
8
+ const searchOptionFieldsBase = {
8
9
  title: Joi.string().trim().allow('').max(255).optional().default('').description('Search by form title, empty string matches all'),
9
10
  author: Joi.string().trim().allow('').max(100).optional().default('').description('Search by form author, empty string matches all'),
10
11
  organisations: Joi.array().items(Joi.string().valid(...organisations)).single().optional().default([]).description('Filter by organisation(s), empty array matches all'),
11
- status: Joi.array().items(Joi.string().valid('draft', 'live')).single().optional().default([]).description('Filter by form status(es), empty array matches all')
12
+ offline: Joi.boolean().optional().description('Filter by forms that are offline')
12
13
  };
14
+ export const searchOptionFieldsUI = {
15
+ ...searchOptionFieldsBase,
16
+ status: Joi.array().items(Joi.string().valid(...Object.values(FormFilterStatus))).single().optional().default([]).description('Filter by form status(es), empty array matches all')
17
+ };
18
+ export const searchOptionFieldsManager = {
19
+ ...searchOptionFieldsBase,
20
+ status: Joi.array().items(Joi.string().valid(...Object.values(FormStatus))).single().optional().default([]).description('Filter by form status(es), empty array matches all')
21
+ };
22
+
23
+ /**
24
+ * Joi schema for {@link SearchOptions} interface - for UI
25
+ */
26
+ export const searchOptionsSchemaUI = Joi.object(searchOptionFieldsUI);
13
27
 
14
28
  /**
15
- * Joi schema for {@link SearchOptions} interface
29
+ * Joi schema for {@link SearchOptions} interface - for forms-manager
16
30
  */
17
- export const searchOptionsSchema = Joi.object(searchOptionFields);
31
+ export const searchOptionsSchemaManager = Joi.object(searchOptionFieldsManager);
18
32
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Joi","organisations","searchOptionFields","title","string","trim","allow","max","optional","default","description","author","array","items","valid","single","status","searchOptionsSchema","object"],"sources":["../../../../src/common/search/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport { type SearchOptions } from '~/src/common/search/types.js'\nimport { organisations } from '~/src/form/form-metadata/index.js'\n\n/**\n * Field definitions for search options.\n */\nexport const searchOptionFields = {\n title: Joi.string()\n .trim()\n .allow('')\n .max(255)\n .optional()\n .default('')\n .description('Search by form title, empty string matches all'),\n author: Joi.string()\n .trim()\n .allow('')\n .max(100)\n .optional()\n .default('')\n .description('Search by form author, empty string matches all'),\n organisations: Joi.array()\n .items(Joi.string().valid(...organisations))\n .single()\n .optional()\n .default([])\n .description('Filter by organisation(s), empty array matches all'),\n status: Joi.array()\n .items(Joi.string().valid('draft', 'live'))\n .single()\n .optional()\n .default([])\n .description('Filter by form status(es), empty array matches all')\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;AAGrB,SAASC,aAAa;;AAEtB;AACA;AACA;AACA,OAAO,MAAMC,kBAAkB,GAAG;EAChCC,KAAK,EAAEH,GAAG,CAACI,MAAM,CAAC,CAAC,CAChBC,IAAI,CAAC,CAAC,CACNC,KAAK,CAAC,EAAE,CAAC,CACTC,GAAG,CAAC,GAAG,CAAC,CACRC,QAAQ,CAAC,CAAC,CACVC,OAAO,CAAC,EAAE,CAAC,CACXC,WAAW,CAAC,gDAAgD,CAAC;EAChEC,MAAM,EAAEX,GAAG,CAACI,MAAM,CAAC,CAAC,CACjBC,IAAI,CAAC,CAAC,CACNC,KAAK,CAAC,EAAE,CAAC,CACTC,GAAG,CAAC,GAAG,CAAC,CACRC,QAAQ,CAAC,CAAC,CACVC,OAAO,CAAC,EAAE,CAAC,CACXC,WAAW,CAAC,iDAAiD,CAAC;EACjET,aAAa,EAAED,GAAG,CAACY,KAAK,CAAC,CAAC,CACvBC,KAAK,CAACb,GAAG,CAACI,MAAM,CAAC,CAAC,CAACU,KAAK,CAAC,GAAGb,aAAa,CAAC,CAAC,CAC3Cc,MAAM,CAAC,CAAC,CACRP,QAAQ,CAAC,CAAC,CACVC,OAAO,CAAC,EAAE,CAAC,CACXC,WAAW,CAAC,oDAAoD,CAAC;EACpEM,MAAM,EAAEhB,GAAG,CAACY,KAAK,CAAC,CAAC,CAChBC,KAAK,CAACb,GAAG,CAACI,MAAM,CAAC,CAAC,CAACU,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAC1CC,MAAM,CAAC,CAAC,CACRP,QAAQ,CAAC,CAAC,CACVC,OAAO,CAAC,EAAE,CAAC,CACXC,WAAW,CAAC,oDAAoD;AACrE,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMO,mBAAoD,GAC/DjB,GAAG,CAACkB,MAAM,CAAChB,kBAAkB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["Joi","FormFilterStatus","FormStatus","organisations","searchOptionFieldsBase","title","string","trim","allow","max","optional","default","description","author","array","items","valid","single","offline","boolean","searchOptionFieldsUI","status","Object","values","searchOptionFieldsManager","searchOptionsSchemaUI","object","searchOptionsSchemaManager"],"sources":["../../../../src/common/search/index.ts"],"sourcesContent":["import Joi from 'joi'\n\nimport { FormFilterStatus, FormStatus } from '~/src/common/enums.js'\nimport { type SearchOptions } from '~/src/common/search/types.js'\nimport { organisations } from '~/src/form/form-metadata/index.js'\n\n/**\n * Field definitions for search options.\n */\nconst searchOptionFieldsBase = {\n title: Joi.string()\n .trim()\n .allow('')\n .max(255)\n .optional()\n .default('')\n .description('Search by form title, empty string matches all'),\n author: Joi.string()\n .trim()\n .allow('')\n .max(100)\n .optional()\n .default('')\n .description('Search by form author, empty string matches all'),\n organisations: Joi.array()\n .items(Joi.string().valid(...organisations))\n .single()\n .optional()\n .default([])\n .description('Filter by organisation(s), empty array matches all'),\n offline: Joi.boolean()\n .optional()\n .description('Filter by forms that are offline')\n}\n\nexport const searchOptionFieldsUI = {\n ...searchOptionFieldsBase,\n status: Joi.array()\n .items(Joi.string().valid(...Object.values(FormFilterStatus)))\n .single()\n .optional()\n .default([])\n .description('Filter by form status(es), empty array matches all')\n}\n\nexport const searchOptionFieldsManager = {\n ...searchOptionFieldsBase,\n status: Joi.array()\n .items(Joi.string().valid(...Object.values(FormStatus)))\n .single()\n .optional()\n .default([])\n .description('Filter by form status(es), empty array matches all')\n}\n\n/**\n * Joi schema for {@link SearchOptions} interface - for UI\n */\nexport const searchOptionsSchemaUI: Joi.ObjectSchema<SearchOptions> =\n Joi.object(searchOptionFieldsUI)\n\n/**\n * Joi schema for {@link SearchOptions} interface - for forms-manager\n */\nexport const searchOptionsSchemaManager: Joi.ObjectSchema<SearchOptions> =\n Joi.object(searchOptionFieldsManager)\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAErB,SAASC,gBAAgB,EAAEC,UAAU;AAErC,SAASC,aAAa;;AAEtB;AACA;AACA;AACA,MAAMC,sBAAsB,GAAG;EAC7BC,KAAK,EAAEL,GAAG,CAACM,MAAM,CAAC,CAAC,CAChBC,IAAI,CAAC,CAAC,CACNC,KAAK,CAAC,EAAE,CAAC,CACTC,GAAG,CAAC,GAAG,CAAC,CACRC,QAAQ,CAAC,CAAC,CACVC,OAAO,CAAC,EAAE,CAAC,CACXC,WAAW,CAAC,gDAAgD,CAAC;EAChEC,MAAM,EAAEb,GAAG,CAACM,MAAM,CAAC,CAAC,CACjBC,IAAI,CAAC,CAAC,CACNC,KAAK,CAAC,EAAE,CAAC,CACTC,GAAG,CAAC,GAAG,CAAC,CACRC,QAAQ,CAAC,CAAC,CACVC,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ElC;AACA;AACA;AACA,OAAO,MAAMO,0BAA2D,GACtE3B,GAAG,CAAC0B,MAAM,CAACF,yBAAyB,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../../src/common/search/types.ts"],"sourcesContent":["import { type FormStatus } from '~/src/common/enums.js'\n\n/**\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 /**\n * Filter by author's name\n * If provided, shows only forms created by authors with matching name\n */\n author?: string\n\n /**\n * Filter by organisations\n * Array of organisation names to filter by\n */\n organisations?: string[]\n\n /**\n * Filter by form status\n * Array of statuses to filter by\n */\n status?: FormStatus[]\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../src/common/search/types.ts"],"sourcesContent":["import { type FormStatus } from '~/src/common/enums.js'\n\n/**\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 /**\n * Filter by author's name\n * If provided, shows only forms created by authors with matching name\n */\n author?: string\n\n /**\n * Filter by organisations\n * Array of organisation names to filter by\n */\n organisations?: string[]\n\n /**\n * Filter by form status\n * Array of statuses to filter by\n */\n status?: FormStatus[]\n\n /**\n * Filter by offline forms\n */\n offline?: boolean\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../src/common/types.ts"],"sourcesContent":["import { type FormStatus } from '~/src/common/enums.js'\nimport {\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 * Available filter options for the current result set\n */\nexport interface FilterOptions {\n /**\n * List of unique authors in the response\n */\n authors: string[]\n\n /**\n * List of organizations that have forms\n */\n organisations: string[]\n\n /**\n * Status values present in the results\n */\n status?: FormStatus[]\n}\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 * Available filter options\n */\n filters?: FilterOptions\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\n/**\n * Type for the list items within a Radio or Checkbox nunjucks definition\n */\nexport interface CheckboxOrRadioItem {\n /**\n * The text to be displayed\n */\n text?: string\n\n /**\n * If text is set, this is not required. HTML to use within each radio item label\n */\n html?: string\n\n /**\n * Specific ID attribute for the checkbox/radio item\n */\n id?: string\n\n /**\n * Name for the checkbox/radio item\n */\n name?: string\n\n /**\n * Required. Value for the radio input\n */\n value: string\n\n /**\n * Subset of options for the label\n */\n label?: string\n\n /**\n * Can be used to add a hint to each item\n */\n hint?: string\n\n /**\n * Divider text to separate checkbox/radio items, for example the text \"or\"\n */\n divider?: string\n\n /**\n * Whether the checkbox/radio should be checked when the page loads\n */\n checked?: boolean\n\n /**\n * Provide additional content to reveal when the checkbox/radio is checked\n */\n conditional?: {\n html?: string\n }\n\n /**\n * The behaviour - if set to \"exclusive\" implements a 'None of thse' type behaviour via Javascript when checkboxes are clicked\n */\n behaviour?: string\n\n /**\n * If true, checkbox/radio option will be disabled\n */\n disabled?: boolean\n\n /**\n * HTML attributes (for example data attributes) to add to the checkbox input tag\n */\n attributes?: object\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/common/types.ts"],"sourcesContent":["import { type FormStatus } from '~/src/common/enums.js'\nimport {\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 * Available filter options for the current result set\n */\nexport interface FilterOptions {\n /**\n * List of unique authors in the response\n */\n authors: string[]\n\n /**\n * List of organizations that have forms\n */\n organisations: string[]\n\n /**\n * Status values present in the results\n */\n status?: FormStatus[]\n\n /**\n * Offline value present in the results\n */\n offline?: boolean\n}\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 * Available filter options\n */\n filters?: FilterOptions\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\n/**\n * Type for the list items within a Radio or Checkbox nunjucks definition\n */\nexport interface CheckboxOrRadioItem {\n /**\n * The text to be displayed\n */\n text?: string\n\n /**\n * If text is set, this is not required. HTML to use within each radio item label\n */\n html?: string\n\n /**\n * Specific ID attribute for the checkbox/radio item\n */\n id?: string\n\n /**\n * Name for the checkbox/radio item\n */\n name?: string\n\n /**\n * Required. Value for the radio input\n */\n value: string\n\n /**\n * Subset of options for the label\n */\n label?: string\n\n /**\n * Can be used to add a hint to each item\n */\n hint?: string\n\n /**\n * Divider text to separate checkbox/radio items, for example the text \"or\"\n */\n divider?: string\n\n /**\n * Whether the checkbox/radio should be checked when the page loads\n */\n checked?: boolean\n\n /**\n * Provide additional content to reveal when the checkbox/radio is checked\n */\n conditional?: {\n html?: string\n }\n\n /**\n * The behaviour - if set to \"exclusive\" implements a 'None of thse' type behaviour via Javascript when checkboxes are clicked\n */\n behaviour?: string\n\n /**\n * If true, checkbox/radio option will be disabled\n */\n disabled?: boolean\n\n /**\n * HTML attributes (for example data attributes) to add to the checkbox input tag\n */\n attributes?: object\n}\n"],"mappings":"","ignoreList":[]}
@@ -2,6 +2,11 @@ export declare enum FormStatus {
2
2
  Draft = "draft",
3
3
  Live = "live"
4
4
  }
5
+ export declare enum FormFilterStatus {
6
+ Draft = "draft",
7
+ Live = "live",
8
+ Offline = "offline"
9
+ }
5
10
  export declare enum ApiErrorCode {
6
11
  General = "General",
7
12
  DuplicatePagePathPage = "DuplicatePagePathPage",
@@ -1 +1 @@
1
- {"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../src/common/enums.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IACpB,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AAED,oBAAY,YAAY;IACtB,OAAO,YAAY;IACnB,qBAAqB,0BAA0B;IAC/C,0BAA0B,+BAA+B;CAC1D"}
1
+ {"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../src/common/enums.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IACpB,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AAED,oBAAY,gBAAgB;IAC1B,KAAK,UAAU;IACf,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED,oBAAY,YAAY;IACtB,OAAO,YAAY;IACnB,qBAAqB,0BAA0B;IAC/C,0BAA0B,+BAA+B;CAC1D"}
@@ -1,8 +1,13 @@
1
1
  import Joi from 'joi';
2
2
  import { type QueryOptions } from '../common/types.js';
3
3
  /**
4
- * Joi schema for `QueryOptions` interface
4
+ * Joi schema for `QueryOptions` interface - for UI
5
5
  * @see {@link QueryOptions}
6
6
  */
7
- export declare const queryOptionsSchema: Joi.ObjectSchema<QueryOptions>;
7
+ export declare const queryOptionsSchemaUI: Joi.ObjectSchema<QueryOptions>;
8
+ /**
9
+ * Joi schema for `QueryOptions` interface - form forms-manager
10
+ * @see {@link QueryOptions}
11
+ */
12
+ export declare const queryOptionsSchemaManager: Joi.ObjectSchema<QueryOptions>;
8
13
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/common/schema.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAQrB,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,GAAG,CAAC,YAAY,CAAC,YAAY,CAI9D,CAAA;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,GAAG,CAAC,YAAY,CAAC,YAAY,CAKjE,CAAA"}
@@ -1,16 +1,25 @@
1
1
  import Joi from 'joi';
2
2
  import { type SearchOptions } from '../../common/search/types.js';
3
- /**
4
- * Field definitions for search options.
5
- */
6
- export declare const searchOptionFields: {
3
+ export declare const searchOptionFieldsUI: {
4
+ status: Joi.ArraySchema<any[]>;
7
5
  title: Joi.StringSchema<string>;
8
6
  author: Joi.StringSchema<string>;
9
7
  organisations: Joi.ArraySchema<any[]>;
8
+ offline: Joi.BooleanSchema<boolean>;
9
+ };
10
+ export declare const searchOptionFieldsManager: {
10
11
  status: Joi.ArraySchema<any[]>;
12
+ title: Joi.StringSchema<string>;
13
+ author: Joi.StringSchema<string>;
14
+ organisations: Joi.ArraySchema<any[]>;
15
+ offline: Joi.BooleanSchema<boolean>;
11
16
  };
12
17
  /**
13
- * Joi schema for {@link SearchOptions} interface
18
+ * Joi schema for {@link SearchOptions} interface - for UI
19
+ */
20
+ export declare const searchOptionsSchemaUI: Joi.ObjectSchema<SearchOptions>;
21
+ /**
22
+ * Joi schema for {@link SearchOptions} interface - for forms-manager
14
23
  */
15
- export declare const searchOptionsSchema: Joi.ObjectSchema<SearchOptions>;
24
+ export declare const searchOptionsSchemaManager: Joi.ObjectSchema<SearchOptions>;
16
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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;AAGjE;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;CA2B9B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAChC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/search/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAGrB,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAgCjE,eAAO,MAAM,oBAAoB;;;;;;CAQhC,CAAA;AAED,eAAO,MAAM,yBAAyB;;;;;;CAQrC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAChC,CAAA;AAElC;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAChC,CAAA"}
@@ -22,5 +22,9 @@ export interface SearchOptions {
22
22
  * Array of statuses to filter by
23
23
  */
24
24
  status?: FormStatus[];
25
+ /**
26
+ * Filter by offline forms
27
+ */
28
+ offline?: boolean;
25
29
  }
26
30
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/common/search/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEvD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IAExB;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,EAAE,CAAA;CACtB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/common/search/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEvD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IAExB;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,EAAE,CAAA;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB"}
@@ -22,6 +22,10 @@ export interface FilterOptions {
22
22
  * Status values present in the results
23
23
  */
24
24
  status?: FormStatus[];
25
+ /**
26
+ * Offline value present in the results
27
+ */
28
+ offline?: boolean;
25
29
  }
26
30
  /**
27
31
  * Metadata containing the optional pagination, sorting, and searching information
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,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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EG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IAEX;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE;QACZ,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,CAAA;IAED;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/forms-model",
3
- "version": "3.0.681",
3
+ "version": "3.0.682",
4
4
  "description": "A hapi plugin providing the model for Defra forms",
5
5
  "homepage": "https://github.com/DEFRA/forms-designer/tree/main/model#readme",
6
6
  "types": "dist/types/index.d.ts",
@@ -3,6 +3,12 @@ export enum FormStatus {
3
3
  Live = 'live'
4
4
  }
5
5
 
6
+ export enum FormFilterStatus {
7
+ Draft = 'draft',
8
+ Live = 'live',
9
+ Offline = 'offline'
10
+ }
11
+
6
12
  export enum ApiErrorCode {
7
13
  General = 'General',
8
14
  DuplicatePagePathPage = 'DuplicatePagePathPage',
@@ -1,16 +1,30 @@
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
+ import {
5
+ searchOptionFieldsManager,
6
+ searchOptionFieldsUI
7
+ } from '~/src/common/search/index.js'
5
8
  import { sortingOptionFields } from '~/src/common/sorting/index.js'
6
9
  import { type QueryOptions } from '~/src/common/types.js'
7
10
 
8
11
  /**
9
- * Joi schema for `QueryOptions` interface
12
+ * Joi schema for `QueryOptions` interface - for UI
10
13
  * @see {@link QueryOptions}
11
14
  */
12
- export const queryOptionsSchema: Joi.ObjectSchema<QueryOptions> = Joi.object({
15
+ export const queryOptionsSchemaUI: Joi.ObjectSchema<QueryOptions> = Joi.object({
13
16
  ...paginationOptionFields,
14
17
  ...sortingOptionFields,
15
- ...searchOptionFields
18
+ ...searchOptionFieldsUI
16
19
  })
20
+
21
+ /**
22
+ * Joi schema for `QueryOptions` interface - form forms-manager
23
+ * @see {@link QueryOptions}
24
+ */
25
+ export const queryOptionsSchemaManager: Joi.ObjectSchema<QueryOptions> =
26
+ Joi.object({
27
+ ...paginationOptionFields,
28
+ ...sortingOptionFields,
29
+ ...searchOptionFieldsManager
30
+ })
@@ -1,12 +1,13 @@
1
1
  import Joi from 'joi'
2
2
 
3
+ import { FormFilterStatus, FormStatus } from '~/src/common/enums.js'
3
4
  import { type SearchOptions } from '~/src/common/search/types.js'
4
5
  import { organisations } from '~/src/form/form-metadata/index.js'
5
6
 
6
7
  /**
7
8
  * Field definitions for search options.
8
9
  */
9
- export const searchOptionFields = {
10
+ const searchOptionFieldsBase = {
10
11
  title: Joi.string()
11
12
  .trim()
12
13
  .allow('')
@@ -27,16 +28,39 @@ export const searchOptionFields = {
27
28
  .optional()
28
29
  .default([])
29
30
  .description('Filter by organisation(s), empty array matches all'),
31
+ offline: Joi.boolean()
32
+ .optional()
33
+ .description('Filter by forms that are offline')
34
+ }
35
+
36
+ export const searchOptionFieldsUI = {
37
+ ...searchOptionFieldsBase,
30
38
  status: Joi.array()
31
- .items(Joi.string().valid('draft', 'live'))
39
+ .items(Joi.string().valid(...Object.values(FormFilterStatus)))
32
40
  .single()
33
41
  .optional()
34
42
  .default([])
35
43
  .description('Filter by form status(es), empty array matches all')
36
44
  }
37
45
 
46
+ export const searchOptionFieldsManager = {
47
+ ...searchOptionFieldsBase,
48
+ status: Joi.array()
49
+ .items(Joi.string().valid(...Object.values(FormStatus)))
50
+ .single()
51
+ .optional()
52
+ .default([])
53
+ .description('Filter by form status(es), empty array matches all')
54
+ }
55
+
56
+ /**
57
+ * Joi schema for {@link SearchOptions} interface - for UI
58
+ */
59
+ export const searchOptionsSchemaUI: Joi.ObjectSchema<SearchOptions> =
60
+ Joi.object(searchOptionFieldsUI)
61
+
38
62
  /**
39
- * Joi schema for {@link SearchOptions} interface
63
+ * Joi schema for {@link SearchOptions} interface - for forms-manager
40
64
  */
41
- export const searchOptionsSchema: Joi.ObjectSchema<SearchOptions> =
42
- Joi.object(searchOptionFields)
65
+ export const searchOptionsSchemaManager: Joi.ObjectSchema<SearchOptions> =
66
+ Joi.object(searchOptionFieldsManager)
@@ -26,4 +26,9 @@ export interface SearchOptions {
26
26
  * Array of statuses to filter by
27
27
  */
28
28
  status?: FormStatus[]
29
+
30
+ /**
31
+ * Filter by offline forms
32
+ */
33
+ offline?: boolean
29
34
  }
@@ -29,6 +29,11 @@ export interface FilterOptions {
29
29
  * Status values present in the results
30
30
  */
31
31
  status?: FormStatus[]
32
+
33
+ /**
34
+ * Offline value present in the results
35
+ */
36
+ offline?: boolean
32
37
  }
33
38
 
34
39
  /**
@@ -1,94 +0,0 @@
1
- {
2
- "type": "object",
3
- "properties": {
4
- "page": {
5
- "type": "number",
6
- "description": "Current page number, starting from 1",
7
- "default": 1,
8
- "exclusiveMinimum": 0,
9
- "minimum": 1,
10
- "title": "Page"
11
- },
12
- "perPage": {
13
- "type": "number",
14
- "description": "Number of items to display per page, between 1 and 200",
15
- "default": 24,
16
- "exclusiveMinimum": 0,
17
- "minimum": 1,
18
- "maximum": 200,
19
- "title": "Per Page"
20
- },
21
- "sortBy": {
22
- "type": "string",
23
- "description": "Field to sort results by",
24
- "enum": [
25
- "updatedAt",
26
- "title"
27
- ],
28
- "title": "Sort By"
29
- },
30
- "order": {
31
- "type": "string",
32
- "description": "Sort order (ascending or descending)",
33
- "enum": [
34
- "asc",
35
- "desc"
36
- ],
37
- "title": "Order"
38
- },
39
- "title": {
40
- "type": "string",
41
- "description": "Search by form title, empty string matches all",
42
- "default": "",
43
- "maxLength": 255,
44
- "title": "Title"
45
- },
46
- "author": {
47
- "type": "string",
48
- "description": "Search by form author, empty string matches all",
49
- "default": "",
50
- "maxLength": 100,
51
- "title": "Author"
52
- },
53
- "organisations": {
54
- "type": "array",
55
- "description": "Filter by organisation(s), empty array matches all",
56
- "default": [],
57
- "items": {
58
- "type": "string",
59
- "enum": [
60
- "Animal and Plant Health Agency – APHA",
61
- "Centre for Environment, Fisheries and Aquaculture Science – Cefas",
62
- "Defra",
63
- "Environment Agency",
64
- "Forestry Commission",
65
- "Marine Management Organisation – MMO",
66
- "Natural England",
67
- "Rural Payments Agency – RPA",
68
- "Veterinary Medicines Directorate – VMD"
69
- ],
70
- "title": "Organisations Item"
71
- },
72
- "title": "Organisations"
73
- },
74
- "status": {
75
- "type": "array",
76
- "description": "Filter by form status(es), empty array matches all",
77
- "default": [],
78
- "items": {
79
- "type": "string",
80
- "enum": [
81
- "draft",
82
- "live"
83
- ],
84
- "title": "Status Item"
85
- },
86
- "title": "Status"
87
- }
88
- },
89
- "additionalProperties": false,
90
- "$schema": "http://json-schema.org/draft-07/schema#",
91
- "title": "Query Options Schema",
92
- "description": "JSON Schema for validating Query Options Schema in Defra forms",
93
- "$id": "@defra/forms-model/schemas/query-options-schema.json"
94
- }
@@ -1,59 +0,0 @@
1
- {
2
- "type": "object",
3
- "properties": {
4
- "title": {
5
- "type": "string",
6
- "description": "Search by form title, empty string matches all",
7
- "default": "",
8
- "maxLength": 255,
9
- "title": "Title"
10
- },
11
- "author": {
12
- "type": "string",
13
- "description": "Search by form author, empty string matches all",
14
- "default": "",
15
- "maxLength": 100,
16
- "title": "Author"
17
- },
18
- "organisations": {
19
- "type": "array",
20
- "description": "Filter by organisation(s), empty array matches all",
21
- "default": [],
22
- "items": {
23
- "type": "string",
24
- "enum": [
25
- "Animal and Plant Health Agency – APHA",
26
- "Centre for Environment, Fisheries and Aquaculture Science – Cefas",
27
- "Defra",
28
- "Environment Agency",
29
- "Forestry Commission",
30
- "Marine Management Organisation – MMO",
31
- "Natural England",
32
- "Rural Payments Agency – RPA",
33
- "Veterinary Medicines Directorate – VMD"
34
- ],
35
- "title": "Organisations Item"
36
- },
37
- "title": "Organisations"
38
- },
39
- "status": {
40
- "type": "array",
41
- "description": "Filter by form status(es), empty array matches all",
42
- "default": [],
43
- "items": {
44
- "type": "string",
45
- "enum": [
46
- "draft",
47
- "live"
48
- ],
49
- "title": "Status Item"
50
- },
51
- "title": "Status"
52
- }
53
- },
54
- "additionalProperties": false,
55
- "$schema": "http://json-schema.org/draft-07/schema#",
56
- "title": "Search Options Schema",
57
- "description": "JSON Schema for validating Search Options Schema in Defra forms",
58
- "$id": "@defra/forms-model/schemas/search-options-schema.json"
59
- }