@org-quicko/silo-client 1.0.0

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 (202) hide show
  1. package/README.md +313 -0
  2. package/dist/collections/collection-definition.d.cts +10 -0
  3. package/dist/collections/collection-definition.d.ts +10 -0
  4. package/dist/collections/collection-handle.d.cts +54 -0
  5. package/dist/collections/collection-handle.d.ts +54 -0
  6. package/dist/collections/collection-schema.d.cts +16 -0
  7. package/dist/collections/collection-schema.d.ts +16 -0
  8. package/dist/collections/collection-summary.d.cts +10 -0
  9. package/dist/collections/collection-summary.d.ts +10 -0
  10. package/dist/collections/collections.d.cts +19 -0
  11. package/dist/collections/collections.d.ts +19 -0
  12. package/dist/collections/json-schema.d.cts +9 -0
  13. package/dist/collections/json-schema.d.ts +9 -0
  14. package/dist/collections/reserved-field-names.d.cts +9 -0
  15. package/dist/collections/reserved-field-names.d.ts +9 -0
  16. package/dist/entries/entry-base.d.cts +31 -0
  17. package/dist/entries/entry-base.d.ts +31 -0
  18. package/dist/entries/entry-list-query.d.cts +11 -0
  19. package/dist/entries/entry-list-query.d.ts +11 -0
  20. package/dist/entries/entry-mapper.d.cts +13 -0
  21. package/dist/entries/entry-mapper.d.ts +13 -0
  22. package/dist/entries/entry-page-stream.d.cts +14 -0
  23. package/dist/entries/entry-page-stream.d.ts +14 -0
  24. package/dist/entries/entry-page.d.cts +16 -0
  25. package/dist/entries/entry-page.d.ts +16 -0
  26. package/dist/entries/entry-payload.d.cts +12 -0
  27. package/dist/entries/entry-payload.d.ts +12 -0
  28. package/dist/entries/entry-reader.d.cts +26 -0
  29. package/dist/entries/entry-reader.d.ts +26 -0
  30. package/dist/entries/entry-stream.d.cts +5 -0
  31. package/dist/entries/entry-stream.d.ts +5 -0
  32. package/dist/entries/entry.d.cts +25 -0
  33. package/dist/entries/entry.d.ts +25 -0
  34. package/dist/entries/resolved-entry.d.cts +11 -0
  35. package/dist/entries/resolved-entry.d.ts +11 -0
  36. package/dist/errors/conflict-error.d.cts +6 -0
  37. package/dist/errors/conflict-error.d.ts +6 -0
  38. package/dist/errors/error-code.d.cts +4 -0
  39. package/dist/errors/error-code.d.ts +4 -0
  40. package/dist/errors/error-factory.d.cts +15 -0
  41. package/dist/errors/error-factory.d.ts +15 -0
  42. package/dist/errors/error-payload.d.cts +13 -0
  43. package/dist/errors/error-payload.d.ts +13 -0
  44. package/dist/errors/forbidden-error.d.cts +5 -0
  45. package/dist/errors/forbidden-error.d.ts +5 -0
  46. package/dist/errors/internal-error.d.cts +6 -0
  47. package/dist/errors/internal-error.d.ts +6 -0
  48. package/dist/errors/invalid-response-error.d.cts +11 -0
  49. package/dist/errors/invalid-response-error.d.ts +11 -0
  50. package/dist/errors/media-delete-stalled-error.d.cts +14 -0
  51. package/dist/errors/media-delete-stalled-error.d.ts +14 -0
  52. package/dist/errors/media-in-use-error.d.cts +21 -0
  53. package/dist/errors/media-in-use-error.d.ts +21 -0
  54. package/dist/errors/network-error.d.cts +11 -0
  55. package/dist/errors/network-error.d.ts +11 -0
  56. package/dist/errors/not-found-error.d.cts +6 -0
  57. package/dist/errors/not-found-error.d.ts +6 -0
  58. package/dist/errors/request-aborted-error.d.cts +10 -0
  59. package/dist/errors/request-aborted-error.d.ts +10 -0
  60. package/dist/errors/silo-error.d.cts +12 -0
  61. package/dist/errors/silo-error.d.ts +12 -0
  62. package/dist/errors/timeout-error.d.cts +11 -0
  63. package/dist/errors/timeout-error.d.ts +11 -0
  64. package/dist/errors/unauthorized-error.d.cts +5 -0
  65. package/dist/errors/unauthorized-error.d.ts +5 -0
  66. package/dist/errors/validation-detail.d.cts +8 -0
  67. package/dist/errors/validation-detail.d.ts +8 -0
  68. package/dist/errors/validation-failed-error.d.cts +11 -0
  69. package/dist/errors/validation-failed-error.d.ts +11 -0
  70. package/dist/index.cjs +2095 -0
  71. package/dist/index.d.cts +96 -0
  72. package/dist/index.d.ts +96 -0
  73. package/dist/index.js +2053 -0
  74. package/dist/instance/health-report.d.cts +5 -0
  75. package/dist/instance/health-report.d.ts +5 -0
  76. package/dist/media/media-asset-mapper.d.cts +31 -0
  77. package/dist/media/media-asset-mapper.d.ts +31 -0
  78. package/dist/media/media-asset-payload.d.cts +20 -0
  79. package/dist/media/media-asset-payload.d.ts +20 -0
  80. package/dist/media/media-asset.d.cts +63 -0
  81. package/dist/media/media-asset.d.ts +63 -0
  82. package/dist/media/media-delete-failure.d.cts +16 -0
  83. package/dist/media/media-delete-failure.d.ts +16 -0
  84. package/dist/media/media-delete-options.d.cts +9 -0
  85. package/dist/media/media-delete-options.d.ts +9 -0
  86. package/dist/media/media-delete-report.d.cts +13 -0
  87. package/dist/media/media-delete-report.d.ts +13 -0
  88. package/dist/media/media-folder-delete.d.cts +10 -0
  89. package/dist/media/media-folder-delete.d.ts +10 -0
  90. package/dist/media/media-folder-move.d.cts +9 -0
  91. package/dist/media/media-folder-move.d.ts +9 -0
  92. package/dist/media/media-folders.d.cts +22 -0
  93. package/dist/media/media-folders.d.ts +22 -0
  94. package/dist/media/media-page-stream.d.cts +10 -0
  95. package/dist/media/media-page-stream.d.ts +10 -0
  96. package/dist/media/media-page.d.cts +19 -0
  97. package/dist/media/media-page.d.ts +19 -0
  98. package/dist/media/media-query.d.cts +24 -0
  99. package/dist/media/media-query.d.ts +24 -0
  100. package/dist/media/media-reference.d.cts +18 -0
  101. package/dist/media/media-reference.d.ts +18 -0
  102. package/dist/media/media-stream.d.cts +7 -0
  103. package/dist/media/media-stream.d.ts +7 -0
  104. package/dist/media/media-upload.d.cts +18 -0
  105. package/dist/media/media-upload.d.ts +18 -0
  106. package/dist/media/media-usage-page.d.cts +35 -0
  107. package/dist/media/media-usage-page.d.ts +35 -0
  108. package/dist/media/media-usage.d.cts +13 -0
  109. package/dist/media/media-usage.d.ts +13 -0
  110. package/dist/media/media.d.cts +37 -0
  111. package/dist/media/media.d.ts +37 -0
  112. package/dist/pagination/page-window.d.cts +14 -0
  113. package/dist/pagination/page-window.d.ts +14 -0
  114. package/dist/pagination/page.d.cts +27 -0
  115. package/dist/pagination/page.d.ts +27 -0
  116. package/dist/pagination/row-stream.d.cts +28 -0
  117. package/dist/pagination/row-stream.d.ts +28 -0
  118. package/dist/query/field-path.d.cts +14 -0
  119. package/dist/query/field-path.d.ts +14 -0
  120. package/dist/query/filter-expression.d.cts +15 -0
  121. package/dist/query/filter-expression.d.ts +15 -0
  122. package/dist/query/filter-field.d.cts +19 -0
  123. package/dist/query/filter-field.d.ts +19 -0
  124. package/dist/query/filter-node.d.cts +9 -0
  125. package/dist/query/filter-node.d.ts +9 -0
  126. package/dist/query/filter-operator.d.cts +7 -0
  127. package/dist/query/filter-operator.d.ts +7 -0
  128. package/dist/query/filter.d.cts +18 -0
  129. package/dist/query/filter.d.ts +18 -0
  130. package/dist/query/sort-term.d.cts +13 -0
  131. package/dist/query/sort-term.d.ts +13 -0
  132. package/dist/query/sort.d.cts +15 -0
  133. package/dist/query/sort.d.ts +15 -0
  134. package/dist/query/typed-filter.d.cts +32 -0
  135. package/dist/query/typed-filter.d.ts +32 -0
  136. package/dist/request-options.d.cts +9 -0
  137. package/dist/request-options.d.ts +9 -0
  138. package/dist/scope/delete-options.d.cts +9 -0
  139. package/dist/scope/delete-options.d.ts +9 -0
  140. package/dist/scope/environment-handle.d.cts +29 -0
  141. package/dist/scope/environment-handle.d.ts +29 -0
  142. package/dist/scope/environment.d.cts +8 -0
  143. package/dist/scope/environment.d.ts +8 -0
  144. package/dist/scope/environments.d.cts +11 -0
  145. package/dist/scope/environments.d.ts +11 -0
  146. package/dist/scope/project-handle.d.cts +22 -0
  147. package/dist/scope/project-handle.d.ts +22 -0
  148. package/dist/scope/project.d.cts +8 -0
  149. package/dist/scope/project.d.ts +8 -0
  150. package/dist/scope/projects.d.cts +10 -0
  151. package/dist/scope/projects.d.ts +10 -0
  152. package/dist/scope/rename-options.d.cts +10 -0
  153. package/dist/scope/rename-options.d.ts +10 -0
  154. package/dist/scope/rename-report.d.cts +21 -0
  155. package/dist/scope/rename-report.d.ts +21 -0
  156. package/dist/scope/scope-reference.d.cts +12 -0
  157. package/dist/scope/scope-reference.d.ts +12 -0
  158. package/dist/search/search-engine.d.cts +3 -0
  159. package/dist/search/search-engine.d.ts +3 -0
  160. package/dist/search/search-hit.d.cts +18 -0
  161. package/dist/search/search-hit.d.ts +18 -0
  162. package/dist/search/search-page.d.cts +19 -0
  163. package/dist/search/search-page.d.ts +19 -0
  164. package/dist/search/search-query.d.cts +11 -0
  165. package/dist/search/search-query.d.ts +11 -0
  166. package/dist/search/search-reach.d.cts +12 -0
  167. package/dist/search/search-reach.d.ts +12 -0
  168. package/dist/search/search-snippet.d.cts +8 -0
  169. package/dist/search/search-snippet.d.ts +8 -0
  170. package/dist/search/search.d.cts +18 -0
  171. package/dist/search/search.d.ts +18 -0
  172. package/dist/silo-options.d.cts +12 -0
  173. package/dist/silo-options.d.ts +12 -0
  174. package/dist/silo.d.cts +42 -0
  175. package/dist/silo.d.ts +42 -0
  176. package/dist/transport/abort-signals.d.cts +23 -0
  177. package/dist/transport/abort-signals.d.ts +23 -0
  178. package/dist/transport/api-path.d.cts +36 -0
  179. package/dist/transport/api-path.d.ts +36 -0
  180. package/dist/transport/fetch-function.d.cts +11 -0
  181. package/dist/transport/fetch-function.d.ts +11 -0
  182. package/dist/transport/page-payload.d.cts +15 -0
  183. package/dist/transport/page-payload.d.ts +15 -0
  184. package/dist/transport/query-string.d.cts +10 -0
  185. package/dist/transport/query-string.d.ts +10 -0
  186. package/dist/transport/response-decoder.d.cts +14 -0
  187. package/dist/transport/response-decoder.d.ts +14 -0
  188. package/dist/transport/route-inventory.d.cts +22 -0
  189. package/dist/transport/route-inventory.d.ts +22 -0
  190. package/dist/transport/transport-request.d.cts +18 -0
  191. package/dist/transport/transport-request.d.ts +18 -0
  192. package/dist/transport/transport.d.cts +45 -0
  193. package/dist/transport/transport.d.ts +45 -0
  194. package/dist/variables/environment-variables.d.cts +14 -0
  195. package/dist/variables/environment-variables.d.ts +14 -0
  196. package/dist/variables/project-variables.d.cts +38 -0
  197. package/dist/variables/project-variables.d.ts +38 -0
  198. package/dist/variables/variable-declaration.d.cts +10 -0
  199. package/dist/variables/variable-declaration.d.ts +10 -0
  200. package/dist/variables/variable.d.cts +17 -0
  201. package/dist/variables/variable.d.ts +17 -0
  202. package/package.json +58 -0
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The one cancellation convention on every call: the last parameter of
3
+ * every method in the client. A per-call value wins over the client's own
4
+ * default timeout.
5
+ */
6
+ export interface RequestOptions {
7
+ signal?: AbortSignal;
8
+ timeoutMilliseconds?: number;
9
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The one cancellation convention on every call: the last parameter of
3
+ * every method in the client. A per-call value wins over the client's own
4
+ * default timeout.
5
+ */
6
+ export interface RequestOptions {
7
+ signal?: AbortSignal;
8
+ timeoutMilliseconds?: number;
9
+ }
@@ -0,0 +1,9 @@
1
+ import type { RequestOptions } from "../request-options.cjs";
2
+ /**
3
+ * `delete()`'s options across projects, environments, collections and
4
+ * entries. `force` bypasses the server's "not empty" or "still referenced"
5
+ * refusal.
6
+ */
7
+ export interface DeleteOptions extends RequestOptions {
8
+ force?: boolean;
9
+ }
@@ -0,0 +1,9 @@
1
+ import type { RequestOptions } from "../request-options.js";
2
+ /**
3
+ * `delete()`'s options across projects, environments, collections and
4
+ * entries. `force` bypasses the server's "not empty" or "still referenced"
5
+ * refusal.
6
+ */
7
+ export interface DeleteOptions extends RequestOptions {
8
+ force?: boolean;
9
+ }
@@ -0,0 +1,29 @@
1
+ import { CollectionHandle } from "../collections/collection-handle.cjs";
2
+ import { Collections } from "../collections/collections.cjs";
3
+ import type { CollectionDefinition } from "../collections/collection-definition.cjs";
4
+ import type { RequestOptions } from "../request-options.cjs";
5
+ import type { SearchPage } from "../search/search-page.cjs";
6
+ import type { SearchQuery } from "../search/search-query.cjs";
7
+ import { EnvironmentVariables } from "../variables/environment-variables.cjs";
8
+ import type { DeleteOptions } from "./delete-options.cjs";
9
+ import type { RenameOptions } from "./rename-options.cjs";
10
+ import { RenameReport } from "./rename-report.cjs";
11
+ import type { ScopeReference } from "./scope-reference.cjs";
12
+ /**
13
+ * One environment, addressed by the name it was built with. Immutable, for
14
+ * the reason `ProjectHandle` is.
15
+ */
16
+ export declare class EnvironmentHandle {
17
+ private readonly scope;
18
+ readonly name: string;
19
+ readonly project: string;
20
+ readonly collections: Collections;
21
+ readonly variables: EnvironmentVariables;
22
+ constructor(scope: ScopeReference);
23
+ collection<Fields = Record<string, unknown>>(name: string): CollectionHandle<Fields>;
24
+ /** Every schema in the scope, in one request. */
25
+ schemas(options?: RequestOptions): Promise<CollectionDefinition[]>;
26
+ search(query: SearchQuery, options?: RequestOptions): Promise<SearchPage>;
27
+ rename(name: string, options?: RenameOptions): Promise<RenameReport>;
28
+ delete(options?: DeleteOptions): Promise<void>;
29
+ }
@@ -0,0 +1,29 @@
1
+ import { CollectionHandle } from "../collections/collection-handle.js";
2
+ import { Collections } from "../collections/collections.js";
3
+ import type { CollectionDefinition } from "../collections/collection-definition.js";
4
+ import type { RequestOptions } from "../request-options.js";
5
+ import type { SearchPage } from "../search/search-page.js";
6
+ import type { SearchQuery } from "../search/search-query.js";
7
+ import { EnvironmentVariables } from "../variables/environment-variables.js";
8
+ import type { DeleteOptions } from "./delete-options.js";
9
+ import type { RenameOptions } from "./rename-options.js";
10
+ import { RenameReport } from "./rename-report.js";
11
+ import type { ScopeReference } from "./scope-reference.js";
12
+ /**
13
+ * One environment, addressed by the name it was built with. Immutable, for
14
+ * the reason `ProjectHandle` is.
15
+ */
16
+ export declare class EnvironmentHandle {
17
+ private readonly scope;
18
+ readonly name: string;
19
+ readonly project: string;
20
+ readonly collections: Collections;
21
+ readonly variables: EnvironmentVariables;
22
+ constructor(scope: ScopeReference);
23
+ collection<Fields = Record<string, unknown>>(name: string): CollectionHandle<Fields>;
24
+ /** Every schema in the scope, in one request. */
25
+ schemas(options?: RequestOptions): Promise<CollectionDefinition[]>;
26
+ search(query: SearchQuery, options?: RequestOptions): Promise<SearchPage>;
27
+ rename(name: string, options?: RenameOptions): Promise<RenameReport>;
28
+ delete(options?: DeleteOptions): Promise<void>;
29
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * An environment as the listing and create routes answer it. `id` is the
3
+ * record's ULID and never changes; `name` is what every path addresses.
4
+ */
5
+ export interface Environment {
6
+ readonly id: string;
7
+ readonly name: string;
8
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * An environment as the listing and create routes answer it. `id` is the
3
+ * record's ULID and never changes; `name` is what every path addresses.
4
+ */
5
+ export interface Environment {
6
+ readonly id: string;
7
+ readonly name: string;
8
+ }
@@ -0,0 +1,11 @@
1
+ import type { RequestOptions } from "../request-options.cjs";
2
+ import type { Transport } from "../transport/transport.cjs";
3
+ import type { Environment } from "./environment.cjs";
4
+ /** Environments within one project: `list` and `create`. */
5
+ export declare class Environments {
6
+ private readonly transport;
7
+ private readonly project;
8
+ constructor(transport: Transport, project: string);
9
+ list(options?: RequestOptions): Promise<Environment[]>;
10
+ create(name: string, options?: RequestOptions): Promise<Environment>;
11
+ }
@@ -0,0 +1,11 @@
1
+ import type { RequestOptions } from "../request-options.js";
2
+ import type { Transport } from "../transport/transport.js";
3
+ import type { Environment } from "./environment.js";
4
+ /** Environments within one project: `list` and `create`. */
5
+ export declare class Environments {
6
+ private readonly transport;
7
+ private readonly project;
8
+ constructor(transport: Transport, project: string);
9
+ list(options?: RequestOptions): Promise<Environment[]>;
10
+ create(name: string, options?: RequestOptions): Promise<Environment>;
11
+ }
@@ -0,0 +1,22 @@
1
+ import type { Transport } from "../transport/transport.cjs";
2
+ import { ProjectVariables } from "../variables/project-variables.cjs";
3
+ import type { DeleteOptions } from "./delete-options.cjs";
4
+ import { EnvironmentHandle } from "./environment-handle.cjs";
5
+ import { Environments } from "./environments.cjs";
6
+ import type { RenameOptions } from "./rename-options.cjs";
7
+ import { RenameReport } from "./rename-report.cjs";
8
+ /**
9
+ * One project, addressed by the name it was built with. Immutable: after a
10
+ * rename this handle still addresses the name that no longer exists, and its
11
+ * next call is a `NotFoundError`. Build a new handle for the new name.
12
+ */
13
+ export declare class ProjectHandle {
14
+ private readonly transport;
15
+ readonly name: string;
16
+ readonly environments: Environments;
17
+ readonly variables: ProjectVariables;
18
+ constructor(transport: Transport, name: string);
19
+ environment(name: string): EnvironmentHandle;
20
+ rename(name: string, options?: RenameOptions): Promise<RenameReport>;
21
+ delete(options?: DeleteOptions): Promise<void>;
22
+ }
@@ -0,0 +1,22 @@
1
+ import type { Transport } from "../transport/transport.js";
2
+ import { ProjectVariables } from "../variables/project-variables.js";
3
+ import type { DeleteOptions } from "./delete-options.js";
4
+ import { EnvironmentHandle } from "./environment-handle.js";
5
+ import { Environments } from "./environments.js";
6
+ import type { RenameOptions } from "./rename-options.js";
7
+ import { RenameReport } from "./rename-report.js";
8
+ /**
9
+ * One project, addressed by the name it was built with. Immutable: after a
10
+ * rename this handle still addresses the name that no longer exists, and its
11
+ * next call is a `NotFoundError`. Build a new handle for the new name.
12
+ */
13
+ export declare class ProjectHandle {
14
+ private readonly transport;
15
+ readonly name: string;
16
+ readonly environments: Environments;
17
+ readonly variables: ProjectVariables;
18
+ constructor(transport: Transport, name: string);
19
+ environment(name: string): EnvironmentHandle;
20
+ rename(name: string, options?: RenameOptions): Promise<RenameReport>;
21
+ delete(options?: DeleteOptions): Promise<void>;
22
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * A project as the listing and create routes answer it. `id` is the record's
3
+ * ULID and never changes; `name` is what every path addresses.
4
+ */
5
+ export interface Project {
6
+ readonly id: string;
7
+ readonly name: string;
8
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * A project as the listing and create routes answer it. `id` is the record's
3
+ * ULID and never changes; `name` is what every path addresses.
4
+ */
5
+ export interface Project {
6
+ readonly id: string;
7
+ readonly name: string;
8
+ }
@@ -0,0 +1,10 @@
1
+ import type { RequestOptions } from "../request-options.cjs";
2
+ import type { Transport } from "../transport/transport.cjs";
3
+ import type { Project } from "./project.cjs";
4
+ /** Projects at the instance root: `list` and `create`. */
5
+ export declare class Projects {
6
+ private readonly transport;
7
+ constructor(transport: Transport);
8
+ list(options?: RequestOptions): Promise<Project[]>;
9
+ create(name: string, options?: RequestOptions): Promise<Project>;
10
+ }
@@ -0,0 +1,10 @@
1
+ import type { RequestOptions } from "../request-options.js";
2
+ import type { Transport } from "../transport/transport.js";
3
+ import type { Project } from "./project.js";
4
+ /** Projects at the instance root: `list` and `create`. */
5
+ export declare class Projects {
6
+ private readonly transport;
7
+ constructor(transport: Transport);
8
+ list(options?: RequestOptions): Promise<Project[]>;
9
+ create(name: string, options?: RequestOptions): Promise<Project>;
10
+ }
@@ -0,0 +1,10 @@
1
+ import type { RequestOptions } from "../request-options.cjs";
2
+ /**
3
+ * `rename()`'s options across projects, environments and collections.
4
+ * `expectedId` binds the call to the record a caller already read — from a
5
+ * dry run's report, from `list()`, or supplied directly.
6
+ */
7
+ export interface RenameOptions extends RequestOptions {
8
+ expectedId?: string;
9
+ dryRun?: boolean;
10
+ }
@@ -0,0 +1,10 @@
1
+ import type { RequestOptions } from "../request-options.js";
2
+ /**
3
+ * `rename()`'s options across projects, environments and collections.
4
+ * `expectedId` binds the call to the record a caller already read — from a
5
+ * dry run's report, from `list()`, or supplied directly.
6
+ */
7
+ export interface RenameOptions extends RequestOptions {
8
+ expectedId?: string;
9
+ dryRun?: boolean;
10
+ }
@@ -0,0 +1,21 @@
1
+ /** The wire's rename preview/result shape, exactly as the server answers it. */
2
+ export interface RenamePreviewPayload {
3
+ id: string;
4
+ from: string;
5
+ to: string;
6
+ rewritten_claims: string[];
7
+ pattern_affected_claims: string[];
8
+ }
9
+ /**
10
+ * What a rename did, or would do. `id` is the record the rename acted
11
+ * on — pass it as `expectedId` to turn a dry run's report into the real call.
12
+ */
13
+ export declare class RenameReport {
14
+ readonly id: string;
15
+ readonly from: string;
16
+ readonly to: string;
17
+ readonly rewrittenClaims: readonly string[];
18
+ readonly patternAffectedClaims: readonly string[];
19
+ private constructor();
20
+ static fromWire(payload: RenamePreviewPayload): RenameReport;
21
+ }
@@ -0,0 +1,21 @@
1
+ /** The wire's rename preview/result shape, exactly as the server answers it. */
2
+ export interface RenamePreviewPayload {
3
+ id: string;
4
+ from: string;
5
+ to: string;
6
+ rewritten_claims: string[];
7
+ pattern_affected_claims: string[];
8
+ }
9
+ /**
10
+ * What a rename did, or would do. `id` is the record the rename acted
11
+ * on — pass it as `expectedId` to turn a dry run's report into the real call.
12
+ */
13
+ export declare class RenameReport {
14
+ readonly id: string;
15
+ readonly from: string;
16
+ readonly to: string;
17
+ readonly rewrittenClaims: readonly string[];
18
+ readonly patternAffectedClaims: readonly string[];
19
+ private constructor();
20
+ static fromWire(payload: RenamePreviewPayload): RenameReport;
21
+ }
@@ -0,0 +1,12 @@
1
+ import type { Transport } from "../transport/transport.cjs";
2
+ /**
3
+ * The transport plus the project and environment names a handle needs to
4
+ * build its own paths — what `EnvironmentHandle` hands to everything it
5
+ * constructs, so none of them repeats the same three constructor parameters.
6
+ */
7
+ export declare class ScopeReference {
8
+ readonly transport: Transport;
9
+ readonly project: string;
10
+ readonly environment: string;
11
+ constructor(transport: Transport, project: string, environment: string);
12
+ }
@@ -0,0 +1,12 @@
1
+ import type { Transport } from "../transport/transport.js";
2
+ /**
3
+ * The transport plus the project and environment names a handle needs to
4
+ * build its own paths — what `EnvironmentHandle` hands to everything it
5
+ * constructs, so none of them repeats the same three constructor parameters.
6
+ */
7
+ export declare class ScopeReference {
8
+ readonly transport: Transport;
9
+ readonly project: string;
10
+ readonly environment: string;
11
+ constructor(transport: Transport, project: string, environment: string);
12
+ }
@@ -0,0 +1,3 @@
1
+ /** Which engine answered a search: the portable in-process scan, or SQLite
2
+ * FTS5 where the build has it. */
3
+ export type SearchEngine = "fts5" | "scan";
@@ -0,0 +1,3 @@
1
+ /** Which engine answered a search: the portable in-process scan, or SQLite
2
+ * FTS5 where the build has it. */
3
+ export type SearchEngine = "fts5" | "scan";
@@ -0,0 +1,18 @@
1
+ import type { ResolvedEntry } from "../entries/resolved-entry.cjs";
2
+ import type { SearchSnippet } from "./search-snippet.cjs";
3
+ /**
4
+ * One result. The location sits on the hit rather than on the entry, which is
5
+ * what lets a caller link to a result found outside the scope on screen, and
6
+ * `environment` is mapped from the wire's `env`.
7
+ *
8
+ * The entry is always a `ResolvedEntry`: a result is not addressed to one
9
+ * typed collection, so there is no `Fields` to give it, and it is not meant to
10
+ * be edited from here — re-read through `collection.edit()` for that.
11
+ */
12
+ export interface SearchHit {
13
+ readonly project: string;
14
+ readonly environment: string;
15
+ readonly collection: string;
16
+ readonly entry: ResolvedEntry<unknown>;
17
+ readonly snippets: readonly SearchSnippet[];
18
+ }
@@ -0,0 +1,18 @@
1
+ import type { ResolvedEntry } from "../entries/resolved-entry.js";
2
+ import type { SearchSnippet } from "./search-snippet.js";
3
+ /**
4
+ * One result. The location sits on the hit rather than on the entry, which is
5
+ * what lets a caller link to a result found outside the scope on screen, and
6
+ * `environment` is mapped from the wire's `env`.
7
+ *
8
+ * The entry is always a `ResolvedEntry`: a result is not addressed to one
9
+ * typed collection, so there is no `Fields` to give it, and it is not meant to
10
+ * be edited from here — re-read through `collection.edit()` for that.
11
+ */
12
+ export interface SearchHit {
13
+ readonly project: string;
14
+ readonly environment: string;
15
+ readonly collection: string;
16
+ readonly entry: ResolvedEntry<unknown>;
17
+ readonly snippets: readonly SearchSnippet[];
18
+ }
@@ -0,0 +1,19 @@
1
+ import { Page } from "../pagination/page.cjs";
2
+ import type { PageWindow } from "../pagination/page-window.cjs";
3
+ import type { SearchEngine } from "./search-engine.cjs";
4
+ import type { SearchHit } from "./search-hit.cjs";
5
+ /** Loads the page at `window`, keeping whatever query produced this page. */
6
+ export type SearchPageLoader = (window: PageWindow) => Promise<SearchPage>;
7
+ /**
8
+ * One page of search results. `pageCount` is `null` when
9
+ * `truncated` — the base `Page` class already does that; this only adds
10
+ * `hits` and `engine`.
11
+ */
12
+ export declare class SearchPage extends Page<SearchHit> {
13
+ private readonly loader;
14
+ readonly engine: SearchEngine;
15
+ constructor(rows: readonly SearchHit[], total: number, window: PageWindow, truncated: boolean, engine: SearchEngine, loader: SearchPageLoader);
16
+ get hits(): readonly SearchHit[];
17
+ next(): Promise<SearchPage | null>;
18
+ previous(): Promise<SearchPage | null>;
19
+ }
@@ -0,0 +1,19 @@
1
+ import { Page } from "../pagination/page.js";
2
+ import type { PageWindow } from "../pagination/page-window.js";
3
+ import type { SearchEngine } from "./search-engine.js";
4
+ import type { SearchHit } from "./search-hit.js";
5
+ /** Loads the page at `window`, keeping whatever query produced this page. */
6
+ export type SearchPageLoader = (window: PageWindow) => Promise<SearchPage>;
7
+ /**
8
+ * One page of search results. `pageCount` is `null` when
9
+ * `truncated` — the base `Page` class already does that; this only adds
10
+ * `hits` and `engine`.
11
+ */
12
+ export declare class SearchPage extends Page<SearchHit> {
13
+ private readonly loader;
14
+ readonly engine: SearchEngine;
15
+ constructor(rows: readonly SearchHit[], total: number, window: PageWindow, truncated: boolean, engine: SearchEngine, loader: SearchPageLoader);
16
+ get hits(): readonly SearchHit[];
17
+ next(): Promise<SearchPage | null>;
18
+ previous(): Promise<SearchPage | null>;
19
+ }
@@ -0,0 +1,11 @@
1
+ import type { FilterExpression } from "../query/filter-expression.cjs";
2
+ import type { SortTerm } from "../query/sort-term.cjs";
3
+ /** Everything a search accepts, all optional. `query` maps to the wire's
4
+ * `q`; omitting `sort` ranks by relevance instead. */
5
+ export interface SearchQuery {
6
+ query?: string;
7
+ where?: FilterExpression;
8
+ sort?: SortTerm | string;
9
+ limit?: number;
10
+ offset?: number;
11
+ }
@@ -0,0 +1,11 @@
1
+ import type { FilterExpression } from "../query/filter-expression.js";
2
+ import type { SortTerm } from "../query/sort-term.js";
3
+ /** Everything a search accepts, all optional. `query` maps to the wire's
4
+ * `q`; omitting `sort` ranks by relevance instead. */
5
+ export interface SearchQuery {
6
+ query?: string;
7
+ where?: FilterExpression;
8
+ sort?: SortTerm | string;
9
+ limit?: number;
10
+ offset?: number;
11
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * How far one search reaches: one collection, one environment, or the
3
+ * whole instance. The reach is the receiver a caller calls `search()` on, so
4
+ * a forgotten argument cannot widen a search past what was asked for.
5
+ */
6
+ export declare class SearchReach {
7
+ readonly path: string;
8
+ private constructor();
9
+ static collection(project: string, environment: string, name: string): SearchReach;
10
+ static environment(project: string, environment: string): SearchReach;
11
+ static instance(): SearchReach;
12
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * How far one search reaches: one collection, one environment, or the
3
+ * whole instance. The reach is the receiver a caller calls `search()` on, so
4
+ * a forgotten argument cannot widen a search past what was asked for.
5
+ */
6
+ export declare class SearchReach {
7
+ readonly path: string;
8
+ private constructor();
9
+ static collection(project: string, environment: string, name: string): SearchReach;
10
+ static environment(project: string, environment: string): SearchReach;
11
+ static instance(): SearchReach;
12
+ }
@@ -0,0 +1,8 @@
1
+ /** Where a match was found, split into three plain strings rather than one
2
+ * with markers in it: the fragment is `before + match + after`. */
3
+ export interface SearchSnippet {
4
+ readonly path: string;
5
+ readonly before: string;
6
+ readonly match: string;
7
+ readonly after: string;
8
+ }
@@ -0,0 +1,8 @@
1
+ /** Where a match was found, split into three plain strings rather than one
2
+ * with markers in it: the fragment is `before + match + after`. */
3
+ export interface SearchSnippet {
4
+ readonly path: string;
5
+ readonly before: string;
6
+ readonly match: string;
7
+ readonly after: string;
8
+ }
@@ -0,0 +1,18 @@
1
+ import type { RequestOptions } from "../request-options.cjs";
2
+ import type { Transport } from "../transport/transport.cjs";
3
+ import { SearchPage } from "./search-page.cjs";
4
+ import type { SearchQuery } from "./search-query.cjs";
5
+ import type { SearchReach } from "./search-reach.cjs";
6
+ /**
7
+ * Search, bound to one reach: a collection, an environment, or the
8
+ * whole instance. `CollectionHandle.search`, `EnvironmentHandle.search` and
9
+ * the root `Silo.search` each construct one of these against their own
10
+ * reach rather than exposing a reach as an argument that could be forgotten.
11
+ */
12
+ export declare class Search {
13
+ private readonly transport;
14
+ private readonly reach;
15
+ constructor(transport: Transport, reach: SearchReach);
16
+ run(query: SearchQuery, options?: RequestOptions): Promise<SearchPage>;
17
+ private toHit;
18
+ }
@@ -0,0 +1,18 @@
1
+ import type { RequestOptions } from "../request-options.js";
2
+ import type { Transport } from "../transport/transport.js";
3
+ import { SearchPage } from "./search-page.js";
4
+ import type { SearchQuery } from "./search-query.js";
5
+ import type { SearchReach } from "./search-reach.js";
6
+ /**
7
+ * Search, bound to one reach: a collection, an environment, or the
8
+ * whole instance. `CollectionHandle.search`, `EnvironmentHandle.search` and
9
+ * the root `Silo.search` each construct one of these against their own
10
+ * reach rather than exposing a reach as an argument that could be forgotten.
11
+ */
12
+ export declare class Search {
13
+ private readonly transport;
14
+ private readonly reach;
15
+ constructor(transport: Transport, reach: SearchReach);
16
+ run(query: SearchQuery, options?: RequestOptions): Promise<SearchPage>;
17
+ private toHit;
18
+ }
@@ -0,0 +1,12 @@
1
+ import type { FetchFunction } from "./transport/fetch-function.cjs";
2
+ /**
3
+ * Everything `new Silo(...)` accepts. Only `url` is required: a key is
4
+ * optional because anonymous reads are legal.
5
+ */
6
+ export interface SiloOptions {
7
+ url: string;
8
+ key?: string;
9
+ timeoutMilliseconds?: number;
10
+ headers?: Record<string, string>;
11
+ fetch?: FetchFunction;
12
+ }
@@ -0,0 +1,12 @@
1
+ import type { FetchFunction } from "./transport/fetch-function.js";
2
+ /**
3
+ * Everything `new Silo(...)` accepts. Only `url` is required: a key is
4
+ * optional because anonymous reads are legal.
5
+ */
6
+ export interface SiloOptions {
7
+ url: string;
8
+ key?: string;
9
+ timeoutMilliseconds?: number;
10
+ headers?: Record<string, string>;
11
+ fetch?: FetchFunction;
12
+ }
@@ -0,0 +1,42 @@
1
+ import type { HealthReport } from "./instance/health-report.cjs";
2
+ import { Media } from "./media/media.cjs";
3
+ import type { RequestOptions } from "./request-options.cjs";
4
+ import { ProjectHandle } from "./scope/project-handle.cjs";
5
+ import { Projects } from "./scope/projects.cjs";
6
+ import type { EnvironmentHandle } from "./scope/environment-handle.cjs";
7
+ import type { SearchPage } from "./search/search-page.cjs";
8
+ import type { SearchQuery } from "./search/search-query.cjs";
9
+ import type { SiloOptions } from "./silo-options.cjs";
10
+ /**
11
+ * One silo instance. Navigate it the way the API is shaped:
12
+ * `silo.project("acme").environment("prod").collection<Post>("posts")`.
13
+ *
14
+ * Handles are value objects and make no request, so nothing in a chain needs
15
+ * an `await` until the call at the end. There is deliberately no default
16
+ * project or environment: both names are always given.
17
+ */
18
+ export declare class Silo {
19
+ /** The projects this key can see, and creating one. */
20
+ readonly projects: Projects;
21
+ /** The media catalog. Media is instance-global, so it takes no scope. */
22
+ readonly media: Media;
23
+ private readonly options;
24
+ private readonly transport;
25
+ constructor(options: SiloOptions);
26
+ /** One project, by the name every path addresses it with. */
27
+ project(name: string): ProjectHandle;
28
+ /** `silo.project(p).environment(e)` in one call. Still takes both names. */
29
+ scope(project: string, environment: string): EnvironmentHandle;
30
+ /**
31
+ * Search everything this key can read. The narrower reaches are
32
+ * `environment.search()` and `collection.search()`, so a reach is always
33
+ * the receiver and never an argument that could be forgotten.
34
+ */
35
+ search(query: SearchQuery, options?: RequestOptions): Promise<SearchPage>;
36
+ /** Liveness and version. The one route that is never authenticated. */
37
+ health(options?: RequestOptions): Promise<HealthReport>;
38
+ /** The same instance read with a different key. */
39
+ withKey(key: string | undefined): Silo;
40
+ /** The same options pointed at a different server. */
41
+ withUrl(url: string): Silo;
42
+ }