@awsless/awsless 0.0.631 → 0.0.633
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 +85 -37
- package/dist/prebuild/icon/bundle.zip +0 -0
- package/dist/prebuild/image/bundle.zip +0 -0
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/dist/server.d.ts +6 -1
- package/dist/server.js +22 -0
- package/package.json +13 -13
package/dist/bin.js
CHANGED
|
@@ -3947,8 +3947,55 @@ var createAsyncLambdaFunction = (group, ctx, ns, id, local) => {
|
|
|
3947
3947
|
};
|
|
3948
3948
|
|
|
3949
3949
|
// src/feature/cron/index.ts
|
|
3950
|
+
import { camelCase as camelCase3 } from "change-case";
|
|
3951
|
+
import { relative as relative3 } from "node:path";
|
|
3952
|
+
var typeGenCode2 = `
|
|
3953
|
+
import { InvokeOptions } from '@awsless/lambda'
|
|
3954
|
+
import type { Mock } from 'vitest'
|
|
3955
|
+
|
|
3956
|
+
type Func = (...args: any[]) => any
|
|
3957
|
+
|
|
3958
|
+
type Options = Omit<InvokeOptions, 'name' | 'payload' | 'type' | 'reflectViewableErrors'>
|
|
3959
|
+
|
|
3960
|
+
type Invoke<N extends string, F extends Func> = unknown extends Parameters<F>[0] ? InvokeWithoutPayload<N, F> : InvokeWithPayload<N, F>
|
|
3961
|
+
|
|
3962
|
+
type InvokeWithPayload<Name extends string, F extends Func> = {
|
|
3963
|
+
readonly name: Name
|
|
3964
|
+
(payload: Parameters<F>[0], options?: Options): Promise<void>
|
|
3965
|
+
}
|
|
3966
|
+
|
|
3967
|
+
type InvokeWithoutPayload<Name extends string, F extends Func> = {
|
|
3968
|
+
readonly name: Name
|
|
3969
|
+
(payload?: Parameters<F>[0], options?: Options): Promise<void>
|
|
3970
|
+
}
|
|
3971
|
+
`;
|
|
3950
3972
|
var cronFeature = defineFeature({
|
|
3951
3973
|
name: "cron",
|
|
3974
|
+
async onTypeGen(ctx) {
|
|
3975
|
+
const types2 = new TypeFile("@awsless/awsless");
|
|
3976
|
+
const resources2 = new TypeObject(1);
|
|
3977
|
+
for (const stack of ctx.stackConfigs) {
|
|
3978
|
+
const resource = new TypeObject(2);
|
|
3979
|
+
for (const [name, props] of Object.entries(stack.tasks || {})) {
|
|
3980
|
+
const varName = camelCase3(`${stack.name}-${name}`);
|
|
3981
|
+
const funcName = formatLocalResourceName({
|
|
3982
|
+
appName: ctx.appConfig.name,
|
|
3983
|
+
stackName: stack.name,
|
|
3984
|
+
resourceType: "cron",
|
|
3985
|
+
resourceName: name
|
|
3986
|
+
});
|
|
3987
|
+
if ("file" in props.consumer.code) {
|
|
3988
|
+
const relFile = relative3(directories.types, props.consumer.code.file);
|
|
3989
|
+
types2.addImport(varName, relFile);
|
|
3990
|
+
resource.addType(name, `Invoke<'${funcName}', typeof ${varName}>`);
|
|
3991
|
+
}
|
|
3992
|
+
}
|
|
3993
|
+
resources2.addType(stack.name, resource);
|
|
3994
|
+
}
|
|
3995
|
+
types2.addCode(typeGenCode2);
|
|
3996
|
+
types2.addInterface("CronResources", resources2);
|
|
3997
|
+
await ctx.write("cron.d.ts", types2, true);
|
|
3998
|
+
},
|
|
3952
3999
|
onApp(ctx) {
|
|
3953
4000
|
const found = ctx.stackConfigs.find((stackConfig) => Object.keys(stackConfig.crons ?? {}).length > 0);
|
|
3954
4001
|
if (found) {
|
|
@@ -4214,10 +4261,10 @@ var domainFeature = defineFeature({
|
|
|
4214
4261
|
// src/feature/function/index.ts
|
|
4215
4262
|
import { Group as Group6 } from "@terraforge/core";
|
|
4216
4263
|
import { aws as aws7 } from "@terraforge/aws";
|
|
4217
|
-
import { camelCase as
|
|
4218
|
-
import { relative as
|
|
4264
|
+
import { camelCase as camelCase4 } from "change-case";
|
|
4265
|
+
import { relative as relative4 } from "path";
|
|
4219
4266
|
import deepmerge2 from "deepmerge";
|
|
4220
|
-
var
|
|
4267
|
+
var typeGenCode3 = `
|
|
4221
4268
|
import { InvokeOptions, InvokeResponse } from '@awsless/lambda'
|
|
4222
4269
|
import type { PartialDeep } from 'type-fest'
|
|
4223
4270
|
import type { Mock } from 'vitest'
|
|
@@ -4258,7 +4305,7 @@ var functionFeature = defineFeature({
|
|
|
4258
4305
|
const mockResponse = new TypeObject(2);
|
|
4259
4306
|
for (const [name, local] of Object.entries(stack.functions || {})) {
|
|
4260
4307
|
const props = deepmerge2(ctx.appConfig.defaults.function, local);
|
|
4261
|
-
const varName =
|
|
4308
|
+
const varName = camelCase4(`${stack.name}-${name}`);
|
|
4262
4309
|
const funcName = formatLocalResourceName({
|
|
4263
4310
|
appName: ctx.appConfig.name,
|
|
4264
4311
|
stackName: stack.name,
|
|
@@ -4266,7 +4313,7 @@ var functionFeature = defineFeature({
|
|
|
4266
4313
|
resourceName: name
|
|
4267
4314
|
});
|
|
4268
4315
|
if ("file" in local.code) {
|
|
4269
|
-
const relFile =
|
|
4316
|
+
const relFile = relative4(directories.types, local.code.file);
|
|
4270
4317
|
if (props.runtime === "container") {
|
|
4271
4318
|
resource.addType(name, `Invoke<'${funcName}', Func>`);
|
|
4272
4319
|
mock.addType(name, `MockBuilder<Func>`);
|
|
@@ -4283,7 +4330,7 @@ var functionFeature = defineFeature({
|
|
|
4283
4330
|
resources2.addType(stack.name, resource);
|
|
4284
4331
|
mockResponses.addType(stack.name, mockResponse);
|
|
4285
4332
|
}
|
|
4286
|
-
types2.addCode(
|
|
4333
|
+
types2.addCode(typeGenCode3);
|
|
4287
4334
|
types2.addInterface("FunctionResources", resources2);
|
|
4288
4335
|
types2.addInterface("FunctionMock", mocks);
|
|
4289
4336
|
types2.addInterface("FunctionMockResponse", mockResponses);
|
|
@@ -4546,12 +4593,12 @@ var pubsubFeature = defineFeature({
|
|
|
4546
4593
|
// src/feature/queue/index.ts
|
|
4547
4594
|
import { Group as Group10 } from "@terraforge/core";
|
|
4548
4595
|
import { aws as aws11 } from "@terraforge/aws";
|
|
4549
|
-
import { camelCase as
|
|
4596
|
+
import { camelCase as camelCase5, constantCase as constantCase6 } from "change-case";
|
|
4550
4597
|
import deepmerge3 from "deepmerge";
|
|
4551
|
-
import { relative as
|
|
4598
|
+
import { relative as relative5 } from "path";
|
|
4552
4599
|
import { seconds as seconds5, toSeconds as toSeconds4 } from "@awsless/duration";
|
|
4553
4600
|
import { toBytes } from "@awsless/size";
|
|
4554
|
-
var
|
|
4601
|
+
var typeGenCode4 = `
|
|
4555
4602
|
import { SendMessageOptions, SendMessageBatchOptions, BatchItem } from '@awsless/sqs'
|
|
4556
4603
|
import type { Mock } from 'vitest'
|
|
4557
4604
|
|
|
@@ -4580,7 +4627,7 @@ var queueFeature = defineFeature({
|
|
|
4580
4627
|
const mock = new TypeObject(2);
|
|
4581
4628
|
const mockResponse = new TypeObject(2);
|
|
4582
4629
|
for (const [name, props] of Object.entries(stack.queues || {})) {
|
|
4583
|
-
const varName =
|
|
4630
|
+
const varName = camelCase5(`${stack.name}-${name}`);
|
|
4584
4631
|
const queueName = formatLocalResourceName({
|
|
4585
4632
|
appName: ctx.appConfig.name,
|
|
4586
4633
|
stackName: stack.name,
|
|
@@ -4588,7 +4635,7 @@ var queueFeature = defineFeature({
|
|
|
4588
4635
|
resourceName: name
|
|
4589
4636
|
});
|
|
4590
4637
|
if (typeof props === "object" && "file" in props.consumer.code) {
|
|
4591
|
-
const relFile =
|
|
4638
|
+
const relFile = relative5(directories.types, props.consumer.code.file);
|
|
4592
4639
|
gen.addImport(varName, relFile);
|
|
4593
4640
|
mock.addType(name, `MockBuilder<typeof ${varName}>`);
|
|
4594
4641
|
resource.addType(name, `Send<'${queueName}', typeof ${varName}>`);
|
|
@@ -4603,7 +4650,7 @@ var queueFeature = defineFeature({
|
|
|
4603
4650
|
resources2.addType(stack.name, resource);
|
|
4604
4651
|
mockResponses.addType(stack.name, mockResponse);
|
|
4605
4652
|
}
|
|
4606
|
-
gen.addCode(
|
|
4653
|
+
gen.addCode(typeGenCode4);
|
|
4607
4654
|
gen.addInterface("QueueResources", resources2);
|
|
4608
4655
|
gen.addInterface("QueueMock", mocks);
|
|
4609
4656
|
gen.addInterface("QueueMockResponse", mockResponses);
|
|
@@ -4790,11 +4837,11 @@ var restFeature = defineFeature({
|
|
|
4790
4837
|
});
|
|
4791
4838
|
|
|
4792
4839
|
// src/feature/rpc/index.ts
|
|
4793
|
-
import { camelCase as
|
|
4840
|
+
import { camelCase as camelCase6, constantCase as constantCase8, kebabCase as kebabCase6 } from "change-case";
|
|
4794
4841
|
import { Group as Group13 } from "@terraforge/core";
|
|
4795
4842
|
import { aws as aws14 } from "@terraforge/aws";
|
|
4796
4843
|
import { mebibytes as mebibytes3 } from "@awsless/size";
|
|
4797
|
-
import { dirname as dirname5, join as join10, relative as
|
|
4844
|
+
import { dirname as dirname5, join as join10, relative as relative6 } from "path";
|
|
4798
4845
|
import { fileURLToPath } from "node:url";
|
|
4799
4846
|
|
|
4800
4847
|
// src/feature/function/prebuild.ts
|
|
@@ -5001,8 +5048,8 @@ var rpcFeature = defineFeature({
|
|
|
5001
5048
|
for (const stack of ctx.stackConfigs) {
|
|
5002
5049
|
for (const [name, props] of Object.entries(stack.rpc?.[id] ?? {})) {
|
|
5003
5050
|
if ("file" in props.code) {
|
|
5004
|
-
const relFile =
|
|
5005
|
-
const varName =
|
|
5051
|
+
const relFile = relative6(directories.types, props.code.file);
|
|
5052
|
+
const varName = camelCase6(`${id}-${stack.name}-${name}`);
|
|
5006
5053
|
types2.addImport(varName, relFile);
|
|
5007
5054
|
schema.addType(name, `Handle<typeof ${varName}>`);
|
|
5008
5055
|
}
|
|
@@ -5206,7 +5253,7 @@ import { Group as Group14 } from "@terraforge/core";
|
|
|
5206
5253
|
import { aws as aws15 } from "@terraforge/aws";
|
|
5207
5254
|
import { constantCase as constantCase9 } from "change-case";
|
|
5208
5255
|
import { toGibibytes as toGibibytes2 } from "@awsless/size";
|
|
5209
|
-
var
|
|
5256
|
+
var typeGenCode5 = `
|
|
5210
5257
|
import { AnyStruct, Table } from '@awsless/open-search'
|
|
5211
5258
|
|
|
5212
5259
|
type Search = {
|
|
@@ -5226,7 +5273,7 @@ var searchFeature = defineFeature({
|
|
|
5226
5273
|
}
|
|
5227
5274
|
resources2.addType(stack.name, list3);
|
|
5228
5275
|
}
|
|
5229
|
-
gen.addCode(
|
|
5276
|
+
gen.addCode(typeGenCode5);
|
|
5230
5277
|
gen.addInterface("SearchResources", resources2);
|
|
5231
5278
|
await ctx.write("search.d.ts", gen, true);
|
|
5232
5279
|
},
|
|
@@ -5560,7 +5607,7 @@ var getContentType2 = (file) => {
|
|
|
5560
5607
|
|
|
5561
5608
|
// src/feature/store/index.ts
|
|
5562
5609
|
import { join as join12 } from "path";
|
|
5563
|
-
var
|
|
5610
|
+
var typeGenCode6 = `
|
|
5564
5611
|
import { Body, PutObjectProps, BodyStream } from '@awsless/s3'
|
|
5565
5612
|
|
|
5566
5613
|
type Store<Name extends string> = {
|
|
@@ -5589,7 +5636,7 @@ var storeFeature = defineFeature({
|
|
|
5589
5636
|
}
|
|
5590
5637
|
resources2.addType(stack.name, list3);
|
|
5591
5638
|
}
|
|
5592
|
-
gen.addCode(
|
|
5639
|
+
gen.addCode(typeGenCode6);
|
|
5593
5640
|
gen.addInterface("StoreResources", resources2);
|
|
5594
5641
|
await ctx.write("store.d.ts", gen, true);
|
|
5595
5642
|
},
|
|
@@ -5921,16 +5968,16 @@ var tableFeature = defineFeature({
|
|
|
5921
5968
|
// src/feature/task/index.ts
|
|
5922
5969
|
import { Group as Group18 } from "@terraforge/core";
|
|
5923
5970
|
import { aws as aws19 } from "@terraforge/aws";
|
|
5924
|
-
import { camelCase as
|
|
5925
|
-
import { relative as
|
|
5926
|
-
var
|
|
5971
|
+
import { camelCase as camelCase7 } from "change-case";
|
|
5972
|
+
import { relative as relative7 } from "path";
|
|
5973
|
+
var typeGenCode7 = `
|
|
5927
5974
|
import { Duration } from '@awsless/duration'
|
|
5928
5975
|
import { InvokeOptions } from '@awsless/lambda'
|
|
5929
5976
|
import type { Mock } from 'vitest'
|
|
5930
5977
|
|
|
5931
5978
|
type Func = (...args: any[]) => any
|
|
5932
5979
|
|
|
5933
|
-
type Options = Omit<InvokeOptions, 'name' | 'payload' | 'type'> & {
|
|
5980
|
+
type Options = Omit<InvokeOptions, 'name' | 'payload' | 'type' | 'reflectViewableErrors'> & {
|
|
5934
5981
|
schedule?: Duration | Date
|
|
5935
5982
|
}
|
|
5936
5983
|
|
|
@@ -5962,7 +6009,7 @@ var taskFeature = defineFeature({
|
|
|
5962
6009
|
const mock = new TypeObject(2);
|
|
5963
6010
|
const mockResponse = new TypeObject(2);
|
|
5964
6011
|
for (const [name, props] of Object.entries(stack.tasks || {})) {
|
|
5965
|
-
const varName =
|
|
6012
|
+
const varName = camelCase7(`${stack.name}-${name}`);
|
|
5966
6013
|
const funcName = formatLocalResourceName({
|
|
5967
6014
|
appName: ctx.appConfig.name,
|
|
5968
6015
|
stackName: stack.name,
|
|
@@ -5970,7 +6017,7 @@ var taskFeature = defineFeature({
|
|
|
5970
6017
|
resourceName: name
|
|
5971
6018
|
});
|
|
5972
6019
|
if ("file" in props.consumer.code) {
|
|
5973
|
-
const relFile =
|
|
6020
|
+
const relFile = relative7(directories.types, props.consumer.code.file);
|
|
5974
6021
|
types2.addImport(varName, relFile);
|
|
5975
6022
|
resource.addType(name, `Invoke<'${funcName}', typeof ${varName}>`);
|
|
5976
6023
|
mock.addType(name, `MockBuilder<typeof ${varName}>`);
|
|
@@ -5981,7 +6028,7 @@ var taskFeature = defineFeature({
|
|
|
5981
6028
|
resources2.addType(stack.name, resource);
|
|
5982
6029
|
mockResponses.addType(stack.name, mockResponse);
|
|
5983
6030
|
}
|
|
5984
|
-
types2.addCode(
|
|
6031
|
+
types2.addCode(typeGenCode7);
|
|
5985
6032
|
types2.addInterface("TaskResources", resources2);
|
|
5986
6033
|
types2.addInterface("TaskMock", mocks);
|
|
5987
6034
|
types2.addInterface("TaskMockResponse", mockResponses);
|
|
@@ -6074,7 +6121,7 @@ var testFeature = defineFeature({
|
|
|
6074
6121
|
// src/feature/topic/index.ts
|
|
6075
6122
|
import { Group as Group19 } from "@terraforge/core";
|
|
6076
6123
|
import { aws as aws20 } from "@terraforge/aws";
|
|
6077
|
-
var
|
|
6124
|
+
var typeGenCode8 = `
|
|
6078
6125
|
import type { PublishOptions } from '@awsless/sns'
|
|
6079
6126
|
|
|
6080
6127
|
type Publish<Name extends string> = {
|
|
@@ -6102,7 +6149,7 @@ var topicFeature = defineFeature({
|
|
|
6102
6149
|
resources2.addType(topic, `Publish<'${name}'>`);
|
|
6103
6150
|
mocks.addType(topic, `MockBuilder`);
|
|
6104
6151
|
}
|
|
6105
|
-
gen.addCode(
|
|
6152
|
+
gen.addCode(typeGenCode8);
|
|
6106
6153
|
gen.addInterface("TopicResources", resources2);
|
|
6107
6154
|
gen.addInterface("TopicMock", mocks);
|
|
6108
6155
|
gen.addInterface("TopicMockResponse", mockResponses);
|
|
@@ -6265,7 +6312,7 @@ var vpcFeature = defineFeature({
|
|
|
6265
6312
|
// src/feature/alert/index.ts
|
|
6266
6313
|
import { Group as Group21 } from "@terraforge/core";
|
|
6267
6314
|
import { aws as aws22 } from "@terraforge/aws";
|
|
6268
|
-
var
|
|
6315
|
+
var typeGenCode9 = `
|
|
6269
6316
|
import type { PublishOptions } from '@awsless/sns'
|
|
6270
6317
|
|
|
6271
6318
|
type Alert<Name extends string> = {
|
|
@@ -6293,7 +6340,7 @@ var alertFeature = defineFeature({
|
|
|
6293
6340
|
mockResponses.addType(alert, "Mock");
|
|
6294
6341
|
mocks.addType(alert, `MockBuilder`);
|
|
6295
6342
|
}
|
|
6296
|
-
gen.addCode(
|
|
6343
|
+
gen.addCode(typeGenCode9);
|
|
6297
6344
|
gen.addInterface("AlertResources", resources2);
|
|
6298
6345
|
gen.addInterface("AlertMock", mocks);
|
|
6299
6346
|
gen.addInterface("AlertMockResponse", mockResponses);
|
|
@@ -7170,7 +7217,7 @@ import { Group as Group27 } from "@terraforge/core";
|
|
|
7170
7217
|
import { aws as aws28 } from "@terraforge/aws";
|
|
7171
7218
|
import { kebabCase as kebabCase8, constantCase as constantCase13 } from "change-case";
|
|
7172
7219
|
import { toSeconds as toSeconds9 } from "@awsless/duration";
|
|
7173
|
-
var
|
|
7220
|
+
var typeGenCode10 = `
|
|
7174
7221
|
import { type PutDataProps, putData, batchPutData } from '@awsless/cloudwatch'
|
|
7175
7222
|
import { type Duration } from '@awsless/duration'
|
|
7176
7223
|
import { type Size } from '@awsless/size'
|
|
@@ -7218,7 +7265,7 @@ var metricFeature = defineFeature({
|
|
|
7218
7265
|
resources2.addType(stack.name, stackResources);
|
|
7219
7266
|
}
|
|
7220
7267
|
resources2.addType("batch", "Batch");
|
|
7221
|
-
gen.addCode(
|
|
7268
|
+
gen.addCode(typeGenCode10);
|
|
7222
7269
|
gen.addInterface("MetricResources", resources2);
|
|
7223
7270
|
await ctx.write("metric.d.ts", gen, true);
|
|
7224
7271
|
},
|
|
@@ -7299,7 +7346,7 @@ var metricFeature = defineFeature({
|
|
|
7299
7346
|
import { days as days7, seconds as seconds9, toSeconds as toSeconds10, years } from "@awsless/duration";
|
|
7300
7347
|
import { Future, Group as Group28 } from "@terraforge/core";
|
|
7301
7348
|
import { aws as aws29 } from "@terraforge/aws";
|
|
7302
|
-
import { camelCase as
|
|
7349
|
+
import { camelCase as camelCase8, constantCase as constantCase14 } from "change-case";
|
|
7303
7350
|
|
|
7304
7351
|
// src/feature/router/router-code.ts
|
|
7305
7352
|
var getViewerRequestFunctionCode = (props) => {
|
|
@@ -7579,7 +7626,7 @@ var routerFeature = defineFeature({
|
|
|
7579
7626
|
const originRequest = new aws29.cloudfront.OriginRequestPolicy(group, "request", {
|
|
7580
7627
|
name,
|
|
7581
7628
|
headersConfig: {
|
|
7582
|
-
headerBehavior:
|
|
7629
|
+
headerBehavior: camelCase8("all-except"),
|
|
7583
7630
|
headers: {
|
|
7584
7631
|
items: [
|
|
7585
7632
|
"host"
|
|
@@ -7790,6 +7837,7 @@ var routerFeature = defineFeature({
|
|
|
7790
7837
|
originProtocolPolicy: "http-only",
|
|
7791
7838
|
originReadTimeout: 20,
|
|
7792
7839
|
originSslProtocols: ["TLSv1.2"]
|
|
7840
|
+
// originKeepaliveTimeout: 30,
|
|
7793
7841
|
}
|
|
7794
7842
|
]
|
|
7795
7843
|
}
|
|
@@ -9838,7 +9886,7 @@ import { log as log23 } from "@awsless/clui";
|
|
|
9838
9886
|
|
|
9839
9887
|
// src/type-gen/generate.ts
|
|
9840
9888
|
import { mkdir as mkdir5, writeFile as writeFile4 } from "fs/promises";
|
|
9841
|
-
import { dirname as dirname10, join as join19, relative as
|
|
9889
|
+
import { dirname as dirname10, join as join19, relative as relative8 } from "path";
|
|
9842
9890
|
var generateTypes = async (props) => {
|
|
9843
9891
|
const files = [];
|
|
9844
9892
|
await Promise.all(
|
|
@@ -9850,7 +9898,7 @@ var generateTypes = async (props) => {
|
|
|
9850
9898
|
const path = join19(directories.types, file);
|
|
9851
9899
|
if (code) {
|
|
9852
9900
|
if (include) {
|
|
9853
|
-
files.push(
|
|
9901
|
+
files.push(relative8(directories.root, path));
|
|
9854
9902
|
}
|
|
9855
9903
|
await mkdir5(dirname10(path), { recursive: true });
|
|
9856
9904
|
await writeFile4(path, code);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/server.d.ts
CHANGED
|
@@ -81,6 +81,11 @@ interface ConfigResources {
|
|
|
81
81
|
}
|
|
82
82
|
declare const Config: ConfigResources;
|
|
83
83
|
|
|
84
|
+
declare const getCronName: <N extends string, S extends string = "stack">(resourceName: N, stackName?: S) => `app--${S}--cron--${N}`;
|
|
85
|
+
interface CronResources {
|
|
86
|
+
}
|
|
87
|
+
declare const Cron: CronResources;
|
|
88
|
+
|
|
84
89
|
declare const getFunctionName: <N extends string, S extends string = "stack">(resourceName: N, stackName?: S) => `app--${S}--function--${N}`;
|
|
85
90
|
interface FunctionResources {
|
|
86
91
|
}
|
|
@@ -168,4 +173,4 @@ declare const Topic: TopicResources;
|
|
|
168
173
|
declare const APP: "app";
|
|
169
174
|
declare const STACK: "stack";
|
|
170
175
|
|
|
171
|
-
export { APP, Alert, type AlertMock, type AlertMockResponse, type AlertResources, Auth, type AuthResources, Cache, type CacheResources, type CommandContext, type CommandHandler, Config, type ConfigResources, Fn, Function, type FunctionMock, type FunctionMockResponse, type FunctionResources, Metric, type MetricResources, PubSub, type PublishOptions, Queue, type QueueMock, type QueueMockResponse, type QueueResources, type RpcAuthorizerResponse, STACK, Search, type SearchResources, Store, type StoreResources, Table, type TableResources, Task, type TaskMock, type TaskMockResponse, type TaskResources, Topic, type TopicMock, type TopicMockResponse, type TopicResources, getAlertName, getAuthProps, getCacheProps, getConfigName, getConfigValue, getFunctionName, getMetricName, getMetricNamespace, getPubSubTopic, getQueueName, getQueueUrl, getSearchName, getSearchProps, getSiteBucketName, getStoreName, getTableName, getTaskName, getTopicName, mockAlert, mockCache, mockFunction, mockMetric, mockPubSub, mockQueue, mockTask, mockTopic, pubsubAuthorizerHandle, pubsubAuthorizerResponse, setConfigValue };
|
|
176
|
+
export { APP, Alert, type AlertMock, type AlertMockResponse, type AlertResources, Auth, type AuthResources, Cache, type CacheResources, type CommandContext, type CommandHandler, Config, type ConfigResources, Cron, type CronResources, Fn, Function, type FunctionMock, type FunctionMockResponse, type FunctionResources, Metric, type MetricResources, PubSub, type PublishOptions, Queue, type QueueMock, type QueueMockResponse, type QueueResources, type RpcAuthorizerResponse, STACK, Search, type SearchResources, Store, type StoreResources, Table, type TableResources, Task, type TaskMock, type TaskMockResponse, type TaskResources, Topic, type TopicMock, type TopicMockResponse, type TopicResources, getAlertName, getAuthProps, getCacheProps, getConfigName, getConfigValue, getCronName, getFunctionName, getMetricName, getMetricNamespace, getPubSubTopic, getQueueName, getQueueUrl, getSearchName, getSearchProps, getSiteBucketName, getStoreName, getTableName, getTaskName, getTopicName, mockAlert, mockCache, mockFunction, mockMetric, mockPubSub, mockQueue, mockTask, mockTopic, pubsubAuthorizerHandle, pubsubAuthorizerResponse, setConfigValue };
|
package/dist/server.js
CHANGED
|
@@ -457,6 +457,26 @@ var Config = /* @__PURE__ */ new Proxy(
|
|
|
457
457
|
}
|
|
458
458
|
);
|
|
459
459
|
|
|
460
|
+
// src/lib/server/cron.ts
|
|
461
|
+
import { invoke as invoke3 } from "@awsless/lambda";
|
|
462
|
+
var getCronName = bindLocalResourceName("cron");
|
|
463
|
+
var Cron = /* @__PURE__ */ createProxy((stackName) => {
|
|
464
|
+
return createProxy((taskName) => {
|
|
465
|
+
const name = getCronName(taskName, stackName);
|
|
466
|
+
const ctx = {
|
|
467
|
+
[name]: async (payload, options = {}) => {
|
|
468
|
+
await invoke3({
|
|
469
|
+
...options,
|
|
470
|
+
type: "Event",
|
|
471
|
+
name,
|
|
472
|
+
payload
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
};
|
|
476
|
+
return ctx[name];
|
|
477
|
+
});
|
|
478
|
+
});
|
|
479
|
+
|
|
460
480
|
// src/lib/server/metric.ts
|
|
461
481
|
import {
|
|
462
482
|
batchPutData,
|
|
@@ -670,6 +690,7 @@ export {
|
|
|
670
690
|
Auth,
|
|
671
691
|
Cache,
|
|
672
692
|
Config,
|
|
693
|
+
Cron,
|
|
673
694
|
Fn,
|
|
674
695
|
Function,
|
|
675
696
|
Metric,
|
|
@@ -687,6 +708,7 @@ export {
|
|
|
687
708
|
getCacheProps,
|
|
688
709
|
getConfigName,
|
|
689
710
|
getConfigValue,
|
|
711
|
+
getCronName,
|
|
690
712
|
getFunctionName,
|
|
691
713
|
getMetricName,
|
|
692
714
|
getMetricNamespace,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/awsless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.633",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -34,21 +34,21 @@
|
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@awsless/big-float": "^0.1.5",
|
|
37
|
+
"@awsless/clui": "^0.0.8",
|
|
37
38
|
"@awsless/duration": "^0.0.4",
|
|
38
39
|
"@awsless/json": "^0.0.11",
|
|
39
40
|
"@awsless/dynamodb": "^0.3.14",
|
|
40
|
-
"@awsless/iot": "^0.0.3",
|
|
41
|
-
"@awsless/cloudwatch": "^0.0.1",
|
|
42
|
-
"@awsless/mqtt": "^0.0.2",
|
|
43
41
|
"@awsless/lambda": "^0.0.36",
|
|
44
|
-
"@awsless/
|
|
42
|
+
"@awsless/cloudwatch": "^0.0.1",
|
|
45
43
|
"@awsless/s3": "^0.0.21",
|
|
46
|
-
"@awsless/
|
|
44
|
+
"@awsless/open-search": "^0.0.21",
|
|
45
|
+
"@awsless/validate": "^0.1.5",
|
|
46
|
+
"@awsless/iot": "^0.0.3",
|
|
47
47
|
"@awsless/sqs": "^0.0.16",
|
|
48
48
|
"@awsless/sns": "^0.0.10",
|
|
49
|
+
"@awsless/mqtt": "^0.0.2",
|
|
50
|
+
"@awsless/redis": "^0.0.14",
|
|
49
51
|
"@awsless/ssm": "^0.0.7",
|
|
50
|
-
"@awsless/open-search": "^0.0.21",
|
|
51
|
-
"@awsless/validate": "^0.1.5",
|
|
52
52
|
"@awsless/weak-cache": "^0.0.1"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@swc/core": "^1.3.70",
|
|
77
77
|
"@terraforge/aws": "^6.35.1",
|
|
78
78
|
"@terraforge/core": "^0.0.22",
|
|
79
|
-
"@terraforge/terraform": "^0.0.
|
|
79
|
+
"@terraforge/terraform": "^0.0.19",
|
|
80
80
|
"@types/aws-lambda": "^8.10.110",
|
|
81
81
|
"@types/bun": "1.3.10",
|
|
82
82
|
"@types/chunk": "^0.0.0",
|
|
@@ -140,15 +140,15 @@
|
|
|
140
140
|
"zip-a-folder": "^3.1.6",
|
|
141
141
|
"zod": "^3.24.2",
|
|
142
142
|
"zod-to-json-schema": "^3.24.3",
|
|
143
|
-
"@awsless/big-float": "^0.1.5",
|
|
144
143
|
"@awsless/cloudwatch": "^0.0.1",
|
|
145
|
-
"@awsless/
|
|
144
|
+
"@awsless/big-float": "^0.1.5",
|
|
146
145
|
"@awsless/duration": "^0.0.4",
|
|
147
|
-
"@awsless/graphql": "^0.0.9",
|
|
148
146
|
"@awsless/json": "^0.0.11",
|
|
147
|
+
"@awsless/size": "^0.0.2",
|
|
149
148
|
"@awsless/scheduler": "^0.0.4",
|
|
150
149
|
"@awsless/validate": "^0.1.5",
|
|
151
|
-
"@awsless/
|
|
150
|
+
"@awsless/graphql": "^0.0.9",
|
|
151
|
+
"@awsless/clui": "^0.0.8",
|
|
152
152
|
"@awsless/ts-file-cache": "^0.0.12"
|
|
153
153
|
},
|
|
154
154
|
"devDependencies": {
|