@grammyjs/hydrate
Advanced tools
Comparing version 1.2.0 to 1.2.1
import { type Message, type RawApi } from "../deps.node.js"; | ||
import { type Other as O, type Ret } from "../plugin.js"; | ||
import { type InlineMessageXFragment } from "./inline-message.js"; | ||
import { type Other as O, type Ret } from "../plugin.js"; | ||
declare type Other<M extends keyof RawApi, K extends string = never> = O<M, K | "chat_id" | "message_id">; | ||
@@ -5,0 +5,0 @@ interface MessageXFragment extends InlineMessageXFragment { |
import { type RawApi, type Update } from "../deps.node.js"; | ||
import { type CallbackQueryX } from "./callback-query.js"; | ||
import { type ChatJoinRequestX } from "./chat-join-request.js"; | ||
import { type ChosenInlineResultX } from "./chosen-inline-result.js"; | ||
import { type InlineQueryX } from "./inline-query.js"; | ||
import { type MessageX } from "./message.js"; | ||
import { type PreCheckoutQueryX } from "./pre-checkout-query.js"; | ||
import { type ShippingQueryX } from "./shipping-query.js"; | ||
import { type MessageX } from "./message.js"; | ||
import { type ChosenInlineResultX } from "./chosen-inline-result.js"; | ||
import { type ChatJoinRequestX } from "./chat-join-request.js"; | ||
export interface UpdateX extends Update { | ||
@@ -10,0 +10,0 @@ message: MessageX | undefined; |
@@ -5,8 +5,8 @@ "use strict"; | ||
const callback_query_js_1 = require("./callback-query.js"); | ||
const chat_join_request_js_1 = require("./chat-join-request.js"); | ||
const chosen_inline_result_js_1 = require("./chosen-inline-result.js"); | ||
const inline_query_js_1 = require("./inline-query.js"); | ||
const message_js_1 = require("./message.js"); | ||
const pre_checkout_query_js_1 = require("./pre-checkout-query.js"); | ||
const shipping_query_js_1 = require("./shipping-query.js"); | ||
const message_js_1 = require("./message.js"); | ||
const chosen_inline_result_js_1 = require("./chosen-inline-result.js"); | ||
const chat_join_request_js_1 = require("./chat-join-request.js"); | ||
function installUpdateMethods(api, update) { | ||
@@ -13,0 +13,0 @@ if (update.message !== undefined) { |
@@ -1,2 +0,2 @@ | ||
export { Api, ApiCallFn, Context, InputFile, RawApi, Transformer, } from "grammy"; | ||
export { Api, ApiCallFn, Context, GrammyError, InputFile, RawApi, Transformer, } from "grammy"; | ||
export * from "@grammyjs/types"; |
@@ -17,7 +17,8 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.InputFile = exports.Context = exports.Api = void 0; | ||
exports.InputFile = exports.GrammyError = exports.Context = exports.Api = void 0; | ||
var grammy_1 = require("grammy"); | ||
Object.defineProperty(exports, "Api", { enumerable: true, get: function () { return grammy_1.Api; } }); | ||
Object.defineProperty(exports, "Context", { enumerable: true, get: function () { return grammy_1.Context; } }); | ||
Object.defineProperty(exports, "GrammyError", { enumerable: true, get: function () { return grammy_1.GrammyError; } }); | ||
Object.defineProperty(exports, "InputFile", { enumerable: true, get: function () { return grammy_1.InputFile; } }); | ||
__exportStar(require("@grammyjs/types"), exports); |
@@ -1,9 +0,9 @@ | ||
import { type Api, type Context, type InputFile, type InputFileProxy, type RawApi, type Transformer } from "./deps.node.js"; | ||
import { type UpdateX } from "./data/update.js"; | ||
import { type MessageX } from "./data/message.js"; | ||
import { type CallbackQueryX } from "./data/callback-query.js"; | ||
import { type ChatJoinRequestX } from "./data/chat-join-request.js"; | ||
import { type InlineQueryX } from "./data/inline-query.js"; | ||
import { type MessageX } from "./data/message.js"; | ||
import { type PreCheckoutQueryX } from "./data/pre-checkout-query.js"; | ||
import { type ShippingQueryX } from "./data/shipping-query.js"; | ||
import { type PreCheckoutQueryX } from "./data/pre-checkout-query.js"; | ||
import { type ChatJoinRequestX } from "./data/chat-join-request.js"; | ||
import { type UpdateX } from "./data/update.js"; | ||
import { type Api, type Context, type InputFile, type InputFileProxy, type RawApi, type Transformer } from "./deps.node.js"; | ||
/** | ||
@@ -10,0 +10,0 @@ * Transformative API Flavor that adds file handling utilities to the supplied |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.hydrateApi = exports.hydrateContext = exports.hydrate = void 0; | ||
const inline_message_js_1 = require("./data/inline-message.js"); | ||
const message_js_1 = require("./data/message.js"); | ||
const update_js_1 = require("./data/update.js"); | ||
const message_js_1 = require("./data/message.js"); | ||
const inline_message_js_1 = require("./data/inline-message.js"); | ||
const deps_node_js_1 = require("./deps.node.js"); | ||
/** | ||
@@ -83,6 +84,15 @@ * Plugin that hydrates the context object and API call results, and equips the | ||
return new Proxy({}, { | ||
get(_, m) { | ||
return connector.bind(null, m); | ||
get(_, method) { | ||
const api = connector.bind(null, method); | ||
return async (...args) => { | ||
const data = await api(...args); | ||
if (data.ok) { | ||
return data.result; | ||
} | ||
else { | ||
throw new deps_node_js_1.GrammyError(`Call to '${method}' failed!`, data, method, args[0]); | ||
} | ||
}; | ||
}, | ||
}); | ||
} |
{ | ||
"name": "@grammyjs/hydrate", | ||
"description": "Hydration plugin for grammY", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"author": "KnorpelSenf", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42293
29
740