@amerged/ohmyhost-cli 0.1.55 → 0.1.57

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.
Files changed (30) hide show
  1. package/README.md +1 -1
  2. package/dist/bin.js +1 -1
  3. package/dist/{chunk-4OAAJX5B.js → chunk-GODV5QDC.js} +797 -86
  4. package/dist/index.js +9 -1
  5. package/package.json +1 -1
  6. package/src/apps/product-cli/package.json +1 -1
  7. package/src/apps/product-cli/src/cli.ts +208 -11
  8. package/src/apps/product-cli/src/command.ts +276 -19
  9. package/src/apps/product-cli/src/index.ts +1 -0
  10. package/src/apps/product-cli/src/product-api.ts +165 -3
  11. package/src/apps/product-cli/src/repository-init.ts +8 -0
  12. package/src/apps/product-cli/src/runtime-contract.ts +81 -5
  13. package/src/apps/product-cli/src/user-token-file.ts +73 -0
  14. package/src/packages/contracts/package.json +5 -0
  15. package/src/packages/contracts/src/credit-pricing.ts +1 -1
  16. package/src/packages/contracts/src/database-events.ts +67 -0
  17. package/src/packages/contracts/src/framework-admission.ts +5 -4
  18. package/src/packages/contracts/src/framework-source-rules.ts +9 -2
  19. package/src/packages/contracts/src/index.ts +9 -0
  20. package/src/packages/contracts/src/operation-deployment-result.ts +121 -1
  21. package/src/packages/contracts/src/operation-failure.ts +72 -1
  22. package/src/packages/contracts/src/organization-mcp-connections.ts +7 -0
  23. package/src/packages/contracts/src/problem-policy.ts +17 -5
  24. package/src/packages/contracts/src/secret-names.ts +10 -2
  25. package/src/packages/sdk-ts/package.json +1 -1
  26. package/src/packages/sdk-ts/src/generated/index.ts +36 -0
  27. package/src/packages/sdk-ts/src/generated/sdk.gen.ts +265 -1
  28. package/src/packages/sdk-ts/src/generated/types.gen.ts +445 -2
  29. package/src/packages/sdk-ts/src/managed-mail-response.ts +12 -0
  30. package/src/packages/sdk-ts/src/managed-mail.ts +10 -1
@@ -11,6 +11,10 @@ import {
11
11
  type TDataShape,
12
12
  } from "./client/index.js";
13
13
  import type {
14
+ ActivateDatabaseWebhookSubscriptionErrors,
15
+ ActivateDatabaseWebhookSubscriptionResponses,
16
+ AddProjectDevelopmentEnvironmentErrors,
17
+ AddProjectDevelopmentEnvironmentResponses,
14
18
  ApplicationDomainIdentityRequest,
15
19
  ApplyPaidProjectDomainErrors,
16
20
  ApplyPaidProjectDomainResponses,
@@ -88,6 +92,8 @@ import type {
88
92
  DatabaseTableCreateRequest,
89
93
  DatabaseWatchCreateRequest,
90
94
  DatabaseWebhookCreateRequest,
95
+ DeactivateDatabaseWebhookSubscriptionErrors,
96
+ DeactivateDatabaseWebhookSubscriptionResponses,
91
97
  DeclareApplicationDomainIdentityErrors,
92
98
  DeclareApplicationDomainIdentityResponses,
93
99
  DeleteEnvironmentSecretErrors,
@@ -133,6 +139,8 @@ import type {
133
139
  GetCurrentIdentityResponses,
134
140
  GetDatabaseComputeErrors,
135
141
  GetDatabaseComputeResponses,
142
+ GetDatabaseWebhookSubscriptionErrors,
143
+ GetDatabaseWebhookSubscriptionResponses,
136
144
  GetDeploymentErrors,
137
145
  GetDeploymentLogsErrors,
138
146
  GetDeploymentLogsResponses,
@@ -326,6 +334,8 @@ import type {
326
334
  RevokeWorkspaceMailDomainDnsAuthorizationResponses,
327
335
  RollbackDeploymentErrors,
328
336
  RollbackDeploymentResponses,
337
+ RotateEnvironmentSecretErrors,
338
+ RotateEnvironmentSecretResponses,
329
339
  RotateManagedMailWebhookSecretErrors,
330
340
  RotateManagedMailWebhookSecretResponses,
331
341
  RotateProjectDevShareLinkErrors,
@@ -3493,6 +3503,59 @@ export const setProjectNotes = <ThrowOnError extends boolean = true>(
3493
3503
  });
3494
3504
  };
3495
3505
 
3506
+ /**
3507
+ * Add Dev to a production-only project
3508
+ *
3509
+ * Creates a Dev environment without changing Prod. Shared data reuses the current Prod data assignment; isolated data receives its own assignment. An identical idempotent retry returns the original accepted operation. Projects that already have Dev return development_environment_exists.
3510
+ */
3511
+ export const addProjectDevelopmentEnvironment = <ThrowOnError extends boolean = true>(
3512
+ parameters: {
3513
+ "X-Request-Id"?: string;
3514
+ "Idempotency-Key": string;
3515
+ project_id: Ulid;
3516
+ body: {
3517
+ [key: string]: never;
3518
+ };
3519
+ },
3520
+ options?: Options<never, ThrowOnError>,
3521
+ ): RequestResult<
3522
+ AddProjectDevelopmentEnvironmentResponses,
3523
+ AddProjectDevelopmentEnvironmentErrors,
3524
+ ThrowOnError,
3525
+ "data"
3526
+ > => {
3527
+ const params = buildClientParams(
3528
+ [parameters],
3529
+ [
3530
+ {
3531
+ args: [
3532
+ { in: "headers", key: "X-Request-Id" },
3533
+ { in: "headers", key: "Idempotency-Key" },
3534
+ { in: "path", key: "project_id" },
3535
+ { key: "body", map: "body" },
3536
+ ],
3537
+ },
3538
+ ],
3539
+ );
3540
+ return (options?.client ?? client).post<
3541
+ AddProjectDevelopmentEnvironmentResponses,
3542
+ AddProjectDevelopmentEnvironmentErrors,
3543
+ ThrowOnError,
3544
+ "data"
3545
+ >({
3546
+ responseStyle: "data",
3547
+ security: [{ scheme: "bearer", type: "http" }],
3548
+ url: "/v1/projects/{project_id}/environments/dev",
3549
+ ...options,
3550
+ ...params,
3551
+ headers: {
3552
+ "Content-Type": "application/json",
3553
+ ...options?.headers,
3554
+ ...params.headers,
3555
+ },
3556
+ });
3557
+ };
3558
+
3496
3559
  /**
3497
3560
  * Get the current project deployment status
3498
3561
  *
@@ -4984,7 +5047,7 @@ export const applyPaidProjectDomain = <ThrowOnError extends boolean = true>(
4984
5047
  /**
4985
5048
  * Plan a deployment
4986
5049
  *
4987
- * Resolves immutable inputs and estimates effects without provider mutation or billable work. The plan targets Dev unless `environment` is `prod`; a Prod plan builds straight into Prod, except that a project with shared data and a database only reaches Prod through promotion. Managed mail requires a confirmed Paid service period; it is checked again before build reservation. Selecting the managed Better Auth bridge does not require managed mail or Paid access. An old sender configuration is not Paid authority. A commit the platform does not admit answers 409 with a nonretryable problem code; for framework_conversion_required, detail is a fixed catalog sentence that names the file, the rule and the required change whenever the refusal is typed.
5050
+ * Resolves immutable inputs and estimates effects without provider mutation or billable work. An omitted `environment` selects Dev when it exists, otherwise Prod. A Prod plan builds straight into Prod, including for a project with shared data; database migrations then affect both environments when Dev exists. Managed mail requires a confirmed Paid service period; it is checked again before build reservation. Selecting the managed Better Auth bridge does not require managed mail or Paid access. An old sender configuration is not Paid authority. A commit the platform does not admit answers 409 with a nonretryable problem code; for framework_conversion_required, detail is a fixed catalog sentence that names the file, the rule and the required change whenever the refusal is typed.
4988
5051
  */
4989
5052
  export const planDeployment = <ThrowOnError extends boolean = true>(
4990
5053
  parameters: {
@@ -5753,6 +5816,159 @@ export const deleteProjectDatabaseWatch = <ThrowOnError extends boolean = true>(
5753
5816
  });
5754
5817
  };
5755
5818
 
5819
+ /**
5820
+ * Read a database webhook subscription
5821
+ *
5822
+ * Returns the current activation generation and state. This read never returns a signing secret.
5823
+ */
5824
+ export const getDatabaseWebhookSubscription = <ThrowOnError extends boolean = true>(
5825
+ parameters: {
5826
+ "X-Request-Id"?: string;
5827
+ project_id: Ulid;
5828
+ subscription_id: Ulid;
5829
+ environment: "dev" | "prod";
5830
+ },
5831
+ options?: Options<never, ThrowOnError>,
5832
+ ): RequestResult<
5833
+ GetDatabaseWebhookSubscriptionResponses,
5834
+ GetDatabaseWebhookSubscriptionErrors,
5835
+ ThrowOnError,
5836
+ "data"
5837
+ > => {
5838
+ const params = buildClientParams(
5839
+ [parameters],
5840
+ [
5841
+ {
5842
+ args: [
5843
+ { in: "headers", key: "X-Request-Id" },
5844
+ { in: "path", key: "project_id" },
5845
+ { in: "path", key: "subscription_id" },
5846
+ { in: "query", key: "environment" },
5847
+ ],
5848
+ },
5849
+ ],
5850
+ );
5851
+ return (options?.client ?? client).get<
5852
+ GetDatabaseWebhookSubscriptionResponses,
5853
+ GetDatabaseWebhookSubscriptionErrors,
5854
+ ThrowOnError,
5855
+ "data"
5856
+ >({
5857
+ responseStyle: "data",
5858
+ security: [{ scheme: "bearer", type: "http" }],
5859
+ url: "/v1/projects/{project_id}/database/webhook-subscriptions/{subscription_id}",
5860
+ ...options,
5861
+ ...params,
5862
+ });
5863
+ };
5864
+
5865
+ /**
5866
+ * Deactivate one webhook subscription generation
5867
+ *
5868
+ * Deactivation is confirmed before a new generation can start. Repeat the same key after an uncertain response. Pending deliveries have no delivery guarantee while the generation is deactivating or inactive.
5869
+ */
5870
+ export const deactivateDatabaseWebhookSubscription = <ThrowOnError extends boolean = true>(
5871
+ parameters: {
5872
+ "X-Request-Id"?: string;
5873
+ "Idempotency-Key": string;
5874
+ project_id: Ulid;
5875
+ subscription_id: Ulid;
5876
+ generation: number;
5877
+ environment: "dev" | "prod";
5878
+ },
5879
+ options?: Options<never, ThrowOnError>,
5880
+ ): RequestResult<
5881
+ DeactivateDatabaseWebhookSubscriptionResponses,
5882
+ DeactivateDatabaseWebhookSubscriptionErrors,
5883
+ ThrowOnError,
5884
+ "data"
5885
+ > => {
5886
+ const params = buildClientParams(
5887
+ [parameters],
5888
+ [
5889
+ {
5890
+ args: [
5891
+ { in: "headers", key: "X-Request-Id" },
5892
+ { in: "headers", key: "Idempotency-Key" },
5893
+ { in: "path", key: "project_id" },
5894
+ { in: "path", key: "subscription_id" },
5895
+ { in: "path", key: "generation" },
5896
+ { in: "query", key: "environment" },
5897
+ ],
5898
+ },
5899
+ ],
5900
+ );
5901
+ return (options?.client ?? client).delete<
5902
+ DeactivateDatabaseWebhookSubscriptionResponses,
5903
+ DeactivateDatabaseWebhookSubscriptionErrors,
5904
+ ThrowOnError,
5905
+ "data"
5906
+ >({
5907
+ responseStyle: "data",
5908
+ security: [{ scheme: "bearer", type: "http" }],
5909
+ url: "/v1/projects/{project_id}/database/webhook-subscriptions/{subscription_id}/activations/{generation}",
5910
+ ...options,
5911
+ ...params,
5912
+ });
5913
+ };
5914
+
5915
+ /**
5916
+ * Activate or reconcile one webhook subscription generation
5917
+ *
5918
+ * The client chooses a stable subscription ULID and starts with generation 1. Repeat the identical request and Idempotency-Key after an uncertain reply to recover the original signing secret. A new generation needs a new key and is accepted only after the previous one is confirmed inactive. A late retry of an old generation is refused. Status reads never reveal the secret; save this authorized response privately. If the provider outcome remains unknown near the end of its 24-hour idempotency window, the operation stays pending rather than risk creating a duplicate. The five-webhook database limit includes existing webhooks.
5919
+ */
5920
+ export const activateDatabaseWebhookSubscription = <ThrowOnError extends boolean = true>(
5921
+ parameters: {
5922
+ "X-Request-Id"?: string;
5923
+ "Idempotency-Key": string;
5924
+ project_id: Ulid;
5925
+ subscription_id: Ulid;
5926
+ generation: number;
5927
+ environment: "dev" | "prod";
5928
+ databaseWebhookCreateRequest: DatabaseWebhookCreateRequest;
5929
+ },
5930
+ options?: Options<never, ThrowOnError>,
5931
+ ): RequestResult<
5932
+ ActivateDatabaseWebhookSubscriptionResponses,
5933
+ ActivateDatabaseWebhookSubscriptionErrors,
5934
+ ThrowOnError,
5935
+ "data"
5936
+ > => {
5937
+ const params = buildClientParams(
5938
+ [parameters],
5939
+ [
5940
+ {
5941
+ args: [
5942
+ { in: "headers", key: "X-Request-Id" },
5943
+ { in: "headers", key: "Idempotency-Key" },
5944
+ { in: "path", key: "project_id" },
5945
+ { in: "path", key: "subscription_id" },
5946
+ { in: "path", key: "generation" },
5947
+ { in: "query", key: "environment" },
5948
+ { key: "databaseWebhookCreateRequest", map: "body" },
5949
+ ],
5950
+ },
5951
+ ],
5952
+ );
5953
+ return (options?.client ?? client).put<
5954
+ ActivateDatabaseWebhookSubscriptionResponses,
5955
+ ActivateDatabaseWebhookSubscriptionErrors,
5956
+ ThrowOnError,
5957
+ "data"
5958
+ >({
5959
+ responseStyle: "data",
5960
+ security: [{ scheme: "bearer", type: "http" }],
5961
+ url: "/v1/projects/{project_id}/database/webhook-subscriptions/{subscription_id}/activations/{generation}",
5962
+ ...options,
5963
+ ...params,
5964
+ headers: {
5965
+ "Content-Type": "application/json",
5966
+ ...options?.headers,
5967
+ ...params.headers,
5968
+ },
5969
+ });
5970
+ };
5971
+
5756
5972
  /**
5757
5973
  * List the project's database webhooks
5758
5974
  *
@@ -6791,6 +7007,54 @@ export const putEnvironmentSecret = <ThrowOnError extends boolean = true>(
6791
7007
  });
6792
7008
  };
6793
7009
 
7010
+ /**
7011
+ * Rotate an installed platform key
7012
+ *
7013
+ * Replaces the value of an installed platform key (OHMYHOST_AI_KEY, OHMYHOST_BROWSER_KEY, OHMYHOST_MAIL_KEY, OHMYHOST_STORAGE_KEY or BETTER_AUTH_SECRET) with a value the platform generates. The request has no body and the value is never returned. The earlier value stops authorizing at once, and the new value reaches the running environment without a deployment. Other names answer 400; an installed key the environment does not hold answers 404. Repeating the same idempotency key replays the stored metadata.
7014
+ */
7015
+ export const rotateEnvironmentSecret = <ThrowOnError extends boolean = true>(
7016
+ parameters: {
7017
+ "X-Request-Id"?: string;
7018
+ "Idempotency-Key": string;
7019
+ project_id: Ulid;
7020
+ environment_id: Ulid;
7021
+ secret_name: string;
7022
+ },
7023
+ options?: Options<never, ThrowOnError>,
7024
+ ): RequestResult<
7025
+ RotateEnvironmentSecretResponses,
7026
+ RotateEnvironmentSecretErrors,
7027
+ ThrowOnError,
7028
+ "data"
7029
+ > => {
7030
+ const params = buildClientParams(
7031
+ [parameters],
7032
+ [
7033
+ {
7034
+ args: [
7035
+ { in: "headers", key: "X-Request-Id" },
7036
+ { in: "headers", key: "Idempotency-Key" },
7037
+ { in: "path", key: "project_id" },
7038
+ { in: "path", key: "environment_id" },
7039
+ { in: "path", key: "secret_name" },
7040
+ ],
7041
+ },
7042
+ ],
7043
+ );
7044
+ return (options?.client ?? client).post<
7045
+ RotateEnvironmentSecretResponses,
7046
+ RotateEnvironmentSecretErrors,
7047
+ ThrowOnError,
7048
+ "data"
7049
+ >({
7050
+ responseStyle: "data",
7051
+ security: [{ scheme: "bearer", type: "http" }],
7052
+ url: "/v1/projects/{project_id}/environments/{environment_id}/secrets/{secret_name}/rotate",
7053
+ ...options,
7054
+ ...params,
7055
+ });
7056
+ };
7057
+
6794
7058
  /**
6795
7059
  * Get an operation
6796
7060
  */