@3dverse/api 0.17.0 → 0.19.1

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.
@@ -970,6 +970,8 @@ export type AssetCreatableWithType = {
970
970
  } | {
971
971
  /** Source code from a git repository that could be used in a shader, a script or in an algorithm */
972
972
  asset_description: {
973
+ /** What built its payload, a compiler and its flags: a build stores the module again when this differs */
974
+ builtWith?: string;
973
975
  /** The size in byte of the same built with its debug symbols: the optional `debug` payload, when built */
974
976
  debugPayloadSize?: number;
975
977
  functions: {
@@ -1061,7 +1063,7 @@ export type AssetCreatableWithType = {
1061
1063
  pipelineDescription?: {
1062
1064
  /** Index of the stencil state for back face rendering */
1063
1065
  backFaceStencilOpStateIndex?: number;
1064
- /** Color blend attachement states */
1066
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
1065
1067
  blendStateIndices?: Array<number>;
1066
1068
  /** Cull mode */
1067
1069
  cullMode?: number;
@@ -1096,7 +1098,7 @@ export type AssetCreatableWithType = {
1096
1098
  pipelineDescription?: {
1097
1099
  /** Index of the stencil state for back face rendering */
1098
1100
  backFaceStencilOpStateIndex?: number;
1099
- /** Color blend attachement states */
1101
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
1100
1102
  blendStateIndices?: Array<number>;
1101
1103
  /** Cull mode */
1102
1104
  cullMode?: number;
@@ -1178,7 +1180,7 @@ export type AssetCreatableWithType = {
1178
1180
  pipelineDescription?: {
1179
1181
  /** Index of the stencil state for back face rendering */
1180
1182
  backFaceStencilOpStateIndex?: number;
1181
- /** Color blend attachement states */
1183
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
1182
1184
  blendStateIndices?: Array<number>;
1183
1185
  /** Cull mode */
1184
1186
  cullMode?: number;
@@ -1263,7 +1265,7 @@ export type AssetCreatableWithType = {
1263
1265
  pipelineDescription?: {
1264
1266
  /** Index of the stencil state for back face rendering */
1265
1267
  backFaceStencilOpStateIndex?: number;
1266
- /** Color blend attachement states */
1268
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
1267
1269
  blendStateIndices?: Array<number>;
1268
1270
  /** Cull mode */
1269
1271
  cullMode?: number;
@@ -2041,6 +2043,8 @@ export type AssetCreationFromDescription = ({
2041
2043
  } | {
2042
2044
  /** Source code from a git repository that could be used in a shader, a script or in an algorithm */
2043
2045
  asset_description: {
2046
+ /** What built its payload, a compiler and its flags: a build stores the module again when this differs */
2047
+ builtWith?: string;
2044
2048
  /** The size in byte of the same built with its debug symbols: the optional `debug` payload, when built */
2045
2049
  debugPayloadSize?: number;
2046
2050
  functions: {
@@ -2132,7 +2136,7 @@ export type AssetCreationFromDescription = ({
2132
2136
  pipelineDescription?: {
2133
2137
  /** Index of the stencil state for back face rendering */
2134
2138
  backFaceStencilOpStateIndex?: number;
2135
- /** Color blend attachement states */
2139
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
2136
2140
  blendStateIndices?: Array<number>;
2137
2141
  /** Cull mode */
2138
2142
  cullMode?: number;
@@ -2167,7 +2171,7 @@ export type AssetCreationFromDescription = ({
2167
2171
  pipelineDescription?: {
2168
2172
  /** Index of the stencil state for back face rendering */
2169
2173
  backFaceStencilOpStateIndex?: number;
2170
- /** Color blend attachement states */
2174
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
2171
2175
  blendStateIndices?: Array<number>;
2172
2176
  /** Cull mode */
2173
2177
  cullMode?: number;
@@ -2249,7 +2253,7 @@ export type AssetCreationFromDescription = ({
2249
2253
  pipelineDescription?: {
2250
2254
  /** Index of the stencil state for back face rendering */
2251
2255
  backFaceStencilOpStateIndex?: number;
2252
- /** Color blend attachement states */
2256
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
2253
2257
  blendStateIndices?: Array<number>;
2254
2258
  /** Cull mode */
2255
2259
  cullMode?: number;
@@ -2334,7 +2338,7 @@ export type AssetCreationFromDescription = ({
2334
2338
  pipelineDescription?: {
2335
2339
  /** Index of the stencil state for back face rendering */
2336
2340
  backFaceStencilOpStateIndex?: number;
2337
- /** Color blend attachement states */
2341
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
2338
2342
  blendStateIndices?: Array<number>;
2339
2343
  /** Cull mode */
2340
2344
  cullMode?: number;
@@ -2909,7 +2913,7 @@ export type DuplicationRequest = {
2909
2913
  /** How many times the request was leased */
2910
2914
  attempts: number;
2911
2915
  created_at: string;
2912
- /** How deep the dependencies of the assets duplicated are duplicated with them. */
2916
+ /** How deep the dependencies of the assets duplicated, and the assets the tools use for them, are duplicated with them. */
2913
2917
  depth: 'none' | 'all' | number;
2914
2918
  /** Duplication request unique identifier */
2915
2919
  duplication_request_id: string;
@@ -3676,6 +3680,8 @@ export type AssetDescription = {
3676
3680
  /** Unique identifier for the asset */
3677
3681
  uuid: string;
3678
3682
  } | {
3683
+ /** What built its payload, a compiler and its flags: a build stores the module again when this differs */
3684
+ builtWith?: string;
3679
3685
  /** The size in byte of the same built with its debug symbols: the optional `debug` payload, when built */
3680
3686
  debugPayloadSize?: number;
3681
3687
  functions: {
@@ -3845,7 +3851,7 @@ export type AssetDescription = {
3845
3851
  pipelineDescription?: {
3846
3852
  /** Index of the stencil state for back face rendering */
3847
3853
  backFaceStencilOpStateIndex?: number;
3848
- /** Color blend attachement states */
3854
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
3849
3855
  blendStateIndices?: Array<number>;
3850
3856
  /** Cull mode */
3851
3857
  cullMode?: number;
@@ -3880,7 +3886,7 @@ export type AssetDescription = {
3880
3886
  pipelineDescription?: {
3881
3887
  /** Index of the stencil state for back face rendering */
3882
3888
  backFaceStencilOpStateIndex?: number;
3883
- /** Color blend attachement states */
3889
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
3884
3890
  blendStateIndices?: Array<number>;
3885
3891
  /** Cull mode */
3886
3892
  cullMode?: number;
@@ -3962,7 +3968,7 @@ export type AssetDescription = {
3962
3968
  pipelineDescription?: {
3963
3969
  /** Index of the stencil state for back face rendering */
3964
3970
  backFaceStencilOpStateIndex?: number;
3965
- /** Color blend attachement states */
3971
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
3966
3972
  blendStateIndices?: Array<number>;
3967
3973
  /** Cull mode */
3968
3974
  cullMode?: number;
@@ -4047,7 +4053,7 @@ export type AssetDescription = {
4047
4053
  pipelineDescription?: {
4048
4054
  /** Index of the stencil state for back face rendering */
4049
4055
  backFaceStencilOpStateIndex?: number;
4050
- /** Color blend attachement states */
4056
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
4051
4057
  blendStateIndices?: Array<number>;
4052
4058
  /** Cull mode */
4053
4059
  cullMode?: number;
@@ -4933,6 +4939,8 @@ export type EditableAssetDescription = {
4933
4939
  /** Unique identifier for the asset */
4934
4940
  uuid: string;
4935
4941
  } | {
4942
+ /** What built its payload, a compiler and its flags: a build stores the module again when this differs */
4943
+ builtWith?: string;
4936
4944
  /** The size in byte of the same built with its debug symbols: the optional `debug` payload, when built */
4937
4945
  debugPayloadSize?: number;
4938
4946
  functions: {
@@ -5020,7 +5028,7 @@ export type EditableAssetDescription = {
5020
5028
  pipelineDescription?: {
5021
5029
  /** Index of the stencil state for back face rendering */
5022
5030
  backFaceStencilOpStateIndex?: number;
5023
- /** Color blend attachement states */
5031
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
5024
5032
  blendStateIndices?: Array<number>;
5025
5033
  /** Cull mode */
5026
5034
  cullMode?: number;
@@ -5055,7 +5063,7 @@ export type EditableAssetDescription = {
5055
5063
  pipelineDescription?: {
5056
5064
  /** Index of the stencil state for back face rendering */
5057
5065
  backFaceStencilOpStateIndex?: number;
5058
- /** Color blend attachement states */
5066
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
5059
5067
  blendStateIndices?: Array<number>;
5060
5068
  /** Cull mode */
5061
5069
  cullMode?: number;
@@ -5137,7 +5145,7 @@ export type EditableAssetDescription = {
5137
5145
  pipelineDescription?: {
5138
5146
  /** Index of the stencil state for back face rendering */
5139
5147
  backFaceStencilOpStateIndex?: number;
5140
- /** Color blend attachement states */
5148
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
5141
5149
  blendStateIndices?: Array<number>;
5142
5150
  /** Cull mode */
5143
5151
  cullMode?: number;
@@ -5222,7 +5230,7 @@ export type EditableAssetDescription = {
5222
5230
  pipelineDescription?: {
5223
5231
  /** Index of the stencil state for back face rendering */
5224
5232
  backFaceStencilOpStateIndex?: number;
5225
- /** Color blend attachement states */
5233
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
5226
5234
  blendStateIndices?: Array<number>;
5227
5235
  /** Cull mode */
5228
5236
  cullMode?: number;
@@ -5741,19 +5749,47 @@ export type AssetDocument = {
5741
5749
  };
5742
5750
  };
5743
5751
  export type AssetContainerWithCode = 'animation_graphs' | 'animation_sequences' | 'modules' | 'scripts' | 'shaders';
5744
- /** The code replacing an asset's, as its caller sends it. Left open, to be extended through `allOf`, as the route adds the user: a body taking it alone closes it with `unevaluatedProperties: false`. */
5745
- export type AssetCode = {
5746
- /** The C++ code, built against the asset type's precompiled header, which it needs not include */
5752
+ /** The code replacing an asset's, as its caller sends it: a shader's, or that of an asset built from C++, as the asset's container tells. Left open, to be extended through `allOf`, as the route adds the user: a body taking it alone closes it with `unevaluatedProperties: false`. */
5753
+ export type AssetCode = StrictUnion<{
5754
+ /** The shader's Slang, one file importing modules */
5755
+ code: string;
5756
+ /** Whether to build its debug payload too, for the engine's developers */
5757
+ debug?: boolean;
5758
+ /** The modules it imports: those they import come with them, and it can import nothing else */
5759
+ modules: Array<string>;
5760
+ /** The shader context its push constant holds */
5761
+ shader_context: string;
5762
+ /** The textures its fields default to, which the caller must be able to read: each a `[DefaultTexture]` of the code names must be one of them */
5763
+ textures?: Array<string>;
5764
+ } | {
5765
+ /** The C++, built against the asset type's precompiled header, which it needs not include */
5747
5766
  code: string;
5748
5767
  /** Whether to build its debug library too, with its symbols, for the engine's developers */
5749
5768
  debug?: boolean;
5750
- };
5751
- export type AssetCodeInput = {
5752
- /** The C++ code, built against the asset type's precompiled header, which it needs not include */
5769
+ modules?: never;
5770
+ shader_context?: never;
5771
+ textures?: never;
5772
+ }>;
5773
+ export type AssetCodeInput = StrictUnion<{
5774
+ /** The shader's Slang, one file importing modules */
5775
+ code: string;
5776
+ /** Whether to build its debug payload too, for the engine's developers */
5777
+ debug?: boolean;
5778
+ /** The modules it imports: those they import come with them, and it can import nothing else */
5779
+ modules: Array<string>;
5780
+ /** The shader context its push constant holds */
5781
+ shader_context: string;
5782
+ /** The textures its fields default to, which the caller must be able to read: each a `[DefaultTexture]` of the code names must be one of them */
5783
+ textures?: Array<string>;
5784
+ } | {
5785
+ /** The C++, built against the asset type's precompiled header, which it needs not include */
5753
5786
  code: string;
5754
5787
  /** Whether to build its debug library too, with its symbols, for the engine's developers */
5755
5788
  debug?: boolean;
5756
- };
5789
+ modules?: never;
5790
+ shader_context?: never;
5791
+ textures?: never;
5792
+ }>;
5757
5793
  /** The build of an asset's code, which replaced the asset's. */
5758
5794
  export type AssetCodeBuild = {
5759
5795
  /** Whether the asset's description changed, which a script's code tells */
@@ -7636,6 +7672,8 @@ export type AssetCreationFromDescriptionInput = ({
7636
7672
  } | {
7637
7673
  /** Source code from a git repository that could be used in a shader, a script or in an algorithm */
7638
7674
  asset_description: {
7675
+ /** What built its payload, a compiler and its flags: a build stores the module again when this differs */
7676
+ builtWith?: string;
7639
7677
  /** The size in byte of the same built with its debug symbols: the optional `debug` payload, when built */
7640
7678
  debugPayloadSize?: number;
7641
7679
  functions: {
@@ -7725,7 +7763,7 @@ export type AssetCreationFromDescriptionInput = ({
7725
7763
  pipelineDescription?: {
7726
7764
  /** Index of the stencil state for back face rendering */
7727
7765
  backFaceStencilOpStateIndex?: number;
7728
- /** Color blend attachement states */
7766
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
7729
7767
  blendStateIndices?: Array<number>;
7730
7768
  /** Cull mode */
7731
7769
  cullMode?: number;
@@ -7760,7 +7798,7 @@ export type AssetCreationFromDescriptionInput = ({
7760
7798
  pipelineDescription?: {
7761
7799
  /** Index of the stencil state for back face rendering */
7762
7800
  backFaceStencilOpStateIndex?: number;
7763
- /** Color blend attachement states */
7801
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
7764
7802
  blendStateIndices?: Array<number>;
7765
7803
  /** Cull mode */
7766
7804
  cullMode?: number;
@@ -7842,7 +7880,7 @@ export type AssetCreationFromDescriptionInput = ({
7842
7880
  pipelineDescription?: {
7843
7881
  /** Index of the stencil state for back face rendering */
7844
7882
  backFaceStencilOpStateIndex?: number;
7845
- /** Color blend attachement states */
7883
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
7846
7884
  blendStateIndices?: Array<number>;
7847
7885
  /** Cull mode */
7848
7886
  cullMode?: number;
@@ -7927,7 +7965,7 @@ export type AssetCreationFromDescriptionInput = ({
7927
7965
  pipelineDescription?: {
7928
7966
  /** Index of the stencil state for back face rendering */
7929
7967
  backFaceStencilOpStateIndex?: number;
7930
- /** Color blend attachement states */
7968
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
7931
7969
  blendStateIndices?: Array<number>;
7932
7970
  /** Cull mode */
7933
7971
  cullMode?: number;
@@ -8654,6 +8692,8 @@ export type EditableAssetDescriptionInput = {
8654
8692
  /** The implemented shader */
8655
8693
  shaderRef: string;
8656
8694
  } | {
8695
+ /** What built its payload, a compiler and its flags: a build stores the module again when this differs */
8696
+ builtWith?: string;
8657
8697
  /** The size in byte of the same built with its debug symbols: the optional `debug` payload, when built */
8658
8698
  debugPayloadSize?: number;
8659
8699
  functions: {
@@ -8739,7 +8779,7 @@ export type EditableAssetDescriptionInput = {
8739
8779
  pipelineDescription?: {
8740
8780
  /** Index of the stencil state for back face rendering */
8741
8781
  backFaceStencilOpStateIndex?: number;
8742
- /** Color blend attachement states */
8782
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
8743
8783
  blendStateIndices?: Array<number>;
8744
8784
  /** Cull mode */
8745
8785
  cullMode?: number;
@@ -8774,7 +8814,7 @@ export type EditableAssetDescriptionInput = {
8774
8814
  pipelineDescription?: {
8775
8815
  /** Index of the stencil state for back face rendering */
8776
8816
  backFaceStencilOpStateIndex?: number;
8777
- /** Color blend attachement states */
8817
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
8778
8818
  blendStateIndices?: Array<number>;
8779
8819
  /** Cull mode */
8780
8820
  cullMode?: number;
@@ -8856,7 +8896,7 @@ export type EditableAssetDescriptionInput = {
8856
8896
  pipelineDescription?: {
8857
8897
  /** Index of the stencil state for back face rendering */
8858
8898
  backFaceStencilOpStateIndex?: number;
8859
- /** Color blend attachement states */
8899
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
8860
8900
  blendStateIndices?: Array<number>;
8861
8901
  /** Cull mode */
8862
8902
  cullMode?: number;
@@ -8941,7 +8981,7 @@ export type EditableAssetDescriptionInput = {
8941
8981
  pipelineDescription?: {
8942
8982
  /** Index of the stencil state for back face rendering */
8943
8983
  backFaceStencilOpStateIndex?: number;
8944
- /** Color blend attachement states */
8984
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
8945
8985
  blendStateIndices?: Array<number>;
8946
8986
  /** Cull mode */
8947
8987
  cullMode?: number;
@@ -11018,10 +11058,14 @@ export declare function getAssetCode({ asset_container_with_code, asset_id, }: {
11018
11058
  asset_id: AssetId;
11019
11059
  }, headers?: RawAxiosRequestHeaders | AxiosRequestHeaders): AxiosPromise<string>;
11020
11060
  /**
11021
- * Replaces the C++ code of a script, animation sequence or animation graph, once asset-compiler built it: code which
11022
- * fails to build replaces nothing, and answers its diagnostics. A script's description is read from its code, and the
11023
- * answer tells whether it changed; the caller must be able to read the assets it references. The build takes a few
11024
- * seconds.
11061
+ * Replaces the code of a script, animation sequence, animation graph or shader, once asset-compiler built it: code
11062
+ * which fails to build replaces nothing, and answers its diagnostics. A script, animation sequence or animation graph
11063
+ * is C++. A script's description is read from its code, and the answer tells whether it changed; the caller must be
11064
+ * able to read the assets it references, and takes `code` and `debug` alone. A shader is one file of Slang, imported
11065
+ * modules by name, naming no other file; it requires `modules`, those it imports, which come with those they import,
11066
+ * and `shader_context`, the context its push constant holds, and lists in `textures` those its fields default to
11067
+ * (`[DefaultTexture("<uuid>")]`), all of which the caller must be able to read. Its description is read from its code.
11068
+ * The build takes a few seconds.
11025
11069
  * @throws {InvalidParameter}
11026
11070
  * @throws {MissingAuthorizationHeader}
11027
11071
  * @throws {InvalidApiKey}
@@ -11031,13 +11075,11 @@ export declare function getAssetCode({ asset_container_with_code, asset_id, }: {
11031
11075
  * @throws {InsufficientPermissions}
11032
11076
  * @throws {TooManyRequests}
11033
11077
  */
11034
- export declare function replaceAssetCode({ asset_container_with_code, asset_id, code, debug, }: {
11078
+ export declare function replaceAssetCode({ asset_container_with_code, asset_id, asset_code, }: {
11035
11079
  asset_container_with_code: AssetContainerWithCode;
11036
11080
  asset_id: AssetId;
11037
- /** The C++ code, built against the asset type's precompiled header, which it needs not include */
11038
- code: string;
11039
- /** Whether to build its debug library too, with its symbols, for the engine's developers */
11040
- debug?: boolean;
11081
+ /** The code replacing an asset's, as its caller sends it: a shader's, or that of an asset built from C++, as the asset's container tells. Left open, to be extended through `allOf`, as the route adds the user: a body taking it alone closes it with `unevaluatedProperties: false`. */
11082
+ asset_code: AssetCodeInput;
11041
11083
  }, headers?: RawAxiosRequestHeaders | AxiosRequestHeaders): AxiosPromise<AssetCodeBuild>;
11042
11084
  /**
11043
11085
  * Gets the asset thumbnail from the specified asset.
package/dist/index.js CHANGED
@@ -1279,16 +1279,12 @@ function getAssetCode({
1279
1279
  function replaceAssetCode({
1280
1280
  asset_container_with_code,
1281
1281
  asset_id,
1282
- code,
1283
- debug = false
1282
+ asset_code
1284
1283
  }, headers) {
1285
1284
  return axiosInstance({
1286
1285
  method: "put",
1287
1286
  url: "/assets/" + encodeURIComponent(asset_container_with_code) + "/" + encodeURIComponent(asset_id) + "/code",
1288
- data: {
1289
- code,
1290
- debug
1291
- },
1287
+ data: asset_code,
1292
1288
  headers
1293
1289
  });
1294
1290
  }