@unified-api/typescript-sdk 2.9.4 → 2.9.5

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 (127) hide show
  1. package/FUNCTIONS.md +108 -0
  2. package/README.md +36 -15
  3. package/RUNTIMES.md +22 -0
  4. package/docs/sdks/account/README.md +501 -0
  5. package/docs/sdks/accounting/README.md +3629 -0
  6. package/docs/sdks/activity/README.md +501 -0
  7. package/docs/sdks/apicall/README.md +165 -0
  8. package/docs/sdks/application/README.md +501 -0
  9. package/docs/sdks/applicationstatus/README.md +88 -0
  10. package/docs/sdks/ats/README.md +3710 -0
  11. package/docs/sdks/auth/README.md +173 -0
  12. package/docs/sdks/branch/README.md +501 -0
  13. package/docs/sdks/call/README.md +88 -0
  14. package/docs/sdks/candidate/README.md +501 -0
  15. package/docs/sdks/channel/README.md +171 -0
  16. package/docs/sdks/class/README.md +501 -0
  17. package/docs/sdks/collection/README.md +501 -0
  18. package/docs/sdks/commerce/README.md +2477 -0
  19. package/docs/sdks/commit/README.md +501 -0
  20. package/docs/sdks/company/README.md +1240 -0
  21. package/docs/sdks/connection/README.md +485 -0
  22. package/docs/sdks/contact/README.md +1489 -0
  23. package/docs/sdks/course/README.md +501 -0
  24. package/docs/sdks/crm/README.md +2971 -0
  25. package/docs/sdks/customer/README.md +501 -0
  26. package/docs/sdks/deal/README.md +501 -0
  27. package/docs/sdks/document/README.md +501 -0
  28. package/docs/sdks/employee/README.md +501 -0
  29. package/docs/sdks/enrich/README.md +169 -0
  30. package/docs/sdks/event/README.md +501 -0
  31. package/docs/sdks/file/README.md +501 -0
  32. package/docs/sdks/genai/README.md +169 -0
  33. package/docs/sdks/group/README.md +995 -0
  34. package/docs/sdks/hris/README.md +2311 -0
  35. package/docs/sdks/instructor/README.md +501 -0
  36. package/docs/sdks/integration/README.md +248 -0
  37. package/docs/sdks/interview/README.md +501 -0
  38. package/docs/sdks/inventory/README.md +501 -0
  39. package/docs/sdks/invoice/README.md +501 -0
  40. package/docs/sdks/issue/README.md +84 -0
  41. package/docs/sdks/item/README.md +501 -0
  42. package/docs/sdks/job/README.md +501 -0
  43. package/docs/sdks/journal/README.md +501 -0
  44. package/docs/sdks/kms/README.md +995 -0
  45. package/docs/sdks/lead/README.md +501 -0
  46. package/docs/sdks/link/README.md +501 -0
  47. package/docs/sdks/list/README.md +501 -0
  48. package/docs/sdks/lms/README.md +1983 -0
  49. package/docs/sdks/location/README.md +995 -0
  50. package/docs/sdks/login/README.md +90 -0
  51. package/docs/sdks/martech/README.md +995 -0
  52. package/docs/sdks/member/README.md +501 -0
  53. package/docs/sdks/message/README.md +501 -0
  54. package/docs/sdks/messaging/README.md +665 -0
  55. package/docs/sdks/metadata/README.md +501 -0
  56. package/docs/sdks/model/README.md +88 -0
  57. package/docs/sdks/note/README.md +501 -0
  58. package/docs/sdks/order/README.md +501 -0
  59. package/docs/sdks/organization/README.md +665 -0
  60. package/docs/sdks/page/README.md +501 -0
  61. package/docs/sdks/passthrough/README.md +671 -0
  62. package/docs/sdks/payment/README.md +1323 -0
  63. package/docs/sdks/payout/README.md +171 -0
  64. package/docs/sdks/payslip/README.md +171 -0
  65. package/docs/sdks/person/README.md +88 -0
  66. package/docs/sdks/pipeline/README.md +501 -0
  67. package/docs/sdks/project/README.md +501 -0
  68. package/docs/sdks/prompt/README.md +88 -0
  69. package/docs/sdks/pullrequest/README.md +501 -0
  70. package/docs/sdks/refund/README.md +171 -0
  71. package/docs/sdks/repo/README.md +2477 -0
  72. package/docs/sdks/repository/README.md +501 -0
  73. package/docs/sdks/scim/README.md +995 -0
  74. package/docs/sdks/scorecard/README.md +501 -0
  75. package/docs/sdks/space/README.md +501 -0
  76. package/docs/sdks/storage/README.md +501 -0
  77. package/docs/sdks/student/README.md +501 -0
  78. package/docs/sdks/task/README.md +995 -0
  79. package/docs/sdks/taxrate/README.md +501 -0
  80. package/docs/sdks/ticket/README.md +501 -0
  81. package/docs/sdks/ticketing/README.md +1489 -0
  82. package/docs/sdks/timeoff/README.md +171 -0
  83. package/docs/sdks/transaction/README.md +501 -0
  84. package/docs/sdks/uc/README.md +582 -0
  85. package/docs/sdks/unified/README.md +1601 -0
  86. package/docs/sdks/unifiedto/README.md +7 -0
  87. package/docs/sdks/user/README.md +501 -0
  88. package/docs/sdks/webhook/README.md +647 -0
  89. package/lib/config.d.ts +3 -3
  90. package/lib/config.js +3 -3
  91. package/lib/primitives.d.ts +2 -0
  92. package/lib/primitives.d.ts.map +1 -1
  93. package/lib/primitives.js +53 -0
  94. package/lib/primitives.js.map +1 -1
  95. package/package.json +3 -1
  96. package/sdk/models/shared/index.d.ts +1 -0
  97. package/sdk/models/shared/index.d.ts.map +1 -1
  98. package/sdk/models/shared/index.js +1 -0
  99. package/sdk/models/shared/index.js.map +1 -1
  100. package/sdk/models/shared/kmspage.d.ts +5 -0
  101. package/sdk/models/shared/kmspage.d.ts.map +1 -1
  102. package/sdk/models/shared/kmspage.js +7 -0
  103. package/sdk/models/shared/kmspage.js.map +1 -1
  104. package/sdk/models/shared/kmspagemetadata.d.ts +37 -0
  105. package/sdk/models/shared/kmspagemetadata.d.ts.map +1 -0
  106. package/sdk/models/shared/kmspagemetadata.js +63 -0
  107. package/sdk/models/shared/kmspagemetadata.js.map +1 -0
  108. package/sdk/models/shared/kmsspace.d.ts +2 -0
  109. package/sdk/models/shared/kmsspace.d.ts.map +1 -1
  110. package/sdk/models/shared/kmsspace.js +4 -0
  111. package/sdk/models/shared/kmsspace.js.map +1 -1
  112. package/sdk/models/shared/security.d.ts +2 -2
  113. package/sdk/models/shared/security.d.ts.map +1 -1
  114. package/sdk/models/shared/security.js +2 -2
  115. package/sdk/models/shared/security.js.map +1 -1
  116. package/sdk/types/operations.d.ts +5 -3
  117. package/sdk/types/operations.d.ts.map +1 -1
  118. package/sdk/types/operations.js +3 -0
  119. package/sdk/types/operations.js.map +1 -1
  120. package/src/lib/config.ts +3 -3
  121. package/src/lib/primitives.ts +62 -0
  122. package/src/sdk/models/shared/index.ts +1 -0
  123. package/src/sdk/models/shared/kmspage.ts +16 -0
  124. package/src/sdk/models/shared/kmspagemetadata.ts +72 -0
  125. package/src/sdk/models/shared/kmsspace.ts +6 -0
  126. package/src/sdk/models/shared/security.ts +4 -4
  127. package/src/sdk/types/operations.ts +11 -5
@@ -58,3 +58,65 @@ export function remap<
58
58
 
59
59
  return out;
60
60
  }
61
+
62
+ export function combineSignals(
63
+ ...signals: Array<AbortSignal | null | undefined>
64
+ ): AbortSignal | null {
65
+ const filtered: AbortSignal[] = [];
66
+ for (const signal of signals) {
67
+ if (signal) {
68
+ filtered.push(signal);
69
+ }
70
+ }
71
+
72
+ switch (filtered.length) {
73
+ case 0:
74
+ case 1:
75
+ return filtered[0] || null;
76
+ default:
77
+ if ("any" in AbortSignal && typeof AbortSignal.any === "function") {
78
+ return AbortSignal.any(filtered);
79
+ }
80
+ return abortSignalAny(filtered);
81
+ }
82
+ }
83
+
84
+ export function abortSignalAny(signals: AbortSignal[]): AbortSignal {
85
+ const controller = new AbortController();
86
+ const result = controller.signal;
87
+ if (!signals.length) {
88
+ return controller.signal;
89
+ }
90
+
91
+ if (signals.length === 1) {
92
+ return signals[0] || controller.signal;
93
+ }
94
+
95
+ for (const signal of signals) {
96
+ if (signal.aborted) {
97
+ return signal;
98
+ }
99
+ }
100
+
101
+ function abort(this: AbortSignal) {
102
+ controller.abort(this.reason);
103
+ clean();
104
+ }
105
+
106
+ const signalRefs: WeakRef<AbortSignal>[] = [];
107
+ function clean() {
108
+ for (const signalRef of signalRefs) {
109
+ const signal = signalRef.deref();
110
+ if (signal) {
111
+ signal.removeEventListener("abort", abort);
112
+ }
113
+ }
114
+ }
115
+
116
+ for (const signal of signals) {
117
+ signalRefs.push(new WeakRef(signal));
118
+ signal.addEventListener("abort", abort);
119
+ }
120
+
121
+ return result;
122
+ }
@@ -77,6 +77,7 @@ export * from "./integration.js";
77
77
  export * from "./integrationsupport.js";
78
78
  export * from "./issue.js";
79
79
  export * from "./kmspage.js";
80
+ export * from "./kmspagemetadata.js";
80
81
  export * from "./kmsspace.js";
81
82
  export * from "./lmsclass.js";
82
83
  export * from "./lmscourse.js";
@@ -8,6 +8,12 @@ import { safeParse } from "../../../lib/schemas.js";
8
8
  import { ClosedEnum } from "../../types/enums.js";
9
9
  import { Result as SafeParseResult } from "../../types/fp.js";
10
10
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+ import {
12
+ KmsPageMetadata,
13
+ KmsPageMetadata$inboundSchema,
14
+ KmsPageMetadata$Outbound,
15
+ KmsPageMetadata$outboundSchema,
16
+ } from "./kmspagemetadata.js";
11
17
 
12
18
  export const KmsPageType = {
13
19
  Html: "HTML",
@@ -19,8 +25,10 @@ export type KmsPageType = ClosedEnum<typeof KmsPageType>;
19
25
  export type KmsPage = {
20
26
  createdAt?: Date | undefined;
21
27
  downloadUrl: string;
28
+ hasChildren?: boolean | undefined;
22
29
  id?: string | undefined;
23
30
  isActive?: boolean | undefined;
31
+ metadata?: Array<KmsPageMetadata> | undefined;
24
32
  parentPageId?: string | undefined;
25
33
  raw?: { [k: string]: any } | undefined;
26
34
  spaceId: string;
@@ -56,8 +64,10 @@ export const KmsPage$inboundSchema: z.ZodType<KmsPage, z.ZodTypeDef, unknown> =
56
64
  new Date(v)
57
65
  ).optional(),
58
66
  download_url: z.string(),
67
+ has_children: z.boolean().optional(),
59
68
  id: z.string().optional(),
60
69
  is_active: z.boolean().optional(),
70
+ metadata: z.array(KmsPageMetadata$inboundSchema).optional(),
61
71
  parent_page_id: z.string().optional(),
62
72
  raw: z.record(z.any()).optional(),
63
73
  space_id: z.string(),
@@ -71,6 +81,7 @@ export const KmsPage$inboundSchema: z.ZodType<KmsPage, z.ZodTypeDef, unknown> =
71
81
  return remap$(v, {
72
82
  "created_at": "createdAt",
73
83
  "download_url": "downloadUrl",
84
+ "has_children": "hasChildren",
74
85
  "is_active": "isActive",
75
86
  "parent_page_id": "parentPageId",
76
87
  "space_id": "spaceId",
@@ -83,8 +94,10 @@ export const KmsPage$inboundSchema: z.ZodType<KmsPage, z.ZodTypeDef, unknown> =
83
94
  export type KmsPage$Outbound = {
84
95
  created_at?: string | undefined;
85
96
  download_url: string;
97
+ has_children?: boolean | undefined;
86
98
  id?: string | undefined;
87
99
  is_active?: boolean | undefined;
100
+ metadata?: Array<KmsPageMetadata$Outbound> | undefined;
88
101
  parent_page_id?: string | undefined;
89
102
  raw?: { [k: string]: any } | undefined;
90
103
  space_id: string;
@@ -102,8 +115,10 @@ export const KmsPage$outboundSchema: z.ZodType<
102
115
  > = z.object({
103
116
  createdAt: z.date().transform(v => v.toISOString()).optional(),
104
117
  downloadUrl: z.string(),
118
+ hasChildren: z.boolean().optional(),
105
119
  id: z.string().optional(),
106
120
  isActive: z.boolean().optional(),
121
+ metadata: z.array(KmsPageMetadata$outboundSchema).optional(),
107
122
  parentPageId: z.string().optional(),
108
123
  raw: z.record(z.any()).optional(),
109
124
  spaceId: z.string(),
@@ -115,6 +130,7 @@ export const KmsPage$outboundSchema: z.ZodType<
115
130
  return remap$(v, {
116
131
  createdAt: "created_at",
117
132
  downloadUrl: "download_url",
133
+ hasChildren: "has_children",
118
134
  isActive: "is_active",
119
135
  parentPageId: "parent_page_id",
120
136
  spaceId: "space_id",
@@ -0,0 +1,72 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type KmsPageMetadata = {
11
+ name: string;
12
+ type?: string | undefined;
13
+ value?: { [k: string]: any } | undefined;
14
+ };
15
+
16
+ /** @internal */
17
+ export const KmsPageMetadata$inboundSchema: z.ZodType<
18
+ KmsPageMetadata,
19
+ z.ZodTypeDef,
20
+ unknown
21
+ > = z.object({
22
+ name: z.string(),
23
+ type: z.string().optional(),
24
+ value: z.record(z.any()).optional(),
25
+ });
26
+
27
+ /** @internal */
28
+ export type KmsPageMetadata$Outbound = {
29
+ name: string;
30
+ type?: string | undefined;
31
+ value?: { [k: string]: any } | undefined;
32
+ };
33
+
34
+ /** @internal */
35
+ export const KmsPageMetadata$outboundSchema: z.ZodType<
36
+ KmsPageMetadata$Outbound,
37
+ z.ZodTypeDef,
38
+ KmsPageMetadata
39
+ > = z.object({
40
+ name: z.string(),
41
+ type: z.string().optional(),
42
+ value: z.record(z.any()).optional(),
43
+ });
44
+
45
+ /**
46
+ * @internal
47
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
48
+ */
49
+ export namespace KmsPageMetadata$ {
50
+ /** @deprecated use `KmsPageMetadata$inboundSchema` instead. */
51
+ export const inboundSchema = KmsPageMetadata$inboundSchema;
52
+ /** @deprecated use `KmsPageMetadata$outboundSchema` instead. */
53
+ export const outboundSchema = KmsPageMetadata$outboundSchema;
54
+ /** @deprecated use `KmsPageMetadata$Outbound` instead. */
55
+ export type Outbound = KmsPageMetadata$Outbound;
56
+ }
57
+
58
+ export function kmsPageMetadataToJSON(
59
+ kmsPageMetadata: KmsPageMetadata,
60
+ ): string {
61
+ return JSON.stringify(KmsPageMetadata$outboundSchema.parse(kmsPageMetadata));
62
+ }
63
+
64
+ export function kmsPageMetadataFromJSON(
65
+ jsonString: string,
66
+ ): SafeParseResult<KmsPageMetadata, SDKValidationError> {
67
+ return safeParse(
68
+ jsonString,
69
+ (x) => KmsPageMetadata$inboundSchema.parse(JSON.parse(x)),
70
+ `Failed to parse 'KmsPageMetadata' from JSON`,
71
+ );
72
+ }
@@ -14,6 +14,7 @@ export type KmsSpace = {
14
14
  id?: string | undefined;
15
15
  isActive?: boolean | undefined;
16
16
  name: string;
17
+ parentPageId?: string | undefined;
17
18
  parentSpaceId?: string | undefined;
18
19
  raw?: { [k: string]: any } | undefined;
19
20
  updatedAt?: Date | undefined;
@@ -32,6 +33,7 @@ export const KmsSpace$inboundSchema: z.ZodType<
32
33
  id: z.string().optional(),
33
34
  is_active: z.boolean().optional(),
34
35
  name: z.string(),
36
+ parent_page_id: z.string().optional(),
35
37
  parent_space_id: z.string().default("sp"),
36
38
  raw: z.record(z.any()).optional(),
37
39
  updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
@@ -41,6 +43,7 @@ export const KmsSpace$inboundSchema: z.ZodType<
41
43
  return remap$(v, {
42
44
  "created_at": "createdAt",
43
45
  "is_active": "isActive",
46
+ "parent_page_id": "parentPageId",
44
47
  "parent_space_id": "parentSpaceId",
45
48
  "updated_at": "updatedAt",
46
49
  "user_id": "userId",
@@ -54,6 +57,7 @@ export type KmsSpace$Outbound = {
54
57
  id?: string | undefined;
55
58
  is_active?: boolean | undefined;
56
59
  name: string;
60
+ parent_page_id?: string | undefined;
57
61
  parent_space_id: string;
58
62
  raw?: { [k: string]: any } | undefined;
59
63
  updated_at?: string | undefined;
@@ -71,6 +75,7 @@ export const KmsSpace$outboundSchema: z.ZodType<
71
75
  id: z.string().optional(),
72
76
  isActive: z.boolean().optional(),
73
77
  name: z.string(),
78
+ parentPageId: z.string().optional(),
74
79
  parentSpaceId: z.string().default("sp"),
75
80
  raw: z.record(z.any()).optional(),
76
81
  updatedAt: z.date().transform(v => v.toISOString()).optional(),
@@ -79,6 +84,7 @@ export const KmsSpace$outboundSchema: z.ZodType<
79
84
  return remap$(v, {
80
85
  createdAt: "created_at",
81
86
  isActive: "is_active",
87
+ parentPageId: "parent_page_id",
82
88
  parentSpaceId: "parent_space_id",
83
89
  updatedAt: "updated_at",
84
90
  userId: "user_id",
@@ -8,7 +8,7 @@ import { Result as SafeParseResult } from "../../types/fp.js";
8
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
9
 
10
10
  export type Security = {
11
- jwt?: string | undefined;
11
+ jwt: string;
12
12
  };
13
13
 
14
14
  /** @internal */
@@ -17,12 +17,12 @@ export const Security$inboundSchema: z.ZodType<
17
17
  z.ZodTypeDef,
18
18
  unknown
19
19
  > = z.object({
20
- jwt: z.string().optional(),
20
+ jwt: z.string(),
21
21
  });
22
22
 
23
23
  /** @internal */
24
24
  export type Security$Outbound = {
25
- jwt?: string | undefined;
25
+ jwt: string;
26
26
  };
27
27
 
28
28
  /** @internal */
@@ -31,7 +31,7 @@ export const Security$outboundSchema: z.ZodType<
31
31
  z.ZodTypeDef,
32
32
  Security
33
33
  > = z.object({
34
- jwt: z.string().optional(),
34
+ jwt: z.string(),
35
35
  });
36
36
 
37
37
  /**
@@ -6,9 +6,10 @@ import { Result } from "./fp.js";
6
6
 
7
7
  export type Paginator<V> = () => Promise<V & { next: Paginator<V> }> | null;
8
8
 
9
- export type PageIterator<V> = V & {
9
+ export type PageIterator<V, PageState = unknown> = V & {
10
10
  next: Paginator<V>;
11
11
  [Symbol.asyncIterator]: () => AsyncIterableIterator<V>;
12
+ "~next"?: PageState | undefined;
12
13
  };
13
14
 
14
15
  export function createPageIterator<V>(
@@ -40,7 +41,9 @@ export function createPageIterator<V>(
40
41
  * terminates. It is useful in paginated SDK functions that have early return
41
42
  * paths when things go wrong.
42
43
  */
43
- export function haltIterator<V extends object>(v: V): PageIterator<V> {
44
+ export function haltIterator<V extends object>(
45
+ v: V,
46
+ ): PageIterator<V, undefined> {
44
47
  return {
45
48
  ...v,
46
49
  next: () => null,
@@ -54,9 +57,9 @@ export function haltIterator<V extends object>(v: V): PageIterator<V> {
54
57
  * Converts an async iterator of `Result<V, E>` into an async iterator of `V`.
55
58
  * When error results occur, the underlying error value is thrown.
56
59
  */
57
- export async function unwrapResultIterator<V>(
58
- iteratorPromise: Promise<PageIterator<Result<V, unknown>>>,
59
- ): Promise<PageIterator<V>> {
60
+ export async function unwrapResultIterator<V, PageState>(
61
+ iteratorPromise: Promise<PageIterator<Result<V, unknown>, PageState>>,
62
+ ): Promise<PageIterator<V, PageState>> {
60
63
  const resultIter = await iteratorPromise;
61
64
 
62
65
  if (!resultIter.ok) {
@@ -66,6 +69,7 @@ export async function unwrapResultIterator<V>(
66
69
  return {
67
70
  ...resultIter.value,
68
71
  next: unwrapPaginator(resultIter.next),
72
+ "~next": resultIter["~next"],
69
73
  [Symbol.asyncIterator]: async function* paginator() {
70
74
  for await (const page of resultIter) {
71
75
  if (!page.ok) {
@@ -97,3 +101,5 @@ function unwrapPaginator<V>(
97
101
  });
98
102
  };
99
103
  }
104
+
105
+ export const URL_OVERRIDE = Symbol("URL_OVERRIDE");