@opengeni/config 0.7.7 → 0.7.10
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 +2 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +29 -0
package/dist/index.d.ts
CHANGED
|
@@ -125,6 +125,8 @@ declare const SettingsSchema: z.ZodObject<{
|
|
|
125
125
|
integrationsStateSecret: z.ZodOptional<z.ZodString>;
|
|
126
126
|
integrationsAllowPrivateNetworkTargets: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
|
|
127
127
|
integrationsOauthClientsJson: z.ZodDefault<z.ZodString>;
|
|
128
|
+
slackClientId: z.ZodOptional<z.ZodString>;
|
|
129
|
+
slackClientSecret: z.ZodOptional<z.ZodString>;
|
|
128
130
|
maxNestedAgentDepth: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
129
131
|
goalMaxAutoContinuations: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
130
132
|
goalNoProgressLimit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
package/dist/index.js
CHANGED
|
@@ -214,6 +214,8 @@ var SettingsSchema = z.object({
|
|
|
214
214
|
integrationsStateSecret: z.string().optional(),
|
|
215
215
|
integrationsAllowPrivateNetworkTargets: EnvBoolean.default(false),
|
|
216
216
|
integrationsOauthClientsJson: z.string().default("{}"),
|
|
217
|
+
slackClientId: z.string().optional(),
|
|
218
|
+
slackClientSecret: z.string().optional(),
|
|
217
219
|
// Undefined is meaningful: the migration boundary persists the product
|
|
218
220
|
// default of 3 when no deployment override is supplied.
|
|
219
221
|
maxNestedAgentDepth: z.coerce.number().int().nonnegative().max(MAX_NESTED_AGENT_DEPTH).optional(),
|
|
@@ -1123,6 +1125,8 @@ function getSettings() {
|
|
|
1123
1125
|
"OPENGENI_INTEGRATIONS_ALLOW_PRIVATE_NETWORK_TARGETS"
|
|
1124
1126
|
),
|
|
1125
1127
|
integrationsOauthClientsJson: optional("OPENGENI_INTEGRATIONS_OAUTH_CLIENTS_JSON"),
|
|
1128
|
+
slackClientId: optional("OPENGENI_SLACK_CLIENT_ID"),
|
|
1129
|
+
slackClientSecret: optional("OPENGENI_SLACK_CLIENT_SECRET"),
|
|
1126
1130
|
maxNestedAgentDepth: optional("OPENGENI_MAX_NESTED_AGENT_DEPTH"),
|
|
1127
1131
|
goalMaxAutoContinuations: optional("OPENGENI_GOAL_MAX_AUTO_CONTINUATIONS"),
|
|
1128
1132
|
goalNoProgressLimit: optional("OPENGENI_GOAL_NO_PROGRESS_LIMIT"),
|
|
@@ -2559,6 +2563,28 @@ function validateSettings(settings) {
|
|
|
2559
2563
|
);
|
|
2560
2564
|
}
|
|
2561
2565
|
}
|
|
2566
|
+
if (Boolean(settings.slackClientId) !== Boolean(settings.slackClientSecret)) {
|
|
2567
|
+
throw new Error(
|
|
2568
|
+
"OPENGENI_SLACK_CLIENT_ID and OPENGENI_SLACK_CLIENT_SECRET must be configured together"
|
|
2569
|
+
);
|
|
2570
|
+
}
|
|
2571
|
+
if (settings.slackClientId) {
|
|
2572
|
+
if (!settings.publicBaseUrl) {
|
|
2573
|
+
throw new Error(
|
|
2574
|
+
"OPENGENI_PUBLIC_BASE_URL is required when the OpenGeni Slack app is configured"
|
|
2575
|
+
);
|
|
2576
|
+
}
|
|
2577
|
+
if (!settings.publicBaseUrl.startsWith("https://") && !["local", "test"].includes(settings.environment)) {
|
|
2578
|
+
throw new Error(
|
|
2579
|
+
"OPENGENI_PUBLIC_BASE_URL must use https when the OpenGeni Slack app is configured outside local/test"
|
|
2580
|
+
);
|
|
2581
|
+
}
|
|
2582
|
+
if (!settings.integrationsStateSecret) {
|
|
2583
|
+
throw new Error(
|
|
2584
|
+
"OPENGENI_INTEGRATIONS_STATE_SECRET is required when the OpenGeni Slack app is configured"
|
|
2585
|
+
);
|
|
2586
|
+
}
|
|
2587
|
+
}
|
|
2562
2588
|
parseIntegrationsOauthClientsJson(settings.integrationsOauthClientsJson);
|
|
2563
2589
|
if (settings.productAccessMode === "configured" && !["local", "test"].includes(settings.environment) && !settings.delegationSecret && !settings.authRequired) {
|
|
2564
2590
|
throw new Error(
|