Skip to content

Commit e855989

Browse files
authored
Merge branch 'master' into patch-1
2 parents d8f774b + 8ca5689 commit e855989

File tree

9 files changed

+468
-19
lines changed

9 files changed

+468
-19
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: Update latest Bindings documentation in the website
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- "**/*.md"
9+
- ".github/workflows/update-docs-in-website.yml"
10+
workflow_dispatch:
11+
12+
jobs:
13+
Make-PR:
14+
name: Make PR on website repository with updated latest Bindings documentation
15+
runs-on: ubuntu-latest
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
18+
steps:
19+
- name: Checkout Current repository
20+
uses: actions/checkout@v4
21+
with:
22+
path: bindings
23+
- name: Checkout Another repository
24+
uses: actions/checkout@v4
25+
with:
26+
repository: asyncapi/website
27+
path: website
28+
token: ${{ env.GITHUB_TOKEN }}
29+
- name: Config git
30+
run: |
31+
git config --global user.name asyncapi-bot
32+
git config --global user.email [email protected]
33+
- name: Create branch
34+
working-directory: ./website
35+
run: |
36+
git checkout -b update-bindings-docs-${{ github.sha }}
37+
- name: Update edit-page-config.json
38+
uses: actions/github-script@v4
39+
with:
40+
script: |
41+
const { writeFile } = require('fs').promises;
42+
const configPath = './website/config/edit-page-config.json';
43+
const checkSlug = 'reference/bindings/';
44+
const slug = {
45+
"value": checkSlug,
46+
"href": "https://github.com/asyncapi/bindings/tree/master"
47+
};
48+
49+
const configData = require(configPath);
50+
const entryExists = configData.some(entry => entry.value === checkSlug);
51+
if (!entryExists) {
52+
configData.unshift(slug);
53+
await writeFile(configPath, JSON.stringify(configData, null, 2))
54+
}
55+
56+
- name: Update title and weight of the markdown files
57+
uses: actions/github-script@v4
58+
with:
59+
script: |
60+
const fs = require('fs');
61+
const path = require('path');
62+
const rootPath = './bindings/';
63+
let itemIndex = 10;
64+
65+
function processMarkdownFiles(folderPath, isRoot = true) {
66+
const items = fs.readdirSync(folderPath, { withFileTypes: true });
67+
for (const item of items) {
68+
const fullPath = path.join(folderPath, item.name);
69+
if (item.isDirectory()) {
70+
// Always process subdirectories, mark isRoot as false for recursive calls
71+
processMarkdownFiles(fullPath, false);
72+
} else if (item.name.endsWith('.md') && !isRoot) { // Skip root level .md files
73+
const baseName = path.basename(fullPath, '.md');
74+
const parentDirName = path.basename(folderPath);
75+
const newFileName = `${parentDirName}.md`;
76+
const newFullPath = path.join(folderPath, newFileName);
77+
fs.renameSync(fullPath, newFullPath);
78+
79+
const newData = `---\ntitle: '${parentDirName}'\nweight: ${itemIndex}\n---\n\n`;
80+
let existingFileData = fs.readFileSync(newFullPath, 'utf8');
81+
82+
existingFileData = existingFileData.replace(/<img\s+src="(?!http)(.*?)"/g, (match, src) => {
83+
// Remove './' prefix from src path and prepend '/img/docs/'
84+
const updatedSrc = src.replace(/^\.\//, '');
85+
return `<img src="/img/docs/${updatedSrc}"`;
86+
});
87+
88+
const updatedContent = newData + existingFileData;
89+
fs.writeFileSync(newFullPath, updatedContent);
90+
itemIndex++;
91+
}
92+
}
93+
}
94+
95+
await processMarkdownFiles(rootPath);
96+
97+
- name: Copy bindings folder from Current Repo to Another
98+
working-directory: ./website
99+
run: |
100+
mkdir -p ./markdown/docs/reference/bindings
101+
printf "%s\ntitle: Bindings\nweight: 11\n%s" "---" "---"> ../bindings/_section.md
102+
find ../bindings -type f -name '*.md' ! -name 'CONTRIBUTING.md' ! -name 'README.md' ! -name 'CODE_OF_CONDUCT.md' -exec mv {} ./markdown/docs/reference/bindings/ \;
103+
104+
- name: Copy images to website
105+
run: |
106+
# Assuming the workflow runs on Linux/macOS
107+
# Create the target directory if it doesn't exist
108+
mkdir -p ./website/public/img/docs/
109+
# Find and copy all image files from the source directory to the target directory
110+
find ./bindings/ -type f \( -iname "*.png" -o -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.gif" -iname "*.webp" \) -exec cp {} ./website/public/img/docs/ \;
111+
112+
- name: Commit and push
113+
working-directory: ./website
114+
run: |
115+
git add .
116+
git commit -m "docs(extension): update latest bindings docs"
117+
git push https://${{ env.GITHUB_TOKEN }}@github.com/asyncapi/website
118+
119+
- name: Create PR
120+
working-directory: ./website
121+
run: |
122+
gh pr create --title "docs(bindings): update latest bindings documentation" --body "Updated bindings documentation is available and this PR introduces update to bindings folder on the website" --head "update-bindings-docs-${{ github.sha }}"

ibmmq/README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,14 @@ Field Name | Type | Description | Applicability [default] | Constraints
156156
---|:---:|---|:---|:---
157157
<a name="channelBindingObjectDestinationType"></a>`destinationType` | string | Defines the type of AsyncAPI channel. | OPTIONAL [`topic`] | MUST be either `topic` or `queue`. For type `topic`, the AsyncAPI channel name MUST be assumed for the IBM MQ topic string unless overridden.
158158
<a name="channelBindingObjectQueue"></a>`queue` | Map[string, any] | Defines the properties of a queue. | REQUIRED if `destinationType` = `queue` | `queue` and `topic` fields MUST NOT coexist within a channel binding
159-
<a name="channelBindingObjectQueueObjectName"></a>`queue.`<br>`objectName`</br> | string | Defines the name of the IBM MQ queue associated with the channel. | REQUIRED | A value MUST be specified. MUST NOT exceed 48 characters in length. MUST be a valid IBM MQ queue name
160-
<a name="channelBindingObjectisPartitioned"></a>`queue.`<br>`isPartitioned`</br> | boolean | Defines if the queue is a cluster queue and therefore partitioned. If `true`, a binding option MAY be specified when accessing the queue. More information on binding options can be found on this [page](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q101870_.html#q101870___BIND_ON_OPEN) in the IBM MQ Knowledge Center. | OPTIONAL [`false`] | If `false`, binding options SHOULD NOT be specified when accessing the queue.
161-
<a name="channelBindingObjectQueueExclusive"></a>`queue.`<br>`exclusive`</br> | boolean | Specifies if it is recommended to open the queue exclusively. | OPTIONAL [`false`] | -
159+
<a name="channelBindingObjectQueueObjectName"></a>`queue.`<br />`objectName` | string | Defines the name of the IBM MQ queue associated with the channel. | REQUIRED | A value MUST be specified. MUST NOT exceed 48 characters in length. MUST be a valid IBM MQ queue name
160+
<a name="channelBindingObjectisPartitioned"></a>`queue.`<br />`isPartitioned` | boolean | Defines if the queue is a cluster queue and therefore partitioned. If `true`, a binding option MAY be specified when accessing the queue. More information on binding options can be found on this [page](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q101870_.html#q101870___BIND_ON_OPEN) in the IBM MQ Knowledge Center. | OPTIONAL [`false`] | If `false`, binding options SHOULD NOT be specified when accessing the queue.
161+
<a name="channelBindingObjectQueueExclusive"></a>`queue.`<br />`exclusive` | boolean | Specifies if it is recommended to open the queue exclusively. | OPTIONAL [`false`] | -
162162
<a name="channelBindingObjectTopic"></a>`topic` | Map[string, any] | Defines the properties of a topic. | OPTIONAL if `destinationType` = `topic` | `queue` and `topic` fields MUST NOT coexist within a channel binding.
163-
<a name="channelBindingObjectTopicString"></a>`topic.`<br>`string`</br> | string | The value of the IBM MQ topic string to be used. | OPTIONAL *<br>Note: if specified, SHALL override AsyncAPI channel name.</br>* | MUST NOT exceed 10240 characters in length. MAY coexist with `topic.objectName`
164-
<a name="channelBindingObjectTopicObjectName"></a>`topic.`<br>`objectName`</br> | string | The name of the IBM MQ topic object. | OPTIONAL *<br>Note: if specified, SHALL override AsyncAPI channel name.</br>*| MUST NOT exceed 48 characters in length. MAY coexist with `topic.string`
165-
<a name="channelBindingObjectTopicDurablePermitted"></a>`topic.`<br> `durablePermitted`</br> | boolean | Defines if the subscription may be durable. | OPTIONAL [`true`] | -
166-
<a name="channelBindingObjectTopicLastMsgRetained"></a>`topic.`<br>`lastMsgRetained`</br> | boolean | Defines if the last message published will be made available to new subscriptions. | OPTIONAL [`false`] | -
163+
<a name="channelBindingObjectTopicString"></a>`topic.`<br />`string` | string | The value of the IBM MQ topic string to be used. | OPTIONAL *<br />Note: if specified, SHALL override AsyncAPI channel name.* | MUST NOT exceed 10240 characters in length. MAY coexist with `topic.objectName`
164+
<a name="channelBindingObjectTopicObjectName"></a>`topic.`<br />`objectName` | string | The name of the IBM MQ topic object. | OPTIONAL *<br />Note: if specified, SHALL override AsyncAPI channel name.*| MUST NOT exceed 48 characters in length. MAY coexist with `topic.string`
165+
<a name="channelBindingObjectTopicDurablePermitted"></a>`topic.`<br /> `durablePermitted` | boolean | Defines if the subscription may be durable. | OPTIONAL [`true`] | -
166+
<a name="channelBindingObjectTopicLastMsgRetained"></a>`topic.`<br />`lastMsgRetained` | boolean | Defines if the last message published will be made available to new subscriptions. | OPTIONAL [`false`] | -
167167
<a name="channelBindingObjectMaxMsgLength"></a>`maxMsgLength` | integer | The maximum length of the physical message (in bytes) accepted by the Topic or Queue. Messages produced that are greater in size than this value may fail to be delivered. More information on the maximum message length can be found on this [page](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.ref.adm.doc/q085520_.html#q085520___maxmsgl) in the IBM MQ Knowledge Center. | OPTIONAL [negotiated on IBM MQ channel]| MUST be `0-104,857,600` bytes (100 MB).
168168
<a name="channelBindingObjectBindingVersion"></a>`bindingVersion` | string | The version of this binding. | OPTIONAL [`latest`] | -
169169

@@ -226,7 +226,7 @@ Field Name | Type | Description | Applicability [default] | Constraints
226226
---|:---:|---|:---|:---
227227
<a name="messageBindingObjectType"></a>`type` | string | The type of the message. | OPTIONAL [`string`] | MUST be either `string`, `jms` or `binary`
228228
<a name="messageBindingObjectHeaders"></a>`headers` | string | Defines the IBM MQ message headers to include with this message. More than one header can be specified as a comma separated list. Supporting information on IBM MQ message formats can be found on this [page](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q097520_.html) in the IBM MQ Knowledge Center. | OPTIONAL if `type` = `binary` | `headers` MUST NOT be specified if `type` = `string` or `jms`
229-
<a name="messageBindingObjectDescription"></a>`description` | string<sup>1</sub> | Provides additional information for application developers: describes the message type or format. | OPTIONAL | -
229+
<a name="messageBindingObjectDescription"></a>`description` | string<sup>1</sup> | Provides additional information for application developers: describes the message type or format. | OPTIONAL | -
230230
<a name="messageBindingObjectExpiry"></a>`expiry` | integer | The recommended setting the client should use for the TTL (Time-To-Live) of the message. This is a period of time expressed in milliseconds and set by the application that puts the message. `expiry` values are API dependant e.g., MQI and JMS use different units of time and default values for *`unlimited`*. General information on IBM MQ message expiry can be found on this [page](https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q097490_.html) in the IBM MQ Knowledge Center. | OPTIONAL [*`unlimited`*] | `expiry` value MUST be either `zero` (*`unlimited`*) or greater than zero.
231231
<a name="messageBindingObjectBindingVersion"></a>`bindingVersion` | string | The version of this binding. | OPTIONAL [`latest`] | -
232232

sns/README.md renamed to sns/2.x.x/README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ We support an array of consumers via the **consumers** field. This allows you to
136136
| <a name="channelBindingDeliveryPolicyObjectMaxReceivesPerSecond"></a>`maxReceivesPerSecond` | integer | **Optional.** The maximum number of deliveries per second, per subscription |
137137

138138
#### Identifier
139-
|Field Name | Type | Description|
140-
|---|:---:|---|
141-
|<a name="identifierObjectUrl"></a>`url` |string| **Optional.** The endpoint is a URL |
142-
|<a name="identifierObjectEmail"></a>`email` |string| **Optional.** The endpoint is an email address |
143-
|<a name="identifierObjectPhone"></a>`phone` |string| **Optional.** The endpoint is a phone number|
144-
|<a name="identifierObjectArn"></a>`arn` |string| **Optional.** The target is an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). For example, for SQS, the identifier may be an ARN, which will be of the form: ["arn:aws:sqs:{region}:{account-id}:{queueName}"](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)|
139+
|Field Name | Type | Description |
140+
|---|:---:|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
141+
|<a name="identifierObjectUrl"></a>`url` |string| **Optional.** The endpoint is a URL |
142+
|<a name="identifierObjectEmail"></a>`email` |string| **Optional.** The endpoint is an email address |
143+
|<a name="identifierObjectPhone"></a>`phone` |string| **Optional.** The endpoint is a phone number |
144+
|<a name="identifierObjectArn"></a>`arn` |string| **Optional.** The target is an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). For example, for SQS, the identifier may be an ARN, which will be of the form: ["arn:aws:sqs:\{region}:\{account-id}:\{queueName}"](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) |
145145
|<a name="identifierObjectName"></a>`name` |string| **Optional.** The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this **publish** Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field **sqs** binding. We don't use $ref because we are referring, not including. |
146146

147147
We provide an Identifer Object to support providing the identifier of an externally defined endpoint for this SNS *publication* to target, or an endpoint on another binding against this Operation Object (via the name field).
@@ -299,4 +299,4 @@ channels:
299299

300300
## Message Binding Object
301301

302-
This object MUST NOT contain any properties. Its name is reserved for future use.
302+
This object MUST NOT contain any properties. Its name is reserved for future use.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)