WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 76b49f2

Browse files
improve types for documentation
1 parent 86d7320 commit 76b49f2

File tree

4 files changed

+57
-0
lines changed

4 files changed

+57
-0
lines changed

packages/oc-azure-storage-adapter/src/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,27 @@ async function streamToBuffer(readableStream: NodeJS.ReadableStream) {
3636
}
3737

3838
export interface AzureConfig extends StorageAdapterBaseConfig {
39+
/**
40+
* Name of the **public** Azure Blob container that will host the static,
41+
* publicly accessible files of a component (css, js, templates, etc.).
42+
*/
3943
publicContainerName: string;
44+
45+
/**
46+
* Name of the **private** Azure Blob container that will host files that must
47+
* not be publicly accessible (e.g. `server.js`, dot-files, etc.).
48+
*/
4049
privateContainerName: string;
50+
51+
/**
52+
* Azure Storage account name that owns the containers.
53+
*/
4154
accountName: string;
55+
56+
/**
57+
* Access key for the storage account. If **omitted**, the adapter falls back
58+
* to Azure's default credential chain (`DefaultAzureCredential`). Optional.
59+
*/
4260
accountKey?: string;
4361
}
4462

packages/oc-gs-storage-adapter/src/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,18 @@ const getPaths: (path: string) => Promise<PathsResult> = promisify(
1717
);
1818

1919
export interface GsConfig extends StorageAdapterBaseConfig {
20+
/**
21+
* Name of the Google Cloud Storage bucket that will host the component files.
22+
*/
2023
bucket: string;
24+
/**
25+
* Google Cloud project ID that owns the bucket.
26+
*/
2127
projectId: string;
28+
/**
29+
* Cache-Control max-age (in seconds) to apply to public files. If not set, defaults to 3600.
30+
* Optional.
31+
*/
2232
maxAge?: boolean;
2333
}
2434

packages/oc-s3-storage-adapter/src/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,25 @@ type RequireAllOrNone<ObjectType, KeysType extends keyof ObjectType = never> = (
3434
export type S3Config = StorageAdapterBaseConfig &
3535
RequireAllOrNone<
3636
{
37+
/** Name of the AWS S3 bucket where components will be stored. */
3738
bucket: string;
39+
/** AWS region where the bucket is located (e.g. "eu-west-1"). */
3840
region: string;
41+
/** AWS access key ID. Must be provided together with `secret`, or both omitted to use IAM role credentials. */
3942
key?: string;
43+
/** AWS secret access key. Must be provided together with `key`, or both omitted to use IAM role credentials. */
4044
secret?: string;
45+
/** When `false`, disables SSL for S3 requests. Defaults to `true`. Optional. */
4146
sslEnabled?: boolean;
47+
/** Force path-style URLs instead of virtual host style. Optional. */
4248
s3ForcePathStyle?: boolean;
49+
/** Socket timeout (in milliseconds) for S3 requests. Optional. */
4350
timeout?: number;
51+
/** Custom HTTP/HTTPS agent to use (e.g. proxy agent). Optional. */
4452
agentProxy?: httpAgent | httpsAgent;
53+
/** Custom S3 endpoint (useful for S3-compatible services or local testing). Optional. */
4554
endpoint?: string;
55+
/** When `true`, enables AWS SDK debug logging to the console. Optional. */
4656
debug?: boolean;
4757
},
4858
'key' | 'secret'

packages/oc-storage-adapters-utils/src/index.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,28 @@ export { getNextYear } from './get-next-year';
44
export * as strings from './strings';
55

66
export interface StorageAdapterBaseConfig {
7+
/**
8+
* Local folder that contains the compiled OC components ready to be uploaded
9+
* to the storage provider.
10+
*/
711
componentsDir: string;
12+
13+
/**
14+
* Public CDN prefix where components will be served from (for example,
15+
* "https://cdn.myorg.com/"). Adapters use this to build the URLs returned by
16+
* `getUrl()`.
17+
*/
818
path: string;
19+
20+
/**
21+
* When set to `true`, enables verbose logging during adapter operations such
22+
* as upload or removal. Optional.
23+
*/
924
verbosity?: boolean;
25+
26+
/**
27+
* Time-to-live for the in-memory cache, in milliseconds. Optional.
28+
*/
1029
refreshInterval?: number;
1130
}
1231

0 commit comments

Comments
 (0)