Skip to content

Commit 45fb10d

Browse files
glowcloudclaude
andauthored
feat: update SQS Bindings (#5132)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3294f83 commit 45fb10d

105 files changed

Lines changed: 2908 additions & 33 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import {
2+
ApidomCompletionItem,
3+
CompletionFormat,
4+
CompletionType,
5+
} from '../../../../../../apidom-language-types.ts';
6+
7+
const completion: ApidomCompletionItem[] = [
8+
{
9+
label: 'queue',
10+
insertText: 'queue',
11+
kind: 14,
12+
format: CompletionFormat.OBJECT,
13+
type: CompletionType.PROPERTY,
14+
insertTextFormat: 2,
15+
documentation: {
16+
kind: 'markdown',
17+
value:
18+
'[Queue](https://github.com/asyncapi/bindings/blob/85b00377193b8ffd3c8f565db25981bbd2e4dde9/sqs/README.md#queue)\n\\\n\\\n**Required.** A definition of the queue that will be used as the channel.',
19+
},
20+
conditions: [
21+
{
22+
targets: [{ path: 'bindingVersion' }],
23+
function: 'apilintValueOrArray',
24+
params: [['0.1.0']],
25+
},
26+
],
27+
},
28+
{
29+
label: 'deadLetterQueue',
30+
insertText: 'deadLetterQueue',
31+
kind: 14,
32+
format: CompletionFormat.OBJECT,
33+
type: CompletionType.PROPERTY,
34+
insertTextFormat: 2,
35+
documentation: {
36+
kind: 'markdown',
37+
value:
38+
'[Queue](https://github.com/asyncapi/bindings/blob/85b00377193b8ffd3c8f565db25981bbd2e4dde9/sqs/README.md#queue)\n\\\n\\\n**Optional.** A definition of the queue that will be used for un-processable messages.',
39+
},
40+
conditions: [
41+
{
42+
targets: [{ path: 'bindingVersion' }],
43+
function: 'apilintValueOrArray',
44+
params: [['0.1.0']],
45+
},
46+
],
47+
},
48+
];
49+
50+
export default completion;
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import {
2+
ApidomCompletionItem,
3+
CompletionFormat,
4+
CompletionType,
5+
} from '../../../../../../apidom-language-types.ts';
6+
7+
const completion: ApidomCompletionItem[] = [
8+
{
9+
label: 'queue',
10+
insertText: 'queue',
11+
kind: 14,
12+
format: CompletionFormat.OBJECT,
13+
type: CompletionType.PROPERTY,
14+
insertTextFormat: 2,
15+
documentation: {
16+
kind: 'markdown',
17+
value:
18+
'[Queue](https://github.com/asyncapi/bindings/blob/e14c6782a95aaa009d33b9a6b72194cbaebd39ff/sqs/README.md#queue)\n\\\n\\\n**Required.** A definition of the queue that will be used as the channel.',
19+
},
20+
conditions: [
21+
{
22+
targets: [{ path: 'bindingVersion' }],
23+
function: 'apilintValueOrArray',
24+
params: [['0.2.0']],
25+
},
26+
],
27+
},
28+
{
29+
label: 'deadLetterQueue',
30+
insertText: 'deadLetterQueue',
31+
kind: 14,
32+
format: CompletionFormat.OBJECT,
33+
type: CompletionType.PROPERTY,
34+
insertTextFormat: 2,
35+
documentation: {
36+
kind: 'markdown',
37+
value:
38+
'[Queue](https://github.com/asyncapi/bindings/blob/e14c6782a95aaa009d33b9a6b72194cbaebd39ff/sqs/README.md#queue)\n\\\n\\\n**Optional.** A definition of the queue that will be used for un-processable messages.',
39+
},
40+
conditions: [
41+
{
42+
targets: [{ path: 'bindingVersion' }],
43+
function: 'apilintValueOrArray',
44+
params: [['0.2.0']],
45+
},
46+
],
47+
},
48+
];
49+
50+
export default completion;
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import {
2+
ApidomCompletionItem,
3+
CompletionFormat,
4+
CompletionType,
5+
} from '../../../../../../apidom-language-types.ts';
6+
7+
const completion: ApidomCompletionItem[] = [
8+
{
9+
label: 'queue',
10+
insertText: 'queue',
11+
kind: 14,
12+
format: CompletionFormat.OBJECT,
13+
type: CompletionType.PROPERTY,
14+
insertTextFormat: 2,
15+
documentation: {
16+
kind: 'markdown',
17+
value:
18+
'[Queue](https://github.com/asyncapi/bindings/blob/master/sqs/README.md#queue)\n\\\n\\\n**Required.** A definition of the queue that will be used as the channel.',
19+
},
20+
conditions: [
21+
{
22+
targets: [{ path: 'bindingVersion' }],
23+
function: 'apilintValueOrArray',
24+
params: [['0.3.0']],
25+
},
26+
],
27+
},
28+
{
29+
label: 'deadLetterQueue',
30+
insertText: 'deadLetterQueue',
31+
kind: 14,
32+
format: CompletionFormat.OBJECT,
33+
type: CompletionType.PROPERTY,
34+
insertTextFormat: 2,
35+
documentation: {
36+
kind: 'markdown',
37+
value:
38+
'[Queue](https://github.com/asyncapi/bindings/blob/master/sqs/README.md#queue)\n\\\n\\\n**Optional.** A definition of the queue that will be used for un-processable messages.',
39+
},
40+
conditions: [
41+
{
42+
targets: [{ path: 'bindingVersion' }],
43+
function: 'apilintValueOrArray',
44+
params: [['0.3.0']],
45+
},
46+
],
47+
},
48+
];
49+
50+
export default completion;
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import completion0_1_0Items from './0-1-0.ts';
2+
import completion0_2_0Items from './0-2-0.ts';
3+
import completion0_3_0Items from './0-3-0.ts';
4+
import completionLatestItems from './latest.ts';
5+
import {
6+
ApidomCompletionItem,
7+
CompletionFormat,
8+
CompletionType,
9+
} from '../../../../../../apidom-language-types.ts';
10+
11+
const completion: ApidomCompletionItem[] = [
12+
...completion0_1_0Items,
13+
...completion0_2_0Items,
14+
...completion0_3_0Items,
15+
...completionLatestItems,
16+
{
17+
label: 'bindingVersion',
18+
insertText: 'bindingVersion',
19+
kind: 14,
20+
format: CompletionFormat.QUOTED,
21+
type: CompletionType.PROPERTY,
22+
insertTextFormat: 2,
23+
documentation: {
24+
kind: 'markdown',
25+
value: '**Optional**, defaults to `latest`. The version of this binding.',
26+
},
27+
},
28+
{
29+
target: 'bindingVersion',
30+
label: '0.1.0',
31+
insertText: '0.1.0',
32+
kind: 12,
33+
format: CompletionFormat.QUOTED_FORCED,
34+
type: CompletionType.VALUE,
35+
insertTextFormat: 2,
36+
},
37+
{
38+
target: 'bindingVersion',
39+
label: '0.2.0',
40+
insertText: '0.2.0',
41+
kind: 12,
42+
format: CompletionFormat.QUOTED_FORCED,
43+
type: CompletionType.VALUE,
44+
insertTextFormat: 2,
45+
},
46+
{
47+
target: 'bindingVersion',
48+
label: '0.3.0',
49+
insertText: '0.3.0',
50+
kind: 12,
51+
format: CompletionFormat.QUOTED_FORCED,
52+
type: CompletionType.VALUE,
53+
insertTextFormat: 2,
54+
},
55+
];
56+
57+
export default completion;
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import {
2+
ApidomCompletionItem,
3+
CompletionFormat,
4+
CompletionType,
5+
} from '../../../../../../apidom-language-types.ts';
6+
7+
const completion: ApidomCompletionItem[] = [
8+
{
9+
label: 'queue',
10+
insertText: 'queue',
11+
kind: 14,
12+
format: CompletionFormat.OBJECT,
13+
type: CompletionType.PROPERTY,
14+
insertTextFormat: 2,
15+
documentation: {
16+
kind: 'markdown',
17+
value:
18+
'[Queue](https://github.com/asyncapi/bindings/blob/master/sqs/README.md#queue)\n\\\n\\\n**Required.** A definition of the queue that will be used as the channel.',
19+
},
20+
conditions: [
21+
{
22+
function: 'missingField',
23+
params: ['bindingVersion'],
24+
},
25+
],
26+
},
27+
{
28+
label: 'deadLetterQueue',
29+
insertText: 'deadLetterQueue',
30+
kind: 14,
31+
format: CompletionFormat.OBJECT,
32+
type: CompletionType.PROPERTY,
33+
insertTextFormat: 2,
34+
documentation: {
35+
kind: 'markdown',
36+
value:
37+
'[Queue](https://github.com/asyncapi/bindings/blob/master/sqs/README.md#queue)\n\\\n\\\n**Optional.** A definition of the queue that will be used for un-processable messages.',
38+
},
39+
conditions: [
40+
{
41+
function: 'missingField',
42+
params: ['bindingVersion'],
43+
},
44+
],
45+
},
46+
];
47+
48+
export default completion;
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
const documentation = [
22
{
3-
docs: '#### [Channel Binding Object](https://github.com/asyncapi/bindings/blob/master/sqs#channel)\n\nThis object MUST NOT contain any properties. Its name is reserved for future use.',
3+
target: 'queue',
4+
docs: '[Queue](https://github.com/asyncapi/bindings/blob/master/sqs/README.md#queue)\n\\\n\\\n**Required.** A definition of the queue that will be used as the channel.\n\nField Name | Type | Description\n---|:---:|---\n`name` | string | **Required.** The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field.\n`fifoQueue` | boolean | **Required.** Is this a FIFO queue?\n`deduplicationScope` | string | **Optional.** Specifies whether message deduplication occurs at the message group or queue level. Valid values are `messageGroup` and `queue`. This property applies only to high throughput for FIFO queues.\n`fifoThroughputLimit` | string | **Optional.** Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are `perQueue` and `perMessageGroupId`. The `perMessageGroupId` value is allowed only when the value for DeduplicationScope is `messageGroup`. This property applies only to high throughput for FIFO queues.\n`deliveryDelay` | integer | **Optional.** The number of seconds to delay before a message sent to the queue can be received. Used to create a delay queue. Range is 0 to 15 minutes. Defaults to 0.\n`visibilityTimeout` | integer | **Optional.** The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again. Range from 0 to 12 hours (43200 seconds). Defaults to 30 seconds.\n`receiveMessageWaitTime` | integer | **Optional.** Determines if the queue uses [short polling](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html) or [long polling](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html). Set to zero (the default) the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.\n`messageRetentionPeriod` | integer | **Optional.** How long to retain a message on the queue in seconds, unless deleted. The range is 60 (1 minute) to 1,209,600 (14 days). The default is 345,600 (4 days).\n`redrivePolicy` | [Redrive Policy](https://github.com/asyncapi/bindings/blob/master/sqs/README.md#redrive-policy) | **Optional.** Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.\n`policy` | [Policy](https://github.com/asyncapi/bindings/blob/master/sqs/README.md#policy) | **Optional.** The security policy for the SQS Queue.\n`tags` | object | **Optional.** Key-value pairs that represent AWS tags on the queue.',
5+
},
6+
{
7+
target: 'deadLetterQueue',
8+
docs: '[Queue](https://github.com/asyncapi/bindings/blob/master/sqs/README.md#queue)\n\\\n\\\n**Optional.** A definition of the queue that will be used for un-processable messages.\n\nField Name | Type | Description\n---|:---:|---\n`name` | string | **Required.** The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field.\n`fifoQueue` | boolean | **Required.** Is this a FIFO queue?\n`deduplicationScope` | string | **Optional.** Specifies whether message deduplication occurs at the message group or queue level. Valid values are `messageGroup` and `queue`. This property applies only to high throughput for FIFO queues.\n`fifoThroughputLimit` | string | **Optional.** Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are `perQueue` and `perMessageGroupId`. The `perMessageGroupId` value is allowed only when the value for DeduplicationScope is `messageGroup`. This property applies only to high throughput for FIFO queues.\n`deliveryDelay` | integer | **Optional.** The number of seconds to delay before a message sent to the queue can be received. Used to create a delay queue. Range is 0 to 15 minutes. Defaults to 0.\n`visibilityTimeout` | integer | **Optional.** The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again. Range from 0 to 12 hours (43200 seconds). Defaults to 30 seconds.\n`receiveMessageWaitTime` | integer | **Optional.** Determines if the queue uses [short polling](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html) or [long polling](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html). Set to zero (the default) the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.\n`messageRetentionPeriod` | integer | **Optional.** How long to retain a message on the queue in seconds, unless deleted. The range is 60 (1 minute) to 1,209,600 (14 days). The default is 345,600 (4 days).\n`redrivePolicy` | [Redrive Policy](https://github.com/asyncapi/bindings/blob/master/sqs/README.md#redrive-policy) | **Optional.** Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.\n`policy` | [Policy](https://github.com/asyncapi/bindings/blob/master/sqs/README.md#policy) | **Optional.** The security policy for the SQS Queue.\n`tags` | object | **Optional.** Key-value pairs that represent AWS tags on the queue.',
9+
},
10+
{
11+
target: 'bindingVersion',
12+
docs: '`string`\n\\\n\\\n**Optional**, defaults to `latest`. The version of this binding.',
13+
},
14+
{
15+
docs: '#### [Channel Binding Object](https://github.com/asyncapi/bindings/blob/master/sqs/README.md#channel-binding-object)\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\nqueue | [Queue](https://github.com/asyncapi/bindings/blob/master/sqs/README.md#queue) | **Required**. A definition of the queue that will be used as the channel.\ndeadLetterQueue | [Queue](https://github.com/asyncapi/bindings/blob/master/sqs/README.md#queue) | **Optional**. A definition of the queue that will be used for un-processable messages.\nbindingVersion | string | **Optional**, defaults to `latest`. The version of this binding.',
416
},
517
];
618
export default documentation;

packages/apidom-ls/src/config/asyncapi/bindings/sqs/channel-binding/lint/0-1-0/allowed-fields.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import { LinterMeta } from '../../../../../../../apidom-language-types.ts';
66
const allowedFieldsLint: LinterMeta = {
77
code: ApilintCodes.NOT_ALLOWED_FIELDS,
88
source: 'apilint',
9-
message: 'This object MUST NOT contain any properties. Its name is reserved for future use.',
9+
message: 'Object includes not allowed fields.',
1010
severity: DiagnosticSeverity.Error,
1111
linterFunction: 'allowedFields',
12-
linterParams: [[]],
12+
linterParams: [['queue', 'deadLetterQueue', 'bindingVersion']],
1313
marker: 'key',
1414
conditions: [
1515
{
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { DiagnosticSeverity } from 'vscode-languageserver-types';
2+
3+
import ApilintCodes from '../../../../../../codes.ts';
4+
import { LinterMeta } from '../../../../../../../apidom-language-types.ts';
5+
6+
const deadLetterQueueTypeLint: LinterMeta = {
7+
code: ApilintCodes.ASYNCAPI2_SQS_CHANNEL_BINDING_FIELD_DEAD_LETTER_QUEUE_TYPE,
8+
source: 'apilint',
9+
message: "'deadLetterQueue' value must be an object",
10+
severity: DiagnosticSeverity.Error,
11+
linterFunction: 'apilintType',
12+
linterParams: ['object'],
13+
marker: 'value',
14+
target: 'deadLetterQueue',
15+
data: {},
16+
conditions: [
17+
{
18+
targets: [{ path: 'bindingVersion' }],
19+
function: 'apilintValueOrArray',
20+
params: [['0.1.0']],
21+
},
22+
],
23+
};
24+
25+
export default deadLetterQueueTypeLint;
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import allowedFieldsLint from './allowed-fields.ts';
2+
import queueTypeLint from './queue--type.ts';
3+
import deadLetterQueueTypeLint from './dead-letter-queue--type.ts';
24

3-
const lints = [allowedFieldsLint];
5+
const lints = [queueTypeLint, deadLetterQueueTypeLint, allowedFieldsLint];
46

57
export default lints;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { DiagnosticSeverity } from 'vscode-languageserver-types';
2+
3+
import ApilintCodes from '../../../../../../codes.ts';
4+
import { LinterMeta } from '../../../../../../../apidom-language-types.ts';
5+
6+
const queueTypeLint: LinterMeta = {
7+
code: ApilintCodes.ASYNCAPI2_SQS_CHANNEL_BINDING_FIELD_QUEUE_TYPE,
8+
source: 'apilint',
9+
message: "'queue' value must be an object",
10+
severity: DiagnosticSeverity.Error,
11+
linterFunction: 'apilintType',
12+
linterParams: ['object'],
13+
marker: 'value',
14+
target: 'queue',
15+
data: {},
16+
conditions: [
17+
{
18+
targets: [{ path: 'bindingVersion' }],
19+
function: 'apilintValueOrArray',
20+
params: [['0.1.0']],
21+
},
22+
],
23+
};
24+
25+
export default queueTypeLint;

0 commit comments

Comments
 (0)