@n3oltd/umbraco-data-imports-client
Advanced tools
Comparing version 9.0.61 to 9.0.62
@@ -8,2 +8,4 @@ export declare class ImportsClient { | ||
}); | ||
addFileToImport(referenceId: string, req: AddFileToImportReq): Promise<void>; | ||
protected processAddFileToImport(response: Response): Promise<void>; | ||
getLookupDatePatterns(): Promise<NamedLookupRes[]>; | ||
@@ -16,6 +18,2 @@ protected processGetLookupDatePatterns(response: Response): Promise<NamedLookupRes[]>; | ||
} | ||
export interface NamedLookupRes { | ||
id?: string | undefined; | ||
name?: string | undefined; | ||
} | ||
export interface ProblemDetails { | ||
@@ -28,6 +26,22 @@ type?: string | undefined; | ||
} | ||
export interface AddFileToImportReq { | ||
file?: string | undefined; | ||
} | ||
export interface ByteSize { | ||
bits?: number; | ||
bytes?: number; | ||
kilobytes?: number; | ||
megabytes?: number; | ||
gigabytes?: number; | ||
terabytes?: number; | ||
largestWholeNumberSymbol?: string | undefined; | ||
largestWholeNumberFullWord?: string | undefined; | ||
largestWholeNumberValue?: number; | ||
} | ||
export interface NamedLookupRes { | ||
id?: string | undefined; | ||
name?: string | undefined; | ||
} | ||
export interface QueueImportsRes { | ||
errors?: string[] | undefined; | ||
success?: boolean; | ||
count?: number | undefined; | ||
count?: number; | ||
} | ||
@@ -54,13 +68,2 @@ export interface QueueImportsReq { | ||
} | ||
export interface ByteSize { | ||
bits?: number; | ||
bytes?: number; | ||
kilobytes?: number; | ||
megabytes?: number; | ||
gigabytes?: number; | ||
terabytes?: number; | ||
largestWholeNumberSymbol?: string | undefined; | ||
largestWholeNumberFullWord?: string | undefined; | ||
largestWholeNumberValue?: number; | ||
} | ||
export declare class ApiException extends Error { | ||
@@ -67,0 +70,0 @@ message: string; |
@@ -28,2 +28,60 @@ //---------------------- | ||
} | ||
ImportsClient.prototype.addFileToImport = function (referenceId, req) { | ||
var _this = this; | ||
var url_ = this.baseUrl + "/umbraco/backoffice/api/Imports/queued/{referenceId}/files"; | ||
if (referenceId === undefined || referenceId === null) | ||
throw new Error("The parameter 'referenceId' must be defined."); | ||
url_ = url_.replace("{referenceId}", encodeURIComponent("" + referenceId)); | ||
url_ = url_.replace(/[?&]$/, ""); | ||
var content_ = JSON.stringify(req); | ||
var options_ = { | ||
body: content_, | ||
method: "POST", | ||
headers: { | ||
"Content-Type": "application/json", | ||
} | ||
}; | ||
return this.http.fetch(url_, options_).then(function (_response) { | ||
return _this.processAddFileToImport(_response); | ||
}); | ||
}; | ||
ImportsClient.prototype.processAddFileToImport = function (response) { | ||
var _this = this; | ||
var status = response.status; | ||
var _headers = {}; | ||
if (response.headers && response.headers.forEach) { | ||
response.headers.forEach(function (v, k) { return _headers[k] = v; }); | ||
} | ||
; | ||
if (status === 200) { | ||
return response.text().then(function (_responseText) { | ||
return; | ||
}); | ||
} | ||
else if (status === 400) { | ||
return response.text().then(function (_responseText) { | ||
var result400 = null; | ||
result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver); | ||
return throwException("A server side error occurred.", status, _responseText, _headers, result400); | ||
}); | ||
} | ||
else if (status === 500) { | ||
return response.text().then(function (_responseText) { | ||
return throwException("A server side error occurred.", status, _responseText, _headers); | ||
}); | ||
} | ||
else if (status === 404) { | ||
return response.text().then(function (_responseText) { | ||
var result404 = null; | ||
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver); | ||
return throwException("A server side error occurred.", status, _responseText, _headers, result404); | ||
}); | ||
} | ||
else if (status !== 200 && status !== 204) { | ||
return response.text().then(function (_responseText) { | ||
return throwException("An unexpected server error occurred.", status, _responseText, _headers); | ||
}); | ||
} | ||
return Promise.resolve(null); | ||
}; | ||
ImportsClient.prototype.getLookupDatePatterns = function () { | ||
@@ -30,0 +88,0 @@ var _this = this; |
@@ -8,2 +8,4 @@ export declare class ImportsClient { | ||
}); | ||
addFileToImport(referenceId: string, req: AddFileToImportReq): Promise<void>; | ||
protected processAddFileToImport(response: Response): Promise<void>; | ||
getLookupDatePatterns(): Promise<NamedLookupRes[]>; | ||
@@ -16,6 +18,2 @@ protected processGetLookupDatePatterns(response: Response): Promise<NamedLookupRes[]>; | ||
} | ||
export interface NamedLookupRes { | ||
id?: string | undefined; | ||
name?: string | undefined; | ||
} | ||
export interface ProblemDetails { | ||
@@ -28,6 +26,22 @@ type?: string | undefined; | ||
} | ||
export interface AddFileToImportReq { | ||
file?: string | undefined; | ||
} | ||
export interface ByteSize { | ||
bits?: number; | ||
bytes?: number; | ||
kilobytes?: number; | ||
megabytes?: number; | ||
gigabytes?: number; | ||
terabytes?: number; | ||
largestWholeNumberSymbol?: string | undefined; | ||
largestWholeNumberFullWord?: string | undefined; | ||
largestWholeNumberValue?: number; | ||
} | ||
export interface NamedLookupRes { | ||
id?: string | undefined; | ||
name?: string | undefined; | ||
} | ||
export interface QueueImportsRes { | ||
errors?: string[] | undefined; | ||
success?: boolean; | ||
count?: number | undefined; | ||
count?: number; | ||
} | ||
@@ -54,13 +68,2 @@ export interface QueueImportsReq { | ||
} | ||
export interface ByteSize { | ||
bits?: number; | ||
bytes?: number; | ||
kilobytes?: number; | ||
megabytes?: number; | ||
gigabytes?: number; | ||
terabytes?: number; | ||
largestWholeNumberSymbol?: string | undefined; | ||
largestWholeNumberFullWord?: string | undefined; | ||
largestWholeNumberValue?: number; | ||
} | ||
export declare class ApiException extends Error { | ||
@@ -67,0 +70,0 @@ message: string; |
@@ -28,2 +28,60 @@ //---------------------- | ||
} | ||
ImportsClient.prototype.addFileToImport = function (referenceId, req) { | ||
var _this = this; | ||
var url_ = this.baseUrl + "/umbraco/backoffice/api/Imports/queued/{referenceId}/files"; | ||
if (referenceId === undefined || referenceId === null) | ||
throw new Error("The parameter 'referenceId' must be defined."); | ||
url_ = url_.replace("{referenceId}", encodeURIComponent("" + referenceId)); | ||
url_ = url_.replace(/[?&]$/, ""); | ||
var content_ = JSON.stringify(req); | ||
var options_ = { | ||
body: content_, | ||
method: "POST", | ||
headers: { | ||
"Content-Type": "application/json", | ||
} | ||
}; | ||
return this.http.fetch(url_, options_).then(function (_response) { | ||
return _this.processAddFileToImport(_response); | ||
}); | ||
}; | ||
ImportsClient.prototype.processAddFileToImport = function (response) { | ||
var _this = this; | ||
var status = response.status; | ||
var _headers = {}; | ||
if (response.headers && response.headers.forEach) { | ||
response.headers.forEach(function (v, k) { return _headers[k] = v; }); | ||
} | ||
; | ||
if (status === 200) { | ||
return response.text().then(function (_responseText) { | ||
return; | ||
}); | ||
} | ||
else if (status === 400) { | ||
return response.text().then(function (_responseText) { | ||
var result400 = null; | ||
result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver); | ||
return throwException("A server side error occurred.", status, _responseText, _headers, result400); | ||
}); | ||
} | ||
else if (status === 500) { | ||
return response.text().then(function (_responseText) { | ||
return throwException("A server side error occurred.", status, _responseText, _headers); | ||
}); | ||
} | ||
else if (status === 404) { | ||
return response.text().then(function (_responseText) { | ||
var result404 = null; | ||
result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver); | ||
return throwException("A server side error occurred.", status, _responseText, _headers, result404); | ||
}); | ||
} | ||
else if (status !== 200 && status !== 204) { | ||
return response.text().then(function (_responseText) { | ||
return throwException("An unexpected server error occurred.", status, _responseText, _headers); | ||
}); | ||
} | ||
return Promise.resolve(null); | ||
}; | ||
ImportsClient.prototype.getLookupDatePatterns = function () { | ||
@@ -30,0 +88,0 @@ var _this = this; |
@@ -5,3 +5,3 @@ { | ||
"description": "TODO", | ||
"version": "9.0.61", | ||
"version": "9.0.62", | ||
"dependencies": {}, | ||
@@ -8,0 +8,0 @@ "license": "UNLICENSED", |
@@ -21,2 +21,55 @@ //---------------------- | ||
addFileToImport(referenceId: string, req: AddFileToImportReq): Promise<void> { | ||
let url_ = this.baseUrl + "/umbraco/backoffice/api/Imports/queued/{referenceId}/files"; | ||
if (referenceId === undefined || referenceId === null) | ||
throw new Error("The parameter 'referenceId' must be defined."); | ||
url_ = url_.replace("{referenceId}", encodeURIComponent("" + referenceId)); | ||
url_ = url_.replace(/[?&]$/, ""); | ||
const content_ = JSON.stringify(req); | ||
let options_: RequestInit = { | ||
body: content_, | ||
method: "POST", | ||
headers: { | ||
"Content-Type": "application/json", | ||
} | ||
}; | ||
return this.http.fetch(url_, options_).then((_response: Response) => { | ||
return this.processAddFileToImport(_response); | ||
}); | ||
} | ||
protected processAddFileToImport(response: Response): Promise<void> { | ||
const status = response.status; | ||
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; | ||
if (status === 200) { | ||
return response.text().then((_responseText) => { | ||
return; | ||
}); | ||
} else if (status === 400) { | ||
return response.text().then((_responseText) => { | ||
let result400: any = null; | ||
result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as ProblemDetails; | ||
return throwException("A server side error occurred.", status, _responseText, _headers, result400); | ||
}); | ||
} else if (status === 500) { | ||
return response.text().then((_responseText) => { | ||
return throwException("A server side error occurred.", status, _responseText, _headers); | ||
}); | ||
} else if (status === 404) { | ||
return response.text().then((_responseText) => { | ||
let result404: any = null; | ||
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as ProblemDetails; | ||
return throwException("A server side error occurred.", status, _responseText, _headers, result404); | ||
}); | ||
} else if (status !== 200 && status !== 204) { | ||
return response.text().then((_responseText) => { | ||
return throwException("An unexpected server error occurred.", status, _responseText, _headers); | ||
}); | ||
} | ||
return Promise.resolve<void>(null as any); | ||
} | ||
getLookupDatePatterns(): Promise<NamedLookupRes[]> { | ||
@@ -174,7 +227,2 @@ let url_ = this.baseUrl + "/umbraco/backoffice/api/Imports/lookups/datePatterns"; | ||
export interface NamedLookupRes { | ||
id?: string | undefined; | ||
name?: string | undefined; | ||
} | ||
export interface ProblemDetails { | ||
@@ -188,6 +236,25 @@ type?: string | undefined; | ||
export interface AddFileToImportReq { | ||
file?: string | undefined; | ||
} | ||
export interface ByteSize { | ||
bits?: number; | ||
bytes?: number; | ||
kilobytes?: number; | ||
megabytes?: number; | ||
gigabytes?: number; | ||
terabytes?: number; | ||
largestWholeNumberSymbol?: string | undefined; | ||
largestWholeNumberFullWord?: string | undefined; | ||
largestWholeNumberValue?: number; | ||
} | ||
export interface NamedLookupRes { | ||
id?: string | undefined; | ||
name?: string | undefined; | ||
} | ||
export interface QueueImportsRes { | ||
errors?: string[] | undefined; | ||
success?: boolean; | ||
count?: number | undefined; | ||
count?: number; | ||
} | ||
@@ -218,14 +285,2 @@ | ||
export interface ByteSize { | ||
bits?: number; | ||
bytes?: number; | ||
kilobytes?: number; | ||
megabytes?: number; | ||
gigabytes?: number; | ||
terabytes?: number; | ||
largestWholeNumberSymbol?: string | undefined; | ||
largestWholeNumberFullWord?: string | undefined; | ||
largestWholeNumberValue?: number; | ||
} | ||
export class ApiException extends Error { | ||
@@ -232,0 +287,0 @@ message: string; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
103958
1354