@distilled.cloud/cloudflare 1.0.0-rc.6 → 1.0.0-rc.8

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.
@@ -1328,10 +1328,123 @@ export const ListAuditLogsRequest = /*@__PURE__*/ S.suspend(() =>
1328
1328
  identifier: "ListAuditLogsRequest",
1329
1329
  }) as any as S.Schema<ListAuditLogsRequest>;
1330
1330
 
1331
- /** Raw response payload (operation does not use the standard v4 result envelope). */
1332
- export interface ListAuditLogsResponse {}
1331
+ export interface AuditLogsListResultItemAction {
1332
+ /** A boolean that indicates if the action attempted was successful. */
1333
+ result?: boolean | null;
1334
+ /** A short string that describes the action that was performed. */
1335
+ type?: string | null;
1336
+ }
1337
+ export const AuditLogsListResultItemAction = /*@__PURE__*/ S.suspend(() =>
1338
+ S.Struct({
1339
+ result: S.optional(S.NullOr(S.Boolean)),
1340
+ type: S.optional(S.NullOr(S.String)),
1341
+ }),
1342
+ ).annotate({
1343
+ identifier: "AuditLogsListResultItemAction",
1344
+ }) as any as S.Schema<AuditLogsListResultItemAction>;
1345
+
1346
+ export type AuditLogsListResultItemActorType = "user" | "admin" | "Cloudflare";
1347
+ export const AuditLogsListResultItemActorType = /*@__PURE__*/ S.String;
1348
+
1349
+ export interface AuditLogsListResultItemActor {
1350
+ /** The ID of the actor that performed the action. If a user performed the action, this will be their User ID. */
1351
+ id?: string | null;
1352
+ /** The email of the user that performed the action. */
1353
+ email?: string | null;
1354
+ /** The IP address of the request that performed the action. */
1355
+ ip?: string | null;
1356
+ /** The type of actor, whether a User, Cloudflare Admin, or an Automated System. */
1357
+ type?: AuditLogsListResultItemActorType | null;
1358
+ }
1359
+ export const AuditLogsListResultItemActor = /*@__PURE__*/ S.suspend(() =>
1360
+ S.Struct({
1361
+ id: S.optional(S.NullOr(S.String)),
1362
+ email: S.optional(S.NullOr(S.String)),
1363
+ ip: S.optional(S.NullOr(S.String)),
1364
+ type: S.optional(S.NullOr(AuditLogsListResultItemActorType)),
1365
+ }),
1366
+ ).annotate({
1367
+ identifier: "AuditLogsListResultItemActor",
1368
+ }) as any as S.Schema<AuditLogsListResultItemActor>;
1369
+
1370
+ export interface AuditLogsListResultItemOwner {
1371
+ /** Identifier */
1372
+ id?: string | null;
1373
+ }
1374
+ export const AuditLogsListResultItemOwner = /*@__PURE__*/ S.suspend(() =>
1375
+ S.Struct({
1376
+ id: S.optional(S.NullOr(S.String)),
1377
+ }),
1378
+ ).annotate({
1379
+ identifier: "AuditLogsListResultItemOwner",
1380
+ }) as any as S.Schema<AuditLogsListResultItemOwner>;
1381
+
1382
+ export interface AuditLogsListResultItemResource {
1383
+ /** An identifier for the resource that was affected by the action. */
1384
+ id?: string | null;
1385
+ /** A short string that describes the resource that was affected by the action. */
1386
+ type?: string | null;
1387
+ }
1388
+ export const AuditLogsListResultItemResource = /*@__PURE__*/ S.suspend(() =>
1389
+ S.Struct({
1390
+ id: S.optional(S.NullOr(S.String)),
1391
+ type: S.optional(S.NullOr(S.String)),
1392
+ }),
1393
+ ).annotate({
1394
+ identifier: "AuditLogsListResultItemResource",
1395
+ }) as any as S.Schema<AuditLogsListResultItemResource>;
1396
+
1397
+ export interface AuditLogsListResultItem {
1398
+ /** A string that uniquely identifies the audit log. */
1399
+ id?: string | null;
1400
+ action?: AuditLogsListResultItemAction | null;
1401
+ actor?: AuditLogsListResultItemActor | null;
1402
+ /** The source of the event. */
1403
+ interface?: string | null;
1404
+ /** An object which can lend more context to the action being logged. This is a flexible value and varies between different actions. */
1405
+ metadata?: unknown | null;
1406
+ /** The new value of the resource that was modified. */
1407
+ newValue?: string | null;
1408
+ /** The value of the resource before it was modified. */
1409
+ oldValue?: string | null;
1410
+ owner?: AuditLogsListResultItemOwner | null;
1411
+ resource?: AuditLogsListResultItemResource | null;
1412
+ /** A UTC RFC3339 timestamp that specifies when the action being logged occured. */
1413
+ when?: string | null;
1414
+ }
1415
+ export const AuditLogsListResultItem = /*@__PURE__*/ S.suspend(() =>
1416
+ S.Struct({
1417
+ id: S.optional(S.NullOr(S.String)),
1418
+ action: S.optional(S.NullOr(AuditLogsListResultItemAction)),
1419
+ actor: S.optional(S.NullOr(AuditLogsListResultItemActor)),
1420
+ interface: S.optional(S.NullOr(S.String)),
1421
+ metadata: S.optional(S.NullOr(S.Unknown)),
1422
+ newValue: S.optional(S.NullOr(S.String)),
1423
+ oldValue: S.optional(S.NullOr(S.String)),
1424
+ owner: S.optional(S.NullOr(AuditLogsListResultItemOwner)),
1425
+ resource: S.optional(S.NullOr(AuditLogsListResultItemResource)),
1426
+ when: S.optional(S.NullOr(S.String)),
1427
+ }),
1428
+ ).annotate({
1429
+ identifier: "AuditLogsListResultItem",
1430
+ }) as any as S.Schema<AuditLogsListResultItem>;
1431
+
1432
+ export type AuditLogsListResultList = Array<AuditLogsListResultItem>;
1433
+ export const AuditLogsListResultList = /*@__PURE__*/ S.Array(
1434
+ AuditLogsListResultItem,
1435
+ ) as any as S.Schema<AuditLogsListResultList>;
1436
+
1437
+ export interface ListAuditLogsResponse {
1438
+ /** The unwrapped `result` payload of the v4 response envelope. */
1439
+ result: AuditLogsListResultList;
1440
+ /** Pagination info from the envelope's `result_info`. */
1441
+ resultInfo?: ResultInfo | null;
1442
+ }
1333
1443
  export const ListAuditLogsResponse = /*@__PURE__*/ S.suspend(() =>
1334
- S.Struct({}).pipe(T.KeyDictionary(KEY_DICTIONARY)),
1444
+ S.Struct({
1445
+ result: AuditLogsListResultList.pipe(T.EnvelopePayload()),
1446
+ resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())),
1447
+ }).pipe(T.KeyDictionary(KEY_DICTIONARY)),
1335
1448
  ).annotate({
1336
1449
  identifier: "ListAuditLogsResponse",
1337
1450
  }) as any as S.Schema<ListAuditLogsResponse>;
@@ -2913,18 +3026,29 @@ export const getUser: API.OperationMethod<
2913
3026
 
2914
3027
  export type ListAuditLogsError = CloudflareOpError;
2915
3028
  /** Gets a list of audit logs for a user account. Can be filtered by who made the change, on which zone, and the timeframe of the change. */
2916
- export const listAuditLogs: API.OperationMethod<
3029
+ export const listAuditLogs: API.PaginatedOperationMethod<
2917
3030
  ListAuditLogsRequest,
2918
3031
  ListAuditLogsResponse,
2919
3032
  ListAuditLogsError,
2920
- CloudflareOpContext
2921
- > = /*@__PURE__*/ API.make(() => ({
2922
- input: ListAuditLogsRequest,
2923
- output: ListAuditLogsResponse,
2924
- errors: [CloudflareRateLimited, CloudflareError],
2925
- protocol: CloudflareProtocol,
2926
- retry: Retry.Retry,
2927
- }));
3033
+ CloudflareOpContext,
3034
+ AuditLogsListResultItem
3035
+ > = /*@__PURE__*/ API.makePaginated(
3036
+ () => ({
3037
+ input: ListAuditLogsRequest,
3038
+ output: ListAuditLogsResponse,
3039
+ errors: [CloudflareRateLimited, CloudflareError],
3040
+ protocol: CloudflarePaginatedProtocol,
3041
+ retry: Retry.Retry,
3042
+ pagination: {
3043
+ mode: "page",
3044
+ inputToken: "page",
3045
+ outputToken: "resultInfo.page",
3046
+ items: "result",
3047
+ pageSize: "perPage",
3048
+ } as const,
3049
+ }),
3050
+ cloudflarePaginate,
3051
+ ) as any;
2928
3052
 
2929
3053
  export type ListBillingHistoriesError = CloudflareOpError;
2930
3054
  /** Accesses your billing history object. */