@centia-io/sdk 0.0.27 → 0.0.29

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.
@@ -0,0 +1,622 @@
1
+ (function(global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.CentiaSDK = {})));
5
+ })(this, function(exports) {
6
+
7
+ //#region src/util/jwt-decode.ts
8
+ var InvalidTokenError = class extends Error {};
9
+ InvalidTokenError.prototype.name = "InvalidTokenError";
10
+ function b64DecodeUnicode(str) {
11
+ return decodeURIComponent(atob(str).replace(/(.)/g, (m, p) => {
12
+ let code = p.charCodeAt(0).toString(16).toUpperCase();
13
+ if (code.length < 2) code = "0" + code;
14
+ return "%" + code;
15
+ }));
16
+ }
17
+ function base64UrlDecode(str) {
18
+ let output = str.replace(/-/g, "+").replace(/_/g, "/");
19
+ switch (output.length % 4) {
20
+ case 0: break;
21
+ case 2:
22
+ output += "==";
23
+ break;
24
+ case 3:
25
+ output += "=";
26
+ break;
27
+ default: throw new Error("base64 string is not of the correct length");
28
+ }
29
+ try {
30
+ return b64DecodeUnicode(output);
31
+ } catch (err) {
32
+ return atob(output);
33
+ }
34
+ }
35
+ function jwtDecode(token, options) {
36
+ if (typeof token !== "string") throw new InvalidTokenError("Invalid token specified: must be a string");
37
+ options ||= {};
38
+ const pos = options.header === true ? 0 : 1;
39
+ const part = token.split(".")[pos];
40
+ if (typeof part !== "string") throw new InvalidTokenError(`Invalid token specified: missing part #${pos + 1}`);
41
+ let decoded;
42
+ try {
43
+ decoded = base64UrlDecode(part);
44
+ } catch (e) {
45
+ throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${pos + 1} (${e.message})`);
46
+ }
47
+ try {
48
+ return JSON.parse(decoded);
49
+ } catch (e) {
50
+ throw new InvalidTokenError(`Invalid token specified: invalid json for part #${pos + 1} (${e.message})`);
51
+ }
52
+ }
53
+
54
+ //#endregion
55
+ //#region src/util/storage.ts
56
+ var MemoryStorage = class {
57
+ constructor() {
58
+ this.store = /* @__PURE__ */ new Map();
59
+ }
60
+ getItem(key) {
61
+ return this.store.has(key) ? this.store.get(key) : null;
62
+ }
63
+ setItem(key, value) {
64
+ this.store.set(key, String(value));
65
+ }
66
+ removeItem(key) {
67
+ this.store.delete(key);
68
+ }
69
+ };
70
+ let cached = null;
71
+ function getStorage() {
72
+ if (cached) return cached;
73
+ try {
74
+ const g$1 = typeof globalThis !== "undefined" ? globalThis : window;
75
+ if (g$1 && g$1.localStorage && typeof g$1.localStorage.getItem === "function") {
76
+ cached = g$1.localStorage;
77
+ return cached;
78
+ }
79
+ } catch (e) {}
80
+ const g = typeof globalThis !== "undefined" ? globalThis : {};
81
+ if (!g.__gc2_memory_storage) g.__gc2_memory_storage = new MemoryStorage();
82
+ cached = g.__gc2_memory_storage;
83
+ return cached;
84
+ }
85
+
86
+ //#endregion
87
+ //#region src/util/utils.ts
88
+ const generatePkceChallenge = async () => {
89
+ const generateRandomString = () => {
90
+ const array = new Uint32Array(28);
91
+ crypto.getRandomValues(array);
92
+ return Array.from(array, (dec) => ("0" + dec.toString(16)).substr(-2)).join("");
93
+ };
94
+ const sha256 = (plain) => {
95
+ const data = new TextEncoder().encode(plain);
96
+ return crypto.subtle.digest("SHA-256", data);
97
+ };
98
+ const base64urlEncode = (str) => {
99
+ return btoa(String.fromCharCode.apply(null, [...new Uint8Array(str)])).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
100
+ };
101
+ async function pkceChallengeFromVerifier(v) {
102
+ return base64urlEncode(await sha256(v));
103
+ }
104
+ const { state, codeVerifier } = {
105
+ state: generateRandomString(),
106
+ codeVerifier: generateRandomString()
107
+ };
108
+ return {
109
+ state,
110
+ codeVerifier,
111
+ codeChallenge: await pkceChallengeFromVerifier(codeVerifier)
112
+ };
113
+ };
114
+ const isTokenExpired = (token) => {
115
+ let isJwtExpired = false;
116
+ const { exp } = jwtDecode(token);
117
+ const currentTime = (/* @__PURE__ */ new Date()).getTime() / 1e3;
118
+ if (exp) {
119
+ if (currentTime > exp) isJwtExpired = true;
120
+ }
121
+ return isJwtExpired;
122
+ };
123
+ const claims = (token) => {
124
+ return jwtDecode(token);
125
+ };
126
+ const isLogin = async (gc2) => {
127
+ const { accessToken, refreshToken } = getTokens();
128
+ if (!accessToken && !refreshToken) return false;
129
+ if (!accessToken || accessToken && isTokenExpired(accessToken)) {
130
+ if (refreshToken && isTokenExpired(refreshToken)) {
131
+ clearTokens();
132
+ clearOptions();
133
+ throw new Error("Refresh token has expired. Please login again.");
134
+ }
135
+ if (refreshToken) try {
136
+ const data = await gc2.getRefreshToken(refreshToken);
137
+ setTokens({
138
+ accessToken: data.access_token,
139
+ refreshToken,
140
+ idToken: data?.id_token
141
+ });
142
+ console.log("Access token refreshed");
143
+ } catch (e) {
144
+ throw new Error("Could not get refresh token.");
145
+ }
146
+ }
147
+ return true;
148
+ };
149
+ const setTokens = (tokens) => {
150
+ getStorage().setItem("gc2_tokens", JSON.stringify({
151
+ "accessToken": tokens.accessToken,
152
+ "refreshToken": tokens.refreshToken,
153
+ "idToken": tokens?.idToken || ""
154
+ }));
155
+ };
156
+ const getTokens = () => {
157
+ const str = getStorage().getItem("gc2_tokens");
158
+ const tokens = str ? JSON.parse(str) : {};
159
+ return {
160
+ accessToken: tokens?.accessToken || "",
161
+ refreshToken: tokens?.refreshToken || "",
162
+ idToken: tokens?.idToken || ""
163
+ };
164
+ };
165
+ const setOptions = (options) => {
166
+ getStorage().setItem("gc2_options", JSON.stringify({
167
+ "clientId": options.clientId,
168
+ "host": options.host,
169
+ "redirectUri": options.redirectUri
170
+ }));
171
+ };
172
+ const getOptions = () => {
173
+ const str = getStorage().getItem("gc2_options");
174
+ const options = str ? JSON.parse(str) : {};
175
+ return {
176
+ clientId: options?.clientId || "",
177
+ host: options?.host || "",
178
+ redirectUri: options?.redirectUri || ""
179
+ };
180
+ };
181
+ const clearTokens = () => {
182
+ getStorage().removeItem("gc2_tokens");
183
+ };
184
+ const clearOptions = () => {
185
+ getStorage().removeItem("gc2_options");
186
+ };
187
+ const getNonce = () => {
188
+ return getStorage().getItem("gc2_nonce");
189
+ };
190
+ const clearNonce = () => {
191
+ getStorage().removeItem("gc2_nonce");
192
+ };
193
+
194
+ //#endregion
195
+ //#region src/services/gc2.services.ts
196
+ var Gc2Service = class {
197
+ constructor(options) {
198
+ this.options = options;
199
+ this.host = options.host;
200
+ }
201
+ isCodeFlowOptions(options) {
202
+ return "redirectUri" in options;
203
+ }
204
+ isPasswordFlowOptions(options) {
205
+ return "username" in options;
206
+ }
207
+ isSignUpOptions(options) {
208
+ return "parentDb" in options;
209
+ }
210
+ buildUrl(path) {
211
+ if (path.startsWith("http://") || path.startsWith("https://")) return path;
212
+ return `${this.host}${path}`;
213
+ }
214
+ async request(url, method, body, contentType = "application/json") {
215
+ const headers = { "Content-Type": contentType };
216
+ let payload;
217
+ if (contentType === "application/json") payload = JSON.stringify(body);
218
+ else payload = new URLSearchParams(body).toString();
219
+ const response = await fetch(url, {
220
+ method,
221
+ headers,
222
+ body: payload
223
+ });
224
+ if (!response.ok) {
225
+ const errText = await response.text();
226
+ throw new Error(`HTTP error ${response.status}: ${errText}`);
227
+ }
228
+ return response.json();
229
+ }
230
+ async getDeviceCode() {
231
+ const path = this.options.deviceUri ?? `${this.host}/api/v4/oauth/device`;
232
+ return this.request(this.buildUrl(path), "POST", { client_id: this.options.clientId });
233
+ }
234
+ async pollToken(deviceCode, interval) {
235
+ const path = this.options.tokenUri ?? `${this.host}/api/v4/oauth`;
236
+ const getToken = async () => {
237
+ try {
238
+ return await this.request(this.buildUrl(path), "POST", {
239
+ client_id: this.options.clientId,
240
+ device_code: deviceCode,
241
+ grant_type: "device_code"
242
+ });
243
+ } catch (e) {
244
+ const err = JSON.parse(e.message.split(": ")[1]);
245
+ if (err.error === "authorization_pending") return null;
246
+ return err.error_description;
247
+ }
248
+ };
249
+ let response = await getToken();
250
+ while (response === null) {
251
+ await new Promise((resolve) => setTimeout(resolve, interval * 1100));
252
+ response = await getToken();
253
+ }
254
+ if (typeof response === "string") throw new Error(response);
255
+ return response;
256
+ }
257
+ getAuthorizationCodeURL(codeChallenge, state) {
258
+ let redirectUri;
259
+ if (this.isCodeFlowOptions(this.options)) redirectUri = this.options.redirectUri;
260
+ else throw new Error("CodeFlow options required for this operation");
261
+ const base = this.options.authUri ?? `${this.host}/auth/`;
262
+ const params = new URLSearchParams();
263
+ const nonce = getNonce();
264
+ params.set("response_type", "code");
265
+ params.set("client_id", this.options.clientId);
266
+ params.set("redirect_uri", redirectUri);
267
+ params.set("state", state);
268
+ params.set("code_challenge", codeChallenge);
269
+ params.set("code_challenge_method", "S256");
270
+ if (nonce) params.set("nonce", nonce);
271
+ if (this.options.scope) params.set("scope", this.options.scope);
272
+ return `${base}?${params.toString()}`;
273
+ }
274
+ getSignUpURL() {
275
+ if (!this.isSignUpOptions(this.options)) throw new Error("CodeFlow options required for this operation");
276
+ const base = this.options.authUri ?? `${this.host}/signup/`;
277
+ const params = new URLSearchParams();
278
+ params.set("client_id", this.options.clientId);
279
+ params.set("parentdb", this.options.parentDb);
280
+ params.set("redirect_uri", this.options.redirectUri);
281
+ return `${base}?${params.toString()}`;
282
+ }
283
+ async getAuthorizationCodeToken(code, codeVerifier) {
284
+ let redirectUri;
285
+ if (this.isCodeFlowOptions(this.options)) redirectUri = this.options.redirectUri;
286
+ else throw new Error("CodeFlow options required for this operation");
287
+ const path = this.options.tokenUri ?? `${this.host}/api/v4/oauth`;
288
+ return this.request(this.buildUrl(path), "POST", {
289
+ client_id: this.options.clientId,
290
+ redirect_uri: redirectUri,
291
+ grant_type: "authorization_code",
292
+ code,
293
+ code_verifier: codeVerifier
294
+ }, "application/x-www-form-urlencoded");
295
+ }
296
+ async getPasswordToken() {
297
+ let username, password, database;
298
+ if (this.isPasswordFlowOptions(this.options)) {
299
+ username = this.options.username;
300
+ password = this.options.password;
301
+ database = this.options.database;
302
+ } else throw new Error("PasswordFlow options required for this operation");
303
+ const path = `${this.host}/api/v4/oauth`;
304
+ return this.request(this.buildUrl(path), "POST", {
305
+ client_id: this.options.clientId,
306
+ grant_type: "password",
307
+ username,
308
+ password,
309
+ database
310
+ });
311
+ }
312
+ async getRefreshToken(token) {
313
+ const path = this.options.tokenUri ?? `${this.host}/api/v4/oauth`;
314
+ return this.request(this.buildUrl(path), "POST", {
315
+ client_id: this.options.clientId,
316
+ grant_type: "refresh_token",
317
+ refresh_token: token
318
+ });
319
+ }
320
+ getSignOutURL() {
321
+ let redirectUri;
322
+ if (this.isCodeFlowOptions(this.options)) redirectUri = this.options.redirectUri;
323
+ else throw new Error("CodeFlow options required for this operation");
324
+ const params = new URLSearchParams({ redirect_uri: redirectUri });
325
+ return this.options.logoutUri ?? `${this.host}/signout?${params.toString()}`;
326
+ }
327
+ };
328
+
329
+ //#endregion
330
+ //#region src/CodeFlow.ts
331
+ var CodeFlow = class {
332
+ constructor(options) {
333
+ this.options = options;
334
+ this.service = new Gc2Service(options);
335
+ }
336
+ async redirectHandle() {
337
+ const url = window.location.search;
338
+ const queryParams = new URLSearchParams(url);
339
+ if (queryParams.get("error")) throw new Error(`Failed to redirect: ${url}`);
340
+ const code = queryParams.get("code");
341
+ if (code) {
342
+ if (queryParams.get("state") !== getStorage().getItem("state")) throw new Error("Possible CSRF attack. Aborting login!");
343
+ try {
344
+ const { access_token, refresh_token, id_token } = await this.service.getAuthorizationCodeToken(code, getStorage().getItem("codeVerifier"));
345
+ setTokens({
346
+ accessToken: access_token,
347
+ refreshToken: refresh_token,
348
+ idToken: id_token
349
+ });
350
+ setOptions({
351
+ clientId: this.options.clientId,
352
+ host: this.options.host,
353
+ redirectUri: this.options.redirectUri
354
+ });
355
+ getStorage().removeItem("state");
356
+ getStorage().removeItem("codeVerifier");
357
+ const params = new URLSearchParams(window.location.search);
358
+ params.delete("code");
359
+ params.delete("state");
360
+ const loc = window.location;
361
+ const newUrl = loc.origin + loc.pathname + (params.size > 0 ? "?" + params.toString() : "");
362
+ history.pushState(null, "", newUrl);
363
+ return Promise.resolve(true);
364
+ } catch (e) {
365
+ throw new Error(e.message);
366
+ }
367
+ }
368
+ return await isLogin(this.service);
369
+ }
370
+ async signIn() {
371
+ const { state, codeVerifier, codeChallenge } = await generatePkceChallenge();
372
+ getStorage().setItem("state", state);
373
+ getStorage().setItem("codeVerifier", codeVerifier);
374
+ window.location = this.service.getAuthorizationCodeURL(codeChallenge, state);
375
+ }
376
+ signOut() {
377
+ this.clear();
378
+ window.location = this.service.getSignOutURL();
379
+ }
380
+ clear() {
381
+ clearTokens();
382
+ clearOptions();
383
+ clearNonce();
384
+ }
385
+ };
386
+
387
+ //#endregion
388
+ //#region src/PasswordFlow.ts
389
+ var PasswordFlow = class {
390
+ constructor(options) {
391
+ this.options = options;
392
+ this.service = new Gc2Service(options);
393
+ }
394
+ async signIn() {
395
+ const { access_token, refresh_token } = await this.service.getPasswordToken();
396
+ setTokens({
397
+ accessToken: access_token,
398
+ refreshToken: refresh_token
399
+ });
400
+ setOptions({
401
+ clientId: this.options.clientId,
402
+ host: this.options.host,
403
+ redirectUri: ""
404
+ });
405
+ }
406
+ signOut() {
407
+ this.clear();
408
+ }
409
+ clear() {
410
+ clearTokens();
411
+ clearOptions();
412
+ clearNonce();
413
+ }
414
+ };
415
+
416
+ //#endregion
417
+ //#region src/util/request-headers.ts
418
+ const getHeaders = async (contentType = "application/json") => {
419
+ if (!await isLogin(new Gc2Service(getOptions()))) return Promise.reject("Is not logged in");
420
+ const { accessToken } = getTokens();
421
+ const headers = {
422
+ Accept: "application/json",
423
+ Cookie: "XDEBUG_SESSION=XDEBUG_ECLIPSE",
424
+ Authorization: accessToken ? "Bearer " + accessToken : null
425
+ };
426
+ if (contentType) headers["Content-Type"] = contentType;
427
+ return headers;
428
+ };
429
+ var request_headers_default = getHeaders;
430
+
431
+ //#endregion
432
+ //#region src/util/make-request.ts
433
+ const make = async (version, resource, method, payload, contentType = "application/json") => {
434
+ const options = getOptions();
435
+ let request = {
436
+ method,
437
+ headers: await request_headers_default(contentType),
438
+ redirect: "manual"
439
+ };
440
+ if (payload) request.body = contentType === "application/json" ? JSON.stringify(payload) : payload;
441
+ return await fetch(options.host + `/api/v${version}/${resource}`, request);
442
+ };
443
+ var make_request_default = make;
444
+
445
+ //#endregion
446
+ //#region src/util/get-response.ts
447
+ const get = async (response, expectedCode) => {
448
+ let res = null;
449
+ let bodyText = "";
450
+ try {
451
+ bodyText = await response.text();
452
+ } catch (e) {}
453
+ if (bodyText) try {
454
+ res = JSON.parse(bodyText);
455
+ } catch (e) {}
456
+ if (response.status !== expectedCode) {
457
+ const msg = res && (res.message || res.error) || bodyText || `Unexpected status ${response.status}`;
458
+ throw new Error(msg);
459
+ }
460
+ return res;
461
+ };
462
+ var get_response_default = get;
463
+
464
+ //#endregion
465
+ //#region src/Sql.ts
466
+ var Sql = class {
467
+ async exec(request) {
468
+ return await get_response_default(await make_request_default("4", `sql`, "POST", request), 200);
469
+ }
470
+ };
471
+
472
+ //#endregion
473
+ //#region src/Rpc.ts
474
+ var Rpc = class {
475
+ async call(request) {
476
+ return await get_response_default(await make_request_default("4", `call`, "POST", request), 200);
477
+ }
478
+ };
479
+
480
+ //#endregion
481
+ //#region src/Meta.ts
482
+ var Meta = class {
483
+ async query(rel) {
484
+ return await get_response_default(await make_request_default("3", `meta/${rel}`, "GET", null), 200);
485
+ }
486
+ };
487
+
488
+ //#endregion
489
+ //#region src/Status.ts
490
+ var Status = class {
491
+ isAuth() {
492
+ const tokens = getTokens();
493
+ return !(!tokens.accessToken && !tokens.refreshToken);
494
+ }
495
+ getTokens() {
496
+ return getTokens();
497
+ }
498
+ };
499
+
500
+ //#endregion
501
+ //#region src/Claims.ts
502
+ var Claims = class {
503
+ get() {
504
+ const tokens = getTokens().accessToken;
505
+ return claims(tokens);
506
+ }
507
+ };
508
+
509
+ //#endregion
510
+ //#region src/Users.ts
511
+ var Users = class {
512
+ async get(user) {
513
+ return await get_response_default(await make_request_default("4", `users/${user}`, "GET", null), 200);
514
+ }
515
+ };
516
+
517
+ //#endregion
518
+ //#region src/Ws.ts
519
+ var Ws = class {
520
+ constructor(options) {
521
+ this.options = options;
522
+ this.options.wsClient = this.options?.wsClient ?? WebSocket;
523
+ }
524
+ connect() {
525
+ const me = this;
526
+ const { accessToken } = getTokens();
527
+ const connect = () => {
528
+ let queryString = `?token=` + accessToken;
529
+ if (this.options?.rel) queryString = queryString + `&rel=` + this.options.rel;
530
+ const ws = new this.options.wsClient(this.options.host + `/` + queryString);
531
+ ws.onopen = function() {
532
+ console.log("WebSocket connected!");
533
+ };
534
+ ws.onmessage = function(event) {
535
+ me.options.callBack(event.data);
536
+ };
537
+ ws.onclose = function(event) {
538
+ if (accessToken !== "") {
539
+ console.log("WebSocket closed, reconnecting in 3 seconds...", event.reason);
540
+ setTimeout(connect, 3e3);
541
+ }
542
+ };
543
+ ws.onerror = function(err) {
544
+ console.error("WebSocket error observed:", err);
545
+ ws.close();
546
+ };
547
+ };
548
+ if (accessToken !== "") connect();
549
+ }
550
+ };
551
+
552
+ //#endregion
553
+ //#region src/Stats.ts
554
+ var Stats = class {
555
+ async get() {
556
+ return await get_response_default(await make_request_default("4", `stats`, "GET", null), 200);
557
+ }
558
+ };
559
+
560
+ //#endregion
561
+ //#region src/Tables.ts
562
+ var Tables = class {
563
+ async get(schema, table) {
564
+ return await get_response_default(await make_request_default("4", `schemas/${encodeURIComponent(schema)}/tables/${encodeURIComponent(table)}`, "GET", null), 200);
565
+ }
566
+ async create(schema, table, payload) {
567
+ return await get_response_default(await make_request_default("4", `schemas/${encodeURIComponent(schema)}/tables/${encodeURIComponent(table)}`, "POST", payload), 200);
568
+ }
569
+ async patch(schema, table, payload) {
570
+ return await get_response_default(await make_request_default("4", `schemas/${encodeURIComponent(schema)}/tables/${encodeURIComponent(table)}`, "PATCH", payload), 200);
571
+ }
572
+ async delete(schema, table) {
573
+ return await get_response_default(await make_request_default("4", `schemas/${encodeURIComponent(schema)}/tables/${encodeURIComponent(table)}`, "DELETE", null), 204);
574
+ }
575
+ };
576
+
577
+ //#endregion
578
+ //#region src/Api.ts
579
+ async function dispatch(name, args) {
580
+ const rpc = new Rpc();
581
+ const request = {
582
+ jsonrpc: "2.0",
583
+ method: name,
584
+ id: 1,
585
+ params: args
586
+ };
587
+ return (await rpc.call(request)).result.data;
588
+ }
589
+ function createApi() {
590
+ return new Proxy({}, { get(_target, prop) {
591
+ if (typeof prop !== "string") return void 0;
592
+ return (...args) => dispatch(prop, ...args);
593
+ } });
594
+ }
595
+
596
+ //#endregion
597
+ //#region src/SignUp.ts
598
+ var SignUp = class {
599
+ constructor(options) {
600
+ this.options = options;
601
+ this.service = new Gc2Service(options);
602
+ }
603
+ async signUp() {
604
+ window.location = this.service.getSignUpURL();
605
+ }
606
+ };
607
+
608
+ //#endregion
609
+ exports.Claims = Claims;
610
+ exports.CodeFlow = CodeFlow;
611
+ exports.Meta = Meta;
612
+ exports.PasswordFlow = PasswordFlow;
613
+ exports.Rpc = Rpc;
614
+ exports.SignUp = SignUp;
615
+ exports.Sql = Sql;
616
+ exports.Stats = Stats;
617
+ exports.Status = Status;
618
+ exports.Tables = Tables;
619
+ exports.Users = Users;
620
+ exports.Ws = Ws;
621
+ exports.createApi = createApi;
622
+ });
package/package.json CHANGED
@@ -1,27 +1,29 @@
1
1
  {
2
2
  "name": "@centia-io/sdk",
3
- "version": "0.0.27",
4
- "description": "TypeScript client for Centia-io",
3
+ "version": "0.0.29",
4
+ "description": "Centia-io TypeScript SDK",
5
+ "author": "Martin Høgh",
6
+ "license": "MIT",
5
7
  "type": "module",
6
- "main": "./dist/index.js",
7
- "module": "./dist/index.js",
8
- "types": "./dist/index.d.ts",
8
+ "main": "./dist/centia-io-sdk.cjs",
9
+ "module": "./dist/centia-io-sdk.js",
10
+ "types": "./dist/centia-io-sdk.d.cts",
9
11
  "exports": {
10
- ".": "./dist/index.js",
12
+ ".": {
13
+ "import": "./dist/centia-io-sdk.js",
14
+ "require": "./dist/centia-io-sdk.cjs"
15
+ },
11
16
  "./package.json": "./package.json"
12
17
  },
13
18
  "files": [
14
- "dist",
15
- "build"
19
+ "dist"
16
20
  ],
17
21
  "devDependencies": {
18
22
  "tsdown": "^0.15.7",
19
- "typescript": "^5.6.3",
20
- "vite": "^5.4.10"
23
+ "typescript": "^5.6.3"
21
24
  },
22
25
  "private": false,
23
26
  "scripts": {
24
- "dev": "vite build --watch --mode development",
25
27
  "build": "tsdown --watch"
26
28
  }
27
29
  }