@distilled.cloud/cloudflare 0.22.3 → 0.22.4

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 (101) hide show
  1. package/lib/services/abuse-reports.d.ts +39 -11
  2. package/lib/services/abuse-reports.d.ts.map +1 -1
  3. package/lib/services/abuse-reports.js +89 -11
  4. package/lib/services/abuse-reports.js.map +1 -1
  5. package/lib/services/accounts.d.ts +21 -1
  6. package/lib/services/accounts.d.ts.map +1 -1
  7. package/lib/services/accounts.js +33 -1
  8. package/lib/services/accounts.js.map +1 -1
  9. package/lib/services/ai.d.ts +97 -1
  10. package/lib/services/ai.d.ts.map +1 -1
  11. package/lib/services/ai.js +119 -2
  12. package/lib/services/ai.js.map +1 -1
  13. package/lib/services/bot-management.d.ts +16 -0
  14. package/lib/services/bot-management.d.ts.map +1 -1
  15. package/lib/services/bot-management.js +22 -0
  16. package/lib/services/bot-management.js.map +1 -1
  17. package/lib/services/browser-rendering.d.ts +25 -9
  18. package/lib/services/browser-rendering.d.ts.map +1 -1
  19. package/lib/services/browser-rendering.js +18 -9
  20. package/lib/services/browser-rendering.js.map +1 -1
  21. package/lib/services/cache.d.ts +11 -0
  22. package/lib/services/cache.d.ts.map +1 -1
  23. package/lib/services/cache.js +17 -1
  24. package/lib/services/cache.js.map +1 -1
  25. package/lib/services/connectivity.d.ts +18 -32
  26. package/lib/services/connectivity.d.ts.map +1 -1
  27. package/lib/services/connectivity.js +56 -66
  28. package/lib/services/connectivity.js.map +1 -1
  29. package/lib/services/d1.d.ts +18 -4
  30. package/lib/services/d1.d.ts.map +1 -1
  31. package/lib/services/d1.js +23 -5
  32. package/lib/services/d1.js.map +1 -1
  33. package/lib/services/dns.d.ts +129 -3
  34. package/lib/services/dns.d.ts.map +1 -1
  35. package/lib/services/dns.js +330 -6
  36. package/lib/services/dns.js.map +1 -1
  37. package/lib/services/magic-transit.d.ts +7 -1
  38. package/lib/services/magic-transit.d.ts.map +1 -1
  39. package/lib/services/magic-transit.js +7 -1
  40. package/lib/services/magic-transit.js.map +1 -1
  41. package/lib/services/network-interconnects.d.ts +5 -1
  42. package/lib/services/network-interconnects.d.ts.map +1 -1
  43. package/lib/services/network-interconnects.js +21 -1
  44. package/lib/services/network-interconnects.js.map +1 -1
  45. package/lib/services/queues.d.ts +6 -4
  46. package/lib/services/queues.d.ts.map +1 -1
  47. package/lib/services/queues.js +8 -4
  48. package/lib/services/queues.js.map +1 -1
  49. package/lib/services/r2.d.ts +11 -4
  50. package/lib/services/r2.d.ts.map +1 -1
  51. package/lib/services/r2.js +13 -4
  52. package/lib/services/r2.js.map +1 -1
  53. package/lib/services/resource-tagging.d.ts +4 -2
  54. package/lib/services/resource-tagging.d.ts.map +1 -1
  55. package/lib/services/resource-tagging.js +4 -1
  56. package/lib/services/resource-tagging.js.map +1 -1
  57. package/lib/services/rulesets.d.ts +510 -6
  58. package/lib/services/rulesets.d.ts.map +1 -1
  59. package/lib/services/rulesets.js +1298 -36
  60. package/lib/services/rulesets.js.map +1 -1
  61. package/lib/services/spectrum.d.ts +4 -8
  62. package/lib/services/spectrum.d.ts.map +1 -1
  63. package/lib/services/spectrum.js +12 -34
  64. package/lib/services/spectrum.js.map +1 -1
  65. package/lib/services/workers-for-platforms.d.ts +12 -2
  66. package/lib/services/workers-for-platforms.d.ts.map +1 -1
  67. package/lib/services/workers-for-platforms.js +35 -3
  68. package/lib/services/workers-for-platforms.js.map +1 -1
  69. package/lib/services/workers.d.ts +12 -2
  70. package/lib/services/workers.d.ts.map +1 -1
  71. package/lib/services/workers.js +35 -3
  72. package/lib/services/workers.js.map +1 -1
  73. package/lib/services/zero-trust.d.ts +1463 -557
  74. package/lib/services/zero-trust.d.ts.map +1 -1
  75. package/lib/services/zero-trust.js +1654 -93
  76. package/lib/services/zero-trust.js.map +1 -1
  77. package/lib/services/zones.d.ts +2 -0
  78. package/lib/services/zones.d.ts.map +1 -1
  79. package/lib/services/zones.js +1 -0
  80. package/lib/services/zones.js.map +1 -1
  81. package/package.json +2 -2
  82. package/src/services/abuse-reports.ts +173 -22
  83. package/src/services/accounts.ts +66 -2
  84. package/src/services/ai.ts +235 -2
  85. package/src/services/bot-management.ts +48 -0
  86. package/src/services/browser-rendering.ts +43 -18
  87. package/src/services/cache.ts +31 -0
  88. package/src/services/connectivity.ts +78 -70
  89. package/src/services/d1.ts +43 -8
  90. package/src/services/dns.ts +549 -12
  91. package/src/services/magic-transit.ts +14 -2
  92. package/src/services/network-interconnects.ts +41 -2
  93. package/src/services/queues.ts +16 -8
  94. package/src/services/r2.ts +30 -7
  95. package/src/services/resource-tagging.ts +8 -2
  96. package/src/services/rulesets.ts +3283 -963
  97. package/src/services/spectrum.ts +36 -52
  98. package/src/services/workers-for-platforms.ts +63 -4
  99. package/src/services/workers.ts +63 -4
  100. package/src/services/zero-trust.ts +3071 -478
  101. package/src/services/zones.ts +3 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@distilled.cloud/cloudflare",
3
- "version": "0.22.3",
3
+ "version": "0.22.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/alchemy-run/distilled",
@@ -63,7 +63,7 @@
63
63
  "specs:update": "git -C specs/cloudflare-typescript fetch && git -C specs/cloudflare-typescript checkout main && git -C specs/cloudflare-typescript pull"
64
64
  },
65
65
  "dependencies": {
66
- "@distilled.cloud/core": "0.22.3"
66
+ "@distilled.cloud/core": "0.22.4"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@effect/platform-node": ">=4.0.0-beta.66 || >=4.0.0",
@@ -465,33 +465,42 @@ export interface CreateAbuseReportRequest {
465
465
  /** Path param: Cloudflare Account ID */
466
466
  accountId: string;
467
467
  /** Body param: The report type for submitted reports. */
468
- act: "abuse_dmca";
468
+ act:
469
+ | "abuse_dmca"
470
+ | "abuse_trademark"
471
+ | "abuse_general"
472
+ | "abuse_phishing"
473
+ | "abuse_children"
474
+ | "abuse_threat"
475
+ | "abuse_registrar_whois"
476
+ | "abuse_ncsei"
477
+ | (string & {});
469
478
  /** Body param: Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). */
470
- address1: string;
479
+ address1?: string;
471
480
  /** Body param: The name of the copyright holder. Text not exceeding 60 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). */
472
- agentName: string;
481
+ agentName?: string;
473
482
  /** Body param: Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports */
474
- agree: "1";
483
+ agree?: "1";
475
484
  /** Body param: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). */
476
- city: string;
485
+ city?: string;
477
486
  /** Body param: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). */
478
- country: string;
487
+ country?: string;
479
488
  /** Body param: A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). */
480
489
  email: string;
481
490
  /** Body param: Should match the value provided in `email` */
482
491
  email2: string;
483
492
  /** Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. */
484
- hostNotification: "send";
493
+ hostNotification?: "send" | "send-anon" | (string & {});
485
494
  /** Body param: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). */
486
495
  name: string;
487
496
  /** Body param: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). */
488
- originalWork: string;
497
+ originalWork?: string;
489
498
  /** Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. */
490
- ownerNotification: "send";
499
+ ownerNotification: "send" | "send-anon" | "none" | (string & {});
491
500
  /** Body param: Required for DMCA reports, should be same as Name. An affirmation that all information in the report is true and accurate while agreeing to the policies of Cloudflare's abuse reports */
492
- signature: string;
501
+ signature?: string;
493
502
  /** Body param: Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). */
494
- state: string;
503
+ state?: string;
495
504
  /** Body param: A list of valid URLs separated by ‘\n’ (new line character). The list of the URLs should not exceed 250 URLs. All URLs should have the same hostname. Each URL should be unique. This field */
496
505
  urls: string;
497
506
  /** Body param: Any additional comments about the infringement not exceeding 2000 characters */
@@ -506,26 +515,94 @@ export interface CreateAbuseReportRequest {
506
515
  tele?: string;
507
516
  /** Body param: Text not exceeding 255 characters */
508
517
  title?: string;
518
+ /** Body param: A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters. */
519
+ justification?: string;
520
+ /** Body param: Text not exceeding 1000 characters */
521
+ trademarkNumber?: string;
522
+ /** Body param: Text not exceeding 1000 characters */
523
+ trademarkOffice?: string;
524
+ /** Body param: Text not exceeding 1000 characters */
525
+ trademarkSymbol?: string;
526
+ /** Body param: A list of IP addresses separated by ‘\n’ (new line character). The list of destination IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be unique. */
527
+ destinationIps?: string;
528
+ /** Body param: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total size of the field should not exceed 2000 characters. Each individual port/protocol should not exceed 100 charac */
529
+ portsProtocols?: string;
530
+ /** Body param: A list of IP addresses separated by ‘\n’ (new line character). The list of source IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be unique. */
531
+ sourceIps?: string;
532
+ /** Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. */
533
+ ncmecNotification?: "send" | "send-anon" | (string & {});
534
+ /** Body param: RDP-mandated fields for registrar WHOIS data disclosure requests. */
535
+ regWhoRequest?: {
536
+ regWhoGoodFaithAffirmation: boolean;
537
+ regWhoLawfulProcessingAgreement: boolean;
538
+ regWhoLegalBasis: string;
539
+ regWhoRequestType: "disclosure" | "invalid_whois" | (string & {});
540
+ regWhoRequestedDataElements: (
541
+ | "registrant_name"
542
+ | "registrant_organization"
543
+ | "registrant_email"
544
+ | "registrant_phone"
545
+ | "registrant_address"
546
+ | "registrant_address_country"
547
+ | "registrant_address_postal_code"
548
+ | "admin_name"
549
+ | "admin_organization"
550
+ | "admin_email"
551
+ | "admin_phone"
552
+ | "admin_address"
553
+ | "tech_name"
554
+ | "tech_organization"
555
+ | "tech_email"
556
+ | "tech_phone"
557
+ | "tech_address"
558
+ | (string & {})
559
+ )[];
560
+ regWhoAuthorizationStatement?: string;
561
+ regWhoRequestorType?:
562
+ | "government"
563
+ | "corporation"
564
+ | "individual"
565
+ | (string & {});
566
+ };
567
+ /** Body param: If the submitter is the target of NCSEI in the URLs of the abuse report. */
568
+ ncseiSubjectRepresentation?: boolean;
509
569
  }
510
570
 
511
571
  export const CreateAbuseReportRequest =
512
572
  /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
513
573
  reportParam: Schema.String.pipe(T.HttpPath("reportParam")),
514
574
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
515
- act: Schema.Literal("abuse_dmca"),
516
- address1: Schema.String,
517
- agentName: Schema.String,
518
- agree: Schema.Literal("1"),
519
- city: Schema.String,
520
- country: Schema.String,
575
+ act: Schema.Union([
576
+ Schema.Literals([
577
+ "abuse_dmca",
578
+ "abuse_trademark",
579
+ "abuse_general",
580
+ "abuse_phishing",
581
+ "abuse_children",
582
+ "abuse_threat",
583
+ "abuse_registrar_whois",
584
+ "abuse_ncsei",
585
+ ]),
586
+ Schema.String,
587
+ ]),
588
+ address1: Schema.optional(Schema.String),
589
+ agentName: Schema.optional(Schema.String),
590
+ agree: Schema.optional(Schema.Literal("1")),
591
+ city: Schema.optional(Schema.String),
592
+ country: Schema.optional(Schema.String),
521
593
  email: Schema.String,
522
594
  email2: Schema.String,
523
- hostNotification: Schema.Literal("send"),
595
+ hostNotification: Schema.optional(
596
+ Schema.Union([Schema.Literals(["send", "send-anon"]), Schema.String]),
597
+ ),
524
598
  name: Schema.String,
525
- originalWork: Schema.String,
526
- ownerNotification: Schema.Literal("send"),
527
- signature: Schema.String,
528
- state: Schema.String,
599
+ originalWork: Schema.optional(Schema.String),
600
+ ownerNotification: Schema.Union([
601
+ Schema.Literals(["send", "send-anon", "none"]),
602
+ Schema.String,
603
+ ]),
604
+ signature: Schema.optional(Schema.String),
605
+ state: Schema.optional(Schema.String),
529
606
  urls: Schema.String,
530
607
  comments: Schema.optional(Schema.String),
531
608
  company: Schema.optional(Schema.String),
@@ -533,6 +610,70 @@ export const CreateAbuseReportRequest =
533
610
  reportedUserAgent: Schema.optional(Schema.String),
534
611
  tele: Schema.optional(Schema.String),
535
612
  title: Schema.optional(Schema.String),
613
+ justification: Schema.optional(Schema.String),
614
+ trademarkNumber: Schema.optional(Schema.String),
615
+ trademarkOffice: Schema.optional(Schema.String),
616
+ trademarkSymbol: Schema.optional(Schema.String),
617
+ destinationIps: Schema.optional(Schema.String),
618
+ portsProtocols: Schema.optional(Schema.String),
619
+ sourceIps: Schema.optional(Schema.String),
620
+ ncmecNotification: Schema.optional(
621
+ Schema.Union([Schema.Literals(["send", "send-anon"]), Schema.String]),
622
+ ),
623
+ regWhoRequest: Schema.optional(
624
+ Schema.Struct({
625
+ regWhoGoodFaithAffirmation: Schema.Boolean,
626
+ regWhoLawfulProcessingAgreement: Schema.Boolean,
627
+ regWhoLegalBasis: Schema.String,
628
+ regWhoRequestType: Schema.Union([
629
+ Schema.Literals(["disclosure", "invalid_whois"]),
630
+ Schema.String,
631
+ ]),
632
+ regWhoRequestedDataElements: Schema.Array(
633
+ Schema.Union([
634
+ Schema.Literals([
635
+ "registrant_name",
636
+ "registrant_organization",
637
+ "registrant_email",
638
+ "registrant_phone",
639
+ "registrant_address",
640
+ "registrant_address_country",
641
+ "registrant_address_postal_code",
642
+ "admin_name",
643
+ "admin_organization",
644
+ "admin_email",
645
+ "admin_phone",
646
+ "admin_address",
647
+ "tech_name",
648
+ "tech_organization",
649
+ "tech_email",
650
+ "tech_phone",
651
+ "tech_address",
652
+ ]),
653
+ Schema.String,
654
+ ]),
655
+ ),
656
+ regWhoAuthorizationStatement: Schema.optional(Schema.String),
657
+ regWhoRequestorType: Schema.optional(
658
+ Schema.Union([
659
+ Schema.Literals(["government", "corporation", "individual"]),
660
+ Schema.String,
661
+ ]),
662
+ ),
663
+ }).pipe(
664
+ Schema.encodeKeys({
665
+ regWhoGoodFaithAffirmation: "reg_who_good_faith_affirmation",
666
+ regWhoLawfulProcessingAgreement:
667
+ "reg_who_lawful_processing_agreement",
668
+ regWhoLegalBasis: "reg_who_legal_basis",
669
+ regWhoRequestType: "reg_who_request_type",
670
+ regWhoRequestedDataElements: "reg_who_requested_data_elements",
671
+ regWhoAuthorizationStatement: "reg_who_authorization_statement",
672
+ regWhoRequestorType: "reg_who_requestor_type",
673
+ }),
674
+ ),
675
+ ),
676
+ ncseiSubjectRepresentation: Schema.optional(Schema.Boolean),
536
677
  }).pipe(
537
678
  Schema.encodeKeys({
538
679
  act: "act",
@@ -556,6 +697,16 @@ export const CreateAbuseReportRequest =
556
697
  reportedUserAgent: "reported_user_agent",
557
698
  tele: "tele",
558
699
  title: "title",
700
+ justification: "justification",
701
+ trademarkNumber: "trademark_number",
702
+ trademarkOffice: "trademark_office",
703
+ trademarkSymbol: "trademark_symbol",
704
+ destinationIps: "destination_ips",
705
+ portsProtocols: "ports_protocols",
706
+ sourceIps: "source_ips",
707
+ ncmecNotification: "ncmec_notification",
708
+ regWhoRequest: "reg_who_request",
709
+ ncseiSubjectRepresentation: "ncsei_subject_representation",
559
710
  }),
560
711
  T.Http({
561
712
  method: "POST",
@@ -1925,18 +1925,50 @@ export interface CreateMemberRequest {
1925
1925
  /** Body param: The contact email address of the user. */
1926
1926
  email: string;
1927
1927
  /** Body param: Array of roles associated with this member. */
1928
- roles: string[];
1928
+ roles?: string[];
1929
1929
  /** Body param: Status of the member invitation. If not provided during creation, defaults to 'pending'. Changing from 'accepted' back to 'pending' will trigger a replacement of the member resource in Ter */
1930
1930
  status?: "accepted" | "pending" | (string & {});
1931
+ /** Body param: Array of policies associated with this member. */
1932
+ policies?: {
1933
+ access: "allow" | "deny" | (string & {});
1934
+ permissionGroups: { id: string }[];
1935
+ resourceGroups: { id: string }[];
1936
+ }[];
1931
1937
  }
1932
1938
 
1933
1939
  export const CreateMemberRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1934
1940
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
1935
1941
  email: Schema.String,
1936
- roles: Schema.Array(Schema.String),
1942
+ roles: Schema.optional(Schema.Array(Schema.String)),
1937
1943
  status: Schema.optional(
1938
1944
  Schema.Union([Schema.Literals(["accepted", "pending"]), Schema.String]),
1939
1945
  ),
1946
+ policies: Schema.optional(
1947
+ Schema.Array(
1948
+ Schema.Struct({
1949
+ access: Schema.Union([
1950
+ Schema.Literals(["allow", "deny"]),
1951
+ Schema.String,
1952
+ ]),
1953
+ permissionGroups: Schema.Array(
1954
+ Schema.Struct({
1955
+ id: Schema.String,
1956
+ }),
1957
+ ),
1958
+ resourceGroups: Schema.Array(
1959
+ Schema.Struct({
1960
+ id: Schema.String,
1961
+ }),
1962
+ ),
1963
+ }).pipe(
1964
+ Schema.encodeKeys({
1965
+ access: "access",
1966
+ permissionGroups: "permission_groups",
1967
+ resourceGroups: "resource_groups",
1968
+ }),
1969
+ ),
1970
+ ),
1971
+ ),
1940
1972
  }).pipe(
1941
1973
  T.Http({ method: "POST", path: "/accounts/{account_id}/members" }),
1942
1974
  ) as unknown as Schema.Schema<CreateMemberRequest>;
@@ -2277,6 +2309,12 @@ export interface UpdateMemberRequest {
2277
2309
  accountId: string;
2278
2310
  /** Body param: Roles assigned to this member. */
2279
2311
  roles?: { id: string }[];
2312
+ /** Body param: Array of policies associated with this member. */
2313
+ policies?: {
2314
+ access: "allow" | "deny" | (string & {});
2315
+ permissionGroups: { id: string }[];
2316
+ resourceGroups: { id: string }[];
2317
+ }[];
2280
2318
  }
2281
2319
 
2282
2320
  export const UpdateMemberRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
@@ -2289,6 +2327,32 @@ export const UpdateMemberRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2289
2327
  }),
2290
2328
  ),
2291
2329
  ),
2330
+ policies: Schema.optional(
2331
+ Schema.Array(
2332
+ Schema.Struct({
2333
+ access: Schema.Union([
2334
+ Schema.Literals(["allow", "deny"]),
2335
+ Schema.String,
2336
+ ]),
2337
+ permissionGroups: Schema.Array(
2338
+ Schema.Struct({
2339
+ id: Schema.String,
2340
+ }),
2341
+ ),
2342
+ resourceGroups: Schema.Array(
2343
+ Schema.Struct({
2344
+ id: Schema.String,
2345
+ }),
2346
+ ),
2347
+ }).pipe(
2348
+ Schema.encodeKeys({
2349
+ access: "access",
2350
+ permissionGroups: "permission_groups",
2351
+ resourceGroups: "resource_groups",
2352
+ }),
2353
+ ),
2354
+ ),
2355
+ ),
2292
2356
  }).pipe(
2293
2357
  T.Http({ method: "PUT", path: "/accounts/{account_id}/members/{memberId}" }),
2294
2358
  ) as unknown as Schema.Schema<UpdateMemberRequest>;
@@ -50,14 +50,247 @@ export interface RunAiRequest {
50
50
  /** Path param */
51
51
  accountId: string;
52
52
  /** Body param: The text that you want to classify */
53
- text: string;
53
+ text?: string | string[];
54
+ /** Body param: A text description of the image you want to generate */
55
+ prompt?: string;
56
+ /** Body param: Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt */
57
+ guidance?: number;
58
+ /** Body param: The height of the generated image in pixels */
59
+ height?: number;
60
+ /** Body param: For use with img2img tasks. An array of integers that represent the image data constrained to 8-bit unsigned integer values */
61
+ image?: number[] | string;
62
+ /** Body param: For use with img2img tasks. A base64-encoded string of the input image */
63
+ imageB64?: string;
64
+ /** Body param: An array representing An array of integers that represent mask image data for inpainting constrained to 8-bit unsigned integer values */
65
+ mask?: number[];
66
+ /** Body param: Text describing elements to avoid in the generated image */
67
+ negativePrompt?: string;
68
+ /** Body param: The number of diffusion steps; higher values can improve quality but take longer */
69
+ numSteps?: number;
70
+ /** Body param: Random seed for reproducibility of the image generation */
71
+ seed?: number;
72
+ /** Body param: A value between 0 and 1 indicating how strongly to apply the transformation during img2img tasks; lower values make the output closer to the input image */
73
+ strength?: number;
74
+ /** Body param: The width of the generated image in pixels */
75
+ width?: number;
76
+ /** Body param: The speech language (e.g., 'en' for English, 'fr' for French). Defaults to 'en' if not specified */
77
+ lang?: string;
78
+ /** Body param: An array of integers that represent the audio data constrained to 8-bit unsigned integer values */
79
+ audio?: number[];
80
+ /** Body param: The language of the recorded audio */
81
+ sourceLang?: string;
82
+ /** Body param: The language to translate the transcription into. Currently only English is supported. */
83
+ targetLang?: string;
84
+ /** Body param: Decreases the likelihood of the model repeating the same lines verbatim. */
85
+ frequencyPenalty?: number;
86
+ /** Body param: Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model. */
87
+ lora?: string;
88
+ /** Body param: The maximum number of tokens to generate in the response. */
89
+ maxTokens?: number;
90
+ /** Body param: Increases the likelihood of the model introducing new topics. */
91
+ presencePenalty?: number;
92
+ /** Body param: If true, a chat template is not applied and you must adhere to the specific model's expected formatting. */
93
+ raw?: boolean;
94
+ /** Body param: Penalty for repeated tokens; higher values discourage repetition. */
95
+ repetitionPenalty?: number;
96
+ /** Body param */
97
+ responseFormat?: {
98
+ jsonSchema?: unknown;
99
+ type?: "json_object" | "json_schema" | (string & {});
100
+ };
101
+ /** Body param: If true, the response will be streamed back incrementally using SSE, Server Sent Events. */
102
+ stream?: boolean;
103
+ /** Body param: Controls the randomness of the output; higher values produce more random results. */
104
+ temperature?: number;
105
+ /** Body param: Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises. */
106
+ topK?: number;
107
+ /** Body param: Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creati */
108
+ topP?: number;
109
+ /** Body param: An array of message objects representing the conversation history. */
110
+ messages?:
111
+ | { content: string | { text?: string; type?: string }[]; role: string }[]
112
+ | {
113
+ content:
114
+ | string
115
+ | { type: string; imageUrl?: { url: string }; text?: string }[];
116
+ role: string;
117
+ }[];
118
+ /** Body param */
119
+ functions?: { code: string; name: string }[];
120
+ /** Body param: A list of tools available for the assistant to use. */
121
+ tools?: (
122
+ | {
123
+ description: string;
124
+ name: string;
125
+ parameters: {
126
+ properties: Record<string, unknown>;
127
+ type: string;
128
+ required?: string[];
129
+ };
130
+ }
131
+ | { code: string; name: string }
132
+ )[];
133
+ /** Body param: The text that you want the model to summarize */
134
+ inputText?: string;
135
+ /** Body param: The maximum length of the generated summary in tokens */
136
+ maxLength?: number;
137
+ /** Body param: Whether to ignore the EOS token and continue generating tokens after the EOS token is generated. */
138
+ ignoreEos?: boolean;
54
139
  }
55
140
 
56
141
  export const RunAiRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
57
142
  modelName: Schema.String.pipe(T.HttpPath("modelName")),
58
143
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
59
- text: Schema.String,
144
+ text: Schema.optional(
145
+ Schema.Union([Schema.String, Schema.Array(Schema.String)]),
146
+ ),
147
+ prompt: Schema.optional(Schema.String),
148
+ guidance: Schema.optional(Schema.Number),
149
+ height: Schema.optional(Schema.Number),
150
+ image: Schema.optional(
151
+ Schema.Union([Schema.Array(Schema.Number), Schema.String]),
152
+ ),
153
+ imageB64: Schema.optional(Schema.String),
154
+ mask: Schema.optional(Schema.Array(Schema.Number)),
155
+ negativePrompt: Schema.optional(Schema.String),
156
+ numSteps: Schema.optional(Schema.Number),
157
+ seed: Schema.optional(Schema.Number),
158
+ strength: Schema.optional(Schema.Number),
159
+ width: Schema.optional(Schema.Number),
160
+ lang: Schema.optional(Schema.String),
161
+ audio: Schema.optional(Schema.Array(Schema.Number)),
162
+ sourceLang: Schema.optional(Schema.String),
163
+ targetLang: Schema.optional(Schema.String),
164
+ frequencyPenalty: Schema.optional(Schema.Number),
165
+ lora: Schema.optional(Schema.String),
166
+ maxTokens: Schema.optional(Schema.Number),
167
+ presencePenalty: Schema.optional(Schema.Number),
168
+ raw: Schema.optional(Schema.Boolean),
169
+ repetitionPenalty: Schema.optional(Schema.Number),
170
+ responseFormat: Schema.optional(
171
+ Schema.Struct({
172
+ jsonSchema: Schema.optional(Schema.Unknown),
173
+ type: Schema.optional(
174
+ Schema.Union([
175
+ Schema.Literals(["json_object", "json_schema"]),
176
+ Schema.String,
177
+ ]),
178
+ ),
179
+ }).pipe(Schema.encodeKeys({ jsonSchema: "json_schema", type: "type" })),
180
+ ),
181
+ stream: Schema.optional(Schema.Boolean),
182
+ temperature: Schema.optional(Schema.Number),
183
+ topK: Schema.optional(Schema.Number),
184
+ topP: Schema.optional(Schema.Number),
185
+ messages: Schema.optional(
186
+ Schema.Union([
187
+ Schema.Array(
188
+ Schema.Struct({
189
+ content: Schema.Union([
190
+ Schema.String,
191
+ Schema.Array(
192
+ Schema.Struct({
193
+ text: Schema.optional(Schema.String),
194
+ type: Schema.optional(Schema.String),
195
+ }),
196
+ ),
197
+ ]),
198
+ role: Schema.String,
199
+ }),
200
+ ),
201
+ Schema.Array(
202
+ Schema.Struct({
203
+ content: Schema.Union([
204
+ Schema.String,
205
+ Schema.Array(
206
+ Schema.Struct({
207
+ type: Schema.String,
208
+ imageUrl: Schema.optional(
209
+ Schema.Struct({
210
+ url: Schema.String,
211
+ }),
212
+ ),
213
+ text: Schema.optional(Schema.String),
214
+ }).pipe(
215
+ Schema.encodeKeys({
216
+ type: "type",
217
+ imageUrl: "image_url",
218
+ text: "text",
219
+ }),
220
+ ),
221
+ ),
222
+ ]),
223
+ role: Schema.String,
224
+ }),
225
+ ),
226
+ ]),
227
+ ),
228
+ functions: Schema.optional(
229
+ Schema.Array(
230
+ Schema.Struct({
231
+ code: Schema.String,
232
+ name: Schema.String,
233
+ }),
234
+ ),
235
+ ),
236
+ tools: Schema.optional(
237
+ Schema.Array(
238
+ Schema.Union([
239
+ Schema.Struct({
240
+ description: Schema.String,
241
+ name: Schema.String,
242
+ parameters: Schema.Struct({
243
+ properties: Schema.Record(Schema.String, Schema.Unknown),
244
+ type: Schema.String,
245
+ required: Schema.optional(Schema.Array(Schema.String)),
246
+ }),
247
+ }),
248
+ Schema.Struct({
249
+ code: Schema.String,
250
+ name: Schema.String,
251
+ }),
252
+ ]),
253
+ ),
254
+ ),
255
+ inputText: Schema.optional(Schema.String),
256
+ maxLength: Schema.optional(Schema.Number),
257
+ ignoreEos: Schema.optional(Schema.Boolean),
60
258
  }).pipe(
259
+ Schema.encodeKeys({
260
+ text: "text",
261
+ prompt: "prompt",
262
+ guidance: "guidance",
263
+ height: "height",
264
+ image: "image",
265
+ imageB64: "image_b64",
266
+ mask: "mask",
267
+ negativePrompt: "negative_prompt",
268
+ numSteps: "num_steps",
269
+ seed: "seed",
270
+ strength: "strength",
271
+ width: "width",
272
+ lang: "lang",
273
+ audio: "audio",
274
+ sourceLang: "source_lang",
275
+ targetLang: "target_lang",
276
+ frequencyPenalty: "frequency_penalty",
277
+ lora: "lora",
278
+ maxTokens: "max_tokens",
279
+ presencePenalty: "presence_penalty",
280
+ raw: "raw",
281
+ repetitionPenalty: "repetition_penalty",
282
+ responseFormat: "response_format",
283
+ stream: "stream",
284
+ temperature: "temperature",
285
+ topK: "top_k",
286
+ topP: "top_p",
287
+ messages: "messages",
288
+ functions: "functions",
289
+ tools: "tools",
290
+ inputText: "input_text",
291
+ maxLength: "max_length",
292
+ ignoreEos: "ignore_eos",
293
+ }),
61
294
  T.Http({ method: "POST", path: "/accounts/{account_id}/ai/run/{modelName}" }),
62
295
  ) as unknown as Schema.Schema<RunAiRequest>;
63
296
 
@@ -553,6 +553,26 @@ export interface PutBotManagementRequest {
553
553
  fightMode?: boolean;
554
554
  /** Body param: Enable cloudflare managed robots.txt. If an existing robots.txt is detected, then managed robots.txt will be prepended to the existing robots.txt. */
555
555
  isRobotsTxtManaged?: boolean;
556
+ /** Body param: Whether to optimize Super Bot Fight Mode protections for Wordpress. */
557
+ optimizeWordpress?: boolean;
558
+ /** Body param: Super Bot Fight Mode (SBFM) action to take on definitely automated requests. */
559
+ sbfmDefinitelyAutomated?:
560
+ | "allow"
561
+ | "block"
562
+ | "managed_challenge"
563
+ | (string & {});
564
+ /** Body param: Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if static resources on your application need bot protection. Note: Static resource protection can also result in le */
565
+ sbfmStaticResourceProtection?: boolean;
566
+ /** Body param: Super Bot Fight Mode (SBFM) action to take on verified bots requests. */
567
+ sbfmVerifiedBots?: "allow" | "block" | (string & {});
568
+ /** Body param: Super Bot Fight Mode (SBFM) action to take on likely automated requests. */
569
+ sbfmLikelyAutomated?: "allow" | "block" | "managed_challenge" | (string & {});
570
+ /** Body param: Automatically update to the newest bot detection models created by Cloudflare as they are released. [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#m */
571
+ autoUpdateModel?: boolean;
572
+ /** Body param: Indicates that the bot management cookie can be placed on end user devices accessing the site. Defaults to true */
573
+ bmCookieEnabled?: boolean;
574
+ /** Body param: Whether to disable tracking the highest bot score for a session in the Bot Management cookie. */
575
+ suppressSessionScore?: boolean;
556
576
  }
557
577
 
558
578
  export const PutBotManagementRequest =
@@ -576,6 +596,26 @@ export const PutBotManagementRequest =
576
596
  enableJs: Schema.optional(Schema.Boolean),
577
597
  fightMode: Schema.optional(Schema.Boolean),
578
598
  isRobotsTxtManaged: Schema.optional(Schema.Boolean),
599
+ optimizeWordpress: Schema.optional(Schema.Boolean),
600
+ sbfmDefinitelyAutomated: Schema.optional(
601
+ Schema.Union([
602
+ Schema.Literals(["allow", "block", "managed_challenge"]),
603
+ Schema.String,
604
+ ]),
605
+ ),
606
+ sbfmStaticResourceProtection: Schema.optional(Schema.Boolean),
607
+ sbfmVerifiedBots: Schema.optional(
608
+ Schema.Union([Schema.Literals(["allow", "block"]), Schema.String]),
609
+ ),
610
+ sbfmLikelyAutomated: Schema.optional(
611
+ Schema.Union([
612
+ Schema.Literals(["allow", "block", "managed_challenge"]),
613
+ Schema.String,
614
+ ]),
615
+ ),
616
+ autoUpdateModel: Schema.optional(Schema.Boolean),
617
+ bmCookieEnabled: Schema.optional(Schema.Boolean),
618
+ suppressSessionScore: Schema.optional(Schema.Boolean),
579
619
  }).pipe(
580
620
  Schema.encodeKeys({
581
621
  aiBotsProtection: "ai_bots_protection",
@@ -585,6 +625,14 @@ export const PutBotManagementRequest =
585
625
  enableJs: "enable_js",
586
626
  fightMode: "fight_mode",
587
627
  isRobotsTxtManaged: "is_robots_txt_managed",
628
+ optimizeWordpress: "optimize_wordpress",
629
+ sbfmDefinitelyAutomated: "sbfm_definitely_automated",
630
+ sbfmStaticResourceProtection: "sbfm_static_resource_protection",
631
+ sbfmVerifiedBots: "sbfm_verified_bots",
632
+ sbfmLikelyAutomated: "sbfm_likely_automated",
633
+ autoUpdateModel: "auto_update_model",
634
+ bmCookieEnabled: "bm_cookie_enabled",
635
+ suppressSessionScore: "suppress_session_score",
588
636
  }),
589
637
  T.Http({ method: "PUT", path: "/zones/{zone_id}/bot_management" }),
590
638
  ) as unknown as Schema.Schema<PutBotManagementRequest>;