@01.software/sdk 0.2.9-dev.260311.892250f → 0.2.9-dev.260311.bb95a4e
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 +8 -8
- package/dist/index.cjs +5 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -25
- package/dist/index.d.ts +5 -25
- package/dist/index.js +5 -17
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -95,17 +95,17 @@ await client.query.prefetchQuery({
|
|
|
95
95
|
```typescript
|
|
96
96
|
const client = createBrowserClient({
|
|
97
97
|
clientKey: string, // Required
|
|
98
|
-
environment?: Environment, // 'local' | 'development' | 'staging' | 'production'
|
|
99
|
-
baseUrl?: string, // Custom API URL (overrides environment)
|
|
100
98
|
})
|
|
101
99
|
```
|
|
102
100
|
|
|
103
|
-
| Option
|
|
104
|
-
|
|
|
105
|
-
| `clientKey`
|
|
106
|
-
| `secretKey`
|
|
107
|
-
|
|
108
|
-
|
|
101
|
+
| Option | Type | Description |
|
|
102
|
+
| ----------- | -------- | ---------------------------- |
|
|
103
|
+
| `clientKey` | `string` | API client key |
|
|
104
|
+
| `secretKey` | `string` | API secret key (server only) |
|
|
105
|
+
|
|
106
|
+
API URL은 환경변수로 오버라이드 가능합니다:
|
|
107
|
+
- `SOFTWARE_API_URL` (서버용) 또는 `NEXT_PUBLIC_SOFTWARE_API_URL` (브라우저용)
|
|
108
|
+
- 미설정 시: dev 빌드(`@dev` 태그)는 `api-dev.01.software`, 정식 릴리즈는 `api.01.software`
|
|
109
109
|
|
|
110
110
|
### Query Builder
|
|
111
111
|
|
package/dist/index.cjs
CHANGED
|
@@ -331,24 +331,12 @@ var createTimeoutError = (message, details, userMessage, suggestion) => new Time
|
|
|
331
331
|
var createUsageLimitError = (message, usage, details, userMessage, suggestion) => new UsageLimitError(message, usage, details, userMessage, suggestion);
|
|
332
332
|
|
|
333
333
|
// src/core/client/types.ts
|
|
334
|
-
|
|
335
|
-
local: "http://localhost:3000",
|
|
336
|
-
development: "https://api-dev.01.software",
|
|
337
|
-
staging: "https://api-stg.01.software",
|
|
338
|
-
production: "https://api.01.software"
|
|
339
|
-
};
|
|
340
|
-
function resolveApiUrl(config) {
|
|
341
|
-
if (config == null ? void 0 : config.baseUrl) {
|
|
342
|
-
return config.baseUrl.replace(/\/$/, "");
|
|
343
|
-
}
|
|
334
|
+
function resolveApiUrl() {
|
|
344
335
|
const envUrl = process.env.SOFTWARE_API_URL || process.env.NEXT_PUBLIC_SOFTWARE_API_URL;
|
|
345
336
|
if (envUrl) {
|
|
346
337
|
return envUrl.replace(/\/$/, "");
|
|
347
338
|
}
|
|
348
|
-
|
|
349
|
-
return API_URLS[config.environment];
|
|
350
|
-
}
|
|
351
|
-
return API_URLS.production;
|
|
339
|
+
return "http://localhost:3000";
|
|
352
340
|
}
|
|
353
341
|
|
|
354
342
|
// src/core/internal/utils/http.ts
|
|
@@ -385,7 +373,7 @@ function httpFetch(url, options) {
|
|
|
385
373
|
secretKey,
|
|
386
374
|
customerToken,
|
|
387
375
|
timeout = DEFAULT_TIMEOUT,
|
|
388
|
-
baseUrl =
|
|
376
|
+
baseUrl = resolveApiUrl(),
|
|
389
377
|
debug,
|
|
390
378
|
retry,
|
|
391
379
|
onUnauthorized
|
|
@@ -1937,7 +1925,7 @@ var BrowserClient = class {
|
|
|
1937
1925
|
throw createConfigError("clientKey is required.");
|
|
1938
1926
|
}
|
|
1939
1927
|
this.config = __spreadValues({}, options);
|
|
1940
|
-
this.baseUrl = resolveApiUrl(
|
|
1928
|
+
this.baseUrl = resolveApiUrl();
|
|
1941
1929
|
const metadata = {
|
|
1942
1930
|
timestamp: Date.now(),
|
|
1943
1931
|
userAgent: typeof window !== "undefined" ? (_a = window.navigator) == null ? void 0 : _a.userAgent : "Node.js"
|
|
@@ -1998,7 +1986,7 @@ var ServerClient = class {
|
|
|
1998
1986
|
throw createConfigError("secretKey is required.");
|
|
1999
1987
|
}
|
|
2000
1988
|
this.config = __spreadValues({}, options);
|
|
2001
|
-
this.baseUrl = resolveApiUrl(
|
|
1989
|
+
this.baseUrl = resolveApiUrl();
|
|
2002
1990
|
const metadata = {
|
|
2003
1991
|
timestamp: Date.now(),
|
|
2004
1992
|
userAgent: "Node.js"
|