@mediaviz/sdk 0.1.0 → 1.0.59
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/LICENSE +21 -0
- package/dist/sdk.cjs +33 -240
- package/dist/sdk.esm.js +34 -239
- package/dist/sdk.umd.js +33 -240
- package/package.json +14 -8
- package/MediaViz.js +0 -126
- package/_oauth.js +0 -3
- package/admin.js +0 -93
- package/ai_model_credits.js +0 -22
- package/company.js +0 -54
- package/curated_albums.js +0 -85
- package/custom_albums.js +0 -78
- package/email_tokens.js +0 -64
- package/errors.js +0 -81
- package/health.js +0 -20
- package/index.js +0 -21
- package/keywords.js +0 -123
- package/oauth/.prettierrc +0 -6
- package/oauth/README.md +0 -76
- package/oauth/browser-smoke-test.html +0 -45
- package/oauth/implementation_plan.json +0 -106
- package/oauth/package-lock.json +0 -5236
- package/oauth/package.json +0 -28
- package/oauth/rollup.config.js +0 -21
- package/oauth/smoke-test.js +0 -27
- package/oauth/spec.md +0 -187
- package/oauth/src/__tests__/browser-smoke-test.test.js +0 -38
- package/oauth/src/__tests__/client.test.js +0 -556
- package/oauth/src/__tests__/errors.test.js +0 -73
- package/oauth/src/__tests__/http.test.js +0 -102
- package/oauth/src/__tests__/index.test.js +0 -53
- package/oauth/src/__tests__/package-fields.test.js +0 -29
- package/oauth/src/__tests__/pkce.test.js +0 -55
- package/oauth/src/__tests__/rollup-build.test.js +0 -58
- package/oauth/src/__tests__/smoke-test.test.js +0 -26
- package/oauth/src/__tests__/types.test.js +0 -29
- package/oauth/src/client.js +0 -180
- package/oauth/src/errors.js +0 -32
- package/oauth/src/http.js +0 -52
- package/oauth/src/index.js +0 -7
- package/oauth/src/pkce.js +0 -50
- package/oauth/src/types.js +0 -67
- package/oauth_authorization.js +0 -53
- package/oauth_clients.js +0 -18
- package/oauth_login.js +0 -24
- package/oauth_token.js +0 -30
- package/person.js +0 -54
- package/photos.js +0 -106
- package/photoupload.js +0 -55
- package/projects.js +0 -191
- package/rollup.config.js +0 -12
- package/search.js +0 -99
- package/users.js +0 -137
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<title>OAuth SDK Browser Smoke Test</title>
|
|
6
|
-
</head>
|
|
7
|
-
<body>
|
|
8
|
-
<pre id="output"></pre>
|
|
9
|
-
<script src="dist/oauth-sdk.umd.js"></script>
|
|
10
|
-
<script>
|
|
11
|
-
(async () => {
|
|
12
|
-
const log = (msg) => {
|
|
13
|
-
document.getElementById('output').textContent += msg + '\n';
|
|
14
|
-
console.log(msg);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
try {
|
|
18
|
-
const { OAuthClient } = OAuthSDK;
|
|
19
|
-
const client = new OAuthClient({
|
|
20
|
-
baseUrl: 'https://example.com',
|
|
21
|
-
clientId: 'test-client-id',
|
|
22
|
-
clientSecret: 'test-client-secret',
|
|
23
|
-
redirectUri: 'https://example.com/callback',
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
const result = await client.generateAuthorizationUrl();
|
|
27
|
-
|
|
28
|
-
if (!result.url.includes('response_type=code')) {
|
|
29
|
-
throw new Error(`url missing response_type=code: ${result.url}`);
|
|
30
|
-
}
|
|
31
|
-
if (result.code_verifier.length !== 64) {
|
|
32
|
-
throw new Error(`code_verifier length ${result.code_verifier.length} !== 64`);
|
|
33
|
-
}
|
|
34
|
-
if (result.state.length !== 32) {
|
|
35
|
-
throw new Error(`state length ${result.state.length} !== 32`);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
log('PASS');
|
|
39
|
-
} catch (err) {
|
|
40
|
-
log('FAIL: ' + err.message);
|
|
41
|
-
}
|
|
42
|
-
})();
|
|
43
|
-
</script>
|
|
44
|
-
</body>
|
|
45
|
-
</html>
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"id": 1,
|
|
4
|
-
"description": "Replace Node.js crypto with Web Crypto API in pkce.js. generateCodeVerifier: use globalThis.crypto.getRandomValues(new Uint8Array(48)) + manual base64url encode + slice to 64 chars. generateCodeChallenge: use globalThis.crypto.subtle.digest('SHA-256', TextEncoder) — must become async, returns Promise<string>. generateState: use getRandomValues(new Uint8Array(16)) + hex join. Remove require('crypto'). Keep module.exports unchanged.",
|
|
5
|
-
"touch_points": [
|
|
6
|
-
{
|
|
7
|
-
"file": "sdk/javascript/src/pkce.js",
|
|
8
|
-
"location": "generateCodeVerifier",
|
|
9
|
-
"status": "replace crypto.randomBytes with getRandomValues + base64url encode"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"file": "sdk/javascript/src/pkce.js",
|
|
13
|
-
"location": "generateCodeChallenge",
|
|
14
|
-
"status": "make async, replace createHash with crypto.subtle.digest"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"file": "sdk/javascript/src/pkce.js",
|
|
18
|
-
"location": "generateState",
|
|
19
|
-
"status": "replace crypto.randomBytes with getRandomValues + hex join"
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
"completion_status": true
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"id": 2,
|
|
26
|
-
"description": "Update client.js to await the now-async generateCodeChallenge. In generateAuthorizationUrl, change the call to: const challenge = await generateCodeChallenge(verifier). The method is already async so the public signature is unchanged.",
|
|
27
|
-
"touch_points": [
|
|
28
|
-
{
|
|
29
|
-
"file": "sdk/javascript/src/client.js",
|
|
30
|
-
"location": "generateAuthorizationUrl",
|
|
31
|
-
"status": "add await before generateCodeChallenge call"
|
|
32
|
-
}
|
|
33
|
-
],
|
|
34
|
-
"completion_status": true
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"id": 3,
|
|
38
|
-
"description": "Update pkce.test.js for async generateCodeChallenge. Change the PKCE test vector assertion to use await: expect(await generateCodeChallenge(verifier)).toBe('E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM'). Mark the test function async. All other tests are sync and unchanged.",
|
|
39
|
-
"touch_points": [
|
|
40
|
-
{
|
|
41
|
-
"file": "sdk/javascript/src/__tests__/pkce.test.js",
|
|
42
|
-
"location": "test('generateCodeChallenge')",
|
|
43
|
-
"status": "add async/await to test vector assertion"
|
|
44
|
-
}
|
|
45
|
-
],
|
|
46
|
-
"completion_status": true
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"id": 4,
|
|
50
|
-
"description": "Add Rollup build tooling. Install dev dependencies: rollup, @rollup/plugin-node-resolve, @rollup/plugin-terser. Create rollup.config.js at sdk/javascript/ with two outputs: (1) dist/oauth-sdk.umd.js — format: 'umd', name: 'OAuthSDK', exports: 'named', plugins: [terser()]; (2) dist/oauth-sdk.esm.js — format: 'esm'. Input: src/index.js. Use nodeResolve plugin to handle any internal references.",
|
|
51
|
-
"touch_points": [
|
|
52
|
-
{
|
|
53
|
-
"file": "sdk/javascript/package.json",
|
|
54
|
-
"location": "devDependencies",
|
|
55
|
-
"status": "add rollup, @rollup/plugin-node-resolve, @rollup/plugin-terser"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"file": "sdk/javascript/rollup.config.js",
|
|
59
|
-
"location": "module",
|
|
60
|
-
"status": "create with umd + esm output config"
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
"completion_status": true
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"id": 5,
|
|
67
|
-
"description": "Update package.json fields. Add: 'module': 'dist/oauth-sdk.esm.js'; 'browser': 'dist/oauth-sdk.umd.js'; 'files': ['src/', 'dist/']; scripts 'build': 'rollup -c' and 'prepublishOnly': 'npm run build'. Keep 'main': 'src/index.js' for Node.js CJS path.",
|
|
68
|
-
"touch_points": [
|
|
69
|
-
{
|
|
70
|
-
"file": "sdk/javascript/package.json",
|
|
71
|
-
"location": "root",
|
|
72
|
-
"status": "add module, browser, files fields and build scripts"
|
|
73
|
-
}
|
|
74
|
-
],
|
|
75
|
-
"completion_status": true
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"id": 6,
|
|
79
|
-
"description": "Add dist/ to .gitignore in sdk/javascript/. Update smoke-test.js: add await to generateAuthorizationUrl call (wrap in async IIFE or top-level await if package is ESM). Verify node smoke-test.js still exits 0.",
|
|
80
|
-
"touch_points": [
|
|
81
|
-
{
|
|
82
|
-
"file": "sdk/javascript/.gitignore",
|
|
83
|
-
"location": "root",
|
|
84
|
-
"status": "add dist/"
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"file": "sdk/javascript/smoke-test.js",
|
|
88
|
-
"location": "main assertion block",
|
|
89
|
-
"status": "confirm generateAuthorizationUrl is awaited (should already be)"
|
|
90
|
-
}
|
|
91
|
-
],
|
|
92
|
-
"completion_status": true
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"id": 7,
|
|
96
|
-
"description": "Build verification. Run npm install then npm run build in sdk/javascript/. Confirm dist/oauth-sdk.umd.js and dist/oauth-sdk.esm.js are produced. Run npm test — all tests must pass. Run node smoke-test.js — must exit 0. Create sdk/javascript/browser-smoke-test.html: minimal HTML page that loads dist/oauth-sdk.umd.js via <script>, calls OAuthSDK.OAuthClient with dummy config, calls generateAuthorizationUrl(), asserts url contains 'response_type=code', logs PASS/FAIL to console.",
|
|
97
|
-
"touch_points": [
|
|
98
|
-
{
|
|
99
|
-
"file": "sdk/javascript/browser-smoke-test.html",
|
|
100
|
-
"location": "script block",
|
|
101
|
-
"status": "create browser smoke test for UMD bundle"
|
|
102
|
-
}
|
|
103
|
-
],
|
|
104
|
-
"completion_status": true
|
|
105
|
-
}
|
|
106
|
-
]
|