@uniformdev/assets 20.72.3-alpha.3 → 20.72.3-alpha.45

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/dist/index.d.mts CHANGED
@@ -764,9 +764,11 @@ interface components$1 {
764
764
  versionId: string;
765
765
  /** @description The timestamp when the version was created in epoch milliseconds */
766
766
  timestamp: number;
767
- /** @description The name (full name) of the user who created the version */
767
+ /** @description The name (full name) of the user who created the version, or "Unknown user" if the author can no longer be resolved */
768
768
  authorName: string;
769
769
  authorIsApiKey: boolean;
770
+ /** @description The identity who created the version; absent on old history entries. */
771
+ authorSubject?: string;
770
772
  /** @description The state of the entity when the history entry was made */
771
773
  state: number;
772
774
  };
@@ -1809,9 +1811,20 @@ declare class AssetClient extends ApiClient {
1809
1811
  get(options: WithoutProjectId<AssetGetRequestList> & {
1810
1812
  filters?: Record<string, unknown>;
1811
1813
  }): Promise<AssetGetResponseList>;
1814
+ /**
1815
+ * Fetches a list of assets
1816
+ */
1817
+ list(options?: WithoutProjectId<AssetGetRequestList> & {
1818
+ filters?: Record<string, unknown>;
1819
+ }): Promise<AssetGetResponseList>;
1820
+ save(options: WithoutProjectId<AssetUpsertRequest>): Promise<void>;
1821
+ /** @deprecated Use {@link save} instead. */
1812
1822
  upsert(options: WithoutProjectId<AssetUpsertRequest>): Promise<void>;
1823
+ remove(options: WithoutProjectId<AssetDeleteRequest>): Promise<void>;
1824
+ /** @deprecated Use {@link remove} instead. */
1813
1825
  delete(options: WithoutProjectId<AssetDeleteRequest>): Promise<void>;
1814
1826
  }
1827
+ /** @deprecated Pass `bypassCache: true` to {@link AssetClient} instead. */
1815
1828
  declare class UncachedAssetClient extends AssetClient {
1816
1829
  constructor(options: Omit<ClientOptions & {
1817
1830
  projectId: NonNullable<ClientOptions['projectId']>;
@@ -1870,14 +1883,20 @@ type ImageFromTransformProps = XOR<{
1870
1883
  y: number;
1871
1884
  };
1872
1885
  }>;
1886
+ /**
1887
+ * Fluent API for reading and transforming an asset image URL.
1888
+ */
1889
+ interface ImageFromApi {
1890
+ /** Returns the image URL with the current transformations applied. */
1891
+ url: () => string;
1892
+ /** Applies image transformations and returns the same fluent API. */
1893
+ transform: (transformProps: ImageFromTransformProps) => ImageFromApi;
1894
+ }
1873
1895
  /**
1874
1896
  * A helper function for extracting the image URL from an asset and optionally
1875
1897
  * applying transformation URL query parameters.
1876
1898
  */
1877
- declare const imageFrom: (asset: Asset | AssetParamValueItem | string) => {
1878
- url: () => string;
1879
- transform: (transformProps: ImageFromTransformProps) => /*elided*/ any;
1880
- };
1899
+ declare const imageFrom: (asset: Asset | AssetParamValueItem | string) => ImageFromApi;
1881
1900
 
1882
1901
  /**
1883
1902
  * Converts a content asset to a put content asset body that has only the properties expected to the PUT API.
@@ -1888,4 +1907,4 @@ declare function convertAssetToPutAsset(asset: {
1888
1907
  projectId: string;
1889
1908
  }): AssetUpsertRequest;
1890
1909
 
1891
- export { type Asset, AssetClient, type AssetDefinitionType, type AssetDeleteRequest, type AssetGetRequest, type AssetGetRequestList, type AssetGetRequestSingle, type AssetGetResponse, type AssetGetResponseList, type AssetGetResponseSingle, type AssetParamValue, type AssetParamValueItem, type AssetUpsertRequest, type ImageDeliveryParams, type ImageFromTransformProps, UncachedAssetClient, assetDefinitions, convertAssetToPutAsset, getAssetDefinitionType, imageFrom };
1910
+ export { type Asset, AssetClient, type AssetDefinitionType, type AssetDeleteRequest, type AssetGetRequest, type AssetGetRequestList, type AssetGetRequestSingle, type AssetGetResponse, type AssetGetResponseList, type AssetGetResponseSingle, type AssetParamValue, type AssetParamValueItem, type AssetUpsertRequest, type ImageDeliveryParams, type ImageFromApi, type ImageFromTransformProps, UncachedAssetClient, assetDefinitions, convertAssetToPutAsset, getAssetDefinitionType, imageFrom };
package/dist/index.d.ts CHANGED
@@ -764,9 +764,11 @@ interface components$1 {
764
764
  versionId: string;
765
765
  /** @description The timestamp when the version was created in epoch milliseconds */
766
766
  timestamp: number;
767
- /** @description The name (full name) of the user who created the version */
767
+ /** @description The name (full name) of the user who created the version, or "Unknown user" if the author can no longer be resolved */
768
768
  authorName: string;
769
769
  authorIsApiKey: boolean;
770
+ /** @description The identity who created the version; absent on old history entries. */
771
+ authorSubject?: string;
770
772
  /** @description The state of the entity when the history entry was made */
771
773
  state: number;
772
774
  };
@@ -1809,9 +1811,20 @@ declare class AssetClient extends ApiClient {
1809
1811
  get(options: WithoutProjectId<AssetGetRequestList> & {
1810
1812
  filters?: Record<string, unknown>;
1811
1813
  }): Promise<AssetGetResponseList>;
1814
+ /**
1815
+ * Fetches a list of assets
1816
+ */
1817
+ list(options?: WithoutProjectId<AssetGetRequestList> & {
1818
+ filters?: Record<string, unknown>;
1819
+ }): Promise<AssetGetResponseList>;
1820
+ save(options: WithoutProjectId<AssetUpsertRequest>): Promise<void>;
1821
+ /** @deprecated Use {@link save} instead. */
1812
1822
  upsert(options: WithoutProjectId<AssetUpsertRequest>): Promise<void>;
1823
+ remove(options: WithoutProjectId<AssetDeleteRequest>): Promise<void>;
1824
+ /** @deprecated Use {@link remove} instead. */
1813
1825
  delete(options: WithoutProjectId<AssetDeleteRequest>): Promise<void>;
1814
1826
  }
1827
+ /** @deprecated Pass `bypassCache: true` to {@link AssetClient} instead. */
1815
1828
  declare class UncachedAssetClient extends AssetClient {
1816
1829
  constructor(options: Omit<ClientOptions & {
1817
1830
  projectId: NonNullable<ClientOptions['projectId']>;
@@ -1870,14 +1883,20 @@ type ImageFromTransformProps = XOR<{
1870
1883
  y: number;
1871
1884
  };
1872
1885
  }>;
1886
+ /**
1887
+ * Fluent API for reading and transforming an asset image URL.
1888
+ */
1889
+ interface ImageFromApi {
1890
+ /** Returns the image URL with the current transformations applied. */
1891
+ url: () => string;
1892
+ /** Applies image transformations and returns the same fluent API. */
1893
+ transform: (transformProps: ImageFromTransformProps) => ImageFromApi;
1894
+ }
1873
1895
  /**
1874
1896
  * A helper function for extracting the image URL from an asset and optionally
1875
1897
  * applying transformation URL query parameters.
1876
1898
  */
1877
- declare const imageFrom: (asset: Asset | AssetParamValueItem | string) => {
1878
- url: () => string;
1879
- transform: (transformProps: ImageFromTransformProps) => /*elided*/ any;
1880
- };
1899
+ declare const imageFrom: (asset: Asset | AssetParamValueItem | string) => ImageFromApi;
1881
1900
 
1882
1901
  /**
1883
1902
  * Converts a content asset to a put content asset body that has only the properties expected to the PUT API.
@@ -1888,4 +1907,4 @@ declare function convertAssetToPutAsset(asset: {
1888
1907
  projectId: string;
1889
1908
  }): AssetUpsertRequest;
1890
1909
 
1891
- export { type Asset, AssetClient, type AssetDefinitionType, type AssetDeleteRequest, type AssetGetRequest, type AssetGetRequestList, type AssetGetRequestSingle, type AssetGetResponse, type AssetGetResponseList, type AssetGetResponseSingle, type AssetParamValue, type AssetParamValueItem, type AssetUpsertRequest, type ImageDeliveryParams, type ImageFromTransformProps, UncachedAssetClient, assetDefinitions, convertAssetToPutAsset, getAssetDefinitionType, imageFrom };
1910
+ export { type Asset, AssetClient, type AssetDefinitionType, type AssetDeleteRequest, type AssetGetRequest, type AssetGetRequestList, type AssetGetRequestSingle, type AssetGetResponse, type AssetGetResponseList, type AssetGetResponseSingle, type AssetParamValue, type AssetParamValueItem, type AssetUpsertRequest, type ImageDeliveryParams, type ImageFromApi, type ImageFromTransformProps, UncachedAssetClient, assetDefinitions, convertAssetToPutAsset, getAssetDefinitionType, imageFrom };
package/dist/index.esm.js CHANGED
@@ -16,7 +16,21 @@ var AssetClient = class extends ApiClient {
16
16
  });
17
17
  return this.apiClient(fetchUri);
18
18
  }
19
- async upsert(options) {
19
+ /**
20
+ * Fetches a list of assets
21
+ */
22
+ async list(options = {}) {
23
+ const { projectId } = this.options;
24
+ const { filters, ...params } = options;
25
+ const rewrittenFilters = rewriteFiltersForApi(filters);
26
+ const fetchUri = this.createUrl(ASSET_BASE_PATH, {
27
+ ...params,
28
+ projectId,
29
+ ...rewrittenFilters
30
+ });
31
+ return this.apiClient(fetchUri);
32
+ }
33
+ async save(options) {
20
34
  const { projectId } = this.options;
21
35
  const fetchUri = this.createUrl(ASSET_BASE_PATH);
22
36
  await this.apiClient(fetchUri, {
@@ -25,7 +39,11 @@ var AssetClient = class extends ApiClient {
25
39
  expectNoContent: true
26
40
  });
27
41
  }
28
- async delete(options) {
42
+ /** @deprecated Use {@link save} instead. */
43
+ async upsert(options) {
44
+ return this.save(options);
45
+ }
46
+ async remove(options) {
29
47
  const { projectId } = this.options;
30
48
  const fetchUri = this.createUrl(ASSET_BASE_PATH);
31
49
  await this.apiClient(fetchUri, {
@@ -34,6 +52,10 @@ var AssetClient = class extends ApiClient {
34
52
  expectNoContent: true
35
53
  });
36
54
  }
55
+ /** @deprecated Use {@link remove} instead. */
56
+ async delete(options) {
57
+ return this.remove(options);
58
+ }
37
59
  };
38
60
  var UncachedAssetClient = class extends AssetClient {
39
61
  constructor(options) {
package/dist/index.js CHANGED
@@ -47,7 +47,21 @@ var AssetClient = class extends import_api.ApiClient {
47
47
  });
48
48
  return this.apiClient(fetchUri);
49
49
  }
50
- async upsert(options) {
50
+ /**
51
+ * Fetches a list of assets
52
+ */
53
+ async list(options = {}) {
54
+ const { projectId } = this.options;
55
+ const { filters, ...params } = options;
56
+ const rewrittenFilters = (0, import_api.rewriteFiltersForApi)(filters);
57
+ const fetchUri = this.createUrl(ASSET_BASE_PATH, {
58
+ ...params,
59
+ projectId,
60
+ ...rewrittenFilters
61
+ });
62
+ return this.apiClient(fetchUri);
63
+ }
64
+ async save(options) {
51
65
  const { projectId } = this.options;
52
66
  const fetchUri = this.createUrl(ASSET_BASE_PATH);
53
67
  await this.apiClient(fetchUri, {
@@ -56,7 +70,11 @@ var AssetClient = class extends import_api.ApiClient {
56
70
  expectNoContent: true
57
71
  });
58
72
  }
59
- async delete(options) {
73
+ /** @deprecated Use {@link save} instead. */
74
+ async upsert(options) {
75
+ return this.save(options);
76
+ }
77
+ async remove(options) {
60
78
  const { projectId } = this.options;
61
79
  const fetchUri = this.createUrl(ASSET_BASE_PATH);
62
80
  await this.apiClient(fetchUri, {
@@ -65,6 +83,10 @@ var AssetClient = class extends import_api.ApiClient {
65
83
  expectNoContent: true
66
84
  });
67
85
  }
86
+ /** @deprecated Use {@link remove} instead. */
87
+ async delete(options) {
88
+ return this.remove(options);
89
+ }
68
90
  };
69
91
  var UncachedAssetClient = class extends AssetClient {
70
92
  constructor(options) {
package/dist/index.mjs CHANGED
@@ -16,7 +16,21 @@ var AssetClient = class extends ApiClient {
16
16
  });
17
17
  return this.apiClient(fetchUri);
18
18
  }
19
- async upsert(options) {
19
+ /**
20
+ * Fetches a list of assets
21
+ */
22
+ async list(options = {}) {
23
+ const { projectId } = this.options;
24
+ const { filters, ...params } = options;
25
+ const rewrittenFilters = rewriteFiltersForApi(filters);
26
+ const fetchUri = this.createUrl(ASSET_BASE_PATH, {
27
+ ...params,
28
+ projectId,
29
+ ...rewrittenFilters
30
+ });
31
+ return this.apiClient(fetchUri);
32
+ }
33
+ async save(options) {
20
34
  const { projectId } = this.options;
21
35
  const fetchUri = this.createUrl(ASSET_BASE_PATH);
22
36
  await this.apiClient(fetchUri, {
@@ -25,7 +39,11 @@ var AssetClient = class extends ApiClient {
25
39
  expectNoContent: true
26
40
  });
27
41
  }
28
- async delete(options) {
42
+ /** @deprecated Use {@link save} instead. */
43
+ async upsert(options) {
44
+ return this.save(options);
45
+ }
46
+ async remove(options) {
29
47
  const { projectId } = this.options;
30
48
  const fetchUri = this.createUrl(ASSET_BASE_PATH);
31
49
  await this.apiClient(fetchUri, {
@@ -34,6 +52,10 @@ var AssetClient = class extends ApiClient {
34
52
  expectNoContent: true
35
53
  });
36
54
  }
55
+ /** @deprecated Use {@link remove} instead. */
56
+ async delete(options) {
57
+ return this.remove(options);
58
+ }
37
59
  };
38
60
  var UncachedAssetClient = class extends AssetClient {
39
61
  constructor(options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/assets",
3
- "version": "20.72.3-alpha.3+3e396259ba",
3
+ "version": "20.72.3-alpha.45+2b8b05d58a",
4
4
  "description": "Uniform Assets",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -21,11 +21,12 @@
21
21
  "sideEffects": false,
22
22
  "scripts": {
23
23
  "build": "run-s update-openapi build:ts",
24
- "build:ts": "tsup",
24
+ "build:ts": "tsup && pnpm test:types",
25
25
  "dev": "run-s update-openapi dev:ts",
26
26
  "dev:ts": "tsup --watch",
27
27
  "clean": "rimraf dist",
28
28
  "test": "vitest run",
29
+ "test:types": "tsc --ignoreConfig --noEmit --strict --skipLibCheck --module esnext --moduleResolution bundler --target es2018 type-tests/imageFrom.ts",
29
30
  "format": "prettier --write \"src/**/*.{js,ts,tsx}\"",
30
31
  "update-openapi": "tsx ./scripts/update-openapi.cts"
31
32
  },
@@ -36,11 +37,11 @@
36
37
  "access": "public"
37
38
  },
38
39
  "dependencies": {
39
- "@uniformdev/context": "20.72.3-alpha.3+3e396259ba",
40
- "@uniformdev/files": "20.72.3-alpha.3+3e396259ba"
40
+ "@uniformdev/context": "20.72.3-alpha.45+2b8b05d58a",
41
+ "@uniformdev/files": "20.72.3-alpha.45+2b8b05d58a"
41
42
  },
42
43
  "devDependencies": {
43
44
  "ts-xor": "^1.3.0"
44
45
  },
45
- "gitHead": "3e396259bafc25b69071cda4102cea340b866922"
46
+ "gitHead": "2b8b05d58ab275b4d29a9647feeaad47b0ab5cce"
46
47
  }