@opencrvs/toolkit 2.0.1-rc.f9085cb → 2.0.1-rc.fa20c7e

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.
@@ -17,8 +17,142 @@ const fs = require('fs')
17
17
 
18
18
  const COUNTRYCONFIG_REPO_URL =
19
19
  'https://github.com/opencrvs/opencrvs-countryconfig.git'
20
- const INFRASTRUCTURE_REPO_URL =
21
- 'https://github.com/opencrvs/infrastructure.git'
20
+ const INFRASTRUCTURE_REPO_URL = 'https://github.com/opencrvs/infrastructure.git'
21
+
22
+ const { version } = JSON.parse(
23
+ fs.readFileSync(path.join(__dirname, 'package.json'), 'utf-8')
24
+ )
25
+
26
+ function tagExists(repoUrl, tag) {
27
+ try {
28
+ execSync(
29
+ 'git ls-remote --exit-code --tags ' + repoUrl + ' refs/tags/' + tag,
30
+ {
31
+ stdio: 'pipe'
32
+ }
33
+ )
34
+ return true
35
+ } catch (err) {
36
+ return false
37
+ }
38
+ }
39
+
40
+ function branchExists(repoUrl, branch) {
41
+ try {
42
+ execSync(
43
+ 'git ls-remote --exit-code --heads ' + repoUrl + ' refs/heads/' + branch,
44
+ {
45
+ stdio: 'pipe'
46
+ }
47
+ )
48
+ return true
49
+ } catch (err) {
50
+ return false
51
+ }
52
+ }
53
+
54
+ /**
55
+ * Release tags (e.g. "v2.1.0"), highest first. Delegates the version-aware
56
+ * ordering to git itself rather than hand-parsing semver, then filters down
57
+ * to strict "vX.Y.Z" tags - `--sort=-version:refname` alone still leaves in
58
+ * non-release refs (e.g. "vtesting", "v2.0.0-beta") and peeled annotated-tag
59
+ * lines ("refs/tags/v2.0.0^{}").
60
+ */
61
+ function listReleaseTags(repoUrl) {
62
+ const output = execSync(
63
+ 'git ls-remote --tags --sort=-version:refname ' + repoUrl,
64
+ { encoding: 'utf-8' }
65
+ )
66
+
67
+ return output
68
+ .split('\n')
69
+ .map((line) => line.split('\t')[1])
70
+ .filter(Boolean)
71
+ .map((ref) => ref.replace('refs/tags/', ''))
72
+ .filter((tag) => /^v\d+\.\d+\.\d+$/.test(tag))
73
+ }
74
+
75
+ /**
76
+ * The highest release tag present in *both* repositories - used as the
77
+ * fallback when the version-specific tag can't be found in one or both, so
78
+ * scaffolding still lands on a real, matched release rather than develop.
79
+ */
80
+ function getLatestCommonReleaseTag() {
81
+ const infrastructureTags = new Set(listReleaseTags(INFRASTRUCTURE_REPO_URL))
82
+ return (
83
+ listReleaseTags(COUNTRYCONFIG_REPO_URL).find((tag) =>
84
+ infrastructureTags.has(tag)
85
+ ) || null
86
+ )
87
+ }
88
+
89
+ /**
90
+ * A prerelease-shaped own version (e.g. "2.1.0-rc.f5ea803", what npm resolves
91
+ * `@next` to - a build published from every push to a branch) never has a
92
+ * matching release tag, so it's resolved as a branch instead. Its base
93
+ * version (stripped of the "-rc.<sha>" suffix) tells apart two different
94
+ * situations: an RC for a version already being stabilized on its own
95
+ * "release/X.Y.Z" branch (e.g. "2.0.1-rc.*" while a patch release is in
96
+ * progress) versus an RC for a version that hasn't been branched off yet and
97
+ * only exists on develop (e.g. "2.1.0-rc.*" while that release branch hasn't
98
+ * been cut). Scaffold from the release branch when it exists in both
99
+ * repositories, otherwise fall back to develop.
100
+ *
101
+ * Otherwise, the own "X.Y.Z" version - whether resolved via npm's `latest`
102
+ * dist-tag (bare invocation) or an explicit `@X.Y.Z` pin - scaffolds from the
103
+ * matching "vX.Y.Z" tag when it exists in both repositories. If it doesn't
104
+ * (e.g. `latest` lagging behind the repos, or a pin that predates one repo's
105
+ * tagging), fall back to the highest release tag common to both, rather than
106
+ * a mismatched pairing of one tagged repo at that version and another repo
107
+ * at a different release. Exits with an error if no matching release tag
108
+ * exists in both repositories.
109
+ */
110
+ function resolveRef() {
111
+ if (version.includes('-')) {
112
+ const releaseBranch = 'release/' + version.split('-')[0]
113
+ if (
114
+ branchExists(COUNTRYCONFIG_REPO_URL, releaseBranch) &&
115
+ branchExists(INFRASTRUCTURE_REPO_URL, releaseBranch)
116
+ ) {
117
+ return releaseBranch
118
+ }
119
+ return 'develop'
120
+ }
121
+
122
+ const tag = 'v' + version
123
+ if (
124
+ tagExists(COUNTRYCONFIG_REPO_URL, tag) &&
125
+ tagExists(INFRASTRUCTURE_REPO_URL, tag)
126
+ ) {
127
+ return tag
128
+ }
129
+
130
+ const latestCommonTag = getLatestCommonReleaseTag()
131
+ if (latestCommonTag) {
132
+ console.warn(
133
+ '\nWarning: tag "' +
134
+ tag +
135
+ '" was not found in both repositories; falling back to the latest ' +
136
+ 'available release, ' +
137
+ latestCommonTag +
138
+ '.'
139
+ )
140
+ return latestCommonTag
141
+ }
142
+
143
+ console.error(
144
+ '\nError: no matching release tag was found in both the country config and ' +
145
+ 'infrastructure repositories.'
146
+ )
147
+ process.exit(1)
148
+ }
149
+
150
+ function cloneRepository(repoUrl, ref, targetDir) {
151
+ execSync(
152
+ 'git clone --depth 1 --branch ' + ref + ' ' + repoUrl + ' ' + targetDir,
153
+ { stdio: 'inherit' }
154
+ )
155
+ }
22
156
 
23
157
  const projectName = process.argv[2]
24
158
 
@@ -33,31 +167,48 @@ const countryconfigDirName = projectName + '-countryconfig'
33
167
  const infrastructureDirName = projectName + '-infrastructure'
34
168
 
35
169
  const countryconfigTargetDir = path.resolve(process.cwd(), countryconfigDirName)
36
- const infrastructureTargetDir = path.resolve(process.cwd(), infrastructureDirName)
170
+ const infrastructureTargetDir = path.resolve(
171
+ process.cwd(),
172
+ infrastructureDirName
173
+ )
37
174
 
38
175
  if (fs.existsSync(countryconfigTargetDir)) {
39
- console.error('Error: Directory "' + countryconfigDirName + '" already exists.')
176
+ console.error(
177
+ 'Error: Directory "' + countryconfigDirName + '" already exists.'
178
+ )
40
179
  process.exit(1)
41
180
  }
42
181
 
43
182
  if (fs.existsSync(infrastructureTargetDir)) {
44
- console.error('Error: Directory "' + infrastructureDirName + '" already exists.')
183
+ console.error(
184
+ 'Error: Directory "' + infrastructureDirName + '" already exists.'
185
+ )
45
186
  process.exit(1)
46
187
  }
47
188
 
48
- console.log('\nScaffolding OpenCRVS country config in ./' + countryconfigDirName + '...\n')
189
+ const ref = resolveRef()
190
+
191
+ console.log(
192
+ '\nScaffolding OpenCRVS country config in ./' + countryconfigDirName + '...\n'
193
+ )
49
194
 
50
195
  try {
51
- execSync('git clone --depth 1 ' + COUNTRYCONFIG_REPO_URL + ' ' + countryconfigDirName, { stdio: 'inherit' })
196
+ cloneRepository(COUNTRYCONFIG_REPO_URL, ref, countryconfigDirName)
52
197
  } catch (err) {
53
198
  console.error('Failed to clone the country config repository:', err.message)
54
199
  process.exit(1)
55
200
  }
56
201
 
57
202
  try {
58
- fs.rmSync(path.join(countryconfigTargetDir, '.git'), { recursive: true, force: true })
203
+ fs.rmSync(path.join(countryconfigTargetDir, '.git'), {
204
+ recursive: true,
205
+ force: true
206
+ })
59
207
  } catch (err) {
60
- console.error('Failed to remove .git directory from country config:', err.message)
208
+ console.error(
209
+ 'Failed to remove .git directory from country config:',
210
+ err.message
211
+ )
61
212
  process.exit(1)
62
213
  }
63
214
 
@@ -72,22 +223,34 @@ if (fs.existsSync(pkgPath)) {
72
223
  process.exit(1)
73
224
  }
74
225
  } else {
75
- console.warn('Warning: No package.json found in the cloned country config repository. Project name was not updated.')
226
+ console.warn(
227
+ 'Warning: No package.json found in the cloned country config repository. Project name was not updated.'
228
+ )
76
229
  }
77
230
 
78
- console.log('\nScaffolding OpenCRVS infrastructure in ./' + infrastructureDirName + '...\n')
231
+ console.log(
232
+ '\nScaffolding OpenCRVS infrastructure in ./' +
233
+ infrastructureDirName +
234
+ '...\n'
235
+ )
79
236
 
80
237
  try {
81
- execSync('git clone --depth 1 ' + INFRASTRUCTURE_REPO_URL + ' ' + infrastructureDirName, { stdio: 'inherit' })
238
+ cloneRepository(INFRASTRUCTURE_REPO_URL, ref, infrastructureDirName)
82
239
  } catch (err) {
83
240
  console.error('Failed to clone the infrastructure repository:', err.message)
84
241
  process.exit(1)
85
242
  }
86
243
 
87
244
  try {
88
- fs.rmSync(path.join(infrastructureTargetDir, '.git'), { recursive: true, force: true })
245
+ fs.rmSync(path.join(infrastructureTargetDir, '.git'), {
246
+ recursive: true,
247
+ force: true
248
+ })
89
249
  } catch (err) {
90
- console.error('Failed to remove .git directory from infrastructure:', err.message)
250
+ console.error(
251
+ 'Failed to remove .git directory from infrastructure:',
252
+ err.message
253
+ )
91
254
  process.exit(1)
92
255
  }
93
256
 
@@ -8284,6 +8284,10 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
8284
8284
  input: {
8285
8285
  name: string;
8286
8286
  scopes: string[];
8287
+ credentials?: {
8288
+ clientId: string;
8289
+ clientSecret: string;
8290
+ } | undefined;
8287
8291
  };
8288
8292
  output: {
8289
8293
  clientId: string;
@@ -8314,7 +8318,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
8314
8318
  scopes: string[];
8315
8319
  status: string;
8316
8320
  createdAt: string;
8317
- createdBy: string & import("zod").$brand<"UUID">;
8321
+ createdBy: (string & import("zod").$brand<"UUID">) | null;
8318
8322
  }[];
8319
8323
  meta: import("trpc-to-openapi").OpenApiMeta;
8320
8324
  }>;
@@ -8329,7 +8333,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
8329
8333
  status: string;
8330
8334
  shaSecret: string | null;
8331
8335
  createdAt: string;
8332
- createdBy: string & import("zod").$brand<"UUID">;
8336
+ createdBy: (string & import("zod").$brand<"UUID">) | null;
8333
8337
  };
8334
8338
  meta: import("trpc-to-openapi").OpenApiMeta;
8335
8339
  }>;
@@ -214,6 +214,7 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
214
214
  id: z.ZodString;
215
215
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
216
216
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
217
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
217
218
  fields: z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
218
219
  conditional: z.ZodOptional<z.ZodAny>;
219
220
  type: z.ZodDefault<z.ZodLiteral<"FORM">>;
@@ -221,6 +222,7 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
221
222
  id: z.ZodString;
222
223
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
223
224
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
225
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
224
226
  fields: z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
225
227
  conditional: z.ZodOptional<z.ZodAny>;
226
228
  type: z.ZodLiteral<"VERIFICATION">;
@@ -270,6 +272,7 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
270
272
  id: z.ZodString;
271
273
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
272
274
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
275
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
273
276
  fields: z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
274
277
  conditional: z.ZodOptional<z.ZodAny>;
275
278
  type: z.ZodDefault<z.ZodLiteral<"FORM">>;
@@ -277,6 +280,7 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
277
280
  id: z.ZodString;
278
281
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
279
282
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
283
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
280
284
  fields: z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
281
285
  conditional: z.ZodOptional<z.ZodAny>;
282
286
  type: z.ZodLiteral<"VERIFICATION">;
@@ -5,6 +5,7 @@ export declare const DeclarationFormConfig: z.ZodObject<{
5
5
  id: z.ZodString;
6
6
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
7
7
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
8
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
8
9
  fields: z.ZodArray<z.ZodType<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
9
10
  conditional: z.ZodOptional<z.ZodAny>;
10
11
  type: z.ZodDefault<z.ZodLiteral<"FORM">>;
@@ -18,6 +19,7 @@ export declare const ActionFormConfig: z.ZodObject<{
18
19
  id: z.ZodString;
19
20
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
20
21
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
22
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
21
23
  fields: z.ZodArray<z.ZodType<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
22
24
  conditional: z.ZodOptional<z.ZodAny>;
23
25
  type: z.ZodDefault<z.ZodLiteral<"FORM">>;
@@ -25,6 +27,7 @@ export declare const ActionFormConfig: z.ZodObject<{
25
27
  id: z.ZodString;
26
28
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
27
29
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
30
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
28
31
  fields: z.ZodArray<z.ZodType<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
29
32
  conditional: z.ZodOptional<z.ZodAny>;
30
33
  type: z.ZodLiteral<"VERIFICATION">;
@@ -50,6 +53,7 @@ export declare const FormConfig: z.ZodUnion<readonly [z.ZodObject<{
50
53
  id: z.ZodString;
51
54
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
52
55
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
56
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
53
57
  fields: z.ZodArray<z.ZodType<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
54
58
  conditional: z.ZodOptional<z.ZodAny>;
55
59
  type: z.ZodDefault<z.ZodLiteral<"FORM">>;
@@ -60,6 +64,7 @@ export declare const FormConfig: z.ZodUnion<readonly [z.ZodObject<{
60
64
  id: z.ZodString;
61
65
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
62
66
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
67
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
63
68
  fields: z.ZodArray<z.ZodType<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
64
69
  conditional: z.ZodOptional<z.ZodAny>;
65
70
  type: z.ZodDefault<z.ZodLiteral<"FORM">>;
@@ -67,6 +72,7 @@ export declare const FormConfig: z.ZodUnion<readonly [z.ZodObject<{
67
72
  id: z.ZodString;
68
73
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
69
74
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
75
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
70
76
  fields: z.ZodArray<z.ZodType<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
71
77
  conditional: z.ZodOptional<z.ZodAny>;
72
78
  type: z.ZodLiteral<"VERIFICATION">;
@@ -9,6 +9,7 @@ export declare const FormPageConfig: z.ZodObject<{
9
9
  id: z.ZodString;
10
10
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
11
11
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
12
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
12
13
  fields: z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
13
14
  conditional: z.ZodOptional<z.ZodAny>;
14
15
  type: z.ZodDefault<z.ZodLiteral<"FORM">>;
@@ -31,6 +32,7 @@ export declare const VerificationPageConfig: z.ZodObject<{
31
32
  id: z.ZodString;
32
33
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
33
34
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
35
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
34
36
  fields: z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
35
37
  conditional: z.ZodOptional<z.ZodAny>;
36
38
  type: z.ZodLiteral<"VERIFICATION">;
@@ -52,6 +54,7 @@ export declare const PageConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
52
54
  id: z.ZodString;
53
55
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
54
56
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
57
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
55
58
  fields: z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
56
59
  conditional: z.ZodOptional<z.ZodAny>;
57
60
  type: z.ZodDefault<z.ZodLiteral<"FORM">>;
@@ -59,6 +62,7 @@ export declare const PageConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
59
62
  id: z.ZodString;
60
63
  title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
61
64
  requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
65
+ showClearButton: z.ZodOptional<z.ZodBoolean>;
62
66
  fields: z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
63
67
  conditional: z.ZodOptional<z.ZodAny>;
64
68
  type: z.ZodLiteral<"VERIFICATION">;
@@ -22,6 +22,7 @@ export declare function getDeclarationPages(configuration: EventConfig): {
22
22
  requireCompletionToContinue: boolean;
23
23
  fields: FieldConfig[];
24
24
  type: "FORM";
25
+ showClearButton?: boolean | undefined;
25
26
  conditional?: any;
26
27
  }[];
27
28
  export declare function getDeclaration(configuration: EventConfig): {
@@ -40,6 +41,7 @@ export declare function getDeclaration(configuration: EventConfig): {
40
41
  requireCompletionToContinue: boolean;
41
42
  fields: FieldConfig[];
42
43
  type: "FORM";
44
+ showClearButton?: boolean | undefined;
43
45
  conditional?: any;
44
46
  }[];
45
47
  };
@@ -60,6 +62,7 @@ export declare function getPrintCertificatePages(configuration: EventConfig): ({
60
62
  requireCompletionToContinue: boolean;
61
63
  fields: FieldConfig[];
62
64
  type: "FORM";
65
+ showClearButton?: boolean | undefined;
63
66
  conditional?: any;
64
67
  } | {
65
68
  id: string;
@@ -99,6 +102,7 @@ export declare function getPrintCertificatePages(configuration: EventConfig): ({
99
102
  };
100
103
  };
101
104
  };
105
+ showClearButton?: boolean | undefined;
102
106
  conditional?: any;
103
107
  })[];
104
108
  export declare const getActionAnnotationFields: (actionConfig: ActionConfig) => FieldConfig[];
@@ -3046,6 +3046,9 @@ var PageConfigBase = z21.object({
3046
3046
  requireCompletionToContinue: z21.boolean().default(false).describe(
3047
3047
  "If true, all required fields must be filled before continuing to the next page"
3048
3048
  ),
3049
+ showClearButton: z21.boolean().optional().describe(
3050
+ 'If true, a "Clear" button is shown at the top of the page allowing the user to reset all fields on the page to their default state'
3051
+ ),
3049
3052
  fields: z21.array(FieldConfig).describe("Fields to be rendered on the page"),
3050
3053
  conditional: Conditional.optional().describe(
3051
3054
  "Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
@@ -7762,6 +7765,7 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
7762
7765
  defaultMessage: "Who is applying for the membership?",
7763
7766
  description: "This is the title of the section"
7764
7767
  },
7768
+ showClearButton: true,
7765
7769
  fields: [
7766
7770
  {
7767
7771
  id: "applicant.name",
@@ -2503,6 +2503,9 @@ var PageConfigBase = z21.object({
2503
2503
  requireCompletionToContinue: z21.boolean().default(false).describe(
2504
2504
  "If true, all required fields must be filled before continuing to the next page"
2505
2505
  ),
2506
+ showClearButton: z21.boolean().optional().describe(
2507
+ 'If true, a "Clear" button is shown at the top of the page allowing the user to reset all fields on the page to their default state'
2508
+ ),
2506
2509
  fields: z21.array(FieldConfig).describe("Fields to be rendered on the page"),
2507
2510
  conditional: Conditional.optional().describe(
2508
2511
  "Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
@@ -5534,6 +5537,7 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
5534
5537
  defaultMessage: "Who is applying for the membership?",
5535
5538
  description: "This is the title of the section"
5536
5539
  },
5540
+ showClearButton: true,
5537
5541
  fields: [
5538
5542
  {
5539
5543
  id: "applicant.name",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencrvs/toolkit",
3
- "version": "2.0.1-rc.f9085cb",
3
+ "version": "2.0.1-rc.fa20c7e",
4
4
  "description": "OpenCRVS toolkit for building country configurations",
5
5
  "license": "MPL-2.0",
6
6
  "bin": {