@nextplus/js-sdk 0.0.1 → 0.0.4

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 (249) hide show
  1. package/README.md +228 -0
  2. package/dist/chunk-DNVJS7WW.js +20836 -0
  3. package/dist/chunk-FXXZNC42.js +726 -0
  4. package/dist/index.d.ts +34 -209
  5. package/dist/index.js +244 -27585
  6. package/dist/sdk/client/index.d.ts +39 -0
  7. package/dist/sdk/client/index.js +18 -0
  8. package/dist/sdk/sdk.gen.d.ts +34568 -0
  9. package/dist/sdk/sdk.gen.js +213 -0
  10. package/dist/types.gen-vDP9AbtO.d.ts +258 -0
  11. package/openapi-ts.config.ts +36 -0
  12. package/package.json +32 -74
  13. package/prettier.config.js +5 -0
  14. package/src/index.ts +219 -0
  15. package/src/sdk/client/client.gen.ts +199 -0
  16. package/src/sdk/client/index.ts +25 -0
  17. package/src/sdk/client/types.gen.ts +232 -0
  18. package/src/sdk/client/utils.gen.ts +424 -0
  19. package/src/sdk/client.gen.ts +28 -0
  20. package/src/sdk/core/auth.gen.ts +42 -0
  21. package/src/sdk/core/bodySerializer.gen.ts +90 -0
  22. package/src/sdk/core/params.gen.ts +153 -0
  23. package/src/sdk/core/pathSerializer.gen.ts +181 -0
  24. package/src/sdk/core/types.gen.ts +120 -0
  25. package/src/sdk/index.ts +3 -0
  26. package/src/sdk/schemas.gen.ts +6968 -0
  27. package/src/sdk/sdk.gen.ts +31790 -0
  28. package/src/sdk/transformers.gen.ts +8383 -0
  29. package/src/sdk/types.gen.ts +40708 -0
  30. package/src/smoke.ts +74 -0
  31. package/tsconfig.json +23 -0
  32. package/tsconfig.node.json +11 -0
  33. package/LICENSE +0 -19
  34. package/dist/core/ApiError.d.ts +0 -10
  35. package/dist/core/ApiRequestOptions.d.ts +0 -13
  36. package/dist/core/ApiResult.d.ts +0 -7
  37. package/dist/core/CancelablePromise.d.ts +0 -20
  38. package/dist/core/OpenAPI.d.ts +0 -16
  39. package/dist/core/request.d.ts +0 -30
  40. package/dist/index.d.mts +0 -15467
  41. package/dist/index.js.map +0 -1
  42. package/dist/index.mjs +0 -27586
  43. package/dist/index.mjs.map +0 -1
  44. package/dist/models/ACL.d.ts +0 -19
  45. package/dist/models/AIPrompt.d.ts +0 -13
  46. package/dist/models/AccessToken.d.ts +0 -12
  47. package/dist/models/ApiMethod.d.ts +0 -13
  48. package/dist/models/ApiMethodLog.d.ts +0 -14
  49. package/dist/models/BreakType.d.ts +0 -10
  50. package/dist/models/Catalog.d.ts +0 -16
  51. package/dist/models/Category.d.ts +0 -10
  52. package/dist/models/Certificate.d.ts +0 -12
  53. package/dist/models/CertificateMapping.d.ts +0 -11
  54. package/dist/models/Chapter.d.ts +0 -6
  55. package/dist/models/Comment.d.ts +0 -13
  56. package/dist/models/Configuration.d.ts +0 -16
  57. package/dist/models/Connection.d.ts +0 -10
  58. package/dist/models/Connector.d.ts +0 -9
  59. package/dist/models/ConnectorFunction.d.ts +0 -13
  60. package/dist/models/ContentPackage.d.ts +0 -24
  61. package/dist/models/ContentPackageSession.d.ts +0 -12
  62. package/dist/models/ContentPackageView.d.ts +0 -11
  63. package/dist/models/CustomField.d.ts +0 -18
  64. package/dist/models/Device.d.ts +0 -10
  65. package/dist/models/DeviceFamily.d.ts +0 -12
  66. package/dist/models/Document.d.ts +0 -24
  67. package/dist/models/Event.d.ts +0 -15
  68. package/dist/models/Field.d.ts +0 -33
  69. package/dist/models/FileParser.d.ts +0 -15
  70. package/dist/models/FileParserJob.d.ts +0 -12
  71. package/dist/models/FileParserStrategyJob.d.ts +0 -15
  72. package/dist/models/Folder.d.ts +0 -9
  73. package/dist/models/Form.d.ts +0 -35
  74. package/dist/models/FormData.d.ts +0 -55
  75. package/dist/models/FormDataComment.d.ts +0 -13
  76. package/dist/models/Forum.d.ts +0 -12
  77. package/dist/models/Gateway.d.ts +0 -17
  78. package/dist/models/Group.d.ts +0 -8
  79. package/dist/models/InventoryTransaction.d.ts +0 -19
  80. package/dist/models/Kit.d.ts +0 -17
  81. package/dist/models/List.d.ts +0 -10
  82. package/dist/models/ListItem.d.ts +0 -13
  83. package/dist/models/Location.d.ts +0 -13
  84. package/dist/models/Menus.d.ts +0 -10
  85. package/dist/models/NPS.d.ts +0 -16
  86. package/dist/models/Node.d.ts +0 -32
  87. package/dist/models/ObjectID.d.ts +0 -1
  88. package/dist/models/OpcUaServer.d.ts +0 -15
  89. package/dist/models/Operation.d.ts +0 -15
  90. package/dist/models/Pages.d.ts +0 -11
  91. package/dist/models/Part.d.ts +0 -10
  92. package/dist/models/PartAssembly.d.ts +0 -55
  93. package/dist/models/PartAssemblyDocument.d.ts +0 -9
  94. package/dist/models/Post.d.ts +0 -16
  95. package/dist/models/PrintPreset.d.ts +0 -26
  96. package/dist/models/PriorityLabel.d.ts +0 -12
  97. package/dist/models/ProductionEntity.d.ts +0 -18
  98. package/dist/models/ProductionEntityEvent.d.ts +0 -21
  99. package/dist/models/ProductionEntityMapping.d.ts +0 -16
  100. package/dist/models/ProductionEntityTransaction.d.ts +0 -19
  101. package/dist/models/ProductionEntityType.d.ts +0 -10
  102. package/dist/models/Project.d.ts +0 -10
  103. package/dist/models/Resource.d.ts +0 -26
  104. package/dist/models/ResourceMapping.d.ts +0 -9
  105. package/dist/models/Revision.d.ts +0 -8
  106. package/dist/models/Role.d.ts +0 -8
  107. package/dist/models/RoleMapping.d.ts +0 -17
  108. package/dist/models/Rule.d.ts +0 -11
  109. package/dist/models/ScromSession.d.ts +0 -11
  110. package/dist/models/Shift.d.ts +0 -26
  111. package/dist/models/ShiftType.d.ts +0 -28
  112. package/dist/models/Station.d.ts +0 -11
  113. package/dist/models/Stock.d.ts +0 -56
  114. package/dist/models/StockItem.d.ts +0 -7
  115. package/dist/models/SyncClients.d.ts +0 -12
  116. package/dist/models/SyncHistory.d.ts +0 -12
  117. package/dist/models/Table.d.ts +0 -11
  118. package/dist/models/TableSetup.d.ts +0 -18
  119. package/dist/models/TimeLog.d.ts +0 -7
  120. package/dist/models/TimeLogReport.d.ts +0 -29
  121. package/dist/models/Timeline.d.ts +0 -17
  122. package/dist/models/Tool.d.ts +0 -18
  123. package/dist/models/Translation.d.ts +0 -12
  124. package/dist/models/Unit.d.ts +0 -11
  125. package/dist/models/UpdateInfo.d.ts +0 -9
  126. package/dist/models/UserModel.d.ts +0 -70
  127. package/dist/models/UserPreferences.d.ts +0 -6
  128. package/dist/models/Variant.d.ts +0 -13
  129. package/dist/models/VoteMapping.d.ts +0 -12
  130. package/dist/models/Warehouse.d.ts +0 -9
  131. package/dist/models/Webhook.d.ts +0 -15
  132. package/dist/models/Wire.d.ts +0 -12
  133. package/dist/models/Wiringlist.d.ts +0 -15
  134. package/dist/models/Workflow.d.ts +0 -54
  135. package/dist/models/WorkflowDetails.d.ts +0 -9
  136. package/dist/models/WorkflowNote.d.ts +0 -18
  137. package/dist/models/WorkflowSessionItem.d.ts +0 -56
  138. package/dist/models/WorkflowType.d.ts +0 -17
  139. package/dist/models/Workorder.d.ts +0 -94
  140. package/dist/models/WorkorderAction.d.ts +0 -8
  141. package/dist/models/WorkorderStatus.d.ts +0 -22
  142. package/dist/models/WorkorderTemplate.d.ts +0 -23
  143. package/dist/models/meta.d.ts +0 -5
  144. package/dist/models/x_any.d.ts +0 -1
  145. package/dist/services/AclService.d.ts +0 -133
  146. package/dist/services/AiPromptService.d.ts +0 -133
  147. package/dist/services/AiService.d.ts +0 -12
  148. package/dist/services/ApiMethodLogService.d.ts +0 -133
  149. package/dist/services/ApiMethodService.d.ts +0 -140
  150. package/dist/services/BomService.d.ts +0 -18
  151. package/dist/services/BreakService.d.ts +0 -19
  152. package/dist/services/BreakTypeService.d.ts +0 -42
  153. package/dist/services/CatalogService.d.ts +0 -267
  154. package/dist/services/CategoryService.d.ts +0 -74
  155. package/dist/services/CertificateMappingService.d.ts +0 -60
  156. package/dist/services/CertificateService.d.ts +0 -74
  157. package/dist/services/ChapterService.d.ts +0 -34
  158. package/dist/services/CommentService.d.ts +0 -58
  159. package/dist/services/ConfigurationService.d.ts +0 -49
  160. package/dist/services/ConnectionService.d.ts +0 -20
  161. package/dist/services/ConnectorFunctionService.d.ts +0 -149
  162. package/dist/services/ConnectorService.d.ts +0 -201
  163. package/dist/services/ContainerService.d.ts +0 -66
  164. package/dist/services/ContentPackageService.d.ts +0 -115
  165. package/dist/services/ContentPackageSessionService.d.ts +0 -28
  166. package/dist/services/ContentPackageViewService.d.ts +0 -165
  167. package/dist/services/CustomFieldService.d.ts +0 -57
  168. package/dist/services/DeviceFamilyService.d.ts +0 -64
  169. package/dist/services/DeviceService.d.ts +0 -21
  170. package/dist/services/DigestEmailService.d.ts +0 -8
  171. package/dist/services/DocumentService.d.ts +0 -103
  172. package/dist/services/EventService.d.ts +0 -20
  173. package/dist/services/FieldService.d.ts +0 -86
  174. package/dist/services/FileParserJobService.d.ts +0 -49
  175. package/dist/services/FileParserService.d.ts +0 -78
  176. package/dist/services/FileParserStrategyJobService.d.ts +0 -49
  177. package/dist/services/FolderService.d.ts +0 -50
  178. package/dist/services/FormDataCommentService.d.ts +0 -159
  179. package/dist/services/FormDataService.d.ts +0 -242
  180. package/dist/services/FormService.d.ts +0 -82
  181. package/dist/services/ForumService.d.ts +0 -49
  182. package/dist/services/GatewayService.d.ts +0 -59
  183. package/dist/services/GroupService.d.ts +0 -50
  184. package/dist/services/IntegrationBuilderService.d.ts +0 -23
  185. package/dist/services/InventoryTransactionService.d.ts +0 -151
  186. package/dist/services/LastSeenResourceService.d.ts +0 -16
  187. package/dist/services/ListItemService.d.ts +0 -96
  188. package/dist/services/ListService.d.ts +0 -73
  189. package/dist/services/LocationService.d.ts +0 -80
  190. package/dist/services/MenusService.d.ts +0 -180
  191. package/dist/services/NodeService.d.ts +0 -383
  192. package/dist/services/NpsService.d.ts +0 -56
  193. package/dist/services/OpcUaServerService.d.ts +0 -182
  194. package/dist/services/OperationService.d.ts +0 -60
  195. package/dist/services/PagesService.d.ts +0 -151
  196. package/dist/services/PartAssemblyDocumentService.d.ts +0 -12
  197. package/dist/services/PartAssemblyService.d.ts +0 -400
  198. package/dist/services/PartService.d.ts +0 -133
  199. package/dist/services/PostService.d.ts +0 -56
  200. package/dist/services/PrintPresetService.d.ts +0 -155
  201. package/dist/services/PriorityLabelService.d.ts +0 -45
  202. package/dist/services/PriorityService.d.ts +0 -51
  203. package/dist/services/ProductionEntityEventService.d.ts +0 -169
  204. package/dist/services/ProductionEntityMappingService.d.ts +0 -142
  205. package/dist/services/ProductionEntityService.d.ts +0 -207
  206. package/dist/services/ProductionEntityTransactionService.d.ts +0 -142
  207. package/dist/services/ProductionEntityTypeService.d.ts +0 -151
  208. package/dist/services/ProjectService.d.ts +0 -142
  209. package/dist/services/PythonResultService.d.ts +0 -15
  210. package/dist/services/ResourceMappingService.d.ts +0 -133
  211. package/dist/services/ResourceService.d.ts +0 -264
  212. package/dist/services/RevisionService.d.ts +0 -62
  213. package/dist/services/RoleMappingService.d.ts +0 -151
  214. package/dist/services/RoleService.d.ts +0 -276
  215. package/dist/services/RuleService.d.ts +0 -217
  216. package/dist/services/ScromSessionService.d.ts +0 -18
  217. package/dist/services/SettingService.d.ts +0 -147
  218. package/dist/services/ShiftService.d.ts +0 -181
  219. package/dist/services/ShiftTypeService.d.ts +0 -142
  220. package/dist/services/StationService.d.ts +0 -50
  221. package/dist/services/StockService.d.ts +0 -766
  222. package/dist/services/SyncClientsService.d.ts +0 -142
  223. package/dist/services/SyncHistoryService.d.ts +0 -142
  224. package/dist/services/SyncService.d.ts +0 -89
  225. package/dist/services/TableService.d.ts +0 -154
  226. package/dist/services/TableSetupService.d.ts +0 -40
  227. package/dist/services/TimeLogReportService.d.ts +0 -87
  228. package/dist/services/TimelineService.d.ts +0 -73
  229. package/dist/services/ToolService.d.ts +0 -73
  230. package/dist/services/TranslationService.d.ts +0 -172
  231. package/dist/services/UnitService.d.ts +0 -182
  232. package/dist/services/UpdateInfoService.d.ts +0 -24
  233. package/dist/services/UserModelService.d.ts +0 -245
  234. package/dist/services/VariantService.d.ts +0 -42
  235. package/dist/services/VoteMappingService.d.ts +0 -19
  236. package/dist/services/WarehouseService.d.ts +0 -19
  237. package/dist/services/WebhookService.d.ts +0 -58
  238. package/dist/services/WireService.d.ts +0 -151
  239. package/dist/services/WiringlistService.d.ts +0 -340
  240. package/dist/services/WorkflowDetailsService.d.ts +0 -151
  241. package/dist/services/WorkflowNoteService.d.ts +0 -173
  242. package/dist/services/WorkflowService.d.ts +0 -976
  243. package/dist/services/WorkflowSessionItemRecordService.d.ts +0 -19
  244. package/dist/services/WorkflowSessionItemService.d.ts +0 -205
  245. package/dist/services/WorkflowTypeService.d.ts +0 -49
  246. package/dist/services/WorkorderService.d.ts +0 -1138
  247. package/dist/services/WorkorderStatusService.d.ts +0 -78
  248. package/dist/services/WorkorderTemplateService.d.ts +0 -49
  249. package/tsconfig.build.json +0 -14
@@ -0,0 +1,213 @@
1
+ import {
2
+ AclService,
3
+ AiPromptService,
4
+ AiService,
5
+ ApiMethodLogService,
6
+ ApiMethodService,
7
+ BomService,
8
+ BreakService,
9
+ BreakTypeService,
10
+ CatalogService,
11
+ CategoryService,
12
+ CertificateMappingService,
13
+ CertificateService,
14
+ ChapterService,
15
+ CommentService,
16
+ ConfigurationService,
17
+ ConnectionService,
18
+ ConnectorFunctionService,
19
+ ConnectorService,
20
+ ContainerService,
21
+ ContentPackageService,
22
+ ContentPackageSessionService,
23
+ ContentPackageViewService,
24
+ CustomFieldService,
25
+ DeviceFamilyService,
26
+ DeviceService,
27
+ DigestEmailService,
28
+ DocumentService,
29
+ EventService,
30
+ FieldService,
31
+ FileParserJobService,
32
+ FileParserService,
33
+ FileParserStrategyJobService,
34
+ FolderService,
35
+ FormDataCommentService,
36
+ FormDataService,
37
+ FormService,
38
+ ForumService,
39
+ GatewayService,
40
+ GroupService,
41
+ IntegrationBuilderService,
42
+ InventoryTransactionService,
43
+ LastSeenResourceService,
44
+ ListItemService,
45
+ ListService,
46
+ LocationService,
47
+ MenusService,
48
+ NodeService,
49
+ NpsService,
50
+ OpcUaServerService,
51
+ OperationService,
52
+ PagesService,
53
+ PartAssemblyDocumentService,
54
+ PartAssemblyService,
55
+ PartService,
56
+ PostService,
57
+ PrintPresetService,
58
+ PriorityLabelService,
59
+ PriorityService,
60
+ ProductionEntityEventService,
61
+ ProductionEntityMappingService,
62
+ ProductionEntityService,
63
+ ProductionEntityTransactionService,
64
+ ProductionEntityTypeService,
65
+ ProjectService,
66
+ PythonResultService,
67
+ ResourceMappingService,
68
+ ResourceService,
69
+ RevisionService,
70
+ RoleMappingService,
71
+ RoleService,
72
+ RuleService,
73
+ ScromSessionService,
74
+ SettingService,
75
+ ShiftService,
76
+ ShiftTypeService,
77
+ StationService,
78
+ StockService,
79
+ SyncClientsService,
80
+ SyncHistoryService,
81
+ SyncService,
82
+ TableService,
83
+ TableSetupService,
84
+ TimeLogReportService,
85
+ TimelineService,
86
+ ToolService,
87
+ TranslationService,
88
+ UnitService,
89
+ UpdateInfoService,
90
+ UserModelService,
91
+ VariantService,
92
+ VoteMappingService,
93
+ WarehouseService,
94
+ WebhookService,
95
+ WireService,
96
+ WiringlistService,
97
+ WorkflowDetailsService,
98
+ WorkflowNoteService,
99
+ WorkflowService,
100
+ WorkflowSessionItemRecordService,
101
+ WorkflowSessionItemService,
102
+ WorkflowTypeService,
103
+ WorkorderService,
104
+ WorkorderStatusService,
105
+ WorkorderTemplateService
106
+ } from "../chunk-DNVJS7WW.js";
107
+ import "../chunk-FXXZNC42.js";
108
+ export {
109
+ AclService,
110
+ AiPromptService,
111
+ AiService,
112
+ ApiMethodLogService,
113
+ ApiMethodService,
114
+ BomService,
115
+ BreakService,
116
+ BreakTypeService,
117
+ CatalogService,
118
+ CategoryService,
119
+ CertificateMappingService,
120
+ CertificateService,
121
+ ChapterService,
122
+ CommentService,
123
+ ConfigurationService,
124
+ ConnectionService,
125
+ ConnectorFunctionService,
126
+ ConnectorService,
127
+ ContainerService,
128
+ ContentPackageService,
129
+ ContentPackageSessionService,
130
+ ContentPackageViewService,
131
+ CustomFieldService,
132
+ DeviceFamilyService,
133
+ DeviceService,
134
+ DigestEmailService,
135
+ DocumentService,
136
+ EventService,
137
+ FieldService,
138
+ FileParserJobService,
139
+ FileParserService,
140
+ FileParserStrategyJobService,
141
+ FolderService,
142
+ FormDataCommentService,
143
+ FormDataService,
144
+ FormService,
145
+ ForumService,
146
+ GatewayService,
147
+ GroupService,
148
+ IntegrationBuilderService,
149
+ InventoryTransactionService,
150
+ LastSeenResourceService,
151
+ ListItemService,
152
+ ListService,
153
+ LocationService,
154
+ MenusService,
155
+ NodeService,
156
+ NpsService,
157
+ OpcUaServerService,
158
+ OperationService,
159
+ PagesService,
160
+ PartAssemblyDocumentService,
161
+ PartAssemblyService,
162
+ PartService,
163
+ PostService,
164
+ PrintPresetService,
165
+ PriorityLabelService,
166
+ PriorityService,
167
+ ProductionEntityEventService,
168
+ ProductionEntityMappingService,
169
+ ProductionEntityService,
170
+ ProductionEntityTransactionService,
171
+ ProductionEntityTypeService,
172
+ ProjectService,
173
+ PythonResultService,
174
+ ResourceMappingService,
175
+ ResourceService,
176
+ RevisionService,
177
+ RoleMappingService,
178
+ RoleService,
179
+ RuleService,
180
+ ScromSessionService,
181
+ SettingService,
182
+ ShiftService,
183
+ ShiftTypeService,
184
+ StationService,
185
+ StockService,
186
+ SyncClientsService,
187
+ SyncHistoryService,
188
+ SyncService,
189
+ TableService,
190
+ TableSetupService,
191
+ TimeLogReportService,
192
+ TimelineService,
193
+ ToolService,
194
+ TranslationService,
195
+ UnitService,
196
+ UpdateInfoService,
197
+ UserModelService,
198
+ VariantService,
199
+ VoteMappingService,
200
+ WarehouseService,
201
+ WebhookService,
202
+ WireService,
203
+ WiringlistService,
204
+ WorkflowDetailsService,
205
+ WorkflowNoteService,
206
+ WorkflowService,
207
+ WorkflowSessionItemRecordService,
208
+ WorkflowSessionItemService,
209
+ WorkflowTypeService,
210
+ WorkorderService,
211
+ WorkorderStatusService,
212
+ WorkorderTemplateService
213
+ };
@@ -0,0 +1,258 @@
1
+ type AuthToken = string | undefined;
2
+ interface Auth {
3
+ /**
4
+ * Which part of the request do we use to send the auth?
5
+ *
6
+ * @default 'header'
7
+ */
8
+ in?: 'header' | 'query' | 'cookie';
9
+ /**
10
+ * Header or query parameter name.
11
+ *
12
+ * @default 'Authorization'
13
+ */
14
+ name?: string;
15
+ scheme?: 'basic' | 'bearer';
16
+ type: 'apiKey' | 'http';
17
+ }
18
+
19
+ interface SerializerOptions<T> {
20
+ /**
21
+ * @default true
22
+ */
23
+ explode: boolean;
24
+ style: T;
25
+ }
26
+ type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
27
+ type ObjectStyle = 'form' | 'deepObject';
28
+
29
+ type QuerySerializer = (query: Record<string, unknown>) => string;
30
+ type BodySerializer = (body: any) => any;
31
+ interface QuerySerializerOptions {
32
+ allowReserved?: boolean;
33
+ array?: SerializerOptions<ArrayStyle>;
34
+ object?: SerializerOptions<ObjectStyle>;
35
+ }
36
+ declare const formDataBodySerializer: {
37
+ bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(body: T) => FormData;
38
+ };
39
+ declare const jsonBodySerializer: {
40
+ bodySerializer: <T>(body: T) => string;
41
+ };
42
+ declare const urlSearchParamsBodySerializer: {
43
+ bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(body: T) => string;
44
+ };
45
+
46
+ interface Client$1<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never> {
47
+ /**
48
+ * Returns the final request URL.
49
+ */
50
+ buildUrl: BuildUrlFn;
51
+ connect: MethodFn;
52
+ delete: MethodFn;
53
+ get: MethodFn;
54
+ getConfig: () => Config;
55
+ head: MethodFn;
56
+ options: MethodFn;
57
+ patch: MethodFn;
58
+ post: MethodFn;
59
+ put: MethodFn;
60
+ request: RequestFn;
61
+ setConfig: (config: Config) => Config;
62
+ trace: MethodFn;
63
+ }
64
+ interface Config$1 {
65
+ /**
66
+ * Auth token or a function returning auth token. The resolved value will be
67
+ * added to the request payload as defined by its `security` array.
68
+ */
69
+ auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
70
+ /**
71
+ * A function for serializing request body parameter. By default,
72
+ * {@link JSON.stringify()} will be used.
73
+ */
74
+ bodySerializer?: BodySerializer | null;
75
+ /**
76
+ * An object containing any HTTP headers that you want to pre-populate your
77
+ * `Headers` object with.
78
+ *
79
+ * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
80
+ */
81
+ headers?: RequestInit['headers'] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
82
+ /**
83
+ * The request method.
84
+ *
85
+ * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
86
+ */
87
+ method?: 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE';
88
+ /**
89
+ * A function for serializing request query parameters. By default, arrays
90
+ * will be exploded in form style, objects will be exploded in deepObject
91
+ * style, and reserved characters are percent-encoded.
92
+ *
93
+ * This method will have no effect if the native `paramsSerializer()` Axios
94
+ * API function is used.
95
+ *
96
+ * {@link https://swagger.io/docs/specification/serialization/#query View examples}
97
+ */
98
+ querySerializer?: QuerySerializer | QuerySerializerOptions;
99
+ /**
100
+ * A function validating request data. This is useful if you want to ensure
101
+ * the request conforms to the desired shape, so it can be safely sent to
102
+ * the server.
103
+ */
104
+ requestValidator?: (data: unknown) => Promise<unknown>;
105
+ /**
106
+ * A function transforming response data before it's returned. This is useful
107
+ * for post-processing data, e.g. converting ISO strings into Date objects.
108
+ */
109
+ responseTransformer?: (data: unknown) => Promise<unknown>;
110
+ /**
111
+ * A function validating response data. This is useful if you want to ensure
112
+ * the response conforms to the desired shape, so it can be safely passed to
113
+ * the transformers and returned to the user.
114
+ */
115
+ responseValidator?: (data: unknown) => Promise<unknown>;
116
+ }
117
+
118
+ declare const mergeHeaders: (...headers: Array<Required<Config>["headers"] | undefined>) => Headers;
119
+ type ErrInterceptor<Err, Res, Req, Options> = (error: Err, response: Res, request: Req, options: Options) => Err | Promise<Err>;
120
+ type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
121
+ type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>;
122
+ declare class Interceptors<Interceptor> {
123
+ _fns: (Interceptor | null)[];
124
+ constructor();
125
+ clear(): void;
126
+ getInterceptorIndex(id: number | Interceptor): number;
127
+ exists(id: number | Interceptor): boolean;
128
+ eject(id: number | Interceptor): void;
129
+ update(id: number | Interceptor, fn: Interceptor): number | false | Interceptor;
130
+ use(fn: Interceptor): number;
131
+ }
132
+ interface Middleware<Req, Res, Err, Options> {
133
+ error: Pick<Interceptors<ErrInterceptor<Err, Res, Req, Options>>, 'eject' | 'use'>;
134
+ request: Pick<Interceptors<ReqInterceptor<Req, Options>>, 'eject' | 'use'>;
135
+ response: Pick<Interceptors<ResInterceptor<Res, Req, Options>>, 'eject' | 'use'>;
136
+ }
137
+ declare const createConfig: <T extends ClientOptions = ClientOptions>(override?: Config<Omit<ClientOptions, keyof T> & T>) => Config<Omit<ClientOptions, keyof T> & T>;
138
+
139
+ type ResponseStyle = 'data' | 'fields';
140
+ interface Config<T extends ClientOptions = ClientOptions> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, Config$1 {
141
+ /**
142
+ * Base URL for all requests made by this client.
143
+ */
144
+ baseUrl?: T['baseUrl'];
145
+ /**
146
+ * Fetch API implementation. You can use this option to provide a custom
147
+ * fetch instance.
148
+ *
149
+ * @default globalThis.fetch
150
+ */
151
+ fetch?: (request: Request) => ReturnType<typeof fetch>;
152
+ /**
153
+ * Please don't use the Fetch client for Next.js applications. The `next`
154
+ * options won't have any effect.
155
+ *
156
+ * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
157
+ */
158
+ next?: never;
159
+ /**
160
+ * Return the response data parsed in a specified format. By default, `auto`
161
+ * will infer the appropriate method from the `Content-Type` response header.
162
+ * You can override this behavior with any of the {@link Body} methods.
163
+ * Select `stream` if you don't want to parse response data at all.
164
+ *
165
+ * @default 'auto'
166
+ */
167
+ parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
168
+ /**
169
+ * Should we return only data or multiple fields (data, error, response, etc.)?
170
+ *
171
+ * @default 'fields'
172
+ */
173
+ responseStyle?: ResponseStyle;
174
+ /**
175
+ * Throw an error instead of returning it in the response?
176
+ *
177
+ * @default false
178
+ */
179
+ throwOnError?: T['throwOnError'];
180
+ }
181
+ interface RequestOptions<TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
182
+ responseStyle: TResponseStyle;
183
+ throwOnError: ThrowOnError;
184
+ }> {
185
+ /**
186
+ * Any body that you want to add to your request.
187
+ *
188
+ * {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
189
+ */
190
+ body?: unknown;
191
+ path?: Record<string, unknown>;
192
+ query?: Record<string, unknown>;
193
+ /**
194
+ * Security mechanism(s) to use for the request.
195
+ */
196
+ security?: ReadonlyArray<Auth>;
197
+ url: Url;
198
+ }
199
+ interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<TResponseStyle, ThrowOnError, Url> {
200
+ serializedBody?: string;
201
+ }
202
+ type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = 'fields'> = ThrowOnError extends true ? Promise<TResponseStyle extends 'data' ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
203
+ data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
204
+ request: Request;
205
+ response: Response;
206
+ }> : Promise<TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
207
+ data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
208
+ error: undefined;
209
+ } | {
210
+ data: undefined;
211
+ error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
212
+ }) & {
213
+ request: Request;
214
+ response: Response;
215
+ }>;
216
+ interface ClientOptions {
217
+ baseUrl?: string;
218
+ responseStyle?: ResponseStyle;
219
+ throwOnError?: boolean;
220
+ }
221
+ type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TResponseStyle, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
222
+ type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TResponseStyle, ThrowOnError>, 'method'> & Pick<Required<RequestOptions<TResponseStyle, ThrowOnError>>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
223
+ type BuildUrlFn = <TData extends {
224
+ body?: unknown;
225
+ path?: Record<string, unknown>;
226
+ query?: Record<string, unknown>;
227
+ url: string;
228
+ }>(options: Pick<TData, 'url'> & Options<TData>) => string;
229
+ type Client = Client$1<RequestFn, Config, MethodFn, BuildUrlFn> & {
230
+ interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
231
+ };
232
+ /**
233
+ * The `createClientConfig()` function will be called on client initialization
234
+ * and the returned object will become the client's initial configuration.
235
+ *
236
+ * You may want to initialize your client this way instead of calling
237
+ * `setConfig()`. This is useful for example if you're using Next.js
238
+ * to ensure your client always has the correct values.
239
+ */
240
+ type CreateClientConfig<T extends ClientOptions = ClientOptions> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
241
+ interface TDataShape {
242
+ body?: unknown;
243
+ headers?: unknown;
244
+ path?: unknown;
245
+ query?: unknown;
246
+ url: string;
247
+ }
248
+ type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
249
+ type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = 'fields'> = OmitKeys<RequestOptions<TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & Omit<TData, 'url'>;
250
+ type OptionsLegacyParser<TData = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = 'fields'> = TData extends {
251
+ body?: any;
252
+ } ? TData extends {
253
+ headers?: any;
254
+ } ? OmitKeys<RequestOptions<TResponseStyle, ThrowOnError>, 'body' | 'headers' | 'url'> & TData : OmitKeys<RequestOptions<TResponseStyle, ThrowOnError>, 'body' | 'url'> & TData & Pick<RequestOptions<TResponseStyle, ThrowOnError>, 'headers'> : TData extends {
255
+ headers?: any;
256
+ } ? OmitKeys<RequestOptions<TResponseStyle, ThrowOnError>, 'headers' | 'url'> & TData & Pick<RequestOptions<TResponseStyle, ThrowOnError>, 'body'> : OmitKeys<RequestOptions<TResponseStyle, ThrowOnError>, 'url'> & TData;
257
+
258
+ export { type Auth as A, type Client as C, type Options as O, type QuerySerializerOptions as Q, type RequestResult as R, type TDataShape as T, type Config as a, type ClientOptions as b, type CreateClientConfig as c, type OptionsLegacyParser as d, type RequestOptions as e, formDataBodySerializer as f, type ResolvedRequestOptions as g, type ResponseStyle as h, createConfig as i, jsonBodySerializer as j, mergeHeaders as m, urlSearchParamsBodySerializer as u };
@@ -0,0 +1,36 @@
1
+ import { defineConfig } from '@hey-api/openapi-ts';
2
+
3
+ export default defineConfig({
4
+ input: 'http://127.0.0.1:3000/explorer/swagger.json',
5
+ output: {
6
+ format: 'prettier',
7
+ lint: 'eslint',
8
+ path: './src/sdk',
9
+ },
10
+ plugins: [
11
+ '@hey-api/schemas',
12
+ {
13
+ dates: true,
14
+ name: '@hey-api/transformers',
15
+ },
16
+ {
17
+ enums: 'javascript',
18
+ name: '@hey-api/typescript',
19
+ },
20
+ {
21
+ name: '@hey-api/sdk',
22
+ asClass: true,
23
+ transformer: true,
24
+ classNameBuilder(name) {
25
+ return `${name}Service`;
26
+ },
27
+ methodNameBuilder(operation) {
28
+ return String(operation.id);
29
+ },
30
+ },
31
+ {
32
+ enums: 'javascript',
33
+ name: '@hey-api/typescript',
34
+ },
35
+ ],
36
+ });
package/package.json CHANGED
@@ -1,84 +1,42 @@
1
1
  {
2
2
  "name": "@nextplus/js-sdk",
3
- "version": "0.0.1",
4
- "main": "dist/index.js",
3
+ "version": "0.0.4",
4
+ "type": "module",
5
5
  "scripts": {
6
- "build": "npm run clean && tsup && tsc -p tsconfig.build.json",
7
- "dev": "tsup --watch",
8
- "clean": "rimraf dist",
9
- "prepublishOnly": "npm run build",
10
- "typecheck": "tsc -p tsconfig.json --noEmit",
11
- "test": "node ./test/login-and-find-tables.test.js",
12
- "smoke": "node ./test/login-and-find-tables.test.js",
13
- "generate": "npx openapi -i http://localhost:3000/explorer/swagger.json -o ./src -c fetch"
14
- },
15
- "keywords": [],
16
- "author": "",
17
- "license": "MIT",
18
- "description": "",
19
- "sideEffects": false,
20
- "devDependencies": {
21
- "openapi": "^1.0.1",
22
- "openapi-typescript-codegen": "^0.29.0",
23
- "tsup": "^8.0.2",
24
- "typescript": "^5.4.0",
25
- "rimraf": "^6.0.1"
26
- },
27
- "tsup": {
28
- "entry": [
29
- "src/index.ts"
30
- ],
31
- "format": [
32
- "esm",
33
- "cjs"
34
- ],
35
- "dts": true,
36
- "sourcemap": true,
37
- "clean": true,
38
- "outDir": "dist",
39
- "target": "es2018",
40
- "minify": false
41
- },
42
- "types": "dist/index.d.ts",
43
- "typesVersions": {
44
- "*": {
45
- "core/*": [
46
- "dist/core/*"
47
- ],
48
- "models/*": [
49
- "dist/models/*"
50
- ],
51
- "services/*": [
52
- "dist/services/*"
53
- ],
54
- "index": [
55
- "dist/index.d.ts"
56
- ]
57
- }
6
+ "generate": "npm run clean && npm run openapi-ts && npm run build",
7
+ "build": "tsup src/index.ts src/sdk/client/index.ts src/sdk/sdk.gen.ts src/smoke.ts --dts --format esm --outDir dist --clean",
8
+ "clean": "rm -rf dist",
9
+ "prepublishOnly": "npm run clean && tsup src/index.ts src/sdk/client/index.ts src/sdk/sdk.gen.ts --dts --format esm --outDir dist --clean",
10
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
11
+ "openapi-ts": "openapi-ts",
12
+ "test": "npm run build && node dist/smoke.js"
58
13
  },
59
14
  "exports": {
60
15
  ".": {
61
- "types": "./dist/index.d.ts",
62
- "import": "./dist/index.mjs",
63
- "require": "./dist/index.js"
64
- },
65
- "./core/*": {
66
- "types": "./dist/core/*",
67
- "default": "./dist/index.js"
68
- },
69
- "./models/*": {
70
- "types": "./dist/models/*",
71
- "default": "./dist/index.js"
72
- },
73
- "./services/*": {
74
- "types": "./dist/services/*",
75
- "default": "./dist/index.js"
16
+ "import": "./dist/index.js",
17
+ "types": "./dist/index.d.ts"
76
18
  }
77
19
  },
78
- "publishConfig": {
79
- "access": "public",
80
- "files": [
81
- "dist"
82
- ]
20
+ "main": "dist/index.js",
21
+ "types": "dist/index.d.ts",
22
+ "keywords": [
23
+ "nextplus",
24
+ "sdk",
25
+ "api",
26
+ "typescript",
27
+ "javascript"
28
+ ],
29
+ "devDependencies": {
30
+ "@hey-api/openapi-ts": "^0.80.9",
31
+ "@types/debug": "^4.1.12",
32
+ "@typescript-eslint/eslint-plugin": "^8.39.0",
33
+ "@typescript-eslint/parser": "^8.39.0",
34
+ "eslint": "^9.32.0",
35
+ "prettier": "^3.6.2",
36
+ "tsup": "^8.5.0",
37
+ "typescript": "^5.9.2"
38
+ },
39
+ "dependencies": {
40
+ "debug": "^4.4.1"
83
41
  }
84
42
  }
@@ -0,0 +1,5 @@
1
+ /** @type {import("prettier").Config} */
2
+ export default {
3
+ semi: true,
4
+ singleQuote: true,
5
+ };