Skip to content

Commit

Permalink
fix: use the new inflight interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
skyrpex committed Apr 12, 2024
1 parent 750690f commit 4af0c3e
Show file tree
Hide file tree
Showing 27 changed files with 51 additions and 69 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;
}
}
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
26 changes: 1 addition & 25 deletions redis/redis.extern.d.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,7 @@
export default interface extern {
newRedisClient: (url: string, redisPassword: string) => Promise<IRedisClient$Inflight>,
}
/** Trait marker for classes that can be depended upon.
The presence of this interface indicates that an object has
an `IDependable` implementation.
This interface can be used to take an (ordering) dependency on a set of
constructs. An ordering dependency implies that the resources represented by
those constructs are deployed before the resources depending ON them are
deployed. */
export interface IDependable$Inflight {
}
/** Represents a construct. */
export interface IConstruct$Inflight extends IDependable$Inflight {
}
/** Data that can be lifted into inflight. */
export interface ILiftable$Inflight {
}
/** A liftable object that needs to be registered on the host as part of the lifting process.
This is generally used so the host can set up permissions
to access the lifted object inflight. */
export interface IHostedLiftable$Inflight extends ILiftable$Inflight {
}
/** Abstract interface for `Resource`. */
export interface IResource$Inflight extends IConstruct$Inflight, IHostedLiftable$Inflight {
}
export interface IRedis$Inflight extends IResource$Inflight {
export interface IRedis$Inflight {
readonly del: (key: string) => Promise<void>;
readonly get: (key: string) => Promise<(string) | undefined>;
readonly hGet: (key: string, field: string) => Promise<(string) | undefined>;
Expand Down
4 changes: 2 additions & 2 deletions tsoa/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 tsoa/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@winglibs/tsoa",
"description": "TSOA library for Wing",
"version": "0.1.0",
"version": "0.1.1",
"author": {
"email": "[email protected]",
"name": "Eyal Keren"
Expand Down
2 changes: 1 addition & 1 deletion tsoa/sim.w
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bring ui;
bring util;
bring "./types.w" as types;

interface StartResponse {
inflight interface StartResponse {
inflight port(): num;
inflight close(): void;
}
Expand Down
Loading

0 comments on commit 4af0c3e

Please sign in to comment.