@ominity/api-typescript 1.1.5 → 1.2.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 (242) hide show
  1. package/README.md +1 -0
  2. package/dist/commonjs/funcs/cms/contentCreate.d.ts +11 -0
  3. package/dist/commonjs/funcs/cms/contentCreate.d.ts.map +1 -0
  4. package/dist/commonjs/funcs/cms/contentCreate.js +110 -0
  5. package/dist/commonjs/funcs/cms/contentCreate.js.map +1 -0
  6. package/dist/commonjs/funcs/cms/contentDelete.d.ts +10 -0
  7. package/dist/commonjs/funcs/cms/contentDelete.d.ts.map +1 -0
  8. package/dist/commonjs/funcs/cms/contentDelete.js +110 -0
  9. package/dist/commonjs/funcs/cms/contentDelete.js.map +1 -0
  10. package/dist/commonjs/funcs/cms/contentGet.d.ts +11 -0
  11. package/dist/commonjs/funcs/cms/contentGet.d.ts.map +1 -0
  12. package/dist/commonjs/funcs/cms/contentGet.js +110 -0
  13. package/dist/commonjs/funcs/cms/contentGet.js.map +1 -0
  14. package/dist/commonjs/funcs/cms/contentList.d.ts +11 -0
  15. package/dist/commonjs/funcs/cms/contentList.d.ts.map +1 -0
  16. package/dist/commonjs/funcs/cms/contentList.js +117 -0
  17. package/dist/commonjs/funcs/cms/contentList.js.map +1 -0
  18. package/dist/commonjs/funcs/cms/contentTypesGet.d.ts +10 -0
  19. package/dist/commonjs/funcs/cms/contentTypesGet.d.ts.map +1 -0
  20. package/dist/commonjs/funcs/cms/contentTypesGet.js +114 -0
  21. package/dist/commonjs/funcs/cms/contentTypesGet.js.map +1 -0
  22. package/dist/commonjs/funcs/cms/contentTypesList.d.ts +10 -0
  23. package/dist/commonjs/funcs/cms/contentTypesList.d.ts.map +1 -0
  24. package/dist/commonjs/funcs/cms/contentTypesList.js +121 -0
  25. package/dist/commonjs/funcs/cms/contentTypesList.js.map +1 -0
  26. package/dist/commonjs/funcs/cms/contentUpdate.d.ts +11 -0
  27. package/dist/commonjs/funcs/cms/contentUpdate.d.ts.map +1 -0
  28. package/dist/commonjs/funcs/cms/contentUpdate.js +111 -0
  29. package/dist/commonjs/funcs/cms/contentUpdate.js.map +1 -0
  30. package/dist/commonjs/funcs/cms/index.d.ts +7 -0
  31. package/dist/commonjs/funcs/cms/index.d.ts.map +1 -1
  32. package/dist/commonjs/funcs/cms/index.js +7 -0
  33. package/dist/commonjs/funcs/cms/index.js.map +1 -1
  34. package/dist/commonjs/funcs/index.d.ts +1 -0
  35. package/dist/commonjs/funcs/index.d.ts.map +1 -1
  36. package/dist/commonjs/funcs/index.js +1 -0
  37. package/dist/commonjs/funcs/index.js.map +1 -1
  38. package/dist/commonjs/index.d.ts +1 -0
  39. package/dist/commonjs/index.d.ts.map +1 -1
  40. package/dist/commonjs/index.js +1 -0
  41. package/dist/commonjs/index.js.map +1 -1
  42. package/dist/commonjs/lib/config.d.ts +3 -3
  43. package/dist/commonjs/lib/config.js +1 -1
  44. package/dist/commonjs/models/cms/content-entry.d.ts +14 -0
  45. package/dist/commonjs/models/cms/content-entry.d.ts.map +1 -0
  46. package/dist/commonjs/models/cms/content-entry.js +57 -0
  47. package/dist/commonjs/models/cms/content-entry.js.map +1 -0
  48. package/dist/commonjs/models/cms/content-type-field.d.ts +27 -0
  49. package/dist/commonjs/models/cms/content-type-field.d.ts.map +1 -0
  50. package/dist/commonjs/models/cms/content-type-field.js +65 -0
  51. package/dist/commonjs/models/cms/content-type-field.js.map +1 -0
  52. package/dist/commonjs/models/cms/content-type.d.ts +32 -0
  53. package/dist/commonjs/models/cms/content-type.d.ts.map +1 -0
  54. package/dist/commonjs/models/cms/content-type.js +78 -0
  55. package/dist/commonjs/models/cms/content-type.js.map +1 -0
  56. package/dist/commonjs/models/cms/index.d.ts +3 -0
  57. package/dist/commonjs/models/cms/index.d.ts.map +1 -1
  58. package/dist/commonjs/models/cms/index.js +3 -0
  59. package/dist/commonjs/models/cms/index.js.map +1 -1
  60. package/dist/commonjs/models/commerce/route.d.ts +2 -2
  61. package/dist/commonjs/models/commerce/route.d.ts.map +1 -1
  62. package/dist/commonjs/models/commerce/route.js +2 -2
  63. package/dist/commonjs/models/commerce/route.js.map +1 -1
  64. package/dist/commonjs/models/index.d.ts +1 -0
  65. package/dist/commonjs/models/index.d.ts.map +1 -1
  66. package/dist/commonjs/models/index.js +1 -0
  67. package/dist/commonjs/models/index.js.map +1 -1
  68. package/dist/commonjs/models/operations/cms-content-types.d.ts +29 -0
  69. package/dist/commonjs/models/operations/cms-content-types.d.ts.map +1 -0
  70. package/dist/commonjs/models/operations/cms-content-types.js +71 -0
  71. package/dist/commonjs/models/operations/cms-content-types.js.map +1 -0
  72. package/dist/commonjs/models/operations/cms-content.d.ts +55 -0
  73. package/dist/commonjs/models/operations/cms-content.d.ts.map +1 -0
  74. package/dist/commonjs/models/operations/cms-content.js +92 -0
  75. package/dist/commonjs/models/operations/cms-content.js.map +1 -0
  76. package/dist/commonjs/models/operations/index.d.ts +2 -0
  77. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  78. package/dist/commonjs/models/operations/index.js +2 -0
  79. package/dist/commonjs/models/operations/index.js.map +1 -1
  80. package/dist/commonjs/sdk/cms/content-types.d.ts +7 -0
  81. package/dist/commonjs/sdk/cms/content-types.d.ts.map +1 -0
  82. package/dist/commonjs/sdk/cms/content-types.js +20 -0
  83. package/dist/commonjs/sdk/cms/content-types.js.map +1 -0
  84. package/dist/commonjs/sdk/cms/content.d.ts +11 -0
  85. package/dist/commonjs/sdk/cms/content.d.ts.map +1 -0
  86. package/dist/commonjs/sdk/cms/content.js +32 -0
  87. package/dist/commonjs/sdk/cms/content.js.map +1 -0
  88. package/dist/commonjs/sdk/cms/index.d.ts +8 -0
  89. package/dist/commonjs/sdk/cms/index.d.ts.map +1 -1
  90. package/dist/commonjs/sdk/cms/index.js +13 -1
  91. package/dist/commonjs/sdk/cms/index.js.map +1 -1
  92. package/dist/commonjs/sdk/index.d.ts +1 -0
  93. package/dist/commonjs/sdk/index.d.ts.map +1 -1
  94. package/dist/commonjs/sdk/index.js +1 -0
  95. package/dist/commonjs/sdk/index.js.map +1 -1
  96. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  97. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  98. package/dist/commonjs/sdk/sdk.js +4 -0
  99. package/dist/commonjs/sdk/sdk.js.map +1 -1
  100. package/dist/commonjs/sdk/tracking/events.d.ts +27 -0
  101. package/dist/commonjs/sdk/tracking/events.d.ts.map +1 -0
  102. package/dist/commonjs/sdk/tracking/events.js +137 -0
  103. package/dist/commonjs/sdk/tracking/events.js.map +1 -0
  104. package/dist/commonjs/sdk/tracking/index.d.ts +12 -0
  105. package/dist/commonjs/sdk/tracking/index.d.ts.map +1 -0
  106. package/dist/commonjs/sdk/tracking/index.js +35 -0
  107. package/dist/commonjs/sdk/tracking/index.js.map +1 -0
  108. package/dist/esm/funcs/cms/contentCreate.d.ts +11 -0
  109. package/dist/esm/funcs/cms/contentCreate.d.ts.map +1 -0
  110. package/dist/esm/funcs/cms/contentCreate.js +74 -0
  111. package/dist/esm/funcs/cms/contentCreate.js.map +1 -0
  112. package/dist/esm/funcs/cms/contentDelete.d.ts +10 -0
  113. package/dist/esm/funcs/cms/contentDelete.d.ts.map +1 -0
  114. package/dist/esm/funcs/cms/contentDelete.js +74 -0
  115. package/dist/esm/funcs/cms/contentDelete.js.map +1 -0
  116. package/dist/esm/funcs/cms/contentGet.d.ts +11 -0
  117. package/dist/esm/funcs/cms/contentGet.d.ts.map +1 -0
  118. package/dist/esm/funcs/cms/contentGet.js +74 -0
  119. package/dist/esm/funcs/cms/contentGet.js.map +1 -0
  120. package/dist/esm/funcs/cms/contentList.d.ts +11 -0
  121. package/dist/esm/funcs/cms/contentList.d.ts.map +1 -0
  122. package/dist/esm/funcs/cms/contentList.js +81 -0
  123. package/dist/esm/funcs/cms/contentList.js.map +1 -0
  124. package/dist/esm/funcs/cms/contentTypesGet.d.ts +10 -0
  125. package/dist/esm/funcs/cms/contentTypesGet.d.ts.map +1 -0
  126. package/dist/esm/funcs/cms/contentTypesGet.js +78 -0
  127. package/dist/esm/funcs/cms/contentTypesGet.js.map +1 -0
  128. package/dist/esm/funcs/cms/contentTypesList.d.ts +10 -0
  129. package/dist/esm/funcs/cms/contentTypesList.d.ts.map +1 -0
  130. package/dist/esm/funcs/cms/contentTypesList.js +85 -0
  131. package/dist/esm/funcs/cms/contentTypesList.js.map +1 -0
  132. package/dist/esm/funcs/cms/contentUpdate.d.ts +11 -0
  133. package/dist/esm/funcs/cms/contentUpdate.d.ts.map +1 -0
  134. package/dist/esm/funcs/cms/contentUpdate.js +75 -0
  135. package/dist/esm/funcs/cms/contentUpdate.js.map +1 -0
  136. package/dist/esm/funcs/cms/index.d.ts +7 -0
  137. package/dist/esm/funcs/cms/index.d.ts.map +1 -1
  138. package/dist/esm/funcs/cms/index.js +7 -0
  139. package/dist/esm/funcs/cms/index.js.map +1 -1
  140. package/dist/esm/funcs/index.d.ts +1 -0
  141. package/dist/esm/funcs/index.d.ts.map +1 -1
  142. package/dist/esm/funcs/index.js +1 -0
  143. package/dist/esm/funcs/index.js.map +1 -1
  144. package/dist/esm/index.d.ts +1 -0
  145. package/dist/esm/index.d.ts.map +1 -1
  146. package/dist/esm/index.js +1 -0
  147. package/dist/esm/index.js.map +1 -1
  148. package/dist/esm/lib/config.d.ts +3 -3
  149. package/dist/esm/lib/config.js +1 -1
  150. package/dist/esm/models/cms/content-entry.d.ts +14 -0
  151. package/dist/esm/models/cms/content-entry.d.ts.map +1 -0
  152. package/dist/esm/models/cms/content-entry.js +21 -0
  153. package/dist/esm/models/cms/content-entry.js.map +1 -0
  154. package/dist/esm/models/cms/content-type-field.d.ts +27 -0
  155. package/dist/esm/models/cms/content-type-field.d.ts.map +1 -0
  156. package/dist/esm/models/cms/content-type-field.js +29 -0
  157. package/dist/esm/models/cms/content-type-field.js.map +1 -0
  158. package/dist/esm/models/cms/content-type.d.ts +32 -0
  159. package/dist/esm/models/cms/content-type.d.ts.map +1 -0
  160. package/dist/esm/models/cms/content-type.js +42 -0
  161. package/dist/esm/models/cms/content-type.js.map +1 -0
  162. package/dist/esm/models/cms/index.d.ts +3 -0
  163. package/dist/esm/models/cms/index.d.ts.map +1 -1
  164. package/dist/esm/models/cms/index.js +3 -0
  165. package/dist/esm/models/cms/index.js.map +1 -1
  166. package/dist/esm/models/commerce/route.d.ts +2 -2
  167. package/dist/esm/models/commerce/route.d.ts.map +1 -1
  168. package/dist/esm/models/commerce/route.js +2 -2
  169. package/dist/esm/models/commerce/route.js.map +1 -1
  170. package/dist/esm/models/index.d.ts +1 -0
  171. package/dist/esm/models/index.d.ts.map +1 -1
  172. package/dist/esm/models/index.js +1 -0
  173. package/dist/esm/models/index.js.map +1 -1
  174. package/dist/esm/models/operations/cms-content-types.d.ts +29 -0
  175. package/dist/esm/models/operations/cms-content-types.d.ts.map +1 -0
  176. package/dist/esm/models/operations/cms-content-types.js +35 -0
  177. package/dist/esm/models/operations/cms-content-types.js.map +1 -0
  178. package/dist/esm/models/operations/cms-content.d.ts +55 -0
  179. package/dist/esm/models/operations/cms-content.d.ts.map +1 -0
  180. package/dist/esm/models/operations/cms-content.js +56 -0
  181. package/dist/esm/models/operations/cms-content.js.map +1 -0
  182. package/dist/esm/models/operations/index.d.ts +2 -0
  183. package/dist/esm/models/operations/index.d.ts.map +1 -1
  184. package/dist/esm/models/operations/index.js +2 -0
  185. package/dist/esm/models/operations/index.js.map +1 -1
  186. package/dist/esm/sdk/cms/content-types.d.ts +7 -0
  187. package/dist/esm/sdk/cms/content-types.d.ts.map +1 -0
  188. package/dist/esm/sdk/cms/content-types.js +16 -0
  189. package/dist/esm/sdk/cms/content-types.js.map +1 -0
  190. package/dist/esm/sdk/cms/content.d.ts +11 -0
  191. package/dist/esm/sdk/cms/content.d.ts.map +1 -0
  192. package/dist/esm/sdk/cms/content.js +28 -0
  193. package/dist/esm/sdk/cms/content.js.map +1 -0
  194. package/dist/esm/sdk/cms/index.d.ts +8 -0
  195. package/dist/esm/sdk/cms/index.d.ts.map +1 -1
  196. package/dist/esm/sdk/cms/index.js +10 -0
  197. package/dist/esm/sdk/cms/index.js.map +1 -1
  198. package/dist/esm/sdk/index.d.ts +1 -0
  199. package/dist/esm/sdk/index.d.ts.map +1 -1
  200. package/dist/esm/sdk/index.js +1 -0
  201. package/dist/esm/sdk/index.js.map +1 -1
  202. package/dist/esm/sdk/sdk.d.ts +3 -0
  203. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  204. package/dist/esm/sdk/sdk.js +4 -0
  205. package/dist/esm/sdk/sdk.js.map +1 -1
  206. package/dist/esm/sdk/tracking/events.d.ts +27 -0
  207. package/dist/esm/sdk/tracking/events.d.ts.map +1 -0
  208. package/dist/esm/sdk/tracking/events.js +133 -0
  209. package/dist/esm/sdk/tracking/events.js.map +1 -0
  210. package/dist/esm/sdk/tracking/index.d.ts +12 -0
  211. package/dist/esm/sdk/tracking/index.d.ts.map +1 -0
  212. package/dist/esm/sdk/tracking/index.js +31 -0
  213. package/dist/esm/sdk/tracking/index.js.map +1 -0
  214. package/jsr.json +1 -1
  215. package/package.json +1 -1
  216. package/src/funcs/cms/contentCreate.ts +171 -0
  217. package/src/funcs/cms/contentDelete.ts +157 -0
  218. package/src/funcs/cms/contentGet.ts +171 -0
  219. package/src/funcs/cms/contentList.ts +179 -0
  220. package/src/funcs/cms/contentTypesGet.ts +162 -0
  221. package/src/funcs/cms/contentTypesList.ts +169 -0
  222. package/src/funcs/cms/contentUpdate.ts +172 -0
  223. package/src/funcs/cms/index.ts +7 -0
  224. package/src/funcs/index.ts +1 -0
  225. package/src/index.ts +1 -0
  226. package/src/lib/config.ts +1 -1
  227. package/src/models/cms/content-entry.ts +31 -0
  228. package/src/models/cms/content-type-field.ts +54 -0
  229. package/src/models/cms/content-type.ts +75 -0
  230. package/src/models/cms/index.ts +3 -3
  231. package/src/models/commerce/route.ts +4 -4
  232. package/src/models/index.ts +1 -0
  233. package/src/models/operations/cms-content-types.ts +74 -0
  234. package/src/models/operations/cms-content.ts +132 -0
  235. package/src/models/operations/index.ts +2 -0
  236. package/src/sdk/cms/content-types.ts +25 -0
  237. package/src/sdk/cms/content.ts +50 -0
  238. package/src/sdk/cms/index.ts +14 -0
  239. package/src/sdk/index.ts +1 -0
  240. package/src/sdk/sdk.ts +6 -0
  241. package/src/sdk/tracking/events.ts +200 -0
  242. package/src/sdk/tracking/index.ts +34 -0
@@ -0,0 +1,162 @@
1
+ /*
2
+ * Get CMS content type.
3
+ */
4
+
5
+ import { ClientSDK, RequestOptions } from "../../lib/sdks.js";
6
+ import { encodeFormQuery } from "../../lib/encodings.js";
7
+
8
+ import * as M from "../../lib/matchers.js";
9
+ import { safeParse } from "../../lib/schemas.js";
10
+ import { extractSecurity, resolveGlobalSecurity } from "../../lib/security.js";
11
+ import * as errors from "../../models/errors/index.js";
12
+ import { ResponseValidationError } from "../../models/errors/response-validation-error.js";
13
+ import { SDKValidationError } from "../../models/errors/sdk-validation-error.js";
14
+ import {
15
+ ConnectionError,
16
+ InvalidRequestError,
17
+ RequestAbortedError,
18
+ RequestTimeoutError,
19
+ UnexpectedClientError,
20
+ } from "../../models/errors/http-client-errors.js";
21
+ import * as operations from "../../models/operations/index.js";
22
+ import { APICall, APIPromise } from "../../types/async.js";
23
+ import { OK, Result } from "../../types/fp.js";
24
+
25
+ export function contentTypesGet(
26
+ client: ClientSDK,
27
+ request: operations.GetContentTypeRequest,
28
+ options?: RequestOptions,
29
+ ): APIPromise<
30
+ Result<
31
+ operations.GetContentTypeResponse,
32
+ | errors.ErrorResponse
33
+ | errors.OminityDefaultError
34
+ | ResponseValidationError
35
+ | ConnectionError
36
+ | RequestAbortedError
37
+ | RequestTimeoutError
38
+ | InvalidRequestError
39
+ | UnexpectedClientError
40
+ | SDKValidationError
41
+ >
42
+ > {
43
+ return new APIPromise($do(
44
+ client,
45
+ request,
46
+ options,
47
+ ));
48
+ }
49
+
50
+ async function $do(
51
+ client: ClientSDK,
52
+ request: operations.GetContentTypeRequest,
53
+ options?: RequestOptions,
54
+ ): Promise<
55
+ [
56
+ Result<
57
+ operations.GetContentTypeResponse,
58
+ | errors.ErrorResponse
59
+ | errors.OminityDefaultError
60
+ | ResponseValidationError
61
+ | ConnectionError
62
+ | RequestAbortedError
63
+ | RequestTimeoutError
64
+ | InvalidRequestError
65
+ | UnexpectedClientError
66
+ | SDKValidationError
67
+ >,
68
+ APICall,
69
+ ]
70
+ > {
71
+ const parsed = safeParse(
72
+ request,
73
+ (value) => operations.GetContentTypeRequest$outboundSchema.parse(value),
74
+ "Input validation failed",
75
+ );
76
+ if (!parsed.ok) {
77
+ return [parsed, { status: "invalid" }];
78
+ }
79
+ const payload = parsed.value;
80
+ const body = null;
81
+
82
+ const safeId = encodeURIComponent(String(payload.id));
83
+ const path = `/cms/content-types/${safeId}`;
84
+
85
+ const query = encodeFormQuery({
86
+ include: payload.include,
87
+ });
88
+
89
+ const headers = new Headers();
90
+
91
+ const securityInput = await extractSecurity(client._options.security);
92
+ const requestSecurity = resolveGlobalSecurity(securityInput);
93
+
94
+ const context = {
95
+ options: client._options,
96
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
97
+ operationID: "cms.contentTypes.get",
98
+ oAuth2Scopes: null,
99
+ resolvedSecurity: requestSecurity,
100
+ securitySource: client._options.security,
101
+ retryConfig: options?.retries
102
+ || client._options.retryConfig
103
+ || { strategy: "none" },
104
+ retryCodes: options?.retryCodes || ["429", "5XX"],
105
+ };
106
+
107
+ const requestRes = client._createRequest(context, {
108
+ security: requestSecurity,
109
+ method: "GET",
110
+ baseURL: options?.serverURL,
111
+ path,
112
+ headers,
113
+ query,
114
+ body,
115
+ userAgent: client._options.userAgent,
116
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
117
+ }, options);
118
+ if (!requestRes.ok) {
119
+ return [requestRes, { status: "invalid" }];
120
+ }
121
+ const req = requestRes.value;
122
+
123
+ const doResult = await client._do(req, {
124
+ context,
125
+ errorCodes: ["4XX", "5XX"],
126
+ retryConfig: context.retryConfig,
127
+ retryCodes: context.retryCodes,
128
+ });
129
+ if (!doResult.ok) {
130
+ return [doResult, { status: "request-error", request: req }];
131
+ }
132
+ const response = doResult.value;
133
+
134
+ const responseFields = {
135
+ HttpMeta: { Response: response, Request: req },
136
+ };
137
+
138
+ const [result] = await M.match<
139
+ operations.GetContentTypeResponse,
140
+ | errors.ErrorResponse
141
+ | errors.OminityDefaultError
142
+ | ResponseValidationError
143
+ | ConnectionError
144
+ | RequestAbortedError
145
+ | RequestTimeoutError
146
+ | InvalidRequestError
147
+ | UnexpectedClientError
148
+ | SDKValidationError
149
+ >(
150
+ M.json(200, operations.GetContentTypeResponse$inboundSchema, { ctype: "application/hal+json" }),
151
+ M.jsonErr("4XX", errors.ErrorResponse$inboundSchema, {
152
+ ctype: "application/hal+json",
153
+ }),
154
+ M.fail("4XX"),
155
+ M.fail("5XX"),
156
+ )(response, req, { extraFields: responseFields });
157
+ if (!result.ok) {
158
+ return [result, { status: "complete", request: req, response }];
159
+ }
160
+
161
+ return [OK(result.value), { status: "complete", request: req, response }];
162
+ }
@@ -0,0 +1,169 @@
1
+ /*
2
+ * List CMS content types.
3
+ */
4
+
5
+ import { ClientSDK, RequestOptions } from "../../lib/sdks.js";
6
+ import { encodeFormQuery } from "../../lib/encodings.js";
7
+
8
+ import * as M from "../../lib/matchers.js";
9
+ import { safeParse } from "../../lib/schemas.js";
10
+ import { extractSecurity, resolveGlobalSecurity } from "../../lib/security.js";
11
+ import * as errors from "../../models/errors/index.js";
12
+ import { ResponseValidationError } from "../../models/errors/response-validation-error.js";
13
+ import { SDKValidationError } from "../../models/errors/sdk-validation-error.js";
14
+ import {
15
+ ConnectionError,
16
+ InvalidRequestError,
17
+ RequestAbortedError,
18
+ RequestTimeoutError,
19
+ UnexpectedClientError,
20
+ } from "../../models/errors/http-client-errors.js";
21
+ import * as operations from "../../models/operations/index.js";
22
+ import { APICall, APIPromise } from "../../types/async.js";
23
+ import { OK, Result } from "../../types/fp.js";
24
+
25
+ export function contentTypesList(
26
+ client: ClientSDK,
27
+ request?: operations.ListContentTypesRequest | undefined,
28
+ options?: RequestOptions,
29
+ ): APIPromise<
30
+ Result<
31
+ operations.ListContentTypesResponse,
32
+ | errors.ErrorResponse
33
+ | errors.OminityDefaultError
34
+ | ResponseValidationError
35
+ | ConnectionError
36
+ | RequestAbortedError
37
+ | RequestTimeoutError
38
+ | InvalidRequestError
39
+ | UnexpectedClientError
40
+ | SDKValidationError
41
+ >
42
+ > {
43
+ return new APIPromise($do(
44
+ client,
45
+ request,
46
+ options,
47
+ ));
48
+ }
49
+
50
+ async function $do(
51
+ client: ClientSDK,
52
+ request?: operations.ListContentTypesRequest | undefined,
53
+ options?: RequestOptions,
54
+ ): Promise<
55
+ [
56
+ Result<
57
+ operations.ListContentTypesResponse,
58
+ | errors.ErrorResponse
59
+ | errors.OminityDefaultError
60
+ | ResponseValidationError
61
+ | ConnectionError
62
+ | RequestAbortedError
63
+ | RequestTimeoutError
64
+ | InvalidRequestError
65
+ | UnexpectedClientError
66
+ | SDKValidationError
67
+ >,
68
+ APICall,
69
+ ]
70
+ > {
71
+ const parsed = safeParse(
72
+ request,
73
+ (value) => operations.ListContentTypesRequest$outboundSchema.optional().parse(value),
74
+ "Input validation failed",
75
+ );
76
+ if (!parsed.ok) {
77
+ return [parsed, { status: "invalid" }];
78
+ }
79
+ const payload = parsed.value;
80
+ const body = null;
81
+
82
+ const path = "/cms/content-types";
83
+
84
+ const query = encodeFormQuery({
85
+ "filter[id]": payload?.filterId,
86
+ "filter[name_singular]": payload?.filterNameSingular,
87
+ "filter[name_plural]": payload?.filterNamePlural,
88
+ "filter[slug]": payload?.filterSlug,
89
+ "filter[resource_key]": payload?.filterResourceKey,
90
+ include: payload?.include,
91
+ sort: payload?.sort,
92
+ page: payload?.page,
93
+ limit: payload?.limit,
94
+ });
95
+
96
+ const headers = new Headers();
97
+
98
+ const securityInput = await extractSecurity(client._options.security);
99
+ const requestSecurity = resolveGlobalSecurity(securityInput);
100
+
101
+ const context = {
102
+ options: client._options,
103
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
104
+ operationID: "cms.contentTypes.list",
105
+ oAuth2Scopes: null,
106
+ resolvedSecurity: requestSecurity,
107
+ securitySource: client._options.security,
108
+ retryConfig: options?.retries
109
+ || client._options.retryConfig
110
+ || { strategy: "none" },
111
+ retryCodes: options?.retryCodes || ["429", "5XX"],
112
+ };
113
+
114
+ const requestRes = client._createRequest(context, {
115
+ security: requestSecurity,
116
+ method: "GET",
117
+ baseURL: options?.serverURL,
118
+ path,
119
+ headers,
120
+ query,
121
+ body,
122
+ userAgent: client._options.userAgent,
123
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
124
+ }, options);
125
+ if (!requestRes.ok) {
126
+ return [requestRes, { status: "invalid" }];
127
+ }
128
+ const req = requestRes.value;
129
+
130
+ const doResult = await client._do(req, {
131
+ context,
132
+ errorCodes: ["4XX", "5XX"],
133
+ retryConfig: context.retryConfig,
134
+ retryCodes: context.retryCodes,
135
+ });
136
+ if (!doResult.ok) {
137
+ return [doResult, { status: "request-error", request: req }];
138
+ }
139
+ const response = doResult.value;
140
+
141
+ const responseFields = {
142
+ HttpMeta: { Response: response, Request: req },
143
+ };
144
+
145
+ const [result] = await M.match<
146
+ operations.ListContentTypesResponse,
147
+ | errors.ErrorResponse
148
+ | errors.OminityDefaultError
149
+ | ResponseValidationError
150
+ | ConnectionError
151
+ | RequestAbortedError
152
+ | RequestTimeoutError
153
+ | InvalidRequestError
154
+ | UnexpectedClientError
155
+ | SDKValidationError
156
+ >(
157
+ M.json(200, operations.ListContentTypesResponse$inboundSchema, { ctype: "application/hal+json" }),
158
+ M.jsonErr("4XX", errors.ErrorResponse$inboundSchema, {
159
+ ctype: "application/hal+json",
160
+ }),
161
+ M.fail("4XX"),
162
+ M.fail("5XX"),
163
+ )(response, req, { extraFields: responseFields });
164
+ if (!result.ok) {
165
+ return [result, { status: "complete", request: req, response }];
166
+ }
167
+
168
+ return [OK(result.value), { status: "complete", request: req, response }];
169
+ }
@@ -0,0 +1,172 @@
1
+ /*
2
+ * Update CMS content entry.
3
+ */
4
+
5
+ import { ClientSDK, RequestOptions } from "../../lib/sdks.js";
6
+
7
+ import * as M from "../../lib/matchers.js";
8
+ import { safeParse } from "../../lib/schemas.js";
9
+ import { extractSecurity, resolveGlobalSecurity } from "../../lib/security.js";
10
+ import * as errors from "../../models/errors/index.js";
11
+ import { ResponseValidationError } from "../../models/errors/response-validation-error.js";
12
+ import { SDKValidationError } from "../../models/errors/sdk-validation-error.js";
13
+ import {
14
+ ConnectionError,
15
+ InvalidRequestError,
16
+ RequestAbortedError,
17
+ RequestTimeoutError,
18
+ UnexpectedClientError,
19
+ } from "../../models/errors/http-client-errors.js";
20
+ import { ContentEntry } from "../../models/cms/content-entry.js";
21
+ import * as operations from "../../models/operations/index.js";
22
+ import { APICall, APIPromise } from "../../types/async.js";
23
+ import { OK, Result } from "../../types/fp.js";
24
+
25
+ export function contentUpdate<TEntry extends ContentEntry = ContentEntry>(
26
+ client: ClientSDK,
27
+ request: operations.UpdateContentRequest,
28
+ options?: RequestOptions,
29
+ ): APIPromise<
30
+ Result<
31
+ operations.UpdateContentResponse<TEntry>,
32
+ | errors.ErrorResponse
33
+ | errors.OminityDefaultError
34
+ | ResponseValidationError
35
+ | ConnectionError
36
+ | RequestAbortedError
37
+ | RequestTimeoutError
38
+ | InvalidRequestError
39
+ | UnexpectedClientError
40
+ | SDKValidationError
41
+ >
42
+ > {
43
+ return new APIPromise($do(
44
+ client,
45
+ request,
46
+ options,
47
+ )) as APIPromise<
48
+ Result<
49
+ operations.UpdateContentResponse<TEntry>,
50
+ | errors.ErrorResponse
51
+ | errors.OminityDefaultError
52
+ | ResponseValidationError
53
+ | ConnectionError
54
+ | RequestAbortedError
55
+ | RequestTimeoutError
56
+ | InvalidRequestError
57
+ | UnexpectedClientError
58
+ | SDKValidationError
59
+ >
60
+ >;
61
+ }
62
+
63
+ async function $do(
64
+ client: ClientSDK,
65
+ request: operations.UpdateContentRequest,
66
+ options?: RequestOptions,
67
+ ): Promise<
68
+ [
69
+ Result<
70
+ operations.UpdateContentResponse,
71
+ | errors.ErrorResponse
72
+ | errors.OminityDefaultError
73
+ | ResponseValidationError
74
+ | ConnectionError
75
+ | RequestAbortedError
76
+ | RequestTimeoutError
77
+ | InvalidRequestError
78
+ | UnexpectedClientError
79
+ | SDKValidationError
80
+ >,
81
+ APICall,
82
+ ]
83
+ > {
84
+ const parsed = safeParse(
85
+ request,
86
+ (value) => operations.UpdateContentRequest$outboundSchema.parse(value),
87
+ "Input validation failed",
88
+ );
89
+ if (!parsed.ok) {
90
+ return [parsed, { status: "invalid" }];
91
+ }
92
+ const payload = parsed.value;
93
+
94
+ const safeSlug = encodeURIComponent(payload.slug);
95
+ const safeId = encodeURIComponent(payload.id);
96
+ const path = `/cms/content/${safeSlug}/${safeId}`;
97
+
98
+ const headers = new Headers({
99
+ "Content-Type": "application/json",
100
+ });
101
+
102
+ const securityInput = await extractSecurity(client._options.security);
103
+ const requestSecurity = resolveGlobalSecurity(securityInput);
104
+
105
+ const context = {
106
+ options: client._options,
107
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
108
+ operationID: "cms.content.update",
109
+ oAuth2Scopes: null,
110
+ resolvedSecurity: requestSecurity,
111
+ securitySource: client._options.security,
112
+ retryConfig: options?.retries
113
+ || client._options.retryConfig
114
+ || { strategy: "none" },
115
+ retryCodes: options?.retryCodes || ["429", "5XX"],
116
+ };
117
+
118
+ const requestRes = client._createRequest(context, {
119
+ security: requestSecurity,
120
+ method: "PATCH",
121
+ baseURL: options?.serverURL,
122
+ path,
123
+ headers,
124
+ body: JSON.stringify(payload.data),
125
+ userAgent: client._options.userAgent,
126
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
127
+ }, options);
128
+ if (!requestRes.ok) {
129
+ return [requestRes, { status: "invalid" }];
130
+ }
131
+ const req = requestRes.value;
132
+
133
+ const doResult = await client._do(req, {
134
+ context,
135
+ errorCodes: ["4XX", "5XX"],
136
+ retryConfig: context.retryConfig,
137
+ retryCodes: context.retryCodes,
138
+ });
139
+ if (!doResult.ok) {
140
+ return [doResult, { status: "request-error", request: req }];
141
+ }
142
+ const response = doResult.value;
143
+
144
+ const responseFields = {
145
+ HttpMeta: { Response: response, Request: req },
146
+ };
147
+
148
+ const [result] = await M.match<
149
+ operations.UpdateContentResponse,
150
+ | errors.ErrorResponse
151
+ | errors.OminityDefaultError
152
+ | ResponseValidationError
153
+ | ConnectionError
154
+ | RequestAbortedError
155
+ | RequestTimeoutError
156
+ | InvalidRequestError
157
+ | UnexpectedClientError
158
+ | SDKValidationError
159
+ >(
160
+ M.json(200, operations.UpdateContentResponse$inboundSchema, { ctype: "application/hal+json" }),
161
+ M.jsonErr("4XX", errors.ErrorResponse$inboundSchema, {
162
+ ctype: "application/hal+json",
163
+ }),
164
+ M.fail("4XX"),
165
+ M.fail("5XX"),
166
+ )(response, req, { extraFields: responseFields });
167
+ if (!result.ok) {
168
+ return [result, { status: "complete", request: req, response }];
169
+ }
170
+
171
+ return [OK(result.value), { status: "complete", request: req, response }];
172
+ }
@@ -1,5 +1,12 @@
1
1
  export * from "./componentsList.js";
2
2
  export * from "./componentsGet.js";
3
+ export * from "./contentCreate.js";
4
+ export * from "./contentDelete.js";
5
+ export * from "./contentGet.js";
6
+ export * from "./contentList.js";
7
+ export * from "./contentUpdate.js";
8
+ export * from "./contentTypesGet.js";
9
+ export * from "./contentTypesList.js";
3
10
  export * from "./layoutsList.js";
4
11
  export * from "./layoutsGet.js";
5
12
  export * from "./pagesList.js";
@@ -15,6 +15,7 @@ export * from "./commerce/cartItemsGet.js";
15
15
  export * from "./commerce/cartItemsCreate.js";
16
16
  export * from "./commerce/cartItemsUpdate.js";
17
17
  export * from "./commerce/cartItemsDelete.js";
18
+ export * from "./cms/index.js";
18
19
  export * from "./channels/index.js";
19
20
  export * from "./localization/index.js";
20
21
  export * from "./oauth2/index.js";
package/src/index.ts CHANGED
@@ -7,3 +7,4 @@ export * from "./core.js";
7
7
  export * from "./funcs/index.js";
8
8
  export * from "./sdk/modules.js";
9
9
  export * from "./sdk/sdk.js";
10
+ export * from "./sdk/tracking/index.js";
package/src/lib/config.ts CHANGED
@@ -75,7 +75,7 @@ function applyApiVersion(url: URL, apiVersion: string | undefined): URL {
75
75
  return url;
76
76
  }
77
77
 
78
- export const SDK_VERSION = "1.1.5";
78
+ export const SDK_VERSION = "1.2.0";
79
79
 
80
80
  export const SDK_METADATA = {
81
81
  language: "typescript",
@@ -0,0 +1,31 @@
1
+ /*
2
+ * CMS Content Entry model.
3
+ */
4
+
5
+ import * as z from "zod/v4";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { HalLinks, HalLinks$inboundSchema } from "../hal.js";
8
+ import { Route, Route$inboundSchema } from "../commerce/route.js";
9
+
10
+ export type ContentEntry<TFields extends Record<string, any> = Record<string, any>> = {
11
+ resource: string;
12
+ id: string;
13
+ route?: Route | null;
14
+ updatedAt: string | null;
15
+ createdAt: string | null;
16
+ links?: HalLinks;
17
+ } & TFields;
18
+
19
+ /** @internal */
20
+ export const ContentEntry$inboundSchema: z.ZodType<ContentEntry> = z.object({
21
+ resource: z.string(),
22
+ id: z.string(),
23
+ route: Route$inboundSchema.nullable().optional(),
24
+ updatedAt: z.string().nullable(),
25
+ createdAt: z.string().nullable(),
26
+ _links: HalLinks$inboundSchema.optional(),
27
+ }).passthrough().transform((v) => {
28
+ return remap$(v, {
29
+ "_links": "links",
30
+ }) as ContentEntry;
31
+ }) as unknown as z.ZodType<ContentEntry>;
@@ -0,0 +1,54 @@
1
+ /*
2
+ * CMS Content Type Field model.
3
+ */
4
+
5
+ import * as z from "zod/v4";
6
+
7
+ export type ContentTypeField = {
8
+ resource: string;
9
+ id: number;
10
+ name: string;
11
+ slug: string;
12
+ description: string | null;
13
+ type: string;
14
+ variant: string | null;
15
+ required: boolean;
16
+ translatable: boolean;
17
+ isRouteParameter: boolean;
18
+ showInTable: boolean;
19
+ multiple: boolean;
20
+ multipleSortable: boolean;
21
+ min: unknown;
22
+ max: unknown;
23
+ defaultValue: unknown;
24
+ data: unknown;
25
+ order: number;
26
+ parentId: number | null;
27
+ updatedAt: string | null;
28
+ createdAt: string | null;
29
+ };
30
+
31
+ /** @internal */
32
+ export const ContentTypeField$inboundSchema: z.ZodType<ContentTypeField> = z.object({
33
+ resource: z.string(),
34
+ id: z.number(),
35
+ name: z.string(),
36
+ slug: z.string(),
37
+ description: z.string().nullable(),
38
+ type: z.string(),
39
+ variant: z.string().nullable(),
40
+ required: z.boolean(),
41
+ translatable: z.boolean(),
42
+ isRouteParameter: z.boolean(),
43
+ showInTable: z.boolean(),
44
+ multiple: z.boolean(),
45
+ multipleSortable: z.boolean(),
46
+ min: z.unknown(),
47
+ max: z.unknown(),
48
+ defaultValue: z.unknown(),
49
+ data: z.unknown(),
50
+ order: z.number(),
51
+ parentId: z.number().nullable(),
52
+ updatedAt: z.string().nullable(),
53
+ createdAt: z.string().nullable(),
54
+ });