@storyshelf/storage-azure 0.6.1 → 0.7.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.
- package/README.md +13 -0
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -75,6 +75,19 @@ interface AzureStorageOptions {
|
|
|
75
75
|
}
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
+
Options at a glance:
|
|
79
|
+
|
|
80
|
+
| Option | Required | Notes |
|
|
81
|
+
| ---------------------------- | -------- | ------------------------------------------------------ |
|
|
82
|
+
| `container` | yes | Blob container name |
|
|
83
|
+
| `prefix` | no | Key prefix applied to every object |
|
|
84
|
+
| `client` | no | Pre-built `ContainerClient`; skips client construction |
|
|
85
|
+
| `connectionString` | no\* | Storage connection string |
|
|
86
|
+
| `accountName` / `accountKey` | no\* | Explicit credentials pair |
|
|
87
|
+
| `accountUrl` / `sasToken` | no\* | URL + SAS form (emulator, fine-grained SAS) |
|
|
88
|
+
|
|
89
|
+
`*` At least one auth form is needed unless `client` is supplied.
|
|
90
|
+
|
|
78
91
|
### `createAzureStorage(options: AzureStorageOptions): StorageAdapter`
|
|
79
92
|
|
|
80
93
|
Creates a `StorageAdapter` backed by the configured Azure container. The returned adapter implements every method of the `StorageAdapter` interface (`read`, `write`, `delete`, `exists`, `list(prefix)`, `readStream`, `writeStream`).
|
package/dist/index.mjs
CHANGED
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * Azure Blob Storage adapter for StoryShelf.\n *\n * Persists captured screenshots and diff overlays in an Azure Blob container.\n * The CLI uploads the built Storybook; the server renders stories with\n * Playwright and stores the resulting blobs here.\n */\nimport type { StorageAdapter } from \"@storyshelf/core/adapter/storage\";\nimport { resolveContainerClient, type AzureContext } from \"./client.ts\";\nimport { buildAzureLifecycle } from \"./lifecycle.ts\";\nimport { azureDelete, azureExists, azureList, azureRead, azureWrite } from \"./operations.ts\";\nimport { azureReadStream, azureWriteStream } from \"./streams.ts\";\nimport type { AzureStorageOptions } from \"./types.ts\";\n\ndeclare const __PKG_VERSION__: string | undefined;\n\n/**\n * Create an Azure Blob Storage-backed StorageAdapter.\n *\n * @param options - Azure configuration options.\n * @returns A StorageAdapter backed by the configured Azure container.\n */\nexport function createAzureStorage(options: AzureStorageOptions): StorageAdapter {\n const { container: containerName, prefix = \"\" } = options;\n const container = resolveContainerClient(options, containerName);\n const ctx: AzureContext = { container, prefix };\n\n return {\n metadata: {\n name: \"Azure Blob Storage\",\n version:
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * Azure Blob Storage adapter for StoryShelf.\n *\n * Persists captured screenshots and diff overlays in an Azure Blob container.\n * The CLI uploads the built Storybook; the server renders stories with\n * Playwright and stores the resulting blobs here.\n */\nimport type { StorageAdapter } from \"@storyshelf/core/adapter/storage\";\nimport { resolveContainerClient, type AzureContext } from \"./client.ts\";\nimport { buildAzureLifecycle } from \"./lifecycle.ts\";\nimport { azureDelete, azureExists, azureList, azureRead, azureWrite } from \"./operations.ts\";\nimport { azureReadStream, azureWriteStream } from \"./streams.ts\";\nimport type { AzureStorageOptions } from \"./types.ts\";\n\ndeclare const __PKG_VERSION__: string | undefined;\n\n/**\n * Create an Azure Blob Storage-backed StorageAdapter.\n *\n * @param options - Azure configuration options.\n * @returns A StorageAdapter backed by the configured Azure container.\n */\nexport function createAzureStorage(options: AzureStorageOptions): StorageAdapter {\n const { container: containerName, prefix = \"\" } = options;\n const container = resolveContainerClient(options, containerName);\n const ctx: AzureContext = { container, prefix };\n\n return {\n metadata: {\n name: \"Azure Blob Storage\",\n version: typeof __PKG_VERSION__ === \"string\" ? __PKG_VERSION__ : \"0.0.0\",\n description: \"Azure Blob Storage adapter\",\n kind: \"azure\",\n category: \"storage\",\n },\n lifecycle: buildAzureLifecycle(container, containerName),\n async read(path) {\n return await azureRead(ctx, path);\n },\n async write(path, data) {\n await azureWrite(ctx, path, data);\n },\n async delete(path) {\n await azureDelete(ctx, path);\n },\n async exists(path) {\n return await azureExists(ctx, path);\n },\n async list(listPrefix) {\n return await azureList(ctx, listPrefix);\n },\n async writeStream(path, stream) {\n await azureWriteStream(ctx, path, stream);\n },\n async readStream(path) {\n return await azureReadStream(ctx, path);\n },\n };\n}\n\nexport type { AzureStorageOptions } from \"./types.ts\";\nexport { azureKey } from \"./keys.ts\";\n"],"mappings":";;;;;;;;;;;;;;;AAsBA,SAAgB,mBAAmB,SAA8C;CAC/E,MAAM,EAAE,WAAW,eAAe,SAAS,OAAO;CAClD,MAAM,YAAY,uBAAuB,SAAS,aAAa;CAC/D,MAAM,MAAoB;EAAE;EAAW;CAAO;CAE9C,OAAO;EACL,UAAU;GACR,MAAM;GACN,SAAA;GACA,aAAa;GACb,MAAM;GACN,UAAU;EACZ;EACA,WAAW,oBAAoB,WAAW,aAAa;EACvD,MAAM,KAAK,MAAM;GACf,OAAO,MAAM,UAAU,KAAK,IAAI;EAClC;EACA,MAAM,MAAM,MAAM,MAAM;GACtB,MAAM,WAAW,KAAK,MAAM,IAAI;EAClC;EACA,MAAM,OAAO,MAAM;GACjB,MAAM,YAAY,KAAK,IAAI;EAC7B;EACA,MAAM,OAAO,MAAM;GACjB,OAAO,MAAM,YAAY,KAAK,IAAI;EACpC;EACA,MAAM,KAAK,YAAY;GACrB,OAAO,MAAM,UAAU,KAAK,UAAU;EACxC;EACA,MAAM,YAAY,MAAM,QAAQ;GAC9B,MAAM,iBAAiB,KAAK,MAAM,MAAM;EAC1C;EACA,MAAM,WAAW,MAAM;GACrB,OAAO,MAAM,gBAAgB,KAAK,IAAI;EACxC;CACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storyshelf/storage-azure",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Azure Blob Storage adapter for StoryShelf.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"azure",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@azure/storage-blob": "^12.26.0",
|
|
56
|
-
"@storyshelf/core": "0.
|
|
56
|
+
"@storyshelf/core": "0.7.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/node": "^26.0.0",
|
|
@@ -65,6 +65,9 @@
|
|
|
65
65
|
"typescript": "^7.0.2",
|
|
66
66
|
"vitest": "^5.0.0"
|
|
67
67
|
},
|
|
68
|
+
"engines": {
|
|
69
|
+
"node": ">=24"
|
|
70
|
+
},
|
|
68
71
|
"jsr": {
|
|
69
72
|
"runtimeCompat": {
|
|
70
73
|
"node": true,
|