@arbol-ai/sdk 3.0.0 → 4.0.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 (236) hide show
  1. package/README.md +23 -0
  2. package/dist/account/apiKeys/client.d.ts +15 -47
  3. package/dist/account/apiKeys/client.js +11 -12
  4. package/dist/account/apiKeys/index.d.ts +1 -1
  5. package/dist/account/apiKeys/models.d.ts +164 -1
  6. package/dist/account/apiKeys/models.js +6 -0
  7. package/dist/account/billing/client.d.ts +4 -10
  8. package/dist/account/billing/client.js +7 -7
  9. package/dist/account/billing/index.d.ts +2 -2
  10. package/dist/account/billing/models.d.ts +32 -0
  11. package/dist/account/billing/models.js +5 -2
  12. package/dist/account/billingProfiles/client.d.ts +13 -24
  13. package/dist/account/billingProfiles/client.js +4 -4
  14. package/dist/account/billingProfiles/index.d.ts +1 -1
  15. package/dist/account/billingProfiles/models.d.ts +48 -0
  16. package/dist/account/client.d.ts +6 -0
  17. package/dist/account/client.js +15 -0
  18. package/dist/account/connections/client.d.ts +2 -200
  19. package/dist/account/connections/client.js +1 -25
  20. package/dist/account/connections/index.d.ts +2 -2
  21. package/dist/account/connections/models.d.ts +22 -7
  22. package/dist/account/index.d.ts +1 -1
  23. package/dist/account/invitations/client.d.ts +9 -38
  24. package/dist/account/invitations/client.js +8 -9
  25. package/dist/account/invitations/index.d.ts +1 -1
  26. package/dist/account/invitations/models.d.ts +221 -2
  27. package/dist/account/invitations/models.js +6 -0
  28. package/dist/account/invoiceDocuments/client.d.ts +25 -0
  29. package/dist/account/invoiceDocuments/client.js +17 -0
  30. package/dist/account/invoiceDocuments/index.d.ts +5 -0
  31. package/dist/account/invoiceDocuments/index.js +4 -0
  32. package/dist/account/invoiceDocuments/models.d.ts +35 -0
  33. package/dist/account/invoiceDocuments/models.js +3 -0
  34. package/dist/account/invoices/client.d.ts +7 -34
  35. package/dist/account/invoices/client.js +7 -14
  36. package/dist/account/invoices/index.d.ts +2 -2
  37. package/dist/account/invoices/models.d.ts +66 -1
  38. package/dist/account/invoices/models.js +8 -0
  39. package/dist/account/members/client.d.ts +14 -55
  40. package/dist/account/members/client.js +6 -7
  41. package/dist/account/members/index.d.ts +1 -1
  42. package/dist/account/members/models.d.ts +261 -2
  43. package/dist/account/models.d.ts +210 -259
  44. package/dist/account/organization/client.d.ts +31 -0
  45. package/dist/account/organization/client.js +25 -0
  46. package/dist/account/organization/index.d.ts +5 -0
  47. package/dist/account/organization/index.js +4 -0
  48. package/dist/account/organization/models.d.ts +89 -0
  49. package/dist/account/organization/models.js +3 -0
  50. package/dist/account/organizations/client.d.ts +2 -48
  51. package/dist/account/organizations/client.js +1 -16
  52. package/dist/account/organizations/index.d.ts +2 -2
  53. package/dist/account/organizations/models.d.ts +26 -37
  54. package/dist/account/payments/client.d.ts +2 -8
  55. package/dist/account/payments/client.js +4 -4
  56. package/dist/account/payments/index.d.ts +1 -1
  57. package/dist/account/payments/models.d.ts +28 -1
  58. package/dist/account/payments/models.js +3 -0
  59. package/dist/account/permissions/client.d.ts +2 -8
  60. package/dist/account/permissions/client.js +1 -1
  61. package/dist/account/permissions/index.d.ts +1 -1
  62. package/dist/account/permissions/models.d.ts +27 -1
  63. package/dist/account/roles/client.d.ts +2 -8
  64. package/dist/account/roles/client.js +1 -1
  65. package/dist/account/roles/index.d.ts +1 -1
  66. package/dist/account/roles/models.d.ts +27 -1
  67. package/dist/account/usage/client.d.ts +7 -44
  68. package/dist/account/usage/client.js +5 -13
  69. package/dist/account/usage/index.d.ts +2 -2
  70. package/dist/account/usage/models.d.ts +27 -1
  71. package/dist/account/usageSummary/client.d.ts +26 -0
  72. package/dist/account/usageSummary/client.js +19 -0
  73. package/dist/account/usageSummary/index.d.ts +5 -0
  74. package/dist/account/usageSummary/index.js +4 -0
  75. package/dist/account/usageSummary/models.d.ts +50 -0
  76. package/dist/account/usageSummary/models.js +9 -0
  77. package/dist/account/walletTransactions/client.d.ts +2 -8
  78. package/dist/account/walletTransactions/client.js +4 -4
  79. package/dist/account/walletTransactions/index.d.ts +1 -1
  80. package/dist/account/walletTransactions/models.d.ts +28 -1
  81. package/dist/account/walletTransactions/models.js +3 -0
  82. package/dist/agenda/appointments/client.d.ts +6 -7
  83. package/dist/agenda/availability/client.d.ts +3 -4
  84. package/dist/agenda/bookings/client.d.ts +11 -12
  85. package/dist/agenda/index.d.ts +1 -1
  86. package/dist/agenda/locations/client.d.ts +2 -3
  87. package/dist/agenda/locations/client.js +1 -1
  88. package/dist/agenda/models.d.ts +8 -2
  89. package/dist/agenda/offerings/client.d.ts +4 -4
  90. package/dist/agenda/resources/client.d.ts +4 -4
  91. package/dist/agenda/scheduleRules/client.d.ts +4 -4
  92. package/dist/agenda/services/client.d.ts +4 -4
  93. package/dist/agenda/waitlist/client.d.ts +3 -4
  94. package/dist/axxa/authorizations/client.d.ts +2 -2
  95. package/dist/axxa/connections/client.d.ts +6 -5
  96. package/dist/axxa/eligibility/client.d.ts +2 -2
  97. package/dist/axxa/index.d.ts +1 -1
  98. package/dist/axxa/models.d.ts +8 -2
  99. package/dist/axxa/provider/client.d.ts +2 -2
  100. package/dist/gmedic/agendaServices/client.d.ts +2 -2
  101. package/dist/gmedic/agendas/client.d.ts +2 -2
  102. package/dist/gmedic/appointments/client.d.ts +4 -4
  103. package/dist/gmedic/availability/client.d.ts +2 -2
  104. package/dist/gmedic/availableDays/client.d.ts +2 -2
  105. package/dist/gmedic/branchOffices/client.d.ts +2 -2
  106. package/dist/gmedic/connections/client.d.ts +6 -5
  107. package/dist/gmedic/dictionaryEntries/client.d.ts +2 -2
  108. package/dist/gmedic/healthPartners/client.d.ts +2 -2
  109. package/dist/gmedic/healthPromotionEntities/client.d.ts +2 -2
  110. package/dist/gmedic/index.d.ts +1 -1
  111. package/dist/gmedic/laboralRiskManagers/client.d.ts +2 -2
  112. package/dist/gmedic/models.d.ts +8 -2
  113. package/dist/gmedic/occupations/client.d.ts +2 -2
  114. package/dist/gmedic/patientNotes/client.d.ts +4 -4
  115. package/dist/gmedic/patients/client.d.ts +4 -4
  116. package/dist/gmedic/services/client.d.ts +2 -2
  117. package/dist/gmedic/sessionPackages/client.d.ts +3 -3
  118. package/dist/index.d.ts +1 -1
  119. package/dist/models.d.ts +293 -5
  120. package/dist/nuevaEps/affiliations/models.d.ts +8 -8
  121. package/dist/nuevaEps/connections/client.d.ts +3 -2
  122. package/dist/nuevaEps/connections/index.d.ts +1 -1
  123. package/dist/nuevaEps/connections/models.d.ts +25 -37
  124. package/dist/nuevaEps/index.d.ts +1 -1
  125. package/dist/nuevaEps/models.d.ts +2 -101
  126. package/dist/orsovision/agencies/models.d.ts +8 -8
  127. package/dist/orsovision/appointments/client.d.ts +3 -3
  128. package/dist/orsovision/appointments/index.d.ts +1 -1
  129. package/dist/orsovision/appointments/models.d.ts +8 -32
  130. package/dist/orsovision/availability/index.d.ts +1 -1
  131. package/dist/orsovision/availability/models.d.ts +9 -20
  132. package/dist/orsovision/clinic/index.d.ts +1 -1
  133. package/dist/orsovision/clinic/models.d.ts +9 -8
  134. package/dist/orsovision/contracts/index.d.ts +1 -1
  135. package/dist/orsovision/contracts/models.d.ts +6 -30
  136. package/dist/orsovision/index.d.ts +1 -1
  137. package/dist/orsovision/models.d.ts +1 -162
  138. package/dist/orsovision/patients/client.d.ts +4 -4
  139. package/dist/orsovision/patients/index.d.ts +1 -1
  140. package/dist/orsovision/patients/models.d.ts +17 -27
  141. package/dist/orsovision/services/index.d.ts +1 -1
  142. package/dist/orsovision/services/models.d.ts +6 -30
  143. package/dist/orsovision/tools/index.d.ts +1 -1
  144. package/dist/orsovision/tools/models.d.ts +9 -8
  145. package/dist/raiz/agents/client.d.ts +5 -6
  146. package/dist/raiz/agents/client.js +3 -4
  147. package/dist/raiz/agents/models.d.ts +1 -0
  148. package/dist/raiz/bulletins/client.d.ts +11 -7
  149. package/dist/raiz/bulletins/client.js +5 -6
  150. package/dist/raiz/campaigns/client.d.ts +11 -11
  151. package/dist/raiz/campaigns/client.js +4 -4
  152. package/dist/raiz/changes/client.d.ts +2 -2
  153. package/dist/raiz/channels/client.d.ts +28 -14
  154. package/dist/raiz/channels/client.js +9 -9
  155. package/dist/raiz/contacts/client.d.ts +7 -8
  156. package/dist/raiz/contacts/client.js +5 -5
  157. package/dist/raiz/conversations/client.d.ts +15 -12
  158. package/dist/raiz/conversations/client.js +6 -6
  159. package/dist/raiz/definitions/client.d.ts +9 -9
  160. package/dist/raiz/definitions/client.js +3 -4
  161. package/dist/raiz/evalCases/client.d.ts +17 -16
  162. package/dist/raiz/evalCases/client.js +2 -2
  163. package/dist/raiz/evalRuns/client.d.ts +10 -8
  164. package/dist/raiz/evalRuns/client.js +2 -3
  165. package/dist/raiz/evalRuns/models.d.ts +7 -1
  166. package/dist/raiz/facts/client.d.ts +3 -4
  167. package/dist/raiz/facts/client.js +3 -3
  168. package/dist/raiz/index.d.ts +1 -1
  169. package/dist/raiz/knowledge/client.d.ts +23 -18
  170. package/dist/raiz/knowledge/client.js +4 -4
  171. package/dist/raiz/models.d.ts +8 -44
  172. package/dist/raiz/organization/client.d.ts +6 -11
  173. package/dist/raiz/organization/client.js +2 -3
  174. package/dist/raiz/organization/models.d.ts +0 -10
  175. package/dist/raiz/profiles/client.d.ts +9 -10
  176. package/dist/raiz/profiles/client.js +3 -4
  177. package/dist/raiz/reports/client.d.ts +2 -2
  178. package/dist/raiz/suppressions/client.d.ts +3 -4
  179. package/dist/raiz/suppressions/client.js +1 -1
  180. package/dist/raiz/tasks/client.d.ts +11 -6
  181. package/dist/raiz/tasks/client.js +6 -7
  182. package/dist/raiz/templates/client.d.ts +5 -5
  183. package/dist/raiz/templates/client.js +1 -1
  184. package/dist/raiz/voices/client.d.ts +2 -2
  185. package/dist/somos/appointments/client.d.ts +3 -3
  186. package/dist/somos/appointments/index.d.ts +1 -1
  187. package/dist/somos/appointments/models.d.ts +14 -12
  188. package/dist/somos/availability/index.d.ts +1 -1
  189. package/dist/somos/availability/models.d.ts +9 -20
  190. package/dist/somos/clinic/index.d.ts +1 -1
  191. package/dist/somos/clinic/models.d.ts +9 -8
  192. package/dist/somos/contracts/index.d.ts +1 -1
  193. package/dist/somos/contracts/models.d.ts +9 -20
  194. package/dist/somos/groups/models.d.ts +9 -9
  195. package/dist/somos/index.d.ts +1 -1
  196. package/dist/somos/models.d.ts +12 -151
  197. package/dist/somos/patients/client.d.ts +4 -4
  198. package/dist/somos/patients/index.d.ts +1 -1
  199. package/dist/somos/patients/models.d.ts +20 -17
  200. package/dist/somos/services/index.d.ts +1 -1
  201. package/dist/somos/services/models.d.ts +15 -26
  202. package/dist/somos/specialtyRules/client.d.ts +2 -2
  203. package/dist/somos/specialtyRules/models.d.ts +7 -7
  204. package/dist/somos/tools/index.d.ts +1 -1
  205. package/dist/somos/tools/models.d.ts +9 -8
  206. package/dist/sura/affiliations/client.d.ts +2 -3
  207. package/dist/sura/appointments/client.d.ts +5 -6
  208. package/dist/sura/authorizations/client.d.ts +2 -3
  209. package/dist/sura/availability/client.d.ts +2 -3
  210. package/dist/sura/connections/client.d.ts +6 -5
  211. package/dist/sura/copays/client.d.ts +2 -3
  212. package/dist/sura/index.d.ts +1 -1
  213. package/dist/sura/models.d.ts +8 -2
  214. package/dist/sura/operations/client.d.ts +2 -3
  215. package/dist/sura/patients/client.d.ts +2 -3
  216. package/dist/sura/professionals/client.d.ts +2 -3
  217. package/dist/sura/services/client.d.ts +2 -3
  218. package/dist/visoft/appointments/index.d.ts +1 -1
  219. package/dist/visoft/appointments/models.d.ts +8 -32
  220. package/dist/visoft/availability/models.d.ts +6 -6
  221. package/dist/visoft/clinic/models.d.ts +3 -2
  222. package/dist/visoft/clinics/models.d.ts +3 -3
  223. package/dist/visoft/connections/client.d.ts +3 -2
  224. package/dist/visoft/connections/index.d.ts +1 -1
  225. package/dist/visoft/connections/models.d.ts +4 -17
  226. package/dist/visoft/contracts/index.d.ts +1 -1
  227. package/dist/visoft/contracts/models.d.ts +4 -16
  228. package/dist/visoft/index.d.ts +1 -1
  229. package/dist/visoft/models.d.ts +3 -162
  230. package/dist/visoft/patients/index.d.ts +1 -1
  231. package/dist/visoft/patients/models.d.ts +10 -38
  232. package/dist/visoft/professionals/models.d.ts +5 -5
  233. package/dist/visoft/serviceCatalogs/models.d.ts +6 -6
  234. package/dist/visoft/services/index.d.ts +1 -1
  235. package/dist/visoft/services/models.d.ts +5 -17
  236. package/package.json +3 -3
package/README.md CHANGED
@@ -133,6 +133,29 @@ Generate and Publish push and dispatch as the Arbol Bot GitHub App, so their com
133
133
  organization secret `ARBOL_BOT_PRIVATE_KEY`, and the App installed with contents write access to this
134
134
  repository and project-arbol-cli. npm publishing uses the organization secret `NPM_TOKEN`.
135
135
 
136
+ ## Migrating Account calls to SDK 4
137
+
138
+ SDK 4 follows Account's current public contract. Update these calls:
139
+
140
+ | SDK 3 | SDK 4 |
141
+ | --- | --- |
142
+ | `account.organizations.current` | `account.organization.get` |
143
+ | `account.organizations.configure` | `account.organization.update` |
144
+ | `account.billing.overview` | `account.billing.get` |
145
+ | `account.usage.breakdown` | `account.usage.get` |
146
+ | `account.usage.summary` | `account.usageSummary.get` |
147
+ | `account.invoices.document` | `account.invoiceDocuments.get` |
148
+
149
+ Account resource identifiers now use `apiKeyId`, `billingProfileId`, `invitationId`,
150
+ `invoiceId` and `memberId` in place of `id`, as the generated request types declare.
151
+ Connection create, update and delete are staff-user operations outside the public
152
+ SDK. Authorized staff use the private operator CLI; credential-bearing operations
153
+ remain outside MCP. Account still owns and enforces those permissions.
154
+
155
+ Shared generated model exports also follow the current schema names. Update
156
+ explicit model imports using the compiler's diagnostics. The client constructor,
157
+ response envelope, `ApiError` and Temporal values keep their existing behavior.
158
+
136
159
  ## License
137
160
 
138
161
  [Apache License 2.0](LICENSE)
@@ -1,6 +1,6 @@
1
1
  import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
2
- import type { DeletedObject, ResponseMetadata } from "../../models.js";
3
- import { type AccountApiKeyPage, type AccountIssuedApiKey } from "./models.js";
2
+ import type { DeletedObjectResponse, Empty } from "../../models.js";
3
+ import { type AccountApiKeyPageResponse, type AccountCreateApiKeyBody, type AccountIssuedApiKeyResponse } from "./models.js";
4
4
  export interface ClientOptions extends BaseClientOptions {
5
5
  /**
6
6
  * The URL the paths of the API are relative to.
@@ -40,38 +40,15 @@ export interface Client {
40
40
  }
41
41
  export declare function createClient(options: ClientOptions): Client;
42
42
  export declare function bind(transport: Transport): Client;
43
- export interface CreateRequest {
44
- /**
45
- * What uses it, such as "Billing backend".
46
- */
47
- name: string;
43
+ export type CreateRequest = AccountCreateApiKeyBody;
44
+ export type CreateResponse = AccountIssuedApiKeyResponse;
45
+ export interface DeleteRequest {
48
46
  /**
49
- * Per integration (sura, visoft, agenda): what the key may use there. An
50
- * integration left out is decided by the key's scopes alone.
47
+ * The API key's id, as apiKeys.list answers it.
51
48
  */
52
- restrictions?: {
53
- [key: string]: unknown;
54
- };
55
- scopes: string[];
56
- }
57
- export interface CreateResponse {
58
- data: AccountIssuedApiKey;
59
- error: null;
60
- metadata: ResponseMetadata;
61
- success: true;
62
- }
63
- export interface DeleteRequest {
64
- id: string;
65
- body: {
66
- [key: string]: unknown;
67
- };
68
- }
69
- export interface DeleteResponse {
70
- data: DeletedObject;
71
- error: null;
72
- metadata: ResponseMetadata;
73
- success: true;
49
+ apiKeyId: string;
74
50
  }
51
+ export type DeleteResponse = DeletedObjectResponse;
75
52
  export interface ListRequest {
76
53
  /**
77
54
  * Opaque cursor returned by pageInfo; omit it to request the first page.
@@ -87,21 +64,12 @@ export interface ListRequest {
87
64
  */
88
65
  limit?: number;
89
66
  }
90
- export interface ListResponse {
91
- data: AccountApiKeyPage;
92
- error: null;
93
- metadata: ResponseMetadata;
94
- success: true;
95
- }
67
+ export type ListResponse = AccountApiKeyPageResponse;
96
68
  export interface RotateRequest {
97
- id: string;
98
- body: {
99
- [key: string]: unknown;
100
- };
101
- }
102
- export interface RotateResponse {
103
- data: AccountIssuedApiKey;
104
- error: null;
105
- metadata: ResponseMetadata;
106
- success: true;
69
+ /**
70
+ * The API key's id, as apiKeys.list answers it.
71
+ */
72
+ apiKeyId: string;
73
+ body: Empty;
107
74
  }
75
+ export type RotateResponse = AccountIssuedApiKeyResponse;
@@ -1,7 +1,7 @@
1
1
  // Code generated by forge. DO NOT EDIT.
2
2
  /* eslint-disable */
3
- import { Transport, object, } from "../../_/index.js";
4
- import { AccountApiKeyPageCodec, AccountIssuedApiKeyCodec, } from "./models.js";
3
+ import { Transport, } from "../../_/index.js";
4
+ import { AccountApiKeyPageResponseCodec, AccountIssuedApiKeyResponseCodec, } from "./models.js";
5
5
  export function createClient(options) {
6
6
  return bind(new Transport(options));
7
7
  }
@@ -17,27 +17,26 @@ const CreateOperation = {
17
17
  method: "POST",
18
18
  route: "/v1/account/api-keys",
19
19
  body: "flat",
20
- response: object([["data", null, () => AccountIssuedApiKeyCodec]]),
21
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
20
+ response: AccountIssuedApiKeyResponseCodec,
21
+ errors: { "400": true, "401": true, "403": true, "409": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
22
22
  };
23
23
  const DeleteOperation = {
24
24
  method: "DELETE",
25
- route: "/v1/account/api-keys/{id}",
26
- body: "nested",
25
+ route: "/v1/account/api-keys/{apiKeyId}",
27
26
  response: null,
28
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
27
+ errors: { "400": true, "401": true, "403": true, "404": true, "409": true, "429": true, "500": true, "502": true, "503": true, "504": true },
29
28
  };
30
29
  const ListOperation = {
31
30
  method: "GET",
32
31
  route: "/v1/account/api-keys",
33
32
  query: { cursor: "cursor", direction: "direction", limit: "limit" },
34
- response: object([["data", null, () => AccountApiKeyPageCodec]]),
35
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
33
+ response: AccountApiKeyPageResponseCodec,
34
+ errors: { "400": true, "401": true, "403": true, "409": true, "429": true, "500": true, "502": true, "503": true, "504": true },
36
35
  };
37
36
  const RotateOperation = {
38
37
  method: "POST",
39
- route: "/v1/account/api-keys/{id}/rotate",
38
+ route: "/v1/account/api-keys/{apiKeyId}/rotate",
40
39
  body: "nested",
41
- response: object([["data", null, () => AccountIssuedApiKeyCodec]]),
42
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
40
+ response: AccountIssuedApiKeyResponseCodec,
41
+ errors: { "400": true, "401": true, "403": true, "404": true, "409": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
43
42
  };
@@ -2,4 +2,4 @@ export { ApiError } from "../../_/index.js";
2
2
  export type { RequestOptions } from "../../_/index.js";
3
3
  export { createClient } from "./client.js";
4
4
  export type { Client, ClientOptions, CreateRequest, CreateResponse, DeleteRequest, DeleteResponse, ListRequest, ListResponse, RotateRequest, RotateResponse, } from "./client.js";
5
- export type { AccountApiKey, AccountApiKeyPage, AccountIssuedApiKey, } from "./models.js";
5
+ export type { AccountApiKey, AccountApiKeyNotFoundError, AccountApiKeyNotFoundFailure, AccountApiKeyPage, AccountApiKeyPageResponse, AccountCreateApiKeyBody, AccountCreateApiKeyForbiddenError, AccountCreateApiKeyForbiddenFailure, AccountCreateApiKeyServiceUnavailableError, AccountCreateApiKeyServiceUnavailableFailure, AccountDeleteApiKeyServiceUnavailableError, AccountDeleteApiKeyServiceUnavailableFailure, AccountIssuedApiKey, AccountIssuedApiKeyResponse, AccountListApiKeysServiceUnavailableError, AccountListApiKeysServiceUnavailableFailure, AccountPermissionNotGrantableFailure, AccountRotateApiKeyServiceUnavailableError, AccountRotateApiKeyServiceUnavailableFailure, } from "./models.js";
@@ -1,4 +1,5 @@
1
- import type { PageInfo } from "../../models.js";
1
+ import type { Empty, ForbiddenFailure, PageInfo, ResponseMetadata, UpstreamUnavailableFailure } from "../../models.js";
2
+ import type { AccountAccountNotConfiguredFailure, AccountIdentityUnavailableFailure } from "../models.js";
2
3
  export interface AccountApiKey {
3
4
  createdAt: Temporal.Instant | null;
4
5
  createdBy: string | null;
@@ -16,6 +17,42 @@ export interface AccountApiKey {
16
17
  } | null;
17
18
  scopes: string[];
18
19
  }
20
+ /**
21
+ * A failed answer.
22
+ */
23
+ export interface AccountApiKeyNotFoundError {
24
+ data: null;
25
+ /**
26
+ * This API key does not exist.
27
+ */
28
+ error: AccountApiKeyNotFoundFailure;
29
+ /**
30
+ * What every answer carries besides its data or error.
31
+ */
32
+ metadata: ResponseMetadata;
33
+ success: false;
34
+ }
35
+ /**
36
+ * This API key does not exist.
37
+ */
38
+ export interface AccountApiKeyNotFoundFailure {
39
+ /**
40
+ * The failure code, stable across releases.
41
+ */
42
+ code: "API_KEY_NOT_FOUND";
43
+ /**
44
+ * No fields.
45
+ */
46
+ data: Empty;
47
+ /**
48
+ * What went wrong, for people; it never contains input values.
49
+ */
50
+ message: string;
51
+ /**
52
+ * Whether repeating the same request may succeed.
53
+ */
54
+ retryable: false;
55
+ }
19
56
  export interface AccountApiKeyPage {
20
57
  /**
21
58
  * Items admitted by this resource contract within the verified organization.
@@ -30,6 +67,71 @@ export interface AccountApiKeyPage {
30
67
  */
31
68
  pageInfo: PageInfo;
32
69
  }
70
+ /**
71
+ * A successful answer.
72
+ */
73
+ export interface AccountApiKeyPageResponse {
74
+ data: AccountApiKeyPage;
75
+ error: null;
76
+ /**
77
+ * What every answer carries besides its data or error.
78
+ */
79
+ metadata: ResponseMetadata;
80
+ success: true;
81
+ }
82
+ export interface AccountCreateApiKeyBody {
83
+ /**
84
+ * What uses it, such as "Billing backend".
85
+ */
86
+ name: string;
87
+ /**
88
+ * Per integration (sura, visoft, agenda): what the key may use there. An
89
+ * integration left out is decided by the key's scopes alone.
90
+ */
91
+ restrictions?: {
92
+ [key: string]: unknown;
93
+ };
94
+ scopes: string[];
95
+ }
96
+ /**
97
+ * A failed answer.
98
+ */
99
+ export interface AccountCreateApiKeyForbiddenError {
100
+ data: null;
101
+ error: AccountCreateApiKeyForbiddenFailure;
102
+ /**
103
+ * What every answer carries besides its data or error.
104
+ */
105
+ metadata: ResponseMetadata;
106
+ success: false;
107
+ }
108
+ export type AccountCreateApiKeyForbiddenFailure = ForbiddenFailure | AccountPermissionNotGrantableFailure;
109
+ /**
110
+ * A failed answer.
111
+ */
112
+ export interface AccountCreateApiKeyServiceUnavailableError {
113
+ data: null;
114
+ error: AccountCreateApiKeyServiceUnavailableFailure;
115
+ /**
116
+ * What every answer carries besides its data or error.
117
+ */
118
+ metadata: ResponseMetadata;
119
+ success: false;
120
+ }
121
+ export type AccountCreateApiKeyServiceUnavailableFailure = UpstreamUnavailableFailure | AccountAccountNotConfiguredFailure | AccountIdentityUnavailableFailure;
122
+ /**
123
+ * A failed answer.
124
+ */
125
+ export interface AccountDeleteApiKeyServiceUnavailableError {
126
+ data: null;
127
+ error: AccountDeleteApiKeyServiceUnavailableFailure;
128
+ /**
129
+ * What every answer carries besides its data or error.
130
+ */
131
+ metadata: ResponseMetadata;
132
+ success: false;
133
+ }
134
+ export type AccountDeleteApiKeyServiceUnavailableFailure = UpstreamUnavailableFailure | AccountAccountNotConfiguredFailure | AccountIdentityUnavailableFailure;
33
135
  export interface AccountIssuedApiKey {
34
136
  apiKey: AccountApiKey;
35
137
  /**
@@ -37,6 +139,67 @@ export interface AccountIssuedApiKey {
37
139
  */
38
140
  key: string;
39
141
  }
142
+ /**
143
+ * A successful answer.
144
+ */
145
+ export interface AccountIssuedApiKeyResponse {
146
+ data: AccountIssuedApiKey;
147
+ error: null;
148
+ /**
149
+ * What every answer carries besides its data or error.
150
+ */
151
+ metadata: ResponseMetadata;
152
+ success: true;
153
+ }
154
+ /**
155
+ * A failed answer.
156
+ */
157
+ export interface AccountListApiKeysServiceUnavailableError {
158
+ data: null;
159
+ error: AccountListApiKeysServiceUnavailableFailure;
160
+ /**
161
+ * What every answer carries besides its data or error.
162
+ */
163
+ metadata: ResponseMetadata;
164
+ success: false;
165
+ }
166
+ export type AccountListApiKeysServiceUnavailableFailure = UpstreamUnavailableFailure | AccountAccountNotConfiguredFailure | AccountIdentityUnavailableFailure;
167
+ /**
168
+ * An API key cannot hold a permission you do not hold.
169
+ */
170
+ export interface AccountPermissionNotGrantableFailure {
171
+ /**
172
+ * The failure code, stable across releases.
173
+ */
174
+ code: "PERMISSION_NOT_GRANTABLE";
175
+ /**
176
+ * No fields.
177
+ */
178
+ data: Empty;
179
+ /**
180
+ * What went wrong, for people; it never contains input values.
181
+ */
182
+ message: string;
183
+ /**
184
+ * Whether repeating the same request may succeed.
185
+ */
186
+ retryable: false;
187
+ }
188
+ /**
189
+ * A failed answer.
190
+ */
191
+ export interface AccountRotateApiKeyServiceUnavailableError {
192
+ data: null;
193
+ error: AccountRotateApiKeyServiceUnavailableFailure;
194
+ /**
195
+ * What every answer carries besides its data or error.
196
+ */
197
+ metadata: ResponseMetadata;
198
+ success: false;
199
+ }
200
+ export type AccountRotateApiKeyServiceUnavailableFailure = UpstreamUnavailableFailure | AccountAccountNotConfiguredFailure | AccountIdentityUnavailableFailure;
40
201
  export declare const AccountApiKeyCodec: import("../../_/codec.js").Codec;
41
202
  export declare const AccountApiKeyPageCodec: import("../../_/codec.js").Codec;
203
+ export declare const AccountApiKeyPageResponseCodec: import("../../_/codec.js").Codec;
42
204
  export declare const AccountIssuedApiKeyCodec: import("../../_/codec.js").Codec;
205
+ export declare const AccountIssuedApiKeyResponseCodec: import("../../_/codec.js").Codec;
@@ -7,6 +7,12 @@ export const AccountApiKeyCodec = object([
7
7
  export const AccountApiKeyPageCodec = object([
8
8
  ["data", null, array(() => AccountApiKeyCodec)],
9
9
  ]);
10
+ export const AccountApiKeyPageResponseCodec = object([
11
+ ["data", null, () => AccountApiKeyPageCodec],
12
+ ]);
10
13
  export const AccountIssuedApiKeyCodec = object([
11
14
  ["apiKey", null, () => AccountApiKeyCodec],
12
15
  ]);
16
+ export const AccountIssuedApiKeyResponseCodec = object([
17
+ ["data", null, () => AccountIssuedApiKeyCodec],
18
+ ]);
@@ -1,6 +1,5 @@
1
1
  import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
2
- import type { ResponseMetadata } from "../../models.js";
3
- import { type AccountBillingOverview } from "./models.js";
2
+ import { type AccountBillingOverviewResponse } from "./models.js";
4
3
  export interface ClientOptions extends BaseClientOptions {
5
4
  /**
6
5
  * The URL the paths of the API are relative to.
@@ -14,15 +13,10 @@ export interface Client {
14
13
  * The organization's billing status, balance, active plans, allowances and
15
14
  * what it spent this month.
16
15
  */
17
- overview(request?: OverviewRequest, options?: RequestOptions): Promise<OverviewResponse>;
16
+ get(request?: GetRequest, options?: RequestOptions): Promise<GetResponse>;
18
17
  }
19
18
  export declare function createClient(options: ClientOptions): Client;
20
19
  export declare function bind(transport: Transport): Client;
21
- export interface OverviewRequest {
22
- }
23
- export interface OverviewResponse {
24
- data: AccountBillingOverview;
25
- error: null;
26
- metadata: ResponseMetadata;
27
- success: true;
20
+ export interface GetRequest {
28
21
  }
22
+ export type GetResponse = AccountBillingOverviewResponse;
@@ -1,18 +1,18 @@
1
1
  // Code generated by forge. DO NOT EDIT.
2
2
  /* eslint-disable */
3
- import { Transport, object, } from "../../_/index.js";
4
- import { AccountBillingOverviewCodec, } from "./models.js";
3
+ import { Transport, } from "../../_/index.js";
4
+ import { AccountBillingOverviewResponseCodec, } from "./models.js";
5
5
  export function createClient(options) {
6
6
  return bind(new Transport(options));
7
7
  }
8
8
  export function bind(transport) {
9
9
  return {
10
- overview: (request, options) => transport.send(OverviewOperation, request, options),
10
+ get: (request, options) => transport.send(GetOperation, request, options),
11
11
  };
12
12
  }
13
- const OverviewOperation = {
13
+ const GetOperation = {
14
14
  method: "GET",
15
- route: "/v1/account/billing/overview",
16
- response: object([["data", null, () => AccountBillingOverviewCodec]]),
17
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
15
+ route: "/v1/account/billing",
16
+ response: AccountBillingOverviewResponseCodec,
17
+ errors: { "400": true, "401": true, "403": true, "404": true, "409": true, "429": true, "500": true, "502": true, "503": true, "504": true },
18
18
  };
@@ -1,5 +1,5 @@
1
1
  export { ApiError } from "../../_/index.js";
2
2
  export type { RequestOptions } from "../../_/index.js";
3
3
  export { createClient } from "./client.js";
4
- export type { Client, ClientOptions, OverviewRequest, OverviewResponse, } from "./client.js";
5
- export type { AccountBillingOverview } from "./models.js";
4
+ export type { Client, ClientOptions, GetRequest, GetResponse, } from "./client.js";
5
+ export type { AccountBillingOverview, AccountBillingOverviewResponse, AccountGetBillingOverviewServiceUnavailableError, AccountGetBillingOverviewServiceUnavailableFailure, } from "./models.js";
@@ -1,3 +1,5 @@
1
+ import type { ResponseMetadata, UpstreamUnavailableFailure } from "../../models.js";
2
+ import type { AccountBillingUnavailableFailure } from "../models.js";
1
3
  export interface AccountBillingOverview {
2
4
  balances: {
3
5
  creditRemainingMicros: number;
@@ -10,8 +12,10 @@ export interface AccountBillingOverview {
10
12
  billingMode: "prepaid" | "postpaid";
11
13
  monthToDate: {
12
14
  end: Temporal.Instant;
15
+ endsAt: Temporal.Instant;
13
16
  priceMicros: number;
14
17
  start: Temporal.Instant;
18
+ startsAt: Temporal.Instant;
15
19
  };
16
20
  /**
17
21
  * Whether the billing profile has what invoices need.
@@ -21,7 +25,9 @@ export interface AccountBillingOverview {
21
25
  subscriptions: {
22
26
  cancelAt: Temporal.Instant | null;
23
27
  currentPeriodEnd: Temporal.Instant | null;
28
+ currentPeriodEndsAt: Temporal.Instant | null;
24
29
  currentPeriodStart: Temporal.Instant | null;
30
+ currentPeriodStartsAt: Temporal.Instant | null;
25
31
  endsAt: Temporal.Instant | null;
26
32
  id: string;
27
33
  kind: "recurring" | "pack";
@@ -39,4 +45,30 @@ export interface AccountBillingOverview {
39
45
  unlimitedCredit: boolean;
40
46
  };
41
47
  }
48
+ /**
49
+ * A successful answer.
50
+ */
51
+ export interface AccountBillingOverviewResponse {
52
+ data: AccountBillingOverview;
53
+ error: null;
54
+ /**
55
+ * What every answer carries besides its data or error.
56
+ */
57
+ metadata: ResponseMetadata;
58
+ success: true;
59
+ }
60
+ /**
61
+ * A failed answer.
62
+ */
63
+ export interface AccountGetBillingOverviewServiceUnavailableError {
64
+ data: null;
65
+ error: AccountGetBillingOverviewServiceUnavailableFailure;
66
+ /**
67
+ * What every answer carries besides its data or error.
68
+ */
69
+ metadata: ResponseMetadata;
70
+ success: false;
71
+ }
72
+ export type AccountGetBillingOverviewServiceUnavailableFailure = UpstreamUnavailableFailure | AccountBillingUnavailableFailure;
42
73
  export declare const AccountBillingOverviewCodec: import("../../_/codec.js").Codec;
74
+ export declare const AccountBillingOverviewResponseCodec: import("../../_/codec.js").Codec;
@@ -2,6 +2,9 @@
2
2
  /* eslint-disable */
3
3
  import { array, instant, object } from "../../_/index.js";
4
4
  export const AccountBillingOverviewCodec = object([
5
- ["monthToDate", null, object([["end", null, instant], ["start", null, instant]])],
6
- ["subscriptions", null, array(object([["cancelAt", null, instant], ["currentPeriodEnd", null, instant], ["currentPeriodStart", null, instant], ["endsAt", null, instant], ["startsAt", null, instant]]))],
5
+ ["monthToDate", null, object([["end", null, instant], ["endsAt", null, instant], ["start", null, instant], ["startsAt", null, instant]])],
6
+ ["subscriptions", null, array(object([["cancelAt", null, instant], ["currentPeriodEnd", null, instant], ["currentPeriodEndsAt", null, instant], ["currentPeriodStart", null, instant], ["currentPeriodStartsAt", null, instant], ["endsAt", null, instant], ["startsAt", null, instant]]))],
7
+ ]);
8
+ export const AccountBillingOverviewResponseCodec = object([
9
+ ["data", null, () => AccountBillingOverviewCodec],
7
10
  ]);
@@ -1,6 +1,5 @@
1
1
  import { type BaseClientOptions, type RequestOptions, Transport } from "../../_/index.js";
2
- import type { ResponseMetadata } from "../../models.js";
3
- import type { AccountBillingProfile } from "./models.js";
2
+ import type { AccountBillingProfileResponse, AccountUpdateBillingProfileBody } from "./models.js";
4
3
  export interface ClientOptions extends BaseClientOptions {
5
4
  /**
6
5
  * The URL the paths of the API are relative to.
@@ -25,26 +24,16 @@ export interface Client {
25
24
  export declare function createClient(options: ClientOptions): Client;
26
25
  export declare function bind(transport: Transport): Client;
27
26
  export interface GetRequest {
28
- id: string;
29
- }
30
- export interface GetResponse {
31
- data: AccountBillingProfile;
32
- error: null;
33
- metadata: ResponseMetadata;
34
- success: true;
35
- }
36
- export interface UpdateRequest {
37
- id: string;
38
- billingDay?: number;
39
- email?: string;
40
- legalName?: string;
41
- taxId?: string;
42
- taxIdType?: string;
43
- withholdingAgent?: boolean;
44
- }
45
- export interface UpdateResponse {
46
- data: AccountBillingProfile;
47
- error: null;
48
- metadata: ResponseMetadata;
49
- success: true;
27
+ /**
28
+ * The billing profile's id: the caller's own organization's id.
29
+ */
30
+ billingProfileId: string;
50
31
  }
32
+ export type GetResponse = AccountBillingProfileResponse;
33
+ export type UpdateRequest = {
34
+ /**
35
+ * The billing profile's id: the caller's own organization's id.
36
+ */
37
+ billingProfileId: string;
38
+ } & AccountUpdateBillingProfileBody;
39
+ export type UpdateResponse = AccountBillingProfileResponse;
@@ -12,14 +12,14 @@ export function bind(transport) {
12
12
  }
13
13
  const GetOperation = {
14
14
  method: "GET",
15
- route: "/v1/account/billing-profiles/{id}",
15
+ route: "/v1/account/billing-profiles/{billingProfileId}",
16
16
  response: null,
17
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
17
+ errors: { "400": true, "401": true, "403": true, "404": true, "409": true, "429": true, "500": true, "502": true, "503": true, "504": true },
18
18
  };
19
19
  const UpdateOperation = {
20
20
  method: "PATCH",
21
- route: "/v1/account/billing-profiles/{id}",
21
+ route: "/v1/account/billing-profiles/{billingProfileId}",
22
22
  body: "flat",
23
23
  response: null,
24
- errors: { "400": true, "401": true, "403": true, "404": true, "405": true, "409": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
24
+ errors: { "400": true, "401": true, "403": true, "404": true, "409": true, "413": true, "415": true, "429": true, "500": true, "502": true, "503": true, "504": true },
25
25
  };
@@ -2,4 +2,4 @@ export { ApiError } from "../../_/index.js";
2
2
  export type { RequestOptions } from "../../_/index.js";
3
3
  export { createClient } from "./client.js";
4
4
  export type { Client, ClientOptions, GetRequest, GetResponse, UpdateRequest, UpdateResponse, } from "./client.js";
5
- export type { AccountBillingProfile } from "./models.js";
5
+ export type { AccountBillingProfile, AccountBillingProfileResponse, AccountGetBillingProfileServiceUnavailableError, AccountGetBillingProfileServiceUnavailableFailure, AccountUpdateBillingProfileBody, AccountUpdateBillingProfileServiceUnavailableError, AccountUpdateBillingProfileServiceUnavailableFailure, } from "./models.js";
@@ -1,3 +1,5 @@
1
+ import type { ResponseMetadata, UpstreamUnavailableFailure } from "../../models.js";
2
+ import type { AccountBillingUnavailableFailure } from "../models.js";
1
3
  export interface AccountBillingProfile {
2
4
  billingDay: number;
3
5
  complete: boolean;
@@ -8,3 +10,49 @@ export interface AccountBillingProfile {
8
10
  taxIdType: string | null;
9
11
  withholdingAgent: boolean;
10
12
  }
13
+ /**
14
+ * A successful answer.
15
+ */
16
+ export interface AccountBillingProfileResponse {
17
+ data: AccountBillingProfile;
18
+ error: null;
19
+ /**
20
+ * What every answer carries besides its data or error.
21
+ */
22
+ metadata: ResponseMetadata;
23
+ success: true;
24
+ }
25
+ /**
26
+ * A failed answer.
27
+ */
28
+ export interface AccountGetBillingProfileServiceUnavailableError {
29
+ data: null;
30
+ error: AccountGetBillingProfileServiceUnavailableFailure;
31
+ /**
32
+ * What every answer carries besides its data or error.
33
+ */
34
+ metadata: ResponseMetadata;
35
+ success: false;
36
+ }
37
+ export type AccountGetBillingProfileServiceUnavailableFailure = UpstreamUnavailableFailure | AccountBillingUnavailableFailure;
38
+ export interface AccountUpdateBillingProfileBody {
39
+ billingDay?: number;
40
+ email?: string;
41
+ legalName?: string;
42
+ taxId?: string;
43
+ taxIdType?: string;
44
+ withholdingAgent?: boolean;
45
+ }
46
+ /**
47
+ * A failed answer.
48
+ */
49
+ export interface AccountUpdateBillingProfileServiceUnavailableError {
50
+ data: null;
51
+ error: AccountUpdateBillingProfileServiceUnavailableFailure;
52
+ /**
53
+ * What every answer carries besides its data or error.
54
+ */
55
+ metadata: ResponseMetadata;
56
+ success: false;
57
+ }
58
+ export type AccountUpdateBillingProfileServiceUnavailableFailure = UpstreamUnavailableFailure | AccountBillingUnavailableFailure;