@uniformdev/project-map 18.6.0 → 18.7.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.
@@ -106,26 +106,7 @@ var ProjectMapClient = class extends ApiClient {
106
106
  };
107
107
  this.getSubtree = async (options) => {
108
108
  var _a;
109
- const { projectId } = this.options;
110
- const fetchOptions = {
111
- projectId,
112
- projectMapId: options.projectMapId
113
- };
114
- if (options.search) {
115
- fetchOptions["search"] = options.search;
116
- } else if (options.id) {
117
- fetchOptions["id"] = options.id;
118
- } else if (options.path && this.validatePath(options.path)) {
119
- fetchOptions["path"] = options.path;
120
- } else if (options.compositionId) {
121
- fetchOptions["compositionId"] = options.compositionId;
122
- }
123
- if (options.depth) {
124
- fetchOptions["depth"] = options.depth.toString();
125
- }
126
- if (options.expanded) {
127
- fetchOptions["expanded"] = "true";
128
- }
109
+ const fetchOptions = this.setFetchOptions(options);
129
110
  fetchOptions["tree"] = "true";
130
111
  const fetchUri = this.createUrl("/api/v1/project-map-nodes", fetchOptions);
131
112
  const result = await this.apiClient(fetchUri);
@@ -149,35 +130,46 @@ var ProjectMapClient = class extends ApiClient {
149
130
  return root;
150
131
  };
151
132
  this.getNodes = async (options) => {
152
- const { projectId } = this.options;
153
- const fetchOptions = {
154
- projectId
155
- };
156
- if (options.projectMapId) {
157
- fetchOptions["projectMapId"] = options.projectMapId;
158
- }
159
- if (options.search) {
160
- fetchOptions["search"] = options.search;
161
- } else if (options.id) {
162
- fetchOptions["id"] = options.id;
163
- } else if (options.path && this.validatePath(options.path)) {
164
- fetchOptions["path"] = options.path;
165
- } else if (options.compositionId) {
166
- fetchOptions["compositionId"] = options.compositionId;
167
- }
133
+ const fetchOptions = this.setFetchOptions(options);
168
134
  if (options.limit) {
169
135
  fetchOptions["limit"] = options.limit.toString();
170
136
  }
171
137
  if (options.offset) {
172
138
  fetchOptions["offset"] = options.offset.toString();
173
139
  }
174
- if (options.expanded) {
175
- fetchOptions["expanded"] = "true";
176
- }
177
140
  const fetchUri = this.createUrl("/api/v1/project-map-nodes", fetchOptions);
178
141
  return await this.apiClient(fetchUri);
179
142
  };
180
143
  }
144
+ setFetchOptions(options) {
145
+ const { projectId } = this.options;
146
+ const fetchOptions = {
147
+ projectId,
148
+ projectMapId: options.projectMapId
149
+ };
150
+ if (options.search) {
151
+ fetchOptions["search"] = options.search;
152
+ } else if (options.id) {
153
+ fetchOptions["id"] = options.id;
154
+ } else if (options.path && this.validatePath(options.path)) {
155
+ fetchOptions["path"] = options.path;
156
+ } else if (options.compositionId) {
157
+ fetchOptions["compositionId"] = options.compositionId;
158
+ }
159
+ if (options.withCompositionData) {
160
+ fetchOptions["withCompositionData"] = "true";
161
+ }
162
+ if (options.withCompositionUIStatus) {
163
+ fetchOptions["withCompositionUIStatus"] = "true";
164
+ }
165
+ if (options.depth) {
166
+ fetchOptions["depth"] = options.depth.toString();
167
+ }
168
+ if (options.expanded) {
169
+ fetchOptions["expanded"] = "true";
170
+ }
171
+ return fetchOptions;
172
+ }
181
173
  cleanProjectMapNode(node) {
182
174
  var _a, _b, _c;
183
175
  return {
package/dist/cli/cli.js CHANGED
@@ -18220,26 +18220,7 @@ var ProjectMapClient = class extends import_api.ApiClient {
18220
18220
  };
18221
18221
  this.getSubtree = async (options) => {
18222
18222
  var _a2;
18223
- const { projectId } = this.options;
18224
- const fetchOptions = {
18225
- projectId,
18226
- projectMapId: options.projectMapId
18227
- };
18228
- if (options.search) {
18229
- fetchOptions["search"] = options.search;
18230
- } else if (options.id) {
18231
- fetchOptions["id"] = options.id;
18232
- } else if (options.path && this.validatePath(options.path)) {
18233
- fetchOptions["path"] = options.path;
18234
- } else if (options.compositionId) {
18235
- fetchOptions["compositionId"] = options.compositionId;
18236
- }
18237
- if (options.depth) {
18238
- fetchOptions["depth"] = options.depth.toString();
18239
- }
18240
- if (options.expanded) {
18241
- fetchOptions["expanded"] = "true";
18242
- }
18223
+ const fetchOptions = this.setFetchOptions(options);
18243
18224
  fetchOptions["tree"] = "true";
18244
18225
  const fetchUri = this.createUrl("/api/v1/project-map-nodes", fetchOptions);
18245
18226
  const result = await this.apiClient(fetchUri);
@@ -18263,35 +18244,46 @@ var ProjectMapClient = class extends import_api.ApiClient {
18263
18244
  return root;
18264
18245
  };
18265
18246
  this.getNodes = async (options) => {
18266
- const { projectId } = this.options;
18267
- const fetchOptions = {
18268
- projectId
18269
- };
18270
- if (options.projectMapId) {
18271
- fetchOptions["projectMapId"] = options.projectMapId;
18272
- }
18273
- if (options.search) {
18274
- fetchOptions["search"] = options.search;
18275
- } else if (options.id) {
18276
- fetchOptions["id"] = options.id;
18277
- } else if (options.path && this.validatePath(options.path)) {
18278
- fetchOptions["path"] = options.path;
18279
- } else if (options.compositionId) {
18280
- fetchOptions["compositionId"] = options.compositionId;
18281
- }
18247
+ const fetchOptions = this.setFetchOptions(options);
18282
18248
  if (options.limit) {
18283
18249
  fetchOptions["limit"] = options.limit.toString();
18284
18250
  }
18285
18251
  if (options.offset) {
18286
18252
  fetchOptions["offset"] = options.offset.toString();
18287
18253
  }
18288
- if (options.expanded) {
18289
- fetchOptions["expanded"] = "true";
18290
- }
18291
18254
  const fetchUri = this.createUrl("/api/v1/project-map-nodes", fetchOptions);
18292
18255
  return await this.apiClient(fetchUri);
18293
18256
  };
18294
18257
  }
18258
+ setFetchOptions(options) {
18259
+ const { projectId } = this.options;
18260
+ const fetchOptions = {
18261
+ projectId,
18262
+ projectMapId: options.projectMapId
18263
+ };
18264
+ if (options.search) {
18265
+ fetchOptions["search"] = options.search;
18266
+ } else if (options.id) {
18267
+ fetchOptions["id"] = options.id;
18268
+ } else if (options.path && this.validatePath(options.path)) {
18269
+ fetchOptions["path"] = options.path;
18270
+ } else if (options.compositionId) {
18271
+ fetchOptions["compositionId"] = options.compositionId;
18272
+ }
18273
+ if (options.withCompositionData) {
18274
+ fetchOptions["withCompositionData"] = "true";
18275
+ }
18276
+ if (options.withCompositionUIStatus) {
18277
+ fetchOptions["withCompositionUIStatus"] = "true";
18278
+ }
18279
+ if (options.depth) {
18280
+ fetchOptions["depth"] = options.depth.toString();
18281
+ }
18282
+ if (options.expanded) {
18283
+ fetchOptions["expanded"] = "true";
18284
+ }
18285
+ return fetchOptions;
18286
+ }
18295
18287
  cleanProjectMapNode(node) {
18296
18288
  var _a2, _b2, _c2;
18297
18289
  return {
package/dist/cli/cli.mjs CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  __require,
7
7
  __toCommonJS,
8
8
  __toESM
9
- } from "../chunk-VEO6RNDL.mjs";
9
+ } from "../chunk-4GWDA2EG.mjs";
10
10
 
11
11
  // ../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js
12
12
  var require_ms = __commonJS({
package/dist/index.d.ts CHANGED
@@ -196,6 +196,13 @@ interface paths {
196
196
  search?: string;
197
197
  /** include expanded helper computed properties, includes isLeaf, parentPath, pathSegment */
198
198
  expanded?: boolean;
199
+ /** include basic composition information. ID, type, state, name, and definition id. */
200
+ withCompositionData?: boolean;
201
+ /**
202
+ * @deprecated Returns the UI status string of the composition.
203
+ * This internal status is subject to change without notice, and is thus marked deprecated to discourage use of internal data.
204
+ */
205
+ withCompositionUIStatus?: boolean;
199
206
  };
200
207
  };
201
208
  responses: {
@@ -342,6 +349,32 @@ interface components {
342
349
  pathSegment?: string;
343
350
  /** @description returns true if the node is a leaf node, meaning having no children, only included if requested with the expanded flag */
344
351
  isLeaf?: boolean;
352
+ compositionData?: components["schemas"]["ProjectMapNodeCompositionData"];
353
+ };
354
+ /** @description Basic information about a composition from the context of a project map node. */
355
+ ProjectMapNodeCompositionData: {
356
+ /** @description Type of the composition instance (public_id of its definition) */
357
+ type: string;
358
+ /**
359
+ * Format: uuid
360
+ * @description The public UUID of the composition.
361
+ */
362
+ id: string;
363
+ /** @description Slug pattern of this composition. */
364
+ slug?: string | null;
365
+ /** @description Friendly name of this composition. */
366
+ name: string;
367
+ /**
368
+ * @deprecated
369
+ * @description UI status value. Subject to change without notice; do not rely on this value. Only present when `withCompositionUIStatus` option is true.
370
+ * @enum {string}
371
+ */
372
+ uiStatus?: "Draft" | "Modified" | "Published" | "Orphan";
373
+ /**
374
+ * @description Icon name or URL for the composition definition (e.g. 'screen' or 'https://s3/my-component.jpg')
375
+ * @default screen
376
+ */
377
+ icon?: string;
345
378
  };
346
379
  ProjectMapNodeUpdate: {
347
380
  /**
@@ -503,6 +536,7 @@ declare class ProjectMapClient extends ApiClient<ProjectMapClientOptions> {
503
536
  deleteProjectMapNode: (options: WithoutProjectId<ProjectMapNodeDeleteRequest>) => Promise<void>;
504
537
  getSubtree: (options: WithoutProjectId<ProjectMapNodeGetRequest>) => Promise<ProjectMapSubtree | undefined>;
505
538
  getNodes: (options: WithoutProjectId<ProjectMapNodeGetRequest>) => Promise<ProjectMapNodeGetResponse>;
539
+ private setFetchOptions;
506
540
  private cleanProjectMapNode;
507
541
  private validatePath;
508
542
  }
package/dist/index.esm.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  ProjectMapClient,
3
3
  ROOT_NODE_PATH,
4
4
  UncachedProjectMapClient
5
- } from "./chunk-VEO6RNDL.mjs";
5
+ } from "./chunk-4GWDA2EG.mjs";
6
6
  export {
7
7
  ProjectMapClient,
8
8
  ROOT_NODE_PATH,
package/dist/index.js CHANGED
@@ -97,26 +97,7 @@ var ProjectMapClient = class extends import_api.ApiClient {
97
97
  };
98
98
  this.getSubtree = async (options) => {
99
99
  var _a;
100
- const { projectId } = this.options;
101
- const fetchOptions = {
102
- projectId,
103
- projectMapId: options.projectMapId
104
- };
105
- if (options.search) {
106
- fetchOptions["search"] = options.search;
107
- } else if (options.id) {
108
- fetchOptions["id"] = options.id;
109
- } else if (options.path && this.validatePath(options.path)) {
110
- fetchOptions["path"] = options.path;
111
- } else if (options.compositionId) {
112
- fetchOptions["compositionId"] = options.compositionId;
113
- }
114
- if (options.depth) {
115
- fetchOptions["depth"] = options.depth.toString();
116
- }
117
- if (options.expanded) {
118
- fetchOptions["expanded"] = "true";
119
- }
100
+ const fetchOptions = this.setFetchOptions(options);
120
101
  fetchOptions["tree"] = "true";
121
102
  const fetchUri = this.createUrl("/api/v1/project-map-nodes", fetchOptions);
122
103
  const result = await this.apiClient(fetchUri);
@@ -140,35 +121,46 @@ var ProjectMapClient = class extends import_api.ApiClient {
140
121
  return root;
141
122
  };
142
123
  this.getNodes = async (options) => {
143
- const { projectId } = this.options;
144
- const fetchOptions = {
145
- projectId
146
- };
147
- if (options.projectMapId) {
148
- fetchOptions["projectMapId"] = options.projectMapId;
149
- }
150
- if (options.search) {
151
- fetchOptions["search"] = options.search;
152
- } else if (options.id) {
153
- fetchOptions["id"] = options.id;
154
- } else if (options.path && this.validatePath(options.path)) {
155
- fetchOptions["path"] = options.path;
156
- } else if (options.compositionId) {
157
- fetchOptions["compositionId"] = options.compositionId;
158
- }
124
+ const fetchOptions = this.setFetchOptions(options);
159
125
  if (options.limit) {
160
126
  fetchOptions["limit"] = options.limit.toString();
161
127
  }
162
128
  if (options.offset) {
163
129
  fetchOptions["offset"] = options.offset.toString();
164
130
  }
165
- if (options.expanded) {
166
- fetchOptions["expanded"] = "true";
167
- }
168
131
  const fetchUri = this.createUrl("/api/v1/project-map-nodes", fetchOptions);
169
132
  return await this.apiClient(fetchUri);
170
133
  };
171
134
  }
135
+ setFetchOptions(options) {
136
+ const { projectId } = this.options;
137
+ const fetchOptions = {
138
+ projectId,
139
+ projectMapId: options.projectMapId
140
+ };
141
+ if (options.search) {
142
+ fetchOptions["search"] = options.search;
143
+ } else if (options.id) {
144
+ fetchOptions["id"] = options.id;
145
+ } else if (options.path && this.validatePath(options.path)) {
146
+ fetchOptions["path"] = options.path;
147
+ } else if (options.compositionId) {
148
+ fetchOptions["compositionId"] = options.compositionId;
149
+ }
150
+ if (options.withCompositionData) {
151
+ fetchOptions["withCompositionData"] = "true";
152
+ }
153
+ if (options.withCompositionUIStatus) {
154
+ fetchOptions["withCompositionUIStatus"] = "true";
155
+ }
156
+ if (options.depth) {
157
+ fetchOptions["depth"] = options.depth.toString();
158
+ }
159
+ if (options.expanded) {
160
+ fetchOptions["expanded"] = "true";
161
+ }
162
+ return fetchOptions;
163
+ }
172
164
  cleanProjectMapNode(node) {
173
165
  var _a, _b, _c;
174
166
  return {
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  ProjectMapClient,
3
3
  ROOT_NODE_PATH,
4
4
  UncachedProjectMapClient
5
- } from "./chunk-VEO6RNDL.mjs";
5
+ } from "./chunk-4GWDA2EG.mjs";
6
6
  export {
7
7
  ProjectMapClient,
8
8
  ROOT_NODE_PATH,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/project-map",
3
- "version": "18.6.0",
3
+ "version": "18.7.1-alpha.11+7cf93b7e6",
4
4
  "description": "Uniform Project Map",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -46,17 +46,17 @@
46
46
  "/dist"
47
47
  ],
48
48
  "dependencies": {
49
- "@uniformdev/canvas": "18.6.0",
50
- "@uniformdev/context": "18.6.0",
49
+ "@uniformdev/canvas": "18.7.1-alpha.11+7cf93b7e6",
50
+ "@uniformdev/context": "18.7.1-alpha.11+7cf93b7e6",
51
51
  "p-limit": "^3.1.0"
52
52
  },
53
53
  "devDependencies": {
54
- "@types/yargs": "17.0.20",
55
- "@uniformdev/cli": "18.6.0",
54
+ "@types/yargs": "17.0.22",
55
+ "@uniformdev/cli": "18.7.1-alpha.11+7cf93b7e6",
56
56
  "yargs": "17.6.2"
57
57
  },
58
58
  "publishConfig": {
59
59
  "access": "public"
60
60
  },
61
- "gitHead": "2e2b4d179180900386f8b3ceb30d4a854a7e22fd"
61
+ "gitHead": "7cf93b7e693ac5a98f87d00f0028c43be13733da"
62
62
  }