@workos/oagen-emitters 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/.husky/pre-commit +1 -0
  2. package/.oxfmtrc.json +8 -1
  3. package/.release-please-manifest.json +1 -1
  4. package/CHANGELOG.md +15 -0
  5. package/README.md +129 -0
  6. package/dist/index.d.mts +10 -1
  7. package/dist/index.d.mts.map +1 -1
  8. package/dist/index.mjs +11943 -2728
  9. package/dist/index.mjs.map +1 -1
  10. package/docs/sdk-architecture/go.md +338 -0
  11. package/docs/sdk-architecture/php.md +315 -0
  12. package/docs/sdk-architecture/python.md +511 -0
  13. package/oagen.config.ts +298 -2
  14. package/package.json +9 -5
  15. package/scripts/generate-php.js +13 -0
  16. package/scripts/git-push-with-published-oagen.sh +21 -0
  17. package/smoke/sdk-dotnet.ts +17 -3
  18. package/smoke/sdk-elixir.ts +17 -3
  19. package/smoke/sdk-go.ts +137 -46
  20. package/smoke/sdk-kotlin.ts +23 -4
  21. package/smoke/sdk-node.ts +15 -3
  22. package/smoke/sdk-php.ts +28 -26
  23. package/smoke/sdk-python.ts +5 -2
  24. package/smoke/sdk-ruby.ts +17 -3
  25. package/smoke/sdk-rust.ts +16 -3
  26. package/src/go/client.ts +141 -0
  27. package/src/go/enums.ts +196 -0
  28. package/src/go/fixtures.ts +212 -0
  29. package/src/go/index.ts +81 -0
  30. package/src/go/manifest.ts +36 -0
  31. package/src/go/models.ts +254 -0
  32. package/src/go/naming.ts +191 -0
  33. package/src/go/resources.ts +827 -0
  34. package/src/go/tests.ts +751 -0
  35. package/src/go/type-map.ts +82 -0
  36. package/src/go/wrappers.ts +261 -0
  37. package/src/index.ts +3 -0
  38. package/src/node/client.ts +167 -122
  39. package/src/node/enums.ts +13 -4
  40. package/src/node/errors.ts +42 -233
  41. package/src/node/field-plan.ts +726 -0
  42. package/src/node/fixtures.ts +15 -5
  43. package/src/node/index.ts +65 -16
  44. package/src/node/models.ts +264 -96
  45. package/src/node/naming.ts +52 -25
  46. package/src/node/resources.ts +621 -172
  47. package/src/node/sdk-errors.ts +41 -0
  48. package/src/node/tests.ts +71 -27
  49. package/src/node/type-map.ts +4 -2
  50. package/src/node/utils.ts +56 -64
  51. package/src/node/wrappers.ts +151 -0
  52. package/src/php/client.ts +171 -0
  53. package/src/php/enums.ts +67 -0
  54. package/src/php/errors.ts +9 -0
  55. package/src/php/fixtures.ts +181 -0
  56. package/src/php/index.ts +96 -0
  57. package/src/php/manifest.ts +36 -0
  58. package/src/php/models.ts +310 -0
  59. package/src/php/naming.ts +298 -0
  60. package/src/php/resources.ts +561 -0
  61. package/src/php/tests.ts +533 -0
  62. package/src/php/type-map.ts +90 -0
  63. package/src/php/utils.ts +18 -0
  64. package/src/php/wrappers.ts +151 -0
  65. package/src/python/client.ts +337 -0
  66. package/src/python/enums.ts +313 -0
  67. package/src/python/fixtures.ts +196 -0
  68. package/src/python/index.ts +95 -0
  69. package/src/python/manifest.ts +38 -0
  70. package/src/python/models.ts +688 -0
  71. package/src/python/naming.ts +209 -0
  72. package/src/python/resources.ts +1322 -0
  73. package/src/python/tests.ts +1335 -0
  74. package/src/python/type-map.ts +93 -0
  75. package/src/python/wrappers.ts +191 -0
  76. package/src/shared/model-utils.ts +255 -0
  77. package/src/shared/naming-utils.ts +107 -0
  78. package/src/shared/non-spec-services.ts +54 -0
  79. package/src/shared/resolved-ops.ts +109 -0
  80. package/src/shared/wrapper-utils.ts +59 -0
  81. package/test/go/client.test.ts +92 -0
  82. package/test/go/enums.test.ts +132 -0
  83. package/test/go/errors.test.ts +9 -0
  84. package/test/go/models.test.ts +265 -0
  85. package/test/go/resources.test.ts +408 -0
  86. package/test/go/tests.test.ts +143 -0
  87. package/test/node/client.test.ts +199 -94
  88. package/test/node/enums.test.ts +75 -3
  89. package/test/node/errors.test.ts +2 -41
  90. package/test/node/models.test.ts +109 -20
  91. package/test/node/naming.test.ts +37 -4
  92. package/test/node/resources.test.ts +662 -30
  93. package/test/node/serializers.test.ts +36 -7
  94. package/test/node/type-map.test.ts +11 -0
  95. package/test/php/client.test.ts +94 -0
  96. package/test/php/enums.test.ts +173 -0
  97. package/test/php/errors.test.ts +9 -0
  98. package/test/php/models.test.ts +497 -0
  99. package/test/php/resources.test.ts +644 -0
  100. package/test/php/tests.test.ts +118 -0
  101. package/test/python/client.test.ts +200 -0
  102. package/test/python/enums.test.ts +228 -0
  103. package/test/python/errors.test.ts +16 -0
  104. package/test/python/manifest.test.ts +74 -0
  105. package/test/python/models.test.ts +716 -0
  106. package/test/python/resources.test.ts +617 -0
  107. package/test/python/tests.test.ts +202 -0
  108. package/src/node/common.ts +0 -273
  109. package/src/node/config.ts +0 -71
  110. package/src/node/serializers.ts +0 -744
@@ -1,6 +1,7 @@
1
1
  import { describe, it, expect } from 'vitest';
2
2
  import { generateEnums } from '../../src/node/enums.js';
3
3
  import type { EmitterContext, ApiSpec, Enum, Service } from '@workos/oagen';
4
+ import { defaultSdkBehavior } from '@workos/oagen';
4
5
 
5
6
  const emptySpec: ApiSpec = {
6
7
  name: 'Test',
@@ -9,6 +10,7 @@ const emptySpec: ApiSpec = {
9
10
  services: [],
10
11
  models: [],
11
12
  enums: [],
13
+ sdk: defaultSdkBehavior(),
12
14
  };
13
15
 
14
16
  const ctx: EmitterContext = {
@@ -30,7 +32,13 @@ describe('generateEnums', () => {
30
32
  name: 'getOrganization',
31
33
  httpMethod: 'get',
32
34
  path: '/organizations/{id}',
33
- pathParams: [{ name: 'id', type: { kind: 'primitive', type: 'string' }, required: true }],
35
+ pathParams: [
36
+ {
37
+ name: 'id',
38
+ type: { kind: 'primitive', type: 'string' },
39
+ required: true,
40
+ },
41
+ ],
34
42
  queryParams: [],
35
43
  headerParams: [],
36
44
  response: {
@@ -76,7 +84,13 @@ describe('generateEnums', () => {
76
84
  name: 'getOrganization',
77
85
  httpMethod: 'get',
78
86
  path: '/organizations/{id}',
79
- pathParams: [{ name: 'id', type: { kind: 'primitive', type: 'string' }, required: true }],
87
+ pathParams: [
88
+ {
89
+ name: 'id',
90
+ type: { kind: 'primitive', type: 'string' },
91
+ required: true,
92
+ },
93
+ ],
80
94
  queryParams: [],
81
95
  headerParams: [],
82
96
  response: { kind: 'enum', name: 'OrgStatus' },
@@ -103,13 +117,71 @@ describe('generateEnums', () => {
103
117
  expect(files[0].path).toBe('src/organizations/interfaces/org-status.interface.ts');
104
118
  });
105
119
 
120
+ it('derives PascalCase member names when merging new enum values into baseline', () => {
121
+ const enums: Enum[] = [
122
+ {
123
+ name: 'OrganizationDomainState',
124
+ values: [
125
+ { name: 'FAILED', value: 'failed' },
126
+ { name: 'PENDING', value: 'pending' },
127
+ { name: 'VERIFIED', value: 'verified' },
128
+ { name: 'LEGACY_VERIFIED', value: 'legacy_verified' },
129
+ { name: 'UNVERIFIED', value: 'unverified' },
130
+ ],
131
+ },
132
+ ];
133
+
134
+ const testCtx: EmitterContext = {
135
+ ...ctx,
136
+ apiSurface: {
137
+ language: 'node',
138
+ extractedFrom: 'test',
139
+ extractedAt: '2024-01-01',
140
+ classes: {},
141
+ interfaces: {},
142
+ typeAliases: {},
143
+ enums: {
144
+ OrganizationDomainState: {
145
+ name: 'OrganizationDomainState',
146
+ members: {
147
+ Failed: 'failed',
148
+ Pending: 'pending',
149
+ Verified: 'verified',
150
+ },
151
+ },
152
+ },
153
+ exports: {},
154
+ },
155
+ };
156
+
157
+ const files = generateEnums(enums, testCtx);
158
+ const content = files[0].content;
159
+
160
+ // Existing members should be preserved as-is
161
+ expect(content).toContain("Failed = 'failed',");
162
+ expect(content).toContain("Pending = 'pending',");
163
+ expect(content).toContain("Verified = 'verified',");
164
+
165
+ // New members should be PascalCase, not lowercased
166
+ expect(content).toContain("LegacyVerified = 'legacy_verified',");
167
+ expect(content).toContain("Unverified = 'unverified',");
168
+
169
+ // Should NOT produce lowercased member names
170
+ expect(content).not.toContain('legacyverified');
171
+ });
172
+
106
173
  it('renders @deprecated on enum values', () => {
107
174
  const enums: Enum[] = [
108
175
  {
109
176
  name: 'Status',
110
177
  values: [
111
178
  { name: 'ACTIVE', value: 'active' },
112
- { name: 'LEGACY', value: 'legacy', description: 'No longer supported.', deprecated: true },
179
+ {
180
+ name: 'LEGACY',
181
+ value: 'legacy',
182
+ description: 'No longer supported.',
183
+ deprecated: true,
184
+ },
113
185
  { name: 'OLD', value: 'old', deprecated: true },
114
186
  ],
115
187
  },
@@ -2,47 +2,8 @@ import { describe, it, expect } from 'vitest';
2
2
  import { generateErrors } from '../../src/node/errors.js';
3
3
 
4
4
  describe('generateErrors', () => {
5
- it('generates all exception classes', () => {
5
+ it('returns empty array without context (static exceptions now hand-maintained)', () => {
6
6
  const files = generateErrors();
7
-
8
- const names = files.map((f) => f.path);
9
- expect(names).toContain('src/common/exceptions/bad-request.exception.ts');
10
- expect(names).toContain('src/common/exceptions/unauthorized.exception.ts');
11
- expect(names).toContain('src/common/exceptions/not-found.exception.ts');
12
- expect(names).toContain('src/common/exceptions/conflict.exception.ts');
13
- expect(names).toContain('src/common/exceptions/unprocessable-entity.exception.ts');
14
- expect(names).toContain('src/common/exceptions/rate-limit-exceeded.exception.ts');
15
- expect(names).toContain('src/common/exceptions/generic-server.exception.ts');
16
- expect(names).toContain('src/common/exceptions/no-api-key-provided.exception.ts');
17
- expect(names).toContain('src/common/exceptions/index.ts');
18
- });
19
-
20
- it('generates NotFoundException with correct status', () => {
21
- const files = generateErrors();
22
- const notFoundFile = files.find((f) => f.path.includes('not-found.exception.ts'))!;
23
-
24
- expect(notFoundFile.content).toContain('export class NotFoundException extends Error');
25
- expect(notFoundFile.content).toContain('readonly status = 404;');
26
- expect(notFoundFile.content).toContain('requestID: string');
27
- });
28
-
29
- it('generates RateLimitExceededException with retryAfter', () => {
30
- const files = generateErrors();
31
- const rateLimitFile = files.find((f) => f.path.includes('rate-limit-exceeded.exception.ts'))!;
32
-
33
- expect(rateLimitFile.content).toContain('export class RateLimitExceededException extends Error');
34
- expect(rateLimitFile.content).toContain('readonly status = 429;');
35
- expect(rateLimitFile.content).toContain('retryAfter?: number');
36
- });
37
-
38
- it('generates exception barrel with all exports', () => {
39
- const files = generateErrors();
40
- const barrel = files.find((f) => f.path === 'src/common/exceptions/index.ts')!;
41
-
42
- expect(barrel.content).toContain('export { BadRequestException }');
43
- expect(barrel.content).toContain('export { UnauthorizedException }');
44
- expect(barrel.content).toContain('export { NotFoundException }');
45
- expect(barrel.content).toContain('export { RateLimitExceededException }');
46
- expect(barrel.content).toContain('export { NoApiKeyProvidedException }');
7
+ expect(files).toEqual([]);
47
8
  });
48
9
  });
@@ -1,6 +1,7 @@
1
1
  import { describe, it, expect } from 'vitest';
2
2
  import { generateModels } from '../../src/node/models.js';
3
3
  import type { EmitterContext, ApiSpec, Model, Service } from '@workos/oagen';
4
+ import { defaultSdkBehavior } from '@workos/oagen';
4
5
 
5
6
  const emptySpec: ApiSpec = {
6
7
  name: 'Test',
@@ -9,6 +10,7 @@ const emptySpec: ApiSpec = {
9
10
  services: [],
10
11
  models: [],
11
12
  enums: [],
13
+ sdk: defaultSdkBehavior(),
12
14
  };
13
15
 
14
16
  const ctx: EmitterContext = {
@@ -30,7 +32,13 @@ describe('generateModels', () => {
30
32
  name: 'getOrganization',
31
33
  httpMethod: 'get',
32
34
  path: '/organizations/{id}',
33
- pathParams: [{ name: 'id', type: { kind: 'primitive', type: 'string' }, required: true }],
35
+ pathParams: [
36
+ {
37
+ name: 'id',
38
+ type: { kind: 'primitive', type: 'string' },
39
+ required: true,
40
+ },
41
+ ],
34
42
  queryParams: [],
35
43
  headerParams: [],
36
44
  response: { kind: 'model', name: 'Organization' },
@@ -101,7 +109,13 @@ describe('generateModels', () => {
101
109
  name: 'getOrganization',
102
110
  httpMethod: 'get',
103
111
  path: '/organizations/{id}',
104
- pathParams: [{ name: 'id', type: { kind: 'primitive', type: 'string' }, required: true }],
112
+ pathParams: [
113
+ {
114
+ name: 'id',
115
+ type: { kind: 'primitive', type: 'string' },
116
+ required: true,
117
+ },
118
+ ],
105
119
  queryParams: [],
106
120
  headerParams: [],
107
121
  response: { kind: 'model', name: 'Organization' },
@@ -247,7 +261,13 @@ describe('generateModels', () => {
247
261
  name: 'getOrganization',
248
262
  httpMethod: 'get',
249
263
  path: '/organizations/{id}',
250
- pathParams: [{ name: 'id', type: { kind: 'primitive', type: 'string' }, required: true }],
264
+ pathParams: [
265
+ {
266
+ name: 'id',
267
+ type: { kind: 'primitive', type: 'string' },
268
+ required: true,
269
+ },
270
+ ],
251
271
  queryParams: [],
252
272
  headerParams: [],
253
273
  response: { kind: 'model', name: 'Organization' },
@@ -306,7 +326,13 @@ describe('generateModels', () => {
306
326
  name: 'getOrganization',
307
327
  httpMethod: 'get',
308
328
  path: '/organizations/{id}',
309
- pathParams: [{ name: 'id', type: { kind: 'primitive', type: 'string' }, required: true }],
329
+ pathParams: [
330
+ {
331
+ name: 'id',
332
+ type: { kind: 'primitive', type: 'string' },
333
+ required: true,
334
+ },
335
+ ],
310
336
  queryParams: [],
311
337
  headerParams: [],
312
338
  response: { kind: 'model', name: 'Organization' },
@@ -386,7 +412,13 @@ describe('generateModels', () => {
386
412
  name: 'getOrganization',
387
413
  httpMethod: 'get',
388
414
  path: '/organizations/{id}',
389
- pathParams: [{ name: 'id', type: { kind: 'primitive', type: 'string' }, required: true }],
415
+ pathParams: [
416
+ {
417
+ name: 'id',
418
+ type: { kind: 'primitive', type: 'string' },
419
+ required: true,
420
+ },
421
+ ],
390
422
  queryParams: [],
391
423
  headerParams: [],
392
424
  response: { kind: 'model', name: 'Organization' },
@@ -470,12 +502,18 @@ describe('generateModels', () => {
470
502
  fields: [
471
503
  {
472
504
  name: 'before',
473
- type: { kind: 'nullable', inner: { kind: 'primitive', type: 'string' } },
505
+ type: {
506
+ kind: 'nullable',
507
+ inner: { kind: 'primitive', type: 'string' },
508
+ },
474
509
  required: false,
475
510
  },
476
511
  {
477
512
  name: 'after',
478
- type: { kind: 'nullable', inner: { kind: 'primitive', type: 'string' } },
513
+ type: {
514
+ kind: 'nullable',
515
+ inner: { kind: 'primitive', type: 'string' },
516
+ },
479
517
  required: false,
480
518
  },
481
519
  ],
@@ -542,7 +580,10 @@ describe('generateModels', () => {
542
580
  },
543
581
  {
544
582
  name: 'data',
545
- type: { kind: 'array', items: { kind: 'model', name: 'Connection' } },
583
+ type: {
584
+ kind: 'array',
585
+ items: { kind: 'model', name: 'Connection' },
586
+ },
546
587
  required: true,
547
588
  },
548
589
  {
@@ -557,12 +598,18 @@ describe('generateModels', () => {
557
598
  fields: [
558
599
  {
559
600
  name: 'before',
560
- type: { kind: 'nullable', inner: { kind: 'primitive', type: 'string' } },
601
+ type: {
602
+ kind: 'nullable',
603
+ inner: { kind: 'primitive', type: 'string' },
604
+ },
561
605
  required: false,
562
606
  },
563
607
  {
564
608
  name: 'after',
565
- type: { kind: 'nullable', inner: { kind: 'primitive', type: 'string' } },
609
+ type: {
610
+ kind: 'nullable',
611
+ inner: { kind: 'primitive', type: 'string' },
612
+ },
566
613
  required: false,
567
614
  },
568
615
  ],
@@ -607,7 +654,13 @@ describe('generateModels', () => {
607
654
  name: 'getOrganization',
608
655
  httpMethod: 'get',
609
656
  path: '/organizations/{id}',
610
- pathParams: [{ name: 'id', type: { kind: 'primitive', type: 'string' }, required: true }],
657
+ pathParams: [
658
+ {
659
+ name: 'id',
660
+ type: { kind: 'primitive', type: 'string' },
661
+ required: true,
662
+ },
663
+ ],
611
664
  queryParams: [],
612
665
  headerParams: [],
613
666
  response: { kind: 'model', name: 'Pagination' },
@@ -623,12 +676,18 @@ describe('generateModels', () => {
623
676
  fields: [
624
677
  {
625
678
  name: 'before',
626
- type: { kind: 'nullable', inner: { kind: 'primitive', type: 'string' } },
679
+ type: {
680
+ kind: 'nullable',
681
+ inner: { kind: 'primitive', type: 'string' },
682
+ },
627
683
  required: false,
628
684
  },
629
685
  {
630
686
  name: 'after',
631
- type: { kind: 'nullable', inner: { kind: 'primitive', type: 'string' } },
687
+ type: {
688
+ kind: 'nullable',
689
+ inner: { kind: 'primitive', type: 'string' },
690
+ },
632
691
  required: false,
633
692
  },
634
693
  {
@@ -661,7 +720,13 @@ describe('model deduplication', () => {
661
720
  name: 'getRole',
662
721
  httpMethod: 'get',
663
722
  path: '/roles/{id}',
664
- pathParams: [{ name: 'id', type: { kind: 'primitive', type: 'string' }, required: true }],
723
+ pathParams: [
724
+ {
725
+ name: 'id',
726
+ type: { kind: 'primitive', type: 'string' },
727
+ required: true,
728
+ },
729
+ ],
665
730
  queryParams: [],
666
731
  headerParams: [],
667
732
  response: { kind: 'model', name: 'EnvironmentRole' },
@@ -675,17 +740,41 @@ describe('model deduplication', () => {
675
740
  {
676
741
  name: 'EnvironmentRole',
677
742
  fields: [
678
- { name: 'id', type: { kind: 'primitive', type: 'string' }, required: true },
679
- { name: 'name', type: { kind: 'primitive', type: 'string' }, required: true },
680
- { name: 'type', type: { kind: 'literal', value: 'environment_role' }, required: true },
743
+ {
744
+ name: 'id',
745
+ type: { kind: 'primitive', type: 'string' },
746
+ required: true,
747
+ },
748
+ {
749
+ name: 'name',
750
+ type: { kind: 'primitive', type: 'string' },
751
+ required: true,
752
+ },
753
+ {
754
+ name: 'type',
755
+ type: { kind: 'literal', value: 'environment_role' },
756
+ required: true,
757
+ },
681
758
  ],
682
759
  },
683
760
  {
684
761
  name: 'OrganizationRole',
685
762
  fields: [
686
- { name: 'id', type: { kind: 'primitive', type: 'string' }, required: true },
687
- { name: 'name', type: { kind: 'primitive', type: 'string' }, required: true },
688
- { name: 'type', type: { kind: 'literal', value: 'environment_role' }, required: true },
763
+ {
764
+ name: 'id',
765
+ type: { kind: 'primitive', type: 'string' },
766
+ required: true,
767
+ },
768
+ {
769
+ name: 'name',
770
+ type: { kind: 'primitive', type: 'string' },
771
+ required: true,
772
+ },
773
+ {
774
+ name: 'type',
775
+ type: { kind: 'literal', value: 'environment_role' },
776
+ required: true,
777
+ },
689
778
  ],
690
779
  },
691
780
  ];
@@ -10,10 +10,31 @@ import {
10
10
  servicePropertyName,
11
11
  resolveServiceName,
12
12
  buildServiceNameMap,
13
+ stripNoiseSuffixes,
13
14
  } from '../../src/node/naming.js';
14
15
  import type { EmitterContext, ApiSpec, Service } from '@workos/oagen';
16
+ import { defaultSdkBehavior } from '@workos/oagen';
15
17
 
16
18
  describe('naming', () => {
19
+ describe('stripNoiseSuffixes', () => {
20
+ it('strips trailing Dto', () => {
21
+ expect(stripNoiseSuffixes('OrganizationDto')).toBe('Organization');
22
+ expect(stripNoiseSuffixes('UpdateOrganizationDto')).toBe('UpdateOrganization');
23
+ });
24
+
25
+ it('is case-insensitive for the Dto suffix', () => {
26
+ expect(stripNoiseSuffixes('OrganizationDTO')).toBe('Organization');
27
+ });
28
+
29
+ it('does not strip Dto from the middle of a name', () => {
30
+ expect(stripNoiseSuffixes('DtoFactory')).toBe('DtoFactory');
31
+ });
32
+
33
+ it('leaves names without Dto unchanged', () => {
34
+ expect(stripNoiseSuffixes('Organization')).toBe('Organization');
35
+ });
36
+ });
37
+
17
38
  describe('className', () => {
18
39
  it('converts to PascalCase', () => {
19
40
  expect(className('organizations')).toBe('Organizations');
@@ -88,6 +109,7 @@ describe('naming', () => {
88
109
  services: [],
89
110
  models: [],
90
111
  enums: [],
112
+ sdk: defaultSdkBehavior(),
91
113
  };
92
114
 
93
115
  it('returns overlay class name when available', () => {
@@ -116,7 +138,12 @@ describe('naming', () => {
116
138
  methodByOperation: new Map([
117
139
  [
118
140
  'POST /auth/factors/enroll',
119
- { className: 'Mfa', methodName: 'enrollFactor', params: [], returnType: 'void' },
141
+ {
142
+ className: 'Mfa',
143
+ methodName: 'enrollFactor',
144
+ params: [],
145
+ returnType: 'void',
146
+ },
120
147
  ],
121
148
  ]),
122
149
  httpKeyByMethod: new Map(),
@@ -133,7 +160,7 @@ describe('naming', () => {
133
160
 
134
161
  it('falls back to PascalCase of service.name', () => {
135
162
  const service: Service = {
136
- name: 'MultiFactorAuth',
163
+ name: 'SomeNewService',
137
164
  operations: [],
138
165
  };
139
166
 
@@ -143,7 +170,7 @@ describe('naming', () => {
143
170
  spec: emptySpec,
144
171
  };
145
172
 
146
- expect(resolveServiceName(service, ctx)).toBe('MultiFactorAuth');
173
+ expect(resolveServiceName(service, ctx)).toBe('SomeNewService');
147
174
  });
148
175
  });
149
176
 
@@ -155,6 +182,7 @@ describe('naming', () => {
155
182
  services: [],
156
183
  models: [],
157
184
  enums: [],
185
+ sdk: defaultSdkBehavior(),
158
186
  };
159
187
 
160
188
  it('maps IR names to resolved names', () => {
@@ -189,7 +217,12 @@ describe('naming', () => {
189
217
  methodByOperation: new Map([
190
218
  [
191
219
  'POST /auth/factors/enroll',
192
- { className: 'Mfa', methodName: 'enrollFactor', params: [], returnType: 'void' },
220
+ {
221
+ className: 'Mfa',
222
+ methodName: 'enrollFactor',
223
+ params: [],
224
+ returnType: 'void',
225
+ },
193
226
  ],
194
227
  ]),
195
228
  httpKeyByMethod: new Map(),