@fjall/util 2.3.0 → 2.4.1
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 +1 -1
- package/dist/environments.d.ts +30 -0
- package/dist/environments.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/.minified
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
57 files minified at 2026-05-
|
|
1
|
+
57 files minified at 2026-05-26T22:01:15.405Z
|
package/dist/environments.d.ts
CHANGED
|
@@ -17,7 +17,37 @@ export declare const STRUCTURAL_ENVIRONMENTS: {
|
|
|
17
17
|
readonly ROOT: "root";
|
|
18
18
|
readonly PLATFORM: "platform";
|
|
19
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* Wire-format environment list including the implicit "root" value.
|
|
22
|
+
* Use this for schemas and validators that accept a system-assigned root
|
|
23
|
+
* environment (e.g. quick-create when called after `fjall create org`,
|
|
24
|
+
* and the public org-config API). User-facing pickers should still use
|
|
25
|
+
* STANDARD_ENVIRONMENTS — "root" is set by context, not chosen.
|
|
26
|
+
*/
|
|
27
|
+
export declare const STANDARD_ENVIRONMENTS_WITH_ROOT: readonly ["production", "staging", "development", "platform", "compliance", "root"];
|
|
28
|
+
export type StandardEnvironmentWithRoot = (typeof STANDARD_ENVIRONMENTS_WITH_ROOT)[number];
|
|
20
29
|
/** Human-readable labels for each standard environment. */
|
|
21
30
|
export declare const ENVIRONMENT_LABELS: Record<StandardEnvironment, string>;
|
|
22
31
|
/** Returns the human-readable label for an environment, with capitalised fallback. */
|
|
23
32
|
export declare function getEnvironmentLabel(env: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* AWS account roles in the wire format used across the CLI, webapp API
|
|
35
|
+
* responses, and the Prisma `AccountRole` enum. This is the SINGLE SOURCE
|
|
36
|
+
* for the literal values — the webapp's
|
|
37
|
+
* `app/.server/types/database-enums.ts` rebinds `AccountRole` to these
|
|
38
|
+
* values, and `database-enums-parity.test.ts` then enforces that the
|
|
39
|
+
* resulting set matches the Prisma migration SQL CHECK constraint. Adding
|
|
40
|
+
* a new role here without updating Prisma fails the parity test; renaming
|
|
41
|
+
* a value here propagates structurally to the webapp.
|
|
42
|
+
*
|
|
43
|
+
* Coupling: `environment` and `role` move together via
|
|
44
|
+
* `environmentToRole`/`roleToEnvironment` in
|
|
45
|
+
* `webapp/app/.server/utils/orgConfigHelpers.ts`. See
|
|
46
|
+
* [[STRUCTURAL_ENVIRONMENTS]] for the env-side equivalent.
|
|
47
|
+
*/
|
|
48
|
+
export declare const ACCOUNT_ROLES: {
|
|
49
|
+
readonly ORGANISATION: "organisation";
|
|
50
|
+
readonly PLATFORM: "platform";
|
|
51
|
+
readonly ACCOUNT: "account";
|
|
52
|
+
};
|
|
53
|
+
export type AccountRole = (typeof ACCOUNT_ROLES)[keyof typeof ACCOUNT_ROLES];
|
package/dist/environments.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const t=["production","staging","development","platform","compliance"];function n(o){return t.includes(o)}const e={ROOT:"root",PLATFORM:"platform"},p=[...t,e.ROOT],r={production:"Production",staging:"Staging",development:"Development",platform:"Platform",compliance:"Compliance"};function c(o){return n(o)?r[o]:o.charAt(0).toUpperCase()+o.slice(1)}const i={ORGANISATION:"organisation",PLATFORM:"platform",ACCOUNT:"account"};export{i as ACCOUNT_ROLES,r as ENVIRONMENT_LABELS,t as STANDARD_ENVIRONMENTS,p as STANDARD_ENVIRONMENTS_WITH_ROOT,e as STRUCTURAL_ENVIRONMENTS,c as getEnvironmentLabel,n as isValidEnvironment};
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { normaliseError, getErrorMessage, hasErrorCode, getErrorCode, getErrorSt
|
|
|
4
4
|
export { singleton } from "./singleton.js";
|
|
5
5
|
export { DANGEROUS_ENV_VARS, filterDangerousEnvVars, maskSensitiveOutput, parseShellArgs } from "./securityHelpers.js";
|
|
6
6
|
export { sleep } from "./sleep.js";
|
|
7
|
-
export { STANDARD_ENVIRONMENTS, STRUCTURAL_ENVIRONMENTS, type StandardEnvironment, isValidEnvironment, ENVIRONMENT_LABELS, getEnvironmentLabel } from "./environments.js";
|
|
7
|
+
export { STANDARD_ENVIRONMENTS, STANDARD_ENVIRONMENTS_WITH_ROOT, STRUCTURAL_ENVIRONMENTS, type StandardEnvironment, type StandardEnvironmentWithRoot, isValidEnvironment, ENVIRONMENT_LABELS, getEnvironmentLabel, ACCOUNT_ROLES, type AccountRole } from "./environments.js";
|
|
8
8
|
export { RESOURCE_CATEGORIES, type ResourceCategory, categoriseResource, getExpectedDuration, getFriendlyResourceType } from "./resourceCategorisation.js";
|
|
9
9
|
export { parseGitRemoteUrl, type GitProvider, type ParsedGitRemote } from "./gitRemoteParser.js";
|
|
10
10
|
export { abbreviateRegion } from "./regions.js";
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DNS_APEX as o,getDomainExportNames as t}from"./domainExports.js";import{toPascalCase as a,toKebab as
|
|
1
|
+
import{DNS_APEX as o,getDomainExportNames as t}from"./domainExports.js";import{toPascalCase as a,toKebab as S,toValidDatabaseName as _,toScreamingSnake as N,capitalise as i,getSafeZoneName as n}from"./caseConversion.js";import{normaliseError as m,getErrorMessage as s,hasErrorCode as A,getErrorCode as p,getErrorStack as f,formatErrorString as g}from"./errorUtils.js";import{singleton as C}from"./singleton.js";import{DANGEROUS_ENV_VARS as I,filterDangerousEnvVars as x,maskSensitiveOutput as V,parseShellArgs as d}from"./securityHelpers.js";import{sleep as M}from"./sleep.js";import{STANDARD_ENVIRONMENTS as P,STANDARD_ENVIRONMENTS_WITH_ROOT as u,STRUCTURAL_ENVIRONMENTS as c,isValidEnvironment as v,ENVIRONMENT_LABELS as H,getEnvironmentLabel as U,ACCOUNT_ROLES as L}from"./environments.js";import{RESOURCE_CATEGORIES as h,categoriseResource as G,getExpectedDuration as F,getFriendlyResourceType as X}from"./resourceCategorisation.js";import{parseGitRemoteUrl as y}from"./gitRemoteParser.js";import{abbreviateRegion as B}from"./regions.js";import{SCOPE_VALUES as Z}from"./tokenScopes.js";import{deriveRegionsFromOrgConfig as q,deriveTargets as w,deriveAllTargets as z,findTarget as J,generateTargetName as Q}from"./targets.js";import{buildAppConfigPath as $}from"./appPath.js";import{findInfrastructurePaths as re,findBoundaryPath as oe,isInfrastructureFile as te}from"./findInfrastructurePaths.js";import{inferContainerFromCandidates as ae}from"./inferContainerFromCandidates.js";import{RESERVED_APP_NAMES as _e,isReservedAppName as Ne}from"./reservedAppNames.js";import{deriveContentHashTag as ne}from"./deriveContentHashTag.js";import{MIGRATION_SNAPSHOT_NAME_PREFIX as me,EXPECTED_SCHEMA_VERSION_ENV as se,EXPECTED_SCHEMA_VERSION_TOOL_ENV as Ae,EXPECTED_CH_SCHEMA_VERSION_ENV as pe,SCHEMA_ADMIN_USER_ENV as fe,SCHEMA_ADMIN_PASSWORD_ENV as ge,PRISMA_MIGRATION_DIR_RE as Te,CLICKHOUSE_MIGRATION_SKIP_RE as Ce}from"./migration/constants.js";export{L as ACCOUNT_ROLES,Ce as CLICKHOUSE_MIGRATION_SKIP_RE,I as DANGEROUS_ENV_VARS,o as DNS_APEX,H as ENVIRONMENT_LABELS,pe as EXPECTED_CH_SCHEMA_VERSION_ENV,se as EXPECTED_SCHEMA_VERSION_ENV,Ae as EXPECTED_SCHEMA_VERSION_TOOL_ENV,me as MIGRATION_SNAPSHOT_NAME_PREFIX,Te as PRISMA_MIGRATION_DIR_RE,_e as RESERVED_APP_NAMES,h as RESOURCE_CATEGORIES,ge as SCHEMA_ADMIN_PASSWORD_ENV,fe as SCHEMA_ADMIN_USER_ENV,Z as SCOPE_VALUES,P as STANDARD_ENVIRONMENTS,u as STANDARD_ENVIRONMENTS_WITH_ROOT,c as STRUCTURAL_ENVIRONMENTS,B as abbreviateRegion,$ as buildAppConfigPath,i as capitalise,G as categoriseResource,z as deriveAllTargets,ne as deriveContentHashTag,q as deriveRegionsFromOrgConfig,w as deriveTargets,x as filterDangerousEnvVars,oe as findBoundaryPath,re as findInfrastructurePaths,J as findTarget,g as formatErrorString,Q as generateTargetName,t as getDomainExportNames,U as getEnvironmentLabel,p as getErrorCode,s as getErrorMessage,f as getErrorStack,F as getExpectedDuration,X as getFriendlyResourceType,n as getSafeZoneName,A as hasErrorCode,ae as inferContainerFromCandidates,te as isInfrastructureFile,Ne as isReservedAppName,v as isValidEnvironment,V as maskSensitiveOutput,m as normaliseError,y as parseGitRemoteUrl,d as parseShellArgs,C as singleton,M as sleep,S as toKebab,a as toPascalCase,N as toScreamingSnake,_ as toValidDatabaseName};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fjall/util",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.1",
|
|
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": "
|
|
120
|
+
"gitHead": "164e50a0f9097678d2eb8f03c7a192652de0b0a2"
|
|
121
121
|
}
|