@amigo-ai/sdk 1.0.0-alpha.1
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/README.md +94 -0
- package/dist/index.js +353 -0
- package/dist/index.js.map +7 -0
- package/dist/types/src/core/auth.d.ts +8 -0
- package/dist/types/src/core/errors.d.ts +67 -0
- package/dist/types/src/core/openapi-client.d.ts +5 -0
- package/dist/types/src/core/utils.d.ts +6 -0
- package/dist/types/src/generated/api-types.d.ts +16421 -0
- package/dist/types/src/index.d.ts +21 -0
- package/dist/types/src/resources/organization.d.ts +14 -0
- package/dist/types/src/resources/services.d.ts +11 -0
- package/package.json +62 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { OrganizationResource } from './resources/organization';
|
|
2
|
+
import { ServiceResource } from './resources/services';
|
|
3
|
+
export interface AmigoSdkConfig {
|
|
4
|
+
/** API key from Amigo dashboard */
|
|
5
|
+
apiKey: string;
|
|
6
|
+
/** API-key ID from Amigo dashboard */
|
|
7
|
+
apiKeyId: string;
|
|
8
|
+
/** User ID on whose behalf the request is made */
|
|
9
|
+
userId: string;
|
|
10
|
+
/** The Organization ID */
|
|
11
|
+
orgId: string;
|
|
12
|
+
/** Base URL of the Amigo API */
|
|
13
|
+
baseUrl?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare class AmigoClient {
|
|
16
|
+
readonly organizations: OrganizationResource;
|
|
17
|
+
readonly services: ServiceResource;
|
|
18
|
+
readonly config: AmigoSdkConfig;
|
|
19
|
+
constructor(config: AmigoSdkConfig);
|
|
20
|
+
}
|
|
21
|
+
export * as errors from './core/errors';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AmigoFetch } from '../core/openapi-client';
|
|
2
|
+
export declare class OrganizationResource {
|
|
3
|
+
private c;
|
|
4
|
+
constructor(c: AmigoFetch);
|
|
5
|
+
getOrganization(orgId: string): Promise<{
|
|
6
|
+
org_id: string;
|
|
7
|
+
org_name: string;
|
|
8
|
+
title: string;
|
|
9
|
+
main_description: string;
|
|
10
|
+
sub_description: string;
|
|
11
|
+
onboarding_instructions: string[];
|
|
12
|
+
default_user_preferences: import("../generated/api-types").components["schemas"]["Preferences-Output"] | null;
|
|
13
|
+
} | undefined>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AmigoFetch } from '../core/openapi-client';
|
|
2
|
+
export declare class ServiceResource {
|
|
3
|
+
private c;
|
|
4
|
+
constructor(c: AmigoFetch);
|
|
5
|
+
getServices(orgId: string): Promise<{
|
|
6
|
+
services: import("../generated/api-types").components["schemas"]["ServiceInstance"][];
|
|
7
|
+
has_more: boolean;
|
|
8
|
+
continuation_token: number | null;
|
|
9
|
+
filter_values: import("../generated/api-types").components["schemas"]["src__app__endpoints__service__get_services__Response__FilterValues"] | null;
|
|
10
|
+
} | undefined>;
|
|
11
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@amigo-ai/sdk",
|
|
3
|
+
"version": "1.0.0-alpha.1",
|
|
4
|
+
"description": "Amigo TypeScript SDK",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"gen-types": "node scripts/gen-types.mjs",
|
|
14
|
+
"test": "vitest run",
|
|
15
|
+
"test:integration": "RUN_INTEGRATION=true vitest run tests/integration.test.ts",
|
|
16
|
+
"test:watch": "vitest",
|
|
17
|
+
"test:coverage": "vitest run --coverage",
|
|
18
|
+
"build": "node scripts/gen.mjs && node scripts/build.mjs && tsc --project tsconfig.build.json",
|
|
19
|
+
"dev": "node scripts/gen.mjs && node scripts/build.mjs --watch",
|
|
20
|
+
"format": "prettier --check .",
|
|
21
|
+
"format:write": "prettier --write .",
|
|
22
|
+
"lint": "eslint 'src/**/*.{ts,tsx}' --max-warnings 0"
|
|
23
|
+
},
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"import": "./dist/index.js",
|
|
27
|
+
"types": "./dist/types/index.d.ts"
|
|
28
|
+
},
|
|
29
|
+
"./package.json": "./package.json"
|
|
30
|
+
},
|
|
31
|
+
"type": "module",
|
|
32
|
+
"sideEffects": false,
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/amigo-ai/amigo-typescript-sdk.git"
|
|
36
|
+
},
|
|
37
|
+
"author": "Amigo AI",
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/amigo-ai/amigo-typescript-sdk/issues"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/amigo-ai/amigo-typescript-sdk#readme",
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/node": "^24.2.0",
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "^8.39.0",
|
|
46
|
+
"@typescript-eslint/parser": "^8.39.0",
|
|
47
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
48
|
+
"dotenv": "^17.2.1",
|
|
49
|
+
"esbuild": "^0.25.8",
|
|
50
|
+
"eslint": "^9.32.0",
|
|
51
|
+
"eslint-config-prettier": "^10.1.8",
|
|
52
|
+
"globals": "^16.3.0",
|
|
53
|
+
"msw": "^2.10.4",
|
|
54
|
+
"openapi-typescript": "^7.8.0",
|
|
55
|
+
"prettier": "^3.6.2",
|
|
56
|
+
"typescript": "^5.9.2",
|
|
57
|
+
"vitest": "^3.2.4"
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"openapi-fetch": "^0.14.0"
|
|
61
|
+
}
|
|
62
|
+
}
|