Skip to content

Commit

Permalink
feat: regen README.md and types.d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicola Dardanis committed Mar 21, 2023
1 parent 01bf2e9 commit 3ad455a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 53 deletions.
39 changes: 10 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright 2020 Adobe. All rights reserved.
Copyright 2019 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Expand All @@ -13,14 +13,11 @@ governing permissions and limitations under the License.
[![Version](https://img.shields.io/npm/v/@adobe/aio-lib-events.svg)](https://npmjs.org/package/@adobe/aio-lib-events)
[![Downloads/week](https://img.shields.io/npm/dw/@adobe/aio-lib-events.svg)](https://npmjs.org/package/@adobe/aio-lib-events)
[![Build Status](https://travis-ci.com/adobe/aio-lib-events.svg?branch=master)](https://travis-ci.com/adobe/aio-lib-events)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Greenkeeper badge](https://badges.greenkeeper.io/adobe/aio-lib-events.svg)](https://greenkeeper.io/)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Greenkeeper badge](https://badges.greenkeeper.io/adobe/aio-lib-events.svg)](https://greenkeeper.io/)
[![Codecov Coverage](https://img.shields.io/codecov/c/github/adobe/aio-lib-events/master.svg?style=flat-square)](https://codecov.io/gh/adobe/aio-lib-events/)

# Adobe I/O Events Lib

Node Javascript API wrapping the [Adobe I/O Events API](https://www.adobe.io/apis/experienceplatform/events.html).

### Installing

```bash
Expand Down Expand Up @@ -50,7 +47,7 @@ async function sdkTest() {

// call methods
try {
// use one of the get methods
// get profiles by custom filters
const result = await client.getSomething({})
console.log(result)

Expand Down Expand Up @@ -125,8 +122,6 @@ and max number of retries</p>
<dd></dd>
<dt><a href="#EventsJournalPollingOptions">EventsJournalPollingOptions</a> : <code>object</code></dt>
<dd></dd>
<dt><a href="#SignatureOptions">SignatureOptions</a> : <code>object</code></dt>
<dd></dd>
</dl>

<a name="EventsCoreAPI"></a>
Expand Down Expand Up @@ -165,7 +160,7 @@ and max number of retries
* [.publishEvent(cloudEvent)](#EventsCoreAPI+publishEvent) ⇒ <code>Promise.&lt;string&gt;</code>
* [.getEventsFromJournal(journalUrl, [eventsJournalOptions], [fetchResponseHeaders])](#EventsCoreAPI+getEventsFromJournal) ⇒ <code>Promise.&lt;object&gt;</code>
* [.getEventsObservableFromJournal(journalUrl, [eventsJournalOptions], [eventsJournalPollingOptions])](#EventsCoreAPI+getEventsObservableFromJournal) ⇒ <code>Observable</code>
* [.verifyDigitalSignatureForEvent(event, recipientClientId, [signatureOptions])](#EventsCoreAPI+verifyDigitalSignatureForEvent) ⇒ <code>boolean</code>
* [.verifyDigitalSignatureForEvent(event, recipientClientId, signatureOptions)](#EventsCoreAPI+verifyDigitalSignatureForEvent) ⇒ <code>boolean</code>

<a name="EventsCoreAPI+httpOptions"></a>

Expand Down Expand Up @@ -503,18 +498,17 @@ and leverage the various <a href="https://rxjs-dev.firebaseapp.com/guide/operato

<a name="EventsCoreAPI+verifyDigitalSignatureForEvent"></a>

### eventsCoreAPI.verifyDigitalSignatureForEvent(event, recipientClientId, [signatureOptions]) ⇒ <code>boolean</code>
### eventsCoreAPI.verifyDigitalSignatureForEvent(event, recipientClientId, signatureOptions) ⇒ <code>boolean</code>
Authenticating events by verifying digital signature

**Kind**: instance method of [<code>EventsCoreAPI</code>](#EventsCoreAPI)
**Returns**: <code>boolean</code> - If signature matches return true else return false

| Param | Type | Description |
| --- | --- | --- |
| event | <code>object</code> | JSON payload delivered to the registered webhook URL |
| recipientClientId | <code>string</code> | Target recipient client id retrieved from the Adobe I/O Console integration |
| [signatureOptions] | [<code>SignatureOptions</code>](#SignatureOptions) | Map of digital signature header fields defined in SignatureOptions |

| event | <code>\*</code> | JSON payload delivered to the registered webhook URL |
| recipientClientId | <code>\*</code> | Target recipient client id retrieved from the Adobe I/O Console integration |
| signatureOptions | <code>\*</code> | map of all digital signature header values consisting fields as below digiSignature1 : Value of digital signature retrieved from the x-adobe-digital-signature1 header in each POST request to webhook digiSignature2 : Value of digital signature retrieved from the x-adobe-digital-signature2 header in each POST request to webhook publicKeyPath1 : Relative path of ioevents public key retrieved from the x-adobe-public-key1-path header in each POST request to webhook publicKeyPath2 : Relative path of ioevents public key retrieved from the x-adobe-public-key2-path header in each POST request to webhook |

<a name="init"></a>

Expand Down Expand Up @@ -593,7 +587,7 @@ Returns a Promise that resolves with a new EventsCoreAPI object.
| description | <code>string</code> | The description of the registration |
| [webhook_url] | <code>string</code> | A valid webhook url where the events would be delivered for webhook or webhook_batch delivery_type |
| events_of_interest | [<code>Array.&lt;EventsOfInterest&gt;</code>](#EventsOfInterest) | The events for which the registration is to be subscribed to |
| delivery_type | <code>string</code> | Delivery type can either be webhook, webhook_batch or journal. |
| delivery_type | <code>string</code> | Delivery type can either be webhook|webhook_batch|journal. |
| [enabled] | <code>string</code> | Enable or disable the registration. Default true. |

<a name="RegistrationUpdateModel"></a>
Expand All @@ -608,7 +602,7 @@ Returns a Promise that resolves with a new EventsCoreAPI object.
| description | <code>string</code> | The description of the registration |
| [webhook_url] | <code>string</code> | A valid webhook url where the events would be delivered for webhook or webhook_batch delivery_type |
| events_of_interest | [<code>Array.&lt;EventsOfInterest&gt;</code>](#EventsOfInterest) | The events for which the registration is to be subscribed to |
| delivery_type | <code>string</code> | Delivery type can either be webhook, webhook_batch or journal. |
| delivery_type | <code>string</code> | Delivery type can either be webhook|webhook_batch|journal. |
| [enabled] | <code>string</code> | Enable or disable the registration. Default true. |

<a name="Page"></a>
Expand Down Expand Up @@ -644,19 +638,6 @@ Returns a Promise that resolves with a new EventsCoreAPI object.
| --- | --- | --- |
| [interval] | <code>number</code> | Interval at which to poll the journal; If not provided, a default value will be used (optional) |

<a name="SignatureOptions"></a>

## SignatureOptions : <code>object</code>
**Kind**: global typedef
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| [digiSignature1] | <code>string</code> | Value of digital signature retrieved from the x-adobe-digital-signature1 header |
| [digiSignature2] | <code>string</code> | Value of digital signature retrieved from the x-adobe-digital-signature2 header |
| [publicKeyPath1] | <code>string</code> | Relative path of ioevents public key retrieved from the x-adobe-public-key1-path header |
| [publicKeyPath2] | <code>string</code> | Relative path of ioevents public key retrieved from the x-adobe-public-key2-path header |

### Debug Logs

```bash
Expand Down
36 changes: 12 additions & 24 deletions types.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import {Observable} from "rxjs";

/**
* @typedef {object} EventsCoreAPIOptions
* @property {number} [timeout] Http request timeout in ms (optional)
* @property {number} [retries] Number of retries in case of 5xx errors. Default 0 (optional)
* @property [timeout] - Http request timeout in ms (optional)
* @property [retries] - Number of retries in case of 5xx errors. Default 0 (optional)
* @property [eventsBaseURL] - Base URL for Events Default https://api.adobe.io (optional)
* @property [eventsIngressURL] - Ingress URL for Events. Default https://eventsingress.adobe.io (optional)
*/
declare type EventsCoreAPIOptions = {
timeout?: number;
retries?: number;
eventsBaseURL?: string;
eventsIngressURL?: string;
};

/**
Expand Down Expand Up @@ -39,19 +40,19 @@ declare class EventsCoreAPI {
/**
* Http options {retries, timeout}
*/
httpOptions: EventsCoreAPIOptions;
httpOptions: any;
/**
* The organization id from your integration
*/
organizationId: string;
organizationId: any;
/**
* The api key from your integration
*/
apiKey: string;
apiKey: any;
/**
* The JWT Token for the integration with IO Management API scope
*/
accessToken: string;
accessToken: any;
/**
* Fetch all the providers
* @param consumerOrgId - Consumer Org Id from the console
Expand Down Expand Up @@ -226,7 +227,7 @@ declare class EventsCoreAPI {
* @param [eventsJournalPollingOptions] - Journal polling options
* @returns observable to which the user can subscribe to in order to listen to events
*/
getEventsObservableFromJournal(journalUrl: string, eventsJournalOptions?: EventsJournalOptions, eventsJournalPollingOptions?: EventsJournalPollingOptions): Observable<object>;
getEventsObservableFromJournal(journalUrl: string, eventsJournalOptions?: EventsJournalOptions, eventsJournalPollingOptions?: EventsJournalPollingOptions): Observable;
/**
* Authenticating events by verifying digital signature
* @param event - JSON payload delivered to the registered webhook URL
Expand All @@ -238,7 +239,7 @@ declare class EventsCoreAPI {
* publicKeyPath2 : Relative path of ioevents public key retrieved from the x-adobe-public-key2-path header in each POST request to webhook
* @returns If signature matches return true else return false
*/
verifyDigitalSignatureForEvent(event: any, recipientClientId: string, signatureOptions?: SignatureOptions): boolean;
verifyDigitalSignatureForEvent(event: any, recipientClientId: any, signatureOptions: any): boolean;
}

/**
Expand Down Expand Up @@ -337,16 +338,3 @@ declare type EventsJournalPollingOptions = {
interval?: number;
};

/**
* @typedef {object} SignatureOptions
* @property [digiSignature1] - Value of digital signature retrieved from the x-adobe-digital-signature1 header in each POST request to webhook
* @property [digiSignature2] - Value of digital signature retrieved from the x-adobe-digital-signature2 header in each POST request to webhook
* @property [publicKeyUrl1] - Value of public key url retrieved from the x-adobe-public-key1-url header in each POST request to webhook
* @property [publicKeyUrl2] - Value of public key url retrieved from the x-adobe-public-key2-url header in each POST request to webhook
*/
declare type SignatureOptions = {
digiSignature1: string;
digiSignature2: string;
publicKeyUrl1: string;
publicKeyUrl2: string;
};

0 comments on commit 3ad455a

Please sign in to comment.