Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bottenderjs/messaging-apis
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: cc72282a84bd6f2176f63bec462b15ae4dd37265
Choose a base ref
...
head repository: bottenderjs/messaging-apis
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8d0a6e0549448e353ce90878b2fe1d71db1d0596
Choose a head ref
  • 16 commits
  • 16 files changed
  • 2 contributors

Commits on Sep 21, 2020

  1. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    5db69aa View commit details
  2. Verified

    This commit was signed with the committer’s verified signature.
    zimme Simon Fridlund
    Copy the full SHA
    62de122 View commit details
  3. Merge pull request #628 from Yoctol/messenger-persona-sender-action

    Messenger persona sender action
    chentsulin authored Sep 21, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    zimme Simon Fridlund
    Copy the full SHA
    e9cc422 View commit details
  4. 1.0.2 changelog

    chentsulin committed Sep 21, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    zimme Simon Fridlund
    Copy the full SHA
    9d3f6cb View commit details
  5. v1.0.2

    chentsulin committed Sep 21, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    zimme Simon Fridlund
    Copy the full SHA
    39aad59 View commit details

Commits on Oct 20, 2020

  1. Verified

    This commit was signed with the committer’s verified signature.
    zimme Simon Fridlund
    Copy the full SHA
    ea2276e View commit details
  2. 1.0.3 changelog

    chentsulin committed Oct 20, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    zimme Simon Fridlund
    Copy the full SHA
    709ad2c View commit details
  3. v1.0.3

    chentsulin committed Oct 20, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    zimme Simon Fridlund
    Copy the full SHA
    dcc5cc9 View commit details

Commits on Dec 4, 2020

  1. Verified

    This commit was signed with the committer’s verified signature.
    zimme Simon Fridlund
    Copy the full SHA
    fb10e8d View commit details

Commits on Dec 11, 2020

  1. chore(deps): bump ini from 1.3.5 to 1.3.7

    Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7.
    - [Release notes](https://github.com/isaacs/ini/releases)
    - [Commits](npm/ini@v1.3.5...v1.3.7)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Dec 11, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    zimme Simon Fridlund
    Copy the full SHA
    2ffd04d View commit details

Commits on Dec 18, 2020

  1. Merge pull request #632 from Yoctol/dependabot/npm_and_yarn/ini-1.3.7

    chore(deps): bump ini from 1.3.5 to 1.3.7
    chentsulin authored Dec 18, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5e2fbfe View commit details
  2. Merge pull request #631 from Yoctol/dependabot/npm_and_yarn/highlight…

    ….js-10.4.1
    
    chore(deps): bump highlight.js from 10.1.2 to 10.4.1
    chentsulin authored Dec 18, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    903981d View commit details

Commits on Jan 5, 2021

  1. chore(deps): bump axios from 0.19.2 to 0.21.1

    Bumps [axios](https://github.com/axios/axios) from 0.19.2 to 0.21.1.
    - [Release notes](https://github.com/axios/axios/releases)
    - [Changelog](https://github.com/axios/axios/blob/v0.21.1/CHANGELOG.md)
    - [Commits](axios/axios@v0.19.2...v0.21.1)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Jan 5, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    958f236 View commit details

Commits on Jan 6, 2021

  1. Merge pull request #633 from Yoctol/dependabot/npm_and_yarn/axios-0.21.1

    chore(deps): bump axios from 0.19.2 to 0.21.1
    chentsulin authored Jan 6, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4c53353 View commit details

Commits on Jan 11, 2021

  1. 1.0.4 changelog

    chentsulin committed Jan 11, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0576812 View commit details
  2. v1.0.4

    chentsulin committed Jan 11, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8d0a6e0 View commit details
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# 1.0.4 / 2021-01-11

- deps: bump axios.

# 1.0.3 / 2020-10-20

### messaging-api-slack

- fix: add the missing `warning` package.

# 1.0.2 / 2020-09-21

### messaging-api-messenger

- feat: add persona support to typing_on and typing_off

# 1.0.1 / 2020-09-21

- chore: remove namespace and export types from module instead #627
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
"lerna": "3.4.0",
"npmClient": "yarn",
"useWorkspaces": true,
"version": "1.0.1",
"version": "1.0.4",
"command": {
"publish": {
"ignoreChanges": [
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@
"@types/jest": "^26.0.10",
"@typescript-eslint/eslint-plugin": "^3.9.1",
"@typescript-eslint/parser": "^3.9.1",
"axios": "^0.19.2",
"axios": "^0.21.1",
"axios-mock-adapter": "^1.18.2",
"chalk": "^4.1.0",
"eslint": "^7.7.0",
4 changes: 2 additions & 2 deletions packages/axios-error/package.json
Original file line number Diff line number Diff line change
@@ -6,11 +6,11 @@
"type": "git",
"url": "https://github.com/Yoctol/messaging-apis.git"
},
"version": "1.0.0",
"version": "1.0.4",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"dependencies": {
"axios": "^0.19.2",
"axios": "^0.21.1",
"type-fest": "^0.15.1"
},
"keywords": [
2 changes: 1 addition & 1 deletion packages/facebook-batch/package.json
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
"type": "git",
"url": "https://github.com/Yoctol/messaging-apis.git"
},
"version": "1.0.1",
"version": "1.0.4",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"dependencies": {
4 changes: 2 additions & 2 deletions packages/messaging-api-common/package.json
Original file line number Diff line number Diff line change
@@ -6,14 +6,14 @@
"type": "git",
"url": "https://github.com/Yoctol/messaging-apis.git"
},
"version": "1.0.0",
"version": "1.0.4",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"dependencies": {
"@types/debug": "^4.1.5",
"@types/lodash": "^4.14.156",
"@types/url-join": "^4.0.0",
"axios": "^0.19.2",
"axios": "^0.21.1",
"camel-case": "^4.1.1",
"debug": "^4.1.1",
"lodash": "^4.17.15",
4 changes: 2 additions & 2 deletions packages/messaging-api-line/package.json
Original file line number Diff line number Diff line change
@@ -6,13 +6,13 @@
"type": "git",
"url": "https://github.com/Yoctol/messaging-apis.git"
},
"version": "1.0.1",
"version": "1.0.4",
"main": "dist/index.js",
"browser": "lib/browser.js",
"types": "dist/index.d.ts",
"dependencies": {
"@types/warning": "^3.0.0",
"axios": "^0.19.2",
"axios": "^0.21.1",
"axios-error": "file:../axios-error",
"image-type": "^4.1.0",
"messaging-api-common": "file:../messaging-api-common",
4 changes: 2 additions & 2 deletions packages/messaging-api-messenger/package.json
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
"type": "git",
"url": "https://github.com/Yoctol/messaging-apis.git"
},
"version": "1.0.1",
"version": "1.0.4",
"main": "dist/index.js",
"browser": "lib/browser.js",
"types": "dist/index.d.ts",
@@ -15,7 +15,7 @@
"@types/lodash": "^4.14.156",
"@types/warning": "^3.0.0",
"append-query": "^2.1.0",
"axios": "^0.19.2",
"axios": "^0.21.1",
"axios-error": "file:../axios-error",
"form-data": "^3.0.0",
"lodash": "^4.17.15",
11 changes: 7 additions & 4 deletions packages/messaging-api-messenger/src/MessengerBatch.ts
Original file line number Diff line number Diff line change
@@ -375,7 +375,8 @@ function deleteUserPersistentMenu(
function sendSenderAction(
psidOrRecipient: MessengerTypes.PsidOrRecipient,
senderAction: MessengerTypes.SenderAction,
options: MessengerTypes.SendOption & MessengerTypes.BatchRequestOptions = {}
options: MessengerTypes.SenderActionOption &
MessengerTypes.BatchRequestOptions = {}
): MessengerTypes.BatchItem {
const recipient =
typeof psidOrRecipient === 'string'
@@ -398,21 +399,23 @@ function sendSenderAction(

function typingOn(
idOrRecipient: MessengerTypes.PsidOrRecipient,
options?: MessengerTypes.SendOption & MessengerTypes.BatchRequestOptions
options?: MessengerTypes.SenderActionOption &
MessengerTypes.BatchRequestOptions
): MessengerTypes.BatchItem {
return sendSenderAction(idOrRecipient, 'typing_on', options);
}

function typingOff(
idOrRecipient: MessengerTypes.PsidOrRecipient,
options?: MessengerTypes.SendOption & MessengerTypes.BatchRequestOptions
options?: MessengerTypes.SenderActionOption &
MessengerTypes.BatchRequestOptions
): MessengerTypes.BatchItem {
return sendSenderAction(idOrRecipient, 'typing_off', options);
}

function markSeen(
idOrRecipient: MessengerTypes.PsidOrRecipient,
options?: MessengerTypes.SendOption & MessengerTypes.BatchRequestOptions
options?: MessengerTypes.BatchRequestOptions
): MessengerTypes.BatchItem {
return sendSenderAction(idOrRecipient, 'mark_seen', options);
}
31 changes: 25 additions & 6 deletions packages/messaging-api-messenger/src/MessengerClient.ts
Original file line number Diff line number Diff line change
@@ -2161,6 +2161,8 @@ export default class MessengerClient {
*
* @param psidOrRecipient - A facebook page-scoped ID of the recipient or a recipient object
* @param senderAction - Message state to display to the user. One of `typing_on`, `typing_off` or `mark_seen`
* @param options - Other optional parameters.
* @param options.personaId - ID of the persona.
* @returns An object includes recipientId
*
* @see https://developers.facebook.com/docs/messenger-platform/send-messages/sender-actions
@@ -2169,11 +2171,15 @@ export default class MessengerClient {
*
* ```js
* await client.sendSenderAction(USER_ID, 'typing_on');
*
* // Or with persona:
* await client.sendSenderAction(USER_ID, 'typing_on', { personaId: '<PERSONA_ID>' });
* ```
*/
sendSenderAction(
psidOrRecipient: MessengerTypes.PsidOrRecipient,
senderAction: MessengerTypes.SenderAction
senderAction: MessengerTypes.SenderAction,
options?: MessengerTypes.SenderActionOption
): Promise<MessengerTypes.SendSenderActionResponse> {
const recipient =
typeof psidOrRecipient === 'string'
@@ -2184,6 +2190,7 @@ export default class MessengerClient {
return this.sendRawBody({
recipient,
senderAction,
...options,
});
}

@@ -2211,6 +2218,8 @@ export default class MessengerClient {
* Turns typing indicators on for the specified user.
*
* @param psidOrRecipient - A facebook page-scoped ID of the recipient or a recipient object
* @param options - Other optional parameters.
* @param options.personaId - ID of the persona.
* @returns An object includes recipientId
*
* @see https://developers.facebook.com/docs/messenger-platform/send-messages/sender-actions#supported_actions
@@ -2219,18 +2228,24 @@ export default class MessengerClient {
*
* ```js
* await client.typingOn(USER_ID);
*
* // Or with persona:
* await client.typingOn(USER_ID, { personaId: '<PERSONA_ID>' });
* ```
* */
typingOn(
psidOrRecipient: MessengerTypes.PsidOrRecipient
psidOrRecipient: MessengerTypes.PsidOrRecipient,
options?: MessengerTypes.SenderActionOption
): Promise<MessengerTypes.SendSenderActionResponse> {
return this.sendSenderAction(psidOrRecipient, 'typing_on');
return this.sendSenderAction(psidOrRecipient, 'typing_on', options);
}

/**
* Turns typing indicators off for the specified user.
*
* @param psidOrRecipient - A facebook page-scoped ID of the recipient or a recipient object
* @param options - Other optional parameters.
* @param options.personaId - ID of the persona.
* @returns An object includes recipientId
*
* @see https://developers.facebook.com/docs/messenger-platform/send-messages/sender-actions#supported_actions
@@ -2239,12 +2254,16 @@ export default class MessengerClient {
*
* ```js
* await client.typingOff(USER_ID);
*
* // Or with persona:
* await client.typingOff(USER_ID, { personaId: '<PERSONA_ID>' });
* ```
*/
typingOff(
psidOrRecipient: MessengerTypes.PsidOrRecipient
psidOrRecipient: MessengerTypes.PsidOrRecipient,
options?: MessengerTypes.SenderActionOption
): Promise<MessengerTypes.SendSenderActionResponse> {
return this.sendSenderAction(psidOrRecipient, 'typing_off');
return this.sendSenderAction(psidOrRecipient, 'typing_off', options);
}

/**
@@ -2453,7 +2472,7 @@ export default class MessengerClient {
*/
getAssociatedLabels(
userId: string,
options: { accessToken?: string; fields?: string[] } = {}
options: { fields?: string[] } = {}
): Promise<{
data: { name: string; id: string }[];
paging: {
5 changes: 5 additions & 0 deletions packages/messaging-api-messenger/src/MessengerTypes.ts
Original file line number Diff line number Diff line change
@@ -185,6 +185,11 @@ export type SendOption = {
messagingType?: MessagingType;
tag?: MessageTag;
quickReplies?: QuickReply[];
personaId?: string;
};

export type SenderActionOption = {
personaId?: string;
};

export type UploadOption = {
11 changes: 6 additions & 5 deletions packages/messaging-api-slack/package.json
Original file line number Diff line number Diff line change
@@ -6,17 +6,18 @@
"type": "git",
"url": "https://github.com/Yoctol/messaging-apis.git"
},
"version": "1.0.1",
"version": "1.0.4",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"dependencies": {
"@types/lodash": "^4.14.156",
"@types/warning": "^3.0.0",
"axios": "^0.19.2",
"axios-error": "^1.0.0",
"axios": "^0.21.1",
"axios-error": "^1.0.4",
"lodash": "^4.17.15",
"messaging-api-common": "^1.0.0",
"ts-invariant": "^0.4.4"
"messaging-api-common": "^1.0.4",
"ts-invariant": "^0.4.4",
"warning": "^4.0.3"
},
"keywords": [
"bot",
4 changes: 2 additions & 2 deletions packages/messaging-api-telegram/package.json
Original file line number Diff line number Diff line change
@@ -6,13 +6,13 @@
"type": "git",
"url": "https://github.com/Yoctol/messaging-apis.git"
},
"version": "1.0.1",
"version": "1.0.4",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"dependencies": {
"@types/lodash": "^4.14.156",
"@types/warning": "^3.0.0",
"axios": "^0.19.2",
"axios": "^0.21.1",
"axios-error": "file:../axios-error",
"lodash": "^4.17.15",
"messaging-api-common": "file:../messaging-api-common",
4 changes: 2 additions & 2 deletions packages/messaging-api-viber/package.json
Original file line number Diff line number Diff line change
@@ -6,12 +6,12 @@
"type": "git",
"url": "https://github.com/Yoctol/messaging-apis.git"
},
"version": "1.0.1",
"version": "1.0.4",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"dependencies": {
"@types/warning": "^3.0.0",
"axios": "^0.19.2",
"axios": "^0.21.1",
"axios-error": "file:../axios-error",
"messaging-api-common": "file:../messaging-api-common",
"ts-invariant": "^0.4.4",
4 changes: 2 additions & 2 deletions packages/messaging-api-wechat/package.json
Original file line number Diff line number Diff line change
@@ -6,12 +6,12 @@
"type": "git",
"url": "https://github.com/Yoctol/messaging-apis.git"
},
"version": "1.0.1",
"version": "1.0.4",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"dependencies": {
"@types/warning": "^3.0.0",
"axios": "^0.19.2",
"axios": "^0.21.1",
"axios-error": "file:../axios-error",
"form-data": "^3.0.0",
"messaging-api-common": "file:../messaging-api-common",
Loading