@helloao/cli 0.0.18 → 0.0.19

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.
@@ -0,0 +1,96 @@
1
+ import { SerializedFile } from './db.js';
2
+ import { Uploader } from './files.js';
3
+ import { DatasetOutput } from '@helloao/tools/generation/dataset.js';
4
+ import { PrismaClient } from './prisma-gen/index.js';
5
+ import { GenerateApiOptions } from '@helloao/tools/generation/api.js';
6
+ export interface UploadApiFromDatabaseOptions extends UploadApiOptions, GenerateApiOptions {
7
+ /**
8
+ * The number of files to upload in each batch.
9
+ */
10
+ batchSize: string | number;
11
+ }
12
+ export interface UploadApiOptions {
13
+ /**
14
+ * Whether to overwrite existing files.
15
+ */
16
+ overwrite?: boolean;
17
+ /**
18
+ * Whether to only overwrite common files.
19
+ * "Common files" are files that are similar between translations, like the books.json endpoint, or individual chapter endpoints.
20
+ */
21
+ overwriteCommonFiles?: boolean;
22
+ /**
23
+ * Whether to only overwrite merged files.
24
+ * "Merged files" are files that are generated from multiple translations, like the available_translations.json endpoint.
25
+ */
26
+ overwriteMergedFiles?: boolean;
27
+ /**
28
+ * The file pattern regex that should be used to filter the files that are uploaded.
29
+ */
30
+ filePattern?: string;
31
+ /**
32
+ * The translations to generate API files for.
33
+ */
34
+ translations?: string[];
35
+ /**
36
+ * The AWS profile to use for uploading to S3.
37
+ */
38
+ profile?: string;
39
+ /**
40
+ * The AWS access key ID to use for uploading to S3.
41
+ */
42
+ accessKeyId?: string;
43
+ /**
44
+ * The AWS secret access key to use for uploading to S3.
45
+ */
46
+ secretAccessKey?: string;
47
+ /**
48
+ * The AWS region to use for uploading to S3.
49
+ */
50
+ s3Region?: string;
51
+ /**
52
+ * Whether to generate API files that use the common name instead of book IDs.
53
+ */
54
+ useCommonName?: boolean;
55
+ /**
56
+ * Whether to generate audio files for the API.
57
+ */
58
+ generateAudioFiles?: boolean;
59
+ /**
60
+ * Whether to generate pretty-printed JSON files.
61
+ */
62
+ pretty?: boolean;
63
+ /**
64
+ * Whether to output verbose log information.
65
+ */
66
+ verbose?: boolean;
67
+ }
68
+ /**
69
+ * Loads and generates the API files from the database and uploads them to the specified destination.
70
+ * @param db The database that the datasets should be loaded from.
71
+ * @param dest The destination to upload the API files to. Supported destinations are S3, zip files, and local directories.
72
+ * @param options The options to use for the upload.
73
+ */
74
+ export declare function uploadApiFilesFromDatabase(db: PrismaClient, dest: string, options: UploadApiFromDatabaseOptions): Promise<void>;
75
+ /**
76
+ * Generates the API files from the given datasets and uploads them to the specified destination.
77
+ * @param dest The destination to upload the API files to. Supported destinations are S3, zip files, and local directories.
78
+ * @param options The options to use for the upload.
79
+ * @param datasets The datasets to generate the API files from.
80
+ */
81
+ export declare function serializeAndUploadDatasets(dest: string, datasets: AsyncIterable<DatasetOutput>, options?: UploadApiOptions & GenerateApiOptions): Promise<void>;
82
+ /**
83
+ * Uploads the given serialized files to the specified destination.
84
+ * @param dest The destination to upload the API files to. Supported destinations are S3, zip files, and local directories.
85
+ * @param options The options to use for the upload.
86
+ * @param datasets The datasets to generate the API files from.
87
+ */
88
+ export declare function uploadFiles(dest: string, options: UploadApiOptions, serializedFiles: AsyncIterable<SerializedFile[]>): Promise<void>;
89
+ /**
90
+ * Uploads the given serialized files using the given uploader.
91
+ * @param uploader The uploader to use.
92
+ * @param options The options to use for the upload.
93
+ * @param datasets The datasets to generate the API files from.
94
+ */
95
+ export declare function uploadFilesUsingUploader(uploader: Uploader, options: UploadApiOptions, serializedFiles: AsyncIterable<SerializedFile[]>): Promise<void>;
96
+ //# sourceMappingURL=uploads.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helloao/cli",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "description": "A CLI and related tools for managing HelloAO's Free Bible API",
5
5
  "main": "./dist/cjs/index.cjs",
6
6
  "module": "./dist/esm/index.js",
@@ -43,7 +43,7 @@
43
43
  "all-iso-language-codes": "1.0.17",
44
44
  "papaparse": "5.4.1",
45
45
  "luxon": "3.5.0",
46
- "@helloao/tools": "0.0.18"
46
+ "@helloao/tools": "0.0.19"
47
47
  },
48
48
  "files": [
49
49
  "/README.md",