@echoxyz/sonar-core 0.7.0 → 0.8.0
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 +6 -0
- package/dist/index.cjs +5 -0
- package/dist/index.d.cts +11 -4
- package/dist/index.d.ts +11 -4
- package/dist/index.js +5 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -274,6 +274,11 @@ var SonarClient = class {
|
|
|
274
274
|
{ includeAuth: false }
|
|
275
275
|
);
|
|
276
276
|
}
|
|
277
|
+
async refreshToken(args) {
|
|
278
|
+
return this.postJSON("/oauth.RefreshAccessToken", {
|
|
279
|
+
refresh_token: args.refreshToken
|
|
280
|
+
});
|
|
281
|
+
}
|
|
277
282
|
async prePurchaseCheck(args) {
|
|
278
283
|
return this.postJSON("/externalapi.PrePurchaseCheck", {
|
|
279
284
|
SaleUUID: args.saleUUID,
|
package/dist/index.d.cts
CHANGED
|
@@ -108,6 +108,12 @@ type ReadEntityResponse = {
|
|
|
108
108
|
type ListAvailableEntitiesResponse = {
|
|
109
109
|
Entities: EntityDetails[];
|
|
110
110
|
};
|
|
111
|
+
type TokenResponse = {
|
|
112
|
+
access_token: string;
|
|
113
|
+
refresh_token: string;
|
|
114
|
+
token_type: string;
|
|
115
|
+
expires_in: number;
|
|
116
|
+
};
|
|
111
117
|
type ClientOptions = {
|
|
112
118
|
auth?: AuthSession;
|
|
113
119
|
fetch?: FetchLike;
|
|
@@ -132,9 +138,10 @@ declare class SonarClient {
|
|
|
132
138
|
code: string;
|
|
133
139
|
codeVerifier: string;
|
|
134
140
|
redirectURI: string;
|
|
135
|
-
}): Promise<
|
|
136
|
-
|
|
137
|
-
|
|
141
|
+
}): Promise<TokenResponse>;
|
|
142
|
+
refreshToken(args: {
|
|
143
|
+
refreshToken: string;
|
|
144
|
+
}): Promise<TokenResponse>;
|
|
138
145
|
prePurchaseCheck(args: {
|
|
139
146
|
saleUUID: string;
|
|
140
147
|
entityID: Hex;
|
|
@@ -190,4 +197,4 @@ type CreateClientOptions = {
|
|
|
190
197
|
};
|
|
191
198
|
declare function createClient(options?: CreateClientOptions): SonarClient;
|
|
192
199
|
|
|
193
|
-
export { APIError, type AllocationPermit, type AllocationResponse, type BasicPermit, type BuildAuthorizationUrlArgs, type ClientOptions, type CreateClientOptions, type EntityDetails, EntitySetupState, EntityType, type FetchLike, type GeneratePurchasePermitResponse, type Hex, InvestingRegion, type ListAvailableEntitiesResponse, type PrePurchaseCheckResponse, PrePurchaseFailureReason, type PurchasePermit, PurchasePermitType, type ReadEntityResponse, SaleEligibility, SonarClient, type StorageLike, buildAuthorizationUrl, createClient, createMemoryStorage, createWebStorage, generatePKCEParams };
|
|
200
|
+
export { APIError, type AllocationPermit, type AllocationResponse, type BasicPermit, type BuildAuthorizationUrlArgs, type ClientOptions, type CreateClientOptions, type EntityDetails, EntitySetupState, EntityType, type FetchLike, type GeneratePurchasePermitResponse, type Hex, InvestingRegion, type ListAvailableEntitiesResponse, type PrePurchaseCheckResponse, PrePurchaseFailureReason, type PurchasePermit, PurchasePermitType, type ReadEntityResponse, SaleEligibility, SonarClient, type StorageLike, type TokenResponse, buildAuthorizationUrl, createClient, createMemoryStorage, createWebStorage, generatePKCEParams };
|
package/dist/index.d.ts
CHANGED
|
@@ -108,6 +108,12 @@ type ReadEntityResponse = {
|
|
|
108
108
|
type ListAvailableEntitiesResponse = {
|
|
109
109
|
Entities: EntityDetails[];
|
|
110
110
|
};
|
|
111
|
+
type TokenResponse = {
|
|
112
|
+
access_token: string;
|
|
113
|
+
refresh_token: string;
|
|
114
|
+
token_type: string;
|
|
115
|
+
expires_in: number;
|
|
116
|
+
};
|
|
111
117
|
type ClientOptions = {
|
|
112
118
|
auth?: AuthSession;
|
|
113
119
|
fetch?: FetchLike;
|
|
@@ -132,9 +138,10 @@ declare class SonarClient {
|
|
|
132
138
|
code: string;
|
|
133
139
|
codeVerifier: string;
|
|
134
140
|
redirectURI: string;
|
|
135
|
-
}): Promise<
|
|
136
|
-
|
|
137
|
-
|
|
141
|
+
}): Promise<TokenResponse>;
|
|
142
|
+
refreshToken(args: {
|
|
143
|
+
refreshToken: string;
|
|
144
|
+
}): Promise<TokenResponse>;
|
|
138
145
|
prePurchaseCheck(args: {
|
|
139
146
|
saleUUID: string;
|
|
140
147
|
entityID: Hex;
|
|
@@ -190,4 +197,4 @@ type CreateClientOptions = {
|
|
|
190
197
|
};
|
|
191
198
|
declare function createClient(options?: CreateClientOptions): SonarClient;
|
|
192
199
|
|
|
193
|
-
export { APIError, type AllocationPermit, type AllocationResponse, type BasicPermit, type BuildAuthorizationUrlArgs, type ClientOptions, type CreateClientOptions, type EntityDetails, EntitySetupState, EntityType, type FetchLike, type GeneratePurchasePermitResponse, type Hex, InvestingRegion, type ListAvailableEntitiesResponse, type PrePurchaseCheckResponse, PrePurchaseFailureReason, type PurchasePermit, PurchasePermitType, type ReadEntityResponse, SaleEligibility, SonarClient, type StorageLike, buildAuthorizationUrl, createClient, createMemoryStorage, createWebStorage, generatePKCEParams };
|
|
200
|
+
export { APIError, type AllocationPermit, type AllocationResponse, type BasicPermit, type BuildAuthorizationUrlArgs, type ClientOptions, type CreateClientOptions, type EntityDetails, EntitySetupState, EntityType, type FetchLike, type GeneratePurchasePermitResponse, type Hex, InvestingRegion, type ListAvailableEntitiesResponse, type PrePurchaseCheckResponse, PrePurchaseFailureReason, type PurchasePermit, PurchasePermitType, type ReadEntityResponse, SaleEligibility, SonarClient, type StorageLike, type TokenResponse, buildAuthorizationUrl, createClient, createMemoryStorage, createWebStorage, generatePKCEParams };
|
package/dist/index.js
CHANGED
|
@@ -237,6 +237,11 @@ var SonarClient = class {
|
|
|
237
237
|
{ includeAuth: false }
|
|
238
238
|
);
|
|
239
239
|
}
|
|
240
|
+
async refreshToken(args) {
|
|
241
|
+
return this.postJSON("/oauth.RefreshAccessToken", {
|
|
242
|
+
refresh_token: args.refreshToken
|
|
243
|
+
});
|
|
244
|
+
}
|
|
240
245
|
async prePurchaseCheck(args) {
|
|
241
246
|
return this.postJSON("/externalapi.PrePurchaseCheck", {
|
|
242
247
|
SaleUUID: args.saleUUID,
|