@nextplus/js-sdk 0.0.5 → 0.0.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/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
- import { A as AllServices } from './index-Dz0aDLqE.cjs';
1
+ import { A as AllServiceTypes } from './index-DnDzRLml.cjs';
2
2
  import './sdk.gen-CPR3KdM-.cjs';
3
3
  import './types.gen-vDP9AbtO.cjs';
4
4
 
5
5
  type ServiceStatics = {
6
- [K in keyof typeof AllServices as K extends `${string}Service` ? K : never]: typeof AllServices[K];
6
+ [K in keyof typeof AllServiceTypes as K extends `${string}Service` ? K : never]: typeof AllServiceTypes[K];
7
7
  };
8
8
  declare class NextPlusSDK {
9
9
  private client;
@@ -26,19 +26,20 @@ declare class NextPlusSDK {
26
26
  }
27
27
  interface NextPlusSDK extends ServiceStatics {
28
28
  }
29
+ type SDKInstance = NextPlusSDK & ServiceStatics;
29
30
  declare const configure: (options: {
30
31
  baseURL: string;
31
32
  email?: string;
32
33
  username?: string;
33
34
  password: string;
34
35
  returnType?: "raw" | "data";
35
- }) => NextPlusSDK;
36
+ }) => SDKInstance;
36
37
  declare const createSDK: (options: {
37
38
  baseURL: string;
38
39
  email?: string;
39
40
  username?: string;
40
41
  password: string;
41
42
  returnType?: "raw" | "data";
42
- }) => NextPlusSDK;
43
+ }) => SDKInstance;
43
44
 
44
- export { NextPlusSDK, configure, createSDK };
45
+ export { NextPlusSDK, type SDKInstance, configure, createSDK };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { A as AllServices } from './index-B0kRliN0.js';
1
+ import { A as AllServiceTypes } from './index-_9HQhd2P.js';
2
2
  import './sdk.gen-D3Q8YKqz.js';
3
3
  import './types.gen-vDP9AbtO.js';
4
4
 
5
5
  type ServiceStatics = {
6
- [K in keyof typeof AllServices as K extends `${string}Service` ? K : never]: typeof AllServices[K];
6
+ [K in keyof typeof AllServiceTypes as K extends `${string}Service` ? K : never]: typeof AllServiceTypes[K];
7
7
  };
8
8
  declare class NextPlusSDK {
9
9
  private client;
@@ -26,19 +26,20 @@ declare class NextPlusSDK {
26
26
  }
27
27
  interface NextPlusSDK extends ServiceStatics {
28
28
  }
29
+ type SDKInstance = NextPlusSDK & ServiceStatics;
29
30
  declare const configure: (options: {
30
31
  baseURL: string;
31
32
  email?: string;
32
33
  username?: string;
33
34
  password: string;
34
35
  returnType?: "raw" | "data";
35
- }) => NextPlusSDK;
36
+ }) => SDKInstance;
36
37
  declare const createSDK: (options: {
37
38
  baseURL: string;
38
39
  email?: string;
39
40
  username?: string;
40
41
  password: string;
41
42
  returnType?: "raw" | "data";
42
- }) => NextPlusSDK;
43
+ }) => SDKInstance;
43
44
 
44
- export { NextPlusSDK, configure, createSDK };
45
+ export { NextPlusSDK, type SDKInstance, configure, createSDK };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextplus/js-sdk",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "generate": "npm run clean && npm run openapi-ts && npm run build",
@@ -11,6 +11,12 @@
11
11
  "openapi-ts": "openapi-ts",
12
12
  "test": "npm run build && node dist/smoke.js"
13
13
  },
14
+ "files": [
15
+ "dist",
16
+ "src",
17
+ "README.md",
18
+ "LICENSE"
19
+ ],
14
20
  "exports": {
15
21
  ".": {
16
22
  "types": "./dist/index.d.ts",
package/src/index.ts CHANGED
@@ -2,6 +2,7 @@ import debug from 'debug';
2
2
  import { createClient } from './sdk/client';
3
3
  import { UserModelService } from './sdk';
4
4
  import * as AllServices from './sdk';
5
+ import type * as AllServiceTypes from './sdk';
5
6
 
6
7
  const log = debug('nextplus:sdk');
7
8
 
@@ -272,20 +273,22 @@ export class NextPlusSDK {
272
273
 
273
274
  // Expose accurate static service method types on the SDK instance for IDE/type safety
274
275
  type ServiceStatics = {
275
- [K in keyof typeof AllServices as K extends `${string}Service` ? K : never]: typeof AllServices[K];
276
+ [K in keyof typeof AllServiceTypes as K extends `${string}Service` ? K : never]: typeof AllServiceTypes[K];
276
277
  };
277
278
 
278
279
  export interface NextPlusSDK extends ServiceStatics {}
279
280
 
280
281
  // Legacy function for backward compatibility
282
+ type SDKInstance = NextPlusSDK & ServiceStatics;
283
+
281
284
  const configure = (options: {
282
285
  baseURL: string;
283
286
  email?: string;
284
287
  username?: string;
285
288
  password: string;
286
289
  returnType?: 'raw' | 'data';
287
- }) => {
288
- return new NextPlusSDK(options);
290
+ }): SDKInstance => {
291
+ return new NextPlusSDK(options) as SDKInstance;
289
292
  };
290
293
 
291
294
  // Create SDK instance
@@ -295,8 +298,9 @@ const createSDK = (options: {
295
298
  username?: string;
296
299
  password: string;
297
300
  returnType?: 'raw' | 'data';
298
- }) => {
299
- return new NextPlusSDK(options);
301
+ }): SDKInstance => {
302
+ return new NextPlusSDK(options) as SDKInstance;
300
303
  };
301
304
 
305
+ export type { SDKInstance };
302
306
  export { configure, createSDK };