Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "package-lock.json|^.secrets.baseline$",
"lines": null
},
"generated_at": "2025-09-04T10:57:40Z",
"generated_at": "2025-09-25T01:54:39Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -126,15 +126,15 @@
"hashed_secret": "d4c3d66fd0c38547a3c7a4c6bdc29c36911bc030",
"is_secret": false,
"is_verified": false,
"line_number": 1601,
"line_number": 1658,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "3235b7f8d626cde63611d2e9ec43473f4e844c67",
"is_secret": false,
"is_verified": false,
"line_number": 2816,
"line_number": 2967,
"type": "Base64 High Entropy String",
"verified_result": null
}
Expand All @@ -144,15 +144,15 @@
"hashed_secret": "0cc20f91828bed53ddb6294968b7f9abd631a3ba",
"is_secret": false,
"is_verified": false,
"line_number": 1535,
"line_number": 1598,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "3235b7f8d626cde63611d2e9ec43473f4e844c67",
"is_secret": false,
"is_verified": false,
"line_number": 3175,
"line_number": 3332,
"type": "Base64 High Entropy String",
"verified_result": null
}
Expand Down
91 changes: 90 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ Currently, this functionality supports following destinations:
5. IBM Cloud Code Engine
6. IBM Cloud Object Storage
7. Webhook
8. App Configuration

```js
const testDestinationParams = {
Expand Down Expand Up @@ -731,6 +732,29 @@ For EventStreams template supported template type value: event_streams.notificat
```
For CodeEngine template supported template type value: ibmceapp.notification and ibmcejob.notification

#### AppConfiguration Template
```js
const templateConfigModel = {
body: <template-body>,
};
let createTemplateParams = {
instanceId: <instance-id>,
name: <template-name>,
type: <template-type>,
templateConfigModel,
description: <template-description>,
};

let createTemplateResult;
try {
createTemplateResult = await eventNotificationsService.createTemplate(createTemplateParams);
console.log(JSON.stringify(createTemplateResult.result, null, 2));
} catch (err) {
console.warn(err);
}
```
For App Configuration template supported template type value: app_configuration.notification

### List Templates
```js
const params = {
Expand Down Expand Up @@ -912,6 +936,30 @@ try {
```
For Event Streams template supported template type value: event_streams.notification

#### Update App Configuration Template
```js
const templateConfigModel = {
params: {
body: <template-body>,
},
};
let replaceTemplateParams = {
instanceId: <instance-id>,
id: <template-id>,
name: <template-name>,
type: <template-type>,
templateConfigModel,
description: <template-description>,
};
let replaceTemplateResult;
try {
replaceTemplateResult = await eventNotificationsService.replaceTemplate(replaceTemplateParams);
} catch (err) {
console.warn(err);
}
```
For App Configuration template supported template type value: app_configuration.notification

#### Update CodeEngine Template
```js
const templateConfigModel = {
Expand Down Expand Up @@ -1008,7 +1056,6 @@ try {
### Create Subscription

```js
While Creating Subscription use any of one option from webhook or email

// SubscriptionCreateAttributesWebhookAttributes
const subscriptionCreateAttributesModel = {
Expand All @@ -1034,6 +1081,46 @@ eventNotificationsService
});
```

### ⚠️ Special Consideration for App Configuration Destination

When creating or updating a subscription for an **App Configuration** destination, the `attributes` object has a specific rule:

- You must include **either** `feature_flag_enabled` **or** `template_id_notification`
- You **cannot** include both properties together

This ensures that a subscription is created for the correct use case — either **feature flag evaluation** or **notification templating**, but not both at once.

#### ✅ Valid Example (Feature Flag Evaluation)

```js
{
"attributes": {
"feature_flag_enabled": true
}
}
```

#### ✅ Valid Example (template association)

```js
{
"attributes": {
"template_id_notification": "<template-id>"
}
}
```

#### ❌ Invalid Example (Not Allowed)

```js
{
"attributes": {
"feature_flag_enabled": true,
"template_id_notification": "<template-id>"
}
}
```

### List Subscriptions

```js
Expand Down Expand Up @@ -1586,6 +1673,8 @@ Find [event_notifications_v1.env.hide](https://github.com/IBM/event-notification
- `EVENT_NOTIFICATIONS_EVENT_STREAMS_ENDPOINT` - Event streams end point
- `EVENT_NOTIFICATIONS_CODE_ENGINE_APP_TEMPLATE_BODY` - base 64 encoded json body for Code Engine Application
- `EVENT_NOTIFICATIONS_CODE_ENGINE_JOB_TEMPLATE_BODY` - base 64 encoded json body for Code Engine Job
- `EVENT_NOTIFICATIONS_APP_CONFIG_CRN` - CRN of App Configuration instance
- `EVENT_NOTIFICATIONS_APP_CONFIG_TEMPLATE_BODY` - base 64 encoded json body for App Configuration

## Questions

Expand Down
47 changes: 47 additions & 0 deletions event-notifications/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3684,6 +3684,7 @@ namespace EventNotificationsV1 {
SMTP_CUSTOM = 'smtp_custom',
SMS_CUSTOM = 'sms_custom',
EVENT_STREAMS = 'event_streams',
APP_CONFIGURATION = 'app_configuration',
}
}

Expand Down Expand Up @@ -5099,6 +5100,19 @@ namespace EventNotificationsV1 {
verification: string;
}

/** Payload describing a App Configuration destination configuration. */
export interface DestinationConfigOneOfAppConfigurationDestinationConfig
extends DestinationConfigOneOf {
/** The App Configuration Destination type. */
type: string;
/** CRN of the App Configuration instance. */
crn: string;
/** Environment ID of App Configuration. */
environment_id: string;
/** Feature ID of App Configuration. */
feature_id: string;
}

/** Payload describing a Chrome destination configuration. */
export interface DestinationConfigOneOfChromeDestinationConfig extends DestinationConfigOneOf {
/** FCM api_key. */
Expand Down Expand Up @@ -5293,6 +5307,15 @@ namespace EventNotificationsV1 {
sensitive_headers?: string[];
}

/** The attributes for a App Configuration notification. */
export interface SubscriptionAttributesAppConfigurationAttributesResponse
extends SubscriptionAttributes {
/** App Configuration enable feature flag attribute. */
feature_flag_enabled?: boolean;
/** App Configuration template id. */
template_id_notification?: string;
}

/** The attributes for a Code Engine response. */
export interface SubscriptionAttributesCodeEngineAttributesResponse
extends SubscriptionAttributes {
Expand Down Expand Up @@ -5412,6 +5435,15 @@ namespace EventNotificationsV1 {
add_notification_payload: boolean;
}

/** The attributes for a App Configuration subscription. */
export interface SubscriptionCreateAttributesAppConfigurationAttributes
extends SubscriptionCreateAttributes {
/** App Configuration enable feature flag attribute. */
feature_flag_enabled?: boolean;
/** App Configuration template id. */
template_id_notification?: string;
}

/** The attributes for a Code Engine subscription. */
export interface SubscriptionCreateAttributesCodeEngineAttributes
extends SubscriptionCreateAttributes {
Expand Down Expand Up @@ -5521,6 +5553,15 @@ namespace EventNotificationsV1 {
template_id_notification?: string;
}

/** The attributes for a App Configuration subscription. */
export interface SubscriptionUpdateAttributesAppConfigurationAttributes
extends SubscriptionUpdateAttributes {
/** App Configuration enable feature flag attribute. */
feature_flag_enabled?: boolean;
/** App Configuration template id. */
template_id_notification?: string;
}

/** The attributes for a Code Engine subscription. */
export interface SubscriptionUpdateAttributesCodeEngineAttributes
extends SubscriptionUpdateAttributes {
Expand Down Expand Up @@ -5644,6 +5685,12 @@ namespace EventNotificationsV1 {
template_id_notification?: string;
}

/** Payload describing a App Configuration template configuration. */
export interface TemplateConfigOneOfAppConfigurationTemplateConfig extends TemplateConfigOneOf {
/** Template body(Base64 encoded). */
body: string;
}

/** Payload describing a code engine application template configuration. */
export interface TemplateConfigOneOfCodeEngineApplicationTemplateConfig
extends TemplateConfigOneOf {
Expand Down
Loading