@uniformdev/assets 20.50.2-alpha.146 → 20.50.2-alpha.167
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 +221 -173
- package/dist/index.d.ts +221 -173
- package/dist/index.esm.js +24 -2
- package/dist/index.js +27 -5
- package/dist/index.mjs +24 -2
- package/package.json +4 -4
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
|
-
|
|
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
|
-
|
|
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
|
@@ -18,8 +18,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
20
|
// src/index.ts
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
23
|
AssetClient: () => AssetClient,
|
|
24
24
|
UncachedAssetClient: () => UncachedAssetClient,
|
|
25
25
|
assetDefinitions: () => assetDefinitions,
|
|
@@ -27,7 +27,7 @@ __export(src_exports, {
|
|
|
27
27
|
getAssetDefinitionType: () => getAssetDefinitionType,
|
|
28
28
|
imageFrom: () => imageFrom
|
|
29
29
|
});
|
|
30
|
-
module.exports = __toCommonJS(
|
|
30
|
+
module.exports = __toCommonJS(index_exports);
|
|
31
31
|
|
|
32
32
|
// src/AssetClient.ts
|
|
33
33
|
var import_api = require("@uniformdev/context/api");
|
|
@@ -47,7 +47,21 @@ var AssetClient = class extends import_api.ApiClient {
|
|
|
47
47
|
});
|
|
48
48
|
return this.apiClient(fetchUri);
|
|
49
49
|
}
|
|
50
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.50.2-alpha.
|
|
3
|
+
"version": "20.50.2-alpha.167+74e60d5bb7",
|
|
4
4
|
"description": "Uniform Assets",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@uniformdev/context": "20.50.2-alpha.
|
|
40
|
-
"@uniformdev/files": "20.50.2-alpha.
|
|
39
|
+
"@uniformdev/context": "20.50.2-alpha.167+74e60d5bb7",
|
|
40
|
+
"@uniformdev/files": "20.50.2-alpha.167+74e60d5bb7"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"ts-xor": "^1.3.0"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "74e60d5bb79fe1c4d446e4d3e6edf9f08850be4f"
|
|
46
46
|
}
|