@happyvertical/smrt-assets 0.51.38 → 0.52.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/AGENTS.md +1 -1
- package/dist/asset-conventions.d.ts +4 -1
- package/dist/asset-conventions.d.ts.map +1 -1
- package/dist/asset-tag.d.ts +29 -0
- package/dist/asset-tag.d.ts.map +1 -0
- package/dist/asset-tags.d.ts +16 -0
- package/dist/asset-tags.d.ts.map +1 -0
- package/dist/asset.d.ts +13 -3
- package/dist/asset.d.ts.map +1 -1
- package/dist/assets.d.ts +42 -14
- package/dist/assets.d.ts.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +283 -91
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +450 -5
- package/dist/owned-asset-helpers.d.ts +15 -0
- package/dist/owned-asset-helpers.d.ts.map +1 -1
- package/dist/smrt-knowledge.json +309 -17
- package/package.json +14 -14
package/AGENTS.md
CHANGED
|
@@ -34,7 +34,7 @@ Agents that need asset I/O should accept an `AssetRuntimeLike` in their options
|
|
|
34
34
|
- `serveAsset({ runtime, asset, tenantId?, disposition?, canAccess?, headers?, remoteMode? })` → standard Web `Response`.
|
|
35
35
|
- `404` when the id doesn't resolve; `403` when the tenant mismatches or `canAccess` denies; `302` when `remoteMode: 'redirect'` and the asset's `sourceUri` is `http(s)`; `502` when `remoteMode: 'proxy'` and the origin fetch fails; `500` on store read errors or unexpected failures; `200` otherwise with `Content-Type`, `Content-Length`, and `Content-Disposition` set.
|
|
36
36
|
- Assets whose `sourceUri` is `http(s)` are supported via `remoteMode`: `'proxy'` (default, fetch and return bytes), `'redirect'` (302 to the origin), or `'error'` (treat as misconfiguration). Pass `fetchImpl` to swap the fetch client.
|
|
37
|
-
- `Content-Disposition`
|
|
37
|
+
- `Content-Disposition` uses an ASCII-safe quoted `filename` fallback and retains the Unicode download name in UTF-8 `filename*` ([RFC 6266](https://www.rfc-editor.org/rfc/rfc6266#section-4.3), [RFC 8187](https://www.rfc-editor.org/rfc/rfc8187#section-3.2.1)). Both names strip C0/DEL/C1 controls and replace `"` / `\` / `/` to prevent header injection; isolated UTF-16 surrogates become U+FFFD before encoding, while valid pairs are preserved.
|
|
38
38
|
- The 500 body is a generic `'Internal error serving asset'`; the underlying error is logged via `console.error` so operators can debug without leaking paths/bucket names to clients.
|
|
39
39
|
- Works in SvelteKit `+server.ts` endpoints, Hono, and any runtime with a global `Response` (Node 18+). Pass `responseCtor` for older runtimes.
|
|
40
40
|
- `resolveAssetForServing(options)` → `{ asset, data, contentType, filename, size }` when callers want to render their own framework response. Throws `AssetServeError(status)` on the same failure modes.
|
|
@@ -25,7 +25,9 @@
|
|
|
25
25
|
* derivative points back to the asset it was produced from).
|
|
26
26
|
* - `attachment`: generic "this asset belongs to that object" link —
|
|
27
27
|
* the default for noun join tables.
|
|
28
|
-
* - `hero`: primary/featured asset for an owner.
|
|
28
|
+
* - `hero`: primary/featured asset for an owner (e.g. a place's main picture).
|
|
29
|
+
* - `depicts`: the asset shows the owner — a photo of a place or a person
|
|
30
|
+
* (`place_assets`, `profile_assets`).
|
|
29
31
|
*/
|
|
30
32
|
export declare const ASSET_ROLES: {
|
|
31
33
|
readonly SOURCE_DOCUMENT: "source_document";
|
|
@@ -36,6 +38,7 @@ export declare const ASSET_ROLES: {
|
|
|
36
38
|
readonly DERIVATION_SOURCE: "derivation_source";
|
|
37
39
|
readonly ATTACHMENT: "attachment";
|
|
38
40
|
readonly HERO: "hero";
|
|
41
|
+
readonly DEPICTS: "depicts";
|
|
39
42
|
};
|
|
40
43
|
export type AssetRole = (typeof ASSET_ROLES)[keyof typeof ASSET_ROLES];
|
|
41
44
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset-conventions.d.ts","sourceRoot":"","sources":["../src/asset-conventions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH
|
|
1
|
+
{"version":3,"file":"asset-conventions.d.ts","sourceRoot":"","sources":["../src/asset-conventions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;CAUd,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEvE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,mBAAmB;;;;;;;CAOtB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAEjE;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;CAK1B,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAC/B,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AssetTag model - Links an asset to a `@happyvertical/smrt-tags` Tag.
|
|
3
|
+
*
|
|
4
|
+
* Backs the `asset_tags` join table that `AssetCollection.addTag()` /
|
|
5
|
+
* `removeTag()` / `getByTag()` and `Asset.getTags()` / `hasTag()` use. Before
|
|
6
|
+
* this model existed those methods wrote raw rows to an `asset_tags` table
|
|
7
|
+
* that no manifest declared, so no migration ever created it.
|
|
8
|
+
*
|
|
9
|
+
* The link is keyed by the Tag's id (not its slug): a tag's natural key is
|
|
10
|
+
* `(tenant, slug, context)`, so a slug alone is ambiguous across tenants and
|
|
11
|
+
* contexts. Both sides cascade: deleting the asset or the tag removes the
|
|
12
|
+
* link. Rows carry the asset's tenant.
|
|
13
|
+
*/
|
|
14
|
+
import type { SmrtObjectOptions } from '@happyvertical/smrt-core';
|
|
15
|
+
import { SmrtObject } from '@happyvertical/smrt-core';
|
|
16
|
+
export interface AssetTagOptions extends SmrtObjectOptions {
|
|
17
|
+
assetId?: string;
|
|
18
|
+
tagId?: string;
|
|
19
|
+
tenantId?: string | null;
|
|
20
|
+
}
|
|
21
|
+
export declare class AssetTag extends SmrtObject {
|
|
22
|
+
tenantId: string | null;
|
|
23
|
+
/** FK to Asset.id — the link goes with the asset. */
|
|
24
|
+
assetId: string;
|
|
25
|
+
/** FK to smrt-tags Tag.id — the link goes with the tag. */
|
|
26
|
+
tagId: string;
|
|
27
|
+
constructor(options?: AssetTagOptions);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=asset-tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asset-tag.d.ts","sourceRoot":"","sources":["../src/asset-tag.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAGL,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAGlC,MAAM,WAAW,eAAgB,SAAQ,iBAAiB;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,qBAQa,QAAS,SAAQ,UAAU;IAEtC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B,qDAAqD;IAErD,OAAO,SAAM;IAEb,2DAA2D;IAK3D,KAAK,SAAM;gBAEC,OAAO,GAAE,eAAoB;CAM1C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AssetTagCollection - junction collection for `asset_tags` (Asset ↔ Tag).
|
|
3
|
+
*
|
|
4
|
+
* Left side is the asset, right side the Tag id. The table has no position
|
|
5
|
+
* column, so neither ordering nor `setLinks` index assignment applies.
|
|
6
|
+
*/
|
|
7
|
+
import { SmrtJunction } from '@happyvertical/smrt-core';
|
|
8
|
+
import { AssetTag } from './asset-tag';
|
|
9
|
+
export declare class AssetTagCollection extends SmrtJunction<AssetTag> {
|
|
10
|
+
static readonly _itemClass: typeof AssetTag;
|
|
11
|
+
protected leftField: string;
|
|
12
|
+
protected rightField: string;
|
|
13
|
+
protected sortField: string | null;
|
|
14
|
+
protected positionField: string | null;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=asset-tags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asset-tags.d.ts","sourceRoot":"","sources":["../src/asset-tags.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAQ,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIvC,qBACa,kBAAmB,SAAQ,YAAY,CAAC,QAAQ,CAAC;IAC5D,MAAM,CAAC,QAAQ,CAAC,UAAU,kBAAY;IACtC,SAAS,CAAC,SAAS,SAAa;IAChC,SAAS,CAAC,UAAU,SAAW;IAC/B,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC1C,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAQ;CAC/C"}
|
package/dist/asset.d.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* `R3-D` changeset for the migration.
|
|
13
13
|
*/
|
|
14
14
|
import { SmrtObject } from '@happyvertical/smrt-core';
|
|
15
|
-
import { Tag } from '@happyvertical/smrt-tags';
|
|
15
|
+
import { type Tag } from '@happyvertical/smrt-tags';
|
|
16
16
|
import type { AssetAssociation } from './asset-association';
|
|
17
17
|
import { AssetStatus } from './asset-status';
|
|
18
18
|
import { AssetType } from './asset-type';
|
|
@@ -55,6 +55,14 @@ export declare class Asset extends SmrtObject {
|
|
|
55
55
|
externalRefs: string;
|
|
56
56
|
createdAt: Date;
|
|
57
57
|
updatedAt: Date;
|
|
58
|
+
/**
|
|
59
|
+
* A file's name is not its identity: two pictures named "photo.jpg" are two
|
|
60
|
+
* assets. Without an explicit slug the default (name-derived) slug would
|
|
61
|
+
* make the second save adopt the first row through the (tenant, slug,
|
|
62
|
+
* context) natural key and overwrite it, so an asset's default slug is its
|
|
63
|
+
* id. An explicit slug is kept.
|
|
64
|
+
*/
|
|
65
|
+
getSlug(): Promise<string | null | undefined>;
|
|
58
66
|
constructor(options?: AssetOptions);
|
|
59
67
|
getMetadata(): Record<string, unknown>;
|
|
60
68
|
setMetadata(metadata: Record<string, unknown>): void;
|
|
@@ -65,7 +73,8 @@ export declare class Asset extends SmrtObject {
|
|
|
65
73
|
provider?: string;
|
|
66
74
|
}): void;
|
|
67
75
|
/**
|
|
68
|
-
* Get all tags for this asset from @happyvertical/smrt-tags
|
|
76
|
+
* Get all tags for this asset from @happyvertical/smrt-tags, through the
|
|
77
|
+
* `asset_tags` join (`AssetTag`), sorted by name.
|
|
69
78
|
*
|
|
70
79
|
* @returns Array of Tag instances from @happyvertical/smrt-tags package
|
|
71
80
|
*/
|
|
@@ -74,9 +83,10 @@ export declare class Asset extends SmrtObject {
|
|
|
74
83
|
* Check if this asset has a specific tag
|
|
75
84
|
*
|
|
76
85
|
* @param tagSlug - The slug of the tag to check
|
|
86
|
+
* @param context - Tag context; any context when omitted
|
|
77
87
|
* @returns True if the asset has this tag
|
|
78
88
|
*/
|
|
79
|
-
hasTag(tagSlug: string): Promise<boolean>;
|
|
89
|
+
hasTag(tagSlug: string, context?: string): Promise<boolean>;
|
|
80
90
|
/**
|
|
81
91
|
* Resolve the AssetCollection lazily. Going through `ObjectRegistry`
|
|
82
92
|
* mirrors the pattern used by `SmrtHierarchical._hierarchyCollection`
|
package/dist/asset.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../src/asset.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAKL,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,GAAG,
|
|
1
|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;IAM1C;;;;OAIG;IACG,SAAS,IAAI,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAM9C;;;;OAIG;IACG,eAAe,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAOpD;;;;;;;OAOG;IACG,aAAa,CACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,SAAY,GACf,OAAO,CAAC,gBAAgB,CAAC;IAO5B;;;;;OAKG;WACU,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;CAI7D"}
|
package/dist/assets.d.ts
CHANGED
|
@@ -4,7 +4,18 @@
|
|
|
4
4
|
* Provides tag management, versioning, tenant-aware queries, and operations for assets
|
|
5
5
|
*/
|
|
6
6
|
import { SmrtCollection } from '@happyvertical/smrt-core';
|
|
7
|
+
import { type Tag } from '@happyvertical/smrt-tags';
|
|
7
8
|
import { Asset } from './asset';
|
|
9
|
+
/** Tag context used for asset tags unless a caller names another. */
|
|
10
|
+
export declare const ASSET_TAG_CONTEXT = "asset";
|
|
11
|
+
export interface AssetTagInput {
|
|
12
|
+
/** Display name for a newly created tag (defaults to the label given). */
|
|
13
|
+
name?: string;
|
|
14
|
+
/** Tag context (namespace); defaults to {@link ASSET_TAG_CONTEXT}. */
|
|
15
|
+
context?: string;
|
|
16
|
+
}
|
|
17
|
+
/** The slug a tag label is stored under: `Town hall` → `town-hall`. */
|
|
18
|
+
export declare function assetTagSlug(label: string): string;
|
|
8
19
|
export declare class AssetCollection extends SmrtCollection<Asset> {
|
|
9
20
|
static readonly _itemClass: typeof Asset;
|
|
10
21
|
/**
|
|
@@ -34,27 +45,44 @@ export declare class AssetCollection extends SmrtCollection<Asset> {
|
|
|
34
45
|
* @returns Array of tenant-specific and global assets
|
|
35
46
|
*/
|
|
36
47
|
findWithGlobals(tenantId: string): Promise<Asset[]>;
|
|
48
|
+
private assetTagCollection;
|
|
49
|
+
private tagCollection;
|
|
50
|
+
private requireAsset;
|
|
37
51
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* @param assetId - The asset ID to tag
|
|
41
|
-
* @param tagSlug - The tag slug from @smrt/tags
|
|
52
|
+
* Find the asset's tag for `tag` (a slug or a label) in the asset's own
|
|
53
|
+
* tenant, optionally creating it. A tag of another tenant is never used.
|
|
42
54
|
*/
|
|
43
|
-
|
|
55
|
+
private resolveAssetTag;
|
|
44
56
|
/**
|
|
45
|
-
*
|
|
57
|
+
* Add a tag to an asset. `tag` is a slug (`town-hall`) or a label
|
|
58
|
+
* (`Town hall`); the tag is found or created in the asset's tenant under
|
|
59
|
+
* `context` (default {@link ASSET_TAG_CONTEXT}). Adding a tag twice is a
|
|
60
|
+
* no-op. Returns the Tag.
|
|
46
61
|
*
|
|
47
|
-
* @
|
|
48
|
-
*
|
|
62
|
+
* @throws when the asset does not exist (or is not visible in the active
|
|
63
|
+
* tenant context)
|
|
49
64
|
*/
|
|
50
|
-
|
|
65
|
+
addTag(assetId: string, tag: string, options?: AssetTagInput): Promise<Tag>;
|
|
51
66
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
|
|
55
|
-
|
|
67
|
+
* Remove a tag (slug or label) from an asset. Unknown tags are ignored.
|
|
68
|
+
* The Tag itself is kept; only the link goes.
|
|
69
|
+
*/
|
|
70
|
+
removeTag(assetId: string, tag: string, options?: Pick<AssetTagInput, 'context'>): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Make the asset's tags (in `context`) exactly `tags`: missing ones are
|
|
73
|
+
* added, others in the same context removed. Returns the resulting Tags.
|
|
74
|
+
*/
|
|
75
|
+
setTags(assetId: string, tags: string[], options?: Pick<AssetTagInput, 'context'>): Promise<Tag[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Tags for many assets in two queries, keyed by asset id (assets without
|
|
78
|
+
* tags map to an empty list). Useful for list views.
|
|
79
|
+
*/
|
|
80
|
+
getTagsForAssets(assetIds: string[]): Promise<Map<string, Tag[]>>;
|
|
81
|
+
/**
|
|
82
|
+
* Get all assets with a specific tag (slug or label), within the active
|
|
83
|
+
* tenant context.
|
|
56
84
|
*/
|
|
57
|
-
getByTag(
|
|
85
|
+
getByTag(tag: string, options?: Pick<AssetTagInput, 'context'>): Promise<Asset[]>;
|
|
58
86
|
/**
|
|
59
87
|
* Get assets by type
|
|
60
88
|
*
|
package/dist/assets.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../src/assets.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../src/assets.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,KAAK,GAAG,EAAiB,MAAM,0BAA0B,CAAC;AAEnE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAIhC,qEAAqE;AACrE,eAAO,MAAM,iBAAiB,UAAU,CAAC;AAEzC,MAAM,WAAW,aAAa;IAC5B,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOlD;AAOD,qBAAa,eAAgB,SAAQ,cAAc,CAAC,KAAK,CAAC;IACxD,MAAM,CAAC,QAAQ,CAAC,UAAU,eAAS;IAMnC;;;;;OAKG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAItD;;;;;;;;OAQG;IACG,UAAU,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;IAIpC;;;;;;;;OAQG;IACG,eAAe,CAAC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CAAC,KAAK,CAAM,GAC3B,OAAO,CAAC,KAAK,CAAC;IAkDjB;;;;;OAKG;IACG,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;IASvE;;;;;OAKG;IACG,YAAY,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAsB9D;;;;;;;;;OASG;IACG,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAI7D;;;;;OAKG;IACG,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAS1D;;;;;;;OAOG;IACG,iBAAiB,CACrB,gBAAgB,EAAE,MAAM,EACxB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,KAAK,CAAC;IAgBjB;;;;;OAKG;IACG,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;CAGtD"}
|
package/dist/index.d.ts
CHANGED
|
@@ -19,13 +19,15 @@ export { AssetServeError, type ResolvedAssetBytes, resolveAssetForServing, type
|
|
|
19
19
|
export { AssetStatus } from './asset-status';
|
|
20
20
|
export { AssetStatusCollection } from './asset-statuses';
|
|
21
21
|
export { type AssetStorageOperation, type AssetStorageResolution, type AssetStorageResolveRequest, type AssetStorageResolver, AssetStore, type AssetStoreOptions, type ProviderOptions, type StoreOptions, } from './asset-store';
|
|
22
|
+
export { AssetTag, type AssetTagOptions } from './asset-tag';
|
|
23
|
+
export { AssetTagCollection } from './asset-tags';
|
|
22
24
|
export { AssetType } from './asset-type';
|
|
23
25
|
export { AssetTypeCollection } from './asset-types';
|
|
24
|
-
export { AssetCollection } from './assets';
|
|
26
|
+
export { ASSET_TAG_CONTEXT, AssetCollection, type AssetTagInput, assetTagSlug, } from './assets';
|
|
25
27
|
export { getFilesystemLazy, isFileNotFoundError, registerFilesModule, } from './files-runtime';
|
|
26
28
|
export { Folder } from './folder';
|
|
27
29
|
export { FolderCollection } from './folders';
|
|
28
30
|
export { type MediaBundleFileDescriptor, type MediaBundleGpsTrackPoint, type MediaBundleInspection, type MediaBundleInspectionLike, type MediaBundleNormalizedMetadata, type MediaBundleSupportFileInspection, type MediaSupportFileVisibility, type PersistMediaBundleAssetInput, type PersistMediaBundleAssociationInput, type PersistMediaBundleInspectionOptions, type PersistMediaBundleInspectionResult, type PersistMediaBundleMetadataArtifactInput, persistMediaBundleInspection, type SmrtMediaBundlePersistenceAdapter, } from './media-bundle-persistence';
|
|
29
|
-
export { type AssetOwnerCollection, type AssetOwnerRecord, addOwnedAssetFromCollection, assertValidOwnedAssetRelationship, assertValidOwnedAssetSortOrder, getOwnedAssetsFromCollection, OWNED_ASSET_RELATIONSHIP_PATTERN, removeOwnedAssetFromCollection, resolveOwnedAssetsById, } from './owned-asset-helpers';
|
|
31
|
+
export { type AssetOwnerCollection, type AssetOwnerRecord, addOwnedAssetFromCollection, assertAssetLinkable, assertValidOwnedAssetRelationship, assertValidOwnedAssetSortOrder, getOwnedAssetsFromCollection, OWNED_ASSET_RELATIONSHIP_PATTERN, removeOwnedAssetFromCollection, resolveOwnedAssetsById, } from './owned-asset-helpers';
|
|
30
32
|
export type { AssetAssociationOptions, AssetMetafieldOptions, AssetOptions, AssetStatusOptions, AssetTypeOptions, FolderOptions, } from './types';
|
|
31
33
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,wBAAwB,CAAC;AAGhC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EACL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