microsoft-graph-client 1.0.12 → 1.0.13
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/dist/auth/authenticator.d.ts +3 -38
- package/dist/auth/authenticator.d.ts.map +1 -1
- package/dist/auth/authenticator.js +4 -164
- package/dist/auth/authenticator.js.map +1 -1
- package/dist/client.d.ts +4 -27
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +3 -24
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/common.d.ts +4 -37
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/common.js +3 -0
- package/dist/types/common.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +4 -6
|
@@ -1,21 +1,12 @@
|
|
|
1
1
|
import { Client } from '@microsoft/microsoft-graph-client';
|
|
2
|
-
import type {
|
|
2
|
+
import type { GraphClientConfig } from '../types/common.js';
|
|
3
3
|
/**
|
|
4
|
-
* Authenticator handles Microsoft Graph authentication.
|
|
4
|
+
* Authenticator handles Microsoft Graph authentication using a pre-obtained access token.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* 1. Device Code Auth - Interactive authentication that persists to disk
|
|
8
|
-
* 2. Pre-seeded Auth - Non-interactive using a previously obtained auth record
|
|
9
|
-
*
|
|
10
|
-
* Uses DeviceCodeCredential with persistent token caching:
|
|
11
|
-
* - Access tokens refresh automatically when they expire (~1 hour)
|
|
12
|
-
* - Refresh tokens valid for ~90 days
|
|
13
|
-
* - Silent re-authentication (no device code prompt after initial auth)
|
|
6
|
+
* The caller is responsible for obtaining and refreshing the token (e.g., via OAuth proxy).
|
|
14
7
|
*/
|
|
15
8
|
export declare class Authenticator {
|
|
16
9
|
private config;
|
|
17
|
-
private credential;
|
|
18
|
-
private authRecord;
|
|
19
10
|
private sdkClient;
|
|
20
11
|
constructor(config: GraphClientConfig);
|
|
21
12
|
/**
|
|
@@ -23,36 +14,10 @@ export declare class Authenticator {
|
|
|
23
14
|
* Creates the client on first call, reuses on subsequent calls.
|
|
24
15
|
*/
|
|
25
16
|
getClient(): Promise<Client>;
|
|
26
|
-
/**
|
|
27
|
-
* Perform interactive device code authentication.
|
|
28
|
-
* This is typically run once to obtain an auth record that can be persisted.
|
|
29
|
-
*
|
|
30
|
-
* @param onDeviceCode - Callback to display the device code to the user
|
|
31
|
-
* @returns The authentication result with serialized auth record
|
|
32
|
-
*/
|
|
33
|
-
authenticate(onDeviceCode?: (info: {
|
|
34
|
-
userCode: string;
|
|
35
|
-
verificationUri: string;
|
|
36
|
-
message: string;
|
|
37
|
-
}) => void): Promise<AuthResult>;
|
|
38
17
|
/**
|
|
39
18
|
* Clear the cached client (forces recreation on next getClient call).
|
|
40
19
|
* Useful for testing or when you want to force token refresh.
|
|
41
20
|
*/
|
|
42
21
|
clearCache(): void;
|
|
43
|
-
/**
|
|
44
|
-
* Load the AuthenticationRecord from disk or pre-seeded config.
|
|
45
|
-
*/
|
|
46
|
-
private loadAuthRecord;
|
|
47
|
-
/**
|
|
48
|
-
* Seed auth files from config to disk.
|
|
49
|
-
* This is required for K8s/CI environments where auth data is passed via env vars
|
|
50
|
-
* but the Azure SDK expects files on disk.
|
|
51
|
-
*
|
|
52
|
-
* Writes:
|
|
53
|
-
* - authRecord → authRecordPath (or default path)
|
|
54
|
-
* - tokenCache → ~/.IdentityService/{cacheName}
|
|
55
|
-
*/
|
|
56
|
-
private seedAuthFiles;
|
|
57
22
|
}
|
|
58
23
|
//# sourceMappingURL=authenticator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticator.d.ts","sourceRoot":"","sources":["../../src/auth/authenticator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"authenticator.d.ts","sourceRoot":"","sources":["../../src/auth/authenticator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D;;;;GAIG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,SAAS,CAAuB;gBAErB,MAAM,EAAE,iBAAiB;IAI5C;;;OAGG;IACU,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAczC;;;OAGG;IACI,UAAU,IAAI,IAAI;CAG1B"}
|
|
@@ -1,28 +1,11 @@
|
|
|
1
|
-
import { promises as fs } from 'node:fs';
|
|
2
|
-
import { homedir } from 'node:os';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import { DeviceCodeCredential, deserializeAuthenticationRecord, serializeAuthenticationRecord, useIdentityPlugin, } from '@azure/identity';
|
|
5
|
-
import { cachePersistencePlugin } from '@azure/identity-cache-persistence';
|
|
6
1
|
import { Client } from '@microsoft/microsoft-graph-client';
|
|
7
|
-
import { DEFAULT_SCOPES } from '../types/common.js';
|
|
8
|
-
// Register the persistent cache plugin (must be done once at module load)
|
|
9
|
-
useIdentityPlugin(cachePersistencePlugin);
|
|
10
2
|
/**
|
|
11
|
-
* Authenticator handles Microsoft Graph authentication.
|
|
3
|
+
* Authenticator handles Microsoft Graph authentication using a pre-obtained access token.
|
|
12
4
|
*
|
|
13
|
-
*
|
|
14
|
-
* 1. Device Code Auth - Interactive authentication that persists to disk
|
|
15
|
-
* 2. Pre-seeded Auth - Non-interactive using a previously obtained auth record
|
|
16
|
-
*
|
|
17
|
-
* Uses DeviceCodeCredential with persistent token caching:
|
|
18
|
-
* - Access tokens refresh automatically when they expire (~1 hour)
|
|
19
|
-
* - Refresh tokens valid for ~90 days
|
|
20
|
-
* - Silent re-authentication (no device code prompt after initial auth)
|
|
5
|
+
* The caller is responsible for obtaining and refreshing the token (e.g., via OAuth proxy).
|
|
21
6
|
*/
|
|
22
7
|
export class Authenticator {
|
|
23
8
|
config;
|
|
24
|
-
credential = null;
|
|
25
|
-
authRecord = null;
|
|
26
9
|
sdkClient = null;
|
|
27
10
|
constructor(config) {
|
|
28
11
|
this.config = config;
|
|
@@ -35,163 +18,20 @@ export class Authenticator {
|
|
|
35
18
|
if (this.sdkClient) {
|
|
36
19
|
return this.sdkClient;
|
|
37
20
|
}
|
|
38
|
-
|
|
39
|
-
await this.seedAuthFiles();
|
|
40
|
-
// Try to load auth record
|
|
41
|
-
await this.loadAuthRecord();
|
|
42
|
-
// Create DeviceCodeCredential with persistent cache
|
|
43
|
-
this.credential = new DeviceCodeCredential({
|
|
44
|
-
clientId: this.config.clientId,
|
|
45
|
-
tenantId: this.config.tenantId,
|
|
46
|
-
tokenCachePersistenceOptions: {
|
|
47
|
-
enabled: true,
|
|
48
|
-
name: this.config.cacheName || 'microsoft-graph-client',
|
|
49
|
-
unsafeAllowUnencryptedStorage: true, // Allow unencrypted storage if keychain unavailable
|
|
50
|
-
},
|
|
51
|
-
// Pass the AuthenticationRecord to enable silent authentication
|
|
52
|
-
authenticationRecord: this.authRecord || undefined,
|
|
53
|
-
});
|
|
54
|
-
const scopes = this.config.scopes || DEFAULT_SCOPES;
|
|
55
|
-
// Create Graph client with auth provider
|
|
21
|
+
const token = this.config.accessToken;
|
|
56
22
|
this.sdkClient = Client.initWithMiddleware({
|
|
57
23
|
authProvider: {
|
|
58
|
-
getAccessToken: async () =>
|
|
59
|
-
try {
|
|
60
|
-
const tokenResponse = await this.credential?.getToken(scopes);
|
|
61
|
-
if (!tokenResponse) {
|
|
62
|
-
throw new Error('Failed to obtain token. Run: authenticate() first');
|
|
63
|
-
}
|
|
64
|
-
return tokenResponse.token;
|
|
65
|
-
}
|
|
66
|
-
catch (_error) {
|
|
67
|
-
throw new Error('Authentication failed. This could mean:\n' +
|
|
68
|
-
" 1. You haven't authenticated yet\n" +
|
|
69
|
-
' 2. Your refresh token expired (after ~90 days)\n' +
|
|
70
|
-
' 3. Your credentials were revoked\n\n' +
|
|
71
|
-
'Solution: Run the authenticate() method');
|
|
72
|
-
}
|
|
73
|
-
},
|
|
24
|
+
getAccessToken: async () => token,
|
|
74
25
|
},
|
|
75
26
|
});
|
|
76
27
|
return this.sdkClient;
|
|
77
28
|
}
|
|
78
|
-
/**
|
|
79
|
-
* Perform interactive device code authentication.
|
|
80
|
-
* This is typically run once to obtain an auth record that can be persisted.
|
|
81
|
-
*
|
|
82
|
-
* @param onDeviceCode - Callback to display the device code to the user
|
|
83
|
-
* @returns The authentication result with serialized auth record
|
|
84
|
-
*/
|
|
85
|
-
async authenticate(onDeviceCode) {
|
|
86
|
-
const scopes = this.config.scopes || DEFAULT_SCOPES;
|
|
87
|
-
// Create credential with device code callback
|
|
88
|
-
const credential = new DeviceCodeCredential({
|
|
89
|
-
clientId: this.config.clientId,
|
|
90
|
-
tenantId: this.config.tenantId,
|
|
91
|
-
tokenCachePersistenceOptions: {
|
|
92
|
-
enabled: true,
|
|
93
|
-
name: this.config.cacheName || 'microsoft-graph-client',
|
|
94
|
-
unsafeAllowUnencryptedStorage: true,
|
|
95
|
-
},
|
|
96
|
-
userPromptCallback: (info) => {
|
|
97
|
-
if (onDeviceCode) {
|
|
98
|
-
onDeviceCode({
|
|
99
|
-
userCode: info.userCode,
|
|
100
|
-
verificationUri: info.verificationUri,
|
|
101
|
-
message: info.message,
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
// Default: print to console
|
|
106
|
-
console.log(`\n${info.message}`);
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
});
|
|
110
|
-
// Trigger authentication by getting a token
|
|
111
|
-
await credential.getToken(scopes);
|
|
112
|
-
// Get the authentication record
|
|
113
|
-
const record = await credential.authenticate(scopes);
|
|
114
|
-
if (!record) {
|
|
115
|
-
throw new Error('Authentication failed: No authentication record obtained');
|
|
116
|
-
}
|
|
117
|
-
const serialized = serializeAuthenticationRecord(record);
|
|
118
|
-
// Save to disk (uses configured path or default)
|
|
119
|
-
const authRecordPath = this.config.authRecordPath || join(homedir(), '.microsoft-graph-client-auth-record.json');
|
|
120
|
-
await fs.writeFile(authRecordPath, serialized, 'utf-8');
|
|
121
|
-
// Store for future use
|
|
122
|
-
this.authRecord = record;
|
|
123
|
-
this.credential = credential;
|
|
124
|
-
return { record, serialized };
|
|
125
|
-
}
|
|
126
29
|
/**
|
|
127
30
|
* Clear the cached client (forces recreation on next getClient call).
|
|
128
31
|
* Useful for testing or when you want to force token refresh.
|
|
129
32
|
*/
|
|
130
33
|
clearCache() {
|
|
131
34
|
this.sdkClient = null;
|
|
132
|
-
this.credential = null;
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Load the AuthenticationRecord from disk or pre-seeded config.
|
|
136
|
-
*/
|
|
137
|
-
async loadAuthRecord() {
|
|
138
|
-
// Option 1: Pre-seeded auth record from config
|
|
139
|
-
if (this.config.authRecord) {
|
|
140
|
-
try {
|
|
141
|
-
this.authRecord = deserializeAuthenticationRecord(this.config.authRecord);
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
catch {
|
|
145
|
-
// Invalid auth record, continue to try file
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
// Option 2: Load from file path
|
|
149
|
-
const authRecordPath = this.config.authRecordPath || join(homedir(), '.microsoft-graph-client-auth-record.json');
|
|
150
|
-
try {
|
|
151
|
-
const content = await fs.readFile(authRecordPath, 'utf-8');
|
|
152
|
-
this.authRecord = deserializeAuthenticationRecord(content);
|
|
153
|
-
}
|
|
154
|
-
catch {
|
|
155
|
-
// Auth record doesn't exist or can't be read - user needs to authenticate
|
|
156
|
-
this.authRecord = null;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Seed auth files from config to disk.
|
|
161
|
-
* This is required for K8s/CI environments where auth data is passed via env vars
|
|
162
|
-
* but the Azure SDK expects files on disk.
|
|
163
|
-
*
|
|
164
|
-
* Writes:
|
|
165
|
-
* - authRecord → authRecordPath (or default path)
|
|
166
|
-
* - tokenCache → ~/.IdentityService/{cacheName}
|
|
167
|
-
*/
|
|
168
|
-
async seedAuthFiles() {
|
|
169
|
-
const authRecordPath = this.config.authRecordPath || join(homedir(), '.microsoft-graph-client-auth-record.json');
|
|
170
|
-
const cacheName = this.config.cacheName || 'microsoft-graph-client';
|
|
171
|
-
const tokenCachePath = join(homedir(), '.IdentityService', cacheName);
|
|
172
|
-
// Seed auth record if provided and file doesn't exist
|
|
173
|
-
if (this.config.authRecord) {
|
|
174
|
-
try {
|
|
175
|
-
await fs.access(authRecordPath);
|
|
176
|
-
// File exists, don't overwrite
|
|
177
|
-
}
|
|
178
|
-
catch {
|
|
179
|
-
// File doesn't exist, write it
|
|
180
|
-
await fs.writeFile(authRecordPath, this.config.authRecord, 'utf-8');
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
// Seed token cache if provided and file doesn't exist
|
|
184
|
-
if (this.config.tokenCache) {
|
|
185
|
-
try {
|
|
186
|
-
await fs.access(tokenCachePath);
|
|
187
|
-
// File exists, don't overwrite
|
|
188
|
-
}
|
|
189
|
-
catch {
|
|
190
|
-
// File doesn't exist, create directory and write
|
|
191
|
-
await fs.mkdir(join(homedir(), '.IdentityService'), { recursive: true });
|
|
192
|
-
await fs.writeFile(tokenCachePath, this.config.tokenCache, 'utf-8');
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
35
|
}
|
|
196
36
|
}
|
|
197
37
|
//# sourceMappingURL=authenticator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticator.js","sourceRoot":"","sources":["../../src/auth/authenticator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"authenticator.js","sourceRoot":"","sources":["../../src/auth/authenticator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAG3D;;;;GAIG;AACH,MAAM,OAAO,aAAa;IAChB,MAAM,CAAoB;IAC1B,SAAS,GAAkB,IAAI,CAAC;IAExC,YAAmB,MAAyB;QAC1C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,SAAS;QACpB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,OAAO,IAAI,CAAC,SAAS,CAAC;QACxB,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtC,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,kBAAkB,CAAC;YACzC,YAAY,EAAE;gBACZ,cAAc,EAAE,KAAK,IAAI,EAAE,CAAC,KAAK;aAClC;SACF,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,UAAU;QACf,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACxB,CAAC;CACF"}
|
package/dist/client.d.ts
CHANGED
|
@@ -1,31 +1,20 @@
|
|
|
1
1
|
import { CalendarApi, ChatsApi, FilesApi, MailApi, MessagesApi, SubscriptionsApi, TranscriptsApi, UsersApi } from './api/index.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { GraphClientConfig } from './types/index.js';
|
|
3
3
|
import type { Client } from '@microsoft/microsoft-graph-client';
|
|
4
4
|
/**
|
|
5
5
|
* Microsoft Graph API client with typed domain APIs.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
* 1. Device Code Auth - Interactive authentication that persists to disk
|
|
9
|
-
* 2. Pre-seeded Auth - Non-interactive using a previously obtained auth record
|
|
7
|
+
* Requires a pre-obtained access token (e.g., from an OAuth proxy).
|
|
10
8
|
*
|
|
11
9
|
* @example
|
|
12
10
|
* ```typescript
|
|
13
|
-
* // Option 1: Device code auth (interactive)
|
|
14
11
|
* const client = new GraphClient({
|
|
15
12
|
* clientId: 'xxx',
|
|
16
13
|
* tenantId: 'yyy',
|
|
17
|
-
*
|
|
14
|
+
* accessToken: 'eyJ...',
|
|
18
15
|
* });
|
|
19
|
-
* await client.
|
|
16
|
+
* await client.initialize();
|
|
20
17
|
*
|
|
21
|
-
* // Option 2: Pre-seeded auth (non-interactive)
|
|
22
|
-
* const client = new GraphClient({
|
|
23
|
-
* clientId: 'xxx',
|
|
24
|
-
* tenantId: 'yyy',
|
|
25
|
-
* authRecord: process.env.MS_GRAPH_AUTH_RECORD,
|
|
26
|
-
* });
|
|
27
|
-
*
|
|
28
|
-
* // Use the APIs
|
|
29
18
|
* const user = await client.users.getCurrentUser();
|
|
30
19
|
* const chats = await client.chats.list();
|
|
31
20
|
* ```
|
|
@@ -74,18 +63,6 @@ export declare class GraphClient {
|
|
|
74
63
|
* Subscription operations: create, renew, delete, list, get
|
|
75
64
|
*/
|
|
76
65
|
get subscriptions(): SubscriptionsApi;
|
|
77
|
-
/**
|
|
78
|
-
* Perform interactive device code authentication.
|
|
79
|
-
* Run this once to obtain and persist an auth record.
|
|
80
|
-
*
|
|
81
|
-
* @param onDeviceCode - Callback to display the device code to the user
|
|
82
|
-
* @returns The authentication result with serialized auth record
|
|
83
|
-
*/
|
|
84
|
-
authenticate(onDeviceCode?: (info: {
|
|
85
|
-
userCode: string;
|
|
86
|
-
verificationUri: string;
|
|
87
|
-
message: string;
|
|
88
|
-
}) => void): Promise<AuthResult>;
|
|
89
66
|
/**
|
|
90
67
|
* Get the raw Microsoft Graph SDK client.
|
|
91
68
|
* Use this for operations not covered by the domain APIs.
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,QAAQ,EACT,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.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HANGED
|
@@ -3,28 +3,17 @@ import { Authenticator } from './auth/index.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Microsoft Graph API client with typed domain APIs.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* 1. Device Code Auth - Interactive authentication that persists to disk
|
|
8
|
-
* 2. Pre-seeded Auth - Non-interactive using a previously obtained auth record
|
|
6
|
+
* Requires a pre-obtained access token (e.g., from an OAuth proxy).
|
|
9
7
|
*
|
|
10
8
|
* @example
|
|
11
9
|
* ```typescript
|
|
12
|
-
* // Option 1: Device code auth (interactive)
|
|
13
10
|
* const client = new GraphClient({
|
|
14
11
|
* clientId: 'xxx',
|
|
15
12
|
* tenantId: 'yyy',
|
|
16
|
-
*
|
|
13
|
+
* accessToken: 'eyJ...',
|
|
17
14
|
* });
|
|
18
|
-
* await client.
|
|
15
|
+
* await client.initialize();
|
|
19
16
|
*
|
|
20
|
-
* // Option 2: Pre-seeded auth (non-interactive)
|
|
21
|
-
* const client = new GraphClient({
|
|
22
|
-
* clientId: 'xxx',
|
|
23
|
-
* tenantId: 'yyy',
|
|
24
|
-
* authRecord: process.env.MS_GRAPH_AUTH_RECORD,
|
|
25
|
-
* });
|
|
26
|
-
*
|
|
27
|
-
* // Use the APIs
|
|
28
17
|
* const user = await client.users.getCurrentUser();
|
|
29
18
|
* const chats = await client.chats.list();
|
|
30
19
|
* ```
|
|
@@ -118,16 +107,6 @@ export class GraphClient {
|
|
|
118
107
|
return this._subscriptions;
|
|
119
108
|
}
|
|
120
109
|
// Public methods
|
|
121
|
-
/**
|
|
122
|
-
* Perform interactive device code authentication.
|
|
123
|
-
* Run this once to obtain and persist an auth record.
|
|
124
|
-
*
|
|
125
|
-
* @param onDeviceCode - Callback to display the device code to the user
|
|
126
|
-
* @returns The authentication result with serialized auth record
|
|
127
|
-
*/
|
|
128
|
-
async authenticate(onDeviceCode) {
|
|
129
|
-
return this.authenticator.authenticate(onDeviceCode);
|
|
130
|
-
}
|
|
131
110
|
/**
|
|
132
111
|
* Get the raw Microsoft Graph SDK client.
|
|
133
112
|
* Use this for operations not covered by the domain APIs.
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,QAAQ,GACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIhD
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,QAAQ,GACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIhD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,WAAW;IACd,aAAa,CAAgB;IAC7B,SAAS,GAAkB,IAAI,CAAC;IAExC,cAAc;IACN,MAAM,GAAoB,IAAI,CAAC;IAC/B,MAAM,GAAoB,IAAI,CAAC;IAC/B,SAAS,GAAuB,IAAI,CAAC;IACrC,KAAK,GAAmB,IAAI,CAAC;IAC7B,SAAS,GAAuB,IAAI,CAAC;IACrC,MAAM,GAAoB,IAAI,CAAC;IAC/B,YAAY,GAA0B,IAAI,CAAC;IAC3C,cAAc,GAA4B,IAAI,CAAC;IAEvD,YAAmB,MAAyB;QAC1C,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;IAED,qDAAqD;IAErD;;OAEG;IACH,IAAW,KAAK;QACd,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,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AAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;IAC7B,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { BaseApi, CalendarApi, ChatsApi, FilesApi, MailApi, MessagesApi, Transcr
|
|
|
3
3
|
export { Authenticator } from './auth/index.js';
|
|
4
4
|
export { encodeSharePointUrl, escapeODataString, extractChatIdFromJoinUrl, extractMeetingInfoFromJoinUrl, markdownToHtml, sanitizeHtml, } from './utils/index.js';
|
|
5
5
|
export type { MeetingInfo } from './utils/index.js';
|
|
6
|
-
export type {
|
|
6
|
+
export type { GraphApiResponse, GraphClientConfig, GraphError, GetUserParams, SearchUsersParams, User, PreferredPresenceAvailability, PresenceAvailability, SetPreferredPresenceParams, SetPresenceParams, Chat, ChatType, ConversationMember, CreateChatParams, GetChatParams, ListChatsParams, ListChatsResult, ChatMessage, ChatMessageAttachment, ChatMessageImportance, ChatMessageInfo, ChatMessageMention, GetChatMessagesParams, ItemBody, SearchHit, SearchHitsContainer, SearchMessagesParams, SearchRequest, SearchResponse, SearchResult, SendChatMessageParams, SetMessageReactionParams, UnsetMessageReactionParams, UpdateChatMessageParams, EmailAddress, FileAttachment, ListMailsParams, Message, SendMailParams, Attendee, CancelCalendarEventParams, CreateCalendarEventParams, DateTimeTimeZone, Event, FindMeetingTimesParams, GetCalendarEventsParams, Location, MeetingTimeSuggestion, MeetingTimeSuggestionsResult, NullableOption, DownloadSharePointFileParams, DownloadSharePointFileResult, GrantFilePermissionParams, UpdateSharePointFileParams, UpdateSharePointFileResult, UploadToSharePointParams, UploadToSharePointResult, CallTranscript, GetMeetingByJoinUrlParams, GetTranscriptContentParams, ListTranscriptsParams, OnlineMeeting, } from './types/index.js';
|
|
7
7
|
export { DEFAULT_SCOPES } from './types/index.js';
|
|
8
8
|
export type { Client as GraphSDKClient, ResponseType } from '@microsoft/microsoft-graph-client';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,EACL,OAAO,EACP,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,WAAW,EACX,cAAc,EACd,QAAQ,GACT,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,wBAAwB,EACxB,6BAA6B,EAC7B,cAAc,EACd,YAAY,GACb,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,YAAY,EAEV,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,EACL,OAAO,EACP,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,WAAW,EACX,cAAc,EACd,QAAQ,GACT,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,wBAAwB,EACxB,6BAA6B,EAC7B,cAAc,EACd,YAAY,GACb,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,YAAY,EAEV,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EAEV,aAAa,EACb,iBAAiB,EACjB,IAAI,EAEJ,6BAA6B,EAC7B,oBAAoB,EACpB,0BAA0B,EAC1B,iBAAiB,EAEjB,IAAI,EACJ,QAAQ,EACR,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,eAAe,EAEf,WAAW,EACX,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,QAAQ,EACR,SAAS,EACT,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,EAEvB,YAAY,EACZ,cAAc,EACd,eAAe,EACf,OAAO,EACP,cAAc,EAEd,QAAQ,EACR,yBAAyB,EACzB,yBAAyB,EACzB,gBAAgB,EAChB,KAAK,EACL,sBAAsB,EACtB,uBAAuB,EACvB,QAAQ,EACR,qBAAqB,EACrB,4BAA4B,EAC5B,cAAc,EAEd,4BAA4B,EAC5B,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,wBAAwB,EACxB,wBAAwB,EAExB,cAAc,EACd,yBAAyB,EACzB,0BAA0B,EAC1B,qBAAqB,EACrB,aAAa,GACd,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,YAAY,EAAE,MAAM,IAAI,cAAc,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,qBAAqB;AACrB,OAAO,EACL,OAAO,EACP,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,WAAW,EACX,cAAc,EACd,QAAQ,GACT,MAAM,gBAAgB,CAAC;AAExB,eAAe;AACf,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,kBAAkB;AAClB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,wBAAwB,EACxB,6BAA6B,EAC7B,cAAc,EACd,YAAY,GACb,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,qBAAqB;AACrB,OAAO,EACL,OAAO,EACP,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,WAAW,EACX,cAAc,EACd,QAAQ,GACT,MAAM,gBAAgB,CAAC;AAExB,eAAe;AACf,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,kBAAkB;AAClB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,wBAAwB,EACxB,6BAA6B,EAC7B,cAAc,EACd,YAAY,GACb,MAAM,kBAAkB,CAAC;AA8E1B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/types/common.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { AuthenticationRecord } from '@azure/identity';
|
|
2
1
|
/**
|
|
3
2
|
* Configuration options for GraphClient.
|
|
4
|
-
*
|
|
3
|
+
* Requires a pre-obtained access token (e.g., from an OAuth proxy).
|
|
5
4
|
*/
|
|
6
5
|
export interface GraphClientConfig {
|
|
7
6
|
/**
|
|
@@ -18,29 +17,10 @@ export interface GraphClientConfig {
|
|
|
18
17
|
*/
|
|
19
18
|
scopes?: string[];
|
|
20
19
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* Default: ~/.microsoft-graph-client-auth-record.json
|
|
20
|
+
* Pre-obtained access token for authentication.
|
|
21
|
+
* The caller is responsible for token refresh.
|
|
24
22
|
*/
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Pre-serialized authentication record JSON string.
|
|
28
|
-
* Use this for environments where auth was performed elsewhere
|
|
29
|
-
* (e.g., CI/CD, Kubernetes) and the record is passed via env var.
|
|
30
|
-
*/
|
|
31
|
-
authRecord?: string;
|
|
32
|
-
/**
|
|
33
|
-
* Pre-serialized token cache JSON string.
|
|
34
|
-
* Use this together with authRecord for K8s/CI environments.
|
|
35
|
-
* When provided, will be written to ~/.IdentityService/{cacheName}
|
|
36
|
-
* before the Azure SDK initializes.
|
|
37
|
-
*/
|
|
38
|
-
tokenCache?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Optional name for the token cache.
|
|
41
|
-
* Default: 'microsoft-graph-client'
|
|
42
|
-
*/
|
|
43
|
-
cacheName?: string;
|
|
23
|
+
accessToken: string;
|
|
44
24
|
}
|
|
45
25
|
/**
|
|
46
26
|
* Default scopes for Microsoft Graph API.
|
|
@@ -68,17 +48,4 @@ export interface GraphError {
|
|
|
68
48
|
date?: string;
|
|
69
49
|
};
|
|
70
50
|
}
|
|
71
|
-
/**
|
|
72
|
-
* Result of the authentication process.
|
|
73
|
-
*/
|
|
74
|
-
export interface AuthResult {
|
|
75
|
-
/**
|
|
76
|
-
* The authentication record that can be serialized and stored.
|
|
77
|
-
*/
|
|
78
|
-
record: AuthenticationRecord;
|
|
79
|
-
/**
|
|
80
|
-
* Serialized JSON string of the authentication record.
|
|
81
|
-
*/
|
|
82
|
-
serialized: string;
|
|
83
|
-
}
|
|
84
51
|
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,UAa1B,CAAC;AAMF;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;IACZ,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH"}
|
package/dist/types/common.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// Client Configuration
|
|
3
|
+
// =============================================================================
|
|
1
4
|
/**
|
|
2
5
|
* Default scopes for Microsoft Graph API.
|
|
3
6
|
* These cover common operations like reading user info, chats, mail, calendar, and files.
|
package/dist/types/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,uBAAuB;AACvB,gFAAgF;AA8BhF;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,WAAW;IACX,oBAAoB;IACpB,oBAAoB;IACpB,uBAAuB;IACvB,yBAAyB;IACzB,qBAAqB;IACrB,qBAAqB;IACrB,gBAAgB;IAChB,gBAAgB;IAChB,qBAAqB;IACrB,oBAAoB;IACpB,qBAAqB;CACtB,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { GraphApiResponse, GraphClientConfig, GraphError } from './common.js';
|
|
2
2
|
export { DEFAULT_SCOPES } from './common.js';
|
|
3
3
|
export type { GetUserParams, SearchUsersParams, User } from './user.js';
|
|
4
4
|
export type { PreferredPresenceAvailability, PresenceAvailability, SetPreferredPresenceParams, SetPresenceParams, } from './presence.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGxE,YAAY,EACV,6BAA6B,EAC7B,oBAAoB,EACpB,0BAA0B,EAC1B,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAGvB,YAAY,EACV,IAAI,EACJ,QAAQ,EACR,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,eAAe,GAChB,MAAM,WAAW,CAAC;AAGnB,YAAY,EACV,WAAW,EACX,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,cAAc,CAAC;AAGtB,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAGxG,YAAY,EACV,QAAQ,EACR,yBAAyB,EACzB,yBAAyB,EACzB,gBAAgB,EAChB,KAAK,EACL,sBAAsB,EACtB,uBAAuB,EACvB,QAAQ,EACR,qBAAqB,EACrB,4BAA4B,EAC5B,cAAc,GACf,MAAM,eAAe,CAAC;AAGvB,YAAY,EACV,4BAA4B,EAC5B,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,WAAW,CAAC;AAGnB,YAAY,EACV,cAAc,EACd,yBAAyB,EACzB,0BAA0B,EAC1B,qBAAqB,EACrB,aAAa,GACd,MAAM,iBAAiB,CAAC;AAGzB,YAAY,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "microsoft-graph-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"publish": true,
|
|
5
5
|
"description": "TypeScript client library for Microsoft Graph API with built-in authentication",
|
|
6
6
|
"type": "module",
|
|
@@ -21,8 +21,6 @@
|
|
|
21
21
|
"author": "Evrim Alacan <evrimalacan@gmail.com>",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@azure/identity": "^4.10.1",
|
|
25
|
-
"@azure/identity-cache-persistence": "^1.2.0",
|
|
26
24
|
"@microsoft/microsoft-graph-client": "^3.0.7",
|
|
27
25
|
"@microsoft/microsoft-graph-types": "^2.43.1",
|
|
28
26
|
"dompurify": "^3.2.6",
|
|
@@ -33,12 +31,12 @@
|
|
|
33
31
|
"@types/dompurify": "^3.2.0",
|
|
34
32
|
"@types/jsdom": "^21.1.7",
|
|
35
33
|
"@types/node": "24.10.4",
|
|
36
|
-
"dotenv": "
|
|
34
|
+
"dotenv": "17.2.3",
|
|
37
35
|
"eslint": "^9.39.0",
|
|
38
36
|
"typescript": "^5.7.2",
|
|
39
37
|
"vitest": "^4.0.16",
|
|
40
|
-
"config-
|
|
41
|
-
"config-
|
|
38
|
+
"config-eslint": "0.0.0",
|
|
39
|
+
"config-typescript": "0.0.0"
|
|
42
40
|
},
|
|
43
41
|
"engines": {
|
|
44
42
|
"node": ">=22.0.0"
|