aeria-sdk 0.0.0

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,10 @@
1
+ export type InstanceConfig = {
2
+ apiUrl: string | {
3
+ production: string;
4
+ development: string;
5
+ };
6
+ storage?: {
7
+ strategy?: 'memo' | 'localStorage';
8
+ namespace?: string;
9
+ };
10
+ };
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/types.mjs ADDED
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,2 @@
1
+ import type { InstanceConfig } from './types.js';
2
+ export declare const apiUrl: (config: InstanceConfig) => string;
package/dist/utils.js ADDED
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.apiUrl = void 0;
4
+ const apiUrl = (config) => {
5
+ if (typeof config.apiUrl === 'string') {
6
+ return config.apiUrl;
7
+ }
8
+ return process.env.NODE_ENV === 'production'
9
+ ? config.apiUrl.production
10
+ : config.apiUrl.development;
11
+ };
12
+ exports.apiUrl = apiUrl;
package/dist/utils.mjs ADDED
@@ -0,0 +1,6 @@
1
+ export var apiUrl = function(config) {
2
+ if (typeof config.apiUrl === "string") {
3
+ return config.apiUrl;
4
+ }
5
+ return process.env.NODE_ENV === "production" ? config.apiUrl.production : config.apiUrl.development;
6
+ };
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "aeria-sdk",
3
+ "version": "0.0.0",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
+ "keywords": [],
9
+ "author": "",
10
+ "license": "ISC",
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "bin": {
15
+ "aeria-sdk": "bin/index.js"
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "bin"
20
+ ],
21
+ "exports": {
22
+ ".": {
23
+ "import": "./dist/index.mjs",
24
+ "require": "./dist/index.js",
25
+ "types": "./dist/index.d.ts"
26
+ },
27
+ "./storage": {
28
+ "import": "./dist/storage.mjs",
29
+ "require": "./dist/storage.js",
30
+ "types": "./dist/storage.d.ts"
31
+ },
32
+ "./topLevel": {
33
+ "import": "./dist/topLevel.mjs",
34
+ "require": "./dist/topLevel.js",
35
+ "types": "./dist/topLevel.d.ts"
36
+ }
37
+ },
38
+ "peerDependencies": {
39
+ "@aeriajs/common": "^0.0.0",
40
+ "@aeriajs/types": "^0.0.0"
41
+ },
42
+ "scripts": {
43
+ "test": "echo skipping",
44
+ "lint": "eslint src",
45
+ "lint:fix": "eslint src --fix",
46
+ "build": "pnpm build:cjs && pnpm build:esm",
47
+ "build:cjs": "tsc",
48
+ "build:esm": "swc src/* -d dist --strip-leading-paths -C module.type=es6 --out-file-extension=mjs && pnpm build:esm-transform",
49
+ "build:esm-transform": "pnpm -w esm-transform $PWD/dist"
50
+ }
51
+ }