Skip to content

Commit 4bd1380

Browse files
AndrewLeedhammacdonst
authored andcommittedDec 16, 2019
Added typescript definition (#29)
* feat: add typescript definition * fix: index.d.ts typo + better response typings * ci: add node prefix for nvs windows * ci: use jobs matrix to differentiate nvs per os * docs: add apache license * docs: remove personal data from typings * Revert "ci: use jobs matrix to differentiate nvs per os" This reverts commit 30e9188. * Revert "ci: add node prefix for nvs windows" This reverts commit b9aec68.
1 parent 4c6e5ee commit 4bd1380

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
 

‎index.d.ts

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
Copyright 2019 Adobe. All rights reserved.
3+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License. You may obtain a copy
5+
of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
7+
Unless required by applicable law or agreed to in writing, software distributed under
8+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9+
OF ANY KIND, either express or implied. See the License for the specific language
10+
governing permissions and limitations under the License.
11+
*/
12+
13+
// Type definitions for @adobe/jwt-auth 0.3
14+
// Project: https://github.com/adobe/jwt-auth#readme
15+
16+
export = authorize;
17+
18+
declare function authorize(
19+
options: authorize.JWTAuthConfig
20+
): Promise<authorize.JWTAuthResponse>;
21+
22+
declare namespace authorize {
23+
export interface JWTAuthConfig {
24+
clientId: string;
25+
technicalAccountId: string;
26+
orgId: string;
27+
clientSecret: string;
28+
privateKey: string;
29+
passphrase?: string;
30+
metaScopes: string | string[];
31+
ims?: string;
32+
}
33+
34+
export interface JWTAuthResponse {
35+
token_type: "bearer";
36+
access_token: string;
37+
expires_in: number;
38+
}
39+
}

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.3.0",
44
"description": "Retrieve an authorization token from Adobe via JSON Web Token",
55
"main": "index.js",
6+
"types": "index.d.ts",
67
"repository": {
78
"type": "git",
89
"url": "https://github.com/adobe/jwt-auth.git"

2 commit comments

Comments
 (2)

AndrewLeedham commented on Dec 30, 2019

@AndrewLeedham
ContributorAuthor

@macdonst thanks for merging this. Is it possible to get it in a released npm version? 0.3.1 perhaps?

macdonst commented on Jan 2, 2020

@macdonst
Contributor

@AndrewLeedham just published a 0.3.1 version

Please sign in to comment.