Compare commits

..

39 Commits

Author SHA1 Message Date
Sean Macfarlane
54a9c39b5e Merge branch 'master' into release/v1.0.0 2021-03-23 10:54:50 -04:00
Sean Macfarlane
9cfefd2c9a updated version 2021-03-23 10:54:19 -04:00
Sean Macfarlane
b663641d04 Merge pull request #22 from Telecominfraproject/bugfix/NETEXP-1335
bugfix/NETEXP-1335: Passpoint profile childProfileIds fix
2021-03-23 10:51:25 -04:00
irtiza-h30
689046f41d added null check 2021-03-22 19:43:44 -04:00
irtiza-h30
27d33b100e added osuSsidProfile in type Profile 2021-03-22 15:24:41 -04:00
irtiza-h30
d3667a26d1 cleanup associatedSsidProfiles query 2021-03-20 13:22:51 -04:00
irtiza-h30
b3f8f6bb56 cleanup associatedSsidProfiles query 2021-03-19 18:33:06 -04:00
irtiza-h30
5213719292 passpoint profile childProfileIds fix 2021-03-19 17:15:03 -04:00
Sean Macfarlane
aa0f5a154c Merge branch 'master' into release/v1.0.0 2021-03-19 00:41:32 -04:00
Sean Macfarlane
dd7c24d0dc WIFI-1557 2021-03-19 00:41:05 -04:00
Sean Macfarlane
c2ad217010 fixedaction 2021-03-04 13:47:51 -05:00
Sean Macfarlane
2426a4e7e2 fixed action 2021-03-04 13:45:32 -05:00
Sean Macfarlane
f04df311d5 Merge branch 'master' into release/v1.0.0 2021-03-04 12:47:49 -05:00
Sean Macfarlane
6fdb196aed release 1.0 2021-03-04 12:43:55 -05:00
Sean Macfarlane
6f5ab5c2f6 Merge pull request #21 from Telecominfraproject/hotfix/WIFI-1505
hotfix/WIFI-1505: Channel field for EquipmentStatus
2021-03-04 12:42:48 -05:00
irtiza-h30
4be5b3e42d Channel field for EquipmentStatus 2021-03-03 14:21:03 -05:00
Max Brenner
4e461dadb1 enable docker push commands 2021-03-02 16:57:56 +01:00
Max Brenner
763485a26a adjust build for release branch 2021-03-02 16:51:39 +01:00
Sean Macfarlane
6a2c2900ce Merge pull request #18 from Telecominfraproject/dependabot/npm_and_yarn/object-path-0.11.5
Bump object-path from 0.11.4 to 0.11.5
2021-02-28 16:41:44 -05:00
AkshayJagadish-ne
75ac653569 Merge pull request #20 from Telecominfraproject/WIFI-1669
WIFI-1669 TIP 1.0 Update default container image tags in rel 1.0
2021-02-27 22:01:59 -05:00
Akshay Jagadish
edea4dc1cd WIFI-1669 TIP 1.0 Update default container image tags in release 1.0 branch 2021-02-26 19:22:41 -05:00
Sean Macfarlane
a6cc03f496 Merge pull request #19 from Telecominfraproject/hotfix/WIFI-1557
WIFI-1557
2021-02-17 13:46:49 -05:00
Sean Macfarlane
0a6523a48e WIFI-1557 2021-02-17 12:54:37 -05:00
Sean Macfarlane
2850f3b3c4 updated version 2021-01-20 12:22:07 -05:00
Sean Macfarlane
d9d4f474f7 fixed null mac error 2021-01-20 12:20:09 -05:00
Sean Macfarlane
e3b647ac22 typo 2020-12-14 21:06:57 -05:00
Sean Macfarlane
fd8212efe9 fixed baseMacAddress 2020-12-14 21:02:43 -05:00
Sean Macfarlane
f1dcd0e952 fixed Equipment schema 2020-12-14 20:43:22 -05:00
Sean Macfarlane
8c3afd4527 switched Role to Roles 2020-11-27 19:47:42 -05:00
Sean Macfarlane
1737221692 undo 2020-10-28 13:42:45 -04:00
Sean Macfarlane
f54ca7a535 added Profiles filter by type 2020-10-28 12:04:00 -04:00
dependabot[bot]
dbeb75a702 Bump object-path from 0.11.4 to 0.11.5
Bumps [object-path](https://github.com/mariocasciaro/object-path) from 0.11.4 to 0.11.5.
- [Release notes](https://github.com/mariocasciaro/object-path/releases)
- [Commits](https://github.com/mariocasciaro/object-path/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-20 10:54:32 +00:00
Sean Macfarlane
82df3e7f4a Merge pull request #17 from Telecominfraproject/WIFI-846
WIFI 846
2020-10-13 12:53:04 -04:00
Sean Macfarlane
6cead31c0c Merge pull request #16 from Telecominfraproject/WIFI-845
WIFI: 845
2020-10-13 12:52:21 -04:00
AkshayJagadish-ne
6d4d212d8b Correction 2020-10-13 03:14:03 -04:00
AkshayJagadish-ne
e6cde6f6d4 WIFI: 846
A property file with component version and commit hash would be copied into the container
2020-10-13 02:53:53 -04:00
AkshayJagadish-ne
6f75486bfc WIFI: 845
Added Nightly build schedule (5am), and additional image with a timestamp tag to be pushed
2020-10-13 02:48:16 -04:00
Sean Macfarlane
1d099821a1 fixed OUI Upload 2020-10-08 18:16:11 -04:00
Sean Macfarlane
165f2b4d6b added firmware APIs 2020-10-02 17:12:09 -04:00
6 changed files with 175 additions and 35 deletions

View File

@@ -5,10 +5,7 @@ on:
# Publish `master` as Docker `latest` image.
branches:
- master
schedule:
# runs at cronjob at 5AM
- cron: '00 09 * * *'
- 'release/**'
# Publish `v1.2.3` tags as releases.
tags:
@@ -17,6 +14,10 @@ on:
# Run tests for any PRs.
pull_request:
schedule:
# runs nightly build at 5AM
- cron: '00 09 * * *'
env:
IMAGE_NAME: wlan-cloud-graphql-gw
DOCKER_REPO: tip-tip-wlan-cloud-docker-repo.jfrog.io
@@ -43,29 +44,45 @@ jobs:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push'
if: github.event_name == 'push' || github.event_name == 'schedule'
steps:
- uses: actions/checkout@v2
with:
ssh-key: ${{ secrets.GH_AUTOMATION_KEY }}
- name: Adding property file with component version and commit hash
run: |
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Create a release snapshot if we are on release branch
[[ "${{ github.ref }}" == "refs/heads/release/"* ]] && VERSION=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\/release\/[v]//' | awk '{print $1"-SNAPSHOT"}')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=0.0.1-SNAPSHOT
TIMESTAMP=$(date +'%Y-%m-%d')
echo date=$TIMESTAMP > commit.properties
echo commitId=$GITHUB_SHA >> commit.properties
echo projectVersion=$VERSION>> commit.properties
- name: Build image
run: docker build . --file Dockerfile --tag image
- name: Set current date as env variable
run: echo "::set-env name=TIMESTAMP::$(date +'%Y-%m-%d')"
- name: Login to Docker Hub
env:
DOCKER_PASSWORD: ${{ secrets.REPO_PASSWORD }}
run: |
echo "${DOCKER_PASSWORD}" | docker login $DOCKER_REPO --username "build-pipeline" --password-stdin
echo "${DOCKER_PASSWORD}" | docker login $DOCKER_REPO --username "build-pipeline" --password-stdin
- name: Push image
run: |
IMAGE_ID=$DOCKER_REPO/$IMAGE_NAME
TIMESTAMP=$(date +'%Y-%m-%d')
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
@@ -75,11 +92,15 @@ jobs:
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Create a release snapshot if we are on release branch
[[ "${{ github.ref }}" == "refs/heads/release/"* ]] && VERSION=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\/release\/[v]//' | awk '{print $1"-SNAPSHOT"}')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
[ "$VERSION" == "master" ] && VERSION=0.0.1-SNAPSHOT
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
echo TIMESTAMP=$TIMESTAMP
docker tag image $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION

8
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "wlan-cloud-graphql-apollo",
"version": "0.3.0",
"version": "0.3.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -2321,9 +2321,9 @@
"integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="
},
"object-path": {
"version": "0.11.4",
"resolved": "https://registry.npmjs.org/object-path/-/object-path-0.11.4.tgz",
"integrity": "sha1-NwrnUvvzfePqcKhhwju6iRVpGUk="
"version": "0.11.5",
"resolved": "https://registry.npmjs.org/object-path/-/object-path-0.11.5.tgz",
"integrity": "sha512-jgSbThcoR/s+XumvGMTMf81QVBmah+/Q7K7YduKeKVWL7N111unR2d6pZZarSk6kY/caeNxUDyxOvMWyzoU2eg=="
},
"object.assign": {
"version": "4.1.0",

View File

@@ -1,6 +1,6 @@
{
"name": "wlan-cloud-graphql-apollo",
"version": "0.3.0",
"version": "1.0.1",
"description": "",
"main": "index.js",
"dependencies": {

View File

@@ -169,6 +169,17 @@ export class API extends RESTDataSource {
`portal/equipmentGateway/requestFirmwareUpdate?equipmentId=${equipmentId}&firmwareVersionId=${firmwareVersionId}`
);
}
async requestEquipmentSwitchBank(equipmentId) {
return this.post(
`portal/equipmentGateway/requestApSwitchSoftwareBank?equipmentId=${equipmentId}`
);
}
async requestEquipmentReboot(equipmentId) {
return this.post(`portal/equipmentGateway/requestApReboot?equipmentId=${equipmentId}`);
}
async requestEquipmentFactoryReset(equipmentId) {
return this.post(`portal/equipmentGateway/requestApFactoryReset?equipmentId=${equipmentId}`);
}
async getEquipmentStatus(customerId, equipmentIds, statusDataTypes) {
return this.get('portal/status/forEquipmentWithFilter', {
@@ -193,9 +204,36 @@ export class API extends RESTDataSource {
}
async createProfile(profile) {
return this.post('portal/profile', {
const newProfile = await this.post('portal/profile', {
...profile,
});
if (profile.profileType === 'passpoint') {
const {
id,
details: { associatedAccessSsidProfileIds, osuSsidProfileId },
} = newProfile;
this.get('portal/profile', {
profileId: osuSsidProfileId,
}).then((profile) => {
this.put('portal/profile', {
...profile,
childProfileIds: [...profile.childProfileIds, id],
});
});
associatedAccessSsidProfileIds.forEach((profileId) => {
this.get('portal/profile', {
profileId,
}).then((profile) => {
this.put('portal/profile', {
...profile,
childProfileIds: [...profile.childProfileIds, id],
});
});
});
}
return newProfile;
}
async getProfile(profileId) {
return this.get('portal/profile', {
@@ -203,6 +241,35 @@ export class API extends RESTDataSource {
});
}
async updateProfile(profile) {
if (profile.profileType === 'passpoint') {
const {
id,
details: { associatedAccessSsidProfileIds, osuSsidProfileId },
} = profile;
this.get('portal/profile', {
profileId: osuSsidProfileId,
}).then((profile) => {
if (!profile.childProfileIds.includes(parseInt(id, 10))) {
this.put('portal/profile', {
...profile,
childProfileIds: [...profile.childProfileIds, id],
});
}
});
associatedAccessSsidProfileIds.forEach((profileId) => {
this.get('portal/profile', {
profileId,
}).then((profile) => {
if (!profile.childProfileIds.includes(parseInt(id, 10))) {
this.put('portal/profile', {
...profile,
childProfileIds: [...profile.childProfileIds, id],
});
}
});
});
}
return this.put('portal/profile', {
...profile,
});
@@ -213,17 +280,11 @@ export class API extends RESTDataSource {
});
}
async getAllProfiles({ customerId, cursor, limit, type, context }) {
const result = await this.get('portal/profile/forCustomer', {
return this.get('portal/profile/forCustomer', {
customerId,
...(type && { profileType: type }),
paginationContext: buildPaginationContext(cursor, limit, context),
});
if (type && result.items) {
result.items = result.items.filter((i) => i.profileType === type);
return result;
}
return result;
}
async getProfilesById(profileIdSet) {
return this.get('portal/profile/inSet', {

View File

@@ -155,6 +155,10 @@ const resolvers = {
) => {
return dataSources.api.getAllStatus(customerId, statusDataTypes, cursor, limit, context);
},
getApiUrl: async (_, {}, { dataSources }) => {
return dataSources.api.baseURL;
},
},
Mutation: {
authenticateUser: async (_, { email, password }, { dataSources }) => {
@@ -164,19 +168,19 @@ const resolvers = {
return dataSources.api.updateToken(refreshToken);
},
createUser: async (_, { username, password, role, customerId }, { dataSources }) => {
return dataSources.api.createUser({ username, password, role, customerId });
createUser: async (_, { username, password, roles, customerId }, { dataSources }) => {
return dataSources.api.createUser({ username, password, roles, customerId });
},
updateUser: async (
_,
{ id, username, password, role, customerId, lastModifiedTimestamp },
{ id, username, password, roles, customerId, lastModifiedTimestamp },
{ dataSources }
) => {
return dataSources.api.updateUser({
id,
username,
password,
role,
roles,
customerId,
lastModifiedTimestamp,
});
@@ -234,6 +238,7 @@ const resolvers = {
profileId,
locationId,
name,
baseMacAddress,
latitude,
longitude,
serial,
@@ -250,6 +255,7 @@ const resolvers = {
profileId,
locationId,
name,
baseMacAddress: { addressAsString: baseMacAddress },
latitude,
longitude,
serial,
@@ -266,6 +272,15 @@ const resolvers = {
updateEquipmentFirmware: async (_, { equipmentId, firmwareVersionId }, { dataSources }) => {
return dataSources.api.updateEquipmentFirmware(equipmentId, firmwareVersionId);
},
requestEquipmentSwitchBank: async (_, { equipmentId }, { dataSources }) => {
return dataSources.api.requestEquipmentSwitchBank(equipmentId);
},
requestEquipmentReboot: async (_, { equipmentId }, { dataSources }) => {
return dataSources.api.requestEquipmentReboot(equipmentId);
},
requestEquipmentFactoryReset: async (_, { equipmentId }, { dataSources }) => {
return dataSources.api.requestEquipmentFactoryReset(equipmentId);
},
createProfile: async (
_,
@@ -365,6 +380,16 @@ const resolvers = {
},
},
Equipment: {
baseMacAddress: ({ baseMacAddress }) => baseMacAddress && baseMacAddress.addressAsString,
manufacturer: ({ baseMacAddress }, args, { dataSources }) => {
return (
baseMacAddress &&
baseMacAddress.addressAsString &&
dataSources.api.getOuiLookup(
baseMacAddress.addressAsString.replace(/[:-]/g, '').substring(0, 6)
)
);
},
profile: ({ profileId }, args, { dataSources }) => {
return dataSources.api.getProfile(profileId);
},
@@ -372,7 +397,14 @@ const resolvers = {
return dataSources.api.getEquipmentStatus(
customerId,
[id],
['PROTOCOL', 'OS_PERFORMANCE', 'RADIO_UTILIZATION', 'CLIENT_DETAILS', 'FIRMWARE']
[
'PROTOCOL',
'OS_PERFORMANCE',
'RADIO_UTILIZATION',
'CLIENT_DETAILS',
'FIRMWARE',
'RADIO_CHANNEL',
]
);
},
channel: ({ details }) => {
@@ -409,6 +441,7 @@ const resolvers = {
clientDetails: (items) => items.find((i) => i.statusDataType === 'CLIENT_DETAILS') || {},
firmware: (items) => items.find((i) => i.statusDataType === 'FIRMWARE') || {},
dashboard: (items) => items.find((i) => i.statusDataType === 'CUSTOMER_DASHBOARD') || {},
channel: (items) => items.find((i) => i.statusDataType === 'RADIO_CHANNEL') || {},
},
Status: {
detailsJSON: ({ details }) => details || {},
@@ -437,7 +470,7 @@ const resolvers = {
reportedMacAddr &&
reportedMacAddr.addressAsString &&
dataSources.api.getOuiLookup(
reportedMacAddr.addressAsString.replace(/:/g, '').substring(0, 6)
reportedMacAddr.addressAsString.replace(/[:-]/g, '').substring(0, 6)
)
);
},
@@ -488,6 +521,18 @@ const resolvers = {
return result && result.value2;
},
associatedSsidProfiles: ({ details }, args, { dataSources }) => {
return (
details &&
details.associatedAccessSsidProfileIds &&
dataSources.api.getProfilesById(details.associatedAccessSsidProfileIds)
);
},
osuSsidProfile: ({ details }, args, { dataSources }) => {
return (
details && details.osuSsidProfileId && dataSources.api.getProfile(details.osuSsidProfileId)
);
},
},
ClientSession: {
id: ({ macAddress }) => macAddress.addressAsString,
@@ -501,7 +546,9 @@ const resolvers = {
return (
macAddress &&
macAddress.addressAsString &&
dataSources.api.getOuiLookup(macAddress.addressAsString.replace(/:/g, '').substring(0, 6))
dataSources.api.getOuiLookup(
macAddress.addressAsString.replace(/[:-]/g, '').substring(0, 6)
)
);
},
equipment: ({ equipmentId }, args, { dataSources }) => {

View File

@@ -7,6 +7,8 @@ const typeDefs = gql`
scalar JSONObject
type Query {
getApiUrl: String
getUser(id: ID!): User
getAllUsers(customerId: ID!, cursor: String, limit: Int, context: JSONObject): UserPagination
@@ -114,7 +116,7 @@ const typeDefs = gql`
id: ID!
username: String!
password: String
role: String!
roles: [String]
customerId: ID!
lastModifiedTimestamp: String
}
@@ -157,6 +159,8 @@ const typeDefs = gql`
profileId: ID!
locationId: ID!
name: String!
baseMacAddress: String
manufacturer: String
latitude: String
longitude: String
serial: String
@@ -187,6 +191,7 @@ const typeDefs = gql`
clientDetails: Status
firmware: Status
dashboard: Status
channel: Status
}
type Status {
@@ -226,6 +231,8 @@ const typeDefs = gql`
lastModifiedTimestamp: String
equipmentCount: Int
details: JSONObject
associatedSsidProfiles: [Profile]
osuSsidProfile: Profile
}
type ProfilePagination {
@@ -348,12 +355,12 @@ const typeDefs = gql`
authenticateUser(email: String!, password: String!): Token
updateToken(refreshToken: String!): Token
createUser(username: String!, password: String!, role: String!, customerId: ID!): User
createUser(username: String!, password: String!, roles: [String], customerId: ID!): User
updateUser(
id: ID!
username: String!
password: String!
role: String!
roles: [String]
customerId: ID!
lastModifiedTimestamp: String
): User
@@ -395,6 +402,7 @@ const typeDefs = gql`
profileId: ID!
locationId: ID!
name: String!
baseMacAddress: String
latitude: String
longitude: String
serial: String
@@ -404,6 +412,9 @@ const typeDefs = gql`
updateEquipmentBulk(items: [EquipmentRrmUpdate]): GenericResponse
deleteEquipment(id: ID!): Equipment
updateEquipmentFirmware(equipmentId: ID, firmwareVersionId: ID): GenericResponse
requestEquipmentSwitchBank(equipmentId: ID): GenericResponse
requestEquipmentReboot(equipmentId: ID): GenericResponse
requestEquipmentFactoryReset(equipmentId: ID): GenericResponse
createProfile(
profileType: String!