Gathering detailed insights and metrics for @serverless/platform-sdk
Gathering detailed insights and metrics for @serverless/platform-sdk
Gathering detailed insights and metrics for @serverless/platform-sdk
Gathering detailed insights and metrics for @serverless/platform-sdk
npm install @serverless/platform-sdk
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
17 Stars
314 Commits
7 Forks
24 Watching
17 Branches
15 Contributors
Updated on 08 Sept 2023
Minified
Minified + Gzipped
JavaScript (99%)
Shell (0.59%)
Dockerfile (0.41%)
Cumulative downloads
Total Downloads
Last day
-13.1%
6,224
Compared to previous day
Last week
-0.2%
46,689
Compared to previous week
Last month
40.4%
161,975
Compared to previous month
Last year
-55.2%
1,781,214
Compared to previous year
14
Note: This package is deprecated in favor of @serverless/platform-client. It accepts only bug fixes
Functional SDK for the Serverless Platfrom.
npm i -s @serverless/platform-sdk
login
Opens a browser for the user to login, along with a running server awaiting auth data once the user logs in.
Parameters
None
Returns
Promise resolving to the following object:
username
- string
- dashboard usernameaccessToken
- string
- Auth0 access tokenidToken
- string
- Auth0 idTokenrefreshToken
- string
- Auth0 refreshTokenexpiresAt
- string
- epoch time at which the idToken expiresExample
1const { login } = require('@serverless/platform-sdk') 2 3const { username, accessToken, idToken, expiresAt } = await login()
refreshToken
Refreshes Auth0 idToken
Parameters
refresh token string
Returns
Promise resolving to the following object:
id_token
- string
- new Auth0 id tokenaccess_token
- string
- new Auth0 access tokenexpires_in
- string
- number of seconds until token expirationExample
1const { refreshToken } = require('@serverless/platform-sdk') 2 3const { id_token, access_token, expires_in } = await refreshToken('some-refresh-token')
createAccessKey
Creates a platform access key for the authenticated user.
Parameters
Object
username
- string
- dashboard usernametenant
- string
- dashboard tenantidToken
- string
- Auth0 idTokentitle
- string
- title of the access keyReturns
Promise resolving to an accessKey
string, that is the access key.
Example
1const { createAccessKey } = require('@serverless/platform-sdk') 2 3const data = { 4 username: 'eahefnawy', 5 tenant: 'eahefnawy', 6 idToken: 'abc', 7 title: 'Framework' 8} 9 10const accessKey = await createAccessKey(data)
archiveService
Archives a service in the platform.
Parameters
Object
tenant
- string
- dashboard tenantaccessKey
- string
- dashboard access keyapp
- string
- service appname
- string
- service nameprovider
- string
- provider nameregion
- string
- region nameReturns
None
Example
1const { archiveService } = require('@serverless/platform-sdk') 2 3const data = { 4 tenant: 'eahefnawy', 5 accessKey: 'abc', 6 app: 'my-app', 7 name: 'my-service', 8 provider: 'aws', 9 region: 'us-east-1' 10} 11 12await archiveService(data)
getServiceUrl
Constructs a service url based on passed-in data.
Parameters
Object
tenant
- string
- dashboard tenantapp
- string
- service appname
- string
- service nameReturns
The service url string.
Example
1const { getServiceUrl } = require('@serverless/platform-sdk') 2 3const data = { 4 tenant: 'eahefnawy', 5 app: 'my-app', 6 name: 'my-service' 7} 8 9const serviceUrl = getServiceUrl(data)
listTenants
Lists the tenants for a given username
Parameters
Object
username
- string
- dashboard usernameidToken
- string
- auth0 user id tokenReturns
Array of objects, each represents a single tenant data model.
Example
1const { listTenants } = require('@serverless/platform-sdk') 2 3const data = { 4 username: 'eahefnawy', 5 idToken: 'abc' 6} 7 8const tenants = await listTenants(data)
createDeploymnet
Creates a platform deployment
Parameters
Object
tenant
- string
- dashboard tenant nameapp
- string
- app nameserviceName
- string
- service nameaccessKey
- string
- dashboard access keyfiles
- object
- files which should be stored in the Platforms deployment recordReturns
Object - Deployment model
Example
1const { createDeployment } = require('@serverless/platform-sdk') 2 3const data = { 4 tenant: 'eahefnawy', 5 app: 'my-app', 6 serviceName: 'my-service', 7 accessKey: 'abc', 8 files: { 9 'serverless-state.json': { 10 //...snip... 11 } 12 } 13} 14 15const { id } = await createDeployment(data)
updateDeployment
Updates a platform deployment
Parameters
Object
tenant
- string
- dashboard tenant nameapp
- string
- app nameserviceName
- string
- service namedeploymentId
- string
- id of the previously created deploymentstatus
- string
- status of the deployment to updateaccessKey
- string
- dashboard access keycomputedData
- object
- computed data the Platform needs to generate the state itemsReturns
Object - Deployment model
Example
1const { updateDeployment } = require('@serverless/platform-sdk') 2 3const data = { 4 tenant: 'eahefnawy', 5 app: 'my-app', 6 serviceName: 'my-service', 7 deploymentId: 'abc', 8 status: 'failed', 9 accessKey: 'abc', 10 computedData: { 11 // ...snip... 12 } 13} 14 15const { id } = await updateDeployment(data)
getApp
Gets a platform app
Parameters
Object
tenant
- string
- dashboard tenant nameapp
- string
- app nametoken
- string
- Auth0 id tokenReturns
Object - App model
Example
1const { getApp } = require('@serverless/platform-sdk') 2 3const data = { 4 tenant: 'eahefnawy', 5 app: 'my-app', 6 token: 'abc' 7} 8 9const app = await getApp(data)
createApp
Creates a platform app
Parameters
Object
tenant
- string
- dashboard tenant nameapp
- string
- app nametoken
- string
- Auth0 id tokenReturns
Object - App model
Example
1const { createApp } = require('@serverless/platform-sdk') 2 3const data = { 4 tenant: 'eahefnawy', 5 app: 'my-app', 6 token: 'abc' 7} 8 9const app = await createApp(data)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 9/13 approved changesets -- score normalized to 6
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More