Skip to content

Commit 09c71e9

Browse files
wwwzbwcomyugasun
authored andcommitted
fix: fix some typings according to api doc and component
1 parent 20e92ba commit 09c71e9

File tree

6 files changed

+32
-30
lines changed

6 files changed

+32
-30
lines changed

src/modules/apigw/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
ApigwRemoveInputs,
2323
ApigwBindCustomDomainInputs,
2424
ApigwBindUsagePlanOutputs,
25-
CustomDomain,
2625
} from './interface';
2726

2827
export default class Apigw {
@@ -355,7 +354,7 @@ export default class Apigw {
355354
* 解绑 API 网关所有自定义域名
356355
* @param serviceId API 网关 ID
357356
*/
358-
async unbindCustomDomain(serviceId: string, customDomains: CustomDomain[]) {
357+
async unbindCustomDomain(serviceId: string, customDomains: { subDomain?: string }[]) {
359358
const customDomainDetail = (await this.request({
360359
Action: 'DescribeServiceSubDomains',
361360
serviceId,
@@ -407,7 +406,7 @@ export default class Apigw {
407406
this.unbindCustomDomain(serviceId, oldState?.customDomains ?? []);
408407

409408
// 2. bind user config domain
410-
const customDomainOutput = [];
409+
const customDomainOutput: ApigwBindCustomDomainOutputs[] = [];
411410
if (customDomains && customDomains.length > 0) {
412411
console.log(`Start bind custom domain for service ${serviceId}`);
413412
for (let i = 0; i < customDomains.length; i++) {

src/modules/apigw/interface.ts

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,21 @@ export interface ApiEndpoint {
6565
base64EncodedTriggerRules?: string[];
6666
}
6767

68-
export interface CustomDomain {
69-
domain: string;
70-
subDomain: string;
71-
protocols: ('http' | 'https')[];
68+
export interface ApigwBindCustomDomainInputs {
69+
customDomains?: {
70+
domain: string;
71+
protocols: ('http' | 'https')[];
7272

73-
certificateId: string;
74-
isDefaultMapping?: boolean;
75-
pathMappingSet: [];
76-
netType: string;
73+
certificateId: string;
74+
isDefaultMapping?: boolean;
75+
pathMappingSet: [];
76+
netType: string;
7777

78-
isForcedHttps: boolean;
79-
}
78+
isForcedHttps: boolean;
8079

81-
export interface ApigwBindCustomDomainInputs {
82-
customDomains?: CustomDomain[];
80+
subDomain?: string;
81+
created?: boolean;
82+
}[];
8383
protocols: ('http' | 'https')[] | string;
8484
oldState?: Partial<ApigwBindCustomDomainInputs>;
8585
}
@@ -127,7 +127,7 @@ export interface ApigwDeployInputs
127127
export interface ApigwBindCustomDomainOutputs {
128128
isBinded: boolean;
129129
created?: boolean;
130-
subDomain: any;
130+
subDomain: string;
131131
cname: string;
132132
url?: string;
133133
message?: string;
@@ -168,11 +168,6 @@ export interface ApigwRemoveInputs {
168168
environment: EnviromentType;
169169
serviceId: string;
170170
apiList: ApiEndpoint[];
171-
customDomains: CustomDomain[];
172-
usagePlan: ApigwSetupUsagePlanInputs;
173-
}
174-
175-
export interface CustomDomain {
176-
subDomain: string;
177-
created: boolean;
171+
customDomains?: ApigwBindCustomDomainOutputs[];
172+
usagePlan?: ApigwSetupUsagePlanInputs;
178173
}

src/modules/cns/interface.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export interface CnsRecordInputs {
55
recordLine: string;
66
recordType: 'CNAME' | 'A' | 'AAAA' | 'TXT' | string;
77
recordId: string;
8-
mx?: string;
8+
mx?: number;
99
ttl?: number;
1010
status?: string;
1111
}
@@ -15,7 +15,7 @@ export interface CnsRecordOutputs {
1515
name: string;
1616
type: string;
1717
id: string;
18-
mx?: string;
18+
mx?: number;
1919
ttl?: number;
2020
line: string;
2121

src/modules/cos/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ export default class Cos {
296296
Filter: {},
297297
};
298298

299-
if (lc.filter?.prefix) {
299+
if (typeof lc.filter !== 'string' && lc.filter?.prefix) {
300300
tempLifecycle.Filter = {
301301
Prefix: lc.filter?.prefix,
302302
};

src/modules/cos/interface.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export interface CosSetLifecycleInputs {
7676
id: string;
7777
status: 'Enabled' | 'Disabled';
7878
filter?: {
79-
prefix: string;
79+
prefix?: string;
8080
};
8181
transition?: {
8282
days: number | string;
@@ -88,11 +88,11 @@ export interface CosSetLifecycleInputs {
8888
storageClass: number | string;
8989
};
9090
expiration?: {
91-
days: number;
91+
days: number | string;
9292
expiredObjectDeleteMarker: string;
9393
};
9494
abortIncompleteMultipartUpload?: {
95-
daysAfterInitiation: number;
95+
daysAfterInitiation: number | string;
9696
};
9797
}[];
9898
}

src/modules/scf/interface.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,15 @@ export interface ScfDeployInputs extends ScfCreateFunctionInputs {
158158
events?: TriggerType[];
159159
}
160160

161-
export interface ScfDeployOutputs {}
161+
export interface ScfDeployOutputs {
162+
FunctionName: string;
163+
Runtime: string;
164+
Namespace: string;
165+
LastVersion?: string;
166+
Traffic?: number;
167+
168+
ConfigTrafficVersion: string;
169+
}
162170

163171
export interface ScfRemoveInputs {
164172
functionName?: string;

0 commit comments

Comments
 (0)