@dr-sentry/sdk 1.0.0 → 1.0.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 CHANGED
@@ -5,13 +5,13 @@ Official Node.js/TypeScript SDK for integrating with the DeploySentry platform.
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install @deploysentry/sdk
8
+ npm install @dr-sentry/sdk
9
9
  ```
10
10
 
11
11
  ## Quick Start
12
12
 
13
13
  ```typescript
14
- import { DeploySentryClient } from '@deploysentry/sdk';
14
+ import { DeploySentryClient } from '@dr-sentry/sdk';
15
15
 
16
16
  const client = new DeploySentryClient({
17
17
  apiKey: 'ds_live_xxx',
@@ -1,9 +1,9 @@
1
1
  /**
2
- * @deploysentry/sdk – Official Node.js/TypeScript SDK for DeploySentry.
2
+ * @dr-sentry/sdk – Official Node.js/TypeScript SDK for DeploySentry.
3
3
  *
4
4
  * @example
5
5
  * ```ts
6
- * import { DeploySentryClient } from '@deploysentry/sdk';
6
+ * import { DeploySentryClient } from '@dr-sentry/sdk';
7
7
  *
8
8
  * const client = new DeploySentryClient({
9
9
  * apiKey: 'ds_live_xxx',
package/dist/cjs/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  /**
3
- * @deploysentry/sdk – Official Node.js/TypeScript SDK for DeploySentry.
3
+ * @dr-sentry/sdk – Official Node.js/TypeScript SDK for DeploySentry.
4
4
  *
5
5
  * @example
6
6
  * ```ts
7
- * import { DeploySentryClient } from '@deploysentry/sdk';
7
+ * import { DeploySentryClient } from '@dr-sentry/sdk';
8
8
  *
9
9
  * const client = new DeploySentryClient({
10
10
  * apiKey: 'ds_live_xxx',
@@ -1,4 +1,4 @@
1
- import { Flag } from './types';
1
+ import { Flag } from './types.js';
2
2
  /**
3
3
  * In-memory flag cache with per-entry TTL support.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { ClientOptions, EvaluationContext, EvaluationResult, Flag, FlagCategory } from './types';
1
+ import { ClientOptions, EvaluationContext, EvaluationResult, Flag, FlagCategory } from './types.js';
2
2
  /**
3
3
  * DeploySentry feature-flag client.
4
4
  *
@@ -1,7 +1,7 @@
1
- import { FlagCache } from './cache';
2
- import { FlagStreamClient } from './streaming';
3
- import { loadFlagConfig } from './file-loader';
4
- import { evaluateLocal } from './local-evaluator';
1
+ import { FlagCache } from './cache.js';
2
+ import { FlagStreamClient } from './streaming.js';
3
+ import { loadFlagConfig } from './file-loader.js';
4
+ import { evaluateLocal } from './local-evaluator.js';
5
5
  const DEFAULT_BASE_URL = 'https://api.dr-sentry.com';
6
6
  const DEFAULT_CACHE_TIMEOUT_MS = 60_000;
7
7
  /**
@@ -1,3 +1,3 @@
1
- import type { FlagConfig } from './types';
1
+ import type { FlagConfig } from './types.js';
2
2
  export declare function loadFlagConfig(filePath?: string): FlagConfig;
3
3
  //# sourceMappingURL=file-loader.d.ts.map
@@ -1,9 +1,9 @@
1
1
  /**
2
- * @deploysentry/sdk – Official Node.js/TypeScript SDK for DeploySentry.
2
+ * @dr-sentry/sdk – Official Node.js/TypeScript SDK for DeploySentry.
3
3
  *
4
4
  * @example
5
5
  * ```ts
6
- * import { DeploySentryClient } from '@deploysentry/sdk';
6
+ * import { DeploySentryClient } from '@dr-sentry/sdk';
7
7
  *
8
8
  * const client = new DeploySentryClient({
9
9
  * apiKey: 'ds_live_xxx',
@@ -20,10 +20,10 @@
20
20
  *
21
21
  * @packageDocumentation
22
22
  */
23
- export { DeploySentryClient } from './client';
24
- export { FlagCache } from './cache';
25
- export { FlagStreamClient } from './streaming';
26
- export { loadFlagConfig } from './file-loader';
27
- export { evaluateLocal } from './local-evaluator';
28
- export type { ClientOptions, EvaluationContext, EvaluationResult, Flag, FlagCategory, FlagMetadata, FlagConfig, FlagConfigFlag, FlagConfigRule, FlagConfigEnvironment, ApiError, } from './types';
23
+ export { DeploySentryClient } from './client.js';
24
+ export { FlagCache } from './cache.js';
25
+ export { FlagStreamClient } from './streaming.js';
26
+ export { loadFlagConfig } from './file-loader.js';
27
+ export { evaluateLocal } from './local-evaluator.js';
28
+ export type { ClientOptions, EvaluationContext, EvaluationResult, Flag, FlagCategory, FlagMetadata, FlagConfig, FlagConfigFlag, FlagConfigRule, FlagConfigEnvironment, ApiError, } from './types.js';
29
29
  //# sourceMappingURL=index.d.ts.map
package/dist/esm/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
- * @deploysentry/sdk – Official Node.js/TypeScript SDK for DeploySentry.
2
+ * @dr-sentry/sdk – Official Node.js/TypeScript SDK for DeploySentry.
3
3
  *
4
4
  * @example
5
5
  * ```ts
6
- * import { DeploySentryClient } from '@deploysentry/sdk';
6
+ * import { DeploySentryClient } from '@dr-sentry/sdk';
7
7
  *
8
8
  * const client = new DeploySentryClient({
9
9
  * apiKey: 'ds_live_xxx',
@@ -20,9 +20,9 @@
20
20
  *
21
21
  * @packageDocumentation
22
22
  */
23
- export { DeploySentryClient } from './client';
24
- export { FlagCache } from './cache';
25
- export { FlagStreamClient } from './streaming';
26
- export { loadFlagConfig } from './file-loader';
27
- export { evaluateLocal } from './local-evaluator';
23
+ export { DeploySentryClient } from './client.js';
24
+ export { FlagCache } from './cache.js';
25
+ export { FlagStreamClient } from './streaming.js';
26
+ export { loadFlagConfig } from './file-loader.js';
27
+ export { evaluateLocal } from './local-evaluator.js';
28
28
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import type { EvaluationContext, FlagConfig } from './types';
1
+ import type { EvaluationContext, FlagConfig } from './types.js';
2
2
  export declare function evaluateLocal(config: FlagConfig, environment: string, key: string, context?: EvaluationContext): {
3
3
  value: string;
4
4
  reason: string;
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -1,4 +1,4 @@
1
- import { Flag } from './types';
1
+ import { Flag } from './types.js';
2
2
  /** Callback invoked whenever a flag update arrives over SSE. */
3
3
  export type FlagUpdateHandler = (flags: Flag[]) => void;
4
4
  /** Callback invoked when the SSE connection encounters an error. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dr-sentry/sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Official Node.js SDK for the DeploySentry platform – feature flag evaluation with rich metadata",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -21,10 +21,11 @@
21
21
  "dist"
22
22
  ],
23
23
  "scripts": {
24
- "build": "npm run build:esm && npm run build:cjs && npm run build:cjs-package-json",
24
+ "build": "npm run build:esm && npm run build:cjs && npm run build:cjs-package-json && npm run fix-esm-imports",
25
25
  "build:esm": "tsc -p tsconfig.esm.json",
26
+ "fix-esm-imports": "node -e \"const fs=require('fs'),path=require('path'),dir='dist/esm';fs.readdirSync(dir).filter(f=>f.endsWith('.js')||f.endsWith('.d.ts')).forEach(f=>{const p=path.join(dir,f);let s=fs.readFileSync(p,'utf8');s=s.replace(/(from\\s+['\\\"])(\\.\\/.+?)(?=['\\\"])/g,(m,pre,spec)=>spec.endsWith('.js')?m:pre+spec+'.js');fs.writeFileSync(p,s)})\"",
26
27
  "build:cjs": "tsc -p tsconfig.cjs.json",
27
- "build:cjs-package-json": "node -e \"require('fs').writeFileSync('dist/cjs/package.json', JSON.stringify({type:'commonjs'}))\"",
28
+ "build:cjs-package-json": "node -e \"require('fs').writeFileSync('dist/cjs/package.json', JSON.stringify({type:'commonjs'}));require('fs').writeFileSync('dist/esm/package.json', JSON.stringify({type:'module'}))\"",
28
29
  "clean": "rm -rf dist",
29
30
  "test": "jest",
30
31
  "lint": "eslint src/",