@uniformdev/assets 19.55.2-alpha.29 → 19.55.2-alpha.37

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
@@ -799,6 +799,28 @@ interface external {
799
799
  DataResourceVariables: {
800
800
  [key: string]: string;
801
801
  };
802
+ HistoryApiResponse: {
803
+ /**
804
+ * @description If there are more results, this will be populated with a token to pass in the next request to get the next page of results.
805
+ * If this is undefined then no more results are available.
806
+ */
807
+ cursor?: string;
808
+ /** @description If more history is available than your plan allows, and additional entries are available by upgrading, this will be true */
809
+ truncated?: boolean;
810
+ /** @description Version history entries. */
811
+ results?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["HistoryEntry"][];
812
+ };
813
+ HistoryEntry: {
814
+ /** @description The version ID of the entity. This can be used to fetch the version's data via the entity API. */
815
+ versionId: string;
816
+ /** @description The timestamp when the version was created in epoch milliseconds. */
817
+ timestamp: number;
818
+ /** @description The name (full name) of the user who created the version. */
819
+ authorName: string;
820
+ authorIsApiKey: boolean;
821
+ /** @description The state of the entity when the history entry was made. */
822
+ state: number;
823
+ };
802
824
  /** @description Category for tagging canvas entities */
803
825
  Category: {
804
826
  /**
@@ -885,4 +907,10 @@ declare class UncachedAssetClient extends AssetClient {
885
907
  }, 'bypassCache'>);
886
908
  }
887
909
 
888
- export { Asset, AssetClient, AssetDeleteRequest, AssetGetRequest, AssetGetRequestList, AssetGetRequestSingle, AssetGetResponse, AssetGetResponseList, AssetGetResponseSingle, AssetUpsertRequest, UncachedAssetClient };
910
+ /**
911
+ * Converts a content asset to a put content asset body that has only the properties expected to the PUT API.
912
+ * Removes things like author, stats, etc.
913
+ */
914
+ declare function convertAssetToPutAsset(asset: AssetGetResponseSingle): AssetUpsertRequest;
915
+
916
+ export { Asset, AssetClient, AssetDeleteRequest, AssetGetRequest, AssetGetRequestList, AssetGetRequestSingle, AssetGetResponse, AssetGetResponseList, AssetGetResponseSingle, AssetUpsertRequest, UncachedAssetClient, convertAssetToPutAsset };
package/dist/index.d.ts CHANGED
@@ -799,6 +799,28 @@ interface external {
799
799
  DataResourceVariables: {
800
800
  [key: string]: string;
801
801
  };
802
+ HistoryApiResponse: {
803
+ /**
804
+ * @description If there are more results, this will be populated with a token to pass in the next request to get the next page of results.
805
+ * If this is undefined then no more results are available.
806
+ */
807
+ cursor?: string;
808
+ /** @description If more history is available than your plan allows, and additional entries are available by upgrading, this will be true */
809
+ truncated?: boolean;
810
+ /** @description Version history entries. */
811
+ results?: external["uniform-canvas-types.swagger.yml"]["components"]["schemas"]["HistoryEntry"][];
812
+ };
813
+ HistoryEntry: {
814
+ /** @description The version ID of the entity. This can be used to fetch the version's data via the entity API. */
815
+ versionId: string;
816
+ /** @description The timestamp when the version was created in epoch milliseconds. */
817
+ timestamp: number;
818
+ /** @description The name (full name) of the user who created the version. */
819
+ authorName: string;
820
+ authorIsApiKey: boolean;
821
+ /** @description The state of the entity when the history entry was made. */
822
+ state: number;
823
+ };
802
824
  /** @description Category for tagging canvas entities */
803
825
  Category: {
804
826
  /**
@@ -885,4 +907,10 @@ declare class UncachedAssetClient extends AssetClient {
885
907
  }, 'bypassCache'>);
886
908
  }
887
909
 
888
- export { Asset, AssetClient, AssetDeleteRequest, AssetGetRequest, AssetGetRequestList, AssetGetRequestSingle, AssetGetResponse, AssetGetResponseList, AssetGetResponseSingle, AssetUpsertRequest, UncachedAssetClient };
910
+ /**
911
+ * Converts a content asset to a put content asset body that has only the properties expected to the PUT API.
912
+ * Removes things like author, stats, etc.
913
+ */
914
+ declare function convertAssetToPutAsset(asset: AssetGetResponseSingle): AssetUpsertRequest;
915
+
916
+ export { Asset, AssetClient, AssetDeleteRequest, AssetGetRequest, AssetGetRequestList, AssetGetRequestSingle, AssetGetResponse, AssetGetResponseList, AssetGetResponseSingle, AssetUpsertRequest, UncachedAssetClient, convertAssetToPutAsset };
package/dist/index.esm.js CHANGED
@@ -37,7 +37,24 @@ var UncachedAssetClient = class extends AssetClient {
37
37
  super({ ...options, bypassCache: true });
38
38
  }
39
39
  };
40
+
41
+ // src/utils/assetConverter.ts
42
+ function convertAssetToPutAsset(asset) {
43
+ return {
44
+ asset: {
45
+ _id: asset.asset._id,
46
+ _dataResources: asset.asset._dataResources,
47
+ _name: asset.asset._name,
48
+ type: asset.asset.type,
49
+ title: asset.asset.title,
50
+ description: asset.asset.description,
51
+ file: asset.asset.file
52
+ },
53
+ projectId: asset.projectId
54
+ };
55
+ }
40
56
  export {
41
57
  AssetClient,
42
- UncachedAssetClient
58
+ UncachedAssetClient,
59
+ convertAssetToPutAsset
43
60
  };
package/dist/index.js CHANGED
@@ -21,7 +21,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var src_exports = {};
22
22
  __export(src_exports, {
23
23
  AssetClient: () => AssetClient,
24
- UncachedAssetClient: () => UncachedAssetClient
24
+ UncachedAssetClient: () => UncachedAssetClient,
25
+ convertAssetToPutAsset: () => convertAssetToPutAsset
25
26
  });
26
27
  module.exports = __toCommonJS(src_exports);
27
28
 
@@ -64,8 +65,25 @@ var UncachedAssetClient = class extends AssetClient {
64
65
  super({ ...options, bypassCache: true });
65
66
  }
66
67
  };
68
+
69
+ // src/utils/assetConverter.ts
70
+ function convertAssetToPutAsset(asset) {
71
+ return {
72
+ asset: {
73
+ _id: asset.asset._id,
74
+ _dataResources: asset.asset._dataResources,
75
+ _name: asset.asset._name,
76
+ type: asset.asset.type,
77
+ title: asset.asset.title,
78
+ description: asset.asset.description,
79
+ file: asset.asset.file
80
+ },
81
+ projectId: asset.projectId
82
+ };
83
+ }
67
84
  // Annotate the CommonJS export names for ESM import in node:
68
85
  0 && (module.exports = {
69
86
  AssetClient,
70
- UncachedAssetClient
87
+ UncachedAssetClient,
88
+ convertAssetToPutAsset
71
89
  });
package/dist/index.mjs CHANGED
@@ -37,7 +37,24 @@ var UncachedAssetClient = class extends AssetClient {
37
37
  super({ ...options, bypassCache: true });
38
38
  }
39
39
  };
40
+
41
+ // src/utils/assetConverter.ts
42
+ function convertAssetToPutAsset(asset) {
43
+ return {
44
+ asset: {
45
+ _id: asset.asset._id,
46
+ _dataResources: asset.asset._dataResources,
47
+ _name: asset.asset._name,
48
+ type: asset.asset.type,
49
+ title: asset.asset.title,
50
+ description: asset.asset.description,
51
+ file: asset.asset.file
52
+ },
53
+ projectId: asset.projectId
54
+ };
55
+ }
40
56
  export {
41
57
  AssetClient,
42
- UncachedAssetClient
58
+ UncachedAssetClient,
59
+ convertAssetToPutAsset
43
60
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/assets",
3
- "version": "19.55.2-alpha.29+d3dee9648",
3
+ "version": "19.55.2-alpha.37+da2058d0a",
4
4
  "description": "Uniform Assets",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -36,7 +36,7 @@
36
36
  "access": "public"
37
37
  },
38
38
  "dependencies": {
39
- "@uniformdev/context": "19.55.2-alpha.29+d3dee9648"
39
+ "@uniformdev/context": "19.55.2-alpha.37+da2058d0a"
40
40
  },
41
- "gitHead": "d3dee964810fcfa01070b60b83acadf1e5487cb1"
41
+ "gitHead": "da2058d0a3cd6812a4181d9758903f307d75dbd2"
42
42
  }