@dereekb/trello 13.11.14 → 13.11.15
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 +102 -98
- package/index.esm.js +102 -98
- package/nestjs/index.cjs.js +28 -16
- package/nestjs/index.esm.js +28 -16
- package/nestjs/package.json +5 -5
- package/nestjs/src/lib/trello/trello.module.d.ts +2 -2
- package/nestjs/src/lib/webhook/webhook.trello.d.ts +1 -1
- package/nestjs/src/lib/webhook/webhook.trello.module.d.ts +1 -1
- package/nestjs/src/lib/webhook/webhook.trello.verify.d.ts +6 -6
- package/package.json +4 -4
- package/src/lib/trello/trello.api.board.d.ts +24 -24
- package/src/lib/trello/trello.api.board.type.d.ts +4 -2
- package/src/lib/trello/trello.api.card.d.ts +30 -26
- package/src/lib/trello/trello.api.list.d.ts +12 -12
- package/src/lib/trello/trello.api.member.d.ts +6 -7
- package/src/lib/trello/trello.api.webhook.d.ts +14 -14
- package/src/lib/trello/trello.factory.d.ts +2 -1
- package/src/lib/trello.api.page.d.ts +9 -7
- package/src/lib/trello.config.d.ts +2 -2
- package/src/lib/trello.error.api.d.ts +7 -5
- package/src/lib/trello.limit.d.ts +2 -1
package/nestjs/index.esm.js
CHANGED
|
@@ -340,7 +340,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
340
340
|
*
|
|
341
341
|
* Reads `TRELLO_API_KEY` and `TRELLO_API_TOKEN` from the environment.
|
|
342
342
|
*
|
|
343
|
-
* @param configService The NestJS ConfigService.
|
|
343
|
+
* @param configService - The NestJS ConfigService.
|
|
344
344
|
* @returns A validated TrelloServiceConfig.
|
|
345
345
|
*/ function trelloServiceConfigFactory(configService) {
|
|
346
346
|
var config = {
|
|
@@ -355,7 +355,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
355
355
|
/**
|
|
356
356
|
* Convenience function used to generate ModuleMetadata for an app's TrelloModule.
|
|
357
357
|
*
|
|
358
|
-
* @param config Optional additional module metadata overrides.
|
|
358
|
+
* @param config - Optional additional module metadata overrides.
|
|
359
359
|
* @returns Module metadata for the Trello module.
|
|
360
360
|
*/ function appTrelloModuleMetadata(config) {
|
|
361
361
|
var _ref = config !== null && config !== void 0 ? config : {}, imports = _ref.imports, exports = _ref.exports, providers = _ref.providers;
|
|
@@ -450,7 +450,7 @@ function _object_spread_props(target, source) {
|
|
|
450
450
|
/**
|
|
451
451
|
* Re-narrows an UntypedTrelloWebhookEvent's payload to the given action data type.
|
|
452
452
|
*
|
|
453
|
-
* @param event The untyped event.
|
|
453
|
+
* @param event - The untyped event.
|
|
454
454
|
* @returns A typed view over the same event.
|
|
455
455
|
*/ function trelloWebhookEvent(event) {
|
|
456
456
|
return {
|
|
@@ -540,9 +540,9 @@ var TRELLO_WEBHOOK_CALLBACK_URL_ENV_VAR = 'TRELLO_WEBHOOK_CALLBACK_URL';
|
|
|
540
540
|
*
|
|
541
541
|
* Exported for testability.
|
|
542
542
|
*
|
|
543
|
-
* @param appSecret The Trello app secret.
|
|
544
|
-
* @param rawBody The raw request body bytes.
|
|
545
|
-
* @param callbackUrl The exact callback URL configured for this webhook.
|
|
543
|
+
* @param appSecret - The Trello app secret.
|
|
544
|
+
* @param rawBody - The raw request body bytes.
|
|
545
|
+
* @param callbackUrl - The exact callback URL configured for this webhook.
|
|
546
546
|
* @returns The expected base64 signature value.
|
|
547
547
|
*/ function trelloWebhookExpectedSignature(appSecret, rawBody, callbackUrl) {
|
|
548
548
|
var hmac = createHmac('sha1', appSecret);
|
|
@@ -553,15 +553,20 @@ var TRELLO_WEBHOOK_CALLBACK_URL_ENV_VAR = 'TRELLO_WEBHOOK_CALLBACK_URL';
|
|
|
553
553
|
/**
|
|
554
554
|
* Verifies a Trello webhook event header.
|
|
555
555
|
*
|
|
556
|
-
* @
|
|
556
|
+
* @param config - The verifier configuration.
|
|
557
|
+
* @returns Verifies a Trello webhook event.
|
|
557
558
|
*
|
|
558
|
-
* @
|
|
559
|
-
* @returns A function that verifies a Trello webhook event.
|
|
559
|
+
* @see https://developer.atlassian.com/cloud/trello/guides/rest-api/webhooks/#webhook-signatures
|
|
560
560
|
*/ function trelloWebhookEventVerifier(config) {
|
|
561
561
|
var appSecret = config.appSecret, callbackUrl = config.callbackUrl;
|
|
562
562
|
return function(request, rawBody) {
|
|
563
563
|
var headerValue = request.headers['x-trello-webhook'];
|
|
564
|
-
var signature
|
|
564
|
+
var signature;
|
|
565
|
+
if (typeof headerValue === 'string') {
|
|
566
|
+
signature = headerValue;
|
|
567
|
+
} else if (Array.isArray(headerValue)) {
|
|
568
|
+
signature = headerValue[0];
|
|
569
|
+
}
|
|
565
570
|
var valid = false;
|
|
566
571
|
if (signature) {
|
|
567
572
|
var expected = trelloWebhookExpectedSignature(appSecret, rawBody, callbackUrl);
|
|
@@ -570,19 +575,26 @@ var TRELLO_WEBHOOK_CALLBACK_URL_ENV_VAR = 'TRELLO_WEBHOOK_CALLBACK_URL';
|
|
|
570
575
|
valid = expectedBuffer.length === signatureBuffer.length && timingSafeEqual(expectedBuffer, signatureBuffer);
|
|
571
576
|
}
|
|
572
577
|
var event;
|
|
578
|
+
var result;
|
|
573
579
|
if (valid) {
|
|
574
580
|
try {
|
|
575
581
|
event = JSON.parse(rawBody.toString('utf8'));
|
|
582
|
+
result = {
|
|
583
|
+
valid: valid,
|
|
584
|
+
event: event
|
|
585
|
+
};
|
|
576
586
|
} catch (unused) {
|
|
577
|
-
|
|
587
|
+
result = {
|
|
578
588
|
valid: false
|
|
579
589
|
};
|
|
580
590
|
}
|
|
591
|
+
} else {
|
|
592
|
+
result = {
|
|
593
|
+
valid: valid,
|
|
594
|
+
event: event
|
|
595
|
+
};
|
|
581
596
|
}
|
|
582
|
-
return
|
|
583
|
-
valid: valid,
|
|
584
|
-
event: event
|
|
585
|
-
};
|
|
597
|
+
return result;
|
|
586
598
|
};
|
|
587
599
|
}
|
|
588
600
|
|
|
@@ -1063,7 +1075,7 @@ function _class_call_check(instance, Constructor) {
|
|
|
1063
1075
|
*
|
|
1064
1076
|
* Reads `TRELLO_APP_SECRET` and `TRELLO_WEBHOOK_CALLBACK_URL` from the environment.
|
|
1065
1077
|
*
|
|
1066
|
-
* @param configService The NestJS ConfigService.
|
|
1078
|
+
* @param configService - The NestJS ConfigService.
|
|
1067
1079
|
* @returns A validated TrelloWebhookServiceConfig.
|
|
1068
1080
|
*/ function trelloWebhookServiceConfigFactory(configService) {
|
|
1069
1081
|
var config = {
|
package/nestjs/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/trello/nestjs",
|
|
3
|
-
"version": "13.11.
|
|
3
|
+
"version": "13.11.15",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@dereekb/nestjs": "13.11.
|
|
6
|
-
"@dereekb/rxjs": "13.11.
|
|
7
|
-
"@dereekb/trello": "13.11.
|
|
8
|
-
"@dereekb/util": "13.11.
|
|
5
|
+
"@dereekb/nestjs": "13.11.15",
|
|
6
|
+
"@dereekb/rxjs": "13.11.15",
|
|
7
|
+
"@dereekb/trello": "13.11.15",
|
|
8
|
+
"@dereekb/util": "13.11.15",
|
|
9
9
|
"@nestjs/common": "^11.1.19",
|
|
10
10
|
"@nestjs/config": "^4.0.4",
|
|
11
11
|
"express": "^5.2.1"
|
|
@@ -6,7 +6,7 @@ import { TrelloServiceConfig } from './trello.config';
|
|
|
6
6
|
*
|
|
7
7
|
* Reads `TRELLO_API_KEY` and `TRELLO_API_TOKEN` from the environment.
|
|
8
8
|
*
|
|
9
|
-
* @param configService The NestJS ConfigService.
|
|
9
|
+
* @param configService - The NestJS ConfigService.
|
|
10
10
|
* @returns A validated TrelloServiceConfig.
|
|
11
11
|
*/
|
|
12
12
|
export declare function trelloServiceConfigFactory(configService: ConfigService): TrelloServiceConfig;
|
|
@@ -15,7 +15,7 @@ export interface ProvideAppTrelloMetadataConfig extends Pick<ModuleMetadata, 'im
|
|
|
15
15
|
/**
|
|
16
16
|
* Convenience function used to generate ModuleMetadata for an app's TrelloModule.
|
|
17
17
|
*
|
|
18
|
-
* @param config Optional additional module metadata overrides.
|
|
18
|
+
* @param config - Optional additional module metadata overrides.
|
|
19
19
|
* @returns Module metadata for the Trello module.
|
|
20
20
|
*/
|
|
21
21
|
export declare function appTrelloModuleMetadata(config?: ProvideAppTrelloMetadataConfig): ModuleMetadata;
|
|
@@ -31,7 +31,7 @@ export declare const TRELLO_WEBHOOK_UPDATE_BOARD_ACTION_TYPE = "updateBoard";
|
|
|
31
31
|
/**
|
|
32
32
|
* Re-narrows an UntypedTrelloWebhookEvent's payload to the given action data type.
|
|
33
33
|
*
|
|
34
|
-
* @param event The untyped event.
|
|
34
|
+
* @param event - The untyped event.
|
|
35
35
|
* @returns A typed view over the same event.
|
|
36
36
|
*/
|
|
37
37
|
export declare function trelloWebhookEvent<D>(event: UntypedTrelloWebhookEvent): TrelloWebhookEvent<D>;
|
|
@@ -5,7 +5,7 @@ import { TrelloWebhookServiceConfig } from './webhook.trello.config';
|
|
|
5
5
|
*
|
|
6
6
|
* Reads `TRELLO_APP_SECRET` and `TRELLO_WEBHOOK_CALLBACK_URL` from the environment.
|
|
7
7
|
*
|
|
8
|
-
* @param configService The NestJS ConfigService.
|
|
8
|
+
* @param configService - The NestJS ConfigService.
|
|
9
9
|
* @returns A validated TrelloWebhookServiceConfig.
|
|
10
10
|
*/
|
|
11
11
|
export declare function trelloWebhookServiceConfigFactory(configService: ConfigService): TrelloWebhookServiceConfig;
|
|
@@ -29,18 +29,18 @@ export interface TrelloWebhookEventVerifierConfig {
|
|
|
29
29
|
*
|
|
30
30
|
* Exported for testability.
|
|
31
31
|
*
|
|
32
|
-
* @param appSecret The Trello app secret.
|
|
33
|
-
* @param rawBody The raw request body bytes.
|
|
34
|
-
* @param callbackUrl The exact callback URL configured for this webhook.
|
|
32
|
+
* @param appSecret - The Trello app secret.
|
|
33
|
+
* @param rawBody - The raw request body bytes.
|
|
34
|
+
* @param callbackUrl - The exact callback URL configured for this webhook.
|
|
35
35
|
* @returns The expected base64 signature value.
|
|
36
36
|
*/
|
|
37
37
|
export declare function trelloWebhookExpectedSignature(appSecret: TrelloAppSecret, rawBody: Buffer, callbackUrl: string): string;
|
|
38
38
|
/**
|
|
39
39
|
* Verifies a Trello webhook event header.
|
|
40
40
|
*
|
|
41
|
-
* @
|
|
41
|
+
* @param config - The verifier configuration.
|
|
42
|
+
* @returns Verifies a Trello webhook event.
|
|
42
43
|
*
|
|
43
|
-
* @
|
|
44
|
-
* @returns A function that verifies a Trello webhook event.
|
|
44
|
+
* @see https://developer.atlassian.com/cloud/trello/guides/rest-api/webhooks/#webhook-signatures
|
|
45
45
|
*/
|
|
46
46
|
export declare function trelloWebhookEventVerifier(config: TrelloWebhookEventVerifierConfig): TrelloWebhookEventVerifier;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/trello",
|
|
3
|
-
"version": "13.11.
|
|
3
|
+
"version": "13.11.15",
|
|
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.
|
|
21
|
-
"@dereekb/rxjs": "13.11.
|
|
22
|
-
"@dereekb/util": "13.11.
|
|
20
|
+
"@dereekb/nestjs": "13.11.15",
|
|
21
|
+
"@dereekb/rxjs": "13.11.15",
|
|
22
|
+
"@dereekb/util": "13.11.15",
|
|
23
23
|
"@nestjs/common": "^11.1.19",
|
|
24
24
|
"@nestjs/config": "^4.0.4",
|
|
25
25
|
"express": "^5.2.1",
|
|
@@ -9,18 +9,18 @@ export interface GetBoardInput {
|
|
|
9
9
|
}
|
|
10
10
|
export type GetBoardFunction = (input: GetBoardInput) => Promise<TrelloBoard>;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-get.
|
|
13
13
|
*
|
|
14
|
-
* @param context The Trello API context.
|
|
15
|
-
* @returns
|
|
14
|
+
* @param context - The Trello API context.
|
|
15
|
+
* @returns Retrieves a board by id.
|
|
16
16
|
*/
|
|
17
17
|
export declare function getBoard(context: TrelloContext): GetBoardFunction;
|
|
18
18
|
export type CreateBoardFunction = (input: CreateBoardBody) => Promise<TrelloBoard>;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-post.
|
|
21
21
|
*
|
|
22
|
-
* @param context The Trello API context.
|
|
23
|
-
* @returns
|
|
22
|
+
* @param context - The Trello API context.
|
|
23
|
+
* @returns Creates a new board.
|
|
24
24
|
*/
|
|
25
25
|
export declare function createBoard(context: TrelloContext): CreateBoardFunction;
|
|
26
26
|
export interface UpdateBoardInput extends UpdateBoardBody {
|
|
@@ -28,18 +28,18 @@ export interface UpdateBoardInput extends UpdateBoardBody {
|
|
|
28
28
|
}
|
|
29
29
|
export type UpdateBoardFunction = (input: UpdateBoardInput) => Promise<TrelloBoard>;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* Https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-put.
|
|
32
32
|
*
|
|
33
|
-
* @param context The Trello API context.
|
|
34
|
-
* @returns
|
|
33
|
+
* @param context - The Trello API context.
|
|
34
|
+
* @returns Updates an existing board.
|
|
35
35
|
*/
|
|
36
36
|
export declare function updateBoard(context: TrelloContext): UpdateBoardFunction;
|
|
37
37
|
export type DeleteBoardFunction = (input: GetBoardInput) => Promise<void>;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* Https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-delete.
|
|
40
40
|
*
|
|
41
|
-
* @param context The Trello API context.
|
|
42
|
-
* @returns
|
|
41
|
+
* @param context - The Trello API context.
|
|
42
|
+
* @returns Deletes a board.
|
|
43
43
|
*/
|
|
44
44
|
export declare function deleteBoard(context: TrelloContext): DeleteBoardFunction;
|
|
45
45
|
export interface ListBoardListsInput {
|
|
@@ -53,10 +53,10 @@ export interface ListBoardListsInput {
|
|
|
53
53
|
}
|
|
54
54
|
export type ListBoardListsFunction = (input: ListBoardListsInput) => Promise<ReadonlyArray<TrelloList>>;
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
56
|
+
* Https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-lists-get.
|
|
57
57
|
*
|
|
58
|
-
* @param context The Trello API context.
|
|
59
|
-
* @returns
|
|
58
|
+
* @param context - The Trello API context.
|
|
59
|
+
* @returns Lists all lists on a board.
|
|
60
60
|
*/
|
|
61
61
|
export declare function listBoardLists(context: TrelloContext): ListBoardListsFunction;
|
|
62
62
|
export interface ListBoardCardsInput {
|
|
@@ -65,10 +65,10 @@ export interface ListBoardCardsInput {
|
|
|
65
65
|
}
|
|
66
66
|
export type ListBoardCardsFunction = (input: ListBoardCardsInput) => Promise<ReadonlyArray<TrelloCard>>;
|
|
67
67
|
/**
|
|
68
|
-
*
|
|
68
|
+
* Https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-cards-get.
|
|
69
69
|
*
|
|
70
|
-
* @param context The Trello API context.
|
|
71
|
-
* @returns
|
|
70
|
+
* @param context - The Trello API context.
|
|
71
|
+
* @returns Lists all cards on a board.
|
|
72
72
|
*/
|
|
73
73
|
export declare function listBoardCards(context: TrelloContext): ListBoardCardsFunction;
|
|
74
74
|
export interface ListBoardLabelsInput {
|
|
@@ -80,10 +80,10 @@ export interface ListBoardLabelsInput {
|
|
|
80
80
|
}
|
|
81
81
|
export type ListBoardLabelsFunction = (input: ListBoardLabelsInput) => Promise<ReadonlyArray<TrelloLabel>>;
|
|
82
82
|
/**
|
|
83
|
-
*
|
|
83
|
+
* Https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-labels-get.
|
|
84
84
|
*
|
|
85
|
-
* @param context The Trello API context.
|
|
86
|
-
* @returns
|
|
85
|
+
* @param context - The Trello API context.
|
|
86
|
+
* @returns Lists every label defined on a board.
|
|
87
87
|
*/
|
|
88
88
|
export declare function listBoardLabels(context: TrelloContext): ListBoardLabelsFunction;
|
|
89
89
|
export interface ListBoardMembersInput {
|
|
@@ -95,9 +95,9 @@ export interface ListBoardMembersInput {
|
|
|
95
95
|
}
|
|
96
96
|
export type ListBoardMembersFunction = (input: ListBoardMembersInput) => Promise<ReadonlyArray<TrelloMember>>;
|
|
97
97
|
/**
|
|
98
|
-
*
|
|
98
|
+
* Https://developer.atlassian.com/cloud/trello/rest/api-group-boards/#api-boards-id-members-get.
|
|
99
99
|
*
|
|
100
|
-
* @param context The Trello API context.
|
|
101
|
-
* @returns
|
|
100
|
+
* @param context - The Trello API context.
|
|
101
|
+
* @returns Lists all members of a board.
|
|
102
102
|
*/
|
|
103
103
|
export declare function listBoardMembers(context: TrelloContext): ListBoardMembersFunction;
|
|
@@ -27,9 +27,11 @@ export interface TrelloBoard {
|
|
|
27
27
|
*/
|
|
28
28
|
export type TrelloBoardPermissionLevel = 'private' | 'org' | 'public';
|
|
29
29
|
/**
|
|
30
|
-
* Background preset name
|
|
30
|
+
* Background preset name or custom background id returned by the API.
|
|
31
|
+
*
|
|
32
|
+
* Common preset values: `blue`, `orange`, `green`, `red`, `purple`, `pink`, `lime`, `sky`, `grey`.
|
|
31
33
|
*/
|
|
32
|
-
export type TrelloBoardBackground =
|
|
34
|
+
export type TrelloBoardBackground = string;
|
|
33
35
|
export interface CreateBoardBody {
|
|
34
36
|
/**
|
|
35
37
|
* The new board's name. Required. 1-16384 characters.
|
|
@@ -6,18 +6,18 @@ export interface GetCardInput {
|
|
|
6
6
|
}
|
|
7
7
|
export type GetCardFunction = (input: GetCardInput) => Promise<TrelloCard>;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-get.
|
|
10
10
|
*
|
|
11
|
-
* @param context The Trello API context.
|
|
12
|
-
* @returns
|
|
11
|
+
* @param context - The Trello API context.
|
|
12
|
+
* @returns Retrieves a card by id.
|
|
13
13
|
*/
|
|
14
14
|
export declare function getCard(context: TrelloContext): GetCardFunction;
|
|
15
15
|
export type CreateCardFunction = (input: CreateCardBody) => Promise<TrelloCard>;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-post.
|
|
18
18
|
*
|
|
19
|
-
* @param context The Trello API context.
|
|
20
|
-
* @returns
|
|
19
|
+
* @param context - The Trello API context.
|
|
20
|
+
* @returns Creates a card on a list.
|
|
21
21
|
*/
|
|
22
22
|
export declare function createCard(context: TrelloContext): CreateCardFunction;
|
|
23
23
|
export interface UpdateCardInput extends UpdateCardBody {
|
|
@@ -25,26 +25,30 @@ export interface UpdateCardInput extends UpdateCardBody {
|
|
|
25
25
|
}
|
|
26
26
|
export type UpdateCardFunction = (input: UpdateCardInput) => Promise<TrelloCard>;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* Https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-put.
|
|
29
29
|
*
|
|
30
|
-
* @param context The Trello API context.
|
|
31
|
-
* @returns
|
|
30
|
+
* @param context - The Trello API context.
|
|
31
|
+
* @returns Updates an existing card.
|
|
32
32
|
*/
|
|
33
33
|
export declare function updateCard(context: TrelloContext): UpdateCardFunction;
|
|
34
34
|
export type DeleteCardFunction = (input: GetCardInput) => Promise<void>;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* Https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-delete.
|
|
37
37
|
*
|
|
38
|
-
* @param context The Trello API context.
|
|
39
|
-
* @returns
|
|
38
|
+
* @param context - The Trello API context.
|
|
39
|
+
* @returns Deletes a card.
|
|
40
40
|
*/
|
|
41
41
|
export declare function deleteCard(context: TrelloContext): DeleteCardFunction;
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
43
|
+
* Trello action type identifier.
|
|
44
|
+
*
|
|
45
|
+
* Trello supports many action types (40+). Common card-related values: `commentCard`, `updateCard`, `createCard`,
|
|
46
|
+
* `deleteCard`, `addMemberToCard`, `removeMemberFromCard`, `addAttachmentToCard`, `deleteAttachmentFromCard`,
|
|
47
|
+
* `addChecklistToCard`, `removeChecklistFromCard`, `updateCheckItemStateOnCard`, `addLabelToCard`, `removeLabelFromCard`.
|
|
44
48
|
*
|
|
45
49
|
* @see https://developer.atlassian.com/cloud/trello/guides/rest-api/action-types/
|
|
46
50
|
*/
|
|
47
|
-
export type TrelloActionType =
|
|
51
|
+
export type TrelloActionType = string;
|
|
48
52
|
export interface ListCardActionsInput {
|
|
49
53
|
readonly cardId: TrelloCardId;
|
|
50
54
|
/**
|
|
@@ -66,13 +70,13 @@ export interface ListCardActionsInput {
|
|
|
66
70
|
}
|
|
67
71
|
export type ListCardActionsFunction = <D = unknown>(input: ListCardActionsInput) => Promise<ReadonlyArray<TrelloAction<D>>>;
|
|
68
72
|
/**
|
|
69
|
-
*
|
|
73
|
+
* Https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-actions-get.
|
|
70
74
|
*
|
|
71
75
|
* Comments are returned as actions with `type === 'commentCard'`; pass `filter: 'commentCard'` and the generic
|
|
72
76
|
* type parameter `TrelloCommentCardActionData` to get a comment-typed result.
|
|
73
77
|
*
|
|
74
|
-
* @param context The Trello API context.
|
|
75
|
-
* @returns
|
|
78
|
+
* @param context - The Trello API context.
|
|
79
|
+
* @returns Lists actions on a card.
|
|
76
80
|
*/
|
|
77
81
|
export declare function listCardActions(context: TrelloContext): ListCardActionsFunction;
|
|
78
82
|
export interface AddCommentToCardInput {
|
|
@@ -84,10 +88,10 @@ export interface AddCommentToCardInput {
|
|
|
84
88
|
}
|
|
85
89
|
export type AddCommentToCardFunction = (input: AddCommentToCardInput) => Promise<TrelloCommentCardAction>;
|
|
86
90
|
/**
|
|
87
|
-
*
|
|
91
|
+
* Https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-actions-comments-post.
|
|
88
92
|
*
|
|
89
|
-
* @param context The Trello API context.
|
|
90
|
-
* @returns
|
|
93
|
+
* @param context - The Trello API context.
|
|
94
|
+
* @returns Adds a comment to a card.
|
|
91
95
|
*/
|
|
92
96
|
export declare function addCommentToCard(context: TrelloContext): AddCommentToCardFunction;
|
|
93
97
|
export interface AddMemberToCardInput {
|
|
@@ -96,10 +100,10 @@ export interface AddMemberToCardInput {
|
|
|
96
100
|
}
|
|
97
101
|
export type AddMemberToCardFunction = (input: AddMemberToCardInput) => Promise<ReadonlyArray<TrelloMemberId>>;
|
|
98
102
|
/**
|
|
99
|
-
*
|
|
103
|
+
* Https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-idmembers-post.
|
|
100
104
|
*
|
|
101
|
-
* @param context The Trello API context.
|
|
102
|
-
* @returns
|
|
105
|
+
* @param context - The Trello API context.
|
|
106
|
+
* @returns Adds a member to a card.
|
|
103
107
|
*/
|
|
104
108
|
export declare function addMemberToCard(context: TrelloContext): AddMemberToCardFunction;
|
|
105
109
|
export interface AddLabelToCardInput {
|
|
@@ -108,9 +112,9 @@ export interface AddLabelToCardInput {
|
|
|
108
112
|
}
|
|
109
113
|
export type AddLabelToCardFunction = (input: AddLabelToCardInput) => Promise<ReadonlyArray<TrelloLabelId>>;
|
|
110
114
|
/**
|
|
111
|
-
*
|
|
115
|
+
* Https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-idlabels-post.
|
|
112
116
|
*
|
|
113
|
-
* @param context The Trello API context.
|
|
114
|
-
* @returns
|
|
117
|
+
* @param context - The Trello API context.
|
|
118
|
+
* @returns Adds an existing label to a card.
|
|
115
119
|
*/
|
|
116
120
|
export declare function addLabelToCard(context: TrelloContext): AddLabelToCardFunction;
|
|
@@ -7,18 +7,18 @@ export interface GetListInput {
|
|
|
7
7
|
}
|
|
8
8
|
export type GetListFunction = (input: GetListInput) => Promise<TrelloList>;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Https://developer.atlassian.com/cloud/trello/rest/api-group-lists/#api-lists-id-get.
|
|
11
11
|
*
|
|
12
|
-
* @param context The Trello API context.
|
|
13
|
-
* @returns
|
|
12
|
+
* @param context - The Trello API context.
|
|
13
|
+
* @returns Retrieves a list by id.
|
|
14
14
|
*/
|
|
15
15
|
export declare function getList(context: TrelloContext): GetListFunction;
|
|
16
16
|
export type CreateListFunction = (input: CreateListBody) => Promise<TrelloList>;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Https://developer.atlassian.com/cloud/trello/rest/api-group-lists/#api-lists-post.
|
|
19
19
|
*
|
|
20
|
-
* @param context The Trello API context.
|
|
21
|
-
* @returns
|
|
20
|
+
* @param context - The Trello API context.
|
|
21
|
+
* @returns Creates a new list on a board.
|
|
22
22
|
*/
|
|
23
23
|
export declare function createList(context: TrelloContext): CreateListFunction;
|
|
24
24
|
export interface UpdateListInput extends UpdateListBody {
|
|
@@ -26,10 +26,10 @@ export interface UpdateListInput extends UpdateListBody {
|
|
|
26
26
|
}
|
|
27
27
|
export type UpdateListFunction = (input: UpdateListInput) => Promise<TrelloList>;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Https://developer.atlassian.com/cloud/trello/rest/api-group-lists/#api-lists-id-put.
|
|
30
30
|
*
|
|
31
|
-
* @param context The Trello API context.
|
|
32
|
-
* @returns
|
|
31
|
+
* @param context - The Trello API context.
|
|
32
|
+
* @returns Updates an existing list.
|
|
33
33
|
*/
|
|
34
34
|
export declare function updateList(context: TrelloContext): UpdateListFunction;
|
|
35
35
|
export interface ListCardsInListInput {
|
|
@@ -38,9 +38,9 @@ export interface ListCardsInListInput {
|
|
|
38
38
|
}
|
|
39
39
|
export type ListCardsInListFunction = (input: ListCardsInListInput) => Promise<ReadonlyArray<TrelloCard>>;
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
41
|
+
* Https://developer.atlassian.com/cloud/trello/rest/api-group-lists/#api-lists-id-cards-get.
|
|
42
42
|
*
|
|
43
|
-
* @param context The Trello API context.
|
|
44
|
-
* @returns
|
|
43
|
+
* @param context - The Trello API context.
|
|
44
|
+
* @returns Lists all cards on a list.
|
|
45
45
|
*/
|
|
46
46
|
export declare function listCardsInList(context: TrelloContext): ListCardsInListFunction;
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import { type TrelloContext } from './trello.factory';
|
|
2
|
-
import { type TrelloMemberId } from '../trello.type';
|
|
3
2
|
import { type TrelloMember } from './trello.api.member.type';
|
|
4
3
|
export interface GetMemberInput {
|
|
5
4
|
/**
|
|
6
5
|
* Member id, username, or the literal `me` (the authenticated user).
|
|
7
6
|
*/
|
|
8
|
-
readonly memberId:
|
|
7
|
+
readonly memberId: string;
|
|
9
8
|
}
|
|
10
9
|
export type GetMemberFunction = (input: GetMemberInput) => Promise<TrelloMember>;
|
|
11
10
|
/**
|
|
12
|
-
*
|
|
11
|
+
* Https://developer.atlassian.com/cloud/trello/rest/api-group-members/#api-members-id-get.
|
|
13
12
|
*
|
|
14
|
-
* @param context The Trello API context.
|
|
15
|
-
* @returns
|
|
13
|
+
* @param context - The Trello API context.
|
|
14
|
+
* @returns Retrieves a member by id (or `me`).
|
|
16
15
|
*/
|
|
17
16
|
export declare function getMember(context: TrelloContext): GetMemberFunction;
|
|
18
17
|
export type GetMeFunction = () => Promise<TrelloMember>;
|
|
19
18
|
/**
|
|
20
19
|
* Convenience wrapper around `getMember({ memberId: 'me' })`.
|
|
21
20
|
*
|
|
22
|
-
* @param context The Trello API context.
|
|
23
|
-
* @returns
|
|
21
|
+
* @param context - The Trello API context.
|
|
22
|
+
* @returns Retrieves the authenticated user.
|
|
24
23
|
*/
|
|
25
24
|
export declare function getMe(context: TrelloContext): GetMeFunction;
|
|
@@ -7,8 +7,8 @@ export type CreateWebhookFunction = (input: CreateWebhookBody) => Promise<Trello
|
|
|
7
7
|
*
|
|
8
8
|
* https://developer.atlassian.com/cloud/trello/guides/rest-api/webhooks/#creating-a-webhook
|
|
9
9
|
*
|
|
10
|
-
* @param context The Trello API context.
|
|
11
|
-
* @returns
|
|
10
|
+
* @param context - The Trello API context.
|
|
11
|
+
* @returns Registers a new webhook.
|
|
12
12
|
*/
|
|
13
13
|
export declare function createWebhook(context: TrelloContext): CreateWebhookFunction;
|
|
14
14
|
export interface GetWebhookInput {
|
|
@@ -16,10 +16,10 @@ export interface GetWebhookInput {
|
|
|
16
16
|
}
|
|
17
17
|
export type GetWebhookFunction = (input: GetWebhookInput) => Promise<TrelloWebhook>;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Https://developer.atlassian.com/cloud/trello/guides/rest-api/webhooks/#retrieving-a-webhook.
|
|
20
20
|
*
|
|
21
|
-
* @param context The Trello API context.
|
|
22
|
-
* @returns
|
|
21
|
+
* @param context - The Trello API context.
|
|
22
|
+
* @returns Retrieves a webhook by id.
|
|
23
23
|
*/
|
|
24
24
|
export declare function getWebhook(context: TrelloContext): GetWebhookFunction;
|
|
25
25
|
export interface UpdateWebhookInput extends UpdateWebhookBody {
|
|
@@ -27,18 +27,18 @@ export interface UpdateWebhookInput extends UpdateWebhookBody {
|
|
|
27
27
|
}
|
|
28
28
|
export type UpdateWebhookFunction = (input: UpdateWebhookInput) => Promise<TrelloWebhook>;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* Https://developer.atlassian.com/cloud/trello/guides/rest-api/webhooks/#updating-a-webhook.
|
|
31
31
|
*
|
|
32
|
-
* @param context The Trello API context.
|
|
33
|
-
* @returns
|
|
32
|
+
* @param context - The Trello API context.
|
|
33
|
+
* @returns Updates an existing webhook.
|
|
34
34
|
*/
|
|
35
35
|
export declare function updateWebhook(context: TrelloContext): UpdateWebhookFunction;
|
|
36
36
|
export type DeleteWebhookFunction = (input: GetWebhookInput) => Promise<void>;
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
38
|
+
* Https://developer.atlassian.com/cloud/trello/guides/rest-api/webhooks/#deleting-a-webhook.
|
|
39
39
|
*
|
|
40
|
-
* @param context The Trello API context.
|
|
41
|
-
* @returns
|
|
40
|
+
* @param context - The Trello API context.
|
|
41
|
+
* @returns Deletes a webhook.
|
|
42
42
|
*/
|
|
43
43
|
export declare function deleteWebhook(context: TrelloContext): DeleteWebhookFunction;
|
|
44
44
|
export interface ListWebhooksForTokenInput {
|
|
@@ -49,9 +49,9 @@ export interface ListWebhooksForTokenInput {
|
|
|
49
49
|
}
|
|
50
50
|
export type ListWebhooksForTokenFunction = (input?: ListWebhooksForTokenInput) => Promise<ReadonlyArray<TrelloWebhook>>;
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
52
|
+
* Https://developer.atlassian.com/cloud/trello/guides/rest-api/webhooks/.
|
|
53
53
|
*
|
|
54
|
-
* @param context The Trello API context.
|
|
55
|
-
* @returns
|
|
54
|
+
* @param context - The Trello API context.
|
|
55
|
+
* @returns Lists all webhooks registered for a token.
|
|
56
56
|
*/
|
|
57
57
|
export declare function listWebhooksForToken(context: TrelloContext): ListWebhooksForTokenFunction;
|
|
@@ -47,8 +47,9 @@ export type TrelloFactory = (config: TrelloConfig) => Trello;
|
|
|
47
47
|
*
|
|
48
48
|
* Auth uses Trello's `Authorization: OAuth oauth_consumer_key=..., oauth_token=...` header form so credentials never appear in URLs or logs.
|
|
49
49
|
*
|
|
50
|
-
* @param factoryConfig Factory-level configuration shared across created Trello instances.
|
|
50
|
+
* @param factoryConfig - Factory-level configuration shared across created Trello instances.
|
|
51
51
|
* @returns A factory function that creates a configured Trello API instance.
|
|
52
|
+
*
|
|
52
53
|
* @__NO_SIDE_EFFECTS__
|
|
53
54
|
*/
|
|
54
55
|
export declare function trelloFactory(factoryConfig?: TrelloFactoryConfig): TrelloFactory;
|