@opencrvs/toolkit 1.8.0-rc.ffe8c17 → 1.8.1-rc.a372970

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.
Files changed (33) hide show
  1. package/README.md +1 -1
  2. package/dist/commons/api/router.d.ts +6644 -9555
  3. package/dist/commons/conditionals/conditionals.d.ts +26 -3
  4. package/dist/commons/conditionals/validate-address.test.d.ts +2 -0
  5. package/dist/commons/conditionals/validate.d.ts +14 -17
  6. package/dist/commons/events/ActionConfig.d.ts +1008 -3209
  7. package/dist/commons/events/ActionDocument.d.ts +9488 -312
  8. package/dist/commons/events/ActionInput.d.ts +5329 -472
  9. package/dist/commons/events/ActionType.d.ts +26 -11
  10. package/dist/commons/events/CompositeFieldValue.d.ts +152 -2
  11. package/dist/commons/events/Conditional.d.ts +21 -5
  12. package/dist/commons/events/Draft.d.ts +351 -48
  13. package/dist/commons/events/EventConfig.d.ts +639 -2862
  14. package/dist/commons/events/EventConfigInput.d.ts +6 -3
  15. package/dist/commons/events/EventDocument.d.ts +3340 -424
  16. package/dist/commons/events/EventIndex.d.ts +6 -3
  17. package/dist/commons/events/EventMetadata.d.ts +3 -0
  18. package/dist/commons/events/FieldConfig.d.ts +383 -104
  19. package/dist/commons/events/FieldTypeMapping.d.ts +104 -207
  20. package/dist/commons/events/FieldValue.d.ts +71 -76
  21. package/dist/commons/events/FormConfig.d.ts +527 -279
  22. package/dist/commons/events/PageConfig.d.ts +335 -0
  23. package/dist/commons/events/TemplateConfig.d.ts +5 -5
  24. package/dist/commons/events/defineConfig.d.ts +40 -417
  25. package/dist/commons/events/index.d.ts +2 -1
  26. package/dist/commons/events/test.utils.d.ts +140 -213
  27. package/dist/commons/events/utils.d.ts +126 -156
  28. package/dist/commons/events/utils.test.d.ts +2 -0
  29. package/dist/conditionals/index.js +166 -81
  30. package/dist/events/index.js +1287 -795
  31. package/dist/scopes/index.d.ts +70 -1
  32. package/dist/scopes/index.js +130 -0
  33. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { AddressField, AdministrativeArea, BulletList, Checkbox, Country, DateField, Divider, Facility, EmailField, FieldConfig, File, FileUploadWithOptions, Location, Office, PageHeader, Paragraph, RadioGroup, SelectField, SignatureField, TextAreaField, TextField, NumberField, Data } from './FieldConfig';
2
+ import { AddressField, AdministrativeArea, BulletList, Checkbox, Country, DateField, Divider, Facility, EmailField, FieldConfig, File, FileUploadWithOptions, Location, Office, PageHeader, Paragraph, RadioGroup, SelectField, SignatureField, TextAreaField, TextField, NumberField, DataField } from './FieldConfig';
3
3
  import { FieldType } from './FieldType';
4
4
  import { FieldValue, FieldUpdateValueSchema } from './FieldValue';
5
5
  import { AddressFieldValue, FileFieldValue, FileFieldWithOptionValue } from './CompositeFieldValue';
@@ -42,8 +42,9 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
42
42
  type: string;
43
43
  filename: string;
44
44
  originalFilename: string;
45
- }>>> | z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
45
+ }>>> | z.ZodUnion<[z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
46
46
  country: z.ZodString;
47
+ addressType: z.ZodLiteral<"DOMESTIC">;
47
48
  province: z.ZodString;
48
49
  district: z.ZodString;
49
50
  }, {
@@ -56,6 +57,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
56
57
  }>, "strip", z.ZodTypeAny, {
57
58
  country: string;
58
59
  district: string;
60
+ addressType: "DOMESTIC";
59
61
  province: string;
60
62
  urbanOrRural: "URBAN";
61
63
  number?: string | null | undefined;
@@ -66,6 +68,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
66
68
  }, {
67
69
  country: string;
68
70
  district: string;
71
+ addressType: "DOMESTIC";
69
72
  province: string;
70
73
  urbanOrRural: "URBAN";
71
74
  number?: string | null | undefined;
@@ -75,6 +78,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
75
78
  zipCode?: string | null | undefined;
76
79
  }>, z.ZodObject<z.objectUtil.extendShape<{
77
80
  country: z.ZodString;
81
+ addressType: z.ZodLiteral<"DOMESTIC">;
78
82
  province: z.ZodString;
79
83
  district: z.ZodString;
80
84
  }, {
@@ -83,58 +87,48 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
83
87
  }>, "strip", z.ZodTypeAny, {
84
88
  country: string;
85
89
  district: string;
90
+ addressType: "DOMESTIC";
86
91
  province: string;
87
92
  urbanOrRural: "RURAL";
88
93
  village?: string | null | undefined;
89
94
  }, {
90
95
  country: string;
91
96
  district: string;
97
+ addressType: "DOMESTIC";
92
98
  province: string;
93
99
  urbanOrRural: "RURAL";
94
100
  village?: string | null | undefined;
95
- }>]> | z.ZodArray<z.ZodObject<{
96
- filename: z.ZodString;
97
- originalFilename: z.ZodString;
98
- type: z.ZodString;
99
- option: z.ZodString;
100
- }, "strip", z.ZodTypeAny, {
101
- type: string;
102
- option: string;
103
- filename: string;
104
- originalFilename: string;
105
- }, {
106
- type: string;
107
- option: string;
108
- filename: string;
109
- originalFilename: string;
110
- }>, "many"> | z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
111
- filename: z.ZodString;
112
- originalFilename: z.ZodString;
113
- type: z.ZodString;
114
- option: z.ZodString;
115
- }, "strip", z.ZodTypeAny, {
116
- type: string;
117
- option: string;
118
- filename: string;
119
- originalFilename: string;
120
- }, {
121
- type: string;
122
- option: string;
123
- filename: string;
124
- originalFilename: string;
125
- }>, "many">>> | z.ZodBoolean | z.ZodOptional<z.ZodNullable<z.ZodBoolean>> | z.ZodNumber | z.ZodOptional<z.ZodNullable<z.ZodNumber>> | z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
126
- filename: z.ZodString;
127
- originalFilename: z.ZodString;
128
- type: z.ZodString;
101
+ }>]>, z.ZodObject<{
102
+ country: z.ZodString;
103
+ addressType: z.ZodLiteral<"INTERNATIONAL">;
104
+ state: z.ZodString;
105
+ district2: z.ZodString;
106
+ cityOrTown: z.ZodOptional<z.ZodNullable<z.ZodString>>;
107
+ addressLine1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
108
+ addressLine2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
109
+ addressLine3: z.ZodOptional<z.ZodNullable<z.ZodString>>;
110
+ postcodeOrZip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
129
111
  }, "strip", z.ZodTypeAny, {
130
- type: string;
131
- filename: string;
132
- originalFilename: string;
112
+ country: string;
113
+ state: string;
114
+ addressType: "INTERNATIONAL";
115
+ district2: string;
116
+ cityOrTown?: string | null | undefined;
117
+ addressLine1?: string | null | undefined;
118
+ addressLine2?: string | null | undefined;
119
+ addressLine3?: string | null | undefined;
120
+ postcodeOrZip?: string | null | undefined;
133
121
  }, {
134
- type: string;
135
- filename: string;
136
- originalFilename: string;
137
- }>, z.ZodArray<z.ZodObject<{
122
+ country: string;
123
+ state: string;
124
+ addressType: "INTERNATIONAL";
125
+ district2: string;
126
+ cityOrTown?: string | null | undefined;
127
+ addressLine1?: string | null | undefined;
128
+ addressLine2?: string | null | undefined;
129
+ addressLine3?: string | null | undefined;
130
+ postcodeOrZip?: string | null | undefined;
131
+ }>]> | z.ZodArray<z.ZodObject<{
138
132
  filename: z.ZodString;
139
133
  originalFilename: z.ZodString;
140
134
  type: z.ZodString;
@@ -149,69 +143,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
149
143
  option: string;
150
144
  filename: string;
151
145
  originalFilename: string;
152
- }>, "many">, z.ZodObject<z.objectUtil.extendShape<{
153
- country: z.ZodString;
154
- province: z.ZodString;
155
- district: z.ZodString;
156
- }, {
157
- urbanOrRural: z.ZodLiteral<"URBAN">;
158
- town: z.ZodOptional<z.ZodString>;
159
- residentialArea: z.ZodOptional<z.ZodString>;
160
- street: z.ZodOptional<z.ZodString>;
161
- number: z.ZodOptional<z.ZodString>;
162
- zipCode: z.ZodOptional<z.ZodString>;
163
- }>, "strip", z.ZodTypeAny, {
164
- country: string;
165
- district: string;
166
- province: string;
167
- urbanOrRural: "URBAN";
168
- number?: string | undefined;
169
- town?: string | undefined;
170
- residentialArea?: string | undefined;
171
- street?: string | undefined;
172
- zipCode?: string | undefined;
173
- }, {
174
- country: string;
175
- district: string;
176
- province: string;
177
- urbanOrRural: "URBAN";
178
- number?: string | undefined;
179
- town?: string | undefined;
180
- residentialArea?: string | undefined;
181
- street?: string | undefined;
182
- zipCode?: string | undefined;
183
- }>, z.ZodObject<z.objectUtil.extendShape<{
184
- country: z.ZodString;
185
- province: z.ZodString;
186
- district: z.ZodString;
187
- }, {
188
- urbanOrRural: z.ZodLiteral<"RURAL">;
189
- village: z.ZodOptional<z.ZodString>;
190
- }>, "strip", z.ZodTypeAny, {
191
- country: string;
192
- district: string;
193
- province: string;
194
- urbanOrRural: "RURAL";
195
- village?: string | undefined;
196
- }, {
197
- country: string;
198
- district: string;
199
- province: string;
200
- urbanOrRural: "RURAL";
201
- village?: string | undefined;
202
- }>]>> | z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{
203
- filename: z.ZodString;
204
- originalFilename: z.ZodString;
205
- type: z.ZodString;
206
- }, "strip", z.ZodTypeAny, {
207
- type: string;
208
- filename: string;
209
- originalFilename: string;
210
- }, {
211
- type: string;
212
- filename: string;
213
- originalFilename: string;
214
- }>, z.ZodArray<z.ZodObject<{
146
+ }>, "many"> | z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
215
147
  filename: z.ZodString;
216
148
  originalFilename: z.ZodString;
217
149
  type: z.ZodString;
@@ -226,58 +158,9 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
226
158
  option: string;
227
159
  filename: string;
228
160
  originalFilename: string;
229
- }>, "many">, z.ZodObject<z.objectUtil.extendShape<{
230
- country: z.ZodString;
231
- province: z.ZodString;
232
- district: z.ZodString;
233
- }, {
234
- urbanOrRural: z.ZodLiteral<"URBAN">;
235
- town: z.ZodOptional<z.ZodString>;
236
- residentialArea: z.ZodOptional<z.ZodString>;
237
- street: z.ZodOptional<z.ZodString>;
238
- number: z.ZodOptional<z.ZodString>;
239
- zipCode: z.ZodOptional<z.ZodString>;
240
- }>, "strip", z.ZodTypeAny, {
241
- country: string;
242
- district: string;
243
- province: string;
244
- urbanOrRural: "URBAN";
245
- number?: string | undefined;
246
- town?: string | undefined;
247
- residentialArea?: string | undefined;
248
- street?: string | undefined;
249
- zipCode?: string | undefined;
250
- }, {
251
- country: string;
252
- district: string;
253
- province: string;
254
- urbanOrRural: "URBAN";
255
- number?: string | undefined;
256
- town?: string | undefined;
257
- residentialArea?: string | undefined;
258
- street?: string | undefined;
259
- zipCode?: string | undefined;
260
- }>, z.ZodObject<z.objectUtil.extendShape<{
261
- country: z.ZodString;
262
- province: z.ZodString;
263
- district: z.ZodString;
264
- }, {
265
- urbanOrRural: z.ZodLiteral<"RURAL">;
266
- village: z.ZodOptional<z.ZodString>;
267
- }>, "strip", z.ZodTypeAny, {
268
- country: string;
269
- district: string;
270
- province: string;
271
- urbanOrRural: "RURAL";
272
- village?: string | undefined;
273
- }, {
274
- country: string;
275
- district: string;
276
- province: string;
277
- urbanOrRural: "RURAL";
278
- village?: string | undefined;
279
- }>]>>>> | z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
161
+ }>, "many">>> | z.ZodBoolean | z.ZodOptional<z.ZodNullable<z.ZodBoolean>> | z.ZodNumber | z.ZodOptional<z.ZodNullable<z.ZodNumber>> | z.ZodUndefined | z.ZodOptional<z.ZodNullable<z.ZodUndefined>> | z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{
280
162
  country: z.ZodString;
163
+ addressType: z.ZodLiteral<"DOMESTIC">;
281
164
  province: z.ZodString;
282
165
  district: z.ZodString;
283
166
  }, {
@@ -290,6 +173,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
290
173
  }>, "strip", z.ZodTypeAny, {
291
174
  country: string;
292
175
  district: string;
176
+ addressType: "DOMESTIC";
293
177
  province: string;
294
178
  urbanOrRural: "URBAN";
295
179
  number?: string | null | undefined;
@@ -300,6 +184,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
300
184
  }, {
301
185
  country: string;
302
186
  district: string;
187
+ addressType: "DOMESTIC";
303
188
  province: string;
304
189
  urbanOrRural: "URBAN";
305
190
  number?: string | null | undefined;
@@ -309,6 +194,7 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
309
194
  zipCode?: string | null | undefined;
310
195
  }>, z.ZodObject<z.objectUtil.extendShape<{
311
196
  country: z.ZodString;
197
+ addressType: z.ZodLiteral<"DOMESTIC">;
312
198
  province: z.ZodString;
313
199
  district: z.ZodString;
314
200
  }, {
@@ -317,15 +203,47 @@ export declare function mapFieldTypeToZod(type: FieldType, required?: boolean):
317
203
  }>, "strip", z.ZodTypeAny, {
318
204
  country: string;
319
205
  district: string;
206
+ addressType: "DOMESTIC";
320
207
  province: string;
321
208
  urbanOrRural: "RURAL";
322
209
  village?: string | null | undefined;
323
210
  }, {
324
211
  country: string;
325
212
  district: string;
213
+ addressType: "DOMESTIC";
326
214
  province: string;
327
215
  urbanOrRural: "RURAL";
328
216
  village?: string | null | undefined;
217
+ }>]>, z.ZodObject<{
218
+ country: z.ZodString;
219
+ addressType: z.ZodLiteral<"INTERNATIONAL">;
220
+ state: z.ZodString;
221
+ district2: z.ZodString;
222
+ cityOrTown: z.ZodOptional<z.ZodNullable<z.ZodString>>;
223
+ addressLine1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
224
+ addressLine2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
225
+ addressLine3: z.ZodOptional<z.ZodNullable<z.ZodString>>;
226
+ postcodeOrZip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
227
+ }, "strip", z.ZodTypeAny, {
228
+ country: string;
229
+ state: string;
230
+ addressType: "INTERNATIONAL";
231
+ district2: string;
232
+ cityOrTown?: string | null | undefined;
233
+ addressLine1?: string | null | undefined;
234
+ addressLine2?: string | null | undefined;
235
+ addressLine3?: string | null | undefined;
236
+ postcodeOrZip?: string | null | undefined;
237
+ }, {
238
+ country: string;
239
+ state: string;
240
+ addressType: "INTERNATIONAL";
241
+ district2: string;
242
+ cityOrTown?: string | null | undefined;
243
+ addressLine1?: string | null | undefined;
244
+ addressLine2?: string | null | undefined;
245
+ addressLine3?: string | null | undefined;
246
+ postcodeOrZip?: string | null | undefined;
329
247
  }>]>>>;
330
248
  export declare function createValidationSchema(config: FieldConfig[]): z.ZodObject<Record<string, FieldUpdateValueSchema | NullishFieldValueSchema>, "strip", z.ZodTypeAny, {
331
249
  [x: string]: string | number | boolean | {
@@ -335,6 +253,7 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
335
253
  } | {
336
254
  country: string;
337
255
  district: string;
256
+ addressType: "DOMESTIC";
338
257
  province: string;
339
258
  urbanOrRural: "URBAN";
340
259
  number?: string | null | undefined;
@@ -345,40 +264,26 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
345
264
  } | {
346
265
  country: string;
347
266
  district: string;
267
+ addressType: "DOMESTIC";
348
268
  province: string;
349
269
  urbanOrRural: "RURAL";
350
270
  village?: string | null | undefined;
351
- } | {
352
- type: string;
353
- option: string;
354
- filename: string;
355
- originalFilename: string;
356
- }[] | Record<string, string | number | boolean | {
357
- type: string;
358
- filename: string;
359
- originalFilename: string;
360
- } | {
361
- country: string;
362
- district: string;
363
- province: string;
364
- urbanOrRural: "URBAN";
365
- number?: string | undefined;
366
- town?: string | undefined;
367
- residentialArea?: string | undefined;
368
- street?: string | undefined;
369
- zipCode?: string | undefined;
370
271
  } | {
371
272
  country: string;
372
- district: string;
373
- province: string;
374
- urbanOrRural: "RURAL";
375
- village?: string | undefined;
273
+ state: string;
274
+ addressType: "INTERNATIONAL";
275
+ district2: string;
276
+ cityOrTown?: string | null | undefined;
277
+ addressLine1?: string | null | undefined;
278
+ addressLine2?: string | null | undefined;
279
+ addressLine3?: string | null | undefined;
280
+ postcodeOrZip?: string | null | undefined;
376
281
  } | {
377
282
  type: string;
378
283
  option: string;
379
284
  filename: string;
380
285
  originalFilename: string;
381
- }[]> | null | undefined;
286
+ }[] | null | undefined;
382
287
  }, {
383
288
  [x: string]: string | number | boolean | {
384
289
  type: string;
@@ -387,6 +292,7 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
387
292
  } | {
388
293
  country: string;
389
294
  district: string;
295
+ addressType: "DOMESTIC";
390
296
  province: string;
391
297
  urbanOrRural: "URBAN";
392
298
  number?: string | null | undefined;
@@ -397,46 +303,33 @@ export declare function createValidationSchema(config: FieldConfig[]): z.ZodObje
397
303
  } | {
398
304
  country: string;
399
305
  district: string;
306
+ addressType: "DOMESTIC";
400
307
  province: string;
401
308
  urbanOrRural: "RURAL";
402
309
  village?: string | null | undefined;
403
- } | {
404
- type: string;
405
- option: string;
406
- filename: string;
407
- originalFilename: string;
408
- }[] | Record<string, string | number | boolean | {
409
- type: string;
410
- filename: string;
411
- originalFilename: string;
412
310
  } | {
413
311
  country: string;
414
- district: string;
415
- province: string;
416
- urbanOrRural: "URBAN";
417
- number?: string | undefined;
418
- town?: string | undefined;
419
- residentialArea?: string | undefined;
420
- street?: string | undefined;
421
- zipCode?: string | undefined;
422
- } | {
423
- country: string;
424
- district: string;
425
- province: string;
426
- urbanOrRural: "RURAL";
427
- village?: string | undefined;
312
+ state: string;
313
+ addressType: "INTERNATIONAL";
314
+ district2: string;
315
+ cityOrTown?: string | null | undefined;
316
+ addressLine1?: string | null | undefined;
317
+ addressLine2?: string | null | undefined;
318
+ addressLine3?: string | null | undefined;
319
+ postcodeOrZip?: string | null | undefined;
428
320
  } | {
429
321
  type: string;
430
322
  option: string;
431
323
  filename: string;
432
324
  originalFilename: string;
433
- }[]> | null | undefined;
325
+ }[] | null | undefined;
434
326
  }>;
435
327
  /**
436
328
  * Quick-and-dirty mock data generator for event actions.
437
329
  */
438
330
  export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number): string | true | 19 | {
439
331
  country: string;
332
+ addressType: "DOMESTIC";
440
333
  province: string;
441
334
  district: string;
442
335
  urbanOrRural: string;
@@ -453,6 +346,7 @@ export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number):
453
346
  originalFilename: string;
454
347
  type: string;
455
348
  country?: undefined;
349
+ addressType?: undefined;
456
350
  province?: undefined;
457
351
  district?: undefined;
458
352
  urbanOrRural?: undefined;
@@ -463,6 +357,7 @@ export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number):
463
357
  zipCode?: undefined;
464
358
  } | {
465
359
  country?: undefined;
360
+ addressType?: undefined;
466
361
  province?: undefined;
467
362
  district?: undefined;
468
363
  urbanOrRural?: undefined;
@@ -480,6 +375,7 @@ export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number):
480
375
  */
481
376
  export declare function mapFieldTypeToEmptyValue(field: FieldConfig): never[] | {
482
377
  country: null;
378
+ addressType: "DOMESTIC";
483
379
  province: null;
484
380
  district: null;
485
381
  urbanOrRural: string;
@@ -496,6 +392,7 @@ export declare function mapFieldTypeToEmptyValue(field: FieldConfig): never[] |
496
392
  originalFilename: string;
497
393
  type: string;
498
394
  country?: undefined;
395
+ addressType?: undefined;
499
396
  province?: undefined;
500
397
  district?: undefined;
501
398
  urbanOrRural?: undefined;
@@ -656,8 +553,8 @@ export declare const isDataFieldType: (field: {
656
553
  config: FieldConfig;
657
554
  value: FieldValue;
658
555
  }) => field is {
659
- value: any;
660
- config: Data;
556
+ value: undefined;
557
+ config: DataField;
661
558
  };
662
559
  export {};
663
560
  //# sourceMappingURL=FieldTypeMapping.d.ts.map