@3dverse/api 0.18.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.
@@ -1063,7 +1063,7 @@ export type AssetCreatableWithType = {
1063
1063
  pipelineDescription?: {
1064
1064
  /** Index of the stencil state for back face rendering */
1065
1065
  backFaceStencilOpStateIndex?: number;
1066
- /** Color blend attachement states */
1066
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
1067
1067
  blendStateIndices?: Array<number>;
1068
1068
  /** Cull mode */
1069
1069
  cullMode?: number;
@@ -1098,7 +1098,7 @@ export type AssetCreatableWithType = {
1098
1098
  pipelineDescription?: {
1099
1099
  /** Index of the stencil state for back face rendering */
1100
1100
  backFaceStencilOpStateIndex?: number;
1101
- /** Color blend attachement states */
1101
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
1102
1102
  blendStateIndices?: Array<number>;
1103
1103
  /** Cull mode */
1104
1104
  cullMode?: number;
@@ -1180,7 +1180,7 @@ export type AssetCreatableWithType = {
1180
1180
  pipelineDescription?: {
1181
1181
  /** Index of the stencil state for back face rendering */
1182
1182
  backFaceStencilOpStateIndex?: number;
1183
- /** Color blend attachement states */
1183
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
1184
1184
  blendStateIndices?: Array<number>;
1185
1185
  /** Cull mode */
1186
1186
  cullMode?: number;
@@ -1265,7 +1265,7 @@ export type AssetCreatableWithType = {
1265
1265
  pipelineDescription?: {
1266
1266
  /** Index of the stencil state for back face rendering */
1267
1267
  backFaceStencilOpStateIndex?: number;
1268
- /** Color blend attachement states */
1268
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
1269
1269
  blendStateIndices?: Array<number>;
1270
1270
  /** Cull mode */
1271
1271
  cullMode?: number;
@@ -2136,7 +2136,7 @@ export type AssetCreationFromDescription = ({
2136
2136
  pipelineDescription?: {
2137
2137
  /** Index of the stencil state for back face rendering */
2138
2138
  backFaceStencilOpStateIndex?: number;
2139
- /** Color blend attachement states */
2139
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
2140
2140
  blendStateIndices?: Array<number>;
2141
2141
  /** Cull mode */
2142
2142
  cullMode?: number;
@@ -2171,7 +2171,7 @@ export type AssetCreationFromDescription = ({
2171
2171
  pipelineDescription?: {
2172
2172
  /** Index of the stencil state for back face rendering */
2173
2173
  backFaceStencilOpStateIndex?: number;
2174
- /** Color blend attachement states */
2174
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
2175
2175
  blendStateIndices?: Array<number>;
2176
2176
  /** Cull mode */
2177
2177
  cullMode?: number;
@@ -2253,7 +2253,7 @@ export type AssetCreationFromDescription = ({
2253
2253
  pipelineDescription?: {
2254
2254
  /** Index of the stencil state for back face rendering */
2255
2255
  backFaceStencilOpStateIndex?: number;
2256
- /** Color blend attachement states */
2256
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
2257
2257
  blendStateIndices?: Array<number>;
2258
2258
  /** Cull mode */
2259
2259
  cullMode?: number;
@@ -2338,7 +2338,7 @@ export type AssetCreationFromDescription = ({
2338
2338
  pipelineDescription?: {
2339
2339
  /** Index of the stencil state for back face rendering */
2340
2340
  backFaceStencilOpStateIndex?: number;
2341
- /** Color blend attachement states */
2341
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
2342
2342
  blendStateIndices?: Array<number>;
2343
2343
  /** Cull mode */
2344
2344
  cullMode?: number;
@@ -2913,7 +2913,7 @@ export type DuplicationRequest = {
2913
2913
  /** How many times the request was leased */
2914
2914
  attempts: number;
2915
2915
  created_at: string;
2916
- /** 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. */
2917
2917
  depth: 'none' | 'all' | number;
2918
2918
  /** Duplication request unique identifier */
2919
2919
  duplication_request_id: string;
@@ -3851,7 +3851,7 @@ export type AssetDescription = {
3851
3851
  pipelineDescription?: {
3852
3852
  /** Index of the stencil state for back face rendering */
3853
3853
  backFaceStencilOpStateIndex?: number;
3854
- /** Color blend attachement states */
3854
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
3855
3855
  blendStateIndices?: Array<number>;
3856
3856
  /** Cull mode */
3857
3857
  cullMode?: number;
@@ -3886,7 +3886,7 @@ export type AssetDescription = {
3886
3886
  pipelineDescription?: {
3887
3887
  /** Index of the stencil state for back face rendering */
3888
3888
  backFaceStencilOpStateIndex?: number;
3889
- /** Color blend attachement states */
3889
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
3890
3890
  blendStateIndices?: Array<number>;
3891
3891
  /** Cull mode */
3892
3892
  cullMode?: number;
@@ -3968,7 +3968,7 @@ export type AssetDescription = {
3968
3968
  pipelineDescription?: {
3969
3969
  /** Index of the stencil state for back face rendering */
3970
3970
  backFaceStencilOpStateIndex?: number;
3971
- /** Color blend attachement states */
3971
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
3972
3972
  blendStateIndices?: Array<number>;
3973
3973
  /** Cull mode */
3974
3974
  cullMode?: number;
@@ -4053,7 +4053,7 @@ export type AssetDescription = {
4053
4053
  pipelineDescription?: {
4054
4054
  /** Index of the stencil state for back face rendering */
4055
4055
  backFaceStencilOpStateIndex?: number;
4056
- /** Color blend attachement states */
4056
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
4057
4057
  blendStateIndices?: Array<number>;
4058
4058
  /** Cull mode */
4059
4059
  cullMode?: number;
@@ -5028,7 +5028,7 @@ export type EditableAssetDescription = {
5028
5028
  pipelineDescription?: {
5029
5029
  /** Index of the stencil state for back face rendering */
5030
5030
  backFaceStencilOpStateIndex?: number;
5031
- /** Color blend attachement states */
5031
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
5032
5032
  blendStateIndices?: Array<number>;
5033
5033
  /** Cull mode */
5034
5034
  cullMode?: number;
@@ -5063,7 +5063,7 @@ export type EditableAssetDescription = {
5063
5063
  pipelineDescription?: {
5064
5064
  /** Index of the stencil state for back face rendering */
5065
5065
  backFaceStencilOpStateIndex?: number;
5066
- /** Color blend attachement states */
5066
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
5067
5067
  blendStateIndices?: Array<number>;
5068
5068
  /** Cull mode */
5069
5069
  cullMode?: number;
@@ -5145,7 +5145,7 @@ export type EditableAssetDescription = {
5145
5145
  pipelineDescription?: {
5146
5146
  /** Index of the stencil state for back face rendering */
5147
5147
  backFaceStencilOpStateIndex?: number;
5148
- /** Color blend attachement states */
5148
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
5149
5149
  blendStateIndices?: Array<number>;
5150
5150
  /** Cull mode */
5151
5151
  cullMode?: number;
@@ -5230,7 +5230,7 @@ export type EditableAssetDescription = {
5230
5230
  pipelineDescription?: {
5231
5231
  /** Index of the stencil state for back face rendering */
5232
5232
  backFaceStencilOpStateIndex?: number;
5233
- /** Color blend attachement states */
5233
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
5234
5234
  blendStateIndices?: Array<number>;
5235
5235
  /** Cull mode */
5236
5236
  cullMode?: number;
@@ -5749,27 +5749,47 @@ export type AssetDocument = {
5749
5749
  };
5750
5750
  };
5751
5751
  export type AssetContainerWithCode = 'animation_graphs' | 'animation_sequences' | 'modules' | 'scripts' | 'shaders';
5752
- /** 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`. */
5753
- export type AssetCode = {
5754
- /** The code: C++, built against the asset type's precompiled header, which it needs not include, or a shader's Slang, one file importing modules */
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
5755
  code: string;
5756
- /** Whether to build its debug library too, with its symbols, or a shader's debug payload, for the engine's developers */
5756
+ /** Whether to build its debug payload too, for the engine's developers */
5757
5757
  debug?: boolean;
5758
- /** The modules a shader imports, required for a shader, refused for another type: those they import come with them, and it can import nothing else */
5759
- modules?: Array<string>;
5760
- /** The shader context its push constant holds, required for a shader, refused for another type */
5761
- shader_context?: string;
5762
- };
5763
- export type AssetCodeInput = {
5764
- /** The code: C++, built against the asset type's precompiled header, which it needs not include, or a shader's Slang, one file importing modules */
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 */
5765
5766
  code: string;
5766
- /** Whether to build its debug library too, with its symbols, or a shader's debug payload, for the engine's developers */
5767
+ /** Whether to build its debug library too, with its symbols, for the engine's developers */
5767
5768
  debug?: boolean;
5768
- /** The modules a shader imports, required for a shader, refused for another type: those they import come with them, and it can import nothing else */
5769
- modules?: Array<string>;
5770
- /** The shader context its push constant holds, required for a shader, refused for another type */
5771
- shader_context?: string;
5772
- };
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 */
5786
+ code: string;
5787
+ /** Whether to build its debug library too, with its symbols, for the engine's developers */
5788
+ debug?: boolean;
5789
+ modules?: never;
5790
+ shader_context?: never;
5791
+ textures?: never;
5792
+ }>;
5773
5793
  /** The build of an asset's code, which replaced the asset's. */
5774
5794
  export type AssetCodeBuild = {
5775
5795
  /** Whether the asset's description changed, which a script's code tells */
@@ -7743,7 +7763,7 @@ export type AssetCreationFromDescriptionInput = ({
7743
7763
  pipelineDescription?: {
7744
7764
  /** Index of the stencil state for back face rendering */
7745
7765
  backFaceStencilOpStateIndex?: number;
7746
- /** Color blend attachement states */
7766
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
7747
7767
  blendStateIndices?: Array<number>;
7748
7768
  /** Cull mode */
7749
7769
  cullMode?: number;
@@ -7778,7 +7798,7 @@ export type AssetCreationFromDescriptionInput = ({
7778
7798
  pipelineDescription?: {
7779
7799
  /** Index of the stencil state for back face rendering */
7780
7800
  backFaceStencilOpStateIndex?: number;
7781
- /** Color blend attachement states */
7801
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
7782
7802
  blendStateIndices?: Array<number>;
7783
7803
  /** Cull mode */
7784
7804
  cullMode?: number;
@@ -7860,7 +7880,7 @@ export type AssetCreationFromDescriptionInput = ({
7860
7880
  pipelineDescription?: {
7861
7881
  /** Index of the stencil state for back face rendering */
7862
7882
  backFaceStencilOpStateIndex?: number;
7863
- /** Color blend attachement states */
7883
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
7864
7884
  blendStateIndices?: Array<number>;
7865
7885
  /** Cull mode */
7866
7886
  cullMode?: number;
@@ -7945,7 +7965,7 @@ export type AssetCreationFromDescriptionInput = ({
7945
7965
  pipelineDescription?: {
7946
7966
  /** Index of the stencil state for back face rendering */
7947
7967
  backFaceStencilOpStateIndex?: number;
7948
- /** Color blend attachement states */
7968
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
7949
7969
  blendStateIndices?: Array<number>;
7950
7970
  /** Cull mode */
7951
7971
  cullMode?: number;
@@ -8759,7 +8779,7 @@ export type EditableAssetDescriptionInput = {
8759
8779
  pipelineDescription?: {
8760
8780
  /** Index of the stencil state for back face rendering */
8761
8781
  backFaceStencilOpStateIndex?: number;
8762
- /** Color blend attachement states */
8782
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
8763
8783
  blendStateIndices?: Array<number>;
8764
8784
  /** Cull mode */
8765
8785
  cullMode?: number;
@@ -8794,7 +8814,7 @@ export type EditableAssetDescriptionInput = {
8794
8814
  pipelineDescription?: {
8795
8815
  /** Index of the stencil state for back face rendering */
8796
8816
  backFaceStencilOpStateIndex?: number;
8797
- /** Color blend attachement states */
8817
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
8798
8818
  blendStateIndices?: Array<number>;
8799
8819
  /** Cull mode */
8800
8820
  cullMode?: number;
@@ -8876,7 +8896,7 @@ export type EditableAssetDescriptionInput = {
8876
8896
  pipelineDescription?: {
8877
8897
  /** Index of the stencil state for back face rendering */
8878
8898
  backFaceStencilOpStateIndex?: number;
8879
- /** Color blend attachement states */
8899
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
8880
8900
  blendStateIndices?: Array<number>;
8881
8901
  /** Cull mode */
8882
8902
  cullMode?: number;
@@ -8961,7 +8981,7 @@ export type EditableAssetDescriptionInput = {
8961
8981
  pipelineDescription?: {
8962
8982
  /** Index of the stencil state for back face rendering */
8963
8983
  backFaceStencilOpStateIndex?: number;
8964
- /** Color blend attachement states */
8984
+ /** Color blend attachement states: an index in blendStateDescriptions per color attachment, -1 for none */
8965
8985
  blendStateIndices?: Array<number>;
8966
8986
  /** Cull mode */
8967
8987
  cullMode?: number;
@@ -11041,10 +11061,11 @@ export declare function getAssetCode({ asset_container_with_code, asset_id, }: {
11041
11061
  * Replaces the code of a script, animation sequence, animation graph or shader, once asset-compiler built it: code
11042
11062
  * which fails to build replaces nothing, and answers its diagnostics. A script, animation sequence or animation graph
11043
11063
  * is C++. A script's description is read from its code, and the answer tells whether it changed; the caller must be
11044
- * able to read the assets it references. A shader is one file of Slang, imported modules by name, naming no other file;
11045
- * it requires `modules`, those it imports, which come with those they import, and `shader_context`, the context its
11046
- * push constant holds, all of which the caller must be able to read. Its description is read from its code. The build
11047
- * takes a few seconds.
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.
11048
11069
  * @throws {InvalidParameter}
11049
11070
  * @throws {MissingAuthorizationHeader}
11050
11071
  * @throws {InvalidApiKey}
@@ -11054,17 +11075,11 @@ export declare function getAssetCode({ asset_container_with_code, asset_id, }: {
11054
11075
  * @throws {InsufficientPermissions}
11055
11076
  * @throws {TooManyRequests}
11056
11077
  */
11057
- export declare function replaceAssetCode({ asset_container_with_code, asset_id, code, debug, modules, shader_context, }: {
11078
+ export declare function replaceAssetCode({ asset_container_with_code, asset_id, asset_code, }: {
11058
11079
  asset_container_with_code: AssetContainerWithCode;
11059
11080
  asset_id: AssetId;
11060
- /** The code: C++, built against the asset type's precompiled header, which it needs not include, or a shader's Slang, one file importing modules */
11061
- code: string;
11062
- /** Whether to build its debug library too, with its symbols, or a shader's debug payload, for the engine's developers */
11063
- debug?: boolean;
11064
- /** The modules a shader imports, required for a shader, refused for another type: those they import come with them, and it can import nothing else */
11065
- modules?: Array<string>;
11066
- /** The shader context its push constant holds, required for a shader, refused for another type */
11067
- shader_context?: string;
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;
11068
11083
  }, headers?: RawAxiosRequestHeaders | AxiosRequestHeaders): AxiosPromise<AssetCodeBuild>;
11069
11084
  /**
11070
11085
  * Gets the asset thumbnail from the specified asset.
package/dist/index.js CHANGED
@@ -1279,20 +1279,12 @@ function getAssetCode({
1279
1279
  function replaceAssetCode({
1280
1280
  asset_container_with_code,
1281
1281
  asset_id,
1282
- code,
1283
- debug = false,
1284
- modules,
1285
- shader_context
1282
+ asset_code
1286
1283
  }, headers) {
1287
1284
  return axiosInstance({
1288
1285
  method: "put",
1289
1286
  url: "/assets/" + encodeURIComponent(asset_container_with_code) + "/" + encodeURIComponent(asset_id) + "/code",
1290
- data: {
1291
- code,
1292
- debug,
1293
- modules,
1294
- shader_context
1295
- },
1287
+ data: asset_code,
1296
1288
  headers
1297
1289
  });
1298
1290
  }