Skip to content

Commit

Permalink
fix: use the new inflight interface modifier (#199)
Browse files Browse the repository at this point in the history
Use the new `inflight interface` modifier introduced by winglang/wing#6197.
  • Loading branch information
skyrpex authored Apr 12, 2024
1 parent 38adce3 commit a8b56d9
Show file tree
Hide file tree
Showing 30 changed files with 58 additions and 76 deletions.
2 changes: 1 addition & 1 deletion dynamodb/dynamodb-client.w
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
bring "./dynamodb-types.w" as dynamodb_types;

interface DocumentClient {
inflight interface DocumentClient {
inflight batchGet(input: Json): Json;
inflight batchWrite(input: Json): Json;
inflight delete(input: Json): Json;
Expand Down
2 changes: 1 addition & 1 deletion dynamodb/dynamodb-types.w
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ pub struct Connection {
clientConfig: ClientConfig?;
}

pub interface IClient {
pub inflight interface IClient {
inflight delete(options: DeleteOptions): DeleteOutput;
inflight get(options: GetOptions): GetOutput;
inflight put(options: PutOptions): PutOutput;
Expand Down
2 changes: 1 addition & 1 deletion dynamodb/dynamodb.sim.w
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bring cloud;
bring "./dynamodb-types.w" as dynamodb_types;
bring "./dynamodb-client.w" as dynamodb_client;

interface Client {
inflight interface Client {
inflight createTable(input: Json): Json;
inflight deleteTable(input: Json): Json;
inflight updateTimeToLive(input: Json): Json;
Expand Down
4 changes: 2 additions & 2 deletions dynamodb/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dynamodb/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@winglibs/dynamodb",
"version": "0.1.5",
"version": "0.1.6",
"description": "DynamoDB library for Wing",
"author": {
"name": "Cristian Pallarés",
Expand Down
4 changes: 2 additions & 2 deletions github/octokit/types.w
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ struct ListForOrgProps {
org: str;
}

interface OctoKitRepos {
inflight interface OctoKitRepos {
inflight getContent(options: GetContentProps): GetContentResponse;
inflight getCommit(options: GetCommitProps): GetCommitResponse;
inflight compareCommits(options: CompareCommitsProps): CompareCommitsResponse;
Expand All @@ -308,4 +308,4 @@ pub struct OctoKit {
git: OctoKitGit;
issues: OctoKitIssues;
repos: OctoKitRepos;
}
}
4 changes: 2 additions & 2 deletions github/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion github/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@winglibs/github",
"description": "A Wing library for GitHub Probot",
"version": "0.0.8",
"version": "0.0.9",
"author": {
"name": "Elad Cohen",
"email": "[email protected]"
Expand Down
4 changes: 2 additions & 2 deletions github/probot/adapter.w
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
bring "../octokit/types.w" as octokit;
bring "./types.w" as probot;

pub interface IProbotAppCredentialsSupplier {
pub inflight interface IProbotAppCredentialsSupplier {
inflight getId(): str;
inflight getWebhookSecret(): str;
inflight getPrivateKey(): str;
Expand Down Expand Up @@ -31,7 +31,7 @@ pub class ProbotAdapter {
inflight new() {
this.instance = ProbotAdapter.createProbotAdapter(
appId: this.credentialsSupplier.getId(),
privateKey: this.credentialsSupplier.getPrivateKey(),
privateKey: this.credentialsSupplier.getPrivateKey(),
webhookSecret: this.credentialsSupplier.getWebhookSecret()
);
}
Expand Down
4 changes: 2 additions & 2 deletions github/probot/types.w
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ pub struct VerifyAndReceieveProps {
payload: str;
}

pub interface IProbotWebhooks {
pub inflight interface IProbotWebhooks {
inflight on(name: str, handler: inflight (): void): void;
inflight verifyAndReceive(props: VerifyAndReceieveProps): void;
}

pub interface IProbotAuth {
pub inflight interface IProbotAuth {
inflight call(instance: ProbotInstance, installationId: num): octokit.OctoKit;
}

Expand Down
4 changes: 2 additions & 2 deletions github/simutils/simutils.w
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ bring cloud;
bring util;
bring sim;

pub interface Process {
pub inflight interface Process {
inflight kill(): void;
}

Expand Down Expand Up @@ -50,4 +50,4 @@ pub class Port {
});
}
extern "./simutils.js" static inflight findPort(): num;
}
}
8 changes: 4 additions & 4 deletions jwt/lib.w
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ struct IJwksClientOptions {
jwksUri: str;
}

interface IJwksSigningKey {
inflight interface IJwksSigningKey {
inflight getPublicKey(): str;
}

interface IJwksClient {
inflight interface IJwksClient {
inflight getSigningKey(kid: str?): IJwksSigningKey;
}

interface IJwt {
inflight interface IJwt {
inflight jwksClient(options: IJwksClientOptions): IJwksClient;
inflight sign(data: Json, secret: str, options: Json?): str;
inflight verify(token: str, secret: inflight (JwtHeader, inflight (str, str): void): void, options: VerifyJwtOptions?): Json;
Expand Down Expand Up @@ -105,7 +105,7 @@ pub class Util {
throw "Either secret or jwksUri must be provided";
}
}

pub inflight static decode(token: str, options: DecodeOptions?): Json {
return JwtUtil._jwt().decode(token, options);
}
Expand Down
4 changes: 2 additions & 2 deletions jwt/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion jwt/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@winglibs/jwt",
"description": "Wing library for JWT authentication",
"version": "0.0.3",
"version": "0.0.4",
"repository": {
"type": "git",
"url": "https://github.com/winglang/winglibs.git",
Expand Down
12 changes: 6 additions & 6 deletions ngrok/ngrok.w
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ bring util;
bring fs;
bring sim;

interface ChildProcess {
inflight interface ChildProcess {
inflight kill(): void;
inflight url(): str;
}

pub interface OnConnectHandler {
pub inflight interface OnConnectHandler {
inflight handle(url: str): void;
}

Expand Down Expand Up @@ -49,17 +49,17 @@ pub class Tunnel {
} catch e {
log("error: {e}");

// ugly: without this an exception will cause dependents to
// ugly: without this an exception will cause dependents to
// never be initialized and the app will fail to start
this.state.set("url", "<error>");
}
}
});

// no need to show the ugly details
nodeof(s).hidden = true;
nodeof(this.state).hidden = true;
} else {
// ugly: without this an exception will cause dependents to
// ugly: without this an exception will cause dependents to
// never be initialized and the app will fail to start
new cloud.Service(inflight () => {
this.state.set("url", "<test>");
Expand Down
4 changes: 2 additions & 2 deletions ngrok/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ngrok/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@winglibs/ngrok",
"version": "0.0.5",
"version": "0.0.6",
"description": "ngrok library for Wing",
"author": {
"name": "Elad Ben-Israel",
Expand Down
4 changes: 2 additions & 2 deletions openai/openai.w
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub struct OpenAIProps {
orgSecret: cloud.Secret?;
}

interface IClient {
inflight interface IClient {
inflight createCompletion(params: Json): Json;
}

Expand All @@ -40,7 +40,7 @@ pub class OpenAI {
mock: bool;

inflight openai: IClient;

new(props: OpenAIProps?) {
this.apiKey = props?.apiKeySecret;
this.org = props?.orgSecret;
Expand Down
4 changes: 2 additions & 2 deletions openai/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion openai/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@winglibs/openai",
"description": "OpenAI library for Wing",
"version": "0.0.3",
"version": "0.0.4",
"repository": {
"type": "git",
"url": "https://github.com/winglang/winglibs.git",
Expand Down
4 changes: 2 additions & 2 deletions redis/api.w
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub interface IRedis extends std.IResource {
pub inflight interface IRedis {
inflight url(): str;
inflight set(key:str, value: str): void;
inflight get(key: str): str?;
Expand All @@ -9,7 +9,7 @@ pub interface IRedis extends std.IResource {
inflight del(key: str): void;
}

pub interface IRedisClient extends IRedis {
pub inflight interface IRedisClient extends IRedis {
inflight connect(): void;
inflight disconnect(): void;
}
Expand Down
10 changes: 8 additions & 2 deletions redis/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion redis/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@winglibs/redis",
"version": "0.0.7",
"version": "0.0.8",
"description": "Redis resource for Wing",
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit a8b56d9

Please sign in to comment.