Skip to content

Commit

Permalink
fix(cognito): symbol name conflict (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chriscbr authored Mar 28, 2024
1 parent d27588d commit 0440bb8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cognito/lib.w
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ pub class Cognito impl types.ICognito {
new(api: cloud.Api, props: types.CognitoProps?) {
let target = util.env("WING_TARGET");
if target == "sim" {
this.inner = new sim.Cognito(api, props) as "sim";
this.inner = new sim.Cognito_sim(api, props) as "sim";
this.clientId = "sim-client-id";
this.userPoolId = "sim-user-pool-id";
} elif target == "tf-aws" {
let auth = new tfaws.Cognito(api, props) as "tf-aws";
let auth = new tfaws.Cognito_tfaws(api, props) as "tf-aws";
this.clientId = auth.clientId;
this.userPoolId = auth.userPoolId;
this.inner = auth;
Expand Down
2 changes: 1 addition & 1 deletion cognito/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@winglibs/cognito",
"version": "0.0.3",
"version": "0.0.4",
"description": "A wing library to work with AWS Cognito",
"author": {
"name": "Elad Cohen",
Expand Down
2 changes: 1 addition & 1 deletion cognito/platform/sim.w
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ interface ICallable {
call(api: cloud.Api, method: str, handler: inflight (cloud.ApiRequest): cloud.ApiResponse): void;
}

pub class Cognito impl types.ICognito {
pub class Cognito_sim impl types.ICognito {
api: cloud.Api;
counter: cloud.Counter;
table: ex.Table;
Expand Down
8 changes: 4 additions & 4 deletions cognito/platform/tfaws.w
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ bring aws as awsUtils;
bring "@cdktf/provider-aws" as aws;
bring "../types.w" as types;

pub class Cognito impl types.ICognito {
pub class Cognito_tfaws impl types.ICognito {
api: cloud.Api;
name: str;
pub clientId: str;
Expand Down Expand Up @@ -105,15 +105,15 @@ pub class Cognito impl types.ICognito {
}

pub inflight signUp(email: str, password: str): void {
Cognito._signUp(this.clientId, email, password);
Cognito_tfaws._signUp(this.clientId, email, password);
}

pub inflight adminConfirmUser(email: str): void {
Cognito._adminConfirmUser(this.userPoolId, email);
Cognito_tfaws._adminConfirmUser(this.userPoolId, email);
}

pub inflight initiateAuth(email: str, password: str): str {
return Cognito._initiateAuth(this.clientId, email, password);
return Cognito_tfaws._initiateAuth(this.clientId, email, password);
}

pub onLift(host: std.IInflightHost, ops: Array<str>) {
Expand Down

0 comments on commit 0440bb8

Please sign in to comment.