gdc-sdk-node-ts 2.3.29 → 2.4.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/dist/device-activation.js +10 -0
- package/package.json +2 -2
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
2
|
import { resolvePollOptionsFromSeconds } from './poll-options.js';
|
|
3
3
|
export async function activateEmployeeDeviceWithActivationCodeWithDeps(deps) {
|
|
4
|
+
const deviceInfo = deps.input.dcrPayload.ext_device_info;
|
|
5
|
+
const redirectUris = deps.input.dcrPayload.redirect_uris;
|
|
6
|
+
const jwks = deps.input.dcrPayload.jwks;
|
|
7
|
+
const clientInstanceId = String(deviceInfo?.device_id
|
|
8
|
+
|| (deps.input.dcrPayload.software_id ? `software:${deps.input.dcrPayload.software_id}` : '')
|
|
9
|
+
|| (redirectUris?.[0] ? `redirect:${redirectUris[0]}` : '')
|
|
10
|
+
|| (jwks?.keys?.[0]?.kid ? `key:${jwks.keys[0].kid}` : '')).trim();
|
|
11
|
+
if (!clientInstanceId)
|
|
12
|
+
throw new Error('Device activation requires a stable device, software, redirect, or key identifier.');
|
|
4
13
|
const exchangePayload = {
|
|
5
14
|
thid: `exchange-${createRuntimeUuid()}`,
|
|
6
15
|
subject_token: deps.input.activationCode,
|
|
16
|
+
client_instance_id: clientInstanceId,
|
|
7
17
|
};
|
|
8
18
|
const exchange = await deps.submitAndPollWithBearerToken(deps.input.idToken, deps.identityTokenExchangePath(deps.routeCtx), deps.identityTokenExchangePollPath(deps.routeCtx), exchangePayload, deps.input.pollOptions);
|
|
9
19
|
const pollBody = exchange.poll.body || {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gdc-sdk-node-ts",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Next-generation Node runtime package for the GDC SDK family",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Antifraud Services Inc.",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"test:e2e:live-gw:clean": "bash ./scripts/run-live-gw-clean.sh"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"gdc-common-utils-ts": "^2.
|
|
40
|
+
"gdc-common-utils-ts": "^2.4.0",
|
|
41
41
|
"gdc-sdk-core-ts": "~2.3.18"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|