@ikatec/digisac-api-sdk 4.4.1 → 4.5.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/dist/apis/cards/CardsApi.cjs +70 -0
- package/dist/apis/cards/CardsApi.cjs.map +1 -1
- package/dist/apis/cards/CardsApi.d.ts +53 -1
- package/dist/apis/cards/CardsApi.d.ts.map +1 -1
- package/dist/apis/cards/CardsApi.mjs +70 -0
- package/dist/apis/cards/CardsApi.mjs.map +1 -1
- package/dist/apis/cards/types.d.ts +84 -0
- package/dist/apis/cards/types.d.ts.map +1 -1
- package/dist/apis/kanbanBoards/types.d.ts +33 -4
- package/dist/apis/kanbanBoards/types.d.ts.map +1 -1
- package/dist/apis/kanbanCards/KanbanCardsApi.cjs +8 -0
- package/dist/apis/kanbanCards/KanbanCardsApi.cjs.map +1 -1
- package/dist/apis/kanbanCards/KanbanCardsApi.d.ts +7 -1
- package/dist/apis/kanbanCards/KanbanCardsApi.d.ts.map +1 -1
- package/dist/apis/kanbanCards/KanbanCardsApi.mjs +8 -0
- package/dist/apis/kanbanCards/KanbanCardsApi.mjs.map +1 -1
- package/dist/apis/kanbanCards/types.d.ts +17 -5
- package/dist/apis/kanbanCards/types.d.ts.map +1 -1
- package/dist/apis/kanbanColumns/KanbanColumnsApi.cjs +9 -0
- package/dist/apis/kanbanColumns/KanbanColumnsApi.cjs.map +1 -1
- package/dist/apis/kanbanColumns/KanbanColumnsApi.d.ts +8 -1
- package/dist/apis/kanbanColumns/KanbanColumnsApi.d.ts.map +1 -1
- package/dist/apis/kanbanColumns/KanbanColumnsApi.mjs +9 -0
- package/dist/apis/kanbanColumns/KanbanColumnsApi.mjs.map +1 -1
- package/dist/apis/kanbanColumns/types.d.ts +14 -3
- package/dist/apis/kanbanColumns/types.d.ts.map +1 -1
- package/dist/apis/pipeline/PipelineApi.cjs +133 -0
- package/dist/apis/pipeline/PipelineApi.cjs.map +1 -1
- package/dist/apis/pipeline/PipelineApi.d.ts +102 -1
- package/dist/apis/pipeline/PipelineApi.d.ts.map +1 -1
- package/dist/apis/pipeline/PipelineApi.mjs +133 -0
- package/dist/apis/pipeline/PipelineApi.mjs.map +1 -1
- package/dist/apis/pipeline/types.d.ts +164 -0
- package/dist/apis/pipeline/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/apis/cards/CardsApi.test.ts +128 -0
- package/src/apis/cards/CardsApi.ts +124 -1
- package/src/apis/cards/types.ts +81 -0
- package/src/apis/kanbanBoards/types.ts +36 -4
- package/src/apis/kanbanCards/KanbanCardsApi.test.ts +46 -0
- package/src/apis/kanbanCards/KanbanCardsApi.ts +23 -1
- package/src/apis/kanbanCards/types.ts +18 -5
- package/src/apis/kanbanColumns/KanbanColumnsApi.test.ts +46 -0
- package/src/apis/kanbanColumns/KanbanColumnsApi.ts +24 -1
- package/src/apis/kanbanColumns/types.ts +15 -3
- package/src/apis/payloads.test-d.ts +30 -0
- package/src/apis/pipeline/PipelineApi.test.ts +193 -0
- package/src/apis/pipeline/PipelineApi.ts +274 -1
- package/src/apis/pipeline/types.ts +162 -0
|
@@ -6,6 +6,76 @@ var CardsApi = class extends require_core_BaseCrudApi.BaseCrudApi {
|
|
|
6
6
|
constructor(client) {
|
|
7
7
|
super(client, "/cards");
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Moves several cards of one stage to another stage (of the same or another pipeline),
|
|
11
|
+
* clearing their status/reason unless given. Cards outside the account or not in
|
|
12
|
+
* `originPipelineStageId` are skipped and counted in `ignoredCount`.
|
|
13
|
+
* @permissions pipelines.opportunity.update
|
|
14
|
+
*/
|
|
15
|
+
bulkMove(body, headers) {
|
|
16
|
+
return this.client.put(`${this.basePath}/bulk-move`, body, headers);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Moves a card to the `order` position of its stage, shifting the cards in between. Resolves
|
|
20
|
+
* to the card as stored. The backend refuses `0` (400 `required`), although the first card of
|
|
21
|
+
* a stage has order 0.
|
|
22
|
+
* @permissions pipelines.opportunity.update
|
|
23
|
+
*/
|
|
24
|
+
updateOrder(id, order, headers) {
|
|
25
|
+
return this.client.put(`${this.basePath}/order/${id}`, { order }, headers);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Adds a product to a card, or updates the product of `body.id`.
|
|
29
|
+
* @permissions pipelines.opportunity.update
|
|
30
|
+
*/
|
|
31
|
+
saveProduct(body, headers) {
|
|
32
|
+
return this.client.post(`${this.basePath}/product`, body, headers);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Deletes a product of a card. An unknown id also resolves with 200, with the message
|
|
36
|
+
* `'Produto não encontrado'`.
|
|
37
|
+
* @permissions pipelines.opportunity.update
|
|
38
|
+
*/
|
|
39
|
+
deleteProduct(id, headers) {
|
|
40
|
+
return this.client.delete(`${this.basePath}/product/${id}`, headers);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Adds a comment to a card, or edits the comment of `body.id`. Resolves to a message, not to
|
|
44
|
+
* the comment — read it back through `getById(cardId, { include: ['comments'] })`. A card or
|
|
45
|
+
* comment of another account fails with 404.
|
|
46
|
+
* @permissions pipelines.opportunity.update
|
|
47
|
+
*/
|
|
48
|
+
saveComment(body, headers) {
|
|
49
|
+
return this.client.post(`${this.basePath}/comment`, body, headers);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Deletes a comment of a card. Resolves with no content; unknown → 404.
|
|
53
|
+
* @permissions pipelines.opportunity.update
|
|
54
|
+
*/
|
|
55
|
+
deleteComment(id, headers) {
|
|
56
|
+
return this.client.delete(`${this.basePath}/comment/${id}`, headers);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Lists the users of the account that can own a card, sorted by name.
|
|
60
|
+
* @permissions pipelines.opportunity.view
|
|
61
|
+
*/
|
|
62
|
+
getOwners(headers) {
|
|
63
|
+
return this.client.post(`${this.basePath}/owners`, void 0, headers);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Lists cards with the board query of the UI. Resolves to a plain array (no pagination).
|
|
67
|
+
* @permissions pipelines.opportunity.view
|
|
68
|
+
*/
|
|
69
|
+
getCards(body, headers) {
|
|
70
|
+
return this.client.post(`${this.basePath}/getCards`, body, headers);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Counts the open cards of a contact visible to the caller.
|
|
74
|
+
* @permissions pipelines.opportunity.view
|
|
75
|
+
*/
|
|
76
|
+
getContactTotals(contactId, headers) {
|
|
77
|
+
return this.client.post(`${this.basePath}/contact-totals/${contactId}`, void 0, headers);
|
|
78
|
+
}
|
|
9
79
|
};
|
|
10
80
|
|
|
11
81
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardsApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/cards/CardsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {
|
|
1
|
+
{"version":3,"file":"CardsApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/cards/CardsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n BulkMoveCardsPayload,\n BulkMoveCardsResult,\n Card,\n CardContactTotals,\n CardOperationResult,\n CardOwner,\n CreateCardPayload,\n GetCardsPayload,\n SaveCardCommentPayload,\n SaveCardProductPayload,\n UpdateCardPayload,\n} from './types'\n\nexport class CardsApi extends BaseCrudApi<Card, CreateCardPayload, UpdateCardPayload> {\n constructor(client: ApiClient) {\n super(client, '/cards')\n }\n\n /**\n * Moves several cards of one stage to another stage (of the same or another pipeline),\n * clearing their status/reason unless given. Cards outside the account or not in\n * `originPipelineStageId` are skipped and counted in `ignoredCount`.\n * @permissions pipelines.opportunity.update\n */\n bulkMove(\n body: BulkMoveCardsPayload,\n headers?: Record<string, string>,\n ): Promise<BulkMoveCardsResult> {\n return this.client.put<BulkMoveCardsResult, BulkMoveCardsPayload>(\n `${this.basePath}/bulk-move`,\n body,\n headers,\n )\n }\n\n /**\n * Moves a card to the `order` position of its stage, shifting the cards in between. Resolves\n * to the card as stored. The backend refuses `0` (400 `required`), although the first card of\n * a stage has order 0.\n * @permissions pipelines.opportunity.update\n */\n updateOrder(id: string, order: number, headers?: Record<string, string>): Promise<Card> {\n return this.client.put<Card, { order: number }>(\n `${this.basePath}/order/${id}`,\n { order },\n headers,\n )\n }\n\n /**\n * Adds a product to a card, or updates the product of `body.id`.\n * @permissions pipelines.opportunity.update\n */\n saveProduct(\n body: SaveCardProductPayload,\n headers?: Record<string, string>,\n ): Promise<CardOperationResult> {\n return this.client.post<CardOperationResult, SaveCardProductPayload>(\n `${this.basePath}/product`,\n body,\n headers,\n )\n }\n\n /**\n * Deletes a product of a card. An unknown id also resolves with 200, with the message\n * `'Produto não encontrado'`.\n * @permissions pipelines.opportunity.update\n */\n deleteProduct(id: string, headers?: Record<string, string>): Promise<CardOperationResult> {\n return this.client.delete<CardOperationResult>(`${this.basePath}/product/${id}`, headers)\n }\n\n /**\n * Adds a comment to a card, or edits the comment of `body.id`. Resolves to a message, not to\n * the comment — read it back through `getById(cardId, { include: ['comments'] })`. A card or\n * comment of another account fails with 404.\n * @permissions pipelines.opportunity.update\n */\n saveComment(\n body: SaveCardCommentPayload,\n headers?: Record<string, string>,\n ): Promise<CardOperationResult> {\n return this.client.post<CardOperationResult, SaveCardCommentPayload>(\n `${this.basePath}/comment`,\n body,\n headers,\n )\n }\n\n /**\n * Deletes a comment of a card. Resolves with no content; unknown → 404.\n * @permissions pipelines.opportunity.update\n */\n deleteComment(id: string, headers?: Record<string, string>): Promise<void> {\n return this.client.delete<void>(`${this.basePath}/comment/${id}`, headers)\n }\n\n /**\n * Lists the users of the account that can own a card, sorted by name.\n * @permissions pipelines.opportunity.view\n */\n getOwners(headers?: Record<string, string>): Promise<CardOwner[]> {\n return this.client.post<CardOwner[]>(`${this.basePath}/owners`, undefined, headers)\n }\n\n /**\n * Lists cards with the board query of the UI. Resolves to a plain array (no pagination).\n * @permissions pipelines.opportunity.view\n */\n getCards(body: GetCardsPayload, headers?: Record<string, string>): Promise<Card[]> {\n return this.client.post<Card[], GetCardsPayload>(`${this.basePath}/getCards`, body, headers)\n }\n\n /**\n * Counts the open cards of a contact visible to the caller.\n * @permissions pipelines.opportunity.view\n */\n getContactTotals(\n contactId: string,\n headers?: Record<string, string>,\n ): Promise<CardContactTotals> {\n return this.client.post<CardContactTotals>(\n `${this.basePath}/contact-totals/${contactId}`,\n undefined,\n headers,\n )\n }\n}\n"],"mappings":";;;;AAgBA,IAAa,WAAb,cAA8BA,qCAAwD;CACpF,YAAY,QAAmB;AAC7B,QAAM,QAAQ,SAAS;;;;;;;;CASzB,SACE,MACA,SAC8B;AAC9B,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,aACjB,MACA,QACD;;;;;;;;CASH,YAAY,IAAY,OAAe,SAAiD;AACtF,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,SAAS,MAC1B,EAAE,OAAO,EACT,QACD;;;;;;CAOH,YACE,MACA,SAC8B;AAC9B,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,WACjB,MACA,QACD;;;;;;;CAQH,cAAc,IAAY,SAAgE;AACxF,SAAO,KAAK,OAAO,OAA4B,GAAG,KAAK,SAAS,WAAW,MAAM,QAAQ;;;;;;;;CAS3F,YACE,MACA,SAC8B;AAC9B,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,WACjB,MACA,QACD;;;;;;CAOH,cAAc,IAAY,SAAiD;AACzE,SAAO,KAAK,OAAO,OAAa,GAAG,KAAK,SAAS,WAAW,MAAM,QAAQ;;;;;;CAO5E,UAAU,SAAwD;AAChE,SAAO,KAAK,OAAO,KAAkB,GAAG,KAAK,SAAS,UAAU,QAAW,QAAQ;;;;;;CAOrF,SAAS,MAAuB,SAAmD;AACjF,SAAO,KAAK,OAAO,KAA8B,GAAG,KAAK,SAAS,YAAY,MAAM,QAAQ;;;;;;CAO9F,iBACE,WACA,SAC4B;AAC5B,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,kBAAkB,aACnC,QACA,QACD"}
|
|
@@ -1,7 +1,59 @@
|
|
|
1
1
|
import type { ApiClient } from '../../core/ApiClient';
|
|
2
2
|
import { BaseCrudApi } from '../../core/BaseCrudApi';
|
|
3
|
-
import type { Card, CreateCardPayload, UpdateCardPayload } from './types';
|
|
3
|
+
import type { BulkMoveCardsPayload, BulkMoveCardsResult, Card, CardContactTotals, CardOperationResult, CardOwner, CreateCardPayload, GetCardsPayload, SaveCardCommentPayload, SaveCardProductPayload, UpdateCardPayload } from './types';
|
|
4
4
|
export declare class CardsApi extends BaseCrudApi<Card, CreateCardPayload, UpdateCardPayload> {
|
|
5
5
|
constructor(client: ApiClient);
|
|
6
|
+
/**
|
|
7
|
+
* Moves several cards of one stage to another stage (of the same or another pipeline),
|
|
8
|
+
* clearing their status/reason unless given. Cards outside the account or not in
|
|
9
|
+
* `originPipelineStageId` are skipped and counted in `ignoredCount`.
|
|
10
|
+
* @permissions pipelines.opportunity.update
|
|
11
|
+
*/
|
|
12
|
+
bulkMove(body: BulkMoveCardsPayload, headers?: Record<string, string>): Promise<BulkMoveCardsResult>;
|
|
13
|
+
/**
|
|
14
|
+
* Moves a card to the `order` position of its stage, shifting the cards in between. Resolves
|
|
15
|
+
* to the card as stored. The backend refuses `0` (400 `required`), although the first card of
|
|
16
|
+
* a stage has order 0.
|
|
17
|
+
* @permissions pipelines.opportunity.update
|
|
18
|
+
*/
|
|
19
|
+
updateOrder(id: string, order: number, headers?: Record<string, string>): Promise<Card>;
|
|
20
|
+
/**
|
|
21
|
+
* Adds a product to a card, or updates the product of `body.id`.
|
|
22
|
+
* @permissions pipelines.opportunity.update
|
|
23
|
+
*/
|
|
24
|
+
saveProduct(body: SaveCardProductPayload, headers?: Record<string, string>): Promise<CardOperationResult>;
|
|
25
|
+
/**
|
|
26
|
+
* Deletes a product of a card. An unknown id also resolves with 200, with the message
|
|
27
|
+
* `'Produto não encontrado'`.
|
|
28
|
+
* @permissions pipelines.opportunity.update
|
|
29
|
+
*/
|
|
30
|
+
deleteProduct(id: string, headers?: Record<string, string>): Promise<CardOperationResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Adds a comment to a card, or edits the comment of `body.id`. Resolves to a message, not to
|
|
33
|
+
* the comment — read it back through `getById(cardId, { include: ['comments'] })`. A card or
|
|
34
|
+
* comment of another account fails with 404.
|
|
35
|
+
* @permissions pipelines.opportunity.update
|
|
36
|
+
*/
|
|
37
|
+
saveComment(body: SaveCardCommentPayload, headers?: Record<string, string>): Promise<CardOperationResult>;
|
|
38
|
+
/**
|
|
39
|
+
* Deletes a comment of a card. Resolves with no content; unknown → 404.
|
|
40
|
+
* @permissions pipelines.opportunity.update
|
|
41
|
+
*/
|
|
42
|
+
deleteComment(id: string, headers?: Record<string, string>): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Lists the users of the account that can own a card, sorted by name.
|
|
45
|
+
* @permissions pipelines.opportunity.view
|
|
46
|
+
*/
|
|
47
|
+
getOwners(headers?: Record<string, string>): Promise<CardOwner[]>;
|
|
48
|
+
/**
|
|
49
|
+
* Lists cards with the board query of the UI. Resolves to a plain array (no pagination).
|
|
50
|
+
* @permissions pipelines.opportunity.view
|
|
51
|
+
*/
|
|
52
|
+
getCards(body: GetCardsPayload, headers?: Record<string, string>): Promise<Card[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Counts the open cards of a contact visible to the caller.
|
|
55
|
+
* @permissions pipelines.opportunity.view
|
|
56
|
+
*/
|
|
57
|
+
getContactTotals(contactId: string, headers?: Record<string, string>): Promise<CardContactTotals>;
|
|
6
58
|
}
|
|
7
59
|
//# sourceMappingURL=CardsApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardsApi.d.ts","sourceRoot":"","sources":["../../../src/apis/cards/CardsApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"CardsApi.d.ts","sourceRoot":"","sources":["../../../src/apis/cards/CardsApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACnB,IAAI,EACJ,iBAAiB,EACjB,mBAAmB,EACnB,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,SAAS,CAAA;AAEhB,qBAAa,QAAS,SAAQ,WAAW,CAAC,IAAI,EAAE,iBAAiB,EAAE,iBAAiB,CAAC;gBACvE,MAAM,EAAE,SAAS;IAI7B;;;;;OAKG;IACH,QAAQ,CACN,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,mBAAmB,CAAC;IAQ/B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAQvF;;;OAGG;IACH,WAAW,CACT,IAAI,EAAE,sBAAsB,EAC5B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,mBAAmB,CAAC;IAQ/B;;;;OAIG;IACH,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAIzF;;;;;OAKG;IACH,WAAW,CACT,IAAI,EAAE,sBAAsB,EAC5B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,mBAAmB,CAAC;IAQ/B;;;OAGG;IACH,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1E;;;OAGG;IACH,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAIjE;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAIlF;;;OAGG;IACH,gBAAgB,CACd,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,iBAAiB,CAAC;CAO9B"}
|
|
@@ -5,6 +5,76 @@ var CardsApi = class extends BaseCrudApi {
|
|
|
5
5
|
constructor(client) {
|
|
6
6
|
super(client, "/cards");
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Moves several cards of one stage to another stage (of the same or another pipeline),
|
|
10
|
+
* clearing their status/reason unless given. Cards outside the account or not in
|
|
11
|
+
* `originPipelineStageId` are skipped and counted in `ignoredCount`.
|
|
12
|
+
* @permissions pipelines.opportunity.update
|
|
13
|
+
*/
|
|
14
|
+
bulkMove(body, headers) {
|
|
15
|
+
return this.client.put(`${this.basePath}/bulk-move`, body, headers);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Moves a card to the `order` position of its stage, shifting the cards in between. Resolves
|
|
19
|
+
* to the card as stored. The backend refuses `0` (400 `required`), although the first card of
|
|
20
|
+
* a stage has order 0.
|
|
21
|
+
* @permissions pipelines.opportunity.update
|
|
22
|
+
*/
|
|
23
|
+
updateOrder(id, order, headers) {
|
|
24
|
+
return this.client.put(`${this.basePath}/order/${id}`, { order }, headers);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Adds a product to a card, or updates the product of `body.id`.
|
|
28
|
+
* @permissions pipelines.opportunity.update
|
|
29
|
+
*/
|
|
30
|
+
saveProduct(body, headers) {
|
|
31
|
+
return this.client.post(`${this.basePath}/product`, body, headers);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Deletes a product of a card. An unknown id also resolves with 200, with the message
|
|
35
|
+
* `'Produto não encontrado'`.
|
|
36
|
+
* @permissions pipelines.opportunity.update
|
|
37
|
+
*/
|
|
38
|
+
deleteProduct(id, headers) {
|
|
39
|
+
return this.client.delete(`${this.basePath}/product/${id}`, headers);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Adds a comment to a card, or edits the comment of `body.id`. Resolves to a message, not to
|
|
43
|
+
* the comment — read it back through `getById(cardId, { include: ['comments'] })`. A card or
|
|
44
|
+
* comment of another account fails with 404.
|
|
45
|
+
* @permissions pipelines.opportunity.update
|
|
46
|
+
*/
|
|
47
|
+
saveComment(body, headers) {
|
|
48
|
+
return this.client.post(`${this.basePath}/comment`, body, headers);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Deletes a comment of a card. Resolves with no content; unknown → 404.
|
|
52
|
+
* @permissions pipelines.opportunity.update
|
|
53
|
+
*/
|
|
54
|
+
deleteComment(id, headers) {
|
|
55
|
+
return this.client.delete(`${this.basePath}/comment/${id}`, headers);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Lists the users of the account that can own a card, sorted by name.
|
|
59
|
+
* @permissions pipelines.opportunity.view
|
|
60
|
+
*/
|
|
61
|
+
getOwners(headers) {
|
|
62
|
+
return this.client.post(`${this.basePath}/owners`, void 0, headers);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Lists cards with the board query of the UI. Resolves to a plain array (no pagination).
|
|
66
|
+
* @permissions pipelines.opportunity.view
|
|
67
|
+
*/
|
|
68
|
+
getCards(body, headers) {
|
|
69
|
+
return this.client.post(`${this.basePath}/getCards`, body, headers);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Counts the open cards of a contact visible to the caller.
|
|
73
|
+
* @permissions pipelines.opportunity.view
|
|
74
|
+
*/
|
|
75
|
+
getContactTotals(contactId, headers) {
|
|
76
|
+
return this.client.post(`${this.basePath}/contact-totals/${contactId}`, void 0, headers);
|
|
77
|
+
}
|
|
8
78
|
};
|
|
9
79
|
|
|
10
80
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardsApi.mjs","names":[],"sources":["../../../src/apis/cards/CardsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {
|
|
1
|
+
{"version":3,"file":"CardsApi.mjs","names":[],"sources":["../../../src/apis/cards/CardsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n BulkMoveCardsPayload,\n BulkMoveCardsResult,\n Card,\n CardContactTotals,\n CardOperationResult,\n CardOwner,\n CreateCardPayload,\n GetCardsPayload,\n SaveCardCommentPayload,\n SaveCardProductPayload,\n UpdateCardPayload,\n} from './types'\n\nexport class CardsApi extends BaseCrudApi<Card, CreateCardPayload, UpdateCardPayload> {\n constructor(client: ApiClient) {\n super(client, '/cards')\n }\n\n /**\n * Moves several cards of one stage to another stage (of the same or another pipeline),\n * clearing their status/reason unless given. Cards outside the account or not in\n * `originPipelineStageId` are skipped and counted in `ignoredCount`.\n * @permissions pipelines.opportunity.update\n */\n bulkMove(\n body: BulkMoveCardsPayload,\n headers?: Record<string, string>,\n ): Promise<BulkMoveCardsResult> {\n return this.client.put<BulkMoveCardsResult, BulkMoveCardsPayload>(\n `${this.basePath}/bulk-move`,\n body,\n headers,\n )\n }\n\n /**\n * Moves a card to the `order` position of its stage, shifting the cards in between. Resolves\n * to the card as stored. The backend refuses `0` (400 `required`), although the first card of\n * a stage has order 0.\n * @permissions pipelines.opportunity.update\n */\n updateOrder(id: string, order: number, headers?: Record<string, string>): Promise<Card> {\n return this.client.put<Card, { order: number }>(\n `${this.basePath}/order/${id}`,\n { order },\n headers,\n )\n }\n\n /**\n * Adds a product to a card, or updates the product of `body.id`.\n * @permissions pipelines.opportunity.update\n */\n saveProduct(\n body: SaveCardProductPayload,\n headers?: Record<string, string>,\n ): Promise<CardOperationResult> {\n return this.client.post<CardOperationResult, SaveCardProductPayload>(\n `${this.basePath}/product`,\n body,\n headers,\n )\n }\n\n /**\n * Deletes a product of a card. An unknown id also resolves with 200, with the message\n * `'Produto não encontrado'`.\n * @permissions pipelines.opportunity.update\n */\n deleteProduct(id: string, headers?: Record<string, string>): Promise<CardOperationResult> {\n return this.client.delete<CardOperationResult>(`${this.basePath}/product/${id}`, headers)\n }\n\n /**\n * Adds a comment to a card, or edits the comment of `body.id`. Resolves to a message, not to\n * the comment — read it back through `getById(cardId, { include: ['comments'] })`. A card or\n * comment of another account fails with 404.\n * @permissions pipelines.opportunity.update\n */\n saveComment(\n body: SaveCardCommentPayload,\n headers?: Record<string, string>,\n ): Promise<CardOperationResult> {\n return this.client.post<CardOperationResult, SaveCardCommentPayload>(\n `${this.basePath}/comment`,\n body,\n headers,\n )\n }\n\n /**\n * Deletes a comment of a card. Resolves with no content; unknown → 404.\n * @permissions pipelines.opportunity.update\n */\n deleteComment(id: string, headers?: Record<string, string>): Promise<void> {\n return this.client.delete<void>(`${this.basePath}/comment/${id}`, headers)\n }\n\n /**\n * Lists the users of the account that can own a card, sorted by name.\n * @permissions pipelines.opportunity.view\n */\n getOwners(headers?: Record<string, string>): Promise<CardOwner[]> {\n return this.client.post<CardOwner[]>(`${this.basePath}/owners`, undefined, headers)\n }\n\n /**\n * Lists cards with the board query of the UI. Resolves to a plain array (no pagination).\n * @permissions pipelines.opportunity.view\n */\n getCards(body: GetCardsPayload, headers?: Record<string, string>): Promise<Card[]> {\n return this.client.post<Card[], GetCardsPayload>(`${this.basePath}/getCards`, body, headers)\n }\n\n /**\n * Counts the open cards of a contact visible to the caller.\n * @permissions pipelines.opportunity.view\n */\n getContactTotals(\n contactId: string,\n headers?: Record<string, string>,\n ): Promise<CardContactTotals> {\n return this.client.post<CardContactTotals>(\n `${this.basePath}/contact-totals/${contactId}`,\n undefined,\n headers,\n )\n }\n}\n"],"mappings":";;;AAgBA,IAAa,WAAb,cAA8B,YAAwD;CACpF,YAAY,QAAmB;AAC7B,QAAM,QAAQ,SAAS;;;;;;;;CASzB,SACE,MACA,SAC8B;AAC9B,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,aACjB,MACA,QACD;;;;;;;;CASH,YAAY,IAAY,OAAe,SAAiD;AACtF,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,SAAS,MAC1B,EAAE,OAAO,EACT,QACD;;;;;;CAOH,YACE,MACA,SAC8B;AAC9B,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,WACjB,MACA,QACD;;;;;;;CAQH,cAAc,IAAY,SAAgE;AACxF,SAAO,KAAK,OAAO,OAA4B,GAAG,KAAK,SAAS,WAAW,MAAM,QAAQ;;;;;;;;CAS3F,YACE,MACA,SAC8B;AAC9B,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,WACjB,MACA,QACD;;;;;;CAOH,cAAc,IAAY,SAAiD;AACzE,SAAO,KAAK,OAAO,OAAa,GAAG,KAAK,SAAS,WAAW,MAAM,QAAQ;;;;;;CAO5E,UAAU,SAAwD;AAChE,SAAO,KAAK,OAAO,KAAkB,GAAG,KAAK,SAAS,UAAU,QAAW,QAAQ;;;;;;CAOrF,SAAS,MAAuB,SAAmD;AACjF,SAAO,KAAK,OAAO,KAA8B,GAAG,KAAK,SAAS,YAAY,MAAM,QAAQ;;;;;;CAO9F,iBACE,WACA,SAC4B;AAC5B,SAAO,KAAK,OAAO,KACjB,GAAG,KAAK,SAAS,kBAAkB,aACnC,QACA,QACD"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ListQuery, WhereClause } from '../../core/types';
|
|
1
2
|
import type { Contact } from '../contacts/types';
|
|
2
3
|
import type { Pipeline, PipelineStage, PipelineStageReason, PipelineStageStatus } from '../pipeline/types';
|
|
3
4
|
import type { User } from '../users/types';
|
|
@@ -90,6 +91,8 @@ export type Card = {
|
|
|
90
91
|
lastMessage?: unknown;
|
|
91
92
|
/** Only on getMany/getById answers: sum of the products (`ammount * value`). */
|
|
92
93
|
totalValue?: number;
|
|
94
|
+
/** Only on `getCards` answers. */
|
|
95
|
+
contactName?: string;
|
|
93
96
|
contact?: Contact | null;
|
|
94
97
|
owner?: User | null;
|
|
95
98
|
pipeline?: Pipeline;
|
|
@@ -137,5 +140,86 @@ export type UpdateCardPayload = {
|
|
|
137
140
|
success?: boolean | null;
|
|
138
141
|
finishedAt?: string | null;
|
|
139
142
|
};
|
|
143
|
+
/** Answer of the product and comment writes — the entity itself is not returned. */
|
|
144
|
+
export type CardOperationResult = {
|
|
145
|
+
message: string;
|
|
146
|
+
};
|
|
147
|
+
export type BulkMoveCardsPayload = {
|
|
148
|
+
/** At least one; ids outside the account or not in `originPipelineStageId` are ignored. */
|
|
149
|
+
ids: string[];
|
|
150
|
+
originPipelineStageId: string;
|
|
151
|
+
/** Destination pipeline; `pipelineStageId` must be one of its stages. */
|
|
152
|
+
pipelineId: string;
|
|
153
|
+
pipelineStageId: string;
|
|
154
|
+
/** Must be a status of the destination stage, unless it is the last stage. */
|
|
155
|
+
statusId?: string;
|
|
156
|
+
/** Kept only when the destination is the last stage (then `finishedAt` is set). */
|
|
157
|
+
success?: boolean;
|
|
158
|
+
reasonId?: string;
|
|
159
|
+
};
|
|
160
|
+
export type BulkMoveCardsResult = {
|
|
161
|
+
movedCount: number;
|
|
162
|
+
ignoredCount: number;
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* Creates a product of a card, or updates the product of `id`. No validation on the backend:
|
|
166
|
+
* a missing `name`/`ammount`/`value` fails with 500.
|
|
167
|
+
*/
|
|
168
|
+
export type SaveCardProductPayload = {
|
|
169
|
+
id?: string;
|
|
170
|
+
cardId: string;
|
|
171
|
+
name: string;
|
|
172
|
+
/** Quantity — integer (the backend column is spelled `ammount`). */
|
|
173
|
+
ammount: number;
|
|
174
|
+
value: number;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Creates a comment on `cardId`, or edits the comment of `id`. It needs text or at least one
|
|
178
|
+
* file. `files` are references to files already uploaded (see `FilesApi`) — `.pdf`, `.txt`,
|
|
179
|
+
* `.html` or `.md`, up to 10 files of 10 MB.
|
|
180
|
+
*/
|
|
181
|
+
export type SaveCardCommentPayload = {
|
|
182
|
+
id?: undefined;
|
|
183
|
+
cardId: string;
|
|
184
|
+
comment?: string;
|
|
185
|
+
files?: {
|
|
186
|
+
id: string;
|
|
187
|
+
}[];
|
|
188
|
+
} | {
|
|
189
|
+
id: string;
|
|
190
|
+
cardId?: string;
|
|
191
|
+
comment?: string;
|
|
192
|
+
files?: {
|
|
193
|
+
id: string;
|
|
194
|
+
}[];
|
|
195
|
+
removedFileIds?: string[];
|
|
196
|
+
};
|
|
197
|
+
export type CardOwner = {
|
|
198
|
+
id: string;
|
|
199
|
+
/** Suffixed with " - Sem permissão" (in the caller's language) when `disabled`. */
|
|
200
|
+
name: string;
|
|
201
|
+
/** `true` for users without `pipelines.opportunity.update`. */
|
|
202
|
+
disabled: boolean;
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* Body of `POST /cards/getCards`: Sequelize options sent as-is. The route does **not** scope the
|
|
206
|
+
* query by account — without `where.accountId` it answers cards of other accounts. `order`
|
|
207
|
+
* accepts card fields and `contact.name`.
|
|
208
|
+
*/
|
|
209
|
+
export type GetCardsPayload = Omit<ListQuery<Card>, 'page' | 'perPage' | 'paginate' | 'where' | 'order' | 'attributes'> & {
|
|
210
|
+
where: WhereClause<Card> & {
|
|
211
|
+
accountId: string;
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* The card columns to answer. Required in practice: the backend selects only these (plus the
|
|
215
|
+
* computed `contactName` and `totalValue`), so without them each card has no other field.
|
|
216
|
+
*/
|
|
217
|
+
attributes: (keyof Card & string)[];
|
|
218
|
+
order?: [(keyof Card & string) | 'contact.name', 'ASC' | 'DESC'][];
|
|
219
|
+
};
|
|
220
|
+
export type CardContactTotals = {
|
|
221
|
+
/** Open cards of the contact (not archived, not finished, in a pipeline that exists). */
|
|
222
|
+
totalOpen: number;
|
|
223
|
+
};
|
|
140
224
|
export {};
|
|
141
225
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/cards/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EACV,QAAQ,EACR,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,KAAK,QAAQ,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAE5C,gGAAgG;AAChG,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,MA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;IACE,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACxB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;CAC1B,CAAA;AAEL,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,mFAAmF;IACnF,IAAI,EAAE,MAAM,CAAA;IACZ,+DAA+D;IAC/D,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,SAAS,CAAC,IAAI,CAAC,EACf,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,YAAY,CACnE,GAAG;IACF,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,GAAG;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAA;IAChD;;;OAGG;IACH,UAAU,EAAE,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,CAAA;IACnC,KAAK,CAAC,EAAE,CAAC,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,cAAc,EAAE,KAAK,GAAG,MAAM,CAAC,EAAE,CAAA;CACnE,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,yFAAyF;IACzF,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA"}
|
|
@@ -1,25 +1,54 @@
|
|
|
1
1
|
import type { Department } from '../departments/types';
|
|
2
2
|
import type { KanbanColumn } from '../kanbanColumns/types';
|
|
3
|
+
export type KanbanBoardVisibleTickets = 'mine' | 'all' | 'mine-and-not-assigned';
|
|
4
|
+
export type KanbanBoardClosedMaxTimeUnit = 'minutes' | 'hours' | 'days' | 'weeks' | 'months';
|
|
5
|
+
/** Card fields shown on the board. */
|
|
6
|
+
export type KanbanBoardSettings = {
|
|
7
|
+
lastMessage: boolean;
|
|
8
|
+
departmentAndUser: boolean;
|
|
9
|
+
tags: boolean;
|
|
10
|
+
createdAtDate: boolean;
|
|
11
|
+
newInteractions: boolean;
|
|
12
|
+
timeoutAlert: boolean;
|
|
13
|
+
};
|
|
3
14
|
export type KanbanBoard = {
|
|
4
15
|
id: string;
|
|
5
16
|
name: string;
|
|
6
|
-
timeoutAlertEnabled: boolean;
|
|
7
17
|
accountId: string;
|
|
18
|
+
visibleTickets: KanbanBoardVisibleTickets | null;
|
|
19
|
+
closedMaxTime: number | null;
|
|
20
|
+
closedMaxTimeUnit: KanbanBoardClosedMaxTimeUnit | null;
|
|
21
|
+
/** `'initializing'` while the cards of the open tickets are being created. */
|
|
22
|
+
status: 'initializing' | 'ready';
|
|
23
|
+
settings: KanbanBoardSettings;
|
|
8
24
|
createdAt: string;
|
|
9
25
|
updatedAt: string;
|
|
10
|
-
deletedAt: string | null;
|
|
11
26
|
departments?: Department[];
|
|
12
27
|
columns?: KanbanColumn[];
|
|
13
28
|
};
|
|
14
29
|
export type KanbanBoardRelationships = 'departments' | 'columns';
|
|
15
30
|
export type CreateKanbanBoardPayload = {
|
|
16
31
|
name: string;
|
|
17
|
-
timeoutAlertEnabled?: boolean;
|
|
18
32
|
/** Department IDs to link to the board. Required by the backend on creation. */
|
|
19
33
|
departmentIds: string[];
|
|
34
|
+
visibleTickets?: KanbanBoardVisibleTickets;
|
|
35
|
+
/** Greater than 0. */
|
|
36
|
+
closedMaxTime?: number;
|
|
37
|
+
closedMaxTimeUnit?: KanbanBoardClosedMaxTimeUnit;
|
|
38
|
+
settings?: Partial<KanbanBoardSettings>;
|
|
20
39
|
};
|
|
21
40
|
export type UpdateKanbanBoardPayload = {
|
|
22
41
|
name?: string;
|
|
23
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Replaces the departments of the board (at least one): removing a department deletes the
|
|
44
|
+
* cards of its tickets, adding one creates cards for its open tickets.
|
|
45
|
+
*/
|
|
46
|
+
departmentIds?: string[];
|
|
47
|
+
visibleTickets?: KanbanBoardVisibleTickets;
|
|
48
|
+
/** Greater than 0. */
|
|
49
|
+
closedMaxTime?: number;
|
|
50
|
+
closedMaxTimeUnit?: KanbanBoardClosedMaxTimeUnit;
|
|
51
|
+
/** Merged into the current settings — send only the keys to change. */
|
|
52
|
+
settings?: Partial<KanbanBoardSettings>;
|
|
24
53
|
};
|
|
25
54
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/kanbanBoards/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAE1D,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/kanbanBoards/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAE1D,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,KAAK,GAAG,uBAAuB,CAAA;AAEhF,MAAM,MAAM,4BAA4B,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;AAE5F,sCAAsC;AACtC,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,EAAE,OAAO,CAAA;IACpB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,IAAI,EAAE,OAAO,CAAA;IACb,aAAa,EAAE,OAAO,CAAA;IACtB,eAAe,EAAE,OAAO,CAAA;IACxB,YAAY,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,MAAM,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anCardsApi = class extends require_core_BaseCrudApi.BaseCrudApi {
|
|
|
6
6
|
constructor(client) {
|
|
7
7
|
super(client, "/kanban-cards");
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Moves a card within its column or to another column (see {@link ReorderKanbanCardPayload}).
|
|
11
|
+
* Resolves to the card with its new `position` and `columnId`.
|
|
12
|
+
* @permissions kanban.cards.move
|
|
13
|
+
*/
|
|
14
|
+
reorder(id, body, headers) {
|
|
15
|
+
return this.client.patch(`${this.basePath}/${id}/reorder`, body, headers);
|
|
16
|
+
}
|
|
9
17
|
};
|
|
10
18
|
|
|
11
19
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KanbanCardsApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/kanbanCards/KanbanCardsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {
|
|
1
|
+
{"version":3,"file":"KanbanCardsApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/kanbanCards/KanbanCardsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n KanbanCard,\n CreateKanbanCardPayload,\n ReorderKanbanCardPayload,\n UpdateKanbanCardPayload,\n} from './types'\n\nexport class KanbanCardsApi extends BaseCrudApi<\n KanbanCard,\n CreateKanbanCardPayload,\n UpdateKanbanCardPayload\n> {\n constructor(client: ApiClient) {\n super(client, '/kanban-cards')\n }\n\n /**\n * Moves a card within its column or to another column (see {@link ReorderKanbanCardPayload}).\n * Resolves to the card with its new `position` and `columnId`.\n * @permissions kanban.cards.move\n */\n reorder(\n id: string,\n body: ReorderKanbanCardPayload,\n headers?: Record<string, string>,\n ): Promise<KanbanCard> {\n return this.client.patch<KanbanCard, ReorderKanbanCardPayload>(\n `${this.basePath}/${id}/reorder`,\n body,\n headers,\n )\n }\n}\n"],"mappings":";;;;AASA,IAAa,iBAAb,cAAoCA,qCAIlC;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,gBAAgB;;;;;;;CAQhC,QACE,IACA,MACA,SACqB;AACrB,SAAO,KAAK,OAAO,MACjB,GAAG,KAAK,SAAS,GAAG,GAAG,WACvB,MACA,QACD"}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import type { ApiClient } from '../../core/ApiClient';
|
|
2
2
|
import { BaseCrudApi } from '../../core/BaseCrudApi';
|
|
3
|
-
import type { KanbanCard, CreateKanbanCardPayload, UpdateKanbanCardPayload } from './types';
|
|
3
|
+
import type { KanbanCard, CreateKanbanCardPayload, ReorderKanbanCardPayload, UpdateKanbanCardPayload } from './types';
|
|
4
4
|
export declare class KanbanCardsApi extends BaseCrudApi<KanbanCard, CreateKanbanCardPayload, UpdateKanbanCardPayload> {
|
|
5
5
|
constructor(client: ApiClient);
|
|
6
|
+
/**
|
|
7
|
+
* Moves a card within its column or to another column (see {@link ReorderKanbanCardPayload}).
|
|
8
|
+
* Resolves to the card with its new `position` and `columnId`.
|
|
9
|
+
* @permissions kanban.cards.move
|
|
10
|
+
*/
|
|
11
|
+
reorder(id: string, body: ReorderKanbanCardPayload, headers?: Record<string, string>): Promise<KanbanCard>;
|
|
6
12
|
}
|
|
7
13
|
//# sourceMappingURL=KanbanCardsApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KanbanCardsApi.d.ts","sourceRoot":"","sources":["../../../src/apis/kanbanCards/KanbanCardsApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"KanbanCardsApi.d.ts","sourceRoot":"","sources":["../../../src/apis/kanbanCards/KanbanCardsApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,EACV,UAAU,EACV,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,SAAS,CAAA;AAEhB,qBAAa,cAAe,SAAQ,WAAW,CAC7C,UAAU,EACV,uBAAuB,EACvB,uBAAuB,CACxB;gBACa,MAAM,EAAE,SAAS;IAI7B;;;;OAIG;IACH,OAAO,CACL,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,wBAAwB,EAC9B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,UAAU,CAAC;CAOvB"}
|
|
@@ -5,6 +5,14 @@ var KanbanCardsApi = class extends BaseCrudApi {
|
|
|
5
5
|
constructor(client) {
|
|
6
6
|
super(client, "/kanban-cards");
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Moves a card within its column or to another column (see {@link ReorderKanbanCardPayload}).
|
|
10
|
+
* Resolves to the card with its new `position` and `columnId`.
|
|
11
|
+
* @permissions kanban.cards.move
|
|
12
|
+
*/
|
|
13
|
+
reorder(id, body, headers) {
|
|
14
|
+
return this.client.patch(`${this.basePath}/${id}/reorder`, body, headers);
|
|
15
|
+
}
|
|
8
16
|
};
|
|
9
17
|
|
|
10
18
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KanbanCardsApi.mjs","names":[],"sources":["../../../src/apis/kanbanCards/KanbanCardsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {
|
|
1
|
+
{"version":3,"file":"KanbanCardsApi.mjs","names":[],"sources":["../../../src/apis/kanbanCards/KanbanCardsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n KanbanCard,\n CreateKanbanCardPayload,\n ReorderKanbanCardPayload,\n UpdateKanbanCardPayload,\n} from './types'\n\nexport class KanbanCardsApi extends BaseCrudApi<\n KanbanCard,\n CreateKanbanCardPayload,\n UpdateKanbanCardPayload\n> {\n constructor(client: ApiClient) {\n super(client, '/kanban-cards')\n }\n\n /**\n * Moves a card within its column or to another column (see {@link ReorderKanbanCardPayload}).\n * Resolves to the card with its new `position` and `columnId`.\n * @permissions kanban.cards.move\n */\n reorder(\n id: string,\n body: ReorderKanbanCardPayload,\n headers?: Record<string, string>,\n ): Promise<KanbanCard> {\n return this.client.patch<KanbanCard, ReorderKanbanCardPayload>(\n `${this.basePath}/${id}/reorder`,\n body,\n headers,\n )\n }\n}\n"],"mappings":";;;AASA,IAAa,iBAAb,cAAoC,YAIlC;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,gBAAgB;;;;;;;CAQhC,QACE,IACA,MACA,SACqB;AACrB,SAAO,KAAK,OAAO,MACjB,GAAG,KAAK,SAAS,GAAG,GAAG,WACvB,MACA,QACD"}
|
|
@@ -2,7 +2,6 @@ import type { KanbanColumn } from '../kanbanColumns/types';
|
|
|
2
2
|
import type { Ticket } from '../tickets/types';
|
|
3
3
|
export type KanbanCard = {
|
|
4
4
|
id: string;
|
|
5
|
-
ticketSubject: string | null;
|
|
6
5
|
position: string;
|
|
7
6
|
columnId: string;
|
|
8
7
|
ticketId: string;
|
|
@@ -11,9 +10,8 @@ export type KanbanCard = {
|
|
|
11
10
|
lastColumnChangeAt: string | null;
|
|
12
11
|
createdAt: string;
|
|
13
12
|
updatedAt: string;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
ticket?: Ticket;
|
|
13
|
+
column?: KanbanColumn | null;
|
|
14
|
+
ticket?: Ticket | null;
|
|
17
15
|
};
|
|
18
16
|
export type KanbanCardRelationships = 'column' | 'ticket';
|
|
19
17
|
export type CreateKanbanCardPayload = {
|
|
@@ -24,6 +22,20 @@ export type CreateKanbanCardPayload = {
|
|
|
24
22
|
export type UpdateKanbanCardPayload = {
|
|
25
23
|
columnId?: string;
|
|
26
24
|
position?: string;
|
|
27
|
-
|
|
25
|
+
/** The caller must share a department with the ticket (or transfer to all / be admin). */
|
|
26
|
+
ticketId?: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Where the card goes. The target column is `columnId`, else the column of the neighbours, else
|
|
30
|
+
* the current one; `moveTo` puts it first/last of the target column. Moving into the `'final'`
|
|
31
|
+
* column closes the ticket, moving out of it reopens the ticket.
|
|
32
|
+
*/
|
|
33
|
+
export type ReorderKanbanCardPayload = {
|
|
34
|
+
/** The card that ends up above. Must be in the same column as `afterCardId`. */
|
|
35
|
+
beforeCardId?: string;
|
|
36
|
+
/** The card that ends up below. */
|
|
37
|
+
afterCardId?: string;
|
|
38
|
+
columnId?: string;
|
|
39
|
+
moveTo?: 'start' | 'end';
|
|
28
40
|
};
|
|
29
41
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/kanbanCards/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAE9C,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/kanbanCards/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAE9C,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IAEjB,MAAM,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEzD,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;CACzB,CAAA"}
|
|
@@ -6,6 +6,15 @@ var KanbanColumnsApi = class extends require_core_BaseCrudApi.BaseCrudApi {
|
|
|
6
6
|
constructor(client) {
|
|
7
7
|
super(client, "/kanban-columns");
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Moves a column between two neighbours of the same board. Both the column and a neighbour
|
|
11
|
+
* must be draggable; swapped neighbours (`before` after `after`) fail with 500. Resolves to the
|
|
12
|
+
* column with its new `position`.
|
|
13
|
+
* @permissions kanban.columns.update
|
|
14
|
+
*/
|
|
15
|
+
reorder(id, body, headers) {
|
|
16
|
+
return this.client.patch(`${this.basePath}/${id}/reorder`, body, headers);
|
|
17
|
+
}
|
|
9
18
|
};
|
|
10
19
|
|
|
11
20
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KanbanColumnsApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/kanbanColumns/KanbanColumnsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {
|
|
1
|
+
{"version":3,"file":"KanbanColumnsApi.cjs","names":["BaseCrudApi"],"sources":["../../../src/apis/kanbanColumns/KanbanColumnsApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseCrudApi } from '../../core/BaseCrudApi'\nimport type {\n KanbanColumn,\n CreateKanbanColumnPayload,\n ReorderKanbanColumnPayload,\n UpdateKanbanColumnPayload,\n} from './types'\n\nexport class KanbanColumnsApi extends BaseCrudApi<\n KanbanColumn,\n CreateKanbanColumnPayload,\n UpdateKanbanColumnPayload\n> {\n constructor(client: ApiClient) {\n super(client, '/kanban-columns')\n }\n\n /**\n * Moves a column between two neighbours of the same board. Both the column and a neighbour\n * must be draggable; swapped neighbours (`before` after `after`) fail with 500. Resolves to the\n * column with its new `position`.\n * @permissions kanban.columns.update\n */\n reorder(\n id: string,\n body: ReorderKanbanColumnPayload,\n headers?: Record<string, string>,\n ): Promise<KanbanColumn> {\n return this.client.patch<KanbanColumn, ReorderKanbanColumnPayload>(\n `${this.basePath}/${id}/reorder`,\n body,\n headers,\n )\n }\n}\n"],"mappings":";;;;AASA,IAAa,mBAAb,cAAsCA,qCAIpC;CACA,YAAY,QAAmB;AAC7B,QAAM,QAAQ,kBAAkB;;;;;;;;CASlC,QACE,IACA,MACA,SACuB;AACvB,SAAO,KAAK,OAAO,MACjB,GAAG,KAAK,SAAS,GAAG,GAAG,WACvB,MACA,QACD"}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import type { ApiClient } from '../../core/ApiClient';
|
|
2
2
|
import { BaseCrudApi } from '../../core/BaseCrudApi';
|
|
3
|
-
import type { KanbanColumn, CreateKanbanColumnPayload, UpdateKanbanColumnPayload } from './types';
|
|
3
|
+
import type { KanbanColumn, CreateKanbanColumnPayload, ReorderKanbanColumnPayload, UpdateKanbanColumnPayload } from './types';
|
|
4
4
|
export declare class KanbanColumnsApi extends BaseCrudApi<KanbanColumn, CreateKanbanColumnPayload, UpdateKanbanColumnPayload> {
|
|
5
5
|
constructor(client: ApiClient);
|
|
6
|
+
/**
|
|
7
|
+
* Moves a column between two neighbours of the same board. Both the column and a neighbour
|
|
8
|
+
* must be draggable; swapped neighbours (`before` after `after`) fail with 500. Resolves to the
|
|
9
|
+
* column with its new `position`.
|
|
10
|
+
* @permissions kanban.columns.update
|
|
11
|
+
*/
|
|
12
|
+
reorder(id: string, body: ReorderKanbanColumnPayload, headers?: Record<string, string>): Promise<KanbanColumn>;
|
|
6
13
|
}
|
|
7
14
|
//# sourceMappingURL=KanbanColumnsApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KanbanColumnsApi.d.ts","sourceRoot":"","sources":["../../../src/apis/kanbanColumns/KanbanColumnsApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"KanbanColumnsApi.d.ts","sourceRoot":"","sources":["../../../src/apis/kanbanColumns/KanbanColumnsApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,EACV,YAAY,EACZ,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EAC1B,MAAM,SAAS,CAAA;AAEhB,qBAAa,gBAAiB,SAAQ,WAAW,CAC/C,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,CAC1B;gBACa,MAAM,EAAE,SAAS;IAI7B;;;;;OAKG;IACH,OAAO,CACL,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,0BAA0B,EAChC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,YAAY,CAAC;CAOzB"}
|