vipcare 0.1.0 → 0.2.0
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/CLAUDE.md +58 -0
- package/README.md +21 -0
- package/bin/vip.js +253 -14
- package/lib/card.js +306 -0
- package/lib/config.js +9 -2
- package/lib/fetchers/search.js +17 -16
- package/lib/fetchers/twitter.js +3 -3
- package/lib/fetchers/youtube.js +108 -0
- package/lib/monitor.js +2 -2
- package/lib/profile.js +11 -1
- package/lib/scheduler.js +5 -5
- package/lib/synthesizer.js +5 -5
- package/lib/templates.js +94 -11
- package/package.json +2 -2
- package/web/index.html +204 -0
- package/lib/fetchers/web.js +0 -29
- package/profiles/.gitkeep +0 -0
- package/profiles/sam-altman.md +0 -49
- package/skill/vip.md +0 -96
- package/tests/fetchers.test.js +0 -21
- package/tests/monitor.test.js +0 -28
- package/tests/profile.test.js +0 -89
- package/tests/resolver.test.js +0 -40
- package/tests/scheduler.test.js +0 -22
package/tests/resolver.test.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { describe, it } from 'node:test';
|
|
2
|
-
import assert from 'node:assert';
|
|
3
|
-
import { parseTwitterHandle, parseLinkedinUrl, isUrl, resolveFromUrl } from '../lib/resolver.js';
|
|
4
|
-
|
|
5
|
-
describe('parseTwitterHandle', () => {
|
|
6
|
-
it('twitter.com', () => assert.strictEqual(parseTwitterHandle('https://twitter.com/elonmusk'), 'elonmusk'));
|
|
7
|
-
it('x.com', () => assert.strictEqual(parseTwitterHandle('https://x.com/sama'), 'sama'));
|
|
8
|
-
it('with @', () => assert.strictEqual(parseTwitterHandle('https://twitter.com/@test'), 'test'));
|
|
9
|
-
it('ignores search', () => assert.strictEqual(parseTwitterHandle('https://twitter.com/search'), null));
|
|
10
|
-
it('ignores explore', () => assert.strictEqual(parseTwitterHandle('https://twitter.com/explore'), null));
|
|
11
|
-
it('no match', () => assert.strictEqual(parseTwitterHandle('https://example.com'), null));
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
describe('parseLinkedinUrl', () => {
|
|
15
|
-
it('valid profile', () => {
|
|
16
|
-
assert.strictEqual(parseLinkedinUrl('https://www.linkedin.com/in/samaltman'), 'https://www.linkedin.com/in/samaltman');
|
|
17
|
-
});
|
|
18
|
-
it('with params', () => {
|
|
19
|
-
assert.strictEqual(parseLinkedinUrl('https://linkedin.com/in/samaltman?trk=x'), 'https://linkedin.com/in/samaltman');
|
|
20
|
-
});
|
|
21
|
-
it('not profile', () => {
|
|
22
|
-
assert.strictEqual(parseLinkedinUrl('https://linkedin.com/company/openai'), null);
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
describe('isUrl', () => {
|
|
27
|
-
it('https', () => assert.ok(isUrl('https://twitter.com/test')));
|
|
28
|
-
it('http', () => assert.ok(isUrl('http://example.com')));
|
|
29
|
-
it('twitter.com', () => assert.ok(isUrl('twitter.com/test')));
|
|
30
|
-
it('not url', () => assert.ok(!isUrl('Sam Altman')));
|
|
31
|
-
it('email not url', () => assert.ok(!isUrl('test@email.com')));
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
describe('resolveFromUrl', () => {
|
|
35
|
-
it('unknown URL', () => {
|
|
36
|
-
const p = resolveFromUrl('https://example.com/unknown');
|
|
37
|
-
assert.strictEqual(p.name, '');
|
|
38
|
-
assert.strictEqual(p.otherUrls.length, 1);
|
|
39
|
-
});
|
|
40
|
-
});
|
package/tests/scheduler.test.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { describe, it } from 'node:test';
|
|
2
|
-
import assert from 'node:assert';
|
|
3
|
-
import { createPlist } from '../lib/scheduler.js';
|
|
4
|
-
|
|
5
|
-
describe('createPlist', () => {
|
|
6
|
-
it('contains interval', () => {
|
|
7
|
-
// This may fail if vip is not installed, skip gracefully
|
|
8
|
-
try {
|
|
9
|
-
const plist = createPlist(12);
|
|
10
|
-
assert.ok(plist.includes('<integer>43200</integer>'));
|
|
11
|
-
assert.ok(plist.includes('com.vip-crm.monitor'));
|
|
12
|
-
assert.ok(plist.includes('monitor'));
|
|
13
|
-
} catch (e) {
|
|
14
|
-
if (e.message.includes("Cannot find 'vip'")) {
|
|
15
|
-
// Expected in test env without global install
|
|
16
|
-
assert.ok(true);
|
|
17
|
-
} else {
|
|
18
|
-
throw e;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
});
|