@noya-app/noya-api-client-react 0.1.52 → 0.1.54

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.
package/dist/index.mjs CHANGED
@@ -5476,49 +5476,67 @@ var gistSchema = Type.Object({
5476
5476
 
5477
5477
  // ../noya-schemas/src/jsonSchema.ts
5478
5478
  var jsonSchema = Type.Recursive(
5479
- (This) => Type.Union(
5480
- [
5481
- Type.Object({
5482
- type: Type.Literal("string"),
5483
- default: Type.Optional(Type.String()),
5484
- _kind: Type.Literal("String")
5485
- }),
5486
- Type.Object({
5487
- type: Type.Literal("number"),
5488
- default: Type.Optional(Type.Number()),
5489
- minimum: Type.Optional(Type.Number()),
5490
- maximum: Type.Optional(Type.Number()),
5491
- _kind: Type.Literal("Number")
5492
- }),
5493
- Type.Object({
5494
- type: Type.Literal("boolean"),
5495
- default: Type.Optional(Type.Boolean()),
5496
- _kind: Type.Literal("Boolean")
5497
- }),
5498
- Type.Object({
5499
- type: Type.Literal("null"),
5500
- _kind: Type.Literal("Null")
5501
- }),
5502
- Type.Object({
5503
- type: Type.Literal("array"),
5504
- items: This,
5505
- // default: Type.Optional(Type.Array(Type.Any())),
5506
- // minItems: Type.Optional(Type.Number()),
5507
- // maxItems: Type.Optional(Type.Number()),
5508
- _kind: Type.Literal("Array")
5509
- }),
5510
- Type.Object({
5511
- type: Type.Literal("object"),
5512
- properties: Type.Record(Type.String(), This),
5513
- required: Type.Optional(Type.Array(Type.String())),
5514
- // default: Type.Optional(Type.Record(Type.String(), Type.Any())),
5515
- _kind: Type.Literal("Object")
5516
- })
5517
- ],
5518
- {
5519
- discriminator: "type"
5520
- }
5521
- ),
5479
+ (This) => Type.Union([
5480
+ Type.Object({
5481
+ type: Type.Literal("string"),
5482
+ default: Type.Optional(Type.String()),
5483
+ _kind: Type.Literal("String")
5484
+ }),
5485
+ Type.Object({
5486
+ type: Type.Literal("number"),
5487
+ default: Type.Optional(Type.Number()),
5488
+ minimum: Type.Optional(Type.Number()),
5489
+ maximum: Type.Optional(Type.Number()),
5490
+ _kind: Type.Literal("Number")
5491
+ }),
5492
+ Type.Object({
5493
+ type: Type.Literal("boolean"),
5494
+ default: Type.Optional(Type.Boolean()),
5495
+ _kind: Type.Literal("Boolean")
5496
+ }),
5497
+ Type.Object({
5498
+ type: Type.Literal("null"),
5499
+ _kind: Type.Literal("Null")
5500
+ }),
5501
+ Type.Object({
5502
+ type: Type.Literal("array"),
5503
+ items: This,
5504
+ // default: Type.Optional(Type.Array(Type.Any())),
5505
+ // minItems: Type.Optional(Type.Number()),
5506
+ // maxItems: Type.Optional(Type.Number()),
5507
+ _kind: Type.Literal("Array")
5508
+ }),
5509
+ Type.Object({
5510
+ type: Type.Literal("object"),
5511
+ properties: Type.Record(Type.String(), This),
5512
+ required: Type.Optional(Type.Array(Type.String())),
5513
+ // default: Type.Optional(Type.Record(Type.String(), Type.Any())),
5514
+ _kind: Type.Literal("Object")
5515
+ }),
5516
+ Type.Object({
5517
+ const: Type.Union([
5518
+ Type.String(),
5519
+ Type.Number(),
5520
+ Type.Boolean(),
5521
+ Type.Null()
5522
+ ]),
5523
+ type: Type.Optional(
5524
+ Type.Union([
5525
+ Type.Literal("string"),
5526
+ Type.Literal("number"),
5527
+ Type.Literal("boolean"),
5528
+ Type.Literal("null")
5529
+ ])
5530
+ ),
5531
+ _kind: Type.Literal("Literal")
5532
+ }),
5533
+ Type.Object({
5534
+ anyOf: Type.Array(This, { minItems: 1 }),
5535
+ discriminator: Type.Optional(Type.String()),
5536
+ default: Type.Optional(Type.Any()),
5537
+ _kind: Type.Literal("Union")
5538
+ })
5539
+ ]),
5522
5540
  {
5523
5541
  $id: "jsonSchema"
5524
5542
  }
@@ -5600,6 +5618,13 @@ var SchemaTree = (0, import_tree_visit.defineTree)((schema) => {
5600
5618
  });
5601
5619
 
5602
5620
  // ../noya-schemas/src/resourceSchema.ts
5621
+ var targetFileSchema = Type.Object({
5622
+ id: Type.String(),
5623
+ toolId: Type.String(),
5624
+ tool: Type.Object({
5625
+ theme: Type.Optional(Type.Any())
5626
+ })
5627
+ });
5603
5628
  var baseSchemaProperties = {
5604
5629
  id: Type.String(),
5605
5630
  stableId: Type.String(),
@@ -5615,7 +5640,9 @@ var baseSchemaProperties = {
5615
5640
  })
5616
5641
  ),
5617
5642
  accessibleByFileVersionId: Nullable(Type.String()),
5618
- url: Type.Optional(Type.String())
5643
+ file: Type.Optional(Nullable(targetFileSchema)),
5644
+ url: Type.Optional(Type.String()),
5645
+ transformUrl: Type.Optional(Type.String())
5619
5646
  };
5620
5647
  var uploadableAssetSchema = Type.Object({
5621
5648
  content: Type.String(),
@@ -10478,12 +10505,19 @@ var createHash = (value, options) => hash(value, { ...options, ignoreUndefinedPr
10478
10505
  // ../state-manager/src/GitManager.ts
10479
10506
  import { Observable as Observable9 } from "@noya-app/observable";
10480
10507
 
10481
- // ../state-manager/src/ImagePickerManager.ts
10508
+ // ../state-manager/src/ResourceManager.ts
10509
+ import { isDeepEqual as isDeepEqual4, uuid as uuid6 } from "@noya-app/noya-utils";
10482
10510
  import { Observable as Observable10 } from "@noya-app/observable";
10483
- import { uuid as uuid6 } from "@noya-app/noya-utils";
10484
10511
 
10485
- // ../state-manager/src/IOManager.ts
10512
+ // ../state-manager/src/HostStorageManager.ts
10513
+ import { uuid as uuid7 } from "@noya-app/noya-utils";
10514
+
10515
+ // ../state-manager/src/ImagePickerManager.ts
10486
10516
  import { Observable as Observable11 } from "@noya-app/observable";
10517
+ import { uuid as uuid8 } from "@noya-app/noya-utils";
10518
+
10519
+ // ../state-manager/src/IOManager.ts
10520
+ import { Observable as Observable12 } from "@noya-app/observable";
10487
10521
 
10488
10522
  // ../state-manager/src/jwt.ts
10489
10523
  function base64UrlEncode(str) {
@@ -10585,18 +10619,18 @@ var jwt;
10585
10619
  })(jwt || (jwt = {}));
10586
10620
 
10587
10621
  // ../state-manager/src/MenuManager.ts
10588
- import { isDeepEqual as isDeepEqual4 } from "@noya-app/noya-utils";
10589
- import { Observable as Observable12 } from "@noya-app/observable";
10622
+ import { isDeepEqual as isDeepEqual5 } from "@noya-app/noya-utils";
10623
+ import { Observable as Observable13 } from "@noya-app/observable";
10590
10624
 
10591
10625
  // ../state-manager/src/NoyaManager.ts
10592
- import { uuid as uuid14 } from "@noya-app/noya-utils";
10626
+ import { uuid as uuid15 } from "@noya-app/noya-utils";
10593
10627
  import { Observable as Observable23 } from "@noya-app/observable";
10594
10628
 
10595
10629
  // ../noya-pipeline/src/graphToTasks.ts
10596
10630
  import { get as get4 } from "@noya-app/observable";
10597
10631
 
10598
10632
  // ../noya-pipeline/src/state.ts
10599
- import { uuid as uuid7 } from "@noya-app/noya-utils";
10633
+ import { uuid as uuid9 } from "@noya-app/noya-utils";
10600
10634
  var rectSchema = Type.Object({
10601
10635
  x: Type.Number(),
10602
10636
  y: Type.Number(),
@@ -10695,20 +10729,16 @@ var pipelineSchema = Type.Object(
10695
10729
  );
10696
10730
 
10697
10731
  // ../state-manager/src/PipelineManager.ts
10698
- import { Observable as Observable13 } from "@noya-app/observable";
10699
-
10700
- // ../state-manager/src/PublishingManager.ts
10701
10732
  import { Observable as Observable14 } from "@noya-app/observable";
10702
10733
 
10703
- // ../state-manager/src/ResourceManager.ts
10704
- import { isDeepEqual as isDeepEqual5, uuid as uuid8 } from "@noya-app/noya-utils";
10734
+ // ../state-manager/src/PublishingManager.ts
10705
10735
  import { Observable as Observable15 } from "@noya-app/observable";
10706
10736
 
10707
10737
  // ../state-manager/src/SandboxManager.ts
10708
10738
  import { Observable as Observable16 } from "@noya-app/observable";
10709
10739
 
10710
10740
  // ../state-manager/src/rpcManager.ts
10711
- import { uuid as uuid9 } from "@noya-app/noya-utils";
10741
+ import { uuid as uuid10 } from "@noya-app/noya-utils";
10712
10742
  import { Observable as Observable17 } from "@noya-app/observable";
10713
10743
 
10714
10744
  // ../state-manager/src/SecretManager.ts
@@ -10725,7 +10755,7 @@ import { Observable as Observable20 } from "@noya-app/observable";
10725
10755
  import { Observable as Observable22 } from "@noya-app/observable";
10726
10756
 
10727
10757
  // ../state-manager/src/sync/clientId.ts
10728
- import { uuid as uuid10 } from "@noya-app/noya-utils";
10758
+ import { uuid as uuid11 } from "@noya-app/noya-utils";
10729
10759
  import { Observable as Observable21 } from "@noya-app/observable";
10730
10760
 
10731
10761
  // ../state-manager/src/sync/defaultNames.ts
@@ -10822,7 +10852,7 @@ if (typeof window !== "undefined") {
10822
10852
  if (storedClientId) {
10823
10853
  clientId$.set(storedClientId);
10824
10854
  } else {
10825
- const newClientId = uuid10();
10855
+ const newClientId = uuid11();
10826
10856
  safeSetItem(CLIENT_ID_STORAGE_KEY, newClientId);
10827
10857
  clientId$.set(newClientId);
10828
10858
  }
@@ -10845,13 +10875,13 @@ if (typeof window !== "undefined") {
10845
10875
  }
10846
10876
 
10847
10877
  // ../state-manager/src/sync/syncUtils.ts
10848
- import { uuid as uuid11 } from "@noya-app/noya-utils";
10878
+ import { uuid as uuid12 } from "@noya-app/noya-utils";
10849
10879
 
10850
10880
  // ../state-manager/src/sync/localRpcHelpers.ts
10851
- import { Base64 as Base644, uuid as uuid12 } from "@noya-app/noya-utils";
10881
+ import { Base64 as Base644, uuid as uuid13 } from "@noya-app/noya-utils";
10852
10882
 
10853
10883
  // ../state-manager/src/sync/localStorageSync.ts
10854
- import { uuid as uuid13 } from "@noya-app/noya-utils";
10884
+ import { uuid as uuid14 } from "@noya-app/noya-utils";
10855
10885
 
10856
10886
  // ../noya-keymap/src/hooks.ts
10857
10887
  import { useEffect as useEffect2, useRef as useRef2 } from "react";
@@ -11378,7 +11408,7 @@ import React35 from "react";
11378
11408
  import { createRoot } from "react-dom/client";
11379
11409
 
11380
11410
  // ../noya-multiplayer-react/src/inspector/StateInspector.tsx
11381
- import { Base64 as Base645, memoize, uuid as uuid15 } from "@noya-app/noya-utils";
11411
+ import { Base64 as Base645, memoize, uuid as uuid16 } from "@noya-app/noya-utils";
11382
11412
  import React34, {
11383
11413
  useCallback as useCallback12,
11384
11414
  useEffect as useEffect14,
@@ -14908,7 +14938,7 @@ var StateInspector = memoGeneric(function StateInspector2({
14908
14938
  {
14909
14939
  theme: theme3,
14910
14940
  onClick: async () => {
14911
- const path2 = prompt("Enter directory path") || uuid15();
14941
+ const path2 = prompt("Enter directory path") || uuid16();
14912
14942
  await resourceManager.createResource({
14913
14943
  type: "directory",
14914
14944
  path: path2
@@ -14924,7 +14954,7 @@ var StateInspector = memoGeneric(function StateInspector2({
14924
14954
  const file = await uploadFile();
14925
14955
  resourceManager.createResource({
14926
14956
  type: "asset",
14927
- path: file.name || uuid15(),
14957
+ path: file.name || uuid16(),
14928
14958
  asset: {
14929
14959
  content: Base645.encode(await file.arrayBuffer()),
14930
14960
  contentType: file.type,