@myapihq/cli 2.31.3 → 2.31.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.
@@ -87,7 +87,7 @@ export async function visits(flags) {
87
87
  ts: v.ts,
88
88
  })));
89
89
  // /visits returns only {visits, total} — it does NOT echo limit/offset the
90
- // way /events and /interactions do, so this used to print
90
+ // way /interactions does, so this used to print
91
91
  // "Showing: undefined | Offset: undefined". Report what the response
92
92
  // actually carries.
93
93
  info(`Total: ${res.total} | Showing: ${res.visits.length}`);
@@ -128,7 +128,11 @@ export async function events(flags) {
128
128
  campaign_id: e.campaign_id ?? '',
129
129
  ts: e.ts,
130
130
  })));
131
- info(`Total: ${res.total} | Showing: ${res.limit} | Offset: ${res.offset}`);
131
+ // /events returns {events, total} the limit/offset echo the visits comment
132
+ // above attributes to it is in `meta`, which the SDK does not surface, so
133
+ // this printed "Showing: undefined | Offset: undefined" too. Only
134
+ // /interactions genuinely echoes them in the body.
135
+ info(`Total: ${res.total} | Showing: ${res.events.length}`);
132
136
  }
133
137
  // Geographic distribution sample of the org's pixel audience.
134
138
  export async function audience(flags) {
package/dist/errors.js CHANGED
@@ -144,7 +144,16 @@ export function friendlyError(err) {
144
144
  lines.push(err.requestId
145
145
  ? ` Quote this when reporting it: ${err.requestId}`
146
146
  : ' No request id came back, so quote the exact command and the time instead.');
147
- lines.push(' Whether the change went through is not knowable from here check before retrying.');
147
+ // Only for a request that could have changed something. A 500 can land
148
+ // before or after a write, so the warning is right for POST/PATCH/DELETE —
149
+ // but `pixel audience` is a GET, and telling someone to go and check
150
+ // whether their read went through sends them looking for a change that
151
+ // could not exist. Unknown method keeps the warning: silence about a
152
+ // possible half-applied write is the worse failure.
153
+ const read = err.method === 'GET' || err.method === 'HEAD';
154
+ if (!read) {
155
+ lines.push(' Whether the change went through is not knowable from here — check before retrying.');
156
+ }
148
157
  return withOrgContext(lines.join('\n'), err);
149
158
  }
150
159
  const base = ERROR_MESSAGES[err.code] || err.code;
@@ -139,3 +139,29 @@ function looksLikeBadKey(err) {
139
139
  ]);
140
140
  return err.status === 401 && (!err.code || AUTH_CODES.has(String(err.code).toLowerCase()));
141
141
  }
142
+ // A 500 on a GET used to end with "Whether the change went through is not
143
+ // knowable from here — check before retrying." `pixel audience` is a read; it
144
+ // sent people to look for a change that could not exist. Found 2026-08-24 while
145
+ // fixing PIXEL_BASE, when the command finally reached the platform at all.
146
+ describe('5xx advice distinguishes a read from a write', () => {
147
+ function err(method) {
148
+ const e = new MyApiError('ANALYTICS_ERROR', 502, 'analytics query failed');
149
+ e.requestId = 'req_test';
150
+ if (method)
151
+ e.method = method;
152
+ return e;
153
+ }
154
+ it('says nothing about a change after a failed GET', () => {
155
+ const msg = friendlyError(err('GET'));
156
+ expect(msg).not.toContain('went through');
157
+ expect(msg).toContain('req_test');
158
+ expect(msg).toContain('our fault');
159
+ });
160
+ it('still warns after a failed write', () => {
161
+ expect(friendlyError(err('POST'))).toContain('went through');
162
+ expect(friendlyError(err('DELETE'))).toContain('went through');
163
+ });
164
+ it('keeps the warning when the method is unknown', () => {
165
+ expect(friendlyError(err())).toContain('went through');
166
+ });
167
+ });
@@ -4,7 +4,7 @@ version: 1.0.0
4
4
  description: >
5
5
  Tracking pixel + identity resolution for MyAPI funnels and email. Capture visits and events, resolve known users to anonymous sessions, stream interaction events for analytics. Pairs with mycrmapi for auto-ingest of pixel_visit events on known contacts.
6
6
  triggers: [pixel, analytics, tracking, visit, event, identity, session, attribution, geo, open pixel]
7
- checksum: sha256-2c6508a5fdfa752cc5fd4231c087380e6d904f514973830a34e919b277ad31de
7
+ checksum: sha256-4be497d5db05dbca3646b76b3385c22f84de4726d1049a7d9876c054159e4a58
8
8
  ---
9
9
 
10
10
  # MyPixelAPI
@@ -103,7 +103,7 @@ graph across the visitor's sessions.
103
103
  <!-- http:start -->
104
104
  <!-- generated by `npm run canonical-sync` — do not edit -->
105
105
  ```
106
- base https://api.mypixelapi.com
106
+ base https://api.myapihq.com
107
107
  path POST /pixel/orgs/{org_id}/identify
108
108
  auth Authorization: Bearer <key> (fn: env.__MYAPI_KEY · container: env.MYAPI_KEY)
109
109
  reply { "success": true, "data": …, "error": null, "meta": {…} }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@myapihq/cli",
3
3
  "license": "Apache-2.0",
4
- "version": "2.31.3",
4
+ "version": "2.31.4",
5
5
  "description": "MyAPI command-line interface",
6
6
  "repository": {
7
7
  "type": "git",
@@ -47,7 +47,7 @@
47
47
  "lint:skills:strict": "node scripts/copy-skills.js && node scripts/lint-skills.js --strict"
48
48
  },
49
49
  "dependencies": {
50
- "@myapihq/sdk": "^2.31.3"
50
+ "@myapihq/sdk": "^2.31.4"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/node": "^25.6.0",