@dorapocket-tech/link-service-sdk 0.1.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/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # @dorapocket-tech/link-service-sdk
2
+
3
+ Typed client SDK for interacting with the Dorapocket Link Service API.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @dorapocket-tech/link-service-sdk
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```ts
14
+ import { LinkServiceClient } from '@dorapocket-tech/link-service-sdk';
15
+
16
+ const client = LinkServiceClient.configure({
17
+ environment: 'prod',
18
+ apiKey: process.env.LINK_SERVICE_API_KEY!,
19
+ });
20
+
21
+ const created = await client.createLink({
22
+ url: 'https://example.com',
23
+ payload: { source: 'campaign-a' },
24
+ });
25
+
26
+ const payload = await client.resolvePayload(created.code);
27
+ ```
28
+
29
+ ## Environments
30
+
31
+ - `prod` -> `https://api.tinyhub.link`
32
+ - `sandbox` -> `https://api.sandbox.tinyhub.link`
33
+
34
+ ## API
35
+
36
+ - `LinkServiceClient.configure({ environment, apiKey })`
37
+ - `client.createLink(request, options?)`
38
+ - `client.resolvePayload(codeOrUrl, options?)`
39
+
40
+ ## Requirements
41
+
42
+ - Node.js 20+
43
+ - Runtime with global `fetch` support
@@ -0,0 +1,7 @@
1
+ export declare const URL_RESOLUTION_CONSTANTS: {
2
+ readonly SHORT_CODE_PARAMETER: "_code";
3
+ };
4
+ export declare const API_CONSTANTS: {
5
+ readonly LINK_MANAGEMENT_BASE_PATH: "links";
6
+ };
7
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB;;CAE3B,CAAC;AAEX,eAAO,MAAM,aAAa;;CAEhB,CAAC"}
@@ -0,0 +1,22 @@
1
+ export interface LinkServiceErrorDetails {
2
+ status: number;
3
+ method: string;
4
+ url: string;
5
+ responseBody?: unknown;
6
+ responseText?: string;
7
+ headers?: Record<string, string | null>;
8
+ retryAfter?: number;
9
+ cause?: unknown;
10
+ }
11
+ export declare class LinkServiceError extends Error {
12
+ readonly status: number;
13
+ readonly method: string;
14
+ readonly url: string;
15
+ readonly responseBody?: unknown;
16
+ readonly responseText?: string;
17
+ readonly headers?: Record<string, string | null>;
18
+ readonly retryAfter?: number;
19
+ readonly cause?: unknown;
20
+ constructor(message: string, details: LinkServiceErrorDetails);
21
+ }
22
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;IACjD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAkB,KAAK,CAAC,EAAE,OAAO,CAAC;gBAEtB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB;CAgB9D"}
@@ -0,0 +1,5 @@
1
+ export { LinkServiceClient } from './link-service-client.js';
2
+ export { LinkServiceError } from './errors.js';
3
+ export { LINK_SERVICE_ENVIRONMENT_URLS } from './types.js';
4
+ export type { LinkServiceConfigurationOptions, LinkServiceEnvironment, LinkServiceRequestOptions, CreateLinkRequest, CreateLinkResponse, LinkPayload, } from './types.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D,YAAY,EACV,+BAA+B,EAC/B,sBAAsB,EACtB,yBAAyB,EACzB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,GACZ,MAAM,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,229 @@
1
+ const E = {
2
+ SHORT_CODE_PARAMETER: "_code"
3
+ }, m = {
4
+ LINK_MANAGEMENT_BASE_PATH: "links"
5
+ };
6
+ class d extends Error {
7
+ status;
8
+ method;
9
+ url;
10
+ responseBody;
11
+ responseText;
12
+ headers;
13
+ retryAfter;
14
+ cause;
15
+ constructor(e, r) {
16
+ super(
17
+ e,
18
+ r.cause !== void 0 ? { cause: r.cause } : void 0
19
+ ), this.name = "LinkServiceError", this.status = r.status, this.method = r.method, this.url = r.url, this.responseBody = r.responseBody, this.responseText = r.responseText, this.headers = r.headers, this.retryAfter = r.retryAfter, this.cause = r.cause;
20
+ }
21
+ }
22
+ const T = {
23
+ prod: "https://api.tinyhub.link",
24
+ sandbox: "https://api.sandbox.tinyhub.link"
25
+ }, y = "application/json", w = 3e4, b = (n) => {
26
+ const e = T[n];
27
+ if (!e)
28
+ throw new Error(`Unsupported Link Service environment: "${n}".`);
29
+ return e;
30
+ }, v = () => {
31
+ if (typeof DOMException < "u")
32
+ return new DOMException("Request timed out", "TimeoutError");
33
+ const n = new Error("Request timed out");
34
+ return n.name = "TimeoutError", n;
35
+ }, S = (n) => n === 400 ? "Request was invalid. Please check your input." : n === 401 ? "Unauthorized. Please check your API key." : n === 403 ? "Forbidden. Your API key does not have access." : n === 404 ? "Resource not found." : n === 409 ? "Request conflict. Please try again." : n === 429 ? "Too many requests. Please try again later." : n >= 500 ? "Link Service is unavailable. Please try again later." : "Request failed. Please try again.";
36
+ class p {
37
+ static configure(e) {
38
+ const r = b(e.environment);
39
+ return new p({
40
+ baseUrl: r,
41
+ apiKey: e.apiKey
42
+ });
43
+ }
44
+ baseUrl;
45
+ apiKey;
46
+ fetchImpl;
47
+ defaultTimeout;
48
+ defaultHeaders;
49
+ constructor(e) {
50
+ if (!e || typeof e != "object")
51
+ throw new Error("LinkServiceClient options are required");
52
+ const r = e.baseUrl?.trim();
53
+ if (!r)
54
+ throw new Error("LinkServiceClient requires a non-empty baseUrl");
55
+ try {
56
+ new URL(r);
57
+ } catch {
58
+ throw new Error(`Invalid baseUrl provided: "${e.baseUrl}"`);
59
+ }
60
+ const t = this.normalizeToken(e.apiKey, "apiKey"), a = globalThis.fetch;
61
+ if (typeof a != "function")
62
+ throw new Error(
63
+ "No fetch implementation found. Ensure global fetch is available."
64
+ );
65
+ this.baseUrl = r.replace(/\/+$/, ""), this.apiKey = t, this.fetchImpl = a.bind(globalThis), this.defaultTimeout = w, this.defaultHeaders = {
66
+ Accept: y
67
+ };
68
+ }
69
+ async createLink(e, r) {
70
+ return this.performRequest(
71
+ "POST",
72
+ `/${m.LINK_MANAGEMENT_BASE_PATH}`,
73
+ e,
74
+ r
75
+ );
76
+ }
77
+ async resolvePayload(e, r) {
78
+ const t = this.resolveShortCode(e);
79
+ return this.performRequest(
80
+ "GET",
81
+ `/${m.LINK_MANAGEMENT_BASE_PATH}/${t}/payload`,
82
+ void 0,
83
+ r
84
+ );
85
+ }
86
+ resolveShortCode(e) {
87
+ const r = e?.trim();
88
+ if (!r)
89
+ throw new Error("Short link code or URL is required");
90
+ const t = /^https?:\/\//i.test(r);
91
+ if (t || r.includes(".") && r.includes("/")) {
92
+ const i = t ? r : `https://${r}`;
93
+ let s;
94
+ try {
95
+ s = new URL(i);
96
+ } catch (o) {
97
+ if (t)
98
+ throw o;
99
+ }
100
+ if (s) {
101
+ const o = E.SHORT_CODE_PARAMETER, c = s.searchParams.get(o)?.trim();
102
+ if (c)
103
+ return c;
104
+ const u = s.pathname.replace(/\/+$/, "").split("/").filter(Boolean).at(-1)?.trim();
105
+ if (u)
106
+ return u;
107
+ throw new Error("Short link URL does not contain a code");
108
+ }
109
+ }
110
+ return r;
111
+ }
112
+ normalizeToken(e, r) {
113
+ if (e == null)
114
+ throw new Error(`${r} is required`);
115
+ const t = e.trim();
116
+ if (!t)
117
+ throw new Error(`${r} must be a non-empty string`);
118
+ return t;
119
+ }
120
+ resolveTimeout(e) {
121
+ return e?.timeoutMs !== void 0 && e.timeoutMs >= 0 && Number.isFinite(e.timeoutMs) ? e.timeoutMs : this.defaultTimeout;
122
+ }
123
+ createSignal(e, r) {
124
+ const t = e?.signal;
125
+ if (!(typeof AbortController < "u" && (r !== void 0 || t)))
126
+ return { signal: t, cleanup: () => {
127
+ } };
128
+ const i = new AbortController();
129
+ let s, o;
130
+ t && (t.aborted ? i.abort(
131
+ t.reason
132
+ ) : (o = () => i.abort(
133
+ t.reason
134
+ ), t.addEventListener("abort", o))), r && r > 0 && (s = setTimeout(() => {
135
+ i.signal.aborted || i.abort(v());
136
+ }, r));
137
+ const c = () => {
138
+ o && t && t.removeEventListener("abort", o), s && clearTimeout(s);
139
+ };
140
+ return {
141
+ signal: i.signal,
142
+ cleanup: c
143
+ };
144
+ }
145
+ mergeHeaders(e, r) {
146
+ const t = {
147
+ ...this.defaultHeaders,
148
+ "X-API-Key": this.apiKey,
149
+ ...r?.headers ?? {}
150
+ };
151
+ return e && (t["Content-Type"] = t["Content-Type"] ?? y), t;
152
+ }
153
+ async performRequest(e, r, t, a) {
154
+ const i = this.buildUrl(r), s = this.resolveTimeout(a), { signal: o, cleanup: c } = this.createSignal(a, s), h = t != null;
155
+ try {
156
+ const l = await this.fetchImpl(i, {
157
+ method: e,
158
+ headers: this.mergeHeaders(h, a),
159
+ body: h ? JSON.stringify(t) : void 0,
160
+ signal: o
161
+ });
162
+ return await this.handleResponse(l, e, i);
163
+ } catch (l) {
164
+ if (l instanceof d)
165
+ throw l;
166
+ let u = "Network request failed. Please try again.";
167
+ if (l && typeof l == "object" && "name" in l) {
168
+ const f = String(l.name);
169
+ f === "TimeoutError" ? u = "Request timed out. Please try again." : f === "AbortError" && (u = "Request was cancelled.");
170
+ }
171
+ throw new d(
172
+ u,
173
+ {
174
+ status: 0,
175
+ method: e,
176
+ url: i,
177
+ cause: l
178
+ }
179
+ );
180
+ } finally {
181
+ c();
182
+ }
183
+ }
184
+ buildUrl(e) {
185
+ return e.startsWith("/") ? `${this.baseUrl}${e}` : `${this.baseUrl}/${e}`;
186
+ }
187
+ async handleResponse(e, r, t) {
188
+ const a = e.headers?.get?.("content-type") ?? e.headers?.get?.("Content-Type") ?? "", s = e.status !== 204 && e.status !== 205 ? await e.text() : "";
189
+ let o;
190
+ if (s && a.includes("json"))
191
+ try {
192
+ o = JSON.parse(s);
193
+ } catch (c) {
194
+ if (e.ok)
195
+ throw new d(
196
+ "Unexpected response from Link Service.",
197
+ {
198
+ status: e.status,
199
+ method: r,
200
+ url: t,
201
+ cause: c
202
+ }
203
+ );
204
+ }
205
+ if (!e.ok) {
206
+ const c = S(e.status);
207
+ throw new d(c, {
208
+ status: e.status,
209
+ method: r,
210
+ url: t
211
+ });
212
+ }
213
+ if (!o && s && !a.includes("json"))
214
+ throw new d(
215
+ "Unexpected response from Link Service.",
216
+ {
217
+ status: e.status,
218
+ method: r,
219
+ url: t
220
+ }
221
+ );
222
+ return o;
223
+ }
224
+ }
225
+ export {
226
+ T as LINK_SERVICE_ENVIRONMENT_URLS,
227
+ p as LinkServiceClient,
228
+ d as LinkServiceError
229
+ };
@@ -0,0 +1,26 @@
1
+ import { CreateLinkRequest, CreateLinkResponse, LinkPayload, LinkServiceConfigurationOptions, LinkServiceRequestOptions } from './types.js';
2
+ type LinkServiceClientInit = {
3
+ baseUrl: string;
4
+ apiKey: string;
5
+ };
6
+ export declare class LinkServiceClient {
7
+ static configure(options: LinkServiceConfigurationOptions): LinkServiceClient;
8
+ private readonly baseUrl;
9
+ private readonly apiKey;
10
+ private readonly fetchImpl;
11
+ private readonly defaultTimeout;
12
+ private readonly defaultHeaders;
13
+ constructor(options: LinkServiceClientInit);
14
+ createLink(request: CreateLinkRequest, options?: LinkServiceRequestOptions): Promise<CreateLinkResponse>;
15
+ resolvePayload(code: string, options?: LinkServiceRequestOptions): Promise<LinkPayload>;
16
+ private resolveShortCode;
17
+ private normalizeToken;
18
+ private resolveTimeout;
19
+ private createSignal;
20
+ private mergeHeaders;
21
+ private performRequest;
22
+ private buildUrl;
23
+ private handleResponse;
24
+ }
25
+ export {};
26
+ //# sourceMappingURL=link-service-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link-service-client.d.ts","sourceRoot":"","sources":["../src/link-service-client.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAElB,WAAW,EACX,+BAA+B,EAE/B,yBAAyB,EAC1B,MAAM,YAAY,CAAC;AAiDpB,KAAK,qBAAqB,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,qBAAa,iBAAiB;IAC5B,MAAM,CAAC,SAAS,CACd,OAAO,EAAE,+BAA+B,GACvC,iBAAiB;IASpB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IACzC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAyB;gBAE5C,OAAO,EAAE,qBAAqB;IAoCpC,UAAU,CACd,OAAO,EAAE,iBAAiB,EAC1B,OAAO,CAAC,EAAE,yBAAyB,GAClC,OAAO,CAAC,kBAAkB,CAAC;IASxB,cAAc,CAClB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,yBAAyB,GAClC,OAAO,CAAC,WAAW,CAAC;IAUvB,OAAO,CAAC,gBAAgB;IA2CxB,OAAO,CAAC,cAAc;IActB,OAAO,CAAC,cAAc;IAatB,OAAO,CAAC,YAAY;IAsDpB,OAAO,CAAC,YAAY;YAkBN,cAAc;IAiD5B,OAAO,CAAC,QAAQ;YAOF,cAAc;CAuD7B"}
@@ -0,0 +1,82 @@
1
+ {
2
+ "name": "@dorapocket-tech/link-service-sdk",
3
+ "version": "0.1.1",
4
+ "description": "Typed client SDK for interacting with the Dorapocket link service API.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/dorapocket-tech/dorapocket-service.git",
9
+ "directory": "apps/link-service-sdk"
10
+ },
11
+ "homepage": "https://github.com/dorapocket-tech/dorapocket-service/tree/main/apps/link-service-sdk#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/dorapocket-tech/dorapocket-service/issues"
14
+ },
15
+ "keywords": [
16
+ "dorapocket",
17
+ "sdk",
18
+ "link-service",
19
+ "typescript"
20
+ ],
21
+ "type": "module",
22
+ "private": false,
23
+ "main": "./dist/index.js",
24
+ "module": "./dist/index.js",
25
+ "types": "./dist/index.d.ts",
26
+ "exports": {
27
+ "./package.json": "./package.json",
28
+ ".": {
29
+ "types": "./dist/index.d.ts",
30
+ "import": "./dist/index.js",
31
+ "default": "./dist/index.js"
32
+ }
33
+ },
34
+ "files": [
35
+ "dist"
36
+ ],
37
+ "publishConfig": {
38
+ "access": "public"
39
+ },
40
+ "scripts": {
41
+ "build": "vite build",
42
+ "test": "vitest run",
43
+ "test:watch": "vitest",
44
+ "lint": "eslint ."
45
+ },
46
+ "devDependencies": {
47
+ "typescript": "^5.8.2",
48
+ "vitest": "^3.0.0"
49
+ },
50
+ "engines": {
51
+ "node": ">=20"
52
+ },
53
+ "nx": {
54
+ "sourceRoot": "apps/link-service-sdk/src",
55
+ "projectType": "library",
56
+ "tags": [
57
+ "scope:sdk",
58
+ "type:lib"
59
+ ],
60
+ "targets": {
61
+ "build": {
62
+ "executor": "@nx/vite:build",
63
+ "outputs": [
64
+ "{options.outputPath}"
65
+ ],
66
+ "options": {
67
+ "outputPath": "apps/link-service-sdk/dist"
68
+ }
69
+ },
70
+ "test": {
71
+ "executor": "@nx/vite:test",
72
+ "outputs": [
73
+ "{options.reportsDirectory}"
74
+ ],
75
+ "options": {
76
+ "passWithNoTests": false,
77
+ "reportsDirectory": "../../coverage/apps/link-service-sdk"
78
+ }
79
+ }
80
+ }
81
+ }
82
+ }
@@ -0,0 +1,46 @@
1
+ export declare const LINK_SERVICE_ENVIRONMENT_URLS: {
2
+ readonly prod: "https://api.tinyhub.link";
3
+ readonly sandbox: "https://api.sandbox.tinyhub.link";
4
+ };
5
+ export type LinkServiceEnvironment = keyof typeof LINK_SERVICE_ENVIRONMENT_URLS;
6
+ export interface LinkServiceConfigurationOptions {
7
+ /**
8
+ * Named environment shortcut.
9
+ */
10
+ environment: LinkServiceEnvironment;
11
+ /**
12
+ * API key issued for the customer application.
13
+ */
14
+ apiKey: string;
15
+ }
16
+ export interface LinkServiceRequestOptions {
17
+ /**
18
+ * Advanced per-request options.
19
+ */
20
+ /**
21
+ * Optional AbortSignal that cancels the request.
22
+ */
23
+ signal?: AbortSignal;
24
+ /**
25
+ * Additional headers to merge for this specific call.
26
+ */
27
+ headers?: Record<string, string>;
28
+ /**
29
+ * Override timeout (in milliseconds) for this call.
30
+ */
31
+ timeoutMs?: number;
32
+ }
33
+ export interface CreateLinkRequest {
34
+ url: string;
35
+ payload?: Record<string, unknown>;
36
+ expiresIn?: string;
37
+ maxUses?: number;
38
+ }
39
+ export interface CreateLinkResponse {
40
+ shortUrl: string;
41
+ code: string;
42
+ expiresAt?: string;
43
+ maxUses?: number;
44
+ }
45
+ export type LinkPayload = Record<string, unknown>;
46
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B;;;CAGhC,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAChC,MAAM,OAAO,6BAA6B,CAAC;AAE7C,MAAM,WAAW,+BAA+B;IAC9C;;OAEG;IACH,WAAW,EAAE,sBAAsB,CAAC;IACpC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,82 @@
1
+ {
2
+ "name": "@dorapocket-tech/link-service-sdk",
3
+ "version": "0.1.1",
4
+ "description": "Typed client SDK for interacting with the Dorapocket link service API.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/dorapocket-tech/dorapocket-service.git",
9
+ "directory": "apps/link-service-sdk"
10
+ },
11
+ "homepage": "https://github.com/dorapocket-tech/dorapocket-service/tree/main/apps/link-service-sdk#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/dorapocket-tech/dorapocket-service/issues"
14
+ },
15
+ "keywords": [
16
+ "dorapocket",
17
+ "sdk",
18
+ "link-service",
19
+ "typescript"
20
+ ],
21
+ "type": "module",
22
+ "private": false,
23
+ "main": "./dist/index.js",
24
+ "module": "./dist/index.js",
25
+ "types": "./dist/index.d.ts",
26
+ "exports": {
27
+ "./package.json": "./package.json",
28
+ ".": {
29
+ "types": "./dist/index.d.ts",
30
+ "import": "./dist/index.js",
31
+ "default": "./dist/index.js"
32
+ }
33
+ },
34
+ "files": [
35
+ "dist"
36
+ ],
37
+ "publishConfig": {
38
+ "access": "public"
39
+ },
40
+ "scripts": {
41
+ "build": "vite build",
42
+ "test": "vitest run",
43
+ "test:watch": "vitest",
44
+ "lint": "eslint ."
45
+ },
46
+ "devDependencies": {
47
+ "typescript": "^5.8.2",
48
+ "vitest": "^3.0.0"
49
+ },
50
+ "engines": {
51
+ "node": ">=20"
52
+ },
53
+ "nx": {
54
+ "sourceRoot": "apps/link-service-sdk/src",
55
+ "projectType": "library",
56
+ "tags": [
57
+ "scope:sdk",
58
+ "type:lib"
59
+ ],
60
+ "targets": {
61
+ "build": {
62
+ "executor": "@nx/vite:build",
63
+ "outputs": [
64
+ "{options.outputPath}"
65
+ ],
66
+ "options": {
67
+ "outputPath": "apps/link-service-sdk/dist"
68
+ }
69
+ },
70
+ "test": {
71
+ "executor": "@nx/vite:test",
72
+ "outputs": [
73
+ "{options.reportsDirectory}"
74
+ ],
75
+ "options": {
76
+ "passWithNoTests": false,
77
+ "reportsDirectory": "../../coverage/apps/link-service-sdk"
78
+ }
79
+ }
80
+ }
81
+ }
82
+ }