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

bot-action

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bot-action - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

4

index.d.ts

@@ -18,2 +18,3 @@ export type Equals<X, Y> = (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? true : false;

export interface ActionBuilderParam<V = any> {
readonly name: string;
readonly order: number;

@@ -33,3 +34,6 @@ readonly pattern: string;

getParam<K extends keyof P>(param: K): { [K_1 in keyof P]: ActionBuilderParam<P[K_1]>; }[K];
getParamOrder<K extends keyof P>(param: K): number;
getParamValue<K extends keyof P>(param: K): P[K] | undefined;
withParamValue<K extends keyof P, V extends P[K]>(param: K, value: V): ActionBuilder<P>;
withParamPattern<K extends keyof P>(param: K, pattern: string): ActionBuilder<P>;
withAnyParams(): ActionBuilder<P>;

@@ -36,0 +40,0 @@ fromStart(): ActionBuilder<P>;

@@ -48,6 +48,8 @@ (function (factory) {

withParam(param, pattern) {
return this.new(Object.assign(Object.assign({}, this.state), { params: Object.assign(Object.assign({}, this.state.params), { [param]: {
pattern,
order: this.getNextParamOrderCounter(),
} }) }));
const paramState = {
name: param,
pattern,
order: this.getNextParamOrderCounter()
};
return this.new(Object.assign(Object.assign({}, this.state), { params: Object.assign(Object.assign({}, this.state.params), { [param]: paramState }) }));
}

@@ -57,9 +59,27 @@ getParam(param) {

}
getParamOrder(param) {
const paramState = this.state.params[param];
if (!paramState) {
throw new Error(`Unknown param. Received ${String(param)}`);
}
return paramState.order;
}
getParamValue(param) {
var _a;
return (_a = this.state.params[param]) === null || _a === void 0 ? void 0 : _a.value;
}
withParamValue(param, value) {
const paramState = this.state.params[param];
if (!param) {
throw new Error(`Unknown param. Received ${String(name)}. Expected one of ${this.state.params}`);
if (!paramState) {
throw new Error(`Unknown param. Received ${String(param)}`);
}
return this.new(Object.assign(Object.assign({}, this.state), { params: Object.assign(Object.assign({}, this.state.params), { [param]: Object.assign(Object.assign({}, paramState), { value }) }) }));
}
withParamPattern(param, pattern) {
const paramState = this.state.params[param];
if (!paramState) {
throw new Error(`Unknown param. Received ${String(param)}`);
}
return this.new(Object.assign(Object.assign({}, this.state), { params: Object.assign(Object.assign({}, this.state.params), { [param]: Object.assign(Object.assign({}, paramState), { pattern }) }) }));
}
withAnyParams() {

@@ -66,0 +86,0 @@ return this.new(Object.assign(Object.assign({}, this.state), { isAnyParams: true }));

82

package.json
{
"name": "bot-action",
"version": "0.0.2",
"main": "index.js",
"scripts": {
"test": "jest",
"build": "tsc",
"prepublishOnly": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/A5KET/action-builder.git"
},
"keywords": [
"action",
"builder",
"telegram",
"bot",
"api"
],
"author": "Max Kotsiuruba",
"license": "MIT",
"bugs": {
"url": "https://github.com/A5KET/bot-action/issues"
},
"homepage": "https://github.com/A5KET/bot-action#readme",
"description": "",
"devDependencies": {
"@types/jest": "^29.5.14",
"@types/node": "^22.9.0",
"jest": "^29.7.0",
"ts-jest": "^29.2.5",
"typescript": "^5.6.3"
},
"type": "module",
"types": "./index.d.ts",
"files": [
"index.js",
"index.d.ts",
"README.md"
]
}
"name": "bot-action",
"version": "0.0.3",
"main": "index.js",
"scripts": {
"test": "jest",
"build": "tsc",
"prepublishOnly": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/A5KET/action-builder.git"
},
"keywords": [
"action",
"builder",
"telegram",
"bot",
"api"
],
"author": "Max Kotsiuruba",
"license": "MIT",
"bugs": {
"url": "https://github.com/A5KET/bot-action/issues"
},
"homepage": "https://github.com/A5KET/bot-action#readme",
"description": "",
"devDependencies": {
"@types/jest": "^29.5.14",
"@types/node": "^22.9.0",
"jest": "^29.7.0",
"ts-jest": "^29.2.5",
"typescript": "^5.6.3"
},
"type": "module",
"types": "./index.d.ts",
"files": [
"index.js",
"index.d.ts",
"README.md"
]
}
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