Registry / devops / oci-functions

oci-functions

JSON →
library2.132.0jsnpmunverified

OCI NodeJS client for the Oracle Cloud Infrastructure Functions service. Current stable version is 2.132.0, released as part of the OCI TypeScript SDK. This module enables management of Functions resources (applications, functions) and invocation of functions. Key differentiators: official Oracle SDK, full TypeScript support, supports API key and instance principal authentication. Requires OCI account, user with appropriate policies, and a key pair for signing API requests. Release cadence follows the OCI TypeScript SDK releases.

npm install oci-functions
INSTALL
IMPORT
SIG · OCI-FUNCTIONS
O
oci-functions
devopsjavascriptv2.132.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FunctionsManagementClient
import { FunctionsManagementClient } from 'oci-functions'
const FunctionsManagementClient = require('oci-functions').FunctionsManagementClient; // Works but not tree-shakable
ESM import recommended. The client is used for CRUD operations on applications and functions.
FunctionsInvokeClient
import { FunctionsInvokeClient } from 'oci-functions'
ESM import. Used to invoke functions. Requires different endpoint configuration than management client.
models
import * as models from 'oci-functions/lib/model'
import { models } from 'oci-functions' // Does not export models as a top-level named export
Models are exported under the 'lib/model' path. Access types like models.CreateFunctionDetails.

Demonstrates initialization of FunctionsManagementClient with authentication provider from oci-common and listing applications.

import { FunctionsManagementClient } from 'oci-functions'; import { Region, SimpleAuthenticationDetailsProvider } from 'oci-common'; const provider = new SimpleAuthenticationDetailsProvider( 'ocid1.tenancy.oc1..example', 'ocid1.user.oc1..example', 'your-api-key-fingerprint', 'path-to-private-key.pem', Region.US_PHOENIX_1 ); const client = new FunctionsManagementClient({ authenticationDetailsProvider: provider }); async function listApplications(compartmentId: string) { const response = await client.listApplications({ compartmentId }); console.log(response.items); }
Debug
Known issues
breakingClient constructors require explicit region or endpoint configuration; default region is not assumed.
fix
Always pass Region enum value or set endpoint via setEndpoint() after construction.
affects: >=2.0.0
deprecatedOCI SDK v1 authentication pattern (using ConfigFileAuthenticationDetailsProvider) is deprecated in favor of SimpleAuthenticationDetailsProvider.
fix
Use SimpleAuthenticationDetailsProvider or ResourcePrincipalAuthenticationDetailsProvider for newer versions.
affects: >=2.0.0
gotchaThe FunctionsInvokeClient requires a different endpoint than FunctionsManagementClient; using management endpoint for invocation will fail.
fix
Set the invoke endpoint to the function's invoke endpoint (e.g., https://<region>.functions.oraclecloud.com).
affects: >=2.0.0
gotchaTypeScript definitions are not exported under the main module; models and request types are under 'oci-functions/lib/model'.
fix
Import types from 'oci-functions/lib/model' or use deep import paths.
affects: >=2.0.0
breakingAs of v2, default export is no longer available; use named exports.
fix
Replace import OciFunctions from 'oci-functions' with import { FunctionsManagementClient } from 'oci-functions'.
affects: >=2.0.0
Errors
Common errors & fixes
Error: A region must be specified when building the client
Client created without setting region via Region enum or setEndpoint().
fix
Pass Region enum to client constructor or call client.setEndpoint() before making API calls.
TypeError: oci_functions_1.default is not a constructor
Using default import (import OciFunctions from 'oci-functions') which is not available in v2.
fix
Use named import: import { FunctionsManagementClient } from 'oci-functions'.
Module not found: Can't resolve 'oci-functions/lib/model'
Using incorrect import path for models; models are under 'oci-functions/lib/model' but bundler may not resolve due to deep imports.
fix
Ensure your bundler supports deep imports, or import root and access models via index if available.
Error: Invalid provider. Ensure you have set up authentication correctly.
Authentication details provider not properly configured or missing required parameters.
fix
Provide tenantId, userId, fingerprint, privateKeyPath/privateKey string, and region to SimpleAuthenticationDetailsProvider.
Upgrade
Version history
2.132.0latest on npm
Audit
Dependencies
oci-commonrequiredCore module providing authentication, HTTP handling, and common utilities required by all OCI service clients.
Agent activity
6 hits · last 30 days
node
6
Resources
oci-functions — npm install oci-functions · libregistry