Skip to content

Commit

Permalink
bump: version 1.0.0-rc.27
Browse files Browse the repository at this point in the history
  • Loading branch information
lurunze1226 committed Mar 3, 2021
1 parent 4367446 commit 9c14a73
Show file tree
Hide file tree
Showing 5 changed files with 139 additions and 18 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Changelog
# CHANGELOG

## 1.0.0-rc.27(2021-03-03)

### Features
- CFCClient supports trigger API

## 1.0.0-rc.26(2020-12-23)

Expand Down
118 changes: 117 additions & 1 deletion dist/baidubce-sdk.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -44710,7 +44710,7 @@ exports.createContext = Script.createContext = function (context) {
},{"indexof":134}],208:[function(require,module,exports){
module.exports={
"name": "@baiducloud/sdk",
"version": "1.0.0-rc.26",
"version": "1.0.0-rc.27",
"description": "Baidu Cloud Engine JavaScript SDK",
"main": "./index.js",
"browser": {
Expand Down Expand Up @@ -47779,6 +47779,122 @@ CfcClient.prototype.listAliases = function (functionName, opt_options) {
});
};

CfcClient.prototype.listRelations = function (opt_options) {
var options = opt_options || {};
var params = u.extend(
u.pick(options, 'FunctionBrn')
);

return this.sendRequest('GET', '/v1/relation', {
params: params,
});
};

CfcClient.prototype.createRelation = function (body, opt_options) {
/**
var body =
{
'Target': 'string',
'Source': 'string',
'Data': {
'Resource': 'string',
'Status': 'string',
'EventType': 'string'
'Name': 'string'
},
};
*/
debug('createRelation, body = %j', body);

var options = opt_options || {};
var params = u.extend(
u.pick(options, 'FunctionBrn')
);

return this.sendRequest('POST', '/v1/relation', {
// params: params,
body: JSON.stringify(body)
});
};

CfcClient.prototype.updateRelation = function (body) {
/**
var body = {
'RelationId': 'string',
'Target': 'string',
'Source': 'string',
'Data': {
'Resource': 'string',
'Status': 'string',
'EventType': 'string'
'Name': 'string'
}
}
*/

return this.sendRequest('PUT', '/v1/relation', {
body: JSON.stringify(body)
});
};

CfcClient.prototype.deleteRelation = function (opt_options) {
var options = opt_options || {};
var params = u.extend(
u.pick(options, 'Target', 'Source', 'RelationId')
);
return this.sendRequest('DELETE', '/v1/relation', {
params: params
});
};


CfcClient.prototype.listEventSourceMappings = function (opt_options) {
var options = opt_options || {};
var params = u.extend(
u.pick(options, 'FunctionName')
);

return this.sendRequest('GET', '/v1/event-source-mappings', {
params: params,
});
};

CfcClient.prototype.createEventSourceMapping = function (body) {
/**
var body =
{
BatchSize: 100
Enabled: true
EventSourceBrn: "42f6fbc2cd374bfcb80d9967370fd8ff__qa_preonline_cfc"
FunctionName: "brn:bce:cfc:bj:1a2cbf55b97ac8a7c760c4177db4e17d:function:html:$LATEST"
Source: "kafka"
StartingPosition: "TRIM_HORIZON"
}
*/
debug('createEventSourceMapping, body = %j', body);

return this.sendRequest('POST', '/v1/event-source-mappings', {
body: JSON.stringify(body)
});
};

CfcClient.prototype.updateEventSourceMapping = function (esmId, body) {
/**
var body = {
BatchSize: 100
Enabled: false
FunctionName: "brn:bce:cfc:bj:1a2cbf55b97ac8a7c760c4177db4e17d:function:html:$LATEST"
}
*/
return this.sendRequest('PUT', '/v1/event-source-mappings/' + esmId, {
body: JSON.stringify(body)
});
};

CfcClient.prototype.deleteEventSourceMapping = function (esmId) {
return this.sendRequest('DELETE', '/v1/event-source-mappings/' + esmId, {});
};


CfcClient.prototype.sendRequest = function (httpMethod, resource, varArgs) {
if (this.config.workspaceId) {
Expand Down
28 changes: 14 additions & 14 deletions dist/baidubce-sdk.bundle.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

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
@@ -1,6 +1,6 @@
{
"name": "@baiducloud/sdk",
"version": "1.0.0-rc.26",
"version": "1.0.0-rc.27",
"description": "Baidu Cloud Engine JavaScript SDK",
"main": "./index.js",
"browser": {
Expand Down

0 comments on commit 9c14a73

Please sign in to comment.