@opencrvs/toolkit 2.0.0-rc.a657c77 → 2.0.0-rc.a7c070e
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/application-config/index.js +12 -20
- package/dist/cli.js +93 -187
- package/dist/commons/api/router.d.ts +7 -0
- package/dist/commons/events/ActionInput.d.ts +36 -0
- package/dist/commons/events/Draft.d.ts +1 -0
- package/dist/events/index.js +13 -20
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +2 -1
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts +1 -9
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts.map +1 -1
- package/dist/migrations/v2.0/delete-infrastructure-directory.js +20 -66
- package/dist/migrations/v2.0/index.d.ts +3 -5
- package/dist/migrations/v2.0/index.d.ts.map +1 -1
- package/dist/migrations/v2.0/index.js +93 -187
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts +1 -11
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts.map +1 -1
- package/dist/migrations/v2.0/merge-infrastructure-directory.js +16 -17
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +1 -1
- package/dist/migrations/v2.0/migrate-workqueue-configs.js +59 -140
- package/dist/notification/index.js +13 -20
- package/opencrvs-toolkit-2.0.0-rc.a7c070e.tgz +0 -0
- package/package.json +1 -1
- package/opencrvs-toolkit-2.0.0-rc.a657c77.tgz +0 -0
|
@@ -6,6 +6,7 @@ export declare const BaseActionInput: z.ZodObject<{
|
|
|
6
6
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
7
7
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
8
8
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
9
10
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
10
11
|
}, z.core.$strip>;
|
|
11
12
|
export declare const RegisterActionInput: z.ZodObject<{
|
|
@@ -15,6 +16,7 @@ export declare const RegisterActionInput: z.ZodObject<{
|
|
|
15
16
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
16
17
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
17
18
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
18
20
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
19
21
|
type: z.ZodDefault<z.ZodLiteral<"REGISTER">>;
|
|
20
22
|
registrationNumber: z.ZodOptional<z.ZodString>;
|
|
@@ -27,6 +29,7 @@ export declare const NotifyActionInput: z.ZodObject<{
|
|
|
27
29
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
28
30
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
29
31
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
30
33
|
type: z.ZodDefault<z.ZodLiteral<"NOTIFY">>;
|
|
31
34
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
32
35
|
}, z.core.$strip>;
|
|
@@ -38,6 +41,7 @@ export declare const DeclareActionInput: z.ZodObject<{
|
|
|
38
41
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
39
42
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
40
43
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
44
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
41
45
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
42
46
|
type: z.ZodDefault<z.ZodLiteral<"DECLARE">>;
|
|
43
47
|
}, z.core.$strip>;
|
|
@@ -48,6 +52,7 @@ export declare const EditActionInput: z.ZodObject<{
|
|
|
48
52
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
49
53
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
50
54
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
55
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
51
56
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
52
57
|
type: z.ZodDefault<z.ZodLiteral<"EDIT">>;
|
|
53
58
|
content: z.ZodObject<{
|
|
@@ -62,6 +67,7 @@ export declare const PrintCertificateActionInput: z.ZodObject<{
|
|
|
62
67
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
63
68
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
64
69
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
70
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
65
71
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
66
72
|
type: z.ZodDefault<z.ZodLiteral<"PRINT_CERTIFICATE">>;
|
|
67
73
|
content: z.ZodOptional<z.ZodObject<{
|
|
@@ -76,6 +82,7 @@ export declare const RejectDeclarationActionInput: z.ZodObject<{
|
|
|
76
82
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
77
83
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
78
84
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
85
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
79
86
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
80
87
|
type: z.ZodDefault<z.ZodLiteral<"REJECT">>;
|
|
81
88
|
content: z.ZodObject<{
|
|
@@ -90,6 +97,7 @@ export declare const DuplicateDetectedActionInput: z.ZodObject<{
|
|
|
90
97
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
91
98
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
92
99
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
100
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
93
101
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
94
102
|
type: z.ZodDefault<z.ZodLiteral<"DUPLICATE_DETECTED">>;
|
|
95
103
|
content: z.ZodObject<{
|
|
@@ -106,6 +114,7 @@ export declare const MarkAsDuplicateActionInput: z.ZodObject<{
|
|
|
106
114
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
107
115
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
108
116
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
117
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
109
118
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
110
119
|
type: z.ZodDefault<z.ZodLiteral<"MARK_AS_DUPLICATE">>;
|
|
111
120
|
content: z.ZodOptional<z.ZodObject<{
|
|
@@ -120,6 +129,7 @@ export declare const MarkNotDuplicateActionInput: z.ZodObject<{
|
|
|
120
129
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
121
130
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
122
131
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
132
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
123
133
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
124
134
|
type: z.ZodDefault<z.ZodLiteral<"MARK_AS_NOT_DUPLICATE">>;
|
|
125
135
|
}, z.core.$strip>;
|
|
@@ -131,6 +141,7 @@ export declare const ArchiveActionInput: z.ZodObject<{
|
|
|
131
141
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
132
142
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
133
143
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
144
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
134
145
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
135
146
|
type: z.ZodDefault<z.ZodLiteral<"ARCHIVE">>;
|
|
136
147
|
content: z.ZodObject<{
|
|
@@ -145,6 +156,7 @@ export declare const AssignActionInput: z.ZodObject<{
|
|
|
145
156
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
146
157
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
147
158
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
159
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
148
160
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
149
161
|
type: z.ZodLiteral<"ASSIGN">;
|
|
150
162
|
assignedTo: z.ZodString;
|
|
@@ -157,6 +169,7 @@ export declare const UnassignActionInput: z.ZodObject<{
|
|
|
157
169
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
158
170
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
159
171
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
172
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
160
173
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
161
174
|
type: z.ZodDefault<z.ZodLiteral<"UNASSIGN">>;
|
|
162
175
|
assignedTo: z.ZodDefault<z.ZodLiteral<null>>;
|
|
@@ -169,6 +182,7 @@ export declare const RequestCorrectionActionInput: z.ZodObject<{
|
|
|
169
182
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
170
183
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
171
184
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
185
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
172
186
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
173
187
|
type: z.ZodDefault<z.ZodLiteral<"REQUEST_CORRECTION">>;
|
|
174
188
|
}, z.core.$strip>;
|
|
@@ -180,6 +194,7 @@ export declare const RejectCorrectionActionInput: z.ZodObject<{
|
|
|
180
194
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
181
195
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
182
196
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
197
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
183
198
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
184
199
|
requestId: z.ZodString;
|
|
185
200
|
type: z.ZodDefault<z.ZodLiteral<"REJECT_CORRECTION">>;
|
|
@@ -195,6 +210,7 @@ export declare const ApproveCorrectionActionInput: z.ZodObject<{
|
|
|
195
210
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
196
211
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
197
212
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
213
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
198
214
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
199
215
|
requestId: z.ZodString;
|
|
200
216
|
type: z.ZodDefault<z.ZodLiteral<"APPROVE_CORRECTION">>;
|
|
@@ -207,6 +223,7 @@ export declare const ReadActionInput: z.ZodObject<{
|
|
|
207
223
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
208
224
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
209
225
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
226
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
210
227
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
211
228
|
type: z.ZodDefault<z.ZodLiteral<"READ">>;
|
|
212
229
|
}, z.core.$strip>;
|
|
@@ -222,6 +239,7 @@ export declare const CustomActionInput: z.ZodObject<{
|
|
|
222
239
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
223
240
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
224
241
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
242
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
225
243
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
226
244
|
type: z.ZodDefault<z.ZodLiteral<"CUSTOM">>;
|
|
227
245
|
customActionType: z.ZodString;
|
|
@@ -242,6 +260,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
242
260
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
243
261
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
244
262
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
263
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
245
264
|
type: z.ZodDefault<z.ZodLiteral<"CREATE">>;
|
|
246
265
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
247
266
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -251,6 +270,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
251
270
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
252
271
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
253
272
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
273
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
254
274
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
255
275
|
type: z.ZodDefault<z.ZodLiteral<"REGISTER">>;
|
|
256
276
|
registrationNumber: z.ZodOptional<z.ZodString>;
|
|
@@ -261,6 +281,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
261
281
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
262
282
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
263
283
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
284
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
264
285
|
type: z.ZodDefault<z.ZodLiteral<"NOTIFY">>;
|
|
265
286
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
266
287
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -270,6 +291,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
270
291
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
271
292
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
272
293
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
294
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
273
295
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
274
296
|
type: z.ZodDefault<z.ZodLiteral<"DECLARE">>;
|
|
275
297
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -279,6 +301,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
279
301
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
280
302
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
281
303
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
304
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
282
305
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
283
306
|
type: z.ZodDefault<z.ZodLiteral<"REJECT">>;
|
|
284
307
|
content: z.ZodObject<{
|
|
@@ -291,6 +314,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
291
314
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
292
315
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
293
316
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
317
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
294
318
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
295
319
|
type: z.ZodDefault<z.ZodLiteral<"DUPLICATE_DETECTED">>;
|
|
296
320
|
content: z.ZodObject<{
|
|
@@ -306,6 +330,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
306
330
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
307
331
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
308
332
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
333
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
309
334
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
310
335
|
type: z.ZodDefault<z.ZodLiteral<"MARK_AS_DUPLICATE">>;
|
|
311
336
|
content: z.ZodOptional<z.ZodObject<{
|
|
@@ -318,6 +343,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
318
343
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
319
344
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
320
345
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
346
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
321
347
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
322
348
|
type: z.ZodDefault<z.ZodLiteral<"MARK_AS_NOT_DUPLICATE">>;
|
|
323
349
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -327,6 +353,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
327
353
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
328
354
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
329
355
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
356
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
330
357
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
331
358
|
type: z.ZodDefault<z.ZodLiteral<"ARCHIVE">>;
|
|
332
359
|
content: z.ZodObject<{
|
|
@@ -339,6 +366,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
339
366
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
340
367
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
341
368
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
369
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
342
370
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
343
371
|
type: z.ZodLiteral<"ASSIGN">;
|
|
344
372
|
assignedTo: z.ZodString;
|
|
@@ -349,6 +377,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
349
377
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
350
378
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
351
379
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
380
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
352
381
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
353
382
|
type: z.ZodDefault<z.ZodLiteral<"UNASSIGN">>;
|
|
354
383
|
assignedTo: z.ZodDefault<z.ZodLiteral<null>>;
|
|
@@ -359,6 +388,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
359
388
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
360
389
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
361
390
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
391
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
362
392
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
363
393
|
type: z.ZodDefault<z.ZodLiteral<"PRINT_CERTIFICATE">>;
|
|
364
394
|
content: z.ZodOptional<z.ZodObject<{
|
|
@@ -371,6 +401,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
371
401
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
372
402
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
373
403
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
404
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
374
405
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
375
406
|
type: z.ZodDefault<z.ZodLiteral<"REQUEST_CORRECTION">>;
|
|
376
407
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -380,6 +411,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
380
411
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
381
412
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
382
413
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
414
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
383
415
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
384
416
|
requestId: z.ZodString;
|
|
385
417
|
type: z.ZodDefault<z.ZodLiteral<"REJECT_CORRECTION">>;
|
|
@@ -393,6 +425,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
393
425
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
394
426
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
395
427
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
428
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
396
429
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
397
430
|
requestId: z.ZodString;
|
|
398
431
|
type: z.ZodDefault<z.ZodLiteral<"APPROVE_CORRECTION">>;
|
|
@@ -403,6 +436,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
403
436
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
404
437
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
405
438
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
439
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
406
440
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
407
441
|
type: z.ZodDefault<z.ZodLiteral<"READ">>;
|
|
408
442
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -412,6 +446,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
412
446
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
413
447
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
414
448
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
449
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
415
450
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
416
451
|
type: z.ZodDefault<z.ZodLiteral<"CUSTOM">>;
|
|
417
452
|
customActionType: z.ZodString;
|
|
@@ -422,6 +457,7 @@ export declare const ActionInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
422
457
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
423
458
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
424
459
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
460
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
425
461
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
426
462
|
type: z.ZodDefault<z.ZodLiteral<"EDIT">>;
|
|
427
463
|
content: z.ZodObject<{
|
|
@@ -51,6 +51,7 @@ export declare const DraftInput: z.ZodObject<{
|
|
|
51
51
|
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./FieldValue").FieldUpdateValue, unknown, z.core.$ZodTypeInternals<import("./FieldValue").FieldUpdateValue, unknown>>>>;
|
|
52
52
|
originalActionId: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>;
|
|
53
53
|
keepAssignment: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
+
waitFor: z.ZodOptional<z.ZodBoolean>;
|
|
54
55
|
createdAtLocation: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "UUID", "out">>>;
|
|
55
56
|
type: z.ZodEnum<{
|
|
56
57
|
CUSTOM: "CUSTOM";
|
package/dist/events/index.js
CHANGED
|
@@ -1414,28 +1414,20 @@ function schemaPriority(schema) {
|
|
|
1414
1414
|
return idx === -1 ? 9999 : idx;
|
|
1415
1415
|
}
|
|
1416
1416
|
function safeUnion(schemas) {
|
|
1417
|
+
const sortedSchemas = [...schemas].sort(
|
|
1418
|
+
(a, b) => schemaPriority(a) - schemaPriority(b)
|
|
1419
|
+
);
|
|
1417
1420
|
return z12.any().superRefine((val, ctx) => {
|
|
1418
|
-
const
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
if (successful.length === 0) {
|
|
1423
|
-
ctx.addIssue({
|
|
1424
|
-
code: "invalid_type",
|
|
1425
|
-
expected: "custom",
|
|
1426
|
-
message: "Value does not match any schema"
|
|
1427
|
-
});
|
|
1428
|
-
return;
|
|
1429
|
-
}
|
|
1430
|
-
successful.sort((a, b) => schemaPriority(a) - schemaPriority(b));
|
|
1431
|
-
const best = successful[0];
|
|
1432
|
-
if (!best.safeParse(val).success) {
|
|
1433
|
-
ctx.addIssue({
|
|
1434
|
-
expected: "custom",
|
|
1435
|
-
code: "invalid_type",
|
|
1436
|
-
message: "Value did not match the best schema"
|
|
1437
|
-
});
|
|
1421
|
+
for (const schema of sortedSchemas) {
|
|
1422
|
+
if (schema.safeParse(val).success) {
|
|
1423
|
+
return;
|
|
1424
|
+
}
|
|
1438
1425
|
}
|
|
1426
|
+
ctx.addIssue({
|
|
1427
|
+
code: "invalid_type",
|
|
1428
|
+
expected: "custom",
|
|
1429
|
+
message: "Value does not match any schema"
|
|
1430
|
+
});
|
|
1439
1431
|
}).meta({
|
|
1440
1432
|
description: "Value that matches exactly one of the possible schema types (TextValue, DateValue, DateRangeFieldValue). The best matching schema is chosen by priority."
|
|
1441
1433
|
});
|
|
@@ -5900,6 +5892,7 @@ var BaseActionInput = z38.object({
|
|
|
5900
5892
|
originalActionId: UUID.optional(),
|
|
5901
5893
|
// should not be part of base action.
|
|
5902
5894
|
keepAssignment: z38.boolean().optional(),
|
|
5895
|
+
waitFor: z38.boolean().optional(),
|
|
5903
5896
|
// For normal users, the createdAtLocation is resolved on the backend from the user's primaryOfficeId.
|
|
5904
5897
|
// @TODO: createdAtLocation should be limited to actions that system users can perform. For normal users, it should not be part of the base action.
|
|
5905
5898
|
createdAtLocation: UUID.nullish().describe(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const UPSTREAM_URL = "https://github.com/opencrvs/opencrvs-countryconfig.git";
|
|
2
|
-
export declare const UPSTREAM_BRANCH = "
|
|
2
|
+
export declare const UPSTREAM_BRANCH = "develop";
|
|
3
3
|
/**
|
|
4
4
|
* Runs a git command in the country config working directory.
|
|
5
5
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout-upstream-files.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/checkout-upstream-files.ts"],"names":[],"mappings":"AA8CA,eAAO,MAAM,YAAY,2DACiC,CAAA;
|
|
1
|
+
{"version":3,"file":"checkout-upstream-files.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/checkout-upstream-files.ts"],"names":[],"mappings":"AA8CA,eAAO,MAAM,YAAY,2DACiC,CAAA;AAG1D,eAAO,MAAM,eAAe,YAAY,CAAA;AAcxC;;;;;;GAMG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,MAAM,EAAE,EACd,EAAE,MAAc,EAAE,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GAC5C,MAAM,CAMR;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAO9C;AAED,wBAAgB,eAAe,IAAI,IAAI,CAMtC;AAID,iBAAe,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAuDnC;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
|
@@ -59,7 +59,8 @@ exports.main = main;
|
|
|
59
59
|
*/
|
|
60
60
|
const child_process_1 = require("child_process");
|
|
61
61
|
exports.UPSTREAM_URL = 'https://github.com/opencrvs/opencrvs-countryconfig.git';
|
|
62
|
-
|
|
62
|
+
// @TODO: This needs to be changed to 'release-v2.0.0' once the branch is created
|
|
63
|
+
exports.UPSTREAM_BRANCH = 'develop';
|
|
63
64
|
// Remote name used only for the duration of this codemod. Prefixed to avoid
|
|
64
65
|
// clashing with remotes the user may have (origin, upstream, etc.).
|
|
65
66
|
const TEMP_REMOTE = 'opencrvs-upgrade-v19-v20-codemod';
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Top-level entries directly under `infrastructure/` to preserve. Names
|
|
4
|
-
* match against the basename of each entry (file or directory). When
|
|
5
|
-
* empty (the default), the whole `infrastructure/` directory is deleted.
|
|
6
|
-
*/
|
|
7
|
-
keep?: string[];
|
|
8
|
-
}
|
|
9
|
-
declare function main({ keep }?: DeleteInfrastructureOptions): Promise<void>;
|
|
1
|
+
declare function main(): Promise<void>;
|
|
10
2
|
export { main };
|
|
11
3
|
//# sourceMappingURL=delete-infrastructure-directory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-infrastructure-directory.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/delete-infrastructure-directory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"delete-infrastructure-directory.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/delete-infrastructure-directory.ts"],"names":[],"mappings":"AA4CA,iBAAe,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAgCnC;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
|
@@ -27,28 +27,20 @@ exports.main = main;
|
|
|
27
27
|
* via Docker Swarm. In that case the `infrastructure/` directory shipped
|
|
28
28
|
* with opencrvs-countryconfig is no longer needed and can be removed.
|
|
29
29
|
*
|
|
30
|
-
* Some non-Swarm deployments still need a small subset of
|
|
31
|
-
* `infrastructure/` (e.g. `postgres/` and `metabase/`). Pass `keep` to
|
|
32
|
-
* preserve those top-level subdirectories — everything else under
|
|
33
|
-
* `infrastructure/` is deleted, and the kept subdirectories can then be
|
|
34
|
-
* refreshed from upstream by `merge-infrastructure-directory.ts` with the
|
|
35
|
-
* matching `subdirs` option.
|
|
36
|
-
*
|
|
37
30
|
* Usage:
|
|
38
31
|
* ts-node -r tsconfig-paths/register src/migrations/v2.0/delete-infrastructure-directory.ts
|
|
39
32
|
*
|
|
40
33
|
* What it does:
|
|
41
34
|
* 1. Stages deletion of all tracked files under `infrastructure/` via
|
|
42
|
-
* `git rm -rf --ignore-unmatch --
|
|
43
|
-
* files from the working tree and records the deletion in the
|
|
35
|
+
* `git rm -rf --ignore-unmatch -- infrastructure/`. This both removes
|
|
36
|
+
* the files from the working tree and records the deletion in the
|
|
44
37
|
* index, so it shows up in the upgrade commit alongside the other
|
|
45
|
-
* codemod changes.
|
|
46
|
-
* the top-level entries that are NOT in `keep`.
|
|
38
|
+
* codemod changes.
|
|
47
39
|
* 2. Cleans up any untracked files / empty directory that `git rm` left
|
|
48
|
-
* behind, so the
|
|
40
|
+
* behind, so the path is fully gone from the working tree.
|
|
49
41
|
*
|
|
50
42
|
* Caveats:
|
|
51
|
-
* - Destructive: any local edits to
|
|
43
|
+
* - Destructive: any local edits to `infrastructure/` are lost. Run on a
|
|
52
44
|
* clean working tree (or after committing your local changes).
|
|
53
45
|
* - If `infrastructure/` doesn't exist, this codemod is a no-op.
|
|
54
46
|
* - Requires git to be installed and the country config working directory
|
|
@@ -59,65 +51,27 @@ const path_1 = require("path");
|
|
|
59
51
|
const checkout_upstream_files_1 = require("./checkout-upstream-files");
|
|
60
52
|
const INFRASTRUCTURE_DIR = 'infrastructure';
|
|
61
53
|
function main() {
|
|
62
|
-
return __awaiter(this,
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
55
|
const fullPath = (0, path_1.join)(process.cwd(), INFRASTRUCTURE_DIR);
|
|
64
56
|
if (!(0, fs_1.existsSync)(fullPath)) {
|
|
65
57
|
console.log(`'${INFRASTRUCTURE_DIR}/' not found in ${process.cwd()} — nothing to delete.`);
|
|
66
58
|
return;
|
|
67
59
|
}
|
|
60
|
+
console.log(`Deleting '${INFRASTRUCTURE_DIR}/'...\n`);
|
|
68
61
|
(0, checkout_upstream_files_1.assertIsGitRepo)();
|
|
69
|
-
//
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
// disk; remove whatever's left so the path is fully gone.
|
|
82
|
-
if ((0, fs_1.existsSync)(fullPath)) {
|
|
83
|
-
(0, fs_1.rmSync)(fullPath, { recursive: true, force: true });
|
|
84
|
-
console.log(` Removed remaining untracked files under '${INFRASTRUCTURE_DIR}/'.`);
|
|
85
|
-
}
|
|
86
|
-
console.log(`\n Done. Review the staged deletion with: git diff --cached -- '${INFRASTRUCTURE_DIR}/'`);
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
// ─── Selective delete: keep listed top-level entries ─────────────────
|
|
90
|
-
const keepSet = new Set(keep);
|
|
91
|
-
console.log(`Deleting contents of '${INFRASTRUCTURE_DIR}/' except: ${[...keepSet]
|
|
92
|
-
.map((name) => `'${name}'`)
|
|
93
|
-
.join(', ')}\n`);
|
|
94
|
-
const topLevelEntries = (0, fs_1.readdirSync)(fullPath, { withFileTypes: true });
|
|
95
|
-
let deleted = 0;
|
|
96
|
-
for (const entry of topLevelEntries) {
|
|
97
|
-
if (keepSet.has(entry.name)) {
|
|
98
|
-
console.log(` Keeping '${INFRASTRUCTURE_DIR}/${entry.name}'.`);
|
|
99
|
-
continue;
|
|
100
|
-
}
|
|
101
|
-
// Append a trailing slash for directories so git treats it as a tree
|
|
102
|
-
// pathspec (matches the recursive behavior of `git rm -rf`).
|
|
103
|
-
const relPath = `${INFRASTRUCTURE_DIR}/${entry.name}${entry.isDirectory() ? '/' : ''}`;
|
|
104
|
-
(0, checkout_upstream_files_1.runGit)(['rm', '-rf', '--ignore-unmatch', '--', relPath], { silent: true });
|
|
105
|
-
const fullEntryPath = (0, path_1.join)(fullPath, entry.name);
|
|
106
|
-
if ((0, fs_1.existsSync)(fullEntryPath)) {
|
|
107
|
-
(0, fs_1.rmSync)(fullEntryPath, { recursive: true, force: true });
|
|
108
|
-
}
|
|
109
|
-
console.log(` Deleted '${relPath}'.`);
|
|
110
|
-
deleted++;
|
|
111
|
-
}
|
|
112
|
-
// Note any requested keeps that weren't actually present, so the dev
|
|
113
|
-
// notices typos / missing directories.
|
|
114
|
-
const presentNames = new Set(topLevelEntries.map((e) => e.name));
|
|
115
|
-
const missingKeeps = [...keepSet].filter((name) => !presentNames.has(name));
|
|
116
|
-
if (missingKeeps.length > 0) {
|
|
117
|
-
console.warn(` [warn] Requested to keep ${missingKeeps
|
|
118
|
-
.map((n) => `'${n}'`)
|
|
119
|
-
.join(', ')} but they don't exist under '${INFRASTRUCTURE_DIR}/'.`);
|
|
62
|
+
// `git rm -rf --ignore-unmatch` removes tracked files (working tree + index)
|
|
63
|
+
// and is a no-op for paths with no tracked entries, so it's safe to run
|
|
64
|
+
// even when `infrastructure/` exists only as untracked files.
|
|
65
|
+
(0, checkout_upstream_files_1.runGit)(['rm', '-rf', '--ignore-unmatch', '--', `${INFRASTRUCTURE_DIR}/`], {
|
|
66
|
+
silent: true
|
|
67
|
+
});
|
|
68
|
+
console.log(` Staged deletion of tracked files under '${INFRASTRUCTURE_DIR}/'.`);
|
|
69
|
+
// `git rm` leaves untracked files (and any now-empty directory) on disk;
|
|
70
|
+
// remove whatever's left so the path is fully gone.
|
|
71
|
+
if ((0, fs_1.existsSync)(fullPath)) {
|
|
72
|
+
(0, fs_1.rmSync)(fullPath, { recursive: true, force: true });
|
|
73
|
+
console.log(` Removed remaining untracked files under '${INFRASTRUCTURE_DIR}/'.`);
|
|
120
74
|
}
|
|
121
|
-
console.log(`\n Done.
|
|
75
|
+
console.log(`\n Done. Review the staged deletion with: git diff --cached -- '${INFRASTRUCTURE_DIR}/'`);
|
|
122
76
|
});
|
|
123
77
|
}
|
|
@@ -3,11 +3,9 @@
|
|
|
3
3
|
* directory.
|
|
4
4
|
*
|
|
5
5
|
* @param dockerSwarm - When true, the local `infrastructure/` directory is
|
|
6
|
-
* merged with upstream changes
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `NON_SWARM_INFRA_SUBDIRS`, and those preserved subdirectories are then
|
|
10
|
-
* merged with upstream.
|
|
6
|
+
* merged with upstream changes (Docker Swarm deployments still need it).
|
|
7
|
+
* When false (the default), `infrastructure/` is deleted entirely, since
|
|
8
|
+
* non-Swarm deployments no longer ship it.
|
|
11
9
|
*/
|
|
12
10
|
export declare function runUpgrade(dockerSwarm: boolean): Promise<void>;
|
|
13
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migrations/v2.0/index.ts"],"names":[],"mappings":"AAqCA;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAAC,WAAW,EAAE,OAAO,iBA+BpD"}
|