Crop PDF import

I’m trying to replace a file of a smart object, when I import the pdf I would like to pass as an option the use of the pdf mediabox, I tried this but it doesn’t work:

await action.batchPlay(
      [
        {
          _obj: "placedLayerReplaceContents",
          crop: {
              _enum: "cropTo",
              _value: "mediaBox"
          },
          null: {
            _path: fs.createSessionToken(file),
            _kind: 'local',
          },
        },
      ],
      {}
  );

I have recorded action and then copy javascript code, this is the solution:

await action.batchPlay(
            [
              {
                _obj: "placedLayerReplaceContents",
                crop: 3,
                null: {
                  _path: fs.createSessionToken(file),
                  _kind: 'local',
                },
              },
            ],
            {}
        );