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

@shibacore/apis

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shibacore/apis - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

4

build/whatsapp/messages.d.ts
import { InteractionButtonComponent, InteractiveListComponent, LanguageCode, Media, PhoneNumberId, TemplateComponents, Location } from "./parameter-types";
import { HeaderOtions, ShibaApiBase, Version } from "./shiba-api-base";
import { HeaderOtions, ShibaApiBase, TokenType, Version } from "./shiba-api-base";
export declare class WhatsappMessages extends ShibaApiBase {
private phoneNumberId;
constructor(access_token: string, version: Version, phoneNumberId: PhoneNumberId, headerOptions?: HeaderOtions);
constructor(access_token: string, version: Version, phoneNumberId: PhoneNumberId, headerOptions?: HeaderOtions, tokenType?: TokenType);
template(to: string, templateName: string, language_code: LanguageCode, components?: TemplateComponents): Promise<any>;

@@ -7,0 +7,0 @@ text(to: string, bodyText: string, preview_url?: boolean): Promise<any>;

@@ -15,4 +15,4 @@ "use strict";

class WhatsappMessages extends shiba_api_base_1.ShibaApiBase {
constructor(access_token, version, phoneNumberId, headerOptions) {
super(access_token, version, headerOptions);
constructor(access_token, version, phoneNumberId, headerOptions, tokenType) {
super(access_token, version, headerOptions, tokenType);
this.phoneNumberId = phoneNumberId;

@@ -19,0 +19,0 @@ }

@@ -1,8 +0,10 @@

import { Axios, HeadersDefaults } from "axios";
import { Axios, RawAxiosRequestHeaders } from "axios";
export type Version = `v${number}`;
export type HeaderOtions = HeadersDefaults["options"];
export type HeaderOtions = RawAxiosRequestHeaders;
export type TokenType = "Bearer" | "OAuth";
export declare abstract class ShibaApiBase {
protected accessToken: string;
protected readonly api: Axios;
constructor(access_token: string, version: Version, headerOptions?: HeaderOtions);
protected token_type: TokenType;
constructor(access_token: string, version: Version, headerOptions?: HeaderOtions, tokenType?: TokenType);
}

@@ -9,5 +9,6 @@ "use strict";

class ShibaApiBase {
constructor(access_token, version, headerOptions) {
constructor(access_token, version, headerOptions = {}, tokenType = "Bearer") {
this.accessToken = access_token;
const headers = {};
this.token_type = tokenType;
const headers = Object.assign({ "Content-Type": "application/json", Authorization: `${tokenType} ${access_token}` }, headerOptions);
headers["Content-Type"] = "application/json";

@@ -19,3 +20,3 @@ if (headerOptions) {

}
headers.Authorization = `Bearer ${access_token}`;
headers.Authorization = `${tokenType} ${access_token}`;
this.api = axios_1.default.create({

@@ -22,0 +23,0 @@ baseURL: `https://graph.facebook.com/${version}`,

{
"name": "@shibacore/apis",
"version": "1.0.1",
"version": "1.0.2",
"description": "",

@@ -5,0 +5,0 @@ "main": "./build/index.js",

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