@awsless/awsless 0.0.355 → 0.0.357

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 CHANGED
@@ -10760,7 +10760,7 @@ import { hashElement } from "folder-hash";
10760
10760
  import { exec } from "promisify-child-process";
10761
10761
  var buildDockerImage = async (opts) => {
10762
10762
  const platform = opts.architecture === "arm64" ? "linux/arm64" : "linux/amd64";
10763
- await exec(`docker image rm ${opts.name}:latest`);
10763
+ await exec(`docker image -f rm ${opts.name}:latest 2> /dev/null || true`);
10764
10764
  const buildResponse = await exec(`docker buildx build --platform ${platform} -t ${opts.name}:latest .`, {
10765
10765
  cwd: opts.cwd
10766
10766
  });
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 constantCase2 } from "change-case";
280
+ import { constantCase as constantCase3 } from "change-case";
256
281
  var getCacheProps = (name, stack = STACK) => {
257
- const prefix = `CACHE_${constantCase2(stack)}_${constantCase2(name)}`;
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 constantCase3 } from "change-case";
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_${constantCase3(stack)}_${constantCase3(name)}_DOMAIN`]
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.355",
3
+ "version": "0.0.357",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -29,13 +29,13 @@
29
29
  },
30
30
  "peerDependencies": {
31
31
  "@awsless/iot": "^0.0.2",
32
- "@awsless/open-search": "^0.0.15",
33
32
  "@awsless/lambda": "^0.0.26",
34
- "@awsless/s3": "^0.0.18",
33
+ "@awsless/open-search": "^0.0.15",
35
34
  "@awsless/redis": "^0.0.12",
36
35
  "@awsless/sns": "^0.0.7",
37
- "@awsless/sqs": "^0.0.7",
38
36
  "@awsless/ssm": "^0.0.7",
37
+ "@awsless/sqs": "^0.0.7",
38
+ "@awsless/s3": "^0.0.18",
39
39
  "@awsless/validate": "^0.0.15",
40
40
  "@awsless/weak-cache": "^0.0.1"
41
41
  },
@@ -108,9 +108,9 @@
108
108
  "zod": "^3.21.4",
109
109
  "zod-to-json-schema": "^3.22.3",
110
110
  "@awsless/code": "^0.0.10",
111
- "@awsless/formation": "^0.0.54",
112
- "@awsless/duration": "^0.0.1",
113
111
  "@awsless/graphql": "^0.0.9",
112
+ "@awsless/duration": "^0.0.1",
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"