@awsless/awsless 0.0.623 → 0.0.624

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
@@ -346,35 +346,112 @@ var Invalidation = createCustomResourceClass2(
346
346
  "invalidation"
347
347
  );
348
348
  var createCloudFrontProvider = (props) => {
349
+ const client = new CloudFrontClient(props);
349
350
  return createCustomProvider2("cloudfront", {
351
+ // distribution: {
352
+ // async createResource(input) {
353
+ // // tags: {
354
+ // // name,
355
+ // // },
356
+ // // comment: name,
357
+ // // enabled: true,
358
+ // // viewerCertificate: [{ cloudfrontDefaultCertificate: true }],
359
+ // // origin: [
360
+ // // {
361
+ // // id: 'default',
362
+ // // domainName: 'placeholder.awsless.dev',
363
+ // // customOriginConfig: [
364
+ // // {
365
+ // // httpPort: 80,
366
+ // // httpsPort: 443,
367
+ // // originProtocolPolicy: 'http-only',
368
+ // // originReadTimeout: 20,
369
+ // // originSslProtocols: ['TLSv1.2'],
370
+ // // },
371
+ // // ],
372
+ // // },
373
+ // // ],
374
+ // // customErrorResponse: Object.entries(props.errors ?? {}).map(([errorCode, item]) => {
375
+ // // if (typeof item === 'string') {
376
+ // // return {
377
+ // // errorCode: Number(errorCode),
378
+ // // responseCode: errorCode,
379
+ // // responsePagePath: item,
380
+ // // }
381
+ // // }
382
+ // // return {
383
+ // // errorCode: Number(errorCode),
384
+ // // errorCachingMinTtl: item.minTTL ? toSeconds(item.minTTL) : undefined,
385
+ // // responseCode: item.statusCode?.toString() ?? errorCode,
386
+ // // responsePagePath: item.path,
387
+ // // }
388
+ // // }),
389
+ // // restrictions: [
390
+ // // {
391
+ // // geoRestriction: [
392
+ // // {
393
+ // // restrictionType: props.geoRestrictions.length > 0 ? 'blacklist' : 'none',
394
+ // // items: props.geoRestrictions,
395
+ // // },
396
+ // // ],
397
+ // // },
398
+ // // ],
399
+ // // defaultCacheBehavior: [
400
+ // // {
401
+ // // compress: true,
402
+ // // targetOriginId: 'default',
403
+ // // functionAssociation: [
404
+ // // {
405
+ // // eventType: 'viewer-request',
406
+ // // functionArn: viewerRequest.arn,
407
+ // // },
408
+ // // ],
409
+ // // originRequestPolicyId: originRequest.id,
410
+ // // cachePolicyId: cache.id,
411
+ // // responseHeadersPolicyId: responseHeaders.id,
412
+ // // viewerProtocolPolicy: 'redirect-to-https',
413
+ // // allowedMethods: [
414
+ // // {
415
+ // // items: ['GET', 'HEAD', 'POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE'],
416
+ // // cachedMethods: ['GET', 'HEAD'],
417
+ // // },
418
+ // // ],
419
+ // // },
420
+ // // ],
421
+ // // webAclId: waf?.arn,
422
+ // // client.send(
423
+ // // new CreateDistributionCommand({
424
+ // // DistributionConfig: {
425
+ // // Enabled: true,
426
+ // // ConnectionMode: 'tenant-only',
427
+ // // ''
428
+ // // },
429
+ // // })
430
+ // // )
431
+ // // new UpdateDistributionCommand({
432
+ // // 'Id'
433
+ // // })
434
+ // },
435
+ // },
350
436
  invalidation: {
351
437
  async updateResource(input) {
352
438
  const state2 = z2.object({
353
439
  distributionId: z2.string(),
354
440
  paths: z2.string().array().min(1)
355
441
  }).parse(input.proposedState);
356
- await createInvalidationForDistributionTenants({
357
- ...props,
358
- ...state2
359
- });
442
+ await createInvalidationForDistributionTenants(client, state2);
360
443
  return {};
361
444
  }
362
445
  }
363
446
  });
364
447
  };
365
- var createInvalidationForDistributionTenants = async ({
366
- distributionId,
367
- credentials,
368
- region,
369
- paths
370
- }) => {
371
- const client = new CloudFrontClient({ credentials, region });
448
+ var createInvalidationForDistributionTenants = async (client, props) => {
372
449
  let cursor;
373
450
  do {
374
451
  const result = await client.send(
375
452
  new ListDistributionTenantsCommand({
376
453
  AssociationFilter: {
377
- DistributionId: distributionId
454
+ DistributionId: props.distributionId
378
455
  },
379
456
  MaxItems: 10,
380
457
  Marker: cursor
@@ -387,8 +464,8 @@ var createInvalidationForDistributionTenants = async ({
387
464
  Id: tenant.Id,
388
465
  InvalidationBatch: {
389
466
  Paths: {
390
- Quantity: paths.length,
391
- Items: paths
467
+ Quantity: props.paths.length,
468
+ Items: props.paths
392
469
  },
393
470
  CallerReference: randomUUID()
394
471
  }
@@ -5173,7 +5250,8 @@ var siteFeature = defineFeature({
5173
5250
  }
5174
5251
  const instance = Bun.spawn(buildProps.command.split(" "), {
5175
5252
  cwd,
5176
- env
5253
+ env,
5254
+ stdout: "ignore"
5177
5255
  // stdout: 'inherit',
5178
5256
  // stderr: 'inherit',
5179
5257
  });
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.623",
3
+ "version": "0.0.624",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -34,22 +34,22 @@
34
34
  },
35
35
  "peerDependencies": {
36
36
  "@awsless/big-float": "^0.1.5",
37
- "@awsless/clui": "^0.0.8",
37
+ "@awsless/duration": "^0.0.4",
38
+ "@awsless/dynamodb": "^0.3.14",
38
39
  "@awsless/json": "^0.0.11",
40
+ "@awsless/clui": "^0.0.8",
41
+ "@awsless/mqtt": "^0.0.2",
39
42
  "@awsless/cloudwatch": "^0.0.1",
40
- "@awsless/dynamodb": "^0.3.14",
41
- "@awsless/iot": "^0.0.3",
42
- "@awsless/lambda": "^0.0.36",
43
43
  "@awsless/open-search": "^0.0.21",
44
+ "@awsless/iot": "^0.0.3",
44
45
  "@awsless/s3": "^0.0.21",
46
+ "@awsless/lambda": "^0.0.36",
45
47
  "@awsless/sns": "^0.0.10",
46
- "@awsless/sqs": "^0.0.16",
47
- "@awsless/validate": "^0.1.4",
48
+ "@awsless/validate": "^0.1.5",
48
49
  "@awsless/ssm": "^0.0.7",
49
- "@awsless/duration": "^0.0.4",
50
- "@awsless/weak-cache": "^0.0.1",
51
- "@awsless/mqtt": "^0.0.2",
52
- "@awsless/redis": "^0.0.14"
50
+ "@awsless/redis": "^0.0.14",
51
+ "@awsless/sqs": "^0.0.16",
52
+ "@awsless/weak-cache": "^0.0.1"
53
53
  },
54
54
  "dependencies": {
55
55
  "@arcanyx/cidr-slicer": "^0.3.0",
@@ -139,14 +139,14 @@
139
139
  "zip-a-folder": "^3.1.6",
140
140
  "zod": "^3.24.2",
141
141
  "zod-to-json-schema": "^3.24.3",
142
- "@awsless/cloudwatch": "^0.0.1",
143
- "@awsless/json": "^0.0.11",
144
142
  "@awsless/big-float": "^0.1.5",
143
+ "@awsless/cloudwatch": "^0.0.1",
145
144
  "@awsless/duration": "^0.0.4",
146
- "@awsless/size": "^0.0.2",
147
145
  "@awsless/graphql": "^0.0.9",
148
- "@awsless/validate": "^0.1.4",
146
+ "@awsless/json": "^0.0.11",
147
+ "@awsless/size": "^0.0.2",
149
148
  "@awsless/scheduler": "^0.0.4",
149
+ "@awsless/validate": "^0.1.5",
150
150
  "@awsless/ts-file-cache": "^0.0.12",
151
151
  "@awsless/clui": "^0.0.8"
152
152
  },