arri 0.0.12 → 0.0.15

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.
@@ -2,15 +2,15 @@ import { createRequire, builtinModules } from 'module';
2
2
  import { fileURLToPath, pathToFileURL, URL } from 'url';
3
3
  import require$$0, { dirname } from 'path';
4
4
  import process4 from 'process';
5
- import require$$0$1 from 'os';
5
+ import require$$1 from 'os';
6
6
  import tty from 'tty';
7
7
  import fs$1, { realpathSync, statSync, Stats, writeFileSync } from 'fs';
8
8
  import assert4 from 'assert';
9
9
  import fs from 'fs/promises';
10
10
  import v8 from 'v8';
11
11
  import { format, inspect } from 'util';
12
- import { g as unflattenProcedures, i as isServiceDefinition, p as pascalCase, h as camelCase, a as isProcedureDefinition, d as isJsonSchemaObject, e as isJsonSchemaEnum, c as isJsonSchemaNullType, b as isJsonSchemaScalarType, f as isJsonSchemaArray } from './arri.b0ab6d2f.mjs';
13
12
  import { execSync } from 'child_process';
13
+ import { g as unflattenProcedures, i as isServiceDefinition, p as pascalCase, h as camelCase, a as isProcedureDefinition, d as isJsonSchemaObject, e as isJsonSchemaEnum, c as isJsonSchemaNullType, b as isJsonSchemaScalarType, f as isJsonSchemaArray } from './arri.dab1f9df.mjs';
14
14
 
15
15
  const require$1 = createRequire(import.meta.url);
16
16
  const __filename$1 = fileURLToPath(import.meta.url);
@@ -21403,7 +21403,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
21403
21403
  return min;
21404
21404
  }
21405
21405
  if (process4.platform === "win32") {
21406
- const osRelease = require$$0$1.release().split(".");
21406
+ const osRelease = require$$1.release().split(".");
21407
21407
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
21408
21408
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
21409
21409
  }
@@ -29051,14 +29051,19 @@ const dartClientGenerator = defineClientGeneratorPlugin(
29051
29051
  clientName: options.clientName
29052
29052
  });
29053
29053
  writeFileSync(options.outputFile, result);
29054
- execSync(`dart format ${options.outputFile}`);
29054
+ try {
29055
+ execSync(`dart format ${options.outputFile}`);
29056
+ } catch (err) {
29057
+ console.error("Error formatting dart client", err);
29058
+ }
29055
29059
  },
29056
29060
  options
29057
29061
  };
29058
29062
  }
29059
29063
  );
29060
- const generatedModels = [];
29064
+ let generatedModels = [];
29061
29065
  function createDartClient(appDef, opts = { clientName: "Client" }) {
29066
+ generatedModels = [];
29062
29067
  const { models, procedures } = appDef;
29063
29068
  const serviceParts = [];
29064
29069
  const procedureParts = [];
@@ -29096,9 +29101,9 @@ function createDartClient(appDef, opts = { clientName: "Client" }) {
29096
29101
  generatedModels.push(typeName);
29097
29102
  }
29098
29103
  });
29099
- return `// This code was autogenerated by arri. Do not modify directly.
29104
+ return `// This code was autogenerated by Arri. Do not modify directly.
29105
+ // For additional documentation visit http://github.com/modiimedia/arri
29100
29106
  import "dart:convert";
29101
- import "package:http/http.dart" as http;
29102
29107
  import "package:arri_client/arri_client.dart";
29103
29108
 
29104
29109
  class ${opts.clientName} {
@@ -29117,22 +29122,6 @@ class ${opts.clientName} {
29117
29122
  );
29118
29123
  }`
29119
29124
  ).join("\n ")}
29120
- Future<http.Response> rawRequest(
29121
- ${opts.clientName}Endpoints endpoint, {
29122
- Map<String, String>? query,
29123
- dynamic body,
29124
- Map<String, String>? headers,
29125
- Encoding? encoding,
29126
- }) async {
29127
- return arriRequest(
29128
- "$_baseUrl\${endpoint.path}",
29129
- method: endpoint.method,
29130
- headers: headers ?? _headers,
29131
- body: body,
29132
- query: query,
29133
- encoding: encoding,
29134
- );
29135
- }
29136
29125
  }
29137
29126
  ${serviceParts.map((item) => item.content).join("\n")}
29138
29127
  ${modelParts.join("\n")}
package/package.json CHANGED
@@ -17,13 +17,15 @@
17
17
  "scule": "^1.0.0",
18
18
  "citty": "^0.1.3",
19
19
  "ofetch": "^1.3.3",
20
- "pathe": "^1.1.1",
21
- "globby": "^13.2.2",
22
20
  "c12": "^1.4.2",
23
21
  "chokidar": "^3.5.3",
24
- "listhen": "^1.4.3"
22
+ "consola": "^3.2.3",
23
+ "esbuild": "^0.19.2",
24
+ "globby": "^13.2.2",
25
+ "listhen": "^1.4.3",
26
+ "pathe": "^1.1.1"
25
27
  },
26
- "version": "0.0.12",
28
+ "version": "0.0.15",
27
29
  "repository": {
28
30
  "url": "https://github.com/modiimedia/arri"
29
31
  }