latitudesh-typescript-sdk 0.6.0 → 0.6.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 (53) hide show
  1. package/bin/mcp-server.js +120 -28
  2. package/bin/mcp-server.js.map +10 -10
  3. package/dist/commonjs/lib/config.d.ts +3 -3
  4. package/dist/commonjs/lib/config.js +3 -3
  5. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  6. package/dist/commonjs/mcp-server/server.js +1 -1
  7. package/dist/commonjs/models/team.d.ts +31 -0
  8. package/dist/commonjs/models/team.d.ts.map +1 -1
  9. package/dist/commonjs/models/team.js +55 -1
  10. package/dist/commonjs/models/team.js.map +1 -1
  11. package/dist/commonjs/models/teaminclude.d.ts +31 -0
  12. package/dist/commonjs/models/teaminclude.d.ts.map +1 -1
  13. package/dist/commonjs/models/teaminclude.js +55 -1
  14. package/dist/commonjs/models/teaminclude.js.map +1 -1
  15. package/dist/commonjs/models/userdata.d.ts +3 -3
  16. package/dist/commonjs/models/userdata.d.ts.map +1 -1
  17. package/dist/commonjs/models/userdata.js +3 -3
  18. package/dist/commonjs/models/userdata.js.map +1 -1
  19. package/dist/commonjs/models/userdataproperties.d.ts +5 -0
  20. package/dist/commonjs/models/userdataproperties.d.ts.map +1 -1
  21. package/dist/commonjs/models/userdataproperties.js +4 -0
  22. package/dist/commonjs/models/userdataproperties.js.map +1 -1
  23. package/dist/esm/lib/config.d.ts +3 -3
  24. package/dist/esm/lib/config.js +3 -3
  25. package/dist/esm/mcp-server/mcp-server.js +1 -1
  26. package/dist/esm/mcp-server/server.js +1 -1
  27. package/dist/esm/models/team.d.ts +31 -0
  28. package/dist/esm/models/team.d.ts.map +1 -1
  29. package/dist/esm/models/team.js +52 -0
  30. package/dist/esm/models/team.js.map +1 -1
  31. package/dist/esm/models/teaminclude.d.ts +31 -0
  32. package/dist/esm/models/teaminclude.d.ts.map +1 -1
  33. package/dist/esm/models/teaminclude.js +52 -0
  34. package/dist/esm/models/teaminclude.js.map +1 -1
  35. package/dist/esm/models/userdata.d.ts +3 -3
  36. package/dist/esm/models/userdata.d.ts.map +1 -1
  37. package/dist/esm/models/userdata.js +3 -3
  38. package/dist/esm/models/userdata.js.map +1 -1
  39. package/dist/esm/models/userdataproperties.d.ts +5 -0
  40. package/dist/esm/models/userdataproperties.d.ts.map +1 -1
  41. package/dist/esm/models/userdataproperties.js +4 -0
  42. package/dist/esm/models/userdataproperties.js.map +1 -1
  43. package/jsr.json +1 -1
  44. package/package.json +1 -1
  45. package/src/lib/config.ts +3 -3
  46. package/src/mcp-server/mcp-server.ts +1 -1
  47. package/src/mcp-server/server.ts +1 -1
  48. package/src/models/team.ts +95 -0
  49. package/src/models/teaminclude.ts +99 -0
  50. package/src/models/userdata.ts +9 -9
  51. package/src/models/userdataproperties.ts +9 -0
  52. package/tests/integration/helpers/mock-data.ts +22 -28
  53. package/tests/integration/userdata.test.ts +18 -18
@@ -25,6 +25,18 @@ export type TeamBilling = {
25
25
  customerBillingId?: string | undefined;
26
26
  };
27
27
 
28
+ export type TeamLimits = {
29
+ bareMetal?: number | null | undefined;
30
+ bareMetalGpu?: number | null | undefined;
31
+ virtualMachine?: number | null | undefined;
32
+ virtualMachineGpu?: number | null | undefined;
33
+ elasticIp?: number | null | undefined;
34
+ virtualNetwork?: number | null | undefined;
35
+ database?: number | null | undefined;
36
+ filesystem?: number | null | undefined;
37
+ blockStorage?: number | null | undefined;
38
+ };
39
+
28
40
  export type TeamAttributes = {
29
41
  name?: string | undefined;
30
42
  slug?: string | undefined;
@@ -39,6 +51,7 @@ export type TeamAttributes = {
39
51
  owner?: UserInclude | undefined;
40
52
  billing?: TeamBilling | undefined;
41
53
  featureFlags?: Array<string> | undefined;
54
+ limits?: TeamLimits | undefined;
42
55
  };
43
56
 
44
57
  export type Team = {
@@ -92,6 +105,85 @@ export function teamBillingFromJSON(
92
105
  );
93
106
  }
94
107
 
108
+ /** @internal */
109
+ export const TeamLimits$inboundSchema: z.ZodType<
110
+ TeamLimits,
111
+ z.ZodTypeDef,
112
+ unknown
113
+ > = z.object({
114
+ bare_metal: z.nullable(z.number().int()).optional(),
115
+ bare_metal_gpu: z.nullable(z.number().int()).optional(),
116
+ virtual_machine: z.nullable(z.number().int()).optional(),
117
+ virtual_machine_gpu: z.nullable(z.number().int()).optional(),
118
+ elastic_ip: z.nullable(z.number().int()).optional(),
119
+ virtual_network: z.nullable(z.number().int()).optional(),
120
+ database: z.nullable(z.number().int()).optional(),
121
+ filesystem: z.nullable(z.number().int()).optional(),
122
+ block_storage: z.nullable(z.number().int()).optional(),
123
+ }).transform((v) => {
124
+ return remap$(v, {
125
+ "bare_metal": "bareMetal",
126
+ "bare_metal_gpu": "bareMetalGpu",
127
+ "virtual_machine": "virtualMachine",
128
+ "virtual_machine_gpu": "virtualMachineGpu",
129
+ "elastic_ip": "elasticIp",
130
+ "virtual_network": "virtualNetwork",
131
+ "block_storage": "blockStorage",
132
+ });
133
+ });
134
+ /** @internal */
135
+ export type TeamLimits$Outbound = {
136
+ bare_metal?: number | null | undefined;
137
+ bare_metal_gpu?: number | null | undefined;
138
+ virtual_machine?: number | null | undefined;
139
+ virtual_machine_gpu?: number | null | undefined;
140
+ elastic_ip?: number | null | undefined;
141
+ virtual_network?: number | null | undefined;
142
+ database?: number | null | undefined;
143
+ filesystem?: number | null | undefined;
144
+ block_storage?: number | null | undefined;
145
+ };
146
+
147
+ /** @internal */
148
+ export const TeamLimits$outboundSchema: z.ZodType<
149
+ TeamLimits$Outbound,
150
+ z.ZodTypeDef,
151
+ TeamLimits
152
+ > = z.object({
153
+ bareMetal: z.nullable(z.number().int()).optional(),
154
+ bareMetalGpu: z.nullable(z.number().int()).optional(),
155
+ virtualMachine: z.nullable(z.number().int()).optional(),
156
+ virtualMachineGpu: z.nullable(z.number().int()).optional(),
157
+ elasticIp: z.nullable(z.number().int()).optional(),
158
+ virtualNetwork: z.nullable(z.number().int()).optional(),
159
+ database: z.nullable(z.number().int()).optional(),
160
+ filesystem: z.nullable(z.number().int()).optional(),
161
+ blockStorage: z.nullable(z.number().int()).optional(),
162
+ }).transform((v) => {
163
+ return remap$(v, {
164
+ bareMetal: "bare_metal",
165
+ bareMetalGpu: "bare_metal_gpu",
166
+ virtualMachine: "virtual_machine",
167
+ virtualMachineGpu: "virtual_machine_gpu",
168
+ elasticIp: "elastic_ip",
169
+ virtualNetwork: "virtual_network",
170
+ blockStorage: "block_storage",
171
+ });
172
+ });
173
+
174
+ export function teamLimitsToJSON(teamLimits: TeamLimits): string {
175
+ return JSON.stringify(TeamLimits$outboundSchema.parse(teamLimits));
176
+ }
177
+ export function teamLimitsFromJSON(
178
+ jsonString: string,
179
+ ): SafeParseResult<TeamLimits, SDKValidationError> {
180
+ return safeParse(
181
+ jsonString,
182
+ (x) => TeamLimits$inboundSchema.parse(JSON.parse(x)),
183
+ `Failed to parse 'TeamLimits' from JSON`,
184
+ );
185
+ }
186
+
95
187
  /** @internal */
96
188
  export const TeamAttributes$inboundSchema: z.ZodType<
97
189
  TeamAttributes,
@@ -111,6 +203,7 @@ export const TeamAttributes$inboundSchema: z.ZodType<
111
203
  owner: UserInclude$inboundSchema.optional(),
112
204
  billing: z.lazy(() => TeamBilling$inboundSchema).optional(),
113
205
  feature_flags: z.array(z.string()).optional(),
206
+ limits: z.lazy(() => TeamLimits$inboundSchema).optional(),
114
207
  }).transform((v) => {
115
208
  return remap$(v, {
116
209
  "created_at": "createdAt",
@@ -134,6 +227,7 @@ export type TeamAttributes$Outbound = {
134
227
  owner?: UserInclude$Outbound | undefined;
135
228
  billing?: TeamBilling$Outbound | undefined;
136
229
  feature_flags?: Array<string> | undefined;
230
+ limits?: TeamLimits$Outbound | undefined;
137
231
  };
138
232
 
139
233
  /** @internal */
@@ -155,6 +249,7 @@ export const TeamAttributes$outboundSchema: z.ZodType<
155
249
  owner: UserInclude$outboundSchema.optional(),
156
250
  billing: z.lazy(() => TeamBilling$outboundSchema).optional(),
157
251
  featureFlags: z.array(z.string()).optional(),
252
+ limits: z.lazy(() => TeamLimits$outboundSchema).optional(),
158
253
  }).transform((v) => {
159
254
  return remap$(v, {
160
255
  createdAt: "created_at",
@@ -10,6 +10,18 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
10
10
 
11
11
  export type Currency = {};
12
12
 
13
+ export type TeamIncludeLimits = {
14
+ bareMetal?: number | null | undefined;
15
+ bareMetalGpu?: number | null | undefined;
16
+ virtualMachine?: number | null | undefined;
17
+ virtualMachineGpu?: number | null | undefined;
18
+ elasticIp?: number | null | undefined;
19
+ virtualNetwork?: number | null | undefined;
20
+ database?: number | null | undefined;
21
+ filesystem?: number | null | undefined;
22
+ blockStorage?: number | null | undefined;
23
+ };
24
+
13
25
  export type TeamInclude = {
14
26
  id?: string | undefined;
15
27
  name?: string | undefined;
@@ -19,6 +31,7 @@ export type TeamInclude = {
19
31
  currency?: Currency | undefined;
20
32
  status?: string | undefined;
21
33
  featureFlags?: Array<string> | undefined;
34
+ limits?: TeamIncludeLimits | undefined;
22
35
  };
23
36
 
24
37
  /** @internal */
@@ -50,6 +63,89 @@ export function currencyFromJSON(
50
63
  );
51
64
  }
52
65
 
66
+ /** @internal */
67
+ export const TeamIncludeLimits$inboundSchema: z.ZodType<
68
+ TeamIncludeLimits,
69
+ z.ZodTypeDef,
70
+ unknown
71
+ > = z.object({
72
+ bare_metal: z.nullable(z.number().int()).optional(),
73
+ bare_metal_gpu: z.nullable(z.number().int()).optional(),
74
+ virtual_machine: z.nullable(z.number().int()).optional(),
75
+ virtual_machine_gpu: z.nullable(z.number().int()).optional(),
76
+ elastic_ip: z.nullable(z.number().int()).optional(),
77
+ virtual_network: z.nullable(z.number().int()).optional(),
78
+ database: z.nullable(z.number().int()).optional(),
79
+ filesystem: z.nullable(z.number().int()).optional(),
80
+ block_storage: z.nullable(z.number().int()).optional(),
81
+ }).transform((v) => {
82
+ return remap$(v, {
83
+ "bare_metal": "bareMetal",
84
+ "bare_metal_gpu": "bareMetalGpu",
85
+ "virtual_machine": "virtualMachine",
86
+ "virtual_machine_gpu": "virtualMachineGpu",
87
+ "elastic_ip": "elasticIp",
88
+ "virtual_network": "virtualNetwork",
89
+ "block_storage": "blockStorage",
90
+ });
91
+ });
92
+ /** @internal */
93
+ export type TeamIncludeLimits$Outbound = {
94
+ bare_metal?: number | null | undefined;
95
+ bare_metal_gpu?: number | null | undefined;
96
+ virtual_machine?: number | null | undefined;
97
+ virtual_machine_gpu?: number | null | undefined;
98
+ elastic_ip?: number | null | undefined;
99
+ virtual_network?: number | null | undefined;
100
+ database?: number | null | undefined;
101
+ filesystem?: number | null | undefined;
102
+ block_storage?: number | null | undefined;
103
+ };
104
+
105
+ /** @internal */
106
+ export const TeamIncludeLimits$outboundSchema: z.ZodType<
107
+ TeamIncludeLimits$Outbound,
108
+ z.ZodTypeDef,
109
+ TeamIncludeLimits
110
+ > = z.object({
111
+ bareMetal: z.nullable(z.number().int()).optional(),
112
+ bareMetalGpu: z.nullable(z.number().int()).optional(),
113
+ virtualMachine: z.nullable(z.number().int()).optional(),
114
+ virtualMachineGpu: z.nullable(z.number().int()).optional(),
115
+ elasticIp: z.nullable(z.number().int()).optional(),
116
+ virtualNetwork: z.nullable(z.number().int()).optional(),
117
+ database: z.nullable(z.number().int()).optional(),
118
+ filesystem: z.nullable(z.number().int()).optional(),
119
+ blockStorage: z.nullable(z.number().int()).optional(),
120
+ }).transform((v) => {
121
+ return remap$(v, {
122
+ bareMetal: "bare_metal",
123
+ bareMetalGpu: "bare_metal_gpu",
124
+ virtualMachine: "virtual_machine",
125
+ virtualMachineGpu: "virtual_machine_gpu",
126
+ elasticIp: "elastic_ip",
127
+ virtualNetwork: "virtual_network",
128
+ blockStorage: "block_storage",
129
+ });
130
+ });
131
+
132
+ export function teamIncludeLimitsToJSON(
133
+ teamIncludeLimits: TeamIncludeLimits,
134
+ ): string {
135
+ return JSON.stringify(
136
+ TeamIncludeLimits$outboundSchema.parse(teamIncludeLimits),
137
+ );
138
+ }
139
+ export function teamIncludeLimitsFromJSON(
140
+ jsonString: string,
141
+ ): SafeParseResult<TeamIncludeLimits, SDKValidationError> {
142
+ return safeParse(
143
+ jsonString,
144
+ (x) => TeamIncludeLimits$inboundSchema.parse(JSON.parse(x)),
145
+ `Failed to parse 'TeamIncludeLimits' from JSON`,
146
+ );
147
+ }
148
+
53
149
  /** @internal */
54
150
  export const TeamInclude$inboundSchema: z.ZodType<
55
151
  TeamInclude,
@@ -64,6 +160,7 @@ export const TeamInclude$inboundSchema: z.ZodType<
64
160
  currency: z.lazy(() => Currency$inboundSchema).optional(),
65
161
  status: z.string().optional(),
66
162
  feature_flags: z.array(z.string()).optional(),
163
+ limits: z.lazy(() => TeamIncludeLimits$inboundSchema).optional(),
67
164
  }).transform((v) => {
68
165
  return remap$(v, {
69
166
  "feature_flags": "featureFlags",
@@ -79,6 +176,7 @@ export type TeamInclude$Outbound = {
79
176
  currency?: Currency$Outbound | undefined;
80
177
  status?: string | undefined;
81
178
  feature_flags?: Array<string> | undefined;
179
+ limits?: TeamIncludeLimits$Outbound | undefined;
82
180
  };
83
181
 
84
182
  /** @internal */
@@ -95,6 +193,7 @@ export const TeamInclude$outboundSchema: z.ZodType<
95
193
  currency: z.lazy(() => Currency$outboundSchema).optional(),
96
194
  status: z.string().optional(),
97
195
  featureFlags: z.array(z.string()).optional(),
196
+ limits: z.lazy(() => TeamIncludeLimits$outboundSchema).optional(),
98
197
  }).transform((v) => {
99
198
  return remap$(v, {
100
199
  featureFlags: "feature_flags",
@@ -13,14 +13,14 @@ import {
13
13
  PaginationMeta$outboundSchema,
14
14
  } from "./paginationmeta.js";
15
15
  import {
16
- UserDataObject,
17
- UserDataObject$inboundSchema,
18
- UserDataObject$Outbound,
19
- UserDataObject$outboundSchema,
20
- } from "./userdataobject.js";
16
+ UserDataProperties,
17
+ UserDataProperties$inboundSchema,
18
+ UserDataProperties$Outbound,
19
+ UserDataProperties$outboundSchema,
20
+ } from "./userdataproperties.js";
21
21
 
22
22
  export type UserData = {
23
- data?: Array<UserDataObject> | undefined;
23
+ data?: Array<UserDataProperties> | undefined;
24
24
  meta?: PaginationMeta | undefined;
25
25
  };
26
26
 
@@ -30,12 +30,12 @@ export const UserData$inboundSchema: z.ZodType<
30
30
  z.ZodTypeDef,
31
31
  unknown
32
32
  > = z.object({
33
- data: z.array(UserDataObject$inboundSchema).optional(),
33
+ data: z.array(UserDataProperties$inboundSchema).optional(),
34
34
  meta: PaginationMeta$inboundSchema.optional(),
35
35
  });
36
36
  /** @internal */
37
37
  export type UserData$Outbound = {
38
- data?: Array<UserDataObject$Outbound> | undefined;
38
+ data?: Array<UserDataProperties$Outbound> | undefined;
39
39
  meta?: PaginationMeta$Outbound | undefined;
40
40
  };
41
41
 
@@ -45,7 +45,7 @@ export const UserData$outboundSchema: z.ZodType<
45
45
  z.ZodTypeDef,
46
46
  UserData
47
47
  > = z.object({
48
- data: z.array(UserDataObject$outboundSchema).optional(),
48
+ data: z.array(UserDataProperties$outboundSchema).optional(),
49
49
  meta: PaginationMeta$outboundSchema.optional(),
50
50
  });
51
51
 
@@ -29,6 +29,10 @@ export type UserDataPropertiesAttributes = {
29
29
  * content of the User Data
30
30
  */
31
31
  content?: string | undefined;
32
+ /**
33
+ * decoded content of the User Data
34
+ */
35
+ decodedContent?: string | null | undefined;
32
36
  project?: ProjectInclude | undefined;
33
37
  createdAt?: string | undefined;
34
38
  updatedAt?: string | undefined;
@@ -57,11 +61,13 @@ export const UserDataPropertiesAttributes$inboundSchema: z.ZodType<
57
61
  > = z.object({
58
62
  description: z.string().optional(),
59
63
  content: z.string().optional(),
64
+ decoded_content: z.nullable(z.string()).optional(),
60
65
  project: ProjectInclude$inboundSchema.optional(),
61
66
  created_at: z.string().optional(),
62
67
  updated_at: z.string().optional(),
63
68
  }).transform((v) => {
64
69
  return remap$(v, {
70
+ "decoded_content": "decodedContent",
65
71
  "created_at": "createdAt",
66
72
  "updated_at": "updatedAt",
67
73
  });
@@ -70,6 +76,7 @@ export const UserDataPropertiesAttributes$inboundSchema: z.ZodType<
70
76
  export type UserDataPropertiesAttributes$Outbound = {
71
77
  description?: string | undefined;
72
78
  content?: string | undefined;
79
+ decoded_content?: string | null | undefined;
73
80
  project?: ProjectInclude$Outbound | undefined;
74
81
  created_at?: string | undefined;
75
82
  updated_at?: string | undefined;
@@ -83,11 +90,13 @@ export const UserDataPropertiesAttributes$outboundSchema: z.ZodType<
83
90
  > = z.object({
84
91
  description: z.string().optional(),
85
92
  content: z.string().optional(),
93
+ decodedContent: z.nullable(z.string()).optional(),
86
94
  project: ProjectInclude$outboundSchema.optional(),
87
95
  createdAt: z.string().optional(),
88
96
  updatedAt: z.string().optional(),
89
97
  }).transform((v) => {
90
98
  return remap$(v, {
99
+ decodedContent: "decoded_content",
91
100
  createdAt: "created_at",
92
101
  updatedAt: "updated_at",
93
102
  });
@@ -471,40 +471,34 @@ export const mockUserData = {
471
471
  export const mockUserDataList = {
472
472
  data: [
473
473
  {
474
- data: {
475
- id: 'userdata_test123',
476
- type: 'user_data',
477
- attributes: {
478
- description: 'Test User Data Script',
479
- content: '#!/bin/bash\necho "Hello World"\napt-get update\napt-get install -y nginx',
480
- project: {
481
- id: 'proj_test123',
482
- name: 'Test Project',
483
- slug: 'test-project',
484
- },
485
- created_at: '2024-01-01T00:00:00Z',
486
- updated_at: '2024-01-01T00:00:00Z',
474
+ id: 'userdata_test123',
475
+ type: 'user_data',
476
+ attributes: {
477
+ description: 'Test User Data Script',
478
+ content: '#!/bin/bash\necho "Hello World"\napt-get update\napt-get install -y nginx',
479
+ project: {
480
+ id: 'proj_test123',
481
+ name: 'Test Project',
482
+ slug: 'test-project',
487
483
  },
484
+ created_at: '2024-01-01T00:00:00Z',
485
+ updated_at: '2024-01-01T00:00:00Z',
488
486
  },
489
- meta: {},
490
487
  },
491
488
  {
492
- data: {
493
- id: 'userdata_test456',
494
- type: 'user_data',
495
- attributes: {
496
- description: 'Docker Setup Script',
497
- content: '#!/bin/bash\ncurl -fsSL https://get.docker.com -o get-docker.sh\nsh get-docker.sh',
498
- project: {
499
- id: 'proj_test456',
500
- name: 'Production Project',
501
- slug: 'production-project',
502
- },
503
- created_at: '2024-01-02T00:00:00Z',
504
- updated_at: '2024-01-02T00:00:00Z',
489
+ id: 'userdata_test456',
490
+ type: 'user_data',
491
+ attributes: {
492
+ description: 'Docker Setup Script',
493
+ content: '#!/bin/bash\ncurl -fsSL https://get.docker.com -o get-docker.sh\nsh get-docker.sh',
494
+ project: {
495
+ id: 'proj_test456',
496
+ name: 'Production Project',
497
+ slug: 'production-project',
505
498
  },
499
+ created_at: '2024-01-02T00:00:00Z',
500
+ updated_at: '2024-01-02T00:00:00Z',
506
501
  },
507
- meta: {},
508
502
  },
509
503
  ],
510
504
  meta: {},
@@ -33,9 +33,9 @@ describe('User Data - Core Operations', () => {
33
33
  // Assert
34
34
  expect(result.data).toBeDefined();
35
35
  expect(result.data.length).toBe(2);
36
- expect(result.data[0].data?.id).toBe('userdata_test123');
37
- expect(result.data[0].data?.type).toBe('user_data');
38
- expect(result.data[0].data?.attributes?.description).toBe('Test User Data Script');
36
+ expect(result.data[0].id).toBe('userdata_test123');
37
+ expect(result.data[0].type).toBe('user_data');
38
+ expect(result.data[0].attributes?.description).toBe('Test User Data Script');
39
39
  });
40
40
 
41
41
  test('should handle empty user data list', async () => {
@@ -68,9 +68,9 @@ describe('User Data - Core Operations', () => {
68
68
 
69
69
  // Assert
70
70
  const userData = result.data[0];
71
- expect(userData.data?.attributes?.content).toBeDefined();
72
- expect(userData.data?.attributes?.content).toContain('#!/bin/bash');
73
- expect(userData.data?.attributes?.content).toContain('apt-get update');
71
+ expect(userData.attributes?.content).toBeDefined();
72
+ expect(userData.attributes?.content).toContain('#!/bin/bash');
73
+ expect(userData.attributes?.content).toContain('apt-get update');
74
74
  });
75
75
 
76
76
  test('should include associated project', async () => {
@@ -85,10 +85,10 @@ describe('User Data - Core Operations', () => {
85
85
 
86
86
  // Assert
87
87
  const userData = result.data[0];
88
- expect(userData.data?.attributes?.project).toBeDefined();
89
- expect(userData.data?.attributes?.project?.id).toBe('proj_test123');
90
- expect(userData.data?.attributes?.project?.name).toBe('Test Project');
91
- expect(userData.data?.attributes?.project?.slug).toBe('test-project');
88
+ expect(userData.attributes?.project).toBeDefined();
89
+ expect(userData.attributes?.project?.id).toBe('proj_test123');
90
+ expect(userData.attributes?.project?.name).toBe('Test Project');
91
+ expect(userData.attributes?.project?.slug).toBe('test-project');
92
92
  });
93
93
 
94
94
  test('should include timestamps', async () => {
@@ -103,9 +103,9 @@ describe('User Data - Core Operations', () => {
103
103
 
104
104
  // Assert
105
105
  const userData = result.data[0];
106
- expect(userData.data?.attributes?.createdAt).toBeDefined();
107
- expect(userData.data?.attributes?.updatedAt).toBeDefined();
108
- expect(userData.data?.attributes?.createdAt).toBe('2024-01-01T00:00:00Z');
106
+ expect(userData.attributes?.createdAt).toBeDefined();
107
+ expect(userData.attributes?.updatedAt).toBeDefined();
108
+ expect(userData.attributes?.createdAt).toBe('2024-01-01T00:00:00Z');
109
109
  });
110
110
  });
111
111
 
@@ -539,7 +539,7 @@ describe('User Data - Core Operations', () => {
539
539
 
540
540
  // Assert
541
541
  const bashScript = result.data[0];
542
- expect(bashScript.data?.attributes?.content).toContain('#!/bin/bash');
542
+ expect(bashScript.attributes?.content).toContain('#!/bin/bash');
543
543
  });
544
544
 
545
545
  test('should handle multi-line scripts', async () => {
@@ -554,7 +554,7 @@ describe('User Data - Core Operations', () => {
554
554
 
555
555
  // Assert
556
556
  const script = result.data[0];
557
- const content = script.data?.attributes?.content || '';
557
+ const content = script.attributes?.content || '';
558
558
  const lines = content.split('\n');
559
559
  expect(lines.length).toBeGreaterThan(1);
560
560
  expect(lines[0]).toBe('#!/bin/bash');
@@ -604,8 +604,8 @@ describe('User Data - Core Operations', () => {
604
604
  const { result } = await sdk.userData.list();
605
605
 
606
606
  // Assert
607
- expect(result.data[0].data?.attributes?.project?.id).toBe('proj_test123');
608
- expect(result.data[1].data?.attributes?.project?.id).toBe('proj_test456');
607
+ expect(result.data[0].attributes?.project?.id).toBe('proj_test123');
608
+ expect(result.data[1].attributes?.project?.id).toBe('proj_test456');
609
609
  });
610
610
 
611
611
  test('should include project slug', async () => {
@@ -620,7 +620,7 @@ describe('User Data - Core Operations', () => {
620
620
 
621
621
  // Assert
622
622
  const userData = result.data[0];
623
- expect(userData.data?.attributes?.project?.slug).toBe('test-project');
623
+ expect(userData.attributes?.project?.slug).toBe('test-project');
624
624
  });
625
625
  });
626
626
  });