Skip to content

Commit f8cdd10

Browse files
committed
Merge branch 'release-25.11' into 'main'
Release 25.11 See merge request nwac/sdk-ts!150
2 parents 083cd55 + 3c984a4 commit f8cdd10

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+4849
-1998
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## Version 7.0.0
4+
5+
Breaking changes:
6+
- KYC functionality is now under `NetworkAsCodeClient.kyc.*` namespace instead of under `Device`
7+
8+
Changes:
9+
- KYC Fill-in is now supported
10+
- KYC Tenure is now supported
11+
- Quality-on-Demand has been updated to support V1 API
12+
- Device Status now supports Device Roaming and Device Reachability V1
13+
- KYC functionality now has return models and types for easier use
14+
15+
Fixes:
16+
- Test mocks were not properly checking request bodies and therefore
17+
gave false negatives. These mocks have now been fixed
18+
319
## Version 6.0.0
420

521
Breaking Changes:

Jenkinsfile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ pipeline {
1313
yaml """
1414
spec:
1515
containers:
16-
- name: narwhal
17-
image: nex-nef-docker-releases.repo.cci.nokia.net/nmp/narwhal:latest
16+
- name: typescript
17+
image: nex-nef-docker-candidates.repo.cci.nokia.net/nmp-sdk-typescript-container:latest
1818
workingDir: /home/jenkins
1919
tty: true
2020
command:
@@ -71,7 +71,7 @@ pipeline {
7171
stages {
7272
stage('Setup') {
7373
steps {
74-
container('narwhal') {
74+
container('typescript') {
7575
script {
7676
sh """
7777
npm config set proxy http://fihel1d-proxy.emea.nsn-net.net:8080
@@ -83,7 +83,7 @@ pipeline {
8383
}
8484
stage('Linting') {
8585
steps {
86-
container('narwhal') {
86+
container('typescript') {
8787
script {
8888
sh """
8989
npm run lint
@@ -94,7 +94,7 @@ pipeline {
9494
}
9595
stage('Test') {
9696
steps {
97-
container('narwhal') {
97+
container('typescript') {
9898
script {
9999
sh """
100100
npm test
@@ -105,7 +105,7 @@ pipeline {
105105
}
106106
stage('Audit') {
107107
steps {
108-
container('narwhal') {
108+
container('typescript') {
109109
script {
110110
sh """
111111
npm audit --prod
@@ -117,7 +117,7 @@ pipeline {
117117
stage('Integration Test') {
118118
when { expression { env.gitlabActionType != "TAG_PUSH"} }
119119
steps {
120-
container('narwhal') {
120+
container('typescript') {
121121
script {
122122
sh """
123123
env | grep gitlab
@@ -149,7 +149,7 @@ pipeline {
149149
}
150150
stage('Build') {
151151
steps {
152-
container('narwhal') {
152+
container('typescript') {
153153
script {
154154
sh """
155155
npm run build
@@ -160,7 +160,7 @@ pipeline {
160160
}
161161
stage('Installation Test'){
162162
steps {
163-
container('narwhal') {
163+
container('typescript') {
164164
script {
165165
sh '''
166166
bash installation-test/installation-test-ts.sh
@@ -174,7 +174,7 @@ pipeline {
174174
stage('Candidate integration tests against production') {
175175
when { expression { env.gitlabActionType == "TAG_PUSH" && env.gitlabBranch.contains("rc-")} }
176176
steps {
177-
container('narwhal') {
177+
container('typescript') {
178178
script {
179179
sh """
180180
env | grep gitlab
@@ -193,7 +193,7 @@ pipeline {
193193
stage('Release integration tests against production') {
194194
when { expression { env.gitlabActionType == "TAG_PUSH" && env.gitlabBranch.contains("release-")} }
195195
steps {
196-
container('narwhal') {
196+
container('typescript') {
197197
script {
198198
sh """
199199
env | grep gitlab
@@ -211,7 +211,7 @@ pipeline {
211211
stage('Publish') {
212212
when { expression { env.gitlabActionType == "TAG_PUSH" && env.gitlabBranch.contains("release-")} }
213213
steps {
214-
container('narwhal') {
214+
container('typescript') {
215215
script {
216216
if(env.gitlabActionType == "TAG_PUSH" && env.gitlabBranch.contains("release-")) {
217217
sh '''
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,39 @@
11
// Device Status functionalities
22

3-
// Subscribing to Connectivity and Roaming updates:
3+
// Subscribing to Reachability or Roaming updates:
44

55
import { NetworkAsCodeClient } from "network-as-code";
6-
6+
import { EventType } from "../src/models/deviceStatus";
77

88
const client = new NetworkAsCodeClient("<your-application-key-here>");
99

1010
// Create a device object for the mobile device we want to use
1111
const myDevice = client.devices.get({
12-
networkAccessIdentifier: "[email protected]",
13-
ipv4Address: {
14-
publicAddress: "233.252.0.2",
15-
privateAddress: "192.0.2.25",
16-
publicPort: 80,
17-
},
18-
Ipv6Address: "2041:0000:140F::875B:131B",
1912
// The phone number accepts the "+" sign, but not spaces or "()" marks
20-
phoneNumber: "36721601234567"
13+
phoneNumber: "+99999991000"
2114
});
2215

2316
// Simply change the event_type whenever needed.
2417
const mySubscription = await client.deviceStatus.subscribe(
2518
myDevice,
26-
// When necessary, change it to:
27-
// "org.camaraproject.device-status.v0.roaming-status"
28-
"org.camaraproject.device-status.v0.connectivity-data",
19+
// When necessary, change this to different event_type, for example:
20+
// [EventType.ROAMING_STATUS]
21+
[EventType.REACHABILITY_DATA],
2922
// Use HTTPS to send notifications
3023
"https://example.com/notify",
24+
// You can add optional parameters as well
3125
{
32-
maxNumberOfReports: 5,
33-
notificationAuthToken: "replace-with-your-auth-token"
26+
initialEvent: true,
27+
subscriptionMaxEvents: 5
3428
}
3529
);
3630

3731
// Use this to show the roaming subscription status
3832
console.log(mySubscription);
3933

40-
// Get the subscription by its ID
41-
const subscription = await client.deviceStatus.get(mySubscription.eventSubscriptionId);
34+
// Get the reachability subscription by its ID
35+
// Change the method call to getRoamingSubscription() to get a roaming subscription
36+
const subscription = await client.deviceStatus.getReachabilitySubscription(mySubscription.eventSubscriptionId);
4237

4338
// Then, delete the subscription whenever needed
4439
subscription.delete();

examples/kyc-age-verification.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@ import { NetworkAsCodeClient } from "network-as-code";
55
const client = new NetworkAsCodeClient("<your-application-key-here>");
66

77

8-
// Then, create a device object for the phone number */
9-
const device = client.devices.get({
10-
// The phone number accepts the "+" sign, but not spaces or "()" marks
11-
phoneNumber: "+999999991000"
12-
});
13-
14-
158
// Add the phone number of the subscriber and the age threshold to compare to here.
169
// Add optionally also the other information of the subscriber here, as well as if the
1710
// subscription has a content lock or parental control.
@@ -31,6 +24,6 @@ const parameters =
3124
includeParentalControl: true
3225
}
3326

34-
const customerAgeVerifyResult = await device.verifyAge(parameters);
27+
const customerAgeVerifyResult = await client.kyc.verifyAge(parameters);
3528

36-
console.log(customerAgeVerifyResult)
29+
console.log(customerAgeVerifyResult)

examples/kyc-fill-in.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { NetworkAsCodeClient } from "network-as-code";
2+
3+
4+
// Initialize the client object with your application key
5+
const client = new NetworkAsCodeClient("<your-application-key-here>");
6+
7+
8+
// To use the requestCustomerInfo method you must provide the customer's phone number.
9+
const result = await client.kyc.requestCustomerInfo("+99999991000");
10+
11+
12+
// If successful, you can access the results like so:
13+
console.log(result);

examples/kyc-match.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,9 @@ import { NetworkAsCodeClient } from "network-as-code";
55
const client = new NetworkAsCodeClient("<your-application-key-here>");
66

77

8-
// Then, create a device object for the phone number. */
9-
const device = client.devices.get({
10-
// The phone number accepts the "+" sign, but not spaces or "()" marks
11-
phoneNumber: "+999999991000"
12-
});
8+
// To match customer records, you must provide the customer's phone number.
139

14-
15-
// Add the customer identity data here, which is to be used in matching
10+
// Add additional customer identity data, which is to be used in matching
1611
// a customer against the account data bound to their phone number.
1712
const parameters =
1813
{
@@ -38,6 +33,6 @@ const parameters =
3833
gender: "OTHER"
3934
}
4035

41-
const customerMatchResult = await device.matchCustomer(parameters);
36+
const customerMatchResult = await client.kyc.matchCustomer(parameters);
4237

43-
console.log(customerMatchResult)
38+
console.log(customerMatchResult)

examples/kyc-tenure.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { NetworkAsCodeClient } from "network-as-code";
2+
3+
4+
// Initialize the client object with your application key
5+
const client = new NetworkAsCodeClient("<your-application-key-here>");
6+
7+
8+
// To use the check_tenure method you must provide the customer's phone number.
9+
10+
// Add the tenure date from which the continuous tenure of the subscriber is to be confirmed
11+
12+
const result = await client.kyc.checkTenure(
13+
{
14+
phoneNumber: "+99999991000",
15+
// You can also use a string value in format of "YYYY-MM-DD"
16+
tenureDate: new Date(2023, 7, 17)
17+
}
18+
)
19+
20+
// If successful, you can access the results like so:
21+
console.log(result)
22+
23+
// Or
24+
console.log(result.tenureDateCheck)
25+
console.log(result.contractType)

examples/qod-session.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// QoD functionalities
22

3-
// QoS session examples:
3+
// QoD session examples:
44

55
import { NetworkAsCodeClient } from "network-as-code";
66

@@ -25,14 +25,18 @@ const myDevice = client.devices.get({
2525
// Create a QoD session with QOS_L (large bandwidth)
2626
// that lasts for 3,600 seconds (1 hour).
2727
// For TypeScript, values can be expressed directly,
28-
// but the QoS profile comes before the IP address(es) and duration:
28+
// but the QoD profile comes before the IP address(es) and duration:
2929
const mySession = await myDevice.createQodSession("QOS_L", {
3030
serviceIpv4: "233.252.0.2",
3131
serviceIpv6: "2001:db8:1234:5678:9abc:def0:fedc:ba98",
3232
duration: 3600,
3333
// Use HTTPS to send or subscribe to notifications
34-
notificationUrl: "https://notify.me/here",
35-
notificationAuthToken: "replace-with-your-auth-token",
34+
sink: "https://example.com/notifications",
35+
sinkCredential: {
36+
credentialType:"ACCESSTOKEN",
37+
accessToken: "some-access-token",
38+
accessTokenType: "bearer",
39+
accessTokenExpiresUtc: new Date("2025-01-23T10:40:30.616Z")}
3640
});
3741

3842
// Let's confirm that the device has the newly created session

0 commit comments

Comments
 (0)