Skip to content
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

Compatible tea core #62

Merged
merged 3 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@darabonba/typescript",
"version": "1.0.1",
"version": "1.0.2",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -37,6 +37,7 @@
"lodash": "^4.17.21",
"moment": "^2.30.1",
"moment-timezone": "^0.5.45",
"@alicloud/tea-typescript": "^1.5.1",
"xml2js": "^0.6.2"
},
"files": [
Expand Down
8 changes: 5 additions & 3 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as httpx from 'httpx';
import { parse } from 'url';
import { RetryOptions } from './retry';
import { BaseError } from './error';
import * as $tea from '@alicloud/tea-typescript';

type TeaDict = { [key: string]: string };
type TeaObject = { [key: string]: any };
Expand Down Expand Up @@ -212,10 +213,11 @@ export function toMap(value: any = undefined, withoutStream: boolean = false): a
return value;
}

export class Model {
export class Model extends $tea.Model {
[key: string]: any

constructor(map?: TeaObject) {
super();
if (map == null) {
return;
}
Expand Down Expand Up @@ -390,7 +392,7 @@ export class FileField extends Model {
}
}

export class ExtendsParameters extends Model {
export class ExtendsParameters extends $tea.Model {
headers?: { [key: string]: string };
queries?: { [key: string]: string };
static names(): { [key: string]: string } {
Expand All @@ -412,7 +414,7 @@ export class ExtendsParameters extends Model {
}
}

export class RuntimeOptions extends Model {
export class RuntimeOptions extends $tea.Model {
retryOptions?: RetryOptions;
autoretry?: boolean;
ignoreSSL?: boolean;
Expand Down
10 changes: 5 additions & 5 deletions src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ export class BaseError extends Error {

export class ResponseError extends BaseError {
code: string
statusCode: number
retryAfter: number
data: any
description: string
accessDeniedDetail: any
statusCode?: number
retryAfter?: number
data?: any
description?: string
accessDeniedDetail?: any

constructor(map: any) {
super(map);
Expand Down