@composio/client 0.1.0-alpha.15 → 0.1.0-alpha.16

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 (234) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +12 -24
  3. package/client.d.mts +5 -5
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +5 -5
  6. package/client.d.ts.map +1 -1
  7. package/client.js +3 -3
  8. package/client.js.map +1 -1
  9. package/client.mjs +3 -3
  10. package/client.mjs.map +1 -1
  11. package/internal/detect-platform.js +3 -3
  12. package/internal/detect-platform.js.map +1 -1
  13. package/internal/detect-platform.mjs +3 -3
  14. package/internal/detect-platform.mjs.map +1 -1
  15. package/internal/shim-types.d.mts +11 -22
  16. package/internal/shim-types.d.mts.map +1 -0
  17. package/internal/shim-types.d.ts +11 -22
  18. package/internal/shim-types.d.ts.map +1 -0
  19. package/internal/shim-types.js +4 -0
  20. package/internal/shim-types.js.map +1 -0
  21. package/internal/shim-types.mjs +3 -0
  22. package/internal/shim-types.mjs.map +1 -0
  23. package/internal/shims.d.mts +2 -2
  24. package/internal/shims.d.mts.map +1 -1
  25. package/internal/shims.d.ts +2 -2
  26. package/internal/shims.d.ts.map +1 -1
  27. package/package.json +1 -4
  28. package/resources/auth-configs.d.mts +3 -3
  29. package/resources/auth-configs.d.mts.map +1 -1
  30. package/resources/auth-configs.d.ts +3 -3
  31. package/resources/auth-configs.d.ts.map +1 -1
  32. package/resources/connected-accounts.d.mts +5262 -52
  33. package/resources/connected-accounts.d.mts.map +1 -1
  34. package/resources/connected-accounts.d.ts +5262 -52
  35. package/resources/connected-accounts.d.ts.map +1 -1
  36. package/resources/index.d.mts +2 -2
  37. package/resources/index.d.mts.map +1 -1
  38. package/resources/index.d.ts +2 -2
  39. package/resources/index.d.ts.map +1 -1
  40. package/resources/index.js +3 -3
  41. package/resources/index.js.map +1 -1
  42. package/resources/index.mjs +1 -1
  43. package/resources/index.mjs.map +1 -1
  44. package/resources/mcp/index.d.mts +1 -1
  45. package/resources/mcp/index.d.mts.map +1 -1
  46. package/resources/mcp/index.d.ts +1 -1
  47. package/resources/mcp/index.d.ts.map +1 -1
  48. package/resources/mcp/index.js.map +1 -1
  49. package/resources/mcp/index.mjs.map +1 -1
  50. package/resources/mcp/mcp.d.mts +99 -1
  51. package/resources/mcp/mcp.d.mts.map +1 -1
  52. package/resources/mcp/mcp.d.ts +99 -1
  53. package/resources/mcp/mcp.d.ts.map +1 -1
  54. package/resources/mcp/mcp.js +22 -0
  55. package/resources/mcp/mcp.js.map +1 -1
  56. package/resources/mcp/mcp.mjs +22 -0
  57. package/resources/mcp/mcp.mjs.map +1 -1
  58. package/resources/org/project/api-keys.d.mts +0 -15
  59. package/resources/org/project/api-keys.d.mts.map +1 -1
  60. package/resources/org/project/api-keys.d.ts +0 -15
  61. package/resources/org/project/api-keys.d.ts.map +1 -1
  62. package/resources/tools.d.mts +4 -5
  63. package/resources/tools.d.mts.map +1 -1
  64. package/resources/tools.d.ts +4 -5
  65. package/resources/tools.d.ts.map +1 -1
  66. package/resources/trigger-instances/trigger-instances.d.mts +9 -46
  67. package/resources/trigger-instances/trigger-instances.d.mts.map +1 -1
  68. package/resources/trigger-instances/trigger-instances.d.ts +9 -46
  69. package/resources/trigger-instances/trigger-instances.d.ts.map +1 -1
  70. package/resources/trigger-instances/trigger-instances.js.map +1 -1
  71. package/resources/trigger-instances/trigger-instances.mjs.map +1 -1
  72. package/resources/v3/admin.d.mts +100 -0
  73. package/resources/v3/admin.d.mts.map +1 -0
  74. package/resources/v3/admin.d.ts +100 -0
  75. package/resources/v3/admin.d.ts.map +1 -0
  76. package/resources/v3/admin.js +54 -0
  77. package/resources/v3/admin.js.map +1 -0
  78. package/resources/v3/admin.mjs +50 -0
  79. package/resources/v3/admin.mjs.map +1 -0
  80. package/resources/v3/auth/auth.d.mts +10 -0
  81. package/resources/v3/auth/auth.d.mts.map +1 -0
  82. package/resources/v3/auth/auth.d.ts +10 -0
  83. package/resources/v3/auth/auth.d.ts.map +1 -0
  84. package/resources/{auth → v3/auth}/auth.js +2 -2
  85. package/resources/v3/auth/auth.js.map +1 -0
  86. package/resources/{auth → v3/auth}/auth.mjs +1 -1
  87. package/resources/v3/auth/auth.mjs.map +1 -0
  88. package/resources/v3/auth/index.d.mts +3 -0
  89. package/resources/v3/auth/index.d.mts.map +1 -0
  90. package/resources/v3/auth/index.d.ts +3 -0
  91. package/resources/v3/auth/index.d.ts.map +1 -0
  92. package/resources/v3/auth/index.js.map +1 -0
  93. package/resources/v3/auth/index.mjs.map +1 -0
  94. package/resources/{auth → v3/auth}/session.d.mts +16 -10
  95. package/resources/v3/auth/session.d.mts.map +1 -0
  96. package/resources/{auth → v3/auth}/session.d.ts +16 -10
  97. package/resources/v3/auth/session.d.ts.map +1 -0
  98. package/resources/{auth → v3/auth}/session.js +8 -2
  99. package/resources/v3/auth/session.js.map +1 -0
  100. package/resources/{auth → v3/auth}/session.mjs +8 -2
  101. package/resources/v3/auth/session.mjs.map +1 -0
  102. package/resources/{auth.d.mts.map → v3/auth.d.mts.map} +1 -1
  103. package/resources/v3/auth.d.ts.map +1 -0
  104. package/resources/{auth.js → v3/auth.js} +1 -1
  105. package/resources/v3/auth.js.map +1 -0
  106. package/resources/v3/auth.mjs.map +1 -0
  107. package/resources/v3/cli.d.mts +167 -0
  108. package/resources/v3/cli.d.mts.map +1 -0
  109. package/resources/v3/cli.d.ts +167 -0
  110. package/resources/v3/cli.d.ts.map +1 -0
  111. package/resources/v3/cli.js +55 -0
  112. package/resources/v3/cli.js.map +1 -0
  113. package/resources/v3/cli.mjs +51 -0
  114. package/resources/v3/cli.mjs.map +1 -0
  115. package/resources/v3/index.d.mts +6 -0
  116. package/resources/v3/index.d.mts.map +1 -0
  117. package/resources/v3/index.d.ts +6 -0
  118. package/resources/v3/index.d.ts.map +1 -0
  119. package/resources/v3/index.js +15 -0
  120. package/resources/v3/index.js.map +1 -0
  121. package/resources/v3/index.mjs +7 -0
  122. package/resources/v3/index.mjs.map +1 -0
  123. package/resources/v3/internal/action-execution.d.mts +153 -0
  124. package/resources/v3/internal/action-execution.d.mts.map +1 -0
  125. package/resources/v3/internal/action-execution.d.ts +153 -0
  126. package/resources/v3/internal/action-execution.d.ts.map +1 -0
  127. package/resources/v3/internal/action-execution.js +38 -0
  128. package/resources/v3/internal/action-execution.js.map +1 -0
  129. package/resources/v3/internal/action-execution.mjs +34 -0
  130. package/resources/v3/internal/action-execution.mjs.map +1 -0
  131. package/resources/v3/internal/index.d.mts +4 -0
  132. package/resources/v3/internal/index.d.mts.map +1 -0
  133. package/resources/v3/internal/index.d.ts +4 -0
  134. package/resources/v3/internal/index.d.ts.map +1 -0
  135. package/resources/v3/internal/index.js +11 -0
  136. package/resources/v3/internal/index.js.map +1 -0
  137. package/resources/v3/internal/index.mjs +5 -0
  138. package/resources/v3/internal/index.mjs.map +1 -0
  139. package/resources/v3/internal/internal.d.mts +14 -0
  140. package/resources/v3/internal/internal.d.mts.map +1 -0
  141. package/resources/v3/internal/internal.d.ts +14 -0
  142. package/resources/v3/internal/internal.d.ts.map +1 -0
  143. package/resources/v3/internal/internal.js +21 -0
  144. package/resources/v3/internal/internal.js.map +1 -0
  145. package/resources/v3/internal/internal.mjs +16 -0
  146. package/resources/v3/internal/internal.mjs.map +1 -0
  147. package/resources/v3/internal/trigger.d.mts +84 -0
  148. package/resources/v3/internal/trigger.d.mts.map +1 -0
  149. package/resources/v3/internal/trigger.d.ts +84 -0
  150. package/resources/v3/internal/trigger.d.ts.map +1 -0
  151. package/resources/v3/internal/trigger.js +23 -0
  152. package/resources/v3/internal/trigger.js.map +1 -0
  153. package/resources/v3/internal/trigger.mjs +19 -0
  154. package/resources/v3/internal/trigger.mjs.map +1 -0
  155. package/resources/v3/internal.d.mts +2 -0
  156. package/resources/v3/internal.d.mts.map +1 -0
  157. package/resources/v3/internal.d.ts +2 -0
  158. package/resources/v3/internal.d.ts.map +1 -0
  159. package/resources/v3/internal.js +6 -0
  160. package/resources/v3/internal.js.map +1 -0
  161. package/resources/v3/internal.mjs +3 -0
  162. package/resources/v3/internal.mjs.map +1 -0
  163. package/resources/v3/v3.d.mts +22 -0
  164. package/resources/v3/v3.d.mts.map +1 -0
  165. package/resources/v3/v3.d.ts +22 -0
  166. package/resources/v3/v3.d.ts.map +1 -0
  167. package/resources/v3/v3.js +29 -0
  168. package/resources/v3/v3.js.map +1 -0
  169. package/resources/v3/v3.mjs +24 -0
  170. package/resources/v3/v3.mjs.map +1 -0
  171. package/resources/v3.d.mts +2 -0
  172. package/resources/v3.d.mts.map +1 -0
  173. package/resources/v3.d.ts +2 -0
  174. package/resources/v3.d.ts.map +1 -0
  175. package/resources/v3.js +6 -0
  176. package/resources/v3.js.map +1 -0
  177. package/resources/v3.mjs +3 -0
  178. package/resources/v3.mjs.map +1 -0
  179. package/src/client.ts +9 -5
  180. package/src/internal/detect-platform.ts +3 -3
  181. package/src/internal/shim-types.ts +26 -0
  182. package/src/internal/shims.ts +2 -2
  183. package/src/resources/auth-configs.ts +0 -3
  184. package/src/resources/connected-accounts.ts +10261 -298
  185. package/src/resources/index.ts +3 -1
  186. package/src/resources/mcp/index.ts +2 -0
  187. package/src/resources/mcp/mcp.ts +128 -0
  188. package/src/resources/org/project/api-keys.ts +0 -18
  189. package/src/resources/tools.ts +5 -6
  190. package/src/resources/trigger-instances/trigger-instances.ts +9 -49
  191. package/src/resources/v3/admin.ts +141 -0
  192. package/src/resources/{auth → v3/auth}/auth.ts +3 -3
  193. package/src/resources/{auth → v3/auth}/index.ts +1 -1
  194. package/src/resources/{auth → v3/auth}/session.ts +16 -10
  195. package/src/resources/v3/cli.ts +209 -0
  196. package/src/resources/v3/index.ts +20 -0
  197. package/src/resources/v3/internal/action-execution.ts +236 -0
  198. package/src/resources/v3/internal/index.ts +10 -0
  199. package/src/resources/v3/internal/internal.ts +35 -0
  200. package/src/resources/v3/internal/trigger.ts +122 -0
  201. package/src/resources/v3/internal.ts +3 -0
  202. package/src/resources/v3/v3.ts +59 -0
  203. package/src/resources/v3.ts +3 -0
  204. package/src/version.ts +1 -1
  205. package/version.d.mts +1 -1
  206. package/version.d.ts +1 -1
  207. package/version.js +1 -1
  208. package/version.mjs +1 -1
  209. package/resources/auth/auth.d.mts +0 -10
  210. package/resources/auth/auth.d.mts.map +0 -1
  211. package/resources/auth/auth.d.ts +0 -10
  212. package/resources/auth/auth.d.ts.map +0 -1
  213. package/resources/auth/auth.js.map +0 -1
  214. package/resources/auth/auth.mjs.map +0 -1
  215. package/resources/auth/index.d.mts +0 -3
  216. package/resources/auth/index.d.mts.map +0 -1
  217. package/resources/auth/index.d.ts +0 -3
  218. package/resources/auth/index.d.ts.map +0 -1
  219. package/resources/auth/index.js.map +0 -1
  220. package/resources/auth/index.mjs.map +0 -1
  221. package/resources/auth/session.d.mts.map +0 -1
  222. package/resources/auth/session.d.ts.map +0 -1
  223. package/resources/auth/session.js.map +0 -1
  224. package/resources/auth/session.mjs.map +0 -1
  225. package/resources/auth.d.ts.map +0 -1
  226. package/resources/auth.js.map +0 -1
  227. package/resources/auth.mjs.map +0 -1
  228. package/src/internal/shim-types.d.ts +0 -28
  229. /package/resources/{auth → v3/auth}/index.js +0 -0
  230. /package/resources/{auth → v3/auth}/index.mjs +0 -0
  231. /package/resources/{auth.d.mts → v3/auth.d.mts} +0 -0
  232. /package/resources/{auth.d.ts → v3/auth.d.ts} +0 -0
  233. /package/resources/{auth.mjs → v3/auth.mjs} +0 -0
  234. /package/src/resources/{auth.ts → v3/auth.ts} +0 -0
@@ -0,0 +1,3 @@
1
+ export { Auth } from "./auth.mjs";
2
+ export { Session, type SessionRetrieveInfoResponse } from "./session.mjs";
3
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/v3/auth/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE;OACR,EAAE,OAAO,EAAE,KAAK,2BAA2B,EAAE"}
@@ -0,0 +1,3 @@
1
+ export { Auth } from "./auth.js";
2
+ export { Session, type SessionRetrieveInfoResponse } from "./session.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/v3/auth/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE;OACR,EAAE,OAAO,EAAE,KAAK,2BAA2B,EAAE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/v3/auth/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kCAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,wCAAsE;AAA7D,kGAAA,OAAO,OAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/v3/auth/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,IAAI,EAAE;OACR,EAAE,OAAO,EAAoC"}
@@ -1,6 +1,6 @@
1
- import { APIResource } from "../../core/resource.mjs";
2
- import { APIPromise } from "../../core/api-promise.mjs";
3
- import { RequestOptions } from "../../internal/request-options.mjs";
1
+ import { APIResource } from "../../../core/resource.mjs";
2
+ import { APIPromise } from "../../../core/api-promise.mjs";
3
+ import { RequestOptions } from "../../../internal/request-options.mjs";
4
4
  export declare class Session extends APIResource {
5
5
  /**
6
6
  * Retrieves detailed information about the current authenticated user session,
@@ -8,28 +8,34 @@ export declare class Session extends APIResource {
8
8
  * applicable. This endpoint is useful for verifying authentication status and
9
9
  * retrieving contextual information about the authenticated user and their access
10
10
  * privileges.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const response =
15
+ * await client.v3.auth.session.retrieveInfo();
16
+ * ```
11
17
  */
12
- retrieve(options?: RequestOptions): APIPromise<SessionRetrieveResponse>;
18
+ retrieveInfo(options?: RequestOptions): APIPromise<SessionRetrieveInfoResponse>;
13
19
  }
14
20
  /**
15
21
  * Response containing user session information
16
22
  */
17
- export interface SessionRetrieveResponse {
23
+ export interface SessionRetrieveInfoResponse {
18
24
  /**
19
25
  * Details of the API key used for authentication (null if using session auth)
20
26
  */
21
- api_key: SessionRetrieveResponse.APIKey | null;
27
+ api_key: SessionRetrieveInfoResponse.APIKey | null;
22
28
  /**
23
29
  * Information about the authenticated user
24
30
  */
25
- org_member: SessionRetrieveResponse.OrgMember;
31
+ org_member: SessionRetrieveInfoResponse.OrgMember;
26
32
  /**
27
33
  * Details of the current active project (null if accessing with org-level
28
34
  * credentials)
29
35
  */
30
- project: SessionRetrieveResponse.Project | null;
36
+ project: SessionRetrieveInfoResponse.Project | null;
31
37
  }
32
- export declare namespace SessionRetrieveResponse {
38
+ export declare namespace SessionRetrieveInfoResponse {
33
39
  /**
34
40
  * Details of the API key used for authentication (null if using session auth)
35
41
  */
@@ -235,6 +241,6 @@ export declare namespace SessionRetrieveResponse {
235
241
  }
236
242
  }
237
243
  export declare namespace Session {
238
- export { type SessionRetrieveResponse as SessionRetrieveResponse };
244
+ export { type SessionRetrieveInfoResponse as SessionRetrieveInfoResponse };
239
245
  }
240
246
  //# sourceMappingURL=session.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.d.mts","sourceRoot":"","sources":["../../../src/resources/v3/auth/session.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;OAYG;IACH,YAAY,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,2BAA2B,CAAC;CAGhF;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,OAAO,EAAE,2BAA2B,CAAC,MAAM,GAAG,IAAI,CAAC;IAEnD;;OAEG;IACH,UAAU,EAAE,2BAA2B,CAAC,SAAS,CAAC;IAElD;;;OAGG;IACH,OAAO,EAAE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 -1,6 +1,6 @@
1
- import { APIResource } from "../../core/resource.js";
2
- import { APIPromise } from "../../core/api-promise.js";
3
- import { RequestOptions } from "../../internal/request-options.js";
1
+ import { APIResource } from "../../../core/resource.js";
2
+ import { APIPromise } from "../../../core/api-promise.js";
3
+ import { RequestOptions } from "../../../internal/request-options.js";
4
4
  export declare class Session extends APIResource {
5
5
  /**
6
6
  * Retrieves detailed information about the current authenticated user session,
@@ -8,28 +8,34 @@ export declare class Session extends APIResource {
8
8
  * applicable. This endpoint is useful for verifying authentication status and
9
9
  * retrieving contextual information about the authenticated user and their access
10
10
  * privileges.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const response =
15
+ * await client.v3.auth.session.retrieveInfo();
16
+ * ```
11
17
  */
12
- retrieve(options?: RequestOptions): APIPromise<SessionRetrieveResponse>;
18
+ retrieveInfo(options?: RequestOptions): APIPromise<SessionRetrieveInfoResponse>;
13
19
  }
14
20
  /**
15
21
  * Response containing user session information
16
22
  */
17
- export interface SessionRetrieveResponse {
23
+ export interface SessionRetrieveInfoResponse {
18
24
  /**
19
25
  * Details of the API key used for authentication (null if using session auth)
20
26
  */
21
- api_key: SessionRetrieveResponse.APIKey | null;
27
+ api_key: SessionRetrieveInfoResponse.APIKey | null;
22
28
  /**
23
29
  * Information about the authenticated user
24
30
  */
25
- org_member: SessionRetrieveResponse.OrgMember;
31
+ org_member: SessionRetrieveInfoResponse.OrgMember;
26
32
  /**
27
33
  * Details of the current active project (null if accessing with org-level
28
34
  * credentials)
29
35
  */
30
- project: SessionRetrieveResponse.Project | null;
36
+ project: SessionRetrieveInfoResponse.Project | null;
31
37
  }
32
- export declare namespace SessionRetrieveResponse {
38
+ export declare namespace SessionRetrieveInfoResponse {
33
39
  /**
34
40
  * Details of the API key used for authentication (null if using session auth)
35
41
  */
@@ -235,6 +241,6 @@ export declare namespace SessionRetrieveResponse {
235
241
  }
236
242
  }
237
243
  export declare namespace Session {
238
- export { type SessionRetrieveResponse as SessionRetrieveResponse };
244
+ export { type SessionRetrieveInfoResponse as SessionRetrieveInfoResponse };
239
245
  }
240
246
  //# sourceMappingURL=session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/resources/v3/auth/session.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;OAYG;IACH,YAAY,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,2BAA2B,CAAC;CAGhF;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,OAAO,EAAE,2BAA2B,CAAC,MAAM,GAAG,IAAI,CAAC;IAEnD;;OAEG;IACH,UAAU,EAAE,2BAA2B,CAAC,SAAS,CAAC;IAElD;;;OAGG;IACH,OAAO,EAAE,2BAA2B,CAAC,OAAO,GAAG,IAAI,CAAC;CACrD;AAED,yBAAiB,2BAA2B,CAAC;IAC3C;;OAEG;IACH,UAAiB,MAAM;QACrB;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,OAAO,EAAE,MAAM,CAAC;QAEhB;;WAEG;QACH,UAAU,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,OAAO,EAAE,OAAO,CAAC;QAEjB;;WAEG;QACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;QAE1B;;WAEG;QACH,GAAG,EAAE,MAAM,CAAC;QAEZ;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,aAAa,EAAE,MAAM,CAAC;QAEtB;;WAEG;QACH,UAAU,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,UAAU,EAAE,MAAM,CAAC;KACpB;IAED;;OAEG;IACH,UAAiB,SAAS;QACxB;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,KAA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AE,MAAM,CAAC;gBAEX;;mBAEG;gBACH,OAAO,EAAE,MAAM,CAAC;gBAEhB;;mBAEG;gBACH,UAAU,EAAE,MAAM,CAAC;gBAEnB;;mBAEG;gBACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;gBAE1B;;mBAEG;gBACH,KAAK,EAAE,MAAM,CAAC;gBAEd;;mBAEG;gBACH,IAAI,EAAE,MAAM,CAAC;gBAEb;;mBAEG;gBACH,MAAM,EAAE,MAAM,CAAC;gBAEf;;mBAEG;gBACH,IAAI,EAAE,MAAM,CAAC;gBAEb;;mBAEG;gBACH,UAAU,EAAE,MAAM,CAAC;gBAEnB;;mBAEG;gBACH,QAAQ,CAAC,EAAE,OAAO,CAAC;aACpB;SACF;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EAAE,KAAK,2BAA2B,IAAI,2BAA2B,EAAE,CAAC;CAC5E"}
@@ -2,7 +2,7 @@
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Session = void 0;
5
- const resource_1 = require("../../core/resource.js");
5
+ const resource_1 = require("../../../core/resource.js");
6
6
  class Session extends resource_1.APIResource {
7
7
  /**
8
8
  * Retrieves detailed information about the current authenticated user session,
@@ -10,8 +10,14 @@ class Session extends resource_1.APIResource {
10
10
  * applicable. This endpoint is useful for verifying authentication status and
11
11
  * retrieving contextual information about the authenticated user and their access
12
12
  * privileges.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const response =
17
+ * await client.v3.auth.session.retrieveInfo();
18
+ * ```
13
19
  */
14
- retrieve(options) {
20
+ retrieveInfo(options) {
15
21
  return this._client.get('/api/v3/auth/session/info', options);
16
22
  }
17
23
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.js","sourceRoot":"","sources":["../../../src/resources/v3/auth/session.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAIrD,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;;;;OAYG;IACH,YAAY,CAAC,OAAwB;QACnC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;CACF;AAjBD,0BAiBC"}
@@ -1,5 +1,5 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { APIResource } from "../../core/resource.mjs";
2
+ import { APIResource } from "../../../core/resource.mjs";
3
3
  export class Session extends APIResource {
4
4
  /**
5
5
  * Retrieves detailed information about the current authenticated user session,
@@ -7,8 +7,14 @@ export class Session extends APIResource {
7
7
  * applicable. This endpoint is useful for verifying authentication status and
8
8
  * retrieving contextual information about the authenticated user and their access
9
9
  * privileges.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const response =
14
+ * await client.v3.auth.session.retrieveInfo();
15
+ * ```
10
16
  */
11
- retrieve(options) {
17
+ retrieveInfo(options) {
12
18
  return this._client.get('/api/v3/auth/session/info', options);
13
19
  }
14
20
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.mjs","sourceRoot":"","sources":["../../../src/resources/v3/auth/session.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;OAYG;IACH,YAAY,CAAC,OAAwB;QACnC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.mts","sourceRoot":"","sources":["../src/resources/auth.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"auth.d.mts","sourceRoot":"","sources":["../../src/resources/v3/auth.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/resources/v3/auth.ts"],"names":[],"mappings":""}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- const tslib_1 = require("../internal/tslib.js");
4
+ const tslib_1 = require("../../internal/tslib.js");
5
5
  tslib_1.__exportStar(require("./auth/index.js"), exports);
6
6
  //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/resources/v3/auth.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,0DAA6B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.mjs","sourceRoot":"","sources":["../../src/resources/v3/auth.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
@@ -0,0 +1,167 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import { APIPromise } from "../../core/api-promise.mjs";
3
+ import { RequestOptions } from "../../internal/request-options.mjs";
4
+ export declare class Cli extends APIResource {
5
+ /**
6
+ * Generates a new CLI session with a random 6-character code. This endpoint is the
7
+ * first step in the CLI authentication flow, creating a session that can later be
8
+ * linked to a user account. The generated code is displayed to the user in the CLI
9
+ * and should be entered in the web interface to complete authentication.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const response = await client.v3.cli.createSession();
14
+ * ```
15
+ */
16
+ createSession(options?: RequestOptions): APIPromise<CliCreateSessionResponse>;
17
+ /**
18
+ * Links a pending CLI session to the currently authenticated user. This is the
19
+ * final step in the CLI authentication flow, where the user enters the code in the
20
+ * web interface and their account is associated with the CLI session, allowing the
21
+ * CLI to act on their behalf.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const response = await client.v3.cli.linkSession({
26
+ * id: 'ABC123',
27
+ * });
28
+ * ```
29
+ */
30
+ linkSession(body: CliLinkSessionParams, options?: RequestOptions): APIPromise<CliLinkSessionResponse>;
31
+ /**
32
+ * Retrieves the current state of a CLI session using either the session ID (UUID)
33
+ * or the 6-character code. This endpoint is used by both the CLI client to check
34
+ * if the session has been linked, and by the web interface to display session
35
+ * details before linking.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * const response = await client.v3.cli.retrieveSession({
40
+ * id: 'ABC123',
41
+ * });
42
+ * ```
43
+ */
44
+ retrieveSession(query: CliRetrieveSessionParams, options?: RequestOptions): APIPromise<CliRetrieveSessionResponse>;
45
+ }
46
+ export interface CliCreateSessionResponse {
47
+ /**
48
+ * Unique identifier for the CLI session. UUID v4 format used for tracking and
49
+ * retrieval.
50
+ */
51
+ id: string;
52
+ /**
53
+ * The 6-character hexadecimal code used for CLI login
54
+ */
55
+ code: string;
56
+ /**
57
+ * The ISO timestamp when the session expires
58
+ */
59
+ expiresAt: string;
60
+ /**
61
+ * The current status of the session
62
+ */
63
+ status: 'pending' | 'linked';
64
+ }
65
+ export interface CliLinkSessionResponse {
66
+ /**
67
+ * The unique identifier for the CLI session
68
+ */
69
+ id: string;
70
+ /**
71
+ * Information about the linked account. Always present for successful responses
72
+ * from this endpoint.
73
+ */
74
+ account: CliLinkSessionResponse.Account;
75
+ /**
76
+ * The 6-character hexadecimal code used for CLI login
77
+ */
78
+ code: string;
79
+ /**
80
+ * The ISO timestamp when the session expires
81
+ */
82
+ expiresAt: string;
83
+ /**
84
+ * The current status of the session
85
+ */
86
+ status: 'pending' | 'linked';
87
+ }
88
+ export declare namespace CliLinkSessionResponse {
89
+ /**
90
+ * Information about the linked account. Always present for successful responses
91
+ * from this endpoint.
92
+ */
93
+ interface Account {
94
+ /**
95
+ * The ID of the linked account
96
+ */
97
+ id: string;
98
+ /**
99
+ * The email address of the linked account
100
+ */
101
+ email: string;
102
+ /**
103
+ * The display name of the linked account
104
+ */
105
+ name: string;
106
+ }
107
+ }
108
+ export interface CliRetrieveSessionResponse {
109
+ /**
110
+ * The unique identifier for the CLI session
111
+ */
112
+ id: string;
113
+ /**
114
+ * Information about the linked account, if any. Null if the session status is
115
+ * "pending".
116
+ */
117
+ account: CliRetrieveSessionResponse.Account | null;
118
+ /**
119
+ * The 6-character hexadecimal code used for CLI login
120
+ */
121
+ code: string;
122
+ /**
123
+ * The ISO timestamp when the session expires
124
+ */
125
+ expiresAt: string;
126
+ /**
127
+ * The current status of the session
128
+ */
129
+ status: 'pending' | 'linked';
130
+ }
131
+ export declare namespace CliRetrieveSessionResponse {
132
+ /**
133
+ * Information about the linked account, if any. Null if the session status is
134
+ * "pending".
135
+ */
136
+ interface Account {
137
+ /**
138
+ * The ID of the linked account
139
+ */
140
+ id: string;
141
+ /**
142
+ * The email address of the linked account
143
+ */
144
+ email: string;
145
+ /**
146
+ * The display name of the linked account
147
+ */
148
+ name: string;
149
+ }
150
+ }
151
+ export interface CliLinkSessionParams {
152
+ /**
153
+ * The CLI session ID or code to link to the current user
154
+ */
155
+ id: string;
156
+ }
157
+ export interface CliRetrieveSessionParams {
158
+ /**
159
+ * CLI session ID (UUID format) or 6-character code to check. Both formats are
160
+ * supported for flexibility in client implementations.
161
+ */
162
+ id: string;
163
+ }
164
+ export declare namespace Cli {
165
+ export { type CliCreateSessionResponse as CliCreateSessionResponse, type CliLinkSessionResponse as CliLinkSessionResponse, type CliRetrieveSessionResponse as CliRetrieveSessionResponse, type CliLinkSessionParams as CliLinkSessionParams, type CliRetrieveSessionParams as CliRetrieveSessionParams, };
166
+ }
167
+ //# sourceMappingURL=cli.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.mts","sourceRoot":"","sources":["../../src/resources/v3/cli.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,GAAI,SAAQ,WAAW;IAClC;;;;;;;;;;OAUG;IACH,aAAa,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;IAI7E;;;;;;;;;;;;OAYG;IACH,WAAW,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,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EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,CAAC,OAAO,WAAW,GAAG,CAAC;IAC3B,OAAO,EACL,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
@@ -0,0 +1,167 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import { APIPromise } from "../../core/api-promise.js";
3
+ import { RequestOptions } from "../../internal/request-options.js";
4
+ export declare class Cli extends APIResource {
5
+ /**
6
+ * Generates a new CLI session with a random 6-character code. This endpoint is the
7
+ * first step in the CLI authentication flow, creating a session that can later be
8
+ * linked to a user account. The generated code is displayed to the user in the CLI
9
+ * and should be entered in the web interface to complete authentication.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const response = await client.v3.cli.createSession();
14
+ * ```
15
+ */
16
+ createSession(options?: RequestOptions): APIPromise<CliCreateSessionResponse>;
17
+ /**
18
+ * Links a pending CLI session to the currently authenticated user. This is the
19
+ * final step in the CLI authentication flow, where the user enters the code in the
20
+ * web interface and their account is associated with the CLI session, allowing the
21
+ * CLI to act on their behalf.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const response = await client.v3.cli.linkSession({
26
+ * id: 'ABC123',
27
+ * });
28
+ * ```
29
+ */
30
+ linkSession(body: CliLinkSessionParams, options?: RequestOptions): APIPromise<CliLinkSessionResponse>;
31
+ /**
32
+ * Retrieves the current state of a CLI session using either the session ID (UUID)
33
+ * or the 6-character code. This endpoint is used by both the CLI client to check
34
+ * if the session has been linked, and by the web interface to display session
35
+ * details before linking.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * const response = await client.v3.cli.retrieveSession({
40
+ * id: 'ABC123',
41
+ * });
42
+ * ```
43
+ */
44
+ retrieveSession(query: CliRetrieveSessionParams, options?: RequestOptions): APIPromise<CliRetrieveSessionResponse>;
45
+ }
46
+ export interface CliCreateSessionResponse {
47
+ /**
48
+ * Unique identifier for the CLI session. UUID v4 format used for tracking and
49
+ * retrieval.
50
+ */
51
+ id: string;
52
+ /**
53
+ * The 6-character hexadecimal code used for CLI login
54
+ */
55
+ code: string;
56
+ /**
57
+ * The ISO timestamp when the session expires
58
+ */
59
+ expiresAt: string;
60
+ /**
61
+ * The current status of the session
62
+ */
63
+ status: 'pending' | 'linked';
64
+ }
65
+ export interface CliLinkSessionResponse {
66
+ /**
67
+ * The unique identifier for the CLI session
68
+ */
69
+ id: string;
70
+ /**
71
+ * Information about the linked account. Always present for successful responses
72
+ * from this endpoint.
73
+ */
74
+ account: CliLinkSessionResponse.Account;
75
+ /**
76
+ * The 6-character hexadecimal code used for CLI login
77
+ */
78
+ code: string;
79
+ /**
80
+ * The ISO timestamp when the session expires
81
+ */
82
+ expiresAt: string;
83
+ /**
84
+ * The current status of the session
85
+ */
86
+ status: 'pending' | 'linked';
87
+ }
88
+ export declare namespace CliLinkSessionResponse {
89
+ /**
90
+ * Information about the linked account. Always present for successful responses
91
+ * from this endpoint.
92
+ */
93
+ interface Account {
94
+ /**
95
+ * The ID of the linked account
96
+ */
97
+ id: string;
98
+ /**
99
+ * The email address of the linked account
100
+ */
101
+ email: string;
102
+ /**
103
+ * The display name of the linked account
104
+ */
105
+ name: string;
106
+ }
107
+ }
108
+ export interface CliRetrieveSessionResponse {
109
+ /**
110
+ * The unique identifier for the CLI session
111
+ */
112
+ id: string;
113
+ /**
114
+ * Information about the linked account, if any. Null if the session status is
115
+ * "pending".
116
+ */
117
+ account: CliRetrieveSessionResponse.Account | null;
118
+ /**
119
+ * The 6-character hexadecimal code used for CLI login
120
+ */
121
+ code: string;
122
+ /**
123
+ * The ISO timestamp when the session expires
124
+ */
125
+ expiresAt: string;
126
+ /**
127
+ * The current status of the session
128
+ */
129
+ status: 'pending' | 'linked';
130
+ }
131
+ export declare namespace CliRetrieveSessionResponse {
132
+ /**
133
+ * Information about the linked account, if any. Null if the session status is
134
+ * "pending".
135
+ */
136
+ interface Account {
137
+ /**
138
+ * The ID of the linked account
139
+ */
140
+ id: string;
141
+ /**
142
+ * The email address of the linked account
143
+ */
144
+ email: string;
145
+ /**
146
+ * The display name of the linked account
147
+ */
148
+ name: string;
149
+ }
150
+ }
151
+ export interface CliLinkSessionParams {
152
+ /**
153
+ * The CLI session ID or code to link to the current user
154
+ */
155
+ id: string;
156
+ }
157
+ export interface CliRetrieveSessionParams {
158
+ /**
159
+ * CLI session ID (UUID format) or 6-character code to check. Both formats are
160
+ * supported for flexibility in client implementations.
161
+ */
162
+ id: string;
163
+ }
164
+ export declare namespace Cli {
165
+ export { type CliCreateSessionResponse as CliCreateSessionResponse, type CliLinkSessionResponse as CliLinkSessionResponse, type CliRetrieveSessionResponse as CliRetrieveSessionResponse, type CliLinkSessionParams as CliLinkSessionParams, type CliRetrieveSessionParams as CliRetrieveSessionParams, };
166
+ }
167
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/resources/v3/cli.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,GAAI,SAAQ,WAAW;IAClC;;;;;;;;;;OAUG;IACH,aAAa,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;IAI7E;;;;;;;;;;;;OAYG;IACH,WAAW,CAAC,IAAI,EAAE,oBAAoB,EAAE,O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QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,CAAC,OAAO,WAAW,GAAG,CAAC;IAC3B,OAAO,EACL,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Cli = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ class Cli extends resource_1.APIResource {
7
+ /**
8
+ * Generates a new CLI session with a random 6-character code. This endpoint is the
9
+ * first step in the CLI authentication flow, creating a session that can later be
10
+ * linked to a user account. The generated code is displayed to the user in the CLI
11
+ * and should be entered in the web interface to complete authentication.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const response = await client.v3.cli.createSession();
16
+ * ```
17
+ */
18
+ createSession(options) {
19
+ return this._client.post('/api/v3/cli/create-session', options);
20
+ }
21
+ /**
22
+ * Links a pending CLI session to the currently authenticated user. This is the
23
+ * final step in the CLI authentication flow, where the user enters the code in the
24
+ * web interface and their account is associated with the CLI session, allowing the
25
+ * CLI to act on their behalf.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * const response = await client.v3.cli.linkSession({
30
+ * id: 'ABC123',
31
+ * });
32
+ * ```
33
+ */
34
+ linkSession(body, options) {
35
+ return this._client.put('/api/v3/cli/link-session', { body, ...options });
36
+ }
37
+ /**
38
+ * Retrieves the current state of a CLI session using either the session ID (UUID)
39
+ * or the 6-character code. This endpoint is used by both the CLI client to check
40
+ * if the session has been linked, and by the web interface to display session
41
+ * details before linking.
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * const response = await client.v3.cli.retrieveSession({
46
+ * id: 'ABC123',
47
+ * });
48
+ * ```
49
+ */
50
+ retrieveSession(query, options) {
51
+ return this._client.get('/api/v3/cli/get-session', { query, ...options });
52
+ }
53
+ }
54
+ exports.Cli = Cli;
55
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/resources/v3/cli.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAIlD,MAAa,GAAI,SAAQ,sBAAW;IAClC;;;;;;;;;;OAUG;IACH,aAAa,CAAC,OAAwB;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,WAAW,CAAC,IAA0B,EAAE,OAAwB;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,eAAe,CACb,KAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;CACF;AApDD,kBAoDC"}