@forge/auth 0.0.5 → 0.0.6-next.0
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 +6 -0
- package/LICENSE.txt +7 -0
- package/out/confluence/index.d.ts +2 -2
- package/out/confluence/index.d.ts.map +1 -1
- package/out/confluence/index.js +1 -1
- package/out/confluence/permissions.d.ts +1 -1
- package/out/confluence/permissions.d.ts.map +1 -1
- package/out/jira/index.d.ts +2 -2
- package/out/jira/index.d.ts.map +1 -1
- package/out/jira/index.js +1 -2
- package/out/jira/permissions.d.ts +2 -2
- package/out/jira/permissions.d.ts.map +1 -1
- package/out/types.d.ts +4 -4
- package/out/types.d.ts.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright (c) 2025 Atlassian
|
|
2
|
+
Permission is hereby granted to use this software in accordance with the terms
|
|
3
|
+
and conditions outlined in the Atlassian Developer Terms, which can be found
|
|
4
|
+
at the following URL:
|
|
5
|
+
https://developer.atlassian.com/platform/marketplace/atlassian-developer-terms/
|
|
6
|
+
By using this software, you agree to comply with these terms and conditions.
|
|
7
|
+
If you do not agree with these terms, you are not permitted to use this software.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FetchHelper } from '../types';
|
|
2
|
-
type RequestConfluence = FetchHelper['requestConfluence'];
|
|
3
|
-
export type ContentId = string | number;
|
|
2
|
+
declare type RequestConfluence = FetchHelper['requestConfluence'];
|
|
3
|
+
export declare type ContentId = string | number;
|
|
4
4
|
export declare const authorizeConfluenceWithFetch: (requestConfluence: RequestConfluence, accountId: string) => {
|
|
5
5
|
readonly onConfluenceContent: (contentId: ContentId) => Record<string, import("../types").PermissionCheck>;
|
|
6
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/confluence/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGvC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/confluence/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGvC,aAAK,iBAAiB,GAAG,WAAW,CAAC,mBAAmB,CAAC,CAAC;AAE1D,oBAAY,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AA+BxC,eAAO,MAAM,4BAA4B,sBAAuB,iBAAiB,aAAa,MAAM;8CAE/D,SAAS;CAG7C,CAAC"}
|
package/out/confluence/index.js
CHANGED
|
@@ -21,7 +21,7 @@ const checkConfluencePermissions = async (requestConfluence, accountId, contentI
|
|
|
21
21
|
const getPermissionsCheckFactory = (requestConfluence, accountId, contentId) => (permission) => {
|
|
22
22
|
return async () => {
|
|
23
23
|
const res = await checkConfluencePermissions(requestConfluence, accountId, contentId, permission);
|
|
24
|
-
return Boolean(res
|
|
24
|
+
return Boolean(res?.hasPermission);
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
27
|
const authorizeConfluenceWithFetch = (requestConfluence, accountId) => {
|
|
@@ -3,6 +3,6 @@ declare const API_PERMISSIONS_MAP: {
|
|
|
3
3
|
readonly canUpdate: "update";
|
|
4
4
|
readonly canDelete: "delete";
|
|
5
5
|
};
|
|
6
|
-
export type ApiPermissionsMap = typeof API_PERMISSIONS_MAP;
|
|
6
|
+
export declare type ApiPermissionsMap = typeof API_PERMISSIONS_MAP;
|
|
7
7
|
export default API_PERMISSIONS_MAP;
|
|
8
8
|
//# sourceMappingURL=permissions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/confluence/permissions.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,mBAAmB;;;;CAIf,CAAC;AAEX,
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/confluence/permissions.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,mBAAmB;;;;CAIf,CAAC;AAEX,oBAAY,iBAAiB,GAAG,OAAO,mBAAmB,CAAC;AAC3D,eAAe,mBAAmB,CAAC"}
|
package/out/jira/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FetchHelper } from '../types';
|
|
2
|
-
export type RequestJira = FetchHelper['requestJira'];
|
|
3
|
-
export type Id = number | string;
|
|
2
|
+
export declare type RequestJira = FetchHelper['requestJira'];
|
|
3
|
+
export declare type Id = number | string;
|
|
4
4
|
export interface ProjectPermission {
|
|
5
5
|
permissions: string[];
|
|
6
6
|
issues?: Id[];
|
package/out/jira/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/jira/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGvC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/jira/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGvC,oBAAY,WAAW,GAAG,WAAW,CAAC,aAAa,CAAC,CAAC;AAIrD,oBAAY,EAAE,GAAG,MAAM,GAAG,MAAM,CAAC;AACjC,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC;IACd,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAsDD,eAAO,MAAM,sBAAsB,gBAAiB,WAAW,aAAa,MAAM;+CAEtC,iBAAiB,EAAE;uCAIjC,EAAE,GAAG,EAAE,EAAE;mCAMb,EAAE,GAAG,EAAE,EAAE;CAMlC,CAAC"}
|
package/out/jira/index.js
CHANGED
|
@@ -18,10 +18,9 @@ const checkJiraPermissions = async (requestJira, accountId, projectPermissions)
|
|
|
18
18
|
return res;
|
|
19
19
|
};
|
|
20
20
|
const hasPermissionsForEntities = (projectPermissions, permission, type, entities) => {
|
|
21
|
-
var _a;
|
|
22
21
|
if (!entities || entities.length === 0)
|
|
23
22
|
return true;
|
|
24
|
-
const allowedEntities =
|
|
23
|
+
const allowedEntities = projectPermissions.find((permissionResponse) => permissionResponse.permission === permission)?.[type];
|
|
25
24
|
return !!allowedEntities && arrayEquals(allowedEntities, entities);
|
|
26
25
|
};
|
|
27
26
|
const getPermissionCheckFactory = (requestJira, accountId, type, entities) => (permission) => {
|
|
@@ -22,7 +22,7 @@ declare const API_PROJECTS_PERMISSIONS_MAP: {
|
|
|
22
22
|
readonly canCreateAttachments: "CREATE_ATTACHMENTS";
|
|
23
23
|
readonly canDeleteAllAttachments: "DELETE_ALL_ATTACHMENTS";
|
|
24
24
|
};
|
|
25
|
-
export type ApiIssuesPermissionsMap = typeof API_ISSUES_PERMISSIONS_MAP;
|
|
26
|
-
export type ApiProjectsPermissionsMap = typeof API_PROJECTS_PERMISSIONS_MAP;
|
|
25
|
+
export declare type ApiIssuesPermissionsMap = typeof API_ISSUES_PERMISSIONS_MAP;
|
|
26
|
+
export declare type ApiProjectsPermissionsMap = typeof API_PROJECTS_PERMISSIONS_MAP;
|
|
27
27
|
export { API_ISSUES_PERMISSIONS_MAP, API_PROJECTS_PERMISSIONS_MAP };
|
|
28
28
|
//# sourceMappingURL=permissions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/jira/permissions.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,0BAA0B;;;;;;;;;;;CAWtB,CAAC;AAEX,QAAA,MAAM,4BAA4B;;;;;;;;;;;CAWxB,CAAC;AAEX,
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/jira/permissions.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,0BAA0B;;;;;;;;;;;CAWtB,CAAC;AAEX,QAAA,MAAM,4BAA4B;;;;;;;;;;;CAWxB,CAAC;AAEX,oBAAY,uBAAuB,GAAG,OAAO,0BAA0B,CAAC;AACxE,oBAAY,yBAAyB,GAAG,OAAO,4BAA4B,CAAC;AAE5E,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,CAAC"}
|
package/out/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type PermissionCheck = (args?: any) => Promise<boolean | object>;
|
|
2
|
-
export type PermissionCheckAPI = Record<string, PermissionCheck | ((args?: any) => PermissionCheckAPI)>;
|
|
1
|
+
export declare type PermissionCheck = (args?: any) => Promise<boolean | object>;
|
|
2
|
+
export declare type PermissionCheckAPI = Record<string, PermissionCheck | ((args?: any) => PermissionCheckAPI)>;
|
|
3
3
|
export interface RequestOptions {
|
|
4
4
|
method: string;
|
|
5
5
|
headers?: {
|
|
@@ -7,10 +7,10 @@ export interface RequestOptions {
|
|
|
7
7
|
};
|
|
8
8
|
body: string;
|
|
9
9
|
}
|
|
10
|
-
export type RequestFunction<T = any> = (path: string, options: RequestOptions) => Promise<T>;
|
|
10
|
+
export declare type RequestFunction<T = any> = (path: string, options: RequestOptions) => Promise<T>;
|
|
11
11
|
export interface FetchHelper {
|
|
12
12
|
requestJira: RequestFunction;
|
|
13
13
|
requestConfluence: RequestFunction;
|
|
14
14
|
}
|
|
15
|
-
export type AuthorizeWithFetchHelper = (fetchHelper: FetchHelper, accountId: string) => PermissionCheckAPI;
|
|
15
|
+
export declare type AuthorizeWithFetchHelper = (fetchHelper: FetchHelper, accountId: string) => PermissionCheckAPI;
|
|
16
16
|
//# sourceMappingURL=types.d.ts.map
|
package/out/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,eAAe,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC;AAExE,oBAAY,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,kBAAkB,CAAC,CAAC,CAAC;AACxG,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,oBAAY,eAAe,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AAE7F,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,eAAe,CAAC;IAC7B,iBAAiB,EAAE,eAAe,CAAC;CACpC;AAED,oBAAY,wBAAwB,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,KAAK,kBAAkB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/auth",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6-next.0",
|
|
4
4
|
"description": "Supports authorization for product REST API calls",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"types": "out/index.d.ts",
|
|
7
|
-
"license": "
|
|
7
|
+
"license": "SEE LICENSE IN LICENSE.txt",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"build": "yarn run clean && yarn run compile",
|
|
10
10
|
"compile": "tsc -b -v",
|