@eide/foir-cli 0.11.0 → 0.11.2

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.
Files changed (2) hide show
  1. package/dist/cli.js +19 -36
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -1519,6 +1519,9 @@ function createRecordsMethods(client) {
1519
1519
  offset: params.offset ?? 0,
1520
1520
  customerId: params.customerId,
1521
1521
  search: params.search,
1522
+ // CLI is admin-equivalent and must see drafts; without preview the
1523
+ // platform now hides unpublished records on publishable models.
1524
+ preview: true,
1522
1525
  filters: params.filters?.map(
1523
1526
  (f) => create4(RecordFilterSchema, {
1524
1527
  field: f.field,
@@ -2359,9 +2362,6 @@ import {
2359
2362
  UpdateCustomerProfileSchemaRequestSchema,
2360
2363
  GetCustomerResolutionAttributesRequestSchema,
2361
2364
  GetEditorConfigsRequestSchema,
2362
- ListEmailActionsRequestSchema,
2363
- ListResendTemplatesRequestSchema,
2364
- UpdateEmailActionRequestSchema,
2365
2365
  ListVariantCatalogRequestSchema,
2366
2366
  GetVariantCatalogEntryRequestSchema,
2367
2367
  CreateVariantCatalogEntryRequestSchema,
@@ -2741,34 +2741,6 @@ function createSettingsMethods(client) {
2741
2741
  create8(ClearRecentlyOpenedRequestSchema, {})
2742
2742
  );
2743
2743
  return resp.success;
2744
- },
2745
- // ── Email Actions ──────────────────────────────────────────
2746
- async listEmailActions(params = {}) {
2747
- return client.listEmailActions(
2748
- create8(ListEmailActionsRequestSchema, {
2749
- limit: params.limit ?? 50,
2750
- offset: params.offset ?? 0
2751
- })
2752
- );
2753
- },
2754
- async updateEmailAction(params) {
2755
- const resp = await client.updateEmailAction(
2756
- create8(UpdateEmailActionRequestSchema, {
2757
- key: params.key,
2758
- resendTemplateId: params.resendTemplateId,
2759
- defaultFrom: params.defaultFrom,
2760
- defaultSubject: params.defaultSubject,
2761
- customData: params.customData,
2762
- isActive: params.isActive
2763
- })
2764
- );
2765
- return resp.action ?? null;
2766
- },
2767
- async listResendTemplates() {
2768
- const resp = await client.listResendTemplates(
2769
- create8(ListResendTemplatesRequestSchema, {})
2770
- );
2771
- return resp.templates ?? [];
2772
2744
  }
2773
2745
  };
2774
2746
  }
@@ -3612,11 +3584,22 @@ function pad(str, width) {
3612
3584
  }
3613
3585
  return str.padEnd(width);
3614
3586
  }
3615
- function timeAgo(dateStr) {
3616
- if (!dateStr) return "\u2014";
3617
- const date = new Date(dateStr);
3618
- const now = Date.now();
3619
- const diffMs = now - date.getTime();
3587
+ function timeAgo(value) {
3588
+ if (value == null) return "\u2014";
3589
+ let date;
3590
+ if (value instanceof Date) {
3591
+ date = value;
3592
+ } else if (typeof value === "string") {
3593
+ date = new Date(value);
3594
+ } else if (typeof value === "object" && "seconds" in value && value.seconds != null) {
3595
+ const seconds = typeof value.seconds === "bigint" ? Number(value.seconds) : value.seconds;
3596
+ const nanos = value.nanos ?? 0;
3597
+ date = new Date(seconds * 1e3 + Math.floor(nanos / 1e6));
3598
+ } else {
3599
+ return "\u2014";
3600
+ }
3601
+ if (Number.isNaN(date.getTime())) return "\u2014";
3602
+ const diffMs = Date.now() - date.getTime();
3620
3603
  if (diffMs < 0) return "future";
3621
3604
  const minutes = Math.floor(diffMs / 6e4);
3622
3605
  if (minutes < 1) return "just now";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eide/foir-cli",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
4
4
  "description": "Universal platform CLI for Foir platform",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -50,7 +50,7 @@
50
50
  "@bufbuild/protovalidate": "^1.1.1",
51
51
  "@connectrpc/connect": "^2.0.0",
52
52
  "@connectrpc/connect-node": "^2.0.0",
53
- "@eide/foir-proto-ts": "^0.26.0",
53
+ "@eide/foir-proto-ts": "^0.29.1",
54
54
  "chalk": "^5.3.0",
55
55
  "commander": "^12.1.0",
56
56
  "dotenv": "^16.4.5",