@uniformdev/assets 20.47.2-alpha.4 → 20.48.1-alpha.11

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
@@ -904,6 +904,8 @@ interface components$1 {
904
904
  };
905
905
  /** @enum {string} */
906
906
  ReleaseState: "open" | "locked" | "queued" | "launching" | "launched" | "deleting";
907
+ /** @enum {string} */
908
+ ReleaseScheduleState: "scheduled" | "unscheduled";
907
909
  ProjectMapNodeAllowedQueryString: {
908
910
  /** @description The name of the query string parameter */
909
911
  name: string;
@@ -971,9 +973,15 @@ interface paths {
971
973
  limit?: components["parameters"]["limit"];
972
974
  /** @description Number of records to skip */
973
975
  offset?: components["parameters"]["offset"];
974
- /** @description Sets the sorting of the results. If unspecified, results are sorted by name ascending
976
+ /** @description Sets the sorting of the results. If unspecified, results are sorted by creation date ascending.
977
+ * Allowed values are: updated_at_DESC, updated_at_ASC, created_at_DESC, created_at_ASC, name_DESC, name_ASC, slug_DESC, slug_ASC
975
978
  * */
976
979
  orderBy?: components["parameters"]["orderBy"];
980
+ /**
981
+ * @deprecated
982
+ * @description Returns counts for distinct values of the specified field or fields (provided as comma-separated IDs).
983
+ */
984
+ facetBy?: components["parameters"]["facetBy"];
977
985
  /** @description The project the asset/assets are on */
978
986
  projectId: components["parameters"]["projectId"];
979
987
  /** @description The asset type ID to filter by */
@@ -993,6 +1001,18 @@ interface paths {
993
1001
  * Content copied to a release can be differentiated from base content by the `releaseId` property on the content. If the content is not copied to the release, this property will be undefined
994
1002
  * */
995
1003
  releaseId?: components["parameters"]["releaseId"];
1004
+ /** @description When true, includes full label entities in the response for UI rendering.
1005
+ * The assignedLabels array includes the label and its parent group (if any).
1006
+ * This parameter is not supported with uniform.global.
1007
+ * */
1008
+ withAssignedLabels?: components["parameters"]["withAssignedLabels"];
1009
+ /**
1010
+ * @deprecated
1011
+ * @description Returns additional author and creator metadata for the asset.
1012
+ * This internal status is subject to change without notice and is thus marked deprecated to discourage use of internal data
1013
+ *
1014
+ */
1015
+ withUIStatus?: components["parameters"]["withUIStatus"];
996
1016
  };
997
1017
  header?: never;
998
1018
  path?: never;
@@ -1155,6 +1175,12 @@ interface components {
1155
1175
  _name: string;
1156
1176
  /** @description Name of the author of the most recent change */
1157
1177
  _author?: string;
1178
+ /** @description Identity subject of the author of the most recent change */
1179
+ _authorSubject?: string;
1180
+ /** @description Name of the original creator */
1181
+ _creator?: string;
1182
+ /** @description Identity subject of the original creator */
1183
+ _creatorSubject?: string;
1158
1184
  fields?: {
1159
1185
  title?: {
1160
1186
  value: string;
@@ -1211,6 +1237,8 @@ interface components {
1211
1237
  };
1212
1238
  };
1213
1239
  _dataResources?: components["schemas"]["DataResourceDefinitions"];
1240
+ /** @description Array of label public IDs assigned to this asset (max 30) */
1241
+ labels?: string[];
1214
1242
  };
1215
1243
  /** @description Defines the shape of the asset input */
1216
1244
  AssetInput: {
@@ -1250,6 +1278,8 @@ interface components {
1250
1278
  };
1251
1279
  };
1252
1280
  _dataResources?: components["schemas"]["DataResourceDefinitions"];
1281
+ /** @description Array of label public IDs assigned to this asset (max 30) */
1282
+ labels?: string[];
1253
1283
  };
1254
1284
  AssetApiResponse: {
1255
1285
  /**
@@ -1273,11 +1303,46 @@ interface components {
1273
1303
  */
1274
1304
  releaseId?: string;
1275
1305
  asset: components["schemas"]["Asset"];
1306
+ /** @description Full label entities for UI rendering (only present when withAssignedLabels=true). Read-only. */
1307
+ assignedLabels?: {
1308
+ [key: string]: {
1309
+ /** Format: uuid */
1310
+ projectId: string;
1311
+ label: {
1312
+ /** @description Public ID of the label (cannot be changed after creation) */
1313
+ publicId: string;
1314
+ /** @description Human readable name of the label */
1315
+ displayName: string;
1316
+ /** @description Whether this label is a group label (cannot be changed after creation) */
1317
+ isGroup: boolean;
1318
+ /** @description Public ID of the parent group label */
1319
+ parent?: string;
1320
+ /** @description Human readable color identifier */
1321
+ color: string;
1322
+ /** @description Short description of what the label is about */
1323
+ description?: string;
1324
+ /** @description Scope of the label (currently unused) */
1325
+ scope: string[];
1326
+ };
1327
+ /** Format: date-time */
1328
+ created: string;
1329
+ /** Format: date-time */
1330
+ modified: string;
1331
+ createdBy?: string;
1332
+ modifiedBy?: string;
1333
+ };
1334
+ };
1276
1335
  };
1277
1336
  AssetListResponse: {
1278
1337
  assets: components["schemas"]["AssetApiResponse"][];
1279
1338
  /** @description Total number of assets that match the query. Only present when `withTotalCount` option is true */
1280
1339
  totalCount?: number;
1340
+ /** @description Per-field counts for distinct values */
1341
+ facets?: {
1342
+ [key: string]: {
1343
+ [key: string]: number;
1344
+ };
1345
+ };
1281
1346
  };
1282
1347
  /** @description Defines a connection to a dynamic token on a data resource
1283
1348
  * */
@@ -1482,9 +1547,15 @@ interface components {
1482
1547
  * This is a list query parameter, and cannot be used with any primary query parameters
1483
1548
  * */
1484
1549
  keyword: string;
1485
- /** @description Sets the sorting of the results. If unspecified, results are sorted by name ascending
1550
+ /** @description Sets the sorting of the results. If unspecified, results are sorted by creation date ascending.
1551
+ * Allowed values are: updated_at_DESC, updated_at_ASC, created_at_DESC, created_at_ASC, name_DESC, name_ASC, slug_DESC, slug_ASC
1486
1552
  * */
1487
- orderBy: ("updated_at_DESC" | "updated_at_ASC" | "created_at_DESC" | "created_at_ASC" | "name_DESC" | "name_ASC")[];
1553
+ orderBy: string[];
1554
+ /**
1555
+ * @deprecated
1556
+ * @description Returns counts for distinct values of the specified field or fields (provided as comma-separated IDs).
1557
+ */
1558
+ facetBy: string;
1488
1559
  /** @description Filters asset lists by the user who created them. The user is specified by their identity subject
1489
1560
  * */
1490
1561
  createdBy: string;
@@ -1503,6 +1574,18 @@ interface components {
1503
1574
  * Content copied to a release can be differentiated from base content by the `releaseId` property on the content. If the content is not copied to the release, this property will be undefined
1504
1575
  * */
1505
1576
  releaseId: string;
1577
+ /** @description When true, includes full label entities in the response for UI rendering.
1578
+ * The assignedLabels array includes the label and its parent group (if any).
1579
+ * This parameter is not supported with uniform.global.
1580
+ * */
1581
+ withAssignedLabels: boolean;
1582
+ /**
1583
+ * @deprecated
1584
+ * @description Returns additional author and creator metadata for the asset.
1585
+ * This internal status is subject to change without notice and is thus marked deprecated to discourage use of internal data
1586
+ *
1587
+ */
1588
+ withUIStatus: boolean;
1506
1589
  };
1507
1590
  requestBodies: never;
1508
1591
  headers: never;
@@ -1601,8 +1684,12 @@ declare class AssetClient extends ApiClient {
1601
1684
  constructor(options: ClientOptions & {
1602
1685
  projectId: NonNullable<ClientOptions['projectId']>;
1603
1686
  });
1604
- get(options: WithoutProjectId<AssetGetRequestSingle>): Promise<AssetGetResponseSingle>;
1605
- get(options: WithoutProjectId<AssetGetRequestList>): Promise<AssetGetResponseList>;
1687
+ get(options: WithoutProjectId<AssetGetRequestSingle> & {
1688
+ filters?: never;
1689
+ }): Promise<AssetGetResponseSingle>;
1690
+ get(options: WithoutProjectId<AssetGetRequestList> & {
1691
+ filters?: Record<string, unknown>;
1692
+ }): Promise<AssetGetResponseList>;
1606
1693
  upsert(options: WithoutProjectId<AssetUpsertRequest>): Promise<void>;
1607
1694
  delete(options: WithoutProjectId<AssetDeleteRequest>): Promise<void>;
1608
1695
  }
package/dist/index.d.ts CHANGED
@@ -904,6 +904,8 @@ interface components$1 {
904
904
  };
905
905
  /** @enum {string} */
906
906
  ReleaseState: "open" | "locked" | "queued" | "launching" | "launched" | "deleting";
907
+ /** @enum {string} */
908
+ ReleaseScheduleState: "scheduled" | "unscheduled";
907
909
  ProjectMapNodeAllowedQueryString: {
908
910
  /** @description The name of the query string parameter */
909
911
  name: string;
@@ -971,9 +973,15 @@ interface paths {
971
973
  limit?: components["parameters"]["limit"];
972
974
  /** @description Number of records to skip */
973
975
  offset?: components["parameters"]["offset"];
974
- /** @description Sets the sorting of the results. If unspecified, results are sorted by name ascending
976
+ /** @description Sets the sorting of the results. If unspecified, results are sorted by creation date ascending.
977
+ * Allowed values are: updated_at_DESC, updated_at_ASC, created_at_DESC, created_at_ASC, name_DESC, name_ASC, slug_DESC, slug_ASC
975
978
  * */
976
979
  orderBy?: components["parameters"]["orderBy"];
980
+ /**
981
+ * @deprecated
982
+ * @description Returns counts for distinct values of the specified field or fields (provided as comma-separated IDs).
983
+ */
984
+ facetBy?: components["parameters"]["facetBy"];
977
985
  /** @description The project the asset/assets are on */
978
986
  projectId: components["parameters"]["projectId"];
979
987
  /** @description The asset type ID to filter by */
@@ -993,6 +1001,18 @@ interface paths {
993
1001
  * Content copied to a release can be differentiated from base content by the `releaseId` property on the content. If the content is not copied to the release, this property will be undefined
994
1002
  * */
995
1003
  releaseId?: components["parameters"]["releaseId"];
1004
+ /** @description When true, includes full label entities in the response for UI rendering.
1005
+ * The assignedLabels array includes the label and its parent group (if any).
1006
+ * This parameter is not supported with uniform.global.
1007
+ * */
1008
+ withAssignedLabels?: components["parameters"]["withAssignedLabels"];
1009
+ /**
1010
+ * @deprecated
1011
+ * @description Returns additional author and creator metadata for the asset.
1012
+ * This internal status is subject to change without notice and is thus marked deprecated to discourage use of internal data
1013
+ *
1014
+ */
1015
+ withUIStatus?: components["parameters"]["withUIStatus"];
996
1016
  };
997
1017
  header?: never;
998
1018
  path?: never;
@@ -1155,6 +1175,12 @@ interface components {
1155
1175
  _name: string;
1156
1176
  /** @description Name of the author of the most recent change */
1157
1177
  _author?: string;
1178
+ /** @description Identity subject of the author of the most recent change */
1179
+ _authorSubject?: string;
1180
+ /** @description Name of the original creator */
1181
+ _creator?: string;
1182
+ /** @description Identity subject of the original creator */
1183
+ _creatorSubject?: string;
1158
1184
  fields?: {
1159
1185
  title?: {
1160
1186
  value: string;
@@ -1211,6 +1237,8 @@ interface components {
1211
1237
  };
1212
1238
  };
1213
1239
  _dataResources?: components["schemas"]["DataResourceDefinitions"];
1240
+ /** @description Array of label public IDs assigned to this asset (max 30) */
1241
+ labels?: string[];
1214
1242
  };
1215
1243
  /** @description Defines the shape of the asset input */
1216
1244
  AssetInput: {
@@ -1250,6 +1278,8 @@ interface components {
1250
1278
  };
1251
1279
  };
1252
1280
  _dataResources?: components["schemas"]["DataResourceDefinitions"];
1281
+ /** @description Array of label public IDs assigned to this asset (max 30) */
1282
+ labels?: string[];
1253
1283
  };
1254
1284
  AssetApiResponse: {
1255
1285
  /**
@@ -1273,11 +1303,46 @@ interface components {
1273
1303
  */
1274
1304
  releaseId?: string;
1275
1305
  asset: components["schemas"]["Asset"];
1306
+ /** @description Full label entities for UI rendering (only present when withAssignedLabels=true). Read-only. */
1307
+ assignedLabels?: {
1308
+ [key: string]: {
1309
+ /** Format: uuid */
1310
+ projectId: string;
1311
+ label: {
1312
+ /** @description Public ID of the label (cannot be changed after creation) */
1313
+ publicId: string;
1314
+ /** @description Human readable name of the label */
1315
+ displayName: string;
1316
+ /** @description Whether this label is a group label (cannot be changed after creation) */
1317
+ isGroup: boolean;
1318
+ /** @description Public ID of the parent group label */
1319
+ parent?: string;
1320
+ /** @description Human readable color identifier */
1321
+ color: string;
1322
+ /** @description Short description of what the label is about */
1323
+ description?: string;
1324
+ /** @description Scope of the label (currently unused) */
1325
+ scope: string[];
1326
+ };
1327
+ /** Format: date-time */
1328
+ created: string;
1329
+ /** Format: date-time */
1330
+ modified: string;
1331
+ createdBy?: string;
1332
+ modifiedBy?: string;
1333
+ };
1334
+ };
1276
1335
  };
1277
1336
  AssetListResponse: {
1278
1337
  assets: components["schemas"]["AssetApiResponse"][];
1279
1338
  /** @description Total number of assets that match the query. Only present when `withTotalCount` option is true */
1280
1339
  totalCount?: number;
1340
+ /** @description Per-field counts for distinct values */
1341
+ facets?: {
1342
+ [key: string]: {
1343
+ [key: string]: number;
1344
+ };
1345
+ };
1281
1346
  };
1282
1347
  /** @description Defines a connection to a dynamic token on a data resource
1283
1348
  * */
@@ -1482,9 +1547,15 @@ interface components {
1482
1547
  * This is a list query parameter, and cannot be used with any primary query parameters
1483
1548
  * */
1484
1549
  keyword: string;
1485
- /** @description Sets the sorting of the results. If unspecified, results are sorted by name ascending
1550
+ /** @description Sets the sorting of the results. If unspecified, results are sorted by creation date ascending.
1551
+ * Allowed values are: updated_at_DESC, updated_at_ASC, created_at_DESC, created_at_ASC, name_DESC, name_ASC, slug_DESC, slug_ASC
1486
1552
  * */
1487
- orderBy: ("updated_at_DESC" | "updated_at_ASC" | "created_at_DESC" | "created_at_ASC" | "name_DESC" | "name_ASC")[];
1553
+ orderBy: string[];
1554
+ /**
1555
+ * @deprecated
1556
+ * @description Returns counts for distinct values of the specified field or fields (provided as comma-separated IDs).
1557
+ */
1558
+ facetBy: string;
1488
1559
  /** @description Filters asset lists by the user who created them. The user is specified by their identity subject
1489
1560
  * */
1490
1561
  createdBy: string;
@@ -1503,6 +1574,18 @@ interface components {
1503
1574
  * Content copied to a release can be differentiated from base content by the `releaseId` property on the content. If the content is not copied to the release, this property will be undefined
1504
1575
  * */
1505
1576
  releaseId: string;
1577
+ /** @description When true, includes full label entities in the response for UI rendering.
1578
+ * The assignedLabels array includes the label and its parent group (if any).
1579
+ * This parameter is not supported with uniform.global.
1580
+ * */
1581
+ withAssignedLabels: boolean;
1582
+ /**
1583
+ * @deprecated
1584
+ * @description Returns additional author and creator metadata for the asset.
1585
+ * This internal status is subject to change without notice and is thus marked deprecated to discourage use of internal data
1586
+ *
1587
+ */
1588
+ withUIStatus: boolean;
1506
1589
  };
1507
1590
  requestBodies: never;
1508
1591
  headers: never;
@@ -1601,8 +1684,12 @@ declare class AssetClient extends ApiClient {
1601
1684
  constructor(options: ClientOptions & {
1602
1685
  projectId: NonNullable<ClientOptions['projectId']>;
1603
1686
  });
1604
- get(options: WithoutProjectId<AssetGetRequestSingle>): Promise<AssetGetResponseSingle>;
1605
- get(options: WithoutProjectId<AssetGetRequestList>): Promise<AssetGetResponseList>;
1687
+ get(options: WithoutProjectId<AssetGetRequestSingle> & {
1688
+ filters?: never;
1689
+ }): Promise<AssetGetResponseSingle>;
1690
+ get(options: WithoutProjectId<AssetGetRequestList> & {
1691
+ filters?: Record<string, unknown>;
1692
+ }): Promise<AssetGetResponseList>;
1606
1693
  upsert(options: WithoutProjectId<AssetUpsertRequest>): Promise<void>;
1607
1694
  delete(options: WithoutProjectId<AssetDeleteRequest>): Promise<void>;
1608
1695
  }
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/AssetClient.ts
2
- import { ApiClient } from "@uniformdev/context/api";
2
+ import { ApiClient, rewriteFiltersForApi } from "@uniformdev/context/api";
3
3
  var ASSET_BASE_PATH = "/api/v1/assets";
4
4
  var AssetClient = class extends ApiClient {
5
5
  constructor(options) {
@@ -7,9 +7,12 @@ var AssetClient = class extends ApiClient {
7
7
  }
8
8
  async get(options) {
9
9
  const { projectId } = this.options;
10
+ const { filters, ...params } = options;
11
+ const rewrittenFilters = rewriteFiltersForApi(filters);
10
12
  const fetchUri = this.createUrl(ASSET_BASE_PATH, {
11
- ...options,
12
- projectId
13
+ ...params,
14
+ projectId,
15
+ ...rewrittenFilters
13
16
  });
14
17
  return this.apiClient(fetchUri);
15
18
  }
@@ -68,7 +71,7 @@ var isUniformImageUrl = (imageUrl) => {
68
71
  if (typeof imageUrl !== "string") {
69
72
  return false;
70
73
  }
71
- return /(img)\.(eu\.)?uniform\.(rocks|global)$/.test(new URL(imageUrl).hostname);
74
+ return /(img)\.(eu([1-9]\d*)?\.)?uniform\.(rocks|global)$/.test(new URL(imageUrl).hostname);
72
75
  } catch (e) {
73
76
  return false;
74
77
  }
@@ -142,6 +145,7 @@ function convertAssetToPutAsset(asset) {
142
145
  _dataResources: asset.asset._dataResources,
143
146
  _name: asset.asset._name,
144
147
  type: asset.asset.type,
148
+ labels: asset.asset.labels,
145
149
  fields: {
146
150
  title: (_a = asset.asset.fields) == null ? void 0 : _a.title,
147
151
  description: (_b = asset.asset.fields) == null ? void 0 : _b.description,
package/dist/index.js CHANGED
@@ -37,9 +37,12 @@ var AssetClient = class extends import_api.ApiClient {
37
37
  }
38
38
  async get(options) {
39
39
  const { projectId } = this.options;
40
+ const { filters, ...params } = options;
41
+ const rewrittenFilters = (0, import_api.rewriteFiltersForApi)(filters);
40
42
  const fetchUri = this.createUrl(ASSET_BASE_PATH, {
41
- ...options,
42
- projectId
43
+ ...params,
44
+ projectId,
45
+ ...rewrittenFilters
43
46
  });
44
47
  return this.apiClient(fetchUri);
45
48
  }
@@ -98,7 +101,7 @@ var isUniformImageUrl = (imageUrl) => {
98
101
  if (typeof imageUrl !== "string") {
99
102
  return false;
100
103
  }
101
- return /(img)\.(eu\.)?uniform\.(rocks|global)$/.test(new URL(imageUrl).hostname);
104
+ return /(img)\.(eu([1-9]\d*)?\.)?uniform\.(rocks|global)$/.test(new URL(imageUrl).hostname);
102
105
  } catch (e) {
103
106
  return false;
104
107
  }
@@ -172,6 +175,7 @@ function convertAssetToPutAsset(asset) {
172
175
  _dataResources: asset.asset._dataResources,
173
176
  _name: asset.asset._name,
174
177
  type: asset.asset.type,
178
+ labels: asset.asset.labels,
175
179
  fields: {
176
180
  title: (_a = asset.asset.fields) == null ? void 0 : _a.title,
177
181
  description: (_b = asset.asset.fields) == null ? void 0 : _b.description,
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/AssetClient.ts
2
- import { ApiClient } from "@uniformdev/context/api";
2
+ import { ApiClient, rewriteFiltersForApi } from "@uniformdev/context/api";
3
3
  var ASSET_BASE_PATH = "/api/v1/assets";
4
4
  var AssetClient = class extends ApiClient {
5
5
  constructor(options) {
@@ -7,9 +7,12 @@ var AssetClient = class extends ApiClient {
7
7
  }
8
8
  async get(options) {
9
9
  const { projectId } = this.options;
10
+ const { filters, ...params } = options;
11
+ const rewrittenFilters = rewriteFiltersForApi(filters);
10
12
  const fetchUri = this.createUrl(ASSET_BASE_PATH, {
11
- ...options,
12
- projectId
13
+ ...params,
14
+ projectId,
15
+ ...rewrittenFilters
13
16
  });
14
17
  return this.apiClient(fetchUri);
15
18
  }
@@ -68,7 +71,7 @@ var isUniformImageUrl = (imageUrl) => {
68
71
  if (typeof imageUrl !== "string") {
69
72
  return false;
70
73
  }
71
- return /(img)\.(eu\.)?uniform\.(rocks|global)$/.test(new URL(imageUrl).hostname);
74
+ return /(img)\.(eu([1-9]\d*)?\.)?uniform\.(rocks|global)$/.test(new URL(imageUrl).hostname);
72
75
  } catch (e) {
73
76
  return false;
74
77
  }
@@ -142,6 +145,7 @@ function convertAssetToPutAsset(asset) {
142
145
  _dataResources: asset.asset._dataResources,
143
146
  _name: asset.asset._name,
144
147
  type: asset.asset.type,
148
+ labels: asset.asset.labels,
145
149
  fields: {
146
150
  title: (_a = asset.asset.fields) == null ? void 0 : _a.title,
147
151
  description: (_b = asset.asset.fields) == null ? void 0 : _b.description,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/assets",
3
- "version": "20.47.2-alpha.4+01993700ac",
3
+ "version": "20.48.1-alpha.11+129de094d4",
4
4
  "description": "Uniform Assets",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -36,10 +36,10 @@
36
36
  "access": "public"
37
37
  },
38
38
  "dependencies": {
39
- "@uniformdev/context": "20.47.2-alpha.4+01993700ac"
39
+ "@uniformdev/context": "20.48.1-alpha.11+129de094d4"
40
40
  },
41
41
  "devDependencies": {
42
42
  "ts-xor": "^1.3.0"
43
43
  },
44
- "gitHead": "01993700aca23ef9a020e7d4b044577ab1114642"
44
+ "gitHead": "129de094d4db58d4adfcae07d6ab0fe506ca739e"
45
45
  }