Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@collaborne/custom-cloudformation-resources

Package Overview
Dependencies
Maintainers
4
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@collaborne/custom-cloudformation-resources - npm Package Compare versions

Comparing version 0.5.2 to 0.5.3

11

dist/custom-resource.d.ts

@@ -27,2 +27,3 @@ import type { ObjectSchema, SchemaType } from '@collaborne/json-schema-to-type';

private requestQueue;
private currentRequest?;
constructor(schema: S, logicalResourceId: string, logger: Logger);

@@ -33,2 +34,12 @@ abstract createResource(physicalResourceId: string, params: SchemaType<S>, continuationAttributes?: ContinuationAttributes): Promise<Response<ResourceAttributes> | ContinuationRequired<ContinuationAttributes>>;

handleRequest(request: CustomResourceRequest | ContinuedCustomResourceRequest<ContinuationAttributes>): Promise<ResponseStatus>;
/**
* Get the request that is currently being processed
*
* This is mostly intended for integrations that want to watch the state of their
* resources, the returned value should not be changed in any way.
*
* @returns the current request when called during an execution of {@link handleRequest}, otherwise `undefined`
*/
get request(): undefined | CustomResourceRequest | ContinuedCustomResourceRequest<ContinuationAttributes>;
protected handleRequestInner(request: CustomResourceRequest | ContinuedCustomResourceRequest<ContinuationAttributes>): Promise<ResponseStatus>;
protected processRequest(request: CustomResourceRequest | ContinuedCustomResourceRequest<ContinuationAttributes>): Promise<{

@@ -35,0 +46,0 @@ status: ResponseStatus;

24

dist/custom-resource.js

@@ -22,3 +22,23 @@ "use strict";

}
handleRequest(request) {
async handleRequest(request) {
try {
this.currentRequest = request;
return await this.handleRequestInner(request);
}
finally {
this.currentRequest = undefined;
}
}
/**
* Get the request that is currently being processed
*
* This is mostly intended for integrations that want to watch the state of their
* resources, the returned value should not be changed in any way.
*
* @returns the current request when called during an execution of {@link handleRequest}, otherwise `undefined`
*/
get request() {
return this.currentRequest;
}
handleRequestInner(request) {
let resolveRequest;

@@ -130,3 +150,3 @@ let rejectRequest;

const cronExpression = `${Math.max(now.getMinutes() + 1, when.getMinutes())} ${when.getHours()} ${when.getDate()} ${when.getMonth() + 1} ? ${when.getFullYear()}`;
this.logger.log(`Scheduling continuation using CWE rule ${continuationRuleName} after ${continuationAfter}s (at ${cronExpression}) `);
this.logger.log(`Scheduling continuation using CWE rule ${continuationRuleName} after ${continuationAfter}s (at ${cronExpression})`);
const schedulePutRuleParams = {

@@ -133,0 +153,0 @@ Name: continuationRuleName,

5

package.json
{
"name": "@collaborne/custom-cloudformation-resources",
"version": "0.5.2",
"version": "0.5.3",
"description": "Custom CloudFormation resources",

@@ -45,3 +45,4 @@ "main": "dist/index.js",

"engines": {
"node": ">=14.14.0"
"node": ">=14.14.0",
"npm": ">=7"
},

@@ -48,0 +49,0 @@ "dependencies": {

@@ -60,2 +60,6 @@ import { CloudWatchEvents } from 'aws-sdk';

private currentRequest?:
| CustomResourceRequest
| ContinuedCustomResourceRequest<ContinuationAttributes>;
constructor(

@@ -92,3 +96,3 @@ protected readonly schema: S,

public handleRequest(
public async handleRequest(
request:

@@ -98,2 +102,30 @@ | CustomResourceRequest

): Promise<ResponseStatus> {
try {
this.currentRequest = request;
return await this.handleRequestInner(request);
} finally {
this.currentRequest = undefined;
}
}
/**
* Get the request that is currently being processed
*
* This is mostly intended for integrations that want to watch the state of their
* resources, the returned value should not be changed in any way.
*
* @returns the current request when called during an execution of {@link handleRequest}, otherwise `undefined`
*/
public get request():
| undefined
| CustomResourceRequest
| ContinuedCustomResourceRequest<ContinuationAttributes> {
return this.currentRequest;
}
protected handleRequestInner(
request:
| CustomResourceRequest
| ContinuedCustomResourceRequest<ContinuationAttributes>,
): Promise<ResponseStatus> {
let resolveRequest: (response: ResponseStatus) => void;

@@ -248,3 +280,3 @@ let rejectRequest: (error: Error) => void;

this.logger.log(
`Scheduling continuation using CWE rule ${continuationRuleName} after ${continuationAfter}s (at ${cronExpression}) `,
`Scheduling continuation using CWE rule ${continuationRuleName} after ${continuationAfter}s (at ${cronExpression})`,
);

@@ -251,0 +283,0 @@ const schedulePutRuleParams: CloudWatchEvents.PutRuleRequest = {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc