@solarwinds/squadcast-sdk-typescript 1.2.0 → 1.3.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/FUNCTIONS.md +5 -8
- package/README.md +127 -29
- package/dist/commonjs/funcs/authAuthGetAccessToken.d.ts +20 -0
- package/dist/commonjs/funcs/authAuthGetAccessToken.d.ts.map +1 -0
- package/dist/commonjs/funcs/authAuthGetAccessToken.js +134 -0
- package/dist/commonjs/funcs/authAuthGetAccessToken.js.map +1 -0
- package/dist/commonjs/funcs/escalationPoliciesUpdate.js +4 -1
- package/dist/commonjs/funcs/escalationPoliciesUpdate.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +4 -4
- package/dist/commonjs/lib/config.d.ts.map +1 -1
- package/dist/commonjs/lib/config.js +8 -4
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/lib/matchers.d.ts.map +1 -1
- package/dist/commonjs/lib/matchers.js +0 -1
- package/dist/commonjs/lib/matchers.js.map +1 -1
- package/dist/commonjs/lib/security.d.ts.map +1 -1
- package/dist/commonjs/lib/security.js +1 -2
- package/dist/commonjs/lib/security.js.map +1 -1
- package/dist/commonjs/models/errors/authgetaccesstoken.d.ts +352 -0
- package/dist/commonjs/models/errors/authgetaccesstoken.d.ts.map +1 -0
- package/dist/commonjs/models/errors/authgetaccesstoken.js +424 -0
- package/dist/commonjs/models/errors/authgetaccesstoken.js.map +1 -0
- package/dist/commonjs/models/errors/index.d.ts +1 -1
- package/dist/commonjs/models/errors/index.d.ts.map +1 -1
- package/dist/commonjs/models/errors/index.js +1 -1
- package/dist/commonjs/models/errors/index.js.map +1 -1
- package/dist/commonjs/models/index.d.ts +1 -0
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +1 -0
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/operations/authgetaccesstoken.d.ts +31 -0
- package/dist/commonjs/models/operations/authgetaccesstoken.d.ts.map +1 -0
- package/dist/commonjs/models/operations/authgetaccesstoken.js +74 -0
- package/dist/commonjs/models/operations/authgetaccesstoken.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/security.d.ts +2 -2
- package/dist/commonjs/models/security.d.ts.map +1 -1
- package/dist/commonjs/models/security.js +1 -1
- package/dist/commonjs/models/security.js.map +1 -1
- package/dist/commonjs/models/v3authaccesstokendata.d.ts +32 -0
- package/dist/commonjs/models/v3authaccesstokendata.d.ts.map +1 -0
- package/dist/commonjs/models/v3authaccesstokendata.js +62 -0
- package/dist/commonjs/models/v3authaccesstokendata.js.map +1 -0
- package/dist/commonjs/sdk/auth.d.ts +14 -0
- package/dist/commonjs/sdk/auth.d.ts.map +1 -0
- package/dist/commonjs/sdk/auth.js +24 -0
- package/dist/commonjs/sdk/auth.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +4 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/funcs/authAuthGetAccessToken.d.ts +20 -0
- package/dist/esm/funcs/authAuthGetAccessToken.d.ts.map +1 -0
- package/dist/esm/funcs/authAuthGetAccessToken.js +98 -0
- package/dist/esm/funcs/authAuthGetAccessToken.js.map +1 -0
- package/dist/esm/funcs/escalationPoliciesUpdate.js +4 -1
- package/dist/esm/funcs/escalationPoliciesUpdate.js.map +1 -1
- package/dist/esm/lib/config.d.ts +4 -4
- package/dist/esm/lib/config.d.ts.map +1 -1
- package/dist/esm/lib/config.js +8 -4
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/lib/matchers.d.ts.map +1 -1
- package/dist/esm/lib/matchers.js +0 -1
- package/dist/esm/lib/matchers.js.map +1 -1
- package/dist/esm/lib/security.d.ts.map +1 -1
- package/dist/esm/lib/security.js +1 -2
- package/dist/esm/lib/security.js.map +1 -1
- package/dist/esm/models/errors/authgetaccesstoken.d.ts +352 -0
- package/dist/esm/models/errors/authgetaccesstoken.d.ts.map +1 -0
- package/dist/esm/models/errors/authgetaccesstoken.js +374 -0
- package/dist/esm/models/errors/authgetaccesstoken.js.map +1 -0
- package/dist/esm/models/errors/index.d.ts +1 -1
- package/dist/esm/models/errors/index.d.ts.map +1 -1
- package/dist/esm/models/errors/index.js +1 -1
- package/dist/esm/models/errors/index.js.map +1 -1
- package/dist/esm/models/index.d.ts +1 -0
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +1 -0
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/operations/authgetaccesstoken.d.ts +31 -0
- package/dist/esm/models/operations/authgetaccesstoken.d.ts.map +1 -0
- package/dist/esm/models/operations/authgetaccesstoken.js +36 -0
- package/dist/esm/models/operations/authgetaccesstoken.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/security.d.ts +2 -2
- package/dist/esm/models/security.d.ts.map +1 -1
- package/dist/esm/models/security.js +1 -1
- package/dist/esm/models/security.js.map +1 -1
- package/dist/esm/models/v3authaccesstokendata.d.ts +32 -0
- package/dist/esm/models/v3authaccesstokendata.d.ts.map +1 -0
- package/dist/esm/models/v3authaccesstokendata.js +25 -0
- package/dist/esm/models/v3authaccesstokendata.js.map +1 -0
- package/dist/esm/sdk/auth.d.ts +14 -0
- package/dist/esm/sdk/auth.d.ts.map +1 -0
- package/dist/esm/sdk/auth.js +20 -0
- package/dist/esm/sdk/auth.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +4 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/examples/authAuthGetAccessToken.example.ts +26 -0
- package/jsr.json +1 -1
- package/package.json +2 -2
- package/src/funcs/authAuthGetAccessToken.ts +229 -0
- package/src/funcs/escalationPoliciesUpdate.ts +7 -1
- package/src/lib/config.ts +8 -4
- package/src/lib/matchers.ts +3 -2
- package/src/lib/security.ts +1 -2
- package/src/models/errors/authgetaccesstoken.ts +751 -0
- package/src/models/errors/index.ts +1 -1
- package/src/models/index.ts +1 -0
- package/src/models/operations/authgetaccesstoken.ts +83 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/security.ts +3 -3
- package/src/models/v3authaccesstokendata.ts +65 -0
- package/src/sdk/auth.ts +29 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
export * from "./
|
|
5
|
+
export * from "./authgetaccesstoken.js";
|
|
6
6
|
export * from "./commonv4error.js";
|
|
7
7
|
export * from "./httpclienterrors.js";
|
|
8
8
|
export * from "./responsevalidationerror.js";
|
package/src/models/index.ts
CHANGED
|
@@ -22,6 +22,7 @@ export * from "./v3auditlogsgetauditlogexporthistorybyidresponse.js";
|
|
|
22
22
|
export * from "./v3auditlogslistauditlogsexporthistoryresponse.js";
|
|
23
23
|
export * from "./v3auditlogslistauditlogsresponse.js";
|
|
24
24
|
export * from "./v3auditlogsteam.js";
|
|
25
|
+
export * from "./v3authaccesstokendata.js";
|
|
25
26
|
export * from "./v3escalationpoliciescreateescalationpolicyrequest.js";
|
|
26
27
|
export * from "./v3escalationpoliciesescalationentity.js";
|
|
27
28
|
export * from "./v3escalationpoliciesescalationpolicyresponse.js";
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import * as models from "../index.js";
|
|
11
|
+
|
|
12
|
+
export const AuthGetAccessTokenServerList = [
|
|
13
|
+
/**
|
|
14
|
+
* US Authentication
|
|
15
|
+
*/
|
|
16
|
+
"https://auth.squadcast.com",
|
|
17
|
+
/**
|
|
18
|
+
* EU Authentication
|
|
19
|
+
*/
|
|
20
|
+
"https://auth.eu.squadcast.com",
|
|
21
|
+
] as const;
|
|
22
|
+
|
|
23
|
+
export type AuthGetAccessTokenRequest = {
|
|
24
|
+
/**
|
|
25
|
+
* (Required) Send your refresh token obtained from Squadcast web application.
|
|
26
|
+
*/
|
|
27
|
+
xRefreshToken: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The request has succeeded.
|
|
32
|
+
*/
|
|
33
|
+
export type AuthGetAccessTokenResponse = {
|
|
34
|
+
/**
|
|
35
|
+
* Access token response returned by the OAuth endpoint.
|
|
36
|
+
*/
|
|
37
|
+
data: models.V3AuthAccessTokenData;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export type AuthGetAccessTokenRequest$Outbound = {
|
|
42
|
+
"X-Refresh-Token": string;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** @internal */
|
|
46
|
+
export const AuthGetAccessTokenRequest$outboundSchema: z.ZodType<
|
|
47
|
+
AuthGetAccessTokenRequest$Outbound,
|
|
48
|
+
z.ZodTypeDef,
|
|
49
|
+
AuthGetAccessTokenRequest
|
|
50
|
+
> = z.object({
|
|
51
|
+
xRefreshToken: z.string(),
|
|
52
|
+
}).transform((v) => {
|
|
53
|
+
return remap$(v, {
|
|
54
|
+
xRefreshToken: "X-Refresh-Token",
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export function authGetAccessTokenRequestToJSON(
|
|
59
|
+
authGetAccessTokenRequest: AuthGetAccessTokenRequest,
|
|
60
|
+
): string {
|
|
61
|
+
return JSON.stringify(
|
|
62
|
+
AuthGetAccessTokenRequest$outboundSchema.parse(authGetAccessTokenRequest),
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** @internal */
|
|
67
|
+
export const AuthGetAccessTokenResponse$inboundSchema: z.ZodType<
|
|
68
|
+
AuthGetAccessTokenResponse,
|
|
69
|
+
z.ZodTypeDef,
|
|
70
|
+
unknown
|
|
71
|
+
> = z.object({
|
|
72
|
+
data: models.V3AuthAccessTokenData$inboundSchema,
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
export function authGetAccessTokenResponseFromJSON(
|
|
76
|
+
jsonString: string,
|
|
77
|
+
): SafeParseResult<AuthGetAccessTokenResponse, SDKValidationError> {
|
|
78
|
+
return safeParse(
|
|
79
|
+
jsonString,
|
|
80
|
+
(x) => AuthGetAccessTokenResponse$inboundSchema.parse(JSON.parse(x)),
|
|
81
|
+
`Failed to parse 'AuthGetAccessTokenResponse' from JSON`,
|
|
82
|
+
);
|
|
83
|
+
}
|
|
@@ -13,6 +13,7 @@ export * from "./auditlogsgetauditlogbyid.js";
|
|
|
13
13
|
export * from "./auditlogsgetauditlogsexporthistorybyid.js";
|
|
14
14
|
export * from "./auditlogslistauditlogs.js";
|
|
15
15
|
export * from "./auditlogslistauditlogsexporthistory.js";
|
|
16
|
+
export * from "./authgetaccesstoken.js";
|
|
16
17
|
export * from "./communicationcardsarchiveslackchannel.js";
|
|
17
18
|
export * from "./communicationcardscreatecommunicationcard.js";
|
|
18
19
|
export * from "./communicationcardscreateslackchannelincommunicationcard.js";
|
package/src/models/security.ts
CHANGED
|
@@ -6,12 +6,12 @@ import * as z from "zod/v3";
|
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
|
|
8
8
|
export type Security = {
|
|
9
|
-
bearerAuth
|
|
9
|
+
bearerAuth?: string | undefined;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
/** @internal */
|
|
13
13
|
export type Security$Outbound = {
|
|
14
|
-
BearerAuth
|
|
14
|
+
BearerAuth?: string | undefined;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
/** @internal */
|
|
@@ -20,7 +20,7 @@ export const Security$outboundSchema: z.ZodType<
|
|
|
20
20
|
z.ZodTypeDef,
|
|
21
21
|
Security
|
|
22
22
|
> = z.object({
|
|
23
|
-
bearerAuth: z.string(),
|
|
23
|
+
bearerAuth: z.string().optional(),
|
|
24
24
|
}).transform((v) => {
|
|
25
25
|
return remap$(v, {
|
|
26
26
|
bearerAuth: "BearerAuth",
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Access token response returned by the OAuth endpoint.
|
|
13
|
+
*/
|
|
14
|
+
export type V3AuthAccessTokenData = {
|
|
15
|
+
/**
|
|
16
|
+
* JWT access token used as Bearer token for API requests.
|
|
17
|
+
*/
|
|
18
|
+
accessToken: string;
|
|
19
|
+
/**
|
|
20
|
+
* Unix timestamp when the access token expires.
|
|
21
|
+
*/
|
|
22
|
+
expiresAt: number;
|
|
23
|
+
/**
|
|
24
|
+
* Unix timestamp when the access token was issued.
|
|
25
|
+
*/
|
|
26
|
+
issuedAt: number;
|
|
27
|
+
/**
|
|
28
|
+
* Refresh token that can be used to obtain a new access token.
|
|
29
|
+
*/
|
|
30
|
+
refreshToken: string;
|
|
31
|
+
/**
|
|
32
|
+
* Token type, e.g. "Bearer".
|
|
33
|
+
*/
|
|
34
|
+
type: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** @internal */
|
|
38
|
+
export const V3AuthAccessTokenData$inboundSchema: z.ZodType<
|
|
39
|
+
V3AuthAccessTokenData,
|
|
40
|
+
z.ZodTypeDef,
|
|
41
|
+
unknown
|
|
42
|
+
> = z.object({
|
|
43
|
+
access_token: z.string(),
|
|
44
|
+
expires_at: z.number().int(),
|
|
45
|
+
issued_at: z.number().int(),
|
|
46
|
+
refresh_token: z.string(),
|
|
47
|
+
type: z.string(),
|
|
48
|
+
}).transform((v) => {
|
|
49
|
+
return remap$(v, {
|
|
50
|
+
"access_token": "accessToken",
|
|
51
|
+
"expires_at": "expiresAt",
|
|
52
|
+
"issued_at": "issuedAt",
|
|
53
|
+
"refresh_token": "refreshToken",
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export function v3AuthAccessTokenDataFromJSON(
|
|
58
|
+
jsonString: string,
|
|
59
|
+
): SafeParseResult<V3AuthAccessTokenData, SDKValidationError> {
|
|
60
|
+
return safeParse(
|
|
61
|
+
jsonString,
|
|
62
|
+
(x) => V3AuthAccessTokenData$inboundSchema.parse(JSON.parse(x)),
|
|
63
|
+
`Failed to parse 'V3AuthAccessTokenData' from JSON`,
|
|
64
|
+
);
|
|
65
|
+
}
|
package/src/sdk/auth.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { authAuthGetAccessToken } from "../funcs/authAuthGetAccessToken.js";
|
|
6
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
7
|
+
import * as operations from "../models/operations/index.js";
|
|
8
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
9
|
+
|
|
10
|
+
export class Auth extends ClientSDK {
|
|
11
|
+
/**
|
|
12
|
+
* Get Access Token
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Get access token to make authenticated HTTP requests to the Squadcast API.
|
|
16
|
+
* Send your refresh token (obtained from the Squadcast web application) in the
|
|
17
|
+
* `X-Refresh-Token` header.
|
|
18
|
+
*/
|
|
19
|
+
async authGetAccessToken(
|
|
20
|
+
request: operations.AuthGetAccessTokenRequest,
|
|
21
|
+
options?: RequestOptions,
|
|
22
|
+
): Promise<operations.AuthGetAccessTokenResponse> {
|
|
23
|
+
return unwrapAsync(authAuthGetAccessToken(
|
|
24
|
+
this,
|
|
25
|
+
request,
|
|
26
|
+
options,
|
|
27
|
+
));
|
|
28
|
+
}
|
|
29
|
+
}
|
package/src/sdk/sdk.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { ClientSDK } from "../lib/sdks.js";
|
|
6
6
|
import { Analytics } from "./analytics.js";
|
|
7
7
|
import { AuditLogs } from "./auditlogs.js";
|
|
8
|
+
import { Auth } from "./auth.js";
|
|
8
9
|
import { CommunicationCards } from "./communicationcards.js";
|
|
9
10
|
import { Components } from "./components.js";
|
|
10
11
|
import { DedupKeyOverlays } from "./dedupkeyoverlays.js";
|
|
@@ -50,6 +51,11 @@ import { WorkflowLogs } from "./workflowlogs.js";
|
|
|
50
51
|
import { Workflows } from "./workflows.js";
|
|
51
52
|
|
|
52
53
|
export class SquadcastSDK extends ClientSDK {
|
|
54
|
+
private _auth?: Auth;
|
|
55
|
+
get auth(): Auth {
|
|
56
|
+
return (this._auth ??= new Auth(this._options));
|
|
57
|
+
}
|
|
58
|
+
|
|
53
59
|
private _analytics?: Analytics;
|
|
54
60
|
get analytics(): Analytics {
|
|
55
61
|
return (this._analytics ??= new Analytics(this._options));
|