Skip to content

Commit

Permalink
fix more runtime links and update repo node and yarn versions (#331)
Browse files Browse the repository at this point in the history
* fix runtime links

* update docs for yarn v4.1.1
  • Loading branch information
MichaelGoberling committed Apr 23, 2024
1 parent 4318597 commit 3c84181
Show file tree
Hide file tree
Showing 12 changed files with 7,297 additions and 7,183 deletions.
783 changes: 0 additions & 783 deletions .yarn/releases/yarn-3.2.2.cjs

This file was deleted.

893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.1.1.cjs

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions .yarnrc.yml
@@ -1,3 +1,7 @@
---
compressionLevel: mixed

enableGlobalCache: false

nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-3.2.2.cjs

yarnPath: .yarn/releases/yarn-4.1.1.cjs
14 changes: 7 additions & 7 deletions README.md
Expand Up @@ -11,12 +11,12 @@ Note, this is not the full site, and this url is not shared. This is a very qui

The slack channel #adobeio-onsite-onboarding is our main point of contact for help. Feel free to join the channel and ask any questions.

## Prerequisite: Install Yarn 3
## Prerequisite: Install Yarn 4

This site uses Yarn 3 to manage package dependencies. If you do not have Yarn 3 installed, follow these instructions:
This site uses Yarn 4 to manage package dependencies. If you do not have Yarn 4 installed, follow these instructions:

1. Install [Node.js LTS](https://nodejs.org/en/download/). At the time of writing, the latest LTS version is `v16.15.1`.
2. Install Yarn 3 by running the following command:
1. Install [Node.js LTS](https://nodejs.org/en/download/). At the time of writing, the latest LTS version is `v20.12.2`.
2. Install Yarn 4 by running the following command:

```bash
corepack enable
Expand All @@ -30,13 +30,13 @@ Corepack is a binary shipped with all Node.js releases starting from 16.10.
yarn set version stable
```

4. Make sure you are now using version 3.2.2 of Yarn:.
4. Make sure you are now using version 4.1.1 of Yarn:.

```bash
yarn --version
```

That's it. For more information on Yarn 3 usage, see [Yarn usage](https://yarnpkg.com/getting-started/usage).
That's it. For more information on Yarn 4 usage, see [Yarn usage](https://yarnpkg.com/getting-started/usage).

For the documentation developer, please read these sections on how to:

Expand All @@ -50,7 +50,7 @@ For the documentation developer, please read these sections on how to:

## How to build the site locally

After installing `yarn` v3 as noted above, you can develop locally by running the following commands:
After installing `yarn` v4 as noted above, you can develop locally by running the following commands:

1. Install the dependencies:

Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -34,7 +34,7 @@
"remark-validate-links"
]
},
"packageManager": "yarn@3.2.2",
"packageManager": "yarn@4.1.1",
"devDependencies": {
"remark-cli": "^11.0.0",
"remark-validate-links": "^12.1.0"
Expand Down
2 changes: 1 addition & 1 deletion src/pages/getting_started/common_troubleshooting.md
Expand Up @@ -33,7 +33,7 @@ You could also try [openwhisk-wskdebug](https://github.com/apache/openwhisk-wskd

## Action logs

When you have [web actions](/apis/experienceplatform/runtime/docs#!adobedocs/adobeio-runtime/master/guides/creating_actions.md#invoking-web-actions) in your app, they are blocking requests and their activation results are not recorded if they are invoked successfully. To enforce the persistence of activation results, you need to pass the `x-ow-extra-logging: on` flag in the request headers. In the development mode of an SPA, you can add this flag directly to the "invoking action" function so that you will have the activation results and logs recorded for all requests. Then they could be retrieved as demonstrated in the [General debugging](#general-debugging) section above.
When you have [web actions](/runtime/docs/guides/using/creating_actions/#invoking-web-actions) in your app, they are blocking requests and their activation results are not recorded if they are invoked successfully. To enforce the persistence of activation results, you need to pass the `x-ow-extra-logging: on` flag in the request headers. In the development mode of an SPA, you can add this flag directly to the "invoking action" function so that you will have the activation results and logs recorded for all requests. Then they could be retrieved as demonstrated in the [General debugging](#general-debugging) section above.

```javascript
headers['x-ow-extra-logging'] = 'on'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/guides/tips_tricks.md
Expand Up @@ -32,7 +32,7 @@ When you test this functionality for web action using Postman or web browser wit

## Returning Large Response Payload

You can return a [response payload of max 1MB](/apis/experienceplatform/runtime/docs#!adobedocs/adobeio-runtime/master/guides/system_settings.md) in an Adobe I/O Runtime action. That is more than enough for the majority of the use cases we have seen so far. However, if your action would return a larger payload than the 1MB limit, we provide a scalable solution with [App Builder Files SDK](https://github.com/adobe/aio-lib-files). It allows you to [persist a binary file to the blob storage](https://github.com/adobe/aio-lib-files/blob/master/doc/api.md#Files+write), obtain [a temporary downloadable URL](https://github.com/adobe/aio-lib-files/blob/master/doc/api.md#Files+generatePresignURL) and return an [HTTP Redirect response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302) to the file with this URL. Below is a simple code snippet to demonstrate that.
You can return a [response payload of max 1MB](/runtime/docs/guides/using/system_settings/) in an Adobe I/O Runtime action. That is more than enough for the majority of the use cases we have seen so far. However, if your action would return a larger payload than the 1MB limit, we provide a scalable solution with [App Builder Files SDK](https://github.com/adobe/aio-lib-files). It allows you to [persist a binary file to the blob storage](https://github.com/adobe/aio-lib-files/blob/master/doc/api.md#Files+write), obtain [a temporary downloadable URL](https://github.com/adobe/aio-lib-files/blob/master/doc/api.md#Files+generatePresignURL) and return an [HTTP Redirect response](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302) to the file with this URL. Below is a simple code snippet to demonstrate that.

```javascript
const fileLocation = '/private-dir/large-image.png'
Expand Down
8 changes: 4 additions & 4 deletions src/pages/resources/customer-dashboard/lesson2.md
Expand Up @@ -33,7 +33,7 @@ runtimeManifest:
get-profiles:
function: actions/get-profiles/index.js
web: 'yes'
runtime: 'nodejs:14'
runtime: 'nodejs:18'
inputs:
LOG_LEVEL: debug
tenant: $CAMPAIGN_STANDARD_TENANT
Expand All @@ -45,9 +45,9 @@ runtimeManifest:

Currently your app only has one action `get-profiles`.
* Source code is at `src/dx-excshell-1/actions/get-profiles/index.js`
* It is a [web action](/apis/experienceplatform/runtime/docs.html#!adobedocs/adobeio-runtime/master/guides/creating_actions.md#invoking-actions)
* The action will be run in the `nodejs:12` [runtime container on I/O Runtime](/apis/experienceplatform/runtime/docs.html#!adobedocs/adobeio-runtime/master/reference/runtimes.md)
* It has some [default params](/apis/experienceplatform/runtime/docs.html#!adobedocs/adobeio-runtime/master/guides/creating_actions.md#working-with-parameters) such as `LOG_LEVEL`, `tenant`, `apiKey`, which are automatically available in the `params` object of the action without passing it to the action for every invocation. The `final` annotation set as `true` tells that those params are immutable.
* It is a [web action](/runtime/docs/guides/using/creating_actions/#invoking-web-actions)
* The action will be run in the `nodejs:18` [runtime container on I/O Runtime](/runtime/docs/guides/reference/runtimes)
* It has some [default params](/runtime/docs/guides/using/creating_actions/#working-with-parameters) such as `LOG_LEVEL`, `tenant`, `apiKey`, which are automatically available in the `params` object of the action without passing it to the action for every invocation. The `final` annotation set as `true` tells that those params are immutable.
* Setting the `require-adobe-auth` annotation as `true` enables this action to be protected by Adobe IMS user token in the request header. Without it, the action will return `401 Unauthorized` error.

Now let's have a deeper look at the action's source code.
Expand Down
10 changes: 5 additions & 5 deletions src/pages/resources/event-driven/lesson3.md
Expand Up @@ -32,7 +32,7 @@ application:
generic:
function: actions/generic/index.js
web: 'yes'
runtime: 'nodejs:14'
runtime: 'nodejs:18'
inputs:
LOG_LEVEL: debug
annotations:
Expand All @@ -41,7 +41,7 @@ application:
publish-events:
function: actions/publish-events/index.js
web: 'yes'
runtime: 'nodejs:14'
runtime: 'nodejs:18'
inputs:
LOG_LEVEL: debug
apiKey: <Your-SERVICE_API_KEY>
Expand All @@ -54,9 +54,9 @@ application:
Now let's start to take a deeper look the template code:

* Source code is at `actions/publish-events/index.js`
* It is a [web action](/apis/experienceplatform/runtime/docs.html#!adobedocs/adobeio-runtime/master/guides/creating_actions.md#invoking-actions)
* The action will be run in the `nodejs:12` [runtime container on I/O Runtime](/apis/experienceplatform/runtime/docs.html#!adobedocs/adobeio-runtime/master/reference/runtimes.md)
* It has some [default params](/apis/experienceplatform/runtime/docs.html#!adobedocs/adobeio-runtime/master/guides/creating_actions.md#working-with-parameters) such as `LOG_LEVEL`, you can pass in your `params` like `apiKey`, `provideId` and `eventCode`from `manifest.yml`
* It is a [web action](/runtime/docs/guides/using/creating_actions/#invoking-web-actions)
* The action will be run in the `nodejs:18` [runtime container on I/O Runtime](/runtime/docs/guides/reference/runtimes)
* It has some [default params](/runtime/docs/guides/using/creating_actions/#working-with-parameters) such as `LOG_LEVEL`, you can pass in your `params` like `apiKey`, `provideId` and `eventCode`from `manifest.yml`

```javascript
const { Core, Events } = require('@adobe/aio-sdk')
Expand Down
2 changes: 1 addition & 1 deletion src/pages/resources/event-driven/lesson4.md
Expand Up @@ -26,7 +26,7 @@ Or you can use [Custom event SDK](https://github.com/adobe/aio-lib-events/) to c


## Option 2: Using runtime action
Once you have access to [Adobe I/O Runtime](/apis/experienceplatform/runtime.html) (in our case you already have) and you have your [slack webhook url defined](https://api.slack.com/incoming-webhooks) :
Once you have access to [Adobe I/O Runtime](/runtime) (in our case you already have) and you have your [slack webhook url defined](https://api.slack.com/incoming-webhooks) :
* Edit the `app.config.yaml` to add an action called slack
```javascript
slack:
Expand Down
2 changes: 1 addition & 1 deletion src/pages/resources/sample_apps/code_snippets/index.md
Expand Up @@ -10,7 +10,7 @@ title: App Builder Code Snippets - Caching HTTP responses
# Caching HTTP responses

Demonstrating how to cache response of an action at Gateway level. To test this functionality, make sure that the Cache-Control header in your HTTP request is not set to `no-cache`
(which is by default if you use Postman or browser's developer tools). More info [here](/apis/experienceplatform/runtime/docs.html#!adobedocs/adobeio-runtime/master/guides/throughput_tuning.md#caching-responses).
(which is by default if you use Postman or browser's developer tools). More info [here](/runtime/docs/guides/using/throughput_tuning/#caching-responses).


```javascript
Expand Down

0 comments on commit 3c84181

Please sign in to comment.