feat: collection level headers and authorization (#3505)

Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
This commit is contained in:
Nivedin
2023-12-13 22:43:18 +05:30
committed by GitHub
parent f3edd001d7
commit 47e009267b
95 changed files with 3221 additions and 970 deletions

View File

@@ -101,7 +101,7 @@ type ExportedUserCollectionGQL = {
function exportedCollectionToHoppCollection(
collection: ExportedUserCollectionREST | ExportedUserCollectionGQL,
collectionType: "REST" | "GQL"
): HoppCollection<HoppRESTRequest | HoppGQLRequest> {
): HoppCollection {
if (collectionType == "REST") {
const restCollection = collection as ExportedUserCollectionREST
@@ -186,7 +186,7 @@ async function loadUserCollections(collectionType: "REST" | "GQL") {
exportedCollectionToHoppCollection(
collection,
"REST"
) as HoppCollection<HoppRESTRequest>
) as HoppCollection
)
)
: setGraphqlCollections(
@@ -195,7 +195,7 @@ async function loadUserCollections(collectionType: "REST" | "GQL") {
exportedCollectionToHoppCollection(
collection,
"GQL"
) as HoppCollection<HoppGQLRequest>
) as HoppCollection
)
)
})
@@ -718,7 +718,7 @@ export const def: CollectionsPlatformDef = {
function getCollectionPathFromCollectionID(
collectionID: string,
collections: HoppCollection<HoppRESTRequest | HoppGQLRequest>[],
collections: HoppCollection[],
parentPath?: string
): string | null {
for (const collectionIndex in collections) {
@@ -742,7 +742,7 @@ function getCollectionPathFromCollectionID(
function getRequestPathFromRequestID(
requestID: string,
collections: HoppCollection<HoppRESTRequest | HoppGQLRequest>[],
collections: HoppCollection[],
parentPath?: string
): { collectionPath: string; requestIndex: number } | null {
for (const collectionIndex in collections) {
@@ -774,7 +774,7 @@ function getRequestPathFromRequestID(
function getRequestIndex(
requestID: string,
parentCollectionPath: string,
collections: HoppCollection<HoppRESTRequest | HoppGQLRequest>[]
collections: HoppCollection[]
) {
const collection = navigateToFolderWithIndexPath(
collections,

View File

@@ -39,7 +39,7 @@ export const restRequestsMapper = createMapper<string, string>()
// temp implementation untill the backend implements an endpoint that accepts an entire collection
// TODO: use importCollectionsJSON to do this
const recursivelySyncCollections = async (
collection: HoppCollection<HoppRESTRequest>,
collection: HoppCollection,
collectionPath: string,
parentUserCollectionID?: string
) => {

View File

@@ -36,7 +36,7 @@ export const gqlRequestsMapper = createMapper<string, string>()
// temp implementation untill the backend implements an endpoint that accepts an entire collection
// TODO: use importCollectionsJSON to do this
const recursivelySyncCollections = async (
collection: HoppCollection<HoppRESTRequest>,
collection: HoppCollection,
collectionPath: string,
parentUserCollectionID?: string
) => {