@onkernel/sdk 0.86.1 → 0.87.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 (105) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/client.d.mts +1 -1
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +1 -1
  5. package/client.d.ts.map +1 -1
  6. package/client.js +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +1 -1
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/audit-logs/audit-logs.d.mts +169 -0
  12. package/resources/audit-logs/audit-logs.d.mts.map +1 -0
  13. package/resources/audit-logs/audit-logs.d.ts +169 -0
  14. package/resources/audit-logs/audit-logs.d.ts.map +1 -0
  15. package/resources/audit-logs/audit-logs.js +53 -0
  16. package/resources/audit-logs/audit-logs.js.map +1 -0
  17. package/resources/audit-logs/audit-logs.mjs +48 -0
  18. package/resources/audit-logs/audit-logs.mjs.map +1 -0
  19. package/resources/audit-logs/export-destinations.d.mts +163 -0
  20. package/resources/audit-logs/export-destinations.d.mts.map +1 -0
  21. package/resources/audit-logs/export-destinations.d.ts +163 -0
  22. package/resources/audit-logs/export-destinations.d.ts.map +1 -0
  23. package/resources/audit-logs/export-destinations.js +62 -0
  24. package/resources/audit-logs/export-destinations.js.map +1 -0
  25. package/resources/audit-logs/export-destinations.mjs +58 -0
  26. package/resources/audit-logs/export-destinations.mjs.map +1 -0
  27. package/resources/audit-logs/index.d.mts +3 -0
  28. package/resources/audit-logs/index.d.mts.map +1 -0
  29. package/resources/audit-logs/index.d.ts +3 -0
  30. package/resources/audit-logs/index.d.ts.map +1 -0
  31. package/resources/audit-logs/index.js +9 -0
  32. package/resources/audit-logs/index.js.map +1 -0
  33. package/resources/audit-logs/index.mjs +4 -0
  34. package/resources/audit-logs/index.mjs.map +1 -0
  35. package/resources/audit-logs.d.mts +1 -164
  36. package/resources/audit-logs.d.mts.map +1 -1
  37. package/resources/audit-logs.d.ts +1 -164
  38. package/resources/audit-logs.d.ts.map +1 -1
  39. package/resources/audit-logs.js +2 -41
  40. package/resources/audit-logs.js.map +1 -1
  41. package/resources/audit-logs.mjs +1 -39
  42. package/resources/audit-logs.mjs.map +1 -1
  43. package/resources/auth/auth.d.mts +4 -0
  44. package/resources/auth/auth.d.mts.map +1 -1
  45. package/resources/auth/auth.d.ts +4 -0
  46. package/resources/auth/auth.d.ts.map +1 -1
  47. package/resources/auth/auth.js +4 -0
  48. package/resources/auth/auth.js.map +1 -1
  49. package/resources/auth/auth.mjs +4 -0
  50. package/resources/auth/auth.mjs.map +1 -1
  51. package/resources/auth/context.d.mts +106 -0
  52. package/resources/auth/context.d.mts.map +1 -0
  53. package/resources/auth/context.d.ts +106 -0
  54. package/resources/auth/context.d.ts.map +1 -0
  55. package/resources/auth/context.js +25 -0
  56. package/resources/auth/context.js.map +1 -0
  57. package/resources/auth/context.mjs +21 -0
  58. package/resources/auth/context.mjs.map +1 -0
  59. package/resources/auth/index.d.mts +1 -0
  60. package/resources/auth/index.d.mts.map +1 -1
  61. package/resources/auth/index.d.ts +1 -0
  62. package/resources/auth/index.d.ts.map +1 -1
  63. package/resources/auth/index.js +3 -1
  64. package/resources/auth/index.js.map +1 -1
  65. package/resources/auth/index.mjs +1 -0
  66. package/resources/auth/index.mjs.map +1 -1
  67. package/resources/browser-pools.d.mts +5 -0
  68. package/resources/browser-pools.d.mts.map +1 -1
  69. package/resources/browser-pools.d.ts +5 -0
  70. package/resources/browser-pools.d.ts.map +1 -1
  71. package/resources/browsers/browsers.d.mts +20 -0
  72. package/resources/browsers/browsers.d.mts.map +1 -1
  73. package/resources/browsers/browsers.d.ts +20 -0
  74. package/resources/browsers/browsers.d.ts.map +1 -1
  75. package/resources/browsers/browsers.js.map +1 -1
  76. package/resources/browsers/browsers.mjs.map +1 -1
  77. package/resources/index.d.mts +1 -1
  78. package/resources/index.d.mts.map +1 -1
  79. package/resources/index.d.ts +1 -1
  80. package/resources/index.d.ts.map +1 -1
  81. package/resources/index.js +1 -1
  82. package/resources/index.js.map +1 -1
  83. package/resources/index.mjs +1 -1
  84. package/resources/index.mjs.map +1 -1
  85. package/resources/invocations.d.mts +5 -0
  86. package/resources/invocations.d.mts.map +1 -1
  87. package/resources/invocations.d.ts +5 -0
  88. package/resources/invocations.d.ts.map +1 -1
  89. package/src/client.ts +7 -7
  90. package/src/resources/audit-logs/audit-logs.ts +281 -0
  91. package/src/resources/audit-logs/export-destinations.ts +262 -0
  92. package/src/resources/audit-logs/index.ts +25 -0
  93. package/src/resources/audit-logs.ts +1 -249
  94. package/src/resources/auth/auth.ts +6 -0
  95. package/src/resources/auth/context.ts +125 -0
  96. package/src/resources/auth/index.ts +1 -0
  97. package/src/resources/browser-pools.ts +6 -0
  98. package/src/resources/browsers/browsers.ts +24 -0
  99. package/src/resources/index.ts +1 -1
  100. package/src/resources/invocations.ts +6 -0
  101. package/src/version.ts +1 -1
  102. package/version.d.mts +1 -1
  103. package/version.d.ts +1 -1
  104. package/version.js +1 -1
  105. package/version.mjs +1 -1
@@ -0,0 +1,169 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import * as ExportDestinationsAPI from "./export-destinations.js";
3
+ import { AuditLogExportDestination, AuditLogExportDestinationTestResult, AuditLogExportDestinationsOffsetPagination, CreateAuditLogExportDestinationRequest, ExportDestinationCreateParams, ExportDestinationListParams, ExportDestinationUpdateParams, ExportDestinations, UpdateAuditLogExportDestinationRequest } from "./export-destinations.js";
4
+ import { APIPromise } from "../../core/api-promise.js";
5
+ import { PagePromise, PageTokenPagination, type PageTokenPaginationParams } from "../../core/pagination.js";
6
+ import { RequestOptions } from "../../internal/request-options.js";
7
+ import { type AuditLogDownloadDestination, type AuditLogDownloadOptions, type AuditLogDownloadParams, type AuditLogDownloadProgress, type AuditLogDownloadResult } from "../../lib/audit-log-download.js";
8
+ export type { AuditLogDownloadDestination, AuditLogDownloadOptions, AuditLogDownloadParams, AuditLogDownloadProgress, AuditLogDownloadResult, } from "../../lib/audit-log-download.js";
9
+ /**
10
+ * Read audit log records for the authenticated organization.
11
+ */
12
+ export declare class AuditLogs extends APIResource {
13
+ exportDestinations: ExportDestinationsAPI.ExportDestinations;
14
+ /**
15
+ * API for searching audit logs. Limited to at most 30 day search, returns up to
16
+ * 100 records per page. Not recommended for bulk export.
17
+ */
18
+ list(query: AuditLogListParams, options?: RequestOptions): PagePromise<AuditLogEntriesPageTokenPagination, AuditLogEntry>;
19
+ /**
20
+ * Download an organization's audit log records for a time range as a file, for
21
+ * archival, compliance, or offline analysis. For interactive browsing, use GET
22
+ * /audit-logs.
23
+ */
24
+ exportChunk(query: AuditLogExportChunkParams, options?: RequestOptions): APIPromise<Response>;
25
+ /**
26
+ * Download a complete gzip-compressed JSON Lines audit log export to a writable
27
+ * destination. The SDK verifies every chunk and retries transient transfer
28
+ * failures. It does not close the destination. If the download fails, the
29
+ * destination may contain a partial export; use a temporary file and atomic
30
+ * rename when the completed export must be published atomically.
31
+ */
32
+ download(query: AuditLogDownloadParams, destination: AuditLogDownloadDestination, options?: AuditLogDownloadOptions): Promise<AuditLogDownloadResult>;
33
+ }
34
+ export type AuditLogEntriesPageTokenPagination = PageTokenPagination<AuditLogEntry>;
35
+ export interface AuditLogEntry {
36
+ /**
37
+ * Authentication strategy used for the request.
38
+ */
39
+ auth_strategy: string;
40
+ /**
41
+ * Client IP address.
42
+ */
43
+ client_ip: string;
44
+ /**
45
+ * Request host.
46
+ */
47
+ domain: string;
48
+ /**
49
+ * Request duration in milliseconds.
50
+ */
51
+ duration_ms: number;
52
+ /**
53
+ * Email of the authenticated user at request time, if any.
54
+ */
55
+ email: string;
56
+ /**
57
+ * HTTP method.
58
+ */
59
+ method: string;
60
+ /**
61
+ * Request path.
62
+ */
63
+ path: string;
64
+ /**
65
+ * Matched API route pattern, if available.
66
+ */
67
+ route: string;
68
+ /**
69
+ * HTTP response status code.
70
+ */
71
+ status: number;
72
+ /**
73
+ * UTC time when the request was received.
74
+ */
75
+ timestamp: string;
76
+ /**
77
+ * User agent header.
78
+ */
79
+ user_agent: string;
80
+ /**
81
+ * ID of the authenticated user, if any.
82
+ */
83
+ user_id: string;
84
+ }
85
+ export interface AuditLogListParams extends PageTokenPaginationParams {
86
+ /**
87
+ * Upper bound (exclusive) for the audit record timestamp.
88
+ */
89
+ end: string;
90
+ /**
91
+ * Lower bound (inclusive) for the audit record timestamp.
92
+ */
93
+ start: string;
94
+ /**
95
+ * Filter by authentication strategy.
96
+ */
97
+ auth_strategy?: string;
98
+ /**
99
+ * Filter out results by HTTP method.
100
+ */
101
+ exclude_method?: Array<string>;
102
+ /**
103
+ * Filter by HTTP method.
104
+ */
105
+ method?: string;
106
+ /**
107
+ * Free-text search over path, user ID, email, client IP, and status.
108
+ */
109
+ search?: string;
110
+ /**
111
+ * Additional user IDs to OR into free-text search.
112
+ */
113
+ search_user_id?: Array<string>;
114
+ /**
115
+ * Filter by service name.
116
+ */
117
+ service?: string;
118
+ }
119
+ export interface AuditLogExportChunkParams {
120
+ /**
121
+ * Upper bound (exclusive) for the audit record timestamp.
122
+ */
123
+ end: string;
124
+ /**
125
+ * Lower bound (inclusive) for the audit record timestamp.
126
+ */
127
+ start: string;
128
+ /**
129
+ * Filter by authentication strategy.
130
+ */
131
+ auth_strategy?: string;
132
+ /**
133
+ * Opaque cursor from X-Next-Cursor for the next chunk of older records.
134
+ */
135
+ cursor?: string;
136
+ /**
137
+ * Filter out results by HTTP method.
138
+ */
139
+ exclude_method?: Array<string>;
140
+ /**
141
+ * Encoding for the returned chunk.
142
+ */
143
+ format?: 'jsonl' | 'jsonl.gz';
144
+ /**
145
+ * Maximum number of records to return in this chunk.
146
+ */
147
+ limit?: number;
148
+ /**
149
+ * Filter by HTTP method.
150
+ */
151
+ method?: string;
152
+ /**
153
+ * Free-text search over path, user ID, email, client IP, and status.
154
+ */
155
+ search?: string;
156
+ /**
157
+ * Additional user IDs to OR into free-text search.
158
+ */
159
+ search_user_id?: Array<string>;
160
+ /**
161
+ * Filter by service name.
162
+ */
163
+ service?: string;
164
+ }
165
+ export declare namespace AuditLogs {
166
+ export { type AuditLogEntry as AuditLogEntry, type AuditLogEntriesPageTokenPagination as AuditLogEntriesPageTokenPagination, type AuditLogListParams as AuditLogListParams, type AuditLogExportChunkParams as AuditLogExportChunkParams, type AuditLogDownloadDestination as AuditLogDownloadDestination, type AuditLogDownloadOptions as AuditLogDownloadOptions, type AuditLogDownloadParams as AuditLogDownloadParams, type AuditLogDownloadProgress as AuditLogDownloadProgress, type AuditLogDownloadResult as AuditLogDownloadResult, };
167
+ export { ExportDestinations as ExportDestinations, type AuditLogExportDestination as AuditLogExportDestination, type AuditLogExportDestinationTestResult as AuditLogExportDestinationTestResult, type CreateAuditLogExportDestinationRequest as CreateAuditLogExportDestinationRequest, type UpdateAuditLogExportDestinationRequest as UpdateAuditLogExportDestinationRequest, type AuditLogExportDestinationsOffsetPagination as AuditLogExportDestinationsOffsetPagination, type ExportDestinationCreateParams as ExportDestinationCreateParams, type ExportDestinationUpdateParams as ExportDestinationUpdateParams, type ExportDestinationListParams as ExportDestinationListParams, };
168
+ }
169
+ //# sourceMappingURL=audit-logs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-logs.d.ts","sourceRoot":"","sources":["../../src/resources/audit-logs/audit-logs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,qBAAqB,iCAA8B;AAC/D,OAAO,EACL,yBAAyB,EACzB,mCAAmC,EACnC,0CAA0C,EAC1C,sCAAsC,EACtC,6BAA6B,EAC7B,2BAA2B,EAC3B,6BAA6B,EAC7B,kBAAkB,EAClB,sCAAsC,EACvC,iCAA8B;AAC/B,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,KAAK,yBAAyB,EAAE,iCAA8B;AAEzG,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAChE,OAAO,EAEL,K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ACnC,KAAK,kCAAkC,IAAI,kCAAkC,EAC7E,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;IAEF,OAAO,EACL,kBAAkB,IAAI,kBAAkB,EACxC,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,sCAAsC,IAAI,sCAAsC,EACrF,KAAK,sCAAsC,IAAI,sCAAsC,EACrF,KAAK,0CAA0C,IAAI,0CAA0C,EAC7F,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,2BAA2B,IAAI,2BAA2B,GAChE,CAAC;CACH"}
@@ -0,0 +1,53 @@
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.AuditLogs = void 0;
5
+ const tslib_1 = require("../../internal/tslib.js");
6
+ const resource_1 = require("../../core/resource.js");
7
+ const ExportDestinationsAPI = tslib_1.__importStar(require("./export-destinations.js"));
8
+ const export_destinations_1 = require("./export-destinations.js");
9
+ const pagination_1 = require("../../core/pagination.js");
10
+ const headers_1 = require("../../internal/headers.js");
11
+ const audit_log_download_1 = require("../../lib/audit-log-download.js");
12
+ /**
13
+ * Read audit log records for the authenticated organization.
14
+ */
15
+ class AuditLogs extends resource_1.APIResource {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.exportDestinations = new ExportDestinationsAPI.ExportDestinations(this._client);
19
+ }
20
+ /**
21
+ * API for searching audit logs. Limited to at most 30 day search, returns up to
22
+ * 100 records per page. Not recommended for bulk export.
23
+ */
24
+ list(query, options) {
25
+ return this._client.getAPIList('/audit-logs', (pagination_1.PageTokenPagination), { query, ...options });
26
+ }
27
+ /**
28
+ * Download an organization's audit log records for a time range as a file, for
29
+ * archival, compliance, or offline analysis. For interactive browsing, use GET
30
+ * /audit-logs.
31
+ */
32
+ exportChunk(query, options) {
33
+ return this._client.get('/audit-logs/export/chunk', {
34
+ query,
35
+ ...options,
36
+ headers: (0, headers_1.buildHeaders)([{ Accept: 'application/octet-stream' }, options?.headers]),
37
+ __binaryResponse: true,
38
+ });
39
+ }
40
+ /**
41
+ * Download a complete gzip-compressed JSON Lines audit log export to a writable
42
+ * destination. The SDK verifies every chunk and retries transient transfer
43
+ * failures. It does not close the destination. If the download fails, the
44
+ * destination may contain a partial export; use a temporary file and atomic
45
+ * rename when the completed export must be published atomically.
46
+ */
47
+ download(query, destination, options) {
48
+ return (0, audit_log_download_1.downloadAuditLogs)((chunkQuery, chunkOptions) => this.exportChunk(chunkQuery, chunkOptions), query, destination, this._client.timeout, options);
49
+ }
50
+ }
51
+ exports.AuditLogs = AuditLogs;
52
+ AuditLogs.ExportDestinations = export_destinations_1.ExportDestinations;
53
+ //# sourceMappingURL=audit-logs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-logs.js","sourceRoot":"","sources":["../../src/resources/audit-logs/audit-logs.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,wFAA+D;AAC/D,kEAU+B;AAE/B,yDAAyG;AACzG,uDAAsD;AAEtD,wEAOsC;AAUtC;;GAEG;AACH,MAAa,SAAU,SAAQ,sBAAW;IAA1C;;QACE,uBAAkB,GAA6C,IAAI,qBAAqB,CAAC,kBAAkB,CACzG,IAAI,CAAC,OAAO,CACb,CAAC;IA+CJ,CAAC;IA7CC;;;OAGG;IACH,IAAI,CACF,KAAyB,EACzB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,EAAE,CAAA,gCAAkC,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3G,CAAC;IAED;;;;OAIG;IACH,WAAW,CAAC,KAAgC,EAAE,OAAwB;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE;YAClD,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,0BAA0B,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YACjF,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,QAAQ,CACN,KAA6B,EAC7B,WAAwC,EACxC,OAAiC;QAEjC,OAAO,IAAA,sCAAiB,EACtB,CAAC,UAAU,EAAE,YAAY,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,YAAY,CAAC,EACxE,KAAK,EACL,WAAW,EACX,IAAI,CAAC,OAAO,CAAC,OAAO,EACpB,OAAO,CACR,CAAC;IACJ,CAAC;CACF;AAlDD,8BAkDC;AAqKD,SAAS,CAAC,kBAAkB,GAAG,wCAAkB,CAAC"}
@@ -0,0 +1,48 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import * as ExportDestinationsAPI from "./export-destinations.mjs";
4
+ import { ExportDestinations, } from "./export-destinations.mjs";
5
+ import { PageTokenPagination } from "../../core/pagination.mjs";
6
+ import { buildHeaders } from "../../internal/headers.mjs";
7
+ import { downloadAuditLogs, } from "../../lib/audit-log-download.mjs";
8
+ /**
9
+ * Read audit log records for the authenticated organization.
10
+ */
11
+ export class AuditLogs extends APIResource {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.exportDestinations = new ExportDestinationsAPI.ExportDestinations(this._client);
15
+ }
16
+ /**
17
+ * API for searching audit logs. Limited to at most 30 day search, returns up to
18
+ * 100 records per page. Not recommended for bulk export.
19
+ */
20
+ list(query, options) {
21
+ return this._client.getAPIList('/audit-logs', (PageTokenPagination), { query, ...options });
22
+ }
23
+ /**
24
+ * Download an organization's audit log records for a time range as a file, for
25
+ * archival, compliance, or offline analysis. For interactive browsing, use GET
26
+ * /audit-logs.
27
+ */
28
+ exportChunk(query, options) {
29
+ return this._client.get('/audit-logs/export/chunk', {
30
+ query,
31
+ ...options,
32
+ headers: buildHeaders([{ Accept: 'application/octet-stream' }, options?.headers]),
33
+ __binaryResponse: true,
34
+ });
35
+ }
36
+ /**
37
+ * Download a complete gzip-compressed JSON Lines audit log export to a writable
38
+ * destination. The SDK verifies every chunk and retries transient transfer
39
+ * failures. It does not close the destination. If the download fails, the
40
+ * destination may contain a partial export; use a temporary file and atomic
41
+ * rename when the completed export must be published atomically.
42
+ */
43
+ download(query, destination, options) {
44
+ return downloadAuditLogs((chunkQuery, chunkOptions) => this.exportChunk(chunkQuery, chunkOptions), query, destination, this._client.timeout, options);
45
+ }
46
+ }
47
+ AuditLogs.ExportDestinations = ExportDestinations;
48
+ //# sourceMappingURL=audit-logs.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-logs.mjs","sourceRoot":"","sources":["../../src/resources/audit-logs/audit-logs.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,qBAAqB,kCAA8B;AAC/D,OAAO,EAQL,kBAAkB,GAEnB,kCAA8B;AAE/B,OAAO,EAAe,mBAAmB,EAAkC,kCAA8B;AACzG,OAAO,EAAE,YAAY,EAAE,mCAA+B;AAEtD,OAAO,EACL,iBAAiB,GAMlB,yCAAqC;AAUtC;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,WAAW;IAA1C;;QACE,uBAAkB,GAA6C,IAAI,qBAAqB,CAAC,kBAAkB,CACzG,IAAI,CAAC,OAAO,CACb,CAAC;IA+CJ,CAAC;IA7CC;;;OAGG;IACH,IAAI,CACF,KAAyB,EACzB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,EAAE,CAAA,mBAAkC,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3G,CAAC;IAED;;;;OAIG;IACH,WAAW,CAAC,KAAgC,EAAE,OAAwB;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE;YAClD,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,0BAA0B,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YACjF,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,QAAQ,CACN,KAA6B,EAC7B,WAAwC,EACxC,OAAiC;QAEjC,OAAO,iBAAiB,CACtB,CAAC,UAAU,EAAE,YAAY,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,YAAY,CAAC,EACxE,KAAK,EACL,WAAW,EACX,IAAI,CAAC,OAAO,CAAC,OAAO,EACpB,OAAO,CACR,CAAC;IACJ,CAAC;CACF;AAqKD,SAAS,CAAC,kBAAkB,GAAG,kBAAkB,CAAC"}
@@ -0,0 +1,163 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import { APIPromise } from "../../core/api-promise.mjs";
3
+ import { OffsetPagination, type OffsetPaginationParams, PagePromise } from "../../core/pagination.mjs";
4
+ import { RequestOptions } from "../../internal/request-options.mjs";
5
+ /**
6
+ * Read audit log records for the authenticated organization.
7
+ */
8
+ export declare class ExportDestinations extends APIResource {
9
+ /**
10
+ * Create a paused destination. Activate it with a status update once the
11
+ * destination test passes. Requires an active Enterprise plan.
12
+ */
13
+ create(body: ExportDestinationCreateParams, options?: RequestOptions): APIPromise<AuditLogExportDestination>;
14
+ /**
15
+ * Retrieve details for a single audit log export destination by its ID.
16
+ */
17
+ retrieve(id: string, options?: RequestOptions): APIPromise<AuditLogExportDestination>;
18
+ /**
19
+ * Apply a partial update to a destination. Requires an active Enterprise plan.
20
+ * Returns 409 when the destination was changed concurrently, because the merged
21
+ * configuration this request validated is no longer the one that would be stored;
22
+ * retry against fresh state. Pausing prevents new delivery attempts, but an S3
23
+ * upload already in progress may complete after the response.
24
+ */
25
+ update(id: string, body: ExportDestinationUpdateParams, options?: RequestOptions): APIPromise<AuditLogExportDestination>;
26
+ /**
27
+ * List audit log export destinations for the organization with pagination support.
28
+ */
29
+ list(query?: ExportDestinationListParams | null | undefined, options?: RequestOptions): PagePromise<AuditLogExportDestinationsOffsetPagination, AuditLogExportDestination>;
30
+ /**
31
+ * Soft delete the destination and prevent new delivery attempts. An S3 upload
32
+ * already in progress may complete after the response.
33
+ */
34
+ delete(id: string, options?: RequestOptions): APIPromise<void>;
35
+ /**
36
+ * Verify the destination is writable by assuming the configured role and uploading
37
+ * a temporary probe object with the same request metadata as a real delivery.
38
+ * Requires an active Enterprise plan.
39
+ */
40
+ test(id: string, options?: RequestOptions): APIPromise<AuditLogExportDestinationTestResult>;
41
+ }
42
+ export type AuditLogExportDestinationsOffsetPagination = OffsetPagination<AuditLogExportDestination>;
43
+ /**
44
+ * An organization-scoped audit log export destination.
45
+ *
46
+ * Delivery is at-least-once for rows visible when their window is committed: a
47
+ * delivery that is retried rewrites the same object, and the same `event_id` can
48
+ * appear in more than one object, so consumers must deduplicate on `event_id`.
49
+ * Each event-time window is held for ten minutes before it commits; a row that
50
+ * becomes visible after its window is committed may not be delivered.
51
+ *
52
+ * Objects are written as
53
+ * `<prefix>/destination_id=<destination>/org_id=<org>/date=<YYYY-MM-DD>/hour=<HH>/<window>-<chunk>.jsonl.gz`,
54
+ * where `date` and `hour` are the UTC calendar hour that fully contains every row
55
+ * in the object, so the layout is safe to register as a Hive-partitioned table.
56
+ * The object name is derived from the rows it holds, so a retried delivery
57
+ * rewrites its own object.
58
+ */
59
+ export interface AuditLogExportDestination {
60
+ id: string;
61
+ bucket: string;
62
+ consecutive_failures: number;
63
+ created_at: string;
64
+ external_id: string;
65
+ format: 'jsonl.gz';
66
+ /**
67
+ * The Kernel role that assumes `role_arn` in your account to deliver logs. Allow
68
+ * this role as the principal in your role's trust policy, and require
69
+ * `external_id` as the `sts:ExternalId` condition.
70
+ *
71
+ * Recreating a destination issues a new `external_id`, which the trust policy has
72
+ * to be updated to match.
73
+ */
74
+ kernel_role_arn: string;
75
+ prefix: string;
76
+ region: string;
77
+ role_arn: string;
78
+ /**
79
+ * Pausing prevents new delivery attempts. An S3 upload already in progress may
80
+ * complete after the pause response; its rows can appear again after the
81
+ * destination is resumed.
82
+ */
83
+ status: 'active' | 'paused';
84
+ type: 's3';
85
+ updated_at: string;
86
+ kms_key_id?: string;
87
+ /**
88
+ * Sanitized description of the most recent delivery failure.
89
+ */
90
+ last_error?: string;
91
+ last_error_at?: string;
92
+ /**
93
+ * Opaque, versioned checkpoint for forward-only continuous export. This value is
94
+ * not compatible with audit-log list page tokens.
95
+ *
96
+ * Delivery starts at the moment the destination is activated, so events recorded
97
+ * before that are not delivered. Pausing stops delivery and resuming starts again
98
+ * from the time of the resume: events recorded while a destination was paused are
99
+ * never exported, and pausing is not a way to defer delivery.
100
+ */
101
+ last_exported_cursor?: string;
102
+ last_success_at?: string;
103
+ next_attempt_at?: string;
104
+ }
105
+ export interface AuditLogExportDestinationTestResult {
106
+ stage: 'assume_role' | 'put_object' | 'complete';
107
+ success: boolean;
108
+ error?: AuditLogExportDestinationTestResult.Error;
109
+ }
110
+ export declare namespace AuditLogExportDestinationTestResult {
111
+ interface Error {
112
+ code: 'assume_role_failed' | 'put_object_failed';
113
+ message: string;
114
+ }
115
+ }
116
+ export interface CreateAuditLogExportDestinationRequest {
117
+ bucket: string;
118
+ format: 'jsonl.gz';
119
+ prefix: string;
120
+ region: string;
121
+ role_arn: string;
122
+ type: 's3';
123
+ kms_key_id?: string;
124
+ }
125
+ export interface UpdateAuditLogExportDestinationRequest {
126
+ bucket?: string;
127
+ /**
128
+ * KMS key ID, alias, or ARN. Set to an empty string to remove the configured KMS
129
+ * key; omit or send null to leave unchanged.
130
+ */
131
+ kms_key_id?: string;
132
+ prefix?: string;
133
+ region?: string;
134
+ role_arn?: string;
135
+ status?: 'active' | 'paused';
136
+ }
137
+ export interface ExportDestinationCreateParams {
138
+ bucket: string;
139
+ format: 'jsonl.gz';
140
+ prefix: string;
141
+ region: string;
142
+ role_arn: string;
143
+ type: 's3';
144
+ kms_key_id?: string;
145
+ }
146
+ export interface ExportDestinationUpdateParams {
147
+ bucket?: string;
148
+ /**
149
+ * KMS key ID, alias, or ARN. Set to an empty string to remove the configured KMS
150
+ * key; omit or send null to leave unchanged.
151
+ */
152
+ kms_key_id?: string;
153
+ prefix?: string;
154
+ region?: string;
155
+ role_arn?: string;
156
+ status?: 'active' | 'paused';
157
+ }
158
+ export interface ExportDestinationListParams extends OffsetPaginationParams {
159
+ }
160
+ export declare namespace ExportDestinations {
161
+ export { type AuditLogExportDestination as AuditLogExportDestination, type AuditLogExportDestinationTestResult as AuditLogExportDestinationTestResult, type CreateAuditLogExportDestinationRequest as CreateAuditLogExportDestinationRequest, type UpdateAuditLogExportDestinationRequest as UpdateAuditLogExportDestinationRequest, type AuditLogExportDestinationsOffsetPagination as AuditLogExportDestinationsOffsetPagination, type ExportDestinationCreateParams as ExportDestinationCreateParams, type ExportDestinationUpdateParams as ExportDestinationUpdateParams, type ExportDestinationListParams as ExportDestinationListParams, };
162
+ }
163
+ //# sourceMappingURL=export-destinations.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-destinations.d.mts","sourceRoot":"","sources":["../../src/resources/audit-logs/export-destinations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE,kCAA8B;A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AM,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC9B;AAED,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,MAAM,CAAC;IAEf,MAAM,EAAE,UAAU,CAAC;IAEnB,MAAM,EAAE,MAAM,CAAC;IAEf,MAAM,EAAE,MAAM,CAAC;IAEf,QAAQ,EAAE,MAAM,CAAC;IAEjB,IAAI,EAAE,IAAI,CAAC;IAEX,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,6BAA6B;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC9B;AAED,MAAM,WAAW,2BAA4B,SAAQ,sBAAsB;CAAG;AAE9E,MAAM,CAAC,OAAO,WAAW,kBAAkB,CAAC;IAC1C,OAAO,EACL,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,sCAAsC,IAAI,sCAAsC,EACrF,KAAK,sCAAsC,IAAI,sCAAsC,EACrF,KAAK,0CAA0C,IAAI,0CAA0C,EAC7F,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,2BAA2B,IAAI,2BAA2B,GAChE,CAAC;CACH"}
@@ -0,0 +1,163 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import { APIPromise } from "../../core/api-promise.js";
3
+ import { OffsetPagination, type OffsetPaginationParams, PagePromise } from "../../core/pagination.js";
4
+ import { RequestOptions } from "../../internal/request-options.js";
5
+ /**
6
+ * Read audit log records for the authenticated organization.
7
+ */
8
+ export declare class ExportDestinations extends APIResource {
9
+ /**
10
+ * Create a paused destination. Activate it with a status update once the
11
+ * destination test passes. Requires an active Enterprise plan.
12
+ */
13
+ create(body: ExportDestinationCreateParams, options?: RequestOptions): APIPromise<AuditLogExportDestination>;
14
+ /**
15
+ * Retrieve details for a single audit log export destination by its ID.
16
+ */
17
+ retrieve(id: string, options?: RequestOptions): APIPromise<AuditLogExportDestination>;
18
+ /**
19
+ * Apply a partial update to a destination. Requires an active Enterprise plan.
20
+ * Returns 409 when the destination was changed concurrently, because the merged
21
+ * configuration this request validated is no longer the one that would be stored;
22
+ * retry against fresh state. Pausing prevents new delivery attempts, but an S3
23
+ * upload already in progress may complete after the response.
24
+ */
25
+ update(id: string, body: ExportDestinationUpdateParams, options?: RequestOptions): APIPromise<AuditLogExportDestination>;
26
+ /**
27
+ * List audit log export destinations for the organization with pagination support.
28
+ */
29
+ list(query?: ExportDestinationListParams | null | undefined, options?: RequestOptions): PagePromise<AuditLogExportDestinationsOffsetPagination, AuditLogExportDestination>;
30
+ /**
31
+ * Soft delete the destination and prevent new delivery attempts. An S3 upload
32
+ * already in progress may complete after the response.
33
+ */
34
+ delete(id: string, options?: RequestOptions): APIPromise<void>;
35
+ /**
36
+ * Verify the destination is writable by assuming the configured role and uploading
37
+ * a temporary probe object with the same request metadata as a real delivery.
38
+ * Requires an active Enterprise plan.
39
+ */
40
+ test(id: string, options?: RequestOptions): APIPromise<AuditLogExportDestinationTestResult>;
41
+ }
42
+ export type AuditLogExportDestinationsOffsetPagination = OffsetPagination<AuditLogExportDestination>;
43
+ /**
44
+ * An organization-scoped audit log export destination.
45
+ *
46
+ * Delivery is at-least-once for rows visible when their window is committed: a
47
+ * delivery that is retried rewrites the same object, and the same `event_id` can
48
+ * appear in more than one object, so consumers must deduplicate on `event_id`.
49
+ * Each event-time window is held for ten minutes before it commits; a row that
50
+ * becomes visible after its window is committed may not be delivered.
51
+ *
52
+ * Objects are written as
53
+ * `<prefix>/destination_id=<destination>/org_id=<org>/date=<YYYY-MM-DD>/hour=<HH>/<window>-<chunk>.jsonl.gz`,
54
+ * where `date` and `hour` are the UTC calendar hour that fully contains every row
55
+ * in the object, so the layout is safe to register as a Hive-partitioned table.
56
+ * The object name is derived from the rows it holds, so a retried delivery
57
+ * rewrites its own object.
58
+ */
59
+ export interface AuditLogExportDestination {
60
+ id: string;
61
+ bucket: string;
62
+ consecutive_failures: number;
63
+ created_at: string;
64
+ external_id: string;
65
+ format: 'jsonl.gz';
66
+ /**
67
+ * The Kernel role that assumes `role_arn` in your account to deliver logs. Allow
68
+ * this role as the principal in your role's trust policy, and require
69
+ * `external_id` as the `sts:ExternalId` condition.
70
+ *
71
+ * Recreating a destination issues a new `external_id`, which the trust policy has
72
+ * to be updated to match.
73
+ */
74
+ kernel_role_arn: string;
75
+ prefix: string;
76
+ region: string;
77
+ role_arn: string;
78
+ /**
79
+ * Pausing prevents new delivery attempts. An S3 upload already in progress may
80
+ * complete after the pause response; its rows can appear again after the
81
+ * destination is resumed.
82
+ */
83
+ status: 'active' | 'paused';
84
+ type: 's3';
85
+ updated_at: string;
86
+ kms_key_id?: string;
87
+ /**
88
+ * Sanitized description of the most recent delivery failure.
89
+ */
90
+ last_error?: string;
91
+ last_error_at?: string;
92
+ /**
93
+ * Opaque, versioned checkpoint for forward-only continuous export. This value is
94
+ * not compatible with audit-log list page tokens.
95
+ *
96
+ * Delivery starts at the moment the destination is activated, so events recorded
97
+ * before that are not delivered. Pausing stops delivery and resuming starts again
98
+ * from the time of the resume: events recorded while a destination was paused are
99
+ * never exported, and pausing is not a way to defer delivery.
100
+ */
101
+ last_exported_cursor?: string;
102
+ last_success_at?: string;
103
+ next_attempt_at?: string;
104
+ }
105
+ export interface AuditLogExportDestinationTestResult {
106
+ stage: 'assume_role' | 'put_object' | 'complete';
107
+ success: boolean;
108
+ error?: AuditLogExportDestinationTestResult.Error;
109
+ }
110
+ export declare namespace AuditLogExportDestinationTestResult {
111
+ interface Error {
112
+ code: 'assume_role_failed' | 'put_object_failed';
113
+ message: string;
114
+ }
115
+ }
116
+ export interface CreateAuditLogExportDestinationRequest {
117
+ bucket: string;
118
+ format: 'jsonl.gz';
119
+ prefix: string;
120
+ region: string;
121
+ role_arn: string;
122
+ type: 's3';
123
+ kms_key_id?: string;
124
+ }
125
+ export interface UpdateAuditLogExportDestinationRequest {
126
+ bucket?: string;
127
+ /**
128
+ * KMS key ID, alias, or ARN. Set to an empty string to remove the configured KMS
129
+ * key; omit or send null to leave unchanged.
130
+ */
131
+ kms_key_id?: string;
132
+ prefix?: string;
133
+ region?: string;
134
+ role_arn?: string;
135
+ status?: 'active' | 'paused';
136
+ }
137
+ export interface ExportDestinationCreateParams {
138
+ bucket: string;
139
+ format: 'jsonl.gz';
140
+ prefix: string;
141
+ region: string;
142
+ role_arn: string;
143
+ type: 's3';
144
+ kms_key_id?: string;
145
+ }
146
+ export interface ExportDestinationUpdateParams {
147
+ bucket?: string;
148
+ /**
149
+ * KMS key ID, alias, or ARN. Set to an empty string to remove the configured KMS
150
+ * key; omit or send null to leave unchanged.
151
+ */
152
+ kms_key_id?: string;
153
+ prefix?: string;
154
+ region?: string;
155
+ role_arn?: string;
156
+ status?: 'active' | 'paused';
157
+ }
158
+ export interface ExportDestinationListParams extends OffsetPaginationParams {
159
+ }
160
+ export declare namespace ExportDestinations {
161
+ export { type AuditLogExportDestination as AuditLogExportDestination, type AuditLogExportDestinationTestResult as AuditLogExportDestinationTestResult, type CreateAuditLogExportDestinationRequest as CreateAuditLogExportDestinationRequest, type UpdateAuditLogExportDestinationRequest as UpdateAuditLogExportDestinationRequest, type AuditLogExportDestinationsOffsetPagination as AuditLogExportDestinationsOffsetPagination, type ExportDestinationCreateParams as ExportDestinationCreateParams, type ExportDestinationUpdateParams as ExportDestinationUpdateParams, type ExportDestinationListParams as ExportDestinationListParams, };
162
+ }
163
+ //# sourceMappingURL=export-destinations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export-destinations.d.ts","sourceRoot":"","sources":["../../src/resources/audit-logs/export-destinations.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