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

onemapsg

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

onemapsg - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

dist/types.d.ts

2

dist/index.d.ts

@@ -1,2 +0,2 @@

import { default as OneMap } from './OneMap';
import { OneMap } from './OneMap';
export default OneMap;
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const OneMap_1 = __importDefault(require("./OneMap"));
exports.default = OneMap_1.default;
const OneMap_1 = require("./OneMap");
exports.default = OneMap_1.OneMap;

@@ -11,5 +11,5 @@ import { AxiosProxyConfig } from 'axios';

}
export default class OneMap {
export declare class OneMap {
static readonly BASE_URL = "https://developers.onemap.sg";
readonly options: Options;
readonly options?: Options;
readonly auth: Auth;

@@ -16,0 +16,0 @@ readonly search: Search;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OneMap = void 0;
const services_1 = require("./services");

@@ -18,3 +19,3 @@ class OneMap {

}
exports.default = OneMap;
exports.OneMap = OneMap;
OneMap.BASE_URL = 'https://developers.onemap.sg';
import OneMap from '..';
import { Service } from '.';
import { APIRes } from '../Types';
export interface GetTokennRes extends APIRes {
import { ApiRes } from '../types';
export interface GetTokennRes extends ApiRes {
access_token: string;
expiry_timestamp: string;
}
export default class Auth extends Service {
export declare class Auth extends Service {
constructor(onemap: OneMap);
getToken(): Promise<GetTokennRes>;
}

@@ -15,2 +15,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Auth = void 0;
const axios_1 = __importDefault(require("axios"));

@@ -44,2 +45,2 @@ const __1 = __importDefault(require(".."));

}
exports.default = Auth;
exports.Auth = Auth;
import OneMap from '..';
import { Service } from '.';
import { Coordinates, APIRes } from '../Types';
import { Coordinates, ApiRes } from '../types';
export interface RevgeocodeReq {

@@ -10,3 +10,3 @@ location: Coordinates;

}
export interface RevgeocodeRes extends APIRes {
export interface RevgeocodeRes extends ApiRes {
GeocodeInfo: {

@@ -24,3 +24,3 @@ BUILDINGNAME: string;

}
export default class Common extends Service {
export declare class Common extends Service {
constructor(onemap: OneMap);

@@ -27,0 +27,0 @@ revgeocodexy(req: RevgeocodeReq): Promise<RevgeocodeRes>;

@@ -12,2 +12,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Common = void 0;
const _1 = require(".");

@@ -33,2 +34,2 @@ class Common extends _1.Service {

}
exports.default = Common;
exports.Common = Common;
import OneMap from '..';
import { Service } from '.';
import { APIRes } from '../Types';
import { ApiRes } from '../types';
export interface LatLonReq {

@@ -12,11 +12,11 @@ latitude: number;

}
export interface LatLonRes extends APIRes {
export interface LatLonRes extends ApiRes {
latitude: number;
longitude: number;
}
export interface XYRes extends APIRes {
export interface XYRes extends ApiRes {
X: number;
Y: number;
}
export default class Convert extends Service {
export declare class Convert extends Service {
constructor(onemap: OneMap);

@@ -23,0 +23,0 @@ _4326to3857(req: LatLonReq): Promise<XYRes>;

@@ -12,2 +12,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Convert = void 0;
const _1 = require(".");

@@ -49,2 +50,2 @@ class Convert extends _1.Service {

}
exports.default = Convert;
exports.Convert = Convert;

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

export { default as Service } from './Service';
export { default as Auth } from './Auth';
export { default as Search } from './Search';
export { default as Common } from './Common';
export { default as Convert } from './Convert';
export { default as Theme } from './Theme';
export { default as Planning } from './Planning';
export { default as Population } from './Population';
export { default as Route } from './Route';
export { default as StaticMap } from './StaticMap';
export { Service } from './Service';
export { Auth } from './Auth';
export { Search } from './Search';
export { Common } from './Common';
export { Convert } from './Convert';
export { Theme } from './Theme';
export { Planning } from './Planning';
export { Population } from './Population';
export { Route } from './Route';
export { StaticMap } from './StaticMap';
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.StaticMap = exports.Route = exports.Population = exports.Planning = exports.Theme = exports.Convert = exports.Common = exports.Search = exports.Auth = exports.Service = void 0;
var Service_1 = require("./Service");
Object.defineProperty(exports, "Service", { enumerable: true, get: function () { return __importDefault(Service_1).default; } });
Object.defineProperty(exports, "Service", { enumerable: true, get: function () { return Service_1.Service; } });
var Auth_1 = require("./Auth");
Object.defineProperty(exports, "Auth", { enumerable: true, get: function () { return __importDefault(Auth_1).default; } });
Object.defineProperty(exports, "Auth", { enumerable: true, get: function () { return Auth_1.Auth; } });
var Search_1 = require("./Search");
Object.defineProperty(exports, "Search", { enumerable: true, get: function () { return __importDefault(Search_1).default; } });
Object.defineProperty(exports, "Search", { enumerable: true, get: function () { return Search_1.Search; } });
var Common_1 = require("./Common");
Object.defineProperty(exports, "Common", { enumerable: true, get: function () { return __importDefault(Common_1).default; } });
Object.defineProperty(exports, "Common", { enumerable: true, get: function () { return Common_1.Common; } });
var Convert_1 = require("./Convert");
Object.defineProperty(exports, "Convert", { enumerable: true, get: function () { return __importDefault(Convert_1).default; } });
Object.defineProperty(exports, "Convert", { enumerable: true, get: function () { return Convert_1.Convert; } });
var Theme_1 = require("./Theme");
Object.defineProperty(exports, "Theme", { enumerable: true, get: function () { return __importDefault(Theme_1).default; } });
Object.defineProperty(exports, "Theme", { enumerable: true, get: function () { return Theme_1.Theme; } });
var Planning_1 = require("./Planning");
Object.defineProperty(exports, "Planning", { enumerable: true, get: function () { return __importDefault(Planning_1).default; } });
Object.defineProperty(exports, "Planning", { enumerable: true, get: function () { return Planning_1.Planning; } });
var Population_1 = require("./Population");
Object.defineProperty(exports, "Population", { enumerable: true, get: function () { return __importDefault(Population_1).default; } });
Object.defineProperty(exports, "Population", { enumerable: true, get: function () { return Population_1.Population; } });
var Route_1 = require("./Route");
Object.defineProperty(exports, "Route", { enumerable: true, get: function () { return __importDefault(Route_1).default; } });
Object.defineProperty(exports, "Route", { enumerable: true, get: function () { return Route_1.Route; } });
var StaticMap_1 = require("./StaticMap");
Object.defineProperty(exports, "StaticMap", { enumerable: true, get: function () { return __importDefault(StaticMap_1).default; } });
Object.defineProperty(exports, "StaticMap", { enumerable: true, get: function () { return StaticMap_1.StaticMap; } });
import OneMap from '..';
import { Service } from '.';
import { APIRes } from '../Types';
import { ApiRes } from '../types';
export interface GetAllPlanningareaReq {

@@ -23,7 +23,7 @@ year: number;

}
export default class Planning extends Service {
export declare class Planning extends Service {
constructor(onemap: OneMap);
getAllPlanningarea(req: GetAllPlanningareaReq): Promise<PlanningareaRes[] | APIRes>;
getPlanningareaNames(req: GetPlanningareaNamesReq): Promise<GetPlanningareaNamesRes[] | APIRes>;
getPlanningarea(req: GetPlanningareaReq): Promise<PlanningareaRes[] | APIRes>;
getAllPlanningarea(req: GetAllPlanningareaReq): Promise<PlanningareaRes[] | ApiRes>;
getPlanningareaNames(req: GetPlanningareaNamesReq): Promise<GetPlanningareaNamesRes[] | ApiRes>;
getPlanningarea(req: GetPlanningareaReq): Promise<PlanningareaRes[] | ApiRes>;
}

@@ -12,2 +12,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Planning = void 0;
const _1 = require(".");

@@ -34,2 +35,2 @@ class Planning extends _1.Service {

}
exports.default = Planning;
exports.Planning = Planning;
import OneMap from '..';
import { Service } from '.';
import { APIRes } from '../Types';
import { ApiRes } from '../types';
export interface PopulationReq {

@@ -12,3 +12,3 @@ year: number;

}
export interface GetEconomicStatusRes extends APIRes {
export interface GetEconomicStatusRes extends ApiRes {
planning_area: string;

@@ -21,3 +21,3 @@ employed: number;

}
export interface GetEducationAttendingRes extends APIRes {
export interface GetEducationAttendingRes extends ApiRes {
planning_area: string;

@@ -33,3 +33,3 @@ pre_primary: number;

}
export interface GetEthnicGroupRes extends APIRes {
export interface GetEthnicGroupRes extends ApiRes {
planning_area: string;

@@ -43,3 +43,3 @@ chinese: number;

}
export interface GetHouseholdMonthlyIncomeWorkRes extends APIRes {
export interface GetHouseholdMonthlyIncomeWorkRes extends ApiRes {
planning_area: string;

@@ -61,3 +61,3 @@ total: number;

}
export interface GetHouseholdSizeRes extends APIRes {
export interface GetHouseholdSizeRes extends ApiRes {
planning_area: string;

@@ -74,3 +74,3 @@ person1: number;

}
export interface GetHouseholdStructureRes extends APIRes {
export interface GetHouseholdStructureRes extends ApiRes {
planning_area: string;

@@ -86,3 +86,3 @@ no_family_nucleus: number;

}
export interface GetIncomeFromWorkRes extends APIRes {
export interface GetIncomeFromWorkRes extends ApiRes {
planning_area: string;

@@ -102,3 +102,3 @@ below_sgd_1000: number;

}
export interface GetIndustryRes extends APIRes {
export interface GetIndustryRes extends ApiRes {
planning_area: string;

@@ -126,3 +126,3 @@ manufacturing: number;

}
export interface GetLanguageLiterateRes extends APIRes {
export interface GetLanguageLiterateRes extends ApiRes {
planning_area: string;

@@ -145,3 +145,3 @@ no_literate: number;

}
export interface GetMaritalStatusRes extends APIRes {
export interface GetMaritalStatusRes extends ApiRes {
planning_area: string;

@@ -155,3 +155,3 @@ single: number;

}
export interface GetModeOfTransportSchoolRes extends APIRes {
export interface GetModeOfTransportSchoolRes extends ApiRes {
planning_area: string;

@@ -172,3 +172,3 @@ bus: number;

}
export interface GetModeOfTransportWorkRes extends APIRes {
export interface GetModeOfTransportWorkRes extends ApiRes {
planning_area: string;

@@ -189,3 +189,3 @@ bus: number;

}
export interface GetOccupationRes extends APIRes {
export interface GetOccupationRes extends ApiRes {
planning_area: string;

@@ -204,3 +204,3 @@ senior_officials_managers: number;

}
export interface GetPopulationAgeGroupRes extends APIRes {
export interface GetPopulationAgeGroupRes extends ApiRes {
planning_area: string;

@@ -229,3 +229,3 @@ age_0_4: number;

}
export interface GetReligionRes extends APIRes {
export interface GetReligionRes extends ApiRes {
planning_area: string;

@@ -243,3 +243,3 @@ no_religion: number;

}
export interface GetSpokenAtHomeRes extends APIRes {
export interface GetSpokenAtHomeRes extends ApiRes {
planning_area: string;

@@ -255,3 +255,3 @@ english: number;

}
export interface GetTenancyRes extends APIRes {
export interface GetTenancyRes extends ApiRes {
planning_area: string;

@@ -263,3 +263,3 @@ owner: number;

}
export interface GetTypeOfDwellingHouseholdRes extends APIRes {
export interface GetTypeOfDwellingHouseholdRes extends ApiRes {
planning_area: string;

@@ -276,3 +276,3 @@ hdb_1_2_room_flats: number;

}
export interface GetTypeOfDwellingPopRes extends APIRes {
export interface GetTypeOfDwellingPopRes extends ApiRes {
id: string;

@@ -291,3 +291,3 @@ planning_area: string;

}
export default class Population extends Service {
export declare class Population extends Service {
constructor(onemap: OneMap);

@@ -294,0 +294,0 @@ getEconomicStatus(req: PopulationReqWithGender): Promise<GetEconomicStatusRes[]>;

@@ -12,2 +12,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Population = void 0;
const _1 = require(".");

@@ -114,2 +115,2 @@ class Population extends _1.Service {

}
exports.default = Population;
exports.Population = Population;
import OneMap from '..';
import { Service } from '.';
import { Coordinates, APIRes } from '../Types';
import { Coordinates, ApiRes } from '../types';
export interface RouteReq {

@@ -9,3 +9,3 @@ start: Coordinates;

}
export interface RouteRes extends APIRes {
export interface RouteRes extends ApiRes {
status_message: string;

@@ -40,5 +40,5 @@ alternative_names: string[][];

}
export default class Route extends Service {
export declare class Route extends Service {
constructor(onemap: OneMap);
route(req: RouteReq): Promise<RouteRes>;
}

@@ -12,2 +12,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Route = void 0;
const _1 = require(".");

@@ -27,2 +28,2 @@ class Route extends _1.Service {

}
exports.default = Route;
exports.Route = Route;
import OneMap from '..';
import { Service } from '.';
import { APIRes } from '../Types';
import { ApiRes } from '../types';
export interface SearchReq {

@@ -10,3 +10,3 @@ searchVal: string;

}
export interface SearchRes extends APIRes {
export interface SearchRes extends ApiRes {
found: number;

@@ -28,5 +28,5 @@ totalNumPages: number;

}
export default class Search extends Service {
export declare class Search extends Service {
constructor(onemap: OneMap);
search(req: SearchReq): Promise<SearchRes>;
}

@@ -12,2 +12,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Search = void 0;
const _1 = require(".");

@@ -24,2 +25,2 @@ class Search extends _1.Service {

}
exports.default = Search;
exports.Search = Search;
import OneMap from '..';
export default class Service {
export declare class Service {
readonly onemap: OneMap;

@@ -4,0 +4,0 @@ readonly serviceName: string;

@@ -15,2 +15,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Service = void 0;
const axios_1 = __importDefault(require("axios"));

@@ -67,2 +68,2 @@ const querystring_1 = __importDefault(require("querystring"));

}
exports.default = Service;
exports.Service = Service;
import OneMap from '..';
import { Service } from '.';
import { Coordinates, Color } from '../Types';
import { Coordinates, Color } from '../types';
export interface GetStaticImageUriReq {

@@ -29,5 +29,5 @@ layerchosen: 'night' | 'grey' | 'original' | 'default' | 'landlot';

}
export default class StaticMap extends Service {
export declare class StaticMap extends Service {
constructor(onemap: OneMap);
getStaticImageUri(req: GetStaticImageUriReq): string;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StaticMap = void 0;
const _1 = require(".");

@@ -28,2 +29,2 @@ class StaticMap extends _1.Service {

}
exports.default = StaticMap;
exports.StaticMap = StaticMap;
import OneMap from '..';
import { Service } from '.';
import { Coordinates, APIRes } from '../Types';
import { Coordinates, ApiRes } from '../types';
export interface CheckThemeStatusReq {

@@ -8,3 +8,3 @@ queryName: string;

}
export interface CheckThemeStatusRes extends APIRes {
export interface CheckThemeStatusRes extends ApiRes {
UpdatedFile: boolean;

@@ -15,3 +15,3 @@ }

}
export interface GetThemeInfoRes extends APIRes {
export interface GetThemeInfoRes extends ApiRes {
Theme_Names: {

@@ -25,3 +25,3 @@ THEMENAME: string;

}
export interface GetAllThemesInfoRes extends APIRes {
export interface GetAllThemesInfoRes extends ApiRes {
Theme_Names: {

@@ -36,3 +36,3 @@ THEMENAME: string;

}
export interface RetrieveThemeRes extends APIRes {
export interface RetrieveThemeRes extends ApiRes {
SrchResults: {

@@ -50,3 +50,3 @@ FeatCount: number;

}
export default class Theme extends Service {
export declare class Theme extends Service {
constructor(onemap: OneMap);

@@ -53,0 +53,0 @@ checkThemeStatus(req: CheckThemeStatusReq): Promise<CheckThemeStatusRes>;

@@ -15,2 +15,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Theme = void 0;
const dayjs_1 = __importDefault(require("dayjs"));

@@ -51,2 +52,2 @@ const _1 = require(".");

}
exports.default = Theme;
exports.Theme = Theme;
{
"name": "onemapsg",
"version": "1.0.1",
"version": "1.0.2",
"author": "Chang Zhe Jiet",

@@ -25,3 +25,2 @@ "description": "Helper library for using OneMap APIs.",

"lint": "eslint src/**/*.ts test/**/*.ts",
"lint-mac": "eslint 'src/**/*.ts' 'test/**/*.ts'",
"test": "jest",

@@ -35,16 +34,16 @@ "build": "del-cli --force dist && tsc",

"axios": "^0.21.1",
"dayjs": "^1.10.4"
"dayjs": "^1.10.5"
},
"devDependencies": {
"@types/jest": "^26.0.20",
"@typescript-eslint/eslint-plugin": "^4.14.2",
"@typescript-eslint/parser": "^4.14.2",
"@types/jest": "^26.0.23",
"@typescript-eslint/eslint-plugin": "^4.25.0",
"@typescript-eslint/parser": "^4.25.0",
"del-cli": "^3.0.1",
"eslint": "^7.19.0",
"eslint-plugin-import": "^2.22.1",
"jest": "^26.6.3",
"ts-jest": "^26.5.0",
"ts-node": "^9.1.1",
"typescript": "^4.1.3"
"eslint": "^7.27.0",
"eslint-plugin-import": "^2.23.4",
"jest": "^27.0.3",
"ts-jest": "^27.0.1",
"ts-node": "^10.0.0",
"typescript": "^4.3.2"
}
}

@@ -1,6 +0,7 @@

# **onemapsg**
# **onemapsg**
[![npm package](https://img.shields.io/npm/v/onemapsg)](https://www.npmjs.com/package/onemapsg)
[![npm downloads](https://img.shields.io/npm/dt/onemapsg)](https://www.npmjs.com/package/onemapsg)
[![GitHub issues](https://img.shields.io/github/issues/ahzhezhe/onemapsg)](https://github.com/ahzhezhe/onemapsg)
[![GitHub issues](https://img.shields.io/github/issues/ahzhezhe/onemapsg)](https://github.com/ahzhezhe/onemapsg/issues)
[![GitHub license](https://img.shields.io/github/license/ahzhezhe/onemapsg)](https://github.com/ahzhezhe/onemapsg/blob/master/LICENSE)

@@ -20,3 +21,3 @@ Helper library for using OneMap APIs (https://docs.onemap.sg/).

// Credential is optional, you do not need to supply credential if you are using common APIs only.
// Credential is optional, you do not need to supply credential if you are using common APIs only.
const onemap = new OneMap({

@@ -23,0 +24,0 @@ email: 'your_email',

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