@oapiex/sdk-kit 0.1.5 → 0.1.8

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,4 +1,4 @@
1
- import { A as CurrencyCode, C as UserConfig, D as XGenericObject, E as ValidationErrorResponse, O as CountryCode, S as UnifiedResponse, T as ValidationError, _ as OAuth2AuthConfig, a as AuthErrorResponse, b as ResponseStatus, c as BasicAuthConfig, d as CustomAuthConfig, f as Environment, g as NormalPagination, h as InitOptions, i as AuthConfig, k as CountryCodeRestricted, l as BearerAuthConfig, m as HttpMethod, n as AccessValidationResult, o as AuthRequestConfig, p as ErrorResponse, r as ApiKeyAuthConfig, s as AuthResponse, t as AccessValidationConfigUpdate, u as CursorPagination, v as PageInfoMeta, w as UserUrls, x as SuccessResponse, y as Response } from "./index-JjhthUpt.cjs";
1
+ import { A as CountryCodeRestricted, C as UnifiedResponse, D as ValidationErrorResponse, E as ValidationError, O as XGenericObject, S as SuccessResponse, T as UserUrls, _ as NormalPagination, a as AuthErrorResponse, b as Response, c as BasicAuthConfig, d as CustomAuthConfig, f as DebugLevel, g as InitOptions, h as HttpMethod, i as AuthConfig, j as CurrencyCode, k as CountryCode, l as BearerAuthConfig, m as ErrorResponse, n as AccessValidationResult, o as AuthRequestConfig, p as Environment, r as ApiKeyAuthConfig, s as AuthResponse, t as AccessValidationConfigUpdate, u as CursorPagination, v as OAuth2AuthConfig, w as UserConfig, x as ResponseStatus, y as PageInfoMeta } from "./index-BA7Ul1Pi.cjs";
2
2
  import * as axios0 from "axios";
3
3
  import { RawAxiosRequestHeaders } from "axios";
4
4
 
@@ -173,15 +173,15 @@ declare class Builder {
173
173
  //#region src/Core.d.ts
174
174
  declare class Core {
175
175
  static apiClass: typeof BaseApi;
176
- debugLevel: number;
176
+ debugLevel: DebugLevel;
177
177
  /**
178
178
  * Client ID
179
179
  */
180
- private clientId;
180
+ private clientId?;
181
181
  /**
182
182
  * Client Secret
183
183
  */
184
- private clientSecret;
184
+ private clientSecret?;
185
185
  /**
186
186
  * API Environment
187
187
  */
@@ -223,7 +223,7 @@ declare class Core {
223
223
  * @param level
224
224
  * @returns
225
225
  */
226
- debug(level?: number): this;
226
+ debug(level?: DebugLevel): this;
227
227
  /**
228
228
  * Get the current environment
229
229
  *
@@ -233,11 +233,11 @@ declare class Core {
233
233
  /**
234
234
  * Get the configured client identifier.
235
235
  */
236
- getClientId(): string;
236
+ getClientId(): string | undefined;
237
237
  /**
238
238
  * Get the configured client secret.
239
239
  */
240
- getClientSecret(): string;
240
+ getClientSecret(): string | undefined;
241
241
  /**
242
242
  * Get the current shared SDK config.
243
243
  */
@@ -281,6 +281,10 @@ declare class Core {
281
281
  api: BaseApi & InferRuntimeSdkApi<TBundle>;
282
282
  };
283
283
  private static normalizeEnvironment;
284
+ private static normalizeCredential;
285
+ private resolveInitOptionsFromObject;
286
+ private resolveInitOptionsFromArgs;
287
+ private hasConfiguredAuth;
284
288
  private isAuthConfigOrArray;
285
289
  private isAuthConfig;
286
290
  private isConfigUpdate;
@@ -316,7 +320,7 @@ declare class HttpException extends Error {
316
320
  * @param code
317
321
  * @param data
318
322
  */
319
- static fromCode(code: number, data: Required<UnifiedResponse>, parent?: Error): HttpException | BadRequestException | UnauthorizedRequestException | ForbiddenRequestException;
323
+ static fromCode(code: number, data: Required<UnifiedResponse>, parent?: Error): BadRequestException | ForbiddenRequestException | HttpException | UnauthorizedRequestException;
320
324
  }
321
325
  //#endregion
322
326
  //#region src/Apis/BaseApi.d.ts
@@ -568,6 +572,7 @@ declare const buildUrl: (baseUrl: string, ...endpoint: string[]) => string;
568
572
  //#region src/utilities/Manager.d.ts
569
573
  declare const defaultConfig: UserConfig;
570
574
  declare let globalConfig: UserConfig;
575
+ declare const loadUserConfig: (rootDir?: string) => Partial<UserConfig> | null;
571
576
  declare const defineConfig: (config: Partial<UserConfig>) => UserConfig;
572
577
  declare const getConfig: () => UserConfig;
573
578
  declare const resetConfig: () => UserConfig;
@@ -613,4 +618,4 @@ declare class WebhookValidator<Options extends XGenericObject = XGenericObject>
613
618
  };
614
619
  }
615
620
  //#endregion
616
- export { AccessTokenCacheLoader, AccessValidationConfigUpdate, AccessValidationResult, ApiKeyAuthConfig, AuthCacheLoader, AuthConfig, AuthErrorResponse, AuthRequestConfig, AuthResponse, BadRequestException, BaseApi, BasicAuthConfig, BearerAuthConfig, Builder, CachedAccessTokenValue, CachedAuthValue, Core, CountryCode, CountryCodeRestricted, CurrencyCode, CursorPagination, CustomAuthConfig, Environment, ErrorResponse, ForbiddenRequestException, Http, HttpException, HttpMethod, InferRuntimeSdkApi, InitOptions, NormalPagination, OAuth2AuthConfig, PageInfoMeta, Response, ResponseStatus, RuntimeSdkBundle, RuntimeSdkGroupManifest, RuntimeSdkManifest, RuntimeSdkOperationManifest, RuntimeSdkParameterManifest, RuntimeSdkSecurityRequirementManifest, RuntimeSdkSecurityRequirementSchemeManifest, RuntimeSdkSecuritySchemeManifest, SuccessResponse, UnauthorizedRequestException, UnifiedResponse, UserConfig, UserUrls, ValidationError, ValidationErrorResponse, WebhookValidator, XGenericObject, buildUrl, createAccessTokenCache, createAuthCache, createRuntimeApi, createSdk, defaultConfig, defineConfig, getConfig, globalConfig, normalizeValue, resetConfig };
621
+ export { AccessTokenCacheLoader, AccessValidationConfigUpdate, AccessValidationResult, ApiKeyAuthConfig, AuthCacheLoader, AuthConfig, AuthErrorResponse, AuthRequestConfig, AuthResponse, BadRequestException, BaseApi, BasicAuthConfig, BearerAuthConfig, Builder, CachedAccessTokenValue, CachedAuthValue, Core, CountryCode, CountryCodeRestricted, CurrencyCode, CursorPagination, CustomAuthConfig, DebugLevel, Environment, ErrorResponse, ForbiddenRequestException, Http, HttpException, HttpMethod, InferRuntimeSdkApi, InitOptions, NormalPagination, OAuth2AuthConfig, PageInfoMeta, Response, ResponseStatus, RuntimeSdkBundle, RuntimeSdkGroupManifest, RuntimeSdkManifest, RuntimeSdkOperationManifest, RuntimeSdkParameterManifest, RuntimeSdkSecurityRequirementManifest, RuntimeSdkSecurityRequirementSchemeManifest, RuntimeSdkSecuritySchemeManifest, SuccessResponse, UnauthorizedRequestException, UnifiedResponse, UserConfig, UserUrls, ValidationError, ValidationErrorResponse, WebhookValidator, XGenericObject, buildUrl, createAccessTokenCache, createAuthCache, createRuntimeApi, createSdk, defaultConfig, defineConfig, getConfig, globalConfig, loadUserConfig, normalizeValue, resetConfig };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as CurrencyCode, C as UserConfig, D as XGenericObject, E as ValidationErrorResponse, O as CountryCode, S as UnifiedResponse, T as ValidationError, _ as OAuth2AuthConfig, a as AuthErrorResponse, b as ResponseStatus, c as BasicAuthConfig, d as CustomAuthConfig, f as Environment, g as NormalPagination, h as InitOptions, i as AuthConfig, k as CountryCodeRestricted, l as BearerAuthConfig, m as HttpMethod, n as AccessValidationResult, o as AuthRequestConfig, p as ErrorResponse, r as ApiKeyAuthConfig, s as AuthResponse, t as AccessValidationConfigUpdate, u as CursorPagination, v as PageInfoMeta, w as UserUrls, x as SuccessResponse, y as Response } from "./index-DUI9uPJQ.js";
1
+ import { A as CountryCodeRestricted, C as UnifiedResponse, D as ValidationErrorResponse, E as ValidationError, O as XGenericObject, S as SuccessResponse, T as UserUrls, _ as NormalPagination, a as AuthErrorResponse, b as Response, c as BasicAuthConfig, d as CustomAuthConfig, f as DebugLevel, g as InitOptions, h as HttpMethod, i as AuthConfig, j as CurrencyCode, k as CountryCode, l as BearerAuthConfig, m as ErrorResponse, n as AccessValidationResult, o as AuthRequestConfig, p as Environment, r as ApiKeyAuthConfig, s as AuthResponse, t as AccessValidationConfigUpdate, u as CursorPagination, v as OAuth2AuthConfig, w as UserConfig, x as ResponseStatus, y as PageInfoMeta } from "./index-BM1p0FMj.js";
2
2
  import "dotenv/config";
3
3
  import * as axios0 from "axios";
4
4
  import { RawAxiosRequestHeaders } from "axios";
@@ -174,15 +174,15 @@ declare class Builder {
174
174
  //#region src/Core.d.ts
175
175
  declare class Core {
176
176
  static apiClass: typeof BaseApi;
177
- debugLevel: number;
177
+ debugLevel: DebugLevel;
178
178
  /**
179
179
  * Client ID
180
180
  */
181
- private clientId;
181
+ private clientId?;
182
182
  /**
183
183
  * Client Secret
184
184
  */
185
- private clientSecret;
185
+ private clientSecret?;
186
186
  /**
187
187
  * API Environment
188
188
  */
@@ -224,7 +224,7 @@ declare class Core {
224
224
  * @param level
225
225
  * @returns
226
226
  */
227
- debug(level?: number): this;
227
+ debug(level?: DebugLevel): this;
228
228
  /**
229
229
  * Get the current environment
230
230
  *
@@ -234,11 +234,11 @@ declare class Core {
234
234
  /**
235
235
  * Get the configured client identifier.
236
236
  */
237
- getClientId(): string;
237
+ getClientId(): string | undefined;
238
238
  /**
239
239
  * Get the configured client secret.
240
240
  */
241
- getClientSecret(): string;
241
+ getClientSecret(): string | undefined;
242
242
  /**
243
243
  * Get the current shared SDK config.
244
244
  */
@@ -282,6 +282,10 @@ declare class Core {
282
282
  api: BaseApi & InferRuntimeSdkApi<TBundle>;
283
283
  };
284
284
  private static normalizeEnvironment;
285
+ private static normalizeCredential;
286
+ private resolveInitOptionsFromObject;
287
+ private resolveInitOptionsFromArgs;
288
+ private hasConfiguredAuth;
285
289
  private isAuthConfigOrArray;
286
290
  private isAuthConfig;
287
291
  private isConfigUpdate;
@@ -317,7 +321,7 @@ declare class HttpException extends Error {
317
321
  * @param code
318
322
  * @param data
319
323
  */
320
- static fromCode(code: number, data: Required<UnifiedResponse>, parent?: Error): HttpException | BadRequestException | UnauthorizedRequestException | ForbiddenRequestException;
324
+ static fromCode(code: number, data: Required<UnifiedResponse>, parent?: Error): BadRequestException | ForbiddenRequestException | HttpException | UnauthorizedRequestException;
321
325
  }
322
326
  //#endregion
323
327
  //#region src/Apis/BaseApi.d.ts
@@ -569,6 +573,7 @@ declare const buildUrl: (baseUrl: string, ...endpoint: string[]) => string;
569
573
  //#region src/utilities/Manager.d.ts
570
574
  declare const defaultConfig: UserConfig;
571
575
  declare let globalConfig: UserConfig;
576
+ declare const loadUserConfig: (rootDir?: string) => Partial<UserConfig> | null;
572
577
  declare const defineConfig: (config: Partial<UserConfig>) => UserConfig;
573
578
  declare const getConfig: () => UserConfig;
574
579
  declare const resetConfig: () => UserConfig;
@@ -614,4 +619,4 @@ declare class WebhookValidator<Options extends XGenericObject = XGenericObject>
614
619
  };
615
620
  }
616
621
  //#endregion
617
- export { AccessTokenCacheLoader, AccessValidationConfigUpdate, AccessValidationResult, ApiKeyAuthConfig, AuthCacheLoader, AuthConfig, AuthErrorResponse, AuthRequestConfig, AuthResponse, BadRequestException, BaseApi, BasicAuthConfig, BearerAuthConfig, Builder, CachedAccessTokenValue, CachedAuthValue, Core, CountryCode, CountryCodeRestricted, CurrencyCode, CursorPagination, CustomAuthConfig, Environment, ErrorResponse, ForbiddenRequestException, Http, HttpException, HttpMethod, InferRuntimeSdkApi, InitOptions, NormalPagination, OAuth2AuthConfig, PageInfoMeta, Response, ResponseStatus, RuntimeSdkBundle, RuntimeSdkGroupManifest, RuntimeSdkManifest, RuntimeSdkOperationManifest, RuntimeSdkParameterManifest, RuntimeSdkSecurityRequirementManifest, RuntimeSdkSecurityRequirementSchemeManifest, RuntimeSdkSecuritySchemeManifest, SuccessResponse, UnauthorizedRequestException, UnifiedResponse, UserConfig, UserUrls, ValidationError, ValidationErrorResponse, WebhookValidator, XGenericObject, buildUrl, createAccessTokenCache, createAuthCache, createRuntimeApi, createSdk, defaultConfig, defineConfig, getConfig, globalConfig, normalizeValue, resetConfig };
622
+ export { AccessTokenCacheLoader, AccessValidationConfigUpdate, AccessValidationResult, ApiKeyAuthConfig, AuthCacheLoader, AuthConfig, AuthErrorResponse, AuthRequestConfig, AuthResponse, BadRequestException, BaseApi, BasicAuthConfig, BearerAuthConfig, Builder, CachedAccessTokenValue, CachedAuthValue, Core, CountryCode, CountryCodeRestricted, CurrencyCode, CursorPagination, CustomAuthConfig, DebugLevel, Environment, ErrorResponse, ForbiddenRequestException, Http, HttpException, HttpMethod, InferRuntimeSdkApi, InitOptions, NormalPagination, OAuth2AuthConfig, PageInfoMeta, Response, ResponseStatus, RuntimeSdkBundle, RuntimeSdkGroupManifest, RuntimeSdkManifest, RuntimeSdkOperationManifest, RuntimeSdkParameterManifest, RuntimeSdkSecurityRequirementManifest, RuntimeSdkSecurityRequirementSchemeManifest, RuntimeSdkSecuritySchemeManifest, SuccessResponse, UnauthorizedRequestException, UnifiedResponse, UserConfig, UserUrls, ValidationError, ValidationErrorResponse, WebhookValidator, XGenericObject, buildUrl, createAccessTokenCache, createAuthCache, createRuntimeApi, createSdk, defaultConfig, defineConfig, getConfig, globalConfig, loadUserConfig, normalizeValue, resetConfig };