@forge/api
Advanced tools
Comparing version 2.1.0-next.1 to 2.1.0-next.2
# @forge/api | ||
## 2.1.0-next.2 | ||
### Patch Changes | ||
- fef6d3a: Export Route as type for @forge/api | ||
## 2.1.0-next.1 | ||
@@ -4,0 +10,0 @@ |
@@ -59,4 +59,3 @@ import { RequestInit, Response } from 'node-fetch'; | ||
export { startsWith } from '@forge/storage'; | ||
export { route, assumeTrustedRoute } from './safeUrl'; | ||
export type { Route }; | ||
export { route, assumeTrustedRoute, Route } from './safeUrl'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -8,3 +8,2 @@ "use strict"; | ||
const privacy_1 = require("./privacy"); | ||
const safeUrl_1 = require("./safeUrl"); | ||
const webTrigger_1 = require("./webTrigger"); | ||
@@ -51,4 +50,4 @@ Object.defineProperty(exports, "webTrigger", { enumerable: true, get: function () { return webTrigger_1.webTrigger; } }); | ||
Object.defineProperty(exports, "startsWith", { enumerable: true, get: function () { return storage_2.startsWith; } }); | ||
var safeUrl_2 = require("./safeUrl"); | ||
Object.defineProperty(exports, "route", { enumerable: true, get: function () { return safeUrl_2.route; } }); | ||
Object.defineProperty(exports, "assumeTrustedRoute", { enumerable: true, get: function () { return safeUrl_2.assumeTrustedRoute; } }); | ||
var safeUrl_1 = require("./safeUrl"); | ||
Object.defineProperty(exports, "route", { enumerable: true, get: function () { return safeUrl_1.route; } }); | ||
Object.defineProperty(exports, "assumeTrustedRoute", { enumerable: true, get: function () { return safeUrl_1.assumeTrustedRoute; } }); |
@@ -1,7 +0,4 @@ | ||
export declare class Route { | ||
private readonly value_; | ||
constructor(value_: string); | ||
set value(_: string); | ||
get value(): string; | ||
} | ||
export declare type Route = { | ||
readonly value: string; | ||
}; | ||
export declare function route(path: TemplateStringsArray, ...parameters: (string | number | URLSearchParams)[]): Route; | ||
@@ -8,0 +5,0 @@ export declare function requireSafeUrl(url: unknown): Route; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.assumeTrustedRoute = exports.requireSafeUrl = exports.route = exports.Route = void 0; | ||
class Route { | ||
exports.assumeTrustedRoute = exports.requireSafeUrl = exports.route = void 0; | ||
class ReadonlyRoute { | ||
constructor(value_) { | ||
@@ -15,3 +15,2 @@ this.value_ = value_; | ||
} | ||
exports.Route = Route; | ||
function route(path, ...parameters) { | ||
@@ -34,7 +33,7 @@ let fullPath = ''; | ||
} | ||
return new Route(fullPath); | ||
return new ReadonlyRoute(fullPath); | ||
} | ||
exports.route = route; | ||
function requireSafeUrl(url) { | ||
if (url instanceof Route) { | ||
if (url instanceof ReadonlyRoute) { | ||
return url; | ||
@@ -47,4 +46,4 @@ } | ||
function assumeTrustedRoute(route) { | ||
return new Route(route); | ||
return new ReadonlyRoute(route); | ||
} | ||
exports.assumeTrustedRoute = assumeTrustedRoute; |
{ | ||
"name": "@forge/api", | ||
"version": "2.1.0-next.1", | ||
"version": "2.1.0-next.2", | ||
"description": "Forge API methods", | ||
@@ -5,0 +5,0 @@ "author": "Atlassian", |
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
37261
483