kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
pull/715/head
rodzic
e4520c69a4
commit
4f29e3bf31
|
@ -15,7 +15,7 @@
|
||||||
"test": "run-s test:*",
|
"test": "run-s test:*",
|
||||||
"test:lint": "eslint .",
|
"test:lint": "eslint .",
|
||||||
"test:typecheck": "tsc --noEmit",
|
"test:typecheck": "tsc --noEmit",
|
||||||
"test:e2e": "vitest run"
|
"test-e2e": "vitest run"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ky": "catalog:",
|
"ky": "catalog:",
|
||||||
|
|
|
@ -0,0 +1,199 @@
|
||||||
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||||
|
|
||||||
|
exports[`URL prefix and suffix success 1`] = `
|
||||||
|
{
|
||||||
|
"deploymentHash": "01234567",
|
||||||
|
"deploymentIdentifier": "username/foo-bar@01234567",
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`URL prefix and suffix success 2`] = `
|
||||||
|
{
|
||||||
|
"deploymentHash": "01234567",
|
||||||
|
"deploymentIdentifier": "username/foo-bar@01234567",
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo/bar/123",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`URL prefix success 1`] = `
|
||||||
|
{
|
||||||
|
"deploymentHash": "01234567",
|
||||||
|
"deploymentIdentifier": "username/foo-bar@01234567",
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`URL prefix success 2`] = `
|
||||||
|
{
|
||||||
|
"deploymentHash": "01234567",
|
||||||
|
"deploymentIdentifier": "username/foo-bar@01234567",
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`URL prefix success 3`] = `
|
||||||
|
{
|
||||||
|
"deploymentHash": "01234567",
|
||||||
|
"deploymentIdentifier": "username/foo-bar@01234567",
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo/bar/456/123",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`URL prefix success 4`] = `
|
||||||
|
{
|
||||||
|
"deploymentHash": "01234567",
|
||||||
|
"deploymentIdentifier": "username/foo-bar@01234567",
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo/bar/456/123",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`URL prefix success 5`] = `
|
||||||
|
{
|
||||||
|
"deploymentHash": "01234567",
|
||||||
|
"deploymentIdentifier": "username/foo-bar@01234567",
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo/bar/456/123",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`URL prefix success 6`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo/bar/456/123",
|
||||||
|
"version": "latest",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`URL prefix success 7`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo/bar/456/123",
|
||||||
|
"version": "dev",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`URL prefix success 8`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo/bar/456/123",
|
||||||
|
"version": "2.1.0",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`URL suffix success 1`] = `
|
||||||
|
{
|
||||||
|
"deploymentHash": "01234567",
|
||||||
|
"deploymentIdentifier": "username/foo-bar@01234567",
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`URL suffix success 2`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo",
|
||||||
|
"version": "latest",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`URL suffix success 3`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo",
|
||||||
|
"version": "dev",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`URL suffix success 4`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo",
|
||||||
|
"version": "2.1.0",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`namespace success 1`] = `
|
||||||
|
{
|
||||||
|
"deploymentHash": "01234567",
|
||||||
|
"deploymentIdentifier": "username/foo-bar@01234567",
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`namespace success 2`] = `
|
||||||
|
{
|
||||||
|
"deploymentHash": "01234567",
|
||||||
|
"deploymentIdentifier": "username/foo-bar@01234567",
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`namespace success 3`] = `
|
||||||
|
{
|
||||||
|
"deploymentHash": "01234567",
|
||||||
|
"deploymentIdentifier": "username/foo-bar@01234567",
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`namespace success 4`] = `
|
||||||
|
{
|
||||||
|
"deploymentHash": "01234567",
|
||||||
|
"deploymentIdentifier": "username/foo-bar@01234567",
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`namespace success 5`] = `
|
||||||
|
{
|
||||||
|
"deploymentHash": "01234567",
|
||||||
|
"deploymentIdentifier": "username/foo-bar@01234567",
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo/bar/123",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`namespace success 6`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo/bar/123",
|
||||||
|
"version": "latest",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`namespace success 7`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo/bar/123",
|
||||||
|
"version": "dev",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`namespace success 8`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo/bar/123",
|
||||||
|
"version": "1.2.3",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`namespace success 9`] = `
|
||||||
|
{
|
||||||
|
"deploymentHash": "01234567",
|
||||||
|
"deploymentIdentifier": "username/foo-bar@01234567",
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo/bar/123",
|
||||||
|
}
|
||||||
|
`;
|
|
@ -0,0 +1,240 @@
|
||||||
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||||
|
|
||||||
|
exports[`username/project-name success 1`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "abc/hello-world",
|
||||||
|
"toolPath": "/",
|
||||||
|
"version": "latest",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name success 2`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "a16z/foo-bar",
|
||||||
|
"toolPath": "/",
|
||||||
|
"version": "latest",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name success 3`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "foodoo/foo-bar",
|
||||||
|
"toolPath": "/",
|
||||||
|
"version": "latest",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name success 4`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "u/foobar123-yo",
|
||||||
|
"toolPath": "/",
|
||||||
|
"version": "latest",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name success 5`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "abc/hello-world",
|
||||||
|
"toolPath": "/",
|
||||||
|
"version": "latest",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name/toolPath success 1`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "u/foo-bar",
|
||||||
|
"toolPath": "/foo",
|
||||||
|
"version": "latest",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name/toolPath success 2`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "a/foo-bar",
|
||||||
|
"toolPath": "/foo_123",
|
||||||
|
"version": "latest",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name/toolPath success 3`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "foo/foobar123-yo",
|
||||||
|
"toolPath": "/foo_bar_BAR_901",
|
||||||
|
"version": "latest",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name/toolPath success 4`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "foo/foobar123-yo",
|
||||||
|
"toolPath": "/foo/bar/123/456",
|
||||||
|
"version": "latest",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name@deployment success 1`] = `
|
||||||
|
{
|
||||||
|
"deploymentHash": "3d2e0fd5",
|
||||||
|
"deploymentIdentifier": "abc/hello-world@3d2e0fd5",
|
||||||
|
"projectIdentifier": "abc/hello-world",
|
||||||
|
"toolPath": "/",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name@deployment success 2`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "a16z/foo-bar",
|
||||||
|
"toolPath": "/",
|
||||||
|
"version": "f673db32c",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name@deployment success 3`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "foodoo/foo-bar",
|
||||||
|
"toolPath": "/",
|
||||||
|
"version": "f673db32c",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name@deployment success 4`] = `
|
||||||
|
{
|
||||||
|
"deploymentHash": "673db32c",
|
||||||
|
"deploymentIdentifier": "u/foobar123-yo@673db32c",
|
||||||
|
"projectIdentifier": "u/foobar123-yo",
|
||||||
|
"toolPath": "/",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name@deployment success 5`] = `
|
||||||
|
{
|
||||||
|
"deploymentHash": "01234567",
|
||||||
|
"deploymentIdentifier": "username/foo-bar@01234567",
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name@deployment/toolPath success 1`] = `
|
||||||
|
{
|
||||||
|
"deploymentHash": "01234567",
|
||||||
|
"deploymentIdentifier": "username/foo-bar@01234567",
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name@deployment/toolPath success 2`] = `
|
||||||
|
{
|
||||||
|
"deploymentHash": "abc123lz",
|
||||||
|
"deploymentIdentifier": "username/foo-bar@abc123lz",
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name@deployment/toolPath success 3`] = `
|
||||||
|
{
|
||||||
|
"deploymentHash": "01234567",
|
||||||
|
"deploymentIdentifier": "username/foobar123-yo@01234567",
|
||||||
|
"projectIdentifier": "username/foobar123-yo",
|
||||||
|
"toolPath": "/foo_bar_BAR_901",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name@deployment/toolPath success 4`] = `
|
||||||
|
{
|
||||||
|
"deploymentHash": "01234567",
|
||||||
|
"deploymentIdentifier": "username/foobar@01234567",
|
||||||
|
"projectIdentifier": "username/foobar",
|
||||||
|
"toolPath": "/foo/bar/123/456",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name@version success 1`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "abc/hello-world",
|
||||||
|
"toolPath": "/",
|
||||||
|
"version": "1.0.3",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name@version success 2`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "a16z/foo-bar",
|
||||||
|
"toolPath": "/",
|
||||||
|
"version": "latest",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name@version success 3`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "a16z/foo-bar",
|
||||||
|
"toolPath": "/",
|
||||||
|
"version": "dev",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name@version success 4`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "foodoo/foo-bar",
|
||||||
|
"toolPath": "/",
|
||||||
|
"version": "1.0.1",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name@version success 5`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "u/foobar123-yo",
|
||||||
|
"toolPath": "/",
|
||||||
|
"version": "3.2.2234",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name@version success 6`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/",
|
||||||
|
"version": "1.0.3",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name@version/toolPath success 1`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo",
|
||||||
|
"version": "latest",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name@version/toolPath success 2`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo",
|
||||||
|
"version": "dev",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name@version/toolPath success 3`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "username/foo-bar",
|
||||||
|
"toolPath": "/foo",
|
||||||
|
"version": "1.0.0",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name@version/toolPath success 4`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "username/foobar123-yo",
|
||||||
|
"toolPath": "/foo_bar_BAR_901",
|
||||||
|
"version": "0.0.1",
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`username/project-name@version/toolPath success 5`] = `
|
||||||
|
{
|
||||||
|
"projectIdentifier": "username/foobar123-yo",
|
||||||
|
"toolPath": "/foo/bar/123-456",
|
||||||
|
"version": "0.0.1",
|
||||||
|
}
|
||||||
|
`;
|
|
@ -65,11 +65,11 @@ test('namespace success', () => {
|
||||||
success('/username/foo-bar@01234567/foo')
|
success('/username/foo-bar@01234567/foo')
|
||||||
success('/username/foo-bar@01234567/foo')
|
success('/username/foo-bar@01234567/foo')
|
||||||
success('/username/foo-bar@01234567/foo/')
|
success('/username/foo-bar@01234567/foo/')
|
||||||
success('username/https://api.saasify.sh/foo-bar@01234567/foo/bar/123')
|
|
||||||
success('/username/foo-bar@01234567/foo/bar/123')
|
success('/username/foo-bar@01234567/foo/bar/123')
|
||||||
success('/username/foo-bar@latest/foo/bar/123')
|
success('/username/foo-bar@latest/foo/bar/123')
|
||||||
success('/username/foo-bar@dev/foo/bar/123')
|
success('/username/foo-bar@dev/foo/bar/123')
|
||||||
success('/username/foo-bar@1.2.3/foo/bar/123')
|
success('/username/foo-bar@1.2.3/foo/bar/123')
|
||||||
|
success('https://api.saasify.sh/username/foo-bar@01234567/foo/bar/123')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('namespace error', () => {
|
test('namespace error', () => {
|
||||||
|
@ -78,7 +78,6 @@ test('namespace error', () => {
|
||||||
error('/foo-bar@01234567/foo')
|
error('/foo-bar@01234567/foo')
|
||||||
error('/foo-bar@dev/foo')
|
error('/foo-bar@dev/foo')
|
||||||
error('/foo-bar@01234567/foo')
|
error('/foo-bar@01234567/foo')
|
||||||
error('foo-bar/tool')
|
|
||||||
error('/foo-bar@01234567/foo/')
|
error('/foo-bar@01234567/foo/')
|
||||||
error('/foo-bar@01234567/foo/bar/123')
|
error('/foo-bar@01234567/foo/bar/123')
|
||||||
error('/foo-bar@0latest/foo/bar/123')
|
error('/foo-bar@0latest/foo/bar/123')
|
||||||
|
|
Ładowanie…
Reference in New Issue