Skip to content

Commit

Permalink
rename new collection to advanced
Browse files Browse the repository at this point in the history
  • Loading branch information
barduinor committed Sep 11, 2023
1 parent 00be6ef commit 4edce1f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ JP_OAS3_REPO="https://github.com/box/box-openapi.git#jp"
POSTMAN_API_KEY=""
EN_POSTMAN_COLLECTION_ID="8119550-b5ea2aeb-c82a-425d-baff-ed5dfd1d7659"
JP_POSTMAN_COLLECTION_ID="8119550-73df4d75-420a-455b-97c2-d3d33103c1a4"
EN_POSTMAN_COLLECTION_ADVANCED_ID = ""
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
"test": "jest",
"lint": "standard --env jest",
"//": "------------------------------",
"convert_multi": "node -e 'require(\"./src/scripts/convert_multi.js\").convert()'",
"release_multi": "node -e 'require(\"./src/scripts/release_multi.js\").release()'"
"convertAdvanced": "node -e 'require(\"./src/scripts/convertAdvanced.js\").convert()'",
"releaseAdvanced": "node -e 'require(\"./src/scripts/releaseAdvanced.js\").release()'"
},
"private": true
}
}
8 changes: 4 additions & 4 deletions src/CollectionMulti.js → src/CollectionAdvanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ const Collection = require('./Collection')

/**
* Our own opinionated OpenAPI to Postman converter
* RB: This is the main class for the multi collection
* RB: This is the main class for the advanced collection
* This class extends the Collection class
* Main difference are:
* - The collectionPreRequest() method - PreScript for the collection
* - The authForEndPoint() method - All endpoints inherit from the collection
* - The defaultAuth() method - Default auth for collection is now Baearer Token
* - The getItemEvents() method - Items do not have events/scripts, these are inhereted from the collection
*/
class CollectionMulti extends Collection {
class CollectionAdvanced extends Collection {
/**
* Accepts an OpenAPI object
* @class CollectionMulti
* @class CollectionAdvanced
* @extends {Collection}
* @param {Object} openapi
* @param {String} locale
Expand Down Expand Up @@ -118,4 +118,4 @@ class CollectionMulti extends Collection {
}
}

module.exports = CollectionMulti
module.exports = CollectionAdvanced
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require('dotenv').config()
const OpenAPI = require('../OpenAPI')
const Path = require('../Path')
const Writer = require('../Writer')
const Collection = require('../CollectionMulti')
const Collection = require('../CollectionAdvanced')

const OPENAPI_FILENAME = 'openapi.json'
const OPENAPI_TYPE = 'OAS3'
Expand All @@ -24,7 +24,7 @@ const convert = async (locale = process.argv[1]) => {

const writer = new Writer(collection)

writer.dump(OUTPUT_FOLDER, `collection.multi.${locale}.json`)
writer.dump(OUTPUT_FOLDER, `collection.advanced.${locale}.json`)
}

const convertAll = async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const axios = require('axios')
const OUTPUT_FOLDER = './compiled'

const release = async (locale = process.argv[1]) => {
const collection = JSON.parse(fs.readFileSync(`${OUTPUT_FOLDER}/collection.multi.${locale}.json`).toString())
const collectionId = process.env[`${locale.toUpperCase()}_POSTMAN_COLLECTION_MULTI_ID`]
const collection = JSON.parse(fs.readFileSync(`${OUTPUT_FOLDER}/collection.advanced.${locale}.json`).toString())
const collectionId = process.env[`${locale.toUpperCase()}_POSTMAN_COLLECTION_ADVANCED_ID`]

// prevent old folders from remaining in place by first removing all items
const emptyCollection = { ...collection }
Expand Down

0 comments on commit 4edce1f

Please sign in to comment.