rutter-ts 0.3.1 → 0.3.3
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/api.cjs +6 -3
- package/dist/api.d.cts +2 -2
- package/dist/api.d.ts +2 -2
- package/dist/api.js +6 -3
- package/package.json +1 -1
package/dist/api.cjs
CHANGED
|
@@ -12,9 +12,12 @@ var RutterConnectionsApi = class {
|
|
|
12
12
|
constructor(client) {
|
|
13
13
|
this.client = client;
|
|
14
14
|
}
|
|
15
|
-
async create(params) {
|
|
15
|
+
async create(params = {}) {
|
|
16
16
|
const endpoint = "/connections/create";
|
|
17
|
-
const response = await this.client.post(
|
|
17
|
+
const response = await this.client.post(
|
|
18
|
+
endpoint,
|
|
19
|
+
Object.keys(params).length > 0 ? params : void 0
|
|
20
|
+
);
|
|
18
21
|
const result = chunkJCJXW7AE_cjs.zConnectionResponse.safeParse(response);
|
|
19
22
|
if (!result.success) {
|
|
20
23
|
throw new chunkLPP3MIOV_cjs.RutterSchemaMismatchError(
|
|
@@ -37,7 +40,7 @@ var RutterConnectionsApi = class {
|
|
|
37
40
|
return result.data;
|
|
38
41
|
}
|
|
39
42
|
async get(accessToken) {
|
|
40
|
-
const endpoint = "/connections";
|
|
43
|
+
const endpoint = "/connections/access_token";
|
|
41
44
|
const response = await this.client.get(endpoint, {
|
|
42
45
|
access_token: accessToken
|
|
43
46
|
});
|
package/dist/api.d.cts
CHANGED
|
@@ -10,8 +10,8 @@ type TGetAccessTokenConnectionResponse = z__default.infer<typeof zGetAccessToken
|
|
|
10
10
|
declare class RutterConnectionsApi {
|
|
11
11
|
private readonly client;
|
|
12
12
|
constructor(client: RutterClient);
|
|
13
|
-
create(params
|
|
14
|
-
platform
|
|
13
|
+
create(params?: {
|
|
14
|
+
platform?: string;
|
|
15
15
|
}): Promise<TConnectionResponse>;
|
|
16
16
|
list(): Promise<TListConnectionsResponse>;
|
|
17
17
|
get(accessToken: string): Promise<TGetAccessTokenConnectionResponse>;
|
package/dist/api.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ type TGetAccessTokenConnectionResponse = z__default.infer<typeof zGetAccessToken
|
|
|
10
10
|
declare class RutterConnectionsApi {
|
|
11
11
|
private readonly client;
|
|
12
12
|
constructor(client: RutterClient);
|
|
13
|
-
create(params
|
|
14
|
-
platform
|
|
13
|
+
create(params?: {
|
|
14
|
+
platform?: string;
|
|
15
15
|
}): Promise<TConnectionResponse>;
|
|
16
16
|
list(): Promise<TListConnectionsResponse>;
|
|
17
17
|
get(accessToken: string): Promise<TGetAccessTokenConnectionResponse>;
|
package/dist/api.js
CHANGED
|
@@ -6,9 +6,12 @@ var RutterConnectionsApi = class {
|
|
|
6
6
|
constructor(client) {
|
|
7
7
|
this.client = client;
|
|
8
8
|
}
|
|
9
|
-
async create(params) {
|
|
9
|
+
async create(params = {}) {
|
|
10
10
|
const endpoint = "/connections/create";
|
|
11
|
-
const response = await this.client.post(
|
|
11
|
+
const response = await this.client.post(
|
|
12
|
+
endpoint,
|
|
13
|
+
Object.keys(params).length > 0 ? params : void 0
|
|
14
|
+
);
|
|
12
15
|
const result = zConnectionResponse.safeParse(response);
|
|
13
16
|
if (!result.success) {
|
|
14
17
|
throw new RutterSchemaMismatchError(
|
|
@@ -31,7 +34,7 @@ var RutterConnectionsApi = class {
|
|
|
31
34
|
return result.data;
|
|
32
35
|
}
|
|
33
36
|
async get(accessToken) {
|
|
34
|
-
const endpoint = "/connections";
|
|
37
|
+
const endpoint = "/connections/access_token";
|
|
35
38
|
const response = await this.client.get(endpoint, {
|
|
36
39
|
access_token: accessToken
|
|
37
40
|
});
|