typed-douyin-openapi
Version:
36 lines • 1.62 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.OpenapiNotification = void 0;
const openapi_base_1 = require("./openapi_base");
class OpenapiNotification extends openapi_base_1.OpenapiBase {
/**
* 发送订阅消息
*/
sendNotification(data) {
return __awaiter(this, void 0, void 0, function* () {
yield this.request({
url: 'api/apps/subscribe_notification/developer/v1/notify',
method: 'post',
data: {
access_token: yield this.ensureAccessToken(),
app_id: this.appid,
tpl_id: data.tpl_id,
open_id: data.open_id,
data: data.data,
page: data.page
}
});
});
}
}
exports.OpenapiNotification = OpenapiNotification;
//# sourceMappingURL=openapi_notification.js.map