New:Socket for Asana Is Now Available.Learn more
Get Started

@parseapi/sdk

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parseapi/sdk - npm Package Compare versions

Comparing version
0.1.1
to
0.1.2
+15
-2
dist/index.cjs

@@ -27,3 +27,3 @@ "use strict";

module.exports = __toCommonJS(index_exports);
var VERSION = "0.1.1";
var VERSION = "0.1.2";
var DEFAULT_BASE_URL = "https://api.parseapi.com";

@@ -122,2 +122,14 @@ var DEFAULT_TIMEOUT_MS = 1e4;

const deepQuery = (opts) => opts?.deep ? { deep: true } : {};
function timezone(idOrLat, lonOrOpts, opts) {
if (typeof idOrLat === "number") {
return request("/timezone", {
lat: idOrLat,
lon: typeof lonOrOpts === "number" ? lonOrOpts : void 0,
at: opts?.at
});
}
return request(`/timezone/${enc(idOrLat)}`, {
at: lonOrOpts && typeof lonOrOpts === "object" ? lonOrOpts.at : void 0
});
}
return {

@@ -180,3 +192,4 @@ ip: Object.assign(

language: (code) => request(`/language/${enc(code)}`),
timezone: (id, opts) => request(`/timezone/${enc(id)}`, { at: opts?.at }),
name: (name) => request(`/name/${enc(name)}`),
timezone,
holiday: Object.assign(

@@ -183,0 +196,0 @@ (country, opts) => request(`/holiday/${enc(country)}`, { year: opts?.year }),

+47
-15

@@ -18,2 +18,3 @@ /**

tor: boolean;
vpn: boolean;
provider: string;

@@ -42,2 +43,4 @@ }

name: string;
emoji?: string | null;
calling_code?: string | null;
}

@@ -57,2 +60,4 @@ interface ContinentCountries {

capital: string | null;
capital_lat: number | null;
capital_lon: number | null;
continent: string;

@@ -67,2 +72,3 @@ region: string | null;

tld: string | null;
calling_code: string | null;
emoji: string | null;

@@ -196,2 +202,3 @@ languages: string[];

email: string;
didyoumean: string | null;
valid: boolean;

@@ -205,8 +212,13 @@ domain: string | null;

interface PhoneDeep {
type: 'mobile' | 'landline' | 'toll_free' | 'unknown';
region: string;
type: 'mobile' | 'landline' | 'voip' | 'toll_free' | 'unknown';
carrier: string | null;
/** Carrier is a known burner number app. Null when carrier is unknown. */
burner: boolean | null;
city: string | null;
state: string | null;
state_name: string | null;
}
interface Phone {
phone: string | null;
valid: boolean;
e164: string | null;
country: string | null;

@@ -236,3 +248,3 @@ national: string | null;

txt: string[];
provider: string;
mailhost: string;
registration: DomainRegistration;

@@ -313,2 +325,14 @@ }

}
/** A parsed person name. Junk input returns valid: false, never an error. Gender comes from dictionary data and is null when the data does not decide. */
interface Name {
name: string;
valid: boolean;
prefix: string | null;
first: string | null;
middle: string | null;
last: string | null;
suffix: string | null;
gender: 'male' | 'female' | null;
salutation: 'Mr' | 'Ms' | null;
}
interface CurrencyRate {

@@ -328,8 +352,10 @@ base: string;

interface Timezone {
timezone: string;
latitude?: number;
longitude?: number;
timezone: string | null;
name: string | null;
abbreviation: string;
offset: string;
offset_minutes: number;
dst: boolean;
abbreviation: string | null;
offset: string | null;
offset_minutes: number | null;
dst: boolean | null;
next_dst: TimezoneNextDst | null;

@@ -364,4 +390,4 @@ }

interface PointDeep {
city: CityNearest;
timezone: Timezone;
city: CityNearest | null;
timezone: Timezone | null;
}

@@ -544,5 +570,11 @@ interface Point {

language: (code: string) => Promise<Language>;
timezone: (id: string, opts?: {
at?: string;
}) => Promise<Timezone>;
name: (name: string) => Promise<Name>;
timezone: {
(id: string, opts?: {
at?: string;
}): Promise<Timezone>;
(lat: number, lon: number, opts?: {
at?: string;
}): Promise<Timezone>;
};
holiday: ((country: string, opts?: {

@@ -564,2 +596,2 @@ year?: number;

export { type City, type CityNearest, type CitySearch, type Continent, type ContinentCountries, type ContinentCountryItem, type Country, type CountryStateItem, type CountryStates, type Currency, type CurrencyRate, type Deep, type District, type Domain, type DomainDeep, type DomainRegistration, type Elevation, type Email, type EmailDeep, type Emoji, type EmojiSearch, type EmojiSkin, type Holiday, type HolidayDate, type HolidayYear, type Ip, type IpDeep, type Language, type Mx, type MxRecord, type ParseAPIClient, ParseAPIError, type ParseAPIOptions, type Phone, type PhoneDeep, type Point, type PointDeep, type Postal, type PostalDistance, type PostalDistanceEnd, type PostalNearby, type PostalNearbyItem, type State, type StateDistrictItem, type StateDistricts, type Timezone, type TimezoneNextDst, type Useragent, type UseragentBrowserBrand, type UseragentBrowserDeep, type UseragentDeep, type UseragentDeviceDeep, type UseragentEngineDeep, type UseragentOsDeep, type Weather, type WeatherAlert, type WeatherDeep, type WeatherForecastPeriod, parseAPI };
export { type City, type CityNearest, type CitySearch, type Continent, type ContinentCountries, type ContinentCountryItem, type Country, type CountryStateItem, type CountryStates, type Currency, type CurrencyRate, type Deep, type District, type Domain, type DomainDeep, type DomainRegistration, type Elevation, type Email, type EmailDeep, type Emoji, type EmojiSearch, type EmojiSkin, type Holiday, type HolidayDate, type HolidayYear, type Ip, type IpDeep, type Language, type Mx, type MxRecord, type Name, type ParseAPIClient, ParseAPIError, type ParseAPIOptions, type Phone, type PhoneDeep, type Point, type PointDeep, type Postal, type PostalDistance, type PostalDistanceEnd, type PostalNearby, type PostalNearbyItem, type State, type StateDistrictItem, type StateDistricts, type Timezone, type TimezoneNextDst, type Useragent, type UseragentBrowserBrand, type UseragentBrowserDeep, type UseragentDeep, type UseragentDeviceDeep, type UseragentEngineDeep, type UseragentOsDeep, type Weather, type WeatherAlert, type WeatherDeep, type WeatherForecastPeriod, parseAPI };

@@ -18,2 +18,3 @@ /**

tor: boolean;
vpn: boolean;
provider: string;

@@ -42,2 +43,4 @@ }

name: string;
emoji?: string | null;
calling_code?: string | null;
}

@@ -57,2 +60,4 @@ interface ContinentCountries {

capital: string | null;
capital_lat: number | null;
capital_lon: number | null;
continent: string;

@@ -67,2 +72,3 @@ region: string | null;

tld: string | null;
calling_code: string | null;
emoji: string | null;

@@ -196,2 +202,3 @@ languages: string[];

email: string;
didyoumean: string | null;
valid: boolean;

@@ -205,8 +212,13 @@ domain: string | null;

interface PhoneDeep {
type: 'mobile' | 'landline' | 'toll_free' | 'unknown';
region: string;
type: 'mobile' | 'landline' | 'voip' | 'toll_free' | 'unknown';
carrier: string | null;
/** Carrier is a known burner number app. Null when carrier is unknown. */
burner: boolean | null;
city: string | null;
state: string | null;
state_name: string | null;
}
interface Phone {
phone: string | null;
valid: boolean;
e164: string | null;
country: string | null;

@@ -236,3 +248,3 @@ national: string | null;

txt: string[];
provider: string;
mailhost: string;
registration: DomainRegistration;

@@ -313,2 +325,14 @@ }

}
/** A parsed person name. Junk input returns valid: false, never an error. Gender comes from dictionary data and is null when the data does not decide. */
interface Name {
name: string;
valid: boolean;
prefix: string | null;
first: string | null;
middle: string | null;
last: string | null;
suffix: string | null;
gender: 'male' | 'female' | null;
salutation: 'Mr' | 'Ms' | null;
}
interface CurrencyRate {

@@ -328,8 +352,10 @@ base: string;

interface Timezone {
timezone: string;
latitude?: number;
longitude?: number;
timezone: string | null;
name: string | null;
abbreviation: string;
offset: string;
offset_minutes: number;
dst: boolean;
abbreviation: string | null;
offset: string | null;
offset_minutes: number | null;
dst: boolean | null;
next_dst: TimezoneNextDst | null;

@@ -364,4 +390,4 @@ }

interface PointDeep {
city: CityNearest;
timezone: Timezone;
city: CityNearest | null;
timezone: Timezone | null;
}

@@ -544,5 +570,11 @@ interface Point {

language: (code: string) => Promise<Language>;
timezone: (id: string, opts?: {
at?: string;
}) => Promise<Timezone>;
name: (name: string) => Promise<Name>;
timezone: {
(id: string, opts?: {
at?: string;
}): Promise<Timezone>;
(lat: number, lon: number, opts?: {
at?: string;
}): Promise<Timezone>;
};
holiday: ((country: string, opts?: {

@@ -564,2 +596,2 @@ year?: number;

export { type City, type CityNearest, type CitySearch, type Continent, type ContinentCountries, type ContinentCountryItem, type Country, type CountryStateItem, type CountryStates, type Currency, type CurrencyRate, type Deep, type District, type Domain, type DomainDeep, type DomainRegistration, type Elevation, type Email, type EmailDeep, type Emoji, type EmojiSearch, type EmojiSkin, type Holiday, type HolidayDate, type HolidayYear, type Ip, type IpDeep, type Language, type Mx, type MxRecord, type ParseAPIClient, ParseAPIError, type ParseAPIOptions, type Phone, type PhoneDeep, type Point, type PointDeep, type Postal, type PostalDistance, type PostalDistanceEnd, type PostalNearby, type PostalNearbyItem, type State, type StateDistrictItem, type StateDistricts, type Timezone, type TimezoneNextDst, type Useragent, type UseragentBrowserBrand, type UseragentBrowserDeep, type UseragentDeep, type UseragentDeviceDeep, type UseragentEngineDeep, type UseragentOsDeep, type Weather, type WeatherAlert, type WeatherDeep, type WeatherForecastPeriod, parseAPI };
export { type City, type CityNearest, type CitySearch, type Continent, type ContinentCountries, type ContinentCountryItem, type Country, type CountryStateItem, type CountryStates, type Currency, type CurrencyRate, type Deep, type District, type Domain, type DomainDeep, type DomainRegistration, type Elevation, type Email, type EmailDeep, type Emoji, type EmojiSearch, type EmojiSkin, type Holiday, type HolidayDate, type HolidayYear, type Ip, type IpDeep, type Language, type Mx, type MxRecord, type Name, type ParseAPIClient, ParseAPIError, type ParseAPIOptions, type Phone, type PhoneDeep, type Point, type PointDeep, type Postal, type PostalDistance, type PostalDistanceEnd, type PostalNearby, type PostalNearbyItem, type State, type StateDistrictItem, type StateDistricts, type Timezone, type TimezoneNextDst, type Useragent, type UseragentBrowserBrand, type UseragentBrowserDeep, type UseragentDeep, type UseragentDeviceDeep, type UseragentEngineDeep, type UseragentOsDeep, type Weather, type WeatherAlert, type WeatherDeep, type WeatherForecastPeriod, parseAPI };
// src/index.ts
var VERSION = "0.1.1";
var VERSION = "0.1.2";
var DEFAULT_BASE_URL = "https://api.parseapi.com";

@@ -96,2 +96,14 @@ var DEFAULT_TIMEOUT_MS = 1e4;

const deepQuery = (opts) => opts?.deep ? { deep: true } : {};
function timezone(idOrLat, lonOrOpts, opts) {
if (typeof idOrLat === "number") {
return request("/timezone", {
lat: idOrLat,
lon: typeof lonOrOpts === "number" ? lonOrOpts : void 0,
at: opts?.at
});
}
return request(`/timezone/${enc(idOrLat)}`, {
at: lonOrOpts && typeof lonOrOpts === "object" ? lonOrOpts.at : void 0
});
}
return {

@@ -154,3 +166,4 @@ ip: Object.assign(

language: (code) => request(`/language/${enc(code)}`),
timezone: (id, opts) => request(`/timezone/${enc(id)}`, { at: opts?.at }),
name: (name) => request(`/name/${enc(name)}`),
timezone,
holiday: Object.assign(

@@ -157,0 +170,0 @@ (country, opts) => request(`/holiday/${enc(country)}`, { year: opts?.year }),

{
"name": "@parseapi/sdk",
"version": "0.1.1",
"version": "0.1.2",
"description": "Official parseAPI client for Node and TypeScript. One key, minimal JSON, fast.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -44,3 +44,5 @@ # @parseapi/sdk

await parse.language('en');
await parse.name('BILLY OSHALL');
await parse.timezone('America/New_York');
await parse.timezone(40.7128, -74.006);
await parse.holiday('US', { year: 2026 });

@@ -47,0 +49,0 @@ await parse.holiday.date('US', '2026-12-25');