@opencrvs/toolkit 2.1.0-rc.00fa07b → 2.1.0-rc.03f553a

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 (35) hide show
  1. package/README.md +0 -1
  2. package/dist/application-config/index.js +0 -1
  3. package/dist/cli.js +58 -174
  4. package/dist/commons/api/router.d.ts +0 -85
  5. package/dist/commons/conditionals/conditionals.d.ts +3 -3
  6. package/dist/commons/events/AdvancedSearchConfig.d.ts +0 -6
  7. package/dist/commons/events/AuditLog.d.ts +0 -37
  8. package/dist/commons/events/FieldConfig.d.ts +0 -5
  9. package/dist/commons/events/index.d.ts +0 -1
  10. package/dist/commons/events/locations.d.ts +0 -7
  11. package/dist/conditionals/index.js +0 -1
  12. package/dist/environment/index.d.ts +0 -1
  13. package/dist/environment/index.d.ts.map +1 -1
  14. package/dist/environment/index.js +0 -10
  15. package/dist/environment/setup-environment.js +1 -2
  16. package/dist/environment/templates.d.ts.map +1 -1
  17. package/dist/environment/templates.js +1 -2
  18. package/dist/environment/update-workflows.d.ts.map +1 -1
  19. package/dist/environment/update-workflows.js +5 -17
  20. package/dist/environment/users.js +13 -11
  21. package/dist/events/index.js +0 -88
  22. package/dist/notification/index.js +25 -99
  23. package/dist/scopes/index.d.ts +1 -3
  24. package/dist/scopes/index.js +0 -1
  25. package/opencrvs-toolkit-2.1.0-rc.03f553a.tgz +0 -0
  26. package/package.json +1 -1
  27. package/tsconfig.tsbuildinfo +1 -1
  28. package/dist/commons/events/locationPayloads.d.ts +0 -95
  29. package/dist/environment/paths.d.ts +0 -7
  30. package/dist/environment/paths.d.ts.map +0 -1
  31. package/dist/environment/paths.js +0 -72
  32. package/dist/environment/upgrade.d.ts +0 -2
  33. package/dist/environment/upgrade.d.ts.map +0 -1
  34. package/dist/environment/upgrade.js +0 -82
  35. package/opencrvs-toolkit-2.1.0-rc.00fa07b.tgz +0 -0
@@ -103,7 +103,6 @@ export declare const FieldConfigSchema: z.ZodObject<{
103
103
  "config.update-all": "config.update-all";
104
104
  "dashboard.view": "dashboard.view";
105
105
  "integration.create": "integration.create";
106
- "location.edit": "location.edit";
107
106
  "organisation.read-locations": "organisation.read-locations";
108
107
  "performance.read": "performance.read";
109
108
  "performance.read-dashboards": "performance.read-dashboards";
@@ -284,7 +283,6 @@ export declare const EventFieldConfigSchema: z.ZodObject<{
284
283
  "config.update-all": "config.update-all";
285
284
  "dashboard.view": "dashboard.view";
286
285
  "integration.create": "integration.create";
287
- "location.edit": "location.edit";
288
286
  "organisation.read-locations": "organisation.read-locations";
289
287
  "performance.read": "performance.read";
290
288
  "performance.read-dashboards": "performance.read-dashboards";
@@ -441,7 +439,6 @@ export declare const AdvancedSearchField: z.ZodDiscriminatedUnion<[z.ZodObject<{
441
439
  "config.update-all": "config.update-all";
442
440
  "dashboard.view": "dashboard.view";
443
441
  "integration.create": "integration.create";
444
- "location.edit": "location.edit";
445
442
  "organisation.read-locations": "organisation.read-locations";
446
443
  "performance.read": "performance.read";
447
444
  "performance.read-dashboards": "performance.read-dashboards";
@@ -590,7 +587,6 @@ export declare const AdvancedSearchField: z.ZodDiscriminatedUnion<[z.ZodObject<{
590
587
  "config.update-all": "config.update-all";
591
588
  "dashboard.view": "dashboard.view";
592
589
  "integration.create": "integration.create";
593
- "location.edit": "location.edit";
594
590
  "organisation.read-locations": "organisation.read-locations";
595
591
  "performance.read": "performance.read";
596
592
  "performance.read-dashboards": "performance.read-dashboards";
@@ -750,7 +746,6 @@ export declare const AdvancedSearchConfig: z.ZodObject<{
750
746
  "config.update-all": "config.update-all";
751
747
  "dashboard.view": "dashboard.view";
752
748
  "integration.create": "integration.create";
753
- "location.edit": "location.edit";
754
749
  "organisation.read-locations": "organisation.read-locations";
755
750
  "performance.read": "performance.read";
756
751
  "performance.read-dashboards": "performance.read-dashboards";
@@ -899,7 +894,6 @@ export declare const AdvancedSearchConfig: z.ZodObject<{
899
894
  "config.update-all": "config.update-all";
900
895
  "dashboard.view": "dashboard.view";
901
896
  "integration.create": "integration.create";
902
- "location.edit": "location.edit";
903
897
  "organisation.read-locations": "organisation.read-locations";
904
898
  "performance.read": "performance.read";
905
899
  "performance.read-dashboards": "performance.read-dashboards";
@@ -281,43 +281,6 @@ export declare const AuditLogEntrySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
281
281
  responseSummary: z.ZodObject<{
282
282
  clientId: z.ZodString;
283
283
  }, z.core.$strip>;
284
- }, z.core.$strip>, z.ZodObject<{
285
- id: z.ZodString;
286
- clientId: z.ZodString;
287
- clientType: z.ZodEnum<{
288
- system: "system";
289
- user: "user";
290
- }>;
291
- createdAt: z.ZodString;
292
- operation: z.ZodLiteral<"locations.create">;
293
- requestData: z.ZodObject<{
294
- id: z.ZodString;
295
- versionId: z.ZodString;
296
- name: z.ZodString;
297
- externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
298
- effectiveFrom: z.ZodString;
299
- status: z.ZodString;
300
- administrativeAreaId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
301
- locationType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
302
- }, z.core.$strip>;
303
- }, z.core.$strip>, z.ZodObject<{
304
- id: z.ZodString;
305
- clientId: z.ZodString;
306
- clientType: z.ZodEnum<{
307
- system: "system";
308
- user: "user";
309
- }>;
310
- createdAt: z.ZodString;
311
- operation: z.ZodLiteral<"administrativeAreas.create">;
312
- requestData: z.ZodObject<{
313
- id: z.ZodString;
314
- versionId: z.ZodString;
315
- name: z.ZodString;
316
- externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
317
- effectiveFrom: z.ZodString;
318
- status: z.ZodString;
319
- parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
320
- }, z.core.$strip>;
321
284
  }, z.core.$strip>, z.ZodObject<{
322
285
  id: z.ZodString;
323
286
  clientId: z.ZodString;
@@ -1883,7 +1883,6 @@ declare const AdministrativeAreaField: z.ZodObject<{
1883
1883
  "config.update-all": "config.update-all";
1884
1884
  "dashboard.view": "dashboard.view";
1885
1885
  "integration.create": "integration.create";
1886
- "location.edit": "location.edit";
1887
1886
  "organisation.read-locations": "organisation.read-locations";
1888
1887
  "performance.read": "performance.read";
1889
1888
  "performance.read-dashboards": "performance.read-dashboards";
@@ -2013,7 +2012,6 @@ declare const LocationInput: z.ZodObject<{
2013
2012
  "config.update-all": "config.update-all";
2014
2013
  "dashboard.view": "dashboard.view";
2015
2014
  "integration.create": "integration.create";
2016
- "location.edit": "location.edit";
2017
2015
  "organisation.read-locations": "organisation.read-locations";
2018
2016
  "performance.read": "performance.read";
2019
2017
  "performance.read-dashboards": "performance.read-dashboards";
@@ -2214,7 +2212,6 @@ declare const Facility: z.ZodObject<{
2214
2212
  "config.update-all": "config.update-all";
2215
2213
  "dashboard.view": "dashboard.view";
2216
2214
  "integration.create": "integration.create";
2217
- "location.edit": "location.edit";
2218
2215
  "organisation.read-locations": "organisation.read-locations";
2219
2216
  "performance.read": "performance.read";
2220
2217
  "performance.read-dashboards": "performance.read-dashboards";
@@ -2330,7 +2327,6 @@ declare const Office: z.ZodObject<{
2330
2327
  "config.update-all": "config.update-all";
2331
2328
  "dashboard.view": "dashboard.view";
2332
2329
  "integration.create": "integration.create";
2333
- "location.edit": "location.edit";
2334
2330
  "organisation.read-locations": "organisation.read-locations";
2335
2331
  "performance.read": "performance.read";
2336
2332
  "performance.read-dashboards": "performance.read-dashboards";
@@ -2532,7 +2528,6 @@ declare const Address: z.ZodObject<{
2532
2528
  "config.update-all": "config.update-all";
2533
2529
  "dashboard.view": "dashboard.view";
2534
2530
  "integration.create": "integration.create";
2535
- "location.edit": "location.edit";
2536
2531
  "organisation.read-locations": "organisation.read-locations";
2537
2532
  "performance.read": "performance.read";
2538
2533
  "performance.read-dashboards": "performance.read-dashboards";
@@ -45,7 +45,6 @@ export * from './field';
45
45
  export * from './Flag';
46
46
  export * from './event';
47
47
  export * from './locations';
48
- export * from './locationPayloads';
49
48
  export { UUID } from '../uuid';
50
49
  export { DocumentPath } from '../documents';
51
50
  //# sourceMappingURL=index.d.ts.map
@@ -111,13 +111,6 @@ export type SetAdministrativeAreaPayload = z.infer<typeof SetAdministrativeAreaP
111
111
  export declare function resolveVersion<T extends {
112
112
  effectiveFrom: string;
113
113
  }>(versions: T[], anchor: string): T;
114
- /**
115
- * Whether the entity holds the given externalId with active status at the
116
- * anchor date or at any point after it. Used for point-in-time uniqueness of
117
- * external codes: a new holder starting at `anchor` collides when an existing
118
- * holder is (or is scheduled to be) active with the code from then on.
119
- */
120
- export declare function hasActiveExternalIdOnOrAfter(versions: LocationVersion[], externalId: string, anchor: string): boolean;
121
114
  type WrapArrayPreserveNullish<V> = V extends readonly any[] ? V : NonNullable<V>[] | Extract<V, null | undefined>;
122
115
  /**
123
116
  * For type T, convert fields K to arrays. If field is string, convert to string[].
@@ -169,7 +169,6 @@ var PlainScopeType = z6.enum([
169
169
  "integration.create",
170
170
  "record.import",
171
171
  "config.update-all",
172
- "location.edit",
173
172
  "attachment.upload",
174
173
  "profile.electronic-signature",
175
174
  "user.read-only-my-audit",
@@ -1,5 +1,4 @@
1
1
  export declare function runEnvironmentInit(): Promise<void>;
2
- export declare function runEnvironmentUpgrade(): Promise<void>;
3
2
  export declare function runEnvironmentUpdateWorkflows(): Promise<void>;
4
3
  export declare function runEnvironmentUsers(): Promise<void>;
5
4
  export declare function runEnvironmentSwarmToK8s(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/environment/index.ts"],"names":[],"mappings":"AAyCA,wBAAsB,kBAAkB,kBAIvC;AAED,wBAAsB,qBAAqB,kBAI1C;AAED,wBAAsB,6BAA6B,kBAIlD;AAED,wBAAsB,mBAAmB,kBAIxC;AAED,wBAAsB,wBAAwB,kBAG7C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/environment/index.ts"],"names":[],"mappings":"AAwCA,wBAAsB,kBAAkB,kBAGvC;AAED,wBAAsB,6BAA6B,kBAIlD;AAED,wBAAsB,mBAAmB,kBAIxC;AAED,wBAAsB,wBAAwB,kBAG7C"}
@@ -20,13 +20,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.runEnvironmentInit = runEnvironmentInit;
23
- exports.runEnvironmentUpgrade = runEnvironmentUpgrade;
24
23
  exports.runEnvironmentUpdateWorkflows = runEnvironmentUpdateWorkflows;
25
24
  exports.runEnvironmentUsers = runEnvironmentUsers;
26
25
  exports.runEnvironmentSwarmToK8s = runEnvironmentSwarmToK8s;
27
26
  const fs_1 = require("fs");
28
27
  const path_1 = require("path");
29
- const paths_1 = require("./paths");
30
28
  const REQUIRED_REPOSITORY_DIRECTORIES = [
31
29
  '.github/workflows',
32
30
  'environments',
@@ -48,17 +46,9 @@ function validateRepositoryStructure(repositoryRoot = process.cwd()) {
48
46
  function runEnvironmentInit() {
49
47
  return __awaiter(this, void 0, void 0, function* () {
50
48
  validateRepositoryStructure();
51
- (0, paths_1.assertNoOldInventoryLayout)();
52
49
  yield import('./setup-environment.js');
53
50
  });
54
51
  }
55
- function runEnvironmentUpgrade() {
56
- return __awaiter(this, void 0, void 0, function* () {
57
- validateRepositoryStructure();
58
- const { upgradeEnvironmentLayout } = yield import('./upgrade.js');
59
- yield upgradeEnvironmentLayout();
60
- });
61
- }
62
52
  function runEnvironmentUpdateWorkflows() {
63
53
  return __awaiter(this, void 0, void 0, function* () {
64
54
  validateRepositoryStructure();
@@ -59,7 +59,6 @@ const questions_1 = require("./questions");
59
59
  const editor_questions_1 = require("./editor-questions");
60
60
  const questions_helper_1 = require("./questions-helper");
61
61
  const manage_users_1 = require("./manage-users");
62
- const paths_1 = require("./paths");
63
62
  function questionToPrompt(_a) {
64
63
  var { valueType, valueLabel, scope } = _a, promptOptions = __rest(_a, ["valueType", "valueLabel", "scope"]);
65
64
  return promptOptions;
@@ -272,7 +271,7 @@ ALL_QUESTIONS.push(...questions_1.githubTokenQuestion, ...questions_1.githubOthe
272
271
  ? infrastructure.kubeWorkerNodes.split(',').map((ip) => ip.trim())
273
272
  : [];
274
273
  (0, logger_1.log)('\n', kleur_1.default.bold().underline('SSH Users'), '\n');
275
- const users = yield (0, manage_users_1.manageUsers)((0, paths_1.getEnvironmentInventoryPath)(environment));
274
+ const users = yield (0, manage_users_1.manageUsers)(`infrastructure/server-setup/inventory/${environment}.yml`);
276
275
  (0, logger_1.log)('\n', kleur_1.default.bold().underline('Traefik SSL Certificate'), '\n');
277
276
  const sslCertExists = (0, utils_1.findExistingValue)('SSL_CRT', 'SECRET', 'ENVIRONMENT', existingValues);
278
277
  let ssl_answers = [];
@@ -1 +1 @@
1
- {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/environment/templates.ts"],"names":[],"mappings":"AAuBA,wBAAgB,QAAQ,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,CAKvC;AAID,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,CAYpD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM,CAWpD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM,CASnD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM,EAAE,CAStD;AAGD;;;;GAIG;AACH;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,QA0CzC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAsBzE"}
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/environment/templates.ts"],"names":[],"mappings":"AAsBA,wBAAgB,QAAQ,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,CAKvC;AAID,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,CAYpD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM,CAWpD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM,CASnD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM,EAAE,CAStD;AAGD;;;;GAIG;AACH;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,QA0CzC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QA4BzE"}
@@ -34,7 +34,6 @@ exports.generateInventory = generateInventory;
34
34
  const fs_1 = __importDefault(require("fs"));
35
35
  const path_1 = __importDefault(require("path"));
36
36
  const logger_1 = require("./logger");
37
- const paths_1 = require("./paths");
38
37
  const handlebars_1 = __importDefault(require("handlebars"));
39
38
  // Register a helper to increment numbers
40
39
  handlebars_1.default.registerHelper('data_label_idx', function (value) {
@@ -150,7 +149,7 @@ function copyChartsValues(env, values) {
150
149
  function generateInventory(env, values) {
151
150
  // Template and output paths
152
151
  const templatePath = path_1.default.join(__dirname, 'templates', 'inventory', 'inventory.template.yml');
153
- const outputPath = path_1.default.resolve(process.cwd(), (0, paths_1.getEnvironmentInventoryPath)(env));
152
+ const outputPath = path_1.default.join(process.cwd(), 'infrastructure', 'server-setup', 'inventory', `${env}.yml`);
154
153
  const templateFile = fs_1.default.readFileSync(templatePath, 'utf-8');
155
154
  const template = handlebars_1.default.compile(templateFile);
156
155
  values['single_node'] =
@@ -1 +1 @@
1
- {"version":3,"file":"update-workflows.d.ts","sourceRoot":"","sources":["../../src/environment/update-workflows.ts"],"names":[],"mappings":"AA+HA,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC,CAgDhE"}
1
+ {"version":3,"file":"update-workflows.d.ts","sourceRoot":"","sources":["../../src/environment/update-workflows.ts"],"names":[],"mappings":"AAgHA,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC,CAgDhE"}
@@ -60,21 +60,12 @@ const path_1 = require("path");
60
60
  const glob = __importStar(require("glob"));
61
61
  const yaml = __importStar(require("js-yaml"));
62
62
  const logger_1 = require("./logger");
63
- const paths_1 = require("./paths");
64
- function isDirectory(path) {
65
- try {
66
- return (0, fs_1.statSync)(path).isDirectory();
67
- }
68
- catch (_a) {
69
- return false;
70
- }
71
- }
72
63
  function extractInfrastructureNames() {
73
64
  return __awaiter(this, void 0, void 0, function* () {
74
- const files = glob.sync((0, path_1.join)('environments', '*', paths_1.INVENTORY_FILE_NAME));
75
- const infraEnvironments = files.map((file) => (0, path_1.basename)((0, path_1.dirname)(file)));
65
+ const files = glob.sync('infrastructure/server-setup/inventory/*.yml');
66
+ const infraEnvironments = files.map((file) => (0, path_1.basename)(file, '.yml'));
76
67
  if (infraEnvironments.length === 0) {
77
- console.log(`⚠️ Warning: No environment inventory files found at environments/*/${paths_1.INVENTORY_FILE_NAME}`);
68
+ console.log('⚠️ Warning: No environment directories found in infrastructure/server-setup/inventory/');
78
69
  return [];
79
70
  }
80
71
  (0, logger_1.log)('🔍 Found infrastructure configurations:', infraEnvironments.join(', '));
@@ -86,11 +77,8 @@ function extractEnvironmentNames() {
86
77
  const entries = yield (0, promises_1.readdir)('environments');
87
78
  // Filter only directories
88
79
  const environments = entries.filter((entry) => {
89
- const environmentPath = (0, path_1.join)('environments', entry);
90
- const opencrvsServicesPath = (0, path_1.join)(environmentPath, 'opencrvs-services');
91
- return (isDirectory(environmentPath) &&
92
- (0, fs_1.existsSync)(opencrvsServicesPath) &&
93
- isDirectory(opencrvsServicesPath));
80
+ const fullPath = (0, path_1.join)('environments', entry);
81
+ return (0, fs_1.statSync)(fullPath).isDirectory();
94
82
  });
95
83
  if (environments.length === 0) {
96
84
  console.log('⚠️ Warning: No environment directories found in environments/');
@@ -62,7 +62,6 @@ const path = __importStar(require("path"));
62
62
  const kleur_1 = __importDefault(require("kleur"));
63
63
  const manage_users_1 = require("./manage-users");
64
64
  const logger_1 = require("./logger");
65
- const paths_1 = require("./paths");
66
65
  function select(options) {
67
66
  return __awaiter(this, void 0, void 0, function* () {
68
67
  const inquirer = yield import('@inquirer/prompts');
@@ -77,29 +76,32 @@ function select(options) {
77
76
  * * @returns {string} Inventory file
78
77
  */
79
78
  function selectInventoryFile() {
80
- return __awaiter(this, arguments, void 0, function* (dirPath = './environments') {
79
+ return __awaiter(this, arguments, void 0, function* (dirPath = './infrastructure/server-setup/inventory/') {
81
80
  // Check if directory exists
82
81
  if (!fs.existsSync(dirPath)) {
83
82
  (0, logger_1.warn)(`⚠️ No environment configuration directory found at ${dirPath}`);
84
83
  (0, logger_1.warn)('Hint: If this is a new infrastructure repository, run `opencrvs environment init` first.');
85
84
  return null;
86
85
  }
87
- const environments = fs
86
+ // Read and filter files
87
+ const files = fs
88
88
  .readdirSync(dirPath)
89
- .filter((entry) => {
90
- const filePath = path.join(dirPath, entry);
91
- return (fs.statSync(filePath).isDirectory() &&
92
- fs.existsSync((0, paths_1.getEnvironmentInventoryPath)(entry)));
89
+ .filter((file) => {
90
+ const filePath = path.join(dirPath, file);
91
+ const isFile = fs.statSync(filePath).isFile();
92
+ const ext = path.extname(file).slice(1).toLowerCase();
93
+ return isFile && (ext === 'yml' || ext === 'yaml');
93
94
  })
94
95
  .sort();
95
- if (environments.length === 0) {
96
+ if (files.length === 0) {
96
97
  (0, logger_1.warn)(`⚠️ No environment configuration files found at ${dirPath}`);
97
98
  (0, logger_1.warn)('Hint: If this is a new infrastructure repository, run `opencrvs environment init` first.');
98
99
  return null;
99
100
  }
100
- const choices = environments.map((environment) => ({
101
- name: environment,
102
- value: (0, paths_1.getEnvironmentInventoryPath)(environment)
101
+ // Create choices - remove extension from display
102
+ const choices = files.map((file) => ({
103
+ name: path.basename(file, path.extname(file)),
104
+ value: path.join(dirPath, file)
103
105
  }));
104
106
  const selectedFile = yield select({
105
107
  message: 'Select environment (inventory file) to load users:',
@@ -80,8 +80,6 @@ __export(events_exports, {
80
80
  ConditionalType: () => ConditionalType,
81
81
  ConfirmableActions: () => ConfirmableActions,
82
82
  ContainsFlags: () => ContainsFlags,
83
- CreateAdministrativeAreaPayload: () => CreateAdministrativeAreaPayload,
84
- CreateLocationPayload: () => CreateLocationPayload,
85
83
  CustomActionInput: () => CustomActionInput,
86
84
  CustomFieldValue: () => CustomFieldValue,
87
85
  CustomFlag: () => CustomFlag,
@@ -222,8 +220,6 @@ __export(events_exports, {
222
220
  UUID: () => UUID,
223
221
  UnarchiveActionInput: () => UnarchiveActionInput,
224
222
  UnassignActionInput: () => UnassignActionInput,
225
- UpdateAdministrativeAreaPayload: () => UpdateAdministrativeAreaPayload,
226
- UpdateLocationPayload: () => UpdateLocationPayload,
227
223
  UserAuditRecordInput: () => UserAuditRecordInput,
228
224
  V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS: () => V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS,
229
225
  V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP: () => V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP,
@@ -233,8 +229,6 @@ __export(events_exports, {
233
229
  VerificationActionConfig: () => VerificationActionConfig,
234
230
  VerificationPageConfig: () => VerificationPageConfig,
235
231
  VerificationStatusValue: () => VerificationStatusValue,
236
- WithdrawAdministrativeAreaVersionPayload: () => WithdrawAdministrativeAreaVersionPayload,
237
- WithdrawLocationVersionPayload: () => WithdrawLocationVersionPayload,
238
232
  Within: () => Within,
239
233
  WorkqueueActionType: () => WorkqueueActionType,
240
234
  WorkqueueColumn: () => WorkqueueColumn,
@@ -353,7 +347,6 @@ __export(events_exports, {
353
347
  getStatusFromActions: () => getStatusFromActions,
354
348
  getValidatorsForField: () => getValidatorsForField,
355
349
  getVisibleVerificationPageIds: () => getVisibleVerificationPageIds,
356
- hasActiveExternalIdOnOrAfter: () => hasActiveExternalIdOnOrAfter,
357
350
  hasAnyOfScopes: () => hasAnyOfScopes,
358
351
  isActionAvailable: () => isActionAvailable,
359
352
  isActionConfigType: () => isActionConfigType,
@@ -512,7 +505,6 @@ var PlainScopeType = z2.enum([
512
505
  "integration.create",
513
506
  "record.import",
514
507
  "config.update-all",
515
- "location.edit",
516
508
  "attachment.upload",
517
509
  "profile.electronic-signature",
518
510
  "user.read-only-my-audit",
@@ -995,29 +987,6 @@ var IntegrationRefreshSecretEntrySchema = AuditLogEntryBase.extend({
995
987
  requestData: z5.object({ id: z5.string() }),
996
988
  responseSummary: z5.object({ clientId: z5.string() })
997
989
  });
998
- var createdVersionFields = {
999
- id: z5.string(),
1000
- versionId: z5.string(),
1001
- name: z5.string(),
1002
- externalId: z5.string().nullish(),
1003
- effectiveFrom: z5.string(),
1004
- status: z5.string()
1005
- };
1006
- var LocationCreateEntrySchema = AuditLogEntryBase.extend({
1007
- operation: z5.literal("locations.create"),
1008
- requestData: z5.object({
1009
- ...createdVersionFields,
1010
- administrativeAreaId: z5.string().nullish(),
1011
- locationType: z5.string().nullish()
1012
- })
1013
- });
1014
- var AdministrativeAreaCreateEntrySchema = AuditLogEntryBase.extend({
1015
- operation: z5.literal("administrativeAreas.create"),
1016
- requestData: z5.object({
1017
- ...createdVersionFields,
1018
- parentId: z5.string().nullish()
1019
- })
1020
- });
1021
990
  var AttachmentUploadEntrySchema = AuditLogEntryBase.extend({
1022
991
  operation: z5.literal("attachments.upload"),
1023
992
  requestData: z5.object({
@@ -1093,8 +1062,6 @@ var AuditLogEntrySchema = z5.discriminatedUnion("operation", [
1093
1062
  IntegrationActivateEntrySchema,
1094
1063
  IntegrationDeleteEntrySchema,
1095
1064
  IntegrationRefreshSecretEntrySchema,
1096
- LocationCreateEntrySchema,
1097
- AdministrativeAreaCreateEntrySchema,
1098
1065
  AttachmentUploadEntrySchema,
1099
1066
  UserCreateEntrySchema,
1100
1067
  UserReasonEntrySchema,
@@ -10551,13 +10518,6 @@ function resolveVersion(versions, anchor) {
10551
10518
  }
10552
10519
  return resolved;
10553
10520
  }
10554
- function hasActiveExternalIdOnOrAfter(versions, externalId, anchor) {
10555
- const inEffectAtAnchor = resolveVersion(versions, anchor);
10556
- const laterVersions = versions.filter((v) => v.effectiveFrom > anchor);
10557
- return [inEffectAtAnchor, ...laterVersions].some(
10558
- (v) => v.externalId === externalId && v.status === "active"
10559
- );
10560
- }
10561
10521
  function matchesJurisdictionFilter(locationIds, filter, user2) {
10562
10522
  if (!locationIds) {
10563
10523
  return false;
@@ -11368,51 +11328,3 @@ var V2_DEFAULT_MOCK_LOCATIONS_MAP = new Map(
11368
11328
  var V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS_MAP = new Map(
11369
11329
  V2_DEFAULT_MOCK_ADMINISTRATIVE_AREAS.map((a) => [a.id, a])
11370
11330
  );
11371
-
11372
- // ../commons/src/events/locationPayloads.ts
11373
- var z44 = __toESM(require("zod/v4"));
11374
- var CreateLocationPayload = z44.object({
11375
- id: UUID.optional(),
11376
- versionId: UUID.optional(),
11377
- name: z44.string(),
11378
- externalId: z44.string().nullish(),
11379
- administrativeAreaId: UUID.nullable(),
11380
- locationType: z44.string().nullable(),
11381
- effectiveFrom: z44.iso.date().optional(),
11382
- status: LocationStatus.default("active")
11383
- });
11384
- var UpdateLocationPayload = z44.strictObject({
11385
- id: UUID,
11386
- versionId: UUID.optional(),
11387
- name: z44.string(),
11388
- externalId: z44.string().nullish(),
11389
- status: LocationStatus,
11390
- effectiveFrom: z44.iso.date().optional(),
11391
- lastVersionId: UUID
11392
- });
11393
- var WithdrawLocationVersionPayload = z44.object({
11394
- id: UUID,
11395
- versionId: UUID
11396
- });
11397
- var CreateAdministrativeAreaPayload = z44.object({
11398
- id: UUID.optional(),
11399
- versionId: UUID.optional(),
11400
- name: z44.string(),
11401
- externalId: z44.string().nullish(),
11402
- parentId: UUID.nullable(),
11403
- effectiveFrom: z44.iso.date().optional(),
11404
- status: LocationStatus.default("active")
11405
- });
11406
- var UpdateAdministrativeAreaPayload = z44.strictObject({
11407
- id: UUID,
11408
- versionId: UUID.optional(),
11409
- name: z44.string(),
11410
- externalId: z44.string().nullish(),
11411
- status: LocationStatus,
11412
- effectiveFrom: z44.iso.date().optional(),
11413
- lastVersionId: UUID
11414
- });
11415
- var WithdrawAdministrativeAreaVersionPayload = z44.object({
11416
- id: UUID,
11417
- versionId: UUID
11418
- });