Skip to content

Commit

Permalink
feat: delete credential
Browse files Browse the repository at this point in the history
  • Loading branch information
wss-git committed Apr 21, 2021
1 parent 79fb9dc commit 89a4528
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 37 deletions.
6 changes: 5 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions dist/utils/utils.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { IV1Inputs, IInputs } from '@serverless-devs/core';
import Pop from '@alicloud/pop-core';
export declare const sleep: (ms: number) => Promise<unknown>;
export declare const tranfromV1InputsToInputs: (inputs: IV1Inputs) => IInputs;
export declare function checkRs(rs: any): void;
export declare const getPopClient: (credentials: any, endpoint: any, apiVersion: any) => Pop;
18 changes: 2 additions & 16 deletions dist/utils/utils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dependencies": {
"@alicloud/fc2": "^2.2.2",
"@alicloud/pop-core": "^1.7.10",
"@serverless-devs/core": "^0.0.63",
"@serverless-devs/core": "^0.0.x",
"ali-oss": "^6.13.2",
"fs-extra": "^9.1.0",
"lodash": "^4.17.20",
Expand Down
2 changes: 1 addition & 1 deletion publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Type: Component
Name: domain
Provider:
- 阿里云
Version: 0.0.6
Version: 0.0.7
Description: 下发Serverless Devs默认域名
HomePage: https://github.com/devsapp/domain
Tags: #标签详情
Expand Down
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ export default class Compoent {
@HLogger(constant.CONTEXT) logger: ILogger;

async get(inputs: IInputs) {
// @ts-ignore
delete inputs.Credentials;
// @ts-ignore
delete inputs.credentials;
this.logger.debug(`inputs params: ${JSON.stringify(inputs)}`);

const apts = { boolean: ['help'], alias: { help: 'h' } };
Expand Down
16 changes: 0 additions & 16 deletions src/utils/utils.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
import { IV1Inputs, IInputs } from '@serverless-devs/core';
import Pop from '@alicloud/pop-core';
import _ from 'lodash';

export const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));

export const tranfromV1InputsToInputs = (inputs: IV1Inputs): IInputs => {
const output: IInputs = {};

_.forEach(inputs, (value, key) => {
const k = _.lowerFirst(key);
if (k === 'properties' || !_.isObject(value)) {
output[k] = value;
} else {
output[k] = _.mapKeys(value, (v, k) => _.lowerFirst(k));
}
});

return output;
};

export function checkRs(rs: any) {
if (rs.Status !== 'Success') {
throw new Error(rs.Body);
Expand Down

0 comments on commit 89a4528

Please sign in to comment.