ultracart_rest_api_v2_typescript 4.1.125 → 4.1.126
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/.openapi-generator/FILES +1 -0
- package/README.md +3 -2
- package/dist/apis/OauthApi.d.ts +23 -0
- package/dist/apis/OauthApi.js +50 -0
- package/dist/models/OauthMeResponse.d.ts +55 -0
- package/dist/models/OauthMeResponse.js +58 -0
- package/dist/models/OauthTokenResponse.d.ts +6 -0
- package/dist/models/OauthTokenResponse.js +2 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/package.json +1 -1
- package/src/apis/OauthApi.ts +47 -0
- package/src/models/OauthMeResponse.ts +99 -0
- package/src/models/OauthTokenResponse.ts +8 -0
- package/src/models/index.ts +1 -0
package/.openapi-generator/FILES
CHANGED
|
@@ -796,6 +796,7 @@ src/models/Metric.ts
|
|
|
796
796
|
src/models/ModelError.ts
|
|
797
797
|
src/models/Notification.ts
|
|
798
798
|
src/models/OauthDeviceAuthorizationResponse.ts
|
|
799
|
+
src/models/OauthMeResponse.ts
|
|
799
800
|
src/models/OauthRevokeSuccessResponse.ts
|
|
800
801
|
src/models/OauthTokenResponse.ts
|
|
801
802
|
src/models/Order.ts
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# UltraCart Typescript SDK
|
|
2
|
-
## ultracart_rest_api_v2_typescript@4.1.
|
|
2
|
+
## ultracart_rest_api_v2_typescript@4.1.126
|
|
3
3
|
|
|
4
4
|
Every API method call has a sample for every language SDK. See https://github.com/UltraCart/sdk_samples
|
|
5
5
|
|
|
6
6
|
Installation
|
|
7
7
|
|
|
8
8
|
```
|
|
9
|
-
npm install ultracart_rest_api_v2_typescript@4.1.
|
|
9
|
+
npm install ultracart_rest_api_v2_typescript@4.1.126 --save
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
```typescript
|
|
@@ -85,6 +85,7 @@ Not every change is committed to every SDK.
|
|
|
85
85
|
|
|
86
86
|
| Version | Date | Comments |
|
|
87
87
|
| --: | :-: | --- |
|
|
88
|
+
| 4.1.126 | 08/10/2026 | oauth - add /oauth/me method to assist application in indentifying the connected account |
|
|
88
89
|
| 4.1.125 | 08/06/2026 | order api - ability to query by bin and last 4 in unlimited scenarios for chargeback order association |
|
|
89
90
|
| 4.1.124 | 08/04/2026 | customer - method to remove customer profile from email suppression |
|
|
90
91
|
| 4.1.123 | 08/04/2026 | customer - method to remove customer profile from email suppression |
|
package/dist/apis/OauthApi.d.ts
CHANGED
|
@@ -68,6 +68,19 @@ export interface OauthApiInterface {
|
|
|
68
68
|
* Initiate a device authorization flow.
|
|
69
69
|
*/
|
|
70
70
|
oauthDeviceAuthorize(requestParameters: OauthDeviceAuthorizeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OauthDeviceAuthorizationResponse>;
|
|
71
|
+
/**
|
|
72
|
+
* Returns the UltraCart merchant account that authorized your application, along with the permissions that were granted. Call it immediately after exchanging your authorization code so you can display the connected account to your user and map it within your own system. Any OAuth access token may call this endpoint regardless of the permissions it holds. The granted permissions are the ones the merchant approved, which may be narrower than the permissions your application currently requests, because permissions are recorded when the merchant authorizes and do not change afterwards. If you add a permission to your application, already connected merchants keep the permissions they originally approved until they authorize again, so read this list rather than assuming your application\'s configured permissions.
|
|
73
|
+
* @summary Identify the merchant account this access token belongs to.
|
|
74
|
+
* @param {*} [options] Override http request option.
|
|
75
|
+
* @throws {RequiredError}
|
|
76
|
+
* @memberof OauthApiInterface
|
|
77
|
+
*/
|
|
78
|
+
oauthMeRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
79
|
+
/**
|
|
80
|
+
* Returns the UltraCart merchant account that authorized your application, along with the permissions that were granted. Call it immediately after exchanging your authorization code so you can display the connected account to your user and map it within your own system. Any OAuth access token may call this endpoint regardless of the permissions it holds. The granted permissions are the ones the merchant approved, which may be narrower than the permissions your application currently requests, because permissions are recorded when the merchant authorizes and do not change afterwards. If you add a permission to your application, already connected merchants keep the permissions they originally approved until they authorize again, so read this list rather than assuming your application\'s configured permissions.
|
|
81
|
+
* Identify the merchant account this access token belongs to.
|
|
82
|
+
*/
|
|
83
|
+
oauthMe(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
71
84
|
/**
|
|
72
85
|
* Revokes the OAuth application associated with the specified client_id and token.
|
|
73
86
|
* @summary Revoke this OAuth application.
|
|
@@ -108,6 +121,16 @@ export declare class OauthApi extends runtime.BaseAPI implements OauthApiInterfa
|
|
|
108
121
|
* Initiate a device authorization flow.
|
|
109
122
|
*/
|
|
110
123
|
oauthDeviceAuthorize(requestParameters: OauthDeviceAuthorizeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OauthDeviceAuthorizationResponse>;
|
|
124
|
+
/**
|
|
125
|
+
* Returns the UltraCart merchant account that authorized your application, along with the permissions that were granted. Call it immediately after exchanging your authorization code so you can display the connected account to your user and map it within your own system. Any OAuth access token may call this endpoint regardless of the permissions it holds. The granted permissions are the ones the merchant approved, which may be narrower than the permissions your application currently requests, because permissions are recorded when the merchant authorizes and do not change afterwards. If you add a permission to your application, already connected merchants keep the permissions they originally approved until they authorize again, so read this list rather than assuming your application\'s configured permissions.
|
|
126
|
+
* Identify the merchant account this access token belongs to.
|
|
127
|
+
*/
|
|
128
|
+
oauthMeRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
129
|
+
/**
|
|
130
|
+
* Returns the UltraCart merchant account that authorized your application, along with the permissions that were granted. Call it immediately after exchanging your authorization code so you can display the connected account to your user and map it within your own system. Any OAuth access token may call this endpoint regardless of the permissions it holds. The granted permissions are the ones the merchant approved, which may be narrower than the permissions your application currently requests, because permissions are recorded when the merchant authorizes and do not change afterwards. If you add a permission to your application, already connected merchants keep the permissions they originally approved until they authorize again, so read this list rather than assuming your application\'s configured permissions.
|
|
131
|
+
* Identify the merchant account this access token belongs to.
|
|
132
|
+
*/
|
|
133
|
+
oauthMe(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
111
134
|
/**
|
|
112
135
|
* Revokes the OAuth application associated with the specified client_id and token.
|
|
113
136
|
* Revoke this OAuth application.
|
package/dist/apis/OauthApi.js
CHANGED
|
@@ -253,6 +253,56 @@ var OauthApi = /** @class */ (function (_super) {
|
|
|
253
253
|
});
|
|
254
254
|
});
|
|
255
255
|
};
|
|
256
|
+
/**
|
|
257
|
+
* Returns the UltraCart merchant account that authorized your application, along with the permissions that were granted. Call it immediately after exchanging your authorization code so you can display the connected account to your user and map it within your own system. Any OAuth access token may call this endpoint regardless of the permissions it holds. The granted permissions are the ones the merchant approved, which may be narrower than the permissions your application currently requests, because permissions are recorded when the merchant authorizes and do not change afterwards. If you add a permission to your application, already connected merchants keep the permissions they originally approved until they authorize again, so read this list rather than assuming your application\'s configured permissions.
|
|
258
|
+
* Identify the merchant account this access token belongs to.
|
|
259
|
+
*/
|
|
260
|
+
OauthApi.prototype.oauthMeRaw = function (initOverrides) {
|
|
261
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
262
|
+
var queryParameters, headerParameters, _a, _b, response;
|
|
263
|
+
return __generator(this, function (_c) {
|
|
264
|
+
switch (_c.label) {
|
|
265
|
+
case 0:
|
|
266
|
+
queryParameters = {};
|
|
267
|
+
headerParameters = {};
|
|
268
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
|
|
269
|
+
// oauth required
|
|
270
|
+
_a = headerParameters;
|
|
271
|
+
_b = "Authorization";
|
|
272
|
+
return [4 /*yield*/, this.configuration.accessToken("ultraCartOauth", [])];
|
|
273
|
+
case 1:
|
|
274
|
+
// oauth required
|
|
275
|
+
_a[_b] = _c.sent();
|
|
276
|
+
_c.label = 2;
|
|
277
|
+
case 2: return [4 /*yield*/, this.request({
|
|
278
|
+
path: "/oauth/me",
|
|
279
|
+
method: 'GET',
|
|
280
|
+
headers: headerParameters,
|
|
281
|
+
query: queryParameters,
|
|
282
|
+
}, initOverrides)];
|
|
283
|
+
case 3:
|
|
284
|
+
response = _c.sent();
|
|
285
|
+
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
});
|
|
289
|
+
};
|
|
290
|
+
/**
|
|
291
|
+
* Returns the UltraCart merchant account that authorized your application, along with the permissions that were granted. Call it immediately after exchanging your authorization code so you can display the connected account to your user and map it within your own system. Any OAuth access token may call this endpoint regardless of the permissions it holds. The granted permissions are the ones the merchant approved, which may be narrower than the permissions your application currently requests, because permissions are recorded when the merchant authorizes and do not change afterwards. If you add a permission to your application, already connected merchants keep the permissions they originally approved until they authorize again, so read this list rather than assuming your application\'s configured permissions.
|
|
292
|
+
* Identify the merchant account this access token belongs to.
|
|
293
|
+
*/
|
|
294
|
+
OauthApi.prototype.oauthMe = function (initOverrides) {
|
|
295
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
296
|
+
return __generator(this, function (_a) {
|
|
297
|
+
switch (_a.label) {
|
|
298
|
+
case 0: return [4 /*yield*/, this.oauthMeRaw(initOverrides)];
|
|
299
|
+
case 1:
|
|
300
|
+
_a.sent();
|
|
301
|
+
return [2 /*return*/];
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
};
|
|
256
306
|
/**
|
|
257
307
|
* Revokes the OAuth application associated with the specified client_id and token.
|
|
258
308
|
* Revoke this OAuth application.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UltraCart Rest API V2
|
|
3
|
+
* UltraCart REST API Version 2
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 2.0.0
|
|
6
|
+
* Contact: support@ultracart.com
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface OauthMeResponse
|
|
16
|
+
*/
|
|
17
|
+
export interface OauthMeResponse {
|
|
18
|
+
/**
|
|
19
|
+
* The name of your application as the merchant approved it.
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof OauthMeResponse
|
|
22
|
+
*/
|
|
23
|
+
application_name?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Your application's client_id. Null when authenticating with a simple key, which is not tied to an application.
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof OauthMeResponse
|
|
28
|
+
*/
|
|
29
|
+
client_id?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The UltraCart merchant account that authorized your application. Stable, and the value to key your own records on.
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof OauthMeResponse
|
|
34
|
+
*/
|
|
35
|
+
merchant_id?: string;
|
|
36
|
+
/**
|
|
37
|
+
* The account's company name, suitable for displaying to your user. The merchant can change this, so display it rather than storing it as an identifier.
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof OauthMeResponse
|
|
40
|
+
*/
|
|
41
|
+
merchant_name?: string;
|
|
42
|
+
/**
|
|
43
|
+
* The permissions the merchant granted. May be narrower than the permissions your application currently requests.
|
|
44
|
+
* @type {Array<string>}
|
|
45
|
+
* @memberof OauthMeResponse
|
|
46
|
+
*/
|
|
47
|
+
scopes?: Array<string>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Check if a given object implements the OauthMeResponse interface.
|
|
51
|
+
*/
|
|
52
|
+
export declare function instanceOfOauthMeResponse(value: object): boolean;
|
|
53
|
+
export declare function OauthMeResponseFromJSON(json: any): OauthMeResponse;
|
|
54
|
+
export declare function OauthMeResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): OauthMeResponse;
|
|
55
|
+
export declare function OauthMeResponseToJSON(value?: OauthMeResponse | null): any;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* UltraCart Rest API V2
|
|
6
|
+
* UltraCart REST API Version 2
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 2.0.0
|
|
9
|
+
* Contact: support@ultracart.com
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.OauthMeResponseToJSON = exports.OauthMeResponseFromJSONTyped = exports.OauthMeResponseFromJSON = exports.instanceOfOauthMeResponse = void 0;
|
|
17
|
+
var runtime_1 = require("../runtime");
|
|
18
|
+
/**
|
|
19
|
+
* Check if a given object implements the OauthMeResponse interface.
|
|
20
|
+
*/
|
|
21
|
+
function instanceOfOauthMeResponse(value) {
|
|
22
|
+
var isInstance = true;
|
|
23
|
+
return isInstance;
|
|
24
|
+
}
|
|
25
|
+
exports.instanceOfOauthMeResponse = instanceOfOauthMeResponse;
|
|
26
|
+
function OauthMeResponseFromJSON(json) {
|
|
27
|
+
return OauthMeResponseFromJSONTyped(json, false);
|
|
28
|
+
}
|
|
29
|
+
exports.OauthMeResponseFromJSON = OauthMeResponseFromJSON;
|
|
30
|
+
function OauthMeResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
31
|
+
if ((json === undefined) || (json === null)) {
|
|
32
|
+
return json;
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
'application_name': !(0, runtime_1.exists)(json, 'application_name') ? undefined : json['application_name'],
|
|
36
|
+
'client_id': !(0, runtime_1.exists)(json, 'client_id') ? undefined : json['client_id'],
|
|
37
|
+
'merchant_id': !(0, runtime_1.exists)(json, 'merchant_id') ? undefined : json['merchant_id'],
|
|
38
|
+
'merchant_name': !(0, runtime_1.exists)(json, 'merchant_name') ? undefined : json['merchant_name'],
|
|
39
|
+
'scopes': !(0, runtime_1.exists)(json, 'scopes') ? undefined : json['scopes'],
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
exports.OauthMeResponseFromJSONTyped = OauthMeResponseFromJSONTyped;
|
|
43
|
+
function OauthMeResponseToJSON(value) {
|
|
44
|
+
if (value === undefined) {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
if (value === null) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
'application_name': value.application_name,
|
|
52
|
+
'client_id': value.client_id,
|
|
53
|
+
'merchant_id': value.merchant_id,
|
|
54
|
+
'merchant_name': value.merchant_name,
|
|
55
|
+
'scopes': value.scopes,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
exports.OauthMeResponseToJSON = OauthMeResponseToJSON;
|
|
@@ -45,6 +45,12 @@ export interface OauthTokenResponse {
|
|
|
45
45
|
* @memberof OauthTokenResponse
|
|
46
46
|
*/
|
|
47
47
|
expires_in?: string;
|
|
48
|
+
/**
|
|
49
|
+
* The UltraCart merchant account that authorized this token. Use it to map the token to the merchant within your own system. Also returned by GET /oauth/me along with the account name.
|
|
50
|
+
* @type {string}
|
|
51
|
+
* @memberof OauthTokenResponse
|
|
52
|
+
*/
|
|
53
|
+
merchant_id?: string;
|
|
48
54
|
/**
|
|
49
55
|
* The refresh token that should be used to fetch a new access token when the expiration occurs
|
|
50
56
|
* @type {string}
|
|
@@ -43,6 +43,7 @@ function OauthTokenResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
43
43
|
'error_description': !(0, runtime_1.exists)(json, 'error_description') ? undefined : json['error_description'],
|
|
44
44
|
'error_uri': !(0, runtime_1.exists)(json, 'error_uri') ? undefined : json['error_uri'],
|
|
45
45
|
'expires_in': !(0, runtime_1.exists)(json, 'expires_in') ? undefined : json['expires_in'],
|
|
46
|
+
'merchant_id': !(0, runtime_1.exists)(json, 'merchant_id') ? undefined : json['merchant_id'],
|
|
46
47
|
'refresh_token': !(0, runtime_1.exists)(json, 'refresh_token') ? undefined : json['refresh_token'],
|
|
47
48
|
'scope': !(0, runtime_1.exists)(json, 'scope') ? undefined : json['scope'],
|
|
48
49
|
'token_type': !(0, runtime_1.exists)(json, 'token_type') ? undefined : json['token_type'],
|
|
@@ -62,6 +63,7 @@ function OauthTokenResponseToJSON(value) {
|
|
|
62
63
|
'error_description': value.error_description,
|
|
63
64
|
'error_uri': value.error_uri,
|
|
64
65
|
'expires_in': value.expires_in,
|
|
66
|
+
'merchant_id': value.merchant_id,
|
|
65
67
|
'refresh_token': value.refresh_token,
|
|
66
68
|
'scope': value.scope,
|
|
67
69
|
'token_type': value.token_type,
|
package/dist/models/index.d.ts
CHANGED
|
@@ -767,6 +767,7 @@ export * from './Metric';
|
|
|
767
767
|
export * from './ModelError';
|
|
768
768
|
export * from './Notification';
|
|
769
769
|
export * from './OauthDeviceAuthorizationResponse';
|
|
770
|
+
export * from './OauthMeResponse';
|
|
770
771
|
export * from './OauthRevokeSuccessResponse';
|
|
771
772
|
export * from './OauthTokenResponse';
|
|
772
773
|
export * from './Order';
|
package/dist/models/index.js
CHANGED
|
@@ -785,6 +785,7 @@ __exportStar(require("./Metric"), exports);
|
|
|
785
785
|
__exportStar(require("./ModelError"), exports);
|
|
786
786
|
__exportStar(require("./Notification"), exports);
|
|
787
787
|
__exportStar(require("./OauthDeviceAuthorizationResponse"), exports);
|
|
788
|
+
__exportStar(require("./OauthMeResponse"), exports);
|
|
788
789
|
__exportStar(require("./OauthRevokeSuccessResponse"), exports);
|
|
789
790
|
__exportStar(require("./OauthTokenResponse"), exports);
|
|
790
791
|
__exportStar(require("./Order"), exports);
|
package/package.json
CHANGED
package/src/apis/OauthApi.ts
CHANGED
|
@@ -93,6 +93,21 @@ export interface OauthApiInterface {
|
|
|
93
93
|
*/
|
|
94
94
|
oauthDeviceAuthorize(requestParameters: OauthDeviceAuthorizeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OauthDeviceAuthorizationResponse>;
|
|
95
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Returns the UltraCart merchant account that authorized your application, along with the permissions that were granted. Call it immediately after exchanging your authorization code so you can display the connected account to your user and map it within your own system. Any OAuth access token may call this endpoint regardless of the permissions it holds. The granted permissions are the ones the merchant approved, which may be narrower than the permissions your application currently requests, because permissions are recorded when the merchant authorizes and do not change afterwards. If you add a permission to your application, already connected merchants keep the permissions they originally approved until they authorize again, so read this list rather than assuming your application\'s configured permissions.
|
|
98
|
+
* @summary Identify the merchant account this access token belongs to.
|
|
99
|
+
* @param {*} [options] Override http request option.
|
|
100
|
+
* @throws {RequiredError}
|
|
101
|
+
* @memberof OauthApiInterface
|
|
102
|
+
*/
|
|
103
|
+
oauthMeRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Returns the UltraCart merchant account that authorized your application, along with the permissions that were granted. Call it immediately after exchanging your authorization code so you can display the connected account to your user and map it within your own system. Any OAuth access token may call this endpoint regardless of the permissions it holds. The granted permissions are the ones the merchant approved, which may be narrower than the permissions your application currently requests, because permissions are recorded when the merchant authorizes and do not change afterwards. If you add a permission to your application, already connected merchants keep the permissions they originally approved until they authorize again, so read this list rather than assuming your application\'s configured permissions.
|
|
107
|
+
* Identify the merchant account this access token belongs to.
|
|
108
|
+
*/
|
|
109
|
+
oauthMe(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
110
|
+
|
|
96
111
|
/**
|
|
97
112
|
* Revokes the OAuth application associated with the specified client_id and token.
|
|
98
113
|
* @summary Revoke this OAuth application.
|
|
@@ -277,6 +292,38 @@ export class OauthApi extends runtime.BaseAPI implements OauthApiInterface {
|
|
|
277
292
|
return await response.value();
|
|
278
293
|
}
|
|
279
294
|
|
|
295
|
+
/**
|
|
296
|
+
* Returns the UltraCart merchant account that authorized your application, along with the permissions that were granted. Call it immediately after exchanging your authorization code so you can display the connected account to your user and map it within your own system. Any OAuth access token may call this endpoint regardless of the permissions it holds. The granted permissions are the ones the merchant approved, which may be narrower than the permissions your application currently requests, because permissions are recorded when the merchant authorizes and do not change afterwards. If you add a permission to your application, already connected merchants keep the permissions they originally approved until they authorize again, so read this list rather than assuming your application\'s configured permissions.
|
|
297
|
+
* Identify the merchant account this access token belongs to.
|
|
298
|
+
*/
|
|
299
|
+
async oauthMeRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
300
|
+
const queryParameters: any = {};
|
|
301
|
+
|
|
302
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
303
|
+
|
|
304
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
305
|
+
// oauth required
|
|
306
|
+
headerParameters["Authorization"] = await this.configuration.accessToken("ultraCartOauth", []);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
const response = await this.request({
|
|
310
|
+
path: `/oauth/me`,
|
|
311
|
+
method: 'GET',
|
|
312
|
+
headers: headerParameters,
|
|
313
|
+
query: queryParameters,
|
|
314
|
+
}, initOverrides);
|
|
315
|
+
|
|
316
|
+
return new runtime.VoidApiResponse(response);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Returns the UltraCart merchant account that authorized your application, along with the permissions that were granted. Call it immediately after exchanging your authorization code so you can display the connected account to your user and map it within your own system. Any OAuth access token may call this endpoint regardless of the permissions it holds. The granted permissions are the ones the merchant approved, which may be narrower than the permissions your application currently requests, because permissions are recorded when the merchant authorizes and do not change afterwards. If you add a permission to your application, already connected merchants keep the permissions they originally approved until they authorize again, so read this list rather than assuming your application\'s configured permissions.
|
|
321
|
+
* Identify the merchant account this access token belongs to.
|
|
322
|
+
*/
|
|
323
|
+
async oauthMe(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
324
|
+
await this.oauthMeRaw(initOverrides);
|
|
325
|
+
}
|
|
326
|
+
|
|
280
327
|
/**
|
|
281
328
|
* Revokes the OAuth application associated with the specified client_id and token.
|
|
282
329
|
* Revoke this OAuth application.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* UltraCart Rest API V2
|
|
5
|
+
* UltraCart REST API Version 2
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 2.0.0
|
|
8
|
+
* Contact: support@ultracart.com
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { exists, mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface OauthMeResponse
|
|
20
|
+
*/
|
|
21
|
+
export interface OauthMeResponse {
|
|
22
|
+
/**
|
|
23
|
+
* The name of your application as the merchant approved it.
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof OauthMeResponse
|
|
26
|
+
*/
|
|
27
|
+
application_name?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Your application's client_id. Null when authenticating with a simple key, which is not tied to an application.
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof OauthMeResponse
|
|
32
|
+
*/
|
|
33
|
+
client_id?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The UltraCart merchant account that authorized your application. Stable, and the value to key your own records on.
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof OauthMeResponse
|
|
38
|
+
*/
|
|
39
|
+
merchant_id?: string;
|
|
40
|
+
/**
|
|
41
|
+
* The account's company name, suitable for displaying to your user. The merchant can change this, so display it rather than storing it as an identifier.
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof OauthMeResponse
|
|
44
|
+
*/
|
|
45
|
+
merchant_name?: string;
|
|
46
|
+
/**
|
|
47
|
+
* The permissions the merchant granted. May be narrower than the permissions your application currently requests.
|
|
48
|
+
* @type {Array<string>}
|
|
49
|
+
* @memberof OauthMeResponse
|
|
50
|
+
*/
|
|
51
|
+
scopes?: Array<string>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Check if a given object implements the OauthMeResponse interface.
|
|
58
|
+
*/
|
|
59
|
+
export function instanceOfOauthMeResponse(value: object): boolean {
|
|
60
|
+
let isInstance = true;
|
|
61
|
+
|
|
62
|
+
return isInstance;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function OauthMeResponseFromJSON(json: any): OauthMeResponse {
|
|
66
|
+
return OauthMeResponseFromJSONTyped(json, false);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function OauthMeResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): OauthMeResponse {
|
|
70
|
+
if ((json === undefined) || (json === null)) {
|
|
71
|
+
return json;
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
|
|
75
|
+
'application_name': !exists(json, 'application_name') ? undefined : json['application_name'],
|
|
76
|
+
'client_id': !exists(json, 'client_id') ? undefined : json['client_id'],
|
|
77
|
+
'merchant_id': !exists(json, 'merchant_id') ? undefined : json['merchant_id'],
|
|
78
|
+
'merchant_name': !exists(json, 'merchant_name') ? undefined : json['merchant_name'],
|
|
79
|
+
'scopes': !exists(json, 'scopes') ? undefined : json['scopes'],
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function OauthMeResponseToJSON(value?: OauthMeResponse | null): any {
|
|
84
|
+
if (value === undefined) {
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
if (value === null) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
|
|
92
|
+
'application_name': value.application_name,
|
|
93
|
+
'client_id': value.client_id,
|
|
94
|
+
'merchant_id': value.merchant_id,
|
|
95
|
+
'merchant_name': value.merchant_name,
|
|
96
|
+
'scopes': value.scopes,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
@@ -49,6 +49,12 @@ export interface OauthTokenResponse {
|
|
|
49
49
|
* @memberof OauthTokenResponse
|
|
50
50
|
*/
|
|
51
51
|
expires_in?: string;
|
|
52
|
+
/**
|
|
53
|
+
* The UltraCart merchant account that authorized this token. Use it to map the token to the merchant within your own system. Also returned by GET /oauth/me along with the account name.
|
|
54
|
+
* @type {string}
|
|
55
|
+
* @memberof OauthTokenResponse
|
|
56
|
+
*/
|
|
57
|
+
merchant_id?: string;
|
|
52
58
|
/**
|
|
53
59
|
* The refresh token that should be used to fetch a new access token when the expiration occurs
|
|
54
60
|
* @type {string}
|
|
@@ -104,6 +110,7 @@ export function OauthTokenResponseFromJSONTyped(json: any, ignoreDiscriminator:
|
|
|
104
110
|
'error_description': !exists(json, 'error_description') ? undefined : json['error_description'],
|
|
105
111
|
'error_uri': !exists(json, 'error_uri') ? undefined : json['error_uri'],
|
|
106
112
|
'expires_in': !exists(json, 'expires_in') ? undefined : json['expires_in'],
|
|
113
|
+
'merchant_id': !exists(json, 'merchant_id') ? undefined : json['merchant_id'],
|
|
107
114
|
'refresh_token': !exists(json, 'refresh_token') ? undefined : json['refresh_token'],
|
|
108
115
|
'scope': !exists(json, 'scope') ? undefined : json['scope'],
|
|
109
116
|
'token_type': !exists(json, 'token_type') ? undefined : json['token_type'],
|
|
@@ -124,6 +131,7 @@ export function OauthTokenResponseToJSON(value?: OauthTokenResponse | null): any
|
|
|
124
131
|
'error_description': value.error_description,
|
|
125
132
|
'error_uri': value.error_uri,
|
|
126
133
|
'expires_in': value.expires_in,
|
|
134
|
+
'merchant_id': value.merchant_id,
|
|
127
135
|
'refresh_token': value.refresh_token,
|
|
128
136
|
'scope': value.scope,
|
|
129
137
|
'token_type': value.token_type,
|
package/src/models/index.ts
CHANGED
|
@@ -769,6 +769,7 @@ export * from './Metric';
|
|
|
769
769
|
export * from './ModelError';
|
|
770
770
|
export * from './Notification';
|
|
771
771
|
export * from './OauthDeviceAuthorizationResponse';
|
|
772
|
+
export * from './OauthMeResponse';
|
|
772
773
|
export * from './OauthRevokeSuccessResponse';
|
|
773
774
|
export * from './OauthTokenResponse';
|
|
774
775
|
export * from './Order';
|