@dyne/interfacer-client 0.3.3 → 0.3.4

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.js CHANGED
@@ -1490,21 +1490,24 @@ var ResourceClient = class {
1490
1490
  const loc = await this.createLocation(params.location);
1491
1491
  locationId = loc.id;
1492
1492
  }
1493
- const res = await this.graphql.request(CREATE_PROJECT, {
1493
+ const variables = {
1494
1494
  name: params.name,
1495
1495
  note: params.note || "",
1496
1496
  metadata: JSON.stringify(params.metadata || {}),
1497
1497
  agent: this.userId,
1498
1498
  creationTime: (/* @__PURE__ */ new Date()).toISOString(),
1499
1499
  location: locationId,
1500
- tags: params.tags || [],
1501
1500
  resourceSpec: specId,
1502
1501
  oneUnit: vars.unitOne,
1503
1502
  images: params.images || [],
1504
1503
  repo: params.repo || "",
1505
1504
  process: processId,
1506
1505
  license: params.license || ""
1507
- });
1506
+ };
1507
+ if (params.tags && params.tags.length > 0) {
1508
+ variables.tags = params.tags;
1509
+ }
1510
+ const res = await this.graphql.request(CREATE_PROJECT, variables);
1508
1511
  if (res.errors?.length) throw new Error(`createProject failed: ${res.errors[0].message}`);
1509
1512
  return res.data.createEconomicEvent.economicEvent.resourceInventoriedAs;
1510
1513
  }