arri 0.0.43 → 0.0.44

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.
@@ -42,7 +42,7 @@ require('h3');
42
42
  require('@sinclair/typebox/errors');
43
43
  require('@sinclair/typebox/value');
44
44
  require('ofetch');
45
- require('../shared/arri.f250629b.cjs');
45
+ require('../shared/arri.bda2f011.cjs');
46
46
  require('child_process');
47
47
  require('listhen');
48
48
 
@@ -40,7 +40,7 @@ import 'h3';
40
40
  import '@sinclair/typebox/errors';
41
41
  import '@sinclair/typebox/value';
42
42
  import 'ofetch';
43
- import '../shared/arri.d767421d.mjs';
43
+ import '../shared/arri.dfab1c78.mjs';
44
44
  import 'child_process';
45
45
  import 'listhen';
46
46
 
package/dist/cli.cjs CHANGED
@@ -29,7 +29,7 @@ const utils$l = require('./shared/arri.0752aa2b.cjs');
29
29
  const index = require('./index.cjs');
30
30
  require('node:stream');
31
31
  const ofetch = require('ofetch');
32
- const dart = require('./shared/arri.f250629b.cjs');
32
+ const dart = require('./shared/arri.bda2f011.cjs');
33
33
  const listhen = require('listhen');
34
34
  require('@sinclair/typebox');
35
35
  require('h3');
package/dist/cli.mjs CHANGED
@@ -27,7 +27,7 @@ import { c as camelCase, r as removeDisallowedChars, k as kebabCase, d as isAppl
27
27
  import { defaultConfig, DEV_DEFINITION_ENDPOINT } from './index.mjs';
28
28
  import 'node:stream';
29
29
  import { ofetch } from 'ofetch';
30
- import { g as dartClientGenerator } from './shared/arri.d767421d.mjs';
30
+ import { g as dartClientGenerator } from './shared/arri.dfab1c78.mjs';
31
31
  import { listenAndWatch } from 'listhen';
32
32
  import '@sinclair/typebox';
33
33
  import 'h3';
package/dist/codegen.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  const require$$0 = require('fs');
4
4
  const prettier = require('prettier');
5
5
  const utils = require('./shared/arri.0752aa2b.cjs');
6
- const dart = require('./shared/arri.f250629b.cjs');
6
+ const dart = require('./shared/arri.bda2f011.cjs');
7
7
  require('child_process');
8
8
 
9
9
  let generatedModels = [];
package/dist/codegen.mjs CHANGED
@@ -2,8 +2,8 @@ import { writeFileSync } from 'fs';
2
2
  import { format } from 'prettier';
3
3
  import { u as unflattenObject, i as isServiceDef, p as pascalCase, a as isProcedureDef, b as unflattenProcedures, c as camelCase } from './shared/arri.ebf86912.mjs';
4
4
  export { d as isApplicationDef, n as normalizeWhitespace, r as removeDisallowedChars, s as setNestedObjectProperty } from './shared/arri.ebf86912.mjs';
5
- import { d as defineClientGeneratorPlugin, i as isJsonSchemaScalarType, a as isJsonSchemaNullType, b as isJsonSchemaObject, c as isJsonSchemaRecord, e as isJsonSchemaEnum, f as isJsonSchemaArray } from './shared/arri.d767421d.mjs';
6
- export { p as classListTransformer, o as classTransformer, h as createDartClient, g as dartClientGenerator, l as dartModelFromJsonSchema, n as dartParsedJsonField, k as dartProcedureFromServiceDefinition, m as dartPropertyTypeFromSchema, j as dartServiceFromServiceDefinition, q as isDartType, r as isDartTypeWithNullables, t as transformers } from './shared/arri.d767421d.mjs';
5
+ import { d as defineClientGeneratorPlugin, i as isJsonSchemaScalarType, a as isJsonSchemaNullType, b as isJsonSchemaObject, c as isJsonSchemaRecord, e as isJsonSchemaEnum, f as isJsonSchemaArray } from './shared/arri.dfab1c78.mjs';
6
+ export { p as classListTransformer, o as classTransformer, h as createDartClient, g as dartClientGenerator, l as dartModelFromJsonSchema, n as dartParsedJsonField, k as dartProcedureFromServiceDefinition, m as dartPropertyTypeFromSchema, j as dartServiceFromServiceDefinition, q as isDartType, r as isDartTypeWithNullables, t as transformers } from './shared/arri.dfab1c78.mjs';
7
7
  import 'child_process';
8
8
 
9
9
  let generatedModels = [];
@@ -353,6 +353,9 @@ function dartModelFromJsonSchema(modelName, schema, opts) {
353
353
  if (typeName === "dynamic") {
354
354
  return `"${field.jsonKey}": ${field.name}`;
355
355
  }
356
+ if (typeName === "List<dynamic>" || typeName === "List<dynamic>?") {
357
+ return `"${field.jsonKey}": ${field.name}`;
358
+ }
356
359
  if (isDartTypeWithNullables(field.type)) {
357
360
  const transformer = transformers[typeName];
358
361
  return transformer.toJsonBody(
@@ -477,11 +480,6 @@ function dartPropertyTypeFromSchema(objectName, propertyName, schema, opts) {
477
480
  if (isJsonSchemaArray(prop)) {
478
481
  const item = prop.items;
479
482
  const type = item.type;
480
- if (typeof type !== "string") {
481
- throw new Error(
482
- "Union types are not supported in arrays at this time"
483
- );
484
- }
485
483
  switch (type) {
486
484
  case "string":
487
485
  finalType = isOptional ? "List<String>?" : "List<String>";
@@ -517,6 +515,9 @@ function dartPropertyTypeFromSchema(objectName, propertyName, schema, opts) {
517
515
  }
518
516
  break;
519
517
  }
518
+ default:
519
+ finalType = isOptional ? "List<dynamic>?" : "List<dynamic>";
520
+ break;
520
521
  }
521
522
  }
522
523
  return [finalType, subTypes.length ? subTypes : void 0];
@@ -525,6 +526,9 @@ function dartParsedJsonField(fieldName, jsonKey, dartType) {
525
526
  if (dartType === "dynamic") {
526
527
  return `${fieldName}: json["${jsonKey}"]`;
527
528
  }
529
+ if (dartType === "List<dynamic>" || dartType === "List<dynamic>?") {
530
+ return `${fieldName}: json["${jsonKey}"]`;
531
+ }
528
532
  if (isDartTypeWithNullables(dartType)) {
529
533
  switch (dartType) {
530
534
  case "String":
@@ -351,6 +351,9 @@ function dartModelFromJsonSchema(modelName, schema, opts) {
351
351
  if (typeName === "dynamic") {
352
352
  return `"${field.jsonKey}": ${field.name}`;
353
353
  }
354
+ if (typeName === "List<dynamic>" || typeName === "List<dynamic>?") {
355
+ return `"${field.jsonKey}": ${field.name}`;
356
+ }
354
357
  if (isDartTypeWithNullables(field.type)) {
355
358
  const transformer = transformers[typeName];
356
359
  return transformer.toJsonBody(
@@ -475,11 +478,6 @@ function dartPropertyTypeFromSchema(objectName, propertyName, schema, opts) {
475
478
  if (isJsonSchemaArray(prop)) {
476
479
  const item = prop.items;
477
480
  const type = item.type;
478
- if (typeof type !== "string") {
479
- throw new Error(
480
- "Union types are not supported in arrays at this time"
481
- );
482
- }
483
481
  switch (type) {
484
482
  case "string":
485
483
  finalType = isOptional ? "List<String>?" : "List<String>";
@@ -515,6 +513,9 @@ function dartPropertyTypeFromSchema(objectName, propertyName, schema, opts) {
515
513
  }
516
514
  break;
517
515
  }
516
+ default:
517
+ finalType = isOptional ? "List<dynamic>?" : "List<dynamic>";
518
+ break;
518
519
  }
519
520
  }
520
521
  return [finalType, subTypes.length ? subTypes : void 0];
@@ -523,6 +524,9 @@ function dartParsedJsonField(fieldName, jsonKey, dartType) {
523
524
  if (dartType === "dynamic") {
524
525
  return `${fieldName}: json["${jsonKey}"]`;
525
526
  }
527
+ if (dartType === "List<dynamic>" || dartType === "List<dynamic>?") {
528
+ return `${fieldName}: json["${jsonKey}"]`;
529
+ }
526
530
  if (isDartTypeWithNullables(dartType)) {
527
531
  switch (dartType) {
528
532
  case "String":
package/package.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "chokidar": "^3.5.3",
26
26
  "listhen": "^1.5.0"
27
27
  },
28
- "version": "0.0.43",
28
+ "version": "0.0.44",
29
29
  "repository": {
30
30
  "url": "https://github.com/modiimedia/arri"
31
31
  }