-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated backup/restore scripts. #855
Conversation
scripts/capture.js
Outdated
|
||
async function getContentTypes() { | ||
const data = await request(`https://${managementEndpoint}/contentTypes?api-version=2018-06-01-preview`); | ||
const data = await request("GET", `https://${managementApiEndpoint}/contentTypes?api-version=2018-06-01-preview`, managementApiAccessToken); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change the api version
scripts/capture.js
Outdated
const contentTypes = data.value.map(x => x.id.replace("\/contentTypes\/", "")); | ||
|
||
return contentTypes; | ||
} | ||
|
||
async function getContentItems(contentType) { | ||
const data = await request(`https://${managementEndpoint}/contentTypes/${contentType}/contentItems?api-version=2018-06-01-preview`); | ||
const data = await request("GET", `https://${managementApiEndpoint}/contentTypes/${contentType}/contentItems?api-version=2018-06-01-preview`, managementApiAccessToken); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change the api version
scripts/cleanup.js
Outdated
|
||
async function getContentTypes() { | ||
const data = await request("GET", `https://${managementEndpoint}/contentTypes?api-version=2018-06-01-preview`); | ||
const data = await request("GET", `https://${managementApiEndpoint}/contentTypes?api-version=2018-06-01-preview`, managementApiAccessToken); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change the api version
scripts/cleanup.js
Outdated
const contentTypes = data.value.map(x => x.id.replace("\/contentTypes\/", "")); | ||
|
||
return contentTypes; | ||
} | ||
|
||
async function getContentItems(contentType) { | ||
const data = await request("GET", `https://${managementEndpoint}/contentTypes/${contentType}/contentItems?api-version=2018-06-01-preview`); | ||
const data = await request("GET", `https://${managementApiEndpoint}/contentTypes/${contentType}/contentItems?api-version=2018-06-01-preview`, managementApiAccessToken); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change the api version
scripts/cleanup.js
Outdated
@@ -87,46 +24,22 @@ async function deleteContent() { | |||
const contentItems = await getContentItems(contentType); | |||
|
|||
for (const contentItem of contentItems) { | |||
await request("DELETE", `https://${managementEndpoint}${contentItem.id}?api-version=2018-06-01-preview`); | |||
await request("DELETE", `https://${managementApiEndpoint}${contentItem.id}?api-version=2018-06-01-preview`, managementApiAccessToken); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change the api version
scripts/generate.js
Outdated
await request(`https://${managementEndpoint}${key}?api-version=2018-06-01-preview`, JSON.stringify(dataObj[key])); | ||
await request( | ||
"PUT", | ||
`https://${managementApiEndpoint}${key}?api-version=2018-06-01-preview`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change the api version
No description provided.