@awsless/awsless 0.0.297 → 0.0.298
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.
- package/dist/bin.js +4 -1
- package/package.json +6 -6
- package/dist/bin.d.ts +0 -1
- package/dist/client.d.ts +0 -54
- package/dist/server.d.ts +0 -144
package/dist/bin.js
CHANGED
|
@@ -3910,7 +3910,7 @@ import { AnyStruct, Table } from '@awsless/open-search'
|
|
|
3910
3910
|
|
|
3911
3911
|
type Search = {
|
|
3912
3912
|
readonly domain: string
|
|
3913
|
-
readonly defineTable: <N extends
|
|
3913
|
+
readonly defineTable: <N extends string, S extends AnyStruct>(tableName: N, schema: S) => Table<N, S>
|
|
3914
3914
|
}
|
|
3915
3915
|
`;
|
|
3916
3916
|
var searchFeature = defineFeature({
|
|
@@ -5487,6 +5487,9 @@ var bind = (program2) => {
|
|
|
5487
5487
|
env[name] = unwrap3(value);
|
|
5488
5488
|
}
|
|
5489
5489
|
note3(wrap(list(env)), "Bind Env");
|
|
5490
|
+
if (commands7.length === 0) {
|
|
5491
|
+
return;
|
|
5492
|
+
}
|
|
5490
5493
|
const command = commands7.join(" ");
|
|
5491
5494
|
spawn(command, {
|
|
5492
5495
|
env: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/awsless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.298",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@awsless/lambda": "^0.0.
|
|
31
|
+
"@awsless/lambda": "^0.0.25",
|
|
32
32
|
"@awsless/open-search": "^0.0.12",
|
|
33
33
|
"@awsless/redis": "^0.0.12",
|
|
34
34
|
"@awsless/s3": "^0.0.15",
|
|
35
|
-
"@awsless/sns": "^0.0.7",
|
|
36
35
|
"@awsless/sqs": "^0.0.7",
|
|
36
|
+
"@awsless/sns": "^0.0.7",
|
|
37
37
|
"@awsless/ssm": "^0.0.7",
|
|
38
|
-
"@awsless/
|
|
39
|
-
"@awsless/
|
|
38
|
+
"@awsless/weak-cache": "^0.0.1",
|
|
39
|
+
"@awsless/validate": "^0.0.14"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@arcanyx/cidr-slicer": "^0.3.0",
|
|
@@ -106,10 +106,10 @@
|
|
|
106
106
|
"zod": "^3.21.4",
|
|
107
107
|
"zod-to-json-schema": "^3.22.3",
|
|
108
108
|
"@awsless/duration": "^0.0.1",
|
|
109
|
-
"@awsless/formation": "^0.0.38",
|
|
110
109
|
"@awsless/graphql": "^0.0.9",
|
|
111
110
|
"@awsless/size": "^0.0.1",
|
|
112
111
|
"@awsless/validate": "^0.0.14",
|
|
112
|
+
"@awsless/formation": "^0.0.38",
|
|
113
113
|
"@awsless/code": "^0.0.10"
|
|
114
114
|
},
|
|
115
115
|
"scripts": {
|
package/dist/bin.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
package/dist/client.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
interface AuthResources {
|
|
2
|
-
}
|
|
3
|
-
declare const Auth: AuthResources;
|
|
4
|
-
declare const getAuthProps: (name: string) => {
|
|
5
|
-
readonly userPoolId: string;
|
|
6
|
-
readonly clientId: string;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
interface GraphQLSchema {
|
|
10
|
-
}
|
|
11
|
-
interface GraphQLResources {
|
|
12
|
-
}
|
|
13
|
-
declare const GraphQL: GraphQLResources;
|
|
14
|
-
declare const getGraphQLProps: (name: string) => {
|
|
15
|
-
endpoint: string;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
interface HTTP {
|
|
19
|
-
}
|
|
20
|
-
type Method = 'GET' | 'POST';
|
|
21
|
-
type Path = string;
|
|
22
|
-
type Params = Record<string, string | number>;
|
|
23
|
-
type Query = Record<string, string>;
|
|
24
|
-
type Body = unknown;
|
|
25
|
-
type Route = {
|
|
26
|
-
param?: Params;
|
|
27
|
-
query?: Query;
|
|
28
|
-
body?: Body;
|
|
29
|
-
response: unknown;
|
|
30
|
-
};
|
|
31
|
-
type Routes = Record<Path, Route>;
|
|
32
|
-
type Schema = Partial<Record<Method, Routes>>;
|
|
33
|
-
type GetRoute<S extends Schema, M extends keyof S, P extends keyof S[M]> = S[M] extends Routes ? S[M][P] : never;
|
|
34
|
-
type Props<R extends Route> = {
|
|
35
|
-
headers?: Record<string, string>;
|
|
36
|
-
params?: R['param'] extends Params ? R['param'] : never;
|
|
37
|
-
query?: R['query'] extends Query ? R['query'] : never;
|
|
38
|
-
body?: R['body'] extends Body ? R['body'] : never;
|
|
39
|
-
};
|
|
40
|
-
type HttpFetcher = (props: {
|
|
41
|
-
method: Method;
|
|
42
|
-
path: Path;
|
|
43
|
-
headers: Headers;
|
|
44
|
-
query?: Query;
|
|
45
|
-
body?: Body;
|
|
46
|
-
}) => unknown;
|
|
47
|
-
declare const createHttpFetcher: (host: string) => HttpFetcher;
|
|
48
|
-
declare const createHttpClient: <S extends Partial<Record<Method, Routes>>>(fetcher: HttpFetcher) => {
|
|
49
|
-
fetch: <M extends keyof S, P extends keyof S[M]>(method: M, routeKey: Extract<P, string>, props?: Props<GetRoute<S, M, P>> | undefined) => Promise<GetRoute<S, M, P>["response"]>;
|
|
50
|
-
get<P_1 extends keyof S["GET"]>(routeKey: Extract<P_1, string>, props?: Props<GetRoute<S, "GET", P_1>> | undefined): Promise<GetRoute<S, "GET", P_1>["response"]>;
|
|
51
|
-
post<P_2 extends keyof S["POST"]>(routeKey: Extract<P_2, string>, props?: Props<GetRoute<S, "POST", P_2>> | undefined): Promise<GetRoute<S, "POST", P_2>["response"]>;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export { Auth, AuthResources, GraphQL, GraphQLResources, GraphQLSchema, HTTP, HttpFetcher, createHttpClient, createHttpFetcher, getAuthProps, getGraphQLProps };
|
package/dist/server.d.ts
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { AwsCredentialIdentityProvider } from '@aws-sdk/types';
|
|
2
|
-
import * as _awsless_lambda from '@awsless/lambda';
|
|
3
|
-
import { Handler, Loggers } from '@awsless/lambda';
|
|
4
|
-
import { BaseSchema, SqsQueueSchema, SnsTopicSchema } from '@awsless/validate';
|
|
5
|
-
import * as valibot from 'valibot';
|
|
6
|
-
|
|
7
|
-
declare const regions: readonly ["us-east-2", "us-east-1", "us-west-1", "us-west-2", "af-south-1", "ap-east-1", "ap-south-2", "ap-southeast-3", "ap-southeast-4", "ap-south-1", "ap-northeast-3", "ap-northeast-2", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ca-central-1", "eu-central-1", "eu-west-1", "eu-west-2", "eu-south-1", "eu-west-3", "eu-south-2", "eu-north-1", "eu-central-2", "me-south-1", "me-central-1", "sa-east-1"];
|
|
8
|
-
type Region = (typeof regions)[number];
|
|
9
|
-
|
|
10
|
-
type Credentials = AwsCredentialIdentityProvider;
|
|
11
|
-
|
|
12
|
-
type CommandContext = {
|
|
13
|
-
region: Region;
|
|
14
|
-
credentials: Credentials;
|
|
15
|
-
accountId: string;
|
|
16
|
-
update: (msg: string) => void;
|
|
17
|
-
};
|
|
18
|
-
type CommandHandler = (options: CommandOptions, context: CommandContext) => Promise<string | undefined | void>;
|
|
19
|
-
declare class CommandOptions {
|
|
20
|
-
private opts;
|
|
21
|
-
constructor(args: string[]);
|
|
22
|
-
get(name: string): any;
|
|
23
|
-
private getAssertType;
|
|
24
|
-
number(name: string): number;
|
|
25
|
-
string(name: string): string;
|
|
26
|
-
boolean(name: string): boolean;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
type CronProps<H extends Handler<S>, S extends BaseSchema> = {
|
|
30
|
-
handle: H;
|
|
31
|
-
schema?: S;
|
|
32
|
-
logger?: Loggers;
|
|
33
|
-
};
|
|
34
|
-
declare const cron: <H extends Handler<S, unknown>, S extends BaseSchema<any, any>>(props: CronProps<H, S>) => (event: _awsless_lambda.Input<S>, context?: _awsless_lambda.LambdaContext | undefined) => Promise<Awaited<ReturnType<H>>>;
|
|
35
|
-
|
|
36
|
-
type FunctionProps<H extends Handler<S>, S extends BaseSchema> = {
|
|
37
|
-
handle: H;
|
|
38
|
-
schema?: S;
|
|
39
|
-
logger?: Loggers;
|
|
40
|
-
logViewableErrors?: boolean;
|
|
41
|
-
};
|
|
42
|
-
declare const func: <H extends Handler<S, unknown>, S extends BaseSchema<any, any>>(props: FunctionProps<H, S>) => (event: _awsless_lambda.Input<S>, context?: _awsless_lambda.LambdaContext | undefined) => Promise<Awaited<ReturnType<H>>>;
|
|
43
|
-
|
|
44
|
-
type QueueProps<H extends Handler<S>, S extends BaseSchema> = {
|
|
45
|
-
handle: H;
|
|
46
|
-
schema?: S;
|
|
47
|
-
logger?: Loggers;
|
|
48
|
-
};
|
|
49
|
-
declare const queue: <H extends Handler<SqsQueueSchema<S>, unknown>, S extends BaseSchema<any, any>>(props: QueueProps<H, S>) => (event: valibot.Input<S> | valibot.Input<S>[] | {
|
|
50
|
-
Records: {
|
|
51
|
-
body: string | valibot.Input<S>;
|
|
52
|
-
}[];
|
|
53
|
-
}, context?: _awsless_lambda.LambdaContext | undefined) => Promise<Awaited<ReturnType<H>>>;
|
|
54
|
-
|
|
55
|
-
type TopicProps<H extends Handler<S>, S extends BaseSchema> = {
|
|
56
|
-
handle: H;
|
|
57
|
-
schema?: S;
|
|
58
|
-
logger?: Loggers;
|
|
59
|
-
};
|
|
60
|
-
declare const topic: <H extends Handler<SnsTopicSchema<S>, unknown>, S extends BaseSchema<any, any>>(props: TopicProps<H, S>) => (event: valibot.Input<S> | valibot.Input<S>[] | {
|
|
61
|
-
Records: {
|
|
62
|
-
Sns: {
|
|
63
|
-
Message: string | valibot.Input<S>;
|
|
64
|
-
};
|
|
65
|
-
}[];
|
|
66
|
-
}, context?: _awsless_lambda.LambdaContext | undefined) => Promise<Awaited<ReturnType<H>>>;
|
|
67
|
-
|
|
68
|
-
interface FunctionMock {
|
|
69
|
-
}
|
|
70
|
-
interface FunctionMockResponse {
|
|
71
|
-
}
|
|
72
|
-
declare const mockFunction: (cb: (mock: FunctionMock) => void) => FunctionMockResponse;
|
|
73
|
-
|
|
74
|
-
interface QueueMock {
|
|
75
|
-
}
|
|
76
|
-
interface QueueMockResponse {
|
|
77
|
-
}
|
|
78
|
-
declare const mockQueue: (cb: (mock: QueueMock) => void) => QueueMockResponse;
|
|
79
|
-
|
|
80
|
-
interface TaskMock {
|
|
81
|
-
}
|
|
82
|
-
interface TaskMockResponse {
|
|
83
|
-
}
|
|
84
|
-
declare const mockTask: (cb: (mock: TaskMock) => void) => TaskMockResponse;
|
|
85
|
-
|
|
86
|
-
interface TopicMock {
|
|
87
|
-
}
|
|
88
|
-
interface TopicMockResponse {
|
|
89
|
-
}
|
|
90
|
-
declare const mockTopic: (cb: (mock: TopicMock) => void) => TopicMockResponse;
|
|
91
|
-
|
|
92
|
-
declare const getCacheProps: (name: string, stack?: string) => {
|
|
93
|
-
readonly host: string;
|
|
94
|
-
readonly port: number;
|
|
95
|
-
};
|
|
96
|
-
interface CacheResources {
|
|
97
|
-
}
|
|
98
|
-
declare const Cache: CacheResources;
|
|
99
|
-
|
|
100
|
-
declare const getConfigName: (name: string) => string;
|
|
101
|
-
interface ConfigResources {
|
|
102
|
-
}
|
|
103
|
-
declare const Config: ConfigResources;
|
|
104
|
-
|
|
105
|
-
declare const getFunctionName: <N extends string, S extends string = "stack">(name: N, stack?: S) => `app--${S}--function--${N}`;
|
|
106
|
-
interface FunctionResources {
|
|
107
|
-
}
|
|
108
|
-
declare const Function: FunctionResources;
|
|
109
|
-
declare const Fn: FunctionResources;
|
|
110
|
-
|
|
111
|
-
declare const getQueueName: <N extends string, S extends string = "stack">(name: N, stack?: S) => `app--${S}--queue--${N}`;
|
|
112
|
-
interface QueueResources {
|
|
113
|
-
}
|
|
114
|
-
declare const Queue: QueueResources;
|
|
115
|
-
|
|
116
|
-
declare const getSearchName: <N extends string, S extends string = "stack">(name: N, stack?: S) => `app--${S}--search--${N}`;
|
|
117
|
-
interface SearchResources {
|
|
118
|
-
}
|
|
119
|
-
declare const Search: SearchResources;
|
|
120
|
-
|
|
121
|
-
declare const getStoreName: <N extends string, S extends string = "stack">(name: N, stack?: S) => `app--${S}--store--${N}`;
|
|
122
|
-
interface StoreResources {
|
|
123
|
-
}
|
|
124
|
-
declare const Store: StoreResources;
|
|
125
|
-
|
|
126
|
-
declare const getTableName: <N extends string, S extends string = "stack">(name: N, stack?: S) => `app--${S}--table--${N}`;
|
|
127
|
-
interface TableResources {
|
|
128
|
-
}
|
|
129
|
-
declare const Table: TableResources;
|
|
130
|
-
|
|
131
|
-
declare const getTaskName: <N extends string, S extends string = "stack">(name: N, stack?: S) => `app--${S}--task--${N}`;
|
|
132
|
-
interface TaskResources {
|
|
133
|
-
}
|
|
134
|
-
declare const Task: TaskResources;
|
|
135
|
-
|
|
136
|
-
declare const getTopicName: <N extends string>(name: N) => `app--topic--${N}`;
|
|
137
|
-
interface TopicResources {
|
|
138
|
-
}
|
|
139
|
-
declare const Topic: TopicResources;
|
|
140
|
-
|
|
141
|
-
declare const APP: "app";
|
|
142
|
-
declare const STACK: "stack";
|
|
143
|
-
|
|
144
|
-
export { APP, Cache, CacheResources, CommandContext, CommandHandler, CommandOptions, Config, ConfigResources, CronProps, Fn, Function, FunctionMock, FunctionMockResponse, FunctionProps, FunctionResources, Queue, QueueMock, QueueMockResponse, QueueProps, QueueResources, STACK, Search, SearchResources, Store, StoreResources, Table, TableResources, Task, TaskMock, TaskMockResponse, TaskResources, Topic, TopicMock, TopicMockResponse, TopicProps, TopicResources, cron, func, getCacheProps, getConfigName, getFunctionName, getQueueName, getSearchName, getStoreName, getTableName, getTaskName, getTopicName, mockFunction, mockQueue, mockTask, mockTopic, queue, topic };
|