async getCredsFromStorage()

in src/controller/credentialController.ts [16:41]


  async getCredsFromStorage(): Promise<{
    apiKey: string;
    secret: string;
  }> {
    const [apiKey, secret] = await Promise.all([
      this.secrets.get("amoApiKey"),
      this.secrets.get("amoApiSecret"),
    ]);

    if (!apiKey || !secret) {
      return await NotificationView.showErrorMessage(
        {
          window: {
            other: "No API Key or Secret found",
          },
          thrown: {
            other: "No API Key or Secret found",
          },
        },
        "other",
        this.getCredsFromStorage
      );
    }

    return { apiKey, secret };
  }