@onkernel/sdk 0.70.0 → 0.71.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 (66) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/client.d.mts +9 -1
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +9 -1
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +6 -0
  9. package/client.mjs.map +1 -1
  10. package/core/pagination.d.mts +14 -0
  11. package/core/pagination.d.mts.map +1 -1
  12. package/core/pagination.d.ts +14 -0
  13. package/core/pagination.d.ts.map +1 -1
  14. package/core/pagination.js +32 -1
  15. package/core/pagination.js.map +1 -1
  16. package/core/pagination.mjs +30 -0
  17. package/core/pagination.mjs.map +1 -1
  18. package/package.json +1 -1
  19. package/resources/audit-logs.d.mts +102 -0
  20. package/resources/audit-logs.d.mts.map +1 -0
  21. package/resources/audit-logs.d.ts +102 -0
  22. package/resources/audit-logs.d.ts.map +1 -0
  23. package/resources/audit-logs.js +20 -0
  24. package/resources/audit-logs.js.map +1 -0
  25. package/resources/audit-logs.mjs +16 -0
  26. package/resources/audit-logs.mjs.map +1 -0
  27. package/resources/auth/auth.d.mts +2 -2
  28. package/resources/auth/auth.d.mts.map +1 -1
  29. package/resources/auth/auth.d.ts +2 -2
  30. package/resources/auth/auth.d.ts.map +1 -1
  31. package/resources/auth/auth.js.map +1 -1
  32. package/resources/auth/auth.mjs.map +1 -1
  33. package/resources/auth/connections.d.mts +80 -1
  34. package/resources/auth/connections.d.mts.map +1 -1
  35. package/resources/auth/connections.d.ts +80 -1
  36. package/resources/auth/connections.d.ts.map +1 -1
  37. package/resources/auth/connections.js +18 -0
  38. package/resources/auth/connections.js.map +1 -1
  39. package/resources/auth/connections.mjs +18 -0
  40. package/resources/auth/connections.mjs.map +1 -1
  41. package/resources/auth/index.d.mts +1 -1
  42. package/resources/auth/index.d.mts.map +1 -1
  43. package/resources/auth/index.d.ts +1 -1
  44. package/resources/auth/index.d.ts.map +1 -1
  45. package/resources/auth/index.js.map +1 -1
  46. package/resources/auth/index.mjs.map +1 -1
  47. package/resources/index.d.mts +1 -0
  48. package/resources/index.d.mts.map +1 -1
  49. package/resources/index.d.ts +1 -0
  50. package/resources/index.d.ts.map +1 -1
  51. package/resources/index.js +3 -1
  52. package/resources/index.js.map +1 -1
  53. package/resources/index.mjs +1 -0
  54. package/resources/index.mjs.map +1 -1
  55. package/src/client.ts +31 -1
  56. package/src/core/pagination.ts +56 -0
  57. package/src/resources/audit-logs.ts +135 -0
  58. package/src/resources/auth/auth.ts +6 -0
  59. package/src/resources/auth/connections.ts +114 -0
  60. package/src/resources/auth/index.ts +3 -0
  61. package/src/resources/index.ts +6 -0
  62. package/src/version.ts +1 -1
  63. package/version.d.mts +1 -1
  64. package/version.d.ts +1 -1
  65. package/version.js +1 -1
  66. package/version.mjs +1 -1
@@ -8,11 +8,14 @@ import {
8
8
  ConnectionListParams,
9
9
  ConnectionLoginParams,
10
10
  ConnectionSubmitParams,
11
+ ConnectionTimelineParams,
11
12
  ConnectionUpdateParams,
12
13
  Connections,
13
14
  LoginResponse,
14
15
  ManagedAuth,
15
16
  ManagedAuthCreateRequest,
17
+ ManagedAuthTimelineEvent,
18
+ ManagedAuthTimelineEventsOffsetPagination,
16
19
  ManagedAuthUpdateRequest,
17
20
  ManagedAuthsOffsetPagination,
18
21
  SubmitFieldsRequest,
@@ -31,15 +34,18 @@ export declare namespace Auth {
31
34
  type LoginResponse as LoginResponse,
32
35
  type ManagedAuth as ManagedAuth,
33
36
  type ManagedAuthCreateRequest as ManagedAuthCreateRequest,
37
+ type ManagedAuthTimelineEvent as ManagedAuthTimelineEvent,
34
38
  type ManagedAuthUpdateRequest as ManagedAuthUpdateRequest,
35
39
  type SubmitFieldsRequest as SubmitFieldsRequest,
36
40
  type SubmitFieldsResponse as SubmitFieldsResponse,
37
41
  type ConnectionFollowResponse as ConnectionFollowResponse,
38
42
  type ManagedAuthsOffsetPagination as ManagedAuthsOffsetPagination,
43
+ type ManagedAuthTimelineEventsOffsetPagination as ManagedAuthTimelineEventsOffsetPagination,
39
44
  type ConnectionCreateParams as ConnectionCreateParams,
40
45
  type ConnectionUpdateParams as ConnectionUpdateParams,
41
46
  type ConnectionListParams as ConnectionListParams,
42
47
  type ConnectionLoginParams as ConnectionLoginParams,
43
48
  type ConnectionSubmitParams as ConnectionSubmitParams,
49
+ type ConnectionTimelineParams as ConnectionTimelineParams,
44
50
  };
45
51
  }
@@ -152,10 +152,39 @@ export class Connections extends APIResource {
152
152
  ): APIPromise<SubmitFieldsResponse> {
153
153
  return this._client.post(path`/auth/connections/${id}/submit`, { body, ...options });
154
154
  }
155
+
156
+ /**
157
+ * Returns a chronological timeline of events for an auth connection — login
158
+ * attempts, automatic re-auth attempts, and health checks. Events are returned
159
+ * newest-first.
160
+ *
161
+ * @example
162
+ * ```ts
163
+ * // Automatically fetches more pages as needed.
164
+ * for await (const managedAuthTimelineEvent of client.auth.connections.timeline(
165
+ * 'id',
166
+ * )) {
167
+ * // ...
168
+ * }
169
+ * ```
170
+ */
171
+ timeline(
172
+ id: string,
173
+ query: ConnectionTimelineParams | null | undefined = {},
174
+ options?: RequestOptions,
175
+ ): PagePromise<ManagedAuthTimelineEventsOffsetPagination, ManagedAuthTimelineEvent> {
176
+ return this._client.getAPIList(
177
+ path`/auth/connections/${id}/timeline`,
178
+ OffsetPagination<ManagedAuthTimelineEvent>,
179
+ { query, ...options },
180
+ );
181
+ }
155
182
  }
156
183
 
157
184
  export type ManagedAuthsOffsetPagination = OffsetPagination<ManagedAuth>;
158
185
 
186
+ export type ManagedAuthTimelineEventsOffsetPagination = OffsetPagination<ManagedAuthTimelineEvent>;
187
+
159
188
  /**
160
189
  * Response from starting a login flow
161
190
  */
@@ -764,6 +793,81 @@ export namespace ManagedAuthCreateRequest {
764
793
  }
765
794
  }
766
795
 
796
+ /**
797
+ * A single event in an auth connection's history — a login attempt, an automatic
798
+ * re-auth attempt, or a health check.
799
+ */
800
+ export interface ManagedAuthTimelineEvent {
801
+ /**
802
+ * Identifier of the underlying login/reauth session or health check.
803
+ */
804
+ id: string;
805
+
806
+ /**
807
+ * Outcome of the event. For login/reauth events this is the flow status
808
+ * (IN_PROGRESS, SUCCESS, EXPIRED, CANCELED, FAILED). For health_check events it is
809
+ * the observed session state (AUTHENTICATED, NEEDS_AUTH).
810
+ */
811
+ status: 'IN_PROGRESS' | 'SUCCESS' | 'EXPIRED' | 'CANCELED' | 'FAILED' | 'AUTHENTICATED' | 'NEEDS_AUTH';
812
+
813
+ /**
814
+ * When the event occurred.
815
+ */
816
+ timestamp: string;
817
+
818
+ /**
819
+ * The kind of event. "login" and "reauth" are authentication attempts;
820
+ * "health_check" is a periodic session-validity check.
821
+ */
822
+ type: 'login' | 'reauth' | 'health_check';
823
+
824
+ /**
825
+ * Machine-readable error code. Present when a login/reauth event failed.
826
+ */
827
+ error_code?: string;
828
+
829
+ /**
830
+ * Human-readable error message. Present when a login/reauth event failed.
831
+ */
832
+ error_message?: string;
833
+
834
+ /**
835
+ * The session state observed before this event. Present for health_check events
836
+ * that recorded a prior state.
837
+ */
838
+ previous_status?: 'AUTHENTICATED' | 'NEEDS_AUTH';
839
+
840
+ /**
841
+ * Replay recording ID for the event's browser session, if session recording was
842
+ * enabled.
843
+ */
844
+ replay_id?: string;
845
+
846
+ /**
847
+ * The step the flow reached. Present for login/reauth events.
848
+ */
849
+ step?:
850
+ | 'INITIALIZED'
851
+ | 'DISCOVERING'
852
+ | 'AWAITING_INPUT'
853
+ | 'AWAITING_EXTERNAL_ACTION'
854
+ | 'AWAITING_HUMAN_INTERVENTION'
855
+ | 'SUBMITTING'
856
+ | 'COMPLETED'
857
+ | 'EXPIRED';
858
+
859
+ /**
860
+ * When the event was last updated. Present for login/reauth events.
861
+ */
862
+ updated_at?: string;
863
+
864
+ /**
865
+ * Visible error message from the website (e.g., 'Incorrect password'). Present
866
+ * when the website displayed an error during the attempt.
867
+ */
868
+ website_error?: string;
869
+ }
870
+
767
871
  /**
768
872
  * Request to update an auth connection's configuration
769
873
  */
@@ -1466,20 +1570,30 @@ export interface ConnectionSubmitParams {
1466
1570
  sso_provider?: string;
1467
1571
  }
1468
1572
 
1573
+ export interface ConnectionTimelineParams extends OffsetPaginationParams {
1574
+ /**
1575
+ * Filter the timeline to a single event type.
1576
+ */
1577
+ type?: 'login' | 'reauth' | 'health_check';
1578
+ }
1579
+
1469
1580
  export declare namespace Connections {
1470
1581
  export {
1471
1582
  type LoginResponse as LoginResponse,
1472
1583
  type ManagedAuth as ManagedAuth,
1473
1584
  type ManagedAuthCreateRequest as ManagedAuthCreateRequest,
1585
+ type ManagedAuthTimelineEvent as ManagedAuthTimelineEvent,
1474
1586
  type ManagedAuthUpdateRequest as ManagedAuthUpdateRequest,
1475
1587
  type SubmitFieldsRequest as SubmitFieldsRequest,
1476
1588
  type SubmitFieldsResponse as SubmitFieldsResponse,
1477
1589
  type ConnectionFollowResponse as ConnectionFollowResponse,
1478
1590
  type ManagedAuthsOffsetPagination as ManagedAuthsOffsetPagination,
1591
+ type ManagedAuthTimelineEventsOffsetPagination as ManagedAuthTimelineEventsOffsetPagination,
1479
1592
  type ConnectionCreateParams as ConnectionCreateParams,
1480
1593
  type ConnectionUpdateParams as ConnectionUpdateParams,
1481
1594
  type ConnectionListParams as ConnectionListParams,
1482
1595
  type ConnectionLoginParams as ConnectionLoginParams,
1483
1596
  type ConnectionSubmitParams as ConnectionSubmitParams,
1597
+ type ConnectionTimelineParams as ConnectionTimelineParams,
1484
1598
  };
1485
1599
  }
@@ -6,6 +6,7 @@ export {
6
6
  type LoginResponse,
7
7
  type ManagedAuth,
8
8
  type ManagedAuthCreateRequest,
9
+ type ManagedAuthTimelineEvent,
9
10
  type ManagedAuthUpdateRequest,
10
11
  type SubmitFieldsRequest,
11
12
  type SubmitFieldsResponse,
@@ -15,5 +16,7 @@ export {
15
16
  type ConnectionListParams,
16
17
  type ConnectionLoginParams,
17
18
  type ConnectionSubmitParams,
19
+ type ConnectionTimelineParams,
18
20
  type ManagedAuthsOffsetPagination,
21
+ type ManagedAuthTimelineEventsOffsetPagination,
19
22
  } from './connections';
@@ -18,6 +18,12 @@ export {
18
18
  type AppListParams,
19
19
  type AppListResponsesOffsetPagination,
20
20
  } from './apps';
21
+ export {
22
+ AuditLogs,
23
+ type AuditLogEntry,
24
+ type AuditLogListParams,
25
+ type AuditLogEntriesPageTokenPagination,
26
+ } from './audit-logs';
21
27
  export { Auth } from './auth/auth';
22
28
  export {
23
29
  BrowserPools,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.70.0'; // x-release-please-version
1
+ export const VERSION = '0.71.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.70.0";
1
+ export declare const VERSION = "0.71.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.70.0";
1
+ export declare const VERSION = "0.71.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.70.0'; // x-release-please-version
4
+ exports.VERSION = '0.71.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.70.0'; // x-release-please-version
1
+ export const VERSION = '0.71.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map