@kirkelliott/zap 0.1.9 → 0.1.10

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/cli.js CHANGED
@@ -219,7 +219,13 @@ program
219
219
  await lambda.send(new client_lambda_1.RemovePermissionCommand({ FunctionName: fn, StatementId: 'public-access' }));
220
220
  }
221
221
  catch { }
222
- await lambda.send(new client_lambda_1.AddPermissionCommand({ FunctionName: fn, StatementId: 'public-access', Action: 'lambda:InvokeFunctionUrl', Principal: '*', FunctionUrlAuthType: 'NONE' }));
222
+ for (const sid of ['public-access', 'FunctionURLAllowPublicAccess']) {
223
+ try {
224
+ await lambda.send(new client_lambda_1.RemovePermissionCommand({ FunctionName: fn, StatementId: sid }));
225
+ }
226
+ catch { }
227
+ }
228
+ await lambda.send(new client_lambda_1.AddPermissionCommand({ FunctionName: fn, StatementId: 'public-access', Action: 'lambda:InvokeFunctionUrl', Principal: '*' }));
223
229
  console.log('✓ permissions repaired');
224
230
  if (cfg.url)
225
231
  console.log(`\n → ${cfg.url.trim()}\n`);
package/dist/init.js CHANGED
@@ -25,16 +25,17 @@ const policy = (bucket) => JSON.stringify({
25
25
  ],
26
26
  });
27
27
  async function allowPublicUrl(lambda, functionArn) {
28
- try {
29
- await lambda.send(new client_lambda_1.RemovePermissionCommand({ FunctionName: functionArn, StatementId: 'public-access' }));
28
+ for (const sid of ['public-access', 'FunctionURLAllowPublicAccess']) {
29
+ try {
30
+ await lambda.send(new client_lambda_1.RemovePermissionCommand({ FunctionName: functionArn, StatementId: sid }));
31
+ }
32
+ catch { }
30
33
  }
31
- catch { }
32
34
  await lambda.send(new client_lambda_1.AddPermissionCommand({
33
35
  FunctionName: functionArn,
34
36
  StatementId: 'public-access',
35
37
  Action: 'lambda:InvokeFunctionUrl',
36
38
  Principal: '*',
37
- FunctionUrlAuthType: 'NONE',
38
39
  }));
39
40
  }
40
41
  function step(label) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kirkelliott/zap",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Drop a .zap file in S3. It becomes an API endpoint.",
5
5
  "main": "dist/handler.js",
6
6
  "bin": {