@opengeni/config 1.4.0 → 1.4.2
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/index.d.ts +7 -0
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +22 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeni/config",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "OpenGeni runtime configuration: settings resolution, deployment knobs, and config validation shared across the server packages.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"prepublishOnly": "bash ../../scripts/prepublish-guard"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@opengeni/codex": "1.4.
|
|
37
|
-
"@opengeni/contracts": "1.4.
|
|
38
|
-
"@opengeni/xai-subscription": "1.4.
|
|
36
|
+
"@opengeni/codex": "1.4.2",
|
|
37
|
+
"@opengeni/contracts": "1.4.2",
|
|
38
|
+
"@opengeni/xai-subscription": "1.4.2",
|
|
39
39
|
"zod": "^4.2.1"
|
|
40
40
|
},
|
|
41
41
|
"engines": {
|
package/src/index.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
export { managedUserEmailAllowed } from "./managed-user-admission";
|
|
2
|
-
import {
|
|
3
|
-
parseRealtimeVoicePricingJson,
|
|
4
|
-
parseRealtimeVoicePricingTableJson,
|
|
5
|
-
} from "./realtime-voice-pricing";
|
|
6
2
|
export * from "./realtime-voice-pricing";
|
|
7
3
|
export * from "./web-search";
|
|
8
4
|
import { EnvCreditPromotionPolicy } from "./credit-promotions";
|
|
@@ -8103,6 +8099,28 @@ export function parseIntegrationsOauthClientsJson(
|
|
|
8103
8099
|
return out;
|
|
8104
8100
|
}
|
|
8105
8101
|
|
|
8102
|
+
/**
|
|
8103
|
+
* The operator-registered client for one authorization server, matched by
|
|
8104
|
+
* exact issuer/URL key first and then trailing-slash-insensitively. The OAuth
|
|
8105
|
+
* start flow and the connector catalog's connectability projection share this
|
|
8106
|
+
* so a catalog row is offered exactly when a start would find a client.
|
|
8107
|
+
*/
|
|
8108
|
+
export function findIntegrationsOauthClient(
|
|
8109
|
+
configured: Readonly<Record<string, IntegrationOAuthClientConfig>>,
|
|
8110
|
+
candidates: readonly string[],
|
|
8111
|
+
): IntegrationOAuthClientConfig | null {
|
|
8112
|
+
const normalize = (value: string) => value.replace(/\/+$/, "");
|
|
8113
|
+
for (const key of new Set(candidates.flatMap((candidate) => [candidate, normalize(candidate)]))) {
|
|
8114
|
+
const entry = configured[key];
|
|
8115
|
+
if (entry) return entry;
|
|
8116
|
+
}
|
|
8117
|
+
const normalizedCandidates = new Set(candidates.map(normalize));
|
|
8118
|
+
for (const [key, entry] of Object.entries(configured)) {
|
|
8119
|
+
if (normalizedCandidates.has(normalize(key))) return entry;
|
|
8120
|
+
}
|
|
8121
|
+
return null;
|
|
8122
|
+
}
|
|
8123
|
+
|
|
8106
8124
|
export const SocialOAuthClientConfigSchema = z.object({
|
|
8107
8125
|
clientId: z.string().min(1),
|
|
8108
8126
|
clientSecret: z.string().min(1).optional(),
|
|
@@ -8900,11 +8918,6 @@ function validateSettings(settings: Settings, source: NodeJS.ProcessEnv = proces
|
|
|
8900
8918
|
// Malformed voice-input pricing deliberately does not fail boot: every
|
|
8901
8919
|
// process shares this config, and a voice-only typo must not crash-loop
|
|
8902
8920
|
// workers. The provider is withheld and the API logs voiceInputPricingIssues.
|
|
8903
|
-
parseRealtimeVoicePricingJson(settings.azureLivePricingJson, "OPENGENI_AZURE_LIVE_PRICING_JSON");
|
|
8904
|
-
parseRealtimeVoicePricingTableJson(
|
|
8905
|
-
settings.aiGatewayRealtimePricingJson,
|
|
8906
|
-
"OPENGENI_AI_GATEWAY_REALTIME_PRICING_JSON",
|
|
8907
|
-
);
|
|
8908
8921
|
sandboxEnvironmentVariableNames(settings);
|
|
8909
8922
|
sandboxLifecycleHookIds(settings);
|
|
8910
8923
|
// Fail fast on a malformed warm-rate table (P2.1).
|