@3dverse/api 0.17.0 → 0.18.0

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: {
@@ -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: {
@@ -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: {
@@ -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: {
@@ -5743,16 +5751,24 @@ export type AssetDocument = {
5743
5751
  export type AssetContainerWithCode = 'animation_graphs' | 'animation_sequences' | 'modules' | 'scripts' | 'shaders';
5744
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`. */
5745
5753
  export type AssetCode = {
5746
- /** The C++ code, built against the asset type's precompiled header, which it needs not include */
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 */
5747
5755
  code: string;
5748
- /** Whether to build its debug library too, with its symbols, for the engine's developers */
5756
+ /** Whether to build its debug library too, with its symbols, or a shader's debug payload, for the engine's developers */
5749
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;
5750
5762
  };
5751
5763
  export type AssetCodeInput = {
5752
- /** The C++ code, built against the asset type's precompiled header, which it needs not include */
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 */
5753
5765
  code: string;
5754
- /** Whether to build its debug library too, with its symbols, for the engine's developers */
5766
+ /** Whether to build its debug library too, with its symbols, or a shader's debug payload, for the engine's developers */
5755
5767
  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;
5756
5772
  };
5757
5773
  /** The build of an asset's code, which replaced the asset's. */
5758
5774
  export type AssetCodeBuild = {
@@ -7636,6 +7652,8 @@ export type AssetCreationFromDescriptionInput = ({
7636
7652
  } | {
7637
7653
  /** Source code from a git repository that could be used in a shader, a script or in an algorithm */
7638
7654
  asset_description: {
7655
+ /** What built its payload, a compiler and its flags: a build stores the module again when this differs */
7656
+ builtWith?: string;
7639
7657
  /** The size in byte of the same built with its debug symbols: the optional `debug` payload, when built */
7640
7658
  debugPayloadSize?: number;
7641
7659
  functions: {
@@ -8654,6 +8672,8 @@ export type EditableAssetDescriptionInput = {
8654
8672
  /** The implemented shader */
8655
8673
  shaderRef: string;
8656
8674
  } | {
8675
+ /** What built its payload, a compiler and its flags: a build stores the module again when this differs */
8676
+ builtWith?: string;
8657
8677
  /** The size in byte of the same built with its debug symbols: the optional `debug` payload, when built */
8658
8678
  debugPayloadSize?: number;
8659
8679
  functions: {
@@ -11018,10 +11038,13 @@ export declare function getAssetCode({ asset_container_with_code, asset_id, }: {
11018
11038
  asset_id: AssetId;
11019
11039
  }, headers?: RawAxiosRequestHeaders | AxiosRequestHeaders): AxiosPromise<string>;
11020
11040
  /**
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.
11041
+ * Replaces the code of a script, animation sequence, animation graph or shader, once asset-compiler built it: code
11042
+ * which fails to build replaces nothing, and answers its diagnostics. A script, animation sequence or animation graph
11043
+ * 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.
11025
11048
  * @throws {InvalidParameter}
11026
11049
  * @throws {MissingAuthorizationHeader}
11027
11050
  * @throws {InvalidApiKey}
@@ -11031,13 +11054,17 @@ export declare function getAssetCode({ asset_container_with_code, asset_id, }: {
11031
11054
  * @throws {InsufficientPermissions}
11032
11055
  * @throws {TooManyRequests}
11033
11056
  */
11034
- export declare function replaceAssetCode({ asset_container_with_code, asset_id, code, debug, }: {
11057
+ export declare function replaceAssetCode({ asset_container_with_code, asset_id, code, debug, modules, shader_context, }: {
11035
11058
  asset_container_with_code: AssetContainerWithCode;
11036
11059
  asset_id: AssetId;
11037
- /** The C++ code, built against the asset type's precompiled header, which it needs not include */
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 */
11038
11061
  code: string;
11039
- /** Whether to build its debug library too, with its symbols, for the engine's developers */
11062
+ /** Whether to build its debug library too, with its symbols, or a shader's debug payload, for the engine's developers */
11040
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;
11041
11068
  }, headers?: RawAxiosRequestHeaders | AxiosRequestHeaders): AxiosPromise<AssetCodeBuild>;
11042
11069
  /**
11043
11070
  * Gets the asset thumbnail from the specified asset.
package/dist/index.js CHANGED
@@ -1280,14 +1280,18 @@ function replaceAssetCode({
1280
1280
  asset_container_with_code,
1281
1281
  asset_id,
1282
1282
  code,
1283
- debug = false
1283
+ debug = false,
1284
+ modules,
1285
+ shader_context
1284
1286
  }, headers) {
1285
1287
  return axiosInstance({
1286
1288
  method: "put",
1287
1289
  url: "/assets/" + encodeURIComponent(asset_container_with_code) + "/" + encodeURIComponent(asset_id) + "/code",
1288
1290
  data: {
1289
1291
  code,
1290
- debug
1292
+ debug,
1293
+ modules,
1294
+ shader_context
1291
1295
  },
1292
1296
  headers
1293
1297
  });