@rxbenefits/server-utils 0.2.1 → 0.2.3

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
@@ -1,4 +1,4 @@
1
- # @rxbenefits/server-utils
1
+ # @admin-portal/server-utils
2
2
 
3
3
  Shared server-side utilities for Next.js API routes across all microfrontends.
4
4
 
@@ -30,12 +30,12 @@ Choose the implementation pattern that matches your app architecture:
30
30
 
31
31
  #### Step 1: Add Dependency
32
32
 
33
- Ensure `@rxbenefits/server-utils` is in your `package.json`:
33
+ Ensure `@admin-portal/server-utils` is in your `package.json`:
34
34
 
35
35
  ```json
36
36
  {
37
37
  "dependencies": {
38
- "@rxbenefits/server-utils": "workspace:*"
38
+ "@admin-portal/server-utils": "workspace:*"
39
39
  }
40
40
  }
41
41
  ```
@@ -44,7 +44,7 @@ Ensure `@rxbenefits/server-utils` is in your `package.json`:
44
44
 
45
45
  ```typescript
46
46
  //************************DO NOT EDIT WITHOUT NOTIFYING Sam or Ken **********************************
47
- import { createCallJavaHandler } from '@rxbenefits/server-utils';
47
+ import { createCallJavaHandler } from '@admin-portal/server-utils';
48
48
 
49
49
  import { getAccessToken, withApiAuthRequired, getWafBypassToken } from '../../lib/auth0';
50
50
 
@@ -73,7 +73,7 @@ export const config = {
73
73
 
74
74
  /**
75
75
  * CallJava API route handler
76
- * Uses centralized handler from @rxbenefits/server-utils with automatic:
76
+ * Uses centralized handler from @admin-portal/server-utils with automatic:
77
77
  * - WAF bypass header injection
78
78
  * - Authentication header injection
79
79
  * - Tracing header injection
@@ -117,12 +117,12 @@ export function getWafBypassToken(): string | undefined {
117
117
 
118
118
  #### Step 1: Add Dependency
119
119
 
120
- Ensure `@rxbenefits/server-utils` is in your `package.json`:
120
+ Ensure `@admin-portal/server-utils` is in your `package.json`:
121
121
 
122
122
  ```json
123
123
  {
124
124
  "dependencies": {
125
- "@rxbenefits/server-utils": "workspace:*"
125
+ "@admin-portal/server-utils": "workspace:*"
126
126
  }
127
127
  }
128
128
  ```
@@ -144,7 +144,7 @@ const headers: Record<string, string> = {
144
144
  **After**:
145
145
 
146
146
  ```typescript
147
- import { createBackendHeaders } from '@rxbenefits/server-utils';
147
+ import { createBackendHeaders } from '@admin-portal/server-utils';
148
148
  import { getWafBypassToken } from '@/lib/auth0';
149
149
 
150
150
  const headers: Record<string, string> = createBackendHeaders({
@@ -158,7 +158,7 @@ const headers: Record<string, string> = createBackendHeaders({
158
158
  #### Step 3: Example - apiHandler.ts
159
159
 
160
160
  ```typescript
161
- import { createBackendHeaders } from '@rxbenefits/server-utils';
161
+ import { createBackendHeaders } from '@admin-portal/server-utils';
162
162
  import { NextRequest, NextResponse } from 'next/server';
163
163
 
164
164
  import { apiConfig } from './apiMaps';
@@ -199,7 +199,7 @@ const fetchData = async (
199
199
  #### Step 4: Example - GraphQL Route
200
200
 
201
201
  ```typescript
202
- import { createBackendHeaders } from '@rxbenefits/server-utils';
202
+ import { createBackendHeaders } from '@admin-portal/server-utils';
203
203
 
204
204
  import { getAccessToken, withApiAuthRequired, getWafBypassToken } from '@/lib/auth0';
205
205
  import { NextRequest, NextResponse } from 'next/server';
@@ -380,5 +380,5 @@ All utilities in this package automatically add:
380
380
  This package uses source files directly (no build step required):
381
381
 
382
382
  ```bash
383
- pnpm --filter @rxbenefits/server-utils lint
383
+ pnpm --filter @admin-portal/server-utils lint
384
384
  ```
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@rxbenefits/server-utils",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "private": false,
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
7
+ "scripts": {
8
+ "build": "echo 'Server utils uses source files directly'",
9
+ "lint": "eslint . --ext .ts,.tsx"
10
+ },
7
11
  "dependencies": {
8
12
  "@opentelemetry/api": "^1.9.0",
9
13
  "axios": "^1.7.9",
@@ -14,10 +18,5 @@
14
18
  "devDependencies": {
15
19
  "@types/formidable": "^3.4.5",
16
20
  "@types/node": "^20"
17
- },
18
- "peerDependencies": {},
19
- "scripts": {
20
- "build": "echo 'Server utils uses source files directly'",
21
- "lint": "eslint . --ext .ts,.tsx"
22
21
  }
23
- }
22
+ }
package/src/api-client.ts CHANGED
@@ -3,6 +3,7 @@ import axios, {
3
3
  type AxiosHeaderValue,
4
4
  type AxiosInstance,
5
5
  type AxiosRequestConfig,
6
+
6
7
  } from 'axios';
7
8
 
8
9
  /**
@@ -1,5 +0,0 @@
1
-
2
- > @admin-portal/server-utils@0.0.0 build /Users/dmalone/Documents/GitHub/admin-portal/packages/server-utils
3
- > echo 'Server utils uses source files directly'
4
-
5
- Server utils uses source files directly
@@ -1,5 +0,0 @@
1
-
2
- > @admin-portal/server-utils@0.0.0 lint /Users/dmalone/Documents/GitHub/admin-portal/packages/server-utils
3
- > eslint . --ext .ts,.tsx
4
-
5
- Pages directory cannot be found at /Users/dmalone/Documents/GitHub/admin-portal/packages/server-utils/pages or /Users/dmalone/Documents/GitHub/admin-portal/packages/server-utils/src/pages. If using a custom path, please configure with the `no-html-link-for-pages` rule in your eslint config file.
package/CHANGELOG.md DELETED
@@ -1,7 +0,0 @@
1
- # @rxbenefits/server-utils
2
-
3
- ## 0.2.0
4
-
5
- ### Minor Changes
6
-
7
- - 9f00bc5: Initial publish of shared admin portal packages from the segmented codebase.