@steamsets/client-ts 0.33.0 → 0.33.2

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 (61) hide show
  1. package/README.md +2 -0
  2. package/funcs/adminCmsListAssets.d.ts +15 -0
  3. package/funcs/adminCmsListAssets.d.ts.map +1 -0
  4. package/funcs/adminCmsListAssets.js +136 -0
  5. package/funcs/adminCmsListAssets.js.map +1 -0
  6. package/jsr.json +1 -1
  7. package/lib/config.d.ts +2 -2
  8. package/lib/config.js +2 -2
  9. package/models/components/assetitem.d.ts +17 -0
  10. package/models/components/assetitem.d.ts.map +1 -0
  11. package/models/components/assetitem.js +64 -0
  12. package/models/components/assetitem.js.map +1 -0
  13. package/models/components/index.d.ts +2 -0
  14. package/models/components/index.d.ts.map +1 -1
  15. package/models/components/index.js +2 -0
  16. package/models/components/index.js.map +1 -1
  17. package/models/components/v1admincmscreaterequestbody.d.ts +1 -16
  18. package/models/components/v1admincmscreaterequestbody.d.ts.map +1 -1
  19. package/models/components/v1admincmscreaterequestbody.js +2 -15
  20. package/models/components/v1admincmscreaterequestbody.js.map +1 -1
  21. package/models/components/v1admincmslistassetsresponsebody.d.ts +15 -0
  22. package/models/components/v1admincmslistassetsresponsebody.d.ts.map +1 -0
  23. package/models/components/v1admincmslistassetsresponsebody.js +57 -0
  24. package/models/components/v1admincmslistassetsresponsebody.js.map +1 -0
  25. package/models/components/v1admincmsreorderrequestbody.d.ts +1 -16
  26. package/models/components/v1admincmsreorderrequestbody.d.ts.map +1 -1
  27. package/models/components/v1admincmsreorderrequestbody.js +2 -15
  28. package/models/components/v1admincmsreorderrequestbody.js.map +1 -1
  29. package/models/operations/cmslist.d.ts +1 -22
  30. package/models/operations/cmslist.d.ts.map +1 -1
  31. package/models/operations/cmslist.js +2 -18
  32. package/models/operations/cmslist.js.map +1 -1
  33. package/models/operations/cmslistassets.d.ts +28 -0
  34. package/models/operations/cmslistassets.d.ts.map +1 -0
  35. package/models/operations/cmslistassets.js +67 -0
  36. package/models/operations/cmslistassets.js.map +1 -0
  37. package/models/operations/index.d.ts +1 -0
  38. package/models/operations/index.d.ts.map +1 -1
  39. package/models/operations/index.js +1 -0
  40. package/models/operations/index.js.map +1 -1
  41. package/models/operations/list.d.ts +1 -22
  42. package/models/operations/list.d.ts.map +1 -1
  43. package/models/operations/list.js +2 -18
  44. package/models/operations/list.js.map +1 -1
  45. package/package.json +1 -1
  46. package/sdk/admin.d.ts +4 -0
  47. package/sdk/admin.d.ts.map +1 -1
  48. package/sdk/admin.js +7 -0
  49. package/sdk/admin.js.map +1 -1
  50. package/src/funcs/adminCmsListAssets.ts +190 -0
  51. package/src/lib/config.ts +2 -2
  52. package/src/models/components/assetitem.ts +52 -0
  53. package/src/models/components/index.ts +2 -0
  54. package/src/models/components/v1admincmscreaterequestbody.ts +2 -23
  55. package/src/models/components/v1admincmslistassetsresponsebody.ts +42 -0
  56. package/src/models/components/v1admincmsreorderrequestbody.ts +2 -23
  57. package/src/models/operations/cmslist.ts +2 -27
  58. package/src/models/operations/cmslistassets.ts +75 -0
  59. package/src/models/operations/index.ts +1 -0
  60. package/src/models/operations/list.ts +2 -27
  61. package/src/sdk/admin.ts +15 -0
@@ -0,0 +1,52 @@
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
+ export type AssetItem = {
12
+ createdAt: Date;
13
+ createdBy: number;
14
+ height?: number | undefined;
15
+ mime: string;
16
+ sizeBytes: number;
17
+ uid: string;
18
+ url: string;
19
+ width?: number | undefined;
20
+ };
21
+
22
+ /** @internal */
23
+ export const AssetItem$inboundSchema: z.ZodType<
24
+ AssetItem,
25
+ z.ZodTypeDef,
26
+ unknown
27
+ > = z.object({
28
+ created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
29
+ created_by: z.number().int(),
30
+ height: z.number().int().optional(),
31
+ mime: z.string(),
32
+ size_bytes: z.number().int(),
33
+ uid: z.string(),
34
+ url: z.string(),
35
+ width: z.number().int().optional(),
36
+ }).transform((v) => {
37
+ return remap$(v, {
38
+ "created_at": "createdAt",
39
+ "created_by": "createdBy",
40
+ "size_bytes": "sizeBytes",
41
+ });
42
+ });
43
+
44
+ export function assetItemFromJSON(
45
+ jsonString: string,
46
+ ): SafeParseResult<AssetItem, SDKValidationError> {
47
+ return safeParse(
48
+ jsonString,
49
+ (x) => AssetItem$inboundSchema.parse(JSON.parse(x)),
50
+ `Failed to parse 'AssetItem' from JSON`,
51
+ );
52
+ }
@@ -6,6 +6,7 @@ export * from "./accountbadgeinfo.js";
6
6
  export * from "./accountleaderboardhistory.js";
7
7
  export * from "./accountsearch.js";
8
8
  export * from "./admincmsitem.js";
9
+ export * from "./assetitem.js";
9
10
  export * from "./badge.js";
10
11
  export * from "./badgesuggesttags.js";
11
12
  export * from "./badgevaluefilter.js";
@@ -133,6 +134,7 @@ export * from "./v1activitystreamfeedevent.js";
133
134
  export * from "./v1admincmsarchiverequestbody.js";
134
135
  export * from "./v1admincmscreaterequestbody.js";
135
136
  export * from "./v1admincmscreateresponsebody.js";
137
+ export * from "./v1admincmslistassetsresponsebody.js";
136
138
  export * from "./v1admincmslistresponsebody.js";
137
139
  export * from "./v1admincmspreviewtokenrequestbody.js";
138
140
  export * from "./v1admincmspreviewtokenresponsebody.js";
@@ -4,22 +4,6 @@
4
4
 
5
5
  import * as z from "zod/v3";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
- import { ClosedEnum } from "../../types/enums.js";
8
-
9
- export const V1AdminCmsCreateRequestBodyType = {
10
- NavItem: "nav_item",
11
- Faq: "faq",
12
- Partner: "partner",
13
- FooterCategory: "footer_category",
14
- FooterLink: "footer_link",
15
- DonateFeature: "donate_feature",
16
- RoleMeta: "role_meta",
17
- StaffText: "staff_text",
18
- Page: "page",
19
- } as const;
20
- export type V1AdminCmsCreateRequestBodyType = ClosedEnum<
21
- typeof V1AdminCmsCreateRequestBodyType
22
- >;
23
7
 
24
8
  export type V1AdminCmsCreateRequestBody = {
25
9
  /**
@@ -33,14 +17,9 @@ export type V1AdminCmsCreateRequestBody = {
33
17
  */
34
18
  payload?: any | undefined;
35
19
  sortOrder: number;
36
- type: V1AdminCmsCreateRequestBodyType;
20
+ type: string;
37
21
  };
38
22
 
39
- /** @internal */
40
- export const V1AdminCmsCreateRequestBodyType$outboundSchema: z.ZodNativeEnum<
41
- typeof V1AdminCmsCreateRequestBodyType
42
- > = z.nativeEnum(V1AdminCmsCreateRequestBodyType);
43
-
44
23
  /** @internal */
45
24
  export type V1AdminCmsCreateRequestBody$Outbound = {
46
25
  doc_key: string;
@@ -62,7 +41,7 @@ export const V1AdminCmsCreateRequestBody$outboundSchema: z.ZodType<
62
41
  parentUid: z.string().optional(),
63
42
  payload: z.any().optional(),
64
43
  sortOrder: z.number().int(),
65
- type: V1AdminCmsCreateRequestBodyType$outboundSchema,
44
+ type: z.string(),
66
45
  }).transform((v) => {
67
46
  return remap$(v, {
68
47
  docKey: "doc_key",
@@ -0,0 +1,42 @@
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 { AssetItem, AssetItem$inboundSchema } from "./assetitem.js";
11
+
12
+ export type V1AdminCmsListAssetsResponseBody = {
13
+ /**
14
+ * A URL to the JSON Schema for this object.
15
+ */
16
+ dollarSchema?: string | undefined;
17
+ assets: Array<AssetItem> | null;
18
+ };
19
+
20
+ /** @internal */
21
+ export const V1AdminCmsListAssetsResponseBody$inboundSchema: z.ZodType<
22
+ V1AdminCmsListAssetsResponseBody,
23
+ z.ZodTypeDef,
24
+ unknown
25
+ > = z.object({
26
+ $schema: z.string().optional(),
27
+ assets: z.nullable(z.array(AssetItem$inboundSchema)),
28
+ }).transform((v) => {
29
+ return remap$(v, {
30
+ "$schema": "dollarSchema",
31
+ });
32
+ });
33
+
34
+ export function v1AdminCmsListAssetsResponseBodyFromJSON(
35
+ jsonString: string,
36
+ ): SafeParseResult<V1AdminCmsListAssetsResponseBody, SDKValidationError> {
37
+ return safeParse(
38
+ jsonString,
39
+ (x) => V1AdminCmsListAssetsResponseBody$inboundSchema.parse(JSON.parse(x)),
40
+ `Failed to parse 'V1AdminCmsListAssetsResponseBody' from JSON`,
41
+ );
42
+ }
@@ -3,38 +3,17 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
- import { ClosedEnum } from "../../types/enums.js";
7
6
  import {
8
7
  ReorderItemReq,
9
8
  ReorderItemReq$Outbound,
10
9
  ReorderItemReq$outboundSchema,
11
10
  } from "./reorderitemreq.js";
12
11
 
13
- export const V1AdminCmsReorderRequestBodyType = {
14
- NavItem: "nav_item",
15
- Faq: "faq",
16
- Partner: "partner",
17
- FooterCategory: "footer_category",
18
- FooterLink: "footer_link",
19
- DonateFeature: "donate_feature",
20
- RoleMeta: "role_meta",
21
- StaffText: "staff_text",
22
- Page: "page",
23
- } as const;
24
- export type V1AdminCmsReorderRequestBodyType = ClosedEnum<
25
- typeof V1AdminCmsReorderRequestBodyType
26
- >;
27
-
28
12
  export type V1AdminCmsReorderRequestBody = {
29
13
  items: Array<ReorderItemReq> | null;
30
- type: V1AdminCmsReorderRequestBodyType;
14
+ type: string;
31
15
  };
32
16
 
33
- /** @internal */
34
- export const V1AdminCmsReorderRequestBodyType$outboundSchema: z.ZodNativeEnum<
35
- typeof V1AdminCmsReorderRequestBodyType
36
- > = z.nativeEnum(V1AdminCmsReorderRequestBodyType);
37
-
38
17
  /** @internal */
39
18
  export type V1AdminCmsReorderRequestBody$Outbound = {
40
19
  items: Array<ReorderItemReq$Outbound> | null;
@@ -48,7 +27,7 @@ export const V1AdminCmsReorderRequestBody$outboundSchema: z.ZodType<
48
27
  V1AdminCmsReorderRequestBody
49
28
  > = z.object({
50
29
  items: z.nullable(z.array(ReorderItemReq$outboundSchema)),
51
- type: V1AdminCmsReorderRequestBodyType$outboundSchema,
30
+ type: z.string(),
52
31
  });
53
32
 
54
33
  export function v1AdminCmsReorderRequestBodyToJSON(
@@ -5,35 +5,15 @@
5
5
  import * as z from "zod/v3";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
- import { ClosedEnum } from "../../types/enums.js";
9
8
  import { Result as SafeParseResult } from "../../types/fp.js";
10
9
  import * as components from "../components/index.js";
11
10
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
12
11
 
13
- /**
14
- * Document type
15
- */
16
- export const Type = {
17
- NavItem: "nav_item",
18
- Faq: "faq",
19
- Partner: "partner",
20
- FooterCategory: "footer_category",
21
- FooterLink: "footer_link",
22
- DonateFeature: "donate_feature",
23
- RoleMeta: "role_meta",
24
- StaffText: "staff_text",
25
- Page: "page",
26
- } as const;
27
- /**
28
- * Document type
29
- */
30
- export type Type = ClosedEnum<typeof Type>;
31
-
32
12
  export type CmsListRequest = {
33
13
  /**
34
14
  * Document type
35
15
  */
36
- type: Type;
16
+ type: string;
37
17
  };
38
18
 
39
19
  export type CmsListResponse = {
@@ -46,11 +26,6 @@ export type CmsListResponse = {
46
26
  | undefined;
47
27
  };
48
28
 
49
- /** @internal */
50
- export const Type$outboundSchema: z.ZodNativeEnum<typeof Type> = z.nativeEnum(
51
- Type,
52
- );
53
-
54
29
  /** @internal */
55
30
  export type CmsListRequest$Outbound = {
56
31
  type: string;
@@ -62,7 +37,7 @@ export const CmsListRequest$outboundSchema: z.ZodType<
62
37
  z.ZodTypeDef,
63
38
  CmsListRequest
64
39
  > = z.object({
65
- type: Type$outboundSchema,
40
+ type: z.string(),
66
41
  });
67
42
 
68
43
  export function cmsListRequestToJSON(cmsListRequest: CmsListRequest): string {
@@ -0,0 +1,75 @@
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 * as components from "../components/index.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type CmsListAssetsRequest = {
13
+ /**
14
+ * Max rows to return (default 100, max 500)
15
+ */
16
+ limit?: number | undefined;
17
+ };
18
+
19
+ export type CmsListAssetsResponse = {
20
+ httpMeta: components.HTTPMetadata;
21
+ /**
22
+ * OK
23
+ */
24
+ v1AdminCmsListAssetsResponseBody?:
25
+ | components.V1AdminCmsListAssetsResponseBody
26
+ | undefined;
27
+ };
28
+
29
+ /** @internal */
30
+ export type CmsListAssetsRequest$Outbound = {
31
+ limit?: number | undefined;
32
+ };
33
+
34
+ /** @internal */
35
+ export const CmsListAssetsRequest$outboundSchema: z.ZodType<
36
+ CmsListAssetsRequest$Outbound,
37
+ z.ZodTypeDef,
38
+ CmsListAssetsRequest
39
+ > = z.object({
40
+ limit: z.number().int().optional(),
41
+ });
42
+
43
+ export function cmsListAssetsRequestToJSON(
44
+ cmsListAssetsRequest: CmsListAssetsRequest,
45
+ ): string {
46
+ return JSON.stringify(
47
+ CmsListAssetsRequest$outboundSchema.parse(cmsListAssetsRequest),
48
+ );
49
+ }
50
+
51
+ /** @internal */
52
+ export const CmsListAssetsResponse$inboundSchema: z.ZodType<
53
+ CmsListAssetsResponse,
54
+ z.ZodTypeDef,
55
+ unknown
56
+ > = z.object({
57
+ HttpMeta: components.HTTPMetadata$inboundSchema,
58
+ V1AdminCmsListAssetsResponseBody: components
59
+ .V1AdminCmsListAssetsResponseBody$inboundSchema.optional(),
60
+ }).transform((v) => {
61
+ return remap$(v, {
62
+ "HttpMeta": "httpMeta",
63
+ "V1AdminCmsListAssetsResponseBody": "v1AdminCmsListAssetsResponseBody",
64
+ });
65
+ });
66
+
67
+ export function cmsListAssetsResponseFromJSON(
68
+ jsonString: string,
69
+ ): SafeParseResult<CmsListAssetsResponse, SDKValidationError> {
70
+ return safeParse(
71
+ jsonString,
72
+ (x) => CmsListAssetsResponse$inboundSchema.parse(JSON.parse(x)),
73
+ `Failed to parse 'CmsListAssetsResponse' from JSON`,
74
+ );
75
+ }
@@ -59,6 +59,7 @@ export * from "./badgetagbadge.js";
59
59
  export * from "./cmsarchive.js";
60
60
  export * from "./cmscreate.js";
61
61
  export * from "./cmslist.js";
62
+ export * from "./cmslistassets.js";
62
63
  export * from "./cmspreviewtoken.js";
63
64
  export * from "./cmspublish.js";
64
65
  export * from "./cmsreorder.js";
@@ -5,35 +5,15 @@
5
5
  import * as z from "zod/v3";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
- import { ClosedEnum } from "../../types/enums.js";
9
8
  import { Result as SafeParseResult } from "../../types/fp.js";
10
9
  import * as components from "../components/index.js";
11
10
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
12
11
 
13
- /**
14
- * Document type
15
- */
16
- export const QueryParamType = {
17
- NavItem: "nav_item",
18
- Faq: "faq",
19
- Partner: "partner",
20
- FooterCategory: "footer_category",
21
- FooterLink: "footer_link",
22
- DonateFeature: "donate_feature",
23
- RoleMeta: "role_meta",
24
- StaffText: "staff_text",
25
- Page: "page",
26
- } as const;
27
- /**
28
- * Document type
29
- */
30
- export type QueryParamType = ClosedEnum<typeof QueryParamType>;
31
-
32
12
  export type ListRequest = {
33
13
  /**
34
14
  * Document type
35
15
  */
36
- type: QueryParamType;
16
+ type: string;
37
17
  /**
38
18
  * Locale code (e.g. en, de). Defaults to en.
39
19
  */
@@ -52,11 +32,6 @@ export type ListResponse = {
52
32
  v1CmsListResponseBody?: components.V1CmsListResponseBody | undefined;
53
33
  };
54
34
 
55
- /** @internal */
56
- export const QueryParamType$outboundSchema: z.ZodNativeEnum<
57
- typeof QueryParamType
58
- > = z.nativeEnum(QueryParamType);
59
-
60
35
  /** @internal */
61
36
  export type ListRequest$Outbound = {
62
37
  type: string;
@@ -70,7 +45,7 @@ export const ListRequest$outboundSchema: z.ZodType<
70
45
  z.ZodTypeDef,
71
46
  ListRequest
72
47
  > = z.object({
73
- type: QueryParamType$outboundSchema,
48
+ type: z.string(),
74
49
  locale: z.string().optional(),
75
50
  preview: z.string().optional(),
76
51
  });
package/src/sdk/admin.ts CHANGED
@@ -6,6 +6,7 @@ import { adminAdminUpdateRoleOverride } from "../funcs/adminAdminUpdateRoleOverr
6
6
  import { adminCmsArchive } from "../funcs/adminCmsArchive.js";
7
7
  import { adminCmsCreate } from "../funcs/adminCmsCreate.js";
8
8
  import { adminCmsList } from "../funcs/adminCmsList.js";
9
+ import { adminCmsListAssets } from "../funcs/adminCmsListAssets.js";
9
10
  import { adminCmsPreviewToken } from "../funcs/adminCmsPreviewToken.js";
10
11
  import { adminCmsPublish } from "../funcs/adminCmsPublish.js";
11
12
  import { adminCmsReorder } from "../funcs/adminCmsReorder.js";
@@ -64,6 +65,20 @@ export class Admin extends ClientSDK {
64
65
  ));
65
66
  }
66
67
 
68
+ /**
69
+ * List recently uploaded CMS images
70
+ */
71
+ async cmsListAssets(
72
+ request: operations.CmsListAssetsRequest,
73
+ options?: RequestOptions,
74
+ ): Promise<operations.CmsListAssetsResponse> {
75
+ return unwrapAsync(adminCmsListAssets(
76
+ this,
77
+ request,
78
+ options,
79
+ ));
80
+ }
81
+
67
82
  /**
68
83
  * Issue a short-lived preview token for a specific document version
69
84
  */