New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@awsless/sns

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@awsless/sns - npm Package Compare versions

Comparing version
0.0.6
to
0.0.7
+29
dist/index.d.cts
import { SNSClient } from '@aws-sdk/client-sns';
import { Mock } from 'vitest';
type Attributes = {
[key: string]: string;
};
interface PublishOptions<Payload = unknown> {
client?: SNSClient;
topic: string;
subject?: string;
payload?: Payload;
attributes?: Attributes;
region?: string;
accountId?: string;
}
declare const publish: ({ client, topic, subject, payload, attributes, region, accountId, }: PublishOptions) => Promise<void>;
type Topics = {
[key: string]: (payload: any) => any;
};
declare const mockSNS: <T extends Topics>(topics: T) => { [P in keyof T]: Mock<any, (...args: any[]) => any>; };
declare const snsClient: {
(): SNSClient;
set(client: SNSClient): void;
};
export { PublishOptions, mockSNS, publish, snsClient };
+2
-21

@@ -25,4 +25,3 @@ "use strict";

publish: () => publish,
snsClient: () => snsClient,
snsStruct: () => snsStruct
snsClient: () => snsClient
});

@@ -107,19 +106,2 @@ module.exports = __toCommonJS(src_exports);

};
// src/struct.ts
var import_superstruct = require("superstruct");
var import_validate = require("@awsless/validate");
var snsStruct = (message) => {
return (0, import_validate.coerce)(
(0, import_validate.array)(message),
(0, import_validate.type)({
Records: (0, import_validate.array)((0, import_validate.type)({
Sns: (0, import_validate.type)({ Message: (0, import_validate.string)() })
}))
}),
(value) => {
return value.Records.map((item) => JSON.parse(item.Sns.Message));
}
);
};
// Annotate the CommonJS export names for ESM import in node:

@@ -129,4 +111,3 @@ 0 && (module.exports = {

publish,
snsClient,
snsStruct
snsClient
});

@@ -25,4 +25,3 @@ "use strict";

publish: () => publish,
snsClient: () => snsClient,
snsStruct: () => snsStruct
snsClient: () => snsClient
});

@@ -107,19 +106,2 @@ module.exports = __toCommonJS(src_exports);

};
// src/struct.ts
var import_superstruct = require("superstruct");
var import_validate = require("@awsless/validate");
var snsStruct = (message) => {
return (0, import_validate.coerce)(
(0, import_validate.array)(message),
(0, import_validate.type)({
Records: (0, import_validate.array)((0, import_validate.type)({
Sns: (0, import_validate.type)({ Message: (0, import_validate.string)() })
}))
}),
(value) => {
return value.Records.map((item) => JSON.parse(item.Sns.Message));
}
);
};
// Annotate the CommonJS export names for ESM import in node:

@@ -129,4 +111,3 @@ 0 && (module.exports = {

publish,
snsClient,
snsStruct
snsClient
});
import { SNSClient } from '@aws-sdk/client-sns';
import { Mock } from 'vitest';
import { Struct } from '@awsless/validate';

@@ -30,4 +29,2 @@ type Attributes = {

declare const snsStruct: <A, B>(message: Struct<A, B>) => Struct<A[], Struct<A, B>>;
export { PublishOptions, mockSNS, publish, snsClient, snsStruct };
export { PublishOptions, mockSNS, publish, snsClient };

@@ -77,24 +77,6 @@ // src/commands.ts

};
// src/struct.ts
import "superstruct";
import { array, type, string, coerce } from "@awsless/validate";
var snsStruct = (message) => {
return coerce(
array(message),
type({
Records: array(type({
Sns: type({ Message: string() })
}))
}),
(value) => {
return value.Records.map((item) => JSON.parse(item.Sns.Message));
}
);
};
export {
mockSNS,
publish,
snsClient,
snsStruct
snsClient
};
{
"name": "@awsless/sns",
"version": "0.0.6",
"version": "0.0.7",
"license": "MIT",

@@ -29,11 +29,4 @@ "type": "module",

"aws-sdk-client-mock": "^2.1.1",
"superstruct": "^1.0.3",
"@awsless/utils": "^0.0.2"
},
"devDependencies": {
"@awsless/validate": "^0.0.4"
},
"peerDependencies": {
"@awsless/validate": "^0.0.4"
},
"scripts": {

@@ -40,0 +33,0 @@ "test": "pnpm code test",