@forge/api 3.9.2 → 4.0.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/out/index.d.ts +1 -16
- package/out/index.d.ts.map +1 -1
- package/out/index.js +2 -23
- package/out/runtime/fetch-and-storage.d.ts +2 -0
- package/out/runtime/fetch-and-storage.d.ts.map +1 -1
- package/out/runtime/fetch-and-storage.js +5 -1
- package/package.json +2 -2
- package/out/properties/confluence-page.d.ts +0 -7
- package/out/properties/confluence-page.d.ts.map +0 -1
- package/out/properties/confluence-page.js +0 -15
- package/out/properties/confluence-space.d.ts +0 -7
- package/out/properties/confluence-space.d.ts.map +0 -1
- package/out/properties/confluence-space.js +0 -15
- package/out/properties/confluence-versioned-storage.d.ts +0 -6
- package/out/properties/confluence-versioned-storage.d.ts.map +0 -1
- package/out/properties/confluence-versioned-storage.js +0 -35
- package/out/properties/index.d.ts +0 -8
- package/out/properties/index.d.ts.map +0 -1
- package/out/properties/index.js +0 -24
- package/out/properties/jira-issue.d.ts +0 -6
- package/out/properties/jira-issue.d.ts.map +0 -1
- package/out/properties/jira-issue.js +0 -12
- package/out/properties/jira-project.d.ts +0 -6
- package/out/properties/jira-project.d.ts.map +0 -1
- package/out/properties/jira-project.js +0 -12
- package/out/properties/product-scoped-storage.d.ts +0 -19
- package/out/properties/product-scoped-storage.d.ts.map +0 -1
- package/out/properties/product-scoped-storage.js +0 -45
- package/out/properties/sanitized-key.d.ts +0 -2
- package/out/properties/sanitized-key.d.ts.map +0 -1
- package/out/properties/sanitized-key.js +0 -11
- package/out/properties/storage-adapter.d.ts +0 -6
- package/out/properties/storage-adapter.d.ts.map +0 -1
- package/out/properties/storage-adapter.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @forge/api
|
|
2
2
|
|
|
3
|
+
## 4.0.0-next.1
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 7e05319: The deprecated Properties API has been removed.
|
|
8
|
+
|
|
9
|
+
This api was deprected here: https://developer.atlassian.com/platform/forge/changelog/#CHANGE-1231
|
|
10
|
+
|
|
11
|
+
## 3.10.0-next.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- a17ae69: Calls to storage api now capture success rates and latency metrics.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [a17ae69]
|
|
20
|
+
- @forge/storage@1.6.0-next.0
|
|
21
|
+
|
|
3
22
|
## 3.9.2
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/out/index.d.ts
CHANGED
|
@@ -47,12 +47,6 @@ export interface StorageMethods {
|
|
|
47
47
|
set: (key: string, value: string | number | boolean | Record<string, any> | any[]) => Promise<void>;
|
|
48
48
|
delete: (key: string) => Promise<void>;
|
|
49
49
|
}
|
|
50
|
-
export interface PropertiesAPI {
|
|
51
|
-
onJiraProject: (context: string) => StorageMethods;
|
|
52
|
-
onJiraIssue: (context: string) => StorageMethods;
|
|
53
|
-
onConfluencePage: (context: string) => StorageMethods;
|
|
54
|
-
onConfluenceSpace: (context: string) => StorageMethods;
|
|
55
|
-
}
|
|
56
50
|
export interface StorageAPI extends StorageMethods, QueryApi, EntityStorageApi {
|
|
57
51
|
}
|
|
58
52
|
export interface ForgeStorageAPI extends StorageAPI {
|
|
@@ -60,12 +54,6 @@ export interface ForgeStorageAPI extends StorageAPI {
|
|
|
60
54
|
setSecret: (key: string, value: any) => Promise<void>;
|
|
61
55
|
deleteSecret: (key: string) => Promise<void>;
|
|
62
56
|
}
|
|
63
|
-
export interface StoreAPI extends PropertiesAPI {
|
|
64
|
-
onJiraProject: (context: string) => StorageMethods;
|
|
65
|
-
onJiraIssue: (context: string) => StorageMethods;
|
|
66
|
-
onConfluencePage: (context: string) => StorageMethods;
|
|
67
|
-
onConfluenceSpace: (context: string) => StorageMethods;
|
|
68
|
-
}
|
|
69
57
|
export declare type AsUserFetchMethods = RequestProductMethods & GraphQLFetchMethods & ConnectedDataFetchMethods & ExternalAuthFetchMethodsProvider;
|
|
70
58
|
export declare type AsAppFetchMethods = RequestProductMethods & GraphQLFetchMethods & ConnectedDataFetchMethods;
|
|
71
59
|
export interface FetchAPI extends RequestProductMethods {
|
|
@@ -74,7 +62,6 @@ export interface FetchAPI extends RequestProductMethods {
|
|
|
74
62
|
fetch: FetchMethodAllowingRoute;
|
|
75
63
|
}
|
|
76
64
|
export interface ForgeAPI extends FetchAPI {
|
|
77
|
-
store: StoreAPI;
|
|
78
65
|
invokeRemote: typeof invokeRemote;
|
|
79
66
|
}
|
|
80
67
|
declare const asUser: () => AsUserFetchMethods;
|
|
@@ -83,15 +70,13 @@ declare const fetch: FetchMethodAllowingRoute;
|
|
|
83
70
|
declare const requestJira: RequestProductMethod;
|
|
84
71
|
declare const requestConfluence: RequestProductMethod;
|
|
85
72
|
declare const requestBitbucket: RequestProductMethod;
|
|
86
|
-
declare const store: PropertiesAPI;
|
|
87
73
|
declare const storage: ForgeStorageAPI;
|
|
88
|
-
declare const properties: PropertiesAPI;
|
|
89
74
|
declare const API: ForgeAPI;
|
|
90
75
|
export declare const privacy: {
|
|
91
76
|
reportPersonalData: (accounts: import("./privacy").Account[]) => Promise<import("./privacy").AccountUpdate[]>;
|
|
92
77
|
};
|
|
93
78
|
export default API;
|
|
94
|
-
export { asUser, asApp, authorize, fetch, requestJira, requestConfluence, requestBitbucket, invokeRemote,
|
|
79
|
+
export { asUser, asApp, authorize, fetch, requestJira, requestConfluence, requestBitbucket, invokeRemote, storage, webTrigger, WebTriggerRequest, WebTriggerResponse, WebTriggerMethod, WebTriggerContext, __requestAtlassianAsApp, __requestAtlassianAsUser, __fetchProduct };
|
|
95
80
|
export declare const createRequestStargateAsApp: () => FetchMethod;
|
|
96
81
|
export { QueryBuilder, QueryApi, EntityStorageApi, Condition, ListResult, Predicate, Result, Value, WherePredicate, FilterPredicate, startsWith, WhereConditions, FilterConditions, SortOrder } from '@forge/storage';
|
|
97
82
|
export { route, assumeTrustedRoute, routeFromAbsolute, Route } from './safeUrl';
|
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAA8C,QAAQ,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAExG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAA8C,QAAQ,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAExG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtH,OAAO,EAGL,uBAAuB,EACvB,wBAAwB,EAEzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,oBAAY,WAAW,GAAG,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,GAAG,IAAI,GAAG,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAC,CAAC;AACvH,oBAAY,WAAW,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,WAAW,CAA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AAY,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACtF,OAAO,EACL,wBAAwB,EACxB,+BAA+B,EAC/B,iBAAiB,EACjB,UAAU,EACV,+BAA+B,EAC/B,8BAA8B,EAC9B,6BAA6B,EAC7B,eAAe,EACf,8BAA8B,EAC9B,SAAS,EACT,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EAChB,MAAM,cAAc,CAAC"}
|
package/out/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isExpectedError = exports.isHostedCodeError = exports.isForgePlatformError = exports.FUNCTION_ERR = exports.HttpError = exports.InvalidWorkspaceRequestedError = exports.NotAllowedError = exports.RequestProductNotAllowedError = exports.ProductEndpointNotAllowedError = exports.ExternalEndpointNotAllowedError = exports.FetchError = exports.ProxyRequestError = exports.NeedsAuthenticationError = exports.__getRuntime = exports.getAppContext = exports.routeFromAbsolute = exports.assumeTrustedRoute = exports.route = exports.SortOrder = exports.FilterConditions = exports.WhereConditions = exports.startsWith = exports.createRequestStargateAsApp = exports.__fetchProduct = exports.__requestAtlassianAsUser = exports.__requestAtlassianAsApp = exports.webTrigger = exports.
|
|
3
|
+
exports.isExpectedError = exports.isHostedCodeError = exports.isForgePlatformError = exports.FUNCTION_ERR = exports.HttpError = exports.InvalidWorkspaceRequestedError = exports.NotAllowedError = exports.RequestProductNotAllowedError = exports.ProductEndpointNotAllowedError = exports.ExternalEndpointNotAllowedError = exports.FetchError = exports.ProxyRequestError = exports.NeedsAuthenticationError = exports.__getRuntime = exports.getAppContext = exports.routeFromAbsolute = exports.assumeTrustedRoute = exports.route = exports.SortOrder = exports.FilterConditions = exports.WhereConditions = exports.startsWith = exports.createRequestStargateAsApp = exports.__fetchProduct = exports.__requestAtlassianAsUser = exports.__requestAtlassianAsApp = exports.webTrigger = exports.storage = exports.invokeRemote = exports.requestBitbucket = exports.requestConfluence = exports.requestJira = exports.fetch = exports.authorize = exports.asApp = exports.asUser = exports.privacy = void 0;
|
|
4
4
|
const storage_1 = require("@forge/storage");
|
|
5
5
|
const authorization_1 = require("./authorization");
|
|
6
6
|
Object.defineProperty(exports, "authorize", { enumerable: true, get: function () { return authorization_1.authorize; } });
|
|
7
|
-
const properties_1 = require("./properties");
|
|
8
7
|
const privacy_1 = require("./privacy");
|
|
9
8
|
const webTrigger_1 = require("./webTrigger");
|
|
10
9
|
Object.defineProperty(exports, "webTrigger", { enumerable: true, get: function () { return webTrigger_1.webTrigger; } });
|
|
@@ -15,13 +14,6 @@ const remote_1 = require("./api/remote");
|
|
|
15
14
|
Object.defineProperty(exports, "invokeRemote", { enumerable: true, get: function () { return remote_1.invokeRemote; } });
|
|
16
15
|
const fetch_1 = require("./api/fetch");
|
|
17
16
|
Object.defineProperty(exports, "__fetchProduct", { enumerable: true, get: function () { return fetch_1.__fetchProduct; } });
|
|
18
|
-
function withDeprecatedMessage(method, message) {
|
|
19
|
-
const wrappedMethod = (...args) => {
|
|
20
|
-
console.warn(message);
|
|
21
|
-
return method(...args);
|
|
22
|
-
};
|
|
23
|
-
return wrappedMethod;
|
|
24
|
-
}
|
|
25
17
|
const fetchAPI = (0, fetch_and_storage_1.getFetchAPI)();
|
|
26
18
|
const asUser = fetchAPI.asUser;
|
|
27
19
|
exports.asUser = asUser;
|
|
@@ -35,23 +27,10 @@ const requestConfluence = fetchAPI.requestConfluence;
|
|
|
35
27
|
exports.requestConfluence = requestConfluence;
|
|
36
28
|
const requestBitbucket = fetchAPI.requestBitbucket;
|
|
37
29
|
exports.requestBitbucket = requestBitbucket;
|
|
38
|
-
const
|
|
39
|
-
.map(([name, method]) => {
|
|
40
|
-
const wrappedMethod = withDeprecatedMessage(method, `store.${name}() is deprecated. Use properties.${name}() imported from '@forge/api' instead`);
|
|
41
|
-
return {
|
|
42
|
-
[name]: wrappedMethod
|
|
43
|
-
};
|
|
44
|
-
})
|
|
45
|
-
.reduce((acc, next) => Object.assign(acc, next), {});
|
|
46
|
-
const store = deprecatedPropertiesApi;
|
|
47
|
-
exports.store = store;
|
|
48
|
-
const storage = (0, storage_1.getStorageInstanceWithQuery)(new storage_1.GlobalStorage(fetch_and_storage_1.getContextAri, fetch_and_storage_1.__requestAtlassianAsApp));
|
|
30
|
+
const storage = (0, storage_1.getStorageInstanceWithQuery)(new storage_1.GlobalStorage(fetch_and_storage_1.getContextAri, fetch_and_storage_1.__requestAtlassianAsApp, fetch_and_storage_1.getMetrics));
|
|
49
31
|
exports.storage = storage;
|
|
50
|
-
const properties = properties_1.propertiesApi;
|
|
51
|
-
exports.properties = properties;
|
|
52
32
|
const API = {
|
|
53
33
|
...fetchAPI,
|
|
54
|
-
store: { ...store },
|
|
55
34
|
invokeRemote: remote_1.invokeRemote
|
|
56
35
|
};
|
|
57
36
|
exports.privacy = {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { FetchMethod } from '..';
|
|
2
2
|
import { AuthProvider } from '../api/fetch';
|
|
3
|
+
import type { Metrics } from '@forge/util/packages/metrics-interface';
|
|
3
4
|
export declare function getContextAri(): any;
|
|
4
5
|
export declare function getFetchAPI(): import("..").FetchAPI;
|
|
6
|
+
export declare function getMetrics(): Metrics;
|
|
5
7
|
export declare function getRequestStargate(provider: AuthProvider): FetchMethod;
|
|
6
8
|
export declare const __requestAtlassianAsApp: FetchMethod;
|
|
7
9
|
export declare const __requestAtlassianAsUser: FetchMethod;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-and-storage.d.ts","sourceRoot":"","sources":["../../src/runtime/fetch-and-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AACjC,OAAO,EAA2D,YAAY,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"fetch-and-storage.d.ts","sourceRoot":"","sources":["../../src/runtime/fetch-and-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AACjC,OAAO,EAA2D,YAAY,EAAE,MAAM,cAAc,CAAC;AAErG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AAEtE,wBAAgB,aAAa,QAE5B;AAED,wBAAgB,WAAW,0BAO1B;AAED,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,YAAY,GAAG,WAAW,CAetE;AAED,eAAO,MAAM,uBAAuB,EAAE,WAAuC,CAAC;AAC9E,eAAO,MAAM,wBAAwB,EAAE,WAAwC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.__requestAtlassianAsUser = exports.__requestAtlassianAsApp = exports.getRequestStargate = exports.getFetchAPI = exports.getContextAri = void 0;
|
|
3
|
+
exports.__requestAtlassianAsUser = exports.__requestAtlassianAsApp = exports.getRequestStargate = exports.getMetrics = exports.getFetchAPI = exports.getContextAri = void 0;
|
|
4
4
|
const fetch_1 = require("../api/fetch");
|
|
5
5
|
const runtime_1 = require("../api/runtime");
|
|
6
6
|
function getContextAri() {
|
|
@@ -17,6 +17,10 @@ function getFetchAPI() {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
exports.getFetchAPI = getFetchAPI;
|
|
20
|
+
function getMetrics() {
|
|
21
|
+
return (0, runtime_1.__getRuntime)().metrics;
|
|
22
|
+
}
|
|
23
|
+
exports.getMetrics = getMetrics;
|
|
20
24
|
function getRequestStargate(provider) {
|
|
21
25
|
if (provider !== 'app' && provider !== 'user') {
|
|
22
26
|
throw new Error(`Unsupported provider: ${provider}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/api",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-next.1",
|
|
4
4
|
"description": "Forge API methods",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@forge/auth": "0.0.5",
|
|
24
24
|
"@forge/egress": "1.2.13",
|
|
25
|
-
"@forge/storage": "1.
|
|
25
|
+
"@forge/storage": "1.6.0-next.0",
|
|
26
26
|
"@forge/util": "1.4.4",
|
|
27
27
|
"@types/node-fetch": "^2.6.11",
|
|
28
28
|
"node-fetch": "2.7.0"
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { RequestProductMethod } from '../index';
|
|
2
|
-
import { ConfluenceVersionedStorage } from './confluence-versioned-storage';
|
|
3
|
-
export declare class ConfluencePageStorage extends ConfluenceVersionedStorage {
|
|
4
|
-
constructor(pageId: string, apiClient: RequestProductMethod);
|
|
5
|
-
set(key: string, value: any): Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=confluence-page.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"confluence-page.d.ts","sourceRoot":"","sources":["../../src/properties/confluence-page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAE5E,qBAAa,qBAAsB,SAAQ,0BAA0B;gBACvD,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,oBAAoB;IAMrD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CAGlD"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConfluencePageStorage = void 0;
|
|
4
|
-
const safeUrl_1 = require("../safeUrl");
|
|
5
|
-
const confluence_versioned_storage_1 = require("./confluence-versioned-storage");
|
|
6
|
-
class ConfluencePageStorage extends confluence_versioned_storage_1.ConfluenceVersionedStorage {
|
|
7
|
-
constructor(pageId, apiClient) {
|
|
8
|
-
const storageApiPath = (key) => (0, safeUrl_1.route) `/wiki/rest/api/content/${pageId}/property/${key}`;
|
|
9
|
-
super(storageApiPath, apiClient);
|
|
10
|
-
}
|
|
11
|
-
async set(key, value) {
|
|
12
|
-
await this.versionedSet(key, value);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.ConfluencePageStorage = ConfluencePageStorage;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { RequestProductMethod } from '../index';
|
|
2
|
-
import { ConfluenceVersionedStorage } from './confluence-versioned-storage';
|
|
3
|
-
export declare class ConfluenceSpaceStorage extends ConfluenceVersionedStorage {
|
|
4
|
-
constructor(spaceId: string, apiClient: RequestProductMethod);
|
|
5
|
-
set(key: string, value: any): Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=confluence-space.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"confluence-space.d.ts","sourceRoot":"","sources":["../../src/properties/confluence-space.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAE5E,qBAAa,sBAAuB,SAAQ,0BAA0B;gBACxD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,oBAAoB;IAMtD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CAGlD"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConfluenceSpaceStorage = void 0;
|
|
4
|
-
const safeUrl_1 = require("../safeUrl");
|
|
5
|
-
const confluence_versioned_storage_1 = require("./confluence-versioned-storage");
|
|
6
|
-
class ConfluenceSpaceStorage extends confluence_versioned_storage_1.ConfluenceVersionedStorage {
|
|
7
|
-
constructor(spaceId, apiClient) {
|
|
8
|
-
const storageApiPath = (key) => (0, safeUrl_1.route) `/wiki/rest/api/space/${spaceId}/property/${key}`;
|
|
9
|
-
super(storageApiPath, apiClient);
|
|
10
|
-
}
|
|
11
|
-
async set(key, value) {
|
|
12
|
-
await this.versionedSet(key, value);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.ConfluenceSpaceStorage = ConfluenceSpaceStorage;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ProductScopedStorage } from './product-scoped-storage';
|
|
2
|
-
export declare class ConfluenceVersionedStorage extends ProductScopedStorage {
|
|
3
|
-
protected versionedSet(key: string, value: any): Promise<void>;
|
|
4
|
-
private getUpdatedVersion;
|
|
5
|
-
}
|
|
6
|
-
//# sourceMappingURL=confluence-versioned-storage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"confluence-versioned-storage.d.ts","sourceRoot":"","sources":["../../src/properties/confluence-versioned-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,qBAAa,0BAA2B,SAAQ,oBAAoB;cAClD,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;YA0BtD,iBAAiB;CAUhC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConfluenceVersionedStorage = void 0;
|
|
4
|
-
const product_scoped_storage_1 = require("./product-scoped-storage");
|
|
5
|
-
const storage_1 = require("@forge/storage");
|
|
6
|
-
class ConfluenceVersionedStorage extends product_scoped_storage_1.ProductScopedStorage {
|
|
7
|
-
async versionedSet(key, value) {
|
|
8
|
-
const versionResponse = await this.apiClient(this.storageApiPath(key));
|
|
9
|
-
if (!versionResponse.ok && versionResponse.status !== 404) {
|
|
10
|
-
throw storage_1.APIError.forStatus(versionResponse.status);
|
|
11
|
-
}
|
|
12
|
-
const updatedVersionNumber = await this.getUpdatedVersion(versionResponse);
|
|
13
|
-
const requestMethod = versionResponse.ok ? 'PUT' : 'POST';
|
|
14
|
-
const requestBody = {
|
|
15
|
-
value,
|
|
16
|
-
version: {
|
|
17
|
-
number: updatedVersionNumber
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
const response = await this.apiClient(this.storageApiPath(key), this.buildSetRequestOptions(requestBody, requestMethod));
|
|
21
|
-
if (!response.ok) {
|
|
22
|
-
throw storage_1.APIError.forStatus(response.status);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
async getUpdatedVersion(versionResponse) {
|
|
26
|
-
if (!versionResponse.ok) {
|
|
27
|
-
return 1;
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
const data = await versionResponse.json();
|
|
31
|
-
return data.version.number + 1;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.ConfluenceVersionedStorage = ConfluenceVersionedStorage;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { StorageMethods } from '../index';
|
|
2
|
-
export declare const propertiesApi: {
|
|
3
|
-
onJiraIssue: (issueKey: string) => StorageMethods;
|
|
4
|
-
onJiraProject: (projectKey: string) => StorageMethods;
|
|
5
|
-
onConfluencePage: (pageId: string) => StorageMethods;
|
|
6
|
-
onConfluenceSpace: (spaceId: string) => StorageMethods;
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/properties/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,cAAc,EAAE,MAAM,UAAU,CAAC;AAmBjD,eAAO,MAAM,aAAa;4BACA,MAAM;gCAEF,MAAM;+BACP,MAAM;iCAEJ,MAAM;CAEpC,CAAC"}
|
package/out/properties/index.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.propertiesApi = void 0;
|
|
4
|
-
const index_1 = require("../index");
|
|
5
|
-
const jira_issue_1 = require("./jira-issue");
|
|
6
|
-
const jira_project_1 = require("./jira-project");
|
|
7
|
-
const confluence_page_1 = require("./confluence-page");
|
|
8
|
-
const confluence_space_1 = require("./confluence-space");
|
|
9
|
-
const sanitized_key_1 = require("./sanitized-key");
|
|
10
|
-
const getPropertiesInstance = (adapter) => {
|
|
11
|
-
console.warn('The @forge/api Properties API is deprecated, you shoud now call product REST APIs directly.');
|
|
12
|
-
const storage = {
|
|
13
|
-
get: (key) => adapter.get((0, sanitized_key_1.sanitizedKey)(key)),
|
|
14
|
-
set: (key, value) => adapter.set((0, sanitized_key_1.sanitizedKey)(key), value),
|
|
15
|
-
delete: (key) => adapter.delete((0, sanitized_key_1.sanitizedKey)(key))
|
|
16
|
-
};
|
|
17
|
-
return storage;
|
|
18
|
-
};
|
|
19
|
-
exports.propertiesApi = {
|
|
20
|
-
onJiraIssue: (issueKey) => getPropertiesInstance(new jira_issue_1.JiraIssueStorage((0, sanitized_key_1.sanitizedKey)(issueKey), (0, index_1.asApp)().requestJira)),
|
|
21
|
-
onJiraProject: (projectKey) => getPropertiesInstance(new jira_project_1.JiraProjectStorage(projectKey, (0, index_1.asApp)().requestJira)),
|
|
22
|
-
onConfluencePage: (pageId) => getPropertiesInstance(new confluence_page_1.ConfluencePageStorage((0, sanitized_key_1.sanitizedKey)(pageId), (0, index_1.asApp)().requestConfluence)),
|
|
23
|
-
onConfluenceSpace: (spaceId) => getPropertiesInstance(new confluence_space_1.ConfluenceSpaceStorage((0, sanitized_key_1.sanitizedKey)(spaceId), (0, index_1.asApp)().requestConfluence))
|
|
24
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ProductScopedStorage } from './product-scoped-storage';
|
|
2
|
-
import { RequestProductMethod } from '../index';
|
|
3
|
-
export declare class JiraIssueStorage extends ProductScopedStorage {
|
|
4
|
-
constructor(issueKey: string, apiClient: RequestProductMethod);
|
|
5
|
-
}
|
|
6
|
-
//# sourceMappingURL=jira-issue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jira-issue.d.ts","sourceRoot":"","sources":["../../src/properties/jira-issue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGhD,qBAAa,gBAAiB,SAAQ,oBAAoB;gBAC5C,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,oBAAoB;CAK9D"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JiraIssueStorage = void 0;
|
|
4
|
-
const product_scoped_storage_1 = require("./product-scoped-storage");
|
|
5
|
-
const safeUrl_1 = require("../safeUrl");
|
|
6
|
-
class JiraIssueStorage extends product_scoped_storage_1.ProductScopedStorage {
|
|
7
|
-
constructor(issueKey, apiClient) {
|
|
8
|
-
const storageApiPath = (key) => (0, safeUrl_1.route) `/rest/api/3/issue/${issueKey}/properties/${key}`;
|
|
9
|
-
super(storageApiPath, apiClient);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.JiraIssueStorage = JiraIssueStorage;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ProductScopedStorage } from './product-scoped-storage';
|
|
2
|
-
import { RequestProductMethod } from '../index';
|
|
3
|
-
export declare class JiraProjectStorage extends ProductScopedStorage {
|
|
4
|
-
constructor(projectKey: string, apiClient: RequestProductMethod);
|
|
5
|
-
}
|
|
6
|
-
//# sourceMappingURL=jira-project.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jira-project.d.ts","sourceRoot":"","sources":["../../src/properties/jira-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGhD,qBAAa,kBAAmB,SAAQ,oBAAoB;gBAC9C,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,oBAAoB;CAKhE"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JiraProjectStorage = void 0;
|
|
4
|
-
const product_scoped_storage_1 = require("./product-scoped-storage");
|
|
5
|
-
const safeUrl_1 = require("../safeUrl");
|
|
6
|
-
class JiraProjectStorage extends product_scoped_storage_1.ProductScopedStorage {
|
|
7
|
-
constructor(projectKey, apiClient) {
|
|
8
|
-
const storageApiPath = (key) => (0, safeUrl_1.route) `/rest/api/3/project/${projectKey}/properties/${key}`;
|
|
9
|
-
super(storageApiPath, apiClient);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.JiraProjectStorage = JiraProjectStorage;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { StorageAdapter } from './storage-adapter';
|
|
2
|
-
import { RequestProductMethod } from '../index';
|
|
3
|
-
import { Route } from '../safeUrl';
|
|
4
|
-
export declare class ProductScopedStorage implements StorageAdapter {
|
|
5
|
-
protected storageApiPath: (key: string) => Route;
|
|
6
|
-
protected apiClient: RequestProductMethod;
|
|
7
|
-
constructor(storageApiPath: (key: string) => Route, apiClient: RequestProductMethod);
|
|
8
|
-
get(key: string): Promise<any>;
|
|
9
|
-
set(key: string, value: any): Promise<void>;
|
|
10
|
-
delete(key: string): Promise<void>;
|
|
11
|
-
protected buildSetRequestOptions(requestBody: any, requestMethod: 'PUT' | 'POST'): {
|
|
12
|
-
method: "PUT" | "POST";
|
|
13
|
-
body: string;
|
|
14
|
-
headers: {
|
|
15
|
-
'content-type': string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=product-scoped-storage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"product-scoped-storage.d.ts","sourceRoot":"","sources":["../../src/properties/product-scoped-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,qBAAa,oBAAqB,YAAW,cAAc;IAEvD,SAAS,CAAC,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,KAAK;IAChD,SAAS,CAAC,SAAS,EAAE,oBAAoB;gBAD/B,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,KAAK,EACtC,SAAS,EAAE,oBAAoB;IAGrC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAc9B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ3C,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQxC,SAAS,CAAC,sBAAsB,CAAC,WAAW,EAAE,GAAG,EAAE,aAAa,EAAE,KAAK,GAAG,MAAM;;;;;;;CASjF"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProductScopedStorage = void 0;
|
|
4
|
-
const storage_1 = require("@forge/storage");
|
|
5
|
-
class ProductScopedStorage {
|
|
6
|
-
storageApiPath;
|
|
7
|
-
apiClient;
|
|
8
|
-
constructor(storageApiPath, apiClient) {
|
|
9
|
-
this.storageApiPath = storageApiPath;
|
|
10
|
-
this.apiClient = apiClient;
|
|
11
|
-
}
|
|
12
|
-
async get(key) {
|
|
13
|
-
const response = await this.apiClient(this.storageApiPath(key));
|
|
14
|
-
if (!response.ok) {
|
|
15
|
-
if (/403|404/.test(response.status.toString())) {
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
throw storage_1.APIError.forStatus(response.status);
|
|
19
|
-
}
|
|
20
|
-
const { value } = await response.json();
|
|
21
|
-
return value;
|
|
22
|
-
}
|
|
23
|
-
async set(key, value) {
|
|
24
|
-
const response = await this.apiClient(this.storageApiPath(key), this.buildSetRequestOptions(value, 'PUT'));
|
|
25
|
-
if (!response.ok) {
|
|
26
|
-
throw storage_1.APIError.forStatus(response.status);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
async delete(key) {
|
|
30
|
-
const response = await this.apiClient(this.storageApiPath(key), { method: 'DELETE' });
|
|
31
|
-
if (!response.ok) {
|
|
32
|
-
throw storage_1.APIError.forStatus(response.status);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
buildSetRequestOptions(requestBody, requestMethod) {
|
|
36
|
-
return {
|
|
37
|
-
method: requestMethod,
|
|
38
|
-
body: JSON.stringify(requestBody),
|
|
39
|
-
headers: {
|
|
40
|
-
'content-type': 'application/json'
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.ProductScopedStorage = ProductScopedStorage;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sanitized-key.d.ts","sourceRoot":"","sources":["../../src/properties/sanitized-key.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,UAAW,MAAM,WAOzC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sanitizedKey = void 0;
|
|
4
|
-
const sanitizedKey = (input) => {
|
|
5
|
-
const regex = /^(~)?[A-Za-z0-9_\-\.]+$/;
|
|
6
|
-
if (!regex.test(input)) {
|
|
7
|
-
throw new Error('Invalid context/property key');
|
|
8
|
-
}
|
|
9
|
-
return input;
|
|
10
|
-
};
|
|
11
|
-
exports.sanitizedKey = sanitizedKey;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storage-adapter.d.ts","sourceRoot":"","sources":["../../src/properties/storage-adapter.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC/B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC"}
|