forked from ali-sdk/ali-oss
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
174 additions
and
178 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import type { DeleteObjectOptions, NormalSuccessResponse } from 'oss-interface'; | ||
|
||
export interface DeleteMultipleObject { | ||
key: string; | ||
versionId?: string; | ||
} | ||
|
||
export interface DeleteMultipleObjectXML { | ||
Key: string; | ||
VersionId?: string; | ||
} | ||
|
||
export interface DeleteMultipleObjectOptions extends DeleteObjectOptions { | ||
quiet?: boolean; | ||
} | ||
|
||
export interface DeleteMultipleResponseObjectXML { | ||
Key: string; | ||
VersionId?: string; | ||
DeleteMarker?: boolean; | ||
DeleteMarkerVersionId?: string; | ||
} | ||
|
||
export interface DeleteMultipleObjectResponse { | ||
res: NormalSuccessResponse; | ||
deleted: DeleteMultipleResponseObjectXML[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './Object.js'; | ||
export * from './Request.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import utility from 'utility'; | ||
|
||
export function json2xml(json: Record<string, any>, options?: { headers: boolean }) { | ||
let xml = ''; | ||
if (options?.headers) { | ||
xml = '<?xml version="1.0" encoding="UTF-8"?>\n'; | ||
} | ||
for (const key in json) { | ||
const value = json[key]; | ||
if (value === null || value === undefined) continue; | ||
if (Array.isArray(value)) { | ||
for (const item of value) { | ||
xml += `<${key}>`; | ||
xml += json2xml(item); | ||
xml += `</${key}>`; | ||
} | ||
} else if (typeof value === 'object') { | ||
xml += `<${key}>`; | ||
xml += json2xml(value); | ||
xml += `</${key}>`; | ||
} else { | ||
xml += `<${key}>${utility.escape(value.toString())}</${key}>`; | ||
} | ||
} | ||
return xml; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.