spaps-sdk 1.6.4 → 1.6.6

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/CHANGELOG.md CHANGED
@@ -8,6 +8,10 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
8
8
 
9
9
  - No changes yet.
10
10
 
11
+ ## [1.6.5] - 2026-04-05
12
+
13
+ - Docs: align package README metadata with published version.
14
+
11
15
  ## [1.6.3] - 2026-03-29
12
16
 
13
17
  ### Added
package/README.md CHANGED
@@ -1,78 +1,69 @@
1
1
  # spaps-sdk
2
2
 
3
- TypeScript SDK for the Sweet Potato Authentication & Payment Service.
3
+ Typed TypeScript client for SPAPS-compatible APIs.
4
4
 
5
- ## TL;DR
5
+ Examples in this README use placeholders such as `user@example.com`, `admin@example.com`, and `https://api.example.test`. Replace them with values from your own deployment.
6
6
 
7
- **The Problem**: SPAPS consumers need one client that can speak auth, payments, secure messaging, issue reporting, entitlements, and dayrate APIs without rebuilding request plumbing for every app.
8
-
9
- **The Solution**: `spaps-sdk` exposes a typed `SPAPSClient` with source-backed namespaces for the major SPAPS surfaces and a small set of permission helpers for app code.
10
-
11
- ### Why Use `spaps-sdk`?
12
-
13
- | Feature | What It Does |
14
- | --- | --- |
15
- | Zero-config local mode | Point at `localhost` and the SDK automatically treats it as local mode |
16
- | Typed namespaces | Use `auth`, `payments`, `sessions`, `secureMessages`, `issueReporting`, `email`, `entitlements`, `dayrate`, `cfo`, and `admin` from one client |
17
- | Browser and server key support | Configure with `publishableKey`, `secretKey`, or the legacy `apiKey` field |
18
- | Shared contracts | Re-exports many `spaps-types` definitions so apps can stay on one dependency surface |
19
-
20
- ## Metadata
21
-
22
- - `package_name`: `spaps-sdk`
23
- - `latest_version`: `1.6.3`
24
- - `minimum_runtime`: `Node.js >=14.0.0`
25
- - `api_base_url`: `https://api.sweetpotato.dev`
26
-
27
- ## Installation
28
-
29
- ### npm
7
+ ## Install
30
8
 
31
9
  ```bash
32
10
  npm install spaps-sdk
33
11
  ```
34
12
 
35
- ### pnpm
13
+ Alternative package managers:
36
14
 
37
15
  ```bash
38
16
  pnpm add spaps-sdk
17
+ yarn add spaps-sdk
39
18
  ```
40
19
 
41
- ### yarn
20
+ This package targets `Node.js >=14`.
42
21
 
43
- ```bash
44
- yarn add spaps-sdk
45
- ```
22
+ ## When It Fits
23
+
24
+ | Need | Package gives you |
25
+ | --- | --- |
26
+ | One client for many SPAPS surfaces | `auth`, `payments`, `sessions`, `secureMessages`, `issueReporting`, `email`, `entitlements`, `dayrate`, `admin`, and `cfo` namespaces |
27
+ | Local development without extra config | Localhost URLs automatically enable local mode |
28
+ | Browser and server usage | `publishableKey`, `secretKey`, or legacy `apiKey` support |
29
+ | Shared contracts | Re-exports a large slice of `spaps-types` |
46
30
 
47
- ## Quick Example
31
+ ## Quick Start
48
32
 
49
- ```typescript
50
- import { SPAPSClient } from 'spaps-sdk';
33
+ ```ts
34
+ import { SPAPSClient } from "spaps-sdk";
51
35
 
52
36
  const spaps = new SPAPSClient({
53
- apiUrl: 'http://localhost:3301',
37
+ apiUrl: "http://localhost:3301",
38
+ publishableKey: "spaps_pub_example",
54
39
  });
55
40
 
56
- const { data } = await spaps.login('user@example.com', 'password');
57
- console.log('User:', data.user);
41
+ const auth = await spaps.auth.signInWithPassword({
42
+ email: "user@example.com",
43
+ password: "correct-horse-battery-staple",
44
+ });
45
+
46
+ const me = await spaps.getUser();
47
+ const issues = await spaps.issueReporting.list({
48
+ status: "open",
49
+ scope: "mine",
50
+ limit: 20,
51
+ });
58
52
 
59
- if (spaps.isAuthenticated()) {
60
- const me = await spaps.getUser();
61
- console.log(me.data.email);
62
- }
53
+ console.log(auth.user.id, me.data.email, issues.total);
63
54
  ```
64
55
 
65
56
  ## Configuration
66
57
 
67
- Constructor values win over environment variables.
58
+ Constructor values take precedence over environment variables.
68
59
 
69
60
  | Option | Purpose |
70
61
  | --- | --- |
71
- | `apiUrl` | Base API URL. Localhost enables local mode automatically. |
62
+ | `apiUrl` | Base API URL. Localhost values enable local mode automatically |
72
63
  | `publishableKey` | Browser-safe key for client-side usage |
73
- | `secretKey` | Server-side key for full access |
74
- | `apiKey` | Deprecated legacy key field |
75
- | `timeout` | Override request timeout |
64
+ | `secretKey` | Server-side key for privileged access |
65
+ | `apiKey` | Legacy key field kept for compatibility |
66
+ | `timeout` | Request timeout override |
76
67
 
77
68
  Relevant environment variables:
78
69
 
@@ -81,84 +72,72 @@ Relevant environment variables:
81
72
  - `SPAPS_API_KEY`
82
73
  - `NEXT_PUBLIC_SPAPS_API_KEY`
83
74
 
84
- ## Client Surface
75
+ ## Core Surface
85
76
 
86
- | Namespace | What It Covers |
77
+ | Namespace | Covers |
87
78
  | --- | --- |
88
- | `auth` | Password, wallet, magic-link, refresh, and logout flows |
89
- | `payments` | Checkout sessions, products, prices, subscriptions, and crypto payment helpers |
90
- | `sessions` | Current session lookup, validation, revocation, and session lifecycle helpers |
91
- | `secureMessages` | Create and list secure messages |
92
- | `issueReporting` | Status, history, create, edit, and reply issue-report flows |
93
- | `email` | Template lookup, previews, and sends |
79
+ | `auth` | Password, wallet, magic-link, refresh, logout, and password-management flows |
80
+ | `payments` | Checkout sessions, products, prices, subscriptions, and crypto helpers |
81
+ | `sessions` | Session lookup, validation, and lifecycle helpers |
82
+ | `secureMessages` | Secure-message create/list helpers |
83
+ | `issueReporting` | Status, history, create, update, and reply flows |
84
+ | `email` | Template lookup, preview, and send helpers |
94
85
  | `entitlements` | User and resource entitlement queries |
95
86
  | `dayrate` | Availability and booking helpers |
96
87
  | `admin` | Product and pricing admin helpers |
97
- | `cfo` | CFO-specific endpoints |
88
+ | `cfo` | CFO-facing reporting endpoints |
98
89
 
99
- ## Common Flows
90
+ ## Common Patterns
100
91
 
101
- ### Typed Secure Messaging
92
+ ### Typed Secure Messages
102
93
 
103
- ```typescript
104
- type SecureMessageMetadata = { urgency: 'low' | 'high'; tags?: string[] };
94
+ ```ts
95
+ type SecureMessageMetadata = { urgency: "low" | "high"; tags?: string[] };
105
96
 
106
97
  const spaps = new SPAPSClient<SecureMessageMetadata>({
107
- apiUrl: 'https://api.sweetpotato.dev',
98
+ apiUrl: "https://api.example.test",
108
99
  secretKey: process.env.SPAPS_API_KEY,
109
100
  });
110
101
 
111
102
  await spaps.secureMessages.create({
112
- patientId: '3d6f0a51-8d77-4b38-8248-2d1b2f1f6c7f',
113
- practitionerId: 'a3d7f431-6c9d-4cbc-9f78-4e5b6a7c8d9e',
114
- content: 'Follow up scheduled for next week.',
115
- metadata: { urgency: 'low', tags: ['follow-up'] },
103
+ patientId: "3d6f0a51-8d77-4b38-8248-2d1b2f1f6c7f",
104
+ practitionerId: "a3d7f431-6c9d-4cbc-9f78-4e5b6a7c8d9e",
105
+ content: "Follow up scheduled for next week.",
106
+ metadata: { urgency: "low", tags: ["follow-up"] },
116
107
  });
117
108
  ```
118
109
 
119
- ### Shared Issue Reporting
120
-
121
- ```typescript
122
- spaps.setAccessToken('jwt-token');
123
-
124
- const summary = await spaps.issueReporting.getStatus();
125
- const history = await spaps.issueReporting.list({ status: 'open' });
126
-
127
- if (!summary.has_open && history.total === 0) {
128
- await spaps.issueReporting.create({
129
- target: {
130
- component_key: 'patient_protocol_widget',
131
- component_label: 'Patient Protocol Widget',
132
- page_url: '/patients/123/protocol',
133
- metadata: { section: 'daily log' },
134
- },
135
- note: 'The save action silently fails after I edit today.',
136
- reporter_role_hint: 'practitioner',
137
- });
138
- }
139
- ```
110
+ ### Permission Helpers With Explicit Admin Config
140
111
 
141
- ### Permission Utilities
112
+ ```ts
113
+ import {
114
+ canAccessAdmin,
115
+ createPermissionChecker,
116
+ isAdminAccount,
117
+ } from "spaps-sdk";
142
118
 
143
- ```typescript
144
- import { canAccessAdmin, getUserRole, isAdminAccount } from 'spaps-sdk';
119
+ const customAdmins = ["admin@example.com"];
120
+ const checker = createPermissionChecker(customAdmins);
145
121
 
146
- const role = getUserRole('user@example.com');
147
- const adminCheck = canAccessAdmin({ id: 'user_123', email: 'buildooor@gmail.com' });
148
- const isAdmin = isAdminAccount('buildooor@gmail.com');
122
+ const role = checker.getRole("staff@example.com");
123
+ const adminCheck = canAccessAdmin(
124
+ { id: "user_123", email: "admin@example.com" },
125
+ customAdmins,
126
+ );
127
+ const isAdmin = isAdminAccount("admin@example.com", customAdmins);
149
128
 
150
129
  console.log(role, adminCheck.allowed, isAdmin);
151
130
  ```
152
131
 
153
- ### Helper Methods
132
+ ### Convenience Helpers
154
133
 
155
- ```typescript
156
- const spaps = new SPAPSClient({ apiUrl: 'http://localhost:3301' });
134
+ ```ts
135
+ const spaps = new SPAPSClient({ apiUrl: "http://localhost:3301" });
157
136
 
158
137
  spaps.isLocalMode();
159
138
  spaps.isAuthenticated();
160
139
  spaps.getAccessToken();
161
- spaps.setAccessToken('token');
140
+ spaps.setAccessToken("token");
162
141
  await spaps.health();
163
142
  ```
164
143
 
@@ -177,41 +156,41 @@ npm run test
177
156
 
178
157
  ### `401 Unauthorized`
179
158
 
180
- Check the access token and key configuration for the environment you are targeting.
159
+ Check the access token, API key choice, and target environment. Browser apps should generally use `publishableKey`, not a server secret.
181
160
 
182
161
  ### Local mode is not activating
183
162
 
184
- Use a localhost URL such as `http://localhost:3301`, or call `spaps.isLocalMode()` to confirm how the SDK resolved the environment.
163
+ Use a localhost URL such as `http://localhost:3301`, then confirm with `spaps.isLocalMode()`.
185
164
 
186
- ### Browser app needs limited access
165
+ ### I need shared types in app code
187
166
 
188
- Use `publishableKey` instead of a server-side secret key.
167
+ Import them from `spaps-sdk` if the re-export exists, or install `spaps-types` directly for a narrower dependency.
189
168
 
190
169
  ## Limitations
191
170
 
192
- - The SDK wraps the current SPAPS surface; it is not an exhaustive code-generated client for every backend route.
171
+ - The SDK is handwritten around the current SPAPS surface. It is not a generated client for every backend route.
193
172
  - Some admin and entitlement flows still depend on upstream permissions and token context.
194
- - The legacy `apiKey` constructor field still exists for compatibility, but new integrations should prefer the explicit key fields.
173
+ - The legacy `apiKey` field remains for compatibility, but new integrations should prefer `publishableKey` or `secretKey`.
195
174
 
196
175
  ## FAQ
197
176
 
198
177
  ### Does this work in browsers?
199
178
 
200
- Yes. The package is designed for both browser and server-side usage.
179
+ Yes. The package is intended for both browser and server use.
201
180
 
202
- ### Does it include fetch polyfills?
181
+ ### Does it include a fetch polyfill?
203
182
 
204
- Yes. It loads `cross-fetch/polyfill` when `fetch` is unavailable.
183
+ Yes. It loads `cross-fetch/polyfill` when `fetch` is missing.
205
184
 
206
- ### Can I use it without TypeScript?
185
+ ### Can I use it from plain JavaScript?
207
186
 
208
- Yes. The runtime works in JavaScript projects and ships bundled type declarations for TS users.
187
+ Yes. The runtime works in JavaScript projects and ships bundled type declarations for TypeScript users.
209
188
 
210
189
  ### Does it re-export shared types?
211
190
 
212
191
  Yes. Many `spaps-types` exports are re-exported for convenience.
213
192
 
214
- ### How do I validate README-related examples?
193
+ ### How do I validate the README snippets?
215
194
 
216
195
  Run:
217
196
 
@@ -220,9 +199,16 @@ npm run typecheck:readme
220
199
  npm run test:readme
221
200
  ```
222
201
 
202
+ ## Metadata
203
+
204
+ - `package_name`: `spaps-sdk`
205
+ - `latest_version`: `1.6.5`
206
+ - `minimum_runtime`: `Node.js >=14.0.0`
207
+ - `api_base_url`: `https://api.sweetpotato.dev`
208
+
223
209
  ## About Contributions
224
210
 
225
- *About Contributions:* Please don't take this the wrong way, but I do not accept outside contributions for any of my projects. I simply don't have the mental bandwidth to review anything, and it's my name on the thing, so I'm responsible for any problems it causes; thus, the risk-reward is highly asymmetric from my perspective. I'd also have to worry about other "stakeholders," which seems unwise for tools I mostly make for myself for free. Feel free to submit issues, and even PRs if you want to illustrate a proposed fix, but know I won't merge them directly. Instead, I'll have Claude or Codex review submissions via `gh` and independently decide whether and how to address them. Bug reports in particular are welcome. Sorry if this offends, but I want to avoid wasted time and hurt feelings. I understand this isn't in sync with the prevailing open-source ethos that seeks community contributions, but it's the only way I can move at this velocity and keep my sanity.
211
+ > *About Contributions:* Please don't take this the wrong way, but I do not accept outside contributions for any of my projects. I simply don't have the mental bandwidth to review anything, and it's my name on the thing, so I'm responsible for any problems it causes; thus, the risk-reward is highly asymmetric from my perspective. I'd also have to worry about other "stakeholders," which seems unwise for tools I mostly make for myself for free. Feel free to submit issues, and even PRs if you want to illustrate a proposed fix, but know I won't merge them directly. Instead, I'll have Claude or Codex review submissions via `gh` and independently decide whether and how to address them. Bug reports in particular are welcome. Sorry if this offends, but I want to avoid wasted time and hurt feelings. I understand this isn't in sync with the prevailing open-source ethos that seeks community contributions, but it's the only way I can move at this velocity and keep my sanity.
226
212
 
227
213
  ## License
228
214
 
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as spaps_types from 'spaps-types';
2
- import { ResourceType, Entitlement, CreateProductRequest, Product, UpdateProductRequest, CreatePriceRequest, Price, ProductSyncResult, CryptoReconcileRequest, CreateSecureMessageRequest, SecureMessage, IssueReportStatusResult, IssueReportStatus, IssueReportListResult, IssueReport, CreateIssueReportRequest, UpdateIssueReportRequest, ReplyIssueReportRequest, AuthResponse, User as User$1, CreateCryptoInvoiceRequest, CryptoInvoiceStatusSnapshot, CheckoutSession, DayrateAvailabilityResponse, DayrateBookingRequest, DayrateBookingResponse, DayrateMultiBookingRequest, DayrateMultiBookingResponse, Subscription, UsageBalance, VerifyCryptoWebhookSignatureOptions } from 'spaps-types';
2
+ import { ResourceType, Entitlement, CreateProductRequest, Product, UpdateProductRequest, CreatePriceRequest, Price, ProductSyncResult, CryptoReconcileRequest, CreateSecureMessageRequest, SecureMessage, IssueReportScope, IssueReportStatusResult, IssueReportStatus, IssueReportListResult, IssueReport, CreateIssueReportRequest, UpdateIssueReportRequest, ReplyIssueReportRequest, AuthResponse, User as User$1, CreateCryptoInvoiceRequest, CryptoInvoiceStatusSnapshot, CheckoutSession, DayrateAvailabilityResponse, DayrateBookingRequest, DayrateBookingResponse, DayrateMultiBookingRequest, DayrateMultiBookingResponse, Subscription, UsageBalance, VerifyCryptoWebhookSignatureOptions } from 'spaps-types';
3
3
  export { AdminPermission, AdminRole, AdminUser, ApiResponse, AuthResponse, CheckoutSession, CreateCryptoInvoiceRequest, CreateIssueReportRequest, CreatePriceRequest, CreateProductRequest, CreateSecureMessageInput, CreateSecureMessageRequest, CryptoInvoice, CryptoInvoiceResponse, CryptoInvoiceStatusSnapshot, CryptoReconcileRequest, DayrateAvailabilityResponse, DayrateAvailableSlot, DayrateBookingRequest, DayrateBookingResponse, DayrateDayOfWeek, DayrateMultiBookingRequest, DayrateMultiBookingResponse, DayratePriceBreakdown, DayrateSlotType, Entitlement, IssueReport, IssueReportListResult, IssueReportStatus, IssueReportStatusResult, IssueReportTarget, LinkedIssueReportCase, Price, Product, ProductSyncResult, ReplyIssueReportRequest, ResourceType, SecureMessage, SecureMessageOutput, Subscription, TokenPair, UpdateIssueReportRequest, UpdateProductRequest, UsageBalance, User, UserProfile, UserRole, UserWallet, VerifyCryptoWebhookSignatureOptions, createSecureMessageRequestSchema, secureMessageMetadataSchema, secureMessageSchema } from 'spaps-types';
4
4
 
5
5
  /**
@@ -346,9 +346,13 @@ interface EntitlementCheckResult {
346
346
  }
347
347
  interface IssueReportListParams {
348
348
  status?: IssueReportStatus;
349
+ scope?: IssueReportScope;
349
350
  limit?: number;
350
351
  offset?: number;
351
352
  }
353
+ interface IssueReportStatusParams {
354
+ scope?: IssueReportScope;
355
+ }
352
356
 
353
357
  declare class SPAPSClient<SecureMessageMetadata extends Record<string, any> = Record<string, any>> {
354
358
  private client;
@@ -441,7 +445,7 @@ declare class SPAPSClient<SecureMessageMetadata extends Record<string, any> = Re
441
445
  /**
442
446
  * Return canonical issue-report summary for the shared floating entrypoint.
443
447
  */
444
- getStatus: () => Promise<IssueReportStatusResult>;
448
+ getStatus: (params?: IssueReportStatusParams) => Promise<IssueReportStatusResult>;
445
449
  /**
446
450
  * List the caller's issue reports inside the active application scope.
447
451
  */
@@ -929,4 +933,4 @@ declare function createServerClient(secretKey: string, options?: Omit<SPAPSConfi
929
933
  */
930
934
  declare function detectKeyType(key: string): ApiKeyType | null;
931
935
 
932
- export { type AdminConfig, type ApiKeyType, type CheckoutLineItem, type CheckoutLineItemPriceData, type CreateCheckoutSessionPayload, DEFAULT_ADMIN_ACCOUNTS, type EmailSendOptions, type EmailSendResult, type EmailTemplate, type EmailTemplatePreview, type EntitlementCheckResult, type EntitlementListParams, type FeatureContext, type FeatureDefinition, FeatureEvaluator, type IssueReportListParams, type PermissionCheckResult, PermissionChecker, RoleHierarchy, SPAPSClient as SPAPS, SPAPSClient, type SPAPSConfig, type TemplateVariable, TokenManager, WalletUtils, WebSocketAuthHelper, type WebSocketAuthHelperConfig, canAccessAdmin, createBrowserClient, createPermissionChecker, createServerClient, SPAPSClient as default, defaultPermissionChecker, detectKeyType, getRoleAwareErrorMessage, getUserDisplay, getUserRole, hasPermission, isAdminAccount, verifyCryptoWebhookSignature };
936
+ export { type AdminConfig, type ApiKeyType, type CheckoutLineItem, type CheckoutLineItemPriceData, type CreateCheckoutSessionPayload, DEFAULT_ADMIN_ACCOUNTS, type EmailSendOptions, type EmailSendResult, type EmailTemplate, type EmailTemplatePreview, type EntitlementCheckResult, type EntitlementListParams, type FeatureContext, type FeatureDefinition, FeatureEvaluator, type IssueReportListParams, type IssueReportStatusParams, type PermissionCheckResult, PermissionChecker, RoleHierarchy, SPAPSClient as SPAPS, SPAPSClient, type SPAPSConfig, type TemplateVariable, TokenManager, WalletUtils, WebSocketAuthHelper, type WebSocketAuthHelperConfig, canAccessAdmin, createBrowserClient, createPermissionChecker, createServerClient, SPAPSClient as default, defaultPermissionChecker, detectKeyType, getRoleAwareErrorMessage, getUserDisplay, getUserRole, hasPermission, isAdminAccount, verifyCryptoWebhookSignature };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as spaps_types from 'spaps-types';
2
- import { ResourceType, Entitlement, CreateProductRequest, Product, UpdateProductRequest, CreatePriceRequest, Price, ProductSyncResult, CryptoReconcileRequest, CreateSecureMessageRequest, SecureMessage, IssueReportStatusResult, IssueReportStatus, IssueReportListResult, IssueReport, CreateIssueReportRequest, UpdateIssueReportRequest, ReplyIssueReportRequest, AuthResponse, User as User$1, CreateCryptoInvoiceRequest, CryptoInvoiceStatusSnapshot, CheckoutSession, DayrateAvailabilityResponse, DayrateBookingRequest, DayrateBookingResponse, DayrateMultiBookingRequest, DayrateMultiBookingResponse, Subscription, UsageBalance, VerifyCryptoWebhookSignatureOptions } from 'spaps-types';
2
+ import { ResourceType, Entitlement, CreateProductRequest, Product, UpdateProductRequest, CreatePriceRequest, Price, ProductSyncResult, CryptoReconcileRequest, CreateSecureMessageRequest, SecureMessage, IssueReportScope, IssueReportStatusResult, IssueReportStatus, IssueReportListResult, IssueReport, CreateIssueReportRequest, UpdateIssueReportRequest, ReplyIssueReportRequest, AuthResponse, User as User$1, CreateCryptoInvoiceRequest, CryptoInvoiceStatusSnapshot, CheckoutSession, DayrateAvailabilityResponse, DayrateBookingRequest, DayrateBookingResponse, DayrateMultiBookingRequest, DayrateMultiBookingResponse, Subscription, UsageBalance, VerifyCryptoWebhookSignatureOptions } from 'spaps-types';
3
3
  export { AdminPermission, AdminRole, AdminUser, ApiResponse, AuthResponse, CheckoutSession, CreateCryptoInvoiceRequest, CreateIssueReportRequest, CreatePriceRequest, CreateProductRequest, CreateSecureMessageInput, CreateSecureMessageRequest, CryptoInvoice, CryptoInvoiceResponse, CryptoInvoiceStatusSnapshot, CryptoReconcileRequest, DayrateAvailabilityResponse, DayrateAvailableSlot, DayrateBookingRequest, DayrateBookingResponse, DayrateDayOfWeek, DayrateMultiBookingRequest, DayrateMultiBookingResponse, DayratePriceBreakdown, DayrateSlotType, Entitlement, IssueReport, IssueReportListResult, IssueReportStatus, IssueReportStatusResult, IssueReportTarget, LinkedIssueReportCase, Price, Product, ProductSyncResult, ReplyIssueReportRequest, ResourceType, SecureMessage, SecureMessageOutput, Subscription, TokenPair, UpdateIssueReportRequest, UpdateProductRequest, UsageBalance, User, UserProfile, UserRole, UserWallet, VerifyCryptoWebhookSignatureOptions, createSecureMessageRequestSchema, secureMessageMetadataSchema, secureMessageSchema } from 'spaps-types';
4
4
 
5
5
  /**
@@ -346,9 +346,13 @@ interface EntitlementCheckResult {
346
346
  }
347
347
  interface IssueReportListParams {
348
348
  status?: IssueReportStatus;
349
+ scope?: IssueReportScope;
349
350
  limit?: number;
350
351
  offset?: number;
351
352
  }
353
+ interface IssueReportStatusParams {
354
+ scope?: IssueReportScope;
355
+ }
352
356
 
353
357
  declare class SPAPSClient<SecureMessageMetadata extends Record<string, any> = Record<string, any>> {
354
358
  private client;
@@ -441,7 +445,7 @@ declare class SPAPSClient<SecureMessageMetadata extends Record<string, any> = Re
441
445
  /**
442
446
  * Return canonical issue-report summary for the shared floating entrypoint.
443
447
  */
444
- getStatus: () => Promise<IssueReportStatusResult>;
448
+ getStatus: (params?: IssueReportStatusParams) => Promise<IssueReportStatusResult>;
445
449
  /**
446
450
  * List the caller's issue reports inside the active application scope.
447
451
  */
@@ -929,4 +933,4 @@ declare function createServerClient(secretKey: string, options?: Omit<SPAPSConfi
929
933
  */
930
934
  declare function detectKeyType(key: string): ApiKeyType | null;
931
935
 
932
- export { type AdminConfig, type ApiKeyType, type CheckoutLineItem, type CheckoutLineItemPriceData, type CreateCheckoutSessionPayload, DEFAULT_ADMIN_ACCOUNTS, type EmailSendOptions, type EmailSendResult, type EmailTemplate, type EmailTemplatePreview, type EntitlementCheckResult, type EntitlementListParams, type FeatureContext, type FeatureDefinition, FeatureEvaluator, type IssueReportListParams, type PermissionCheckResult, PermissionChecker, RoleHierarchy, SPAPSClient as SPAPS, SPAPSClient, type SPAPSConfig, type TemplateVariable, TokenManager, WalletUtils, WebSocketAuthHelper, type WebSocketAuthHelperConfig, canAccessAdmin, createBrowserClient, createPermissionChecker, createServerClient, SPAPSClient as default, defaultPermissionChecker, detectKeyType, getRoleAwareErrorMessage, getUserDisplay, getUserRole, hasPermission, isAdminAccount, verifyCryptoWebhookSignature };
936
+ export { type AdminConfig, type ApiKeyType, type CheckoutLineItem, type CheckoutLineItemPriceData, type CreateCheckoutSessionPayload, DEFAULT_ADMIN_ACCOUNTS, type EmailSendOptions, type EmailSendResult, type EmailTemplate, type EmailTemplatePreview, type EntitlementCheckResult, type EntitlementListParams, type FeatureContext, type FeatureDefinition, FeatureEvaluator, type IssueReportListParams, type IssueReportStatusParams, type PermissionCheckResult, PermissionChecker, RoleHierarchy, SPAPSClient as SPAPS, SPAPSClient, type SPAPSConfig, type TemplateVariable, TokenManager, WalletUtils, WebSocketAuthHelper, type WebSocketAuthHelperConfig, canAccessAdmin, createBrowserClient, createPermissionChecker, createServerClient, SPAPSClient as default, defaultPermissionChecker, detectKeyType, getRoleAwareErrorMessage, getUserDisplay, getUserRole, hasPermission, isAdminAccount, verifyCryptoWebhookSignature };
package/dist/index.js CHANGED
@@ -637,9 +637,12 @@ var SPAPSClient = class {
637
637
  /**
638
638
  * Return canonical issue-report summary for the shared floating entrypoint.
639
639
  */
640
- getStatus: async () => {
640
+ getStatus: async (params) => {
641
+ const q = new URLSearchParams();
642
+ if (params?.scope) q.append("scope", params.scope);
643
+ const qs = q.toString();
641
644
  const res = await this.client.get(
642
- "/api/v1/issue-reports/status",
645
+ `/api/v1/issue-reports/status${qs ? `?${qs}` : ""}`,
643
646
  this.accessToken ? { headers: { Authorization: `Bearer ${this.accessToken}` } } : void 0
644
647
  );
645
648
  return this.unwrapApiResponse(res, "Failed to get issue report status");
@@ -650,6 +653,7 @@ var SPAPSClient = class {
650
653
  list: async (params) => {
651
654
  const q = new URLSearchParams();
652
655
  if (params?.status) q.append("status", params.status);
656
+ if (params?.scope) q.append("scope", params.scope);
653
657
  if (params?.limit !== void 0) q.append("limit", String(params.limit));
654
658
  if (params?.offset !== void 0) q.append("offset", String(params.offset));
655
659
  const qs = q.toString();
package/dist/index.mjs CHANGED
@@ -607,9 +607,12 @@ var SPAPSClient = class {
607
607
  /**
608
608
  * Return canonical issue-report summary for the shared floating entrypoint.
609
609
  */
610
- getStatus: async () => {
610
+ getStatus: async (params) => {
611
+ const q = new URLSearchParams();
612
+ if (params?.scope) q.append("scope", params.scope);
613
+ const qs = q.toString();
611
614
  const res = await this.client.get(
612
- "/api/v1/issue-reports/status",
615
+ `/api/v1/issue-reports/status${qs ? `?${qs}` : ""}`,
613
616
  this.accessToken ? { headers: { Authorization: `Bearer ${this.accessToken}` } } : void 0
614
617
  );
615
618
  return this.unwrapApiResponse(res, "Failed to get issue report status");
@@ -620,6 +623,7 @@ var SPAPSClient = class {
620
623
  list: async (params) => {
621
624
  const q = new URLSearchParams();
622
625
  if (params?.status) q.append("status", params.status);
626
+ if (params?.scope) q.append("scope", params.scope);
623
627
  if (params?.limit !== void 0) q.append("limit", String(params.limit));
624
628
  if (params?.offset !== void 0) q.append("offset", String(params.offset));
625
629
  const qs = q.toString();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spaps-sdk",
3
- "version": "1.6.4",
3
+ "version": "1.6.6",
4
4
  "description": "Sweet Potato Authentication & Payment Service SDK - Zero-config client with built-in permission checking, role-based access control, and dayrate scheduling",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -50,7 +50,7 @@
50
50
  "dependencies": {
51
51
  "axios": "^1.6.0",
52
52
  "cross-fetch": "^4.0.0",
53
- "spaps-types": "^1.1.1"
53
+ "spaps-types": "^1.1.2"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/node": "^20.10.0",