Comparing version 1.1.0-beta.6 to 1.1.0-beta.7
@@ -5,2 +5,3 @@ import { Cache, Customers, Notes, Payments, Reservations, Tasks, Tours } from './models'; | ||
import SetupAPI from './models/setup'; | ||
import { NoteManager } from './models/notes'; | ||
export * as Auth from './auth'; | ||
@@ -54,2 +55,3 @@ export * as Models from './models'; | ||
get setup(): SetupAPI; | ||
get noteManager(): NoteManager; | ||
/** | ||
@@ -56,0 +58,0 @@ * Add a new interceptor before a request is sent |
@@ -31,2 +31,3 @@ "use strict"; | ||
const setup_1 = __importDefault(require("./models/setup")); | ||
const notes_1 = require("./models/notes"); | ||
exports.Auth = __importStar(require("./auth")); | ||
@@ -104,2 +105,5 @@ exports.Models = __importStar(require("./models")); | ||
} | ||
get noteManager() { | ||
return new notes_1.NoteManager(this.axios); | ||
} | ||
/** | ||
@@ -106,0 +110,0 @@ * Add a new interceptor before a request is sent |
import { APIGroup, LinkedObject } from "./common"; | ||
export declare type NoteType = "SpecialRequest" | "Amendment" | "Diet" | "Medical" | "CustomerFeedback" | "Complaint" | "ChildCare" | "TermsAndConditions" | "Insurance" | "AccessCode" | "ArrivalTime" | "Generic" | "FlightNotes" | "FlightNotesManual" | "Membership" | "EveOfDeparture" | "FinalDocuments" | "SailingQualification" | "Representative" | "CreditControl" | "PassportAndVisaInformation" | "ImportantInformation" | "Recommended"; | ||
export interface Note extends LinkedObject { | ||
Id: number; | ||
Type: NoteType; | ||
Title: string; | ||
Text: string; | ||
} | ||
export interface NotePayload { | ||
BundleReference: string; | ||
Type: NoteType; | ||
Title: string; | ||
Text: string; | ||
ValidDocuments?: string[]; | ||
IsPredefinedNote?: boolean; | ||
} | ||
export interface Note extends NotePayload, LinkedObject { | ||
Id: number; | ||
} | ||
export declare class Api extends APIGroup { | ||
@@ -35,1 +35,7 @@ /** | ||
} | ||
export declare class NoteManager extends APIGroup { | ||
list(resourceReference: string): Promise<Note[]>; | ||
add(note: NotePayload): Promise<Note>; | ||
get(id: number): Promise<Note | null>; | ||
remove(id: number): Promise<void>; | ||
} |
@@ -12,3 +12,4 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Api = void 0; | ||
exports.NoteManager = exports.Api = void 0; | ||
const axios_1 = require("axios"); | ||
const common_1 = require("./common"); | ||
@@ -39,4 +40,3 @@ class Api extends common_1.APIGroup { | ||
catch (error) { | ||
const err = error; | ||
if (((_a = err.response) === null || _a === void 0 ? void 0 : _a.status) === 404) { | ||
if (axios_1.isAxiosError(error) && ((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === 404) { | ||
throw new Error("Specified resource does not support notes"); | ||
@@ -64,4 +64,3 @@ } | ||
catch (error) { | ||
const err = error; | ||
if (((_a = err.response) === null || _a === void 0 ? void 0 : _a.status) === 404) { | ||
if (axios_1.isAxiosError(error) && ((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === 404) { | ||
throw new Error("Specified resource does not support notes"); | ||
@@ -75,2 +74,25 @@ } | ||
exports.Api = Api; | ||
class NoteManager extends common_1.APIGroup { | ||
list(resourceReference) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return (yield this.axios.get(`/notemanager/notes`, { params: { bundleReference: resourceReference } })).data; | ||
}); | ||
} | ||
add(note) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return (yield this.axios.post(`/notemanager/notes`, note)).data; | ||
}); | ||
} | ||
get(id) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return (yield this.axios.get(`/notemanager/notes/${id}`)).data; | ||
}); | ||
} | ||
remove(id) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
yield this.axios.delete(`/notemanager/notes/${id}`); | ||
}); | ||
} | ||
} | ||
exports.NoteManager = NoteManager; | ||
//# sourceMappingURL=notes.js.map |
{ | ||
"name": "tigerbay", | ||
"version": "1.1.0-beta.6", | ||
"version": "1.1.0-beta.7", | ||
"description": "API Client library for TigerBay", | ||
@@ -5,0 +5,0 @@ "main": "lib/client.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
104610
2574