@distilled.cloud/cloudflare 0.21.4 → 0.21.6

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@distilled.cloud/cloudflare",
3
- "version": "0.21.4",
3
+ "version": "0.21.6",
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.21.4"
66
+ "@distilled.cloud/core": "0.21.6"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@effect/platform-node": ">=4.0.0-beta.66 || >=4.0.0",
@@ -13,6 +13,52 @@ import type { Credentials } from "../credentials.ts";
13
13
  import { type DefaultErrors } from "../errors.ts";
14
14
  import { UploadableSchema } from "../schemas.ts";
15
15
 
16
+ // =============================================================================
17
+ // Errors
18
+ // =============================================================================
19
+
20
+ export class IndexAlreadyExists extends Schema.TaggedErrorClass<IndexAlreadyExists>()(
21
+ "IndexAlreadyExists",
22
+ { code: Schema.Number, message: Schema.String },
23
+ ) {}
24
+ T.applyErrorMatchers(IndexAlreadyExists, [{ code: 3002 }]);
25
+
26
+ export class IndexInvalidConfig extends Schema.TaggedErrorClass<IndexInvalidConfig>()(
27
+ "IndexInvalidConfig",
28
+ { code: Schema.Number, message: Schema.String },
29
+ ) {}
30
+ T.applyErrorMatchers(IndexInvalidConfig, [{ code: 3003 }]);
31
+
32
+ export class IndexInvalidName extends Schema.TaggedErrorClass<IndexInvalidName>()(
33
+ "IndexInvalidName",
34
+ { code: Schema.Number, message: Schema.String },
35
+ ) {}
36
+ T.applyErrorMatchers(IndexInvalidName, [{ code: 3001 }]);
37
+
38
+ export class MetadataIndexAlreadyExists extends Schema.TaggedErrorClass<MetadataIndexAlreadyExists>()(
39
+ "MetadataIndexAlreadyExists",
40
+ { code: Schema.Number, message: Schema.String },
41
+ ) {}
42
+ T.applyErrorMatchers(MetadataIndexAlreadyExists, [{ code: 40004 }]);
43
+
44
+ export class MetadataIndexInvalidType extends Schema.TaggedErrorClass<MetadataIndexInvalidType>()(
45
+ "MetadataIndexInvalidType",
46
+ { code: Schema.Number, message: Schema.String },
47
+ ) {}
48
+ T.applyErrorMatchers(MetadataIndexInvalidType, [{ code: 40026 }]);
49
+
50
+ export class MetadataIndexNotFound extends Schema.TaggedErrorClass<MetadataIndexNotFound>()(
51
+ "MetadataIndexNotFound",
52
+ { code: Schema.Number, message: Schema.String },
53
+ ) {}
54
+ T.applyErrorMatchers(MetadataIndexNotFound, [{ code: 40005 }]);
55
+
56
+ export class NotFound extends Schema.TaggedErrorClass<NotFound>()("NotFound", {
57
+ code: Schema.Number,
58
+ message: Schema.String,
59
+ }) {}
60
+ T.applyErrorMatchers(NotFound, [{ code: 3000 }]);
61
+
16
62
  // =============================================================================
17
63
  // ByIdsIndex
18
64
  // =============================================================================
@@ -161,7 +207,7 @@ export const GetIndexResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
161
207
  )
162
208
  .pipe(T.ResponsePath("result")) as unknown as Schema.Schema<GetIndexResponse>;
163
209
 
164
- export type GetIndexError = DefaultErrors;
210
+ export type GetIndexError = DefaultErrors | NotFound;
165
211
 
166
212
  export const getIndex: API.OperationMethod<
167
213
  GetIndexRequest,
@@ -171,7 +217,7 @@ export const getIndex: API.OperationMethod<
171
217
  > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
172
218
  input: GetIndexRequest,
173
219
  output: GetIndexResponse,
174
- errors: [],
220
+ errors: [NotFound],
175
221
  }));
176
222
 
177
223
  export interface ListIndexesRequest {
@@ -334,7 +380,11 @@ export const CreateIndexResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
334
380
  T.ResponsePath("result"),
335
381
  ) as unknown as Schema.Schema<CreateIndexResponse>;
336
382
 
337
- export type CreateIndexError = DefaultErrors;
383
+ export type CreateIndexError =
384
+ | DefaultErrors
385
+ | IndexAlreadyExists
386
+ | IndexInvalidName
387
+ | IndexInvalidConfig;
338
388
 
339
389
  export const createIndex: API.OperationMethod<
340
390
  CreateIndexRequest,
@@ -344,7 +394,7 @@ export const createIndex: API.OperationMethod<
344
394
  > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
345
395
  input: CreateIndexRequest,
346
396
  output: CreateIndexResponse,
347
- errors: [],
397
+ errors: [IndexAlreadyExists, IndexInvalidName, IndexInvalidConfig],
348
398
  }));
349
399
 
350
400
  export interface DeleteIndexRequest {
@@ -370,7 +420,7 @@ export const DeleteIndexResponse =
370
420
  T.ResponsePath("result"),
371
421
  ) as unknown as Schema.Schema<DeleteIndexResponse>;
372
422
 
373
- export type DeleteIndexError = DefaultErrors;
423
+ export type DeleteIndexError = DefaultErrors | NotFound;
374
424
 
375
425
  export const deleteIndex: API.OperationMethod<
376
426
  DeleteIndexRequest,
@@ -380,7 +430,7 @@ export const deleteIndex: API.OperationMethod<
380
430
  > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
381
431
  input: DeleteIndexRequest,
382
432
  output: DeleteIndexResponse,
383
- errors: [],
433
+ errors: [NotFound],
384
434
  }));
385
435
 
386
436
  export interface InfoIndexRequest {
@@ -672,7 +722,7 @@ export const ListIndexMetadataIndexesResponse =
672
722
  T.ResponsePath("result"),
673
723
  ) as unknown as Schema.Schema<ListIndexMetadataIndexesResponse>;
674
724
 
675
- export type ListIndexMetadataIndexesError = DefaultErrors;
725
+ export type ListIndexMetadataIndexesError = DefaultErrors | NotFound;
676
726
 
677
727
  export const listIndexMetadataIndexes: API.OperationMethod<
678
728
  ListIndexMetadataIndexesRequest,
@@ -682,7 +732,7 @@ export const listIndexMetadataIndexes: API.OperationMethod<
682
732
  > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
683
733
  input: ListIndexMetadataIndexesRequest,
684
734
  output: ListIndexMetadataIndexesResponse,
685
- errors: [],
735
+ errors: [NotFound],
686
736
  }));
687
737
 
688
738
  export interface CreateIndexMetadataIndexRequest {
@@ -720,7 +770,11 @@ export const CreateIndexMetadataIndexResponse =
720
770
  T.ResponsePath("result"),
721
771
  ) as unknown as Schema.Schema<CreateIndexMetadataIndexResponse>;
722
772
 
723
- export type CreateIndexMetadataIndexError = DefaultErrors;
773
+ export type CreateIndexMetadataIndexError =
774
+ | DefaultErrors
775
+ | NotFound
776
+ | MetadataIndexAlreadyExists
777
+ | MetadataIndexInvalidType;
724
778
 
725
779
  export const createIndexMetadataIndex: API.OperationMethod<
726
780
  CreateIndexMetadataIndexRequest,
@@ -730,7 +784,7 @@ export const createIndexMetadataIndex: API.OperationMethod<
730
784
  > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
731
785
  input: CreateIndexMetadataIndexRequest,
732
786
  output: CreateIndexMetadataIndexResponse,
733
- errors: [],
787
+ errors: [NotFound, MetadataIndexAlreadyExists, MetadataIndexInvalidType],
734
788
  }));
735
789
 
736
790
  export interface DeleteIndexMetadataIndexRequest {
@@ -765,7 +819,10 @@ export const DeleteIndexMetadataIndexResponse =
765
819
  T.ResponsePath("result"),
766
820
  ) as unknown as Schema.Schema<DeleteIndexMetadataIndexResponse>;
767
821
 
768
- export type DeleteIndexMetadataIndexError = DefaultErrors;
822
+ export type DeleteIndexMetadataIndexError =
823
+ | DefaultErrors
824
+ | NotFound
825
+ | MetadataIndexNotFound;
769
826
 
770
827
  export const deleteIndexMetadataIndex: API.OperationMethod<
771
828
  DeleteIndexMetadataIndexRequest,
@@ -775,7 +832,7 @@ export const deleteIndexMetadataIndex: API.OperationMethod<
775
832
  > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
776
833
  input: DeleteIndexMetadataIndexRequest,
777
834
  output: DeleteIndexMetadataIndexResponse,
778
- errors: [],
835
+ errors: [NotFound, MetadataIndexNotFound],
779
836
  }));
780
837
 
781
838
  // =============================================================================