linkup-sdk 1.0.2 → 1.0.4
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 +1 -0
- package/dist/errors.d.ts +5 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/linkup-client.d.ts.map +1 -1
- package/dist/linkup-client.js +22 -23
- package/dist/linkup-client.js.map +1 -1
- package/dist/types.d.ts +30 -11
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/concat-error-and-details.util.d.ts +3 -0
- package/dist/utils/concat-error-and-details.util.d.ts.map +1 -0
- package/dist/utils/concat-error-and-details.util.js +12 -0
- package/dist/utils/concat-error-and-details.util.js.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +19 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +53 -52
package/README.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/linkup-sdk)
|
|
4
4
|
[](LICENSE)
|
|
5
|
+
[](https://www.npmjs.com/package/linkup-sdk)
|
|
5
6
|
|
|
6
7
|
A JS/TS SDK for the [Linkup API](https://linkup-api.readme.io/reference/getting-started), allowing
|
|
7
8
|
easy integration with Linkup's services.
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
export type LinkupErrorDetail = {
|
|
2
|
+
field: string;
|
|
3
|
+
message: string;
|
|
4
|
+
};
|
|
1
5
|
export declare abstract class LinkupError extends Error {
|
|
2
6
|
}
|
|
3
7
|
export declare class LinkupInvalidRequestError extends LinkupError {
|
|
@@ -6,7 +10,7 @@ export declare class LinkupInvalidRequestError extends LinkupError {
|
|
|
6
10
|
export declare class LinkupNoResultError extends LinkupError {
|
|
7
11
|
constructor(message?: string);
|
|
8
12
|
}
|
|
9
|
-
export declare class LinkupAuthenticationError extends
|
|
13
|
+
export declare class LinkupAuthenticationError extends Error {
|
|
10
14
|
constructor(message?: string);
|
|
11
15
|
}
|
|
12
16
|
export declare class LinkupInsufficientCreditError extends LinkupError {
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,8BAAsB,WAAY,SAAQ,KAAK;CAAG;AAKlD,qBAAa,yBAA0B,SAAQ,WAAW;gBAC5C,OAAO,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,8BAAsB,WAAY,SAAQ,KAAK;CAAG;AAKlD,qBAAa,yBAA0B,SAAQ,WAAW;gBAC5C,OAAO,EAAE,MAAM;CAS5B;AAID,qBAAa,mBAAoB,SAAQ,WAAW;gBACtC,OAAO,CAAC,EAAE,MAAM;CAQ7B;AAID,qBAAa,yBAA0B,SAAQ,KAAK;gBACtC,OAAO,CAAC,EAAE,MAAM;CAQ7B;AAID,qBAAa,6BAA8B,SAAQ,WAAW;gBAChD,OAAO,CAAC,EAAE,MAAM;CAQ7B;AAGD,qBAAa,kBAAmB,SAAQ,WAAW;gBACrC,OAAO,EAAE,MAAM;CAQ5B"}
|
package/dist/errors.js
CHANGED
|
@@ -31,7 +31,7 @@ class LinkupNoResultError extends LinkupError {
|
|
|
31
31
|
exports.LinkupNoResultError = LinkupNoResultError;
|
|
32
32
|
// Authentication error, raised when the Linkup API returns a 403 status code.
|
|
33
33
|
// It is returned when there is an authentication issue, typically when the API key is not valid.
|
|
34
|
-
class LinkupAuthenticationError extends
|
|
34
|
+
class LinkupAuthenticationError extends Error {
|
|
35
35
|
constructor(message) {
|
|
36
36
|
super(message);
|
|
37
37
|
this.name = LinkupAuthenticationError.name;
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;AAKA,MAAsB,WAAY,SAAQ,KAAK;CAAG;AAAlD,kCAAkD;AAElD,+EAA+E;AAC/E,2FAA2F;AAC3F,gEAAgE;AAChE,MAAa,yBAA0B,SAAQ,WAAW;IACxD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC,IAAI,CAAC;QAE3C,IAAI,mBAAmB,IAAI,KAAK,EAAE,CAAC;YACjC,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,yBAAyB,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;CACF;AAVD,8DAUC;AAED,yEAAyE;AACzE,mFAAmF;AACnF,MAAa,mBAAoB,SAAQ,WAAW;IAClD,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAC;QAErC,IAAI,mBAAmB,IAAI,KAAK,EAAE,CAAC;YACjC,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;CACF;AATD,kDASC;AAED,8EAA8E;AAC9E,iGAAiG;AACjG,MAAa,yBAA0B,SAAQ,KAAK;IAClD,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC,IAAI,CAAC;QAE3C,IAAI,mBAAmB,IAAI,KAAK,EAAE,CAAC;YACjC,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,yBAAyB,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;CACF;AATD,8DASC;AAED,mFAAmF;AACnF,mDAAmD;AACnD,MAAa,6BAA8B,SAAQ,WAAW;IAC5D,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAC,IAAI,CAAC;QAE/C,IAAI,mBAAmB,IAAI,KAAK,EAAE,CAAC;YACjC,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,6BAA6B,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;CACF;AATD,sEASC;AAED,gBAAgB;AAChB,MAAa,kBAAmB,SAAQ,WAAW;IACjD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC;QAEpC,IAAI,mBAAmB,IAAI,KAAK,EAAE,CAAC;YACjC,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;CACF;AATD,gDASC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./linkup-client"), exports);
|
|
18
18
|
__exportStar(require("./errors"), exports);
|
|
19
19
|
__exportStar(require("./types"), exports);
|
|
20
|
+
__exportStar(require("./utils"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,2CAAyB;AACzB,0CAAwB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linkup-client.d.ts","sourceRoot":"","sources":["../src/linkup-client.ts"],"names":[],"mappings":"AASA,OAAO,EACL,SAAS,EAET,YAAY,EACZ,aAAa,EACb,aAAa,EACb,sBAAsB,
|
|
1
|
+
{"version":3,"file":"linkup-client.d.ts","sourceRoot":"","sources":["../src/linkup-client.ts"],"names":[],"mappings":"AASA,OAAO,EACL,SAAS,EAET,YAAY,EACZ,aAAa,EACb,aAAa,EACb,sBAAsB,EAGvB,MAAM,SAAS,CAAC;AAKjB,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAyB;IACpD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,MAAM,EAAE,SAAS;IAKvB,MAAM,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,GAAG,YAAY,EACrE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,GACtB,OAAO,CACR,CAAC,SAAS,eAAe,GACrB,aAAa,GACb,CAAC,SAAS,eAAe,GACvB,aAAa,GACb,CAAC,SAAS,YAAY,GACpB,sBAAsB,GACtB,KAAK,CACd;IAsBD,OAAO,CAAC,cAAc;IAyBtB,OAAO,CAAC,cAAc;IAoBtB,OAAO,CAAC,WAAW;CAqBpB"}
|
package/dist/linkup-client.js
CHANGED
|
@@ -7,9 +7,9 @@ exports.LinkupClient = void 0;
|
|
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
|
8
8
|
const errors_1 = require("./errors");
|
|
9
9
|
const zod_to_json_schema_1 = __importDefault(require("zod-to-json-schema"));
|
|
10
|
-
const
|
|
10
|
+
const utils_1 = require("./utils");
|
|
11
11
|
class LinkupClient {
|
|
12
|
-
USER_AGENT = 'Linkup-JS-SDK/1.0.
|
|
12
|
+
USER_AGENT = 'Linkup-JS-SDK/1.0.4';
|
|
13
13
|
apiKey;
|
|
14
14
|
baseUrl;
|
|
15
15
|
constructor(config) {
|
|
@@ -17,17 +17,20 @@ class LinkupClient {
|
|
|
17
17
|
this.baseUrl = config.baseUrl || 'https://api.linkup.so/v1';
|
|
18
18
|
}
|
|
19
19
|
async search(params) {
|
|
20
|
+
let headers = {
|
|
21
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
22
|
+
};
|
|
23
|
+
if (typeof window === 'undefined') {
|
|
24
|
+
headers['User-Agent'] = this.USER_AGENT;
|
|
25
|
+
}
|
|
20
26
|
return axios_1.default
|
|
21
27
|
.post('/search', this.sanitizeParams(params), {
|
|
22
28
|
baseURL: this.baseUrl,
|
|
23
|
-
headers
|
|
24
|
-
'User-Agent': this.USER_AGENT,
|
|
25
|
-
Authorization: `Bearer ${this.apiKey}`,
|
|
26
|
-
},
|
|
29
|
+
headers,
|
|
27
30
|
})
|
|
28
31
|
.then((response) => this.formatResponse(response.data, params.outputType))
|
|
29
32
|
.catch((e) => {
|
|
30
|
-
throw this.refineError(e);
|
|
33
|
+
throw this.refineError(e.response.data);
|
|
31
34
|
});
|
|
32
35
|
}
|
|
33
36
|
sanitizeParams({ query, depth, outputType, includeImages = false, structuredOutputSchema, }) {
|
|
@@ -38,7 +41,7 @@ class LinkupClient {
|
|
|
38
41
|
includeImages,
|
|
39
42
|
};
|
|
40
43
|
if (structuredOutputSchema) {
|
|
41
|
-
searchParams.structuredOutputSchema = JSON.stringify((0,
|
|
44
|
+
searchParams.structuredOutputSchema = JSON.stringify((0, utils_1.isZodObject)(structuredOutputSchema)
|
|
42
45
|
? (0, zod_to_json_schema_1.default)(structuredOutputSchema)
|
|
43
46
|
: structuredOutputSchema);
|
|
44
47
|
}
|
|
@@ -60,26 +63,22 @@ class LinkupClient {
|
|
|
60
63
|
return searchResponse;
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
|
-
refineError(
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
!('message' in error.response.data)) {
|
|
68
|
-
return new errors_1.LinkupUnknownError(unknownErrorMessage);
|
|
69
|
-
}
|
|
70
|
-
const { data: { message }, status, } = error.response;
|
|
71
|
-
switch (status) {
|
|
66
|
+
refineError(e) {
|
|
67
|
+
const { statusCode, error } = e;
|
|
68
|
+
const { code, message } = error;
|
|
69
|
+
switch (statusCode) {
|
|
72
70
|
case 400:
|
|
73
|
-
if (
|
|
74
|
-
return new errors_1.LinkupNoResultError();
|
|
71
|
+
if (code === 'SEARCH_QUERY_NO_RESULT') {
|
|
72
|
+
return new errors_1.LinkupNoResultError(message);
|
|
75
73
|
}
|
|
76
|
-
return new errors_1.LinkupInvalidRequestError(
|
|
74
|
+
return new errors_1.LinkupInvalidRequestError((0, utils_1.concatErrorAndDetails)(e));
|
|
75
|
+
case 401:
|
|
77
76
|
case 403:
|
|
78
|
-
return new errors_1.LinkupAuthenticationError();
|
|
77
|
+
return new errors_1.LinkupAuthenticationError(message);
|
|
79
78
|
case 429:
|
|
80
|
-
return new errors_1.LinkupInsufficientCreditError();
|
|
79
|
+
return new errors_1.LinkupInsufficientCreditError(message);
|
|
81
80
|
default:
|
|
82
|
-
return new errors_1.LinkupUnknownError(
|
|
81
|
+
return new errors_1.LinkupUnknownError(`An unknown error occurred: ${error.message}`);
|
|
83
82
|
}
|
|
84
83
|
}
|
|
85
84
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linkup-client.js","sourceRoot":"","sources":["../src/linkup-client.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"linkup-client.js","sourceRoot":"","sources":["../src/linkup-client.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,qCAOkB;AAWlB,4EAAiD;AAEjD,mCAA6D;AAE7D,MAAa,YAAY;IACN,UAAU,GAAG,qBAAqB,CAAC;IACnC,MAAM,CAAS;IACf,OAAO,CAAS;IAEjC,YAAY,MAAiB;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,0BAA0B,CAAC;IAC9D,CAAC;IAED,KAAK,CAAC,MAAM,CACV,MAAuB;QAUvB,IAAI,OAAO,GAA2B;YACpC,aAAa,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE;SACvC,CAAC;QAEF,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAC1C,CAAC;QAED,OAAO,eAAK;aACT,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE;YAC5C,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,OAAO;SACR,CAAC;aACD,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CACjB,IAAI,CAAC,cAAc,CAAI,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,CAAC,CACzD;aACA,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;YACX,MAAM,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;IACP,CAAC;IAEO,cAAc,C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AI,kCAAyB,CAAC,OAAO,CAAC,CAAC;YAChD,KAAK,GAAG;gBACN,OAAO,IAAI,sCAA6B,CAAC,OAAO,CAAC,CAAC;YACpD;gBACE,OAAO,IAAI,2BAAkB,CAC3B,8BAA8B,KAAK,CAAC,OAAO,EAAE,CAC9C,CAAC;QACN,CAAC;IACH,CAAC;CACF;AA5GD,oCA4GC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -14,19 +14,38 @@ export interface SearchParams<T extends SearchOutputType> {
|
|
|
14
14
|
structuredOutputSchema?: StructuredOutputSchema;
|
|
15
15
|
}
|
|
16
16
|
export type LinkupSearchResponse<T> = T extends 'sourcedAnswer' ? SourcedAnswer : T extends 'searchResults' ? SearchResults : T extends 'structured' ? StructuredOutputSchema : never;
|
|
17
|
+
export interface SearchResults {
|
|
18
|
+
results: (TextSearchResult | ImageSearchResult)[];
|
|
19
|
+
}
|
|
20
|
+
export interface TextSearchResult {
|
|
21
|
+
type: 'text';
|
|
22
|
+
name: string;
|
|
23
|
+
url: string;
|
|
24
|
+
content: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ImageSearchResult {
|
|
27
|
+
type: 'image';
|
|
28
|
+
name: string;
|
|
29
|
+
url: string;
|
|
30
|
+
}
|
|
17
31
|
export interface SourcedAnswer {
|
|
18
32
|
answer: string;
|
|
19
|
-
sources:
|
|
20
|
-
name: string;
|
|
21
|
-
url: string;
|
|
22
|
-
snippet: string;
|
|
23
|
-
}[];
|
|
33
|
+
sources: (Source | TextSearchResult | ImageSearchResult)[];
|
|
24
34
|
}
|
|
25
|
-
export interface
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
content: string;
|
|
30
|
-
}[];
|
|
35
|
+
export interface Source {
|
|
36
|
+
name: string;
|
|
37
|
+
url: string;
|
|
38
|
+
snippet: string;
|
|
31
39
|
}
|
|
40
|
+
export type LinkupApiError = {
|
|
41
|
+
statusCode: number;
|
|
42
|
+
error: {
|
|
43
|
+
code: string;
|
|
44
|
+
message: string;
|
|
45
|
+
details: {
|
|
46
|
+
field: string;
|
|
47
|
+
message: string;
|
|
48
|
+
}[];
|
|
49
|
+
};
|
|
50
|
+
};
|
|
32
51
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAE7C,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,MAAM,CAAC;AAE9C,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAAG,eAAe,GAAG,YAAY,CAAC;AAEhF,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,sBAAsB,GAC9B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACvB,SAAS,CAAC,WAAW,CAAC,CAAC;AAE3B,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,gBAAgB;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,WAAW,CAAC;IACnB,UAAU,EAAE,CAAC,CAAC;IACd,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;CACjD;AAED,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,CAAC,SAAS,eAAe,GAC3D,aAAa,GACb,CAAC,SAAS,eAAe,GACvB,aAAa,GACb,CAAC,SAAS,YAAY,GACpB,sBAAsB,GACtB,KAAK,CAAC;AAEd,MAAM,WAAW,aAAa;IAC5B,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAE7C,MAAM,MAAM,WAAW,GAA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,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE;YACP,KAAK,EAAE,MAAM,CAAC;YACd,OAAO,EAAE,MAAM,CAAC;SACjB,EAAE,CAAC;KACL,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concat-error-and-details.util.d.ts","sourceRoot":"","sources":["../../src/utils/concat-error-and-details.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,eAAO,MAAM,qBAAqB,MAAO,cAAc,KAAG,MAOzD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.concatErrorAndDetails = void 0;
|
|
4
|
+
const concatErrorAndDetails = (e) => {
|
|
5
|
+
const errorMessage = [
|
|
6
|
+
e.error.message,
|
|
7
|
+
...e.error.details.map((detail) => detail.message),
|
|
8
|
+
].join(' ');
|
|
9
|
+
return errorMessage;
|
|
10
|
+
};
|
|
11
|
+
exports.concatErrorAndDetails = concatErrorAndDetails;
|
|
12
|
+
//# sourceMappingURL=concat-error-and-details.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concat-error-and-details.util.js","sourceRoot":"","sources":["../../src/utils/concat-error-and-details.util.ts"],"names":[],"mappings":";;;AAEO,MAAM,qBAAqB,GAAG,CAAC,CAAiB,EAAU,EAAE;IACjE,MAAM,YAAY,GAAG;QACnB,CAAC,CAAC,KAAK,CAAC,OAAO;QACf,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC;KACnD,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEZ,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAPW,QAAA,qBAAqB,yBAOhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./concat-error-and-details.util"), exports);
|
|
18
|
+
__exportStar(require("./schema.utils"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAAgD;AAChD,iDAA+B"}
|
package/package.json
CHANGED
|
@@ -1,54 +1,55 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
2
|
+
"name": "linkup-sdk",
|
|
3
|
+
"version": "1.0.4",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "tsc",
|
|
8
|
+
"watch": "tsc --watch",
|
|
9
|
+
"test": "jest",
|
|
10
|
+
"test:watch": "jest --watch",
|
|
11
|
+
"lint": "eslint src/**/*.ts",
|
|
12
|
+
"format": "prettier --write \"src/**/*.ts\""
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"linkup",
|
|
16
|
+
"llm",
|
|
17
|
+
"nodejs",
|
|
18
|
+
"api",
|
|
19
|
+
"sdk",
|
|
20
|
+
"client",
|
|
21
|
+
"search"
|
|
22
|
+
],
|
|
23
|
+
"author": "Linkup",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/LinkupPlatform/linkup-js-sdk"
|
|
28
|
+
},
|
|
29
|
+
"description": "A Javascript Client SDK for the Linkup API",
|
|
30
|
+
"files": [
|
|
31
|
+
"dist/**/*"
|
|
32
|
+
],
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@eslint/eslintrc": "^3.2.0",
|
|
35
|
+
"@eslint/js": "^9.17.0",
|
|
36
|
+
"@types/jest": "^29.5.14",
|
|
37
|
+
"@types/node-fetch": "^2.6.4",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^8.16.0",
|
|
39
|
+
"@typescript-eslint/parser": "^8.16.0",
|
|
40
|
+
"eslint": "^9.15.0",
|
|
41
|
+
"eslint-config-prettier": "^9.1.0",
|
|
42
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
43
|
+
"globals": "^15.13.0",
|
|
44
|
+
"jest": "^29.7.0",
|
|
45
|
+
"prettier": "^3.4.1",
|
|
46
|
+
"ts-jest": "^29.2.5",
|
|
47
|
+
"ts-node": "^10.9.2",
|
|
48
|
+
"typescript": "^5.7.2"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"axios": "^1.7.9",
|
|
52
|
+
"zod": "^3.24.1",
|
|
53
|
+
"zod-to-json-schema": "^3.24.1"
|
|
54
|
+
}
|
|
54
55
|
}
|