@velaro/cli 1.4.102 → 1.4.103
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/README.md +19 -0
- package/bin/velaro.js +12 -0
- package/lib/api.js +2 -1
- package/lib/apple-pay.js +32 -0
- package/lib/apple-pay.test.js +32 -0
- package/lib/avatar-switch.js +42 -0
- package/lib/avatar-switch.test.js +49 -0
- package/lib/build-info.js +28 -0
- package/lib/build-info.test.js +24 -0
- package/lib/commands/apple-pay.js +73 -0
- package/lib/commands/avatar.js +60 -2
- package/lib/commands/billing-automation.js +172 -0
- package/lib/commands/copilotstudio.js +14 -1
- package/lib/commands/enterprise-reports.js +1 -0
- package/lib/commands/entitlement.js +29 -1
- package/lib/commands/focus.js +1 -1
- package/lib/commands/index.js +38 -2
- package/lib/commands/logs-insights.js +342 -0
- package/lib/commands/logs.js +313 -3
- package/lib/commands/magento.js +16 -0
- package/lib/commands/mcp-key.js +23 -1
- package/lib/commands/netsuite.js +67 -2
- package/lib/commands/notifications.js +34 -1
- package/lib/commands/ops.js +23 -54
- package/lib/commands/report-backfill.js +23 -5
- package/lib/commands/report.js +77 -14
- package/lib/commands/salesforce.js +101 -0
- package/lib/commands/shopify.js +84 -0
- package/lib/commands/signature.js +79 -0
- package/lib/commands/site-builder.js +30 -0
- package/lib/commands/support.js +22 -0
- package/lib/commands/teams.js +11 -1
- package/lib/commands/workflow.js +33 -0
- package/lib/commands/zoom-phone.js +15 -0
- package/lib/enterprise-reports.test.js +1 -1
- package/lib/entitlement-report-packages.test.js +47 -0
- package/lib/logs-insights.test.js +146 -0
- package/lib/mcp-key.test.js +11 -0
- package/lib/messaging-routes.test.js +10 -1
- package/lib/oauth.js +14 -2
- package/lib/report-range.js +21 -0
- package/lib/report-range.test.js +38 -0
- package/lib/shopify-write-policy.test.js +34 -0
- package/lib/signature-policy.js +70 -0
- package/lib/signature-policy.test.js +48 -0
- package/package.json +1 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { parseMode, parseTeamId, buildPolicyBody, findPolicy, describeMode } from './signature-policy.js';
|
|
4
|
+
|
|
5
|
+
test('parseMode maps friendly names to API values and rejects unknown ones', () => {
|
|
6
|
+
assert.equal(parseMode('locked'), 'admin_locked');
|
|
7
|
+
assert.equal(parseMode('Company-Default'), 'company_default');
|
|
8
|
+
assert.equal(parseMode('personal_only'), 'personal_only');
|
|
9
|
+
assert.equal(parseMode('default'), null);
|
|
10
|
+
assert.equal(parseMode(undefined), undefined);
|
|
11
|
+
assert.throws(() => parseMode('strict'), /mode must be/);
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
test('parseTeamId defaults to company-wide and rejects junk', () => {
|
|
15
|
+
assert.equal(parseTeamId(undefined), 0);
|
|
16
|
+
assert.equal(parseTeamId('7'), 7);
|
|
17
|
+
assert.throws(() => parseTeamId('abc'), /teamId/);
|
|
18
|
+
assert.throws(() => parseTeamId(-1), /teamId/);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
test('buildPolicyBody keeps current values for fields that are not passed', () => {
|
|
22
|
+
const cur = { teamId: 0, mode: 'company_default', corporateSignature: '<b>Acme</b>', disclaimerEnabled: true, disclaimerText: 'Confidential' };
|
|
23
|
+
const body = buildPolicyBody(cur, { mode: 'locked' });
|
|
24
|
+
assert.deepEqual(body, { teamId: 0, mode: 'admin_locked', corporateSignature: '<b>Acme</b>', disclaimerEnabled: true, disclaimerText: 'Confidential' });
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test('buildPolicyBody with no existing row starts from all-null (follow company-wide)', () => {
|
|
28
|
+
const body = buildPolicyBody(undefined, { teamId: 5, disclaimerEnabled: true });
|
|
29
|
+
assert.deepEqual(body, { teamId: 5, mode: null, corporateSignature: null, disclaimerEnabled: true, disclaimerText: null });
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test('null clears a field and over-long text is rejected before sending', () => {
|
|
33
|
+
const cur = { teamId: 0, mode: 'admin_locked', disclaimerEnabled: true, disclaimerText: 'x' };
|
|
34
|
+
assert.equal(buildPolicyBody(cur, { disclaimerEnabled: null }).disclaimerEnabled, null);
|
|
35
|
+
assert.equal(buildPolicyBody(cur, { mode: 'default' }).mode, null);
|
|
36
|
+
assert.throws(() => buildPolicyBody(cur, { disclaimerText: 'a'.repeat(2001) }), /2000/);
|
|
37
|
+
assert.throws(() => buildPolicyBody(cur, { corporateSignature: 'a'.repeat(4001) }), /4000/);
|
|
38
|
+
assert.throws(() => buildPolicyBody(cur, { disclaimerEnabled: 'yes' }), /true, false or null/);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test('findPolicy picks the row for a team and describeMode is readable', () => {
|
|
42
|
+
const rows = [{ teamId: 0, mode: 'personal_only' }, { teamId: 3, mode: 'admin_locked' }];
|
|
43
|
+
assert.equal(findPolicy(rows, 3).mode, 'admin_locked');
|
|
44
|
+
assert.equal(findPolicy(rows, undefined).teamId, 0);
|
|
45
|
+
assert.equal(findPolicy(null, 1), undefined);
|
|
46
|
+
assert.match(describeMode('admin_locked'), /locked/);
|
|
47
|
+
assert.match(describeMode(null), /follows/);
|
|
48
|
+
});
|
package/package.json
CHANGED