@spica-devkit/sync 0.19.8

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/index.d.ts ADDED
@@ -0,0 +1,68 @@
1
+ interface SpicaConnection {
2
+ url: string;
3
+ authorization: string;
4
+ }
5
+ declare class SpicaRequestError extends Error {
6
+ readonly status?: number;
7
+ readonly data?: unknown;
8
+ constructor(message: string, status?: number, data?: unknown);
9
+ }
10
+
11
+ type ResourceFiles = Record<string, string> | Map<string, string>;
12
+ interface PlanOptions {
13
+ connection: SpicaConnection;
14
+ files: ResourceFiles;
15
+ modules?: string[];
16
+ concurrency?: number;
17
+ maxDiffLength?: number;
18
+ }
19
+ interface ApplyOptions extends PlanOptions {
20
+ fingerprint: string;
21
+ abortOnError?: boolean;
22
+ }
23
+ interface SyncPlanEntry {
24
+ slug: string;
25
+ summary: string;
26
+ changedFields: string[];
27
+ diffs: Record<string, string>;
28
+ omittedDiffs: string[];
29
+ }
30
+ interface SyncModulePlan {
31
+ module: string;
32
+ displayName: string;
33
+ creates: SyncPlanEntry[];
34
+ updates: SyncPlanEntry[];
35
+ deletes: SyncPlanEntry[];
36
+ }
37
+ interface SyncPlan {
38
+ fingerprint: string;
39
+ totals: {
40
+ creates: number;
41
+ updates: number;
42
+ deletes: number;
43
+ };
44
+ modules: SyncModulePlan[];
45
+ }
46
+ type ApplyResult = {
47
+ status: "outdated";
48
+ plan: SyncPlan;
49
+ } | {
50
+ status: "succeeded" | "partial" | "failed";
51
+ plan: SyncPlan;
52
+ errors: string[];
53
+ };
54
+ declare function plan(options: PlanOptions): Promise<SyncPlan>;
55
+ declare function apply(options: ApplyOptions): Promise<ApplyResult>;
56
+
57
+ interface ReadTarballOptions {
58
+ path?: string;
59
+ stripComponents?: number;
60
+ maxFileBytes?: number;
61
+ maxTotalBytes?: number;
62
+ maxFiles?: number;
63
+ }
64
+ type TarballInput = Uint8Array | AsyncIterable<Uint8Array>;
65
+ declare function readTarball(input: TarballInput, options?: ReadTarballOptions): Promise<Map<string, string>>;
66
+
67
+ export { SpicaRequestError, apply, plan, readTarball };
68
+ export type { ApplyOptions, ApplyResult, PlanOptions, ReadTarballOptions, ResourceFiles, SpicaConnection, SyncModulePlan, SyncPlan, SyncPlanEntry, TarballInput };