@ikatec/digisac-api-sdk 4.1.0 → 4.2.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.
Files changed (126) hide show
  1. package/README.md +7 -4
  2. package/dist/apis/authHistory/AuthHistoryApi.cjs +12 -12
  3. package/dist/apis/authHistory/AuthHistoryApi.cjs.map +1 -1
  4. package/dist/apis/authHistory/AuthHistoryApi.d.ts +12 -19
  5. package/dist/apis/authHistory/AuthHistoryApi.d.ts.map +1 -1
  6. package/dist/apis/authHistory/AuthHistoryApi.mjs +12 -12
  7. package/dist/apis/authHistory/AuthHistoryApi.mjs.map +1 -1
  8. package/dist/apis/authHistory/types.d.ts +4 -3
  9. package/dist/apis/authHistory/types.d.ts.map +1 -1
  10. package/dist/apis/customFields/types.d.ts +21 -19
  11. package/dist/apis/customFields/types.d.ts.map +1 -1
  12. package/dist/apis/dashboard/DashboardApi.cjs +19 -0
  13. package/dist/apis/dashboard/DashboardApi.cjs.map +1 -0
  14. package/dist/apis/dashboard/DashboardApi.d.ts +12 -0
  15. package/dist/apis/dashboard/DashboardApi.d.ts.map +1 -0
  16. package/dist/apis/dashboard/DashboardApi.mjs +18 -0
  17. package/dist/apis/dashboard/DashboardApi.mjs.map +1 -0
  18. package/dist/apis/dashboard/index.cjs +4 -0
  19. package/dist/apis/dashboard/index.d.ts +3 -0
  20. package/dist/apis/dashboard/index.d.ts.map +1 -0
  21. package/dist/apis/dashboard/index.mjs +3 -0
  22. package/dist/apis/dashboard/types.cjs +0 -0
  23. package/dist/apis/dashboard/types.d.ts +53 -0
  24. package/dist/apis/dashboard/types.d.ts.map +1 -0
  25. package/dist/apis/dashboard/types.mjs +0 -0
  26. package/dist/apis/holiday/types.d.ts +34 -8
  27. package/dist/apis/holiday/types.d.ts.map +1 -1
  28. package/dist/apis/index.cjs +6 -0
  29. package/dist/apis/index.d.ts +2 -0
  30. package/dist/apis/index.d.ts.map +1 -1
  31. package/dist/apis/index.mjs +5 -1
  32. package/dist/apis/now/NowApi.cjs +37 -0
  33. package/dist/apis/now/NowApi.cjs.map +1 -0
  34. package/dist/apis/now/NowApi.d.ts +26 -0
  35. package/dist/apis/now/NowApi.d.ts.map +1 -0
  36. package/dist/apis/now/NowApi.mjs +36 -0
  37. package/dist/apis/now/NowApi.mjs.map +1 -0
  38. package/dist/apis/now/index.cjs +4 -0
  39. package/dist/apis/now/index.d.ts +3 -0
  40. package/dist/apis/now/index.d.ts.map +1 -0
  41. package/dist/apis/now/index.mjs +3 -0
  42. package/dist/apis/now/types.cjs +0 -0
  43. package/dist/apis/now/types.d.ts +45 -0
  44. package/dist/apis/now/types.d.ts.map +1 -0
  45. package/dist/apis/now/types.mjs +0 -0
  46. package/dist/apis/people/types.d.ts +7 -2
  47. package/dist/apis/people/types.d.ts.map +1 -1
  48. package/dist/apis/permissions/PermissionsApi.cjs +6 -2
  49. package/dist/apis/permissions/PermissionsApi.cjs.map +1 -1
  50. package/dist/apis/permissions/PermissionsApi.d.ts +7 -3
  51. package/dist/apis/permissions/PermissionsApi.d.ts.map +1 -1
  52. package/dist/apis/permissions/PermissionsApi.mjs +6 -2
  53. package/dist/apis/permissions/PermissionsApi.mjs.map +1 -1
  54. package/dist/apis/permissions/types.d.ts +4 -14
  55. package/dist/apis/permissions/types.d.ts.map +1 -1
  56. package/dist/apis/personalAccessTokens/PersonalAccessTokensApi.cjs +5 -0
  57. package/dist/apis/personalAccessTokens/PersonalAccessTokensApi.cjs.map +1 -1
  58. package/dist/apis/personalAccessTokens/PersonalAccessTokensApi.d.ts +5 -0
  59. package/dist/apis/personalAccessTokens/PersonalAccessTokensApi.d.ts.map +1 -1
  60. package/dist/apis/personalAccessTokens/PersonalAccessTokensApi.mjs +5 -0
  61. package/dist/apis/personalAccessTokens/PersonalAccessTokensApi.mjs.map +1 -1
  62. package/dist/apis/personalAccessTokens/types.d.ts +23 -4
  63. package/dist/apis/personalAccessTokens/types.d.ts.map +1 -1
  64. package/dist/apis/roles/RolesApi.cjs.map +1 -1
  65. package/dist/apis/roles/RolesApi.d.ts +2 -2
  66. package/dist/apis/roles/RolesApi.d.ts.map +1 -1
  67. package/dist/apis/roles/RolesApi.mjs.map +1 -1
  68. package/dist/apis/roles/types.d.ts +27 -4
  69. package/dist/apis/roles/types.d.ts.map +1 -1
  70. package/dist/apis/terms/TermsApi.cjs +4 -1
  71. package/dist/apis/terms/TermsApi.cjs.map +1 -1
  72. package/dist/apis/terms/TermsApi.d.ts +4 -1
  73. package/dist/apis/terms/TermsApi.d.ts.map +1 -1
  74. package/dist/apis/terms/TermsApi.mjs +4 -1
  75. package/dist/apis/terms/TermsApi.mjs.map +1 -1
  76. package/dist/apis/timetable/types.d.ts +12 -7
  77. package/dist/apis/timetable/types.d.ts.map +1 -1
  78. package/dist/core/BaseCrudApi.cjs +3 -30
  79. package/dist/core/BaseCrudApi.cjs.map +1 -1
  80. package/dist/core/BaseCrudApi.d.ts +4 -24
  81. package/dist/core/BaseCrudApi.d.ts.map +1 -1
  82. package/dist/core/BaseCrudApi.mjs +3 -30
  83. package/dist/core/BaseCrudApi.mjs.map +1 -1
  84. package/dist/core/BaseReadApi.cjs +44 -0
  85. package/dist/core/BaseReadApi.cjs.map +1 -0
  86. package/dist/core/BaseReadApi.d.ts +32 -0
  87. package/dist/core/BaseReadApi.d.ts.map +1 -0
  88. package/dist/core/BaseReadApi.mjs +43 -0
  89. package/dist/core/BaseReadApi.mjs.map +1 -0
  90. package/dist/core/index.cjs +2 -0
  91. package/dist/core/index.d.ts +1 -0
  92. package/dist/core/index.d.ts.map +1 -1
  93. package/dist/core/index.mjs +2 -1
  94. package/dist/index.cjs +2 -0
  95. package/dist/index.mjs +2 -1
  96. package/package.json +1 -1
  97. package/src/apis/authHistory/AuthHistoryApi.test.ts +10 -2
  98. package/src/apis/authHistory/AuthHistoryApi.ts +13 -39
  99. package/src/apis/authHistory/types.ts +4 -3
  100. package/src/apis/customFields/types.ts +21 -25
  101. package/src/apis/dashboard/DashboardApi.test.ts +82 -0
  102. package/src/apis/dashboard/DashboardApi.ts +18 -0
  103. package/src/apis/dashboard/index.ts +2 -0
  104. package/src/apis/dashboard/types.ts +53 -0
  105. package/src/apis/holiday/types.ts +36 -8
  106. package/src/apis/index.ts +2 -0
  107. package/src/apis/now/NowApi.test.ts +125 -0
  108. package/src/apis/now/NowApi.ts +59 -0
  109. package/src/apis/now/index.ts +2 -0
  110. package/src/apis/now/types.ts +47 -0
  111. package/src/apis/payloads.test-d.ts +39 -0
  112. package/src/apis/payloads.test.ts +81 -0
  113. package/src/apis/people/types.ts +7 -2
  114. package/src/apis/permissions/PermissionsApi.test.ts +93 -0
  115. package/src/apis/permissions/PermissionsApi.ts +7 -7
  116. package/src/apis/permissions/types.ts +4 -16
  117. package/src/apis/personalAccessTokens/PersonalAccessTokensApi.ts +5 -0
  118. package/src/apis/personalAccessTokens/types.ts +25 -4
  119. package/src/apis/queryFormat.test.ts +75 -0
  120. package/src/apis/roles/RolesApi.ts +7 -2
  121. package/src/apis/roles/types.ts +27 -4
  122. package/src/apis/terms/TermsApi.ts +4 -1
  123. package/src/apis/timetable/types.ts +13 -7
  124. package/src/core/BaseCrudApi.ts +4 -60
  125. package/src/core/BaseReadApi.ts +70 -0
  126. package/src/core/index.ts +1 -0
package/README.md CHANGED
@@ -55,13 +55,14 @@ The SDK is structured in two layers:
55
55
  | `ApiClient.ts` | Interface defining `setAccessToken` and HTTP methods (`get`, `post`, `put`, `patch`, `delete`, `request`) |
56
56
  | `BaseApiClient.ts` | `fetch`-based implementation of `ApiClient`. Handles JSON serialization and error parsing into `ApiError`. Automatically injects `Authorization: Bearer` header when an access token is set |
57
57
  | `BaseApi.ts` | Base of every API class: holds the `client`, binds the methods to the instance (so they can be destructured) and provides `withQueryFormat` |
58
- | `BaseCrudApi.ts` | Generic class (extends `BaseApi`) providing `getMany`, `getOne`, `getById`, `create`, `updateById`, `deleteById` |
58
+ | `BaseReadApi.ts` | Generic read-only class (extends `BaseApi`) providing `basePath`, `getMany`, `getOne`, `getById`. Base of the resources the backend only serves for reading |
59
+ | `BaseCrudApi.ts` | Generic class (extends `BaseReadApi`) adding `create`, `updateById`, `deleteById` |
59
60
  | `types.ts` | Shared types: `WhereClause<T>`, `ListQuery<T>`, `Paginated<T>`, `IncludeItem<T>` |
60
61
 
61
62
  ### API Resources (`src/apis/<resource>/`)
62
63
 
63
64
  Each resource has its own folder with:
64
- - `<Resource>Api.ts` — extends `BaseCrudApi` with the resource path and type parameters (or `BaseApi` for resources without CRUD routes)
65
+ - `<Resource>Api.ts` — extends `BaseCrudApi` with the resource path and type parameters (`BaseReadApi` for read-only resources, or `BaseApi` for resources without CRUD routes)
65
66
  - `types.ts` — TypeScript types for the resource model, create payload, and update payload
66
67
  - `index.ts` — barrel file re-exporting the API class and all types
67
68
 
@@ -80,7 +81,7 @@ Available resources:
80
81
  | Accounts | `AccountsApi` | `/accounts` |
81
82
  | Activity Log | `ActivityLogApi` | `/activity-log` |
82
83
  | Answers | `AnswersApi` | `/answers` |
83
- | Auth History | `AuthHistoryApi` | `/auth-history` |
84
+ | Auth History (read-only) | `AuthHistoryApi` | `/auth-history` |
84
85
  | Bot Versions | `BotVersionsApi` | `/bot-versions` |
85
86
  | Bots | `BotsApi` | `/bots` |
86
87
  | Campaigns | `CampaignsApi` | `/campaigns` |
@@ -92,6 +93,7 @@ Available resources:
92
93
  | Contacts | `ContactsApi` | `/contacts` |
93
94
  | Credit Movements | `CreditMovementsApi` | `/credit-movements` |
94
95
  | Custom Fields | `CustomFieldsApi` | `/custom-fields` |
96
+ | Dashboard | `DashboardApi` | `/dashboard` |
95
97
  | Departments | `DepartmentsApi` | `/departments` |
96
98
  | Distribution | `DistributionApi` | `/distribution` |
97
99
  | Files | `FilesApi` | `/files` |
@@ -106,9 +108,10 @@ Available resources:
106
108
  | Me | `MeApi` | `/me` |
107
109
  | Messages | `MessagesApi` | `/messages` |
108
110
  | Notifications | `NotificationsApi` | `/notifications` |
111
+ | Now ("Agora") | `NowApi` | `/now` |
109
112
  | Organizations | `OrganizationsApi` | `/organizations` |
110
113
  | People | `PeopleApi` | `/people` |
111
- | Permissions | `PermissionsApi` | `/permissions` |
114
+ | Permissions (read-only) | `PermissionsApi` | `/permissions` |
112
115
  | Personal Access Tokens | `PersonalAccessTokensApi` | `/personal-access-tokens` |
113
116
  | Pipelines | `PipelineApi` | `/pipelines` |
114
117
  | Plan AI History | `PlanAiHistoryApi` | `/plan-ai-history` |
@@ -1,18 +1,18 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_core_BaseApi = require('../../core/BaseApi.cjs');
2
+ const require_core_BaseReadApi = require('../../core/BaseReadApi.cjs');
3
3
 
4
4
  //#region src/apis/authHistory/AuthHistoryApi.ts
5
- var AuthHistoryApi = class extends require_core_BaseApi.BaseApi {
6
- getMany(query, headers) {
7
- const queryString = this.toQueryString(query);
8
- return this.client.get(`/auth-history${queryString}`, headers);
9
- }
10
- /**
11
- * Returns a single authentication event by its ID. Non-admin users can only access their own records.
12
- * @permissions authHistory.view
13
- */
14
- getById(id, headers) {
15
- return this.client.get(`/auth-history/${id}`, headers);
5
+ /**
6
+ * Authentication events (auth, password_change, logout), read-only (guarded by
7
+ * `authHistory.view`). Non-admin users can only see and access their own records.
8
+ *
9
+ * Since 4.2 `getById` has the base signature `(id, query?, headers?)`: a call written as
10
+ * `getById(id, headers)` with the headers in a variable still compiles, but the headers are sent
11
+ * as the query string — move them to the third argument.
12
+ */
13
+ var AuthHistoryApi = class extends require_core_BaseReadApi.BaseReadApi {
14
+ constructor(client) {
15
+ super(client, "/auth-history");
16
16
  }
17
17
  };
18
18
 
@@ -1 +1 @@
1
- {"version":3,"file":"AuthHistoryApi.cjs","names":["BaseApi"],"sources":["../../../src/apis/authHistory/AuthHistoryApi.ts"],"sourcesContent":["import { BaseApi } from '../../core/BaseApi'\nimport type { ListQuery, Paginated, HasGetMany, HasGetById } from '../../core/types'\nimport type { AuthHistory } from './types'\n\nexport class AuthHistoryApi\n extends BaseApi\n implements HasGetMany<AuthHistory>, HasGetById<AuthHistory>\n{\n /**\n * Returns a paginated list of authentication events (auth, password_change, logout). Non-admin users can only see their own records.\n * @permissions authHistory.view\n */\n getMany(\n query: ListQuery<AuthHistory> & { paginate: false },\n headers?: Record<string, string>,\n ): Promise<AuthHistory[]>\n getMany(\n query?: ListQuery<AuthHistory> & { paginate?: true },\n headers?: Record<string, string>,\n ): Promise<Paginated<AuthHistory>>\n getMany(\n query?: ListQuery<AuthHistory>,\n headers?: Record<string, string>,\n ): Promise<Paginated<AuthHistory> | AuthHistory[]>\n getMany(\n query?: ListQuery<AuthHistory>,\n headers?: Record<string, string>,\n ): Promise<Paginated<AuthHistory> | AuthHistory[]> {\n const queryString = this.toQueryString(query)\n return this.client.get<Paginated<AuthHistory> | AuthHistory[]>(\n `/auth-history${queryString}`,\n headers,\n )\n }\n\n /**\n * Returns a single authentication event by its ID. Non-admin users can only access their own records.\n * @permissions authHistory.view\n */\n getById(id: string, headers?: Record<string, string>): Promise<AuthHistory> {\n return this.client.get<AuthHistory>(`/auth-history/${id}`, headers)\n }\n}\n"],"mappings":";;;;AAIA,IAAa,iBAAb,cACUA,6BAEV;CAiBE,QACE,OACA,SACiD;EACjD,MAAM,cAAc,KAAK,cAAc,MAAM;AAC7C,SAAO,KAAK,OAAO,IACjB,gBAAgB,eAChB,QACD;;;;;;CAOH,QAAQ,IAAY,SAAwD;AAC1E,SAAO,KAAK,OAAO,IAAiB,iBAAiB,MAAM,QAAQ"}
1
+ {"version":3,"file":"AuthHistoryApi.cjs","names":["BaseReadApi"],"sources":["../../../src/apis/authHistory/AuthHistoryApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseReadApi } from '../../core/BaseReadApi'\nimport type { AuthHistory } from './types'\n\n/**\n * Authentication events (auth, password_change, logout), read-only (guarded by\n * `authHistory.view`). Non-admin users can only see and access their own records.\n *\n * Since 4.2 `getById` has the base signature `(id, query?, headers?)`: a call written as\n * `getById(id, headers)` with the headers in a variable still compiles, but the headers are sent\n * as the query string — move them to the third argument.\n */\nexport class AuthHistoryApi extends BaseReadApi<AuthHistory> {\n constructor(client: ApiClient) {\n super(client, '/auth-history')\n }\n}\n"],"mappings":";;;;;;;;;;;;AAYA,IAAa,iBAAb,cAAoCA,qCAAyB;CAC3D,YAAY,QAAmB;AAC7B,QAAM,QAAQ,gBAAgB"}
@@ -1,22 +1,15 @@
1
- import { BaseApi } from '../../core/BaseApi';
2
- import type { ListQuery, Paginated, HasGetMany, HasGetById } from '../../core/types';
1
+ import type { ApiClient } from '../../core/ApiClient';
2
+ import { BaseReadApi } from '../../core/BaseReadApi';
3
3
  import type { AuthHistory } from './types';
4
- export declare class AuthHistoryApi extends BaseApi implements HasGetMany<AuthHistory>, HasGetById<AuthHistory> {
5
- /**
6
- * Returns a paginated list of authentication events (auth, password_change, logout). Non-admin users can only see their own records.
7
- * @permissions authHistory.view
8
- */
9
- getMany(query: ListQuery<AuthHistory> & {
10
- paginate: false;
11
- }, headers?: Record<string, string>): Promise<AuthHistory[]>;
12
- getMany(query?: ListQuery<AuthHistory> & {
13
- paginate?: true;
14
- }, headers?: Record<string, string>): Promise<Paginated<AuthHistory>>;
15
- getMany(query?: ListQuery<AuthHistory>, headers?: Record<string, string>): Promise<Paginated<AuthHistory> | AuthHistory[]>;
16
- /**
17
- * Returns a single authentication event by its ID. Non-admin users can only access their own records.
18
- * @permissions authHistory.view
19
- */
20
- getById(id: string, headers?: Record<string, string>): Promise<AuthHistory>;
4
+ /**
5
+ * Authentication events (auth, password_change, logout), read-only (guarded by
6
+ * `authHistory.view`). Non-admin users can only see and access their own records.
7
+ *
8
+ * Since 4.2 `getById` has the base signature `(id, query?, headers?)`: a call written as
9
+ * `getById(id, headers)` with the headers in a variable still compiles, but the headers are sent
10
+ * as the query string — move them to the third argument.
11
+ */
12
+ export declare class AuthHistoryApi extends BaseReadApi<AuthHistory> {
13
+ constructor(client: ApiClient);
21
14
  }
22
15
  //# sourceMappingURL=AuthHistoryApi.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AuthHistoryApi.d.ts","sourceRoot":"","sources":["../../../src/apis/authHistory/AuthHistoryApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACpF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,qBAAa,cACX,SAAQ,OACR,YAAW,UAAU,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC;IAE3D;;;OAGG;IACH,OAAO,CACL,KAAK,EAAE,SAAS,CAAC,WAAW,CAAC,GAAG;QAAE,QAAQ,EAAE,KAAK,CAAA;KAAE,EACnD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,WAAW,EAAE,CAAC;IACzB,OAAO,CACL,KAAK,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,GAAG;QAAE,QAAQ,CAAC,EAAE,IAAI,CAAA;KAAE,EACpD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAClC,OAAO,CACL,KAAK,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,EAC9B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,WAAW,EAAE,CAAC;IAYlD;;;OAGG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;CAG5E"}
1
+ {"version":3,"file":"AuthHistoryApi.d.ts","sourceRoot":"","sources":["../../../src/apis/authHistory/AuthHistoryApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;;;;GAOG;AACH,qBAAa,cAAe,SAAQ,WAAW,CAAC,WAAW,CAAC;gBAC9C,MAAM,EAAE,SAAS;CAG9B"}
@@ -1,17 +1,17 @@
1
- import { BaseApi } from "../../core/BaseApi.mjs";
1
+ import { BaseReadApi } from "../../core/BaseReadApi.mjs";
2
2
 
3
3
  //#region src/apis/authHistory/AuthHistoryApi.ts
4
- var AuthHistoryApi = class extends BaseApi {
5
- getMany(query, headers) {
6
- const queryString = this.toQueryString(query);
7
- return this.client.get(`/auth-history${queryString}`, headers);
8
- }
9
- /**
10
- * Returns a single authentication event by its ID. Non-admin users can only access their own records.
11
- * @permissions authHistory.view
12
- */
13
- getById(id, headers) {
14
- return this.client.get(`/auth-history/${id}`, headers);
4
+ /**
5
+ * Authentication events (auth, password_change, logout), read-only (guarded by
6
+ * `authHistory.view`). Non-admin users can only see and access their own records.
7
+ *
8
+ * Since 4.2 `getById` has the base signature `(id, query?, headers?)`: a call written as
9
+ * `getById(id, headers)` with the headers in a variable still compiles, but the headers are sent
10
+ * as the query string — move them to the third argument.
11
+ */
12
+ var AuthHistoryApi = class extends BaseReadApi {
13
+ constructor(client) {
14
+ super(client, "/auth-history");
15
15
  }
16
16
  };
17
17
 
@@ -1 +1 @@
1
- {"version":3,"file":"AuthHistoryApi.mjs","names":[],"sources":["../../../src/apis/authHistory/AuthHistoryApi.ts"],"sourcesContent":["import { BaseApi } from '../../core/BaseApi'\nimport type { ListQuery, Paginated, HasGetMany, HasGetById } from '../../core/types'\nimport type { AuthHistory } from './types'\n\nexport class AuthHistoryApi\n extends BaseApi\n implements HasGetMany<AuthHistory>, HasGetById<AuthHistory>\n{\n /**\n * Returns a paginated list of authentication events (auth, password_change, logout). Non-admin users can only see their own records.\n * @permissions authHistory.view\n */\n getMany(\n query: ListQuery<AuthHistory> & { paginate: false },\n headers?: Record<string, string>,\n ): Promise<AuthHistory[]>\n getMany(\n query?: ListQuery<AuthHistory> & { paginate?: true },\n headers?: Record<string, string>,\n ): Promise<Paginated<AuthHistory>>\n getMany(\n query?: ListQuery<AuthHistory>,\n headers?: Record<string, string>,\n ): Promise<Paginated<AuthHistory> | AuthHistory[]>\n getMany(\n query?: ListQuery<AuthHistory>,\n headers?: Record<string, string>,\n ): Promise<Paginated<AuthHistory> | AuthHistory[]> {\n const queryString = this.toQueryString(query)\n return this.client.get<Paginated<AuthHistory> | AuthHistory[]>(\n `/auth-history${queryString}`,\n headers,\n )\n }\n\n /**\n * Returns a single authentication event by its ID. Non-admin users can only access their own records.\n * @permissions authHistory.view\n */\n getById(id: string, headers?: Record<string, string>): Promise<AuthHistory> {\n return this.client.get<AuthHistory>(`/auth-history/${id}`, headers)\n }\n}\n"],"mappings":";;;AAIA,IAAa,iBAAb,cACU,QAEV;CAiBE,QACE,OACA,SACiD;EACjD,MAAM,cAAc,KAAK,cAAc,MAAM;AAC7C,SAAO,KAAK,OAAO,IACjB,gBAAgB,eAChB,QACD;;;;;;CAOH,QAAQ,IAAY,SAAwD;AAC1E,SAAO,KAAK,OAAO,IAAiB,iBAAiB,MAAM,QAAQ"}
1
+ {"version":3,"file":"AuthHistoryApi.mjs","names":[],"sources":["../../../src/apis/authHistory/AuthHistoryApi.ts"],"sourcesContent":["import type { ApiClient } from '../../core/ApiClient'\nimport { BaseReadApi } from '../../core/BaseReadApi'\nimport type { AuthHistory } from './types'\n\n/**\n * Authentication events (auth, password_change, logout), read-only (guarded by\n * `authHistory.view`). Non-admin users can only see and access their own records.\n *\n * Since 4.2 `getById` has the base signature `(id, query?, headers?)`: a call written as\n * `getById(id, headers)` with the headers in a variable still compiles, but the headers are sent\n * as the query string — move them to the third argument.\n */\nexport class AuthHistoryApi extends BaseReadApi<AuthHistory> {\n constructor(client: ApiClient) {\n super(client, '/auth-history')\n }\n}\n"],"mappings":";;;;;;;;;;;AAYA,IAAa,iBAAb,cAAoC,YAAyB;CAC3D,YAAY,QAAmB;AAC7B,QAAM,QAAQ,gBAAgB"}
@@ -6,9 +6,10 @@ export type AuthHistory = {
6
6
  event: AuthHistoryEvent;
7
7
  userId: string;
8
8
  accountId: string;
9
- branch: string;
10
- originIP: string;
11
- originUA: string;
9
+ /** Nullable in the database. */
10
+ originIP: string | null;
11
+ /** Nullable in the database. */
12
+ originUA: string | null;
12
13
  createdAt: string;
13
14
  updatedAt: string;
14
15
  account?: Account;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/authHistory/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,iBAAiB,GAAG,QAAQ,CAAA;AAEpE,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,gBAAgB,CAAA;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IAEjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,IAAI,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,MAAM,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/authHistory/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,iBAAiB,GAAG,QAAQ,CAAA;AAEpE,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,gBAAgB,CAAA;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IAEjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,IAAI,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,MAAM,CAAA"}
@@ -1,24 +1,26 @@
1
1
  export type CustomFieldType = 'cpf' | 'cnpj' | 'email' | 'date' | 'date-range' | 'hour' | 'hour-range' | 'type' | 'text' | 'long-text' | 'numeric' | 'monetary' | 'phone' | 'postal-code' | 'checkbox' | 'list';
2
2
  export type CustomFieldOption = {
3
- id?: string;
4
- label?: string;
3
+ id?: string | null;
4
+ label?: string | null;
5
5
  };
6
- /** Settings for `list` and `checkbox` types: a list of selectable options. */
7
- export type CustomFieldListSettings = {
8
- options: CustomFieldOption[];
6
+ /**
7
+ * Settings of a custom field — a free JSONB the backend does not validate, echoed back as sent.
8
+ * The fields below are the ones the web app form sends (`front/src/pages/custom-fields/components/
9
+ * form.tsx`): `options` for the `list` and `checkbox` types, `min`/`max` for `numeric` and `monetary`,
10
+ * `currency` for `monetary`, `maxLength` for `text` and `long-text`, and `placeholder` for the inputs.
11
+ */
12
+ export type CustomFieldSettings = {
13
+ options?: CustomFieldOption[];
14
+ placeholder?: string | null;
15
+ currency?: string | null;
16
+ maxLength?: number | null;
17
+ min?: string | null;
18
+ max?: string | null;
9
19
  };
10
- /** Settings for `monetary` type: optional min/max value constraints. */
11
- export type CustomFieldMonetarySettings = {
12
- options: CustomFieldOption[];
13
- min?: string;
14
- max?: string;
15
- };
16
- /** Settings for `text` and `long-text` types: optional max length constraint. */
17
- export type CustomFieldTextSettings = {
18
- options: CustomFieldOption[];
19
- maxLength?: number;
20
- };
21
- export type CustomFieldSettings = CustomFieldListSettings | CustomFieldMonetarySettings | CustomFieldTextSettings;
20
+ /**
21
+ * A custom field of the account. Custom fields are soft-deleted, but `deletedAt` is never returned
22
+ * (customFieldsTransformer).
23
+ */
22
24
  export type CustomField = {
23
25
  id: string;
24
26
  name: string;
@@ -30,7 +32,6 @@ export type CustomField = {
30
32
  accountId: string;
31
33
  createdAt: string;
32
34
  updatedAt: string;
33
- deletedAt: string | null;
34
35
  };
35
36
  export type CreateCustomFieldPayload = {
36
37
  name: string;
@@ -38,11 +39,12 @@ export type CreateCustomFieldPayload = {
38
39
  allowed: 'contacts';
39
40
  showOnRegister?: boolean;
40
41
  required?: boolean;
41
- settings?: CustomFieldSettings;
42
+ settings?: CustomFieldSettings | null;
42
43
  };
43
44
  export type UpdateCustomFieldPayload = {
44
45
  name?: string;
45
46
  type?: CustomFieldType;
47
+ allowed?: 'contacts';
46
48
  showOnRegister?: boolean;
47
49
  required?: boolean;
48
50
  settings?: CustomFieldSettings | null;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/customFields/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GACvB,KAAK,GACL,MAAM,GACN,OAAO,GACP,MAAM,GACN,YAAY,GACZ,MAAM,GACN,YAAY,GACZ,MAAM,GACN,MAAM,GACN,WAAW,GACX,SAAS,GACT,UAAU,GACV,OAAO,GACP,aAAa,GACb,UAAU,GACV,MAAM,CAAA;A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E,OAAO,CAAA;IACjB,QAAQ,EAAE,mBAAmB,GAAG,IAAI,CAAA;IACpC,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,eAAe,CAAA;IACrB,OAAO,EAAE,UAAU,CAAA;IACnB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAA;CACtC,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,eAAe,CAAA;IACtB,OAAO,CAAC,EAAE,UAAU,CAAA;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAA;CACtC,CAAA"}
@@ -0,0 +1,19 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_core_BaseApi = require('../../core/BaseApi.cjs');
3
+
4
+ //#region src/apis/dashboard/DashboardApi.ts
5
+ /**
6
+ * Service statistics ("Estatísticas de atendimento"). The `/dashboard` routes only require an
7
+ * authenticated user (no permission check).
8
+ */
9
+ var DashboardApi = class extends require_core_BaseApi.BaseApi {
10
+ basePath = "/dashboard";
11
+ /** Message, ticket, contact and time counts of the period (`GET /dashboard/general`). */
12
+ getGeneral(query, headers) {
13
+ return this.client.get(`${this.basePath}/general${this.toQueryString(query)}`, headers);
14
+ }
15
+ };
16
+
17
+ //#endregion
18
+ exports.DashboardApi = DashboardApi;
19
+ //# sourceMappingURL=DashboardApi.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DashboardApi.cjs","names":["BaseApi"],"sources":["../../../src/apis/dashboard/DashboardApi.ts"],"sourcesContent":["import { BaseApi } from '../../core/BaseApi'\nimport type { DashboardGeneral, DashboardQuery } from './types'\n\n/**\n * Service statistics (\"Estatísticas de atendimento\"). The `/dashboard` routes only require an\n * authenticated user (no permission check).\n */\nexport class DashboardApi extends BaseApi {\n public readonly basePath = '/dashboard'\n\n /** Message, ticket, contact and time counts of the period (`GET /dashboard/general`). */\n getGeneral(query?: DashboardQuery, headers?: Record<string, string>): Promise<DashboardGeneral> {\n return this.client.get<DashboardGeneral>(\n `${this.basePath}/general${this.toQueryString(query)}`,\n headers,\n )\n }\n}\n"],"mappings":";;;;;;;;AAOA,IAAa,eAAb,cAAkCA,6BAAQ;CACxC,AAAgB,WAAW;;CAG3B,WAAW,OAAwB,SAA6D;AAC9F,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,UAAU,KAAK,cAAc,MAAM,IACpD,QACD"}
@@ -0,0 +1,12 @@
1
+ import { BaseApi } from '../../core/BaseApi';
2
+ import type { DashboardGeneral, DashboardQuery } from './types';
3
+ /**
4
+ * Service statistics ("Estatísticas de atendimento"). The `/dashboard` routes only require an
5
+ * authenticated user (no permission check).
6
+ */
7
+ export declare class DashboardApi extends BaseApi {
8
+ readonly basePath = "/dashboard";
9
+ /** Message, ticket, contact and time counts of the period (`GET /dashboard/general`). */
10
+ getGeneral(query?: DashboardQuery, headers?: Record<string, string>): Promise<DashboardGeneral>;
11
+ }
12
+ //# sourceMappingURL=DashboardApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DashboardApi.d.ts","sourceRoot":"","sources":["../../../src/apis/dashboard/DashboardApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE/D;;;GAGG;AACH,qBAAa,YAAa,SAAQ,OAAO;IACvC,SAAgB,QAAQ,gBAAe;IAEvC,yFAAyF;IACzF,UAAU,CAAC,KAAK,CAAC,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAMhG"}
@@ -0,0 +1,18 @@
1
+ import { BaseApi } from "../../core/BaseApi.mjs";
2
+
3
+ //#region src/apis/dashboard/DashboardApi.ts
4
+ /**
5
+ * Service statistics ("Estatísticas de atendimento"). The `/dashboard` routes only require an
6
+ * authenticated user (no permission check).
7
+ */
8
+ var DashboardApi = class extends BaseApi {
9
+ basePath = "/dashboard";
10
+ /** Message, ticket, contact and time counts of the period (`GET /dashboard/general`). */
11
+ getGeneral(query, headers) {
12
+ return this.client.get(`${this.basePath}/general${this.toQueryString(query)}`, headers);
13
+ }
14
+ };
15
+
16
+ //#endregion
17
+ export { DashboardApi };
18
+ //# sourceMappingURL=DashboardApi.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DashboardApi.mjs","names":[],"sources":["../../../src/apis/dashboard/DashboardApi.ts"],"sourcesContent":["import { BaseApi } from '../../core/BaseApi'\nimport type { DashboardGeneral, DashboardQuery } from './types'\n\n/**\n * Service statistics (\"Estatísticas de atendimento\"). The `/dashboard` routes only require an\n * authenticated user (no permission check).\n */\nexport class DashboardApi extends BaseApi {\n public readonly basePath = '/dashboard'\n\n /** Message, ticket, contact and time counts of the period (`GET /dashboard/general`). */\n getGeneral(query?: DashboardQuery, headers?: Record<string, string>): Promise<DashboardGeneral> {\n return this.client.get<DashboardGeneral>(\n `${this.basePath}/general${this.toQueryString(query)}`,\n headers,\n )\n }\n}\n"],"mappings":";;;;;;;AAOA,IAAa,eAAb,cAAkC,QAAQ;CACxC,AAAgB,WAAW;;CAG3B,WAAW,OAAwB,SAA6D;AAC9F,SAAO,KAAK,OAAO,IACjB,GAAG,KAAK,SAAS,UAAU,KAAK,cAAc,MAAM,IACpD,QACD"}
@@ -0,0 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_apis_dashboard_DashboardApi = require('./DashboardApi.cjs');
3
+
4
+ exports.DashboardApi = require_apis_dashboard_DashboardApi.DashboardApi;
@@ -0,0 +1,3 @@
1
+ export { DashboardApi } from './DashboardApi';
2
+ export type * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/apis/dashboard/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,mBAAmB,SAAS,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { DashboardApi } from "./DashboardApi.mjs";
2
+
3
+ export { DashboardApi };
File without changes
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Filters of the service statistics (`/dashboard`). Every field is optional; the period defaults to
3
+ * the last 7 days.
4
+ */
5
+ export type DashboardQuery = {
6
+ /** ISO date-time. Default: 7 days ago, 00:00. */
7
+ startPeriod?: string;
8
+ /** ISO date-time. Default: the end of the `startPeriod` day (or of today). */
9
+ endPeriod?: string;
10
+ /** Which ticket date the period filters: opening (default) or closing. */
11
+ periodType?: 'openDate' | 'closeDate';
12
+ /** Ticket status (`closed`, not `close`). */
13
+ status?: 'all' | 'open' | 'closed';
14
+ /**
15
+ * A department id, a list of ids, or `all`. Only applied together with `departmentParticipation`:
16
+ * without it the backend ignores `departmentId` and answers the totals of every department.
17
+ */
18
+ departmentId?: string | string[];
19
+ /**
20
+ * Whether the department must be the ticket's last one or any one it went through. Required for
21
+ * `departmentId` to filter; sent WITHOUT `departmentId`, it filters the tickets with no department.
22
+ */
23
+ departmentParticipation?: 'last' | 'middle';
24
+ /**
25
+ * A user id, a list of ids, or `all`. Only applied together with `userParticipation`: without it
26
+ * the backend ignores `userId` and answers the totals of every user.
27
+ */
28
+ userId?: string | string[];
29
+ /**
30
+ * Whether the user must be the ticket's last one or any one it went through. Required for `userId`
31
+ * to filter; sent WITHOUT `userId`, it filters the tickets with no user.
32
+ */
33
+ userParticipation?: 'last' | 'middle';
34
+ userStatus?: 'active' | 'archived' | 'all';
35
+ serviceId?: string | string[];
36
+ tagId?: string | string[];
37
+ ticketTopicId?: string | string[];
38
+ };
39
+ /** `GET /dashboard/general` — counts of the period. Times are in seconds. */
40
+ export type DashboardGeneral = {
41
+ sentMessagesCount: number;
42
+ receivedMessagesCount: number;
43
+ totalMessagesCount: number;
44
+ openedTicketsCount: number;
45
+ closedTicketsCount: number;
46
+ totalTicketsCount: number;
47
+ waitingTime: number;
48
+ waitingTimeAfterBot: number;
49
+ waitingTimeAvg: number;
50
+ ticketTime: number;
51
+ contactsCount: number;
52
+ };
53
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/dashboard/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,0EAA0E;IAC1E,UAAU,CAAC,EAAE,UAAU,GAAG,WAAW,CAAA;IACrC,6CAA6C;IAC7C,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAA;IAClC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAChC;;;OAGG;IACH,uBAAuB,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;IAC3C;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC1B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;IACrC,UAAU,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,KAAK,CAAA;IAC1C,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC7B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IACzB,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAClC,CAAA;AAED,6EAA6E;AAC7E,MAAM,MAAM,gBAAgB,GAAG;IAC7B,iBAAiB,EAAE,MAAM,CAAA;IACzB,qBAAqB,EAAE,MAAM,CAAA;IAC7B,kBAAkB,EAAE,MAAM,CAAA;IAC1B,kBAAkB,EAAE,MAAM,CAAA;IAC1B,kBAAkB,EAAE,MAAM,CAAA;IAC1B,iBAAiB,EAAE,MAAM,CAAA;IACzB,WAAW,EAAE,MAAM,CAAA;IACnB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,cAAc,EAAE,MAAM,CAAA;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;CACtB,CAAA"}
File without changes
@@ -1,24 +1,50 @@
1
+ import type { Account } from '../accounts/types';
2
+ import type { File } from '../files/types';
3
+ /**
4
+ * A holiday: the account's services answer `message` during the period `from`–`to`.
5
+ * Holidays are soft-deleted, but `deletedAt` is never returned.
6
+ */
1
7
  export type Holiday = {
2
8
  id: string;
3
9
  name: string;
4
10
  from: string;
5
11
  to: string;
6
12
  message: string;
13
+ /** Whether the period is over. */
14
+ expired: boolean;
15
+ /** Number of attached files (computed on the listing, derived from `files` on the detail). */
16
+ filesCount: number;
17
+ /**
18
+ * Attached files — always an array. Only loaded on `getById` (or when listed with
19
+ * `include: ['files']`): `getMany` answers `[]` even when the holiday has files, so use
20
+ * `filesCount` there.
21
+ */
22
+ files: File[];
7
23
  accountId: string;
8
24
  createdAt: string;
9
- updatedAt: string | null;
10
- deletedAt: string | null;
25
+ /** Virtual attribute of the model — may be absent. */
26
+ updatedAt?: string | null;
27
+ account?: Account;
28
+ };
29
+ export type HolidayRelationships = 'account' | 'files';
30
+ /** A file attached by id (up to 10 per holiday). */
31
+ export type HolidayFileRef = {
32
+ id: string;
11
33
  };
12
34
  export type CreateHolidayPayload = {
35
+ /** Up to 255 characters. */
13
36
  name: string;
37
+ /** Date string. A period overlapping another holiday answers 402 "Holiday time already exists.". */
14
38
  from: string;
39
+ /** Date string. */
15
40
  to: string;
41
+ /** Up to 1024 characters. */
16
42
  message: string;
43
+ files?: HolidayFileRef[];
17
44
  };
18
- export type UpdateHolidayPayload = {
19
- name?: string;
20
- from?: string;
21
- to?: string;
22
- message?: string;
23
- };
45
+ /**
46
+ * The backend requires name, from, to and message on every update (same validator as the create).
47
+ * Omitting `files` keeps the current attachments.
48
+ */
49
+ export type UpdateHolidayPayload = CreateHolidayPayload;
24
50
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/holiday/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/apis/holiday/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,8FAA8F;IAC9F,UAAU,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAEzB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,OAAO,CAAA;AAEtD,oDAAoD;AACpD,MAAM,MAAM,cAAc,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAA;AAE3C,MAAM,MAAM,oBAAoB,GAAG;IACjC,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,oGAAoG;IACpG,IAAI,EAAE,MAAM,CAAA;IACZ,mBAAmB;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,cAAc,EAAE,CAAA;CACzB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,CAAA"}
@@ -34,6 +34,8 @@ const require_apis_creditMovements_CreditMovementsApi = require('./creditMovemen
34
34
  require('./creditMovements/index.cjs');
35
35
  const require_apis_customFields_CustomFieldsApi = require('./customFields/CustomFieldsApi.cjs');
36
36
  require('./customFields/index.cjs');
37
+ const require_apis_dashboard_DashboardApi = require('./dashboard/DashboardApi.cjs');
38
+ require('./dashboard/index.cjs');
37
39
  const require_apis_departments_DepartmentsApi = require('./departments/DepartmentsApi.cjs');
38
40
  require('./departments/index.cjs');
39
41
  const require_apis_distribution_DistributionApi = require('./distribution/DistributionApi.cjs');
@@ -62,6 +64,8 @@ const require_apis_messages_MessagesApi = require('./messages/MessagesApi.cjs');
62
64
  require('./messages/index.cjs');
63
65
  const require_apis_notifications_NotificationsApi = require('./notifications/NotificationsApi.cjs');
64
66
  require('./notifications/index.cjs');
67
+ const require_apis_now_NowApi = require('./now/NowApi.cjs');
68
+ require('./now/index.cjs');
65
69
  const require_apis_organizations_OrganizationsApi = require('./organizations/OrganizationsApi.cjs');
66
70
  require('./organizations/index.cjs');
67
71
  const require_apis_people_PeopleApi = require('./people/PeopleApi.cjs');
@@ -128,6 +132,7 @@ exports.ContactBlockListsControlsApi = require_apis_contactBlockListsControls_Co
128
132
  exports.ContactsApi = require_apis_contacts_ContactsApi.ContactsApi;
129
133
  exports.CreditMovementsApi = require_apis_creditMovements_CreditMovementsApi.CreditMovementsApi;
130
134
  exports.CustomFieldsApi = require_apis_customFields_CustomFieldsApi.CustomFieldsApi;
135
+ exports.DashboardApi = require_apis_dashboard_DashboardApi.DashboardApi;
131
136
  exports.DepartmentsApi = require_apis_departments_DepartmentsApi.DepartmentsApi;
132
137
  exports.DistributionApi = require_apis_distribution_DistributionApi.DistributionApi;
133
138
  exports.FilesApi = require_apis_files_FilesApi.FilesApi;
@@ -142,6 +147,7 @@ exports.KnowledgeBaseItemApi = require_apis_knowledgeBaseItem_KnowledgeBaseItemA
142
147
  exports.MeApi = require_apis_me_MeApi.MeApi;
143
148
  exports.MessagesApi = require_apis_messages_MessagesApi.MessagesApi;
144
149
  exports.NotificationsApi = require_apis_notifications_NotificationsApi.NotificationsApi;
150
+ exports.NowApi = require_apis_now_NowApi.NowApi;
145
151
  exports.OrganizationsApi = require_apis_organizations_OrganizationsApi.OrganizationsApi;
146
152
  exports.PeopleApi = require_apis_people_PeopleApi.PeopleApi;
147
153
  exports.PermissionsApi = require_apis_permissions_PermissionsApi.PermissionsApi;
@@ -15,6 +15,7 @@ export * from './contactBlockListsControls';
15
15
  export * from './contacts';
16
16
  export * from './creditMovements';
17
17
  export * from './customFields';
18
+ export * from './dashboard';
18
19
  export * from './departments';
19
20
  export * from './distribution';
20
21
  export * from './files';
@@ -29,6 +30,7 @@ export * from './knowledgeBaseItem';
29
30
  export * from './me';
30
31
  export * from './messages';
31
32
  export * from './notifications';
33
+ export * from './now';
32
34
  export * from './organizations';
33
35
  export * from './people';
34
36
  export * from './permissions';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,QAAQ,CAAA;AACtB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAA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gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,MAAM,CAAA;AACpB,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,OAAO,CAAA;AACrB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,wBAAwB,CAAA;AACtC,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,2BAA2B,CAAA;AACzC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,6BAA6B,CAAA"}
@@ -33,6 +33,8 @@ import { CreditMovementsApi } from "./creditMovements/CreditMovementsApi.mjs";
33
33
  import "./creditMovements/index.mjs";
34
34
  import { CustomFieldsApi } from "./customFields/CustomFieldsApi.mjs";
35
35
  import "./customFields/index.mjs";
36
+ import { DashboardApi } from "./dashboard/DashboardApi.mjs";
37
+ import "./dashboard/index.mjs";
36
38
  import { DepartmentsApi } from "./departments/DepartmentsApi.mjs";
37
39
  import "./departments/index.mjs";
38
40
  import { DistributionApi } from "./distribution/DistributionApi.mjs";
@@ -61,6 +63,8 @@ import { MessagesApi } from "./messages/MessagesApi.mjs";
61
63
  import "./messages/index.mjs";
62
64
  import { NotificationsApi } from "./notifications/NotificationsApi.mjs";
63
65
  import "./notifications/index.mjs";
66
+ import { NowApi } from "./now/NowApi.mjs";
67
+ import "./now/index.mjs";
64
68
  import { OrganizationsApi } from "./organizations/OrganizationsApi.mjs";
65
69
  import "./organizations/index.mjs";
66
70
  import { PeopleApi } from "./people/PeopleApi.mjs";
@@ -110,4 +114,4 @@ import "./webhooks/index.mjs";
110
114
  import { WhatsappBusinessTemplatesApi } from "./whatsappBusinessTemplates/WhatsappBusinessTemplatesApi.mjs";
111
115
  import "./whatsappBusinessTemplates/index.mjs";
112
116
 
113
- export { AbsenceApi, AcceptanceTermsApi, AccountsApi, ActivityLogApi, AnswersApi, AuthHistoryApi, BotVersionsApi, BotsApi, CampaignsApi, CardsApi, CategoriesApi, ClientFeedbackApi, ContactBlockListsApi, ContactBlockListsControlsApi, ContactsApi, CreditMovementsApi, CustomFieldsApi, DepartmentsApi, DistributionApi, FilesApi, HolidayApi, IntegrationsApi, InteractiveMessagesApi, KanbanBoardsApi, KanbanCardsApi, KanbanColumnsApi, KnowledgeBaseApi, KnowledgeBaseItemApi, MeApi, MessagesApi, NotificationsApi, OrganizationsApi, PeopleApi, PermissionsApi, PersonalAccessTokensApi, PipelineApi, PlanAiHistoryApi, QuestionsApi, QuickRepliesApi, RolesApi, ScheduleApi, ServiceAccessManagementApi, ServiceEventsApi, ServicesApi, StickerUsersApi, StickersApi, TagsApi, TermsApi, TicketTopicsApi, TicketsApi, TimetableApi, TranscriptsApi, UsersApi, WebhooksApi, WhatsappBusinessTemplatesApi, scopes_exports as scopes };
117
+ export { AbsenceApi, AcceptanceTermsApi, AccountsApi, ActivityLogApi, AnswersApi, AuthHistoryApi, BotVersionsApi, BotsApi, CampaignsApi, CardsApi, CategoriesApi, ClientFeedbackApi, ContactBlockListsApi, ContactBlockListsControlsApi, ContactsApi, CreditMovementsApi, CustomFieldsApi, DashboardApi, DepartmentsApi, DistributionApi, FilesApi, HolidayApi, IntegrationsApi, InteractiveMessagesApi, KanbanBoardsApi, KanbanCardsApi, KanbanColumnsApi, KnowledgeBaseApi, KnowledgeBaseItemApi, MeApi, MessagesApi, NotificationsApi, NowApi, OrganizationsApi, PeopleApi, PermissionsApi, PersonalAccessTokensApi, PipelineApi, PlanAiHistoryApi, QuestionsApi, QuickRepliesApi, RolesApi, ScheduleApi, ServiceAccessManagementApi, ServiceEventsApi, ServicesApi, StickerUsersApi, StickersApi, TagsApi, TermsApi, TicketTopicsApi, TicketsApi, TimetableApi, TranscriptsApi, UsersApi, WebhooksApi, WhatsappBusinessTemplatesApi, scopes_exports as scopes };