@opencrvs/toolkit 2.0.1-rc.68eb027 → 2.0.1-rc.6acf897
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/create-countryconfig/index.js +177 -14
- package/dist/application-config/index.js +1 -3
- package/dist/cli.js +1 -3
- package/dist/commons/api/router.d.ts +23 -0
- package/dist/commons/events/ActionConfig.d.ts +0 -4
- package/dist/commons/events/FormConfig.d.ts +0 -6
- package/dist/commons/events/PageConfig.d.ts +0 -4
- package/dist/commons/events/utils.d.ts +0 -4
- package/dist/conditionals/index.js +1 -3
- package/dist/events/index.js +1 -7
- package/dist/migrations/v2.0/index.js +1 -3
- package/dist/notification/index.js +1 -7
- package/dist/scopes/index.js +1 -3
- package/opencrvs-toolkit-2.0.1-rc.6acf897.tgz +0 -0
- package/package.json +1 -1
- package/opencrvs-toolkit-2.0.1-rc.68eb027.tgz +0 -0
|
@@ -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
|
-
|
|
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(
|
|
170
|
+
const infrastructureTargetDir = path.resolve(
|
|
171
|
+
process.cwd(),
|
|
172
|
+
infrastructureDirName
|
|
173
|
+
)
|
|
37
174
|
|
|
38
175
|
if (fs.existsSync(countryconfigTargetDir)) {
|
|
39
|
-
console.error(
|
|
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(
|
|
183
|
+
console.error(
|
|
184
|
+
'Error: Directory "' + infrastructureDirName + '" already exists.'
|
|
185
|
+
)
|
|
45
186
|
process.exit(1)
|
|
46
187
|
}
|
|
47
188
|
|
|
48
|
-
|
|
189
|
+
const ref = resolveRef()
|
|
190
|
+
|
|
191
|
+
console.log(
|
|
192
|
+
'\nScaffolding OpenCRVS country config in ./' + countryconfigDirName + '...\n'
|
|
193
|
+
)
|
|
49
194
|
|
|
50
195
|
try {
|
|
51
|
-
|
|
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'), {
|
|
203
|
+
fs.rmSync(path.join(countryconfigTargetDir, '.git'), {
|
|
204
|
+
recursive: true,
|
|
205
|
+
force: true
|
|
206
|
+
})
|
|
59
207
|
} catch (err) {
|
|
60
|
-
console.error(
|
|
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(
|
|
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(
|
|
231
|
+
console.log(
|
|
232
|
+
'\nScaffolding OpenCRVS infrastructure in ./' +
|
|
233
|
+
infrastructureDirName +
|
|
234
|
+
'...\n'
|
|
235
|
+
)
|
|
79
236
|
|
|
80
237
|
try {
|
|
81
|
-
|
|
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'), {
|
|
245
|
+
fs.rmSync(path.join(infrastructureTargetDir, '.git'), {
|
|
246
|
+
recursive: true,
|
|
247
|
+
force: true
|
|
248
|
+
})
|
|
89
249
|
} catch (err) {
|
|
90
|
-
console.error(
|
|
250
|
+
console.error(
|
|
251
|
+
'Failed to remove .git directory from infrastructure:',
|
|
252
|
+
err.message
|
|
253
|
+
)
|
|
91
254
|
process.exit(1)
|
|
92
255
|
}
|
|
93
256
|
|
|
@@ -651,9 +651,7 @@ var PlainScopeType = z11.enum([
|
|
|
651
651
|
"performance.vital-statistics-export",
|
|
652
652
|
// Scopes used exclusively by countryconfig integration token
|
|
653
653
|
"record.confirm-registration",
|
|
654
|
-
"record.reject-registration"
|
|
655
|
-
// bootstrap: allows countryconfig to register integrations on startup
|
|
656
|
-
"integration.create"
|
|
654
|
+
"record.reject-registration"
|
|
657
655
|
]);
|
|
658
656
|
var scopeByEvent = z11.preprocess(
|
|
659
657
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
package/dist/cli.js
CHANGED
|
@@ -2178,9 +2178,7 @@ var PlainScopeType = z3.enum([
|
|
|
2178
2178
|
"performance.vital-statistics-export",
|
|
2179
2179
|
// Scopes used exclusively by countryconfig integration token
|
|
2180
2180
|
"record.confirm-registration",
|
|
2181
|
-
"record.reject-registration"
|
|
2182
|
-
// bootstrap: allows countryconfig to register integrations on startup
|
|
2183
|
-
"integration.create"
|
|
2181
|
+
"record.reject-registration"
|
|
2184
2182
|
]);
|
|
2185
2183
|
var scopeByEvent = z3.preprocess(
|
|
2186
2184
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
@@ -7803,6 +7803,18 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
7803
7803
|
output: void;
|
|
7804
7804
|
meta: object;
|
|
7805
7805
|
}>;
|
|
7806
|
+
upsert: import("@trpc/server").TRPCMutationProcedure<{
|
|
7807
|
+
input: {
|
|
7808
|
+
id: string;
|
|
7809
|
+
name: string;
|
|
7810
|
+
administrativeAreaId: string | null;
|
|
7811
|
+
validUntil: string | null;
|
|
7812
|
+
locationType: string | null;
|
|
7813
|
+
externalId?: string | null | undefined;
|
|
7814
|
+
};
|
|
7815
|
+
output: void;
|
|
7816
|
+
meta: import("trpc-to-openapi").OpenApiMeta;
|
|
7817
|
+
}>;
|
|
7806
7818
|
get: import("@trpc/server").TRPCQueryProcedure<{
|
|
7807
7819
|
input: {
|
|
7808
7820
|
id: string;
|
|
@@ -8234,6 +8246,17 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
8234
8246
|
output: void;
|
|
8235
8247
|
meta: object;
|
|
8236
8248
|
}>;
|
|
8249
|
+
upsert: import("@trpc/server").TRPCMutationProcedure<{
|
|
8250
|
+
input: {
|
|
8251
|
+
id: string;
|
|
8252
|
+
name: string;
|
|
8253
|
+
parentId: string | null;
|
|
8254
|
+
validUntil: string | null;
|
|
8255
|
+
externalId?: string | null | undefined;
|
|
8256
|
+
};
|
|
8257
|
+
output: void;
|
|
8258
|
+
meta: import("trpc-to-openapi").OpenApiMeta;
|
|
8259
|
+
}>;
|
|
8237
8260
|
}>>;
|
|
8238
8261
|
integrations: import("@trpc/server").TRPCBuiltRouter<{
|
|
8239
8262
|
ctx: Partial<{
|
|
@@ -214,7 +214,6 @@ 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>;
|
|
218
217
|
fields: z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
|
|
219
218
|
conditional: z.ZodOptional<z.ZodAny>;
|
|
220
219
|
type: z.ZodDefault<z.ZodLiteral<"FORM">>;
|
|
@@ -222,7 +221,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
222
221
|
id: z.ZodString;
|
|
223
222
|
title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
224
223
|
requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
|
|
225
|
-
showClearButton: z.ZodOptional<z.ZodBoolean>;
|
|
226
224
|
fields: z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
|
|
227
225
|
conditional: z.ZodOptional<z.ZodAny>;
|
|
228
226
|
type: z.ZodLiteral<"VERIFICATION">;
|
|
@@ -272,7 +270,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
272
270
|
id: z.ZodString;
|
|
273
271
|
title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
274
272
|
requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
|
|
275
|
-
showClearButton: z.ZodOptional<z.ZodBoolean>;
|
|
276
273
|
fields: z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
|
|
277
274
|
conditional: z.ZodOptional<z.ZodAny>;
|
|
278
275
|
type: z.ZodDefault<z.ZodLiteral<"FORM">>;
|
|
@@ -280,7 +277,6 @@ export declare const ActionConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
280
277
|
id: z.ZodString;
|
|
281
278
|
title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
282
279
|
requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
|
|
283
|
-
showClearButton: z.ZodOptional<z.ZodBoolean>;
|
|
284
280
|
fields: z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
|
|
285
281
|
conditional: z.ZodOptional<z.ZodAny>;
|
|
286
282
|
type: z.ZodLiteral<"VERIFICATION">;
|
|
@@ -5,7 +5,6 @@ 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>;
|
|
9
8
|
fields: z.ZodArray<z.ZodType<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
|
|
10
9
|
conditional: z.ZodOptional<z.ZodAny>;
|
|
11
10
|
type: z.ZodDefault<z.ZodLiteral<"FORM">>;
|
|
@@ -19,7 +18,6 @@ export declare const ActionFormConfig: z.ZodObject<{
|
|
|
19
18
|
id: z.ZodString;
|
|
20
19
|
title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
21
20
|
requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
|
|
22
|
-
showClearButton: z.ZodOptional<z.ZodBoolean>;
|
|
23
21
|
fields: z.ZodArray<z.ZodType<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
|
|
24
22
|
conditional: z.ZodOptional<z.ZodAny>;
|
|
25
23
|
type: z.ZodDefault<z.ZodLiteral<"FORM">>;
|
|
@@ -27,7 +25,6 @@ export declare const ActionFormConfig: z.ZodObject<{
|
|
|
27
25
|
id: z.ZodString;
|
|
28
26
|
title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
29
27
|
requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
|
|
30
|
-
showClearButton: z.ZodOptional<z.ZodBoolean>;
|
|
31
28
|
fields: z.ZodArray<z.ZodType<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
|
|
32
29
|
conditional: z.ZodOptional<z.ZodAny>;
|
|
33
30
|
type: z.ZodLiteral<"VERIFICATION">;
|
|
@@ -53,7 +50,6 @@ export declare const FormConfig: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
53
50
|
id: z.ZodString;
|
|
54
51
|
title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
55
52
|
requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
|
|
56
|
-
showClearButton: z.ZodOptional<z.ZodBoolean>;
|
|
57
53
|
fields: z.ZodArray<z.ZodType<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
|
|
58
54
|
conditional: z.ZodOptional<z.ZodAny>;
|
|
59
55
|
type: z.ZodDefault<z.ZodLiteral<"FORM">>;
|
|
@@ -64,7 +60,6 @@ export declare const FormConfig: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
64
60
|
id: z.ZodString;
|
|
65
61
|
title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
66
62
|
requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
|
|
67
|
-
showClearButton: z.ZodOptional<z.ZodBoolean>;
|
|
68
63
|
fields: z.ZodArray<z.ZodType<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
|
|
69
64
|
conditional: z.ZodOptional<z.ZodAny>;
|
|
70
65
|
type: z.ZodDefault<z.ZodLiteral<"FORM">>;
|
|
@@ -72,7 +67,6 @@ export declare const FormConfig: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
72
67
|
id: z.ZodString;
|
|
73
68
|
title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
74
69
|
requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
|
|
75
|
-
showClearButton: z.ZodOptional<z.ZodBoolean>;
|
|
76
70
|
fields: z.ZodArray<z.ZodType<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<import("./FieldConfig").FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
|
|
77
71
|
conditional: z.ZodOptional<z.ZodAny>;
|
|
78
72
|
type: z.ZodLiteral<"VERIFICATION">;
|
|
@@ -9,7 +9,6 @@ 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>;
|
|
13
12
|
fields: z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
|
|
14
13
|
conditional: z.ZodOptional<z.ZodAny>;
|
|
15
14
|
type: z.ZodDefault<z.ZodLiteral<"FORM">>;
|
|
@@ -32,7 +31,6 @@ export declare const VerificationPageConfig: z.ZodObject<{
|
|
|
32
31
|
id: z.ZodString;
|
|
33
32
|
title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
34
33
|
requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
|
|
35
|
-
showClearButton: z.ZodOptional<z.ZodBoolean>;
|
|
36
34
|
fields: z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
|
|
37
35
|
conditional: z.ZodOptional<z.ZodAny>;
|
|
38
36
|
type: z.ZodLiteral<"VERIFICATION">;
|
|
@@ -54,7 +52,6 @@ export declare const PageConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
54
52
|
id: z.ZodString;
|
|
55
53
|
title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
56
54
|
requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
|
|
57
|
-
showClearButton: z.ZodOptional<z.ZodBoolean>;
|
|
58
55
|
fields: z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
|
|
59
56
|
conditional: z.ZodOptional<z.ZodAny>;
|
|
60
57
|
type: z.ZodDefault<z.ZodLiteral<"FORM">>;
|
|
@@ -62,7 +59,6 @@ export declare const PageConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
62
59
|
id: z.ZodString;
|
|
63
60
|
title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, z.core.$strip>;
|
|
64
61
|
requireCompletionToContinue: z.ZodDefault<z.ZodBoolean>;
|
|
65
|
-
showClearButton: z.ZodOptional<z.ZodBoolean>;
|
|
66
62
|
fields: z.ZodArray<z.ZodType<FieldConfig, import("./FieldConfig").FieldConfigInput, z.core.$ZodTypeInternals<FieldConfig, import("./FieldConfig").FieldConfigInput>>>;
|
|
67
63
|
conditional: z.ZodOptional<z.ZodAny>;
|
|
68
64
|
type: z.ZodLiteral<"VERIFICATION">;
|
|
@@ -22,7 +22,6 @@ export declare function getDeclarationPages(configuration: EventConfig): {
|
|
|
22
22
|
requireCompletionToContinue: boolean;
|
|
23
23
|
fields: FieldConfig[];
|
|
24
24
|
type: "FORM";
|
|
25
|
-
showClearButton?: boolean | undefined;
|
|
26
25
|
conditional?: any;
|
|
27
26
|
}[];
|
|
28
27
|
export declare function getDeclaration(configuration: EventConfig): {
|
|
@@ -41,7 +40,6 @@ export declare function getDeclaration(configuration: EventConfig): {
|
|
|
41
40
|
requireCompletionToContinue: boolean;
|
|
42
41
|
fields: FieldConfig[];
|
|
43
42
|
type: "FORM";
|
|
44
|
-
showClearButton?: boolean | undefined;
|
|
45
43
|
conditional?: any;
|
|
46
44
|
}[];
|
|
47
45
|
};
|
|
@@ -62,7 +60,6 @@ export declare function getPrintCertificatePages(configuration: EventConfig): ({
|
|
|
62
60
|
requireCompletionToContinue: boolean;
|
|
63
61
|
fields: FieldConfig[];
|
|
64
62
|
type: "FORM";
|
|
65
|
-
showClearButton?: boolean | undefined;
|
|
66
63
|
conditional?: any;
|
|
67
64
|
} | {
|
|
68
65
|
id: string;
|
|
@@ -102,7 +99,6 @@ export declare function getPrintCertificatePages(configuration: EventConfig): ({
|
|
|
102
99
|
};
|
|
103
100
|
};
|
|
104
101
|
};
|
|
105
|
-
showClearButton?: boolean | undefined;
|
|
106
102
|
conditional?: any;
|
|
107
103
|
})[];
|
|
108
104
|
export declare const getActionAnnotationFields: (actionConfig: ActionConfig) => FieldConfig[];
|
|
@@ -177,9 +177,7 @@ var PlainScopeType = z6.enum([
|
|
|
177
177
|
"performance.vital-statistics-export",
|
|
178
178
|
// Scopes used exclusively by countryconfig integration token
|
|
179
179
|
"record.confirm-registration",
|
|
180
|
-
"record.reject-registration"
|
|
181
|
-
// bootstrap: allows countryconfig to register integrations on startup
|
|
182
|
-
"integration.create"
|
|
180
|
+
"record.reject-registration"
|
|
183
181
|
]);
|
|
184
182
|
var scopeByEvent = z6.preprocess(
|
|
185
183
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
package/dist/events/index.js
CHANGED
|
@@ -506,9 +506,7 @@ var PlainScopeType = z2.enum([
|
|
|
506
506
|
"performance.vital-statistics-export",
|
|
507
507
|
// Scopes used exclusively by countryconfig integration token
|
|
508
508
|
"record.confirm-registration",
|
|
509
|
-
"record.reject-registration"
|
|
510
|
-
// bootstrap: allows countryconfig to register integrations on startup
|
|
511
|
-
"integration.create"
|
|
509
|
+
"record.reject-registration"
|
|
512
510
|
]);
|
|
513
511
|
var scopeByEvent = z2.preprocess(
|
|
514
512
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
@@ -3046,9 +3044,6 @@ var PageConfigBase = z21.object({
|
|
|
3046
3044
|
requireCompletionToContinue: z21.boolean().default(false).describe(
|
|
3047
3045
|
"If true, all required fields must be filled before continuing to the next page"
|
|
3048
3046
|
),
|
|
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
|
-
),
|
|
3052
3047
|
fields: z21.array(FieldConfig).describe("Fields to be rendered on the page"),
|
|
3053
3048
|
conditional: Conditional.optional().describe(
|
|
3054
3049
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
|
@@ -7765,7 +7760,6 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
|
7765
7760
|
defaultMessage: "Who is applying for the membership?",
|
|
7766
7761
|
description: "This is the title of the section"
|
|
7767
7762
|
},
|
|
7768
|
-
showClearButton: true,
|
|
7769
7763
|
fields: [
|
|
7770
7764
|
{
|
|
7771
7765
|
id: "applicant.name",
|
|
@@ -2190,9 +2190,7 @@ var PlainScopeType = z3.enum([
|
|
|
2190
2190
|
"performance.vital-statistics-export",
|
|
2191
2191
|
// Scopes used exclusively by countryconfig integration token
|
|
2192
2192
|
"record.confirm-registration",
|
|
2193
|
-
"record.reject-registration"
|
|
2194
|
-
// bootstrap: allows countryconfig to register integrations on startup
|
|
2195
|
-
"integration.create"
|
|
2193
|
+
"record.reject-registration"
|
|
2196
2194
|
]);
|
|
2197
2195
|
var scopeByEvent = z3.preprocess(
|
|
2198
2196
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
@@ -104,9 +104,7 @@ var PlainScopeType = z2.enum([
|
|
|
104
104
|
"performance.vital-statistics-export",
|
|
105
105
|
// Scopes used exclusively by countryconfig integration token
|
|
106
106
|
"record.confirm-registration",
|
|
107
|
-
"record.reject-registration"
|
|
108
|
-
// bootstrap: allows countryconfig to register integrations on startup
|
|
109
|
-
"integration.create"
|
|
107
|
+
"record.reject-registration"
|
|
110
108
|
]);
|
|
111
109
|
var scopeByEvent = z2.preprocess(
|
|
112
110
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
@@ -2503,9 +2501,6 @@ var PageConfigBase = z21.object({
|
|
|
2503
2501
|
requireCompletionToContinue: z21.boolean().default(false).describe(
|
|
2504
2502
|
"If true, all required fields must be filled before continuing to the next page"
|
|
2505
2503
|
),
|
|
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
|
-
),
|
|
2509
2504
|
fields: z21.array(FieldConfig).describe("Fields to be rendered on the page"),
|
|
2510
2505
|
conditional: Conditional.optional().describe(
|
|
2511
2506
|
"Page will be shown if condition is met. If conditional is not defined, the page will be always shown."
|
|
@@ -5537,7 +5532,6 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
|
5537
5532
|
defaultMessage: "Who is applying for the membership?",
|
|
5538
5533
|
description: "This is the title of the section"
|
|
5539
5534
|
},
|
|
5540
|
-
showClearButton: true,
|
|
5541
5535
|
fields: [
|
|
5542
5536
|
{
|
|
5543
5537
|
id: "applicant.name",
|
package/dist/scopes/index.js
CHANGED
|
@@ -135,9 +135,7 @@ var PlainScopeType = z3.enum([
|
|
|
135
135
|
"performance.vital-statistics-export",
|
|
136
136
|
// Scopes used exclusively by countryconfig integration token
|
|
137
137
|
"record.confirm-registration",
|
|
138
|
-
"record.reject-registration"
|
|
139
|
-
// bootstrap: allows countryconfig to register integrations on startup
|
|
140
|
-
"integration.create"
|
|
138
|
+
"record.reject-registration"
|
|
141
139
|
]);
|
|
142
140
|
var scopeByEvent = z3.preprocess(
|
|
143
141
|
(val) => val === void 0 ? void 0 : [val].flat(),
|
|
Binary file
|
package/package.json
CHANGED
|
Binary file
|