@awsless/awsless 0.0.356 → 0.0.358
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 +1 -1
- package/dist/server.d.ts +9 -1
- package/dist/server.js +31 -4
- package/package.json +8 -8
package/dist/bin.js
CHANGED
|
@@ -10998,7 +10998,7 @@ var createAsyncLambdaFunction = (group, ctx, ns, id, local2) => {
|
|
|
10998
10998
|
var authFeature = defineFeature({
|
|
10999
10999
|
name: "auth",
|
|
11000
11000
|
async onTypeGen(ctx) {
|
|
11001
|
-
const gen = new TypeFile("@awsless/awsless
|
|
11001
|
+
const gen = new TypeFile("@awsless/awsless");
|
|
11002
11002
|
const resources = new TypeObject(1);
|
|
11003
11003
|
for (const name of Object.keys(ctx.appConfig.defaults.auth)) {
|
|
11004
11004
|
resources.addType(name, `{ readonly userPoolId: string, readonly clientId: string }`);
|
package/dist/server.d.ts
CHANGED
|
@@ -51,6 +51,14 @@ interface TopicMockResponse {
|
|
|
51
51
|
}
|
|
52
52
|
declare const mockTopic: (cb: (mock: TopicMock) => void) => TopicMockResponse;
|
|
53
53
|
|
|
54
|
+
declare const getAuthProps: (name: string) => {
|
|
55
|
+
readonly userPoolId: string | undefined;
|
|
56
|
+
readonly clientId: string | undefined;
|
|
57
|
+
};
|
|
58
|
+
interface AuthResources {
|
|
59
|
+
}
|
|
60
|
+
declare const Auth: AuthResources;
|
|
61
|
+
|
|
54
62
|
declare const getCacheProps: (name: string, stack?: string) => {
|
|
55
63
|
readonly host: string;
|
|
56
64
|
readonly port: number;
|
|
@@ -118,4 +126,4 @@ declare const Topic: TopicResources;
|
|
|
118
126
|
declare const APP: "app";
|
|
119
127
|
declare const STACK: "stack";
|
|
120
128
|
|
|
121
|
-
export { APP, Cache, type CacheResources, type CommandContext, type CommandHandler, CommandOptions, Config, type ConfigResources, Fn, Function, type FunctionMock, type FunctionMockResponse, type FunctionResources, PubSub, type PublishOptions, Queue, type QueueMock, type QueueMockResponse, type QueueResources, STACK, Search, type SearchResources, Store, type StoreResources, Table, type TableResources, Task, type TaskMock, type TaskMockResponse, type TaskResources, Topic, type TopicMock, type TopicMockResponse, type TopicResources, getCacheProps, getConfigName, getFunctionName, getPubSubTopic, getQueueName, getQueueUrl, getSearchName, getSearchProps, getSiteBucketName, getStoreName, getTableName, getTaskName, getTopicName, mockFunction, mockPubSub, mockQueue, mockTask, mockTopic };
|
|
129
|
+
export { APP, Auth, type AuthResources, Cache, type CacheResources, type CommandContext, type CommandHandler, CommandOptions, Config, type ConfigResources, Fn, Function, type FunctionMock, type FunctionMockResponse, type FunctionResources, PubSub, type PublishOptions, Queue, type QueueMock, type QueueMockResponse, type QueueResources, STACK, Search, type SearchResources, Store, type StoreResources, Table, type TableResources, Task, type TaskMock, type TaskMockResponse, type TaskResources, Topic, type TopicMock, type TopicMockResponse, type TopicResources, getAuthProps, getCacheProps, getConfigName, getFunctionName, getPubSubTopic, getQueueName, getQueueUrl, getSearchName, getSearchProps, getSiteBucketName, getStoreName, getTableName, getTaskName, getTopicName, mockFunction, mockPubSub, mockQueue, mockTask, mockTopic };
|
package/dist/server.js
CHANGED
|
@@ -250,11 +250,36 @@ var mockTopic = (cb) => {
|
|
|
250
250
|
});
|
|
251
251
|
};
|
|
252
252
|
|
|
253
|
+
// src/lib/server/auth.ts
|
|
254
|
+
import { constantCase as constantCase2 } from "change-case";
|
|
255
|
+
var getAuthProps = (name) => {
|
|
256
|
+
return {
|
|
257
|
+
userPoolId: process.env[`${constantCase2(name)}_USER_POOL_ID`],
|
|
258
|
+
clientId: process.env[`${constantCase2(name)}_CLIENT_ID`]
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
var Auth = /* @__PURE__ */ createProxy((name) => {
|
|
262
|
+
const { userPoolId, clientId } = getAuthProps(name);
|
|
263
|
+
return {
|
|
264
|
+
userPoolId,
|
|
265
|
+
clientId
|
|
266
|
+
// async listUsers(limit: number, filter?: string) {
|
|
267
|
+
// return client.send(
|
|
268
|
+
// new ListUsersCommand({
|
|
269
|
+
// UserPoolId: userPoolId,
|
|
270
|
+
// Limit: limit,
|
|
271
|
+
// Filter: filter,
|
|
272
|
+
// })
|
|
273
|
+
// )
|
|
274
|
+
// },
|
|
275
|
+
};
|
|
276
|
+
});
|
|
277
|
+
|
|
253
278
|
// src/lib/server/cache.ts
|
|
254
279
|
import { command } from "@awsless/redis";
|
|
255
|
-
import { constantCase as
|
|
280
|
+
import { constantCase as constantCase3 } from "change-case";
|
|
256
281
|
var getCacheProps = (name, stack = STACK) => {
|
|
257
|
-
const prefix = `CACHE_${
|
|
282
|
+
const prefix = `CACHE_${constantCase3(stack)}_${constantCase3(name)}`;
|
|
258
283
|
return {
|
|
259
284
|
host: process.env[`${prefix}_HOST`],
|
|
260
285
|
port: parseInt(process.env[`${prefix}_PORT`], 10)
|
|
@@ -344,11 +369,11 @@ var PubSub = {
|
|
|
344
369
|
|
|
345
370
|
// src/lib/server/search.ts
|
|
346
371
|
import { define, searchClient } from "@awsless/open-search";
|
|
347
|
-
import { constantCase as
|
|
372
|
+
import { constantCase as constantCase4 } from "change-case";
|
|
348
373
|
var getSearchName = bindLocalResourceName("search");
|
|
349
374
|
var getSearchProps = (name, stack = STACK) => {
|
|
350
375
|
return {
|
|
351
|
-
domain: process.env[`SEARCH_${
|
|
376
|
+
domain: process.env[`SEARCH_${constantCase4(stack)}_${constantCase4(name)}_DOMAIN`]
|
|
352
377
|
};
|
|
353
378
|
};
|
|
354
379
|
var Search = /* @__PURE__ */ createProxy((stack) => {
|
|
@@ -413,6 +438,7 @@ var Table = /* @__PURE__ */ createProxy((stack) => {
|
|
|
413
438
|
});
|
|
414
439
|
export {
|
|
415
440
|
APP,
|
|
441
|
+
Auth,
|
|
416
442
|
Cache,
|
|
417
443
|
CommandOptions,
|
|
418
444
|
Config,
|
|
@@ -427,6 +453,7 @@ export {
|
|
|
427
453
|
Table,
|
|
428
454
|
Task,
|
|
429
455
|
Topic,
|
|
456
|
+
getAuthProps,
|
|
430
457
|
getCacheProps,
|
|
431
458
|
getConfigName,
|
|
432
459
|
getFunctionName,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/awsless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.358",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -28,16 +28,16 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
+
"@awsless/iot": "^0.0.2",
|
|
32
|
+
"@awsless/lambda": "^0.0.26",
|
|
31
33
|
"@awsless/open-search": "^0.0.15",
|
|
32
|
-
"@awsless/
|
|
33
|
-
"@awsless/sns": "^0.0.7",
|
|
34
|
+
"@awsless/redis": "^0.0.12",
|
|
34
35
|
"@awsless/sqs": "^0.0.7",
|
|
36
|
+
"@awsless/s3": "^0.0.18",
|
|
37
|
+
"@awsless/validate": "^0.0.15",
|
|
35
38
|
"@awsless/ssm": "^0.0.7",
|
|
36
39
|
"@awsless/weak-cache": "^0.0.1",
|
|
37
|
-
"@awsless/
|
|
38
|
-
"@awsless/redis": "^0.0.12",
|
|
39
|
-
"@awsless/iot": "^0.0.2",
|
|
40
|
-
"@awsless/validate": "^0.0.15"
|
|
40
|
+
"@awsless/sns": "^0.0.7"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@arcanyx/cidr-slicer": "^0.3.0",
|
|
@@ -109,8 +109,8 @@
|
|
|
109
109
|
"zod-to-json-schema": "^3.22.3",
|
|
110
110
|
"@awsless/code": "^0.0.10",
|
|
111
111
|
"@awsless/duration": "^0.0.1",
|
|
112
|
-
"@awsless/formation": "^0.0.55",
|
|
113
112
|
"@awsless/graphql": "^0.0.9",
|
|
113
|
+
"@awsless/formation": "^0.0.55",
|
|
114
114
|
"@awsless/size": "^0.0.1",
|
|
115
115
|
"@awsless/ts-file-cache": "^0.0.9",
|
|
116
116
|
"@awsless/validate": "^0.0.15"
|