@functional-systems/lambdadb 0.3.0-dev.2 → 0.3.0-dev.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.
- package/README.md +129 -13
- package/dist/commonjs/client.d.ts +108 -18
- package/dist/commonjs/client.d.ts.map +1 -1
- package/dist/commonjs/client.js +220 -2
- package/dist/commonjs/client.js.map +1 -1
- package/dist/commonjs/index.d.ts +16 -1
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +10 -2
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/lib/queryInput.d.ts +30 -0
- package/dist/commonjs/lib/queryInput.d.ts.map +1 -0
- package/dist/commonjs/lib/queryInput.js +18 -0
- package/dist/commonjs/lib/queryInput.js.map +1 -0
- package/dist/commonjs/types/errors.d.ts +34 -0
- package/dist/commonjs/types/errors.d.ts.map +1 -0
- package/dist/commonjs/types/errors.js +27 -0
- package/dist/commonjs/types/errors.js.map +1 -0
- package/dist/commonjs/types/public.d.ts +26 -0
- package/dist/commonjs/types/public.d.ts.map +1 -0
- package/dist/commonjs/types/public.js +7 -0
- package/dist/commonjs/types/public.js.map +1 -0
- package/dist/esm/client.d.ts +108 -18
- package/dist/esm/client.d.ts.map +1 -1
- package/dist/esm/client.js +221 -3
- package/dist/esm/client.js.map +1 -1
- package/dist/esm/index.d.ts +16 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +6 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/queryInput.d.ts +30 -0
- package/dist/esm/lib/queryInput.d.ts.map +1 -0
- package/dist/esm/lib/queryInput.js +15 -0
- package/dist/esm/lib/queryInput.js.map +1 -0
- package/dist/esm/types/errors.d.ts +34 -0
- package/dist/esm/types/errors.d.ts.map +1 -0
- package/dist/esm/types/errors.js +8 -0
- package/dist/esm/types/errors.js.map +1 -0
- package/dist/esm/types/public.d.ts +26 -0
- package/dist/esm/types/public.d.ts.map +1 -0
- package/dist/esm/types/public.js +6 -0
- package/dist/esm/types/public.js.map +1 -0
- package/examples/collectionScoped.example.ts +9 -3
- package/examples/collectionsList.example.ts +5 -2
- package/package.json +1 -1
- package/src/client.ts +410 -19
- package/src/index.ts +25 -1
- package/src/lib/queryInput.ts +33 -0
- package/src/types/errors.ts +97 -0
- package/src/types/public.ts +45 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public API error types for the collection-scoped client.
|
|
3
|
+
* Re-exports error classes and defines per-operation error unions for Safe methods.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type * as errors from "../models/errors/index.js";
|
|
7
|
+
import type { LambdaDBError } from "../models/errors/lambdadberror.js";
|
|
8
|
+
import type { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
9
|
+
import type { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
10
|
+
import type {
|
|
11
|
+
ConnectionError,
|
|
12
|
+
RequestAbortedError,
|
|
13
|
+
RequestTimeoutError,
|
|
14
|
+
InvalidRequestError,
|
|
15
|
+
UnexpectedClientError,
|
|
16
|
+
} from "../models/errors/httpclienterrors.js";
|
|
17
|
+
|
|
18
|
+
// ---- Re-export error classes for instanceof checks and typing ----
|
|
19
|
+
export {
|
|
20
|
+
BadRequestError,
|
|
21
|
+
UnauthenticatedError,
|
|
22
|
+
ResourceNotFoundError,
|
|
23
|
+
ResourceAlreadyExistsError,
|
|
24
|
+
TooManyRequestsError,
|
|
25
|
+
InternalServerError,
|
|
26
|
+
LambdaDBError,
|
|
27
|
+
LambdaDBDefaultError,
|
|
28
|
+
ResponseValidationError,
|
|
29
|
+
SDKValidationError,
|
|
30
|
+
} from "../models/errors/index.js";
|
|
31
|
+
export {
|
|
32
|
+
HTTPClientError,
|
|
33
|
+
ConnectionError,
|
|
34
|
+
RequestAbortedError,
|
|
35
|
+
RequestTimeoutError,
|
|
36
|
+
InvalidRequestError,
|
|
37
|
+
UnexpectedClientError,
|
|
38
|
+
} from "../models/errors/httpclienterrors.js";
|
|
39
|
+
|
|
40
|
+
// ---- Base union: errors common to all operations (client/SDK layer) ----
|
|
41
|
+
export type LambdaDBClientError =
|
|
42
|
+
| LambdaDBError
|
|
43
|
+
| ResponseValidationError
|
|
44
|
+
| ConnectionError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| InvalidRequestError
|
|
48
|
+
| UnexpectedClientError
|
|
49
|
+
| SDKValidationError;
|
|
50
|
+
|
|
51
|
+
// ---- API error unions (subset of errors.* per operation) ----
|
|
52
|
+
|
|
53
|
+
/** Errors that can occur when listing collections, getting a collection, deleting a collection, or getting bulk upsert info. */
|
|
54
|
+
export type ListCollectionsError =
|
|
55
|
+
| errors.UnauthenticatedError
|
|
56
|
+
| errors.ResourceNotFoundError
|
|
57
|
+
| errors.TooManyRequestsError
|
|
58
|
+
| errors.InternalServerError
|
|
59
|
+
| LambdaDBClientError;
|
|
60
|
+
|
|
61
|
+
/** Errors that can occur when creating a collection. */
|
|
62
|
+
export type CreateCollectionError =
|
|
63
|
+
| errors.BadRequestError
|
|
64
|
+
| errors.UnauthenticatedError
|
|
65
|
+
| errors.ResourceAlreadyExistsError
|
|
66
|
+
| errors.TooManyRequestsError
|
|
67
|
+
| errors.InternalServerError
|
|
68
|
+
| LambdaDBClientError;
|
|
69
|
+
|
|
70
|
+
/** Errors that can occur when getting a collection. */
|
|
71
|
+
export type GetCollectionError = ListCollectionsError;
|
|
72
|
+
|
|
73
|
+
/** Errors that can occur when updating a collection. */
|
|
74
|
+
export type UpdateCollectionError =
|
|
75
|
+
| errors.BadRequestError
|
|
76
|
+
| errors.UnauthenticatedError
|
|
77
|
+
| errors.ResourceNotFoundError
|
|
78
|
+
| errors.TooManyRequestsError
|
|
79
|
+
| errors.InternalServerError
|
|
80
|
+
| LambdaDBClientError;
|
|
81
|
+
|
|
82
|
+
/** Errors that can occur when deleting a collection. */
|
|
83
|
+
export type DeleteCollectionError = ListCollectionsError;
|
|
84
|
+
|
|
85
|
+
/** Errors that can occur when querying a collection. */
|
|
86
|
+
export type QueryCollectionError = UpdateCollectionError;
|
|
87
|
+
|
|
88
|
+
/** Errors that can occur when listing, upserting, updating, deleting, or fetching docs, or when calling bulkUpsert. */
|
|
89
|
+
export type ListDocsError = UpdateCollectionError;
|
|
90
|
+
export type UpsertDocsError = UpdateCollectionError;
|
|
91
|
+
export type UpdateDocsError = UpdateCollectionError;
|
|
92
|
+
export type DeleteDocsError = UpdateCollectionError;
|
|
93
|
+
export type FetchDocsError = UpdateCollectionError;
|
|
94
|
+
export type BulkUpsertDocsError = UpdateCollectionError;
|
|
95
|
+
|
|
96
|
+
/** Errors that can occur when getting bulk upsert docs info. */
|
|
97
|
+
export type GetBulkUpsertDocsError = ListCollectionsError;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public API types for the collection-scoped client.
|
|
3
|
+
* Only request-body–level inputs and method return types are exposed.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// ---- Input types (RequestBody / Request aliased as XxxInput) ----
|
|
7
|
+
export type { CreateCollectionRequest as CreateCollectionInput } from "../models/operations/createcollection.js";
|
|
8
|
+
export type { UpdateCollectionRequestBody as UpdateCollectionInput } from "../models/operations/updatecollection.js";
|
|
9
|
+
export type { QueryCollectionRequestBody as QueryCollectionInput } from "../models/operations/querycollection.js";
|
|
10
|
+
export type { UpsertDocsRequestBody as UpsertDocsInput } from "../models/operations/upsertdocs.js";
|
|
11
|
+
export type { UpdateDocsRequestBody as UpdateDocsInput } from "../models/operations/updatedocs.js";
|
|
12
|
+
export type { DeleteDocsRequestBody as DeleteDocsInput } from "../models/operations/deletedocs.js";
|
|
13
|
+
export type { FetchDocsRequestBody as FetchDocsInput } from "../models/operations/fetchdocs.js";
|
|
14
|
+
export type { BulkUpsertDocsRequestBody as BulkUpsertInput } from "../models/operations/bulkupsertdocs.js";
|
|
15
|
+
|
|
16
|
+
import type { ListDocsRequest } from "../models/operations/listdocs.js";
|
|
17
|
+
|
|
18
|
+
/** Parameters for listing documents (size, pageToken). */
|
|
19
|
+
export type ListDocsInput = Pick<ListDocsRequest, "size" | "pageToken">;
|
|
20
|
+
|
|
21
|
+
// ---- Response types ----
|
|
22
|
+
export type { ListCollectionsResponse } from "../models/operations/listcollections.js";
|
|
23
|
+
export type { CreateCollectionResponse } from "../models/operations/createcollection.js";
|
|
24
|
+
export type { GetCollectionResponse } from "../models/operations/getcollection.js";
|
|
25
|
+
export type { UpdateCollectionResponse } from "../models/operations/updatecollection.js";
|
|
26
|
+
export type {
|
|
27
|
+
QueryCollectionResponse,
|
|
28
|
+
QueryCollectionDoc,
|
|
29
|
+
} from "../models/operations/querycollection.js";
|
|
30
|
+
export type { ListDocsResponse } from "../models/operations/listdocs.js";
|
|
31
|
+
export type { MessageResponse } from "../models/index.js";
|
|
32
|
+
export type {
|
|
33
|
+
FetchDocsResponse,
|
|
34
|
+
FetchDocsDoc,
|
|
35
|
+
} from "../models/operations/fetchdocs.js";
|
|
36
|
+
export type { GetBulkUpsertDocsResponse } from "../models/operations/getbulkupsertdocs.js";
|
|
37
|
+
|
|
38
|
+
// ---- Models referenced by request/response bodies ----
|
|
39
|
+
export type {
|
|
40
|
+
IndexConfigsUnion,
|
|
41
|
+
PartitionConfig,
|
|
42
|
+
PartitionFilter,
|
|
43
|
+
FieldsSelectorUnion,
|
|
44
|
+
CollectionResponse,
|
|
45
|
+
} from "../models/index.js";
|