@happyvertical/smrt-assets 0.56.1 → 0.57.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.
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-assets",
5
- "packageVersion": "0.56.1",
5
+ "packageVersion": "0.57.0",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-assets:AssetAssociation": {
8
8
  "name": "assetassociation",
@@ -377,7 +377,23 @@
377
377
  "isPublic": true
378
378
  }
379
379
  },
380
- "decoratorConfig": {},
380
+ "decoratorConfig": {
381
+ "api": {
382
+ "include": [
383
+ "list",
384
+ "get",
385
+ "create",
386
+ "delete"
387
+ ]
388
+ },
389
+ "mcp": {
390
+ "include": [
391
+ "list",
392
+ "get",
393
+ "create"
394
+ ]
395
+ }
396
+ },
381
397
  "extends": "SmrtJunctionBase",
382
398
  "extendsTypeArg": "AssetAssociation",
383
399
  "exportName": "AssetAssociationCollection",
@@ -708,7 +724,24 @@
708
724
  "isPublic": true
709
725
  }
710
726
  },
711
- "decoratorConfig": {},
727
+ "decoratorConfig": {
728
+ "api": {
729
+ "include": [
730
+ "list",
731
+ "get",
732
+ "create",
733
+ "update",
734
+ "delete"
735
+ ]
736
+ },
737
+ "mcp": {
738
+ "include": [
739
+ "list",
740
+ "get",
741
+ "create"
742
+ ]
743
+ }
744
+ },
712
745
  "extends": "SmrtCollection",
713
746
  "extendsTypeArg": "AssetMetafield",
714
747
  "exportName": "AssetMetafieldCollection",
@@ -976,7 +1009,24 @@
976
1009
  "isPublic": true
977
1010
  }
978
1011
  },
979
- "decoratorConfig": {},
1012
+ "decoratorConfig": {
1013
+ "api": {
1014
+ "include": [
1015
+ "list",
1016
+ "get",
1017
+ "create",
1018
+ "update",
1019
+ "delete"
1020
+ ]
1021
+ },
1022
+ "mcp": {
1023
+ "include": [
1024
+ "list",
1025
+ "get",
1026
+ "create"
1027
+ ]
1028
+ }
1029
+ },
980
1030
  "extends": "SmrtCollection",
981
1031
  "extendsTypeArg": "AssetStatus",
982
1032
  "exportName": "AssetStatusCollection",
@@ -1623,7 +1673,24 @@
1623
1673
  "isPublic": true
1624
1674
  }
1625
1675
  },
1626
- "decoratorConfig": {},
1676
+ "decoratorConfig": {
1677
+ "api": {
1678
+ "include": [
1679
+ "list",
1680
+ "get",
1681
+ "create",
1682
+ "update",
1683
+ "delete"
1684
+ ]
1685
+ },
1686
+ "mcp": {
1687
+ "include": [
1688
+ "list",
1689
+ "get",
1690
+ "create"
1691
+ ]
1692
+ }
1693
+ },
1627
1694
  "extends": "SmrtCollection",
1628
1695
  "extendsTypeArg": "AssetType",
1629
1696
  "exportName": "AssetTypeCollection",
@@ -1735,6 +1802,19 @@
1735
1802
  }
1736
1803
  }
1737
1804
  },
1805
+ "accessMode": {
1806
+ "type": "text",
1807
+ "required": false,
1808
+ "default": "public",
1809
+ "description": "Whether this record is public to ordinary asset APIs or private.",
1810
+ "_meta": {
1811
+ "description": "Whether this record is public to ordinary asset APIs or private."
1812
+ },
1813
+ "enum": [
1814
+ "public",
1815
+ "private"
1816
+ ]
1817
+ },
1738
1818
  "name": {
1739
1819
  "type": "text",
1740
1820
  "required": false,
@@ -2108,7 +2188,7 @@
2108
2188
  ],
2109
2189
  "schema": {
2110
2190
  "tableName": "assets",
2111
- "ddl": "CREATE TABLE IF NOT EXISTS \"assets\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"source_uri\" TEXT,\n \"mime_type\" TEXT,\n \"description\" TEXT,\n \"metadata\" TEXT,\n \"version\" INTEGER DEFAULT 1,\n \"primary_version_id\" UUID,\n \"type_slug\" TEXT,\n \"status_slug\" TEXT,\n \"owner_profile_id\" UUID,\n \"source_asset_id\" UUID,\n \"folder_id\" UUID,\n \"source_type\" TEXT,\n \"external_id\" TEXT,\n \"external_refs\" TEXT\n);",
2191
+ "ddl": "CREATE TABLE IF NOT EXISTS \"assets\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"access_mode\" TEXT DEFAULT 'public',\n \"name\" TEXT,\n \"source_uri\" TEXT,\n \"mime_type\" TEXT,\n \"description\" TEXT,\n \"metadata\" TEXT,\n \"version\" INTEGER DEFAULT 1,\n \"primary_version_id\" UUID,\n \"type_slug\" TEXT,\n \"status_slug\" TEXT,\n \"owner_profile_id\" UUID,\n \"source_asset_id\" UUID,\n \"folder_id\" UUID,\n \"source_type\" TEXT,\n \"external_id\" TEXT,\n \"external_refs\" TEXT\n);",
2112
2192
  "columns": {
2113
2193
  "id": {
2114
2194
  "type": "UUID",
@@ -2148,6 +2228,11 @@
2148
2228
  "referenceKind": "tenantId",
2149
2229
  "notNull": false
2150
2230
  },
2231
+ "access_mode": {
2232
+ "type": "TEXT",
2233
+ "notNull": false,
2234
+ "default": "public"
2235
+ },
2151
2236
  "name": {
2152
2237
  "type": "TEXT",
2153
2238
  "notNull": false
@@ -2282,7 +2367,7 @@
2282
2367
  ]
2283
2368
  }
2284
2369
  ],
2285
- "version": "16d6c152"
2370
+ "version": "0e75029e"
2286
2371
  },
2287
2372
  "importPath": "@happyvertical/smrt-assets"
2288
2373
  },
@@ -2592,14 +2677,32 @@
2592
2677
  "isPublic": true
2593
2678
  }
2594
2679
  },
2595
- "decoratorConfig": {},
2680
+ "decoratorConfig": {
2681
+ "api": {
2682
+ "include": [
2683
+ "list",
2684
+ "get",
2685
+ "create",
2686
+ "update",
2687
+ "delete"
2688
+ ]
2689
+ },
2690
+ "mcp": {
2691
+ "include": [
2692
+ "list",
2693
+ "get",
2694
+ "create",
2695
+ "update"
2696
+ ]
2697
+ }
2698
+ },
2596
2699
  "extends": "SmrtCollection",
2597
2700
  "extendsTypeArg": "Asset",
2598
2701
  "exportName": "AssetCollection",
2599
2702
  "collectionExportName": "AssetCollectionCollection",
2600
2703
  "schema": {
2601
2704
  "tableName": "assets",
2602
- "ddl": "CREATE TABLE IF NOT EXISTS \"assets\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"source_uri\" TEXT,\n \"mime_type\" TEXT,\n \"description\" TEXT,\n \"metadata\" TEXT,\n \"version\" INTEGER DEFAULT 1,\n \"primary_version_id\" UUID,\n \"type_slug\" TEXT,\n \"status_slug\" TEXT,\n \"owner_profile_id\" UUID,\n \"source_asset_id\" UUID,\n \"folder_id\" UUID,\n \"source_type\" TEXT,\n \"external_id\" TEXT,\n \"external_refs\" TEXT\n);",
2705
+ "ddl": "CREATE TABLE IF NOT EXISTS \"assets\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"access_mode\" TEXT DEFAULT 'public',\n \"name\" TEXT,\n \"source_uri\" TEXT,\n \"mime_type\" TEXT,\n \"description\" TEXT,\n \"metadata\" TEXT,\n \"version\" INTEGER DEFAULT 1,\n \"primary_version_id\" UUID,\n \"type_slug\" TEXT,\n \"status_slug\" TEXT,\n \"owner_profile_id\" UUID,\n \"source_asset_id\" UUID,\n \"folder_id\" UUID,\n \"source_type\" TEXT,\n \"external_id\" TEXT,\n \"external_refs\" TEXT\n);",
2603
2706
  "columns": {
2604
2707
  "id": {
2605
2708
  "type": "UUID",
@@ -2639,6 +2742,11 @@
2639
2742
  "referenceKind": "tenantId",
2640
2743
  "notNull": false
2641
2744
  },
2745
+ "access_mode": {
2746
+ "type": "TEXT",
2747
+ "notNull": false,
2748
+ "default": "public"
2749
+ },
2642
2750
  "name": {
2643
2751
  "type": "TEXT",
2644
2752
  "notNull": false
@@ -2773,7 +2881,7 @@
2773
2881
  ]
2774
2882
  }
2775
2883
  ],
2776
- "version": "16d6c152"
2884
+ "version": "0e75029e"
2777
2885
  },
2778
2886
  "importPath": "@happyvertical/smrt-assets"
2779
2887
  },
@@ -3143,7 +3251,25 @@
3143
3251
  "isPublic": true
3144
3252
  }
3145
3253
  },
3146
- "decoratorConfig": {},
3254
+ "decoratorConfig": {
3255
+ "api": {
3256
+ "include": [
3257
+ "list",
3258
+ "get",
3259
+ "create",
3260
+ "update",
3261
+ "delete"
3262
+ ]
3263
+ },
3264
+ "mcp": {
3265
+ "include": [
3266
+ "list",
3267
+ "get",
3268
+ "create",
3269
+ "update"
3270
+ ]
3271
+ }
3272
+ },
3147
3273
  "extends": "SmrtCollection",
3148
3274
  "extendsTypeArg": "Folder",
3149
3275
  "exportName": "FolderCollection",
@@ -0,0 +1,14 @@
1
+ /** Trusted server capability. Never construct this from an untrusted API payload. */
2
+ export interface PrivateAssetAccess {
3
+ tenantId: string;
4
+ actorUserId: string;
5
+ ownerProfileId: string;
6
+ assetIds: readonly string[];
7
+ }
8
+ /**
9
+ * Run an already-authorized operation on exact private asset IDs. The host must
10
+ * authorize the relationship first; this capability does not grant permissions.
11
+ * Nested capabilities may only narrow their parent's IDs and retain its owner.
12
+ */
13
+ export declare function withPrivateAssetAccess<T>(access: PrivateAssetAccess, callback: () => Promise<T>): Promise<T>;
14
+ //# sourceMappingURL=private-asset-access.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"private-asset-access.d.ts","sourceRoot":"","sources":["../src/private-asset-access.ts"],"names":[],"mappings":"AAUA,qFAAqF;AACrF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B;AAgCD;;;;GAIG;AACH,wBAAsB,sBAAsB,CAAC,CAAC,EAC5C,MAAM,EAAE,kBAAkB,EAC1B,QAAQ,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACzB,OAAO,CAAC,CAAC,CAAC,CAoCZ"}