@dereekb/trello 13.11.18 → 13.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -797,6 +797,23 @@ function _ts_generator$3(thisArg, body) {
797
797
  return context.fetchJson("/boards/".concat(input.boardId, "/members"), 'GET');
798
798
  };
799
799
  }
800
+ /**
801
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-actions-get.
802
+ *
803
+ * Returns the board action stream. Useful for list-movement audits via `filter: 'updateCard:idList'` paired with
804
+ * the {@link TrelloUpdateCardIdListActionData} payload type — answers "which cards moved into list X since time Y?".
805
+ *
806
+ * @param context - The Trello API context.
807
+ * @returns Lists actions on a board.
808
+ */ function listBoardActions(context) {
809
+ return function(input) {
810
+ var boardId = input.boardId, query = _object_without_properties$4(input, [
811
+ "boardId"
812
+ ]);
813
+ var queryString = fetch.makeUrlSearchParams(query);
814
+ return context.fetchJson("/boards/".concat(boardId, "/actions?").concat(queryString), 'GET');
815
+ };
816
+ }
800
817
 
801
818
  function _object_without_properties$3(source, excluded) {
802
819
  if (source == null) return {};
@@ -1994,6 +2011,7 @@ exports.getMe = getMe;
1994
2011
  exports.getMember = getMember;
1995
2012
  exports.getWebhook = getWebhook;
1996
2013
  exports.handleTrelloErrorFetch = handleTrelloErrorFetch;
2014
+ exports.listBoardActions = listBoardActions;
1997
2015
  exports.listBoardCards = listBoardCards;
1998
2016
  exports.listBoardLabels = listBoardLabels;
1999
2017
  exports.listBoardLists = listBoardLists;
package/index.esm.js CHANGED
@@ -795,6 +795,23 @@ function _ts_generator$3(thisArg, body) {
795
795
  return context.fetchJson("/boards/".concat(input.boardId, "/members"), 'GET');
796
796
  };
797
797
  }
798
+ /**
799
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-actions-get.
800
+ *
801
+ * Returns the board action stream. Useful for list-movement audits via `filter: 'updateCard:idList'` paired with
802
+ * the {@link TrelloUpdateCardIdListActionData} payload type — answers "which cards moved into list X since time Y?".
803
+ *
804
+ * @param context - The Trello API context.
805
+ * @returns Lists actions on a board.
806
+ */ function listBoardActions(context) {
807
+ return function(input) {
808
+ var boardId = input.boardId, query = _object_without_properties$4(input, [
809
+ "boardId"
810
+ ]);
811
+ var queryString = makeUrlSearchParams(query);
812
+ return context.fetchJson("/boards/".concat(boardId, "/actions?").concat(queryString), 'GET');
813
+ };
814
+ }
798
815
 
799
816
  function _object_without_properties$3(source, excluded) {
800
817
  if (source == null) return {};
@@ -1961,4 +1978,4 @@ function _object_spread_props(target, source) {
1961
1978
  }));
1962
1979
  }
1963
1980
 
1964
- export { DEFAULT_TRELLO_API_RATE_LIMIT, DEFAULT_TRELLO_API_RATE_LIMIT_RESET_PERIOD, TRELLO_API_URL, TRELLO_MAX_PAGE_LIMIT, TrelloInvalidTokenError, TrelloServerError, TrelloServerFetchResponseError, TrelloTooManyRequestsError, addAttachmentToCard, addCommentToCard, addLabelToCard, addMemberToCard, buildTrelloPageResult, createBoard, createCard, createList, createWebhook, defaultTrelloPageItemIdReader, deleteAttachmentFromCard, deleteBoard, deleteCard, deleteWebhook, downloadCardAttachment, getBoard, getCard, getCardAttachment, getList, getMe, getMember, getWebhook, handleTrelloErrorFetch, listBoardCards, listBoardLabels, listBoardLists, listBoardMembers, listCardActions, listCardAttachments, listCardsInList, listWebhooksForToken, logTrelloErrorToConsole, logTrelloServerErrorFunction, parseTrelloApiError, trelloActionIdReader, trelloFactory, trelloFetchPageFactory, trelloRateLimitedFetchHandler, updateBoard, updateCard, updateList, updateWebhook };
1981
+ export { DEFAULT_TRELLO_API_RATE_LIMIT, DEFAULT_TRELLO_API_RATE_LIMIT_RESET_PERIOD, TRELLO_API_URL, TRELLO_MAX_PAGE_LIMIT, TrelloInvalidTokenError, TrelloServerError, TrelloServerFetchResponseError, TrelloTooManyRequestsError, addAttachmentToCard, addCommentToCard, addLabelToCard, addMemberToCard, buildTrelloPageResult, createBoard, createCard, createList, createWebhook, defaultTrelloPageItemIdReader, deleteAttachmentFromCard, deleteBoard, deleteCard, deleteWebhook, downloadCardAttachment, getBoard, getCard, getCardAttachment, getList, getMe, getMember, getWebhook, handleTrelloErrorFetch, listBoardActions, listBoardCards, listBoardLabels, listBoardLists, listBoardMembers, listCardActions, listCardAttachments, listCardsInList, listWebhooksForToken, logTrelloErrorToConsole, logTrelloServerErrorFunction, parseTrelloApiError, trelloActionIdReader, trelloFactory, trelloFetchPageFactory, trelloRateLimitedFetchHandler, updateBoard, updateCard, updateList, updateWebhook };
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@dereekb/trello/nestjs",
3
- "version": "13.11.18",
3
+ "version": "13.12.0",
4
4
  "peerDependencies": {
5
- "@dereekb/nestjs": "13.11.18",
6
- "@dereekb/rxjs": "13.11.18",
7
- "@dereekb/trello": "13.11.18",
8
- "@dereekb/util": "13.11.18",
5
+ "@dereekb/nestjs": "13.12.0",
6
+ "@dereekb/rxjs": "13.12.0",
7
+ "@dereekb/trello": "13.12.0",
8
+ "@dereekb/util": "13.12.0",
9
9
  "@nestjs/common": "^11.1.19",
10
10
  "@nestjs/config": "^4.0.4",
11
11
  "express": "^5.2.1"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/trello",
3
- "version": "13.11.18",
3
+ "version": "13.12.0",
4
4
  "exports": {
5
5
  "./nestjs": {
6
6
  "module": "./nestjs/index.esm.js",
@@ -17,9 +17,9 @@
17
17
  }
18
18
  },
19
19
  "peerDependencies": {
20
- "@dereekb/nestjs": "13.11.18",
21
- "@dereekb/rxjs": "13.11.18",
22
- "@dereekb/util": "13.11.18",
20
+ "@dereekb/nestjs": "13.12.0",
21
+ "@dereekb/rxjs": "13.12.0",
22
+ "@dereekb/util": "13.12.0",
23
23
  "@nestjs/common": "^11.1.19",
24
24
  "@nestjs/config": "^4.0.4",
25
25
  "express": "^5.2.1",
@@ -2,7 +2,8 @@ import { type TrelloContext } from './trello.factory';
2
2
  import { type TrelloBoardId, type TrelloMemberId } from '../trello.type';
3
3
  import { type CreateBoardBody, type TrelloBoard, type UpdateBoardBody } from './trello.api.board.type';
4
4
  import { type TrelloList } from './trello.api.list.type';
5
- import { type TrelloCard, type TrelloLabel } from './trello.api.card.type';
5
+ import { type TrelloAction, type TrelloCard, type TrelloLabel } from './trello.api.card.type';
6
+ import { type TrelloActionType } from './trello.api.card';
6
7
  import { type TrelloMember } from './trello.api.member.type';
7
8
  export interface GetBoardInput {
8
9
  readonly boardId: TrelloBoardId;
@@ -101,3 +102,35 @@ export type ListBoardMembersFunction = (input: ListBoardMembersInput) => Promise
101
102
  * @returns Lists all members of a board.
102
103
  */
103
104
  export declare function listBoardMembers(context: TrelloContext): ListBoardMembersFunction;
105
+ export interface ListBoardActionsInput {
106
+ readonly boardId: TrelloBoardId;
107
+ /**
108
+ * Comma-separated list of action types to include, or `all`. Examples: `'updateCard:idList'`, `'updateCard:idList,createCard'`.
109
+ *
110
+ * @see https://developer.atlassian.com/cloud/trello/guides/rest-api/action-types/
111
+ */
112
+ readonly filter?: TrelloActionType;
113
+ /**
114
+ * Maximum number of actions to return. Defaults to 50 server-side; max is 1000.
115
+ */
116
+ readonly limit?: number;
117
+ /**
118
+ * Cursor: return actions before this action id (older). Also accepts an ISO 8601 date string.
119
+ */
120
+ readonly before?: string;
121
+ /**
122
+ * Cursor: return actions since this action id (newer). Also accepts an ISO 8601 date string.
123
+ */
124
+ readonly since?: string;
125
+ }
126
+ export type ListBoardActionsFunction = <D = unknown>(input: ListBoardActionsInput) => Promise<ReadonlyArray<TrelloAction<D>>>;
127
+ /**
128
+ * Https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-actions-get.
129
+ *
130
+ * Returns the board action stream. Useful for list-movement audits via `filter: 'updateCard:idList'` paired with
131
+ * the {@link TrelloUpdateCardIdListActionData} payload type — answers "which cards moved into list X since time Y?".
132
+ *
133
+ * @param context - The Trello API context.
134
+ * @returns Lists actions on a board.
135
+ */
136
+ export declare function listBoardActions(context: TrelloContext): ListBoardActionsFunction;
@@ -139,3 +139,33 @@ export interface TrelloCommentCardActionData {
139
139
  };
140
140
  }
141
141
  export type TrelloCommentCardAction = TrelloAction<TrelloCommentCardActionData>;
142
+ /**
143
+ * Payload of an `updateCard:idList` action — emitted by Trello whenever a card moves between lists.
144
+ *
145
+ * Pair with `listBoardActions(...)<TrelloUpdateCardIdListActionData>({ filter: 'updateCard:idList', ... })`
146
+ * to audit list movements.
147
+ */
148
+ export interface TrelloUpdateCardIdListActionData {
149
+ readonly card: {
150
+ readonly id: TrelloCardId;
151
+ readonly idShort?: number;
152
+ readonly name?: string;
153
+ readonly shortLink?: string;
154
+ };
155
+ readonly old?: {
156
+ readonly idList?: TrelloListId;
157
+ };
158
+ readonly listAfter?: {
159
+ readonly id: TrelloListId;
160
+ readonly name?: string;
161
+ };
162
+ readonly listBefore?: {
163
+ readonly id: TrelloListId;
164
+ readonly name?: string;
165
+ };
166
+ readonly board?: {
167
+ readonly id: TrelloBoardId;
168
+ readonly name?: string;
169
+ };
170
+ }
171
+ export type TrelloUpdateCardIdListAction = TrelloAction<TrelloUpdateCardIdListActionData>;