@fjall/util 2.15.0 → 2.16.0

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/.minified CHANGED
@@ -1 +1 @@
1
- 64 files minified at 2026-06-12T02:44:39.673Z
1
+ 65 files minified at 2026-06-14T08:03:57.032Z
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Logical id of the per-service image-tag CfnParameter. This is a cross-package
3
+ * contract: the CDK template declares the parameter under this id
4
+ * (@fjall/components-infrastructure ecsImages) and the deploy plumbs its value
5
+ * via `--parameters <id>=<tag>` (@fjall/deploy-core applicationDeploy). Both
6
+ * sides MUST derive the id here — a mismatch makes cdk reject
7
+ * "Parameters: [...] do not exist in the template".
8
+ */
9
+ export declare function imageTagParameterName(serviceName: string): string;
@@ -0,0 +1 @@
1
+ import{toPascalCase as e}from"./caseConversion.js";function m(a){return`${e(a)}ImageTag`}export{m as imageTagParameterName};
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { DNS_APEX, getDomainExportNames, type ManagedDomainExports } from "./domainExports.js";
2
2
  export { BACKUP_VAULT_NAME } from "./backupVault.js";
3
+ export { imageTagParameterName } from "./imageTags.js";
3
4
  export { toPascalCase, toKebab, toValidDatabaseName, toScreamingSnake, capitalise, getSafeZoneName, accountConstructKey, hasAsciiStableConstructKey } from "./caseConversion.js";
4
5
  export { findAccountNameCollision, type AccountNameCollision } from "./accountNameCollision.js";
5
6
  export { normaliseError, getErrorMessage, hasErrorCode, getErrorCode, getErrorStack, formatErrorString } from "./errorUtils.js";
@@ -10,7 +11,7 @@ export { mapSettledWithConcurrency } from "./concurrency.js";
10
11
  export { ACCOUNT_STAGES_WITH_ROOT, STRUCTURAL_ENVIRONMENTS, ACCOUNT_STAGES, ACCOUNT_STAGE_LABELS, isAccountStage, ACCOUNT_TIERS, type AccountTier, AccountTierSchema, isAccountTier, environmentToTier, stageFromWireEnvironment, accountTier, type AccountStageWithRoot, type AccountStage, getEnvironmentLabel, ACCOUNT_ROLES } from "./environments.js";
11
12
  export { RESOURCE_CATEGORIES, type ResourceCategory, categoriseResource, getExpectedDuration, getFriendlyResourceType } from "./resourceCategorisation.js";
12
13
  export { parseGitRemoteUrl, type GitProvider, type ParsedGitRemote } from "./gitRemoteParser.js";
13
- export { abbreviateRegion, AWS_REGIONS_METADATA, DEFAULT_REGION, getRegionInfo, MAX_SECONDARY_REGIONS, regions, suggestRegionForTimezone, type RegionCode, type RegionInfo } from "./regions.js";
14
+ export { abbreviateRegion, AWS_REGIONS_METADATA, DEFAULT_REGION, getRegionInfo, MAX_SECONDARY_REGIONS, OPT_IN_REGION_CODES, optInRegionWarning, regions, suggestRegionForTimezone, type RegionCode, type RegionInfo } from "./regions.js";
14
15
  export { SCOPE_VALUES, type TokenScope } from "./tokenScopes.js";
15
16
  export { ConnectionWireSchema, type ConnectionWire, ConnectionsListResponseSchema, type ConnectionsListResponse } from "./connectionsWire.js";
16
17
  export { deriveRegionsFromOrgConfig, deriveTargets, deriveAllTargets, environmentOrTier, findTarget, generateTargetName, type OrgConfigRegions, type TargetAccount, type DerivedTarget } from "./targets.js";
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{DNS_APEX as o,getDomainExportNames as t}from"./domainExports.js";import{BACKUP_VAULT_NAME as n}from"./backupVault.js";import{toPascalCase as i,toKebab as S,toValidDatabaseName as A,toScreamingSnake as _,capitalise as s,getSafeZoneName as m,accountConstructKey as C,hasAsciiStableConstructKey as T}from"./caseConversion.js";import{findAccountNameCollision as N}from"./accountNameCollision.js";import{normaliseError as f,getErrorMessage as g,hasErrorCode as c,getErrorCode as O,getErrorStack as I,formatErrorString as x}from"./errorUtils.js";import{singleton as l}from"./singleton.js";import{DANGEROUS_ENV_VARS as M,filterDangerousEnvVars as D,maskSensitiveOutput as P,parseShellArgs as U}from"./securityHelpers.js";import{sleep as v}from"./sleep.js";import{mapSettledWithConcurrency as h}from"./concurrency.js";import{ACCOUNT_STAGES_WITH_ROOT as H,STRUCTURAL_ENVIRONMENTS as b,ACCOUNT_STAGES as F,ACCOUNT_STAGE_LABELS as y,isAccountStage as K,ACCOUNT_TIERS as W,AccountTierSchema as X,isAccountTier as k,environmentToTier as B,stageFromWireEnvironment as z,accountTier as Y,getEnvironmentLabel as Z,ACCOUNT_ROLES as j}from"./environments.js";import{RESOURCE_CATEGORIES as w,categoriseResource as J,getExpectedDuration as Q,getFriendlyResourceType as $}from"./resourceCategorisation.js";import{parseGitRemoteUrl as re}from"./gitRemoteParser.js";import{abbreviateRegion as te,AWS_REGIONS_METADATA as Ee,DEFAULT_REGION as ne,getRegionInfo as ae,MAX_SECONDARY_REGIONS as ie,regions as Se,suggestRegionForTimezone as Ae}from"./regions.js";import{SCOPE_VALUES as se}from"./tokenScopes.js";import{ConnectionWireSchema as Ce,ConnectionsListResponseSchema as Te}from"./connectionsWire.js";import{deriveRegionsFromOrgConfig as Ne,deriveTargets as pe,deriveAllTargets as fe,environmentOrTier as ge,findTarget as ce,generateTargetName as Oe}from"./targets.js";import{buildAppConfigPath as xe}from"./appPath.js";import{findInfrastructurePaths as le,findBoundaryPath as de,isInfrastructureFile as Me}from"./findInfrastructurePaths.js";import{inferContainerFromCandidates as Pe}from"./inferContainerFromCandidates.js";import{RESERVED_APP_NAMES as Ve,isReservedAppName as ve}from"./reservedAppNames.js";import{deriveContentHashTag as he}from"./deriveContentHashTag.js";import{MIGRATION_SNAPSHOT_NAME_PREFIX as He,EXPECTED_SCHEMA_VERSION_ENV as be,EXPECTED_SCHEMA_VERSION_TOOL_ENV as Fe,EXPECTED_CH_SCHEMA_VERSION_ENV as ye,SCHEMA_ADMIN_USER_ENV as Ke,SCHEMA_ADMIN_PASSWORD_ENV as We,PRISMA_MIGRATION_DIR_RE as Xe,CLICKHOUSE_MIGRATION_SKIP_RE as ke}from"./migration/constants.js";export{j as ACCOUNT_ROLES,F as ACCOUNT_STAGES,H as ACCOUNT_STAGES_WITH_ROOT,y as ACCOUNT_STAGE_LABELS,W as ACCOUNT_TIERS,Ee as AWS_REGIONS_METADATA,X as AccountTierSchema,n as BACKUP_VAULT_NAME,ke as CLICKHOUSE_MIGRATION_SKIP_RE,Ce as ConnectionWireSchema,Te as ConnectionsListResponseSchema,M as DANGEROUS_ENV_VARS,ne as DEFAULT_REGION,o as DNS_APEX,ye as EXPECTED_CH_SCHEMA_VERSION_ENV,be as EXPECTED_SCHEMA_VERSION_ENV,Fe as EXPECTED_SCHEMA_VERSION_TOOL_ENV,ie as MAX_SECONDARY_REGIONS,He as MIGRATION_SNAPSHOT_NAME_PREFIX,Xe as PRISMA_MIGRATION_DIR_RE,Ve as RESERVED_APP_NAMES,w as RESOURCE_CATEGORIES,We as SCHEMA_ADMIN_PASSWORD_ENV,Ke as SCHEMA_ADMIN_USER_ENV,se as SCOPE_VALUES,b as STRUCTURAL_ENVIRONMENTS,te as abbreviateRegion,C as accountConstructKey,Y as accountTier,xe as buildAppConfigPath,s as capitalise,J as categoriseResource,fe as deriveAllTargets,he as deriveContentHashTag,Ne as deriveRegionsFromOrgConfig,pe as deriveTargets,ge as environmentOrTier,B as environmentToTier,D as filterDangerousEnvVars,N as findAccountNameCollision,de as findBoundaryPath,le as findInfrastructurePaths,ce as findTarget,x as formatErrorString,Oe as generateTargetName,t as getDomainExportNames,Z as getEnvironmentLabel,O as getErrorCode,g as getErrorMessage,I as getErrorStack,Q as getExpectedDuration,$ as getFriendlyResourceType,ae as getRegionInfo,m as getSafeZoneName,T as hasAsciiStableConstructKey,c as hasErrorCode,Pe as inferContainerFromCandidates,K as isAccountStage,k as isAccountTier,Me as isInfrastructureFile,ve as isReservedAppName,h as mapSettledWithConcurrency,P as maskSensitiveOutput,f as normaliseError,re as parseGitRemoteUrl,U as parseShellArgs,Se as regions,l as singleton,v as sleep,z as stageFromWireEnvironment,Ae as suggestRegionForTimezone,S as toKebab,i as toPascalCase,_ as toScreamingSnake,A as toValidDatabaseName};
1
+ import{DNS_APEX as o,getDomainExportNames as t}from"./domainExports.js";import{BACKUP_VAULT_NAME as E}from"./backupVault.js";import{imageTagParameterName as i}from"./imageTags.js";import{toPascalCase as _,toKebab as m,toValidDatabaseName as A,toScreamingSnake as s,capitalise as C,getSafeZoneName as T,accountConstructKey as N,hasAsciiStableConstructKey as R}from"./caseConversion.js";import{findAccountNameCollision as p}from"./accountNameCollision.js";import{normaliseError as O,getErrorMessage as c,hasErrorCode as I,getErrorCode as x,getErrorStack as u,formatErrorString as l}from"./errorUtils.js";import{singleton as P}from"./singleton.js";import{DANGEROUS_ENV_VARS as M,filterDangerousEnvVars as U,maskSensitiveOutput as V,parseShellArgs as G}from"./securityHelpers.js";import{sleep as h}from"./sleep.js";import{mapSettledWithConcurrency as H}from"./concurrency.js";import{ACCOUNT_STAGES_WITH_ROOT as F,STRUCTURAL_ENVIRONMENTS as W,ACCOUNT_STAGES as y,ACCOUNT_STAGE_LABELS as K,isAccountStage as X,ACCOUNT_TIERS as k,AccountTierSchema as B,isAccountTier as z,environmentToTier as Y,stageFromWireEnvironment as Z,accountTier as j,getEnvironmentLabel as q,ACCOUNT_ROLES as w}from"./environments.js";import{RESOURCE_CATEGORIES as Q,categoriseResource as $,getExpectedDuration as ee,getFriendlyResourceType as re}from"./resourceCategorisation.js";import{parseGitRemoteUrl as te}from"./gitRemoteParser.js";import{abbreviateRegion as Ee,AWS_REGIONS_METADATA as ae,DEFAULT_REGION as ie,getRegionInfo as Se,MAX_SECONDARY_REGIONS as _e,OPT_IN_REGION_CODES as me,optInRegionWarning as Ae,regions as se,suggestRegionForTimezone as Ce}from"./regions.js";import{SCOPE_VALUES as Ne}from"./tokenScopes.js";import{ConnectionWireSchema as ge,ConnectionsListResponseSchema as pe}from"./connectionsWire.js";import{deriveRegionsFromOrgConfig as Oe,deriveTargets as ce,deriveAllTargets as Ie,environmentOrTier as xe,findTarget as ue,generateTargetName as le}from"./targets.js";import{buildAppConfigPath as Pe}from"./appPath.js";import{findInfrastructurePaths as Me,findBoundaryPath as Ue,isInfrastructureFile as Ve}from"./findInfrastructurePaths.js";import{inferContainerFromCandidates as ve}from"./inferContainerFromCandidates.js";import{RESERVED_APP_NAMES as Le,isReservedAppName as He}from"./reservedAppNames.js";import{deriveContentHashTag as Fe}from"./deriveContentHashTag.js";import{MIGRATION_SNAPSHOT_NAME_PREFIX as ye,EXPECTED_SCHEMA_VERSION_ENV as Ke,EXPECTED_SCHEMA_VERSION_TOOL_ENV as Xe,EXPECTED_CH_SCHEMA_VERSION_ENV as ke,SCHEMA_ADMIN_USER_ENV as Be,SCHEMA_ADMIN_PASSWORD_ENV as ze,PRISMA_MIGRATION_DIR_RE as Ye,CLICKHOUSE_MIGRATION_SKIP_RE as Ze}from"./migration/constants.js";export{w as ACCOUNT_ROLES,y as ACCOUNT_STAGES,F as ACCOUNT_STAGES_WITH_ROOT,K as ACCOUNT_STAGE_LABELS,k as ACCOUNT_TIERS,ae as AWS_REGIONS_METADATA,B as AccountTierSchema,E as BACKUP_VAULT_NAME,Ze as CLICKHOUSE_MIGRATION_SKIP_RE,ge as ConnectionWireSchema,pe as ConnectionsListResponseSchema,M as DANGEROUS_ENV_VARS,ie as DEFAULT_REGION,o as DNS_APEX,ke as EXPECTED_CH_SCHEMA_VERSION_ENV,Ke as EXPECTED_SCHEMA_VERSION_ENV,Xe as EXPECTED_SCHEMA_VERSION_TOOL_ENV,_e as MAX_SECONDARY_REGIONS,ye as MIGRATION_SNAPSHOT_NAME_PREFIX,me as OPT_IN_REGION_CODES,Ye as PRISMA_MIGRATION_DIR_RE,Le as RESERVED_APP_NAMES,Q as RESOURCE_CATEGORIES,ze as SCHEMA_ADMIN_PASSWORD_ENV,Be as SCHEMA_ADMIN_USER_ENV,Ne as SCOPE_VALUES,W as STRUCTURAL_ENVIRONMENTS,Ee as abbreviateRegion,N as accountConstructKey,j as accountTier,Pe as buildAppConfigPath,C as capitalise,$ as categoriseResource,Ie as deriveAllTargets,Fe as deriveContentHashTag,Oe as deriveRegionsFromOrgConfig,ce as deriveTargets,xe as environmentOrTier,Y as environmentToTier,U as filterDangerousEnvVars,p as findAccountNameCollision,Ue as findBoundaryPath,Me as findInfrastructurePaths,ue as findTarget,l as formatErrorString,le as generateTargetName,t as getDomainExportNames,q as getEnvironmentLabel,x as getErrorCode,c as getErrorMessage,u as getErrorStack,ee as getExpectedDuration,re as getFriendlyResourceType,Se as getRegionInfo,T as getSafeZoneName,R as hasAsciiStableConstructKey,I as hasErrorCode,i as imageTagParameterName,ve as inferContainerFromCandidates,X as isAccountStage,z as isAccountTier,Ve as isInfrastructureFile,He as isReservedAppName,H as mapSettledWithConcurrency,V as maskSensitiveOutput,O as normaliseError,Ae as optInRegionWarning,te as parseGitRemoteUrl,G as parseShellArgs,se as regions,P as singleton,h as sleep,Z as stageFromWireEnvironment,Ce as suggestRegionForTimezone,m as toKebab,_ as toPascalCase,s as toScreamingSnake,A as toValidDatabaseName};
package/dist/regions.d.ts CHANGED
@@ -10,6 +10,8 @@ export interface RegionInfo {
10
10
  name: string;
11
11
  city: string;
12
12
  country: string;
13
+ /** Requires per-account enablement (AWS regions launched after 2019-03-20). */
14
+ optIn: boolean;
13
15
  }
14
16
  export declare const DEFAULT_REGION = "us-east-2";
15
17
  /** Cap on Organisation.secondaryRegions — API contract shared by every write surface. */
@@ -19,140 +21,221 @@ export declare const AWS_REGIONS_METADATA: readonly [{
19
21
  readonly name: "US East";
20
22
  readonly city: "Ohio";
21
23
  readonly country: "USA";
24
+ readonly optIn: false;
22
25
  }, {
23
26
  readonly code: "us-west-2";
24
27
  readonly name: "US West";
25
28
  readonly city: "Oregon";
26
29
  readonly country: "USA";
30
+ readonly optIn: false;
27
31
  }, {
28
32
  readonly code: "us-east-1";
29
33
  readonly name: "US East";
30
34
  readonly city: "N. Virginia";
31
35
  readonly country: "USA";
36
+ readonly optIn: false;
32
37
  }, {
33
38
  readonly code: "eu-west-1";
34
39
  readonly name: "EU West";
35
40
  readonly city: "Ireland";
36
41
  readonly country: "Ireland";
42
+ readonly optIn: false;
37
43
  }, {
38
44
  readonly code: "eu-central-1";
39
45
  readonly name: "EU Central";
40
46
  readonly city: "Frankfurt";
41
47
  readonly country: "Germany";
48
+ readonly optIn: false;
42
49
  }, {
43
50
  readonly code: "ap-southeast-1";
44
51
  readonly name: "Asia Pacific";
45
52
  readonly city: "Singapore";
46
53
  readonly country: "Singapore";
54
+ readonly optIn: false;
47
55
  }, {
48
56
  readonly code: "ap-northeast-1";
49
57
  readonly name: "Asia Pacific";
50
58
  readonly city: "Tokyo";
51
59
  readonly country: "Japan";
60
+ readonly optIn: false;
52
61
  }, {
53
62
  readonly code: "ap-southeast-2";
54
63
  readonly name: "Asia Pacific";
55
64
  readonly city: "Sydney";
56
65
  readonly country: "Australia";
66
+ readonly optIn: false;
57
67
  }, {
58
68
  readonly code: "us-west-1";
59
69
  readonly name: "US West";
60
70
  readonly city: "N. California";
61
71
  readonly country: "USA";
72
+ readonly optIn: false;
62
73
  }, {
63
74
  readonly code: "ca-central-1";
64
75
  readonly name: "Canada";
65
76
  readonly city: "Central";
66
77
  readonly country: "Canada";
78
+ readonly optIn: false;
67
79
  }, {
68
80
  readonly code: "af-south-1";
69
81
  readonly name: "Africa";
70
82
  readonly city: "Cape Town";
71
83
  readonly country: "South Africa";
84
+ readonly optIn: true;
72
85
  }, {
73
86
  readonly code: "ap-east-1";
74
87
  readonly name: "Asia Pacific";
75
88
  readonly city: "Hong Kong";
76
- readonly country: "China";
89
+ readonly country: "Hong Kong";
90
+ readonly optIn: true;
77
91
  }, {
78
92
  readonly code: "ap-northeast-2";
79
93
  readonly name: "Asia Pacific";
80
94
  readonly city: "Seoul";
81
95
  readonly country: "South Korea";
96
+ readonly optIn: false;
82
97
  }, {
83
98
  readonly code: "ap-northeast-3";
84
99
  readonly name: "Asia Pacific";
85
100
  readonly city: "Osaka";
86
101
  readonly country: "Japan";
102
+ readonly optIn: false;
87
103
  }, {
88
104
  readonly code: "ap-south-1";
89
105
  readonly name: "Asia Pacific";
90
106
  readonly city: "Mumbai";
91
107
  readonly country: "India";
108
+ readonly optIn: false;
92
109
  }, {
93
110
  readonly code: "ap-south-2";
94
111
  readonly name: "Asia Pacific";
95
112
  readonly city: "Hyderabad";
96
113
  readonly country: "India";
114
+ readonly optIn: true;
97
115
  }, {
98
116
  readonly code: "ap-southeast-3";
99
117
  readonly name: "Asia Pacific";
100
118
  readonly city: "Jakarta";
101
119
  readonly country: "Indonesia";
120
+ readonly optIn: true;
102
121
  }, {
103
122
  readonly code: "ap-southeast-4";
104
123
  readonly name: "Asia Pacific";
105
124
  readonly city: "Melbourne";
106
125
  readonly country: "Australia";
126
+ readonly optIn: true;
107
127
  }, {
108
128
  readonly code: "eu-central-2";
109
129
  readonly name: "EU Central";
110
130
  readonly city: "Zurich";
111
131
  readonly country: "Switzerland";
132
+ readonly optIn: true;
112
133
  }, {
113
134
  readonly code: "eu-north-1";
114
135
  readonly name: "EU North";
115
136
  readonly city: "Stockholm";
116
137
  readonly country: "Sweden";
138
+ readonly optIn: false;
117
139
  }, {
118
140
  readonly code: "eu-south-1";
119
141
  readonly name: "EU South";
120
142
  readonly city: "Milan";
121
143
  readonly country: "Italy";
144
+ readonly optIn: true;
122
145
  }, {
123
146
  readonly code: "eu-south-2";
124
147
  readonly name: "EU South";
125
148
  readonly city: "Spain";
126
149
  readonly country: "Spain";
150
+ readonly optIn: true;
127
151
  }, {
128
152
  readonly code: "eu-west-2";
129
153
  readonly name: "EU West";
130
154
  readonly city: "London";
131
155
  readonly country: "UK";
156
+ readonly optIn: false;
132
157
  }, {
133
158
  readonly code: "eu-west-3";
134
159
  readonly name: "EU West";
135
160
  readonly city: "Paris";
136
161
  readonly country: "France";
162
+ readonly optIn: false;
137
163
  }, {
138
164
  readonly code: "me-central-1";
139
165
  readonly name: "Middle East";
140
166
  readonly city: "UAE";
141
167
  readonly country: "UAE";
168
+ readonly optIn: true;
142
169
  }, {
143
170
  readonly code: "me-south-1";
144
171
  readonly name: "Middle East";
145
172
  readonly city: "Bahrain";
146
173
  readonly country: "Bahrain";
174
+ readonly optIn: true;
147
175
  }, {
148
176
  readonly code: "sa-east-1";
149
177
  readonly name: "South America";
150
178
  readonly city: "São Paulo";
151
179
  readonly country: "Brazil";
180
+ readonly optIn: false;
181
+ }, {
182
+ readonly code: "ap-southeast-5";
183
+ readonly name: "Asia Pacific";
184
+ readonly city: "Kuala Lumpur";
185
+ readonly country: "Malaysia";
186
+ readonly optIn: true;
187
+ }, {
188
+ readonly code: "ap-southeast-6";
189
+ readonly name: "Asia Pacific";
190
+ readonly city: "Auckland";
191
+ readonly country: "New Zealand";
192
+ readonly optIn: true;
193
+ }, {
194
+ readonly code: "ap-southeast-7";
195
+ readonly name: "Asia Pacific";
196
+ readonly city: "Bangkok";
197
+ readonly country: "Thailand";
198
+ readonly optIn: true;
199
+ }, {
200
+ readonly code: "ap-east-2";
201
+ readonly name: "Asia Pacific";
202
+ readonly city: "Taipei";
203
+ readonly country: "Taiwan";
204
+ readonly optIn: true;
205
+ }, {
206
+ readonly code: "ca-west-1";
207
+ readonly name: "Canada West";
208
+ readonly city: "Calgary";
209
+ readonly country: "Canada";
210
+ readonly optIn: true;
211
+ }, {
212
+ readonly code: "il-central-1";
213
+ readonly name: "Israel";
214
+ readonly city: "Tel Aviv";
215
+ readonly country: "Israel";
216
+ readonly optIn: true;
217
+ }, {
218
+ readonly code: "mx-central-1";
219
+ readonly name: "Mexico";
220
+ readonly city: "Central";
221
+ readonly country: "Mexico";
222
+ readonly optIn: true;
152
223
  }];
153
224
  /** Union of supported region codes, derived from the metadata (SSoT). */
154
225
  export type RegionCode = (typeof AWS_REGIONS_METADATA)[number]["code"];
155
226
  export declare const regions: readonly string[];
227
+ /**
228
+ * Codes of regions that must be enabled per-account before use, derived from
229
+ * the metadata (SSoT) — never re-list these.
230
+ */
231
+ export declare const OPT_IN_REGION_CODES: ReadonlySet<string>;
232
+ /**
233
+ * Warning copy shown when a user selects an opt-in region at a region picker.
234
+ * Single source for the CLI and webapp so the wording cannot drift — the webapp
235
+ * provision-region preview prefixes a "⚠ " marker, the CLI renders it in its
236
+ * warning colour.
237
+ */
238
+ export declare function optInRegionWarning(regionCode: string): string;
156
239
  export declare function getRegionInfo(code: string): RegionInfo | undefined;
157
240
  /**
158
241
  * Abbreviate an AWS region name to a compact form.
@@ -160,10 +243,12 @@ export declare function getRegionInfo(code: string): RegionInfo | undefined;
160
243
  */
161
244
  export declare function abbreviateRegion(region: string): string;
162
245
  /**
163
- * Suggest the geographically nearest supported AWS region for an IANA
164
- * timezone (e.g. from Intl.DateTimeFormat().resolvedOptions().timeZone).
165
- * Returns undefined when no sensible suggestion exists (UTC, Etc/*,
166
- * unrecognised input) callers fall back to DEFAULT_REGION without
167
- * "closest to you" justification copy.
246
+ * Suggest the geographically nearest *deployable* AWS region for an IANA
247
+ * timezone (e.g. from Intl.DateTimeFormat().resolvedOptions().timeZone). Never
248
+ * returns an opt-in region: a geographically-closest opt-in match is swapped
249
+ * for its nearest default-enabled neighbour so an accepted suggestion can be
250
+ * deployed without per-account enablement. Returns undefined when no sensible
251
+ * suggestion exists (UTC, Etc/*, unrecognised input) — callers fall back to
252
+ * DEFAULT_REGION without "closest to you" justification copy.
168
253
  */
169
254
  export declare function suggestRegionForTimezone(timeZone: string): RegionCode | undefined;
package/dist/regions.js CHANGED
@@ -1 +1 @@
1
- const i="us-east-2",n=10,o=Object.freeze([{code:"us-east-2",name:"US East",city:"Ohio",country:"USA"},{code:"us-west-2",name:"US West",city:"Oregon",country:"USA"},{code:"us-east-1",name:"US East",city:"N. Virginia",country:"USA"},{code:"eu-west-1",name:"EU West",city:"Ireland",country:"Ireland"},{code:"eu-central-1",name:"EU Central",city:"Frankfurt",country:"Germany"},{code:"ap-southeast-1",name:"Asia Pacific",city:"Singapore",country:"Singapore"},{code:"ap-northeast-1",name:"Asia Pacific",city:"Tokyo",country:"Japan"},{code:"ap-southeast-2",name:"Asia Pacific",city:"Sydney",country:"Australia"},{code:"us-west-1",name:"US West",city:"N. California",country:"USA"},{code:"ca-central-1",name:"Canada",city:"Central",country:"Canada"},{code:"af-south-1",name:"Africa",city:"Cape Town",country:"South Africa"},{code:"ap-east-1",name:"Asia Pacific",city:"Hong Kong",country:"China"},{code:"ap-northeast-2",name:"Asia Pacific",city:"Seoul",country:"South Korea"},{code:"ap-northeast-3",name:"Asia Pacific",city:"Osaka",country:"Japan"},{code:"ap-south-1",name:"Asia Pacific",city:"Mumbai",country:"India"},{code:"ap-south-2",name:"Asia Pacific",city:"Hyderabad",country:"India"},{code:"ap-southeast-3",name:"Asia Pacific",city:"Jakarta",country:"Indonesia"},{code:"ap-southeast-4",name:"Asia Pacific",city:"Melbourne",country:"Australia"},{code:"eu-central-2",name:"EU Central",city:"Zurich",country:"Switzerland"},{code:"eu-north-1",name:"EU North",city:"Stockholm",country:"Sweden"},{code:"eu-south-1",name:"EU South",city:"Milan",country:"Italy"},{code:"eu-south-2",name:"EU South",city:"Spain",country:"Spain"},{code:"eu-west-2",name:"EU West",city:"London",country:"UK"},{code:"eu-west-3",name:"EU West",city:"Paris",country:"France"},{code:"me-central-1",name:"Middle East",city:"UAE",country:"UAE"},{code:"me-south-1",name:"Middle East",city:"Bahrain",country:"Bahrain"},{code:"sa-east-1",name:"South America",city:"S\xE3o Paulo",country:"Brazil"}]),r=Object.freeze(o.map(e=>e.code));function c(e){return o.find(a=>a.code===e)}function A(e){const a=e.split("-");return a.length===3&&a[0]&&a[1]&&a[2]?`${a[0]}${a[1][0]}${a[2]}`:e}const s=Object.freeze({"Europe/London":"eu-west-2","Europe/Jersey":"eu-west-2","Europe/Guernsey":"eu-west-2","Europe/Isle_of_Man":"eu-west-2","Europe/Dublin":"eu-west-1","Europe/Paris":"eu-west-3","Europe/Berlin":"eu-central-1","Europe/Amsterdam":"eu-central-1","Europe/Brussels":"eu-central-1","Europe/Luxembourg":"eu-central-1","Europe/Vienna":"eu-central-1","Europe/Prague":"eu-central-1","Europe/Warsaw":"eu-central-1","Europe/Budapest":"eu-central-1","Europe/Zurich":"eu-central-2","Europe/Stockholm":"eu-north-1","Europe/Oslo":"eu-north-1","Europe/Copenhagen":"eu-north-1","Europe/Helsinki":"eu-north-1","Europe/Tallinn":"eu-north-1","Europe/Riga":"eu-north-1","Europe/Vilnius":"eu-north-1","Europe/Rome":"eu-south-1","Europe/Malta":"eu-south-1","Europe/Athens":"eu-south-1","Europe/Madrid":"eu-south-2","Europe/Lisbon":"eu-south-2","America/New_York":"us-east-1","America/Detroit":"us-east-1","America/Toronto":"ca-central-1","America/Montreal":"ca-central-1","America/Halifax":"ca-central-1","America/Winnipeg":"ca-central-1","America/Chicago":"us-east-2","America/Indiana/Indianapolis":"us-east-2","America/Mexico_City":"us-east-2","America/Denver":"us-west-2","America/Phoenix":"us-west-2","America/Edmonton":"us-west-2","America/Vancouver":"us-west-2","America/Los_Angeles":"us-west-1","America/Tijuana":"us-west-1","America/Sao_Paulo":"sa-east-1","America/Argentina/Buenos_Aires":"sa-east-1","America/Santiago":"sa-east-1","America/Montevideo":"sa-east-1","America/Lima":"sa-east-1","America/Bogota":"us-east-1","Asia/Tokyo":"ap-northeast-1","Asia/Seoul":"ap-northeast-2","Asia/Hong_Kong":"ap-east-1","Asia/Shanghai":"ap-east-1","Asia/Taipei":"ap-east-1","Asia/Macau":"ap-east-1","Asia/Singapore":"ap-southeast-1","Asia/Kuala_Lumpur":"ap-southeast-1","Asia/Bangkok":"ap-southeast-1","Asia/Ho_Chi_Minh":"ap-southeast-1","Asia/Manila":"ap-southeast-1","Asia/Jakarta":"ap-southeast-3","Asia/Kolkata":"ap-south-1","Asia/Calcutta":"ap-south-1","Asia/Karachi":"ap-south-1","Asia/Dhaka":"ap-south-1","Asia/Colombo":"ap-south-1","Asia/Dubai":"me-central-1","Asia/Muscat":"me-central-1","Asia/Qatar":"me-south-1","Asia/Bahrain":"me-south-1","Asia/Riyadh":"me-south-1","Asia/Kuwait":"me-south-1","Asia/Jerusalem":"me-south-1","Australia/Sydney":"ap-southeast-2","Australia/Brisbane":"ap-southeast-2","Australia/Canberra":"ap-southeast-2","Australia/Melbourne":"ap-southeast-4","Australia/Hobart":"ap-southeast-4","Australia/Adelaide":"ap-southeast-4","Pacific/Auckland":"ap-southeast-2","Pacific/Honolulu":"us-west-1","Africa/Johannesburg":"af-south-1","Africa/Casablanca":"eu-south-2","Africa/Cairo":"me-south-1","Indian/Maldives":"ap-south-1"}),u=Object.freeze({Europe:"eu-central-1",America:"us-east-1",Asia:"ap-southeast-1",Australia:"ap-southeast-2",Pacific:"ap-southeast-2",Africa:"af-south-1",Atlantic:"eu-west-1",Indian:"ap-south-1"});function p(e){if(!e)return;const a=s[e];if(a!==void 0)return a;const t=e.split("/")[0];if(t!==void 0)return u[t]}export{o as AWS_REGIONS_METADATA,i as DEFAULT_REGION,n as MAX_SECONDARY_REGIONS,A as abbreviateRegion,c as getRegionInfo,r as regions,p as suggestRegionForTimezone};
1
+ const u="us-east-2",l=10,t=Object.freeze([{code:"us-east-2",name:"US East",city:"Ohio",country:"USA",optIn:!1},{code:"us-west-2",name:"US West",city:"Oregon",country:"USA",optIn:!1},{code:"us-east-1",name:"US East",city:"N. Virginia",country:"USA",optIn:!1},{code:"eu-west-1",name:"EU West",city:"Ireland",country:"Ireland",optIn:!1},{code:"eu-central-1",name:"EU Central",city:"Frankfurt",country:"Germany",optIn:!1},{code:"ap-southeast-1",name:"Asia Pacific",city:"Singapore",country:"Singapore",optIn:!1},{code:"ap-northeast-1",name:"Asia Pacific",city:"Tokyo",country:"Japan",optIn:!1},{code:"ap-southeast-2",name:"Asia Pacific",city:"Sydney",country:"Australia",optIn:!1},{code:"us-west-1",name:"US West",city:"N. California",country:"USA",optIn:!1},{code:"ca-central-1",name:"Canada",city:"Central",country:"Canada",optIn:!1},{code:"af-south-1",name:"Africa",city:"Cape Town",country:"South Africa",optIn:!0},{code:"ap-east-1",name:"Asia Pacific",city:"Hong Kong",country:"Hong Kong",optIn:!0},{code:"ap-northeast-2",name:"Asia Pacific",city:"Seoul",country:"South Korea",optIn:!1},{code:"ap-northeast-3",name:"Asia Pacific",city:"Osaka",country:"Japan",optIn:!1},{code:"ap-south-1",name:"Asia Pacific",city:"Mumbai",country:"India",optIn:!1},{code:"ap-south-2",name:"Asia Pacific",city:"Hyderabad",country:"India",optIn:!0},{code:"ap-southeast-3",name:"Asia Pacific",city:"Jakarta",country:"Indonesia",optIn:!0},{code:"ap-southeast-4",name:"Asia Pacific",city:"Melbourne",country:"Australia",optIn:!0},{code:"eu-central-2",name:"EU Central",city:"Zurich",country:"Switzerland",optIn:!0},{code:"eu-north-1",name:"EU North",city:"Stockholm",country:"Sweden",optIn:!1},{code:"eu-south-1",name:"EU South",city:"Milan",country:"Italy",optIn:!0},{code:"eu-south-2",name:"EU South",city:"Spain",country:"Spain",optIn:!0},{code:"eu-west-2",name:"EU West",city:"London",country:"UK",optIn:!1},{code:"eu-west-3",name:"EU West",city:"Paris",country:"France",optIn:!1},{code:"me-central-1",name:"Middle East",city:"UAE",country:"UAE",optIn:!0},{code:"me-south-1",name:"Middle East",city:"Bahrain",country:"Bahrain",optIn:!0},{code:"sa-east-1",name:"South America",city:"S\xE3o Paulo",country:"Brazil",optIn:!1},{code:"ap-southeast-5",name:"Asia Pacific",city:"Kuala Lumpur",country:"Malaysia",optIn:!0},{code:"ap-southeast-6",name:"Asia Pacific",city:"Auckland",country:"New Zealand",optIn:!0},{code:"ap-southeast-7",name:"Asia Pacific",city:"Bangkok",country:"Thailand",optIn:!0},{code:"ap-east-2",name:"Asia Pacific",city:"Taipei",country:"Taiwan",optIn:!0},{code:"ca-west-1",name:"Canada West",city:"Calgary",country:"Canada",optIn:!0},{code:"il-central-1",name:"Israel",city:"Tel Aviv",country:"Israel",optIn:!0},{code:"mx-central-1",name:"Mexico",city:"Central",country:"Mexico",optIn:!0}]),A=Object.freeze(t.map(e=>e.code)),i=new Set(t.filter(e=>e.optIn).map(e=>e.code));function h(e){return`${e} is an opt-in region: it must be enabled in the AWS account (Account settings \u2192 Regions) before deployment will succeed.`}function d(e){return t.find(a=>a.code===e)}function m(e){const a=e.split("-");return a.length===3&&a[0]&&a[1]&&a[2]?`${a[0]}${a[1][0]}${a[2]}`:e}const r=Object.freeze({"Europe/London":"eu-west-2","Europe/Jersey":"eu-west-2","Europe/Guernsey":"eu-west-2","Europe/Isle_of_Man":"eu-west-2","Europe/Dublin":"eu-west-1","Europe/Paris":"eu-west-3","Europe/Berlin":"eu-central-1","Europe/Amsterdam":"eu-central-1","Europe/Brussels":"eu-central-1","Europe/Luxembourg":"eu-central-1","Europe/Vienna":"eu-central-1","Europe/Prague":"eu-central-1","Europe/Warsaw":"eu-central-1","Europe/Budapest":"eu-central-1","Europe/Zurich":"eu-central-2","Europe/Stockholm":"eu-north-1","Europe/Oslo":"eu-north-1","Europe/Copenhagen":"eu-north-1","Europe/Helsinki":"eu-north-1","Europe/Tallinn":"eu-north-1","Europe/Riga":"eu-north-1","Europe/Vilnius":"eu-north-1","Europe/Rome":"eu-south-1","Europe/Malta":"eu-south-1","Europe/Athens":"eu-south-1","Europe/Madrid":"eu-south-2","Europe/Lisbon":"eu-south-2","America/New_York":"us-east-1","America/Detroit":"us-east-1","America/Toronto":"ca-central-1","America/Montreal":"ca-central-1","America/Halifax":"ca-central-1","America/Winnipeg":"ca-central-1","America/Chicago":"us-east-2","America/Indiana/Indianapolis":"us-east-2","America/Mexico_City":"us-east-2","America/Denver":"us-west-2","America/Phoenix":"us-west-2","America/Edmonton":"us-west-2","America/Vancouver":"us-west-2","America/Los_Angeles":"us-west-1","America/Tijuana":"us-west-1","America/Sao_Paulo":"sa-east-1","America/Argentina/Buenos_Aires":"sa-east-1","America/Santiago":"sa-east-1","America/Montevideo":"sa-east-1","America/Lima":"sa-east-1","America/Bogota":"us-east-1","Asia/Tokyo":"ap-northeast-1","Asia/Seoul":"ap-northeast-2","Asia/Hong_Kong":"ap-east-1","Asia/Shanghai":"ap-east-1","Asia/Taipei":"ap-east-1","Asia/Macau":"ap-east-1","Asia/Singapore":"ap-southeast-1","Asia/Kuala_Lumpur":"ap-southeast-1","Asia/Bangkok":"ap-southeast-1","Asia/Ho_Chi_Minh":"ap-southeast-1","Asia/Manila":"ap-southeast-1","Asia/Jakarta":"ap-southeast-3","Asia/Kolkata":"ap-south-1","Asia/Calcutta":"ap-south-1","Asia/Karachi":"ap-south-1","Asia/Dhaka":"ap-south-1","Asia/Colombo":"ap-south-1","Asia/Dubai":"me-central-1","Asia/Muscat":"me-central-1","Asia/Qatar":"me-south-1","Asia/Bahrain":"me-south-1","Asia/Riyadh":"me-south-1","Asia/Kuwait":"me-south-1","Asia/Jerusalem":"me-south-1","Australia/Sydney":"ap-southeast-2","Australia/Brisbane":"ap-southeast-2","Australia/Canberra":"ap-southeast-2","Australia/Melbourne":"ap-southeast-4","Australia/Hobart":"ap-southeast-4","Australia/Adelaide":"ap-southeast-4","Pacific/Auckland":"ap-southeast-2","Pacific/Honolulu":"us-west-1","Africa/Johannesburg":"af-south-1","Africa/Casablanca":"eu-south-2","Africa/Cairo":"me-south-1","Indian/Maldives":"ap-south-1"}),c=Object.freeze({Europe:"eu-central-1",America:"us-east-1",Asia:"ap-southeast-1",Australia:"ap-southeast-2",Pacific:"ap-southeast-2",Africa:"af-south-1",Atlantic:"eu-west-1",Indian:"ap-south-1"}),p=Object.freeze({"af-south-1":"eu-west-1","ap-east-1":"ap-southeast-1","ap-southeast-3":"ap-southeast-1","ap-southeast-4":"ap-southeast-2","eu-central-2":"eu-central-1","eu-south-1":"eu-central-1","eu-south-2":"eu-west-3","me-central-1":"ap-south-1","me-south-1":"ap-south-1"});function s(e){return i.has(e)?p[e]??u:e}function y(e){if(!e)return;const a=r[e];if(a!==void 0)return s(a);const o=e.split("/")[0];if(o===void 0)return;const n=c[o];return n===void 0?void 0:s(n)}export{t as AWS_REGIONS_METADATA,u as DEFAULT_REGION,l as MAX_SECONDARY_REGIONS,i as OPT_IN_REGION_CODES,m as abbreviateRegion,d as getRegionInfo,h as optInRegionWarning,A as regions,y as suggestRegionForTimezone};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fjall/util",
3
- "version": "2.15.0",
3
+ "version": "2.16.0",
4
4
  "description": "Common utility methods",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -117,5 +117,5 @@
117
117
  "engines": {
118
118
  "node": ">=22.0.0"
119
119
  },
120
- "gitHead": "b2223855907cb6d467e47df073b2a5b28c684ede"
120
+ "gitHead": "2383b19f1e7db980ae603a6c75dca2c61b7a1d42"
121
121
  }