Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 18 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
# Change Log

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/).

## 1.1.1 - 2020-06-16

## 1.2.0 - 2020-06-23
### Added
- Support for the Data Integration service
- Support for updating database home IDs on databases in the Database service
- Support for backing up autonomous databases on Cloud at Customer in the Database service
- Support for managing autonomous VM clusters on Cloud at Customer in the Database service
- Support for accessing data assets via private endpoints in the Data Catalog service
- Support for dependency archive zip files to be specified for use by applications in the Data Flow service


### Breaking
- Attribute LifecycleState in the Data Catalog service has restricted values to LifecycleState ENUMs (CREATING, ACTIVE, INACTIVE, UPDATING, DELETING, DELETED, FAILED, MOVING, UNKNOWN_VALUE)
- Attribute HarvestStatus in the Data Catalog service has restricted values to HarvestStatus ENUMs (COMPLETE, ERROR, IN_PROGRESS, DEFERRED, UNKNOWN_VALUE)
- Attribute TermWorkflowStatus in the Data Catalog service has restricted values to TermWorkflowStatus ENUMs (NEW, APPROVED, UNDER_REVIEW, ESCALATED, UNKNOWN_VALUE)
- Attribute JobType in the Data Catalog service has restricted values to JobType ENUMs (HARVEST, PROFILING, SAMPLING, PREVIEW, IMPORT, EXPORT, INTERNAL, PURGE, IMMEDIATE, SCHEDULED, IMMEDIATE_EXECUTION, SCHEDULED_EXECUTION, SCHEDULED_EXECUTION_INSTANCE, UNKNOWN_VALUE)
- Attribute JobExecutionState in the Data Catalog service has restricted values to JobExecutionState ENUMs (CREATED, IN_PROGRESS, INACTIVE, FAILED, SUCCEEDED, CANCELED, UNKNOWN_VALUE)

## 1.1.1 - 2020-06-16
### Added
- Support for creating a new database from an existing database based on a given timestamp in the Database service
- Support for enabling archive log backups of databases in the Database service
- Support for returning the database version on autonomous container databases in the Database service
Expand All @@ -16,31 +30,25 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
- Support for filtering of list APIs for groups, identity providers, identity provider groups, compartments, dynamic groups, network sources, policies, and users by name or lifecycle state in the Identity Service

## 1.1.0 - 2020-06-09

### Added

- Support for returning the database version of backups in the Database service
- Support for patching on Exadata Cloud at Customer resources in the Database service
- Support for new lifecycle substates on instances in the Digital Assistant service
- Support for file servers in the Integration service
- Support for deleting non-empty tag namespaces and bulk deleting tags in the Identity service
- Support for bulk move and bulk delete of resources by compartment in the Identity service

### Breaking

### Breaking
- Parameter LifecycleState removed state OFFLINE and added DISCONNECTED in the Database service

## 1.0.2 - 2020-06-02

### Added

- Support for optionally supplying a signature when deleting an agreement in the Marketplace service
- Support for launching paid listings in non-US regions in the Marketplace service
- Support for returning the image id of packages in the Marketplace service
- Support for calling Oracle Cloud Infrastructure services in the ap-chuncheon-1 region

## 1.0.1 - 2020-05-27

### Added

- Initial Release
40 changes: 17 additions & 23 deletions examples/javascript/objectstorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

const os = require("oci-objectstorage");
const common = require("oci-common");
const st = require("stream");
const fs = require("fs");

const configurationFilePath = "~/.oci/config";
const configProfile = "DEFAULT";
Expand Down Expand Up @@ -69,21 +69,17 @@ client.region = common.Region.US_PHOENIX_1;
console.log("Get bucket executed successfully." + getBucketResponse.bucket);

// Create stream to upload
const ObjectData =
"Test Data, Test Data, Test Data, Test Data, Test Data, Test Data, Test Data, Test Data, Test Data";
const putObjectStream = new st.Readable();
putObjectStream._read = function() {};
putObjectStream.push(ObjectData);
putObjectStream.push(null); // null defines end of the stream
const fileLocation = "/Users/File/location";
const stats = fs.statSync(fileLocation);
const objectData = fs.createReadStream(fileLocation);

console.log("Bucket is created. Now adding object to the Bucket.");
const putObjectRequest = {
namespaceName: namespace,
bucketName: bucket,
putObjectBody: putObjectStream,
putObjectBody: objectData,
objectName: object,
contentLength: ObjectData.length,
contentType: "application/octet-stream"
contentLength: stats.size
};
const putObjectResponse = await client.putObject(putObjectRequest);
console.log("Put Object executed successfully" + putObjectResponse);
Expand All @@ -97,10 +93,9 @@ client.region = common.Region.US_PHOENIX_1;
const getObjectResponse = await client.getObject(getObjectRequest);
console.log("Get Object executed successfully.");

console.log(
"Upload stream and downloaded stream are same? ",
await compareStreams(putObjectStream, getObjectResponse.value)
);
const isSameStream = compareStreams(objectData, getObjectResponse.value);
console.log(`Upload stream and downloaded stream are same? ${isSameStream}`);

console.log("Delete Object");
const deleteObjectRequest = {
namespaceName: namespace,
Expand All @@ -122,17 +117,16 @@ client.region = common.Region.US_PHOENIX_1;
}
})();

async function compareStreams(stream1, stream2) {
const dataforStream1 = await streamToString(stream1);
const dataforStream2 = await streamToString(stream2);
return dataforStream1 === dataforStream2;
function compareStreams(stream1, stream2) {
return streamToString(stream1) === streamToString(stream2);
}

function streamToString(stream) {
const chunks = [];
return new Promise((resolve, reject) => {
stream.on("data", chunk => chunks.push(chunk));
stream.on("error", reject);
stream.on("end", () => resolve(Buffer.concat(chunks).toString("utf8")));
let output = "";
stream.on("data", function(data) {
output += data.toString();
});
stream.on("end", function() {
return output;
});
}
11 changes: 2 additions & 9 deletions examples/typescript/audit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/

import * as identity from "oci-identity";
import { ConfigFileReader } from "oci-common/lib/config-file-reader";
import * as audit from "oci-audit";
import common = require("oci-common");

Expand All @@ -20,14 +19,8 @@ const provider: common.ConfigFileAuthenticationDetailsProvider = new common.Conf
configurationFilePath,
configProfile
);
const config = ConfigFileReader.parseDefault(null);
const profile = config.accumulator.configurationsByProfile.get("DEFAULT");
let compartmentId = "";
if (profile) {
compartmentId = profile.get("tenancy") as string;
} else {
compartmentId = "";
}

const compartmentId = provider.getTenantId();

let identityClient: identity.IdentityClient;
let auditClient: audit.AuditClient;
Expand Down
4 changes: 0 additions & 4 deletions examples/typescript/identity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
import * as identity from "oci-identity";
import common = require("oci-common");

import { ConfigFileReader } from "oci-common/lib/config-file-reader";

const config = ConfigFileReader.parseDefault(null);

const configurationFilePath = "~/.oci/config";
const configProfile = "DEFAULT";

Expand Down
41 changes: 18 additions & 23 deletions examples/typescript/objectstorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import os = require("oci-objectstorage");
import common = require("oci-common");
import st = require("stream");
import { createReadStream, statSync } from "fs";

const configurationFilePath = "~/.oci/config";
const configProfile = "DEFAULT";
Expand Down Expand Up @@ -65,22 +66,18 @@ client.region = common.Region.US_PHOENIX_1;
const getBucketResponse = await client.getBucket(getBucketRequest);
console.log("Get bucket executed successfully." + getBucketResponse.bucket);

// Create stream to upload
const ObjectData: string =
"Test Data, Test Data, Test Data, Test Data, Test Data, Test Data, Test Data, Test Data, Test Data";
const putObjectStream = new st.Readable();
putObjectStream._read = function() {};
putObjectStream.push(ObjectData);
putObjectStream.push(null); // null defines end of the stream
// Create read stream to file
const fileLocation = "/Users/File/location";
const stats = statSync(fileLocation);
const objectData = createReadStream(fileLocation);

console.log("Bucket is created. Now adding object to the Bucket.");
const putObjectRequest: os.requests.PutObjectRequest = {
namespaceName: namespace,
bucketName: bucket,
putObjectBody: putObjectStream,
putObjectBody: objectData,
objectName: object,
contentLength: ObjectData.length,
contentType: "application/octet-stream"
contentLength: stats.size
};
const putObjectResponse = await client.putObject(putObjectRequest);
console.log("Put Object executed successfully" + putObjectResponse);
Expand All @@ -94,10 +91,9 @@ client.region = common.Region.US_PHOENIX_1;
const getObjectResponse = await client.getObject(getObjectRequest);
console.log("Get Object executed successfully.");

console.log(
"Upload stream and downloaded stream are same? ",
await compareStreams(putObjectStream, getObjectResponse.value as st.Readable)
);
const isSameStream = compareStreams(objectData, getObjectResponse.value as st.Readable);
console.log(`Upload stream and downloaded stream are same? ${isSameStream}`);

console.log("Delete Object");
const deleteObjectRequest: os.requests.DeleteObjectRequest = {
namespaceName: namespace,
Expand All @@ -119,17 +115,16 @@ client.region = common.Region.US_PHOENIX_1;
}
})();

async function compareStreams(stream1: st.Readable, stream2: st.Readable): Promise<boolean> {
const dataforStream1 = await streamToString(stream1);
const dataforStream2 = await streamToString(stream2);
return dataforStream1 === dataforStream2;
function compareStreams(stream1: st.Readable, stream2: st.Readable): boolean {
return streamToString(stream1) === streamToString(stream2);
}

function streamToString(stream: st.Readable) {
const chunks: Buffer[] = [];
return new Promise((resolve, reject) => {
stream.on("data", chunk => chunks.push(chunk));
stream.on("error", reject);
stream.on("end", () => resolve(Buffer.concat(chunks).toString("utf8")));
let output = "";
stream.on("data", function(data) {
output += data.toString();
});
stream.on("end", function() {
return output;
});
}
1 change: 1 addition & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,4 @@ export import mysql = require("oci-mysql");
export import nosql = require("oci-nosql");
export import vault = require("oci-vault");
export import secrets = require("oci-secrets");
export import dataintegration = require("oci-dataintegration");
2 changes: 1 addition & 1 deletion lib/analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oci-analytics",
"version": "1.1.1",
"version": "1.2.0",
"description": "OCI NodeJS client for Analytics Service",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion lib/announcementsservice/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oci-announcementsservice",
"version": "1.1.1",
"version": "1.2.0",
"description": "OCI NodeJS client for Announcement Service",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion lib/apigateway/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oci-apigateway",
"version": "1.1.1",
"version": "1.2.0",
"description": "OCI NodeJS client for API gateway service",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion lib/applicationmigration/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oci-applicationmigration",
"version": "1.1.1",
"version": "1.2.0",
"description": "OCI NodeJS client for Application Migration service",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion lib/audit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oci-audit",
"version": "1.1.1",
"version": "1.2.0",
"description": "OCI NodeJS client for Audit Service",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion lib/autoscaling/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oci-autoscaling",
"version": "1.1.1",
"version": "1.2.0",
"description": "OCI NodeJS client for Autoscaling Service",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion lib/bds/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oci-bds",
"version": "1.1.1",
"version": "1.2.0",
"description": "OCI NodeJS client for BDS Service",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion lib/budget/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oci-budget",
"version": "1.1.1",
"version": "1.2.0",
"description": "OCI NodeJS client for Budget Service",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion lib/cims/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oci-cims",
"version": "1.1.1",
"version": "1.2.0",
"description": "OCI NodeJS client for Cims ",
"repository": {
"type": "git",
Expand Down
8 changes: 8 additions & 0 deletions lib/common/lib/config-file-reader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,21 @@ export class ConfigFileReader {
* @throws Error, if the file could not be read.
*/
static parseDefault(profile: string | null): ConfigFile {
const envVarConfigFile: string | undefined = process.env.OCI_CONFIG_FILE;

// Check if file exists in the location
const defaultExists = ConfigFileReader.fileExists(ConfigFileReader.DEFAULT_FILE_PATH);
const fallbackExists = ConfigFileReader.fileExists(ConfigFileReader.FALLBACK_DEFAULT_FILE_PATH);
let configFileFromEnvVarExists = false;
if (envVarConfigFile) {
configFileFromEnvVarExists = ConfigFileReader.fileExists(envVarConfigFile);
}

// If default file exists, assign effecive file as default file, else fallback as effective file
if (defaultExists) {
return ConfigFileReader.parseFileFromPath(ConfigFileReader.DEFAULT_FILE_PATH, profile);
} else if (configFileFromEnvVarExists) {
return ConfigFileReader.parseFileFromPath(envVarConfigFile!, profile);
} else if (fallbackExists) {
return ConfigFileReader.parseFileFromPath(
ConfigFileReader.FALLBACK_DEFAULT_FILE_PATH,
Expand Down
2 changes: 1 addition & 1 deletion lib/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oci-common",
"version": "1.1.1",
"version": "1.2.0",
"description": "OCI Common module for NodeJS",
"repository": {
"type": "git",
Expand Down
Loading