@endora-commerce/mod-assets-library 0.0.0-stage → 0.100.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/LICENSE +21 -0
- package/README.md +61 -2
- package/dist/admin/api/assets-library-client.d.ts +29 -0
- package/dist/admin/api/assets-library-client.d.ts.map +1 -0
- package/dist/admin/api/assets-library-client.js +70 -0
- package/dist/admin/api/assets-library-client.js.map +1 -0
- package/dist/admin/components/AssetDetailDrawer.d.ts +8 -0
- package/dist/admin/components/AssetDetailDrawer.d.ts.map +1 -0
- package/dist/admin/components/AssetDetailDrawer.js +96 -0
- package/dist/admin/components/AssetDetailDrawer.js.map +1 -0
- package/dist/admin/components/FolderTree.d.ts +13 -0
- package/dist/admin/components/FolderTree.d.ts.map +1 -0
- package/dist/admin/components/FolderTree.js +71 -0
- package/dist/admin/components/FolderTree.js.map +1 -0
- package/dist/admin/index.d.ts +44 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +46 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/pages/LibraryPage.d.ts +9 -0
- package/dist/admin/pages/LibraryPage.d.ts.map +1 -0
- package/dist/admin/pages/LibraryPage.js +163 -0
- package/dist/admin/pages/LibraryPage.js.map +1 -0
- package/dist/backend/entities/asset-folder.entity.d.ts +16 -0
- package/dist/backend/entities/asset-folder.entity.d.ts.map +1 -0
- package/dist/backend/entities/asset-folder.entity.js +57 -0
- package/dist/backend/entities/asset-folder.entity.js.map +1 -0
- package/dist/backend/entities/asset.entity.d.ts +38 -0
- package/dist/backend/entities/asset.entity.d.ts.map +1 -0
- package/dist/backend/entities/asset.entity.js +128 -0
- package/dist/backend/entities/asset.entity.js.map +1 -0
- package/dist/backend/index.d.ts +57 -0
- package/dist/backend/index.d.ts.map +1 -0
- package/dist/backend/index.js +150 -0
- package/dist/backend/index.js.map +1 -0
- package/dist/backend/jobs/hard-delete-asset.job.d.ts +18 -0
- package/dist/backend/jobs/hard-delete-asset.job.d.ts.map +1 -0
- package/dist/backend/jobs/hard-delete-asset.job.js +91 -0
- package/dist/backend/jobs/hard-delete-asset.job.js.map +1 -0
- package/dist/backend/plugin.d.ts +47 -0
- package/dist/backend/plugin.d.ts.map +1 -0
- package/dist/backend/plugin.js +96 -0
- package/dist/backend/plugin.js.map +1 -0
- package/dist/backend/routes.admin.d.ts +15 -0
- package/dist/backend/routes.admin.d.ts.map +1 -0
- package/dist/backend/routes.admin.js +189 -0
- package/dist/backend/routes.admin.js.map +1 -0
- package/dist/backend/routes.public.d.ts +14 -0
- package/dist/backend/routes.public.d.ts.map +1 -0
- package/dist/backend/routes.public.js +99 -0
- package/dist/backend/routes.public.js.map +1 -0
- package/dist/backend/services/asset-read-port.d.ts +103 -0
- package/dist/backend/services/asset-read-port.d.ts.map +1 -0
- package/dist/backend/services/asset-read-port.js +167 -0
- package/dist/backend/services/asset-read-port.js.map +1 -0
- package/dist/backend/services/assets-library.service.d.ts +76 -0
- package/dist/backend/services/assets-library.service.d.ts.map +1 -0
- package/dist/backend/services/assets-library.service.js +261 -0
- package/dist/backend/services/assets-library.service.js.map +1 -0
- package/dist/backend/services/cms-body-resolver.d.ts +6 -0
- package/dist/backend/services/cms-body-resolver.d.ts.map +1 -0
- package/dist/backend/services/cms-body-resolver.js +44 -0
- package/dist/backend/services/cms-body-resolver.js.map +1 -0
- package/dist/backend/services/folders.service.d.ts +29 -0
- package/dist/backend/services/folders.service.d.ts.map +1 -0
- package/dist/backend/services/folders.service.js +231 -0
- package/dist/backend/services/folders.service.js.map +1 -0
- package/dist/backend/services/hmac.d.ts +28 -0
- package/dist/backend/services/hmac.d.ts.map +1 -0
- package/dist/backend/services/hmac.js +50 -0
- package/dist/backend/services/hmac.js.map +1 -0
- package/dist/backend/services/reference-registry.d.ts +36 -0
- package/dist/backend/services/reference-registry.d.ts.map +1 -0
- package/dist/backend/services/reference-registry.js +63 -0
- package/dist/backend/services/reference-registry.js.map +1 -0
- package/dist/backend/services/storage/adapter-registry.d.ts +77 -0
- package/dist/backend/services/storage/adapter-registry.d.ts.map +1 -0
- package/dist/backend/services/storage/adapter-registry.js +95 -0
- package/dist/backend/services/storage/adapter-registry.js.map +1 -0
- package/dist/backend/services/storage/errors.d.ts +18 -0
- package/dist/backend/services/storage/errors.d.ts.map +1 -0
- package/dist/backend/services/storage/errors.js +30 -0
- package/dist/backend/services/storage/errors.js.map +1 -0
- package/dist/backend/services/storage/gcs-adapter.d.ts +42 -0
- package/dist/backend/services/storage/gcs-adapter.d.ts.map +1 -0
- package/dist/backend/services/storage/gcs-adapter.js +106 -0
- package/dist/backend/services/storage/gcs-adapter.js.map +1 -0
- package/dist/backend/services/storage/legacy-resolver.d.ts +15 -0
- package/dist/backend/services/storage/legacy-resolver.d.ts.map +1 -0
- package/dist/backend/services/storage/legacy-resolver.js +32 -0
- package/dist/backend/services/storage/legacy-resolver.js.map +1 -0
- package/dist/backend/services/storage/local-fs-adapter.d.ts +59 -0
- package/dist/backend/services/storage/local-fs-adapter.d.ts.map +1 -0
- package/dist/backend/services/storage/local-fs-adapter.js +153 -0
- package/dist/backend/services/storage/local-fs-adapter.js.map +1 -0
- package/dist/backend/services/storage/locator.d.ts +5 -0
- package/dist/backend/services/storage/locator.d.ts.map +1 -0
- package/dist/backend/services/storage/locator.js +16 -0
- package/dist/backend/services/storage/locator.js.map +1 -0
- package/dist/backend/services/storage/object-storage-port.d.ts +46 -0
- package/dist/backend/services/storage/object-storage-port.d.ts.map +1 -0
- package/dist/backend/services/storage/object-storage-port.js +78 -0
- package/dist/backend/services/storage/object-storage-port.js.map +1 -0
- package/dist/backend/services/storage/public-url-base.d.ts +50 -0
- package/dist/backend/services/storage/public-url-base.d.ts.map +1 -0
- package/dist/backend/services/storage/public-url-base.js +70 -0
- package/dist/backend/services/storage/public-url-base.js.map +1 -0
- package/dist/backend/services/storage/s3-adapter.d.ts +50 -0
- package/dist/backend/services/storage/s3-adapter.d.ts.map +1 -0
- package/dist/backend/services/storage/s3-adapter.js +110 -0
- package/dist/backend/services/storage/s3-adapter.js.map +1 -0
- package/dist/backend/services/storage/settings-view.d.ts +4 -0
- package/dist/backend/services/storage/settings-view.d.ts.map +1 -0
- package/dist/backend/services/storage/settings-view.js +73 -0
- package/dist/backend/services/storage/settings-view.js.map +1 -0
- package/dist/backend/services/storage/storage-adapter.d.ts +62 -0
- package/dist/backend/services/storage/storage-adapter.d.ts.map +1 -0
- package/dist/backend/services/storage/storage-adapter.js +10 -0
- package/dist/backend/services/storage/storage-adapter.js.map +1 -0
- package/dist/backend/services/upload-pipeline.d.ts +41 -0
- package/dist/backend/services/upload-pipeline.d.ts.map +1 -0
- package/dist/backend/services/upload-pipeline.js +231 -0
- package/dist/backend/services/upload-pipeline.js.map +1 -0
- package/dist/manifest.d.ts +185 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +229 -0
- package/dist/manifest.js.map +1 -0
- package/dist/migrations/20260505T102206_assets_library_init.d.ts +35 -0
- package/dist/migrations/20260505T102206_assets_library_init.d.ts.map +1 -0
- package/dist/migrations/20260505T102206_assets_library_init.js +132 -0
- package/dist/migrations/20260505T102206_assets_library_init.js.map +1 -0
- package/dist/migrations/index.d.ts +27 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +29 -0
- package/dist/migrations/index.js.map +1 -0
- package/docs/assets-library/index.md +125 -0
- package/i18n/en.json +54 -0
- package/i18n/pl.json +54 -0
- package/package.json +99 -3
- package/tailwind.css +14 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `./migrations` subpath — every migration class this module owns, as one
|
|
3
|
+
* ordered `migrations` array.
|
|
4
|
+
*
|
|
5
|
+
* The array is what the platform reads when this module is **installed**:
|
|
6
|
+
* `src/packages/package-runtime.ts` takes `exported['migrations']` and refuses
|
|
7
|
+
* the package outright when it is absent (D-168).
|
|
8
|
+
*
|
|
9
|
+
* Listed in ascending timestamp, which is the order of this module's own
|
|
10
|
+
* migrations and of nothing else (feature 081): a manifest `dependencies` array
|
|
11
|
+
* is the only thing ordering this block against another module's.
|
|
12
|
+
*
|
|
13
|
+
* The **named** exports stay beside the array, and the asymmetry with
|
|
14
|
+
* `./backend` — which publishes an array and no named class (D-168) — is
|
|
15
|
+
* deliberate. `db/migrations-registry.generated.ts` imports each class by name
|
|
16
|
+
* from this specifier, and a migration class name is contract in a way an entity
|
|
17
|
+
* class name is not: `mikro_orm_migrations` persists it, so it is a string every
|
|
18
|
+
* already-migrated database holds.
|
|
19
|
+
*
|
|
20
|
+
* A class that is in neither the array nor the barrel is a migration that does
|
|
21
|
+
* not run: `migration:pending` reports nothing pending and the first symptom is
|
|
22
|
+
* a query against a table nobody created.
|
|
23
|
+
*/
|
|
24
|
+
import { Migration20260505T102206AssetsLibraryInit } from './20260505T102206_assets_library_init.js';
|
|
25
|
+
export const migrations = [
|
|
26
|
+
Migration20260505T102206AssetsLibraryInit,
|
|
27
|
+
];
|
|
28
|
+
export { Migration20260505T102206AssetsLibraryInit, };
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,yCAAyC,EAAE,MAAM,0CAA0C,CAAC;AAErG,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,yCAAyC;CAC1C,CAAC;AAEF,OAAO,EACL,yCAAyC,GAC1C,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Assets Library
|
|
3
|
+
description: Central digital-asset library with pluggable storage adapters, soft-delete, and reference-protection guards
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Assets Library
|
|
7
|
+
|
|
8
|
+
The Assets Library is the platform's digital-asset substrate. It owns:
|
|
9
|
+
|
|
10
|
+
- A central catalogue of files (images, video, PDFs, documents) reusable
|
|
11
|
+
across Product media, Product attachments, Category main images, and CMS
|
|
12
|
+
pages.
|
|
13
|
+
- A folder tree for organising assets.
|
|
14
|
+
- Pluggable storage backends — Local filesystem, Amazon S3, GCP Cloud
|
|
15
|
+
Storage — configured from Settings, exactly one active at a time.
|
|
16
|
+
- Public/private visibility per asset.
|
|
17
|
+
- Reference protection: assets in use by Catalog or CMS cannot be deleted
|
|
18
|
+
until every reference is detached.
|
|
19
|
+
|
|
20
|
+
## Quick start
|
|
21
|
+
|
|
22
|
+
1. **Active adapter** — open Settings → Storage and pick one of `local`, `s3`,
|
|
23
|
+
or `gcs`. Defaults to `local`.
|
|
24
|
+
2. **Local FS** — set `assets.local.base_dir` (default `var/assets`). The
|
|
25
|
+
admin server creates the directory tree at upload time. Set
|
|
26
|
+
`assets.local.public_url_base` if the backend is fronted by a different
|
|
27
|
+
public hostname (e.g. a CDN or a reverse proxy); leave it blank and every
|
|
28
|
+
URL is built on this deployment's public API origin instead.
|
|
29
|
+
3. **Amazon S3** — set `assets.s3.bucket`, `assets.s3.region`,
|
|
30
|
+
`assets.s3.access_key_id`, `assets.s3.secret_access_key`. Optional:
|
|
31
|
+
`assets.s3.endpoint` (for S3-compatible providers like MinIO),
|
|
32
|
+
`assets.s3.prefix`, `assets.s3.public_base_url` (CDN base URL prefix).
|
|
33
|
+
4. **GCP Cloud Storage** — set `assets.gcs.bucket` and either
|
|
34
|
+
`assets.gcs.service_account_json` (paste the full JSON) or rely on
|
|
35
|
+
ambient credentials. Optional: `assets.gcs.prefix`,
|
|
36
|
+
`assets.gcs.public_base_url`.
|
|
37
|
+
5. **Test the connection** — `POST /api/v1/admin/assets/storage/self-check`.
|
|
38
|
+
Returns `{ ok: true }` on success or `{ ok: false, reason: ... }` on
|
|
39
|
+
misconfiguration. The dashboard is at `GET /api/v1/admin/assets/storage/state`.
|
|
40
|
+
|
|
41
|
+
## Upload constraints
|
|
42
|
+
|
|
43
|
+
Two settings gate uploads, both checked before any byte reaches the active
|
|
44
|
+
adapter:
|
|
45
|
+
|
|
46
|
+
- `assets.allowed_file_types` — list of file extensions or MIME types
|
|
47
|
+
(e.g. `["jpg", "png", "image/jpeg", "application/pdf"]`). The sentinel
|
|
48
|
+
`["*"]` (default) disables the gate. Wildcards like `image/*` match any
|
|
49
|
+
MIME under that prefix. The check considers both the declared MIME and
|
|
50
|
+
the magic-number-sniffed MIME (file-type) and rejects when either fails.
|
|
51
|
+
- `assets.max_file_size_mb` — integer cap in MB. `0` (default) disables
|
|
52
|
+
the cap.
|
|
53
|
+
|
|
54
|
+
## Visibility & private URLs
|
|
55
|
+
|
|
56
|
+
Each asset has `visibility ∈ {public, private}`. Public URLs are stable;
|
|
57
|
+
private URLs are short-lived (TTL = `assets.private_url_ttl_sec`, default
|
|
58
|
+
300s) and re-issued by the admin or storefront on every read.
|
|
59
|
+
|
|
60
|
+
For the **local FS** adapter, private URLs are HMAC-signed by the backend.
|
|
61
|
+
The signing key is sourced from the `ASSETS_LIBRARY_HMAC_KEY` env var
|
|
62
|
+
(generate with `openssl rand -hex 32`); rotate to invalidate every
|
|
63
|
+
outstanding private URL.
|
|
64
|
+
|
|
65
|
+
For **S3** and **GCS**, private URLs are V4-signed through the vendor SDK;
|
|
66
|
+
nothing in the backend needs to be configured beyond the credentials.
|
|
67
|
+
|
|
68
|
+
## Soft-delete & hard-delete
|
|
69
|
+
|
|
70
|
+
Deletes go through a two-step lifecycle:
|
|
71
|
+
|
|
72
|
+
1. `DELETE /api/v1/admin/assets/:id` → soft-delete. Sets `deletedAt` and
|
|
73
|
+
`purgeAfterAt = now + assets.soft_delete_retention_days` (default 30).
|
|
74
|
+
The asset disappears from listings and pickers but remains recoverable
|
|
75
|
+
via `POST /api/v1/admin/assets/:id/restore`.
|
|
76
|
+
2. The repeating `HardDeleteAssetWorker` finalises after `purgeAfterAt`:
|
|
77
|
+
removes the row and asks the adapter to delete the underlying file.
|
|
78
|
+
If the backend cannot remove the file (read-only mount, revoked
|
|
79
|
+
credentials, network partition), the row stays and `pendingCleanup` is
|
|
80
|
+
set to `true`; the worker retries on the next tick.
|
|
81
|
+
|
|
82
|
+
## Reference protection {#asset-reference-registry}
|
|
83
|
+
|
|
84
|
+
Soft-delete is rejected with `409 ASSET_REFERENCED` when any of the
|
|
85
|
+
following points at the asset:
|
|
86
|
+
|
|
87
|
+
- `gallery_items.asset_id` (Product gallery)
|
|
88
|
+
- `product_attachments.asset_id` (Product attachments)
|
|
89
|
+
- `products.download_asset_id` (virtual-download products)
|
|
90
|
+
- `categories.main_image_asset_id` (Category main image)
|
|
91
|
+
- `cms_pages.body` containing a `{ type: "asset_ref", assetId }` node
|
|
92
|
+
|
|
93
|
+
The reference list is included in the error envelope's `details` array so
|
|
94
|
+
the admin UI can show "in use by" prompts.
|
|
95
|
+
|
|
96
|
+
## Pluggable storage adapters
|
|
97
|
+
|
|
98
|
+
Each backend implements the `StorageAdapter` SPI in
|
|
99
|
+
`packages/modules/assets_library/src/backend/services/storage/`. Adding a fourth
|
|
100
|
+
backend (Azure Blob, Backblaze B2, …) is a matter of dropping in a new
|
|
101
|
+
class that implements:
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
selfCheck(): Promise<{ ok: boolean; reason?: string }>;
|
|
105
|
+
newLocator({ assetId, originalFilename }): string;
|
|
106
|
+
put({ locator, mimeType, visibility, stream, sizeBytes }): Promise<void>;
|
|
107
|
+
resolveUrl({ locator, visibility, ttlSec? }): Promise<{ url; expiresAt }>;
|
|
108
|
+
open({ locator }): Promise<NodeJS.ReadableStream>;
|
|
109
|
+
delete({ locator }): Promise<void>;
|
|
110
|
+
setVisibility?({ locator, visibility }): Promise<void>;
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
…and registering it in `AdapterRegistry.build`. See the existing
|
|
114
|
+
`LocalFsStorageAdapter`, `S3StorageAdapter`, and `GcsStorageAdapter` for
|
|
115
|
+
templates.
|
|
116
|
+
|
|
117
|
+
## Legacy escape hatch
|
|
118
|
+
|
|
119
|
+
Pre-existing `assets` rows whose `storage_url` was a URL this platform did not
|
|
120
|
+
issue are tagged `storage_backend = 'legacy'` at migration time. The legacy
|
|
121
|
+
resolver returns the URL verbatim for `public` assets — rebasing it onto the
|
|
122
|
+
public API origin when the stored value is host-relative — and refuses to flip
|
|
123
|
+
them to `private` (we cannot sign URLs we didn't issue), which surfaces as
|
|
124
|
+
`409 ASSET_LEGACY_LOCATOR_CANNOT_HARDEN` to the admin. Re-upload through
|
|
125
|
+
the active adapter to upgrade.
|
package/i18n/en.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"errors.ASSET_NOT_FOUND": "Asset Not Found.",
|
|
3
|
+
"errors.ASSET_REFERENCED": "Asset Referenced.",
|
|
4
|
+
"errors.ASSET_FOLDER_NOT_FOUND": "Asset Folder Not Found.",
|
|
5
|
+
"errors.ASSET_FOLDER_NOT_EMPTY": "Asset Folder Not Empty.",
|
|
6
|
+
"errors.ASSET_FOLDER_NAME_CONFLICT": "Asset Folder Name Conflict.",
|
|
7
|
+
"errors.ASSET_FOLDER_CYCLE": "Asset Folder Cycle.",
|
|
8
|
+
"errors.ASSET_UPLOAD_NO_FILE": "Asset Upload No File.",
|
|
9
|
+
"errors.ASSET_UPLOAD_TYPE_NOT_ALLOWED": "Asset Upload Type Not Allowed.",
|
|
10
|
+
"errors.ASSET_UPLOAD_TOO_LARGE": "Asset Upload Too Large.",
|
|
11
|
+
"errors.ASSET_STORAGE_UNAVAILABLE": "Asset Storage Unavailable.",
|
|
12
|
+
"errors.ASSET_STORAGE_MISCONFIGURED": "Asset Storage Misconfigured.",
|
|
13
|
+
"errors.ASSET_LEGACY_LOCATOR_CANNOT_HARDEN": "Asset Legacy Locator Cannot Harden.",
|
|
14
|
+
"errors.ASSET_FILE_MISSING": "Asset File Missing.",
|
|
15
|
+
"errors.ASSET_GONE": "Asset Gone.",
|
|
16
|
+
"errors.ASSET_ACCESS_DENIED": "Asset Access Denied.",
|
|
17
|
+
"common.search": "Search",
|
|
18
|
+
"common.loading": "Loading…",
|
|
19
|
+
"common.save": "Save",
|
|
20
|
+
"common.optional": "(optional)",
|
|
21
|
+
"common.ok": "OK",
|
|
22
|
+
"common.cancel": "Cancel",
|
|
23
|
+
"common.delete": "Delete",
|
|
24
|
+
"page.title": "Assets Library",
|
|
25
|
+
"page.description": "Upload, organize, and reuse images, videos, PDFs, and other files across the platform.",
|
|
26
|
+
"assets.title": "Assets",
|
|
27
|
+
"assets.searchPlaceholder": "Search filename or label…",
|
|
28
|
+
"assets.emptyFolder": "No assets in this folder yet.",
|
|
29
|
+
"assets.loadMore": "Load more",
|
|
30
|
+
"uploader.triggerCurrentFolder": "Upload to current folder",
|
|
31
|
+
"detail.title": "Asset detail",
|
|
32
|
+
"detail.openFile": "Open file",
|
|
33
|
+
"detail.filename": "Filename",
|
|
34
|
+
"detail.label": "Label (storefront)",
|
|
35
|
+
"detail.mimeType": "MIME type",
|
|
36
|
+
"detail.visibility": "Visibility",
|
|
37
|
+
"detail.storage": "Storage",
|
|
38
|
+
"detail.size": "Size",
|
|
39
|
+
"detail.bytes": "bytes",
|
|
40
|
+
"detail.referencedBy": "Referenced by",
|
|
41
|
+
"detail.notReferenced": "Not referenced.",
|
|
42
|
+
"detail.softDeleteTitle": "Soft-delete this asset",
|
|
43
|
+
"detail.softDeleteBlockedTitle": "Remove every reference first",
|
|
44
|
+
"detail.softDelete": "Soft-delete",
|
|
45
|
+
"visibility.public": "public",
|
|
46
|
+
"visibility.private": "private",
|
|
47
|
+
"folders.title": "Folders",
|
|
48
|
+
"folders.root": "Unsorted (root)",
|
|
49
|
+
"folders.namePlaceholder": "Folder name",
|
|
50
|
+
"folders.newSubfolder": "New sub-folder",
|
|
51
|
+
"folders.deleteConfirm": "Delete this folder?\n\nOK = move its contents to the parent folder, then delete.\nCancel = abort.",
|
|
52
|
+
"folders.removed": "Folder removed ({id}).",
|
|
53
|
+
"nav.assetsLibrary.label": "Assets library"
|
|
54
|
+
}
|
package/i18n/pl.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"errors.ASSET_NOT_FOUND": "Błąd: asset not found.",
|
|
3
|
+
"errors.ASSET_REFERENCED": "Błąd: asset referenced.",
|
|
4
|
+
"errors.ASSET_FOLDER_NOT_FOUND": "Błąd: asset folder not found.",
|
|
5
|
+
"errors.ASSET_FOLDER_NOT_EMPTY": "Błąd: asset folder not empty.",
|
|
6
|
+
"errors.ASSET_FOLDER_NAME_CONFLICT": "Błąd: asset folder name conflict.",
|
|
7
|
+
"errors.ASSET_FOLDER_CYCLE": "Błąd: asset folder cycle.",
|
|
8
|
+
"errors.ASSET_UPLOAD_NO_FILE": "Błąd: asset upload no file.",
|
|
9
|
+
"errors.ASSET_UPLOAD_TYPE_NOT_ALLOWED": "Błąd: asset upload type not allowed.",
|
|
10
|
+
"errors.ASSET_UPLOAD_TOO_LARGE": "Błąd: asset upload too large.",
|
|
11
|
+
"errors.ASSET_STORAGE_UNAVAILABLE": "Błąd: asset storage unavailable.",
|
|
12
|
+
"errors.ASSET_STORAGE_MISCONFIGURED": "Błąd: asset storage misconfigured.",
|
|
13
|
+
"errors.ASSET_LEGACY_LOCATOR_CANNOT_HARDEN": "Błąd: asset legacy locator cannot harden.",
|
|
14
|
+
"errors.ASSET_FILE_MISSING": "Błąd: asset file missing.",
|
|
15
|
+
"errors.ASSET_GONE": "Błąd: asset gone.",
|
|
16
|
+
"errors.ASSET_ACCESS_DENIED": "Błąd: asset access denied.",
|
|
17
|
+
"common.search": "Szukaj",
|
|
18
|
+
"common.loading": "Wczytywanie…",
|
|
19
|
+
"common.save": "Zapisz",
|
|
20
|
+
"common.optional": "(opcjonalnie)",
|
|
21
|
+
"common.ok": "OK",
|
|
22
|
+
"common.cancel": "Anuluj",
|
|
23
|
+
"common.delete": "Usuń",
|
|
24
|
+
"page.title": "Biblioteka zasobów",
|
|
25
|
+
"page.description": "Przesyłaj, porządkuj i wykorzystuj ponownie obrazy, filmy, PDF-y oraz inne pliki na platformie.",
|
|
26
|
+
"assets.title": "Zasoby",
|
|
27
|
+
"assets.searchPlaceholder": "Szukaj po nazwie pliku lub etykiecie…",
|
|
28
|
+
"assets.emptyFolder": "W tym folderze nie ma jeszcze zasobów.",
|
|
29
|
+
"assets.loadMore": "Wczytaj więcej",
|
|
30
|
+
"uploader.triggerCurrentFolder": "Prześlij do bieżącego folderu",
|
|
31
|
+
"detail.title": "Szczegóły zasobu",
|
|
32
|
+
"detail.openFile": "Otwórz plik",
|
|
33
|
+
"detail.filename": "Nazwa pliku",
|
|
34
|
+
"detail.label": "Etykieta (sklep)",
|
|
35
|
+
"detail.mimeType": "Typ MIME",
|
|
36
|
+
"detail.visibility": "Widoczność",
|
|
37
|
+
"detail.storage": "Magazyn",
|
|
38
|
+
"detail.size": "Rozmiar",
|
|
39
|
+
"detail.bytes": "bajtów",
|
|
40
|
+
"detail.referencedBy": "Używany przez",
|
|
41
|
+
"detail.notReferenced": "Brak odwołań.",
|
|
42
|
+
"detail.softDeleteTitle": "Przenieś zasób do kosza",
|
|
43
|
+
"detail.softDeleteBlockedTitle": "Najpierw usuń wszystkie odwołania",
|
|
44
|
+
"detail.softDelete": "Do kosza",
|
|
45
|
+
"visibility.public": "publiczny",
|
|
46
|
+
"visibility.private": "prywatny",
|
|
47
|
+
"folders.title": "Foldery",
|
|
48
|
+
"folders.root": "Nieposortowane (root)",
|
|
49
|
+
"folders.namePlaceholder": "Nazwa folderu",
|
|
50
|
+
"folders.newSubfolder": "Nowy podfolder",
|
|
51
|
+
"folders.deleteConfirm": "Usunąć ten folder?\n\nOK = przenieś zawartość do folderu nadrzędnego, a potem usuń.\nAnuluj = przerwij.",
|
|
52
|
+
"folders.removed": "Usunięto folder ({id}).",
|
|
53
|
+
"nav.assetsLibrary.label": "Biblioteka zasobów"
|
|
54
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,102 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@endora-commerce/mod-assets-library",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.100.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"description": "Storage adapter registry (local / S3 / GCS), asset upload, and reference tracking.",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"endora": {
|
|
9
|
+
"type": "module",
|
|
10
|
+
"id": "assets_library"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/endora-commerce/endora-commerce.git",
|
|
15
|
+
"directory": "packages/modules/assets_library"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/manifest.d.ts",
|
|
23
|
+
"default": "./dist/manifest.js"
|
|
24
|
+
},
|
|
25
|
+
"./backend": {
|
|
26
|
+
"types": "./dist/backend/index.d.ts",
|
|
27
|
+
"default": "./dist/backend/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./migrations": {
|
|
30
|
+
"types": "./dist/migrations/index.d.ts",
|
|
31
|
+
"default": "./dist/migrations/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./admin": {
|
|
34
|
+
"types": "./dist/admin/index.d.ts",
|
|
35
|
+
"default": "./dist/admin/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./tailwind.css": "./tailwind.css",
|
|
38
|
+
"./package.json": "./package.json"
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"i18n",
|
|
43
|
+
"docs",
|
|
44
|
+
"tailwind.css"
|
|
45
|
+
],
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=22.18.0"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"@aws-sdk/client-s3": "^3",
|
|
51
|
+
"@aws-sdk/s3-request-presigner": "^3",
|
|
52
|
+
"@fastify/multipart": "^10",
|
|
53
|
+
"@google-cloud/storage": "^7",
|
|
54
|
+
"@mikro-orm/core": "^6",
|
|
55
|
+
"@mikro-orm/migrations": "^6",
|
|
56
|
+
"@mikro-orm/postgresql": "^6",
|
|
57
|
+
"fastify": "^5",
|
|
58
|
+
"file-type": "^22",
|
|
59
|
+
"lucide-react": "^1",
|
|
60
|
+
"react": "^19",
|
|
61
|
+
"@endora-commerce/admin-kit": "0.100.0",
|
|
62
|
+
"@endora-commerce/contracts": "0.100.0",
|
|
63
|
+
"@endora-commerce/platform": "0.100.0"
|
|
64
|
+
},
|
|
65
|
+
"peerDependenciesMeta": {
|
|
66
|
+
"@endora-commerce/admin-kit": {
|
|
67
|
+
"optional": true
|
|
68
|
+
},
|
|
69
|
+
"lucide-react": {
|
|
70
|
+
"optional": true
|
|
71
|
+
},
|
|
72
|
+
"react": {
|
|
73
|
+
"optional": true
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"devDependencies": {
|
|
77
|
+
"@aws-sdk/client-s3": "^3.1042.0",
|
|
78
|
+
"@aws-sdk/s3-request-presigner": "^3.1042.0",
|
|
79
|
+
"@fastify/multipart": "^10.0.0",
|
|
80
|
+
"@google-cloud/storage": "^7.19.0",
|
|
81
|
+
"@mikro-orm/core": "^6.6.13",
|
|
82
|
+
"@mikro-orm/migrations": "^6.6.13",
|
|
83
|
+
"@mikro-orm/postgresql": "^6.6.13",
|
|
84
|
+
"@types/node": "^22.9.0",
|
|
85
|
+
"@types/react": "^19.2.14",
|
|
86
|
+
"fastify": "^5.12.5",
|
|
87
|
+
"file-type": "^22.0.1",
|
|
88
|
+
"lucide-react": "^1.11.0",
|
|
89
|
+
"react": "^19.2.5",
|
|
90
|
+
"typescript": "^5.9.3",
|
|
91
|
+
"vitest": "^4.1.11",
|
|
92
|
+
"@endora-commerce/admin-kit": "0.100.0",
|
|
93
|
+
"@endora-commerce/contracts": "0.100.0",
|
|
94
|
+
"@endora-commerce/platform": "0.100.0"
|
|
95
|
+
},
|
|
96
|
+
"scripts": {
|
|
97
|
+
"build": "tsc -p tsconfig.build.json && tsc -p tsconfig.ui.json",
|
|
98
|
+
"typecheck": "tsc -p tsconfig.json && tsc -p tsconfig.ui.json --noEmit",
|
|
99
|
+
"lint": "eslint src",
|
|
100
|
+
"test": "vitest run"
|
|
101
|
+
}
|
|
6
102
|
}
|
package/tailwind.css
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* @endora-commerce/mod-assets-library — AUTO-GENERATED by `pnpm --filter backend run manifests:generate`.
|
|
2
|
+
*
|
|
3
|
+
* The `@source` directives this package asks its host to scan
|
|
4
|
+
* (`specs/110-instance-repository/contracts/admin-stylesheet-composition.md` R1).
|
|
5
|
+
* They resolve relative to **this file**, so they hold wherever the package is
|
|
6
|
+
* installed — a workspace link here, `node_modules` in a client's instance.
|
|
7
|
+
*
|
|
8
|
+
* The `dist` line is what a published tarball ships and is what an instance
|
|
9
|
+
* scans; the `src` line is inert there and is what keeps `pnpm --filter admin
|
|
10
|
+
* run dev` reading source in this repository. Do not edit: run
|
|
11
|
+
* `pnpm --filter backend run manifests:generate`.
|
|
12
|
+
*/
|
|
13
|
+
@source "./dist/admin";
|
|
14
|
+
@source "./src/admin";
|