@eide/foir-cli 0.4.4 → 0.4.6

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/cli.js CHANGED
@@ -4601,6 +4601,7 @@ async function reconcileModels(client, configId, models, summary) {
4601
4601
  manifestKeys.add(m.key);
4602
4602
  const config2 = { ...m.config };
4603
4603
  if (m.pluralName) config2.pluralName = m.pluralName;
4604
+ if (m.pluralKey) config2.pluralKey = m.pluralKey;
4604
4605
  if (m.description) config2.description = m.description;
4605
4606
  const ex = existingByKey.get(m.key);
4606
4607
  if (ex) {
@@ -4994,11 +4995,32 @@ function registerPushCommand(program2, globalOpts) {
4994
4995
  }
4995
4996
  const { secret: signingSecret } = await client.operations.getSigningSecret();
4996
4997
  if (signingSecret) {
4997
- envWrites.push({
4998
- key: "FOIR_WEBHOOK_SECRET",
4999
- value: signingSecret,
5000
- label: "Webhook signing secret"
5001
- });
4998
+ const envPath2 = resolve4(opts.env ?? ".env");
4999
+ const envContent = existsSync4(envPath2) ? readFileSync(envPath2, "utf-8") : "";
5000
+ const currentMatch = envContent.match(/^FOIR_WEBHOOK_SECRET=(.*)$/m);
5001
+ const currentValue = currentMatch?.[1];
5002
+ if (currentValue !== signingSecret) {
5003
+ if (currentMatch) {
5004
+ const updated = envContent.replace(
5005
+ /^FOIR_WEBHOOK_SECRET=.*$/m,
5006
+ `FOIR_WEBHOOK_SECRET=${signingSecret}`
5007
+ );
5008
+ writeFileSync2(envPath2, updated, "utf-8");
5009
+ console.log(
5010
+ chalk6.yellow("\u27F3 Webhook signing secret") + chalk6.dim(` \u2192 FOIR_WEBHOOK_SECRET updated in ${envPath2}`)
5011
+ );
5012
+ } else {
5013
+ envWrites.push({
5014
+ key: "FOIR_WEBHOOK_SECRET",
5015
+ value: signingSecret,
5016
+ label: "Webhook signing secret"
5017
+ });
5018
+ }
5019
+ } else {
5020
+ console.log(
5021
+ chalk6.dim(" Webhook signing secret: FOIR_WEBHOOK_SECRET already up to date, skipped")
5022
+ );
5023
+ }
5002
5024
  }
5003
5025
  if (envWrites.length > 0) {
5004
5026
  console.log();
@@ -34,6 +34,7 @@ interface ApplyConfigModelInput {
34
34
  key: string;
35
35
  name: string;
36
36
  pluralName?: string;
37
+ pluralKey?: string;
37
38
  description?: string;
38
39
  fields?: FieldDefinitionInput[];
39
40
  config?: Record<string, unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eide/foir-cli",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
4
4
  "description": "Universal platform CLI for Foir platform",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -49,7 +49,7 @@
49
49
  "@bufbuild/protobuf": "^2.0.0",
50
50
  "@connectrpc/connect": "^2.0.0",
51
51
  "@connectrpc/connect-node": "^2.0.0",
52
- "@eide/foir-proto-ts": "^0.3.3",
52
+ "@eide/foir-proto-ts": "^0.3.5",
53
53
  "chalk": "^5.3.0",
54
54
  "commander": "^12.1.0",
55
55
  "dotenv": "^16.4.5",