Socket
Socket
Sign inDemoInstall

@ibm-cloud/ibm-code-engine-sdk

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ibm-cloud/ibm-code-engine-sdk - npm Package Compare versions

Comparing version 4.1.0 to 4.6.0

12

dist/package.json
{
"name": "@ibm-cloud/ibm-code-engine-sdk",
"version": "4.1.0",
"version": "4.6.0",
"description": "IBM Cloud Code Engine NodeJS SDK",

@@ -38,3 +38,3 @@ "repository": {

"engines": {
"node": ">=14.0.0"
"node": ">=18.0.0"
},

@@ -44,9 +44,9 @@ "dependencies": {

"extend": "^3.0.2",
"ibm-cloud-sdk-core": "^4.0.3"
"ibm-cloud-sdk-core": "^5.0.0"
},
"devDependencies": {
"@ibm-cloud/sdk-test-utilities": "^1.0.0",
"@masterodin/publisher": "^0.10.0",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"axios": "^1.0.0",
"dotenv": "^16.0.0",

@@ -58,7 +58,7 @@ "eslint": "^7.26.0",

"eslint-plugin-import": "^2.23.2",
"eslint-plugin-jest": "^24.3.6",
"eslint-plugin-jest": "^28.0.0",
"eslint-plugin-jsdoc": "^34.6.3",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-prettier": "^3.0.1",
"installed-check": "^8.0.0",
"installed-check": "^9.0.0",
"jest": "^29.3.1",

@@ -65,0 +65,0 @@ "nock": "^13.2.4",

@@ -64,3 +64,5 @@ /**

codeEngineService = CodeEngineV2.newInstance();
codeEngineService = CodeEngineV2.newInstance({
version: '2024-08-04',
});

@@ -403,2 +405,37 @@ // end-common

test('listAppInstances request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('listAppInstances() result:');
// begin-list_app_instances
const params = {
projectId: '15314cc3-85b4-4338-903f-c28cdee6d005',
appName: 'my-app',
limit: 100,
};
const allResults = [];
try {
const pager = new CodeEngineV2.AppInstancesPager(codeEngineService, params);
while (pager.hasNext()) {
const nextPage = await pager.getNext();
expect(nextPage).not.toBeNull();
allResults.push(...nextPage);
}
console.log(JSON.stringify(allResults, null, 2));
} catch (err) {
console.warn(err);
}
// end-list_app_instances
});
test('listJobs request example', async () => {

@@ -619,2 +656,150 @@ consoleLogMock.mockImplementation((output) => {

test('listFunctionRuntimes request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('listFunctionRuntimes() result:');
// begin-list_function_runtimes
let res;
try {
res = await codeEngineService.listFunctionRuntimes({});
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-list_function_runtimes
});
test('listFunctions request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('listFunctions() result:');
// begin-list_functions
const params = {
projectId: '15314cc3-85b4-4338-903f-c28cdee6d005',
limit: 100,
};
const allResults = [];
try {
const pager = new CodeEngineV2.FunctionsPager(codeEngineService, params);
while (pager.hasNext()) {
const nextPage = await pager.getNext();
expect(nextPage).not.toBeNull();
allResults.push(...nextPage);
}
console.log(JSON.stringify(allResults, null, 2));
} catch (err) {
console.warn(err);
}
// end-list_functions
});
test('createFunction request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('createFunction() result:');
// begin-create_function
const params = {
projectId: '15314cc3-85b4-4338-903f-c28cdee6d005',
codeReference: 'data:text/plain;base64,<base64encoded-source-code>',
name: 'my-function',
runtime: 'nodejs-18',
};
let res;
try {
res = await codeEngineService.createFunction(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-create_function
});
test('getFunction request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('getFunction() result:');
// begin-get_function
const params = {
projectId: '15314cc3-85b4-4338-903f-c28cdee6d005',
name: 'my-function',
};
let res;
try {
res = await codeEngineService.getFunction(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-get_function
});
test('updateFunction request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('updateFunction() result:');
// begin-update_function
const params = {
projectId: '15314cc3-85b4-4338-903f-c28cdee6d005',
name: 'my-function',
ifMatch: 'testString',
};
let res;
try {
res = await codeEngineService.updateFunction(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-update_function
});
test('listBindings request example', async () => {

@@ -939,3 +1124,3 @@ consoleLogMock.mockImplementation((output) => {

test('listConfigMaps request example', async () => {
test('listDomainMappings request example', async () => {
consoleLogMock.mockImplementation((output) => {

@@ -950,4 +1135,4 @@ originalLog(output);

originalLog('listConfigMaps() result:');
// begin-list_config_maps
originalLog('listDomainMappings() result:');
// begin-list_domain_mappings

@@ -961,3 +1146,3 @@ const params = {

try {
const pager = new CodeEngineV2.ConfigMapsPager(codeEngineService, params);
const pager = new CodeEngineV2.DomainMappingsPager(codeEngineService, params);
while (pager.hasNext()) {

@@ -973,6 +1158,6 @@ const nextPage = await pager.getNext();

// end-list_config_maps
// end-list_domain_mappings
});
test('createConfigMap request example', async () => {
test('createDomainMapping request example', async () => {
consoleLogMock.mockImplementation((output) => {

@@ -987,8 +1172,18 @@ originalLog(output);

originalLog('createConfigMap() result:');
// begin-create_config_map
originalLog('createDomainMapping() result:');
// begin-create_domain_mapping
// Request models needed by this operation.
// ComponentRef
const componentRefModel = {
name: 'my-app-1',
resource_type: 'app_v2',
};
const params = {
projectId: '15314cc3-85b4-4338-903f-c28cdee6d005',
name: 'my-config-map',
component: componentRefModel,
name: 'www.example.com',
tlsSecret: 'my-tls-secret',
};

@@ -998,3 +1193,3 @@

try {
res = await codeEngineService.createConfigMap(params);
res = await codeEngineService.createDomainMapping(params);
console.log(JSON.stringify(res.result, null, 2));

@@ -1005,6 +1200,6 @@ } catch (err) {

// end-create_config_map
// end-create_domain_mapping
});
test('getConfigMap request example', async () => {
test('getDomainMapping request example', async () => {
consoleLogMock.mockImplementation((output) => {

@@ -1019,8 +1214,8 @@ originalLog(output);

originalLog('getConfigMap() result:');
// begin-get_config_map
originalLog('getDomainMapping() result:');
// begin-get_domain_mapping
const params = {
projectId: '15314cc3-85b4-4338-903f-c28cdee6d005',
name: 'my-config-map',
name: 'www.example.com',
};

@@ -1030,3 +1225,3 @@

try {
res = await codeEngineService.getConfigMap(params);
res = await codeEngineService.getDomainMapping(params);
console.log(JSON.stringify(res.result, null, 2));

@@ -1037,6 +1232,6 @@ } catch (err) {

// end-get_config_map
// end-get_domain_mapping
});
test('replaceConfigMap request example', async () => {
test('updateDomainMapping request example', async () => {
consoleLogMock.mockImplementation((output) => {

@@ -1051,8 +1246,8 @@ originalLog(output);

originalLog('replaceConfigMap() result:');
// begin-replace_config_map
originalLog('updateDomainMapping() result:');
// begin-update_domain_mapping
const params = {
projectId: '15314cc3-85b4-4338-903f-c28cdee6d005',
name: 'my-config-map',
name: 'www.example.com',
ifMatch: 'testString',

@@ -1063,3 +1258,3 @@ };

try {
res = await codeEngineService.replaceConfigMap(params);
res = await codeEngineService.updateDomainMapping(params);
console.log(JSON.stringify(res.result, null, 2));

@@ -1070,6 +1265,6 @@ } catch (err) {

// end-replace_config_map
// end-update_domain_mapping
});
test('listSecrets request example', async () => {
test('listConfigMaps request example', async () => {
consoleLogMock.mockImplementation((output) => {

@@ -1084,4 +1279,4 @@ originalLog(output);

originalLog('listSecrets() result:');
// begin-list_secrets
originalLog('listConfigMaps() result:');
// begin-list_config_maps

@@ -1095,3 +1290,3 @@ const params = {

try {
const pager = new CodeEngineV2.SecretsPager(codeEngineService, params);
const pager = new CodeEngineV2.ConfigMapsPager(codeEngineService, params);
while (pager.hasNext()) {

@@ -1107,6 +1302,6 @@ const nextPage = await pager.getNext();

// end-list_secrets
// end-list_config_maps
});
test('createSecret request example', async () => {
test('createConfigMap request example', async () => {
consoleLogMock.mockImplementation((output) => {

@@ -1121,9 +1316,8 @@ originalLog(output);

originalLog('createSecret() result:');
// begin-create_secret
originalLog('createConfigMap() result:');
// begin-create_config_map
const params = {
projectId: '15314cc3-85b4-4338-903f-c28cdee6d005',
format: 'generic',
name: 'my-secret',
name: 'my-config-map',
};

@@ -1133,3 +1327,3 @@

try {
res = await codeEngineService.createSecret(params);
res = await codeEngineService.createConfigMap(params);
console.log(JSON.stringify(res.result, null, 2));

@@ -1140,6 +1334,6 @@ } catch (err) {

// end-create_secret
// end-create_config_map
});
test('getSecret request example', async () => {
test('getConfigMap request example', async () => {
consoleLogMock.mockImplementation((output) => {

@@ -1154,8 +1348,8 @@ originalLog(output);

originalLog('getSecret() result:');
// begin-get_secret
originalLog('getConfigMap() result:');
// begin-get_config_map
const params = {
projectId: '15314cc3-85b4-4338-903f-c28cdee6d005',
name: 'my-secret',
name: 'my-config-map',
};

@@ -1165,3 +1359,3 @@

try {
res = await codeEngineService.getSecret(params);
res = await codeEngineService.getConfigMap(params);
console.log(JSON.stringify(res.result, null, 2));

@@ -1172,6 +1366,6 @@ } catch (err) {

// end-get_secret
// end-get_config_map
});
test('replaceSecret request example', async () => {
test('replaceConfigMap request example', async () => {
consoleLogMock.mockImplementation((output) => {

@@ -1186,10 +1380,9 @@ originalLog(output);

originalLog('replaceSecret() result:');
// begin-replace_secret
originalLog('replaceConfigMap() result:');
// begin-replace_config_map
const params = {
projectId: '15314cc3-85b4-4338-903f-c28cdee6d005',
name: 'my-secret',
name: 'my-config-map',
ifMatch: 'testString',
format: 'generic',
};

@@ -1199,3 +1392,3 @@

try {
res = await codeEngineService.replaceSecret(params);
res = await codeEngineService.replaceConfigMap(params);
console.log(JSON.stringify(res.result, null, 2));

@@ -1206,6 +1399,6 @@ } catch (err) {

// end-replace_secret
// end-replace_config_map
});
test('listDomainMappings request example', async () => {
test('listSecrets request example', async () => {
consoleLogMock.mockImplementation((output) => {

@@ -1220,4 +1413,4 @@ originalLog(output);

originalLog('listDomainMappings() result:');
// begin-list_domain_mappings
originalLog('listSecrets() result:');
// begin-list_secrets

@@ -1231,3 +1424,3 @@ const params = {

try {
const pager = new CodeEngineV2.DomainMappingsPager(codeEngineService, params);
const pager = new CodeEngineV2.SecretsPager(codeEngineService, params);
while (pager.hasNext()) {

@@ -1243,6 +1436,6 @@ const nextPage = await pager.getNext();

// end-list_domain_mappings
// end-list_secrets
});
test('createDomainMapping request example', async () => {
test('createSecret request example', async () => {
consoleLogMock.mockImplementation((output) => {

@@ -1257,18 +1450,9 @@ originalLog(output);

originalLog('createDomainMapping() result:');
// begin-create_domain_mapping
originalLog('createSecret() result:');
// begin-create_secret
// Request models needed by this operation.
// ComponentRef
const componentRefModel = {
name: 'my-app-1',
resource_type: 'app_v2',
};
const params = {
projectId: '15314cc3-85b4-4338-903f-c28cdee6d005',
component: componentRefModel,
name: 'www.example.com',
tlsSecret: 'my-tls-secret',
format: 'generic',
name: 'my-secret',
};

@@ -1278,3 +1462,3 @@

try {
res = await codeEngineService.createDomainMapping(params);
res = await codeEngineService.createSecret(params);
console.log(JSON.stringify(res.result, null, 2));

@@ -1285,6 +1469,6 @@ } catch (err) {

// end-create_domain_mapping
// end-create_secret
});
test('getDomainMapping request example', async () => {
test('getSecret request example', async () => {
consoleLogMock.mockImplementation((output) => {

@@ -1299,8 +1483,8 @@ originalLog(output);

originalLog('getDomainMapping() result:');
// begin-get_domain_mapping
originalLog('getSecret() result:');
// begin-get_secret
const params = {
projectId: '15314cc3-85b4-4338-903f-c28cdee6d005',
name: 'www.example.com',
name: 'my-secret',
};

@@ -1310,3 +1494,3 @@

try {
res = await codeEngineService.getDomainMapping(params);
res = await codeEngineService.getSecret(params);
console.log(JSON.stringify(res.result, null, 2));

@@ -1317,6 +1501,6 @@ } catch (err) {

// end-get_domain_mapping
// end-get_secret
});
test('updateDomainMapping request example', async () => {
test('replaceSecret request example', async () => {
consoleLogMock.mockImplementation((output) => {

@@ -1331,9 +1515,10 @@ originalLog(output);

originalLog('updateDomainMapping() result:');
// begin-update_domain_mapping
originalLog('replaceSecret() result:');
// begin-replace_secret
const params = {
projectId: '15314cc3-85b4-4338-903f-c28cdee6d005',
name: 'www.example.com',
name: 'my-secret',
ifMatch: 'testString',
format: 'generic',
};

@@ -1343,3 +1528,3 @@

try {
res = await codeEngineService.updateDomainMapping(params);
res = await codeEngineService.replaceSecret(params);
console.log(JSON.stringify(res.result, null, 2));

@@ -1350,3 +1535,3 @@ } catch (err) {

// end-update_domain_mapping
// end-replace_secret
});

@@ -1484,2 +1669,28 @@

test('deleteFunction request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
// begin-delete_function
const params = {
projectId: '15314cc3-85b4-4338-903f-c28cdee6d005',
name: 'my-function',
};
try {
await codeEngineService.deleteFunction(params);
} catch (err) {
console.warn(err);
}
// end-delete_function
});
test('deleteBinding request example', async () => {

@@ -1563,3 +1774,3 @@ consoleLogMock.mockImplementation((output) => {

test('deleteConfigMap request example', async () => {
test('deleteDomainMapping request example', async () => {
consoleLogMock.mockImplementation((output) => {

@@ -1574,11 +1785,11 @@ originalLog(output);

// begin-delete_config_map
// begin-delete_domain_mapping
const params = {
projectId: '15314cc3-85b4-4338-903f-c28cdee6d005',
name: 'my-config-map',
name: 'www.example.com',
};
try {
await codeEngineService.deleteConfigMap(params);
await codeEngineService.deleteDomainMapping(params);
} catch (err) {

@@ -1588,6 +1799,6 @@ console.warn(err);

// end-delete_config_map
// end-delete_domain_mapping
});
test('deleteSecret request example', async () => {
test('deleteConfigMap request example', async () => {
consoleLogMock.mockImplementation((output) => {

@@ -1602,11 +1813,11 @@ originalLog(output);

// begin-delete_secret
// begin-delete_config_map
const params = {
projectId: '15314cc3-85b4-4338-903f-c28cdee6d005',
name: 'my-secret',
name: 'my-config-map',
};
try {
await codeEngineService.deleteSecret(params);
await codeEngineService.deleteConfigMap(params);
} catch (err) {

@@ -1616,6 +1827,6 @@ console.warn(err);

// end-delete_secret
// end-delete_config_map
});
test('deleteDomainMapping request example', async () => {
test('deleteSecret request example', async () => {
consoleLogMock.mockImplementation((output) => {

@@ -1630,11 +1841,11 @@ originalLog(output);

// begin-delete_domain_mapping
// begin-delete_secret
const params = {
projectId: '15314cc3-85b4-4338-903f-c28cdee6d005',
name: 'www.example.com',
name: 'my-secret',
};
try {
await codeEngineService.deleteDomainMapping(params);
await codeEngineService.deleteSecret(params);
} catch (err) {

@@ -1644,4 +1855,4 @@ console.warn(err);

// end-delete_domain_mapping
// end-delete_secret
});
});
{
"name": "@ibm-cloud/ibm-code-engine-sdk",
"version": "4.1.0",
"version": "4.6.0",
"description": "IBM Cloud Code Engine NodeJS SDK",

@@ -38,3 +38,3 @@ "repository": {

"engines": {
"node": ">=14.0.0"
"node": ">=18.0.0"
},

@@ -44,9 +44,9 @@ "dependencies": {

"extend": "^3.0.2",
"ibm-cloud-sdk-core": "^4.0.3"
"ibm-cloud-sdk-core": "^5.0.0"
},
"devDependencies": {
"@ibm-cloud/sdk-test-utilities": "^1.0.0",
"@masterodin/publisher": "^0.10.0",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"axios": "^1.0.0",
"dotenv": "^16.0.0",

@@ -58,7 +58,7 @@ "eslint": "^7.26.0",

"eslint-plugin-import": "^2.23.2",
"eslint-plugin-jest": "^24.3.6",
"eslint-plugin-jest": "^28.0.0",
"eslint-plugin-jsdoc": "^34.6.3",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-prettier": "^3.0.1",
"installed-check": "^8.0.0",
"installed-check": "^9.0.0",
"jest": "^29.3.1",

@@ -65,0 +65,0 @@ "nock": "^13.2.4",

@@ -1,7 +0,6 @@

[![Build Status](https://travis-ci.com/IBM/code-engine-node-sdk.svg?branch=main)](https://travis-ci.com/IBM/code-engine-node-sdk)
<!--
[![Build Status](https://travis-ci.com/IBM/code-engine-node-sdk.svg?token=eW5FVD71iyte6tTby8gr&branch=master)](https://travis.ibm.com/IBM/code-engine-node-sdk)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![codecov](https://codecov.io/gh/IBM/code-engine-node-sdk/branch/main/graph/badge.svg)](https://codecov.io/gh/IBM/code-engine-node-sdk)
<!--[![npm-version](https://img.shields.io/npm/v/IBM/ibm-code-engine-node-sdk.svg)](https://www.npmjs.com/package/ibm-code-engine-sdk)
[![npm-version](https://img.shields.io/npm/v/IBM/code-engine-node-sdk.svg)](https://www.npmjs.com/package/code-engine-sdk)
[![codecov](https://codecov.io/gh/IBM/code-engine-node-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/IBM/code-engine-node-sdk)
-->

@@ -25,13 +24,11 @@ # NodeJS SDK for IBM Cloud Code Engine

- [NodeJS SDK for IBM Cloud Code Engine](#nodejs-sdk-for-ibm-cloud-code-engine)
- [Table of Contents](#table-of-contents)
- [Overview](#overview)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Using the SDK](#using-the-sdk)
- [Questions](#questions)
- [Issues](#issues)
- [Open source @ IBM](#open-source--ibm)
- [Contributing](#contributing)
- [License](#license)
- [Overview](#overview)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Using the SDK](#using-the-sdk)
- [Questions](#questions)
- [Issues](#issues)
- [Open source @ IBM](#open-source--ibm)
- [Contributing](#contributing)
- [License](#license)

@@ -38,0 +35,0 @@ <!-- tocstop -->

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc