@solarwinds/squadcast-sdk-typescript 1.1.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.
Files changed (149) hide show
  1. package/FUNCTIONS.md +5 -8
  2. package/README.md +138 -36
  3. package/dist/commonjs/funcs/authAuthGetAccessToken.d.ts +20 -0
  4. package/dist/commonjs/funcs/authAuthGetAccessToken.d.ts.map +1 -0
  5. package/dist/commonjs/funcs/authAuthGetAccessToken.js +134 -0
  6. package/dist/commonjs/funcs/authAuthGetAccessToken.js.map +1 -0
  7. package/dist/commonjs/funcs/escalationPoliciesUpdate.js +4 -1
  8. package/dist/commonjs/funcs/escalationPoliciesUpdate.js.map +1 -1
  9. package/dist/commonjs/funcs/workflowsUpdateAction.d.ts +1 -2
  10. package/dist/commonjs/funcs/workflowsUpdateAction.d.ts.map +1 -1
  11. package/dist/commonjs/funcs/workflowsUpdateAction.js +1 -2
  12. package/dist/commonjs/funcs/workflowsUpdateAction.js.map +1 -1
  13. package/dist/commonjs/lib/config.d.ts +4 -4
  14. package/dist/commonjs/lib/config.d.ts.map +1 -1
  15. package/dist/commonjs/lib/config.js +8 -4
  16. package/dist/commonjs/lib/config.js.map +1 -1
  17. package/dist/commonjs/lib/matchers.d.ts.map +1 -1
  18. package/dist/commonjs/lib/matchers.js +0 -1
  19. package/dist/commonjs/lib/matchers.js.map +1 -1
  20. package/dist/commonjs/lib/security.d.ts.map +1 -1
  21. package/dist/commonjs/lib/security.js +1 -2
  22. package/dist/commonjs/lib/security.js.map +1 -1
  23. package/dist/commonjs/models/errors/authgetaccesstoken.d.ts +352 -0
  24. package/dist/commonjs/models/errors/authgetaccesstoken.d.ts.map +1 -0
  25. package/dist/commonjs/models/errors/authgetaccesstoken.js +424 -0
  26. package/dist/commonjs/models/errors/authgetaccesstoken.js.map +1 -0
  27. package/dist/commonjs/models/errors/index.d.ts +1 -1
  28. package/dist/commonjs/models/errors/index.d.ts.map +1 -1
  29. package/dist/commonjs/models/errors/index.js +1 -1
  30. package/dist/commonjs/models/errors/index.js.map +1 -1
  31. package/dist/commonjs/models/index.d.ts +1 -0
  32. package/dist/commonjs/models/index.d.ts.map +1 -1
  33. package/dist/commonjs/models/index.js +1 -0
  34. package/dist/commonjs/models/index.js.map +1 -1
  35. package/dist/commonjs/models/operations/authgetaccesstoken.d.ts +31 -0
  36. package/dist/commonjs/models/operations/authgetaccesstoken.d.ts.map +1 -0
  37. package/dist/commonjs/models/operations/authgetaccesstoken.js +74 -0
  38. package/dist/commonjs/models/operations/authgetaccesstoken.js.map +1 -0
  39. package/dist/commonjs/models/operations/index.d.ts +1 -0
  40. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  41. package/dist/commonjs/models/operations/index.js +1 -0
  42. package/dist/commonjs/models/operations/index.js.map +1 -1
  43. package/dist/commonjs/models/operations/workflowsupdateworkflowaction.d.ts +29 -0
  44. package/dist/commonjs/models/operations/workflowsupdateworkflowaction.d.ts.map +1 -1
  45. package/dist/commonjs/models/operations/workflowsupdateworkflowaction.js +49 -1
  46. package/dist/commonjs/models/operations/workflowsupdateworkflowaction.js.map +1 -1
  47. package/dist/commonjs/models/security.d.ts +2 -2
  48. package/dist/commonjs/models/security.d.ts.map +1 -1
  49. package/dist/commonjs/models/security.js +1 -1
  50. package/dist/commonjs/models/security.js.map +1 -1
  51. package/dist/commonjs/models/v3authaccesstokendata.d.ts +32 -0
  52. package/dist/commonjs/models/v3authaccesstokendata.d.ts.map +1 -0
  53. package/dist/commonjs/models/v3authaccesstokendata.js +62 -0
  54. package/dist/commonjs/models/v3authaccesstokendata.js.map +1 -0
  55. package/dist/commonjs/sdk/auth.d.ts +14 -0
  56. package/dist/commonjs/sdk/auth.d.ts.map +1 -0
  57. package/dist/commonjs/sdk/auth.js +24 -0
  58. package/dist/commonjs/sdk/auth.js.map +1 -0
  59. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  60. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  61. package/dist/commonjs/sdk/sdk.js +4 -0
  62. package/dist/commonjs/sdk/sdk.js.map +1 -1
  63. package/dist/commonjs/sdk/workflows.d.ts +1 -1
  64. package/dist/commonjs/sdk/workflows.d.ts.map +1 -1
  65. package/dist/esm/funcs/authAuthGetAccessToken.d.ts +20 -0
  66. package/dist/esm/funcs/authAuthGetAccessToken.d.ts.map +1 -0
  67. package/dist/esm/funcs/authAuthGetAccessToken.js +98 -0
  68. package/dist/esm/funcs/authAuthGetAccessToken.js.map +1 -0
  69. package/dist/esm/funcs/escalationPoliciesUpdate.js +4 -1
  70. package/dist/esm/funcs/escalationPoliciesUpdate.js.map +1 -1
  71. package/dist/esm/funcs/workflowsUpdateAction.d.ts +1 -2
  72. package/dist/esm/funcs/workflowsUpdateAction.d.ts.map +1 -1
  73. package/dist/esm/funcs/workflowsUpdateAction.js +1 -2
  74. package/dist/esm/funcs/workflowsUpdateAction.js.map +1 -1
  75. package/dist/esm/lib/config.d.ts +4 -4
  76. package/dist/esm/lib/config.d.ts.map +1 -1
  77. package/dist/esm/lib/config.js +8 -4
  78. package/dist/esm/lib/config.js.map +1 -1
  79. package/dist/esm/lib/matchers.d.ts.map +1 -1
  80. package/dist/esm/lib/matchers.js +0 -1
  81. package/dist/esm/lib/matchers.js.map +1 -1
  82. package/dist/esm/lib/security.d.ts.map +1 -1
  83. package/dist/esm/lib/security.js +1 -2
  84. package/dist/esm/lib/security.js.map +1 -1
  85. package/dist/esm/models/errors/authgetaccesstoken.d.ts +352 -0
  86. package/dist/esm/models/errors/authgetaccesstoken.d.ts.map +1 -0
  87. package/dist/esm/models/errors/authgetaccesstoken.js +374 -0
  88. package/dist/esm/models/errors/authgetaccesstoken.js.map +1 -0
  89. package/dist/esm/models/errors/index.d.ts +1 -1
  90. package/dist/esm/models/errors/index.d.ts.map +1 -1
  91. package/dist/esm/models/errors/index.js +1 -1
  92. package/dist/esm/models/errors/index.js.map +1 -1
  93. package/dist/esm/models/index.d.ts +1 -0
  94. package/dist/esm/models/index.d.ts.map +1 -1
  95. package/dist/esm/models/index.js +1 -0
  96. package/dist/esm/models/index.js.map +1 -1
  97. package/dist/esm/models/operations/authgetaccesstoken.d.ts +31 -0
  98. package/dist/esm/models/operations/authgetaccesstoken.d.ts.map +1 -0
  99. package/dist/esm/models/operations/authgetaccesstoken.js +36 -0
  100. package/dist/esm/models/operations/authgetaccesstoken.js.map +1 -0
  101. package/dist/esm/models/operations/index.d.ts +1 -0
  102. package/dist/esm/models/operations/index.d.ts.map +1 -1
  103. package/dist/esm/models/operations/index.js +1 -0
  104. package/dist/esm/models/operations/index.js.map +1 -1
  105. package/dist/esm/models/operations/workflowsupdateworkflowaction.d.ts +29 -0
  106. package/dist/esm/models/operations/workflowsupdateworkflowaction.d.ts.map +1 -1
  107. package/dist/esm/models/operations/workflowsupdateworkflowaction.js +45 -0
  108. package/dist/esm/models/operations/workflowsupdateworkflowaction.js.map +1 -1
  109. package/dist/esm/models/security.d.ts +2 -2
  110. package/dist/esm/models/security.d.ts.map +1 -1
  111. package/dist/esm/models/security.js +1 -1
  112. package/dist/esm/models/security.js.map +1 -1
  113. package/dist/esm/models/v3authaccesstokendata.d.ts +32 -0
  114. package/dist/esm/models/v3authaccesstokendata.d.ts.map +1 -0
  115. package/dist/esm/models/v3authaccesstokendata.js +25 -0
  116. package/dist/esm/models/v3authaccesstokendata.js.map +1 -0
  117. package/dist/esm/sdk/auth.d.ts +14 -0
  118. package/dist/esm/sdk/auth.d.ts.map +1 -0
  119. package/dist/esm/sdk/auth.js +20 -0
  120. package/dist/esm/sdk/auth.js.map +1 -0
  121. package/dist/esm/sdk/sdk.d.ts +3 -0
  122. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  123. package/dist/esm/sdk/sdk.js +4 -0
  124. package/dist/esm/sdk/sdk.js.map +1 -1
  125. package/dist/esm/sdk/workflows.d.ts +1 -1
  126. package/dist/esm/sdk/workflows.d.ts.map +1 -1
  127. package/examples/authAuthGetAccessToken.example.ts +26 -0
  128. package/jsr.json +1 -1
  129. package/package.json +5 -5
  130. package/src/funcs/authAuthGetAccessToken.ts +229 -0
  131. package/src/funcs/escalationPoliciesUpdate.ts +7 -1
  132. package/src/funcs/workflowsUpdateAction.ts +4 -5
  133. package/src/lib/config.ts +8 -4
  134. package/src/lib/matchers.ts +3 -2
  135. package/src/lib/security.ts +1 -2
  136. package/src/models/errors/authgetaccesstoken.ts +751 -0
  137. package/src/models/errors/index.ts +1 -1
  138. package/src/models/index.ts +1 -0
  139. package/src/models/operations/authgetaccesstoken.ts +83 -0
  140. package/src/models/operations/index.ts +1 -0
  141. package/src/models/operations/workflowsupdateworkflowaction.ts +122 -0
  142. package/src/models/security.ts +3 -3
  143. package/src/models/v3authaccesstokendata.ts +65 -0
  144. package/src/sdk/auth.ts +29 -0
  145. package/src/sdk/sdk.ts +6 -0
  146. package/src/sdk/workflows.ts +1 -1
  147. package/examples/package-lock.json +0 -611
  148. package/examples/package.json +0 -18
  149. package/tsconfig.json +0 -40
@@ -2,7 +2,7 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
- export * from "./analyticsgetorganalytics.js";
5
+ export * from "./authgetaccesstoken.js";
6
6
  export * from "./commonv4error.js";
7
7
  export * from "./httpclienterrors.js";
8
8
  export * from "./responsevalidationerror.js";
@@ -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";
@@ -4,6 +4,10 @@
4
4
 
5
5
  import * as z from "zod/v3";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
7
11
  import * as models from "../index.js";
8
12
 
9
13
  export type WorkflowsUpdateWorkflowActionRequest = {
@@ -14,6 +18,43 @@ export type WorkflowsUpdateWorkflowActionRequest = {
14
18
  | undefined;
15
19
  };
16
20
 
21
+ export const Name = {
22
+ SqAttachRunbooks: "sq_attach_runbooks",
23
+ } as const;
24
+ export type Name = ClosedEnum<typeof Name>;
25
+
26
+ export type WorkflowsUpdateWorkflowActionData = {
27
+ runbooks: Array<models.V3WorkflowsRunbookResponse>;
28
+ };
29
+
30
+ export type SqAttachRunbooks = {
31
+ name: Name;
32
+ data: WorkflowsUpdateWorkflowActionData;
33
+ };
34
+
35
+ /**
36
+ * The request has succeeded.
37
+ */
38
+ export type WorkflowsUpdateWorkflowActionResponse =
39
+ | SqAttachRunbooks
40
+ | models.V3WorkflowsSqMarkIncidentSLOAffecting
41
+ | models.V3WorkflowsSqTriggerManualWebhook
42
+ | models.V3WorkflowsUpdateIncidentPriority
43
+ | models.V3WorkflowsSqCreateStatusPageIssue
44
+ | models.V3WorkflowsSqAddIncidentNote
45
+ | models.V3WorkflowsSqAddCommunicationChannel
46
+ | models.V3WorkflowsSlackMessageChannel
47
+ | models.V3WorkflowsSlackMessageUser
48
+ | models.V3WorkflowsSqMakeHTTPCall
49
+ | models.V3WorkflowsSlackCreateIncidentChannel
50
+ | models.V3WorkflowsJiraCreateTicket
51
+ | models.V3WorkflowsMsTeamsMessageChannel
52
+ | models.V3WorkflowsMsTeamsMessageUser
53
+ | models.V3WorkflowsSqSendEmail
54
+ | models.V3WorkflowsSlackArchiveChannel
55
+ | models.V3WorkflowsMsTeamsCreateMeetingLink
56
+ | any;
57
+
17
58
  /** @internal */
18
59
  export type WorkflowsUpdateWorkflowActionRequest$Outbound = {
19
60
  workflowID: string;
@@ -48,3 +89,84 @@ export function workflowsUpdateWorkflowActionRequestToJSON(
48
89
  ),
49
90
  );
50
91
  }
92
+
93
+ /** @internal */
94
+ export const Name$inboundSchema: z.ZodNativeEnum<typeof Name> = z.nativeEnum(
95
+ Name,
96
+ );
97
+
98
+ /** @internal */
99
+ export const WorkflowsUpdateWorkflowActionData$inboundSchema: z.ZodType<
100
+ WorkflowsUpdateWorkflowActionData,
101
+ z.ZodTypeDef,
102
+ unknown
103
+ > = z.object({
104
+ runbooks: z.array(models.V3WorkflowsRunbookResponse$inboundSchema),
105
+ });
106
+
107
+ export function workflowsUpdateWorkflowActionDataFromJSON(
108
+ jsonString: string,
109
+ ): SafeParseResult<WorkflowsUpdateWorkflowActionData, SDKValidationError> {
110
+ return safeParse(
111
+ jsonString,
112
+ (x) => WorkflowsUpdateWorkflowActionData$inboundSchema.parse(JSON.parse(x)),
113
+ `Failed to parse 'WorkflowsUpdateWorkflowActionData' from JSON`,
114
+ );
115
+ }
116
+
117
+ /** @internal */
118
+ export const SqAttachRunbooks$inboundSchema: z.ZodType<
119
+ SqAttachRunbooks,
120
+ z.ZodTypeDef,
121
+ unknown
122
+ > = z.object({
123
+ name: Name$inboundSchema,
124
+ data: z.lazy(() => WorkflowsUpdateWorkflowActionData$inboundSchema),
125
+ });
126
+
127
+ export function sqAttachRunbooksFromJSON(
128
+ jsonString: string,
129
+ ): SafeParseResult<SqAttachRunbooks, SDKValidationError> {
130
+ return safeParse(
131
+ jsonString,
132
+ (x) => SqAttachRunbooks$inboundSchema.parse(JSON.parse(x)),
133
+ `Failed to parse 'SqAttachRunbooks' from JSON`,
134
+ );
135
+ }
136
+
137
+ /** @internal */
138
+ export const WorkflowsUpdateWorkflowActionResponse$inboundSchema: z.ZodType<
139
+ WorkflowsUpdateWorkflowActionResponse,
140
+ z.ZodTypeDef,
141
+ unknown
142
+ > = z.union([
143
+ z.lazy(() => SqAttachRunbooks$inboundSchema),
144
+ models.V3WorkflowsSqMarkIncidentSLOAffecting$inboundSchema,
145
+ models.V3WorkflowsSqTriggerManualWebhook$inboundSchema,
146
+ models.V3WorkflowsUpdateIncidentPriority$inboundSchema,
147
+ models.V3WorkflowsSqCreateStatusPageIssue$inboundSchema,
148
+ models.V3WorkflowsSqAddIncidentNote$inboundSchema,
149
+ models.V3WorkflowsSqAddCommunicationChannel$inboundSchema,
150
+ models.V3WorkflowsSlackMessageChannel$inboundSchema,
151
+ models.V3WorkflowsSlackMessageUser$inboundSchema,
152
+ models.V3WorkflowsSqMakeHTTPCall$inboundSchema,
153
+ models.V3WorkflowsSlackCreateIncidentChannel$inboundSchema,
154
+ models.V3WorkflowsJiraCreateTicket$inboundSchema,
155
+ models.V3WorkflowsMsTeamsMessageChannel$inboundSchema,
156
+ models.V3WorkflowsMsTeamsMessageUser$inboundSchema,
157
+ models.V3WorkflowsSqSendEmail$inboundSchema,
158
+ models.V3WorkflowsSlackArchiveChannel$inboundSchema,
159
+ models.V3WorkflowsMsTeamsCreateMeetingLink$inboundSchema,
160
+ z.any(),
161
+ ]);
162
+
163
+ export function workflowsUpdateWorkflowActionResponseFromJSON(
164
+ jsonString: string,
165
+ ): SafeParseResult<WorkflowsUpdateWorkflowActionResponse, SDKValidationError> {
166
+ return safeParse(
167
+ jsonString,
168
+ (x) =>
169
+ WorkflowsUpdateWorkflowActionResponse$inboundSchema.parse(JSON.parse(x)),
170
+ `Failed to parse 'WorkflowsUpdateWorkflowActionResponse' from JSON`,
171
+ );
172
+ }
@@ -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: string;
9
+ bearerAuth?: string | undefined;
10
10
  };
11
11
 
12
12
  /** @internal */
13
13
  export type Security$Outbound = {
14
- BearerAuth: string;
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
+ }
@@ -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));
@@ -172,7 +172,7 @@ export class Workflows extends ClientSDK {
172
172
  async updateAction(
173
173
  request: operations.WorkflowsUpdateWorkflowActionRequest,
174
174
  options?: RequestOptions,
175
- ): Promise<models.V3WorkflowsActionResponse> {
175
+ ): Promise<operations.WorkflowsUpdateWorkflowActionResponse> {
176
176
  return unwrapAsync(workflowsUpdateAction(
177
177
  this,
178
178
  request,