@amerged/ohmyhost-mcp 0.1.19 → 0.1.21

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.
@@ -40,7 +40,8 @@ export class CredentialStoreIntegrityError extends Error {
40
40
  }
41
41
  }
42
42
 
43
- const CREDENTIAL_ACCOUNT = "credential";
43
+ /** The single login entry of clients before named profiles; it is only read to migrate it. */
44
+ export const LEGACY_CREDENTIAL_ACCOUNT = "credential";
44
45
 
45
46
  export class NativeNapiKeyringCredentialStore implements CredentialStore {
46
47
  private readonly createEntry: KeyringEntryFactory;
@@ -48,6 +49,7 @@ export class NativeNapiKeyringCredentialStore implements CredentialStore {
48
49
  public constructor(
49
50
  createEntry: KeyringEntryFactory | undefined = undefined,
50
51
  serviceName = "ohmyhost",
52
+ private readonly account = LEGACY_CREDENTIAL_ACCOUNT,
51
53
  ) {
52
54
  this.createEntry = createEntry ?? createNativeEntryFactory(serviceName);
53
55
  }
@@ -72,7 +74,7 @@ export class NativeNapiKeyringCredentialStore implements CredentialStore {
72
74
  }
73
75
 
74
76
  private entry(): Promise<KeyringEntry> {
75
- return this.createEntry(CREDENTIAL_ACCOUNT);
77
+ return this.createEntry(this.account);
76
78
  }
77
79
  }
78
80
 
@@ -84,7 +86,7 @@ const parseVerifiedCredential = (serialized: string | undefined): StoredCredenti
84
86
  }
85
87
  };
86
88
 
87
- const createNativeEntryFactory = (serviceName: string): KeyringEntryFactory => {
89
+ export const createNativeEntryFactory = (serviceName: string): KeyringEntryFactory => {
88
90
  if (!/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u.test(serviceName)) {
89
91
  throw new CredentialStoreUnavailableError();
90
92
  }
@@ -4,14 +4,18 @@ export * from "./composition.js";
4
4
  export * from "./credential-store.js";
5
5
  export * from "./file-credential-store.js";
6
6
  export * from "./product-api.js";
7
+ export * from "./profile-store.js";
7
8
  export * from "./project-link-store.js";
8
9
  export * from "./repository-init.js";
9
10
  export * from "./workspace.js";
11
+ export type { PublicAccount } from "./runtime-contract.js";
10
12
  export {
11
13
  parseAccountProfile,
12
14
  parseCurrentIdentity,
13
15
  parseDevAccessTicket,
14
16
  parseDevAccessState,
17
+ parsePoweredByFlag,
18
+ parseOrganizationReferral,
15
19
  parseCloudflareDnsAuthorization,
16
20
  parseCloudflareDnsAuthorizationStatus,
17
21
  parsePaidDomain,
@@ -45,6 +45,7 @@ import {
45
45
  type BillingPortal,
46
46
  getOrganizationCredits,
47
47
  getOrganizationAccount,
48
+ getOrganizationReferral,
48
49
  type OrganizationAccount,
49
50
  getOrganizationCreditUsage,
50
51
  type OrganizationCreditUsage,
@@ -61,6 +62,8 @@ import {
61
62
  rotateProjectDevShareLink,
62
63
  revokeProjectDevShareLink,
63
64
  setProjectDevAccessMode,
65
+ getProjectPoweredByFlag,
66
+ setProjectPoweredByFlag,
64
67
  createDeployment,
65
68
  createProject,
66
69
  submitFeedback,
@@ -130,7 +133,7 @@ import {
130
133
  type Deployment,
131
134
  type SourceAutoDeploy,
132
135
  } from "@ohmyhost/sdk-ts";
133
- import { parseAccountProfile, type PublicWorkspace } from "./runtime-contract.js";
136
+ import { parseAccountProfile, type PublicAccount } from "./runtime-contract.js";
134
137
 
135
138
  export interface ProjectCreateInput {
136
139
  readonly organizationId: string;
@@ -193,6 +196,9 @@ export interface ProductApi {
193
196
  }): Promise<import("@ohmyhost/sdk-ts").BillingRecharge>;
194
197
  createBillingPortal(organizationId: string): Promise<BillingPortal>;
195
198
  getOrganizationAccount(organizationId: string): Promise<OrganizationAccount>;
199
+ getOrganizationReferral(
200
+ organizationId: string,
201
+ ): Promise<import("@ohmyhost/sdk-ts").OrganizationReferral>;
196
202
  getOrganizationCredits(organizationId: string): Promise<OrganizationCredits>;
197
203
  getOrganizationCreditUsage(input: {
198
204
  organizationId: string;
@@ -212,8 +218,8 @@ export interface ProductApi {
212
218
  readonly idempotencyKey: string;
213
219
  }): Promise<Organization>;
214
220
  getCurrentIdentity(): Promise<CurrentIdentity>;
215
- /** The signed-in user's workspaces; an interactive session is required for this route. */
216
- getAccountProfile(): Promise<readonly PublicWorkspace[]>;
221
+ /** The signed-in user and its workspaces; an interactive session is required for this route. */
222
+ getAccountProfile(): Promise<PublicAccount>;
217
223
  listProjects(input: { readonly cursor?: string; readonly limit: number }): Promise<ProjectPage>;
218
224
  checkProjectHandle(input: { readonly handle: string }): Promise<ProjectHandleAvailability>;
219
225
  changeProjectHandle(input: {
@@ -277,6 +283,12 @@ export interface ProductApi {
277
283
  mode: "protected" | "public",
278
284
  idempotencyKey: string,
279
285
  ): Promise<import("@ohmyhost/sdk-ts").DevAccessState>;
286
+ getPoweredByFlag(projectId: string): Promise<import("@ohmyhost/sdk-ts").PoweredByFlag>;
287
+ setPoweredByFlag(
288
+ projectId: string,
289
+ enabled: boolean,
290
+ idempotencyKey: string,
291
+ ): Promise<import("@ohmyhost/sdk-ts").PoweredByFlag>;
280
292
  submitFeedback(input: {
281
293
  report: import("@ohmyhost/sdk-ts").FeedbackSubmission;
282
294
  idempotencyKey: string;
@@ -485,10 +497,13 @@ export class GeneratedSdkProductApi implements ProductApi {
485
497
  return getCurrentIdentity({}, { client: this.#client });
486
498
  }
487
499
 
488
- public async getAccountProfile(): Promise<readonly PublicWorkspace[]> {
500
+ public async getAccountProfile(): Promise<PublicAccount> {
489
501
  return parseAccountProfile(await getAccountProfile({ client: this.#client }));
490
502
  }
491
503
 
504
+ public getOrganizationReferral(organizationId: string) {
505
+ return getOrganizationReferral({ organization_id: organizationId }, { client: this.#client });
506
+ }
492
507
  public getOrganizationAccount(organizationId: string) {
493
508
  return getOrganizationAccount({ organization_id: organizationId }, { client: this.#client });
494
509
  }
@@ -790,6 +805,19 @@ export class GeneratedSdkProductApi implements ProductApi {
790
805
  { client: this.#client },
791
806
  );
792
807
  }
808
+ public async getPoweredByFlag(projectId: string) {
809
+ return getProjectPoweredByFlag({ project_id: projectId }, { client: this.#client });
810
+ }
811
+ public async setPoweredByFlag(projectId: string, enabled: boolean, idempotencyKey: string) {
812
+ return setProjectPoweredByFlag(
813
+ {
814
+ project_id: projectId,
815
+ "Idempotency-Key": idempotencyKey,
816
+ setPoweredByFlagRequest: { enabled },
817
+ },
818
+ { client: this.#client },
819
+ );
820
+ }
793
821
  public async createDevAccessTicket(projectId: string): Promise<DevAccessTicket> {
794
822
  return createProjectDevAccessTicket({ project_id: projectId }, { client: this.#client });
795
823
  }