@distilled.cloud/cloudflare 0.30.1 → 0.30.3

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.
@@ -48,6 +48,14 @@ export class RulesetNotFound extends T.applyErrorMatchers(
48
48
  [{ status: 404 }],
49
49
  ) {}
50
50
 
51
+ export class RumSiteQuotaExceeded extends T.applyErrorMatchers(
52
+ Schema.TaggedErrorClass<RumSiteQuotaExceeded>()("RumSiteQuotaExceeded", {
53
+ code: Schema.Number,
54
+ message: Schema.String,
55
+ }),
56
+ [{ code: 10014 }],
57
+ ) {}
58
+
51
59
  export class SiteNotFound extends T.applyErrorMatchers(
52
60
  Schema.TaggedErrorClass<SiteNotFound>()("SiteNotFound", {
53
61
  code: Schema.Number,
@@ -211,22 +219,21 @@ interface ListSiteInfosResponseResultInfo {
211
219
  perPage?: number | null;
212
220
  totalCount?: number | null;
213
221
  }
214
- const ListSiteInfosResponseResultInfo =
215
- /*@__PURE__*/ Schema.suspend(() =>
216
- Schema.Struct({
217
- count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
218
- page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
219
- perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
220
- totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
221
- }).pipe(
222
- Schema.encodeKeys({
223
- count: "count",
224
- page: "page",
225
- perPage: "per_page",
226
- totalCount: "total_count",
227
- }),
228
- ),
229
- ) as unknown as Schema.Codec<ListSiteInfosResponseResultInfo>;
222
+ const ListSiteInfosResponseResultInfo = /*@__PURE__*/ Schema.suspend(() =>
223
+ Schema.Struct({
224
+ count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
225
+ page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
226
+ perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
227
+ totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
228
+ }).pipe(
229
+ Schema.encodeKeys({
230
+ count: "count",
231
+ page: "page",
232
+ perPage: "per_page",
233
+ totalCount: "total_count",
234
+ }),
235
+ ),
236
+ ) as unknown as Schema.Codec<ListSiteInfosResponseResultInfo>;
230
237
 
231
238
  // =============================================================================
232
239
  // Rule
@@ -541,21 +548,20 @@ export interface BulkCreateRulesRequest {
541
548
  }[];
542
549
  }
543
550
 
544
- export const BulkCreateRulesRequest =
545
- /*@__PURE__*/ Schema.suspend(() =>
546
- Schema.Struct({
547
- rulesetId: Schema.String.pipe(T.HttpPath("rulesetId")),
548
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
549
- deleteRules: Schema.optional(Schema.Array(Schema.String)),
550
- rules: Schema.optional(Schema.Array(Rule)),
551
- }).pipe(
552
- Schema.encodeKeys({ deleteRules: "delete_rules", rules: "rules" }),
553
- T.Http({
554
- method: "POST",
555
- path: "/accounts/{account_id}/rum/v2/{rulesetId}/rules",
556
- }),
557
- ),
558
- ) as unknown as Schema.Codec<BulkCreateRulesRequest>;
551
+ export const BulkCreateRulesRequest = /*@__PURE__*/ Schema.suspend(() =>
552
+ Schema.Struct({
553
+ rulesetId: Schema.String.pipe(T.HttpPath("rulesetId")),
554
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
555
+ deleteRules: Schema.optional(Schema.Array(Schema.String)),
556
+ rules: Schema.optional(Schema.Array(Rule)),
557
+ }).pipe(
558
+ Schema.encodeKeys({ deleteRules: "delete_rules", rules: "rules" }),
559
+ T.Http({
560
+ method: "POST",
561
+ path: "/accounts/{account_id}/rum/v2/{rulesetId}/rules",
562
+ }),
563
+ ),
564
+ ) as unknown as Schema.Codec<BulkCreateRulesRequest>;
559
565
 
560
566
  export interface BulkCreateRulesResponse {
561
567
  /** A list of rules. */
@@ -578,15 +584,12 @@ export interface BulkCreateRulesResponse {
578
584
  } | null;
579
585
  }
580
586
 
581
- export const BulkCreateRulesResponse =
582
- /*@__PURE__*/ Schema.suspend(() =>
583
- Schema.Struct({
584
- rules: Schema.optional(
585
- Schema.Union([Schema.Array(Rumrule), Schema.Null]),
586
- ),
587
- ruleset: Schema.optional(Schema.Union([Ruleset, Schema.Null])),
588
- }).pipe(T.ResponsePath("result")),
589
- ) as unknown as Schema.Codec<BulkCreateRulesResponse>;
587
+ export const BulkCreateRulesResponse = /*@__PURE__*/ Schema.suspend(() =>
588
+ Schema.Struct({
589
+ rules: Schema.optional(Schema.Union([Schema.Array(Rumrule), Schema.Null])),
590
+ ruleset: Schema.optional(Schema.Union([Ruleset, Schema.Null])),
591
+ }).pipe(T.ResponsePath("result")),
592
+ ) as unknown as Schema.Codec<BulkCreateRulesResponse>;
590
593
 
591
594
  export type BulkCreateRulesError = DefaultErrors;
592
595
 
@@ -839,36 +842,36 @@ export interface CreateSiteInfoResponse {
839
842
  host?: string | null;
840
843
  }
841
844
 
842
- export const CreateSiteInfoResponse =
843
- /*@__PURE__*/ Schema.suspend(() =>
844
- Schema.Struct({
845
- autoInstall: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
846
- created: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
847
- rules: Schema.optional(
848
- Schema.Union([Schema.Array(Rumrule), Schema.Null]),
849
- ),
850
- ruleset: Schema.optional(Schema.Union([Ruleset, Schema.Null])),
851
- siteTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
852
- siteToken: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
853
- snippet: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
854
- host: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
855
- })
856
- .pipe(
857
- Schema.encodeKeys({
858
- autoInstall: "auto_install",
859
- created: "created",
860
- rules: "rules",
861
- ruleset: "ruleset",
862
- siteTag: "site_tag",
863
- siteToken: "site_token",
864
- snippet: "snippet",
865
- host: "host",
866
- }),
867
- )
868
- .pipe(T.ResponsePath("result")),
869
- ) as unknown as Schema.Codec<CreateSiteInfoResponse>;
870
-
871
- export type CreateSiteInfoError = DefaultErrors | Forbidden;
845
+ export const CreateSiteInfoResponse = /*@__PURE__*/ Schema.suspend(() =>
846
+ Schema.Struct({
847
+ autoInstall: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
848
+ created: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
849
+ rules: Schema.optional(Schema.Union([Schema.Array(Rumrule), Schema.Null])),
850
+ ruleset: Schema.optional(Schema.Union([Ruleset, Schema.Null])),
851
+ siteTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
852
+ siteToken: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
853
+ snippet: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
854
+ host: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
855
+ })
856
+ .pipe(
857
+ Schema.encodeKeys({
858
+ autoInstall: "auto_install",
859
+ created: "created",
860
+ rules: "rules",
861
+ ruleset: "ruleset",
862
+ siteTag: "site_tag",
863
+ siteToken: "site_token",
864
+ snippet: "snippet",
865
+ host: "host",
866
+ }),
867
+ )
868
+ .pipe(T.ResponsePath("result")),
869
+ ) as unknown as Schema.Codec<CreateSiteInfoResponse>;
870
+
871
+ export type CreateSiteInfoError =
872
+ | DefaultErrors
873
+ | Forbidden
874
+ | RumSiteQuotaExceeded;
872
875
 
873
876
  export const createSiteInfo: API.OperationMethod<
874
877
  CreateSiteInfoRequest,
@@ -878,7 +881,7 @@ export const createSiteInfo: API.OperationMethod<
878
881
  > = /*@__PURE__*/ API.make(() => ({
879
882
  input: CreateSiteInfoRequest,
880
883
  output: CreateSiteInfoResponse,
881
- errors: [Forbidden],
884
+ errors: [Forbidden, RumSiteQuotaExceeded],
882
885
  }));
883
886
 
884
887
  export interface UpdateSiteInfoRequest {
@@ -952,34 +955,31 @@ export interface UpdateSiteInfoResponse {
952
955
  host?: string | null;
953
956
  }
954
957
 
955
- export const UpdateSiteInfoResponse =
956
- /*@__PURE__*/ Schema.suspend(() =>
957
- Schema.Struct({
958
- autoInstall: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
959
- created: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
960
- rules: Schema.optional(
961
- Schema.Union([Schema.Array(Rumrule), Schema.Null]),
962
- ),
963
- ruleset: Schema.optional(Schema.Union([Ruleset, Schema.Null])),
964
- siteTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
965
- siteToken: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
966
- snippet: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
967
- host: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
968
- })
969
- .pipe(
970
- Schema.encodeKeys({
971
- autoInstall: "auto_install",
972
- created: "created",
973
- rules: "rules",
974
- ruleset: "ruleset",
975
- siteTag: "site_tag",
976
- siteToken: "site_token",
977
- snippet: "snippet",
978
- host: "host",
979
- }),
980
- )
981
- .pipe(T.ResponsePath("result")),
982
- ) as unknown as Schema.Codec<UpdateSiteInfoResponse>;
958
+ export const UpdateSiteInfoResponse = /*@__PURE__*/ Schema.suspend(() =>
959
+ Schema.Struct({
960
+ autoInstall: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
961
+ created: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
962
+ rules: Schema.optional(Schema.Union([Schema.Array(Rumrule), Schema.Null])),
963
+ ruleset: Schema.optional(Schema.Union([Ruleset, Schema.Null])),
964
+ siteTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
965
+ siteToken: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
966
+ snippet: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
967
+ host: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
968
+ })
969
+ .pipe(
970
+ Schema.encodeKeys({
971
+ autoInstall: "auto_install",
972
+ created: "created",
973
+ rules: "rules",
974
+ ruleset: "ruleset",
975
+ siteTag: "site_tag",
976
+ siteToken: "site_token",
977
+ snippet: "snippet",
978
+ host: "host",
979
+ }),
980
+ )
981
+ .pipe(T.ResponsePath("result")),
982
+ ) as unknown as Schema.Codec<UpdateSiteInfoResponse>;
983
983
 
984
984
  export type UpdateSiteInfoError = DefaultErrors | SiteNotFound | Forbidden;
985
985
 
@@ -1017,14 +1017,13 @@ export interface DeleteSiteInfoResponse {
1017
1017
  siteTag?: string | null;
1018
1018
  }
1019
1019
 
1020
- export const DeleteSiteInfoResponse =
1021
- /*@__PURE__*/ Schema.suspend(() =>
1022
- Schema.Struct({
1023
- siteTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1024
- })
1025
- .pipe(Schema.encodeKeys({ siteTag: "site_tag" }))
1026
- .pipe(T.ResponsePath("result")),
1027
- ) as unknown as Schema.Codec<DeleteSiteInfoResponse>;
1020
+ export const DeleteSiteInfoResponse = /*@__PURE__*/ Schema.suspend(() =>
1021
+ Schema.Struct({
1022
+ siteTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1023
+ })
1024
+ .pipe(Schema.encodeKeys({ siteTag: "site_tag" }))
1025
+ .pipe(T.ResponsePath("result")),
1026
+ ) as unknown as Schema.Codec<DeleteSiteInfoResponse>;
1028
1027
 
1029
1028
  export type DeleteSiteInfoError = DefaultErrors | SiteNotFound | Forbidden;
1030
1029